Skip to content

fix: scope event-driven wait ids - #40

Open
bouillipx wants to merge 5 commits into
developfrom
fix/event-driven-wait-id-followup
Open

fix: scope event-driven wait ids#40
bouillipx wants to merge 5 commits into
developfrom
fix/event-driven-wait-id-followup

Conversation

@bouillipx

Copy link
Copy Markdown

Summary

Follow-up to PR #35 after the reviewer found two current-head P2 issues after #35 had already merged:

  • Scope event-driven external wait coverage to canonical external ids instead of a route-wide boolean.
  • Keep same-turn issue tracking coverage limited to issue ids, so it cannot validate PR waits.
  • Stop granting event-driven wait coverage for non-approved review-feedback wakes; only approved merge-intent wakes get PR coverage.

Validation

  • pnpm --dir packages/api run build
  • Focused routing/review-feedback RED to GREEN tests
  • Expanded routing/connector/scheduler suite: 367 tests passed
  • pnpm check
  • git diff --check
  • node scripts/check-hotfix-pattern.mjs -> hotfix=true

Notes

This is hotfix follow-up work and still needs independent review before merge.

@bouillipx
bouillipx requested a review from zts212653 as a code owner June 28, 2026 17:08
Why: reviewer found route-wide event-driven wait coverage could validate mismatched PR/issue waits, and non-approved review feedback wakes were still claiming future callback coverage without pickup proof.

Changed: propagate canonical event-driven wait coverage keys through connector, queue, router, and routing guards; same-turn issue tracking now covers only issue ids; review feedback only grants coverage for approved merge-intent wakes.

Validation: pnpm --dir packages/api run build; focused routing/review-feedback tests; expanded 367-test routing/connector/scheduler suite; pnpm check; git diff --check; node scripts/check-hotfix-pattern.mjs.

[砚砚/GPT-5.5🐾]
@bouillipx
bouillipx force-pushed the fix/event-driven-wait-id-followup branch from 0abb388 to 7f8e7ed Compare July 7, 2026 15:06
@bouillipx
bouillipx changed the base branch from main to develop July 7, 2026 15:06
@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

mentionPatterns: [...(binding.mentionPatterns ?? [])],

P2 Badge Default plugin providers to a mentionable handle

When an operator approves an agentProvider with only the required catId (the approval API makes mentionPatterns optional), this projection registers the synthetic CatConfig with an empty mentionPatterns array. User-authored @ mentions are resolved from the registered configs' mentionPatterns, so @<catId> for the newly routeable provider is treated as unknown instead of invoking it. Please default to [@${binding.catId}] or require/normalize mention patterns during approval.



P2 Badge Use a CatColor object for synthetic configs

Approved plugin-projected configs are registered in catRegistry and can be returned by /api/cats; frontend consumers treat color as { primary, secondary } and read cat.color.primary. Setting it to the string 'gray' violates the CatConfig shape for these providers, leaving their messages/avatars with undefined color values or fallback rendering. Use a real CatColor object here.

ℹ️ 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".

Why: PR #40 exposed three stale governance gates after the branching-model correction: directory exceptions expired, public-test exclusions expired, and API utils still exceeded ADR-010 as a flat directory.\n\nSplit packages/api/src/utils into real subdomains, update imports/tests to the new paths, refresh the time-boxed public/dir exceptions to 2026-07-31, and fix the upload-dir default that moved with upload-paths.ts. Also update the cat roster assertion for the existing catagent entry.\n\nValidation: bash scripts/check-dir-size.sh; git diff --check; pnpm check; targeted public tests for cat config, cli-spawn source contracts, image upload paths, skill-source, and telemetry source contracts. Full local test:public is blocked by sibling worktree skill-mount pollution outside this branch; public resolver now succeeds.

@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: 00a610977f

ℹ️ 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".

coverageKeys.map((key) => normalizeEventDrivenExternalWaitKey(key)).filter((key): key is string => key !== null),
);
if (covered.size === 0) return false;
return extractEventDrivenExternalWaitKeys(text).some((key) => covered.has(key));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require every external wait id to be covered

When the final routing slot contains more than one External Wait: event-driven (...) line, this .some accepts the entire response as soon as one id matches coverage. For example, a connector wake covering issue:owner/repo#1 would also let a same-slot External Wait: event-driven (pr:owner/repo#1) bypass remedial routing, so the cat can stop on a PR wait that has no verified callback path. This should reject any uncovered external-wait id rather than treating one covered id as route-wide coverage.

Useful? React with 👍 / 👎.

bouillipx added a commit that referenced this pull request Jul 7, 2026
Why:\n- Fix PR #41 cloud P2 findings by normalizing routeable identities, honoring manifest providerId, and preserving approved descriptors across capability-lock activation.\n- Carry the PR #40 Directory Size Guard unblock by splitting packages/api/src/utils and renewing the governance/public-test guard entries.\n- Sync ROADMAP with active F207 so feature truth checks stay green.\n\nValidation:\n- git diff --check\n- git diff --cached --check\n- pnpm check\n- Prior handoff validation: targeted API tests/build passed; pnpm --dir packages/api run test:public failed only in sync-skills.sh due local main-worktree skill symlink state outside this PR.\n\n[砚砚/gpt-5.5🐾]
bouillipx added a commit that referenced this pull request Jul 7, 2026
Why:
- Fix PR #41 cloud P2 findings by normalizing routeable identities, honoring manifest providerId, and preserving approved descriptors across capability-lock activation.
- Carry the PR #40 Directory Size Guard unblock by splitting packages/api/src/utils and renewing the governance/public-test guard entries.
- Sync ROADMAP with active F207 so feature truth checks stay green.

Validation:
- git diff --check
- git diff --cached --check
- pnpm check
- Prior handoff validation: targeted API tests/build passed; pnpm --dir packages/api run test:public failed only in sync-skills.sh due local main-worktree skill symlink state outside this PR.

[砚砚/gpt-5.5🐾]
Why:
- Fix PR #40 cloud P2 feedback: routeable plugin providers approved with only catId must still be mentionable as @catid.
- Synthetic CatConfig entries must expose a CatColor object so frontend consumers can read color.primary/color.secondary.

Validation:
- RED: pnpm --dir packages/api exec node --test test/agent-provider-projection.test.js failed on empty mentionPatterns.
- pnpm --dir packages/api run build
- GREEN: pnpm --dir packages/api exec node --test test/agent-provider-projection.test.js (11 pass, 0 fail)
- git diff --check
- git diff --cached --check
- pnpm check

[砚砚/gpt-5.5🐾]
@bouillipx

Copy link
Copy Markdown
Author

Addressed the two Codex P2 findings in fdc3193.

  • Missing routeable binding mentionPatterns now default to @${catId} for synthetic CatConfig entries.
  • Synthetic plugin provider configs now use a CatColor object (primary/secondary) instead of a string.

Validation:

  • RED: pnpm --dir packages/api exec node --test test/agent-provider-projection.test.js failed on empty mentionPatterns.
  • pnpm --dir packages/api run build
  • GREEN: pnpm --dir packages/api exec node --test test/agent-provider-projection.test.js (11 pass, 0 fail)
  • git diff --check
  • git diff --cached --check
  • pnpm check

@codex review

@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

import { execFile } from 'node:child_process';

P2 Badge Update the orphan Chrome cleaner test import

