Resolve the nine audit findings from 2026-07-10 without weakening the immutable safety floor or silently changing unrelated project behavior.
npm test: 572 passed, 0 failed.node scripts/lint-argv.js: 0 hits.node scripts/safety-coverage-audit.js: 0 reported gaps, while semantic counterexamples still reproduced; static keyword coverage is not sufficient.node scripts/doctor.js: 12 checks passed before fault injection.- Reproduced failures:
git commit -asecret bypass, quotedgit -Cbypass,0600 -> 0664config mode change, prefix-owned skill deletion, deployed-copy self-update deletion, partial install, unlocked telemetry loss, and Chinese memory prompt non-recall.
- Replace regex-only Git command detection with a shared quote-aware parser, including path-qualified Git and global options.
- Scan tracked worktree changes for
git commit -a/--alland preserve secure file modes during atomic writes. - Make install/update/uninstall manifest-owned and transactional; reject modified or foreign artifacts before any mutation.
- Narrow the ship hook contract to the known-red remote status it observes and add repository CI for every supported Node line plus shell static checks.
- Serialize telemetry rotation and append across hook processes.
- Base governance on per-rule eligible/evaluated opportunities, not unrelated sessions or raw zero-hit counts.
- Reduce the always-on prompt, keep safety/auth/evidence in core, follow the user's language, and separate SQL data mutation from schema destruction.
- Make repository-memory writes opt-in, add bilingual recall triggers, and add positive/near-negative skill-routing fixtures.
- Synchronize manifests, architecture, READMEs, changelogs, drift gates, and capability wording with the contracts the repository can verify.
- Parse Git invocations with quote-aware argv handling shared by all Git gates.
- Include
git commit -a/--alltracked worktree changes in the secret scan. - Preserve existing file modes during atomic install/restore writes and use owner-only defaults for new Codex configuration/state files.
- Acceptance: regression fixtures for quoted
-C,commit -a, path-qualified Git, mode preservation, canonical commands, and bypass tokens.
- Replace prefix/substr ownership with manifest-backed exact ownership markers.
- Stage a complete release tree before switching hook registrations.
- Keep the previous release usable until shared-file updates and manifest commit complete; roll back on injected failure.
- Make doctor validate every registered hook and required support file.
- Acceptance: foreign skill/extended files survive, self-update is non-destructive, each injected phase failure restores the prior usable install.
- Rename the hook contract to the behavior it can prove: known-red remote branch protection. Do not claim full/local/fresh validation from remote-run presence.
- Add repository CI for the full Node/shell suite and shell static checks.
- Acceptance: red blocks; success permits; in-progress/no-run/stale cases are
explicitly classified and documented; CI runs
npm testandshellcheck.
- Serialize rotation plus append across concurrent hook processes.
- Record per-rule
eligible/evaluatedobservations and keep enforcement events separate from denominators. - Compute governance signals from rule-specific eligible sessions; insufficient opportunity never becomes a demotion recommendation.
- Acceptance: concurrent attempted rows equal retained rows with empty stderr; governance fixtures distinguish no opportunity, evaluated-clean, and active.
- Reduce always-on core size while preserving safety/auth/evidence gates.
- Follow the user's current language and the repository document language.
- Make repository memory archival opt-in and add bilingual recall triggers.
- Split SQL data-mutation safety from destructive schema operations.
- Move unpinned
npxadvice out of the immutable unknown-script telemetry bucket. - Shorten skill descriptions and add positive/near-negative routing fixtures.
- Synchronize
hard-rules.json, hook registries, architecture, READMEs, changelogs, skills, and version/drift checks with the implemented contracts. - Run targeted tests after each phase, then the full suite, shell syntax/static checks, package dry-run, doctor sandbox, and destructive temp-fixture smoke.
Work is isolated on codex/optimize-audit-findings. Each phase keeps a focused
diff and must pass its targeted validation before the next phase begins. No push,
publish, live $CODEX_HOME install, or release is part of this plan.
All reproduced failures have a pre-change counterexample and a passing regression test; all nine findings map to code or documentation changes; no unaccounted files remain; the final report names any contract not proven end to end.
- Git parser and all-invocation/refspec gates: implemented; smoke 139/139.
commit -asecret coverage and secure atomic modes: implemented; install 146/146.- Manifest ownership plus install/uninstall CAS transactions: implemented; sandbox lifecycle and exact shim-only reinstall green.
- Known-red ship contract and CI: implemented; Ubuntu Node 18/20/22/24, shellcheck, and macOS Node 22 jobs declared.
- Telemetry serialization and stale-lock recovery: implemented; audit 80/80, including 96-way normal and 32-way stale-recovery fixtures.
- Rule-specific governance denominators: implemented; no-opportunity/evaluated-clean/active fixtures green.
- Core prompt semantics: implemented; core is 16,301 B and drift-gated at 16 KiB.
- Opt-in memory and skill routing: implemented; 15 frontmatters parse and 27 routing proxy cases pass.
- Manifests/docs/drift/package surfaces: synchronized; final evidence is recorded in the task report.