Skip to content

feat(papercuts): triage overlay and an agent-facing CLI (show, list, mark) #24

Description

@nohat

Part of #22. Wave 1, independent.

Problem

Stages 3 and 4 of docs/fork/papercuts.md need a place to record what happened to a report: triaged, issue linked, fixed in build X, dismissed, reopened. Today PapercutStatus has five values but only new is ever written (apps/server/src/papercuts/Papercuts.ts:272), there is no way to read one record in full, and the only CLI verb is list (apps/server/src/cli/papercuts.ts). An agent that triages or fixes needs show and mark.

What the code shows

  • The live server owns the record files and writes them atomically (Papercuts.ts:267-288). A second process rewriting those files would race the server and would blur what the client originally sent.
  • listPapercutRecords already reads the directory directly and the CLI works with the server stopped.

Plan

  1. Records stay immutable. Triage state lives in an overlay file <id>.triage.json beside the record. Append-only history: [{ at, status, by, note }], plus optional summary, classification, signature, clusterId, issueUrl, fixedInVersion. Effective status is the latest history entry, else the record's own new. Reversal is appending another entry, so every status is reachable from every other (dismissed is reopenable).
  2. Schema PapercutTriage in packages/contracts/src/papercut.ts, additive.
  3. CLI t3 papercuts:
    • list [--status s] [--since t] [--json] shows effective status.
    • show <id> [--json] prints the whole record and overlay, the screenshot path, and (once feat(papercuts): capture the server's full picture at report time #26 lands) the trace slice path. No redaction: within the loop, agents read everything (decision 2026-10-05).
    • mark <id> <status> [--issue url] [--fixed-in version] [--note text].
    • Works with the server stopped; honors the same home-dir resolution as the existing list.
  4. Overlay writes are atomic and the CLI never touches the .json record or the SQLite database.
  5. A corrupt overlay never hides its record: list shows the record as new and flags the overlay.

Acceptance

  • Tests for overlay merge, append and reversal, a corrupt overlay, a record with no overlay, and mark refusing unknown ids.
  • t3 papercuts show <id> is enough for an agent to start work without opening the data directory by hand.

Surfaces and decisions

  • Server CLI only. Web, desktop, and mobile clients do not read records today; the list view is deferred (see feat(papercuts): a local feedback loop from one-tap report to verified fix #22, "Not now").
  • Agents reach it by running the command. An MCP toolkit (apps/server/src/mcp/toolkits/) is deferred until an agent that cannot run commands needs it.
  • Assumption recorded: no new RPC and no database for triage state; files and a CLI are the smallest model that serves one user.

Related

#22, #26, #29, #30.

No activity

Activity on this issue will appear here.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions