Commit Graph

5 Commits

Author SHA1 Message Date
Oleks 38e1adbd48 Phase 4: boundary rubric skill, offload-analyst agent, calibration gate
references/boundary-rubric.md is design/rubric.md verbatim (4.1).

skills/boundary-rubric is usable standalone on a single step before any code
exists — the rubric is more valuable applied before the fact than after (4.2).

agents/offload-analyst classifies pre-computed inventory/scan JSON, leads with
coverage, treats hook/prose drift as its own category, and enforces the hard
gate: no overrule case -> boundary question, never filed (4.3).

bin/boundary-classify applies rubric §6's confidence table and the FR-4.2 filing
gate. The determinism-test outcomes and the falsifiability triple are inference;
grading them is a lookup, so it is a script rather than agent prose (FR-8.1).

Calibration gate (4.4) passes on real runs:
  - token-budget            -> 0 high-confidence, "nothing to offload here"
  - worktree-discipline with bin/worktree-audit masked out
                            -> worktree-safety classification at high,
                               position llm-over-script-digest

tests/classify.test.sh asserts both gates plus synthetic table cases; 67
assertions green across the suite.
2026-07-29 17:27:17 +03:00
Oleks bdb62da898 Phase 3: dynamic pass (bin/offload-scan), synthetic transcript fixtures, tests
Streams ~/.claude/projects/**/*.jsonl once, filters to turns attributed to the
target plugin (attributionPlugin / attributionSkill / attributionAgent),
de-duplicates by (message.id, requestId) taking max on every usage field, and
computes the spec.md §5.2 dynamic signals: MTR, offload_waste, recurring
tool-signature n-grams, read amplification, retry density, judgment density,
fan-out multiplier, and the composite offload_value — plus the FR-3.4
attribution-coverage headline.

Token and cost arithmetic is taken from token-budget's cc-tokens, never
reimplemented. It is imported as a module rather than shelled out with --json,
because cc-tokens' subcommands aggregate by day/session/project/model and none
can answer "weighted tokens for this set of turns" — the attribution fields are
not on its CLI surface. Its Rec.cost / Rec.weighted still compute every number
here, so the pricing table and cache multipliers keep exactly one home.

Two deviations from design/plan.md §4.1, both because the transcripts say
otherwise: agents attribute via attributionAgent on the subagent sidechain
files, not agentName (which is a separate `type: "agent-name"` line mapping a
session to a display label); and attributionSkill is sometimes bare rather than
plugin-qualified, so it is normalized.

Tool arguments are masked to <path>/<n>/<sha>/<url>/<str> before entering any
emitted structure, and Bash commands are reduced to bare executable words —
FR-3.5, asserted in the suite. Fixtures are synthetic by construction; no real
transcript content is in this repo.

Real-history check: 30-day window over a 1.7 GB history, 94s wall, 29 MB peak
RSS, one process.
2026-07-29 16:58:00 +03:00
Oleks 07b56376fc Tag fenced blocks with language for markdownlint, widen parser fence regex 2026-07-29 15:47:43 +03:00
Oleks caa2a8ccb4 Fix catalog parser (fenced-block extraction) and drop overly strict local markdownlint config 2026-07-29 15:46:39 +03:00
Oleks bf88742bf4 Phase 2: static pass (bin/plugin-inventory), signals catalog, fixture tests 2026-07-29 15:44:10 +03:00