Skip to content

Restore pre-edit path evidence for tool safety#7

Merged
NagyVikt merged 1 commit into
devfrom
agent/agent4/add-extracted-edit-event-paths-on-fork-d-2026-05-01-14-58
May 1, 2026
Merged

Restore pre-edit path evidence for tool safety#7
NagyVikt merged 1 commit into
devfrom
agent/agent4/add-extracted-edit-event-paths-on-fork-d-2026-05-01-14-58

Conversation

@NagyVikt
Copy link
Copy Markdown
Collaborator

@NagyVikt NagyVikt commented May 1, 2026

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

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>
@NagyVikt NagyVikt force-pushed the agent/agent4/add-extracted-edit-event-paths-on-fork-d-2026-05-01-14-58 branch from a8d3c1a to a6af322 Compare May 1, 2026 13:19
@NagyVikt NagyVikt merged commit 1c0b6f1 into dev May 1, 2026
8 of 10 checks passed
@NagyVikt NagyVikt deleted the agent/agent4/add-extracted-edit-event-paths-on-fork-d-2026-05-01-14-58 branch May 1, 2026 13:19
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant