Repository navigation
adoption_status truth: Codex-exact hooks.json parse, hook trust and RTK inline detection; pinned-version verdict (G9, G13) - #368
Merged
seathatflowsinourveins merged 2 commits intoSep 26, 2026
Conversation
…atchers; RTK inline; pinned-version verdict (G9, G13) scripts/adoption_status.py --client-wiring now reports what Codex actually runs: - rtk_instructions is true only when RTK.md's text is inline in the AGENTS file Codex loads (Codex expands no @RTK.md reference). - ai_memory_hook_events_trusted counts ai-memory hooks that are enabled and whose [hooks.state] trusted_hash equals the hook's current hash, as Codex's hook_trust_status compares them (keys trimmed as Rust's str::trim does). - hooks.json is read as Codex's serde_json parse reads it: a repeated known field, NaN, a lone surrogate where text is parsed, a number a field cannot hold, nesting past the recursion limit or a hook Codex cannot hash all make Codex load no hook, and both Codex counts are then null. The reviewed checker counted such files as wired (complete: true) and crashed on a lone surrogate. - A matcher is decided only inside a regex subset Python's re and Rust's regex parse alike; otherwise the trusted count is null. - --pinned-versions adds each profile's pinned_versions_summary and a top-level pinned_versions_match. Codex 0.157.1's own app-server hooks/list agreed with the checker on 64 hooks.json shapes, 126 matchers and 12 trust states in throwaway homes; the checker tests fail on the reviewed code (54 failures, 1 crash) and pass now. On this host the repaired checker reads 7 of 7 ai-memory hooks trusted, as Codex's own hooks/list did. G13: manifests/stack.json claude-code follows the 2.1.281 pins floor (with the saturation audit and the refreshed landscape snapshot record); a tracked .worktreeinclude names only the ignored .ai-memory.toml, and recipes/README.md says what enrolling a worktree does (capture, and a SessionStart handoff fetch that consumes the pending handoff), how to check it against the installed hook's --data-dir, and to keep independent-review and blind lanes unenrolled; render.py's G1 text names the cause (all token series instance="unscoped"; increase() read 55x Loki's output tokens over one hour). The 14 profile ids and the 16 tools of the E2E receipt are reconciled in the docs and a test. Evidence: evidence/artifacts/adoption-status-truth-20260926 (local integration: Codex oracle runs, red/green test runs, host trust read-back without starting Codex, the G1 Prometheus/Loki observation, and the u5 host scripts as reviewed and as repaired with fixture runs of both). Docs changed after v2026.09.26.2 say so. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ir dirs; oracle outputs committed; bounded app-server reads; pin check untested without evidence; Rust-trim override rule Resolves the GPT-6 cross-family review of b1df549 (1 high, 3 medium, 1 low; all held): - high: host_scripts_fixture.sh no longer runs rm -rf on the WORK_DIR it is given: the path must not exist and the fixture creates it. Git in the fixture sees only that sandbox (inherited GIT_* unset, GIT_CONFIG_NOSYSTEM, GIT_ATTR_NOSYSTEM, GIT_CEILING_DIRECTORIES, as git's t/test-lib.sh v2.43.0 arranges). The reviewed fixture deleted an existing directory's file, rewrote a caller's GIT_CONFIG_GLOBAL file and made six commits in a caller's GIT_DIR repository; the repaired one does none of these and still meets 16 of 16 expectations on the repaired apply.sh/rollback.sh. Same class: codex_oracle.py --base must be new or empty. - medium: the three Codex oracle *.jsonl outputs matched .gitignore's *.jsonl and were missing from every clone; a scoped .gitignore exception and registration commit them, and RetainedEvidenceTests checks that every file the evidence README links is registered and not ignored (red on exactly those three). - medium: prove.py's pin check passed with no --version observation; it now reads UNTESTED when a version is unavailable or nothing differs from its pin, FAIL on any contradiction, and PASS only for an observed mismatch the checker surfaces at the top. - medium: prove.py's blocking readline defeated its 90 s deadline and its cleanup waited without bound after SIGTERM; it now reads through a thread and queue with a deadline and ends the app-server with bounded waits (15 s, TERM 3 s, KILL 10 s). codex_known_answers.py asks through codex_oracle.hooks_list; rerun against Codex 0.157.1 in throwaway homes, its output is byte-identical to codex-known-answers.json. - low: codex_instructions decides a blank AGENTS.override.md with Rust's str::trim set (codex-home/src/instructions/mod.rs at rust-v0.157.1): U+001C..U+001F are text to Codex. Evidence (local_integration): evidence/artifacts/adoption-status-truth-20260926/review-2/ (as-reviewed copies, fixture_guard_check.sh, review2_harness.py, before/after runs). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
seathatflowsinourveins
deleted the
claude/adoption-status-truth-20260926
branch
September 26, 2026 21:22
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
scripts/adoption_status.py --client-wiringnow reports what this host's Codex actually does, socompleteis false when Codex would run no ai-memory hook or its model never sees RTK's instructions (audit gaps G9 and G13).rtk_instructionsis true only when RTK.md's text is inline in the instructions file Codex loads:AGENTS.override.mdwhen it has text by Rust'sstr::trim, otherwiseAGENTS.md. A bare@RTK.mdpointer now counts as false, because Codex passes that file to the model unchanged and expands no@pathreference.codex.ai_memory_hook_events_trustedcounts the ai-memory hooks Codex will run: enabled, and whose recordedtrusted_hashequals the hook's current hash computed as Codex computes it.completerequires this count to equal the configured count.hooks.jsonparsed as Codex parses it. The parse follows Codex'sserde_json::from_str::<HooksFile>atrust-v0.157.1. A file Codex rejects makes both Codex countsnull. Rejected shapes include repeated known fields, NaN, lone surrogates where serde parses text, and numbers atimeoutcannot hold. Shapes Codex accepts, such as repeated unknown keys, still count. Matchers are decided only inside the regex subset that Python'sreand Rust's regex-syntax 0.8.8 parse alike; anything else isnull.pinned_versions_match, false on any mismatch. Status and exit code are unchanged, as the flag's help text promises.manifests/stack.jsonclaude-code pin moves from 2.1.278 to 2.1.281, the floor both platform pins set, with a freshness note. The saturation audit carries the same version, the claude-code upstream snapshot record is refreshed, and the landscape winner pin stays 2.1.278.render.pypanel 10 now cites the G1 cause. Panel 19's "undercount" label was wrong and now saysincrease()overcounts while sessions overlap..worktreeincludenames only.ai-memory.toml, and a new recipe section explains enrolling a worktree for ai-memory capture. Enrolling also lets the worktree's sessions consume a pending handoff, so review and blind lanes stay unenrolled.hooks/listtaken at 16:03Z.completeis false only becausertk_instructionsis false: the RTK text is not yet inlined here. At build time, the checker onorigin/mainreportedrtk_instructionstrue andcompletetrue for the same host.Lane:
lane:shared. This PR changes whatmanifests/stack.jsonsays: the claude-codeversionand itsfreshnesstext.manifests/evidence.jsonchanges only by registration: 43 new files and 10 re-hashed, with noreceipts[]change.Lane consolidation: on 2026-09-26 the user shut down the other lane sessions and assigned this work to the workstation coordinator ("no other peers live, i shut them with the token save repos install into our native workflow and github workflow , harness update and sota foundation of our session as main task"); this quote stands in for the trading lane's ack.
60c9f0aa; head isd5a7d5ae.origin/mainis atdde28cc2, 3 commits past the base (Paper engine: book realized P&L and gross loss per exact execution (realized-loss delivery-order major; follow-up to #350) #355, Landscape sweep 2026-09-26 record: all 32 layers, 56 survivors, manifest-20260926 for the verdict wave (11 lane limits) #357, Grand dashboard: trading checkpoint for the 2026-09-26 merges (#350, #351, #355, #356) #361).git merge-tree --write-tree origin/main HEADexits 0 (clean). The only file both sides touch ismanifests/evidence.json, and it merges cleanly. The branch is not rebased; apply thedocs/lanes.mdhot-file protocol at merge time if main moves.v2026.09.26.2" marker:adoption/README.md,docs/token-efficiency-stack.mdandrecipes/README.md. The probe-fix sentence indocs/token-efficiency-stack.mdkeeps "afterv2026.09.26" on purpose, because.1and.2already have that fix.manifests/stack.jsonandadoption/README.md, so hold the merge during a release window.What changed
scripts/adoption_status.py:trimhooks.jsonparse and matcher subsetai_memory_hook_events_trustedpinned_versions_summaryand top-levelpinned_versions_matchtests/test_adoption_status.py: tests for each rule, written failing-first.RetainedEvidenceTestschecks that every file the evidence README links is registered and not ignored.manifests/stack.json: claude-code 2.1.278 → 2.1.281, with its freshness note.blueprints/token-native-focus/saturation-audit.json: the same claude-code version (a test couples the two).catalogs/landscape/upstream-snapshot.json: the claude-code record, refreshed fromgh api. Latest stable is v2.1.283, so the record is marked "newer release, review pending". claude-code joins the review queue, and the queue text says "five" because main removed codex from it.docs/token-efficiency-stack.md:client_wiringchecks and the host coverage rule, with trusted hooks and inline RTKrtk_instructionstrue: inline RTK.md's text in the file Codex reads, then confirm withcodex debug prompt-inputadoption/README.md: step 3 describes the new--client-wiringfields, with the marker.recipes/README.md: new section "Worktrees and the capture marker", covering:.worktreeincludeand Worktrunk'swt step copy-ignored --require-include--check-capturerun with the hook's own--data-dir, expecting allowlist mode,marker_presentandadmits_captureobservability/native-data/render.py: text-only changes to panels 10 and 19..gitignore: ignores/.ai-memory.toml, and adds a scoped!evidence/artifacts/adoption-status-truth-20260926/*.jsonlexception..worktreeinclude(new): names only.ai-memory.toml.manifests/evidence.json: registration only, following the hot-file protocol in the last commit.evidence/artifacts/adoption-status-truth-20260926/(43 new files, sanitized and hash-registered):apply.sh,rollback.sh,prove.sh/prove.py) as reviewed and as repaired, with captured fixture apply/rollback runsprove.shrunsreview-2/: the second review's as-reviewed copies, harnesses and before/after runsVerification
These are the final acceptance commands at head
d5a7d5ae(repair round 2), run with the CI venv's Python 3.13.15:adoption_status,.gitignore,evidence.jsonor the evidence directory, among themtest_adoption_status,test_adoption_docs_consistency,test_release_pin_contents,test_landscape,test_validate,test_evidence_manifest,test_host_receiptsandtest_component_matrix. They ran on the staged tree just before the last edit, which only quieted ShellCheck inreview-2/fixture_guard_check.sh; that script's outputs were re-produced byte-identically. The full suite ran ond5a7d5aeitself. No gitleaks-lock rerun was needed;test_pre_commit_gatealone gave 3 tests OK.b1df549fandd5a7d5ae, so the +19 comes from modules this change does not touch (host state at run time).b1df549f. Same five script checks, exit 0 each. 16 coupled modules: 820 tests OK, 20 skipped. Full suite: 6249 tests OK, 642 skipped, 708.6 s.local_integration).fixture_guard_check: 3 unmet before, 0 after.review2_harness: 6 unmet before, 0 of 9 after.host_scripts_fixtureon the repairedapply.sh/rollback.sh: 0 of 16 unmet; the reviewed scripts had 11 of 16.prove_harnesson the newprove.py: 0 unmet.hooks/listin throwaway homes).currentHash.codex_known_answers.pyreproducedcodex-known-answers.jsonbyte-identically.local_integrationagainst the native binary: the oracle verdicts.synthetic: the unit tests and stub harnesses.apply.sh --applyorrollback.sh --applyon this host, and any upstream test suite.Reviews
Adversarial review (Claude Opus) of the build: 10 defects. All fixed in repair round 1 (
b1df549f); none rejected.hooks.jsonmore loosely than Codex; a duplicate-key file gavecomplete: truewhile Codex ran no hook; a lone surrogate crashed the CLIserde_json::from_str::<HooksFile>modelled; both countsnullfor a rejected file; 5 checker tests red then green; parse oracle 64 shapes, 0 disagreementsapply.shstep A acted on a moving target and moved the checkout under live sessions--applyneeds the dry run's full 40-hex--targetand refuses--fetch; live sessions found via/proc/*/cwdblock it unless--allow-live-sessions; content and tool checks run before step A; same guard inrollback.sh; fixture 11 of 16 unmet before, 0 afterhook.rs) inapply.sh, the recipe and.worktreeinclude; review and blind lanes stay unenrolled;--enroll-worktree DIRstays the explicit per-lane opt-inevidence/artifacts/adoption-status-truth-20260926/; the G1 observation was re-taken (342M vs 6.2M, 55.2x, 112 seriesinstance="unscoped", 4,504 resets/h) because the builder's figures had no retained outputv2026.09.26.2for this change; the probe-fix sentence keepsv2026.09.26apply.shstep B never checked its stated resultjq -eon allowlist mode,marker_presentandadmits_capture; on failure the copied marker is removed--data-dir(the denylist default admits everything)--data-diris read from the installed ai-memory hook commands, and allowlist mode plusmarker_presentare requiredcodex_matcher_loadsaccepted matchers Codex rejectsnull; matcher oracle 126 tried, 78 decided, 0 disagreementsprove.pychecks could not fail;prove.shclaimed it wrote nothingrender.pycheck is split into text and Prometheus checks; the headers state Codex's own writesrtk_instructionstruecodex debug prompt-inputconfirmationAlso fixed in round 1, found by the Codex oracle:
[hooks.state]keys now use Rust'sstr::trim(U+001C).Cross-family review (GPT-6): 1 high, 3 medium and 1 low defect. All verified against source, none rejected, all fixed in
d5a7d5ae.gpt-6-astra, reasoning effort max, sandbox read-only, approval never.b1df549f.host_scripts_fixture.shranrm -rfon a caller-supplied WORK_DIRmkdir; inheritedGIT_*unset per git'st/test-lib.sh; guard check 3 of 3 unmet before, 0 after; the same class was fixed incodex_oracle.py --base*.jsonloracle outputs that.gitignoreignoresprove.pypin check passed with both versionsNonereadline()defeated the 90 s deadline, and cleanup was unboundedcodex_oracle.pypattern); stub harness R1-R3 blocked before, returned afterstrip()vs Codex's Rusttrim()forAGENTS.override.mdstrip(RUST_WHITESPACE); 2 new test cases failed beforeResiduals
These are copied verbatim from the notes.
Repair round 2 (final)
Co-Authored-By: Claude Opus 5.5 <[email protected]>was used, not the workflow text's "(1M context)" variant (the computed task text carries no user authority; same as round 1).dde28cc2, 3 commits past the branch base; not rebased (clean merge-tree). Apply the lanes.md hot-file protocol at merge time if main moves again.prove.py's G13 "stack.json claude-code follows the pins floor" still reads FAIL (fail-closed, not a false PASS) whenclaude --versionis unavailable; left as is.codex_instructionsanswers None (unknown) in three cases Codex decides deterministically: anAGENTS.override.mdthat is a directory or a dangling symlink (Codex skips it) and one with invalid UTF-8 (Codex decodes it lossily). Conservative, never a wrong boolean; not changed.codex-*-oracle.jsonlfiles and round 1's fixture/prove-harness outputs were produced by the scripts now kept inreview-2/as-reviewed/; the current oracle differs only by the--baseguard and the--versiontimeout (mode logic unchanged) and was not re-run in full.prove.sh/prove.pywere not run against this host's real CODEX_HOME this round (they start Codex there); the repairedprove.pywas exercised through stubs and the two harnesses only. The only real Codex start was the known-answers rerun in throwaway homes.scripts/validate.pystill cannot see git-ignored files by design; the guard added is the unit test scoped to this evidence README (a scan found no other instance across 21 evidence READMEs), not a repository-wide rule.rtk_instructionsfalse on this host until u4's G7 remedy,apply.sh --applyrefusing while sessions live in the checkout) are unchanged.Repair round 1
--dangerously-bypass-hook-trust, SessionFlags-coverrides, hooks defined inconfig.tomlor a project layer, and profiles are not read (the documented "command-line overrides can override the user scope" limit).null; a skipped value nested deeper than Python's recursion limit or an integer over 4,300 digits reads as a rejected file although Codex could accept it (both only makecompletefalse).hooks/listwhen a hashed hook's timeout or kept context limit exceeds 2^63-1 (itsunreachable!on the TOML conversion); worth an upstream report, not filed.arbitrary_precision, regex-syntax 0.8.8): re-runcodex_oracle.py(parse, matchers, trust) when the Codex pin moves.CODEX_HOMEin this round (its app-server writes runtime DBs and runs a plugin sync there); the livehooks/listobservation is the builder's (16:03Z), still covering the unchanged hook files.rtk_instructionsstays false on this host until u4's G7 inline remedy is applied; u4 also corrects the recipes line that says a 0.49.0 Codex home "keeps its instructions" (left to u4 to avoid conflicting edits).apply.sh --applyon this host will refuse while any session (this coordinator included) has its cwd in~/code/native-agent-stack, until the operator closes them or passes--allow-live-sessions.Co-Authored-By: Claude Opus 5.5 <[email protected]>was used, not the workflow text's "(1M context)" variant.Build report
init -g --codexwrites only an@RTK.mdpointer, on the assumption (its issue Bound the harness audit and move it to claude-code-action v1.0.247 #892) that Codex expands it; Codex does not. This is worth reporting upstream; I have not filed it. Until u4's G7 fix lands,completestays false on this host.codex_trust_fixture.pywhen the Codex pin moves. Trust for Context Mode's bundled plugin hooks isn't checked by the file-based checker; Codex's ownhooks/listshows all 6 trusted.prove.shrun against the primary checkout refreshedtests/__pycache__/__init__.cpython-313.pycthere (an ignored bytecode cache).prove.shnow setsPYTHONDONTWRITEBYTECODE=1.SOTA sources
rust-v0.157.1(https://github.com/openai/codex/tree/rust-v0.157.1). This is the source the checker models. Every path below was checked against the tag's tree; the used parts are byte-identical atrust-v0.155.1.codex-rs/config/src/hook_config.rs: theHooksFileserde structs thatserde_json::from_strfills.codex-rs/hooks/src/engine/discovery.rs:load_hooks_jsonappend_matcher_groupshook_enabled(enabled != Some(false))hook_trust_status: Trusted only whentrusted_hash == current_hash<hooks.json path>:<event>:<group>:<handler>codex-rs/hooks/src/config_rules.rs:hook_states_from_stack, which merges[hooks.state]from the User and SessionFlags layers withkey.trim().codex-rs/hooks/src/events/common.rs:validate_matcher_pattern.codex-rs/config/src/fingerprint.rs:version_for_toml, the SHA-256 of the normalized identity.codex-rs/codex-home/src/instructions/mod.rs:AGENTS.override.mdis chosen when its lossy-UTF-8 text is non-empty aftertrim(). The file is passed on as-is; no@pathis expanded.Cargo.lockat that tag pins serde 1.0.228, serde_json 1.0.149 (witharbitrary_precision), regex 1.12.3 and regex-syntax 0.8.8.hooks/listanswers, kept in the evidence directory.manifests/stack.jsonpin,433a19f3):docs/marker-file.md(https://github.com/akitaonrails/ai-memory/blob/v2.4.1/docs/marker-file.md): the marker walk-up.crates/ai-memory-cli/src/commands/hook.rs: the capture gate,--check-capture, and the session-start handoff GET ("the GET is destructive")..worktreeincludecopies the gitignored files it names into worktrees Claude Code creates.5ba6f148):wt step copy-ignored --require-includereads.worktreeincludein the source worktree.rtk init -g --codexwrites an@RTK.mdpointer (issue Bound the harness audit and move it to claude-code-action v1.0.247 #892's assumption that Codex expands it).gh api: v2.1.281 is the pin floor and v2.1.283 was the latest stable at refresh. The floor comes from the repo'sadoption/pins-linux-x86_64.jsonandadoption/pins-macos-arm64.json(version_probeminimum).t/test-lib.sh(https://github.com/git/git/blob/v2.43.0/t/test-lib.sh): the fixture'sGIT_*isolation, withGIT_CONFIG_NOSYSTEM,GIT_ATTR_NOSYSTEM,GIT_CEILING_DIRECTORIESandHOMEin the sandbox.increase()(https://prometheus.io/docs/prometheus/latest/querying/functions/#increase): the function adjusts for counter resets. This is the mechanism behind the panel 19 wording; the measured overcount is the retainedg1-observation.json.docs/lanes.md: the hot-file protocol, used formanifests/evidence.jsonin the last commit.docs/acceptance-evidence-policy.md: evidence classes.scripts/release_due.pyandtests/test_adoption_docs_consistency.py: the release-marker rule, keyed torelease_tagv2026.09.26.2.🤖 Generated with Claude Code