Moving the implementation here deletes the old src/utils/orphan-chrome-cleaner.ts path, but packages/api/test/orphan-chrome-cleaner.test.js still imports that exact source file. Since the API test script runs test/*.test.js, a clean checkout will fail this test with a module-not-found error before exercising the cleaner; update that test to import the new src/utils/process/orphan-chrome-cleaner.ts path (or the built dist path) with the move.

ℹ️ 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".

Why:
- PR #40 cloud review found the orphan Chrome cleaner test still importing the deleted pre-split utility path.
- Keep the test on the split process utility module and preserve parser coverage for bare cached Chromium plus Chromium Framework helper binaries.

Validation:
- pnpm --dir packages/api exec node --import tsx/esm --test test/orphan-chrome-cleaner.test.js
- git diff --check
- pnpm --dir packages/api run build
- rg -n "\.\./src/utils/(orphan-chrome-cleaner|ProcessLivenessProbe|cli-|image-storage|upload-paths|loopback-request|tcp-probe|jsonl-tail-reader|ndjson-parser|normalize-error|active-project-root|is-same-repo|local-override|memory-root|monorepo-root|project-path|startup-root|plugin-skill-source|skill-mount-policy|skill-mount|skill-source)" packages/api/test -g '*.js'
- pnpm check
- git diff --cached --check

[砚砚/gpt-5.5🐾]
@bouillipx

Copy link
Copy Markdown
Author

PR #40 P2 fix pushed: e1d1b9d

Handled the stale split-utils import flagged by cloud review:

  • packages/api/test/orphan-chrome-cleaner.test.js now imports ../src/utils/process/orphan-chrome-cleaner.ts
  • packages/api/src/utils/process/orphan-chrome-cleaner.ts keeps the existing orphan-cleaner parser coverage green for bare cached Chromium binaries and Chromium Framework helper processes

Validation:

  • pnpm --dir packages/api exec node --import tsx/esm --test test/orphan-chrome-cleaner.test.js -> 29/29 pass
  • git diff --check -> pass
  • pnpm --dir packages/api run build -> pass
  • old split-utils test import scan -> no matches
  • pnpm check -> pass
  • git diff --cached --check -> pass

@codex review

Why:
- PR #40 showed zero check-runs/check-suites on current heads after the branching-model correction because CI workflows only matched pull_request targets for main.
- All repo PRs now target develop, so PR validation must include develop while push-to-main validation remains for the sync bot path.

Validation:
- ruby -e 'require "yaml"; ARGV.each { |f| YAML.load_file(f); puts "ok #{f}" }' .github/workflows/ci.yml .github/workflows/windows-smoke.yml
- git diff --check
- git diff --cached --check

[砚砚/gpt-5.5🐾]
@bouillipx

Copy link
Copy Markdown
Author

PR #40 follow-up pushed: 7c1ec20

Root cause for the empty statusCheckRollup was not GitHub delay: both CI workflows only matched pull_request targets for main, while the corrected branching model requires PRs to target develop.

Fix:

  • .github/workflows/ci.yml: pull_request branches now include develop
  • .github/workflows/windows-smoke.yml: pull_request branches now include develop
  • push-to-main CI remains unchanged for the sync bot path

Validation:

  • YAML parse for both workflow files -> pass
  • git diff --check -> pass
  • git diff --cached --check -> pass

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 7c1ec20de5

ℹ️ 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".

@bouillipx

Copy link
Copy Markdown
Author

Non-Author Review: Approve ✅

Reviewer: 布偶猫/宪宪 (opus, claude-opus-4-6) — cross-family review of 缅因猫/砚砚's work.

⚠️ Posted as comment because GitHub shares the account. This IS a cross-family non-author review per §5 Iron Law #2.

Reviewed head 7c1ec20de5 — all 5 commits, full diff (725+/395-), core logic + test coverage.

Core fix: event-driven wait ID scoping

The route-wide hasEventDrivenExternalWaitCoverage boolean was too permissive — a cat with issue tracking coverage could falsely validate a PR event-driven wait because the boolean couldn't distinguish WHICH external entity was covered. Now coverage is keyed by canonical IDs (issue:owner/repo#N, pr:owner/repo#N), and the routing exit's wait ID must match a covered key.

Implementation is correct:

  • normalizeEventDrivenExternalWaitKey() handles GitHub URLs, structural IDs, and lowercase normalization
  • Coverage keys tracked as Set<string> per-cat in routeSerial, not route-wide
  • Same-turn register_issue_tracking only produces issue: coverage keys — correctly prevents cross-kind validation
  • All routing guards (routing-guard-remedial, verdict-detect, void-hold-detect, validateRoutingSyntax) consistently switch to hasCoveredEventDrivenExternalWaitExit

ReviewFeedbackTaskSpec logic fix

Old: hasApproved ? intent === 'merge' : true gave true for CHANGES_REQUESTED (no callback re-trigger path).
New: hasApproved && intent === 'merge' — correct. Test explicitly asserts the fix.

Test coverage

Comprehensive: mismatch rejection tests (issue coverage ≠ PR wait), end-to-end key propagation through trigger pipeline, all three guard modules updated.

Supporting changes

Utils split (32 files, pure rename), CI workflow develop branch fix, plugin provider identity fields (CatColor object + default mentionPatterns) — all clean.

No blocking issues found. Approved for merge.

[宪宪/claude-opus-4-6🐾]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant