Repository navigation
feat(plan): PLAN-AUTO-2 plan:sync rewrites stale status cells - #1711
Conversation
Test-First: scripts/lib/plan-sync.test.mjs::a merged PR flips an in-progress row to Erledigt with the merge date Test-First: scripts/lib/plan-sync.test.mjs::closed unmerged and open PRs are reported not rewritten Test-First: scripts/lib/plan-sync.test.mjs::only the status cell changes other columns stay byte-identical Test-First: scripts/lib/plan-sync.test.mjs::CLI defaults to dry run and writes atomically only after valid GitHub evidence Co-Authored-By: GPT-6 <noreply@openai.com>
Test-First: scripts/lib/plan-sync.test.mjs::a merged PR flips an in-progress row to Erledigt with the merge date Test-First: scripts/lib/plan-sync.test.mjs::closed unmerged and open PRs are reported not rewritten Test-First: scripts/lib/plan-sync.test.mjs::only the status cell changes other columns stay byte-identical Test-First: scripts/lib/plan-sync.test.mjs::CLI defaults to dry run and writes atomically only after valid GitHub evidence Co-Authored-By: GPT-6 <noreply@openai.com>
No-Test: plan text only Co-Authored-By: GPT-6 <noreply@openai.com>
The harness turn_context.model observed on 2026-10-18 is gpt-6.1-sol. This refines the generic GPT-6 family attribution in the preceding three commits without rewriting their history. No-Test: attribution metadata only Co-Authored-By: gpt-6.1-sol <noreply@openai.com>
Test-First: scripts/lib/plan-sync.test.mjs::synchronized rows are done for existing PLAN consumers Co-Authored-By: gpt-6.1-sol <noreply@openai.com>
Retain the complete old status cell after the existing originally marker so parsePlan reads the result as done and replay needs no special case. Test-First: scripts/lib/plan-sync.test.mjs::synchronized rows are done for existing PLAN consumers Test-First: scripts/lib/plan-sync.test.mjs::a merged PR flips an in-progress row to Erledigt with the merge date Test-First: scripts/lib/plan-sync.test.mjs::closed unmerged and open PRs are reported not rewritten Test-First: scripts/lib/plan-sync.test.mjs::only the status cell changes other columns stay byte-identical Test-First: scripts/lib/plan-sync.test.mjs::CLI defaults to dry run and writes atomically only after valid GitHub evidence Co-Authored-By: gpt-6.1-sol <noreply@openai.com>
Test-First: scripts/lib/plan-sync.test.mjs::a dependency PR in another column is neither listed nor required Test-First: scripts/lib/plan-sync.test.mjs::a status cell that already starts with Erledigt is left unchanged Co-Authored-By: GPT-6 <noreply@openai.com>
Test-First: scripts/lib/plan-sync.test.mjs::a dependency PR in another column is neither listed nor required Test-First: scripts/lib/plan-sync.test.mjs::a status cell that already starts with Erledigt is left unchanged Co-Authored-By: GPT-6 <noreply@openai.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4dea1be8d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const numbers = [...new Set(groups.get(row.line))].sort((a, b) => a - b); | ||
| const refs = numbers.map(n => prs.find(pr => pr.number === n)); |
There was a problem hiding this comment.
Account for open delivery PRs outside the status cell
When a package row has merged PR #42 in Status but an open delivery PR #43 in Ticket or Abnahme, checkPlan emits a contradiction only for #42; building numbers solely from those findings then rewrites the row to Erledigt even though row.prs contains #43 and that PR remains open. This is reproducible with a four-column ID | Ziel | Status | Ticket table and makes the canonical plan falsely complete, so delivery references outside the status cell must be distinguished from dependency references and included in the all-merged check.
AGENTS.md reference: AGENTS.md:L121-L121
Useful? React with 👍 / 👎.
| if (/^Erledigt\b/i.test(row.statusRaw.replace(/`|\*\*/g, "").trim()) || !["in_progress", "in_review", "planned"].includes(row.status) || refs.some(pr => pr?.state !== "MERGED")) { | ||
| skip("Not a pending row with all referenced PRs merged"); continue; |
There was a problem hiding this comment.
Honor all supported done markers before rewriting
When a mixed status starts with another completion marker supported by normalizeStatus, such as Done #42; Rest ausstehend, Gemergt #42; Rest offen, or ✓ #42; Rest geplant, the parser correctly classifies it as in_progress, but this guard recognizes only Erledigt. Once #42 is merged, the row is therefore rewritten to Erledigt and the explicitly pending remainder becomes historical; the same preservation check should cover every done marker recognized by the shared status model.
AGENTS.md reference: AGENTS.md:L121-L121
Useful? React with 👍 / 👎.
| let prs; | ||
| try { | ||
| const r = run("gh", ["pr", "list", "--state", "all", "--limit", "300", "--json", "number,state,title,headRefName,body,mergedAt"]); | ||
| if (r.code !== 0) throw new Error(); |
There was a problem hiding this comment.
Refuse writes when the PR history is truncated
When this query reaches its 300-item cap, --write still proceeds and only prints a warning afterward. A pending row can have a recent merged PR associated through Plan-ID: while an older still-open PR for the same package falls outside the returned page and is not explicitly present in the status cell; checkPlan then sees only the merge and syncPlan falsely marks the package complete. Since this repository already has PR numbers well above the cap, either fetch complete relevant evidence (for example, open PRs separately) or refuse writes whenever the result is capped.
AGENTS.md reference: AGENTS.md:L121-L121
Useful? React with 👍 / 👎.
Merge Queue Status
This pull request spent 11 minutes 46 seconds in the queue, including 10 minutes 57 seconds running CI. Required conditions to merge
|
Mit
npm run plan:synclassen sich veraltete PLAN-Statuszellen nach bestätigten Merges abgleichen.Standardmäßig zeigt der Befehl nur eine Vorschau und schreibt erst mit
--write.Die Änderungen gelangen weiterhin über einen normalen PR nach
main; die unabhängige Prüfung steht noch aus.Report
Plan-ID: PLAN-AUTO-2
Implemented conservative status synchronization using the existing
parsePlan,checkPlanandstatusColumnhelpers. Only pending rows with astatus-contradicts-githubfinding and all referenced PRs confirmed merged are rewritten. Each merged PR is listed with its UTC merge date; the previous cell text (after; ursprünglich:), whitespace, escaped pipes, other columns, CRLF/LF and fenced examples are preserved. Multiple PRs produce one row edit. The existing parser reads the synchronized row as done,checkPlanno longer reports that contradiction, and repeated synchronization is idempotent. The historical marker reuses the existing model convention; no parser or finding behavior changes. Closed unmerged PRs, completed rows with open PRs, missing merge dates and unsupported status columns are reported without rewriting.The CLI uses the same bounded
gh pr list --state all --limit 300 --json number,state,title,headRefName,body,mergedAtquery asplan-check. It defaults to a preview, returns 2 on failed or malformed GitHub responses, and uses an exclusive temporary file in the same directory followed by rename for--write. No dependencies were added. There is no commit, push, hook or CI automation.Only the existing PLAN-AUTO-2 row was updated: the base already contained that ID with an older gate description, so adding another row would introduce a duplicate. All PLAN-CLEAN-5 and parallel DS rows remain untouched.
Evidence
origin/mainatf3fb146b4a63e70fee617176ae18dd6c5819a1b2(observed 2026-10-18).node --test scripts/lib/plan-sync.test.mjsexited 1 with four assertion failures against compiling behavior-less exports; committed asc60a1873before implementationf99df96d. An added escaped-status-pipe assertion also failed before the fix.node --test scripts/lib/plan-sync.test.mjsexited 0 (5 tests).node scripts/plan-check.mjs --offlineexited 0 (0 findings).bash scripts/ci/red-first.shexited 0 at the final candidate; all five exact test names were verified red/missing at the merge-base and green at head.bash scripts/ci/secret-scan.shexited 0 before every commit; all precommit hooks exited 0.git diff --checkexited 0. Diff: 167 additions and 1 deletion, 6 files, within the 300-line budget.bash scripts/ci/gates.sh lane prepush: Exit 0 at candidate679b80e92d02d50d71f11c1a278411ebc1341f23through the normal full pre-push hook (PA_PREPUSH=full, CPU affinity 0,1); 967 s total. Frontend: 1633 passed with coverage; HQ: 948 passed and 3 existing skips; Denkraum: 388 Node tests and 33 browser tests passed with 1 existing skip; Clippy: passed; Rust: 2278 passed and 7 existing skips.git push -u origin codex/plan-auto-2: Exit 0 (PA_PREPUSH=full taskset -c 0,1 git push -u origin codex/plan-auto-2).git ls-remote origin codex/plan-auto-2: Exit 0, verified679b80e92d02d50d71f11c1a278411ebc1341f23 refs/heads/codex/plan-auto-2.Test boundaries: the pure
syncPlan(markdown, prs)function with literal snippets/PR data, and the CLI with an injected GitHub runner and real temporary-file writes. Coverage includes existing-consumer status semantics, multiple PRs, pending states, closed/open/missing evidence, missing merge dates, replay, dedicated Stand columns, byte preservation, dry-run default and failed/malformed GitHub responses without writes.Two requested test names contained commas, which the existing
tf_trailer_is_well_formedrejects. Their commas were removed from the test names and matching trailers; assertions were not weakened. Model provenance was refined in a separate metadata-only commit without rewriting history: harnessturn_context.modelobserved on 2026-10-18 isgpt-6.1-sol; earlier trailers used its generic GPT-6 family label.An additional compiling regression test proved that simply appending the old pending text leaves
parsePlanatin_progress. It exited 1 and was committed aseb729d80before fix679b80e9. The fix preserves that complete text after the existing; ursprünglich:historical marker. The new test now assertsdoneand nocheckPlancontradiction. Existing byte-preservation assertions were updated to the explicit history label and remain exact.Two initial ordinary parallel
prepushruns exited 1 in unchanged frontend tests: firstrenderBudget.test.tsxexceeded 5000 ms (1632 other tests passed), then twoLeitstandRoute.test.tsxqueries did not find the Agenten region.npx --no-install vitest run src/screens/leitstand/perf/renderBudget.test.tsxexited 0 (test duration 1.38 s). The observed one-minute load was 29.98 on 8 CPUs; resource contention is a hypothesis, not a proven cause. Installed Vitest source computes its default worker count as available CPUs minus one.taskset -c 0,1 node -p 'require("node:os").availableParallelism()'printed 2, selecting one Vitest worker. Under that affinity the two affected files passed all 28 tests, and a full prepush run at the earlier head95c5b961exited 0 (1633 frontend tests with coverage, 2278 Rust tests; 7 existing Rust skips). No timeouts, retries, skip markers, assertions or coverage thresholds were weakened. The final candidate is checked through the normal full pre-push hook under the same affinity; its result is recorded above.Start-check pauses were observed at two or three running Cargo builds; later full lanes started only after a green check. One earlier documentation commit hook was mistakenly started after an exit-1 start check and ran cargo check successfully; this was acknowledged, and subsequent starts waited. Provider limits remained explicitly unmeasured by the start check.
Dry run on the real main PLAN
npm run plan:syncexited 0 with the fetchedorigin/mainPLAN atac408f688aee9439b9a933e4b607386a62768522as input (observed 2026-10-18). The working PLAN was backed up, replaced with that exact input for the dry run, then restored byte-identically in a finally block. No real--writeresult was committed. Output:Root operation after a merge wave
Create
claude/plan-sync-<date>from currentmain, runnpm run plan:sync, thennpm run plan:sync -- --write. Inspect the diff, run the gates, and open a normal tier C documentation PR. The command never commits or pushes. Seescripts/dev/README.md.NICHT ABGEDECKT
#[cfg(windows)]tests (run_in_pty, npm_shim, ConPTY, DPAPI) or Windows clippy branches. The Windows lane runs in the merge queue.plan-check --offlinedoes not verify GitHub PRs, plan age or running jobs. Its finding and gate behavior is unchanged. Retained pending prose is explicitly marked historical, so existing consumers recognize done without any special replay exception.--write, automatic merge trigger, GitHub outage/failure injection over the network, concurrent-editor coordination, or durability under power loss was exercised. Write behavior and failed GitHub responses were tested on temporary fixtures.dev:start-check; it explicitly reported that omission. The locallage-jetztmemory mirror was unavailable; live GitHub and git sources were used.Review disposition
Review: ausstehend (Stufe B); pending, Root commissions. The requested independent reviewer must be from a family other than the author (OpenAI). No independent verdict, self-approval, ready transition, label, enqueue or merge is claimed. Root owns review and integration.
🤖 Generated with Claude Code on the ProjectA server worker
Review fix R1711-RD1/RD2 (Codex, 2026-10-20)
The sync now uses only the delivery PRs identified by the existing
status-contradicts-githubfindings. Dependency-column PRs are neither required nor listed. Status cells already starting withErledigt(including existing Markdown formatting) are left unchanged, even when open follow-up prose makes the shared parser classify them as pending.plan-model.mjsand plan-check behavior are unchanged. Onlyscripts/lib/plan-sync.mjsand its test file changed in this fix round.c4dea1be8d94bdcfa81ae43d3891595e95f572fbc4dea1be8d94bdcfa81ae43d3891595e95f572fboffenorausstehend, including bold Erledigt.Evidence (2026-10-20; worktree
C:/Users/Cuarr/orca/ProjectA/.claude/worktrees/codex-plan-auto-2, branchcodex-fix/plan-auto-2trackingorigin/codex/plan-auto-2):679b80e92d02d50d71f11c1a278411ebc1341f23, verified withgit ls-remote origin refs/heads/codex/plan-auto-2(exit 0) before editing. Worktree started at exactly that SHA.npm ci: exit 0; no dependency changes.node --test scripts/lib/plan-sync.test.mjsbefore the fix: exit 1; both requested regression tests failed by assertion, the five existing tests passed. Tests-only commite1c5ca2b9972a11c091f38848292c570efcbeac7precedes fix commitc4dea1be8d94bdcfa81ae43d3891595e95f572fb. Both exact comma-free names are recorded as separate Test-First trailers.node --test scripts/lib/plan-sync.test.mjsafter the fix: exit 0, 7 passed.node scripts/plan-check.mjs --offline: exit 0,Plan-Prüfung: 0 Befunde.git diff --check origin/main...HEAD: exit 0. Entire PR: 186 additions and 1 deletion (187 lines, 6 files); fix round itself: 21 additions and 2 deletions in 2 files.bash scripts/ci/secret-scan.sh: exit 0 before each commit; both normal precommit hooks also exited 0. Both commits used the requested Cuarroc identity and a finalCo-Authored-By: GPT-6 <noreply@openai.com>line. GPT-6 was the system-provided family label; exact harnessturn_context.modelsubsequently observed asgpt-6.1-solin this session's JSONL (efforthigh).git merge-tree --write-tree HEAD origin/mainat the starting head exited 0; no merge or rebase was needed.Dry run:
node C:/Users/Cuarr/pa-orch/review-evidence/plan-auto-2-fix-20261020/dry-run.mjscalledmain([], io, {file})against an external scratchPLAN.mdexported byte-for-byte withgit show origin/main:docs/PLAN.md, main SHAfc51eb7a. Exit 0. Summary:DS-X-16's new prefix contains only
#1712(no dependency#1662); DS-X-33's new prefix contains only#1717(no dependency#1702). SEC-01b is skipped with its original cell unchanged. The scratch PLAN and worktree PLAN remained unchanged. The external evidence harness initially exited 1 because Windows ESM requires afile:///URL; correcting only that scratch import produced the exit-0 run above.Start evidence:
npm run dev:start-checkexited 0 before work (3.6 GB free, 0 cargo builds) and before the full push lane (4.4 GB free, 0 cargo builds). The command explicitly reported no usage-file input; separate liveusage_overviewreported Codex weekly use 4%, projected-at-reset 28% (below the 80% cap). Build environment:CARGO_TARGET_DIR=C:/Users/Cuarr/cargo-targets/projecta-c,CARGO_BUILD_JOBS=1; noCARGO_PROFILE_*override.Review disposition: this is the requested repair of Root's Anthropic review on
679b80e9. Root must review the new delta/head before acceptance; no independent approval of the fixed head is claimed. The PR remains draft; ready, labels, queue and merge remain with Root.Final verification and delivery:
bash scripts/ci/gates.sh lane prepush: exit 0 atc4dea1be8d94bdcfa81ae43d3891595e95f572fb, executed by the ordinary full pre-push hook in THIS worktree; 521 s total. No rerun. Frontend: 218 files / 1633 tests passed with coverage. HQ: 948 passed / 5 existing skips. Denkraum: 363 Node tests passed / 23 existing skips, plus 33 browser tests passed. Clippy passed; Rust: 2319 passed / 20 existing skips.git push origin HEAD:codex/plan-auto-2: exit 0 with the normal hook, no force, no hook bypass.git ls-remote origin refs/heads/codex/plan-auto-2: exit 0,c4dea1be8d94bdcfa81ae43d3891595e95f572fb refs/heads/codex/plan-auto-2.git fetch originandgit merge-tree --write-tree HEAD origin/main: exit 0; main remainsfc51eb7a, no conflict. Repeated dry run after this fetch: exit 0, sameDry run: 4 changes, 1 skipped.git status --porcelain: exit 0, empty.C:/Users/Cuarr/pa-orch/review-evidence/plan-auto-2-fix-20261020/push-prepush-1.log.NICHT ABGEDECKT:
Additional limits: offline plan-check does not cover GitHub state, plan age or running jobs; the live GitHub query is capped at 300 PRs and reports that bound. No real PLAN write was performed. Existing platform/permission/configured skips above were not changed. Acceptance and integration remain with Root after review of the fixed head.
shellcheckandactionlintwere explicitly SKIPPED because neither tool is installed locally; the lane exit 0 does not prove those two checks.Reviews and disposition (Root, 2026-10-20)
Author family: OpenAI (Codex). Tier B (dev script, writes docs/PLAN.md only with
--write).679b80e9(Claude Opus 5.5, Anthropic, non-author): REQUEST CHANGES. Evidence:node --test scripts/lib/plan-sync.test.mjsexit 0; dry run against the main PLAN printed "5 changes, 0 skipped" and showed both defects.e1c5ca2b(tests, red) +c4dea1be(fix) by Codex. Root delta review679b80e9..c4dea1be: APPROVE. Only the PRs thatcheckPlanreports as contradicting are listed and required, and rows whose status already starts with "Erledigt" are skipped. Codex dry run: "4 changes, 1 skipped" (SEC-01b unchanged; DS-X-16 only feat(design): DS-X-16 gallery stories controls and inputs #1712, DS-X-33 only feat(design): DS-X-33 sparkline, bar list, chart frame #1717). Push-hook prepush exit 0.plan-sync.mjs:15-17)e1c5ca2b+c4dea1bee1c5ca2b+c4dea1beNo open high finding.
review-okbound to headc4dea1be8d94bdcfa81ae43d3891595e95f572fb.