Skip to content

Refactor: Take the top level to seven directories and rename authlib to core - #1142

Merged
huang195 merged 17 commits into
rossoctl:mainfrom
huang195:refactor/repo-layout
Sep 26, 2026
Merged

huang195 merged 17 commits into
rossoctl:mainfrom
huang195:refactor/repo-layout

Conversation

@huang195

@huang195 huang195 commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

What

The flatten (#1134) removed the vestigial authbridge/ level. That fixed the depth and exposed two things it had been hiding: the root did not describe the product, and the library's name was wrong on two axes at once.

This takes the top level from 10 directories to 7, renames authlib to core, and renames nine packages inside it to say what they do. No published contract changes.

cmd/  core/  demos/  deploy/  docs/  scripts/  tests/

authlib was not merely stale — it was 1.6% auth

Measured on this branch, non-test lines under core/ (53,323 total):

Theme Packages Lines Share
Framework pipeline, plugins, listener, config, spiffe 30,485 57.1%
Cost cost/* 11,288 21.1%
Observability session, sessionapi, observe, redact 5,368 10.0%
Auth auth, bypass, capabilities 882 1.6%

The docs compounded it. They called it "the shared auth library" and enumerated it as "validation, exchange, cache, bypass, spiffe, routing, auth, config…" — the 1.6% listed first, the 57% omitted. core/README.md named 11 of its 25 packages, leaving out the entire cost group and listener, which between them are most of the module.

And it claimed, twice, "no protocol dependencies (no gRPC, no Envoy)". That stopped being true when the listeners moved in: listener/extproc is an Envoy ext_proc gRPC server, and core has 20 direct dependencies including google.golang.org/grpc, envoyproxy/go-control-plane, OPA, OpenTelemetry and CPEX. The README's dependency list named three of the twenty. No gate can catch a doc that lies; it took reading it against go.mod.

Read it in commit order

Commit What
e1c25cc4 deploy/ — proxy-init, sparc-service, lineage-attach grouped. Contexts moved; image name: values untouched.
a43090c0 scripts/dev/ — the three loose shell scripts consolidated.
bd649fdf Ten relative links retargeted — deploy/ fallout that no diff could show.
2254a937 authlib → core — module path, ~850 imports over ~393 files, 7 replace directives.
82bfc597 Migration script made reproducible — as committed it wasn't.
84f2dc8b storage/redis → core/storage/redis — beside the interface it implements.
5b0cff2e Nine package renames.
59188424 gofmt ordering the rename disturbed.
7239a663 Seven godoc headers + seven filenames the renames stranded.
bfae6a7a Prose rewritten, migration script retired, spec marked implemented.
1aa53d93 A broken make target plus the last two invisible shapes, found by the final review.

Plus the two doc commits carrying the design spec and the plan.

Six planned commits, eleven as shipped. The five extra are each fallout that earned its own reviewable boundary rather than being buried in the commit that caused it. That the fallout nearly matched the planned work commit-for-commit is the honest measure of how much of this change was invisible to the sweep performing it.

The nine renames

From To Why (from the package's own doc comment)
shared memstore "a generic, process-scoped, TTL key→value store… intentionally semantics-free" — and it now contrasts with storage, the cross-pod persistent one
runtimeutil bootstrap "process-level helpers shared by the binaries… logging setup, the SIGUSR1 toggle, the health and stats servers" — startup, not a "util"
contracts capabilities "defines capability interfaces that protocol extensions implement"
tls tlsconfig builds *crypto/tls.Config values. tlsbridge forges certificates. Two unrelated jobs, near-identical names
pricing costing costledger costevent usage cost/{pricing,settle,ledger,event,usage} five siblings on one subject. costing → settle because it "turns one response's facts into one settled cost"

core/'s top-level package count drops 29 → 25. placeholder and praxis were deliberately not renamed: placeholder is accurately named and tied to the abph_ wire prefix, which cannot change; praxis is an external product's name.

Eleven classes of reference a substitution sweep cannot see

The design spec anticipated one — the bare-name-without-trailing-slash class that cost #1134 sixteen broken spellings. Implementation found eleven. Each was caught by building or measuring, not by grepping for what I expected. The last two were found by the whole-branch review, after I thought the branch was finished, and one of them was the only functional break in it.

  1. Relative markdown links whose text never changes. Ten of them, in four READMEs that moved one level deeper. A diff shows nothing; only the ground beneath the file moved. A blanket ../ → ../../ would have broken deploy/sparc-service/deploy/README.md's ../README.md, which points at its own parent and already resolved — so the fix had to be per-link.

  2. Wildcard-free git pathspecs match at the root only. The migration script's 'Dockerfile*' and 'Makefile' each covered exactly one file, hiding 4 nested Dockerfiles with COPY authlib/ authlib/ and 2 nested Makefiles. '*.py' was absent entirely — the same omission that made pytest fail at collection in Refactor: Flatten authbridge/ into the repo root #1134.

  3. A starred regex group keeps only its last repetition. s|=> \(\.\./\)*authlib|=> \1core| turns => ../../authlib into => ../core: wrong depth, on every replace directive, silently. There were 7, not the 5 the spec claimed — two live inside replace ( blocks, which is why the first count was low.

  4. References written in a syntax other than plain text. scripts/profile-tags/guards_test.go holds the module path as a regexp literal with escaped dots (github\.com/…). No plain-substring sweep can match it, and grepping for the literal string cannot find others like it.

  5. Assertions that compare a package path as a string. Two guards in cmd/authbridge-{cpex,envoy}/main_test.go use strings.HasSuffix(path, "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/authlib/costledger"). Miss them and nothing fails — the suffix stops matching, the loop finds nothing, the test passes, and the assertion silently guards nothing. Both were re-pointed and then proven to still fire by inverting them.

  6. A build tag no profile enables is invisible to every aggregate gate. cmd/authbridge-{proxy,envoy}/plugins_sessionbudget.go carry _ "…/storage/redis" blank imports behind include_plugin_sessionbudget, which appears in zero shipped profiles. go build ./... and all four profile builds pass while that import is broken — and release-binaries.yaml ships a -sessionbudget variant. Only an explicit tagged build sees it.

  7. The same identifier check gives opposite answers per name. authlib is nowhere a Go identifier, so a bare-word substitution was safe. shared is — a struct field p.shared in core/plugins/opa — and a blanket rule rewrote 11 field accesses into p.memstore. Meanwhile tls needed no identifier rewrite: all 7 importers already alias it authtls because crypto/tls owns the bare name in 5 of the same files, so a tls. rule would have corrupted ~30 crypto/tls call sites, some plausibly still compiling.

  8. \b does not stop at an underscore. ^package tls\b misses package tls_test, producing an error that names the cause but reads obscurely: found packages tlsconfig (client.go) and tls (server_test.go).

  9. godoc headers name the bare identifier with no path prefix. All seven renamed packages still opened // Package <oldname>, so go doc and pkg.go.dev would have shown the wrong name for every one. Invisible to both the core/<old> path sweep and the ^package <old>$ clause rule.

  10. A path that never gained its new parent — the only functional break on the branch. The five cost packages moved deeper, so a reference mapping old leaf → new leaf comes out wrong by exactly one level while containing no old name at all. make pricing-table still ran go run ./pricing/internal/gen -dir ./pricing from inside core; it is now ./cost/pricing. No CI job runs that target, and it is the documented recovery path cited by seven code sites and docs/plugin-catalog.md. It is the purest case in the set: pricing kept its leaf, so nothing textual changed and no substitution rule could have fired — the reference broke purely by gaining a parent. Three comments had it too (core/ledger, core/event, core/settle). I handled exactly this hazard for core/storage/redis and did not think to apply it to core/cost/*.

  11. The indefinite article stranded by substitution. authlib starts with a vowel; core does not. Six sites read "an core" — including two godoc comments on exported functions, which pkg.go.dev publishes, and one in docs/framework-architecture.md where "an authlib-core change" had become "an core-core change". It compiles, vets, gofmts, and leaves no old name to grep for.

And one where no rule could fire without breaking something else. Sixteen comments still named the retired costing package — because costing is also an English word. The twenty places where it is the gerund ("costing each client the request it had in flight") had to stay, so the sixteen were separated by reading them, not by pattern.

Two consequences in the same family: seven files were still named after the package they no longer belong to (runtimeutil.go in bootstrap, costing.go in settle), and import ordering shifted — authlib sorted before sibling paths, core sorts after, so 16 import blocks needed resequencing. gofmt is gated nowhere here (ci.yaml runs go fmt, which rewrites and exits 0), so that one had to be measured per commit.

And one the plan predicted that did not happen. It warned that event and settle are short common words likely to shadow the new packages, provable only by building. I ran the whole rename in a throwaway worktree first: zero build errors, zero vet errors, all tests pass. A regex scan suggesting 34-of-50 collisions was false positives. Shadowing a package name is legal Go; it only breaks where the same scope also qualifies the package.

Two deliberate inconsistencies

Runtime log and error prefixes still read "costledger: …" in core/cost/ledger/{store,query,writer}.go. Left alone on purpose: they are observable output an operator greps and alerting may key on, they are not wrong (the subsystem is the cost ledger), and "ledger:" would say less. Renaming observable output is a separate decision with its own blast radius, not something to fold into a change whose premise is that no published contract moves.

To be precise about the first one, since the prefixes span two packages: 19 "costledger:" in core/cost/ledger/{store,query,writer}.go plus 2 "costing:" in core/cost/settle/settle.go. It is applied consistently — only three packages ever carried a package-named log prefix, and all three kept it (pricing: ×12 needed no change).

Comments name renamed packages by path form — cost/ledger, not ledger. The bare leaves read badly in prose ("event is explicit that no consumer may add money" is ambiguous) and the path form is what a reader would grep for.

One production literal did move, and it is the deliberate inverse of the log-prefix call: settle.StateKey changed from "costing.settled" to "settle.settled". That one is in-process only — consumers reference the constant, nothing hardcodes the string, and its godoc says it is deliberately not on the wire — so unlike a log line, no one outside the process can observe it.

Deliberate exclusions — please don't "fix" these

  • install.sh is untouched — 0 lines changed, including line 485's --ref probe of ${ref}/authbridge/install.sh. That probe finds installers inside pre-flatten releases, whose git trees still have the file there. Rewriting it makes both lookup paths identical and silently breaks --ref for every existing release, with no failing test to show it.
  • docs/superpowers/ keeps its stale authlib strings. Dated design records, per the precedent in Docs: Correct the docs and repo config to match the tree #1125.
  • The 6 gofmt-dirty files that remain are pre-existing on main. Fixing them is unrelated churn here; the 16 this PR caused are fixed.

Verification

All Go commands with GOWORK=off, as CI runs them.

  • go mod tidy -diff + build + vet clean in all 12 modules — the gate that passes while build, vet and test all fail
  • core: go test -race clean; all four pure-Go profiles resolve and compile; cpex resolves
  • go build -tags include_plugin_sessionbudget in both proxy and envoy — the only gate that sees those blank imports
  • install_test.sh 113/113; pytest tests/ 12/12; readme-demo staleness check passes
  • Published contracts unchanged: image names 6/6, cmd/ names, AUTHBRIDGE_* 9/9, x-authbridge-direction 50, /etc/authbridge 23
  • Markdown links resolved on disk with #anchor stripped, compared against the base to separate new breaks from old: 7 broken, the same 7 as main
  • gofmt -l measured at every commit on the branch: back to main's 6
  • Both path-string guards proven to still fire, by inverting them — a guard you cannot demonstrate failing is not a guard
  • All 8 dependabot.yml entries re-checked against their ecosystems (the gomod ones have a go.mod, the docker one a Dockerfile.init)
  • A real docker build of the proxy image, and of proxy-init and sparc-service, whose contexts moved
  • The migration script re-run from the base commit in a clean worktree while it existed: 0 survivors, and a tree byte-identical to the rename commit — then retired in bfae6a7a, so this row is history rather than something a reader can re-derive at HEAD
  • The published surface diffed base → HEAD and proven byte-identical, rather than argued: 519 json: tags, 142 yaml:/mapstructure: keys, 22 plugin names, 17 include_plugin_* tags, 133 metric Name: literals, 16 OTel attributes, 101 reason codes, 5 action values, 21 routes, 42 x-* headers, 25 env vars. Rego and Python literal sets unchanged. Exported declarations go 968 → 978, the delta being exactly the 10 redis declarations that moved in.

One gate not closed locally. The envoy image's final assembly cannot be built on this machine: the Go-build stage completes all 9 steps, then FROM docker.io/envoyproxy/envoy fails with x509: certificate signed by unknown authority pulling a CloudFront blob — the local HTTPS proxy's MITM cert, untrusted by the container runtime. It reproduces on unrelated images from other registries, so it is environmental and not caused by this change, and the stage this PR edited passed. build.yaml covers assembly on tag push. Worth one confirming build somewhere with normal registry access.

Expected non-failures: cmd/authbridge-cpex vet exits 1 without -tags cpex at every commit including the base — every file sits behind //go:build cpex, so ./... matches no packages. cmd/abctl's TestRunExec_BeforeFirstStart… fails from an ambient SSL_CERT_FILE; reproduces on unmodified main.

Downstream

rossoctl/operator and rossoctl/rossoctl-cli compile against this module and need, on their next cortex bump:

github.com/rossoctl/cortex/authlib…  →  github.com/rossoctl/cortex/core…

plus the nine package renames. Neither breaks when this merges — both pin pre-flatten pseudo-versions, so they already owed a one-time import sweep from #1134; this folds into the same one.

Rollback

A pure rename: git revert of the merge commit restores everything, and consumers are pinned either way. The one hazard is cutting a release inside the window — a tag between this and a revert would publish, then unpublish, a module path. Don't tag until it has settled.

Design spec: docs/superpowers/specs/2026-09-26-repo-layout-design.md (marked implemented, with its two wrong counts corrected in place)
Implementation plan: docs/superpowers/plans/2026-09-26-repo-layout.md

Assisted-By: Claude (Anthropic AI) noreply@anthropic.com

Deferred, deliberately

Filed rather than fixed here, so a later pass does not rediscover them as new:

  • The same deep-move leaf-path drift in the 2026-09-09-pricing-consolidation-* docs. Those
    are point-in-time records this PR does not touch; the paths were correct when written.
    Enumerate with the sweep in the review log.
  • The scripts/dev/ comment column in CLAUDE.md, which overflows on the length of
    verify-moved-ca-diagnostics.sh. Aligning it means widening every other line in the block.
  • Three pre-existing breaks this PR does not introduce: the CI pytest step's
    --ignore=tests/e2e, a security-scans.yaml comment citing a demo/ path that never
    existed, and two broken relative links in demos/github-issue/demo-aiac.md. Worth one
    follow-up issue.
  • make fmt reaches a subset of the workspace modules. This PR adds the one the redis move
    affected; the others were never covered at base either.

The flatten removed the vestigial authbridge/ level and exposed two things it had
been hiding: the root does not describe the product (four of ten directories are
implementation satellites), and the names are a product generation behind.

authlib is the sharpest case, and not merely because of the AuthBridge->Cortex
rename. Measured by non-test lines it is 1.7% auth: 65% framework, 22% cost, 10%
observability. The docs compound it, calling it "the shared auth library" and
enumerating the 1.7% first while omitting the 32%.

Scope deliberately excludes every published contract — image names the operator
selects by name, binary names on users' PATH, the x-authbridge-* wire headers
injected by Helm-rendered Envoy config, the AUTHBRIDGE_* env vars install.sh
accepts, the authbridge-* ConfigMaps, /etc/authbridge, authproxy-routes, the abph_
prefix, and install.sh's --ref probe. "Do not break anything" is written as twelve
gates rather than an intention.

Section 6 carries forward the class that cost rossoctl#1134 a review round: its
substitutions matched authbridge/ WITH a trailing slash, so sixteen bare-directory
spellings survived. authlib has nineteen of the same shape, enumerated by count.
Unlike rossoctl#1134 the replace directives DO change, both sides, five of them.

Self-review caught three errors of mine before commit: the module count is 12 not
13 (storage/redis is already one of them, so moving it adds none), there are five
build profiles not four (cpex is image-only, needing cgo), and "build.yaml's six
name: values" was a bad gate since a grep for '- name:' returns 15 including step
names.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
Six tasks, one per commit, so a rename touching 850 import sites can be reviewed
piecewise: group the deployables under deploy/, consolidate the loose dev scripts,
rename authlib to core, move the redis driver beside the interface it implements,
rename five packages inside core/, then fix the prose and retire the script.

Three lessons from rossoctl#1134 are wired into the mechanics rather than left as advice.
Every substitution matches the bare name without requiring a trailing slash —
that omission is exactly what let sixteen spellings survive the flatten, nine of
them cd lines whose blocks then failed at step 1. Verification decomposes by shape
(raw mentions, then each spelling) instead of trusting the patterns. And pytest is
in the gate set, which it was not last time, when a dead parents[1] path broke
collection.

Two hazards are named where they live. Task 2: the dev scripts compute REPO_ROOT
from SCRIPT_DIR, so moving them one level deeper changes that arithmetic — the
identical hazard was live in the previous PR. Task 5: the new package names
`event` and `settle` are short common words, so a local variable can shadow the
new package; only the build proves it.

Unlike the flatten, the replace directives change on both sides, and storage/redis
is the only directory that changes depth.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
Move proxy-init/, sparc-service/, and lineage-attach/ under a new
deploy/ directory. All three run in-cluster beside the sidecar:
proxy-init and sparc-service are published images with their own
build contexts, and lineage-attach is cluster-attach tooling with a
Dockerfile that is deliberately not in build.yaml. Grouping them
makes that shared shape visible at the top level instead of leaving
three unrelated-looking directories at repo root.

No published contract changes: image name: values in
.github/workflows/build.yaml are untouched (the operator selects
images by name), only their context: paths move. install.sh is
untouched. Nothing is renamed here -- only moved.

Swept every reference to the three old paths across CI workflows,
dependabot config, the root Makefile, scripts, docs, and demos,
distinguishing filesystem paths (updated) from same-named identifiers
that must not change: image names, Deployment/Service names, DNS
names, container names, and CI job ids. Found and fixed two
path-arithmetic bugs where a script/doc computed a path relative to
its own file location and would have silently broken one level
deeper after the move: deploy/lineage-attach/RECIPE.md's `cd ..`
(now `cd ../..`) and CLAUDE.md's matching build-instructions snippet.

Verified: docker builds of both moved images from their new
deploy/ contexts, GOWORK=off go build ./... in authlib, and
sh install_test.sh (113 passed).

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
Moves local-build-and-test.sh, verify-spire-keycloak.sh, and
verify-moved-ca-diagnostics.sh into scripts/dev/ so scripts/ reads as
four clear things: dev/, hooks/, profile-tags/, readme-demo/.

Fixes the REPO_ROOT arithmetic in local-build-and-test.sh (one more
level of ../) and the repo-root cd in verify-moved-ca-diagnostics.sh,
and updates every reference in CLAUDE.md, CONTRIBUTING.md, and
.claude/skills/demo/SKILL.md plus each script's own header comments.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
The three deployables moved one level deeper, so relative links out of
their READMEs — to .github/, demos/, docs/ and authlib/ — now land in
deploy/ and 404. Nothing in the diff showed it: the link text never
changed, only the ground beneath the file.

This is the class that cost rossoctl#1134 a review round, and it is gate 11 of
the design spec. The Task 1 brief named the prose-cd shape and not this
one, so both the implementer's sweep and my own verification missed it.
Grep-by-name cannot see it — a link's text does not mention the moved
directory. Only resolving targets on disk finds it, checked against the
base commit to tell a new break from a pre-existing one.

deploy/sparc-service/deploy/README.md needed ../../../ for its three
docs/ links while keeping ../README.md, which points at its own parent
and already resolved. A blanket ../ -> ../../ would have broken it.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
authlib is 1.7% auth by non-test lines (882 of ~50,000) -- it is the
shared framework, cost, and observability module every binary imports.
"core" names what it actually is.

Mechanical rename via scripts/layout-migrate.sh (committed alongside,
so review is "re-run it and diff"): git mv authlib core, the module
path, all seven replace directives (five single-line, two inside a
replace (...) block), ~850 import occurrences across ~393 files, and
bare-word path/prose references across yaml/yml/md/sh/py/Makefile/
Dockerfile/go.work. docs/superpowers/ (dated archive) and install.sh
are excluded by design and untouched.

Beyond the corrected script: fixed three functional survivors the
script's patterns don't model -- two test guards comparing import-path
suffixes (cmd/authbridge-cpex, cmd/authbridge-envoy main_test.go) and
one regexp literal with escaped dots (scripts/profile-tags/
guards_test.go) that would otherwise silently stop matching anything
and pass vacuously. Also swept the ~150 bare "authlib" mentions left
in Go comments and go.mod comments (not reachable by the script's
non-Go bare-word rule) so the repo carries zero mentions outside the
two excluded paths.

No published contract changed: image names, binary names,
x-authbridge-* headers, AUTHBRIDGE_* env vars, authbridge-* ConfigMaps,
/etc/authbridge/*, authproxy-routes, and the abph_ prefix are untouched.

Signed-off-by: Hai Huang <huang195@gmail.com>
Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
The plan commits this script so review can be "re-run it and diff". As
committed it could not: re-running it from the base left 144 survivors,
because the bare-word rule was scoped to non-Go files and the Go-side
references were then fixed by hand.

Three of those were not prose. They are references written in a syntax
no plain module-path substitution can match: a regexp literal with
escaped dots in scripts/profile-tags/guards_test.go, and two guards in
cmd/authbridge-{cpex,envoy}/main_test.go comparing a quoted import-path
suffix, "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/authlib/costledger" and "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/authlib/usage". Left alone each one
goes quietly inert -- the string stops matching, so the test still
passes while the assertion no longer asserts anything. That is the most
useful shape this refactor has surfaced, and a script that silently
omits it is worse than no script.

Extending the bare-word rule to *.go and go.mod covers all three, and
is safe: authlib is nowhere a Go identifier or import alias, and sits
in no string literal, struct tag, go:embed directive or testdata
fixture where it is data rather than a path.

Verified by re-running the corrected script against a fresh checkout of
the base: zero survivors, and the resulting tree is byte-identical to
the rename commit.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
storage/redis implements core/storage's Store interface but lived as a
sibling of the library rather than beside it. Move it to
core/storage/redis, keeping it as its own Go module (its go.mod still
declares github.com/rossoctl/cortex/core/storage/redis) so the Redis
dependency stays out of core's dependency graph.

Updates every reference to the old path: go.work, dependabot.yml, the
require/replace directives in cmd/authbridge-{proxy,envoy}/go.mod, the
blank imports in both plugins_sessionbudget.go files (the session-budget
plugin's redis registration), and the CLAUDE.md prose/tree. Deletes the
now-dead COPY storage/ storage/ line from the proxy, envoy, and praxis
Dockerfiles (core/ already carries it one line earlier) and updates
praxis's build-context comment. The module's own replace for core
becomes ../.., since the target moved closer even though the module
moved deeper.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
Rename nine core packages so their names describe what they do, not
their history:

  core/shared      -> core/memstore
  core/runtimeutil -> core/bootstrap
  core/contracts   -> core/capabilities
  core/tls         -> core/tlsconfig
  core/pricing     -> core/cost/pricing
  core/costing     -> core/cost/settle
  core/costledger  -> core/cost/ledger
  core/costevent   -> core/cost/event
  core/usage       -> core/cost/usage

Every import site, package clause, and identifier prefix (costing.*,
costledger.*, costevent.*) was swept across all 12 Go modules, plus
comment-only path mentions in Go source and prose references in docs
and scripts that a plain identifier sweep does not touch. No published
contract changed: image names, binary names, x-authbridge-* headers,
AUTHBRIDGE_* env vars, authbridge-* ConfigMaps, /etc/authbridge/*,
authproxy-routes, and the abph_ prefix are all untouched, and
install.sh has zero diff against the branch point. docs/superpowers/
keeps its stale paths as a dated archive, by design.

All 12 modules build, vet, and test clean with GOWORK=off, including
the cpex build tag and both sessionbudget-tagged builds, and
go mod tidy -diff is clean everywhere. The markdown relative-link
checker and the contract-count checks (AUTHBRIDGE_, x-authbridge-direction,
/etc/authbridge, abph_) are unchanged from the branch point.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
Renaming authlib to core changed how gofmt wants 16 import blocks
ordered, and nothing caught it: gofmt is gated nowhere here, because
ci.yaml runs `go fmt ./...`, which is `gofmt -l -w` — it rewrites the
checkout and exits 0, so drift cannot fail a build.

The cause is alphabetical, not cosmetic. `authlib` sorted before sibling
paths like `cmd/abctl/apiclient`; `core` sorts after them, so every
import block mixing the two needed resequencing.

Measured per commit: the repo carries 6 gofmt-dirty files on main and
stayed at 6 through the deploy/ and scripts/dev/ moves, then went to 22
at the rename and stayed there. This restores it to those same 6, which
are pre-existing and left alone deliberately — fixing them would add
unrelated churn to a layout PR.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
…nded

Every one of the seven renamed packages still opened with
`// Package <oldname>`, so `go doc` and pkg.go.dev would have shown the
wrong name for all seven. Nothing caught it: a godoc header names the
bare identifier with no path prefix, so neither the `core/<oldname>`
path sweep nor the `^package <oldname>$` clause rule can see it. It is
the eighth distinct shape in this refactor that a substitution sweep is
structurally blind to.

Seven files were also still named after the package they no longer
belong to — runtimeutil.go in package bootstrap, costing.go in settle,
costevent.go in event, plus their tests. Renamed, since a filename that
names a package is stale the moment that package is renamed, and
filenames reflecting what they hold is part of the point here.

Verified with `go doc` on each of the seven, which now reports the
package's real name.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
…ript

The docs called it "the shared auth library" and enumerated it as
"validation, exchange, cache, bypass, spiffe, routing, auth, config" —
listing the 1.6% first and omitting the 57%. core/README.md named 11 of
its 25 packages and left out the entire cost group, which is 21% of the
module, along with listener, which is most of the rest.

It also claimed, twice, "no protocol dependencies (no gRPC, no Envoy)".
That stopped being true when the listeners moved in: listener/extproc
is an Envoy ext_proc gRPC server, and core has 20 direct dependencies
including grpc, go-control-plane, OPA, OpenTelemetry and CPEX. The
README's dependency list named three of them.

Every package description now comes from that package's own doc comment,
and the theme table is measured on this branch rather than inherited from
the design spec, whose figures no longer match.

Two judgement calls worth knowing about:

Comments naming a renamed package now use the import-path form —
cost/ledger, not ledger. The bare leaf names read badly in prose
("event is explicit that no consumer may add money" is ambiguous), and
the path form is what a reader would grep for.

The 21 runtime log and error prefixes that say "costledger: ..." are
left alone, in three non-test files. They are observable output an
operator greps and alerting may key on; they are not wrong, since the
subsystem is still the cost ledger; and "ledger:" would say less than
"costledger:" does. Renaming observable output is a separate decision
with its own blast radius, not something to fold into a layout change
whose whole premise is that no published contract moves.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
The whole-branch review found one functional break and two more classes of
reference that no substitution rule could have caught.

`make pricing-table` was broken. Makefile still ran `go run
./pricing/internal/gen -dir ./pricing` from inside core, where it is now
`./cost/pricing`. No CI job runs the target, and it is the documented
recovery path cited by seven code sites and docs/plugin-catalog.md.

The ninth shape: a path that never gained a new parent. The five cost
packages moved DEEPER, so a reference mapping old leaf to new leaf comes
out wrong by exactly one level while containing no old name — invisible
to every grep for costledger or costing. The Makefile pair is the purest
case: `pricing` kept its leaf, so nothing textual changed at all and no
rule could have fired. The reference broke purely by gaining a parent.
Also core/ledger, core/event, core/settle in three comments. I handled
exactly this for core/storage/redis and did not think to for core/cost/*.

The tenth: the indefinite article stranded by substitution. `authlib`
starts with a vowel and `core` does not, so six sites read "an core" —
including two godoc comments on exported functions, which pkg.go.dev
publishes, and one in framework-architecture.md where "an authlib-core
change" had become "an core-core change".

Also: sixteen comments still named the retired `costing` package. Those
survived because `costing` is an English word, so no bare-word rule
could fire without wrecking the twenty places where it is the gerund —
"costing each client the request it had in flight" stays.

core/README.md's Auth table contradicted its own theme table over where
`capabilities` and `spiffe` are counted; it now says which and why.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
@huang195
huang195 requested a review from a team as a code owner September 26, 2026 17:01
@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 717 files, which is 617 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

Usage-priced reviews support at most 300 files.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: f446c993-42b8-4df4-bc6c-2133b21d405a

📥 Commits

Reviewing files that changed from the base of the PR and between 9f406c0 and 8c01fc0.

⛔ Files ignored due to path filters (4)
  • core/cost/pricing/internal/gen/main.go is excluded by !**/gen/**
  • core/go.sum is excluded by !**/*.sum
  • core/storage/redis/go.sum is excluded by !**/*.sum
  • go.work is excluded by !**/*.work
📒 Files selected for processing (717)
  • .claude/skills/demo/SKILL.md
  • .github/codeql/codeql-config.yml
  • .github/dependabot.yml
  • .github/workflows/build.yaml
  • .github/workflows/ci.yaml
  • .github/workflows/dependabot-tidy.yml
  • .github/workflows/release-binaries.yaml
  • CLAUDE.md
  • CONTRIBUTING.md
  • Makefile
  • README.md
  • authlib/README.md
  • cmd/README.md
  • cmd/abctl/apiclient/client.go
  • cmd/abctl/apiclient/client_test.go
  • cmd/abctl/apiclient/metrics_decode_test.go
  • cmd/abctl/apiclient/snapshot.go
  • cmd/abctl/apiclient/snapshot_limit_test.go
  • cmd/abctl/apiclient/snapshot_test.go
  • cmd/abctl/apiclient/sse.go
  • cmd/abctl/apiclient/summary_test.go
  • cmd/abctl/cmd_claudecode.go
  • cmd/abctl/cmd_claudecode_test.go
  • cmd/abctl/cmd_config_migrate.go
  • cmd/abctl/cmd_config_migrate_test.go
  • cmd/abctl/cmd_cost.go
  • cmd/abctl/cmd_cost_test.go
  • cmd/abctl/cmd_exec.go
  • cmd/abctl/cmd_exec_test.go
  • cmd/abctl/cmd_experimental.go
  • cmd/abctl/cmd_pricing_test.go
  • cmd/abctl/cmd_service.go
  • cmd/abctl/cost_degraded_clauses_test.go
  • cmd/abctl/cost_token_split_test.go
  • cmd/abctl/edit/configmap.go
  • cmd/abctl/edit/status.go
  • cmd/abctl/go.mod
  • cmd/abctl/local_endpoint.go
  • cmd/abctl/main.go
  • cmd/abctl/tui/app.go
  • cmd/abctl/tui/cost_event.go
  • cmd/abctl/tui/cost_event_test.go
  • cmd/abctl/tui/coverage_test.go
  • cmd/abctl/tui/detail_fetch.go
  • cmd/abctl/tui/detail_fetch_test.go
  • cmd/abctl/tui/detail_pane.go
  • cmd/abctl/tui/detail_pane_test.go
  • cmd/abctl/tui/detail_reasoning_test.go
  • cmd/abctl/tui/e2e_test.go
  • cmd/abctl/tui/event_retention_test.go
  • cmd/abctl/tui/events_columns.go
  • cmd/abctl/tui/events_columns_test.go
  • cmd/abctl/tui/events_pane.go
  • cmd/abctl/tui/events_pane_test.go
  • cmd/abctl/tui/header_align_test.go
  • cmd/abctl/tui/help_pane_map_test.go
  • cmd/abctl/tui/layout_fit_test.go
  • cmd/abctl/tui/local_preview_test.go
  • cmd/abctl/tui/money_precision_test.go
  • cmd/abctl/tui/namespaces_pane.go
  • cmd/abctl/tui/older_notice_test.go
  • cmd/abctl/tui/open_at_test.go
  • cmd/abctl/tui/paging.go
  • cmd/abctl/tui/paging_test.go
  • cmd/abctl/tui/plugin_detail_pane_test.go
  • cmd/abctl/tui/prune_saving.go
  • cmd/abctl/tui/prune_saving_test.go
  • cmd/abctl/tui/session_metadata.go
  • cmd/abctl/tui/sessions_context.go
  • cmd/abctl/tui/sessions_context_bench_test.go
  • cmd/abctl/tui/sessions_context_fold_test.go
  • cmd/abctl/tui/sessions_context_test.go
  • cmd/abctl/tui/sessions_context_wire_test.go
  • cmd/abctl/tui/sessions_money_test.go
  • cmd/abctl/tui/sessions_pane.go
  • cmd/abctl/tui/sessions_rowid_test.go
  • cmd/abctl/tui/sessions_title_test.go
  • cmd/abctl/tui/sessions_tokens_test.go
  • cmd/abctl/tui/settings.go
  • cmd/abctl/tui/settings_persist_test.go
  • cmd/abctl/tui/span_readings_test.go
  • cmd/abctl/tui/spend.go
  • cmd/abctl/tui/spend_band_test.go
  • cmd/abctl/tui/spend_drawer.go
  • cmd/abctl/tui/spend_drawer_test.go
  • cmd/abctl/tui/spend_sanitize_test.go
  • cmd/abctl/tui/spend_strip.go
  • cmd/abctl/tui/spend_strip_test.go
  • cmd/abctl/tui/spend_test.go
  • cmd/abctl/tui/spend_tiers.go
  • cmd/abctl/tui/spend_tiers_reasoning_test.go
  • cmd/abctl/tui/spend_tiers_test.go
  • cmd/abctl/tui/table_ansi_test.go
  • cmd/abctl/tui/table_cursor_test.go
  • cmd/abctl/tui/usage_pane.go
  • cmd/abctl/tui/usage_pane_scope_test.go
  • cmd/abctl/tui/usage_render.go
  • cmd/abctl/tui/usage_render_test.go
  • cmd/abctl/tui/usage_stacked.go
  • cmd/abctl/tui/usage_stacked_test.go
  • cmd/abctl/tui/usage_state_test.go
  • cmd/abctl/tui/usage_whiskers.go
  • cmd/abctl/tui/usage_whiskers_test.go
  • cmd/abctl/tui/yank_test.go
  • cmd/authbridge-cpex/Dockerfile
  • cmd/authbridge-cpex/go.mod
  • cmd/authbridge-cpex/main.go
  • cmd/authbridge-cpex/main_test.go
  • cmd/authbridge-cpex/plugins_a2aparser.go
  • cmd/authbridge-cpex/plugins_cpex.go
  • cmd/authbridge-cpex/plugins_ibac.go
  • cmd/authbridge-cpex/plugins_inferenceparser.go
  • cmd/authbridge-cpex/plugins_jwtvalidation.go
  • cmd/authbridge-cpex/plugins_mcpparser.go
  • cmd/authbridge-cpex/plugins_sparcplugin.go
  • cmd/authbridge-cpex/plugins_tokenbroker.go
  • cmd/authbridge-cpex/plugins_tokenexchange.go
  • cmd/authbridge-envoy/Dockerfile
  • cmd/authbridge-envoy/go.mod
  • cmd/authbridge-envoy/main.go
  • cmd/authbridge-envoy/main_test.go
  • cmd/authbridge-envoy/plugins_a2aparser.go
  • cmd/authbridge-envoy/plugins_contextguru.go
  • cmd/authbridge-envoy/plugins_ibac.go
  • cmd/authbridge-envoy/plugins_inferenceparser.go
  • cmd/authbridge-envoy/plugins_jwtvalidation.go
  • cmd/authbridge-envoy/plugins_lineage.go
  • cmd/authbridge-envoy/plugins_mcpparser.go
  • cmd/authbridge-envoy/plugins_opa.go
  • cmd/authbridge-envoy/plugins_sessionbudget.go
  • cmd/authbridge-envoy/plugins_sparcplugin.go
  • cmd/authbridge-envoy/plugins_tokenbroker.go
  • cmd/authbridge-envoy/plugins_tokenexchange.go
  • cmd/authbridge-envoy/plugins_toolprune.go
  • cmd/authbridge-praxis/Dockerfile
  • cmd/authbridge-praxis/go.mod
  • cmd/authbridge-praxis/main.go
  • cmd/authbridge-proxy/Dockerfile
  • cmd/authbridge-proxy/go.mod
  • cmd/authbridge-proxy/local.go
  • cmd/authbridge-proxy/local_test.go
  • cmd/authbridge-proxy/main.go
  • cmd/authbridge-proxy/main_test.go
  • cmd/authbridge-proxy/plugins_a2aparser.go
  • cmd/authbridge-proxy/plugins_contextguru.go
  • cmd/authbridge-proxy/plugins_ibac.go
  • cmd/authbridge-proxy/plugins_inferenceparser.go
  • cmd/authbridge-proxy/plugins_jwtvalidation.go
  • cmd/authbridge-proxy/plugins_lineage.go
  • cmd/authbridge-proxy/plugins_litellm_budgettrack.go
  • cmd/authbridge-proxy/plugins_mcpparser.go
  • cmd/authbridge-proxy/plugins_opa.go
  • cmd/authbridge-proxy/plugins_sessionbudget.go
  • cmd/authbridge-proxy/plugins_sparcplugin.go
  • cmd/authbridge-proxy/plugins_staticinject.go
  • cmd/authbridge-proxy/plugins_tokenbroker.go
  • cmd/authbridge-proxy/plugins_tokenexchange.go
  • cmd/authbridge-proxy/plugins_toolprune.go
  • core/README.md
  • core/auth/auth.go
  • core/auth/auth_test.go
  • core/auth/bearer.go
  • core/auth/result.go
  • core/bootstrap/bootstrap.go
  • core/bootstrap/bootstrap_test.go
  • core/bypass/matcher.go
  • core/bypass/matcher_test.go
  • core/capabilities/content.go
  • core/capabilities/identity.go
  • core/clientstate/clientstate.go
  • core/clientstate/clientstate_test.go
  • core/config/config.go
  • core/config/config_test.go
  • core/config/cost_ledger_test.go
  • core/config/inbound_interception_test.go
  • core/config/loopback_bind_test.go
  • core/config/presets.go
  • core/config/pricing_test.go
  • core/config/resolve.go
  • core/config/session_limits_test.go
  • core/config/validate.go
  • core/config/warn.go
  • core/config/warn_test.go
  • core/cost/event/event.go
  • core/cost/event/event_test.go
  • core/cost/event/trust_test.go
  • core/cost/ledger/admission_test.go
  • core/cost/ledger/dst_test.go
  • core/cost/ledger/durability_test.go
  • core/cost/ledger/foreign_day_test.go
  • core/cost/ledger/group_test.go
  • core/cost/ledger/query.go
  • core/cost/ledger/query_test.go
  • core/cost/ledger/reprice.go
  • core/cost/ledger/reprice_test.go
  • core/cost/ledger/retention_cutoff_test.go
  • core/cost/ledger/retention_month_test.go
  • core/cost/ledger/row.go
  • core/cost/ledger/store.go
  • core/cost/ledger/tier_split_test.go
  • core/cost/ledger/writer.go
  • core/cost/ledger/writer_test.go
  • core/cost/pricing/bench_test.go
  • core/cost/pricing/bundled.go
  • core/cost/pricing/bundled_multipliers.go
  • core/cost/pricing/bundled_test.go
  • core/cost/pricing/config.go
  • core/cost/pricing/config_test.go
  • core/cost/pricing/consumer.go
  • core/cost/pricing/cost.go
  • core/cost/pricing/cost_test.go
  • core/cost/pricing/cost_tier_test.go
  • core/cost/pricing/describe.go
  • core/cost/pricing/describe_test.go
  • core/cost/pricing/estimate.go
  • core/cost/pricing/estimate_test.go
  • core/cost/pricing/handler.go
  • core/cost/pricing/host.go
  • core/cost/pricing/host_test.go
  • core/cost/pricing/incompletereason_test.go
  • core/cost/pricing/inference.go
  • core/cost/pricing/inference_test.go
  • core/cost/pricing/internal/pricegen/pricegen.go
  • core/cost/pricing/multiplier.go
  • core/cost/pricing/multiplier_test.go
  • core/cost/pricing/plausible_test.go
  • core/cost/pricing/provenance.go
  • core/cost/pricing/provenance_ordering_test.go
  • core/cost/pricing/rates.go
  • core/cost/pricing/rates_test.go
  • core/cost/pricing/refusal_class_test.go
  • core/cost/pricing/registry.go
  • core/cost/pricing/registry_test.go
  • core/cost/pricing/resolution_regression_test.go
  • core/cost/pricing/review_fixes_test.go
  • core/cost/pricing/strict.go
  • core/cost/pricing/strict_test.go
  • core/cost/pricing/table.go
  • core/cost/pricing/table_test.go
  • core/cost/pricing/testdata/model_prices.snapshot.json
  • core/cost/settle/avoided.go
  • core/cost/settle/bound_agreement_test.go
  • core/cost/settle/cacheblind_test.go
  • core/cost/settle/decode.go
  • core/cost/settle/implausible_test.go
  • core/cost/settle/incomplete_test.go
  • core/cost/settle/parallel_guard_test.go
  • core/cost/settle/settle.go
  • core/cost/settle/settle_test.go
  • core/cost/settle/settle_tier_test.go
  • core/cost/usage/agent_test.go
  • core/cost/usage/apportion.go
  • core/cost/usage/apportion_test.go
  • core/cost/usage/concurrent_test.go
  • core/cost/usage/dst_test.go
  • core/cost/usage/fold_test.go
  • core/cost/usage/incomplete_test.go
  • core/cost/usage/month_test.go
  • core/cost/usage/pricing_test.go
  • core/cost/usage/requestpair_test.go
  • core/cost/usage/review_findings_test.go
  • core/cost/usage/snapshot.go
  • core/cost/usage/snapshot_test.go
  • core/cost/usage/usage.go
  • core/cost/usage/usage_test.go
  • core/cost/usage/usage_tier_test.go
  • core/go.mod
  • core/internal/hostglob/hostglob.go
  • core/internal/hostglob/hostglob_test.go
  • core/listener/e2e/placeholder_e2e_test.go
  • core/listener/extproc/client_test.go
  • core/listener/extproc/httppath_test.go
  • core/listener/extproc/mcpreject_test.go
  • core/listener/extproc/placeholder_test.go
  • core/listener/extproc/server.go
  • core/listener/extproc/server_authority_test.go
  • core/listener/extproc/server_contentlength_test.go
  • core/listener/extproc/server_finalize_test.go
  • core/listener/extproc/server_headerdiff_test.go
  • core/listener/extproc/server_headeronly_test.go
  • core/listener/extproc/server_lifecycle_test.go
  • core/listener/extproc/server_midframe_test.go
  • core/listener/extproc/server_path_test.go
  • core/listener/extproc/server_rejectonce_test.go
  • core/listener/extproc/server_responsephase_test.go
  • core/listener/extproc/server_streamedbody_test.go
  • core/listener/extproc/server_teardown_test.go
  • core/listener/extproc/server_test.go
  • core/listener/extproc/skiphost_test.go
  • core/listener/forwardproxy/bridgehealth_test.go
  • core/listener/forwardproxy/client_test.go
  • core/listener/forwardproxy/fallback_finalize_test.go
  • core/listener/forwardproxy/gzip_sse_test.go
  • core/listener/forwardproxy/httppath_test.go
  • core/listener/forwardproxy/mcp_sse_repro_test.go
  • core/listener/forwardproxy/mcp_sse_stream_test.go
  • core/listener/forwardproxy/server.go
  • core/listener/forwardproxy/server_headerdiff_test.go
  • core/listener/forwardproxy/server_test.go
  • core/listener/forwardproxy/session_header_test.go
  • core/listener/forwardproxy/session_identity_test.go
  • core/listener/forwardproxy/session_pin_test.go
  • core/listener/forwardproxy/skiphost_test.go
  • core/listener/forwardproxy/sniff.go
  • core/listener/forwardproxy/sniff_test.go
  • core/listener/forwardproxy/streaming_direction_test.go
  • core/listener/forwardproxy/streaming_test.go
  • core/listener/forwardproxy/tlsbridge_integration_test.go
  • core/listener/forwardproxy/transparent.go
  • core/listener/forwardproxy/transparent_test.go
  • core/listener/forwardproxy/tunnelreason_integration_test.go
  • core/listener/forwardproxy/tunnelreason_test.go
  • core/listener/forwardproxy/writesse_test.go
  • core/listener/httpx/path.go
  • core/listener/httpx/path_test.go
  • core/listener/httpx/render.go
  • core/listener/httpx/render_test.go
  • core/listener/httpx/teardown.go
  • core/listener/httpx/teardown_test.go
  • core/listener/internal/bodyread/bodyread.go
  • core/listener/internal/bodyread/bodyread_test.go
  • core/listener/internal/sseframe/bom_test.go
  • core/listener/internal/sseframe/reader.go
  • core/listener/internal/sseframe/reader_test.go
  • core/listener/internal/tlssniff/listener.go
  • core/listener/internal/tlssniff/listener_test.go
  • core/listener/parity/cost_parity_test.go
  • core/listener/parity/dispatch_audit_test.go
  • core/listener/parity/drivers_test.go
  • core/listener/parity/parity_test.go
  • core/listener/parity/spy_test.go
  • core/listener/reverseproxy/client_test.go
  • core/listener/reverseproxy/costsettle_test.go
  • core/listener/reverseproxy/finalize_context_test.go
  • core/listener/reverseproxy/finisher_test.go
  • core/listener/reverseproxy/httppath_test.go
  • core/listener/reverseproxy/placeholder_test.go
  • core/listener/reverseproxy/recording_test.go
  • core/listener/reverseproxy/server.go
  • core/listener/reverseproxy/server_test.go
  • core/listener/reverseproxy/streaming_direction_test.go
  • core/listener/reverseproxy/streaming_test.go
  • core/listener/reverseproxy/transparent_inbound_mtls_test.go
  • core/listener/reverseproxy/transparent_inbound_test.go
  • core/listener/skiphost/globcontract_test.go
  • core/listener/skiphost/skiphost.go
  • core/listener/skiphost/skiphost_test.go
  • core/listener/transparentproxy/inbound.go
  • core/listener/transparentproxy/inbound_mtls_chain_test.go
  • core/listener/transparentproxy/inbound_test.go
  • core/listener/transparentproxy/origdst_linux.go
  • core/listener/transparentproxy/origdst_other.go
  • core/listener/transparentproxy/server.go
  • core/listener/transparentproxy/sockaddr.go
  • core/listener/transparentproxy/sockaddr_test.go
  • core/llmclient/README.md
  • core/llmclient/client.go
  • core/llmclient/client_test.go
  • core/llmclient/structured.go
  • core/memstore/store.go
  • core/memstore/store_test.go
  • core/observe/claude/harvest.go
  • core/observe/claude/harvest_test.go
  • core/observe/claude/lock_other.go
  • core/observe/claude/lock_unix.go
  • core/observe/claude/lock_unix_test.go
  • core/observe/claude/metadata.go
  • core/observe/statserver.go
  • core/observe/statserver_test.go
  • core/pipeline/README.md
  • core/pipeline/action.go
  • core/pipeline/action_test.go
  • core/pipeline/bodydirection_test.go
  • core/pipeline/bodymutation_test.go
  • core/pipeline/client.go
  • core/pipeline/client_test.go
  • core/pipeline/configurable.go
  • core/pipeline/configurable_test.go
  • core/pipeline/configured.go
  • core/pipeline/configured_test.go
  • core/pipeline/content.go
  • core/pipeline/content_test.go
  • core/pipeline/context.go
  • core/pipeline/errorkind_test.go
  • core/pipeline/extensions.go
  • core/pipeline/extensions_test.go
  • core/pipeline/finisher_test.go
  • core/pipeline/holder.go
  • core/pipeline/holder_test.go
  • core/pipeline/metrics.go
  • core/pipeline/outcome.go
  • core/pipeline/outcome_test.go
  • core/pipeline/pipeline.go
  • core/pipeline/pipeline_test.go
  • core/pipeline/plugin.go
  • core/pipeline/policy.go
  • core/pipeline/promptcontext.go
  • core/pipeline/promptcontext_fixtures_test.go
  • core/pipeline/promptcontext_test.go
  • core/pipeline/rawjson_test.go
  • core/pipeline/requestid.go
  • core/pipeline/requestid_unique_test.go
  • core/pipeline/schema.go
  • core/pipeline/schema_test.go
  • core/pipeline/session.go
  • core/pipeline/session_test.go
  • core/pipeline/sharedstore_test.go
  • core/pipeline/snapshot.go
  • core/pipeline/snapshot_test.go
  • core/pipeline/streaming_test.go
  • core/pipeline/tokens.go
  • core/placeholder/placeholder.go
  • core/placeholder/placeholder_test.go
  • core/plugins/README.md
  • core/plugins/a2aparser/plugin.go
  • core/plugins/a2aparser/plugin_test.go
  • core/plugins/a2aparser/streaming_test.go
  • core/plugins/contextguru/build_test.go
  • core/plugins/contextguru/plugin.go
  • core/plugins/contextguru/plugin_test.go
  • core/plugins/cpex/README.md
  • core/plugins/cpex/cmf_a2a.go
  • core/plugins/cpex/cmf_a2a_test.go
  • core/plugins/cpex/cmf_body.go
  • core/plugins/cpex/cmf_body_test.go
  • core/plugins/cpex/cmf_inference.go
  • core/plugins/cpex/cmf_inference_test.go
  • core/plugins/cpex/config.go
  • core/plugins/cpex/headers.go
  • core/plugins/cpex/headers_test.go
  • core/plugins/cpex/hooks.go
  • core/plugins/cpex/manager.go
  • core/plugins/cpex/manager_cpex.go
  • core/plugins/cpex/manager_stub.go
  • core/plugins/cpex/manager_test.go
  • core/plugins/cpex/plugin.go
  • core/plugins/cpex/plugin_test.go
  • core/plugins/deps.go
  • core/plugins/deps_test.go
  • core/plugins/ibac/judge.go
  • core/plugins/ibac/judge_test.go
  • core/plugins/ibac/plugin.go
  • core/plugins/ibac/plugin_test.go
  • core/plugins/inferenceparser/anthropic.go
  • core/plugins/inferenceparser/anthropic_test.go
  • core/plugins/inferenceparser/bodyless_cost_test.go
  • core/plugins/inferenceparser/cacheblind.go
  • core/plugins/inferenceparser/cacheblind_test.go
  • core/plugins/inferenceparser/cost.go
  • core/plugins/inferenceparser/events.go
  • core/plugins/inferenceparser/events_test.go
  • core/plugins/inferenceparser/implausible_cost_test.go
  • core/plugins/inferenceparser/incomplete_cost_test.go
  • core/plugins/inferenceparser/plugin.go
  • core/plugins/inferenceparser/plugin_test.go
  • core/plugins/inferenceparser/settle_state_test.go
  • core/plugins/inferenceparser/splittokens_test.go
  • core/plugins/inferenceparser/sse_shapes_test.go
  • core/plugins/inferenceparser/streaming_test.go
  • core/plugins/inferenceparser/subagent.go
  • core/plugins/inferenceparser/subagent_test.go
  • core/plugins/inferenceparser/unparsed_cost_test.go
  • core/plugins/injection_coverage_test.go
  • core/plugins/internal/parsercommon/kindbits_usage_test.go
  • core/plugins/internal/parsercommon/parsercommon.go
  • core/plugins/internal/parsercommon/tokenusage.go
  • core/plugins/internal/parsercommon/tokenusage_test.go
  • core/plugins/jwtvalidation/e2e_audiences_test.go
  • core/plugins/jwtvalidation/identity.go
  • core/plugins/jwtvalidation/identity_test.go
  • core/plugins/jwtvalidation/placeholder_test.go
  • core/plugins/jwtvalidation/plugin.go
  • core/plugins/jwtvalidation/plugin_test.go
  • core/plugins/jwtvalidation/validation/jwks.go
  • core/plugins/jwtvalidation/validation/jwks_test.go
  • core/plugins/jwtvalidation/validation/lazy.go
  • core/plugins/jwtvalidation/validation/verifier.go
  • core/plugins/lineage/config.go
  • core/plugins/lineage/plugin.go
  • core/plugins/lineage/plugin_test.go
  • core/plugins/litellm_budgettrack/drift.go
  • core/plugins/litellm_budgettrack/drift_test.go
  • core/plugins/litellm_budgettrack/forwardproxy_integration_test.go
  • core/plugins/litellm_budgettrack/plugin.go
  • core/plugins/litellm_budgettrack/plugin_test.go
  • core/plugins/litellm_budgettrack/settled_zero_test.go
  • core/plugins/litellm_budgettrack/sse_equivalence_test.go
  • core/plugins/litellm_budgettrack/streaming_integration_test.go
  • core/plugins/mcpparser/plugin.go
  • core/plugins/mcpparser/plugin_test.go
  • core/plugins/mcpparser/streaming_test.go
  • core/plugins/opa/README.md
  • core/plugins/opa/plugin.go
  • core/plugins/opa/plugin_test.go
  • core/plugins/opa/tool_parameters_rego_test.go
  • core/plugins/plugins_test.go
  • core/plugins/plugintesting/plugintesting.go
  • core/plugins/registry.go
  • core/plugins/registry_capsclone_test.go
  • core/plugins/registry_test.go
  • core/plugins/registry_testing.go
  • core/plugins/requireslater_test.go
  • core/plugins/sessionbudget/e2e_test.go
  • core/plugins/sessionbudget/lifecycle_test.go
  • core/plugins/sessionbudget/plugin.go
  • core/plugins/sessionbudget/plugin_test.go
  • core/plugins/sessionbudget/split_test.go
  • core/plugins/sparc/collect.go
  • core/plugins/sparc/plugin.go
  • core/plugins/sparc/plugin_test.go
  • core/plugins/sparc/reflector.go
  • core/plugins/sparc/reflector_test.go
  • core/plugins/sparc/respond.go
  • core/plugins/staticinject/plugin.go
  • core/plugins/staticinject/plugin_test.go
  • core/plugins/staticinject/resolver.go
  • core/plugins/staticinject/resolver_test.go
  • core/plugins/stats.go
  • core/plugins/tokenbroker/client/client.go
  • core/plugins/tokenbroker/client/client_acquire_test.go
  • core/plugins/tokenbroker/client/client_bench_test.go
  • core/plugins/tokenbroker/client/client_error_test.go
  • core/plugins/tokenbroker/client/client_network_test.go
  • core/plugins/tokenbroker/client/client_security_test.go
  • core/plugins/tokenbroker/client/client_testing.go
  • core/plugins/tokenbroker/client/error.go
  • core/plugins/tokenbroker/plugin.go
  • core/plugins/tokenbroker/plugin_configure_test.go
  • core/plugins/tokenbroker/plugin_edge_test.go
  • core/plugins/tokenbroker/plugin_request_test.go
  • core/plugins/tokenbroker/plugin_routing_test.go
  • core/plugins/tokenbroker/plugin_testing.go
  • core/plugins/tokenbroker/router_guard_test.go
  • core/plugins/tokenexchange/cache/cache.go
  • core/plugins/tokenexchange/cache/cache_test.go
  • core/plugins/tokenexchange/delegation_test.go
  • core/plugins/tokenexchange/exchange/auth.go
  • core/plugins/tokenexchange/exchange/client.go
  • core/plugins/tokenexchange/exchange/client_test.go
  • core/plugins/tokenexchange/exchange/errors.go
  • core/plugins/tokenexchange/placeholder_test.go
  • core/plugins/tokenexchange/plugin.go
  • core/plugins/tokenexchange/plugin_test.go
  • core/plugins/tokenexchange/provider.go
  • core/plugins/tokenexchange/provider_keycloak.go
  • core/plugins/tokenexchange/provider_test.go
  • core/plugins/toolprune/event.go
  • core/plugins/toolprune/metrics.go
  • core/plugins/toolprune/plugin.go
  • core/plugins/toolprune/plugin_test.go
  • core/praxis/policy.go
  • core/praxis/policy_test.go
  • core/praxis/praxis.go
  • core/praxis/praxis_test.go
  • core/praxis/render.go
  • core/redact/redact.go
  • core/redact/redact_test.go
  • core/reloader/reloader.go
  • core/reloader/reloader_test.go
  • core/reloader/status.go
  • core/routing/config.go
  • core/routing/hostutil.go
  • core/routing/hostutil_test.go
  • core/routing/router.go
  • core/routing/router_test.go
  • core/session/idheader.go
  • core/session/idheader_test.go
  • core/session/intent_pin_test.go
  • core/session/intern.go
  • core/session/intern_test.go
  • core/session/no_expiry_test.go
  • core/session/recorder_test.go
  • core/session/retention_bench_test.go
  • core/session/store.go
  • core/session/store_test.go
  • core/session/viewpage_test.go
  • core/session/viewtail_test.go
  • core/sessionapi/before_test.go
  • core/sessionapi/catalog_adapter.go
  • core/sessionapi/dst_test.go
  • core/sessionapi/index_test.go
  • core/sessionapi/limit_test.go
  • core/sessionapi/metrics_test.go
  • core/sessionapi/retention_assembly_test.go
  • core/sessionapi/retention_coverage_test.go
  • core/sessionapi/server.go
  • core/sessionapi/server_test.go
  • core/sessionapi/snapshot.go
  • core/sessionapi/snapshot_bench_test.go
  • core/sessionapi/snapshot_test.go
  • core/sessionapi/summary.go
  • core/sessionapi/summary_http_test.go
  • core/sessionapi/summary_test.go
  • core/sessionapi/symbolic_window_error_test.go
  • core/sessionapi/usage.go
  • core/sessionapi/usage_group_test.go
  • core/sessionapi/usage_test.go
  • core/spiffe/consumer.go
  • core/spiffe/mirror.go
  • core/spiffe/mirror_test.go
  • core/spiffe/provider.go
  • core/spiffe/provider_integration_test.go
  • core/spiffe/provider_test.go
  • core/spiffe/source.go
  • core/spiffe/workload_jwt.go
  • core/spiffe/workload_jwt_test.go
  • core/spiffe/workload_x509.go
  • core/spiffe/workload_x509_test.go
  • core/storage/provider.go
  • core/storage/provider_test.go
  • core/storage/redis/go.mod
  • core/storage/redis/redis.go
  • core/storage/redis/redis_test.go
  • core/storage/store.go
  • core/tlsbridge/bundle.go
  • core/tlsbridge/bundle_sources_test.go
  • core/tlsbridge/bundle_test.go
  • core/tlsbridge/ca.go
  • core/tlsbridge/ca_test.go
  • core/tlsbridge/decision.go
  • core/tlsbridge/decision_test.go
  • core/tlsbridge/doc.go
  • core/tlsbridge/engine.go
  • core/tlsbridge/minter.go
  • core/tlsbridge/minter_test.go
  • core/tlsbridge/serve.go
  • core/tlsbridge/terminator.go
  • core/tlsbridge/terminator_test.go
  • core/tlsbridge/upstream.go
  • core/tlsbridge/upstream_test.go
  • core/tlsconfig/client.go
  • core/tlsconfig/metrics.go
  • core/tlsconfig/server.go
  • core/tlsconfig/server_test.go
  • core/tlsconfig/spiffe.go
  • core/tlsconfig/testhelpers_test.go
  • demos/README.md
  • demos/echo/agent/main.go
  • demos/echo/scripts/echo-merge.py
  • demos/finance-sparc/Makefile
  • demos/finance-sparc/README.md
  • demos/github-issue/demo.md
  • demos/hr-cpex/Makefile
  • demos/hr-cpex/agent/agent.py
  • demos/hr-cpex/scenarios/02-alice-deny.sh
  • demos/hr-cpex/scenarios/05-alice-external-cedar-deny.sh
  • demos/hr-cpex/scenarios/07-bob-pii-deny.sh
  • demos/ibac/README.md
  • demos/ibac/agent/main.go
  • demos/ibac/k8s/ibac-patch.yaml
  • demos/lineage/README.md
  • demos/mtls/README.md
  • demos/session-budget/local/approver.go
  • demos/session-budget/local/config.yaml
  • deploy/lineage-attach/DESIGN.md
  • deploy/lineage-attach/Dockerfile.otel-shim
  • deploy/lineage-attach/README.md
  • deploy/lineage-attach/RECIPE.md
  • deploy/lineage-attach/attach-lineage.sh
  • deploy/lineage-attach/build-otel-shim.sh
  • deploy/lineage-attach/container-runtime.sh
  • deploy/lineage-attach/lineage-propagate-hook.py
  • deploy/lineage-attach/sidecar-patch.sh
  • deploy/proxy-init/Dockerfile.init
  • deploy/proxy-init/Makefile
  • deploy/proxy-init/README.md
  • deploy/proxy-init/init-iptables.sh
  • deploy/proxy-init/test-enforce-redirect.sh
  • deploy/sparc-service/.dockerignore
  • deploy/sparc-service/Dockerfile
  • deploy/sparc-service/README.md
  • deploy/sparc-service/deploy/Makefile
  • deploy/sparc-service/deploy/README.md
  • deploy/sparc-service/deploy/sparc-service.yaml
  • deploy/sparc-service/pyproject.toml
  • deploy/sparc-service/sparc_service/__init__.py
  • deploy/sparc-service/sparc_service/__main__.py
  • deploy/sparc-service/sparc_service/api.py
  • deploy/sparc-service/sparc_service/engine.py
  • deploy/sparc-service/sparc_service/models.py
  • deploy/sparc-service/sparc_service/providers.py
  • deploy/sparc-service/sparc_service/settings.py
  • deploy/sparc-service/tests/conftest.py
  • deploy/sparc-service/tests/test_api.py
  • deploy/sparc-service/tests/test_engine.py
  • deploy/sparc-service/tests/test_haiku_empty_response.py
  • deploy/sparc-service/tests/test_providers.py
  • deploy/sparc-service/tests/test_settings.py
  • deploy/sparc-service/tests/test_watsonx_integration.py
  • docs/architecture.md
  • docs/cpex-plugin.md
  • docs/framework-architecture.md
  • docs/ibac-plugin.md
  • docs/idp-plugin-contract.md
  • docs/lineage-wire-contract.md
  • docs/litellm-budgettrack-plugin.md
  • docs/plugin-catalog.md
  • docs/plugin-reference.md
  • docs/plugin-tutorial.md
  • docs/pricing.md
  • docs/proposals/authbridge-hooks.md
  • docs/proposals/cost-tier-breakdown.md
  • docs/proposals/tool-prune.md
  • docs/session-budget-plugin.md
  • docs/sparc-plugin.md
  • docs/superpowers/plans/2026-09-26-repo-layout.md
  • docs/superpowers/specs/2026-09-26-repo-layout-design.md
  • docs/token-broker-plugin.md
  • docs/tool-prune-plugin.md
  • scripts/dev/local-build-and-test.sh
  • scripts/dev/verify-moved-ca-diagnostics.sh
  • scripts/dev/verify-spire-keycloak.sh
  • scripts/profile-tags/guards_test.go
  • scripts/readme-demo/README.md
  • scripts/readme-demo/fixturedata.go
  • scripts/readme-demo/go.mod
  • scripts/readme-demo/tuicapture.go

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Review round 1 on this PR found 29 findings, 0 must-fix. This applies the 21
in-scope ones plus the four adjacent guards, by class rather than by instance.

RENAME-DRIFT (deep-move). The five cost packages gained a cost/ parent and KEPT
their leaf name, so a reference by leaf is wrong while containing no occurrence
of any old name -- `grep authlib --include=*.go` over the tree returns zero hits
and reads perfectly clean. Swept per MATCH rather than per line, because a line
holding one correct and one stale reference is otherwise filtered out: 20 distinct
leaf-path targets, 15 of them stale, 22 citing sites. Fixed the 6 in scope
(pricegen.go's emitted header, the committed bundled.go carrying it, two godoc
lines in internal/gen, two PR-added comments in sessionapi/dst_test.go). The
other 15 sit in 2026-09-09 design docs this PR never touches and are deferred,
not fixed -- rewriting a point-in-time record is archaeology.

FALSE-CLAIM. Ten verified-false claims, fixed by deleting or dropping the number
rather than restating it, since a replacement claim is new unreviewed surface:

  - The spec's theme table gave Framework 32,984 lines / 65%. Measured per
    directory it is 30,485, identical at base and HEAD, which is what
    core/README.md already says. Its Auth row named five directories of which
    only two ever existed -- `validation` and `exchange` never existed at all,
    `contracts` is base-only -- while the 882 figure actually comes from
    `capabilities`, a HEAD-only name the row did not mention. Corrected the
    Lines column, dropped the Share column, and pointed at core/README.md as the
    one place shares are maintained.
  - The spec's commit arithmetic ("twelve commits, not six ... the other six are
    fallout ... matched the planned work commit-for-commit") was 13 total / 11
    implementation / 5 fallout. Dropped the counts instead of correcting them:
    this very commit would invalidate any number written here.
  - The spec's target-layout block rendered `core/validation/`, which has never
    existed in this repo at either end of the diff.
  - core/README.md claimed 24 packages (25 directories, and the package/container
    split makes the count ambiguous) -- number dropped; that `routing` is counted
    under Framework (Framework's total is exactly the other five, so routing's
    185 lines are in the stated remainder); and that neither external consumer is
    referenced anywhere else in the tree (rossoctl/operator appears in 13 files).
  - The plan's brace expansion named dependabot-tidy.yaml; it is .yml. And it
    called seven target names "six" two clauses before calling them "seven".

GEOMETRY-INVARIANT. The invariant is "identical to base", not "internally
uniform". Measured by DISPLAY column, since box-drawing characters are multi-byte:
base's CLAUDE.md tree block is uniform at 70/70 on column 38, HEAD had exactly two
outliers. Fixed line 93 (column 35). Line 159 stays at 43 as a recorded exception
-- it overflows on the length of verify-moved-ca-diagnostics.sh, and aligning it
would mean widening all 81 lines of the block for one filename.

UNFAILABLE-ASSERTION. Three negative guards where a match is the failure, so zero
hits is the pass -- and a stale pattern produces zero hits too. The reviewer proved
the suffixes correct at HEAD with positive import mutants, but nothing stopped them
going inert on the next move. Each now carries a reachability control, copying the
`checked == 0` idiom from core/plugins/injection_coverage_test.go: the two
cost-ledger guards assert the directories their suffixes name exist, and the
profile-tags scan counts the sanctioned plugins_*.go matches it skips, separating
"the tree is clean" from "the regexp is blind". Every one was mutated and watched
to fail before being kept.

Makefile: `cd core && go fmt ./...` cannot reach core/storage/redis, because Go
excludes nested modules from ./... -- 64 packages, none of them under it, while
redis.go is one of the tree's gofmt-dirty files. Coverage is unchanged from base;
the move only made it look covered. Added the one module the move affected, and
deliberately did not reformat the dirty file, which is pre-existing.

dependabot.yml: after the rename "core uses three symbols from core/schemas" reads
self-referential. Disambiguated to bifrost's core/schemas.

Not fixed, deliberately: the 15 historical-doc references above, CLAUDE.md:159,
and findings 27-29, which are pre-existing breaks in files this PR does not touch.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
Review round 2 (delta-scoped to 8518a7b) returned one must-fix, in that commit's
own fix. Escalation 1 from the remediation stop rule: change how the fix is
written, rather than adding more of it.

UNFAILABLE-ASSERTION, recurrence of round 1's findings 22-24 inside the code that
fixed them. The reachability control I added read a SECOND literal copy of the
package paths while the guard matched on its own `HasSuffix` literals. Nothing
coupled them, so an edit to the matcher alone left the control green and the guard
could still go silently blind -- witnessed by mutants G3 (envoy) and G5 (cpex),
both of which mutate only the `HasSuffix` literals and both of which SURVIVED.
That falsified the comment the fix shipped ("Pin the suffixes to real
directories") for exactly the failure mode it named.

Why the round-1 mutation missed it: M1/M2 mutated the CONTROL's own list, which
proves the control runs, not that it covers the matcher. A mutation aimed at the
code you just wrote can pass while the defect it targets is untouched.

Both guards now derive the match and the existence check from one `costPkgs`
slice, building the suffix as "/"+pkg. The same commit already had this right 30
lines away in scripts/profile-tags/guards_test.go, which counts with the same
`blankPluginImport` variable its scan uses -- so this restores a verified sibling
rather than composing a new shape. The desynchronisation G3/G5 expressed is now
structurally unavailable: there is no second copy to edit, which is why those two
mutants' target no longer exists.

| Mutant | Mutation | Verdict |
|---|---|---|
| G1 | envoy main.go gains a real core/cost/ledger import | killed |
| G2 | cpex main.go gains a real core/cost/usage import | killed |
| M1 | envoy costPkgs -> core/NOPE/ledger | killed |
| M2 | cpex costPkgs -> core/NOPE/ledger | killed |
| M3 | blankPluginImport module path core -> authlib | killed |
| G3/G5 | matcher literals only | target no longer exists (one list) |

G1/G2 matter most here: they prove the DERIVED suffix still matches real import
paths, so coupling the control did not weaken what the guard actually detects.

Also from round 2, both created by the previous round's own subtractive fixes:

  - The auth fraction was corrected at one site and left standing at five others
    in the same two files. Swept: every instance in the 2026-09-26 spec and plan
    now reads 1.6%, matching core/README.md and the spec's own header, which
    truncate rather than round. Fixing the named line without sweeping the class
    applies to figures, not just paths.
  - The replacement pointer sentence claimed core/README.md was "the one place"
    shares are maintained, contradicted by this spec's own header 30 lines above
    it. Deleted the over-claim rather than restating it.

G4 (pricegen's emitted header, mutated alone, survives the cost/pricing suite)
stays open: the golden test compares generated DATA, never Render()'s bytes, so
the header pair this PR fixed by hand is ungated. Pre-existing and adjacent --
recorded in the review log, not fixed here.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
Review round 3 flagged the comment added in 11a2d0e: "an edit that blinds one
blinds the other" is unqualified, and false for edits to the match EXPRESSION
rather than the strings. Mutants G8/G9 (append a trailing slash to the derived
suffix) and G10/G11 (HasSuffix -> HasPrefix) each blind the matcher with one
token while the os.Stat loop stays green.

The conclusion was true -- the two-copy desynchronisation really is structurally
gone -- so this is a true claim resting on an over-broad reason, which is the
shape that survives every check aimed at the conclusion. Narrowed the claim to
the strings it actually covers and said plainly what it does not catch, rather
than widening the guard to match the sentence.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
rossoctl#1141 landed while this was in review. Merged rather than rebased: this branch
carries 206 pure renames across 15 commits, so a replay would re-resolve the same
rename-vs-modify decision once per commit, and it would rewrite the SHAs three
review rounds cite.

Upstream's four commits touched nine files. Eight merged cleanly, including the
four `authlib/pricing/*.go` edits, which git routed to `core/cost/pricing/*` on
its own via rename detection -- verified by the tests, not assumed.

`docs/plugin-catalog.md` conflicted in two hunks. rossoctl#1141 MOVED the pricing and
cost-record sections out of that file into a new `docs/pricing.md`, replacing them
with pointers, while this branch still held the originals with their paths
renamed. Took upstream's side in both hunks: keeping ours would have duplicated
162 lines that now live in `docs/pricing.md`. Confirmed the content is actually
there before discarding it.

The merge's real hazard was not the conflict. `docs/pricing.md` is new, written
against the pre-rename layout, and arrived carrying ten `authlib/` citations --
plus one that upstream added to `plugin-catalog.md`. Merging them verbatim would
have silently reintroduced the exact drift this branch exists to remove, in files
no conflict marker pointed at. Translated all eleven, most-specific first so the
bare `authlib/` could not shadow the others, and verified every target exists on
disk before writing it:

  authlib/pricing     -> core/cost/pricing        authlib/usage      -> core/cost/usage
  authlib/costing     -> core/cost/settle         authlib/costledger -> core/cost/ledger
  authlib/costevent   -> core/cost/event          authlib/           -> core/
  authlib/plugins/litellm_budgettrack -> core/plugins/litellm_budgettrack

Also `costing.Settle` -> `settle.Settle`: that package's name changed too, so the
symbol reference was stale independently of its path.

Verified after resolution: all 9 modules test clean (incl. `-tags cpex`), gofmt
clean on every merged Go dir, `go mod tidy -diff` clean, every relative link in
both docs resolves, every `core/...` path cited in the new doc exists, the
complete mutation suite re-run with no prior mutant flipping to SURVIVED, and no
`authlib` string left outside the dated `docs/superpowers/` archive.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>

@esnible esnible left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

A 721-file rename refactor that holds together. I verified the structural and mechanical claims against the PR head tree rather than taking the (unusually detailed) description on trust, and found nothing to flag — no must-fix, no suggestions, no nits.

Author: huang195 (MEMBER — maintainer)
Areas reviewed: Go, CI/GitHub Actions, Dockerfiles, dependency manifests, Shell, Python, Docs, Agent/IDE config
Agent/IDE config (.claude/.vscode): FLAGGED and cleared — .claude/skills/demo/SKILL.md (6/-6). Full patch read: all six lines are prose path updates from this PR's own rename (authlib/spiffe→core/spiffe, proxy-init→deploy/proxy-init, scripts/→scripts/dev/). No hooks, no command, no runOptions, no permission grants, no executables added or referenced, no obfuscated content. No settings.json/settings.local.json anywhere in the diff; a repo-wide scan for settings.json|setup.mjs|tasks.json|launch.json|extensions.json|devcontainer returns zero hits.
Commits: 17, all signed off
CI status: passing (27/27; Spellcheck + tidy skipped, CodeRabbit skipped at 717 files over its 100-file limit)

Verified against the head tree

Claim Result
Top level 10 → 7 cmd core demos deploy docs scripts tests
core/ 29 → 25 packages exactly 25
Nine renames landed all present; zero surviving authlib/costing/costledger/costevent/runtimeutil/contracts
placeholder/praxis kept both present, as stated
Seven replace directives correct, including the depth-sensitive core/storage/redis => ../..
Hazard #10 (make pricing-table) ./cost/pricing/internal/gen -dir ./cost/pricing; both paths exist
Hazard #4 (escaped-dot regexp) updated — no substring sweep could have matched it
Hazard #6 (tag-gated blank imports) both plugins_sessionbudget.go fixed
Hazard #11 ("an core") 0 remaining
"20 direct dependencies" exactly 20 in core/go.mod
README package coverage (was 11/25) 24/25 — only internal/ omitted, correctly
"no gRPC, no Envoy" false claim corrected explicitly rather than quietly dropped
install.sh untouched absent from the diff, so --ref against pre-flatten releases still resolves
settle.StateKey safe to move consumers go through settle.Load()/settle.Settled, never the literal

Security posture: all Actions remain full-SHA pinned, every go.sum is 0/-0 (no dependency content moved), and no dependabot ignore constraint was loosened. The core/schemas → bifrost's core/schemas disambiguation in dependabot.yml is a real improvement now that core is this repo's own module name.

Worth calling out

The two cost-ledger guards (hazard #5) weren't merely re-pointed. They now derive both the suffix match and an os.Stat existence check from one costPkgs slice, so a future rename that stales the suffix fails loudly instead of passing vacuously — and the comment is candid about the limit it does not claim to catch. That is the right fix for a guard that could previously have guarded nothing in silence.

Every deliberate exclusion checks out as correctly reasoned, and the four Deferred items are real and appropriately scoped out of this PR.

One thing outside this PR's reach

As the description notes, the envoy image's final assembly can't be built in the author's environment (MITM cert on a CloudFront blob pull, reproduces on unrelated images). build.yaml covers assembly on tag push, but one confirming build somewhere with normal registry access is worth having before a tag is cut — and per the Rollback section, don't tag until this has settled.

Approving on a maintainer diff with the flagged agent-config file inspected and confirmed benign.

@huang195
huang195 merged commit 60d2a66 into rossoctl:main Sep 26, 2026
27 checks passed
@huang195
huang195 deleted the refactor/repo-layout branch September 26, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants