GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — impl(pm-stack): spend attribution projection — session to issue/epic resolution, unattributed shown (#1259 slice 1) · Issue #4822 · developing-today/code

impl(pm-stack): spend attribution projection — session to issue/epic resolution, unattributed shown (#1259 slice 1) #4822

New issue
Copy link
New issue
Copy link
Closed
#5164
Closed
impl(pm-stack): spend attribution projection — session to issue/epic resolution, unattributed shown (#1259 slice 1)#4822
#5164
Copy link
Assignees
dezren39
Labels
app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/mMedium: expected under 1 day of workkind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Nov 3, 2026
Issue body actions

Part of epic #1184; implementation follow-up of design issue #1259 (spend rollups). Design note: doc/spend-rollups-design-1259.md (PR linked from #1259).

Scope

Build the spend-attribution projection in the pm-stack aggregator: a versioned, pure projection that turns existing per-session usage records into per-issue / per-epic / per-project spend facts. Consume existing sources only — do NOT build new collectors:

  • pm-stack/opencode-usage-export documents (per-session tokens + cost, parentId, directory, model/provider) — slice 1 of External-system observability: unified PM + queue + quota attribution (webhooks, hot list, session IDs, projections) #2072.
  • The aggregator usage snapshot store (pm-stack/aggregator/src/snapshots.ts, append-only usage-YYYY-MM.jsonl).

Attribution rules (per the design note)

  • Queue-bound sessions resolve exactly: lane-ledger session binding → queue task → issue number.
  • Fleet-worktree sessions resolve from the worktree directory name (~/git/fleet/<task>-<issue>-<slug>).
  • Sub-sessions roll up to their root session (parentId); never double-counted.
  • Epic/project resolution reuses the existing hierarchy seams (epicRef / parent chains in pm-stack/aggregator/src/model.ts, rollups in src/epics.ts); Project Area is a display grouping, not an attribution key.
  • Anything unresolved lands in an explicit unattributed bucket with a reason code (no-binding, no-worktree, parent-left-pool, source-gap). Unattributed spend is shown, never dropped or guessed onto an epic.
  • Every projected fact carries attributionVersion; raw source records are never rewritten.

Acceptance criteria

  • Projection is a pure, tested module: same inputs + same version → identical output.
  • Unit tests cover: bound session, worktree session, sub-session rollup, each unattributed reason code, and a session whose parent chain leaves the fetched pool.
  • Totals reconcile: sum(attributed) + unattributed = source totals, per unit, asserted in tests.
  • No new collector, exporter, or instrumentation in OpenCode/OpenChamber.

Checks

  • bun test and bunx tsc --noEmit in pm-stack/aggregator pass (CI on the PR).

Activity

Next
  1. dezren39
    added
    kind/featureNew feature or capability request
    priority/normalOrdinary priority (the default)
    effort/mMedium: expected under 1 day of work
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 3, 2026
  2. dezren39
    added a parent issue on Nov 3, 2026
    • design(pm-stack): spend rollups — token and dollar attribution per project and per epic, rendered on Projects/Roadmap #1259
  3. github-actions
    assigned
    dezren39
    on Nov 3, 2026
  4. dezren39
    added
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    status/needs-triageNot yet triaged; needs a first look
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 3, 2026
  5. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    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
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane code-c shift
    • Session / ID: task 8447
    • Found via: queue claim (coverage triage)
    • Task: Triage at current main: verify the spend-attribution projection (design(pm-stack): spend rollups — token and dollar attribution per project and per epic, rendered on Projects/Roadmap #1259 slice 1) is not already built, verify its named sources (usage export docs, snapshots store, lane-ledger binding) exist as the design assumes, and route the implementation.
    • Expectation: effort xs — verdict + scoped implementation task enqueued, or closed with evidence if already handled/superseded.
  7. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    on Nov 3, 2026
  8. 5 remaining items

  9. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    queue/queuedHas a queued queue task
    on Nov 3, 2026
  10. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane 9aca43b4-5439-4939-9f71-323f5d32521b
    • Session / ID: task 8769
    • Found via: OpenChamber scheduled lane claim
    • Task: Implement the pure, versioned spend-attribution projection for queue-bound and fleet-worktree sessions, sub-session rollup, unattributed reasons, and reconciliation tests.
    • Expectation: small_fix — verified against issue impl(pm-stack): spend attribution projection — session to issue/epic resolution, unattributed shown (#1259 slice 1) #4822 and its design note; no competing implementation PR found.
  11. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 3, 2026
  12. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane 9aca43b4-5439-4939-9f71-323f5d32521b
    • Session / ID: task 8769
    • Found via: OpenChamber scheduled lane claim
    • Task: Implement the v1 spend attribution projection and reconciliation tests.
    • Outcome: PR feat(pm-stack): project spend attribution facts (#4822) #5164 opened: feat(pm-stack): project spend attribution facts (#4822) #5164 (head d577df915f61669eb09d798c1627f9d2a1409c7d).
    • Verification: targeted test 7/7 and focused strict TypeScript check pass. No PR checks are configured for pm-stack aggregator: the aggregator workflows trigger on main pushes only. Full local suite had 2 existing /api/health assertions fail; full typecheck reports the existing HealthView.conflicts fixture error.
  13. dezren39
    added a commit that references this issue on Nov 8, 2026

    Merge pull request #5164 from developing-today/queue/8769-4822-spend-…

    9e9bb8b
  14. dezren39
    closed this as completedin #5164on Nov 8, 2026
  15. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    PR #5164 (project spend attribution facts) merged 2026-11-08T00:41:47Z (merge commit c2329cf56f57) by queue worker lane code-z under task 11311, after fixing both Codex P2 findings on the PR (provider/model fact splitting; root binding consulted when the root row is outside the source window; bun test test/spend-attribution.test.ts 9 pass). Resolution issue #6912 closed with the full outcome. Leaving #4822 open for its own lifecycle in case the wider #1259 slice set has more to land here.

  16. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    Correction: PR #5164 merge commit is 9e9bb8b (gh api + origin/main log verified), not the SHA in my previous comment. - lane code-z, task 11311

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

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/mMedium: expected under 1 day of workkind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.