Repository navigation
🐛 fix(trackerrow): pin the STAGE_TRACKER_* contract and list tracker-human-attention - #16081
Conversation
…human-attention in the layout doc Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Review findings from Read the new Go against the tree at One cross-reference for whoever lands these: #16084 (hub |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
There was a problem hiding this comment.
Intent alignment (read at head e755c0b).
#16067 is fully addressed: src/docs/dashboard-source-layout.md:80 now lists tracker-human-attention between tracker-row-acted and tracker-row-layout, matching static-src/manifest.txt:77-79.
#16068 is only partially addressed. The issue's finding is that "nothing pins the hub's copies to the spoke's values". This PR exports a list of names (src/pkg/webassets/trackerrow/trackerrow.go:40-51), and the two new tests check names only: TestRequiredGlobals regex-matches identifiers in the assets (trackerrow_test.go:70-91), and TestTrackerRowRequiredGlobalsDefinedBySpoke calls jsConstLine (tracker_row_shared_asset_test.go:52-57), which only asserts const NAME = exists in index.html (disabled_agent_enable_test.go:205-216) and discards the returned line. A hub that defines STAGE_TRACKER_PATH = [0, 10, 20, 30, 40, 80] passes everything here yet lights different columns than the spoke's [0, 10, 20, 30, 50, 80] (agent-now.js:472).
The changelog fragment (changelog.d/fixed-trackerrow-drift-guard.md:1) claims "so the hub cannot silently light different columns than the spoke", which the diff does not deliver.
Requested change: carry the spoke's values in the contract, not just the names — e.g. make RequiredGlobals a map[string]string (or an ordered slice of {Name, JS}) holding the JS literal for each constant, and have TestTrackerRowRequiredGlobalsDefinedBySpoke compare jsConstLine(t, html, name) against "const " + name + " = " + value + ";" so a spoke edit fails until the Go table is updated. Then the hub can assert its own definitions against values, and the changelog claim becomes true.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
…pt digits in the drift-guard regex
RequiredGlobals now carries each STAGE_TRACKER_* constant's spoke JS literal
(Global{Name, JS} with Decl()), and TestTrackerRowRequiredGlobalsDefinedBySpoke
compares the spoke's declaration against it, so a hub copy with a different
value fails the test as #16068 asked. TestRequiredGlobals matches
[A-Z0-9_]+ so a future constant with a digit is still forced into the list.
Hive-Fix-Attempt: 1/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Looks correct to me. I checked the new pins against the v5 tree rather than the diff.
src/pkg/webassets/trackerrow/trackerrow.go:56-67— all tenRequiredGlobalsvalues match the spoke's declarations verbatim:agent-now.js:472-476(PATH,PR_COLUMN,MERGE_COLUMN,NEEDS_DECISION,ISSUE_NEEDS_DECISION) andtracker-words-core.js:67-105(ISSUE_DECISION_COLUMN,TRIAGE_NEEDED,POSSIBLY_EXISTS,PRE_MERGE_SOAK,TERMINAL). The generatedstatic/index.htmlcarries each asconst NAME = VALUE;with no trailing comment, so the exact-string compare inTestTrackerRowRequiredGlobalsDefinedBySpoke(tracker_row_shared_asset_test.go:53-59) passes today and will fail on a value change, which is the point.trackerrow_test.go:71-102— the\bSTAGE_TRACKER_[A-Z0-9_]+\bscan of the two embedded files yields exactly the ten names in the list (I ran the same grep overtracker-row-anchor.js/tracker-row-title.js), so the set-equality check is green at this head and any new free global forces a list entry.jsConstLine(disabled_agent_enable_test.go:205) fatals when a name is absent, so a removed spoke constant is caught as well as a changed one.src/docs/dashboard-source-layout.md:80—tracker-human-attentionplaced betweentracker-row-actedandtracker-row-layout, which ismanifest.txt:77-79order.
One non-blocking note for the hub side: nothing consumes RequiredGlobals yet (as the body says, that is #16063's job), so until the hub adds its own assertion the guard only protects the spoke half of the contract. Not a defect in this change.
"Sign-off survives the squash" shows CANCELLED on this head — looks like a runner cancellation rather than something in the diff; worth a re-run before merge.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Looks correct to me. What I checked against the tree at 464d512:
- The ten names in
trackerrow.RequiredGlobals(src/pkg/webassets/trackerrow/trackerrow.go:56-67) are exactly the set ofSTAGE_TRACKER_*identifiers the four embedded asset files reference — no extras, none missing — soTestRequiredGlobalswill pass and will fire if either side drifts. - Each pinned
JSliteral is byte-for-byte the spoke's declaration instatic-src/js(const STAGE_TRACKER_PATH = [0, 10, 20, 30, 50, 80];etc.), soTestTrackerRowRequiredGlobalsDefinedBySpokepasses today. It leans on the existingjsConstLine/indexHTMLhelpers (disabled_agent_enable_test.go:205,clickable_avatars_test.go:12), which return the declaration up to end-of-line — fine for these single-line consts. dashboard-source-layout.mdnow liststracker-human-attentionbetweentracker-row-actedandtracker-row-layout, matchingmanifest.txt:77-79.
One note for the hub side (#16063/#16084, not this PR): nothing in v5 asserts against RequiredGlobals yet; the value of this list is realised only when the hub's host page checks its own consts against it, so that follow-up should land with or soon after this.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
…iredGlobals Now that the branch carries hivecommons#16081, TestActivityPage_DefinesTrackerRowGlobalsWithSpokeValues compares each STAGE_TRACKER_* declaration in static/activity.js with trackerrow.RequiredGlobals[i].Decl(), instead of re-deriving the names from the asset and re-parsing the spoke's static-src. The names stay pinned to the asset by TestRequiredGlobals and the values to the spoke by TestTrackerRowRequiredGlobalsDefinedBySpoke, so the hub now checks against the same single list instead of a second copy of the contract. Addresses the hive reviewer suggestion on hivecommons#16084. Hive-Run: hivecommons#16063 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HRH6kjQb8shmrV2ZP2K8GD Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
…ng, hive chips and group-by-hive headers (#16084) * ✨ feature(hub): add the Fleet activity page /activity Add the read-only hub Fleet activity board at /activity, linked as "📡 Fleet activity" next to "🔬 Evidence" on the dashboard's Fleet quadrant card (#16063, part of #15965, RFC #15861 by @hanthor). - GET /activity: data-free shell; no valid session redirects to /login, otherwise requireAuth (not admin-only). Served with its own CSP following webstatic/csp_script_src.go (scripts/styles from 'self' only, script-src-attr and style-src-attr 'none', script-src-elem recomputed from the served bytes) and the static no-cache + ETag headers. - GET /activity/assets/{name}: the shared trackerrow asset (#16062), byte-identical, whitelisted to trackerrow.Files. - static/activity.js polls GET /api/hub/activity every 15 s with If-None-Match and redraws only on a new ETag. Hive column with stable colour chips linking to /api/saas/hives/{id}/open; rows link to GitHub; titles set as text; no action menus. Group-by-hive headers carry counts and freshness (stale, "upgrade to report activity", missing). Truncation, dropped events and stale/missing hives are always listed above the board. - The page defines the STAGE_TRACKER_* globals the shared asset reads; a test pins them to the spoke's values (#16067 / #16081). - /activity is noindex; docs page and changelog fragment. Hive-Run: #16063 Hive-Plan: #15965 decomposition, piece 2 of 3 (#16062 -> #16063 -> #16064) Hive-Spec: RFC-15861#D Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HRH6kmq5bGTopPWeCopPvU Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com> * 🌱 test(hub): assert the activity page globals against trackerrow.RequiredGlobals Now that the branch carries #16081, TestActivityPage_DefinesTrackerRowGlobalsWithSpokeValues compares each STAGE_TRACKER_* declaration in static/activity.js with trackerrow.RequiredGlobals[i].Decl(), instead of re-deriving the names from the asset and re-parsing the spoke's static-src. The names stay pinned to the asset by TestRequiredGlobals and the values to the spoke by TestTrackerRowRequiredGlobalsDefinedBySpoke, so the hub now checks against the same single list instead of a second copy of the contract. Addresses the hive reviewer suggestion on #16084. Hive-Run: #16063 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HRH6kjQb8shmrV2ZP2K8GD Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com> --------- Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Closes #16067
Closes #16068
Both findings came from the review of #16066.
Why
tracker-row-anchor.jsreads theSTAGE_TRACKER_*constants as free globals that only the spoke defines, and nothing pinned a host's copies to them. If the constants drift, the hub ([scanner] Add the hub Fleet activity page /activity with ETag polling, Hive chips and group-by-hive headers #16063) could light different columns than the spoke.dashboard-source-layout.mdlisted JS parts out of step withmanifest.txt:tracker-human-attentionwas missing.What
trackerrow.RequiredGlobalsexports the required constants so the hub can assert against it when it activates the asset.TestRequiredGlobalskeeps that list equal to what the embedded assets reference.TestTrackerRowRequiredGlobalsDefinedBySpokefails if the spoke page stops defining one.tracker-human-attentionin manifest order.— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88