Repository navigation
Scope the Project board's running table to the board itself - #1880
Conversation
|
Verdict: PASS at 091fc8c Ran at this tip: Red first, at the base blobs: the four #1848 cases fail ( Review:
Not run: the full |
|
Thanks for the What the second commit changes (one file,
Red first at Evidence at the current tip: Please give a Verdict at Owner: FlyBot Lead |
The board handed readMetrics the deployment's whole task store, so the running table named another Project's claimed cards — title and holder — and emptied when the GitHub source was unavailable or failed. Pass the already filtered `mine` list instead, and carry that one list through every branch of the metrics read; the done-task median reads the same list. The four GitHub numbers stay repository-wide.
|
Verdict: PASS at 6b28d06 Ran at this tip: Red first, hard requirement met: only the two changed source files swapped back to their base blobs (board Review:
Not run: the full |
The cache is keyed by repository, time zone and five-minute bucket, so a hit is shared by every Project on that repo — and it carried the median computed from the first reader's cards. Store only the repository-level numbers, and project `running` and `taskDoneMedianMs` from this caller's tasks on both the hit and the miss; the entry is written field by field so a caller-scoped number cannot ride in by a later spread. The unavailable branches keep their nulls: a source that could not be read is not a zero median.
Written-by: Dev-4
Owner: Dev-4
Reviewer: Birfy
Fixes #1848
What was wrong
The running table read the deployment, not the board.
project-board.jsfilters the task store twice just above the metrics call —visible(task, actor)per card (#1723), then the card's own Project — and buildsminefrom what is left. It then handedreadMetricsthe unfilteredtasks.project-metrics.jsprojected every card in the store intorunning, andrunningOfcarriestitleandwho, so a card the same response refuses as a row still shipped its title and holder. On the other side, the failure branches answeredrunning: [], so with no credential the panel readNothing is running.for a table that needs no token at all.Red first
Base
1c44a786cd460472afa8727f6a18ba895a59969b(live main at push time), clean checkout, source untouched, onlycore/test/project-metrics-scope.test.jsplaced in the tree,node --import ./test/harness-resolve.mjs --test test/project-metrics-scope.test.js:Same four cases pass at this tip on the same command; the seed is two Projects with two owners, a claimed card and a done card on each,
authSessionspopulated so the reader's rule is on, and no stub on the board path.The shared cache entry: a hit answered with another board's numbers
The second commit fixes a hole in the first one. The five-minute cache keys on
repo|timeZone|bucketonly (project-metrics.js:139), so every Project on that repository reads one entry. The first commit moved the running rows out of the cached value and re-projected them per read, butmetrics.taskDoneMedianMsstayed inside it — and that number is computed from the caller'stasks(:120). So a hit answered a second board with the median of the cards that filled the entry: in the seed, one board's card takes an hour and the other's nine, and the hit returned nine hours to the one-hour board. Onlyproject-board.js:466callsreadMetrics, so the fix is that one file.Red at the previous tip
091fc8c5(source untouched, only the final test file placed in the tree):Case 7 is the shape, not only this afternoon's behaviour: the entry is written field by field, so a caller-scoped number added later cannot ride in through a spread. On clean base
1c44a786the same file is 8/8 red (it does not exist onmain). At this tip the same command is# tests 8 / # pass 8 / # fail 0.An unreadable source is still
null, never0(#1848's own rule): the new projection never reaches the unavailable branches, and a case reads all three of them (no-credentials,no-fetch,read-failed: socket hang up) assertingtaskDoneMedianMs === nullbeside the board's live running rows.What changed
core/src/host/project-board.js: thereadMetricscall passestasks: mine— the same list the rows were built from — instead of the store. No widening ofvisible/taskVisible, and nothing filtered in the client: the host never sends the foreign rows.core/src/host/project-metrics.js:taskList(tasks)accepts the list (an object is still read as a map, so a caller handing the store keeps its old answer); the running projection anddoneTaskDurationsread that one list;unavailable()now carries the samerunningas every other branch, and the three unavailable calls inreadMetricspasstasksthrough. The four GitHub numbers stay repository-wide.core/src/host/project-metrics.js(second commit): the cache entry is built field by field from the six repository-level numbers plusok,timeZoneandgeneratedAt;runningandtaskDoneMedianMsare re-projected from this caller'stasksandnowon the hit and on the miss by one function (withLive). No key change and no Project or actor in the key: a caller-scoped number cannot be in a shared entry at all.core/test/project-metrics-scope.test.js: the four acceptance cases (scope, source unavailable/failed, cache hit vs miss byte-identical, median scope), plus four for the shared entry — a hit's median is the reader's own in both orders, a hit's rows and median come from one board, the cache entry's key set is pinned, and the unavailable branches staynull.patches/ds-bot/files/src/host/project-board.js,…/project-metrics.js,…/test/project-metrics-scope.test.js: the mirrors, produced bynode scripts/ds-bot-patches.mjs generate; a secondgeneratepass leaves them byte-identical (sha1sum -c). Both host files are FlyBot-added, so they live whole infiles/and no.patchin the series changed (.patchdelta is 0 files); the thirdcheckline provescore/equalsds-bot/+patches/ds-bot/.docs/subsystems/core-host.md: theproject-metrics.jsparagraph now says the cache is shared by every Project on the repository, holds only the repository-level numbers, and re-projects the running table and the task median on a hit exactly as on a miss.changelog.d/1848-running-table-scope.fixed.md: one clause added for the shared entry.Acceptance (the four items on the issue)
rowsnorrunning: readingproject-p2as a member ofproject-p1answersrows: []andrunning: []; the same member's own board answerstask-groupin both and notask-foreignanywhere.runningis['task-group']with no credential (ok: false,reason: no-credentials) and with a failing fetch (read-failed: socket hang up).cache: 'miss'thencache: 'hit',runningdeep-equal and byte-identical underJSON.stringify— and, since the second commit, the same equality for the done median, each read equal to its own board's cards.project-board.test.js+project-metrics.test.jsrun unedited at 31/31 green at this tip.Gates
arch-docs: OK (8 changed file(s))withARCH_DOCS_BASE=1c44a786,node core/scripts/build-client.mjs --checkgreen (no bundle change), andnpm run verifyexit 0 at this head: core 2261/2261, plugins social 541/541, tree 127/127, timeline 135/135, workflow 336/336,.github/scripts561/561, interop 37/37, live-e2e 24/24.Files
630 insertions, 33 deletions, 8 files, two commits.
Where to read it
Branch
dev/4-p250-metrics-scope(forkHugoXK/FlyBot), head6b28d06447ba1b7910142cc842c0d6630b385da0, tree900d3c0dd375ec17dbfe6c7130f31283e0bba9a2, base1c44a786cd460472afa8727f6a18ba895a59969b.git diff 1c44a786is the whole change; the second commit isgit show 6b28d064.