Repository navigation
Guard taskCounters against a non-numeric updatedAt - #2589
Merged
Merged
Conversation
workerSeconds added (task.updatedAt - lease.takenAt) while guarding only the lease, so a stored card whose updatedAt was missing or non-numeric made the counter NaN, and JSON handed every reader null instead of a number. Guard the task operand the way the sibling readers of the same card fields do (room-context.js, isoStamp, project-board.js). Red first: core/test/task-counters-updated-at.test.js seeds an accepted card with a lease and updatedAt 'not-a-number' and failed with workerSeconds = NaN before this change; reverting the one-line guard turns it red again. Fixes #2588 Docs-not-needed: a numeric guard on an existing counter; no subsystem behaviour changes.
This was referenced Nov 7, 2026
Collaborator
Author
|
Verdict: PASS at 5dcd29e Ran at this tip: Review notes:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Written-by: Dev
Fixes #2588
Owner: Dev
Reviewer: Reviewer
What changed
rt.taskCounters()added(task.updatedAt - lease.takenAt)intoworkerSecondswhile guarding onlylease.takenAt, so a stored card with a missing or non-numericupdatedAtturned the counter intoNaN, and JSON handed every readernull.core/src/host/tasks.js:572now guardsNumber.isFinite(task.updatedAt)beside the lease guard, the wayroom-context.js,isoStampin this file andproject-board.jsalready guard that field. A numericupdatedAtstill measures the lease window.The new test
core/test/task-counters-updated-at.test.jsseeds an accepted card with a lease and covers a string, a missing and anullupdatedAt, the JSON serialisation, and the numeric control.Red first
Before the source change,
cd core && node --import ./test/harness-resolve.mjs --test test/task-counters-updated-at.test.js:After the fix the same command passes 2/2; reverting the one-line guard turns it red again with the same message.
Ran at the tip
Each stage on its own with
TZ=UTC: this host's Docker pid cap (512) breaks one longnpm run verifychain withpthread_create: Resource temporarily unavailable, so the same commands were run one at a time.node scripts/lint-plugins.mjs(0 errors),node core/scripts/build-client.mjs --check,node scripts/ds-bot-patches.mjs check(10 patches apply in order;core/equalsds-bot/+patches/ds-bot/).check-arch-docs.test.jsneedsgit(absent) twice, andusage-fields.test.jsshells out topython3(absent); CI runs them..github/scripts/*.test.mjs+policy/*.test.mjs: 662 pass, 0 fail. Interop lint + 37/37; live-e2e lint + 34/34.Not run here:
arch-docsandds-bot-patches canonical, both of which need a realgit. The branch commit and this body carry theDocs-not-needed:trailer arch-docs reads, and the twopatches/ds-bot/files/**mirrors are byte-identical to theircore/sources, socheckproves the series reproducescore/.Checkpoint
{
"pr": 2589,
"claim": "Dev",
"issue": 2588,
"summary": "rt.taskCounters added a card's updatedAt into workerSeconds while guarding only the lease, so a missing or non-numeric updatedAt made the counter NaN and JSON gave readers null. The host now guards both operands in core/src/host/tasks.js, the same way sibling readers of those card fields already do. A new test pins a string, a missing and a null updatedAt plus the numeric control, and fails without the guard. The two patches/ds-bot/files mirrors are the generated whole-file copy of the same sources.",
"files": [
"core/src/host/tasks.js",
"core/test/task-counters-updated-at.test.js",
"patches/ds-bot/files/src/host/tasks.js",
"patches/ds-bot/files/test/task-counters-updated-at.test.js"
],
"checks": {
"ran": "staged verify: core lint, plugin lint, build-client check, patches check, core suite, four plugin suites, repo/policy tests, interop and live-e2e",
"result": "green",
"at": "5dcd29e33a99b6a37604ce7b80e180335eb4f8ff"
},
"next": "none — ready for review"
}
Docs-not-needed: a numeric guard on an existing counter; no subsystem behaviour changes.