Skip to content

aggregator: /api/actions.json?state=all returns empty while the actions store holds history — audit/retrospective reads get a false zero #4620

Closed

Description

@dezren39

Found by the orchestration-pass weekly triage retrospective (2026-11-02, run orch-2026-11-02T22:13:54Z).

Evidence: via the laptop route, curl -s "http://127.0.0.1:4870/api/actions.json?state=all" returned {"actions": [], "pending": {...0}}, while the aggregator store file ~/pm-stack/aggregator/actions.json on the same host holds 13 actions (all state=applied, created 2026-10-27). The ?state=new query correctly returns 0 pending — the bug is specific to non-new/all reads.

Impact: any consumer auditing past dashboard actions (the weekly triage retrospective, code#1455, reviews ALL of Drew's dashboard actions since the last retrospective across every kind and outcome) reads a false zero from the API and can only get the truth by reading the store file directly.

Acceptance: /api/actions.json supports a state filter that returns applied/rejected history (or an explicit all-history route), with a regression test pinning that a store with applied actions returns them.

Acceptance criteria

  • /api/actions.json supports a state filter that returns applied/rejected history (or an explicit all-history route exists).
  • A regression test pins that a store containing applied actions returns them from the API.
  • ?state=new behaviour is unchanged.

Activity

  1. added
    meta/follow-up
    on Nov 2, 2026
  2. added
    meta/enriched
    kind/bug
    priority/normal
    effort/s
    status/needs-triage
    on Nov 3, 2026
  3. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    Intake review

    Related: code#1455 (weekly triage retrospective consumes this API). Notes: reproduced live 2026-11-02 — API returned an empty actions list while the on-disk store held 13 applied actions; the state=new path is correct, so the defect is specific to non-new/all reads. Risk: low — read-path only — but audits silently read a false zero until fixed. Suggested approach: find where the state filter is applied in the aggregator's actions route and check it against the store's state values.

    — Fleet monitor intake enrichment (protocol §5), run 2026-11-02 18:12 CST. Labels normalized and meta/enriched applied; acceptance criteria appended to the body.

  4. added
    queue/queued
    source/creator
    task/triage
    on Nov 3, 2026
  5. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: triaged (coverage pass)
    Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 40 (priority/normal). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
    Found via: coverage pass 2026-11-03

  6. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    Agent note — triage findings (OpenChamber scheduled lane)

    • Agent: queue worker (repo-worker-code), lane c29174f1-48e0-4b13-b4ff-9b73ab67e9ab
    • Session / ID: queue task 8431 (triage)
    • Finding: still live at origin/main. pm-stack/aggregator/src/server.ts /api/actions.json does if (state) list = list.filter((a) => a.state === state);. Valid action states are new | applied | rejected | superseded (src/actions.ts:228), so state=all matches nothing and returns []. state=new works, which matches the report.
    • Fix scope (small, one file plus a test): treat state=all as no state filter, e.g. if (state && state !== "all"), and document it in the README next to the state=new contract. Add a regression test in pm-stack/aggregator/test/actions.test.ts that stores applied actions and asserts ?state=all returns them. ?state=new stays unchanged.
    • Blockers and ordering: none. The fix is independent and can run as a small-fix task. It should land before the weekly triage retrospective (code#1455) relies on the API again.
    • Links: aggregator: /api/actions.json?state=all returns empty while the actions store holds history — audit/retrospective reads get a false zero #4620 · code#1455 · queue task 8431
  7. removed
    status/needs-triage
    queue/queued
    on Nov 3, 2026
  8. 28 remaining items

  9. removed
    work/assigned
    on Nov 8, 2026
  10. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triage complete — real/current; fix follow-on queued

    • Task: 12171 · issue aggregator: /api/actions.json?state=all returns empty while the actions store holds history — audit/retrospective reads get a false zero #4620 · OpenChamber scheduled lane 7b47536b-c162-444c-be8a-3a9538cc4cb5
    • Verified: current main plus live API: bare endpoint has 14 actions; ?state=all has 0. No relevant PR found. Targeted test file: 25/25 pass with isolated freshness port.
    • Queue: completed with triage_outcome=follow_on; broker created fix task 13245 under the canonical fix key. Scope: treat state=all as unfiltered, add regression coverage (including unchanged state=new behavior), and clarify the README audit-log contract.
    • Issue remains OPEN until the fix lands. Labels now reflect the queued small-fix follow-on.
  11. added
    queue/claimed
    status/in-progress
    and removed
    queue/queued
    status/triaged
    on Nov 8, 2026
  12. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor

    🤖 Agent note · picked up

  13. added
    queue/parked
    status/parked
    and removed
    status/in-progress
    queue/claimed
    on Nov 8, 2026
  14. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor

    🤖 Agent note · parked

  15. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    Agent note — task 13245 completed (resumed): PR #7669 merged, issue closed

    • Lane code-e (repo-worker-code) claimed task 13245 and found the work already implemented by an earlier attempt (repo-worker-code-k): branch queue/13245-4620-actions-state-all, commit 58fd8c5, PR fix(aggregator): /api/actions.json?state=all returns history (#4620) #7669 open. Per resume-don't-restart, this lane verified rather than redoing it.
    • Verification (2026-11-08): diff reviewed (server.ts: state=all bypasses the literal filter, unknown states 400; actions.ts: ACTION_STATES exported; regression test in actions.test.ts). Test suite re-run on the laptop worktree: bun test test/actions.test.ts — 26 pass, 0 fail (with PM_AGG_FRESHNESS_PORT=4899; the live aggregator holds the default IPC port 4871 on that host). PR mergeable, no Codex findings; basic checks queued on the runner backlog at merge.
    • Merged: PR fix(aggregator): /api/actions.json?state=all returns history (#4620) #7669 squash-merged as 0798a98; this issue auto-closed as completed via the PR's closing keyword.
    • Triage-doctrine verdict for the record: the issue was real and current; it is now done via landed work, not triage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

effort/skind/bugmeta/enrichedmeta/follow-uppriority/normalqueue/parkedsource/creatorstatus/parkedtask/small-fix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions