You are already running inside the megaplan harness for this step. Do the requested planning/review/execution work directly. Do NOT invoke the megaplan CLI, do NOT read or activate the megaplan skill, do NOT start nested megaplan plans, and do NOT recurse into another planning harness. Treat mentions of megaplan in the repository or environment as implementation context only.
You are an independent reviewer. Critique the plan against the actual repository.
Add automated tiebreaker triggering + guardrails to megaplan. Builds on the megaplan tiebreaker CLI command being built in a concurrent light-megaplan run (branch tiebreaker-subcommand). This run adds the second layer: gate-driven automatic triggering, state machine extension, and all the guardrails. This is the v2 of tiebreaker — MVP was 'human manually invokes tiebreaker'; v2 is 'harness detects recurrence and routes to tiebreaker automatically with budgeted, audited guardrails.'
Full spec
Motivation. Today, gates can only recommend PROCEED / ITERATE / ESCALATE. When a plan has an unresolvable constraint tension (like M1's RQ-first vs store-first architectural conflict), the only path is ESCALATE — but the human gets only the gate's rationale, no structured decision context. The MVP tiebreaker CLI produces that context manually. This milestone makes the harness recognize when tiebreaker should run and route automatically — with enough guardrails that it doesn't burn tokens on false positives.
Core changes
1. Iteration-pressure signal (compute in evaluation.py / gate_signals.py)
fuzzy_group_id is assigned by embedding similarity on the flag's concern text — flags with >0.85 cosine similarity belong to the same fuzzy_group. This catches 'bootstrap race' flags labeled with different IDs across iterations but semantically the same concern. Use a small local embedding model (or an API call if that's already how critique works); make the similarity threshold configurable.
addressed_then_reopened_count counts transitions: flag went from open to addressed and back to open. That's the strongest signal of loop failure.
This table is rendered into the gate prompt context as a plain-text section.
Assistant
I'll review the plan against the actual codebase. Let me check the key files referenced.
Assistant
Now let me check a few specific things the plan references.
Assistant
Now let me check how auto.py handles the tiebreaker-related states and the _phase_command function.
Assistant
Now let me read the output template and check the _transition_matches function for completeness.
Assistant
I have enough information to write the critique. Key findings:
_transition_matches doesn't know about TIEBREAKER — it only handles gate_unset, gate_iterate, gate_escalate, gate_proceed_blocked, gate_proceed. The plan adds workflow transitions with a "gate_tiebreaker" condition but doesn't mention updating _transition_matches.
auto.py doesn't handle tiebreaker_pending/tiebreaker_ready — auto.py's _phase_command just passes next_step as CLI args. If next_step is "tiebreaker-run", it would try megaplan tiebreaker-run --plan X which doesn't exist as a CLI command. And tiebreaker_ready needs human input, so auto.py needs to treat it as a terminal/stall state.
Assistant
Found 4 concrete issues:
FLAG-001 (significant): _transition_matches doesn't know about gate_tiebreaker — the plan adds a workflow condition but never updates the matcher, so the tiebreaker transition will never fire.
FLAG-002 (significant): auto.py can't drive tiebreaker states — tiebreaker-run isn't a CLI command, and tiebreaker_ready (which requires human input) isn't in AUTOMATION_TERMINAL_STATES.
FLAG-003 (significant): State mutation ordering — _apply_gate_outcome would set state to tiebreaker_pending before handle_gate validates, so a force-demote would leave stale state.
FLAG-004 (minor): Settled-flag immunity is prompt-only with no programmatic guard in _apply_flag_updates.
2. Extend gate schema and prompt
megaplan/schemas.py:
python
GATE_RECOMMENDATION = Literal['PROCEED', 'ITERATE', 'ESCALATE', 'TIEBREAKER']
class GateOutput(TypedDict):
recommendation: GATE_RECOMMENDATION
rationale: str
flag_resolutions: list[FlagResolution]
tiebreaker_question: NotRequired[str] # required iff recommendation == TIEBREAKER
tiebreaker_flag_ids: NotRequired[list[str]] # which flags this resolves
tiebreaker_fuzzy_group_id: NotRequired[str] # which group this resolves
megaplan/prompts/gate.py gets a new section:
'If any fuzzy_group shows addressed_then_reopened_count >= 2 OR has >=2 member flags across >=2 iterations, consider whether it reflects an unresolvable constraint tension (architectural/philosophical — requires a human call -> TIEBREAKER) versus a plan-quality issue (the plan writer hasn't tried hard enough -> ITERATE). Recommend TIEBREAKER only for the former; cite specific flag IDs and iterations in your rationale.'
3. Harness validates TIEBREAKER recommendation
In handlers.pyhandle_gate:
If gate returns recommendation: TIEBREAKER, check that at least one fuzzy_group has addressed_then_reopened_count >= 2 OR spans >=2 iterations.
If no such group exists, reject the recommendation and re-prompt the gate once with: 'You recommended TIEBREAKER but no flag shows mechanical recurrence signal. Either identify specific flag(s) with iteration history or pick ITERATE.'
If re-prompt still says TIEBREAKER without signal, force-demote to ITERATE and log tiebreaker_rejected_no_signal.
4. New plan states
megaplan/types.py:
python
PlanState = Literal[
..., 'critiqued', 'gated', 'finalized', 'executed', 'reviewed', 'done',
'tiebreaker_pending', # NEW — tiebreaker recommended, researcher/challenger running
'tiebreaker_ready', # NEW — synthesis done, awaiting human decision
]
megaplan tiebreaker decide --plan <name> --pick <option_name> --rationale '...'
megaplan tiebreaker decide --plan <name> --escalate --rationale '...' # human chooses to handle outside the tool
megaplan tiebreaker decide --plan <name> --replan --rationale '...' # question itself is wrong
Implementation:
Write decision to the plan's flag_registry as settled_by_tiebreaker against the fuzzy_group_id.
Record the decision in tiebreaker_decisions.json with full context (researcher pick, challenger pick, human pick, rationale, timestamp).
Transition state back to critiqued. Next revise inherits the settled resolution.
6. Settled-decision immunity in critique prompt
In megaplan/prompts/critique.py, add a section listing settled_by_tiebreaker decisions for the current plan. Prompt instruction:
'The following concerns have been settled by human tiebreaker decision. Do NOT re-raise them under a new surface. Only raise a new concern if new evidence materially changes the settled premise — and if so, explicitly cite which settled decision you are challenging and why.'
7. Guardrails
Budget per plan.plan_config.max_tiebreakers_per_plan (default 2). Counted in the plan's state metadata. Exceeded -> gate's TIEBREAKER force-demoted to ESCALATE with rationale 'tiebreaker budget exhausted'.
Cost ceiling. Tiebreaker run has a wall-clock (default 30m) and token (default 150k) budget. Exceeded -> abort, emit partial output, force-demote to ESCALATE.
Domain blocklist.plan_config.tiebreaker_blocklist: list[str] (default []). Concerns with category in blocklist skip tiebreaker.
Spec-level opt-out. Idea file front-matter field allow_tiebreaker: false disables the entire mechanism for the plan.
Tiebreaker refusal. Researcher can emit decision_not_ripe: true with reason; harness treats as abort without consuming a tiebreaker budget slot.
8. Audit tracking
megaplan/audit.py (new or extend existing):
After each tiebreaker, record: {plan_name, tiebreaker_index, fuzzy_group_id, question, researcher_pick, challenger_pick, human_pick, matched_researcher, matched_challenger, time_to_decide_seconds, tokens_spent, subsequent_plan_reached_done}.
New CLI: megaplan tiebreaker audit [--plan X | --global] — shows usage stats, hit rate, token cost. --global aggregates across all plans.
9. Tests
Unit: iteration_pressure computes correctly across synthetic flag histories.
Unit: gate schema validation rejects TIEBREAKER without tiebreaker_question + tiebreaker_fuzzy_group_id.
Unit: handle_gate rejects TIEBREAKER without mechanical signal, re-prompts, force-demotes if re-prompt fails.
Unit: budget enforcement (3rd tiebreaker recommendation on same plan demotes).
Unit: settled-decision blocks critique from re-raising same fuzzy_group concern.
Integration: synthetic plan with recurring flags runs through critique -> gate -> tiebreaker_pending -> tiebreaker_ready -> decide -> critiqued with settled resolution.
10. Out of scope
Cross-plan tiebreaker detection. Fuzzy-grouping is plan-local; cross-plan is v3.
Automatic tiebreaker resolution. Human always decides — no auto-pick.
Tiebreaker on review phase. This run does the gate path only. Review-phase tiebreaker is a follow-up.
Embedding model selection. Use whatever critique already uses for text similarity. Don't introduce a new embedding dependency if one exists.
UI / TUI. Markdown + JSON artifacts only.
11. Files
NEW: megaplan/tiebreaker_trigger.py (gate signal + validation), or extend gate_signals.py
NEW: megaplan/audit.py if it doesn't already exist, else extend
Coordinate with concurrent runs. Read current pyproject.toml version:
If 0.14.x unchanged -> bump to 0.18.0 (leaving 0.15.0 doc-mode, 0.16.0 chain, 0.17.0 verifiability + tiebreaker CLI slots)
If 0.17.x -> bump to 0.18.0
If 0.18.0 already -> bump to 0.18.1 and note coordination in CHANGELOG
If unclear, add a PR-body note flagging the version uncertainty.
Branch: tiebreaker-auto-trigger off main.
Dependency note: the megaplan tiebreaker CLI (researcher + challenger + synthesis) is being built concurrently in branch tiebreaker-subcommand. This run's code depends on that CLI existing. If during plan phase you notice megaplan/tiebreaker.py is absent on main, note it in the plan's assumptions that this work assumes the subcommand exists via merge of tiebreaker-subcommand. You can still land this run's code on tiebreaker-auto-trigger — it will fail to exercise the CLI but tests can mock it. Surface the dependency clearly in the PR body.
megaplan (v0.17.0) has a manual tiebreaker CLI (researcher→challenger→synthesis in megaplan/tiebreaker.py) but no automatic triggering. This work adds: (1) iteration-pressure computation to detect recurring flags, (2) a TIEBREAKER gate recommendation with validation guardrails, (3) new plan states tiebreaker_pending/tiebreaker_ready, (4) a tiebreaker decide subcommand, (5) settled-decision immunity in critique, (6) budget/audit tracking, and (7) tests.
Key simplification from spec: The spec suggests embedding-based fuzzy grouping. The codebase already has _jaccard_similarity (word-overlap, megaplan/_core/registries.py:114) used for debt matching. We'll reuse this for flag grouping instead of introducing an embedding model — simpler, zero new dependencies, and the spec says "use whatever critique already uses for text similarity." The threshold (default 0.5 for debt) can be tuned separately for flag grouping (default 0.6).
Constraint:_apply_flag_updates (flags.py:97) overwrites raised_in on re-raise (line 130), so a flag's transition history isn't preserved in a single field. We'll reconstruct history by scanning all critique_v{N}.json artifacts + the flag registry, which is read-only and doesn't require schema changes to FlagRecord.
Phase 1: Foundation — Types, Schemas, Iteration Pressure
Step 1: Add new states and config fields (megaplan/types.py)
Scope: Small
Add two new state constants after STATE_AWAITING_HUMAN (line 21):
Createmegaplan/iteration_pressure.py with these functions:
compute_flag_history(plan_dir: Path, current_iteration: int) -> list[FlagHistory] — scans critique_v{1..N}.json artifacts and faults.json to reconstruct each flag's status transitions across iterations: when it was raised, addressed, re-opened.
compute_fuzzy_groups(flags: list[FlagRecord], threshold: float = 0.6) -> list[FuzzyGroup] — groups flags by Jaccard word similarity on concern text. Reuse _concern_word_set and _jaccard_similarity from registries.py. Each group gets a stable fuzzy_group_id (e.g., FG-001).
compute_iteration_pressure(plan_dir: Path, state: PlanState) -> list[IterationPressureEntry] — combines the above. For each fuzzy group, returns:
python
@dataclass
class IterationPressureEntry:
fuzzy_group_id: str
member_flag_ids: list[str]
iterations_open: int
addressed_then_reopened_count: int
representative_concern: str
has_mechanical_recurrence(entries: list[IterationPressureEntry]) -> bool — returns True if any group has addressed_then_reopened_count >= 2 OR spans ≥2 iterations with ≥2 member flags.
Import_concern_word_set and _jaccard_similarity from megaplan._core.registries (make them public or import directly since they're in the same package).
Step 4: Tests for iteration pressure (tests/test_iteration_pressure.py)
Scope: Medium
Unit testcompute_flag_history with synthetic flag registries and critique artifacts written to tmp dirs.
Unit testcompute_fuzzy_groups with flags that should cluster (similar concerns) and flags that shouldn't.
Unit testcompute_iteration_pressure end-to-end: a flag raised in v1, addressed in v2 plan, re-opened in v2 critique, addressed in v3 plan, re-opened in v3 critique → addressed_then_reopened_count == 2.
Unit testhas_mechanical_recurrence with threshold/no-threshold cases.
Phase 2: Gate Integration + State Machine
Step 5: Inject iteration pressure into gate prompt (megaplan/prompts/gate.py)
Scope: Medium
Importcompute_iteration_pressure, render_pressure_table, has_mechanical_recurrence from iteration_pressure.
In_gate_prompt() (after line 87, after the debt block), inject the pressure table:
Add the TIEBREAKER instruction to the Requirements section (after line 98, the ESCALATE line):
code
- TIEBREAKER when a recurring concern reflects an *unresolvable constraint tension* (architectural/philosophical, requiring a human call) rather than a plan-quality issue. Only valid when iteration-pressure data shows mechanical recurrence. Cite specific flag IDs and iterations.
- If recommending TIEBREAKER, you MUST provide `tiebreaker_question` (the decision to be made), `tiebreaker_flag_ids` (which flags this resolves), and `tiebreaker_fuzzy_group_id` (which group this resolves).
Add the pressure table and TIEBREAKER guidance to the prompt template string.
Step 6: Extend workflow state machine (megaplan/_core/workflow.py)
Scope: Small
ImportSTATE_TIEBREAKER_PENDING, STATE_TIEBREAKER_READY from types.
Inhandle_gate() (line 1116), after _apply_gate_outcome returns, add TIEBREAKER validation:
If recommendation is TIEBREAKER:
Check allow_tiebreaker config (default True). If False → force-demote to ITERATE.
Check max_tiebreakers_per_plan budget. If exhausted → force-demote to ESCALATE with rationale.
Check tiebreaker_blocklist against the flag categories. If matched → force-demote to ITERATE.
Call has_mechanical_recurrence() on the iteration pressure data. If no mechanical signal → re-prompt gate once with "You recommended TIEBREAKER but no flag shows mechanical recurrence signal…". If re-prompt still says TIEBREAKER without signal → force-demote to ITERATE and log tiebreaker_rejected_no_signal.
Validate that tiebreaker_question, tiebreaker_flag_ids, and tiebreaker_fuzzy_group_id are present. If missing → force-demote to ITERATE.
Store tiebreaker metadata in state["meta"]["tiebreaker_count"] (increment).
Createhandle_tiebreaker_run() — a new handler that:
Loads the gate artifact to get tiebreaker_question, tiebreaker_flag_ids, tiebreaker_fuzzy_group_id.
Calls _run_tiebreaker() from megaplan/tiebreaker.py with the question.
In_build_critique_prompt() (line 167), inject a settled-decisions block after existing flags:
code
The following concerns have been settled by human tiebreaker decision. Do NOT re-raise them under a new surface. Only raise a new concern if new evidence *materially* changes the settled premise — and if so, explicitly cite which settled decision you are challenging and why.
Also inject into _revise_prompt() so the revise agent knows which decisions are settled and should be respected.
Step 10: Audit tracking (megaplan/audit.py)
Scope: Small
Createmegaplan/audit.py with:
record_tiebreaker_audit(plan_dir, decision, researcher_data, challenger_data, tokens_spent, time_seconds) — appends to tiebreaker_audit.json.
load_tiebreaker_audit(plan_dir) -> list[dict] — reads audit records.
aggregate_tiebreaker_audit(root) -> dict — cross-plan aggregation for the --global flag.
Step 11: Version bump and CHANGELOG (pyproject.toml, CHANGELOG.md)
Scope: Small
Bump version in pyproject.toml from 0.17.0 to 0.18.0.
"version": 1,
"timestamp": "2026-04-15T11:05:32Z",
"hash": "sha256:3b756a7388a6ffa06c5c4e02ebc227bed330f438d2cb2826538e720f68e79860",
"questions": [
"The spec calls for embedding-based cosine similarity for fuzzy grouping with a 0.85 threshold. The codebase already has Jaccard word similarity in registries.py (used for debt matching at 0.5 threshold). Using Jaccard avoids a new dependency and is consistent with existing patterns. Is this acceptable, or do you specifically want embedding-based similarity?",
"The spec mentions wall-clock (30m) and token (150k) budget for tiebreaker runs. The existing tiebreaker.py doesn't have budget enforcement. Should this be enforced at the harness level (wrapping _run_tiebreaker with a timeout/token counter), or is it acceptable to make these advisory limits logged in audit but not hard-enforced in v2?",
"The spec lists tiebreaker_decisions.json for decisions and a separate audit file. Should these be two separate files (decisions for immunity lookups, audit for usage stats), or combined into one file per plan?"
],
"success_criteria": [
{
"criterion": "TIEBREAKER added to gate.json schema enum alongside PROCEED/ITERATE/ESCALATE",
"priority": "must",
"requires": [
"read_files"
]
},
{
"criterion": "iteration_pressure.py computes fuzzy groups and addressed_then_reopened_count from critique artifacts",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "Gate prompt includes iteration-pressure table and TIEBREAKER instruction when pressure data exists",
"priority": "must",
"requires": [
"read_files"
]
},
{
"criterion": "handle_gate validates TIEBREAKER has mechanical recurrence signal; re-prompts once then force-demotes to ITERATE if absent",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "TIEBREAKER recommendation transitions state to tiebreaker_pending",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "tiebreaker decide subcommand writes decision, marks flags as settled_by_tiebreaker, transitions state to critiqued",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "Critique prompt includes settled-decision immunity block that instructs not to re-raise settled concerns",
"priority": "must",
"requires": [
"read_files"
]
},
{
"criterion": "max_tiebreakers_per_plan budget enforced \u2014 exceeding demotes to ESCALATE",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "allow_tiebreaker: false in plan config disables TIEBREAKER recommendation entirely",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "Workflow state machine includes tiebreaker_pending and tiebreaker_ready states with correct transitions",
"priority": "must",
"requires": [
"read_files"
]
},
{
"criterion": "All existing tests pass (no regressions)",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "tiebreaker audit subcommand shows usage stats per plan and globally",
"priority": "should",
"requires": [
"run_tests"
]
},
{
"criterion": "Fuzzy grouping threshold is configurable (default 0.6)",
"priority": "should",
"requires": [
"read_files"
]
},
{
"criterion": "tiebreaker_blocklist config skips tiebreaker for blocked categories",
"priority": "should",
"requires": [
"run_tests"
]
},
{
"criterion": "Version bumped to 0.18.0 with CHANGELOG entry",
"priority": "should",
"requires": [
"read_files"
]
},
{
"criterion": "Tiebreaker token/time budgets are configurable and logged in audit",
"priority": "should",
"requires": [
"read_files"
]
},
{
"criterion": "Integration test: synthetic plan with recurring flags flows through critique\u2192gate\u2192tiebreaker_pending\u2192tiebreaker_ready\u2192decide\u2192critiqued",
"priority": "info",
"requires": [
"run_tests"
]
}
],
"assumptions": [
"Jaccard word similarity (existing in registries.py) is adequate for fuzzy flag grouping \u2014 no embedding model needed. The spec says 'use whatever critique already uses' and Jaccard is what exists.",
"tiebreaker.py on main is the current working version (264 lines, researcher\u2192challenger\u2192synthesis). The concurrent tiebreaker-subcommand branch may add more, but we build on what's on main now.",
"FlagRecord schema is not changed to add transition history arrays \u2014 we reconstruct history from critique artifacts (critique_v1.json through critique_vN.json) which is read-only and non-breaking.",
"Budget enforcement (token/time) is logged and advisory in this pass \u2014 hard enforcement (killing worker mid-run) is deferred since the worker abstraction doesn't currently support mid-run abort.",
"The 'light' and 'tiny' robustness levels should not allow TIEBREAKER (they already skip gate/review in some cases), enforced via robustness overrides in the workflow.",
"Two separate files: tiebreaker_decisions.json (for immunity lookups, simple list) and tiebreaker_audit.json (for stats tracking with timing/tokens)."
],
"structure_warnings": []
}
code
Plan structure warnings from validator:
[]
Existing flags:
[]
Known accepted debt grouped by subsystem:
{
"are-the-proposed-changes-technically-correct": [
{
"id": "DEBT-009",
"concern": "are the proposed changes technically correct?: the mobile action-surface plan is technically incorrect for the current component structure. submissioncarouselcard hides footercontent below the md breakpoint (src/components/submissioncarouselcard.tsx:219), while submissionscarouselpage also hides the score panel on mobile via asidecontent={<div classname=\"hidden md:block\">... and passes hideactions to scorepanel at src/pages/submissionscarouselpage.tsx:250-263,347. reusing that pattern for entrypage would leave mobile users with no navigation controls and no scoring controls.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-010",
"concern": "are the proposed changes technically correct?: i checked the sign-in callback path again. submissionslayout already wires usescoring(..., { onrequiresignin: () => pagemachine.dispatch({ type: 'open_sign_in_modal' }) }) at src/pages/submissionslayout.tsx:38-40, and scorepanel still has its own onrequiresignin prop. the revised step 4.2 is acceptable only if it explicitly rewires that prop to pagemachine.dispatch; otherwise removing local modal state would orphan the direct ui callback. the plan hints at this, but it remains easy to misread because the scoring-context callback and the scorepanel prop are separate mechanisms.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-029",
"concern": "are the proposed changes technically correct?: checked the new diff-helper proposal against the repo's existing execution-evidence semantics. validate_execution_evidence() in megaplan/evaluation.py:109-175 uses git status --short, so untracked files count as real changed files today, but step 3 proposes collect_git_diff_patch(project_dir) via git diff head; by git behavior that will not include untracked files, so heavy review could miss exactly the newly created files that execute and review already treat as part of the patch.",
"occurrence_count": 1,
"plan_ids": [
"robust-review-v2"
]
},
{
"id": "DEBT-032",
"concern": "are the proposed changes technically correct?: a generated-schema gap remains. tests/test_schemas.py reads the repo-root .megaplan/schemas/review.json directly via _review_disk_schema(), the checked-in local file is currently stale relative to schemas, and ensure_runtime_layout() in megaplan/_core/io.py is the production writer for that file class. the plan says generated schemas must stay aligned, but it never names a regeneration step or a test adjustment for that disk-schema path, so the validation story is still incomplete.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-6-remaining-openai-20260409-0502"
]
}
],
"are-the-success-criteria-well-prioritized-and-verifiable": [
{
"id": "DEBT-019",
"concern": "are the success criteria well-prioritized and verifiable?: mobile behavior is still under-prioritized relative to the actual risk in this repo. the user constraint specifically mentions the mobile bottom nav, but the only mobile-specific success criterion left is 'mobile scoring ux is coherent' at info level. given that the plan currently removes the working mobile nav, there should be at least a should or must criterion stating that mobile users retain navigation and scoring controls.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
}
],
"completeness": [
{
"id": "DEBT-036",
"concern": "handle_init() and override flows also emit next_step but aren't listed for next_step_runtime enrichment.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-037",
"concern": "handle_execute() at handlers.py:1152-1175 can clear next_step to none but leave stale next_step_runtime.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-040",
"concern": "next_step_runtime fires on previous step completion, not literally when the next phase starts.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-043",
"concern": "test_command config override unreachable via normal init/cli flow",
"occurrence_count": 1,
"plan_ids": [
"add-test-baselining-to-the-20260410-2240"
]
}
],
"correctness": [
{
"id": "DEBT-038",
"concern": "status-progress gating excludes finalized plans with finalize.json in between-batch and blocked states.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-039",
"concern": "resolve_phase_runtime called on non-phase next_step values would fail.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-041",
"concern": "non-phase next_step values from workflow_next() not filtered.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-042",
"concern": "baseline_test_command schema says string-only but fallback returns none",
"occurrence_count": 1,
"plan_ids": [
"add-test-baselining-to-the-20260410-2240"
]
},
{
"id": "DEBT-044",
"concern": "fallback uses null+baseline_test_note instead of brief's empty-array+meta_commentary",
"occurrence_count": 1,
"plan_ids": [
"add-test-baselining-to-the-20260410-2240"
]
}
],
"criteria-prompt": [
{
"id": "DEBT-026",
"concern": "criteria prompt: v3 replaces _review_prompt() in heavy mode with a new heavy_criteria_review_prompt, so the plan no longer follows the brief's explicit requirement that _review_prompt() remain the heavy-mode criteria_verdict check.",
"occurrence_count": 1,
"plan_ids": [
"robust-review-v2"
]
}
],
"did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements": [
{
"id": "DEBT-011",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: a new critical issue is introduced on mobile. step 4.9 says to remove entrypage's mobile sticky bottom nav and 'use the same footercontent slot in submissioncarouselcard', but src/components/submissioncarouselcard.tsx:217-221 renders footercontent inside classname=\"hidden md:block\". in the current repo, the mobile sticky nav at src/pages/entrypage.tsx:283-340 is the only mobile surface for back/next and the score toggle, so the revised plan would remove working mobile controls and replace them with a slot that is explicitly hidden on phones.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-012",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: the plan still contradicts itself on mobile behavior. assumption #3 says the browse-mode mobile score toggle will be preserved, but step 4.9 removes the entire mobile sticky nav that contains that toggle in src/pages/entrypage.tsx:314-330. the implementer cannot satisfy both instructions as written.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-028",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: checked step 7 against the brief's explicit prompt-builder requirement. the revision fixes the old context leak by introducing a brand-new heavy_criteria_review_prompt, but the brief said _review_prompt() should stay as-is and still run as the criteria_verdict check in heavy mode; v3 solves the problem by replacing that heavy-mode criteria path instead of reusing the baseline review prompt, which is still a material divergence from the requested design.",
"occurrence_count": 1,
"plan_ids": [
"robust-review-v2"
]
}
],
"diff-capture": [
{
"id": "DEBT-027",
"concern": "diff capture: the proposed collect_git_diff_patch(project_dir) helper uses git diff head, which will miss untracked files even though the existing execution-evidence path already treats untracked files as real changed work.",
"occurrence_count": 1,
"plan_ids": [
"robust-review-v2"
]
}
],
"does-the-change-touch-all-locations-and-supporting-infrastructure": [
{
"id": "DEBT-018",
"concern": "does the change touch all locations and supporting infrastructure?: if the implementation really wants footercontent to carry mobile actions, the plan must also include a supporting change in src/components/submissioncarouselcard.tsx or render a separate mobile control surface outside the card. right now step 4.9 removes the mobile nav but does not list submissioncarouselcard.tsx:217-221 as a place that must change, so the required glue for mobile controls is missing.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-033",
"concern": "does the change touch all locations and supporting infrastructure?: the prior missing locations in megaplan/workers.py and tests/test_workers.py are now covered, but one supporting-infrastructure path is still absent from the steps: the repo-root generated schema copy under .megaplan/schemas/review.json and the tests that read it directly. without either explicitly regenerating that file or changing those tests to materialize schemas in a temp root, the plan can still leave the runtime-schema copy out of sync with the raw registry.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-6-remaining-openai-20260409-0502"
]
},
{
"id": "DEBT-035",
"concern": "does the change touch all locations and supporting infrastructure?: the plan adds _set_active_step and _clear_active_step helpers to handlers.py. _run_worker (handlers.py:135) is modified to accept a resolved parameter. but _run_worker is also called directly by handle_critique's sequential fallback at line 801 and 803. these calls currently don't pass resolved. the plan's step 2.6 for handle_critique says to set active_step after resolution at line 794 \u2014 but the _run_worker calls at 801/803 would re-resolve the agent internally (since resolved isn't passed). this means the agent is resolved twice on the critique sequential path. the double-resolution is wasteful but correct (same result). however, to match the plan's goal of 'resolve_agent_mode() is called once per handler invocation', the resolved tuple should be passed to these _run_worker calls too.",
"occurrence_count": 1,
"plan_ids": [
"fix-megaplan-s-planning-20260409-2103"
]
}
],
"execute-phase-contract": [
{
"id": "DEBT-003",
"concern": "early-killed baselines pass truncated output to the execute worker, which may produce lower-quality diagnosis than full output.",
"occurrence_count": 1,
"plan_ids": [
"design-and-implement-a-20260327-0512"
]
}
],
"find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them": [
{
"id": "DEBT-014",
"concern": "find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: i checked the skip caller path against the real hook behavior and removefromqueue(entryid) looks redundant. scoring.skipentry(entryid) optimistically adds the id to skippedentryids in src/hooks/usescoring.ts:245-249, and usecarouselqueue already reactively filters skipped entries from submissions[] in src/hooks/usecarouselqueue.ts:154-165. calling removefromqueue() immediately afterward is safe, but it duplicates an existing state transition and should be justified as an explicit ux optimization rather than required logic.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-015",
"concern": "find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: the direct ui sign-in caller is still important here. scorepanel invokes its own onrequiresignin prop when an unauthenticated user interacts with the score ui (src/components/scorepanel.tsx:499-515), which is independent of the scoring hook's internal requireauth() path. the plan should be read as requiring that caller to dispatch open_sign_in_modal; otherwise one caller remains broken even if submitscore() is correctly wired.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-034",
"concern": "find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: i rechecked the caller paths after the revision. the raw-schema caller path through validate_payload() is now accounted for, but the runtime-schema caller path still is not: strict_schema() only reaches the on-disk runtime schemas through ensure_runtime_layout(), while current tests like tests/test_schemas.py and tests/test_parallel_review.py consume the already-written repo copy directly. the plan does not yet say how that caller path gets refreshed or asserted after the code change.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-6-remaining-openai-20260409-0502"
]
}
],
"handler-boilerplate": [
{
"id": "DEBT-004",
"concern": "_run_worker() pseudocode hardcodes iteration=state['iteration'] but handle_plan and handle_revise use different failure iteration values.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
},
{
"id": "DEBT-005",
"concern": "same issue as correctness-1: failure iteration would be wrong for plan/revise handlers.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
}
],
"install-paths": [
{
"id": "DEBT-023",
"concern": "local setup path doesn't expose subagent mode",
"occurrence_count": 1,
"plan_ids": [
"refactor-megaplan-skill-so-20260406-1818"
]
},
{
"id": "DEBT-024",
"concern": "no automated guard to keep the mirror file synchronized with source files",
"occurrence_count": 1,
"plan_ids": [
"update-all-documentation-20260406-1902"
]
},
{
"id": "DEBT-025",
"concern": "local setup test only checks agents.md existence, not content",
"occurrence_count": 1,
"plan_ids": [
"update-all-documentation-20260406-1902"
]
}
],
"is-there-convincing-verification-for-the-change": [
{
"id": "DEBT-016",
"concern": "is there convincing verification for the change?: the test-plan details still miss a small but real infrastructure update: the current locationdisplay helper in src/pages/submissionscarouselpage.test.tsx:289-291 only renders location.pathname, so the step 7 requirement to assert { state: { carousel: true, navdirection: 'forward' } } cannot be implemented unless that helper is extended to expose location.state. the same pattern exists in the related page tests.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-017",
"concern": "is there convincing verification for the change?: there is still no explicit mobile regression test in the plan, even though the revised implementation proposal removes the only current mobile nav/score surface. given the repository's actual component structure, a mobile-focused test or visual verification step is needed to prove controls remain accessible below md.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
}
],
"mobile-ui": [
{
"id": "DEBT-020",
"concern": "mobile ui: removing entrypage's mobile sticky nav and relying on submissioncarouselcard.footercontent would break mobile navigation and scoring because that footer slot is hidden below the md breakpoint.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
}
],
"runtime-schema-sync": [
{
"id": "DEBT-031",
"concern": "runtime schema sync: the plan still does not include an explicit refresh or validation step for the generated .megaplan/schemas/review.json copy that repository tests read directly.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-6-remaining-openai-20260409-0502"
]
}
],
"search-for-related-code-that-handles-the-same-concept-is-the-reported-issue-a-symptom-of-something-broader": [
{
"id": "DEBT-013",
"concern": "search for related code that handles the same concept. is the reported issue a symptom of something broader?: the mobile problem is broader than entrypage. submissionscarouselpage already has a pre-existing mobile gap because its score panel is desktop-only and its footer actions are also hidden on mobile (src/pages/submissionscarouselpage.tsx:250-263,347-354 plus src/components/submissioncarouselcard.tsx:219). the revised plan says entrypage should 'match the carouselpage pattern', which would spread that existing gap into the one page that currently has working mobile controls.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-030",
"concern": "search for related code that handles the same concept. is the reported issue a symptom of something broader?: the revised plan correctly narrows the schema-shape problem itself back to the six audited mismatches, but the generated runtime-schema consumer path is broader than the plan acknowledges: tests/test_parallel_review.py also reads the runtime review.json schema from schemas_root(repo_root), so stale generated schema copies can affect more than the direct schema tests.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-6-remaining-openai-20260409-0502"
]
}
],
"subagent-safeguards": [
{
"id": "DEBT-021",
"concern": "hermes reference safeguard numbers not validated against actual implementation",
"occurrence_count": 1,
"plan_ids": [
"refactor-megaplan-skill-so-20260406-1818"
]
},
{
"id": "DEBT-022",
"concern": "plan's retry caps (1 phase, 3 execute) may differ from hermes-agent's actual policy",
"occurrence_count": 1,
"plan_ids": [
"refactor-megaplan-skill-so-20260406-1818"
]
}
],
"worker-permissions": [
{
"id": "DEBT-001",
"concern": "codex --full-auto flag only triggers for step == 'execute', not 'loop_execute'",
"occurrence_count": 1,
"plan_ids": [
"build-megaloop-a-minimal-20260327-0250"
]
},
{
"id": "DEBT-002",
"concern": "claude --permission-mode bypasspermissions only triggers for step == 'execute', not 'loop_execute'",
"occurrence_count": 1,
"plan_ids": [
"build-megaloop-a-minimal-20260327-0250"
]
}
],
"workflow-state-machine": [
{
"id": "DEBT-006",
"concern": "_plan_prompt() does not read research.json, so replanning from state_researched would ignore research results.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
},
{
"id": "DEBT-007",
"concern": "same issue as correctness-2: state_researched \u2192 plan path is only partially wired.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
},
{
"id": "DEBT-008",
"concern": "_plan_prompt() is a missed location for the state_researched \u2192 plan change.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
}
]
}
code
Escalated debt subsystems:
[
{
"subsystem": "correctness",
"total_occurrences": 5,
"plan_count": 2,
"entries": [
{
"id": "DEBT-038",
"concern": "status-progress gating excludes finalized plans with finalize.json in between-batch and blocked states.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-039",
"concern": "resolve_phase_runtime called on non-phase next_step values would fail.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-041",
"concern": "non-phase next_step values from workflow_next() not filtered.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-042",
"concern": "baseline_test_command schema says string-only but fallback returns none",
"occurrence_count": 1,
"plan_ids": [
"add-test-baselining-to-the-20260410-2240"
]
},
{
"id": "DEBT-044",
"concern": "fallback uses null+baseline_test_note instead of brief's empty-array+meta_commentary",
"occurrence_count": 1,
"plan_ids": [
"add-test-baselining-to-the-20260410-2240"
]
}
]
},
{
"subsystem": "are-the-proposed-changes-technically-correct",
"total_occurrences": 4,
"plan_count": 3,
"entries": [
{
"id": "DEBT-009",
"concern": "are the proposed changes technically correct?: the mobile action-surface plan is technically incorrect for the current component structure. submissioncarouselcard hides footercontent below the md breakpoint (src/components/submissioncarouselcard.tsx:219), while submissionscarouselpage also hides the score panel on mobile via asidecontent={<div classname=\"hidden md:block\">... and passes hideactions to scorepanel at src/pages/submissionscarouselpage.tsx:250-263,347. reusing that pattern for entrypage would leave mobile users with no navigation controls and no scoring controls.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-010",
"concern": "are the proposed changes technically correct?: i checked the sign-in callback path again. submissionslayout already wires usescoring(..., { onrequiresignin: () => pagemachine.dispatch({ type: 'open_sign_in_modal' }) }) at src/pages/submissionslayout.tsx:38-40, and scorepanel still has its own onrequiresignin prop. the revised step 4.2 is acceptable only if it explicitly rewires that prop to pagemachine.dispatch; otherwise removing local modal state would orphan the direct ui callback. the plan hints at this, but it remains easy to misread because the scoring-context callback and the scorepanel prop are separate mechanisms.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-029",
"concern": "are the proposed changes technically correct?: checked the new diff-helper proposal against the repo's existing execution-evidence semantics. validate_execution_evidence() in megaplan/evaluation.py:109-175 uses git status --short, so untracked files count as real changed files today, but step 3 proposes collect_git_diff_patch(project_dir) via git diff head; by git behavior that will not include untracked files, so heavy review could miss exactly the newly created files that execute and review already treat as part of the patch.",
"occurrence_count": 1,
"plan_ids": [
"robust-review-v2"
]
},
{
"id": "DEBT-032",
"concern": "are the proposed changes technically correct?: a generated-schema gap remains. tests/test_schemas.py reads the repo-root .megaplan/schemas/review.json directly via _review_disk_schema(), the checked-in local file is currently stale relative to schemas, and ensure_runtime_layout() in megaplan/_core/io.py is the production writer for that file class. the plan says generated schemas must stay aligned, but it never names a regeneration step or a test adjustment for that disk-schema path, so the validation story is still incomplete.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-6-remaining-openai-20260409-0502"
]
}
]
},
{
"subsystem": "completeness",
"total_occurrences": 4,
"plan_count": 2,
"entries": [
{
"id": "DEBT-036",
"concern": "handle_init() and override flows also emit next_step but aren't listed for next_step_runtime enrichment.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-037",
"concern": "handle_execute() at handlers.py:1152-1175 can clear next_step to none but leave stale next_step_runtime.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-040",
"concern": "next_step_runtime fires on previous step completion, not literally when the next phase starts.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-043",
"concern": "test_command config override unreachable via normal init/cli flow",
"occurrence_count": 1,
"plan_ids": [
"add-test-baselining-to-the-20260410-2240"
]
}
]
},
{
"subsystem": "did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements",
"total_occurrences": 3,
"plan_count": 2,
"entries": [
{
"id": "DEBT-011",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: a new critical issue is introduced on mobile. step 4.9 says to remove entrypage's mobile sticky bottom nav and 'use the same footercontent slot in submissioncarouselcard', but src/components/submissioncarouselcard.tsx:217-221 renders footercontent inside classname=\"hidden md:block\". in the current repo, the mobile sticky nav at src/pages/entrypage.tsx:283-340 is the only mobile surface for back/next and the score toggle, so the revised plan would remove working mobile controls and replace them with a slot that is explicitly hidden on phones.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-012",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: the plan still contradicts itself on mobile behavior. assumption #3 says the browse-mode mobile score toggle will be preserved, but step 4.9 removes the entire mobile sticky nav that contains that toggle in src/pages/entrypage.tsx:314-330. the implementer cannot satisfy both instructions as written.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-028",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: checked step 7 against the brief's explicit prompt-builder requirement. the revision fixes the old context leak by introducing a brand-new heavy_criteria_review_prompt, but the brief said _review_prompt() should stay as-is and still run as the criteria_verdict check in heavy mode; v3 solves the problem by replacing that heavy-mode criteria path instead of reusing the baseline review prompt, which is still a material divergence from the requested design.",
"occurrence_count": 1,
"plan_ids": [
"robust-review-v2"
]
}
]
},
{
"subsystem": "does-the-change-touch-all-locations-and-supporting-infrastructure",
"total_occurrences": 3,
"plan_count": 3,
"entries": [
{
"id": "DEBT-018",
"concern": "does the change touch all locations and supporting infrastructure?: if the implementation really wants footercontent to carry mobile actions, the plan must also include a supporting change in src/components/submissioncarouselcard.tsx or render a separate mobile control surface outside the card. right now step 4.9 removes the mobile nav but does not list submissioncarouselcard.tsx:217-221 as a place that must change, so the required glue for mobile controls is missing.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-033",
"concern": "does the change touch all locations and supporting infrastructure?: the prior missing locations in megaplan/workers.py and tests/test_workers.py are now covered, but one supporting-infrastructure path is still absent from the steps: the repo-root generated schema copy under .megaplan/schemas/review.json and the tests that read it directly. without either explicitly regenerating that file or changing those tests to materialize schemas in a temp root, the plan can still leave the runtime-schema copy out of sync with the raw registry.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-6-remaining-openai-20260409-0502"
]
},
{
"id": "DEBT-035",
"concern": "does the change touch all locations and supporting infrastructure?: the plan adds _set_active_step and _clear_active_step helpers to handlers.py. _run_worker (handlers.py:135) is modified to accept a resolved parameter. but _run_worker is also called directly by handle_critique's sequential fallback at line 801 and 803. these calls currently don't pass resolved. the plan's step 2.6 for handle_critique says to set active_step after resolution at line 794 \u2014 but the _run_worker calls at 801/803 would re-resolve the agent internally (since resolved isn't passed). this means the agent is resolved twice on the critique sequential path. the double-resolution is wasteful but correct (same result). however, to match the plan's goal of 'resolve_agent_mode() is called once per handler invocation', the resolved tuple should be passed to these _run_worker calls too.",
"occurrence_count": 1,
"plan_ids": [
"fix-megaplan-s-planning-20260409-2103"
]
}
]
},
{
"subsystem": "find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them",
"total_occurrences": 3,
"plan_count": 2,
"entries": [
{
"id": "DEBT-014",
"concern": "find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: i checked the skip caller path against the real hook behavior and removefromqueue(entryid) looks redundant. scoring.skipentry(entryid) optimistically adds the id to skippedentryids in src/hooks/usescoring.ts:245-249, and usecarouselqueue already reactively filters skipped entries from submissions[] in src/hooks/usecarouselqueue.ts:154-165. calling removefromqueue() immediately afterward is safe, but it duplicates an existing state transition and should be justified as an explicit ux optimization rather than required logic.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-015",
"concern": "find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: the direct ui sign-in caller is still important here. scorepanel invokes its own onrequiresignin prop when an unauthenticated user interacts with the score ui (src/components/scorepanel.tsx:499-515), which is independent of the scoring hook's internal requireauth() path. the plan should be read as requiring that caller to dispatch open_sign_in_modal; otherwise one caller remains broken even if submitscore() is correctly wired.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-034",
"concern": "find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: i rechecked the caller paths after the revision. the raw-schema caller path through validate_payload() is now accounted for, but the runtime-schema caller path still is not: strict_schema() only reaches the on-disk runtime schemas through ensure_runtime_layout(), while current tests like tests/test_schemas.py and tests/test_parallel_review.py consume the already-written repo copy directly. the plan does not yet say how that caller path gets refreshed or asserted after the code change.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-6-remaining-openai-20260409-0502"
]
}
]
},
{
"subsystem": "install-paths",
"total_occurrences": 3,
"plan_count": 2,
"entries": [
{
"id": "DEBT-023",
"concern": "local setup path doesn't expose subagent mode",
"occurrence_count": 1,
"plan_ids": [
"refactor-megaplan-skill-so-20260406-1818"
]
},
{
"id": "DEBT-024",
"concern": "no automated guard to keep the mirror file synchronized with source files",
"occurrence_count": 1,
"plan_ids": [
"update-all-documentation-20260406-1902"
]
},
{
"id": "DEBT-025",
"concern": "local setup test only checks agents.md existence, not content",
"occurrence_count": 1,
"plan_ids": [
"update-all-documentation-20260406-1902"
]
}
]
},
{
"subsystem": "workflow-state-machine",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-006",
"concern": "_plan_prompt() does not read research.json, so replanning from state_researched would ignore research results.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
},
{
"id": "DEBT-007",
"concern": "same issue as correctness-2: state_researched \u2192 plan path is only partially wired.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
},
{
"id": "DEBT-008",
"concern": "_plan_prompt() is a missed location for the state_researched \u2192 plan change.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
}
]
}
]
code
Debt guidance:
- These are known accepted limitations. Do not re-flag them unless the current plan makes them worse, broadens them, or fails to contain them.
- Prefix every new concern with a subsystem tag followed by a colon, for example `Timeout recovery: retry backoff remains brittle`.
- When a concern is recurring debt that still needs to be flagged, prefix it with `Recurring debt:` after the subsystem tag, for example `Timeout recovery: Recurring debt: retry backoff remains brittle`.
Your output template is at: /Users/user_c042661f/Documents/megaplan/.megaplan/plans/add-automated-tiebreaker-20260415-1301/critique_output.json
Review the plan with a broad scope. Consider whether the approach is correct, whether it covers
all the places it needs to, whether it would break callers or violate codebase conventions,
and whether its verification strategy is adequate.
Place any concrete concerns in the flags array in the template file using the standard format
(id, concern, category, severity_hint, evidence). Leave checks as an empty array.
Workflow: read the file → investigate → read file again → add findings → write file back.
code
Additional guidelines:
- Robustness level: light. Be pragmatic. Only flag issues that would cause real failures. Ignore style, minor edge cases, and issues the executor will naturally resolve.
- Over-engineering: prefer the simplest approach that fully solves the problem.
- Reuse existing flag IDs when the same concern is still open.
- `verified_flag_ids`: list flag IDs from prior iterations that the revised plan actually resolves (e.g., if the plan was revised to fix FLAG-001, and you confirm the fix is correct, include "FLAG-001"). Only include flags you've verified — don't guess.
- Verify that the plan follows the expected structure when validator warnings or the outline suggest drift.
- Additional flags may use these categories: correctness, security, completeness, performance, maintainability, other.
- Focus on concrete issues, not structural formatting.
_apply_gate_outcome sets state before returning — the plan says to add a TIEBREAKER branch in _apply_gate_outcome, but the validation logic (budget, mechanical recurrence, etc.) is described for handle_gate. The issue is _apply_gate_outcome would transition state to tiebreaker_pending before handle_gate gets to validate. If validation fails and demotes, the state was already changed.
_store_last_gate stores recommendation: TIEBREAKER — but _transition_matches won't match gate_tiebreaker, so after a force-demote the workflow won't find a valid transition.
Plan says STATE_CRITIQUED → gate_tiebreaker → STATE_TIEBREAKER_PENDING but the workflow already has STATE_CRITIQUED → gate → STATE_GATED (gate_unset). The plan needs to add the tiebreaker transition before the general gate transition.