Repository navigation
Conversation
|
[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 |
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. |
|
@Karibhou this PR is back in your court ( Failing checks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Queued in your relay fix queue (1 waiting): fixes are handed out before new work as soon as you have capacity. |
There was a problem hiding this comment.
Intent alignment (#15951) — read at head e7da30d. The diff delivers every bullet of the child issue (default-100/ceiling-250 digest in pkg/hubactivity, urgency order, builder-side private drop with totals kept, heartbeat ack + memory-only activityStore, per-user/per-hive GET /api/hub/activity with ETag, stale/not_reporting/missing/truncation disclosure, no rollout/participation/broadcast change). visibleActivityHives (src/pkg/hub/activity.go:143-170) matches the My Hives rule in saas_hives_api.go:747-777 (admin / owner / grant) and is stricter on expiry. No unrelated files touched. Two low notes, neither blocking:
-
Docs row disagrees with the code on
Vary.src/docs/api-reference/hub-server.md:49saysVary: Cookie; the handler setsCookie, Authorization(src/pkg/hub/activity.go:363) and the test asserts that (activity_test.go,TestHubActivity_ETagPolling).`Cache-Control: private, no-cache`, `Vary: Cookie, Authorization`(replace the
Vary: Cookiefragment in the row.) -
The response ETag churns on every beat even when no content changed. The etag is
ETagFor(json.Marshal(view))(activity.go:352-358), and the view embedsreceived_at(activity.go:291), whichrecordrefreshes on each unchanged marker (activity.go:97). So with any reporting hive a viewer'sIf-None-Matchwill miss every ~2 min regardless of content, which undercuts the "ETag polling" the issue asks for. The 304 test does not interleave a beat, so it does not catch this. A small fix: hash the view with the volatile timestamps cleared.- body, err := json.Marshal(view) + body, err := json.Marshal(view) if err != nil { ... } - etag := webstatic.ETagFor(body) + stable := view + stable.Hives = slices.Clone(view.Hives) + for i := range stable.Hives { + stable.Hives[i].ReceivedAt, stable.Hives[i].GeneratedAt = nil, nil + } + stableBody, _ := json.Marshal(stable) + etag := webstatic.ETagFor(stableBody)
stale/statusstay in the hashed body, so a freshness flip still produces a new etag.
— hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Read What I verified
Why CI is red (all three failures share one cause)
Two small, non-blocking notes
I have not approved or changed anything. Review findings from Correctness review (head 1. Response ETag churns on every heartbeat, so - body, err := json.Marshal(view)
+ body, err := json.Marshal(view)
if err != nil { ... }
- etag := webstatic.ETagFor(body)
+ // Freshness timestamps change every beat; keep them out of the validator
+ // so an unchanged board polls to 304.
+ tagView := view
+ tagView.Hives = slices.Clone(view.Hives)
+ for i := range tagView.Hives {
+ tagView.Hives[i].ReceivedAt = nil
+ }
+ tagBody, _ := json.Marshal(tagView)
+ etag := webstatic.ETagFor(tagBody)2. Hub-side test overstates the private guarantee (low, test adequacy) Note: CI Review findings from Read the two new packages, the wiring in Blocking (CI red): api-reference citations drifted. The three lines inserted at Verified correct
Two small things, not blockers
Open question for the follow-ups, not this slice: Body and diff agree otherwise: the changelog fragment is present and correctly named, nothing populates the digest yet, and no participation/broadcast setting changed. Review findings from Style / conventions review (read at head e7da30d, diff + 1. The new struct field ( (merge-base is clean: "all pkg/: references verified"). bash src/scripts/check-api-reference-citations.sh --fix && git add src/docs/api-reference/hub-server.md2. Doc/code mismatch on The new table row documents Otherwise the package layout ( Review findings from docs-currency review (read at head e7da30d against true merge-base 1c25e90; the 1. 2. (apply inside the existing row text — the row is one line.) Everything else in the new row checked out against the code: 401 for anonymous ( |
|
@Karibhou the hive has adopted this PR ( |
…b/activity First implementation slice of the hub-wide Activity Monitor (RFC hivecommons#15861 by @hanthor, child hivecommons#15951): - pkg/hubactivity: shared wire contract for the heartbeat `activity` block. Build caps items at 100 by default under a hard 250-item ceiling, orders by urgency (needs-human/needs-decision, stalled, furthest stage, oldest), drops private-repo items unless the spoke opts in while still counting them in totals, and stamps a content etag independent of generated_at. Sanitize re-applies every bound on the hub: owner/name repos only, closed kind/author_kind sets, slug-only stage/mods, deduped repo#n rows, clamped integers, control/format/separator characters stripped from titles. - Hub: the digest rides the existing per-hive heartbeat bearer, is sanitized and kept in memory only (leaf-locked activityStore, never in the persisted registry, forgotten after 24h of silence), and the beat response acknowledges the held etag (activity_etag) so a spoke can send an unchanged marker. - GET /api/hub/activity (signed-in users): per-user/per-hive authorization before any block is read (admins all hives; others owned or unexpired granted hives), merged items tagged with hive_id, per-hive ok / stale / not_reporting / missing disclosure, digest and response truncation counts, bounded filters, ETag + If-None-Match polling, private no-cache. - Spoke payload/response carry the optional fields; nothing populates the digest yet (hivecommons#15963). No rollout, participation or broadcast setting changes. Hive-Run: hivecommons#15861 Hive-Plan: rfc-15861 decomposition, child 1 (hivecommons#15951) Hive-Spec: rfc-15861#A-B-C Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
…i/hub/activity The new activityStore field and /api/hub/activity registration in pkg/hub/server.go shifted every cited line in the hub-server API reference, so the changelog-fragment-guard citation check failed. Re-run the citation fixer and align the documented Vary header with what the handler sets. Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
e7da30d to
51bd49a
Compare
|
hive/awaiting-ci: rebased the adopted branch onto v5 (author commit kept intact, 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
First implementation slice of the hub-wide Activity Monitor: RFC #15861, proposed by @hanthor, child #15951.
Closes #15951
Refs #15861: partial. Still to do: the cached spoke publisher with coalesced ≤1/15 s updates (#15963), bounded
eventsand merge toasts (#15964), the Fleet activity page and display shell (#15965), and the disabled-by-defaulthivecommonsfleetbroadcast (#15966).What changed
pkg/hubactivity(new): the shared wire contract for the heartbeatactivityblock. Both ends import it, so the caps and the ordering cannot drift between spoke and hub.Buildcaps at 100 items by default under a hard 250-item ceiling.totals, and the drop is not reported as truncation.generated_at.Sanitizere-applies every bound on the hub, because spoke input is untrusted:repomust beowner/name;kindandauthor_kindcome from closed sets;stageandmodsmust be slugs;repo#nrows are removed;Hub storage and acknowledgement
activityStore, never in the persisted registry. A hive's block is forgotten after 24 h of silence.activity_etag. A spoke can then send an etag-only "unchanged" marker, and the marker is compared on the cleaned etag.GET /api/hub/activity(signed-in users, read-only, no actions)hive_id.ok,stale(more than two missed heartbeats),not_reporting(spoke too old) ormissing(granted but unknown).hive/repo/stage/mod/author_kind/qare bounded; an invalid one returns400.If-None-Matchreturns304. Headers areCache-Control: private, no-cacheandVary: Cookie, Authorization.Spoke: the payload and response structs carry the optional fields. Nothing populates the digest yet (that is #15963), so beats are byte-identical today.
Also included: a docs row in
src/docs/api-reference/hub-server.mdandchangelog.d/added-15951-hub-activity-api.md.Tests
The tests were written before the implementation. Per
AGENTS.md, nothing was run locally (gofmt -lis clean), so CI gives the verdict.hubactivity: default cap and truncation, ceiling clamp, urgency order, private drop with totals still counted,share_private, etag stability, no input mutation, hub ceiling, token validation and dedupe, separator stripping, the unchanged marker.handleHeartbeat:401.304, then a new etag after a change.400.Review notes
The change was reviewed by a Go reviewer and a security reviewer. Neither found a CRITICAL or HIGH issue, and their findings were applied before the push. Known limits, deliberately left out of this slice:
Owneris spoke-asserted. This is the same trust model My Hives uses today. The worst a spoke can do is show its own rows to another user; it cannot read anything.Privateopt-in is enforced in the spoke builder, as ✨ Bounded activity heartbeat contract and authorized hub aggregation API #15951 scopes it. A hub-side consent record would be a follow-up.server.gomay shift existing docs citations. If the guard reports drift, I'll runcheck-docs-citations.py --fixasAGENTS.mddescribes.Deployment and activation status
Unchanged. No spoke populates the digest yet, and no rollout, participation (
hub.activity.*) or broadcast setting was added or changed. The existinghivecommonsstream is untouched. @hanthor will get a completion note when this PR actually merges.🤖 Generated with Claude Code
https://claude.ai/code/session_01HRH6kkRUk7o2ootvBTQceV
— hive: backend=claude