Skip to content

Papercuts: agent friction journal + Kaizen tab - #689

Merged
nikhilunni merged 6 commits into
mainfrom
papercuts-kaizen
Jul 16, 2026
Merged

nikhilunni merged 6 commits into
mainfrom
papercuts-kaizen

Conversation

@gsdatta

@gsdatta gsdatta commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

What

A first-class papercuts concept (inspired by papercuts.claxx.gg): agents log the small frictions they hit mid-task, and humans triage them in a new Kaizen tab.

  • papercut tool — registered as an ADR 0089 builtin with no capability gate, so every session's manifest carries it. Handler persists summary/description/category/severity/tags stamped with session/task/profile/user from ToolContext.
  • System-prompt guidance — every session's ENGRAM_APPEND_SYSTEM_PROMPT now includes short papercut instructions (log-and-continue, no duplicates, no secrets), merged after extraHarnessEnv so Slack's append coexists.
  • PapercutService (orchestrator-native ConnectRPC): ListPapercuts / ArchivePapercut / UnarchivePapercut.
  • Web: Kaizen top-rail tab → Papercuts page — category/severity/tags badges, profile chip, origin-session link, archive/unarchive with confirm, show-archived toggle, and a "Copy papercut details" action.
  • Replay safety: inserts key on a unique (session_id, tool_call_id) (DBOS steps are at-least-once); replays return the original row's id.

Deliberate scope cuts

  • No ADR (maintainer call).
  • A StartFixTask RPC (one-click fix-it task in the papercut's profile) was built, then removed in favor of copy-details — starting fix work stays a human action in the composer.

Validation

  • Orchestrator: typecheck + 685 bun tests green (handler stamping, manifest inclusion for zero-capability profiles, append-merge with and without Slack, service list/archive, replay idempotency).
  • Web: oxlint + build green.
  • Live on the dev stack: an organically-logged papercut flowed agent → MCP bridge → coordinator → orchestrator consumer → DB with full context stamps, renders in Kaizen, archive round-trips.
  • Rust untouched (papercut.proto is app-contract-only, not in engram-protocol's build list).

🤖 Generated with Claude Code

gsdatta and others added 6 commits July 15, 2026 16:24
Papercuts are small, concrete friction observations agents log mid-task
(ADR 0089 tool protocol will feed them). Table stamps session/task/
profile/user context plus lifecycle (fix_task_id, archived_at).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…structions

Registers a handled/sync 'papercut' builtin (no capability gate, so
compileToolManifest ships it to every profile) whose handler persists
the observation stamped with ToolContext. Every session's
ENGRAM_APPEND_SYSTEM_PROMPT now carries short papercut guidance,
merged AFTER extraHarnessEnv so Slack's append survives alongside it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New engram.app.v1 PapercutService + Papercut message (reuses
ProfileSnapshot for display). TS bindings regenerated via buf for
cli, orchestrator, and web.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…x-task

Native ConnectRPC service over the papercuts store. StartFixTask
composes a canned fix prompt from the papercut, boots a task in the
papercut's profile via createTaskWithSession (owned by the caller),
and links fix_task_id — the papercut stays open until archived by a
human.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New top-rail Kaizen hat with a Papercuts subnav: card rows with
category/severity/tags, profile chip, origin-session link, and a
fix-task badge; archive/unarchive with confirm, show-archived toggle,
and one-click 'Start fix task' that boots a session in the papercut's
profile and navigates to it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…etails

Review follow-ups: tool handlers run under at-least-once DBOS steps, so
the papercut insert now keys on (session_id, tool_call_id) with a
unique index + conflict-tolerant insert returning the existing id on
replay (migration 0022). StartFixTask is removed end to end (proto,
service, store, web) in favor of a 'Copy papercut details' row action —
starting fix work is the human's call from the composer.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped⏩ skipped✅ passedJul 16, 2026, 12:39 AM

@gsdatta
gsdatta requested a review from nikhilunni July 16, 2026 00:45
@nikhilunni
nikhilunni added this pull request to the merge queue Jul 16, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 16, 2026
@nikhilunni
nikhilunni added this pull request to the merge queue Jul 16, 2026
Merged via the queue into main with commit ce9d556 Jul 16, 2026
19 checks passed
@nikhilunni
nikhilunni deleted the papercuts-kaizen branch July 16, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants