Skip to content

Preserve review evidence and required test artifacts - #3635

Merged
BigSimmo merged 24 commits into
mainfrom
codex/agent-policy-delivery-20261017
Oct 18, 2026
Merged

BigSimmo merged 24 commits into
mainfrom
codex/agent-policy-delivery-20261017

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

User description

Summary

Result receipts could be reused for commands requiring report artifacts or interactive execution, and a missing Node runtime allowed the required push guard to be skipped. Restrict receipt reuse to eligible console runs, clarify the limits of committed review evidence, and refuse a push when the guard cannot run. Add the portable advisory Codex hook adapter and its synthetic checks, correct Windows Cloud fixtures and a lazy-render assertion, and align the shared operating guidance while retaining PsychSift's product-specific controls.

Areas touched: Knowledge and records, Delivery and assurance, Personal practice

Verification

  • Checks run: the later three-file unit selection passed 160 tests with zero failures and eight platform skips; 14 adapter checks and the named documentation, rule and formatting checks passed.

Local evidence is composite: the earlier full verify:pr-local invocation failed in three test files (28 failed tests; 31,880 passed). After correcting those files, the later selected run passed 160 tests with eight existing platform skips and zero failures, with a real JSON report. The normal pre-push guard then found a TypeScript inference error in the two synthetic Cloud fixture helpers. After the two-line type correction, their fresh two-file run passed 158 tests with zero failures/eight skips and a real JSON report; normal source typecheck and scoped formatting also passed. The three previously unreached RAG/medication selectors passed separately. Fourteen synthetic adapter checks, documentation/organisation and rule-consistency checks passed. This is not a passing full-wrapper invocation on final HEAD.

The reviewed delivery adds the two-line fixture type correction on top of 9a0c6a518188c73304d54728ea762d09c95d1168, retaining the same 18 changed paths. Exact-main comparison against 62558e5c7cb6fa2cbc12944093d0d053240cb351 found no superseded repair or textual merge conflict. The pre-publication main snapshot advanced to b12f3d4b3f5deda6eaff00e460550f2ec1bdaf26 in one commit changing only five disjoint Supabase/SQL paths; the inspected workflow chain and 18 delivery paths did not change. Main's independent AGENTS and organisation-map entries must be preserved. Main has newer dependencies, so local branch evidence does not certify the eventual merge tree.

Risk and rollout

  • Risk: agent tooling and governance behavior, including receipt eligibility, local fixture isolation and advisory hook routing. No clinical content, database, auth or retrieval behavior changes are included.
  • Rollback: revert the affected commits through a separately reviewed change; do not weaken required guards to repair a failing gate.
  • Provider or production effects: the explicitly authorized effect is one public draft PR and its inspected standard-runner CI. No ready-for-review/model trigger, database action, merge or deployment is part of this delivery.

This is a draft for review. Its hosted static checks remain pending until executed. Draft coverage/safety and automatic Claude review are deliberately deferred; native hook dispatch, clinical sign-off, merge and deployment are not certified by this change.


Summary by cubic

Vitest result receipts now reuse only for eligible console runs, and the pre-push guard blocks pushes when Node is missing. A portable Codex adapter adds advisory repository safeguards by routing supported events to the existing Claude hooks without running tool commands.

  • The adapter handles edit aliases and apply_patch, warns about protected-file edits, detects gh pr create even with an inherited -R/--repo flag, command substitution, quoting, or a path prefix, and keeps push detection intact when git global options — including single-quoted, double-quoted, and attached -C values — precede push; its tests run in verify:cheap:internal after the stale-install parity check.
  • Review-ledger guidance clarifies that matches cover committed HEAD and scope only; shared guidance also clarifies memory scope, spending approval, and formatting owned paths.
  • Windows Cloud fixtures and a lazy-render test were corrected, and receipt tests now exercise the real memoisation rule.

Written for commit e30a90e. Summary will update on new commits.

View guided diff Turn on auto-fix


CodeAnt-AI Description

Make test-result reuse safe, enforce push checks, and add Codex hooks

What Changed

  • Test results are reused only for eligible console runs; runs that create reports or use interactive modes run again so required artifacts are not stale or missing.
  • Push checks now recognize Git pushes with global options and block the push if Node is unavailable to run required guards.
  • Codex sessions can use project-specific safety checks and guidance for pushes, edits, pull-request handoffs, startup, and context compaction.
  • Working guidance now clarifies what review records prove, requires explicit publication targets, and sets boundaries for scoped memory use and billable runs.

Impact

✅ Fresh reports from artifact-producing test runs
✅ No push-guard bypass when Node is missing
✅ Codex users receive project-specific safety guidance

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Next included review available in 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 123 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: BigSimmo/PsychSift/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Team
  • Run ID: a13f8b16-b717-43c0-ba41-cfa1da381158
📥 Commits

Reviewing files that changed from the base of the PR and between 1bd7ea3 and e30a90e.

📒 Files selected for processing: 25
  • .claude/hooks/pr-handoff-stop.sh
  • .claude/hooks/push-format-guard.sh
  • .codex/hooks.json
  • .codex/hooks/dispatch.mjs
  • .codex/hooks/dispatch.test.mjs
  • .githooks/pre-push
  • .gitignore
  • AGENTS.md
  • docs/agents/codex-review-throttling.md
  • docs/agents/native-startup/publication-workflows.md
  • docs/agents/shared-context-and-memory.md
  • docs/agents/verification-gates.md
  • docs/ci-operations.md
  • docs/organisation/systems/delivery.json
  • docs/organisation/systems/knowledge.json
  • package.json
  • scripts/branch-review-ledger.mjs
  • scripts/run-vitest.mjs
  • tests/codex-cloud-policy-harness.test.ts
  • tests/codex-cloud-setup.test.ts
  • tests/gate-receipts.test.ts
  • tests/on-call-service-lifecycle.dom.test.tsx
  • tests/pr-handoff-stop.test.ts
  • tests/push-format-guard.test.ts
  • tests/vitest-result-reuse.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@codeant-ai

codeant-ai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: e30a90ef
Scan Time: 2026-10-18 09:39:08 UTC

✅ Overall Status: PASSED

Quality Gate Details

Quality Gate Status Details
Secrets ✅ PASSED 0 secrets found
Duplicate Code ✅ PASSED 0.0% duplicated
SAST ✅ PASSED No security issues
Bugs ✅ PASSED Rating S: No bugs
IAC ✅ PASSED No IAC issues

View Full Results

@supabase

supabase Bot commented Oct 18, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@BigSimmo
BigSimmo marked this pull request as ready for review October 18, 2026 06:27
@BigSimmo
BigSimmo enabled auto-merge (squash) October 18, 2026 06:27

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BigSimmo has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@codeant-ai

codeant-ai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Incremental review completed fd4831e Oct 18, 2026 · 09:04 09:05
✅ Incremental review completed b3d6f32 Oct 18, 2026 · 07:42 07:43
✅ Reviewed your PR cbb9370 Oct 18, 2026 · 06:27 06:36

@codeant-ai

codeant-ai Bot commented Oct 18, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T09:09:16.792386Z fd4831e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 2s —— View job


I'll analyze this and get back to you.

@codeant-ai codeant-ai Bot added the size:XL This PR changes 500-999 lines, ignoring generated files label Oct 18, 2026
Comment thread scripts/run-vitest.mjs Resolved
gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 18, 2026

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gitar has auto-approved this PR (configure)

@qodo-code-review

qodo-code-review Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Preserve test artifacts and add portable Codex hook guidance

🐞 Bug fix ✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Restrict Vitest receipt reuse so report-producing and interactive commands run and create their
 required artifacts.
• Refuse pushes without Node, and route Codex events to existing project hooks.
• Clarify review-evidence limits, align operating guidance, and isolate Windows Cloud test fixtures.
Diagram

