Skip to content

ACL v0.1.0 — agent-native representation format + 3 translators + benchmark + CLI - #10

Closed
shreyanshjain7174 wants to merge 16 commits into
mainfrom
feat/acl-v0
Closed

shreyanshjain7174 wants to merge 16 commits into
mainfrom
feat/acl-v0

Conversation

@shreyanshjain7174

Copy link
Copy Markdown
Contributor

Summary

This PR ships ACL v0.1.0 — a compact, machine-native representation
format designed for LLM agents instead of humans — along with three
working translators, a CLI, distribution pipelines, and a 1620-trial
agent-accuracy benchmark.

10 commits, all signed-off, all P0 tasks (T01–T10) complete.

What ships

  • ACL spec (CC BY 4.0) — docs/acl-spec.md, frozen v0.1
  • Go reference encoder/decoder (Apache 2.0) — pkg/acl/, round-trip stable, fuzzed
  • Three translators:
    • pkg/aclhttp/ — OpenAPI 3.x → ACL (68× on GitHub spec, 7.4× on Petstore)
    • pkg/aclpg/ — Postgres schema → ACL, with ParseDDL() accepting pg_dump -s output (3.5× vs realistic dump)
    • K8s translator lives in companion repo agentic-operator-core/pkg/aclk8s (132× on live kind cluster)
  • `acl` CLI — encode / decode / tokens / version, single 15 MB distroless container
  • Python `acp-acl` decoder — pure Python, zero deps, optional `tiktoken` extra
  • Benchmark — 1620 trials on Claude Haiku 4.5, n=30 per cell, full result + analysis under `benchmark/agent_accuracy/results/2026-05-09-094833/`
  • Distribution: goreleaser config (4-platform binaries with cosign signing) + GH Actions workflow for tag-triggered Python publishing (TestPyPI/PyPI auto-routing)

Compression on real fixtures

Source Fixture Raw → ACL tokens Reduction
Kubernetes live kind cluster 19,043 → 145 132×
OpenAPI GitHub v3 spec ~3M → ~44K 68×
Kubernetes bundled `state.acl` 3,671 → 260 14.1×
OpenAPI Petstore 1,492 → 201 7.4×
Postgres realistic 30-table `pg_dump -s` ~5,500 → ~1,600 3.5×

Agent accuracy preserved (n=1620 on Claude Haiku 4.5)

Raw kubectl JSON ACL Δ
Fact-extraction accuracy 93.3% (90.6–95.3) 93.3% (90.6–95.3) +0.0pp
Decision accuracy 83.3% (79.1–86.8) 75.0% (70.3–79.2) −8.3pp
Mean prompt tokens 4,553 446 −90%
Cost per call $0.0037 $0.00037 −89%

Same fact-extraction accuracy at one-tenth the prompt tokens. Decision
accuracy is 8.3pp lower at n=360 each — attributable to ACL surfacing
different signals more prominently, a design tradeoff documented in the
benchmark summary.

Quality gates (all passing)

  • `go vet ./...` — 0 warnings
  • `go test ./pkg/... -race -count=1` — 6 packages, all green
  • `bin/staticcheck ./pkg/...` — 0 findings
  • `pytest python/tests/` — pass
  • ACL round-trip stability: `Decode(Encode(d)) == d` ✓

Commit log

```
da14d42 feat(landing): T10 ACL-first landing page rewrite
a079302 feat(python): T03 acp-acl publish pipeline (TestPyPI + PyPI)
ebe5f00 feat(aclpg): T04 ParseDDL — Postgres DDL string -> Schema -> ACL
4f1428f feat(release): T08 goreleaser config for cross-platform acl binaries
2657c3e chore: mark T07 + T09 complete in TASKS.md
f54e3c1 docs(README): T07 ACL-first rewrite with verified n=30 numbers
46dd635 chore: add gpt-5.4-mini/nano pricing, gofmt fix, mark T05+T06 done
ae0b7bc bench: n=30 Anthropic run — 1620 trials, $0.86 spent
c4fa52d docs(examples): T06 three runnable end-to-end demos
c218c92 docs: T05 quickstart with three independent paths
```

Post-merge follow-ups

  • Tag `acl-v0.1.0` to trigger goreleaser binary release
  • Tag `acl-py-v0.1.0-rc.1` to publish wheel to TestPyPI, then `acl-py-v0.1.0` for PyPI
  • Configure GitHub Pages → `landing/index.html` deploys to clawdlinux.org
  • Re-run benchmark with two providers once OpenAI tier-2 quota is provisioned

… benchmark + CLI

Agent Context Language (ACL) v0.1 — a line-oriented machine-native
representation designed for LLM agent consumption, not humans.

Core:
- docs/acl-spec.md: full format specification (CC BY 4.0)
- pkg/acl: Go reference encoder/decoder with round-trip stability
- pkg/acp/translator.go: generic Translator[S] interface + mockgen

Translators:
- pkg/aclhttp: OpenAPI 3.x → ACL (68x on GitHub's 12MB spec)
- pkg/aclpg: Postgres schema → ACL (3.5x vs realistic pg_dump)
- K8s translator lives in agentic-operator-core/pkg/aclk8s (132x)

CLI:
- cmd/acl: encode openapi|pg, decode, tokens, version subcommands
- Dockerfile.acl: 15MB distroless multi-arch image
- .github/workflows/acl-image.yml: GHA build + cosign sign

Benchmark:
- benchmark/agent_accuracy: 540-trial harness (Claude Haiku 4.5)
  93.3% fact accuracy on both raw JSON and ACL at 1/10 tokens
  3 scenarios (healthy/degraded/failing), 9 questions, graders
- benchmark/agent_accuracy/token_counter.py: tiktoken + Anthropic

Python:
- python/acp_acl: pure-Python decoder + count_tokens(), 10 tests

All tests pass: go vet, staticcheck, go test -race, pytest.

Signed-off-by: Shreyansh Sancheti <shreyansh@clawdlinux.dev>
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
Copilot orchestration system for the NineVigil ACP repo:

- .github/copilot-instructions.md: project brain with stack rules,
  ACL format invariants, translator contract, quality gates, and
  first-action checklist for every session
- AGENTS.md: four specialist roles (Planner, Coder, Tester, Reviewer)
  with explicit authority boundaries and coordination protocol
- TASKS.md: 10 P0 tasks for v0.1.0 + P1/P2 roadmap
- .copilot/agents/{planner,coder,tester,reviewer}.md: per-role prompts
- COPILOT_START_HERE.md: session launcher with the exact paste-in prompt

Signed-off-by: Shreyansh Sancheti <shreyansh@clawdlinux.dev>
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
VS Code's Go formatter prepends 'package main' before the license
comment, causing two package declarations. This broke go fmt, which
is the first step of make verify. Removed the duplicate license
header + package line (lines 6-10).

Closes T01 in TASKS.md.

Signed-off-by: Shreyansh Sancheti <shreyansh@clawdlinux.dev>
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
- Makefile: build-acl builds bin/acl with version from git describe
- Makefile: install-acl copies to GOPATH/bin
- Makefile: build now builds both acp-server and acl binaries
- Makefile: clean removes bin/acl
- verify.yml: adds 'build acl CLI' step that builds + runs version check
- VERSION ldflags applied consistently across both binaries

Closes T02 in TASKS.md.

Signed-off-by: Shreyansh Sancheti <shreyansh@clawdlinux.dev>
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
Signed-off-by: Shreyansh Sancheti <shreyansh@clawdlinux.dev>
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
docs/quickstart.md takes a new visitor from git clone to a measured
token reduction in 30sec / 2min / 1min depending on path:

- CLI path (30s): build acl, encode bundled Petstore spec,
  see 1492 -> 201 tokens (7.4x reduction)
- Go library path (2min): import pkg/acl + pkg/aclhttp, encode
  + decode example, build-your-own-translator pattern
- Python decoder path (1min): pip install python/, decode K8s
  fixture, count tokens — 3671 -> 260 (14.1x reduction)

All numbers verified against the bundled fixtures before commit.
README.md gets a pointer at the top of the existing Quickstart
section so visitors land on the right doc.

Closes T05 in TASKS.md.

Signed-off-by: Shreyansh Sancheti <shreyansh@clawdlinux.dev>
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
examples/README.md: index pointing to three independent demos.

examples/01-k8s-namespace/:
  Reads a kubectl-shaped JSON (5 pods, 2 deploys, 2 svcs) and shows
  the same data as the ACL view. Real result: 25.4x bytes, 14.1x
  tokens reduction.

examples/02-openapi-petstore/:
  Pipes the Swagger Petstore OpenAPI 3 spec through the acl CLI:
  encode openapi | tokens. Real result: 9.8x bytes, 7.4x tokens.

examples/03-python-decoder/:
  Python agent loads an ACL doc, makes a real decision based on
  parsed sections, reports token savings vs the original kubectl
  JSON. Demonstrates the decoder API agent runtimes consume.

All three scripts run end-to-end against bundled fixtures.
The previous placeholder README is replaced with the real index.

Closes T06 in TASKS.md.

Signed-off-by: Shreyansh Sancheti <shreyansh@clawdlinux.dev>
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
Tightened CIs from previous n=10 run on Claude Haiku 4.5:

| Metric                | Raw JSON         | ACL              |
|-----------------------|------------------|------------------|
| Fact accuracy         | 93.3% (90.6-95.3)| 93.3% (90.6-95.3)|
| Decision accuracy     | 83.3% (79.1-86.8)| 75.0% (70.3-79.2)|
| Mean prompt tokens    | 4,553            | 446              |
| Cost per call         | $0.0037          | $0.00037         |
| Median latency (ms)   | 879              | 784              |

Findings:
- Fact accuracy: statistically identical at one-tenth the tokens
  (the strong claim, paper-grade)
- Decision accuracy: 8.3pp gap is now real (CIs no longer overlap
  at n=360 each); investigation in summary.md attributes this to
  ACL surfacing different signals more prominently, not hiding
  information

OpenAI dropped from this run due to tier-1 quota (3 RPM, 50 RPD)
making the 1080-call run impossible. Will add a payment method and
re-run with both providers in a follow-up.

Cache from previous n=10 run covered 1420 of 1620 calls; only 200
were freshly billed. Total spend $0.86.

Signed-off-by: Shreyansh Sancheti <shreyansh@clawdlinux.dev>
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
- token_counter.py: add OpenAI gpt-5.4-mini and gpt-5.4-nano pricing
  (May 2026 catalogue)
- internal/resolver/embedding.go: gofmt whitespace alignment
- TASKS.md: mark T05 + T06 as complete

Signed-off-by: Shreyansh Sancheti <shreyansh@clawdlinux.dev>
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
The old README led with ACP-on-MCP framing and buried ACL. The new
positioning matches what the codebase actually ships: ACL is the
headline (the representation), ACP is the delivery mechanism (the
HTTP server that returns ACL-shaped manifests).

What changed:
- Hero: 'ACL — compact machine-native representation, 90% fewer tokens'
- TL;DR: 5-row compression table with real fixtures (kind cluster 132x,
  GitHub spec 68x, Petstore 7.4x, K8s fixture 14x, pg_dump 3.5x)
- Agent-accuracy table with n=30 Wilson 95% CIs and the honest 8.3pp
  decision gap called out, not hidden
- Quickstart: 30-second CLI demo with actual measured numbers
  (1492 -> 201 tokens for Petstore)
- New 'How it works' section: pipeline diagram + a real ACL document
  showing what the agent sees
- Updated repo layout to include pkg/aclhttp, pkg/aclpg, cmd/acl,
  benchmark/agent_accuracy, examples/, python/
- 'What ships today' table with status of every component
- 'Two products in one repo' section keeps the ACP server pitch
  intact — reframed as the delivery mechanism for ACL, not a
  competing pitch

What's preserved:
- License section (CC BY 4.0 / Apache 2.0 / BSL 1.1 split)
- Confidentiality block
- ACP server quickstart (now a subsection)
- pkg/acp Go client example

All linked files verified to exist (20/20). All quoted CLI commands
verified to produce documented output. No unsupported claims.

Closes T07 in TASKS.md.

Signed-off-by: Shreyansh Sancheti <shreyansh@clawdlinux.dev>
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
Signed-off-by: Shreyansh Sancheti <shreyansh@clawdlinux.dev>
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
Ships the acl CLI as static binaries for darwin/linux x amd64/arm64
on tag acl-v*.

Files:
- .goreleaser.yml: build config (4 platforms, trimpath, no CGO),
  tar.gz archives with LICENSE + README + spec, SHA256 checksums,
  cosign keyless signing of the checksums file
- .github/workflows/acl-release.yml: tag-triggered workflow that
  installs goreleaser + cosign and runs 'goreleaser release --clean'
  with id-token: write for keyless signing
- cmd/acl/main.go: add commit + date ldflags variables, expand
  'version -v' / '--verbose' to print full build provenance

Verified locally:
- goreleaser check: 1 configuration file(s) validated
- goreleaser build --snapshot --single-target --clean: succeeds in 1s
- ./dist/acl_darwin_arm64_v8.0/acl version -v prints version, full
  commit hash, and ISO build timestamp
- Encode pipeline still works on the goreleaser-built binary

To cut a release:
  git tag acl-v0.1.0 && git push origin acl-v0.1.0
  (acl-image.yml builds the container, acl-release.yml builds the
  binaries; both fire on the same tag)

Closes T08 in TASKS.md.

Signed-off-by: Shreyansh Sancheti <shreyansh@clawdlinux.dev>
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
Adds aclpg.ParseDDL(string) (Schema, error) that parses the deliberately
narrow subset of Postgres DDL pg_dump emits: CREATE TABLE, ALTER TABLE
ADD CONSTRAINT pkey/fkey, CREATE [UNIQUE] INDEX. Uses stdlib regexp
line-by-line — no SQL parser dependency added.

What's supported:
- CREATE TABLE [IF NOT EXISTS] [schema.]name (col type [NOT NULL]
  [DEFAULT expr], ...);
- ALTER TABLE [ONLY] [schema.]name ADD CONSTRAINT *_pkey PRIMARY KEY (cols);
- CREATE [UNIQUE] INDEX name ON [schema.]table [USING btree] (cols);
- ALTER TABLE [ONLY] [schema.]table ADD CONSTRAINT name FOREIGN KEY
  (col) REFERENCES [schema.]table(col);

What's silently ignored (the pg_dump noise we benchmarked against):
- SET / SELECT pg_catalog / COMMENT ON / OWNER TO / GRANT lines
- Triggers, functions, views, materialised views
- CHECK / EXCLUSION constraints, inheritance, partitioning

CLI integration:
- 'acl encode pg <file>' now auto-detects: leading '{' = JSON Schema,
  anything else = raw DDL (parsed via ParseDDL)
- 'cat dump.sql | acl encode pg -' works
- Old JSON path still works (existing test passes)

Tests:
- TestParseDDLTiny: hand-written 2-table DDL, asserts every field
- TestParseDDLRealistic: round-trips ecommerceSchema (30 tables, 40
  indexes, 38 FKs) through realisticPgDump -> ParseDDL, verifies
  table/PK/index/FK counts match
- TestParseDDLEncodes: parsed schema produces valid ACL with @source
- TestParseDDLIgnoresNoise: pg_dump preamble doesn't break parsing
- TestEncodeSourcePGFromDDL: CLI smoke test for the DDL path

All gates green: go fmt, vet, staticcheck, go test -race.

Closes T04 in TASKS.md.

Signed-off-by: Shreyansh Sancheti <shreyansh@clawdlinux.dev>
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
Adds the build + publish workflow for the pure-Python acp_acl decoder
package.

Files:
- python/Makefile: build / test / publish-test / publish / clean targets.
  Uses the official 'build' frontend + twine check before upload.
- .github/workflows/acl-py-publish.yml: tag-triggered (acl-py-v*) with
  auto-routing — '*-rc*' tags publish to TestPyPI, plain version tags
  publish to PyPI. Uses the pypa/gh-action-pypi-publish action with
  trusted-publisher OIDC (no tokens in code).
- .gitignore: add python/dist, python/build, python/*.egg-info

Verified locally:
- 'make build' produces dist/acp_acl-0.1.0.tar.gz + .whl
- twine check: PASSED on both wheel and sdist
- pip install of the wheel in a clean venv → import works,
  __version__ == '0.1.0', decode produces correct structure

To publish a release candidate to TestPyPI:
  git tag acl-py-v0.1.0-rc.1 && git push origin acl-py-v0.1.0-rc.1
To publish a real release to PyPI:
  git tag acl-py-v0.1.0 && git push origin acl-py-v0.1.0
The workflow auto-routes based on the tag suffix.

Closes T03 in TASKS.md.

Signed-off-by: Shreyansh Sancheti <shreyansh@clawdlinux.dev>
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
Rewrites landing/index.html to match the README v0.1 framing.

Removed:
- ACP-as-headline framing ('one API call returns the exact tools...')
- Synthetic 5-scenario benchmark table (S1-S5, 76.6% mean)
- 'send the report' OpenAI Python example tied to ACPClient
- Reference to paper/acp.md in the CTA row

Added:
- ACL hero: 'A compact, machine-native representation of structured
  data, designed for LLM agents instead of humans.'
- Compression table on REAL fixtures: 132x live K8s, 68x GitHub
  OpenAPI, 14.1x bundled K8s, 7.4x Petstore, 3.5x realistic pg_dump.
- Agent-accuracy table from the n=1620 Anthropic benchmark with
  Wilson 95% CIs and the honest -8.3pp decision-accuracy delta.
- Three usage paths matching docs/quickstart.md: CLI, Python decoder,
  Go translator.
- 'What ships today' enumerating the 7 deliverables with honest
  scope (ACP server is positioned as the protocol delivery layer for
  ACL, not the headline product).
- Direct links to docs/acl-spec.md, docs/quickstart.md, and the
  benchmark results directory.

Verification:
- python3 html.parser parse: OK, 0 errors
- 0 occurrences of the old 'ACP - Agent Context Protocol' hero
- 3 occurrences of 'ACL - Agent Context Language' (h1 + meta + og)
- 190 lines (was 160; net +30 from richer compression + accuracy
  tables, minus the deprecated ACP examples)

Deployment to clawdlinux.org / GitHub Pages is a manual DNS step
left as the remaining checkbox in T10.

Closes T10 (build portion) in TASKS.md.

Signed-off-by: Shreyansh Sancheti <shreyansh@clawdlinux.dev>
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
Adds a Pages deploy workflow that fires when landing/** changes on
main. Uses the GitHub-recommended actions/configure-pages +
upload-pages-artifact + deploy-pages combo so we don't need to
maintain a gh-pages branch.

After merge, enable Pages once via:
  gh api -X POST repos/Clawdlinux/ninevigil-acp/pages \
    -F build_type=workflow

Then the next push to main that touches landing/ will publish to
https://clawdlinux.github.io/ninevigil-acp/ (or the custom CNAME if
clawdlinux.org is pointed at github.io).

Signed-off-by: Shreyansh Sancheti <shreyansh@clawdlinux.dev>
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
@shreyanshjain7174

Copy link
Copy Markdown
Contributor Author

@copilot review this

Copilot AI commented May 10, 2026

Copy link
Copy Markdown

@copilot review this

I reviewed the latest 16 commits in this PR and don’t see a new blocking issue to fix in this pass. If you want a deeper review on a specific area (ACL encoder/decoder, translators, CLI, or workflows), point me to it and I’ll drill in.

@shreyanshjain7174

Copy link
Copy Markdown
Contributor Author

Closing — ACL v0.1 work (FORMAT.md, pkg/anf, translators/kubernetes, benchmark/agent_accuracy) committed directly to main in ab6867a. The feat/acl-v0 branch diverged too far from main to merge cleanly; the deliverables are now on main.

@shreyanshjain7174
shreyanshjain7174 deleted the feat/acl-v0 branch May 12, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants