chore: remove 20 dead packages and strip gh/aws vendor knowledge #284

Merged
coilysiren merged 2 commits from chore/remove-dead-packages into main 2026-08-14 02:24:31 +00:00
Member

Surface drops 52 packages to 32 across two commits. Refs #282, and splits #283 out of it.

1. Dead packages (17)

coily is deprecated, which retires the packages only it consumed, plus a second tier nothing reaches.

coily-only (9): cli/{decision,doctor,hook,hookcfg,profile,profiles,shim,sudo}, cmd/cli-guard-hook
no consumer (8): cli/{allowlist,catalog}, http/{ghidcache,ghratelimit,stscache}, pkg/{agentclaim,fleetconfig,workdir}

2. Vendor knowledge (3)

umbra is a policy-free engine; knowing a specific vendor's CLI is the consumer's job.

  • http/ghcache - GitHub response cache, plus passthrough.WithReadCache / ReadCacheClassifier, its only wiring. ward never used the option.
  • cli/awsgate - the arn:aws:iam:: denylist, the aws verb vocabulary (describe-/list-/ls/scan), and the aws-read gate. Contradicted AGENTS.md's "ships no embedded denylist" outright.
  • pkg/agentid - deprecated.

Also removed the only-reads when-qualifier, whose semantics were defined by aws verb naming. No live guardfile in AOS or ward used gate, aws-read or only-reads; gateRegistry now ships empty and every gate name fails closed until a consumer registers one.

globMatch and positionals were lifted out of awsgate into cli/execverb as unexported helpers - they are generic and load-bearing for the any-arg / argN selectors AOS guardfiles use.

Corrections to the #282 audit

The census was rebuilt from reverse imports rather than taken from the issue, and diverged both ways. Four packages #282 implicated are live and were kept:

package why it stayed
http/ghcache called the "strongest removal candidate", but cli/passthrough imports it and ward imports that
http/specgen/embedfile unreachable per go list, but emitted by the codegen template - all eight generated AOS CLIs import it
pkg/stepflow listed as having no consumer; cli/execverb and http/specverb both import it
pkg/agentid correctly flagged as a false positive at the time (removed here only because it is now deprecated)

Conversely cli/allowlist and cli/catalog were dead and were not on the issue's list at all.

One more correction: #282 says AOS "ships zero cli-guard at runtime". True of the AOS repo, but the binaries specgen generates link 8 umbra packages - cli/execverb, cli/verb, http/guardfile, http/specverb, http/specgen/embedfile, pkg/audit, pkg/config, pkg/valuesource. That matters for the module-path rename: every guardfile needs regenerating when the path changes.

Verification

Full gate green - make build, vet, tidy, test, lint (0 issues). Beyond that, all three consumer contracts were checked directly:

  • ward builds against this tree via a replace
  • mcp-beaver builds against this tree
  • AOS - all eight guardfiles render, and specgen output is byte-identical to a binary built from pristine main

go.mod drops golang.org/x/term (was cli/sudo's tty prompt).

Not in this PR

  • The module path is still .../cli-guard. The repo is renamed but go.mod is not. That is a breaking change for all three consumers' pins and wants its own PR.
  • specgen still generates AWS SDK code - the HasSSM branch is live (AOS's actions.kdl and forgejo.kdl use value ssm), so it needs a replacement rather than a deletion. Filed as #283.
  • One aws-shaped table survives, marked TODO(#282) in cli/execverb/argv.go. positionals strips value-taking flags using aws's global-flag list. Dropping it silently weakens a live guard: with aws s3 ls --region us-east-1 s3://my-tfstate, losing the strip makes arg0 resolve to us-east-1 and AOS's deny-when arg0 matches *tfstate* fails open. Fix belongs in the guardfile, covered by #283.

Docs

Deleted four orphaned docs (deny-by-structure.md, profiles.md, fleetconfig.md, agent-claim.md), re-anchored architecture.md's config/permission partition on pkg/config, and rewrote AGENTS.md's Safety section to describe the two guarded surfaces instead of the retired engine. godoc-current.txt regenerated.

Surface drops **52 packages to 32** across two commits. Refs #282, and splits #283 out of it. ## 1. Dead packages (17) coily is deprecated, which retires the packages only it consumed, plus a second tier nothing reaches. **coily-only (9):** `cli/{decision,doctor,hook,hookcfg,profile,profiles,shim,sudo}`, `cmd/cli-guard-hook` **no consumer (8):** `cli/{allowlist,catalog}`, `http/{ghidcache,ghratelimit,stscache}`, `pkg/{agentclaim,fleetconfig,workdir}` ## 2. Vendor knowledge (3) umbra is a policy-free engine; knowing a specific vendor's CLI is the consumer's job. - **`http/ghcache`** - GitHub response cache, plus `passthrough.WithReadCache` / `ReadCacheClassifier`, its only wiring. ward never used the option. - **`cli/awsgate`** - the `arn:aws:iam::` denylist, the aws verb vocabulary (`describe-`/`list-`/`ls`/`scan`), and the `aws-read` gate. Contradicted AGENTS.md's "ships no embedded denylist" outright. - **`pkg/agentid`** - deprecated. Also removed the `only-reads` when-qualifier, whose semantics were defined by aws verb naming. No live guardfile in AOS or ward used `gate`, `aws-read` or `only-reads`; `gateRegistry` now ships empty and every gate name fails closed until a consumer registers one. `globMatch` and `positionals` were lifted out of awsgate into `cli/execverb` as unexported helpers - they are generic and load-bearing for the `any-arg` / `argN` selectors AOS guardfiles use. ## Corrections to the #282 audit The census was rebuilt from reverse imports rather than taken from the issue, and diverged both ways. Four packages #282 implicated are **live and were kept**: | package | why it stayed | | --- | --- | | `http/ghcache` | called the "strongest removal candidate", but `cli/passthrough` imports it and ward imports that | | `http/specgen/embedfile` | unreachable per `go list`, but emitted by the codegen template - all eight generated AOS CLIs import it | | `pkg/stepflow` | listed as having no consumer; `cli/execverb` and `http/specverb` both import it | | `pkg/agentid` | correctly flagged as a false positive at the time (removed here only because it is now deprecated) | Conversely `cli/allowlist` and `cli/catalog` were dead and were not on the issue's list at all. One more correction: #282 says AOS "ships zero cli-guard at runtime". True of the AOS repo, but the binaries specgen **generates** link 8 umbra packages - `cli/execverb`, `cli/verb`, `http/guardfile`, `http/specverb`, `http/specgen/embedfile`, `pkg/audit`, `pkg/config`, `pkg/valuesource`. That matters for the module-path rename: every guardfile needs regenerating when the path changes. ## Verification Full gate green - `make build`, `vet`, `tidy`, `test`, `lint` (0 issues). Beyond that, all three consumer contracts were checked directly: - **ward** builds against this tree via a `replace` - **mcp-beaver** builds against this tree - **AOS** - all eight guardfiles render, and `specgen` output is **byte-identical** to a binary built from pristine `main` `go.mod` drops `golang.org/x/term` (was `cli/sudo`'s tty prompt). ## Not in this PR - **The module path is still `.../cli-guard`.** The repo is renamed but `go.mod` is not. That is a breaking change for all three consumers' pins and wants its own PR. - **specgen still generates AWS SDK code** - the `HasSSM` branch is live (AOS's `actions.kdl` and `forgejo.kdl` use `value ssm`), so it needs a replacement rather than a deletion. Filed as #283. - **One aws-shaped table survives, marked `TODO(#282)`** in `cli/execverb/argv.go`. `positionals` strips value-taking flags using aws's global-flag list. Dropping it silently weakens a live guard: with `aws s3 ls --region us-east-1 s3://my-tfstate`, losing the strip makes `arg0` resolve to `us-east-1` and AOS's `deny-when arg0 matches *tfstate*` fails open. Fix belongs in the guardfile, covered by #283. ## Docs Deleted four orphaned docs (`deny-by-structure.md`, `profiles.md`, `fleetconfig.md`, `agent-claim.md`), re-anchored `architecture.md`'s config/permission partition on `pkg/config`, and rewrote AGENTS.md's Safety section to describe the two guarded surfaces instead of the retired engine. `godoc-current.txt` regenerated.
Surface drops from 52 packages to 35 (cli 18->8, http 10->7, pkg 21->18,
cmd 3->2). coily is deprecated, which retires the packages that only it
consumed, plus a second tier that no consumer reaches.

Removed, coily-only:
  cli/decision cli/doctor cli/hook cli/hookcfg cli/profile
  cli/profiles cli/shim cli/sudo cmd/cli-guard-hook

Removed, no consumer:
  cli/allowlist cli/catalog http/ghidcache http/ghratelimit
  http/stscache pkg/agentclaim pkg/fleetconfig pkg/workdir

Kept, against the audit in #282, because each is live:
  pkg/agentid       cross-language contract with agentic_os/agent_id.py
  http/ghcache      reachable from ward via cli/passthrough
  specgen/embedfile emitted by the codegen template, invisible to go list
  pkg/stepflow      imported by cli/execverb and http/specverb

Verified: ward and mcp-beaver both build against this tree, and specgen
renders all eight AOS guardfiles byte-identically to main. go.mod drops
golang.org/x/term (was cli/sudo's tty prompt).

Docs follow the code: deleted deny-by-structure.md, profiles.md,
fleetconfig.md and agent-claim.md; re-anchored architecture.md's
config/permission partition on pkg/config; AGENTS.md Safety now
describes the two guarded surfaces rather than the retired engine.

Refs #282

Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
chore: strip vendor knowledge - gh, aws, and the deprecated agentid
All checks were successful
ci / test (pull_request) Successful in 41s
ci / secrets (pull_request) Successful in 7s
ci / lint (pull_request) Successful in 26s
c0e6fc615e
umbra is a policy-free engine; knowing a specific vendor's CLI is the
consumer's job. Surface drops 35 -> 32.

Removed:
  http/ghcache      GitHub response cache, plus passthrough.WithReadCache
                    and ReadCacheClassifier, its only wiring. ward never
                    used the option.
  cli/awsgate       AWS sensitive-read denial: the arn:aws:iam:: denylist,
                    the aws verb vocabulary (describe-/list-/ls/scan), and
                    the `aws-read` gate. Contradicted "ships no embedded
                    denylist" outright.
  pkg/agentid       deprecated. AOS's drift test compares its Python module
                    against committed vectors and never invoked the Go port,
                    so AOS CI is unaffected.

Also gone: the `only-reads` when-qualifier, whose semantics were defined by
aws verb naming. No live guardfile in AOS or ward used `gate`, `aws-read`
or `only-reads`; gateRegistry now ships empty and every gate name fails
closed until a consumer registers one.

Kept as unexported helpers in cli/execverb (generic, and load-bearing for
the `any-arg` / `argN` selectors AOS guardfiles use): globMatch and
positionals, lifted out of awsgate.

Verified: ward and mcp-beaver build against this tree, and specgen renders
all eight AOS guardfiles byte-identically to before the removal.

Refs #282

Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-flight-deck/umbra!284
No description provided.