graph TD
  A["Codex events"] --> B["Hook adapter"] --> C["Claude hooks"] --> D["Advisory output"]
  E["Git pre-push"] --> F{"Node present?"} -->|Yes| G["Push guards"]
  F -->|No| H["Push refused"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Implement separate native Codex policies
  • ➕ Could tailor each decision directly to Codex payloads.
  • ➖ Duplicates maintained hook rules and increases the risk of policy drift.

Recommendation: Keep the adapter to reuse existing project hooks rather than duplicate their policies. Its checkout validation, payload translation, and failure behavior are the principal boundaries to review.

Files changed (23) +963 / -134

Enhancement (2) +273 / -0
hooks.jsonRegister portable Codex project hooks +54/-0

Register portable Codex project hooks

• Registers pre-tool, post-tool, compaction, and session-start adapters with Unix and Windows launch commands.

.codex/hooks.json

dispatch.mjsTranslate Codex events to maintained project hooks +219/-0

Translate Codex events to maintained project hooks

• Normalizes shell and edit payloads, selects applicable existing hooks, and relays their advisory output. It also supplies checkout-root validation and Windows runtime fallbacks.

.codex/hooks/dispatch.mjs

Bug fix (4) +29 / -11
push-format-guard.shRecognize pushes after Git global options +2/-2

Recognize pushes after Git global options

• The push detector now recognizes commands such as git -C <dir> push, so the formatting guard still runs when global options precede push.

.claude/hooks/push-format-guard.sh

pre-pushRefuse pushes when Node is unavailable +3/-3

Refuse pushes when Node is unavailable

• Exits nonzero instead of skipping the required push guards when Node cannot be found.

.githooks/pre-push

branch-review-ledger.mjsQualify the already-reviewed lookup verdict +1/-1

Qualify the already-reviewed lookup verdict

• The lookup output now states which inputs it does not compare and when additional evidence is needed before reuse.

scripts/branch-review-ledger.mjs

run-vitest.mjsRestrict Vitest receipt reuse to eligible runs +23/-5

Restrict Vitest receipt reuse to eligible runs

• Recognizes plural reporter flags and prevents reuse for artifact-producing options, custom reporters, and interactive modes. Ordinary console runs and focused related runs remain eligible.

scripts/run-vitest.mjs

Tests (7) +608 / -112
dispatch.test.mjsTest Codex adapter routing with synthetic inputs +339/-0

Test Codex adapter routing with synthetic inputs

• Exercises event routing, registration, edit translation, hook outcomes, and pre-push behavior in synthetic fixtures that trap network and provider calls.

.codex/hooks/dispatch.test.mjs

codex-cloud-policy-harness.test.tsIsolate Cloud policy shell fixtures +112/-59

Isolate Cloud policy shell fixtures

• Pins synthetic shell tools after Git Bash startup and checks their selection before running target scripts. Adjusts path and filename cases for Windows while retaining POSIX-only coverage where appropriate.

tests/codex-cloud-policy-harness.test.ts

codex-cloud-setup.test.tsIsolate Cloud setup fixtures from host Git +100/-37

Isolate Cloud setup fixtures from host Git

• Adds synthetic Git configuration, hooks, and shell-path controls so fixture commands do not select host tools. Updates setup and shim assertions to use those isolated paths.

tests/codex-cloud-setup.test.ts

gate-receipts.test.tsTest the runner's actual reuse decision +14/-15

Test the runner's actual reuse decision

• Imports the Vitest memoisation predicate instead of extracting a regular expression from source text, keeping assertions tied to runtime behavior.

tests/gate-receipts.test.ts

on-call-service-lifecycle.dom.test.tsxAwait the lazy-rendered invitation control +1/-1

Await the lazy-rendered invitation control

• Waits for the Members panel's invitation button before asserting that it is disabled.

tests/on-call-service-lifecycle.dom.test.tsx

push-format-guard.test.tsCover pushes with preceding Git options +16/-0

Cover pushes with preceding Git options

• Adds cases showing that global Git options do not bypass the push formatting guard, while non-push commands remain unaffected.

tests/push-format-guard.test.ts

vitest-result-reuse.test.tsCover artifact and interactive receipt exclusions +26/-0

Cover artifact and interactive receipt exclusions

• Tests reporter aliases, report-merging and interactive modes, alongside eligible ordinary and focused related runs.

tests/vitest-result-reuse.test.ts

Documentation (8) +46 / -10
AGENTS.mdClarify publication, memory, and spending rules +6/-2

Clarify publication, memory, and spending rules

• Requires explicit repository targets and per-run spending approval, and identifies the approved shared-preferences memory scope.

AGENTS.md

codex-review-throttling.mdLimit what a prior review record proves +3/-1

Limit what a prior review record proves

• Clarifies that a matching ledger record covers committed HEAD and scope, not the base, working tree, environment, or artifacts.

docs/agents/codex-review-throttling.md

publication-workflows.mdScope readiness formatting to owned paths +3/-1

Scope readiness formatting to owned paths

• Replaces whole-tree formatting guidance with formatting of owned handoff paths and verification of the content intended for publication.

docs/agents/native-startup/publication-workflows.md

shared-context-and-memory.mdDefine shared memory and publication safeguards +24/-4

Define shared memory and publication safeguards

• Documents curated, scoped memory saves; explicit publication targets; and approval, cost-bound, and reporting requirements for each billable run.

docs/agents/shared-context-and-memory.md

verification-gates.mdAlign ordinary PR formatting guidance +3/-1

Align ordinary PR formatting guidance

• Specifies owned-path formatting and verification of the exact publication candidate rather than requiring whole-tree formatting.

docs/agents/verification-gates.md

ci-operations.mdClarify CI behavior when undrafting +3/-1

Clarify CI behavior when undrafting

• Explains that undrafting may restart work or enable readiness jobs, but changed-file predicates still determine job selection.

docs/ci-operations.md

delivery.jsonMap the Vitest reuse test to Delivery +1/-0

Map the Vitest reuse test to Delivery

• Adds the new receipt-reuse test to the Delivery system inventory.

docs/organisation/systems/delivery.json

knowledge.jsonMap Codex hooks to Knowledge +3/-0

Map Codex hooks to Knowledge

• Registers the Codex hook configuration, dispatcher, and tests in the Knowledge system inventory.

docs/organisation/systems/knowledge.json

Other (2) +7 / -1
.gitignoreTrack the Codex hook adapter +5/-0

Track the Codex hook adapter

• Allows the hook registration, dispatcher, and synthetic tests to be committed while retaining the broader .codex ignore rule.

.gitignore

package.jsonInclude Codex hook checks in cheap verification +2/-1

Include Codex hook checks in cheap verification

• Adds a dedicated adapter test command and runs it as part of the cheap verification gate.

package.json

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cbb9370a53

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .codex/hooks/dispatch.mjs Resolved
@qodo-code-review

qodo-code-review Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

No findings for this group


Remediation recommended

No findings for this group


Informational

No findings for this group

Grey Divider


Resolved findings

1. Quoted checkout pushes skip formatting ✓ Resolved
Description
push-format-guard.sh does not recognize a git -C path enclosed in single quotes when the path
contains spaces, although the Codex adapter routes that command to the guard. In a checkout without
a wired pre-push hook, a command such as git -C '/tmp/My Repo' push exits before the formatting
check, leaving CI to catch an unformatted push.
Code

.claude/hooks/push-format-guard.sh[81]

+printf '%s' "$command_text" | grep -Eq '(^|[;&|[:space:]])git([[:space:]]+(-[Cc][[:space:]]+("[^"]*"|[^[:space:]]+)|--?[[:alnum:]-]+(=[^[:space:]]*)?))*[[:space:]]+push([[:space:]]|$)' || exit 0
Relevance

●●● Strong

Adapter and shell guard disagree on valid quoted paths; repository history accepts realistic hook
coverage gaps.

PR-#2318
PR-#2249

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The review skill calls for realistic failure paths. The adapter's new push expression accepts
single-quoted -C paths, but the shell guard's new expression accepts only double-quoted paths or a
whitespace-delimited token; the added guard tests do not cover the single-quoted case.

.codex/hooks/dispatch.mjs[56-56]
.claude/hooks/push-format-guard.sh[81-81]
tests/push-format-guard.test.ts[307-319]
Skill: review

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The push-format guard misses `git -C` commands whose checkout path is single-quoted and contains spaces, even though the Codex adapter selects the guard for them.

## Fix Focus Areas
- .claude/hooks/push-format-guard.sh[81-81]
- tests/push-format-guard.test.ts[307-319]

## Recommended Fix
Extend the guard's push discriminator to accept a single-quoted `-C` argument. Add a regression test using a single-quoted checkout path containing spaces with the pre-push hook unwired, and assert that the formatting guard fires.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Local report merges can be skipped ✓ Resolved
Description
vitestRunIsMemoisable excludes --mergeReports but not Vitest's supported --merge-reports
spelling. A local run --merge-reports=.vitest-ci --reporter=default invocation can therefore reuse
an earlier receipt and exit before Vitest performs the requested merge; the repository's CI coverage
command also uses this spelling, but includes --coverage and is not subject to this bypass.
Code

scripts/run-vitest.mjs[182]

+const NON_MEMOISABLE_ARGUMENT = /^--(?:coverage|watch|update|ui|outputFile|output-file|mergeReports|config)(?:[.=]|$)/;
Relevance

●●● Strong

Recent memoization precedent accepts excluding artifact-producing CLI variants to prevent stale
receipt reuse.

PR-#2216

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed exclusion names only the camelCase option, while the receipt path exits before spawning
Vitest for eligible runs. Repository tests establish the hyphenated spelling as an invocation used
for report merging. The gates skill requires proof that a gate actually ran before it is treated as
green.

scripts/run-vitest.mjs[182-201]
scripts/run-vitest.mjs[218-226]
tests/ci-cache-safety.test.ts[108-113]
Skill: gates

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Local Vitest report merges using `--merge-reports` are eligible for receipt reuse, so a later invocation can skip the merge.
## Fix Focus Areas
- scripts/run-vitest.mjs[182-201]
- tests/vitest-result-reuse.test.ts[1-24]
## Recommended Fix
Exclude both supported spellings of the merge-reports option, including `=value` forms, from memoisation. Add a regression assertion for `run --merge-reports=.vitest-ci --reporter=default`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Hook runs code from any repo the agent enters ✓ Resolved
Description
The trusted bootstrap uses the payload's tool_input.workdir/cwd, which the model controls, to
find a checkout. It then import()s that checkout's .codex/hooks/dispatch.mjs, and execute()
runs that checkout's .claude/hooks/*.sh through bash. If an agent runs any shell command inside a
cloned or untrusted repository that ships these files, its code runs as an unsandboxed hook. Codex
never asks for review, because it trusts only the unchanged hooks.json hash, not the files the hook
loads at runtime.
Code

.codex/hooks/dispatch.mjs[136]

+    '(async()=>{const f=require("node:fs"),p=require("node:path"),u=require("node:url");let s="";for await(const b of process.stdin){s+=b;if(s.length>1048576)return;}let v;try{v=JSON.parse(s)}catch{return}if(!v||typeof v!=="object"||Array.isArray(v))return;let d=v.tool_input?.workdir??v.tool_input?.cwd??v.cwd??process.cwd();if(typeof d!=="string"||!p.isAbsolute(d))return;d=p.resolve(d);if(["GIT_DIR","GIT_COMMON_DIR","GIT_WORK_TREE","GIT_CEILING_DIRECTORIES","GIT_DISCOVERY_ACROSS_FILESYSTEM"].some(k=>process.env[k])){const g=require("node:child_process").spawnSync("git",["-C",d,"rev-parse","--show-toplevel"],{encoding:"utf8",windowsHide:true,timeout:5000});if(g.status!==0)return;d=p.resolve(g.stdout.trim())}else{if(f.existsSync(p.join(d,"HEAD"))&&f.existsSync(p.join(d,"objects"))&&f.existsSync(p.join(d,"refs")))return;while(!f.existsSync(p.join(d,".git"))){const q=p.dirname(d);if(q===d)return;d=q;}}const a=p.join(d,".codex/hooks/dispatch.mjs");if(!f.existsSync(a))return;const m=await import(u.pathToFileURL(a).href),r=await m.run(process.argv[1],v,d);process.stdout.write(r.stdout);process.stderr.write(r.stderr);process.exitCode=r.code;})().catch(()=>{process.stderr.write("Codex project hook adapter unavailable; no advisory decision was produced.\\n")})';
Relevance

●● Moderate

Serious trust-boundary concern, but changing checkout selection is architectural and lacks a close
precedent.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The bootstrap string resolves d from v.tool_input?.workdir??v.tool_input?.cwd??v.cwd, walks up
to the nearest .git, and does await import(pathToFileURL(join(d,'.codex/hooks/dispatch.mjs'))).
execute() then spawns /bin/bash path.join(root, action.file). Codex documentation says hook
trust is recorded against the hook definition's hash, so code loaded from a different checkout never
goes through review.

.codex/hooks/dispatch.mjs[131-146]
.codex/hooks/dispatch.mjs[81-98]
🌐 Before a non-managed command hook can run, Codex requires you to review and trust the exact hook definition. Codex records trust against the hook's current hash.

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Codex hook bootstrap picks a repository root from the model-supplied tool workdir. It then imports and executes `.codex/hooks/dispatch.mjs` and `.claude/hooks/*.sh` from that root, which can be any checkout, including an untrusted one.

## Fix Focus Areas
- .codex/hooks/dispatch.mjs[131-156]
- .codex/hooks.json[1-54]

## Recommended Fix
Resolve the adapter from the project that registered the hook, for example the session `cwd` that Codex uses to discover `.codex/hooks.json`, not from `tool_input.workdir`. Refuse to run when the workdir-derived root differs from that project root. Alternatively, check the resolved root's origin and identity before importing. Regenerate hooks.json from `registration()`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View resolved (10)
4. Failed PR commands can open handoff ✗ Dismissed
Description
The new GH_FLAGS and shell regexes allow any option-shaped token without requiring its documented
argument, so --repo can be treated as a flag-less option and the following pr token as the
subcommand. A failed command such as gh --repo pr create combined with a later command that prints
a pull-request URL can therefore dispatch the handoff hook and persist an open-PR marker even though
no PR was created.
Code

.codex/hooks/dispatch.mjs[R57-58]

+const GH_FLAGS = String.raw`(?:\s+(?:-R\s*\S+|--repo(?:=|\s+)\S+|--?[\w-]+(?:=\S*)?))*`;
+const GH_PR_CREATE = new RegExp(String.raw`(?<![\w-])gh${GH_FLAGS}\s+pr${GH_FLAGS}\s+create(?![\w-])`);
Relevance

●●● Strong

Recent hook precedents accept narrowly scoped hardening against unsafe command matching and
shell-triggered side effects.

PR-#2246
PR-#3597

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Both changed matchers include a permissive generic option branch (--?[\w-]+ / --?[[:alnum:]-]+)
that can match --repo without consuming a value. The adapter dispatches the handoff hook whenever
that regex matches, while the shell hook subsequently relies on the command match plus a URL in tool
output before writing the marker, so a compound invalid command followed by printed URL text can
satisfy both conditions.

.codex/hooks/dispatch.mjs[56-58]
.codex/hooks/dispatch.mjs[116-120]
.claude/hooks/pr-handoff-stop.sh[253-265]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The generic option alternative in `GH_FLAGS` accepts options such as `--repo` without their required value and can reinterpret the following `pr` token as the command. This causes invalid or failed commands to trigger PR handoff processing, especially when unrelated output contains a pull-request URL.

## Fix Focus Areas
- .codex/hooks/dispatch.mjs[56-58]
- .claude/hooks/pr-handoff-stop.sh[253-253]

## Recommended Fix
Replace the generic option fallback with parsing that recognizes only supported `gh` global and `pr create` options, requiring values where the CLI requires them. Keep the JavaScript adapter and shell hook grammars equivalent, and add regression tests for invalid forms such as `gh --repo pr create` and compound commands where a failed `gh` invocation is followed by unrelated pull-request URL output.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Some pushes bypass the format guard ✓ Resolved
Description
The new push detectors require whitespace after -C, so neither recognizes the valid command `git
-C/tmp/repo push`. When that command runs from a checkout without a wired pre-push hook, Codex does
not dispatch the format guard, and the shell hook also exits before checking formatting.
Code

.claude/hooks/push-format-guard.sh[81]

+printf '%s' "$command_text" | grep -Eq '(^|[;&|[:space:]])git([[:space:]]+(-[Cc][[:space:]]+("[^"]*"|[^[:space:]]+)|--?[[:alnum:]-]+(=[^[:space:]]*)?))*[[:space:]]+push([[:space:]]|$)' || exit 0
Relevance

●●● Strong

Valid push syntax is missed by both detectors; recent hook edge-case fixes were accepted.

PR-#2318
PR-#2246

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Both detectors accept -C only when followed by whitespace. Codex schedules the guard only after
its detector matches; the shell guard exits immediately when its own detector does not match, before
reaching the repository-wide formatting check.

.codex/hooks/dispatch.mjs[56-56]
.codex/hooks/dispatch.mjs[106-111]
.claude/hooks/push-format-guard.sh[80-81]
.claude/hooks/push-format-guard.sh[150-158]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Valid pushes using an attached `-C` path bypass both push detectors and, in an unwired checkout, the format guard.

## Fix Focus Areas
- .claude/hooks/push-format-guard.sh[81-81]
- .codex/hooks/dispatch.mjs[56-56]
- tests/push-format-guard.test.ts[307-319]

## Recommended Fix
Update both detectors to accept attached as well as separated `-C` values. Add a test for `git -C/tmp/repo push` that exercises the shell guard and Codex dispatch.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Protected-file warnings miss named edits ✓ Resolved
Description
plan() routes edit_file, write_file, and their functions.* variants to the organisation
warning hook without translating their tool names to ones that hook accepts. When one of those tools
edits a protected file, editHookOutput() returns before inspecting the file path, so no warning
reaches the agent.
Code

.codex/hooks/dispatch.mjs[R63-64]

+    if (["Edit", "Write", "MultiEdit", "NotebookEdit", "edit_file", "write_file", "functions.edit_file", "functions.write_file"].includes(p.tool_name))
+      return [{ file: ".claude/hooks/organisation-edit-warning.sh", args: [] }];
Relevance

●●● Strong

Concrete hook-routing bug prevents protected-file warnings for newly supported edit tools; similar
hook correctness fixes were accepted.

PR-#2246
PR-#2249

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The adapter now selects the warning hook for these tool names, but its normalization leaves them
unchanged. The selected hook accepts only Claude edit tool names and returns before evaluating the
target file for every newly routed Codex name.

.codex/hooks/dispatch.mjs[37-53]
.codex/hooks/dispatch.mjs[62-65]
.codex/hooks/dispatch.mjs[90-110]
scripts/organisation/agent-hooks.mjs[38-38]
scripts/organisation/agent-hooks.mjs[340-347]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The newly routed Codex edit tool names are rejected by the Claude organisation warning hook, silently losing protected-file warnings.

## Fix Focus Areas
- .codex/hooks/dispatch.mjs[37-53]
- .codex/hooks/dispatch.mjs[62-65]
- .codex/hooks/dispatch.test.mjs[1-155]

## Recommended Fix
Translate the Codex edit and write tool names to the corresponding names accepted by the organisation hook before passing the payload to its runner. Add a synthetic protected-file edit test that checks the warning output, not just the planned action.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. PR formatting guidance conflicts ✓ Resolved
Description
The revised publication workflow tells agents to format only owned handoff paths, while the
verification-gates guide still directs ordinary PR pushes to run npm run format. Following that
unchanged instruction runs whole-tree Prettier and can modify paths outside the handoff scope
despite the new workflow's narrower direction.
Code

docs/agents/native-startup/publication-workflows.md[66]

+- For Run PR sweeps and normal readiness pushes — never an explicit bare PR publication — format only the owned handoff paths with `node node_modules/prettier/bin/prettier.cjs --write <owned-path> ...` (requires the existing local dependency), then run `npm run verify:pr-local` (or the smallest gate that covers the change). Verify the exact candidate content that will be published; formatting left only in the working tree does not prove the committed blob. Commit and publication still require applicable authority. Whole-tree formatting is a separate, explicitly scoped operation. Format is in `static-pr` but not in `verify:cheap`.
Relevance

●●● Strong

The two guides give directly conflicting formatting commands, creating deterministic whole-tree
versus owned-path behavior.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed workflow prescribes owned-path formatting and calls whole-tree formatting a separate
operation. The ordinary-PR gate instruction still requires npm run format, whose package script
formats the whole tree.

docs/agents/native-startup/publication-workflows.md[63-67]
docs/agents/verification-gates.md[69-75]
package.json[192-192]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Two delivery guides now prescribe different formatting scopes for the same ordinary PR push.

## Fix Focus Areas
- docs/agents/native-startup/publication-workflows.md[63-67]
- docs/agents/verification-gates.md[69-75]

## Recommended Fix
Update the ordinary-PR gate guidance to distinguish owned-path formatting from an explicitly scoped whole-tree format operation. Keep its verification requirements consistent with the publication workflow.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


8. Memory rule again allows an unnamed shared scope ✓ Resolved
Description
Rule 11 now adds "the approved shared-preferences/continuity scope" to the list of allowed
Supermemory namespaces, but never names which namespace that is. The same change replaces
exact-content approval with automatic curated saves. An agent following the rule can choose any
account space it considers 'continuity', such as codex_continuity, and save to it without per-item
approval, which reopens the cross-project scope the rest of the rule forbids.
Code

AGENTS.md[16]

+11. Use confirmed, authorised memory services (including Supermemory MCP via `supermemory-context` and scoped local SQLite checkpoints) with the explicit owning project scope (`namespace` on the current hosted server, `containerTag` on older connectors; one of `psychsift_engineering`, `wardflow_design`, `caring_contacts_engineering` or `communication_engineering`, or the approved shared-preferences/continuity scope when curating cross-project preferences). No account-default or cross-project fallback, automatic transcript capture, bulk upload or background synchronization. Apply the approved curated-save policy for short checked nonclinical decisions and handovers while preserving host-specific restrictions and per-run spending approval. Forgetting or content outside that scope needs exact-content/destination approval. Continue from current files and a checkpoint if memory is unavailable.
Relevance

●●● Strong

Exact recent precedent rejected an extra continuity namespace beyond four explicitly named project
scopes.

PR-#3545

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The same files previously listed codex_continuity as an allowed scope. That was rejected as an
unapproved memory scope and narrowed to exactly four named namespaces. This PR adds an unnamed fifth
scope in both AGENTS.md and the shared guide, and removes the exact-content approval for saves.

docs/agents/shared-context-and-memory.md[17-19]
PR-#3545

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
AGENTS.md rule 11 and the shared memory guide allow an unnamed 'shared-preferences/continuity scope' and automatic saves into it, so agents have to guess which namespace is meant.

## Fix Focus Areas
- AGENTS.md[16-16]
- docs/agents/shared-context-and-memory.md[17-19]

## Recommended Fix
Replace the description with the exact approved namespace literal, and say that only cross-project working preferences may go there. Keep exact-content approval for any save outside the curated policy.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


9. Hook adapter checks never run in CI ✓ Resolved
Description
.codex/hooks/dispatch.test.mjs sits outside tests/, and the Vitest projects only include
tests/**/*.test.ts and tests/**/*.dom.test.tsx. No npm script or workflow runs this file. So the
assertion that .codex/hooks.json matches registration(), and all routing checks, run only when
someone launches them by hand; the hand-copied hooks.json can drift from the generator without
anything failing.
Code

.gitignore[R31-32]

+!/.codex/hooks/dispatch.mjs
+!/.codex/hooks/dispatch.test.mjs
Relevance

●●● Strong

Repository precedent accepts findings where added tests are collected but not scheduled or executed
by CI.

PR-#3485

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The Vitest include globs cover only tests/. Searching package.json, scripts and workflows finds no
reference to dispatch.test or .codex/hooks. The only test that compares hooks.json with
registration() is in the unrun file.

vitest.config.mts[108-128]
.codex/hooks/dispatch.test.mjs[183-196]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`.codex/hooks/dispatch.test.mjs` is not run by any Vitest project, npm script or CI workflow, so the check that hooks.json matches `registration()` never gates a change.

## Fix Focus Areas
- vitest.config.mts[108-128]
- package.json[50-60]

## Recommended Fix
Add a script such as `"test:codex-hooks": "node --test .codex/hooks/dispatch.test.mjs"` and include it in `verify:cheap`/`static-pr`, or add a thin `tests/codex-hooks-dispatch.test.ts` that covers the registration equality.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


10. Codex edits miss clinical-risk warnings ✓ Resolved
Description
The new PreToolUse matcher excludes edit tools, and plan() has no action for the existing
organisation-edit-warning.sh hook. When a Codex edit touches a protected ranking path, migration,
or clinical-risk file, the adapter never requests the warning context that the Claude project hook
supplies.
Code

.codex/hooks/dispatch.mjs[150]

+      PreToolUse: [{ matcher: `^(?:${shells}|CronCreate)$`, hooks: [hook("PreToolUse")] }],
Relevance

●●● Strong

Past review accepted extending Codex clinical safeguards when named protected paths were omitted.

PR-#2327

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Claude registers the warning for edits, and its script can emit PreToolUse context for protected
paths. The new Codex registration and plan omit that action. Codex documents that file edits through
apply_patch can match Edit or Write, although their input still reports apply_patch;
supporting them also requires payload translation.

.claude/settings.json[525-535]
scripts/organisation/agent-hooks.mjs[307-326]
scripts/organisation/agent-hooks.mjs[339-377]
.codex/hooks/dispatch.mjs[56-78]
.codex/hooks/dispatch.mjs[147-153]
🌐 Codex documents apply_patch edit-hook aliases and the tool name reported in hook input.

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Codex adapter does not dispatch the existing edit-time organisation warnings for protected files.

## Fix Focus Areas
- .codex/hooks/dispatch.mjs[37-78]
- .codex/hooks/dispatch.mjs[147-153]
- .codex/hooks.json[3-15]

## Recommended Fix
Register supported Codex edit calls, translate their input into the file-path and tool-name shape expected by the organisation warning hook, and dispatch that hook before the edit. Add synthetic tests for protected-file edits.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


11. Windows hooks fail when Node is installed elsewhere ✓ Resolved
Description
commandWindows pins Node to C:/Program Files/nodejs/node.exe, while execute() pins Bash to
C:/Program Files/Git/bin/bash.exe, with no PATH fallback. On Windows hosts using fnm/nvm or a
different Git installation, hooks fail to launch or report 'unavailable', so their advisory
decisions, session context, push-format checks, and PR-handoff checks do not run.
Code

.codex/hooks/dispatch.mjs[R83-87]

+  const binary = action.file.endsWith(".mjs")
+    ? process.execPath
+    : process.platform === "win32"
+      ? "C:/Program Files/Git/bin/bash.exe"
+      : "/bin/bash";
Relevance

●●● Strong

Recent Windows tooling precedent accepts PATH-based runtime fallback when fixed executable paths
fail.

PR-#3587

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The generated Windows command and checked-in registration name a fixed Node executable, and
registration also pins Bash without a PATH fallback. The repository lists fnm among its CLIs and its
Windows setup tooling uses the active runtime, so Node need not be under Program Files; the added
test checks the fixed command spelling rather than whether the executable is available.

.claude/settings.json[484-484]
.codex/hooks/dispatch.mjs[141-146]
.codex/hooks/dispatch.mjs[141-145]
.codex/hooks.json[9-10]
scripts/setup-codex-worktree.mjs[80-100]
.codex/hooks/dispatch.test.mjs[183-190]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Windows hook command and Bash launcher assume fixed installation paths, preventing hooks from running when Node or Git is installed elsewhere.

## Fix Focus Areas
- .codex/hooks/dispatch.mjs[81-98]
- .codex/hooks/dispatch.mjs[137-146]
- .codex/hooks.json[9-10]
- .codex/hooks/dispatch.test.mjs[183-190]

## Recommended Fix
In `execute()`, use the fixed Bash path only when it exists; otherwise resolve `bash` from PATH. Generate the Windows hook command to use the pinned Node executable when present and fall back to `node` from PATH when it is missing. Regenerate the checked-in `hooks.json` and test execution with a synthetic Node installation outside Program Files.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


12. Focused test runs can no longer reuse results ✓ Resolved
Description
vitestRunIsMemoisable now requires argumentList[0] === "run". But test:focused calls the
runner as related --run <files>. Those plain console runs now always run again, even when nothing
changed, which the PR's goal of restricting reuse to artifact-producing runs did not call for.
Code

scripts/run-vitest.mjs[R184-185]

+  argumentList[0] === "run" &&
+  !argumentList.some((argument) => /^-(?:u|w|o|c)(?:=|$)/.test(argument) || NON_MEMOISABLE_ARGUMENT.test(argument)) &&
Relevance

●●● Strong

Recent precedent explicitly accepts restricting receipt arbitration to canonical full-suite runs,
excluding focused invocations.

PR-#2245

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
test-focused.mjs passes related as the first argument, so the new check returns false and the
receipt lookup is skipped.

scripts/test-focused.mjs[68-72]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Requiring `run` as the first argument stops focused `related --run` runs from reusing receipts.

## Fix Focus Areas
- scripts/run-vitest.mjs[182-201]

## Recommended Fix
Treat `argumentList[0] === "run"`, or `argumentList[0] === "related"` together with `--run`, as non-interactive. Make sure the receipt key covers the related input files, and add a test case.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


13. Cloud host guidance is now duplicated ✓ Resolved
Description
The shared 'Check the actual host' paragraph was reworded to drop the Cloud policy link. A new
project block then re-adds almost the same paragraph with the link restored. Agents now get two
slightly different instructions for the same topic, and a later edit to one will not reach the
other.
Code

docs/agents/shared-context-and-memory.md[R44-48]

+## Project scope and host safeguards
+
+_Updated 2026-10-17 — preserved existing project-specific instructions; Documentation owns._
+
+Cloud sessions use the selected repository revision and their own tools, access, runtime and account settings. Personal Windows paths, desktop plugins, local services, credentials and OAuth sessions do not automatically transfer. Repository guidance cannot install a connector or grant permissions. Check the current branch/commit and actual callable tools before relying on them. Follow [the current Cloud policy](codex-cloud-environment.md); preserve applicable dependency, provider and selected-environment setup/raw-boundary gates. Use supported account settings for authenticated connectors; never copy secrets into tracked files or bypass setup-only secret boundaries.
Relevance

●● Moderate

The duplicated host paragraph is real, but the project-specific block may intentionally preserve
scoped guidance.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The paragraph in the new project block (line 48) matches the original paragraph removed from line
27, while the shared paragraph at line 31 now omits the Cloud policy link.

docs/agents/shared-context-and-memory.md[29-49]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Two nearly identical 'actual host' paragraphs now exist in the shared memory guide.

## Fix Focus Areas
- docs/agents/shared-context-and-memory.md[29-49]

## Recommended Fix
Keep the shared paragraph, and limit the project block to only the project-specific sentence (the Cloud policy link and the setup/raw-boundary gates).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 9 rules
✅ Cross-repo context — repo relationships
Review mode: Auto: 🚀 Fast: Localized hook detection change with focused tests and contained behavioral impact.

Grey Divider

Tip of the day
💡 Did you know, you can move or hide resolved findings to focus on what still needs action

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread .codex/hooks/dispatch.mjs Resolved
Comment thread .codex/hooks/dispatch.mjs Resolved
Comment thread .gitignore Resolved
Comment thread AGENTS.md Resolved
Comment thread .codex/hooks/dispatch.mjs Resolved
Comment thread scripts/run-vitest.mjs Resolved
- Exclude hyphenated report merges from reuse
- Allow memoisation for focused related runs
- Pin the hook adapter to the trusted project
- Dispatch protected-file edit warnings
- Add Windows Node and Bash fallbacks
gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 18, 2026

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gitar has auto-approved this PR (configure)

push-format-guard.sh and the Codex dispatcher's GIT_PUSH missed
`git -C '/tmp/My Repo' push` (no single-quoted alternative in the guard) and
`git -C/tmp/repo push` (whitespace after -C was required), so the format
check could be skipped. Both matchers now accept a single-quoted, double-quoted
or attached -C value. Regression tests cover both forms, including in the
guard's unwired pre-push case.
gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 18, 2026

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gitar has auto-approved this PR (configure)

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit b9c7b1c

…al vitest memoisation rule

- verify:cheap:internal ran test:codex-hooks before check:installed-lock-parity, and the
  parity contract treats "npm run test:codex-hooks" as the first test interpretation. Run
  the stale-install check first, as the contract requires.
- gate-receipts coverage-form tests scraped a one-line regex out of scripts/run-vitest.mjs,
  which stopped matching once the constant was reformatted across two lines. Call the
  exported vitestRunIsMemoisable instead so the assertions exercise the real decision.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V2VWJXoHMnr3XnAhrREN8V
gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 18, 2026

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gitar has auto-approved this PR (configure)

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit fd4831e

@BigSimmo

Copy link
Copy Markdown
Owner Author

Grok Bot sweep coordination: I took the three git -C guard-bypass threads. They're fixed in b9c7b1c, replied to and resolved. Claude's 83c5d7d and fd4831e cover the Unit coverage failures (installed-lock parity order and the gate-receipts test), so I've dropped my overlapping local fixes and won't push those. From here I'm only watching CI on fd4831e and leaving auto-merge armed. If anything else needs fixing, I'll comment here before taking it.

@BigSimmo
BigSimmo disabled auto-merge October 18, 2026 08:39
@BigSimmo
BigSimmo marked this pull request as draft October 18, 2026 08:39
@BigSimmo
BigSimmo marked this pull request as ready for review October 18, 2026 09:04

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BigSimmo has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@BigSimmo
BigSimmo enabled auto-merge (squash) October 18, 2026 09:04
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit fd4831e

@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo Fixer

Found 12 findings, but none include a fix that can be applied automatically.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd4831e44b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .codex/hooks/dispatch.mjs Resolved
The Codex adapter and the shared handoff hook only matched an adjacent
'gh pr create', so 'gh --repo X pr create' or 'gh pr -R X create' never
wrote the PR handoff marker. Accept gh's inherited -R/--repo flag between
the words in both places, with tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V2VWJXoHMnr3XnAhrREN8V
Comment thread .codex/hooks/dispatch.mjs Resolved
My earlier left anchor required whitespace or a separator before gh, so
$(gh pr create), quoted shell strings and /usr/bin/gh no longer reached the
handoff hook. Use a word-boundary lookbehind instead, and add those forms
to the adapter tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V2VWJXoHMnr3XnAhrREN8V

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gitar has auto-approved this PR (configure)

@gitar-bot

gitar-bot Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor
Code Review ✅ Approved 4 closed / 4 findings

🔴 High risk · Automatically authorizing scoped Supermemory writes for nonclinical project decisions could persist content in an unintended namespace if agents misread scope.

Restricts Vitest result receipt reuse to eligible console runs, makes the push guard refuse when Node is missing, and adds a portable Codex hook adapter that routes supported events to existing hooks. Resolved this session: kebab-case --merge-reports no longer allows receipt reuse, Windows bash lookup prefers Git Bash over the WSL launcher, the push guard now handles single-quoted -C paths, and gh pr create detection covers command substitution, quoted forms and path prefixes while still rejecting lookalikes such as ghx pr create. No open findings remain.

✅ 4 closed
✅ Edge Case: Kebab-case --merge-reports still allows receipt reuse

📄 scripts/run-vitest.mjs:182-185 📄 tests/vitest-result-reuse.test.ts:5-18
The new NON_MEMOISABLE_ARGUMENT lists both outputFile and output-file, but only the camelCase mergeReports. Vitest's CLI parser (cac) also accepts --merge-reports, so node scripts/run-vitest.mjs run --merge-reports still counts as memoisable. That run's result depends on blob report files under .vitest-reports, which are not receipt inputs, so a stale pass receipt can be reused after those blobs change. This undercuts the PR's goal of excluding artifact-dependent runs. Add the kebab-case spelling and a test case for it.

✅ Bug: Windows bash lookup can pick the WSL launcher instead of Git Bash

📄 .codex/hooks/dispatch.mjs:85-90
execute now runs where.exe bash and, if that succeeds, spawns a bare bash from PATH. On Windows machines with WSL installed, C:\Windows\System32\bash.exe (the WSL launcher) is usually the first match, because System32 comes before Git's directories in PATH. The WSL launcher then gets a Windows script path such as C:\...\.claude\hooks\push-format-guard.sh, which it cannot resolve. The hook exits with an error, run reports "Codex project hook unavailable", and the push-format, PR-handoff and edit-warning advisories silently stop working. The previous code pinned Git Bash, which avoided this, and the PR summary still says the Bash path is pinned. A smaller cost: every bash action now starts an extra where.exe process. Fix: try the pinned Git Bash path first and fall back to PATH only when it is missing, ignoring any result under System32.

✅ Bug: Push guard regex skips single-quoted -C paths that the adapter routes

📄 .claude/hooks/push-format-guard.sh:81 📄 .codex/hooks/dispatch.mjs:56 📄 .codex/hooks/dispatch.mjs:110-111 📄 tests/push-format-guard.test.ts:307-318
The adapter's GIT_PUSH (dispatch.mjs:56) accepts a single-quoted -C value ('[^']*'), so git -C 'C:/My Repo' push gets routed to push-format-guard.sh. The guard's own ERE (push-format-guard.sh:81) only accepts a double-quoted value or [^[:space:]]+. For that command it matches 'C:/My, then can't match Repo' as an option, so grep -Eq fails and the hook exits 0 without running the format check. Single quotes are the usual quoting in PowerShell and common in Bash, so this push goes out unchecked even though the comment says the two regexes mirror each other. The fix is to add a single-quoted alternative to the shell regex and a test case for a quoted path with a space.

✅ Bug: GH_PR_CREATE left anchor drops $(gh pr create) and quoted forms

📄 .codex/hooks/dispatch.mjs:57-58 📄 .codex/hooks/dispatch.mjs:118
The old unanchored /gh\s+pr\s+create/ matched any occurrence. The new GH_PR_CREATE requires gh to sit at the start of the string or after one of [;&|\s]. Common forms where gh follows (, a backtick, a quote or a path separator no longer match: url=$(gh pr create --fill), bash -lc "gh pr create", (gh pr create), /usr/bin/gh pr create. For those commands, the Codex PostToolUse event no longer sends anything to pr-handoff-stop.sh post. The PR-handoff marker is never written, so CronCreate is not blocked after a PR is opened.

The bash hook's own regex (pr-handoff-stop.sh:253) has no left anchor and would still match these commands. The two detectors now disagree, and this is a regression from the previous behaviour. Fix: widen the anchor class to include (, a backtick, ", ' and /, or drop the anchor to match the shell hook. Also add a $(gh pr create ...) case to dispatch.test.mjs.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Approved

For more verification details, comment gitar display:verbose.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Important

Your trial ends in 3 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more.

Was this helpful? React with 👍 / 👎 | Gitar

Comment thread .codex/hooks/dispatch.mjs Resolved
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit e30a90e

@BigSimmo
BigSimmo merged commit 675fec3 into main Oct 18, 2026
51 checks passed
@BigSimmo
BigSimmo deleted the codex/agent-policy-delivery-20261017 branch October 18, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔴 Large blast radius size:XL This PR changes 500-999 lines, ignoring generated files 🕐 40+ Minutes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants