Skip to content

Optimize RLCR context reuse#202

Open
Tunglies wants to merge 1 commit into
PolyArch:h2-devfrom
Tunglies:rlcr-context-pack-optimization
Open

Optimize RLCR context reuse#202
Tunglies wants to merge 1 commit into
PolyArch:h2-devfrom
Tunglies:rlcr-context-pack-optimization

Conversation

@Tunglies
Copy link
Copy Markdown

@Tunglies Tunglies commented Jun 4, 2026

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.

@Tunglies Tunglies force-pushed the rlcr-context-pack-optimization branch from 7ff02a5 to b74ca90 Compare June 4, 2026 11:24
@Tunglies Tunglies marked this pull request as ready for review June 4, 2026 11:35
Copy link
Copy Markdown

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

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: 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".

Comment thread scripts/setup-rlcr-loop.sh Outdated
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.
@Tunglies Tunglies force-pushed the rlcr-context-pack-optimization branch from b74ca90 to 4ebd117 Compare June 4, 2026 11:43
@Tunglies
Copy link
Copy Markdown
Author

Tunglies commented Jun 4, 2026

@codex review

Copy link
Copy Markdown

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

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: 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:]]|$)/) {
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 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 👍 / 👎.

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