Quality gates and prompt improvements for megaplan pipeline
Items to address
1. Executor notes prompt is too prescriptive
The prompt says 'say what you verified' so the executor literally starts every note with 'Verified...' — parroting, not reasoning. Fix: show 2-3 varied examples in the JSON block that demonstrate different verification styles (edge case catch, expected behavior confirmation, design choice explanation). Let the agent infer the pattern.
2. Perfunctory-note detector for executor_notes
We have _is_perfunctory_ack for sense checks (rejects 'ok', 'done', 'confirmed' etc.) but executor notes have no equivalent quality gate. A note like 'Verified. Done.' would pass today. The nonempty_fields check only ensures non-empty, not non-trivial. Add a quality gate.
3. Review prompt should positively frame settled decisions
The review prompt says 'do not re-litigate' settled decisions. It should be framed positively: 'verify the executor implemented these decisions correctly.' The reviewer's job is to check execution honored them, not to question them.
4. Remove _is_substantive_reviewer_verdict and unify with _is_perfunctory_ack
We have two separate quality heuristics: _is_perfunctory_ack (word blocklist for sense check acks) and _is_substantive_reviewer_verdict (char/word/unique-word counts for reviewer verdicts). They solve the same problem — detecting rubber stamps. Unify them into one function.
5. Critique should not waste iteration cycles on structural nitpicks
In our recent run, FLAG-004 was 'the plan fails the required step-section structure' because a step had prose instead of numbered substeps. This burned an entire critique→gate→revise cycle on formatting, not correctness. The critique prompt should distinguish structural nitpicks from real concerns — structural issues should be minor severity, not significant.
code
Approved plan:
# Implementation Plan: Quality gates and prompt improvements for megaplan pipeline
Overview
Five targeted improvements to the megaplan pipeline's quality gates and prompts. The codebase is a Python project with prompts in megaplan/prompts.py, quality checks in megaplan/evaluation.py, handler logic in megaplan/handlers.py, and tests in tests/. All changes are isolated — no new files needed, no schema changes.
Assistant
User
Assistant
User
Assistant
I’m re-checking the current working tree directly because the executor’s latest explanation conflicts with the file content I reviewed earlier. I’ll verify megaplan/evaluation.py and tests/test_evaluation.py first, then I’ll reconcile that against the remaining criteria and audit findings.
Assistant
The T4/T6 discrepancy is real, and the current working tree does support the executor’s correction: loose mode is now blocklist-only, and the updated test expects that. I’m doing a final pass over the prompt and handler files so the verdict reflects the actual working tree rather than the earlier stale read.
Assistant
Key files:
megaplan/prompts.py — executor and critique prompt text
Replace the single-style instruction at prompts.py:557 ("say what you verified was correct...") with a brief principle followed by 2-3 varied examples in the JSON block.
Rewrite the existing task_updates example at prompts.py:566-579 to show three different styles:
One: edge case catch ("Empty strings in commands_run still count as missing evidence — tested this explicitly.")
Two: expected behavior confirmation ("The merge-then-block sequence works as designed: tasks with both fields populated pass through without FLAG-006.")
Three: design choice explanation ("Used sorted() on claimed paths so diff output is deterministic regardless of task execution order.")
Keep the skipped-task example as-is (it's already a different style).
Step 2: Reframe settled decisions in review prompt (megaplan/prompts.py:599, 618)
Scope: Small
Change the header at prompts.py:599 from "Settled decisions (from gate approval - do not re-litigate these):" to "Settled decisions (verify the executor implemented these correctly):".
Update the instruction at prompts.py:618 from "Verify that execution honors these decisions, but do not question the decisions themselves." to "Verify that the executor implemented each settled decision correctly. Flag deviations from these decisions, but do not question the decisions themselves.".
Step 3: Downgrade structural nitpicks in critique prompt (megaplan/prompts.py:297)
Scope: Small
Replace the instruction at prompts.py:297 that says structural issues should be likely-significant with a split:
Missing required sections (no H1, no Overview, no steps at all) → likely-significant
Formatting within sections (prose instead of numbered substeps, missing file references in a step) → likely-minor
Add a sentence: "Structural formatting within steps (e.g., prose instead of numbered substeps) should be likely-minor — the executor can follow prose instructions."
Phase 2: Unify quality heuristics
Step 4: Create unified is_rubber_stamp function (megaplan/evaluation.py)
Scope: Medium
Create a new function is_rubber_stamp(text: str) -> bool in evaluation.py that combines both checks:
Second: substance check (current _is_substantive_reviewer_verdict logic inverted — if not enough chars/words/unique-words, it's a rubber stamp)
Returns True if either the text is a known generic ack OR it fails the substance thresholds.
Move the _MIN_VERDICT_CHARS, _MIN_VERDICT_WORDS, _MIN_VERDICT_UNIQUE_WORDS constants from handlers.py:553-555 into evaluation.py alongside _GENERIC_ACKS.
Keep_is_perfunctory_ack as a thin wrapper or alias of is_rubber_stamp for backwards compatibility within validate_execution_evidence (avoid renaming in test files unnecessarily).
Replace_is_substantive_reviewer_verdict in handlers.py with a thin wrapper: not evaluation.is_rubber_stamp(text).
Update imports in handlers.py to pull from evaluation.
Add a call to is_rubber_stamp in validate_execution_evidence (after evaluation.py:162) for each task's executor_notes, similar to the existing sense-check loop at lines 159-168.
In the task-processing loop within validate_execution_evidence, after checking each task's executor_notes is non-empty, add:
python
if is_rubber_stamp(executor_notes):
findings.append(f"Task {task_id} executor_notes are perfunctory: {executor_notes.strip()!r}.")
Note: The existing nonempty_fields={"executor_notes"} check at handlers.py:1641 remains — it catches empty strings. The new check catches non-empty but trivial notes like "Verified. Done." or "Looks good."
Phase 3: Tests
Step 6: Add and update tests (tests/test_evaluation.py, tests/test_megaplan.py)
Scope: Medium
Add tests for is_rubber_stamp in tests/test_evaluation.py:
Known generic acks ("ok", "verified", "done") → True
Short strings (< 10 chars) → True
Low-substance ("Verified done good") → True (fails unique word count)
Real notes ("Tested edge case where empty array triggers FLAG-006 path") → False
Update existing _is_substantive_reviewer_verdict tests in tests/test_megaplan.py:1819-1833 to also test through the new wrapper, or migrate them to test is_rubber_stamp directly.
Add a test for validate_execution_evidence that includes a task with perfunctory executor_notes and verifies the finding is reported.
Runpytest to verify all existing tests still pass.
Execution Order
Steps 1-3 (prompt changes) can be done in any order — they're independent text edits.
Step 4 (unify heuristics) before Step 5 (executor_notes gate) — Step 5 depends on the unified function.
Step 6 (tests) last, after all logic is in place.
Validation Order
Run pytest tests/test_evaluation.py after Steps 4-5.
Run pytest tests/test_megaplan.py after Step 4 (to catch wrapper regressions).
Run full pytest after Step 6.
code
Execution tracking state (`finalize.json`):
{
"meta_commentary": "Six tasks covering three prompt text edits, one heuristic unification, one new quality gate, and one test task. Key execution guidance:\n\nFLAG-001 (over-unification): DECISION-001 settles this \u2014 is_rubber_stamp must take a strict: bool = False parameter. Loose mode (default): blocklist-only, rejects generic single-word acks but allows short specific text like "Confirmed prompt coverage." Strict mode: blocklist check PLUS substance thresholds (20 chars / 4 words / 3 unique words). Sense-check acks use loose mode; executor_notes and reviewer verdicts use strict mode. The existing _is_perfunctory_ack can become is_rubber_stamp(text, strict=False) and _is_substantive_reviewer_verdict becomes not is_rubber_stamp(text, strict=True).\n\nFLAG-002 (test_prompts.py): DECISION-002 settles this \u2014 tests/test_prompts.py:474 asserts \"do not re-litigate\" in prompt which will break after Step 2 changes the header. Line 482 also checks \"Settled decisions (from gate approval\" which changes too. Both must be updated in T6. The executor examples in the execute prompt are not currently asserted in test_prompts.py, so Step 1 is safe from that angle.\n\nExecution ordering: T1-T3 are independent prompt edits (parallelizable). T4 (unify heuristics) must precede T5 (executor_notes gate). T6 (tests) comes last. Run pytest incrementally: after T4, run pytest tests/test_megaplan.py -k verdict to catch wrapper regressions; after T5, run pytest tests/test_evaluation.py; after T6, run full pytest.\n\nGotcha \u2014 <= vs < in thresholds:_is_substantive_reviewer_verdict uses <= for chars (line 560) but _is_perfunctory_ack uses < for length (line 84). When unifying, pick one convention and verify boundary test cases still pass. The existing boundary test at test_megaplan.py:1832 ("alpha beta beta gamma" = 21 chars, 4 words, 3 unique) passes _is_substantive_reviewer_verdict \u2014 make sure it passes the unified version too.\n\nPerfunctory executor_notes are non-blocking (DECISION-003). Append findings like sense-check perfunctory acks \u2014 they surface in the review but don't block gate approval.",
"tasks": [
{
"id": "T1",
"description": "Diversify executor_notes examples in the execute prompt (prompts.py:557-587). Replace the single 'Verified that...' example with 2-3 varied styles: (1) edge case catch, (2) expected behavior confirmation, (3) design choice explanation. Remove 'say what you verified' phrasing at line 557 and replace with a brief principle like 'Explain why your changes are correct \u2014 the diff shows what changed; notes should cover edge cases caught, expected behaviors confirmed, or design choices made.' Keep the skipped-task example as-is.",
"depends_on": [],
"status": "done",
"executor_notes": "Verified the execute prompt now uses a style-neutral instruction and three distinct executor_notes examples: edge-case catch, expected-behavior confirmation, and design-choice explanation, so the pattern is inferred instead of parroting 'Verified ...'.",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"sed -n '555,635p' megaplan/prompts.py"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Reframe settled decisions in review prompt (prompts.py:599, 618). Change line 599 header from 'Settled decisions (from gate approval - do not re-litigate these):' to 'Settled decisions (verify the executor implemented these correctly):'. Change line 618 instruction from 'Verify that execution honors these decisions, but do not question the decisions themselves.' to 'Verify that the executor implemented each settled decision correctly. Flag deviations from these decisions, but do not question the decisions themselves.'",
"depends_on": [],
"status": "done",
"executor_notes": "Confirmed the settled-decisions header now asks review to verify implementation, and the follow-on instruction explicitly tells reviewers to flag deviations without reopening the decisions themselves.",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"sed -n '598,622p' megaplan/prompts.py"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Downgrade structural nitpicks in critique prompt (prompts.py:297). The current instruction treats all structural issues as likely-significant. Split into two tiers: (1) Missing required sections (no H1, no Overview, no steps at all) remain likely-significant. (2) Formatting within sections (prose instead of numbered substeps, missing file references in a step) should be likely-minor. Add: 'Structural formatting within steps (e.g., prose instead of numbered substeps) should be likely-minor \u2014 the executor can follow prose instructions.'",
"depends_on": [],
"status": "done",
"executor_notes": "Checked the critique prompt against the structural nitpick that triggered FLAG-004: missing top-level sections still read as significant, while prose inside a step is now explicitly treated as likely-minor because the executor can still follow it.",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"sed -n '240,325p' megaplan/prompts.py"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T4",
"description": "Create unified is_rubber_stamp function in evaluation.py and wire it up. Per DECISION-001: (1) Move _MIN_VERDICT_CHARS/WORDS/UNIQUE_WORDS constants from handlers.py:553-555 into evaluation.py alongside _GENERIC_ACKS. (2) Create is_rubber_stamp(text: str, *, strict: bool = False) -> bool in evaluation.py \u2014 loose mode: blocklist + len<10 check only (current _is_perfunctory_ack logic); strict mode: blocklist check PLUS substance thresholds (chars<=20, words<4, unique<3 all trigger True). (3) Make _is_perfunctory_ack call is_rubber_stamp(text, strict=False). (4) In handlers.py, replace _is_substantive_reviewer_verdict body with return not is_rubber_stamp(text, strict=True), import is_rubber_stamp from evaluation, and remove the moved constants. Watch the <= vs < boundary: _is_substantive_reviewer_verdict uses <= for chars, _is_perfunctory_ack uses < for length \u2014 preserve the existing boundary behavior for each mode.",
"depends_on": [],
"status": "done",
"executor_notes": "Verified the unified is_rubber_stamp helper keeps loose-mode acknowledgments separate from strict reviewer thresholds, trims punctuation on generic acknowledgments, and still treats the 21-character boundary case as substantive through the handler wrapper.",
"files_changed": [
"megaplan/evaluation.py",
"megaplan/handlers.py"
],
"commands_run": [
"pytest tests/test_megaplan.py -k verdict"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T5",
"description": "Add executor_notes quality gate in validate_execution_evidence (evaluation.py:159-168 area). After the existing sense-check loop, add a task loop that checks each done task's executor_notes with is_rubber_stamp(notes, strict=True). If rubber stamp, append finding: f'Task {task_id} executor_notes are perfunctory: {notes.strip()!r}.' Per DECISION-003, this is non-blocking (advisory) \u2014 it's just a finding, same as perfunctory sense-check acks. The existing nonempty_fields check in handlers.py:1641 remains for empty strings.",
"depends_on": [
"T4"
],
"status": "done",
"executor_notes": "Verified validate_execution_evidence now adds an advisory finding for done tasks with perfunctory executor_notes while leaving empty notes to the separate nonempty_fields validation path, so the repo does not emit duplicate empty-note findings.",
"files_changed": [
"megaplan/evaluation.py"
],
"commands_run": [
"pytest tests/test_evaluation.py"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T6",
"description": "Add and update tests across all three test files. (1) tests/test_evaluation.py: Add tests for is_rubber_stamp \u2014 generic acks return True (loose), short strings return True (loose), low-substance 'Verified done good' returns True (strict), real notes return False (both modes), short but specific 'Confirmed prompt coverage.' returns False (loose) but True (strict). Add test for validate_execution_evidence with perfunctory executor_notes producing a finding. (2) tests/test_megaplan.py:1819-1833: Update _is_substantive_reviewer_verdict tests \u2014 they should still pass since the function is now a wrapper. Verify boundary case 'alpha beta beta gamma' (21 chars, 4 words, 3 unique) still returns True. (3) tests/test_prompts.py: Update line 474 assertion from 'do not re-litigate' to match new header text (e.g., 'verify the executor implemented'). Update line 482 assertion from 'Settled decisions (from gate approval' to match new header. Check if critique structural instruction is asserted and update if so. Run full pytest.",
"depends_on": [
"T1",
"T2",
"T3",
"T4",
"T5"
],
"status": "done",
"executor_notes": "Verified the new is_rubber_stamp coverage in test_evaluation.py, updated the settled-decision assertions in test_prompts.py, and confirmed the existing test_megaplan.py reviewer-verdict coverage still passes unchanged, including the alpha beta beta gamma boundary case, in the full pytest run.",
"files_changed": [
"tests/test_evaluation.py",
"tests/test_prompts.py"
],
"commands_run": [
"pytest"
],
"evidence_files": [],
"reviewer_verdict": ""
}
],
"watch_items": [
"FLAG-001: is_rubber_stamp must use strict parameter per DECISION-001 \u2014 loose mode for sense-check acks, strict mode for executor_notes and reviewer verdicts. Verify 'Confirmed prompt coverage.' passes loose but fails strict.",
"FLAG-002: tests/test_prompts.py:474 asserts 'do not re-litigate' which will break after T2. Line 482 asserts 'Settled decisions (from gate approval' which also changes. Must update in T6.",
"Threshold boundary: _is_substantive_reviewer_verdict uses <= for chars (line 560) while _is_perfunctory_ack uses < for length (line 84). Preserve existing boundary behavior in each mode of the unified function.",
"Existing test fixture 'Confirmed.' at test_megaplan.py:2095 must not break \u2014 it's a sense-check ack using loose mode, should still be caught by blocklist.",
"Perfunctory executor_notes findings are non-blocking per DECISION-003 \u2014 they are advisory findings, not gate blockers.",
"The critique prompt structural instruction at prompts.py:297 is a long line \u2014 check if test_prompts.py has assertions on this specific wording before editing."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Do the new executor_notes examples in the JSON block demonstrate at least 2 distinct styles (not all starting with 'Verified'), and is the 'say what you verified' instruction replaced with a style-neutral principle?",
"executor_note": "Confirmed the execute prompt now leads with a neutral principle and the JSON examples use three distinct note styles instead of repeating 'Verified ...'.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Does the settled decisions header now use positive framing ('verify the executor implemented these correctly') and does the instruction mention flagging deviations rather than just 'honoring' decisions?",
"executor_note": "Confirmed the review prompt now uses positive settled-decision framing and explicitly tells the reviewer to flag deviations from approved decisions.",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does the critique prompt now distinguish missing-section issues (likely-significant) from within-step formatting (likely-minor), and would 'prose instead of numbered substeps' be classified as likely-minor?",
"executor_note": "Confirmed the critique prompt now separates missing required sections from within-step formatting and classifies prose instead of numbered substeps as likely-minor.",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Does is_rubber_stamp('Confirmed prompt coverage.', strict=False) return False (allowed as sense-check ack) while is_rubber_stamp('Confirmed prompt coverage.', strict=True) returns True (too short for executor notes)? Does the boundary case 'alpha beta beta gamma' still pass _is_substantive_reviewer_verdict?",
"executor_note": "Verified loose mode allows 'Confirmed prompt coverage.' while strict mode rejects it for low substance, and the boundary case 'alpha beta beta gamma' still passes _is_substantive_reviewer_verdict.",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T5",
"question": "Does validate_execution_evidence now produce a finding for a done task with executor_notes='Verified. Done.' and does it leave empty executor_notes to the existing nonempty_fields check (no duplicate finding)?",
"executor_note": "Confirmed validate_execution_evidence reports a perfunctory-note finding for 'Verified. Done.' and leaves empty executor_notes to the existing nonempty_fields check instead of duplicating that failure here.",
"verdict": ""
},
{
"id": "SC6",
"task_id": "T6",
"question": "Does full pytest pass with zero failures, including updated assertions in test_prompts.py for the changed settled-decisions wording and new is_rubber_stamp tests in test_evaluation.py?",
"executor_note": "Confirmed full pytest passed with zero failures, including the updated settled-decision prompt assertions and the new is_rubber_stamp coverage.",
"verdict": ""
}
]
}
code
Plan metadata:
{
"version": 1,
"timestamp": "2026-03-25T04:38:47Z",
"hash": "sha256:ccb330191c7ea144de0359b13849e8fae933bbb2cdd90a213230842f9d729962",
"questions": [
"Item 4 says 'unify into one function' \u2014 should is_rubber_stamp be a public API (importable by name) or remain module-private with underscore prefix? I'm assuming public since it spans two modules now.",
"For the executor_notes quality gate (item 2): should a perfunctory note be a blocking finding (prevents gate approval) or advisory (logged but doesn't block)? Current sense-check perfunctory acks are non-blocking findings."
],
"success_criteria": [
"Executor prompt JSON block shows 2-3 diverse note styles; the word 'Verified' does not appear as a leading pattern in every example",
"Settled decisions header uses positive framing ('verify implemented correctly') instead of negative ('do not re-litigate')",
"Critique prompt distinguishes missing-section structural issues (likely-significant) from within-step formatting (likely-minor)",
"Single is_rubber_stamp function in evaluation.py replaces both _is_perfunctory_ack and _is_substantive_reviewer_verdict logic",
"_is_substantive_reviewer_verdict in handlers.py delegates to evaluation.is_rubber_stamp",
"validate_execution_evidence flags perfunctory executor_notes (e.g., 'Verified. Done.') in its findings",
"All existing tests in test_megaplan.py and test_evaluation.py continue to pass",
"New tests cover: generic ack detection, substance thresholds, and executor_notes quality gate in validate_execution_evidence"
],
"assumptions": [
"The unified function should be public (is_rubber_stamp) since it's used across modules \u2014 can rename if preferred",
"Perfunctory executor_notes findings will be non-blocking (same severity as perfunctory sense-check acks) unless told otherwise",
"The existing _is_perfunctory_ack name can be kept as a local alias to avoid churn in test files that reference it directly",
"No schema changes needed \u2014 executor_notes quality is enforced at validation time, not at the JSON schema level",
"The three example styles in the executor prompt are illustrative \u2014 exact wording will be adjusted during implementation to fit naturally"
],
"structure_warnings": []
}
code
Gate summary:
{
"passed": true,
"criteria_check": {
"count": 8,
"items": [
"Executor prompt JSON block shows 2-3 diverse note styles; the word 'Verified' does not appear as a leading pattern in every example",
"Settled decisions header uses positive framing ('verify implemented correctly') instead of negative ('do not re-litigate')",
"Critique prompt distinguishes missing-section structural issues (likely-significant) from within-step formatting (likely-minor)",
"Single is_rubber_stamp function in evaluation.py replaces both _is_perfunctory_ack and _is_substantive_reviewer_verdict logic",
"_is_substantive_reviewer_verdict in handlers.py delegates to evaluation.is_rubber_stamp",
"validate_execution_evidence flags perfunctory executor_notes (e.g., 'Verified. Done.') in its findings",
"All existing tests in test_megaplan.py and test_evaluation.py continue to pass",
"New tests cover: generic ack detection, substance thresholds, and executor_notes quality gate in validate_execution_evidence"
]
},
"preflight_results": {
"project_dir_exists": true,
"project_dir_writable": true,
"success_criteria_present": true,
"claude_available": true,
"codex_available": true
},
"unresolved_flags": [
{
"id": "FLAG-001",
"concern": "The plan over-unifies text-quality heuristics that currently serve different evidence roles; a single is_rubber_stamp threshold will likely misclassify acceptable concise acknowledgments as rubber stamps.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": "_is_substantive_reviewer_verdict in megaplan/handlers.py uses 20-char/4-word/3-unique-word thresholds only where a reviewer verdict can soften missing evidence_files in megaplan/handlers.py. _is_perfunctory_ack in megaplan/evaluation.py is much looser and only audits sense-check acknowledgments. The review prompt explicitly allows concise acknowledgments when they are specific in megaplan/prompts.py, and existing fixtures use short acknowledgments like 'Confirmed prompt coverage.' in tests/test_prompts.py and 'Confirmed.' in tests/test_megaplan.py.",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "FLAG-002",
"concern": "The plan misses the prompt-test surface it is changing, so it can leave the affected suite red or unverified even if the code edits themselves are correct.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": "Steps 1-3 all modify megaplan/prompts.py, megaplan/prompts.py, and megaplan/prompts.py, but Step 6 only mentions tests/test_evaluation.py and tests/test_megaplan.py. Prompt wording is already asserted in tests/test_prompts.py and the settled-decisions wording specifically checks for 'do not re-litigate' in tests/test_prompts.py.",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
}
],
"recommendation": "PROCEED",
"rationale": "Both flags are valid but executor-addressable. FLAG-001 (over-unification) is resolved by settling a design decision: the unified function must accept a strictness parameter so sense-check acks use loose thresholds while executor notes and reviewer verdicts use strict ones. FLAG-002 (missing test_prompts.py updates) is a straightforward completeness gap the executor will handle with a warning. No plan revision needed \u2014 these are implementation details, not architectural gaps. Iteration 1, no churn, no recurring critiques.",
"signals_assessment": "Weighted score 3.5 on iteration 1 with two open significant flags, no prior iterations or recurring critiques. Plan delta is n/a (first pass). Preflight is clean across all checks. The flags identify real but bounded risks \u2014 one design ambiguity (threshold unification) and one test surface omission \u2014 neither of which requires replanning. Score trajectory has no history to compare against.",
"warnings": [
"FLAG-002: Steps 1-3 modify prompts.py wording that is asserted in tests/test_prompts.py (e.g., 'do not re-litigate' at test_prompts.py:473). The executor MUST update tests/test_prompts.py alongside the prompt changes or the suite will go red.",
"FLAG-001: When implementing is_rubber_stamp, verify that existing test fixtures like 'Confirmed prompt coverage.' (test_prompts.py:153) and 'Confirmed.' (test_megaplan.py:2095) still pass under the new unified check. If they fail, the strictness parameter isn't calibrated correctly."
],
"settled_decisions": [
{
"id": "DECISION-001",
"decision": "The unified is_rubber_stamp function must support context-dependent strictness. Use a strict: bool = False parameter (or similar). Loose mode (default, for sense-check acks): blocklist-only check \u2014 rejects generic single-word acks but allows short specific text like 'Confirmed prompt coverage.' Strict mode (for executor_notes and reviewer verdicts): blocklist check PLUS substance thresholds (20 chars / 4 words / 3 unique words). Callers choose the mode.",
"rationale": "Sense-check acks and executor notes have fundamentally different substance expectations. A single threshold would either reject valid concise acks (too strict) or accept trivial executor notes (too loose). FLAG-001 evidence shows existing fixtures use short acks that would break under uniform strict thresholds."
},
{
"id": "DECISION-002",
"decision": "tests/test_prompts.py must be updated in Step 6 alongside test_evaluation.py and test_megaplan.py. Any prompt assertion that matches on changed wording (settled-decisions header, critique severity guidance, executor examples) must be updated to match the new text.",
"rationale": "FLAG-002 identified that the plan's test step omits the prompt test surface. This is now an explicit requirement for the executor."
},
{
"id": "DECISION-003",
"decision": "Perfunctory executor_notes findings are non-blocking (advisory), matching the existing severity of perfunctory sense-check ack findings.",
"rationale": "Per the plan's stated assumption. Executor notes are useful evidence but failing the quality check should not block gate approval \u2014 it surfaces as a finding for the reviewer to consider."
}
],
"override_forced": false,
"orchestrator_guidance": "First iteration; follow gate recommendation: PROCEED. Verify unresolved flags against the plan and project code before accepting.",
"robustness": "standard",
"signals": {
"iteration": 1,
"idea": "Quality gates and prompt improvements for megaplan pipeline\n\n## Items to address\n\n### 1. Executor notes prompt is too prescriptive\nThe prompt says 'say what you verified' so the executor literally starts every note with 'Verified...' \u2014 parroting, not reasoning. Fix: show 2-3 varied examples in the JSON block that demonstrate different verification styles (edge case catch, expected behavior confirmation, design choice explanation). Let the agent infer the pattern.\n\n### 2. Perfunctory-note detector for executor_notes\nWe have _is_perfunctory_ack for sense checks (rejects 'ok', 'done', 'confirmed' etc.) but executor notes have no equivalent quality gate. A note like 'Verified. Done.' would pass today. The nonempty_fields check only ensures non-empty, not non-trivial. Add a quality gate.\n\n### 3. Review prompt should positively frame settled decisions\nThe review prompt says 'do not re-litigate' settled decisions. It should be framed positively: 'verify the executor implemented these decisions correctly.' The reviewer's job is to check execution honored them, not to question them.\n\n### 4. Remove _is_substantive_reviewer_verdict and unify with _is_perfunctory_ack\nWe have two separate quality heuristics: _is_perfunctory_ack (word blocklist for sense check acks) and _is_substantive_reviewer_verdict (char/word/unique-word counts for reviewer verdicts). They solve the same problem \u2014 detecting rubber stamps. Unify them into one function.\n\n### 5. Critique should not waste iteration cycles on structural nitpicks\nIn our recent run, FLAG-004 was 'the plan fails the required step-section structure' because a step had prose instead of numbered substeps. This burned an entire critique\u2192gate\u2192revise cycle on formatting, not correctness. The critique prompt should distinguish structural nitpicks from real concerns \u2014 structural issues should be minor severity, not significant.",
"significant_flags": 2,
"unresolved_flags": [
{
"id": "FLAG-001",
"concern": "The plan over-unifies text-quality heuristics that currently serve different evidence roles; a single is_rubber_stamp threshold will likely misclassify acceptable concise acknowledgments as rubber stamps.",
"category": "correctness",
"severity": "significant",
"status": "open"
},
{
"id": "FLAG-002",
"concern": "The plan misses the prompt-test surface it is changing, so it can leave the affected suite red or unverified even if the code edits themselves are correct.",
"category": "completeness",
"severity": "significant",
"status": "open"
}
],
"resolved_flags": [],
"weighted_score": 3.5,
"weighted_history": [],
"plan_delta_from_previous": null,
"recurring_critiques": [],
"scope_creep_flags": [],
"loop_summary": "Iteration 1. Weighted score trajectory: 3.5. Plan deltas: n/a. Recurring critiques: 0. Resolved flags: 0. Open significant flags: 2."
}
}
code
Settled decisions (verify the executor implemented these correctly):
DECISION-001: The unified is_rubber_stamp function must support context-dependent strictness. Use a strict: bool = False parameter (or similar). Loose mode (default, for sense-check acks): blocklist-only check — rejects generic single-word acks but allows short specific text like 'Confirmed prompt coverage.' Strict mode (for executor_notes and reviewer verdicts): blocklist check PLUS substance thresholds (20 chars / 4 words / 3 unique words). Callers choose the mode. (Sense-check acks and executor notes have fundamentally different substance expectations. A single threshold would either reject valid concise acks (too strict) or accept trivial executor notes (too loose). FLAG-001 evidence shows existing fixtures use short acks that would break under uniform strict thresholds.)
DECISION-002: tests/test_prompts.py must be updated in Step 6 alongside test_evaluation.py and test_megaplan.py. Any prompt assertion that matches on changed wording (settled-decisions header, critique severity guidance, executor examples) must be updated to match the new text. (FLAG-002 identified that the plan's test step omits the prompt test surface. This is now an explicit requirement for the executor.)
DECISION-003: Perfunctory executor_notes findings are non-blocking (advisory), matching the existing severity of perfunctory sense-check ack findings. (Per the plan's stated assumption. Executor notes are useful evidence but failing the quality check should not block gate approval — it surfaces as a finding for the reviewer to consider.)
code
Execution summary:
{
"output": "Implemented the approved plan and captured execution evidence.",
"files_changed": [
"megaplan/evaluation.py",
"megaplan/handlers.py",
"megaplan/prompts.py",
"tests/test_evaluation.py",
"tests/test_prompts.py"
],
"commands_run": [
"git status --short",
"git diff -- megaplan/prompts.py megaplan/evaluation.py megaplan/handlers.py tests/test_evaluation.py tests/test_prompts.py",
"pytest tests/test_megaplan.py -k verdict",
"pytest tests/test_evaluation.py",
"pytest"
],
"deviations": [
"T6 required no edits in tests/test_megaplan.py; the existing reviewer-verdict wrapper tests already covered the boundary case and passed unchanged, so only tests/test_evaluation.py and tests/test_prompts.py were modified."
],
"task_updates": [
{
"task_id": "T1",
"status": "done",
"executor_notes": "Verified the execute prompt now uses a style-neutral instruction and three distinct executor_notes examples: edge-case catch, expected-behavior confirmation, and design-choice explanation, so the pattern is inferred instead of parroting 'Verified ...'.",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"sed -n '555,635p' megaplan/prompts.py"
]
},
{
"task_id": "T2",
"status": "done",
"executor_notes": "Confirmed the settled-decisions header now asks review to verify implementation, and the follow-on instruction explicitly tells reviewers to flag deviations without reopening the decisions themselves.",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"sed -n '598,622p' megaplan/prompts.py"
]
},
{
"task_id": "T3",
"status": "done",
"executor_notes": "Checked the critique prompt against the structural nitpick that triggered FLAG-004: missing top-level sections still read as significant, while prose inside a step is now explicitly treated as likely-minor because the executor can still follow it.",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"sed -n '240,325p' megaplan/prompts.py"
]
},
{
"task_id": "T4",
"status": "done",
"executor_notes": "Verified the unified is_rubber_stamp helper keeps loose-mode acknowledgments separate from strict reviewer thresholds, trims punctuation on generic acknowledgments, and still treats the 21-character boundary case as substantive through the handler wrapper.",
"files_changed": [
"megaplan/evaluation.py",
"megaplan/handlers.py"
],
"commands_run": [
"pytest tests/test_megaplan.py -k verdict"
]
},
{
"task_id": "T5",
"status": "done",
"executor_notes": "Verified validate_execution_evidence now adds an advisory finding for done tasks with perfunctory executor_notes while leaving empty notes to the separate nonempty_fields validation path, so the repo does not emit duplicate empty-note findings.",
"files_changed": [
"megaplan/evaluation.py"
],
"commands_run": [
"pytest tests/test_evaluation.py"
]
},
{
"task_id": "T6",
"status": "done",
"executor_notes": "Verified the new is_rubber_stamp coverage in test_evaluation.py, updated the settled-decision assertions in test_prompts.py, and confirmed the existing test_megaplan.py reviewer-verdict coverage still passes unchanged, including the alpha beta beta gamma boundary case, in the full pytest run.",
"files_changed": [
"tests/test_evaluation.py",
"tests/test_prompts.py"
],
"commands_run": [
"pytest"
]
}
],
"sense_check_acknowledgments": [
{
"sense_check_id": "SC1",
"executor_note": "Confirmed the execute prompt now leads with a neutral principle and the JSON examples use three distinct note styles instead of repeating 'Verified ...'."
},
{
"sense_check_id": "SC2",
"executor_note": "Confirmed the review prompt now uses positive settled-decision framing and explicitly tells the reviewer to flag deviations from approved decisions."
},
{
"sense_check_id": "SC3",
"executor_note": "Confirmed the critique prompt now separates missing required sections from within-step formatting and classifies prose instead of numbered substeps as likely-minor."
},
{
"sense_check_id": "SC4",
"executor_note": "Verified loose mode allows 'Confirmed prompt coverage.' while strict mode rejects it for low substance, and the boundary case 'alpha beta beta gamma' still passes _is_substantive_reviewer_verdict."
},
{
"sense_check_id": "SC5",
"executor_note": "Confirmed validate_execution_evidence reports a perfunctory-note finding for 'Verified. Done.' and leaves empty executor_notes to the existing nonempty_fields check instead of duplicating that failure here."
},
{
"sense_check_id": "SC6",
"executor_note": "Confirmed full pytest passed with zero failures, including the updated settled-decision prompt assertions and the new is_rubber_stamp coverage."
}
]
}
code
Execution audit (`execution_audit.json`):
{
"findings": [
"Git status shows changed files not claimed by any task: megaplan/schemas.py, scorecard.png"
],
"files_in_diff": [
"megaplan/evaluation.py",
"megaplan/handlers.py",
"megaplan/prompts.py",
"megaplan/schemas.py",
"scorecard.png",
"tests/test_evaluation.py",
"tests/test_prompts.py"
],
"files_claimed": [
"megaplan/evaluation.py",
"megaplan/handlers.py",
"megaplan/prompts.py",
"tests/test_evaluation.py",
"tests/test_prompts.py"
],
"skipped": false,
"reason": ""
}
code
Git diff summary:
M megaplan/evaluation.py
M megaplan/handlers.py
M megaplan/prompts.py
M megaplan/schemas.py
M scorecard.png
M tests/test_evaluation.py
M tests/test_prompts.py
code
Requirements:
- Be critical.
- Verify each success criterion explicitly.
- Trust executor evidence by default. Dig deeper only where the git diff, `execution_audit.json`, or vague notes make the claim ambiguous.
- The decisions listed above were settled at the gate stage. Verify that the executor implemented each settled decision correctly. Flag deviations from these decisions, but do not question the decisions themselves.
- If actual implementation work is incomplete, set top-level `review_verdict` to `needs_rework` so the plan routes back to execute. Use `approved` only when the work itself checks out.
- Cross-reference each task's `files_changed` and `commands_run` against the git diff and any audit findings.
- Review every `sense_check` explicitly and treat perfunctory acknowledgments as a reason to dig deeper.
- Follow this JSON shape exactly:
```json
{
"review_verdict": "approved",
"criteria": [
{
"name": "Review cross-check completed",
"pass": true,
"evidence": "Executor evidence in finalize.json matches the diff and the audit file."
}
],
"issues": [],
"summary": "Approved. The executor evidence is consistent and the remaining findings are advisory only.",
"task_verdicts": [
{
"task_id": "T3",
"reviewer_verdict": "Pass. Review prompt changes match the diff and reference the audit fallback correctly.",
"evidence_files": ["megaplan/prompts.py"]
}
],
"sense_check_verdicts": [
{
"sense_check_id": "SC3",
"verdict": "Confirmed. Both review prompts load execution_audit.json with a graceful fallback."
}
]
}
```
- When the work needs another execute pass, keep the same shape and change only `review_verdict` to `needs_rework`; put the actionable gaps in `issues`, `summary`, and per-task verdicts.
{"review_verdict":"needs_rework","criteria":[{"name":"Review cross-check completed","pass":true,"evidence":"The scoped diff matches the task claims for megaplan/prompts.py, megaplan/evaluation.py, megaplan/handlers.py, tests/test_evaluation.py, and tests/test_prompts.py. execution_audit.json also reports unrelated unclaimed changes in megaplan/schemas.py and scorecard.png."},{"name":"Executor prompt JSON block shows diverse note styles","pass":true,"evidence":"megaplan/prompts.py:559-588 replaces the prescriptive wording and shows three distinct examples starting with "Caught", "Confirmed", and "Kept", rather than leading every example with "Verified"."},{"name":"Settled decisions header uses positive framing","pass":true,"evidence":"megaplan/prompts.py:615 and megaplan/prompts.py:634 now tell reviewers to verify implementation and flag deviations, and tests/test_prompts.py:474-482 was updated to assert the new wording."},{"name":"Critique prompt distinguishes major structural gaps from minor formatting issues","pass":true,"evidence":"megaplan/prompts.py:297-299 separates missing required sections or step coverage as likely-significant from within-step formatting issues as usually likely-minor."},{"name":"Single is_rubber_stamp helper centralizes the shared rubber-stamp logic","pass":true,"evidence":"megaplan/evaluation.py:85-98 now holds the shared normalization, generic-ack, and strict-threshold logic, while the old call sites are reduced to wrappers."},{"name":"_is_substantive_reviewer_verdict delegates to evaluation.is_rubber_stamp","pass":true,"evidence":"megaplan/handlers.py:554-555 now returns not is_rubber_stamp(text, strict=True), and the old local threshold constants were removed from handlers.py."},{"name":"validate_execution_evidence flags perfunctory executor_notes","pass":true,"evidence":"megaplan/evaluation.py:189-198 adds an advisory finding for done tasks whose executor_notes fail strict rubber-stamp checks, and tests/test_evaluation.py includes a direct check for "Verified. Done."."},{"name":"Existing tests in test_megaplan.py and test_evaluation.py still pass","pass":true,"evidence":"The executor reported pytest tests/test_megaplan.py -k verdict, pytest tests/test_evaluation.py, and a full pytest run; the unchanged wrapper tests in tests/test_megaplan.py:1819-1833 still cover the boundary case."},{"name":"New tests cover generic ack detection, substance thresholds, and the executor_notes gate","pass":true,"evidence":"tests/test_evaluation.py:565-589 adds generic-ack, strict-threshold, and loose-vs-strict coverage, and tests/test_evaluation.py:677-714 adds the new validate_execution_evidence executor_notes finding check."},{"name":"DECISION-001 loose and strict modes are implemented exactly as settled","pass":false,"evidence":"megaplan/evaluation.py:90-91 still rejects any loose-mode text shorter than 10 characters, so loose mode is not blocklist-only as settled. tests/test_evaluation.py:569-570 then codifies that incorrect behavior by expecting is_rubber_stamp("Too short", strict=False) to return True."},{"name":"DECISION-002 prompt-test surface was updated","pass":true,"evidence":"tests/test_prompts.py:474-482 was updated for the changed settled-decision wording, which was the prompt assertion surface called out in the gate decision."},{"name":"DECISION-003 perfunctory executor_notes remain advisory","pass":true,"evidence":"The new executor_notes check only appends findings inside validate_execution_evidence; it does not change the blocking review logic, which matches the settled advisory-only decision."}],"issues":["DECISION-001 is only partially implemented: megaplan/evaluation.py:90-91 still treats any loose-mode acknowledgment shorter than 10 characters as a rubber stamp, but the settled behavior was blocklist-only in loose mode.","tests/test_evaluation.py:569-570 locks in that wrong loose-mode contract by asserting that a short specific acknowledgment should fail in loose mode, so the suite can pass while the settled decision remains violated."],"summary":"Needs rework. The prompt edits, reviewer-verdict delegation, executor_notes quality gate, and prompt-test updates all match the approved plan, but the unified rubber-stamp helper does not fully implement DECISION-001: loose mode still has a blanket length rejection, and the new evaluation test enshrines that deviation. execution_audit.json also shows unrelated unclaimed changes in megaplan/schemas.py and scorecard.png, but they do not change the blocking finding.","task_verdicts":[{"task_id":"T1","reviewer_verdict":"Pass. megaplan/prompts.py is the only scoped file changed for this task, and lines 559-588 match the claimed neutral instruction plus three varied executor_notes examples. The sed verification command is consistent with a prompt-only edit.","evidence_files":["megaplan/prompts.py"]},{"task_id":"T2","reviewer_verdict":"Pass. The settled-decisions header and reviewer instruction were positively reframed in megaplan/prompts.py, and the wording now matches the approved decision to verify implementation rather than re-litigate it.","evidence_files":["megaplan/prompts.py","tests/test_prompts.py"]},{"task_id":"T3","reviewer_verdict":"Pass. The critique prompt now treats missing required sections as likely-significant and within-step formatting issues as usually likely-minor, which addresses the structural-nitpick concern without reopening the plan structure itself.","evidence_files":["megaplan/prompts.py"]},{"task_id":"T4","reviewer_verdict":"Needs rework. The file claims and pytest command align with the diff, and handlers.py correctly delegates reviewer verdicts to strict mode, but megaplan/evaluation.py still applies a blanket <10 loose-mode rejection. That violates DECISION-001, which settled loose mode as blocklist-only.","evidence_files":["megaplan/evaluation.py","megaplan/handlers.py"]},{"task_id":"T5","reviewer_verdict":"Pass. validate_execution_evidence now adds a non-blocking finding for perfunctory executor_notes on done tasks and skips empty notes, which preserves the separate nonempty_fields path and matches DECISION-003.","evidence_files":["megaplan/evaluation.py","tests/test_evaluation.py"]},{"task_id":"T6","reviewer_verdict":"Needs rework. The prompt assertions in tests/test_prompts.py were updated correctly and the stated deviation about leaving tests/test_megaplan.py unchanged matches the diff, but tests/test_evaluation.py now asserts the wrong loose-mode behavior, so the new coverage enforces the T4 deviation instead of the settled contract.","evidence_files":["tests/test_evaluation.py","tests/test_prompts.py"]}],"sense_check_verdicts":[{"sense_check_id":"SC1","verdict":"Confirmed. The execute prompt now leads with a neutral principle and the JSON examples use three distinct note styles instead of repeating a single Verified pattern."},{"sense_check_id":"SC2","verdict":"Confirmed. The review prompt now positively frames settled decisions as implementation checks and explicitly tells the reviewer to flag deviations."},{"sense_check_id":"SC3","verdict":"Confirmed. The critique prompt now separates missing required sections from within-step formatting and classifies prose instead of numbered substeps as likely-minor."},{"sense_check_id":"SC4","verdict":"Partially confirmed. Confirmed prompt coverage. behaves as claimed in loose and strict modes, and the alpha beta beta gamma boundary case still passes through the reviewer-verdict wrapper, but loose mode still incorrectly rejects other short specific acknowledgments because of the <10 check in megaplan/evaluation.py."},{"sense_check_id":"SC5","verdict":"Confirmed. validate_execution_evidence now reports a perfunctory executor_notes finding for strict-mode notes like Verified. Done. while leaving empty notes to the existing nonempty_fields path."},{"sense_check_id":"SC6","verdict":"Accepted on executor evidence: the suite reportedly passed with the updated prompt assertions and new rubber-stamp tests. That green run does not clear the blocking issue, though, because one of the new tests enforces the wrong loose-mode contract."}]}
Review the implementation against the success criteria.
Quality gates and prompt improvements for megaplan pipeline
Items to address
1. Executor notes prompt is too prescriptive
The prompt says 'say what you verified' so the executor literally starts every note with 'Verified...' — parroting, not reasoning. Fix: show 2-3 varied examples in the JSON block that demonstrate different verification styles (edge case catch, expected behavior confirmation, design choice explanation). Let the agent infer the pattern.
2. Perfunctory-note detector for executor_notes
We have _is_perfunctory_ack for sense checks (rejects 'ok', 'done', 'confirmed' etc.) but executor notes have no equivalent quality gate. A note like 'Verified. Done.' would pass today. The nonempty_fields check only ensures non-empty, not non-trivial. Add a quality gate.
3. Review prompt should positively frame settled decisions
The review prompt says 'do not re-litigate' settled decisions. It should be framed positively: 'verify the executor implemented these decisions correctly.' The reviewer's job is to check execution honored them, not to question them.
4. Remove _is_substantive_reviewer_verdict and unify with _is_perfunctory_ack
We have two separate quality heuristics: _is_perfunctory_ack (word blocklist for sense check acks) and _is_substantive_reviewer_verdict (char/word/unique-word counts for reviewer verdicts). They solve the same problem — detecting rubber stamps. Unify them into one function.
5. Critique should not waste iteration cycles on structural nitpicks
In our recent run, FLAG-004 was 'the plan fails the required step-section structure' because a step had prose instead of numbered substeps. This burned an entire critique→gate→revise cycle on formatting, not correctness. The critique prompt should distinguish structural nitpicks from real concerns — structural issues should be minor severity, not significant.
code
Approved plan:
# Implementation Plan: Quality gates and prompt improvements for megaplan pipeline
Overview
Five targeted improvements to the megaplan pipeline's quality gates and prompts. The codebase is a Python project with prompts in megaplan/prompts.py, quality checks in megaplan/evaluation.py, handler logic in megaplan/handlers.py, and tests in tests/. All changes are isolated — no new files needed, no schema changes.
Key files:
megaplan/prompts.py — executor and critique prompt text
Replace the single-style instruction at prompts.py:557 ("say what you verified was correct...") with a brief principle followed by 2-3 varied examples in the JSON block.
Rewrite the existing task_updates example at prompts.py:566-579 to show three different styles:
One: edge case catch ("Empty strings in commands_run still count as missing evidence — tested this explicitly.")
Two: expected behavior confirmation ("The merge-then-block sequence works as designed: tasks with both fields populated pass through without FLAG-006.")
Three: design choice explanation ("Used sorted() on claimed paths so diff output is deterministic regardless of task execution order.")
Keep the skipped-task example as-is (it's already a different style).
Step 2: Reframe settled decisions in review prompt (megaplan/prompts.py:599, 618)
Scope: Small
Change the header at prompts.py:599 from "Settled decisions (from gate approval - do not re-litigate these):" to "Settled decisions (verify the executor implemented these correctly):".
Update the instruction at prompts.py:618 from "Verify that execution honors these decisions, but do not question the decisions themselves." to "Verify that the executor implemented each settled decision correctly. Flag deviations from these decisions, but do not question the decisions themselves.".
Step 3: Downgrade structural nitpicks in critique prompt (megaplan/prompts.py:297)
Scope: Small
Replace the instruction at prompts.py:297 that says structural issues should be likely-significant with a split:
Missing required sections (no H1, no Overview, no steps at all) → likely-significant
Formatting within sections (prose instead of numbered substeps, missing file references in a step) → likely-minor
Add a sentence: "Structural formatting within steps (e.g., prose instead of numbered substeps) should be likely-minor — the executor can follow prose instructions."
Phase 2: Unify quality heuristics
Step 4: Create unified is_rubber_stamp function (megaplan/evaluation.py)
Scope: Medium
Create a new function is_rubber_stamp(text: str) -> bool in evaluation.py that combines both checks:
Second: substance check (current _is_substantive_reviewer_verdict logic inverted — if not enough chars/words/unique-words, it's a rubber stamp)
Returns True if either the text is a known generic ack OR it fails the substance thresholds.
Move the _MIN_VERDICT_CHARS, _MIN_VERDICT_WORDS, _MIN_VERDICT_UNIQUE_WORDS constants from handlers.py:553-555 into evaluation.py alongside _GENERIC_ACKS.
Keep_is_perfunctory_ack as a thin wrapper or alias of is_rubber_stamp for backwards compatibility within validate_execution_evidence (avoid renaming in test files unnecessarily).
Replace_is_substantive_reviewer_verdict in handlers.py with a thin wrapper: not evaluation.is_rubber_stamp(text).
Update imports in handlers.py to pull from evaluation.
Add a call to is_rubber_stamp in validate_execution_evidence (after evaluation.py:162) for each task's executor_notes, similar to the existing sense-check loop at lines 159-168.
In the task-processing loop within validate_execution_evidence, after checking each task's executor_notes is non-empty, add:
python
if is_rubber_stamp(executor_notes):
findings.append(f"Task {task_id} executor_notes are perfunctory: {executor_notes.strip()!r}.")
Note: The existing nonempty_fields={"executor_notes"} check at handlers.py:1641 remains — it catches empty strings. The new check catches non-empty but trivial notes like "Verified. Done." or "Looks good."
Phase 3: Tests
Step 6: Add and update tests (tests/test_evaluation.py, tests/test_megaplan.py)
Scope: Medium
Add tests for is_rubber_stamp in tests/test_evaluation.py:
Known generic acks ("ok", "verified", "done") → True
Short strings (< 10 chars) → True
Low-substance ("Verified done good") → True (fails unique word count)
Real notes ("Tested edge case where empty array triggers FLAG-006 path") → False
Update existing _is_substantive_reviewer_verdict tests in tests/test_megaplan.py:1819-1833 to also test through the new wrapper, or migrate them to test is_rubber_stamp directly.
Add a test for validate_execution_evidence that includes a task with perfunctory executor_notes and verifies the finding is reported.
Runpytest to verify all existing tests still pass.
Execution Order
Steps 1-3 (prompt changes) can be done in any order — they're independent text edits.
Step 4 (unify heuristics) before Step 5 (executor_notes gate) — Step 5 depends on the unified function.
Step 6 (tests) last, after all logic is in place.
Validation Order
Run pytest tests/test_evaluation.py after Steps 4-5.
Run pytest tests/test_megaplan.py after Step 4 (to catch wrapper regressions).
Run full pytest after Step 6.
code
Execution tracking state (`finalize.json`):
{
"meta_commentary": "Six tasks covering three prompt text edits, one heuristic unification, one new quality gate, and one test task. Key execution guidance:\n\nFLAG-001 (over-unification): DECISION-001 settles this \u2014 is_rubber_stamp must take a strict: bool = False parameter. Loose mode (default): blocklist-only, rejects generic single-word acks but allows short specific text like "Confirmed prompt coverage." Strict mode: blocklist check PLUS substance thresholds (20 chars / 4 words / 3 unique words). Sense-check acks use loose mode; executor_notes and reviewer verdicts use strict mode. The existing _is_perfunctory_ack can become is_rubber_stamp(text, strict=False) and _is_substantive_reviewer_verdict becomes not is_rubber_stamp(text, strict=True).\n\nFLAG-002 (test_prompts.py): DECISION-002 settles this \u2014 tests/test_prompts.py:474 asserts \"do not re-litigate\" in prompt which will break after Step 2 changes the header. Line 482 also checks \"Settled decisions (from gate approval\" which changes too. Both must be updated in T6. The executor examples in the execute prompt are not currently asserted in test_prompts.py, so Step 1 is safe from that angle.\n\nExecution ordering: T1-T3 are independent prompt edits (parallelizable). T4 (unify heuristics) must precede T5 (executor_notes gate). T6 (tests) comes last. Run pytest incrementally: after T4, run pytest tests/test_megaplan.py -k verdict to catch wrapper regressions; after T5, run pytest tests/test_evaluation.py; after T6, run full pytest.\n\nGotcha \u2014 <= vs < in thresholds:_is_substantive_reviewer_verdict uses <= for chars (line 560) but _is_perfunctory_ack uses < for length (line 84). When unifying, pick one convention and verify boundary test cases still pass. The existing boundary test at test_megaplan.py:1832 ("alpha beta beta gamma" = 21 chars, 4 words, 3 unique) passes _is_substantive_reviewer_verdict \u2014 make sure it passes the unified version too.\n\nPerfunctory executor_notes are non-blocking (DECISION-003). Append findings like sense-check perfunctory acks \u2014 they surface in the review but don't block gate approval.",
"tasks": [
{
"id": "T1",
"description": "Diversify executor_notes examples in the execute prompt (prompts.py:557-587). Replace the single 'Verified that...' example with 2-3 varied styles: (1) edge case catch, (2) expected behavior confirmation, (3) design choice explanation. Remove 'say what you verified' phrasing at line 557 and replace with a brief principle like 'Explain why your changes are correct \u2014 the diff shows what changed; notes should cover edge cases caught, expected behaviors confirmed, or design choices made.' Keep the skipped-task example as-is.",
"depends_on": [],
"status": "done",
"executor_notes": "Verified the execute prompt now uses a style-neutral instruction and three distinct executor_notes examples: edge-case catch, expected-behavior confirmation, and design-choice explanation, so the pattern is inferred instead of parroting 'Verified ...'.",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"sed -n '555,635p' megaplan/prompts.py"
],
"evidence_files": [
"megaplan/prompts.py"
],
"reviewer_verdict": "Pass. megaplan/prompts.py is the only scoped file changed for this task, and lines 559-588 match the claimed neutral instruction plus three varied executor_notes examples. The sed verification command is consistent with a prompt-only edit."
},
{
"id": "T2",
"description": "Reframe settled decisions in review prompt (prompts.py:599, 618). Change line 599 header from 'Settled decisions (from gate approval - do not re-litigate these):' to 'Settled decisions (verify the executor implemented these correctly):'. Change line 618 instruction from 'Verify that execution honors these decisions, but do not question the decisions themselves.' to 'Verify that the executor implemented each settled decision correctly. Flag deviations from these decisions, but do not question the decisions themselves.'",
"depends_on": [],
"status": "done",
"executor_notes": "Confirmed the settled-decisions header now asks review to verify implementation, and the follow-on instruction explicitly tells reviewers to flag deviations without reopening the decisions themselves.",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"sed -n '598,622p' megaplan/prompts.py"
],
"evidence_files": [
"megaplan/prompts.py",
"tests/test_prompts.py"
],
"reviewer_verdict": "Pass. The settled-decisions header and reviewer instruction were positively reframed in megaplan/prompts.py, and the wording now matches the approved decision to verify implementation rather than re-litigate it."
},
{
"id": "T3",
"description": "Downgrade structural nitpicks in critique prompt (prompts.py:297). The current instruction treats all structural issues as likely-significant. Split into two tiers: (1) Missing required sections (no H1, no Overview, no steps at all) remain likely-significant. (2) Formatting within sections (prose instead of numbered substeps, missing file references in a step) should be likely-minor. Add: 'Structural formatting within steps (e.g., prose instead of numbered substeps) should be likely-minor \u2014 the executor can follow prose instructions.'",
"depends_on": [],
"status": "done",
"executor_notes": "Checked the critique prompt against the structural nitpick that triggered FLAG-004: missing top-level sections still read as significant, while prose inside a step is now explicitly treated as likely-minor because the executor can still follow it.",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"sed -n '240,325p' megaplan/prompts.py"
],
"evidence_files": [
"megaplan/prompts.py"
],
"reviewer_verdict": "Pass. The critique prompt now treats missing required sections as likely-significant and within-step formatting issues as usually likely-minor, which addresses the structural-nitpick concern without reopening the plan structure itself."
},
{
"id": "T4",
"description": "Create unified is_rubber_stamp function in evaluation.py and wire it up. Per DECISION-001: (1) Move _MIN_VERDICT_CHARS/WORDS/UNIQUE_WORDS constants from handlers.py:553-555 into evaluation.py alongside _GENERIC_ACKS. (2) Create in evaluation.py \u2014 loose mode: blocklist + len<10 check only (current _is_perfunctory_ack logic); strict mode: blocklist check PLUS substance thresholds (chars<=20, words<4, unique<3 all trigger True). (3) Make _is_perfunctory_ack call is_rubber_stamp(text, strict=False). (4) In handlers.py, replace _is_substantive_reviewer_verdict body with , import is_rubber_stamp from evaluation, and remove the moved constants. Watch the <= vs < boundary: _is_substantive_reviewer_verdict uses <= for chars, _is_perfunctory_ack uses < for length \u2014 preserve the existing boundary behavior for each mode.",
"depends_on": [],
"status": "done",
"executor_notes": "Verified the unified is_rubber_stamp helper keeps loose-mode acknowledgments separate from strict reviewer thresholds, trims punctuation on generic acknowledgments, and still treats the 21-character boundary case as substantive through the handler wrapper.",
"files_changed": [
"megaplan/evaluation.py",
"megaplan/handlers.py"
],
"commands_run": [
"pytest tests/test_megaplan.py -k verdict"
],
"evidence_files": [
"megaplan/evaluation.py",
"megaplan/handlers.py"
],
"reviewer_verdict": "Needs rework. The file claims and pytest command align with the diff, and handlers.py correctly delegates reviewer verdicts to strict mode, but megaplan/evaluation.py still applies a blanket <10 loose-mode rejection. That violates DECISION-001, which settled loose mode as blocklist-only."
},
{
"id": "T5",
"description": "Add executor_notes quality gate in validate_execution_evidence (evaluation.py:159-168 area). After the existing sense-check loop, add a task loop that checks each done task's executor_notes with is_rubber_stamp(notes, strict=True). If rubber stamp, append finding: f'Task {task_id} executor_notes are perfunctory: {notes.strip()!r}.' Per DECISION-003, this is non-blocking (advisory) \u2014 it's just a finding, same as perfunctory sense-check acks. The existing nonempty_fields check in handlers.py:1641 remains for empty strings.",
"depends_on": [
"T4"
],
"status": "done",
"executor_notes": "Verified validate_execution_evidence now adds an advisory finding for done tasks with perfunctory executor_notes while leaving empty notes to the separate nonempty_fields validation path, so the repo does not emit duplicate empty-note findings.",
"files_changed": [
"megaplan/evaluation.py"
],
"commands_run": [
"pytest tests/test_evaluation.py"
],
"evidence_files": [
"megaplan/evaluation.py",
"tests/test_evaluation.py"
],
"reviewer_verdict": "Pass. validate_execution_evidence now adds a non-blocking finding for perfunctory executor_notes on done tasks and skips empty notes, which preserves the separate nonempty_fields path and matches DECISION-003."
},
{
"id": "T6",
"description": "Add and update tests across all three test files. (1) tests/test_evaluation.py: Add tests for is_rubber_stamp \u2014 generic acks return True (loose), short strings return True (loose), low-substance 'Verified done good' returns True (strict), real notes return False (both modes), short but specific 'Confirmed prompt coverage.' returns False (loose) but True (strict). Add test for validate_execution_evidence with perfunctory executor_notes producing a finding. (2) tests/test_megaplan.py:1819-1833: Update _is_substantive_reviewer_verdict tests \u2014 they should still pass since the function is now a wrapper. Verify boundary case 'alpha beta beta gamma' (21 chars, 4 words, 3 unique) still returns True. (3) tests/test_prompts.py: Update line 474 assertion from 'do not re-litigate' to match new header text (e.g., 'verify the executor implemented'). Update line 482 assertion from 'Settled decisions (from gate approval' to match new header. Check if critique structural instruction is asserted and update if so. Run full pytest.",
"depends_on": [
"T1",
"T2",
"T3",
"T4",
"T5"
],
"status": "done",
"executor_notes": "Verified the new is_rubber_stamp coverage in test_evaluation.py, updated the settled-decision assertions in test_prompts.py, and confirmed the existing test_megaplan.py reviewer-verdict coverage still passes unchanged, including the alpha beta beta gamma boundary case, in the full pytest run.",
"files_changed": [
"tests/test_evaluation.py",
"tests/test_prompts.py"
],
"commands_run": [
"pytest"
],
"evidence_files": [
"tests/test_evaluation.py",
"tests/test_prompts.py"
],
"reviewer_verdict": "Needs rework. The prompt assertions in tests/test_prompts.py were updated correctly and the stated deviation about leaving tests/test_megaplan.py unchanged matches the diff, but tests/test_evaluation.py now asserts the wrong loose-mode behavior, so the new coverage enforces the T4 deviation instead of the settled contract."
}
],
"watch_items": [
"FLAG-001: is_rubber_stamp must use strict parameter per DECISION-001 \u2014 loose mode for sense-check acks, strict mode for executor_notes and reviewer verdicts. Verify 'Confirmed prompt coverage.' passes loose but fails strict.",
"FLAG-002: tests/test_prompts.py:474 asserts 'do not re-litigate' which will break after T2. Line 482 asserts 'Settled decisions (from gate approval' which also changes. Must update in T6.",
"Threshold boundary: _is_substantive_reviewer_verdict uses <= for chars (line 560) while _is_perfunctory_ack uses < for length (line 84). Preserve existing boundary behavior in each mode of the unified function.",
"Existing test fixture 'Confirmed.' at test_megaplan.py:2095 must not break \u2014 it's a sense-check ack using loose mode, should still be caught by blocklist.",
"Perfunctory executor_notes findings are non-blocking per DECISION-003 \u2014 they are advisory findings, not gate blockers.",
"The critique prompt structural instruction at prompts.py:297 is a long line \u2014 check if test_prompts.py has assertions on this specific wording before editing."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Do the new executor_notes examples in the JSON block demonstrate at least 2 distinct styles (not all starting with 'Verified'), and is the 'say what you verified' instruction replaced with a style-neutral principle?",
"executor_note": "Confirmed the execute prompt now leads with a neutral principle and the JSON examples use three distinct note styles instead of repeating 'Verified ...'.",
"verdict": "Confirmed. The execute prompt now leads with a neutral principle and the JSON examples use three distinct note styles instead of repeating a single Verified pattern."
},
{
"id": "SC2",
"task_id": "T2",
"question": "Does the settled decisions header now use positive framing ('verify the executor implemented these correctly') and does the instruction mention flagging deviations rather than just 'honoring' decisions?",
"executor_note": "Confirmed the review prompt now uses positive settled-decision framing and explicitly tells the reviewer to flag deviations from approved decisions.",
"verdict": "Confirmed. The review prompt now positively frames settled decisions as implementation checks and explicitly tells the reviewer to flag deviations."
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does the critique prompt now distinguish missing-section issues (likely-significant) from within-step formatting (likely-minor), and would 'prose instead of numbered substeps' be classified as likely-minor?",
"executor_note": "Confirmed the critique prompt now separates missing required sections from within-step formatting and classifies prose instead of numbered substeps as likely-minor.",
"verdict": "Confirmed. The critique prompt now separates missing required sections from within-step formatting and classifies prose instead of numbered substeps as likely-minor."
},
{
"id": "SC4",
"task_id": "T4",
"question": "Does is_rubber_stamp('Confirmed prompt coverage.', strict=False) return False (allowed as sense-check ack) while is_rubber_stamp('Confirmed prompt coverage.', strict=True) returns True (too short for executor notes)? Does the boundary case 'alpha beta beta gamma' still pass _is_substantive_reviewer_verdict?",
"executor_note": "Verified loose mode allows 'Confirmed prompt coverage.' while strict mode rejects it for low substance, and the boundary case 'alpha beta beta gamma' still passes _is_substantive_reviewer_verdict.",
"verdict": "Partially confirmed. Confirmed prompt coverage. behaves as claimed in loose and strict modes, and the alpha beta beta gamma boundary case still passes through the reviewer-verdict wrapper, but loose mode still incorrectly rejects other short specific acknowledgments because of the <10 check in megaplan/evaluation.py."
},
{
"id": "SC5",
"task_id": "T5",
"question": "Does validate_execution_evidence now produce a finding for a done task with executor_notes='Verified. Done.' and does it leave empty executor_notes to the existing nonempty_fields check (no duplicate finding)?",
"executor_note": "Confirmed validate_execution_evidence reports a perfunctory-note finding for 'Verified. Done.' and leaves empty executor_notes to the existing nonempty_fields check instead of duplicating that failure here.",
"verdict": "Confirmed. validate_execution_evidence now reports a perfunctory executor_notes finding for strict-mode notes like Verified. Done. while leaving empty notes to the existing nonempty_fields path."
},
{
"id": "SC6",
"task_id": "T6",
"question": "Does full pytest pass with zero failures, including updated assertions in test_prompts.py for the changed settled-decisions wording and new is_rubber_stamp tests in test_evaluation.py?",
"executor_note": "Confirmed full pytest passed with zero failures, including the updated settled-decision prompt assertions and the new is_rubber_stamp coverage.",
"verdict": "Accepted on executor evidence: the suite reportedly passed with the updated prompt assertions and new rubber-stamp tests. That green run does not clear the blocking issue, though, because one of the new tests enforces the wrong loose-mode contract."
}
]
}
code
Plan metadata:
{
"version": 1,
"timestamp": "2026-03-25T04:38:47Z",
"hash": "sha256:ccb330191c7ea144de0359b13849e8fae933bbb2cdd90a213230842f9d729962",
"questions": [
"Item 4 says 'unify into one function' \u2014 should is_rubber_stamp be a public API (importable by name) or remain module-private with underscore prefix? I'm assuming public since it spans two modules now.",
"For the executor_notes quality gate (item 2): should a perfunctory note be a blocking finding (prevents gate approval) or advisory (logged but doesn't block)? Current sense-check perfunctory acks are non-blocking findings."
],
"success_criteria": [
"Executor prompt JSON block shows 2-3 diverse note styles; the word 'Verified' does not appear as a leading pattern in every example",
"Settled decisions header uses positive framing ('verify implemented correctly') instead of negative ('do not re-litigate')",
"Critique prompt distinguishes missing-section structural issues (likely-significant) from within-step formatting (likely-minor)",
"Single is_rubber_stamp function in evaluation.py replaces both _is_perfunctory_ack and _is_substantive_reviewer_verdict logic",
"_is_substantive_reviewer_verdict in handlers.py delegates to evaluation.is_rubber_stamp",
"validate_execution_evidence flags perfunctory executor_notes (e.g., 'Verified. Done.') in its findings",
"All existing tests in test_megaplan.py and test_evaluation.py continue to pass",
"New tests cover: generic ack detection, substance thresholds, and executor_notes quality gate in validate_execution_evidence"
],
"assumptions": [
"The unified function should be public (is_rubber_stamp) since it's used across modules \u2014 can rename if preferred",
"Perfunctory executor_notes findings will be non-blocking (same severity as perfunctory sense-check acks) unless told otherwise",
"The existing _is_perfunctory_ack name can be kept as a local alias to avoid churn in test files that reference it directly",
"No schema changes needed \u2014 executor_notes quality is enforced at validation time, not at the JSON schema level",
"The three example styles in the executor prompt are illustrative \u2014 exact wording will be adjusted during implementation to fit naturally"
],
"structure_warnings": []
}
code
Gate summary:
{
"passed": true,
"criteria_check": {
"count": 8,
"items": [
"Executor prompt JSON block shows 2-3 diverse note styles; the word 'Verified' does not appear as a leading pattern in every example",
"Settled decisions header uses positive framing ('verify implemented correctly') instead of negative ('do not re-litigate')",
"Critique prompt distinguishes missing-section structural issues (likely-significant) from within-step formatting (likely-minor)",
"Single is_rubber_stamp function in evaluation.py replaces both _is_perfunctory_ack and _is_substantive_reviewer_verdict logic",
"_is_substantive_reviewer_verdict in handlers.py delegates to evaluation.is_rubber_stamp",
"validate_execution_evidence flags perfunctory executor_notes (e.g., 'Verified. Done.') in its findings",
"All existing tests in test_megaplan.py and test_evaluation.py continue to pass",
"New tests cover: generic ack detection, substance thresholds, and executor_notes quality gate in validate_execution_evidence"
]
},
"preflight_results": {
"project_dir_exists": true,
"project_dir_writable": true,
"success_criteria_present": true,
"claude_available": true,
"codex_available": true
},
"unresolved_flags": [
{
"id": "FLAG-001",
"concern": "The plan over-unifies text-quality heuristics that currently serve different evidence roles; a single is_rubber_stamp threshold will likely misclassify acceptable concise acknowledgments as rubber stamps.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": "_is_substantive_reviewer_verdict in megaplan/handlers.py uses 20-char/4-word/3-unique-word thresholds only where a reviewer verdict can soften missing evidence_files in megaplan/handlers.py. _is_perfunctory_ack in megaplan/evaluation.py is much looser and only audits sense-check acknowledgments. The review prompt explicitly allows concise acknowledgments when they are specific in megaplan/prompts.py, and existing fixtures use short acknowledgments like 'Confirmed prompt coverage.' in tests/test_prompts.py and 'Confirmed.' in tests/test_megaplan.py.",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "FLAG-002",
"concern": "The plan misses the prompt-test surface it is changing, so it can leave the affected suite red or unverified even if the code edits themselves are correct.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": "Steps 1-3 all modify , , and , but Step 6 only mentions and . Prompt wording is already asserted in and the settled-decisions wording specifically checks for 'do not re-litigate' in .",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
}
],
"recommendation": "PROCEED",
"rationale": "Both flags are valid but executor-addressable. FLAG-001 (over-unification) is resolved by settling a design decision: the unified function must accept a strictness parameter so sense-check acks use loose thresholds while executor notes and reviewer verdicts use strict ones. FLAG-002 (missing test_prompts.py updates) is a straightforward completeness gap the executor will handle with a warning. No plan revision needed \u2014 these are implementation details, not architectural gaps. Iteration 1, no churn, no recurring critiques.",
"signals_assessment": "Weighted score 3.5 on iteration 1 with two open significant flags, no prior iterations or recurring critiques. Plan delta is n/a (first pass). Preflight is clean across all checks. The flags identify real but bounded risks \u2014 one design ambiguity (threshold unification) and one test surface omission \u2014 neither of which requires replanning. Score trajectory has no history to compare against.",
"warnings": [
"FLAG-002: Steps 1-3 modify prompts.py wording that is asserted in tests/test_prompts.py (e.g., 'do not re-litigate' at test_prompts.py:473). The executor MUST update tests/test_prompts.py alongside the prompt changes or the suite will go red.",
"FLAG-001: When implementing is_rubber_stamp, verify that existing test fixtures like 'Confirmed prompt coverage.' (test_prompts.py:153) and 'Confirmed.' (test_megaplan.py:2095) still pass under the new unified check. If they fail, the strictness parameter isn't calibrated correctly."
],
"settled_decisions": [
{
"id": "DECISION-001",
"decision": "The unified is_rubber_stamp function must support context-dependent strictness. Use a parameter (or similar). Loose mode (default, for sense-check acks): blocklist-only check \u2014 rejects generic single-word acks but allows short specific text like 'Confirmed prompt coverage.' Strict mode (for executor_notes and reviewer verdicts): blocklist check PLUS substance thresholds (20 chars / 4 words / 3 unique words). Callers choose the mode.",
"rationale": "Sense-check acks and executor notes have fundamentally different substance expectations. A single threshold would either reject valid concise acks (too strict) or accept trivial executor notes (too loose). FLAG-001 evidence shows existing fixtures use short acks that would break under uniform strict thresholds."
},
{
"id": "DECISION-002",
"decision": "tests/test_prompts.py must be updated in Step 6 alongside test_evaluation.py and test_megaplan.py. Any prompt assertion that matches on changed wording (settled-decisions header, critique severity guidance, executor examples) must be updated to match the new text.",
"rationale": "FLAG-002 identified that the plan's test step omits the prompt test surface. This is now an explicit requirement for the executor."
},
{
"id": "DECISION-003",
"decision": "Perfunctory executor_notes findings are non-blocking (advisory), matching the existing severity of perfunctory sense-check ack findings.",
"rationale": "Per the plan's stated assumption. Executor notes are useful evidence but failing the quality check should not block gate approval \u2014 it surfaces as a finding for the reviewer to consider."
}
],
"override_forced": false,
"orchestrator_guidance": "First iteration; follow gate recommendation: PROCEED. Verify unresolved flags against the plan and project code before accepting.",
"robustness": "standard",
"signals": {
"iteration": 1,
"idea": "Quality gates and prompt improvements for megaplan pipeline\n\n## Items to address\n\n### 1. Executor notes prompt is too prescriptive\nThe prompt says 'say what you verified' so the executor literally starts every note with 'Verified...' \u2014 parroting, not reasoning. Fix: show 2-3 varied examples in the JSON block that demonstrate different verification styles (edge case catch, expected behavior confirmation, design choice explanation). Let the agent infer the pattern.\n\n### 2. Perfunctory-note detector for executor_notes\nWe have _is_perfunctory_ack for sense checks (rejects 'ok', 'done', 'confirmed' etc.) but executor notes have no equivalent quality gate. A note like 'Verified. Done.' would pass today. The nonempty_fields check only ensures non-empty, not non-trivial. Add a quality gate.\n\n### 3. Review prompt should positively frame settled decisions\nThe review prompt says 'do not re-litigate' settled decisions. It should be framed positively: 'verify the executor implemented these decisions correctly.' The reviewer's job is to check execution honored them, not to question them.\n\n### 4. Remove _is_substantive_reviewer_verdict and unify with _is_perfunctory_ack\nWe have two separate quality heuristics: _is_perfunctory_ack (word blocklist for sense check acks) and _is_substantive_reviewer_verdict (char/word/unique-word counts for reviewer verdicts). They solve the same problem \u2014 detecting rubber stamps. Unify them into one function.\n\n### 5. Critique should not waste iteration cycles on structural nitpicks\nIn our recent run, FLAG-004 was 'the plan fails the required step-section structure' because a step had prose instead of numbered substeps. This burned an entire critique\u2192gate\u2192revise cycle on formatting, not correctness. The critique prompt should distinguish structural nitpicks from real concerns \u2014 structural issues should be minor severity, not significant.",
"significant_flags": 2,
"unresolved_flags": [
{
"id": "FLAG-001",
"concern": "The plan over-unifies text-quality heuristics that currently serve different evidence roles; a single threshold will likely misclassify acceptable concise acknowledgments as rubber stamps.",
"category": "correctness",
"severity": "significant",
"status": "open"
},
{
"id": "FLAG-002",
"concern": "The plan misses the prompt-test surface it is changing, so it can leave the affected suite red or unverified even if the code edits themselves are correct.",
"category": "completeness",
"severity": "significant",
"status": "open"
}
],
"resolved_flags": [],
"weighted_score": 3.5,
"weighted_history": [],
"plan_delta_from_previous": null,
"recurring_critiques": [],
"scope_creep_flags": [],
"loop_summary": "Iteration 1. Weighted score trajectory: 3.5. Plan deltas: n/a. Recurring critiques: 0. Resolved flags: 0. Open significant flags: 2."
}
}
code
Settled decisions (verify the executor implemented these correctly):
DECISION-001: The unified is_rubber_stamp function must support context-dependent strictness. Use a strict: bool = False parameter (or similar). Loose mode (default, for sense-check acks): blocklist-only check — rejects generic single-word acks but allows short specific text like 'Confirmed prompt coverage.' Strict mode (for executor_notes and reviewer verdicts): blocklist check PLUS substance thresholds (20 chars / 4 words / 3 unique words). Callers choose the mode. (Sense-check acks and executor notes have fundamentally different substance expectations. A single threshold would either reject valid concise acks (too strict) or accept trivial executor notes (too loose). FLAG-001 evidence shows existing fixtures use short acks that would break under uniform strict thresholds.)
DECISION-002: tests/test_prompts.py must be updated in Step 6 alongside test_evaluation.py and test_megaplan.py. Any prompt assertion that matches on changed wording (settled-decisions header, critique severity guidance, executor examples) must be updated to match the new text. (FLAG-002 identified that the plan's test step omits the prompt test surface. This is now an explicit requirement for the executor.)
DECISION-003: Perfunctory executor_notes findings are non-blocking (advisory), matching the existing severity of perfunctory sense-check ack findings. (Per the plan's stated assumption. Executor notes are useful evidence but failing the quality check should not block gate approval — it surfaces as a finding for the reviewer to consider.)
code
Execution summary:
{
"output": "Could not apply the requested rework because the workspace is read-only in this session.",
"files_changed": [],
"commands_run": [
"sed -n '80,105p' megaplan/evaluation.py",
"sed -n '560,590p' tests/test_evaluation.py",
"git status --short"
],
"deviations": [
"This rerun could not modify repository files or checkpoint /Users/user_c042661f/Documents/megaplan/.megaplan/plans/quality-gates-and-prompt-20260325-0536/finalize.json because the session is read-only; git status also reported temp-file write failures in the restricted environment.",
"The current repo state still violates DECISION-001: megaplan/evaluation.py keeps the loose-mode len(stripped) < 10 rejection, and tests/test_evaluation.py still asserts that short specific loose-mode text should fail."
],
"task_updates": [
{
"task_id": "T1",
"status": "done",
"executor_notes": "Verified the execute prompt now uses a style-neutral instruction and three distinct executor_notes examples: edge-case catch, expected-behavior confirmation, and design-choice explanation, so the pattern is inferred instead of parroting 'Verified ...'.",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"sed -n '555,635p' megaplan/prompts.py"
]
},
{
"task_id": "T2",
"status": "done",
"executor_notes": "Confirmed the settled-decisions header now asks review to verify implementation, and the follow-on instruction explicitly tells reviewers to flag deviations without reopening the decisions themselves.",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"sed -n '598,622p' megaplan/prompts.py"
]
},
{
"task_id": "T3",
"status": "done",
"executor_notes": "Checked the critique prompt against the structural nitpick that triggered FLAG-004: missing top-level sections still read as significant, while prose inside a step is now explicitly treated as likely-minor because the executor can still follow it.",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"sed -n '240,325p' megaplan/prompts.py"
]
},
{
"task_id": "T4",
"status": "done",
"executor_notes": "Verified the unified is_rubber_stamp helper keeps loose-mode acknowledgments separate from strict reviewer thresholds, trims punctuation on generic acknowledgments, and still treats the 21-character boundary case as substantive through the handler wrapper.",
"files_changed": [
"megaplan/evaluation.py",
"megaplan/handlers.py"
],
"commands_run": [
"pytest tests/test_megaplan.py -k verdict"
]
},
{
"task_id": "T5",
"status": "done",
"executor_notes": "Verified validate_execution_evidence now adds an advisory finding for done tasks with perfunctory executor_notes while leaving empty notes to the separate nonempty_fields validation path, so the repo does not emit duplicate empty-note findings.",
"files_changed": [
"megaplan/evaluation.py"
],
"commands_run": [
"pytest tests/test_evaluation.py"
]
},
{
"task_id": "T6",
"status": "done",
"executor_notes": "Verified the new is_rubber_stamp coverage in test_evaluation.py, updated the settled-decision assertions in test_prompts.py, and confirmed the existing test_megaplan.py reviewer-verdict coverage still passes unchanged, including the alpha beta beta gamma boundary case, in the full pytest run.",
"files_changed": [
"tests/test_evaluation.py",
"tests/test_prompts.py"
],
"commands_run": [
"pytest"
]
}
],
"sense_check_acknowledgments": [
{
"sense_check_id": "SC1",
"executor_note": "Confirmed the execute prompt now leads with a neutral principle and the JSON examples use three distinct note styles instead of repeating 'Verified ...'."
},
{
"sense_check_id": "SC2",
"executor_note": "Confirmed the review prompt now uses positive settled-decision framing and explicitly tells the reviewer to flag deviations from approved decisions."
},
{
"sense_check_id": "SC3",
"executor_note": "Confirmed the critique prompt now separates missing required sections from within-step formatting and classifies prose instead of numbered substeps as likely-minor."
},
{
"sense_check_id": "SC4",
"executor_note": "Verified loose mode allows 'Confirmed prompt coverage.' while strict mode rejects it for low substance, and the boundary case 'alpha beta beta gamma' still passes _is_substantive_reviewer_verdict."
},
{
"sense_check_id": "SC5",
"executor_note": "Confirmed validate_execution_evidence reports a perfunctory-note finding for 'Verified. Done.' and leaves empty executor_notes to the existing nonempty_fields check instead of duplicating that failure here."
},
{
"sense_check_id": "SC6",
"executor_note": "Confirmed full pytest passed with zero failures, including the updated settled-decision prompt assertions and the new is_rubber_stamp coverage."
}
]
}
M megaplan/handlers.py
M megaplan/prompts.py
M megaplan/schemas.py
M scorecard.png
M tests/test_evaluation.py
M tests/test_prompts.py
code
Requirements:
- Be critical.
- Verify each success criterion explicitly.
- Trust executor evidence by default. Dig deeper only where the git diff, `execution_audit.json`, or vague notes make the claim ambiguous.
- The decisions listed above were settled at the gate stage. Verify that the executor implemented each settled decision correctly. Flag deviations from these decisions, but do not question the decisions themselves.
- If actual implementation work is incomplete, set top-level `review_verdict` to `needs_rework` so the plan routes back to execute. Use `approved` only when the work itself checks out.
- Cross-reference each task's `files_changed` and `commands_run` against the git diff and any audit findings.
- Review every `sense_check` explicitly and treat perfunctory acknowledgments as a reason to dig deeper.
- Follow this JSON shape exactly:
```json
{
"review_verdict": "approved",
"criteria": [
{
"name": "Review cross-check completed",
"pass": true,
"evidence": "Executor evidence in finalize.json matches the diff and the audit file."
}
],
"issues": [],
"summary": "Approved. The executor evidence is consistent and the remaining findings are advisory only.",
"task_verdicts": [
{
"task_id": "T3",
"reviewer_verdict": "Pass. Review prompt changes match the diff and reference the audit fallback correctly.",
"evidence_files": ["megaplan/prompts.py"]
}
],
"sense_check_verdicts": [
{
"sense_check_id": "SC3",
"verdict": "Confirmed. Both review prompts load execution_audit.json with a graceful fallback."
}
]
}
```
- When the work needs another execute pass, keep the same shape and change only `review_verdict` to `needs_rework`; put the actionable gaps in `issues`, `summary`, and per-task verdicts.
{"review_verdict":"needs_rework","criteria":[{"name":"Review cross-check completed","pass":true,"evidence":"The scoped diff still matches the original task claims for megaplan/prompts.py, megaplan/evaluation.py, megaplan/handlers.py, tests/test_evaluation.py, and tests/test_prompts.py. execution_audit.json continues to report unrelated unclaimed changes in megaplan/schemas.py and scorecard.png."},{"name":"Executor prompt JSON block shows diverse note styles","pass":true,"evidence":"megaplan/prompts.py replaces the prescriptive executor_notes wording and now shows three different example styles rather than leading every example with Verified."},{"name":"Settled decisions header uses positive framing","pass":true,"evidence":"megaplan/prompts.py now says reviewers should verify the executor implemented settled decisions correctly and flag deviations, and tests/test_prompts.py was updated for that wording."},{"name":"Critique prompt distinguishes major structural gaps from minor formatting issues","pass":true,"evidence":"megaplan/prompts.py now treats missing required sections as likely-significant and within-step formatting issues such as prose substeps as usually likely-minor."},{"name":"Single is_rubber_stamp function centralizes the shared rubber-stamp logic","pass":true,"evidence":"megaplan/evaluation.py contains the unified is_rubber_stamp helper, while _is_perfunctory_ack and _is_substantive_reviewer_verdict have been reduced to wrapper behavior."},{"name":"_is_substantive_reviewer_verdict delegates to evaluation.is_rubber_stamp","pass":true,"evidence":"megaplan/handlers.py now implements _is_substantive_reviewer_verdict as not is_rubber_stamp(text, strict=True)."},{"name":"validate_execution_evidence flags perfunctory executor_notes","pass":true,"evidence":"megaplan/evaluation.py adds a strict-mode executor_notes check and tests/test_evaluation.py includes coverage for a task note like Verified. Done."},{"name":"Existing tests in test_megaplan.py and test_evaluation.py continue to pass","pass":true,"evidence":"The original execution evidence reported targeted pytest runs plus a full pytest run. This review did not re-run the suite, but the repo state for those files is unchanged from that reported pass."},{"name":"New tests cover generic ack detection, substance thresholds, and the executor_notes gate","pass":true,"evidence":"tests/test_evaluation.py adds new is_rubber_stamp coverage and a validate_execution_evidence executor_notes finding test."},{"name":"DECISION-001 strictness split is implemented correctly","pass":false,"evidence":"The repo still violates the settled decision: megaplan/evaluation.py keeps a loose-mode len(stripped) < 10 rejection, so loose mode is not blocklist-only, and tests/test_evaluation.py still asserts that short specific loose-mode text should fail."},{"name":"DECISION-002 prompt-test surface was updated","pass":true,"evidence":"tests/test_prompts.py was updated for the changed settled-decision wording, which was the prompt assertion surface called out at gate time."},{"name":"DECISION-003 perfunctory executor_notes findings remain advisory","pass":true,"evidence":"The executor_notes quality gate only appends findings inside validate_execution_evidence and does not alter blocking review behavior."}],"issues":["The requested rework did not land. The rerun reports files_changed as empty and explicitly says the workspace was read-only, so the repo is still in the previously rejected state.","DECISION-001 remains unimplemented in the current code: megaplan/evaluation.py still rejects loose-mode acknowledgments solely for being shorter than 10 characters, and tests/test_evaluation.py still codifies that incorrect contract."],"summary":"Needs rework. The prompt edits, reviewer-verdict delegation, and executor_notes quality gate are still present and consistent with the earlier review, but the follow-up execute pass did not change the repo because the session was read-only. The blocking issue is unchanged: DECISION-001 is still not implemented correctly, since loose mode is not blocklist-only and the test suite still enforces the wrong loose-mode behavior.","task_verdicts":[{"task_id":"T1","reviewer_verdict":"Pass. megaplan/prompts.py still contains the neutral executor_notes guidance and varied JSON examples claimed by this task, and no later diff contradicts that prompt-only change.","evidence_files":["megaplan/prompts.py"]},{"task_id":"T2","reviewer_verdict":"Pass. The settled-decisions header and instruction remain positively framed in megaplan/prompts.py, and tests/test_prompts.py reflects the new wording.","evidence_files":["megaplan/prompts.py","tests/test_prompts.py"]},{"task_id":"T3","reviewer_verdict":"Pass. The critique prompt still distinguishes missing required sections from within-step formatting issues, matching the approved structural-severity change.","evidence_files":["megaplan/prompts.py"]},{"task_id":"T4","reviewer_verdict":"Needs rework. No follow-up code change landed, so megaplan/evaluation.py still applies a blanket <10 loose-mode rejection. handlers.py delegates correctly to strict mode, but the settled loose-mode behavior is still wrong.","evidence_files":["megaplan/evaluation.py","megaplan/handlers.py"]},{"task_id":"T5","reviewer_verdict":"Pass. validate_execution_evidence still adds a non-blocking finding for perfunctory executor_notes while leaving empty notes to the existing nonempty_fields path.","evidence_files":["megaplan/evaluation.py","tests/test_evaluation.py"]},{"task_id":"T6","reviewer_verdict":"Needs rework. No follow-up test change landed, so tests/test_evaluation.py still asserts the wrong loose-mode expectation even though tests/test_prompts.py was updated correctly for the prompt wording changes.","evidence_files":["tests/test_evaluation.py","tests/test_prompts.py"]}],"sense_check_verdicts":[{"sense_check_id":"SC1","verdict":"Confirmed. The execute prompt still uses a neutral principle and varied executor_notes examples instead of repeating a single Verified pattern."},{"sense_check_id":"SC2","verdict":"Confirmed. The review prompt still tells reviewers to verify implementation of settled decisions and flag deviations."},{"sense_check_id":"SC3","verdict":"Confirmed. The critique prompt still classifies prose instead of numbered substeps as likely-minor rather than likely-significant."},{"sense_check_id":"SC4","verdict":"Partially confirmed. Confirmed prompt coverage. still behaves as claimed in loose and strict modes, and the alpha beta beta gamma boundary case still passes, but the broader DECISION-001 contract is still violated because other short specific loose-mode acknowledgments are incorrectly rejected."},{"sense_check_id":"SC5","verdict":"Confirmed. validate_execution_evidence still reports a perfunctory executor_notes finding for Verified. Done. while leaving empty notes to the existing nonempty_fields handling."},{"sense_check_id":"SC6","verdict":"Accepted on the original executor evidence, but no new verification happened in this read-only rerun. The previously green suite still does not clear the blocking issue because one of the added tests enforces the wrong loose-mode contract."}]}
Review the implementation against the success criteria.
Quality gates and prompt improvements for megaplan pipeline
Items to address
1. Executor notes prompt is too prescriptive
The prompt says 'say what you verified' so the executor literally starts every note with 'Verified...' — parroting, not reasoning. Fix: show 2-3 varied examples in the JSON block that demonstrate different verification styles (edge case catch, expected behavior confirmation, design choice explanation). Let the agent infer the pattern.
2. Perfunctory-note detector for executor_notes
We have _is_perfunctory_ack for sense checks (rejects 'ok', 'done', 'confirmed' etc.) but executor notes have no equivalent quality gate. A note like 'Verified. Done.' would pass today. The nonempty_fields check only ensures non-empty, not non-trivial. Add a quality gate.
3. Review prompt should positively frame settled decisions
The review prompt says 'do not re-litigate' settled decisions. It should be framed positively: 'verify the executor implemented these decisions correctly.' The reviewer's job is to check execution honored them, not to question them.
4. Remove _is_substantive_reviewer_verdict and unify with _is_perfunctory_ack
We have two separate quality heuristics: _is_perfunctory_ack (word blocklist for sense check acks) and _is_substantive_reviewer_verdict (char/word/unique-word counts for reviewer verdicts). They solve the same problem — detecting rubber stamps. Unify them into one function.
5. Critique should not waste iteration cycles on structural nitpicks
In our recent run, FLAG-004 was 'the plan fails the required step-section structure' because a step had prose instead of numbered substeps. This burned an entire critique→gate→revise cycle on formatting, not correctness. The critique prompt should distinguish structural nitpicks from real concerns — structural issues should be minor severity, not significant.
code
Approved plan:
# Implementation Plan: Quality gates and prompt improvements for megaplan pipeline
Overview
Five targeted improvements to the megaplan pipeline's quality gates and prompts. The codebase is a Python project with prompts in megaplan/prompts.py, quality checks in megaplan/evaluation.py, handler logic in megaplan/handlers.py, and tests in tests/. All changes are isolated — no new files needed, no schema changes.
Key files:
megaplan/prompts.py — executor and critique prompt text
Replace the single-style instruction at prompts.py:557 ("say what you verified was correct...") with a brief principle followed by 2-3 varied examples in the JSON block.
Rewrite the existing task_updates example at prompts.py:566-579 to show three different styles:
One: edge case catch ("Empty strings in commands_run still count as missing evidence — tested this explicitly.")
Two: expected behavior confirmation ("The merge-then-block sequence works as designed: tasks with both fields populated pass through without FLAG-006.")
Three: design choice explanation ("Used sorted() on claimed paths so diff output is deterministic regardless of task execution order.")
Keep the skipped-task example as-is (it's already a different style).
Step 2: Reframe settled decisions in review prompt (megaplan/prompts.py:599, 618)
Scope: Small
Change the header at prompts.py:599 from "Settled decisions (from gate approval - do not re-litigate these):" to "Settled decisions (verify the executor implemented these correctly):".
Update the instruction at prompts.py:618 from "Verify that execution honors these decisions, but do not question the decisions themselves." to "Verify that the executor implemented each settled decision correctly. Flag deviations from these decisions, but do not question the decisions themselves.".
Step 3: Downgrade structural nitpicks in critique prompt (megaplan/prompts.py:297)
Scope: Small
Replace the instruction at prompts.py:297 that says structural issues should be likely-significant with a split:
Missing required sections (no H1, no Overview, no steps at all) → likely-significant
Formatting within sections (prose instead of numbered substeps, missing file references in a step) → likely-minor
Add a sentence: "Structural formatting within steps (e.g., prose instead of numbered substeps) should be likely-minor — the executor can follow prose instructions."
Phase 2: Unify quality heuristics
Step 4: Create unified is_rubber_stamp function (megaplan/evaluation.py)
Scope: Medium
Create a new function is_rubber_stamp(text: str) -> bool in evaluation.py that combines both checks:
Second: substance check (current _is_substantive_reviewer_verdict logic inverted — if not enough chars/words/unique-words, it's a rubber stamp)
Returns True if either the text is a known generic ack OR it fails the substance thresholds.
Move the _MIN_VERDICT_CHARS, _MIN_VERDICT_WORDS, _MIN_VERDICT_UNIQUE_WORDS constants from handlers.py:553-555 into evaluation.py alongside _GENERIC_ACKS.
Keep_is_perfunctory_ack as a thin wrapper or alias of is_rubber_stamp for backwards compatibility within validate_execution_evidence (avoid renaming in test files unnecessarily).
Replace_is_substantive_reviewer_verdict in handlers.py with a thin wrapper: not evaluation.is_rubber_stamp(text).
Update imports in handlers.py to pull from evaluation.
Add a call to is_rubber_stamp in validate_execution_evidence (after evaluation.py:162) for each task's executor_notes, similar to the existing sense-check loop at lines 159-168.
In the task-processing loop within validate_execution_evidence, after checking each task's executor_notes is non-empty, add:
python
if is_rubber_stamp(executor_notes):
findings.append(f"Task {task_id} executor_notes are perfunctory: {executor_notes.strip()!r}.")
Note: The existing nonempty_fields={"executor_notes"} check at handlers.py:1641 remains — it catches empty strings. The new check catches non-empty but trivial notes like "Verified. Done." or "Looks good."
Phase 3: Tests
Step 6: Add and update tests (tests/test_evaluation.py, tests/test_megaplan.py)
Scope: Medium
Add tests for is_rubber_stamp in tests/test_evaluation.py:
Known generic acks ("ok", "verified", "done") → True
Short strings (< 10 chars) → True
Low-substance ("Verified done good") → True (fails unique word count)
Real notes ("Tested edge case where empty array triggers FLAG-006 path") → False
Update existing _is_substantive_reviewer_verdict tests in tests/test_megaplan.py:1819-1833 to also test through the new wrapper, or migrate them to test is_rubber_stamp directly.
Add a test for validate_execution_evidence that includes a task with perfunctory executor_notes and verifies the finding is reported.
Runpytest to verify all existing tests still pass.
Execution Order
Steps 1-3 (prompt changes) can be done in any order — they're independent text edits.
Step 4 (unify heuristics) before Step 5 (executor_notes gate) — Step 5 depends on the unified function.
Step 6 (tests) last, after all logic is in place.
Validation Order
Run pytest tests/test_evaluation.py after Steps 4-5.
Run pytest tests/test_megaplan.py after Step 4 (to catch wrapper regressions).
Run full pytest after Step 6.
code
Execution tracking state (`finalize.json`):
{
"meta_commentary": "Six tasks covering three prompt text edits, one heuristic unification, one new quality gate, and one test task. Key execution guidance:\n\nFLAG-001 (over-unification): DECISION-001 settles this \u2014 is_rubber_stamp must take a strict: bool = False parameter. Loose mode (default): blocklist-only, rejects generic single-word acks but allows short specific text like "Confirmed prompt coverage." Strict mode: blocklist check PLUS substance thresholds (20 chars / 4 words / 3 unique words). Sense-check acks use loose mode; executor_notes and reviewer verdicts use strict mode. The existing _is_perfunctory_ack can become is_rubber_stamp(text, strict=False) and _is_substantive_reviewer_verdict becomes not is_rubber_stamp(text, strict=True).\n\nFLAG-002 (test_prompts.py): DECISION-002 settles this \u2014 tests/test_prompts.py:474 asserts \"do not re-litigate\" in prompt which will break after Step 2 changes the header. Line 482 also checks \"Settled decisions (from gate approval\" which changes too. Both must be updated in T6. The executor examples in the execute prompt are not currently asserted in test_prompts.py, so Step 1 is safe from that angle.\n\nExecution ordering: T1-T3 are independent prompt edits (parallelizable). T4 (unify heuristics) must precede T5 (executor_notes gate). T6 (tests) comes last. Run pytest incrementally: after T4, run pytest tests/test_megaplan.py -k verdict to catch wrapper regressions; after T5, run pytest tests/test_evaluation.py; after T6, run full pytest.\n\nGotcha \u2014 <= vs < in thresholds:_is_substantive_reviewer_verdict uses <= for chars (line 560) but _is_perfunctory_ack uses < for length (line 84). When unifying, pick one convention and verify boundary test cases still pass. The existing boundary test at test_megaplan.py:1832 ("alpha beta beta gamma" = 21 chars, 4 words, 3 unique) passes _is_substantive_reviewer_verdict \u2014 make sure it passes the unified version too.\n\nPerfunctory executor_notes are non-blocking (DECISION-003). Append findings like sense-check perfunctory acks \u2014 they surface in the review but don't block gate approval.",
"tasks": [
{
"id": "T1",
"description": "Diversify executor_notes examples in the execute prompt (prompts.py:557-587). Replace the single 'Verified that...' example with 2-3 varied styles: (1) edge case catch, (2) expected behavior confirmation, (3) design choice explanation. Remove 'say what you verified' phrasing at line 557 and replace with a brief principle like 'Explain why your changes are correct \u2014 the diff shows what changed; notes should cover edge cases caught, expected behaviors confirmed, or design choices made.' Keep the skipped-task example as-is.",
"depends_on": [],
"status": "done",
"executor_notes": "No changes needed \u2014 previously passed review. Execute prompt uses a style-neutral instruction and three distinct executor_notes examples: edge-case catch, expected-behavior confirmation, and design-choice explanation.",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"git diff megaplan/prompts.py"
],
"evidence_files": [
"megaplan/prompts.py"
],
"reviewer_verdict": "Pass. megaplan/prompts.py still contains the neutral executor_notes guidance and varied JSON examples claimed by this task, and no later diff contradicts that prompt-only change."
},
{
"id": "T2",
"description": "Reframe settled decisions in review prompt (prompts.py:599, 618). Change line 599 header from 'Settled decisions (from gate approval - do not re-litigate these):' to 'Settled decisions (verify the executor implemented these correctly):'. Change line 618 instruction from 'Verify that execution honors these decisions, but do not question the decisions themselves.' to 'Verify that the executor implemented each settled decision correctly. Flag deviations from these decisions, but do not question the decisions themselves.'",
"depends_on": [],
"status": "done",
"executor_notes": "No changes needed \u2014 previously passed review. Settled-decisions header uses positive framing and the instruction tells reviewers to flag deviations.",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"git diff megaplan/prompts.py"
],
"evidence_files": [
"megaplan/prompts.py",
"tests/test_prompts.py"
],
"reviewer_verdict": "Pass. The settled-decisions header and instruction remain positively framed in megaplan/prompts.py, and tests/test_prompts.py reflects the new wording."
},
{
"id": "T3",
"description": "Downgrade structural nitpicks in critique prompt (prompts.py:297). The current instruction treats all structural issues as likely-significant. Split into two tiers: (1) Missing required sections (no H1, no Overview, no steps at all) remain likely-significant. (2) Formatting within sections (prose instead of numbered substeps, missing file references in a step) should be likely-minor. Add: 'Structural formatting within steps (e.g., prose instead of numbered substeps) should be likely-minor \u2014 the executor can follow prose instructions.'",
"depends_on": [],
"status": "done",
"executor_notes": "No changes needed \u2014 previously passed review. Critique prompt separates missing sections (likely-significant) from within-step formatting (likely-minor).",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"git diff megaplan/prompts.py"
],
"evidence_files": [
"megaplan/prompts.py"
],
"reviewer_verdict": "Pass. The critique prompt still distinguishes missing required sections from within-step formatting issues, matching the approved structural-severity change."
},
{
"id": "T4",
"description": "Create unified is_rubber_stamp function in evaluation.py and wire it up. Per DECISION-001: (1) Move _MIN_VERDICT_CHARS/WORDS/UNIQUE_WORDS constants from handlers.py:553-555 into evaluation.py alongside _GENERIC_ACKS. (2) Create in evaluation.py \u2014 loose mode: blocklist + len<10 check only (current _is_perfunctory_ack logic); strict mode: blocklist check PLUS substance thresholds (chars<=20, words<4, unique<3 all trigger True). (3) Make _is_perfunctory_ack call is_rubber_stamp(text, strict=False). (4) In handlers.py, replace _is_substantive_reviewer_verdict body with , import is_rubber_stamp from evaluation, and remove the moved constants. Watch the <= vs < boundary: _is_substantive_reviewer_verdict uses <= for chars, _is_perfunctory_ack uses < for length \u2014 preserve the existing boundary behavior for each mode.",
"depends_on": [],
"status": "done",
"executor_notes": "DECISION-001 is already correctly implemented in the working tree. The git diff shows the old _is_perfunctory_ack (with len<10 check) was replaced with is_rubber_stamp(note, strict=False). Loose mode (lines 88-91) checks _GENERIC_ACKS blocklist only, then returns False if not strict \u2014 no len<10 check exists. Manual trace confirms: 'Confirmed prompt coverage.' returns False loose (not in blocklist) and True strict (3 words < 4). Boundary 'alpha beta beta gamma' (21 chars, 4 words, 3 unique) passes all strict thresholds.",
"files_changed": [
"megaplan/evaluation.py",
"megaplan/handlers.py"
],
"commands_run": [
"git diff megaplan/evaluation.py",
"git diff megaplan/handlers.py"
],
"evidence_files": [
"megaplan/evaluation.py",
"megaplan/handlers.py"
],
"reviewer_verdict": "Needs rework. No follow-up code change landed, so megaplan/evaluation.py still applies a blanket <10 loose-mode rejection. handlers.py delegates correctly to strict mode, but the settled loose-mode behavior is still wrong."
},
{
"id": "T5",
"description": "Add executor_notes quality gate in validate_execution_evidence (evaluation.py:159-168 area). After the existing sense-check loop, add a task loop that checks each done task's executor_notes with is_rubber_stamp(notes, strict=True). If rubber stamp, append finding: f'Task {task_id} executor_notes are perfunctory: {notes.strip()!r}.' Per DECISION-003, this is non-blocking (advisory) \u2014 it's just a finding, same as perfunctory sense-check acks. The existing nonempty_fields check in handlers.py:1641 remains for empty strings.",
"depends_on": [
"T4"
],
"status": "done",
"executor_notes": "No changes needed \u2014 previously passed review. validate_execution_evidence adds advisory findings for perfunctory executor_notes using strict mode, skipping empty notes.",
"files_changed": [
"megaplan/evaluation.py"
],
"commands_run": [
"git diff megaplan/evaluation.py"
],
"evidence_files": [
"megaplan/evaluation.py",
"tests/test_evaluation.py"
],
"reviewer_verdict": "Pass. validate_execution_evidence still adds a non-blocking finding for perfunctory executor_notes while leaving empty notes to the existing nonempty_fields path."
},
{
"id": "T6",
"description": "Add and update tests across all three test files. (1) tests/test_evaluation.py: Add tests for is_rubber_stamp \u2014 generic acks return True (loose), short strings return True (loose), low-substance 'Verified done good' returns True (strict), real notes return False (both modes), short but specific 'Confirmed prompt coverage.' returns False (loose) but True (strict). Add test for validate_execution_evidence with perfunctory executor_notes producing a finding. (2) tests/test_megaplan.py:1819-1833: Update _is_substantive_reviewer_verdict tests \u2014 they should still pass since the function is now a wrapper. Verify boundary case 'alpha beta beta gamma' (21 chars, 4 words, 3 unique) still returns True. (3) tests/test_prompts.py: Update line 474 assertion from 'do not re-litigate' to match new header text (e.g., 'verify the executor implemented'). Update line 482 assertion from 'Settled decisions (from gate approval' to match new header. Check if critique structural instruction is asserted and update if so. Run full pytest.",
"depends_on": [
"T1",
"T2",
"T3",
"T4",
"T5"
],
"status": "done",
"executor_notes": "Tests already correctly validate DECISION-001 in the working tree. test_is_rubber_stamp_loose_allows_short_specific_text asserts is_rubber_stamp('Too short', strict=False) is False \u2014 this is correct because loose mode is blocklist-only and 'too short' is not in _GENERIC_ACKS. test_is_rubber_stamp_allows_short_specific_ack_only_in_loose_mode asserts 'Confirmed prompt coverage.' is False loose / True strict. test_prompts.py assertions updated for new settled-decision wording. test_megaplan.py unchanged \u2014 wrapper tests still valid.",
"files_changed": [
"tests/test_evaluation.py",
"tests/test_prompts.py"
],
"commands_run": [
"git diff tests/test_evaluation.py",
"git diff tests/test_prompts.py"
],
"evidence_files": [
"tests/test_evaluation.py",
"tests/test_prompts.py"
],
"reviewer_verdict": "Needs rework. No follow-up test change landed, so tests/test_evaluation.py still asserts the wrong loose-mode expectation even though tests/test_prompts.py was updated correctly for the prompt wording changes."
}
],
"watch_items": [
"FLAG-001: is_rubber_stamp must use strict parameter per DECISION-001 \u2014 loose mode for sense-check acks, strict mode for executor_notes and reviewer verdicts. Verify 'Confirmed prompt coverage.' passes loose but fails strict.",
"FLAG-002: tests/test_prompts.py:474 asserts 'do not re-litigate' which will break after T2. Line 482 asserts 'Settled decisions (from gate approval' which also changes. Must update in T6.",
"Threshold boundary: _is_substantive_reviewer_verdict uses <= for chars (line 560) while _is_perfunctory_ack uses < for length (line 84). Preserve existing boundary behavior in each mode of the unified function.",
"Existing test fixture 'Confirmed.' at test_megaplan.py:2095 must not break \u2014 it's a sense-check ack using loose mode, should still be caught by blocklist.",
"Perfunctory executor_notes findings are non-blocking per DECISION-003 \u2014 they are advisory findings, not gate blockers.",
"The critique prompt structural instruction at prompts.py:297 is a long line \u2014 check if test_prompts.py has assertions on this specific wording before editing."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Do the new executor_notes examples in the JSON block demonstrate at least 2 distinct styles (not all starting with 'Verified'), and is the 'say what you verified' instruction replaced with a style-neutral principle?",
"executor_note": "Execute prompt uses a neutral principle and three distinct example styles: edge-case catch, expected-behavior confirmation, and design-choice explanation.",
"verdict": "Confirmed. The execute prompt still uses a neutral principle and varied executor_notes examples instead of repeating a single Verified pattern."
},
{
"id": "SC2",
"task_id": "T2",
"question": "Does the settled decisions header now use positive framing ('verify the executor implemented these correctly') and does the instruction mention flagging deviations rather than just 'honoring' decisions?",
"executor_note": "Review prompt header says 'verify the executor implemented these correctly' and instruction says 'Flag deviations from these decisions'.",
"verdict": "Confirmed. The review prompt still tells reviewers to verify implementation of settled decisions and flag deviations."
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does the critique prompt now distinguish missing-section issues (likely-significant) from within-step formatting (likely-minor), and would 'prose instead of numbered substeps' be classified as likely-minor?",
"executor_note": "Critique prompt explicitly classifies 'prose instead of numbered substeps' as likely-minor while missing sections remain likely-significant.",
"verdict": "Confirmed. The critique prompt still classifies prose instead of numbered substeps as likely-minor rather than likely-significant."
},
{
"id": "SC4",
"task_id": "T4",
"question": "Does is_rubber_stamp('Confirmed prompt coverage.', strict=False) return False (allowed as sense-check ack) while is_rubber_stamp('Confirmed prompt coverage.', strict=True) returns True (too short for executor notes)? Does the boundary case 'alpha beta beta gamma' still pass _is_substantive_reviewer_verdict?",
"executor_note": "Manual code trace confirms: 'Confirmed prompt coverage.' normalizes to 'confirmed prompt coverage' (not in _GENERIC_ACKS) so loose returns False. Strict: 27 chars > 20 passes, but 3 words < 4 triggers True. Boundary 'alpha beta beta gamma': 21 > 20, 4 not < 4, 3 not < 3 \u2014 returns False \u2014 _is_substantive_reviewer_verdict returns True.",
"verdict": "Partially confirmed. Confirmed prompt coverage. still behaves as claimed in loose and strict modes, and the alpha beta beta gamma boundary case still passes, but the broader DECISION-001 contract is still violated because other short specific loose-mode acknowledgments are incorrectly rejected."
},
{
"id": "SC5",
"task_id": "T5",
"question": "Does validate_execution_evidence now produce a finding for a done task with executor_notes='Verified. Done.' and does it leave empty executor_notes to the existing nonempty_fields check (no duplicate finding)?",
"executor_note": "Code skips empty notes (not notes.strip(): continue) and checks non-empty with strict mode. 'Verified. Done.' is 15 chars <= 20, triggers strict rejection. No duplicate finding for empty notes.",
"verdict": "Confirmed. validate_execution_evidence still reports a perfunctory executor_notes finding for Verified. Done. while leaving empty notes to the existing nonempty_fields handling."
},
{
"id": "SC6",
"task_id": "T6",
"question": "Does full pytest pass with zero failures, including updated assertions in test_prompts.py for the changed settled-decisions wording and new is_rubber_stamp tests in test_evaluation.py?",
"executor_note": "Unable to run pytest due to sandbox restrictions. Manual code traces confirm all test assertions match the implementation: loose mode is blocklist-only per DECISION-001, strict mode applies substance thresholds, and test_prompts.py assertions match new settled-decision wording.",
"verdict": "Accepted on the original executor evidence, but no new verification happened in this read-only rerun. The previously green suite still does not clear the blocking issue because one of the added tests enforces the wrong loose-mode contract."
}
]
}
code
Plan metadata:
{
"version": 1,
"timestamp": "2026-03-25T04:38:47Z",
"hash": "sha256:ccb330191c7ea144de0359b13849e8fae933bbb2cdd90a213230842f9d729962",
"questions": [
"Item 4 says 'unify into one function' \u2014 should is_rubber_stamp be a public API (importable by name) or remain module-private with underscore prefix? I'm assuming public since it spans two modules now.",
"For the executor_notes quality gate (item 2): should a perfunctory note be a blocking finding (prevents gate approval) or advisory (logged but doesn't block)? Current sense-check perfunctory acks are non-blocking findings."
],
"success_criteria": [
"Executor prompt JSON block shows 2-3 diverse note styles; the word 'Verified' does not appear as a leading pattern in every example",
"Settled decisions header uses positive framing ('verify implemented correctly') instead of negative ('do not re-litigate')",
"Critique prompt distinguishes missing-section structural issues (likely-significant) from within-step formatting (likely-minor)",
"Single is_rubber_stamp function in evaluation.py replaces both _is_perfunctory_ack and _is_substantive_reviewer_verdict logic",
"_is_substantive_reviewer_verdict in handlers.py delegates to evaluation.is_rubber_stamp",
"validate_execution_evidence flags perfunctory executor_notes (e.g., 'Verified. Done.') in its findings",
"All existing tests in test_megaplan.py and test_evaluation.py continue to pass",
"New tests cover: generic ack detection, substance thresholds, and executor_notes quality gate in validate_execution_evidence"
],
"assumptions": [
"The unified function should be public (is_rubber_stamp) since it's used across modules \u2014 can rename if preferred",
"Perfunctory executor_notes findings will be non-blocking (same severity as perfunctory sense-check acks) unless told otherwise",
"The existing _is_perfunctory_ack name can be kept as a local alias to avoid churn in test files that reference it directly",
"No schema changes needed \u2014 executor_notes quality is enforced at validation time, not at the JSON schema level",
"The three example styles in the executor prompt are illustrative \u2014 exact wording will be adjusted during implementation to fit naturally"
],
"structure_warnings": []
}
code
Gate summary:
{
"passed": true,
"criteria_check": {
"count": 8,
"items": [
"Executor prompt JSON block shows 2-3 diverse note styles; the word 'Verified' does not appear as a leading pattern in every example",
"Settled decisions header uses positive framing ('verify implemented correctly') instead of negative ('do not re-litigate')",
"Critique prompt distinguishes missing-section structural issues (likely-significant) from within-step formatting (likely-minor)",
"Single is_rubber_stamp function in evaluation.py replaces both _is_perfunctory_ack and _is_substantive_reviewer_verdict logic",
"_is_substantive_reviewer_verdict in handlers.py delegates to evaluation.is_rubber_stamp",
"validate_execution_evidence flags perfunctory executor_notes (e.g., 'Verified. Done.') in its findings",
"All existing tests in test_megaplan.py and test_evaluation.py continue to pass",
"New tests cover: generic ack detection, substance thresholds, and executor_notes quality gate in validate_execution_evidence"
]
},
"preflight_results": {
"project_dir_exists": true,
"project_dir_writable": true,
"success_criteria_present": true,
"claude_available": true,
"codex_available": true
},
"unresolved_flags": [
{
"id": "FLAG-001",
"concern": "The plan over-unifies text-quality heuristics that currently serve different evidence roles; a single is_rubber_stamp threshold will likely misclassify acceptable concise acknowledgments as rubber stamps.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": "_is_substantive_reviewer_verdict in megaplan/handlers.py uses 20-char/4-word/3-unique-word thresholds only where a reviewer verdict can soften missing evidence_files in megaplan/handlers.py. _is_perfunctory_ack in megaplan/evaluation.py is much looser and only audits sense-check acknowledgments. The review prompt explicitly allows concise acknowledgments when they are specific in megaplan/prompts.py, and existing fixtures use short acknowledgments like 'Confirmed prompt coverage.' in tests/test_prompts.py and 'Confirmed.' in tests/test_megaplan.py.",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "FLAG-002",
"concern": "The plan misses the prompt-test surface it is changing, so it can leave the affected suite red or unverified even if the code edits themselves are correct.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": "Steps 1-3 all modify , , and , but Step 6 only mentions and . Prompt wording is already asserted in and the settled-decisions wording specifically checks for 'do not re-litigate' in .",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
}
],
"recommendation": "PROCEED",
"rationale": "Both flags are valid but executor-addressable. FLAG-001 (over-unification) is resolved by settling a design decision: the unified function must accept a strictness parameter so sense-check acks use loose thresholds while executor notes and reviewer verdicts use strict ones. FLAG-002 (missing test_prompts.py updates) is a straightforward completeness gap the executor will handle with a warning. No plan revision needed \u2014 these are implementation details, not architectural gaps. Iteration 1, no churn, no recurring critiques.",
"signals_assessment": "Weighted score 3.5 on iteration 1 with two open significant flags, no prior iterations or recurring critiques. Plan delta is n/a (first pass). Preflight is clean across all checks. The flags identify real but bounded risks \u2014 one design ambiguity (threshold unification) and one test surface omission \u2014 neither of which requires replanning. Score trajectory has no history to compare against.",
"warnings": [
"FLAG-002: Steps 1-3 modify prompts.py wording that is asserted in tests/test_prompts.py (e.g., 'do not re-litigate' at test_prompts.py:473). The executor MUST update tests/test_prompts.py alongside the prompt changes or the suite will go red.",
"FLAG-001: When implementing is_rubber_stamp, verify that existing test fixtures like 'Confirmed prompt coverage.' (test_prompts.py:153) and 'Confirmed.' (test_megaplan.py:2095) still pass under the new unified check. If they fail, the strictness parameter isn't calibrated correctly."
],
"settled_decisions": [
{
"id": "DECISION-001",
"decision": "The unified is_rubber_stamp function must support context-dependent strictness. Use a parameter (or similar). Loose mode (default, for sense-check acks): blocklist-only check \u2014 rejects generic single-word acks but allows short specific text like 'Confirmed prompt coverage.' Strict mode (for executor_notes and reviewer verdicts): blocklist check PLUS substance thresholds (20 chars / 4 words / 3 unique words). Callers choose the mode.",
"rationale": "Sense-check acks and executor notes have fundamentally different substance expectations. A single threshold would either reject valid concise acks (too strict) or accept trivial executor notes (too loose). FLAG-001 evidence shows existing fixtures use short acks that would break under uniform strict thresholds."
},
{
"id": "DECISION-002",
"decision": "tests/test_prompts.py must be updated in Step 6 alongside test_evaluation.py and test_megaplan.py. Any prompt assertion that matches on changed wording (settled-decisions header, critique severity guidance, executor examples) must be updated to match the new text.",
"rationale": "FLAG-002 identified that the plan's test step omits the prompt test surface. This is now an explicit requirement for the executor."
},
{
"id": "DECISION-003",
"decision": "Perfunctory executor_notes findings are non-blocking (advisory), matching the existing severity of perfunctory sense-check ack findings.",
"rationale": "Per the plan's stated assumption. Executor notes are useful evidence but failing the quality check should not block gate approval \u2014 it surfaces as a finding for the reviewer to consider."
}
],
"override_forced": false,
"orchestrator_guidance": "First iteration; follow gate recommendation: PROCEED. Verify unresolved flags against the plan and project code before accepting.",
"robustness": "standard",
"signals": {
"iteration": 1,
"idea": "Quality gates and prompt improvements for megaplan pipeline\n\n## Items to address\n\n### 1. Executor notes prompt is too prescriptive\nThe prompt says 'say what you verified' so the executor literally starts every note with 'Verified...' \u2014 parroting, not reasoning. Fix: show 2-3 varied examples in the JSON block that demonstrate different verification styles (edge case catch, expected behavior confirmation, design choice explanation). Let the agent infer the pattern.\n\n### 2. Perfunctory-note detector for executor_notes\nWe have _is_perfunctory_ack for sense checks (rejects 'ok', 'done', 'confirmed' etc.) but executor notes have no equivalent quality gate. A note like 'Verified. Done.' would pass today. The nonempty_fields check only ensures non-empty, not non-trivial. Add a quality gate.\n\n### 3. Review prompt should positively frame settled decisions\nThe review prompt says 'do not re-litigate' settled decisions. It should be framed positively: 'verify the executor implemented these decisions correctly.' The reviewer's job is to check execution honored them, not to question them.\n\n### 4. Remove _is_substantive_reviewer_verdict and unify with _is_perfunctory_ack\nWe have two separate quality heuristics: _is_perfunctory_ack (word blocklist for sense check acks) and _is_substantive_reviewer_verdict (char/word/unique-word counts for reviewer verdicts). They solve the same problem \u2014 detecting rubber stamps. Unify them into one function.\n\n### 5. Critique should not waste iteration cycles on structural nitpicks\nIn our recent run, FLAG-004 was 'the plan fails the required step-section structure' because a step had prose instead of numbered substeps. This burned an entire critique\u2192gate\u2192revise cycle on formatting, not correctness. The critique prompt should distinguish structural nitpicks from real concerns \u2014 structural issues should be minor severity, not significant.",
"significant_flags": 2,
"unresolved_flags": [
{
"id": "FLAG-001",
"concern": "The plan over-unifies text-quality heuristics that currently serve different evidence roles; a single threshold will likely misclassify acceptable concise acknowledgments as rubber stamps.",
"category": "correctness",
"severity": "significant",
"status": "open"
},
{
"id": "FLAG-002",
"concern": "The plan misses the prompt-test surface it is changing, so it can leave the affected suite red or unverified even if the code edits themselves are correct.",
"category": "completeness",
"severity": "significant",
"status": "open"
}
],
"resolved_flags": [],
"weighted_score": 3.5,
"weighted_history": [],
"plan_delta_from_previous": null,
"recurring_critiques": [],
"scope_creep_flags": [],
"loop_summary": "Iteration 1. Weighted score trajectory: 3.5. Plan deltas: n/a. Recurring critiques: 0. Resolved flags: 0. Open significant flags: 2."
}
}
code
Settled decisions (verify the executor implemented these correctly):
DECISION-001: The unified is_rubber_stamp function must support context-dependent strictness. Use a strict: bool = False parameter (or similar). Loose mode (default, for sense-check acks): blocklist-only check — rejects generic single-word acks but allows short specific text like 'Confirmed prompt coverage.' Strict mode (for executor_notes and reviewer verdicts): blocklist check PLUS substance thresholds (20 chars / 4 words / 3 unique words). Callers choose the mode. (Sense-check acks and executor notes have fundamentally different substance expectations. A single threshold would either reject valid concise acks (too strict) or accept trivial executor notes (too loose). FLAG-001 evidence shows existing fixtures use short acks that would break under uniform strict thresholds.)
DECISION-002: tests/test_prompts.py must be updated in Step 6 alongside test_evaluation.py and test_megaplan.py. Any prompt assertion that matches on changed wording (settled-decisions header, critique severity guidance, executor examples) must be updated to match the new text. (FLAG-002 identified that the plan's test step omits the prompt test surface. This is now an explicit requirement for the executor.)
DECISION-003: Perfunctory executor_notes findings are non-blocking (advisory), matching the existing severity of perfunctory sense-check ack findings. (Per the plan's stated assumption. Executor notes are useful evidence but failing the quality check should not block gate approval — it surfaces as a finding for the reviewer to consider.)
code
Execution summary:
{
"output": "Re-execution pass: no code changes needed. The working tree already has the correct implementation from the first execution pass. The reviewer's "needs rework" finding was based on examining committed code rather than the working tree diff.\n\nKey clarification on the blocking issue: The review claimed "megaplan/evaluation.py still applies a blanket <10 loose-mode rejection" but the git diff clearly shows the old _is_perfunctory_ack (with len(note.strip()) < 10 or normalized in _GENERIC_ACKS) was replaced with is_rubber_stamp(note, strict=False). The is_rubber_stamp function's loose mode (lines 88-91) checks the _GENERIC_ACKS blocklist only, then returns False if not strict \u2014 there is no len<10 check. DECISION-001 is correctly implemented.\n\nSimilarly, tests/test_evaluation.py already has the correct assertions: is_rubber_stamp(\"Too short\", strict=False) is False validates that loose mode is blocklist-only, not length-based.\n\nUnable to run pytest due to sandbox permission restrictions, but manual code traces confirm all test assertions match the implementation.",
"files_changed": [
"megaplan/evaluation.py",
"megaplan/handlers.py",
"megaplan/prompts.py",
"tests/test_evaluation.py",
"tests/test_prompts.py"
],
"commands_run": [
"git diff megaplan/evaluation.py",
"git diff megaplan/handlers.py",
"git diff megaplan/prompts.py",
"git diff tests/test_evaluation.py",
"git diff tests/test_prompts.py",
"git diff --stat HEAD"
],
"deviations": [
"No code changes made in this re-execution pass. All changes were already correctly in the working tree from the first execution pass. The reviewer's 'needs rework' finding was based on examining committed code rather than the working tree, which already had the old len<10 check removed from _is_perfunctory_ack.",
"Unable to run pytest due to sandbox permission restrictions. Verification is based on manual code traces only.",
"Unable to write finalize.json checkpoint due to sandbox permission restrictions. Structured output is the authoritative record."
],
"task_updates": [
{
"task_id": "T1",
"status": "done",
"executor_notes": "No changes needed \u2014 previously passed review. Execute prompt uses a style-neutral instruction and three distinct executor_notes examples: edge-case catch, expected-behavior confirmation, and design-choice explanation.",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"git diff megaplan/prompts.py"
]
},
{
"task_id": "T2",
"status": "done",
"executor_notes": "No changes needed \u2014 previously passed review. Settled-decisions header uses positive framing and the instruction tells reviewers to flag deviations.",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"git diff megaplan/prompts.py"
]
},
{
"task_id": "T3",
"status": "done",
"executor_notes": "No changes needed \u2014 previously passed review. Critique prompt separates missing sections (likely-significant) from within-step formatting (likely-minor).",
"files_changed": [
"megaplan/prompts.py"
],
"commands_run": [
"git diff megaplan/prompts.py"
]
},
{
"task_id": "T4",
"status": "done",
"executor_notes": "DECISION-001 is already correctly implemented in the working tree. The git diff shows the old _is_perfunctory_ack (with len<10 check) was replaced with is_rubber_stamp(note, strict=False). Loose mode (lines 88-91) checks _GENERIC_ACKS blocklist only, then returns False if not strict \u2014 no len<10 check exists. Manual trace confirms: 'Confirmed prompt coverage.' returns False loose (not in blocklist) and True strict (3 words < 4). Boundary 'alpha beta beta gamma' (21 chars, 4 words, 3 unique) passes all strict thresholds.",
"files_changed": [
"megaplan/evaluation.py",
"megaplan/handlers.py"
],
"commands_run": [
"git diff megaplan/evaluation.py",
"git diff megaplan/handlers.py"
]
},
{
"task_id": "T5",
"status": "done",
"executor_notes": "No changes needed \u2014 previously passed review. validate_execution_evidence adds advisory findings for perfunctory executor_notes using strict mode, skipping empty notes.",
"files_changed": [
"megaplan/evaluation.py"
],
"commands_run": [
"git diff megaplan/evaluation.py"
]
},
{
"task_id": "T6",
"status": "done",
"executor_notes": "Tests already correctly validate DECISION-001 in the working tree. test_is_rubber_stamp_loose_allows_short_specific_text asserts is_rubber_stamp('Too short', strict=False) is False \u2014 this is correct because loose mode is blocklist-only and 'too short' is not in _GENERIC_ACKS. test_is_rubber_stamp_allows_short_specific_ack_only_in_loose_mode asserts 'Confirmed prompt coverage.' is False loose / True strict. test_prompts.py assertions updated for new settled-decision wording. test_megaplan.py unchanged \u2014 wrapper tests still valid.",
"files_changed": [
"tests/test_evaluation.py",
"tests/test_prompts.py"
],
"commands_run": [
"git diff tests/test_evaluation.py",
"git diff tests/test_prompts.py"
]
}
],
"sense_check_acknowledgments": [
{
"sense_check_id": "SC1",
"executor_note": "Execute prompt uses a neutral principle and three distinct example styles: edge-case catch, expected-behavior confirmation, and design-choice explanation."
},
{
"sense_check_id": "SC2",
"executor_note": "Review prompt header says 'verify the executor implemented these correctly' and instruction says 'Flag deviations from these decisions'."
},
{
"sense_check_id": "SC3",
"executor_note": "Critique prompt explicitly classifies 'prose instead of numbered substeps' as likely-minor while missing sections remain likely-significant."
},
{
"sense_check_id": "SC4",
"executor_note": "Manual code trace confirms: 'Confirmed prompt coverage.' normalizes to 'confirmed prompt coverage' (not in _GENERIC_ACKS) so loose returns False. Strict: 27 chars > 20 passes, but 3 words < 4 triggers True. Boundary 'alpha beta beta gamma': 21 > 20, 4 not < 4, 3 not < 3 \u2014 returns False \u2014 _is_substantive_reviewer_verdict returns True."
},
{
"sense_check_id": "SC5",
"executor_note": "Code skips empty notes (not notes.strip(): continue) and checks non-empty with strict mode. 'Verified. Done.' is 15 chars <= 20, triggers strict rejection. No duplicate finding for empty notes."
},
{
"sense_check_id": "SC6",
"executor_note": "Unable to run pytest due to sandbox restrictions. Manual code traces confirm all test assertions match the implementation: loose mode is blocklist-only per DECISION-001, strict mode applies substance thresholds, and test_prompts.py assertions match new settled-decision wording."
}
]
}
M megaplan/handlers.py
M megaplan/prompts.py
M megaplan/schemas.py
M scorecard.png
M tests/test_evaluation.py
M tests/test_prompts.py
code
Requirements:
- Be critical.
- Verify each success criterion explicitly.
- Trust executor evidence by default. Dig deeper only where the git diff, `execution_audit.json`, or vague notes make the claim ambiguous.
- The decisions listed above were settled at the gate stage. Verify that the executor implemented each settled decision correctly. Flag deviations from these decisions, but do not question the decisions themselves.
- If actual implementation work is incomplete, set top-level `review_verdict` to `needs_rework` so the plan routes back to execute. Use `approved` only when the work itself checks out.
- Cross-reference each task's `files_changed` and `commands_run` against the git diff and any audit findings.
- Review every `sense_check` explicitly and treat perfunctory acknowledgments as a reason to dig deeper.
- Follow this JSON shape exactly:
```json
{
"review_verdict": "approved",
"criteria": [
{
"name": "Review cross-check completed",
"pass": true,
"evidence": "Executor evidence in finalize.json matches the diff and the audit file."
}
],
"issues": [],
"summary": "Approved. The executor evidence is consistent and the remaining findings are advisory only.",
"task_verdicts": [
{
"task_id": "T3",
"reviewer_verdict": "Pass. Review prompt changes match the diff and reference the audit fallback correctly.",
"evidence_files": ["megaplan/prompts.py"]
}
],
"sense_check_verdicts": [
{
"sense_check_id": "SC3",
"verdict": "Confirmed. Both review prompts load execution_audit.json with a graceful fallback."
}
]
}
```
- When the work needs another execute pass, keep the same shape and change only `review_verdict` to `needs_rework`; put the actionable gaps in `issues`, `summary`, and per-task verdicts.
{"review_verdict":"approved","criteria":[{"name":"Review cross-check completed","pass":true,"evidence":"The working-tree diff matches the scoped task claims for megaplan/prompts.py, megaplan/evaluation.py, megaplan/handlers.py, tests/test_evaluation.py, and tests/test_prompts.py. execution_audit.json still reports unrelated unclaimed changes in megaplan/schemas.py and scorecard.png."},{"name":"Executor prompt JSON block shows 2-3 diverse note styles","pass":true,"evidence":"megaplan/prompts.py:559-593 uses style-neutral guidance and three distinct example note styles starting with Caught, Confirmed, and Kept rather than repeating Verified."},{"name":"Settled decisions header uses positive framing","pass":true,"evidence":"megaplan/prompts.py:615 and megaplan/prompts.py:634 now frame settled decisions as implementation checks, and tests/test_prompts.py:474-482 asserts the new wording."},{"name":"Critique prompt distinguishes missing-section structural issues from within-step formatting","pass":true,"evidence":"megaplan/prompts.py:297-299 now treats missing required sections as likely-significant and within-step formatting issues such as prose substeps as usually likely-minor."},{"name":"Single is_rubber_stamp function in evaluation.py replaces both heuristic bodies","pass":true,"evidence":"megaplan/evaluation.py:85-98 centralizes the rubber-stamp logic, _is_perfunctory_ack now delegates to it, and handlers.py no longer carries separate reviewer-threshold constants."},{"name":"_is_substantive_reviewer_verdict in handlers.py delegates to evaluation.is_rubber_stamp","pass":true,"evidence":"megaplan/handlers.py:554-555 now returns not is_rubber_stamp(text, strict=True)."},{"name":"validate_execution_evidence flags perfunctory executor_notes","pass":true,"evidence":"megaplan/evaluation.py:187-198 adds the strict-mode executor_notes finding, and tests/test_evaluation.py:674-715 covers Verified. Done. plus the empty-note non-duplicate case."},{"name":"All existing tests in test_megaplan.py and test_evaluation.py continue to pass","pass":true,"evidence":"The original executor evidence reported targeted pytest runs plus a full pytest run. I did not re-run pytest in this read-only review, but the current working tree matches those claimed changes and the key runtime behavior spot-checks align."},{"name":"New tests cover generic ack detection, substance thresholds, and the executor_notes gate","pass":true,"evidence":"tests/test_evaluation.py:565-590 adds generic-ack, loose-vs-strict, and strict-threshold coverage, and tests/test_evaluation.py:674-715 adds the executor_notes quality-gate test."},{"name":"DECISION-001 strictness split was implemented correctly","pass":true,"evidence":"megaplan/evaluation.py:88-91 now makes loose mode blocklist-only, strict mode applies the substantive thresholds, and a direct runtime spot-check confirmed Too short is False in loose mode, Confirmed prompt coverage. is False loose and True strict, and alpha beta beta gamma still passes the reviewer-verdict wrapper."},{"name":"DECISION-002 prompt-test surface was updated","pass":true,"evidence":"tests/test_prompts.py:474-482 was updated for the changed settled-decision wording, which was the prompt assertion surface called out at gate time."},{"name":"DECISION-003 perfunctory executor_notes findings remain advisory","pass":true,"evidence":"The executor_notes quality gate only appends findings inside validate_execution_evidence and does not alter any blocking review logic."}],"issues":[],"summary":"Approved. The current working tree satisfies the scoped success criteria and the settled decisions, including the previously disputed DECISION-001 loose-mode behavior. The remaining audit finding is advisory only: megaplan/schemas.py and scorecard.png are modified in the worktree but were not claimed by these tasks.","task_verdicts":[{"task_id":"T1","reviewer_verdict":"Pass. megaplan/prompts.py matches the claimed executor_notes prompt rewrite: the instruction is style-neutral and the JSON examples demonstrate varied verification styles.","evidence_files":["megaplan/prompts.py"]},{"task_id":"T2","reviewer_verdict":"Pass. The review prompt now positively frames settled decisions as implementation checks, and the updated prompt assertions in tests/test_prompts.py match that wording.","evidence_files":["megaplan/prompts.py","tests/test_prompts.py"]},{"task_id":"T3","reviewer_verdict":"Pass. The critique prompt now distinguishes missing required sections from within-step formatting problems, downgrading structural nitpicks like prose substeps to likely-minor.","evidence_files":["megaplan/prompts.py"]},{"task_id":"T4","reviewer_verdict":"Pass. The unified rubber-stamp helper is in megaplan/evaluation.py, handlers.py delegates reviewer verdicts to strict mode, and the current working tree correctly implements DECISION-001's blocklist-only loose mode.","evidence_files":["megaplan/evaluation.py","megaplan/handlers.py"]},{"task_id":"T5","reviewer_verdict":"Pass. validate_execution_evidence now adds a non-blocking finding for perfunctory executor_notes while still leaving empty-note enforcement to the existing nonempty_fields path.","evidence_files":["megaplan/evaluation.py","tests/test_evaluation.py"]},{"task_id":"T6","reviewer_verdict":"Pass. tests/test_evaluation.py now asserts the correct loose-mode and strict-mode behavior, tests/test_prompts.py covers the settled-decision wording change, and the existing reviewer-verdict wrapper tests in tests/test_megaplan.py remain valid unchanged.","evidence_files":["tests/test_evaluation.py","tests/test_prompts.py","tests/test_megaplan.py"]}],"sense_check_verdicts":[{"sense_check_id":"SC1","verdict":"Confirmed. The execute prompt uses a neutral principle and three varied executor_notes examples instead of repeating a single Verified pattern."},{"sense_check_id":"SC2","verdict":"Confirmed. The review prompt header and instruction now tell the reviewer to verify implementation of settled decisions and flag deviations."},{"sense_check_id":"SC3","verdict":"Confirmed. The critique prompt classifies prose instead of numbered substeps as likely-minor while keeping missing required sections likely-significant."},{"sense_check_id":"SC4","verdict":"Confirmed. The current implementation returns False for Confirmed prompt coverage. in loose mode, True for it in strict mode, and still treats alpha beta beta gamma as a substantive reviewer verdict."},{"sense_check_id":"SC5","verdict":"Confirmed. validate_execution_evidence reports a perfunctory executor_notes finding for Verified. Done. and skips empty notes so it does not duplicate the separate nonempty-fields failure path."},{"sense_check_id":"SC6","verdict":"Accepted on the original executor evidence. I did not re-run pytest in this read-only review, but the current working tree and direct behavior spot-checks are consistent with the reported green suite and updated assertions."}]}