Audit remediation: fix all e2e-audit findings + 8 review-caught regressions#96
Merged
Conversation
…t regressions
A 17-subsystem adversarially-verified audit found 26 confirmed findings (2 HIGH,
0 CRITICAL); all are fixed here, each with a discriminating test.
Both HIGH resolved: the OpenAI/OpenRouter SSE assembler swallowing an in-band
error frame as nil-error success (now a typed, retryable-vs-terminal APIError),
and an unvalidated SKILL.md frontmatter name 400-ing every model call (validated
at load + a Defs() boundary guard + an install-time check).
Confirmed clusters fixed: scheduler.Submit >1024-task deadlock, swarm
stranded-green false-green, resilience.Stream double-paint, MCP single-flight
ctx-poisoning; the dead closed-loop features (trust scope, config standings,
-class filter, selfimprove execution-time enforcement, MaxFanout semantics,
namespace blast wall-fence); invariant edges (read-path O_NOFOLLOW hardening,
lossless log rotation, off-argv macOS keychain, MCP {{secret:}}/{{env:}}
placeholders); vcache O(n^2) + trust-rebuild perf; and the code-graph
qualified-id migration.
A 12-slice adversarial review of the ASSEMBLED diff then caught 8 second-order
regressions the tests missed (all fixed): worktreefs mkdirAllNoFollow I4 escape
(attacker-swapped in-worktree symlink), graded auto-approval denying everything
under default -blast-radius off, repomap PageRank dropping all call edges,
macOS ConfigDir move orphaning the secrets vault on upgrade, route.Race
loser-cancel nondeterminism, chat stdin os.ErrClosed -> fatal() on Ctrl-C.
Infra: lint folded into `make verify`, a container-sandbox I4 CI job, the -race
lane +6 packages, release checksums + installer verification, a hermetic
model-free native-loop smoke test, and doc drift.
Verified: make verify (119 pkgs, lint-inclusive) + Linux cross-build + the
expanded -race lane + a fully-uncached `go test -count=1 ./...` all green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Full end-to-end remediation of the 17-subsystem adversarial audit. It found 26 confirmed findings (2 HIGH, 0 CRITICAL); all are fixed here, each with a discriminating test. Then a 12-slice adversarial review of the assembled diff caught 8 second-order regressions the tests missed — all fixed. 134 files, ~8k insertions.
Both HIGH findings
data:{"error":…}frame (and an EOF-without-[DONE]with no content) was returned as a nil-error empty/partial success, defeating retry/failover. Now surfaces a typed, retryable-vs-terminal*model.APIErrorlike the Anthropic path.namebecameskill_<name>, so one malformed installed skill 400'd every model call. Now sanitized/validated at load + aDefs()boundary guard + an install-time check.Confirmed clusters (all fixed w/ tests)
scheduler.Submit>1024-task deadlock; swallowedwt.Commitstranding a verified green shard as false-green;resilience.Streamdouble-paint across a retry; MCPManagersingle-flight ctx-poisoning a concurrent peer./applytrust scope mismatch;exp_config_standingnever written;experience -classfilter;selfimprove.Scopeadvisory-only → fail-closed execution screen;superMaxFanout cumulative-not-concurrent;-blast-radiuswall fence unenforced on the default Linux namespace backend.worktreefs.ReadConfinedO_NOFOLLOW);maint.RotateLogoverwriting a hash-chained generation (→ lossless, I5); macOS keychainSetleaking the secret on argv; MCPHeaderspromising secret resolution no code performed (→{{secret:}}/{{env:}}).vcacheO(n²) → memoized side-effect-free hits;graapprovetrust rebuild → incremental.NodeID/SplitID/DisplayName+ name→qualified resolution); embedder base-URL; model-keyed semantic cache.8 second-order regressions caught by the assembled-diff review
worktreefs
mkdirAllNoFollowI4 escape (attacker-swapped in-worktree symlink — reproduced then closed); graded auto-approval denying everything under default-blast-radius off; repomap PageRank dropping all edges; macOSConfigDirmove orphaning the secrets vault on upgrade;route.Raceloser-cancel nondeterminism; chat stdinos.ErrClosed→fatal()on Ctrl-C. (A 9th — hex redaction — was applied then reverted when it proved to mask the log's own hashes and break the verify cache.)Contract / infra / docs
make verifynow runs golangci-lint (dogfooded gate == CI == CLAUDE.md §4)NILCORE_SANDBOX_MUST_RUN) — the primary boundary now has regression protection-racelane +6 packages;tui-verifywidenednilcore run, vestigialnullclawgitignoreVerification
make verify(119 pkgs, lint-inclusive) + Linux cross-build + expanded-racelane + a fully-uncachedgo test -count=1 ./...— all green.🤖 Generated with Claude Code