Skip to content

✨ feature: persist Activity Monitor operator actions - #15004

Closed
thatguywob wants to merge 1 commit into
hivecommons:v5from
thatguywob:scanner/activity-actions-14996
Closed

thatguywob wants to merge 1 commit into
hivecommons:v5from
thatguywob:scanner/activity-actions-14996

Conversation

@thatguywob

Copy link
Copy Markdown
Contributor

Closes #14996

Activity Monitor actions now retain their operator and outcome in /data/operator-actions.json, capped at 20 entries per item. Tracker rows expose last_operator_action and operator_action_count; GET /api/repos/{owner}/{repo}/items/{number} returns retained history newest first.

Hold/release, decisions, triage acceptance and send-to-human record success and error responses without allowing a storage failure to fail the action. Delegated decisions record their final job outcome. Bulk retries still perform one rescan, now carrying the selected items so each row receives a ledger entry. Entries capture the row's head and stage before mutation and retain comments or supersession references.

Added tests for persistence, retention, item isolation, corrupt-ledger preservation, tracker summaries, head/stage snapshots, handler success and failure, storage failure tolerance, the GET route and bulk retries. Go tests are delegated to CI per AGENTS.md; changed Go files pass gofmt -l. Ran the issue-requested bash src/scripts/check-api-reference-citations.sh --fix (142 citations updated, none unresolved). Includes the changelog fragment and API documentation.

— hive: backend=codex


🐝 Hive Agent: contributor | SHA: 39858f993

Record row action outcomes in a capped dashboard-owned ledger and expose retained history and tracker summaries. Include selected rows in bulk retry requests and record delegated decisions after completion.

Hive-Run: hivecommons#14996
Hive-Plan: activity-monitor-operator-ledger
Hive-Spec: issue-14996#scope
Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 28, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign danathar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added author/clanker A contributor's own hive authored this PR under their login dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Failing checks:

  • test (dashboard 2/4)
  • test (dashboard shuffle 2/3)

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.

Your relay session received this as a fix-pr task and launched a parallel fix session; your current work continues.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision needed: @clubanderson should decide whether #14992 (your owner-authored ledger + badge, Fixes #14991) or the hive split #15004 (server, Closes #14996) + #15003 (UI, Closes #14998) is the operator-action ledger that lands on v5 — they implement the same /data/operator-actions.json ledger with incompatible wire shapes and cannot both merge.

Conclusion: this PR and #14992 implement the same feature — a server-side operator-action ledger at /data/operator-actions.json, keyed repo#number, capped at 20, surfaced as last_operator_action / operator_action_count on tracker rows and via a new GET /api/repos/{owner}/{repo}/items/{number}. Both add src/pkg/dashboard/operator_actions.go and operator_actions_test.go and wrap the same handlers (hold, decision, decide-delegated, accept-triage, send-to-human). I read both diffs in full; they are not byte-duplicates — they conflict on the wire shape, so only one can land.

Verified differences (this PR → #14992):

  • OperatorAction.Outcome is free-text: "ok" on success, else the response error string / status text (operator_actions.go observeOperatorAction). #14992 uses a closed vocabulary pending|applied|no-op|failed|superseded-by-state-change plus a separate detail.
  • Head field is head here vs head_sha in #14992; this PR has no target and no derived state/followed[].
  • operator_action_count is emitted unconditionally here (json:"operator_action_count"), omitempty in #14992.
  • #15003's UI (sibling of this PR) hard-codes action.outcome !== 'ok' ⇒ "action failed" (static/index.html, +76), so it is bound to this PR's shape and would mislabel every success if #14992's server shipped instead.

What I checked and found fine in this PR: actor attribution via X-Hive-User matches the existing handlers (api.go:811, api.go:1342); the read-modify-rename is serialized under a package mutex and an unreadable ledger is never overwritten (appendOperatorAction); attachOperatorActions is hooked into the tracker response build.

Issue lineage, from the PR bodies: #14992 cites the owner request in #14991 verbatim and covers (c) badge + trail end to end; #14996/#14998 appear to be the hive's split of that same request. If #14992 is preferred, this PR and #15003 can be closed as superseded. If the split is preferred, #14992 should be closed and the two hive PRs merged in order (#15004 before #15003). I have not closed anything.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Superseded by #15003 (earlier fix for #14996). Closing as duplicate.

@hivecommons-hive hivecommons-hive Bot added the hive/superseded Closed by Hive: a different merged PR already landed this change label Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot closed this Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#15013 🐛 dashboard: Needs human chip counts only human-gated rows; Refs-only PRs address, not cover, an issue same files src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#15011 🐛 Close superseded hive PRs automatically and re-stage adopted originals out of the merge gate same files src/pkg/dashboard/static/index.html
#14995 ✨ Activity Monitor: needs-human popover says what to decide and offers the actions same files src/docs/api-reference.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#15014 ✨ Activity Monitor: live row feedback — confirm opt-out, result toasts, working cue, event line, merge celebration same files src/pkg/dashboard/api_repo_hold.go
src/pkg/dashboard/api_repo_item_accept_triage.go
src/pkg/dashboard/api_repo_item_decide_delegated.go
src/pkg/dashboard/api_repo_item_decision.go
src/pkg/dashboard/api_repos_rescan.go
src/pkg/dashboard/api_review_pipeline.go
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/stage_tracker_row_actions_test.go
src/pkg/dashboard/static/index.html
#15003 ✨ feature: show Activity Monitor operator decision trails same files src/pkg/dashboard/static/index.html
#14992 ✨ Activity monitor: decision badge shows what you chose and what hive did next CONFLICT src/docs/api-reference.md
src/pkg/dashboard/api.go
src/pkg/dashboard/operator_actions.go
src/pkg/dashboard/operator_actions_test.go
#14987 ✨ review: gate PR reviews on an approval label (review.require_labels) same files src/pkg/dashboard/static/index.html
#14807 ✨ dashboard: stream Job pod logs in the terminal pane for sandbox.runtime: job agents same files src/docs/api-reference.md
src/pkg/dashboard/server.go
src/pkg/dashboard/static/index.html
#14524 ✨ feat(hub,agent): Hub-coordinated live CLI session pool for multi-tenant runner capacity same files src/docs/api-reference.md

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision needed: @clubanderson should decide whether #15004 (+ its UI consumer #15003) or the owner-authored #14992 is the operator-action ledger that lands; both create src/pkg/dashboard/operator_actions.go with incompatible last_operator_action shapes.

Conclusion: the ledger implementation is correct and conservative (never overwrites an unreadable file, tmp+rename, storage failure never fails the action), but it collides with #14992 and the head is red on a spec-parity test.

1. Collides with #14992. Both PRs create src/pkg/dashboard/operator_actions.go / operator_actions_test.go, use /data/operator-actions.json, register GET /api/repos/{owner}/{repo}/items/{number}, and add last_operator_action + operator_action_count to StageTrackerItem. The record shapes differ: here OperatorAction (operator_actions.go:18-25) is {action, actor, at, note, outcome, head, stage}; #14992 emits {…, state, stage_at, followed[], head_sha, detail, target} with server-derived state. #15003 consumes this shape (action.stage, action.outcome, action.at), so the realistic choice is "this pair" vs "#14992". A maintainer should pick; I have not closed anything.

2. dashboard/openapi.json not updated — TestOpenAPISpecCoversEveryRegisteredRoute fails on every dashboard shard (openapi_route_parity_test.go:388, "495 registered, 485 documented, 1 problem"). The spec has …/items/{number}/hold (dashboard/openapi.json:28207) but no entry for the new bare …/items/{number} GET. Add the path (the issue's check-api-reference-citations.sh --fix covers api-reference.md only, not the OpenAPI spec).

3. Low — lock scope. newOperatorAction (operator_actions.go:97-112) runs s.buildStageTracker(...) while holding s.statusMu.RLock(). buildStageTracker doesn't touch statusMu, so no deadlock, but the two existing callers (delegated_pr_context.go:85-93, stage_tracker.go handleStageTracker) snapshot s.status under the lock and build outside it. Same pattern would keep write-lock holders from stalling on a full tracker rebuild per operator click.

Body vs diff: matches — hold/decision/decide-delegated/accept-triage/send-to-human are wrapped, bulk rescan carries selected items, GET returns newest-first. Nothing else verified worth raising.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/clanker A contributor's own hive authored this PR under their login conflicts-with-open-pr Open PR has a merge conflict with another open PR dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. hive/superseded Closed by Hive: a different merged PR already landed this change role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] Activity monitor: record row actions server-side and expose last_operator_action

1 participant