Skip to content

feat: add integral context to RLCR review prompts#81

Merged
SihaoLiu merged 1 commit intoPolyArch:devfrom
zevorn:feat/rlcr-integral-context
Apr 15, 2026
Merged

feat: add integral context to RLCR review prompts#81
SihaoLiu merged 1 commit intoPolyArch:devfrom
zevorn:feat/rlcr-integral-context

Conversation

@zevorn
Copy link
Copy Markdown

@zevorn zevorn commented Apr 14, 2026

Summary

  • Add the Integral (I) component to the RLCR feedback loop, completing a PID control model for Codex reviews
  • Codex now sees accumulated commit history (since loop start) and the last 3 rounds' summaries/reviews alongside the existing goal tracker (P) and current summary (D)
  • Validate BASE_COMMIT with cat-file -e before git log to prevent set -e crash on corrupted state files; annotate fallback when base commit is unavailable

Changes

File Change
prompt-template/codex/commit-history-section.md New template for the I component
hooks/loop-codex-stop-hook.sh Gather commit log, build round file refs, render template, pass to both review prompts
prompt-template/codex/regular-review.md Insert {{COMMIT_HISTORY_SECTION}} between summary and Part 1
prompt-template/codex/full-alignment-review.md Same insertion
tests/test-commit-history-section.sh 9 tests covering all edge cases
Version bump 1.16.0 -> 1.17.0

PID Model

  • P (proportional): goal-tracker.md — current state vs acceptance criteria gap
  • I (integral): accumulated commits + last 3 rounds' summary/review files — trajectory and patterns
  • D (derivative): current round summary — what changed this round

Test plan

  • Round 0: (no commits yet) and (first round, no prior history)
  • Round 2+: commit log and round file references render correctly ✓
  • Corrupted base_commit: hook does not crash, falls back with (base commit unavailable, showing recent branch commits) annotation ✓
  • Missing template: fallback renders full section including commits, round files, and directive language ✓
  • Round 1 boundary: only round 0 referenced ✓
  • Empty BASE_COMMIT: triggers annotation ✓

All 9/9 tests pass (tests/test-commit-history-section.sh).

@zevorn zevorn changed the base branch from main to dev April 14, 2026 04:38
@zevorn zevorn force-pushed the feat/rlcr-integral-context branch from f612fb3 to 2474513 Compare April 14, 2026 04:44
@SihaoLiu
Copy link
Copy Markdown
Contributor

@codex please review this PR

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: 247451343f

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

Feed accumulated commit history and recent round summaries/reviews
to Codex during each review round, completing the PID feedback model:
- P (proportional): goal-tracker vs acceptance criteria
- I (integral): accumulated commits + last 3 rounds history
- D (derivative): current round summary vs prompt

Validate BASE_COMMIT with cat-file -e before git log to prevent
set -e crash on corrupted/stale state files.

Add test-commit-history-section.sh covering all edge cases (9/9 pass).

Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
@zevorn zevorn force-pushed the feat/rlcr-integral-context branch from 2474513 to c4389bb Compare April 15, 2026 02:26
@zevorn zevorn requested a review from SihaoLiu April 15, 2026 02:41
Copy link
Copy Markdown
Contributor

@SihaoLiu SihaoLiu left a comment

Choose a reason for hiding this comment

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

lgtm

@SihaoLiu SihaoLiu merged commit 50ed1bc into PolyArch:dev Apr 15, 2026
5 checks passed
@SihaoLiu SihaoLiu mentioned this pull request Apr 15, 2026
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.

2 participants