Restore pre-edit path evidence for tool safety#7
Merged
NagyVikt merged 1 commit intoMay 1, 2026
Merged
Conversation
Colony cannot assess claim-before-edit when native PreToolUse events only say that a tool ran. OMX now extracts repo-relative paths from direct edit tools, apply_patch hunks, and common Bash write forms, then attaches those paths to lifecycle context before mutation. Constraint: Late PostToolUse metadata must not count as pre-edit safety Constraint: Path extraction must stay local and continue without Colony or MCP availability Rejected: PostToolUse-only metadata | arrives after mutation and cannot support pre-edit claims Confidence: high Scope-risk: narrow Tested: npm run build Tested: node --test dist/scripts/__tests__/codex-native-hook.test.js Tested: node --test dist/config/__tests__/codex-hooks.test.js Tested: npm run lint Tested: openspec validate --specs Co-authored-by: OmX <omx@oh-my-codex.dev>
a8d3c1a to
a6af322
Compare
NagyVikt
pushed a commit
that referenced
this pull request
May 1, 2026
Dev moved again with lifecycle replay and runtime-summary work, so this merge preserves the newer repo-relative extracted-path handling while keeping Agent 5 pre/post hook-dispatch proof and missing-pre marking. Constraint: PR #9 base advanced through PRs #7, #8, and #10 while Agent 5 was open. Rejected: Prefer old raw-path helper | current dev has normalized repo-relative extraction and lifecycle event tests that should stay authoritative. Confidence: high Scope-risk: moderate Directive: Keep mutating PostToolUse coverage aligned with the PreToolUse mutator matcher plus MCP/OMX parity post hooks. Tested: npm run build Tested: node --test dist/scripts/__tests__/codex-native-hook.test.js dist/config/__tests__/codex-hooks.test.js Tested: node --test dist/hooks/extensibility/__tests__/dispatcher.test.js Tested: node --test dist/colony/__tests__/bridge.test.js dist/cli/__tests__/colony.test.js dist/colony/__tests__/lifecycle-events.test.js dist/runtime/__tests__/colony-runtime-summary.test.js Tested: git diff --check && git diff --cached --check Co-authored-by: OmX <omx@oh-my-codex.dev>
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.
Automated by Agent 4. Adds repo-relative extracted_paths telemetry for native PreToolUse edit surfaces, apply_patch, and common Bash write patterns.\n\nVerification:\n- npm run build\n- node --test dist/scripts/tests/codex-native-hook.test.js\n- node --test dist/config/tests/codex-hooks.test.js\n- npm run lint\n- openspec validate --specs