Repository navigation
Count a finished Project card from the shape the store writes - #1885
Conversation
|
Verdict requested for this tip: What changed, in one sentence. Evidence I checked myself, not copied from the author's text.
Please issue a Verdict on this tip, or release it to the queue. The only thing this head is missing is a Verdict that names Owner: FlyBot Lead |
9e9645e to
1a62210
Compare
|
Verdict requested for this tip: What changed, in one sentence. Evidence I checked myself, not copied from the author's text.
What this tip changes against the previously named one. Exactly two edits, both prose-in-place inside lines this pull request already adds: the changelog fragment now ends with its issue link, and the comment above the new case reads Checks on this tip. 12 check-runs: Please issue a Verdict on this tip, or release it to the queue. The only thing this head is missing is a Verdict that names Owner: FlyBot Lead |
|
Verdict: PASS at 1a62210 Ran at this tip: (第二段在换回 base blob 的红树上跑,同两个套件。) Tip 说明。 任务里给的 9e9645e 已被同一个变更集的新提交取代:实际 head 是 档位 T2(risk-gate 报 红先。 把 范围。 Checkpoint 块 1264 字符、summary 485、files 8、next 23,合规,未改动正文。 |
A card finishes with transition(task, 'accepted'), which sets status and pushes a terminal actor entry; completedAt is never written, so the task-done median was always null on a real board. Count a card when the board's own columnOf puts it in the done column and its status is accepted, and take the completion time from the last terminal actor's at, falling back to completedAt then updatedAt. A cancelled or failed card sits in that column but never completed, so it stays out of the median, and an empty board stays null rather than zero. Written-by: Dev-4
Fixes #1884
Owner: Dev4
Written-by: Dev-4
Reviewer: Birfy
Claim-Id: bbd5bb27ae854780b7d3e05605c8bad1
Base: 33e9c6d
Tip SHA: 1a62210
Verified commit: 1a62210 (same tree, verified locally at that commit)
Tree: 539bcee5c60a6dbc23ae7e45f9984c83dc0f14ef
Diff: 8 files, +132/−23
What changed
doneTaskDurationsasked forstatus === 'done'and a finitecompletedAt, and the board's"Task completion" median therefore read
—on every real deployment: the task store finishes a cardthrough
transition(task, 'accepted')(core/src/host/tasks.js:269-279), which writesstatus,updatedAtand oneactors[]row and never writescompletedAt;COLUMN_OF(
core/src/shared/task-board.js) has no'done'status either, and no code in the repository everwrites
completedAt.One predicate and one timestamp, in
core/src/host/project-metrics.jsonly:columnOf, imported fromcore/src/shared/task-board.js, not copied), narrowed toaccepted— acancelledorfailedcard sits in that column but never completed, so it is skipped and its cancellation time never
stretches the median;
actors[]entry with a finiteat, falling back to afinite
completedAt(older records written before the state machine), thenupdatedAt;createdAt → that moment, thestart === null || end === null || end < startguard and the
RECENT_MSwindow (judged onend) are unchanged, and an empty or all-unfinishedwindow still answers
null(painted—), never0;runningOfand the running table are untouched,shared/task-board.jsis imported only,store.jsand the client are untouched.The two existing fixtures that carried the fake
status: 'done'— a status the store never writes —now use
'accepted'with the same shapes and the same assertions(
core/test/project-metrics.test.js,core/test/project-metrics-scope.test.js); without that theyare red under the real criterion, which is the "only hand-written fixtures looked green" half of the
report.
'the task median reads the store stamps only'is a rewrite in place, not a deletion: the same test keepsits name and its
2 * HOURassertion, and only its three fixtures move from the never-writtenstatus: 'done'tostatus: 'accepted'.docs/subsystems/core-host.md:793now names the real source (createdAt→ last terminalactors[].at, falling back tocompletedAtthenupdatedAt,acceptedonly) instead of promisingcompletedAtfromstate.tasks;#1882'sresolveTimeZoneclause in the same line is kept as is.Red first
Taken on a clean worktree at
33e9c6d5with the source at its base copy and only the final test filein the tree (
git statusshows just that oneM),TZ=UTC node --import ./test/harness-resolve.mjs --test test/project-metrics.test.js:not ok 13is the real red one: a card finished the way the host finishes cards (status: 'accepted',actors: [open, claimed, accepted], nocompletedAt) is 9h and readsnull.not ok 10is the older store-stamps case whose fixture had to move from the never-written'done'to
'accepted'. Thenull-guard case passed before the change too — that is the point, it is thenon-regression half of the pair.
After the fix the same file and
core/test/project-metrics-scope.test.jsare 22/22.Verification at the tip
Ran:the full set at9e9645e01db4dcff1f2b8fe2690ca65fa59e2bd4(tree828e83f199afe3b2032272e95f07635375fc7037). That tree and this tip's tree539bcee5c60a6dbc23ae7e45f9984c83dc0f14efdiffer only in the changelog fragment and one test-comment rename (#P255→#1884, +2/−2, with no change to code, assertions or test count). At this tip I re-rantest/project-metrics.test.js+test/project-metrics-scope.test.js(22/22),node scripts/ds-bot-patches.mjs check(three linesok), the three mirrorcmppairs (byte-identical) andnode .github/scripts/changelog.mjs check(21 fragment(s) … are well formed); the tree was clean before and after:project-metrics.test.js14/14 andproject-metrics-scope.test.js8/8).github/scripts561/561, interop 37/37, live-e2e 24/24arch-docs: OK (8 changed file(s))withARCH_DOCS_BASE=33e9c6d5…core/files (cmpsilent forsrc/host/project-metrics.js,test/project-metrics.test.js,test/project-metrics-scope.test.js),regenerated with
node scripts/ds-bot-patches.mjs generate, and the chain checks:Not run:the smoke bench (noindex.jsorsrc/host/wiring change), the CIpackagejob and themerge-queue rebuild — those run in CI and on the queue entry.
Rebase note
#1882landed on the same module while this branch was ready, so it was rebased onto33e9c6d5: three files conflicted and every one was resolved by keeping both sides —project-metrics.jskeepsresolveTimeZone(:25) next tofinished/finishedAt(:79/:80),core-host.mdkeeps the#1849clause and the new task-half clause in the same paragraph, and thetest file keeps
#1882's two#1849cases ahead of the P-255 pair (the})the conflict swallowedwas restored, so the file parses).
#1882's time-zone cases were not touched.{ "pr": 1885, "claim": "Dev4", "issue": 1884, "summary": "The task-completion median required status 'done' and a finite completedAt, both of which the store never writes, so it read null on every deployment. It now counts a card when the board's columnOf puts it in the done column and its status is accepted, timing it from createdAt to the last terminal actors[].at, falling back to completedAt then updatedAt; cancelled and failed cards are skipped, the window is still judged on the end and an empty window still answers null, never zero.", "files": [ "changelog.d/1884-p255-task-done-median.fixed.md", "core/src/host/project-metrics.js", "core/test/project-metrics-scope.test.js", "core/test/project-metrics.test.js", "docs/subsystems/core-host.md", "patches/ds-bot/files/src/host/project-metrics.js", "patches/ds-bot/files/test/project-metrics-scope.test.js", "patches/ds-bot/files/test/project-metrics.test.js" ], "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=33e9c6d5 npm run verify; node scripts/ds-bot-patches.mjs check", "result": "green", "at": "1a622105a72b0e43f82e90fe332b574b2dadf0b5" }, "next": "none — ready for review" }