Skip to content

gate 3: stop listing backticked prose as files in scope - #22

Merged
khaliqgant merged 2 commits into
mainfrom
gate3/scope-regex
Aug 29, 2026
Merged

gate 3: stop listing backticked prose as files in scope#22
khaliqgant merged 2 commits into
mainfrom
gate3/scope-regex

Conversation

@khaliqgant

Copy link
Copy Markdown
Member

Closes the last open finding from PR #21.

The bug

The files_in_scope extraction matched any backticked span containing a slash. A backlog entry writing prose like ``contains `/``` produced a work package claiming that prose was a file in scope.

For the component whose job is proposing the system's next task, a package naming files that do not exist is worse than one naming none — it sends whoever picks it up looking for something that was never there.

Verified, in the direction that matters

Against the previous code:

× backlog picker > does not treat backticked prose containing a slash as a file in scope

With the fix: passes. sdk: Test Files 12 passed (12) / Tests 161 passed (161).

A note on how this one was produced

This is the first drive run tonight that both delivered the test its definition of done required and produced a test that genuinely catches the bug. The two runs before it reported their DoD met and shipped no test at all — the code was right, the claim was not.

The only thing that changed was the brief, which said every new test must be confirmed to fail against current code before being claimed as passing. That is a prompt, not a gate, so it can be ignored — but it is worth knowing it worked once before building the heavier fix (making the DoD executable so verify runs it, and a missing test fails because the command naming it does not exist). That change is recorded in ops/BACKLOG.md and wants a human's view first.

🤖 Generated with Claude Code

The files_in_scope extraction matched any backticked span containing a slash,
so a backlog entry writing prose like 'contains `/`' produced a work package
claiming that prose was a file in scope. A Garden proposing work must describe
the work accurately; a package naming files that do not exist is worse than one
naming none.

Delivered by the drive loop with its test, and the test was CONFIRMED TO FAIL
against the previous code before being trusted:
  × does not treat backticked prose containing a slash as a file in scope

This is the first run tonight to both deliver the test its DoD required and
have that test genuinely catch the bug. The two before it reported their DoD
met and shipped no test at all; the difference here was the brief demanding the
fail-first check explicitly.

Verified: sdk 161 passed across 12 files.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 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-08-29T12:46:29.031185Z b362266 PR opened
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 49 minutes.

View limit details

Limit details: You’ve used the included review currently available.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 6699ce92-1ece-49ab-ae83-d7e321b5c7c6

📥 Commits

Reviewing files that changed from the base of the PR and between b362266 and fbdd33c.

📒 Files selected for processing (3)
  • sdk/tests/backlog-picker-flow.test.ts
  • testdata/backlog-picker.flow.yaml
  • testdata/backlog-picker.spec.canonical.json
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 49798ccd-3824-4a8c-b1a6-7557efeba318

📥 Commits

Reviewing files that changed from the base of the PR and between fb785f5 and b362266.

📒 Files selected for processing (2)
  • sdk/tests/backlog-picker.test.ts
  • testdata/backlog-picker.flow.yaml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The file-scope extraction pattern now requires filename-like paths. An integration test runs emit-package with temporary backlog data and verifies that slash-containing prose is excluded from files_in_scope.

Changes

Backlog file-scope extraction

Layer / File(s) Summary
File-scope extraction and integration validation
testdata/backlog-picker.flow.yaml, sdk/tests/backlog-picker.test.ts
The extraction pattern requires a valid filename extension and restricted path characters. The integration test creates temporary input, runs emit-package, checks the emitted package, and removes temporary resources.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to b3622

The change narrows file-scope extraction so backticked prose containing a slash is no longer reported as a file, with a test covering the regression. No actionable merge-blocking risk remains after normal checks and review.

Poem

A rabbit checks the backtick trail

Slashy prose hops off the rail
Real file paths stay in the scope
Temporary burrows close with hope
The package leaves a cleaner trail


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/settings/billing.

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

@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: b36226606e

ℹ️ 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 testdata/backlog-picker.flow.yaml Outdated
dependsOn: [select-entry]
command: >-
node -e 'const fs=require("node:fs");const entry=JSON.parse(fs.readFileSync(".relayflow/backlog-picker-entry.json","utf8"));const text=entry.title+" "+entry.body;const files=[...new Set([...text.matchAll(/`([^`\s]*\/[^`]*)`/g)].map(match=>match[1]))];const gate=text.match(/\bgate[ -]?(\d+)\b/i);process.stdout.write(JSON.stringify({title:entry.title,description:entry.body,files_in_scope:files,gate:gate?Number(gate[1]):null}))'
node -e 'const fs=require("node:fs");const entry=JSON.parse(fs.readFileSync(".relayflow/backlog-picker-entry.json","utf8"));const text=entry.title+" "+entry.body;const files=[...new Set([...text.matchAll(/`([A-Za-z._][A-Za-z0-9._-]*(?:\/[A-Za-z0-9._-]+)*\/[A-Za-z0-9_-]+\.[A-Za-z0-9._-]+)`/g)].map(match=>match[1]))];const gate=text.match(/\bgate[ -]?(\d+)\b/i);process.stdout.write(JSON.stringify({title:entry.title,description:entry.body,files_in_scope:files,gate:gate?Number(gate[1]):null}))'

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 Regenerate the canonical backlog-picker spec

When testdata/backlog-picker.spec.canonical.json is checked or consumed directly, it still executes the old permissive matcher because this commit updates only the YAML source. The repository explicitly supports canonical JSON specs, so the checked-in compiled artifact continues emitting backticked prose such as / in files_in_scope; regenerate the canonical file alongside this command change.

Useful? React with 👍 / 👎.

Comment thread testdata/backlog-picker.flow.yaml Outdated
dependsOn: [select-entry]
command: >-
node -e 'const fs=require("node:fs");const entry=JSON.parse(fs.readFileSync(".relayflow/backlog-picker-entry.json","utf8"));const text=entry.title+" "+entry.body;const files=[...new Set([...text.matchAll(/`([^`\s]*\/[^`]*)`/g)].map(match=>match[1]))];const gate=text.match(/\bgate[ -]?(\d+)\b/i);process.stdout.write(JSON.stringify({title:entry.title,description:entry.body,files_in_scope:files,gate:gate?Number(gate[1]):null}))'
node -e 'const fs=require("node:fs");const entry=JSON.parse(fs.readFileSync(".relayflow/backlog-picker-entry.json","utf8"));const text=entry.title+" "+entry.body;const files=[...new Set([...text.matchAll(/`([A-Za-z._][A-Za-z0-9._-]*(?:\/[A-Za-z0-9._-]+)*\/[A-Za-z0-9_-]+\.[A-Za-z0-9._-]+)`/g)].map(match=>match[1]))];const gate=text.match(/\bgate[ -]?(\d+)\b/i);process.stdout.write(JSON.stringify({title:entry.title,description:entry.body,files_in_scope:files,gate:gate?Number(gate[1]):null}))'

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 Preserve valid directory and extensionless paths

For backlog entries that scope a directory such as regressions/ or an extensionless file such as src/Dockerfile, this matcher now silently omits the path because it requires the final component to contain a dot. Both are valid repository scopes, so work packages for those inputs lose actionable scope information; reject the standalone-slash prose case without restricting paths to extension-bearing filenames.

Useful? React with 👍 / 👎.

…(PR #22 P2s)

Two review findings, the first more serious than its label.

The canonical spec is what the KERNEL consumes, and PR #22 fixed the path
matcher in the flow yaml while leaving the canonical spec carrying the old
permissive one. The fix did not reach the thing that runs. That divergence is
silent by nature: both files are valid, tests over the yaml pass, and the
kernel keeps executing the stale command. There is now a test asserting every
step's command matches between the two, and it was confirmed to FAIL against
the stale spec:
  × backlog-picker canonical spec > stays in sync with the flow yaml

The matcher also dropped legitimate scopes — a directory like regressions/ or
an extensionless file like src/Dockerfile — while still needing to reject prose
such as 'contains `/`'. It now accepts both and rejects both prose and
malformed paths; seven cases are covered by a test.

Verified: sdk 164 passed across 12 files.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@khaliqgant
khaliqgant merged commit ff5b00c into main Aug 29, 2026
2 checks passed
@khaliqgant
khaliqgant deleted the gate3/scope-regex branch August 29, 2026 13:02
khaliqgant pushed a commit that referenced this pull request Aug 29, 2026
Recording immediately after the merge. All four of the picker's properties now
have tests confirmed to fail without their fixes, which is the standard the two
remaining open PRs are measured against.

Worth keeping visible: property 3 exists because a fix landed in the flow yaml
while the canonical spec — the thing the kernel actually consumes — kept the
old command. That class of divergence is silent: both files valid, tests over
the yaml green, stale behaviour in production.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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