Skip to content

Commit bb2d941

Browse files
committed
feat: add integral context to RLCR review prompts (PID complete)
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. Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
1 parent 722eb25 commit bb2d941

7 files changed

Lines changed: 56 additions & 3 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"name": "humanize",
99
"source": "./",
1010
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
11-
"version": "1.16.0"
11+
"version": "1.17.0"
1212
}
1313
]
1414
}

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "humanize",
33
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
4-
"version": "1.16.0",
4+
"version": "1.17.0",
55
"author": {
66
"name": "humania-org"
77
},

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Humanize
22

3-
**Current Version: 1.16.0**
3+
**Current Version: 1.17.0**
44

55
> Derived from the [GAAC (GitHub-as-a-Context)](https://github.com/SihaoLiu/gaac) project.
66

hooks/loop-codex-stop-hook.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,37 @@ COMPLETED_ITERATIONS=$((CURRENT_ROUND + 1))
965965
PREV_ROUND=$(( CURRENT_ROUND > 0 ? CURRENT_ROUND - 1 : 0 ))
966966
PREV_PREV_ROUND=$(( CURRENT_ROUND > 1 ? CURRENT_ROUND - 2 : 0 ))
967967

968+
# Integral component: accumulated commit history and recent round references
969+
# Validate BASE_COMMIT is a reachable git object before using it in git log
970+
if [[ -n "$BASE_COMMIT" ]] && git -C "$PROJECT_ROOT" cat-file -e "$BASE_COMMIT" 2>/dev/null; then
971+
COMMIT_HISTORY=$(git -C "$PROJECT_ROOT" log --oneline --no-decorate --reverse "$BASE_COMMIT"..HEAD 2>/dev/null | tail -80)
972+
else
973+
COMMIT_HISTORY=$(git -C "$PROJECT_ROOT" log --oneline --no-decorate --reverse -30 2>/dev/null)
974+
# Annotate so Codex knows this is not the full loop history
975+
[[ -n "$COMMIT_HISTORY" ]] && COMMIT_HISTORY="(base commit unavailable, showing recent branch commits)
976+
${COMMIT_HISTORY}"
977+
fi
978+
[[ -z "$COMMIT_HISTORY" ]] && COMMIT_HISTORY="(no commits yet)"
979+
980+
RECENT_ROUND_FILES=""
981+
for (( r = CURRENT_ROUND - 1; r >= 0 && r >= CURRENT_ROUND - 3; r-- )); do
982+
RECENT_ROUND_FILES+="- @.humanize/rlcr/${LOOP_TIMESTAMP}/round-${r}-summary.md
983+
- @.humanize/rlcr/${LOOP_TIMESTAMP}/round-${r}-review-result.md
984+
"
985+
done
986+
[[ -z "$RECENT_ROUND_FILES" ]] && RECENT_ROUND_FILES="(first round, no prior history)"
987+
988+
COMMIT_HISTORY_SECTION_FALLBACK="## Development History (Integral Context)
989+
\`\`\`
990+
${COMMIT_HISTORY}
991+
\`\`\`
992+
### Recent Round Files
993+
Read these files before conducting your review to understand the trajectory of work:
994+
${RECENT_ROUND_FILES}"
995+
COMMIT_HISTORY_SECTION=$(load_and_render_safe "$TEMPLATE_DIR" "codex/commit-history-section.md" "$COMMIT_HISTORY_SECTION_FALLBACK" \
996+
"COMMIT_HISTORY=$COMMIT_HISTORY" \
997+
"RECENT_ROUND_FILES=$RECENT_ROUND_FILES")
998+
968999
# Build the review prompt
9691000
FULL_ALIGNMENT_FALLBACK="# Full Alignment Review (Round {{CURRENT_ROUND}})
9701001
@@ -973,6 +1004,8 @@ Review Claude's work against the plan and goal tracker. Check all goals are bein
9731004
## Claude's Summary
9741005
{{SUMMARY_CONTENT}}
9751006
1007+
{{COMMIT_HISTORY_SECTION}}
1008+
9761009
{{GOAL_TRACKER_UPDATE_SECTION}}
9771010
9781011
Write your review to {{REVIEW_RESULT_FILE}}. End with COMPLETE if done, or list issues."
@@ -984,6 +1017,8 @@ Review Claude's work for this round.
9841017
## Claude's Summary
9851018
{{SUMMARY_CONTENT}}
9861019
1020+
{{COMMIT_HISTORY_SECTION}}
1021+
9871022
{{GOAL_TRACKER_UPDATE_SECTION}}
9881023
9891024
Write your review to {{REVIEW_RESULT_FILE}}. End with COMPLETE if done, or list issues."
@@ -997,6 +1032,7 @@ if [[ "$FULL_ALIGNMENT_CHECK" == "true" ]]; then
9971032
"GOAL_TRACKER_FILE=$GOAL_TRACKER_FILE" \
9981033
"DOCS_PATH=$DOCS_PATH" \
9991034
"GOAL_TRACKER_UPDATE_SECTION=$GOAL_TRACKER_UPDATE_SECTION" \
1035+
"COMMIT_HISTORY_SECTION=$COMMIT_HISTORY_SECTION" \
10001036
"COMPLETED_ITERATIONS=$COMPLETED_ITERATIONS" \
10011037
"LOOP_TIMESTAMP=$LOOP_TIMESTAMP" \
10021038
"PREV_ROUND=$PREV_ROUND" \
@@ -1013,6 +1049,7 @@ else
10131049
"GOAL_TRACKER_FILE=$GOAL_TRACKER_FILE" \
10141050
"DOCS_PATH=$DOCS_PATH" \
10151051
"GOAL_TRACKER_UPDATE_SECTION=$GOAL_TRACKER_UPDATE_SECTION" \
1052+
"COMMIT_HISTORY_SECTION=$COMMIT_HISTORY_SECTION" \
10161053
"COMPLETED_ITERATIONS=$COMPLETED_ITERATIONS" \
10171054
"LOOP_TIMESTAMP=$LOOP_TIMESTAMP" \
10181055
"PREV_ROUND=$PREV_ROUND" \
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Development History (Integral Context)
2+
3+
Accumulated commits since loop start (oldest first):
4+
```
5+
{{COMMIT_HISTORY}}
6+
```
7+
8+
### Recent Round Files
9+
Read these files before conducting your review to understand the trajectory of work:
10+
{{RECENT_ROUND_FILES}}
11+
12+
Use this history to identify patterns across rounds: recurring issues, stalled progress, or drift from the mainline objective. Weight recent rounds more heavily but watch for systemic trends in the full commit log.

prompt-template/codex/full-alignment-review.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ You MUST read this plan file first to understand the full scope of work before c
1616
<!-- CLAUDE's WORK SUMMARY END -->
1717
---
1818

19+
{{COMMIT_HISTORY_SECTION}}
20+
1921
## Part 1: Goal Tracker Audit (MANDATORY)
2022

2123
Read @{{GOAL_TRACKER_FILE}} and verify:

prompt-template/codex/regular-review.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Below is Claude's summary of the work completed:
1717
<!-- CLAUDE's WORK SUMMARY END -->
1818
---
1919

20+
{{COMMIT_HISTORY_SECTION}}
21+
2022
## Part 1: Implementation Review
2123

2224
- Your task is to conduct a deep critical review, focusing on finding implementation issues and identifying gaps between "plan-design" and actual implementation.

0 commit comments

Comments
 (0)