fix(codex): key inline hook trust by its actual group position #2028
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 431 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.363
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2028"
general
weight: 0.35
openrig-review
What a user gets
Refs #17, without claiming to close its original Codex 0.155.1/macOS report.
OpenRig's inline activity hooks get their own exact trust records even when a person's config already contains groups for the same event. Previously, provisioning always wrote
...:<event>:0:0, although it appended its managed group after those existing groups. Its hook could remain untrusted, and a person's existing group-zero trust hash could be overwritten with OpenRig's different hash.Count each event's groups before the managed block, then reuse the existing key/hash writer at that position. Groups after the block don't change its position. Personal hook definitions, their hashes and explicit disable choices stay unchanged. This neither grants blanket hook trust nor adds trust to the person's hooks. The existing JSON-hook provisioning route and hash algorithm are unchanged.
How you verified it
npm run buildandnpm run lint: pass.codex-hook-trust,codex-owned-hook-trust,codex-activity-hooks): 72 tests pass.CodexRuntimeAdapter.ensureCodexActivityHooks, with separate temporary configurations and a loopback-only synthetic HTTP endpoint. Before the fix, a preceding personalSessionStartgroup prevented OpenRig'sSessionStartfrom firing, while its separateUserPromptSubmitstill fired. After the fix, both events fired. The clean-config control still works; the untrusted control and the untrusted personal hook never execute. The endpoint deliberately returns HTTP 400 before any model work, so exit 1 is expected. No real account, model request, paid usage or active OpenRig daemon was involved.Not run: the complete workspace matrix or installed-package scenario. No current macOS/0.155.1 or interactive trust-dialog claim, and no claim that every remaining case in #17 is fixed.
Anything you were unsure about
This prevents future writes at the wrong key. It cannot reconstruct a person's hash already replaced by an older version, and does not guess or rewrite that historical choice. Native evidence covers
SessionStartandUserPromptSubmit; all four provisioned event positions are covered by deterministic tests.AI-assisted implementation and tests. No version bump, changelog edit, runtime deployment or new service.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Trust records now use the correct position when custom hook groups appear before the managed activity hooks. Hook groups added after the managed block do not affect that position.
* Provisioning preserves existing trust entries and produces identical configuration when run again.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->