Skip to content

feat(framework): a stored record names the project it came from, so a report can be asked for one #704

Description

@blafourcade

The sink already holds every project on the machine, mixed together, and nothing can separate them. "What did this repository cost this month" cannot be asked.

What is missing, exactly

A stored record carries its tool, its model, its moment, its turn identifier and its step. It carries no project identity. The readers build it from what each tool wrote about a session, and none of them writes a repository.

The run journal knows: session_start carries project_id and project_remote, resolved from the repository the hook fired in. It stops there. Nothing carries it across into the record the sink stores.

That is the whole gap — a fact already established, one hop from where it is needed.

Why it bites

The sink is machine-level by design: it lives under the user's config directory, not per repository, because a session's figures belong to the person and their machine rather than to whichever checkout they happened to be in. The consequence is that a report over any period silently mixes every repository worked on in that period.

Nothing is wrong with the figures. They simply answer a question nobody asked, and there is no way to ask the one people do.

Done when

  • A stored record names the project the session ran in.
  • A report can be asked for one project, and a breakdown by project reconciles to the period's total exactly.
  • A record stored before this change reads as belonging to no known project, rather than being attributed to a guess.
  • Two checkouts of the same repository are one project, or they are deliberately two and that is written down.

Worth deciding, not assuming

What identifies a project. project_id is a directory name today and project_remote a git remote; the first collides across machines, the second is absent for a repository with no remote. Whichever is chosen, a record must say which one it used — the same reason vendor_field exists on the identifier.

Not this

Reporting per person or per team (#656, #661), which needs an identity nothing records yet. This is one field that already exists, carried one hop further.

Activity

  1. added this to the milestone on Aug 22, 2026
  2. moved this from Ideation to In Progress in AIDD Roadmapon Aug 27, 2026
  3. self-assigned this
    on Aug 27, 2026
  4. blafourcade commented on Aug 28, 2026

    @blafourcade
    ContributorAuthor

    The premise this issue argues from is no longer true

    Found by a backlog audit on 2026-08-28. This is In Progress, and its body asserts as present fact that a stored record carries no project identity. It does:

    • cli/src/domain/models/telemetry-sink-record.ts:72 — readonly project_id?: string
    • :134 — aidd.project_id is in the OTLP attribute allowlist, so an export carries it too
    • cli/src/domain/models/cost-report.ts:239 — byProjects
    • Shipped commands: aidd telemetry report --project <id> and --axis project

    A real run confirms it end to end: aidd telemetry report prints a by project section, and a journalled session's session_start line carries project_id alongside project_remote.

    Its four "Done when" bullets therefore read as substantially met while the issue sits in progress. Someone should decide whether anything is genuinely left here, rather than continuing against a premise the code already answered — and if something is left, say which part, because the body no longer identifies it.

  5. blafourcade commented on Sep 2, 2026

    @blafourcade
    ContributorAuthor

    Delivered by #706, squash-merged into next as 627408f.

  6. moved this from In Progress to Done in AIDD Roadmapon Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Fields

Priority

High

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions