Optimize RLCR context reuse#202
Conversation
7ff02a5 to
b74ca90
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b74ca90666
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Generate an immutable context-pack.md for each RLCR run and reference it from implementation and routine review prompts. The context pack carries a stable goal/AC digest, source identity, and source-of-truth rules, while the original plan remains authoritative and full-alignment reviews still read the full plan directly. Keep routine review prompt prefixes stable by removing the round number from the title and moving round-specific payloads, summary content, commit history, prompt path, and review output path behind a Dynamic Round Payload section. Preserve existing review semantics such as Claude summary boundary markers, review intent wording, Original Implementation Plan headings, and the 1-2 target AC round contract rule. Replace fragile sed-based plan goal/AC extraction with section-aware parsing so context-pack generation is reliable. Record the context pack path in loop state and pass it through stop-hook generated regular-review and next-round prompts, with fallback to the original plan for older loops without a context pack. Final auxiliary validation showed regular review reusable-prefix ratio improving from 0.24% to 88.35%, average reusable prefix growing from 22 bytes to 5296 bytes, and a representative Round 0 prompt estimate dropping about 72% by replacing embedded plan text with context references. Auxiliary validation tools are kept out of this commit and saved separately in stash.
b74ca90 to
4ebd117
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ebd117079
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (in_section) { | ||
| exit | ||
| } | ||
| if (lower ~ /^##[[:space:]]*(acceptance|criteria|requirements)([[:space:]]|$)/) { |
There was a problem hiding this comment.
Restore matching for punctuated requirements headings
For plans whose acceptance criteria live under a common heading like ## Requirements: or ## Criteria:, this stricter regex no longer recognizes the section because it only allows whitespace or end-of-line after the keyword. The previous prefix-based sed match handled those headings, so extract_plan_ac_content now returns empty, causing the generated context pack and the initial goal tracker to fall back to generic placeholders instead of seeding the real requirements.
Useful? React with 👍 / 👎.
|
@codex Please review this PR thorougly |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ebd117079
ℹ️ 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".
| if (lower ~ /^##[[:space:]]*(acceptance|criteria|requirements)([[:space:]]|$)/) { | ||
| in_section = 1 |
There was a problem hiding this comment.
Accept punctuated requirement headings
For plans that use common headings such as ## Requirements: or ## Criteria:, this predicate returns no AC content because it only allows whitespace or end-of-line after the keyword; the previous prefix match did extract those sections. With this commit the context pack and initial goal tracker are now the stable source routine prompts read first, so these plans fall back to placeholder/“read the original plan” text instead of carrying the actual acceptance criteria. Allow trailing punctuation (and apply the same treatment to the analogous goal parser) before generating the digest.
Useful? React with 👍 / 👎.
Generate an immutable context-pack.md for each RLCR run and reference it from implementation and routine review prompts. The context pack carries a stable goal/AC digest, source identity, and source-of-truth rules, while the original plan remains authoritative and full-alignment reviews still read the full plan directly.
Keep routine review prompt prefixes stable by removing the round number from the title and moving round-specific payloads, summary content, commit history, prompt path, and review output path behind a Dynamic Round Payload section. Preserve existing review semantics such as Claude summary boundary markers, review intent wording, Original Implementation Plan headings, and the 1-2 target AC round contract rule.
Replace fragile sed-based plan goal/AC extraction with section-aware parsing so context-pack generation is reliable. Record the context pack path in loop state and pass it through stop-hook generated regular-review and next-round prompts, with fallback to the original plan for older loops without a context pack.
Final auxiliary validation showed regular review reusable-prefix ratio improving from 0.24% to 88.35%, average reusable prefix growing from 22 bytes to 5296 bytes, and a representative Round 0 prompt estimate dropping 72.2% by replacing embedded plan text with context references.