fix: stabilize Codex paths and close the relationship-origin vocabulary#127
Conversation
Bounded hotfix from Codex's post-ship review of intent-exploration-foundation: stable-path Codex rendering (Decision 19 amendment), closed relationship-origin vocabulary with registry and reclassify repair, and help-surface parity.
U1: relationship-origin registry (imported/manual/command) feeding writers, doctor, and repair; intent/exploration/conversion writers normalized to 'command'; a source-literal parity scan exposed five more 'system' writers in run.go/finding.go, also normalized; repair reclassifies the four named legacy origins backup-first and preserves the backup path on failure. U2: Codex-managed guidance, hooks, and execpolicy prefixes render the un-canonicalized PATH entrypoint so upgrades no longer strand rendered policy; EvalSymlinks retained for forbidden-roots validation (both directions tested), amending journal-reliability-foundation Decision 19. U3: state migrate dispatch and help derive from one registry with a behavioral parity test; all six sources listed; bare and leaf --help (migrate, conversation handle add, exploration conversation add) exit 0; agent-help and the generated CLI reference brought in line. Capability evidence regenerated via the sanctioned u8 smoke writers against the rebuilt binary (hash/timestamp/marker only).
Bare 'state repair relationship-origin' is now valid as reclassify-only mode β the backfill requires an explicit --origin imported|manual β making the Change's Observable Workflow commands executable as written. A legacy-only repair fixture proves post-apply doctor cleanliness (V3), and the source-literal parity scan fails closed on origin binds it cannot classify. The Change document records the H1 trust-boundary reasoning for the stable-entrypoint amendment, the bare-invocation mode split in Decision 4, and adjacent-surface justifications for the top-level migrate help fix and the sanctioned smoke-evidence regeneration.
|
Response to the adversarial review (verdict FAIL, seven findings) β addressed in 8007bab: Fixed:
Documented rather than changed: Already sequenced (5, 6): the real-state repin, database repair, closures, and runtime smoke are release-time Definition of Done steps per the Change's Sequencing section β your sandbox couldn't reach the live DB or GitHub to see that context. V1's gates ( |
Version 2.0.0-alpha.12: stable Codex execution paths, closed relationship-origin vocabulary, and help-surface parity from PR #127, with real-state dogfood completed before publication.
Change
docs/changes/20260719-path-stability-and-origin-hygiene/
Bounded hotfix shaped from Codex's post-ship review of intent-exploration-foundation (PR #122), addressing both HIGH/MEDIUM code defects and the help-surface LOWs before the next large Change.
What & Why
U1 β Relationship-origin registry. Doctor rejected origins that the new Intent/Exploration writers produced ('intent-create', 'legacy-conversion', 'exploration-create'), leaving a healthy schema-12 database permanently warning on ten rows while the recommended repair matched zero of them. One registry in
internal/state/relationship_origin.gonow feeds the writers, the doctor invariant, and repair. All writers normalize to the closed mechanism vocabulary (imported/manual/command); a source-literal AST scan enforces it β and immediately exposed five more writers inlining 'system' in run.go/finding.go, the same defect class, now also normalized.state repair relationship-originreclassifies exactly the four named legacy origins backup-first (idempotent, foreign origins surfaced but never rewritten) and preserves the backup path when a post-backup step fails.U2 β Codex stable-path rendering. The installer resolved the
loafPATH entry through EvalSymlinks into the versioned Homebrew Cellar target, so every release invalidated the rendered AGENTS.md guidance, SessionStart hook, and all execpolicy prefixes, stranding running Codex tasks. Rendering now uses the un-canonicalized PATH entrypoint (stable across upgrades); EvalSymlinks is retained for validation only, with forbidden-root checks enforced in both symlink directions. This amends Decision 19 of journal-reliability-foundation, recorded in the Change and journal.U3 β Help-surface parity.
state migratedispatch and help now derive from one registry, making an unlisted source structurally impossible (bidirectional parity test plus a behavioral dispatch probe per source). All six sources are listed; baremigrate --helpand the leaf helps (conversation handle add,exploration conversation add) exit 0; agent-help and the generated CLI reference were brought in line.Review focus
Verification
go vet ./...,go test ./... -count=1(all packages),npm run typecheck,npm run buildβ all green; artifacts synchronized and committed.loaf change checkβ no violations, executable.Migration / breaking changes
Existing databases with the legacy origins run
loaf state repair relationship-origin --dry-runthen--apply(backup-first). The real-database run, the Codex repin vialoaf install --upgrade, and the journal closure entries are Definition of Done steps executed with the release, per the Change's sequencing.Deferred