Skip to content

Commit aa01aeb

Browse files
authored
Merge pull request #75 from qwerfunch/feat/v0.15.7-token-measurement
feat: v0.15.7 — LLM token tracking infrastructure (F-172)
2 parents be1ac4d + 00afc4b commit aa01aeb

37 files changed

Lines changed: 980 additions & 68 deletions

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"name": "harness-boot",
1212
"description": "Multi-agent development harness for Claude Code. Your AI has speed; we give it direction — through living specs and focused specialist agents.",
1313
"source": "./",
14-
"version": "0.15.6",
14+
"version": "0.15.7",
1515
"homepage": "https://github.com/qwerfunch/harness-boot",
1616
"category": "development"
1717
}

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "harness-boot",
3-
"version": "0.15.6",
3+
"version": "0.15.7",
44
"description": "Multi-agent development harness for Claude Code. Your AI has speed; we give it direction — through living specs and focused specialist agents.",
55
"author": {
66
"name": "qwerfunch"

.harness/spec.archive.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6037,3 +6037,47 @@ features:
60376037
- "AC-6: Project mode default unchanged (product). A new test asserts
60386038
skeleton-only output has no `project.mode` set (falls through to
60396039
DEFAULT_MODE='product')."
6040+
- id: F-172
6041+
description: |-
6042+
Direct response to the v0.15.6 post-release verification gap.
6043+
The user's real question — "harness vs 그냥 Claude — 작업
6044+
퀄리티 결과물, 토큰 소비량" — could not be answered because
6045+
`src/init/tokenLog.ts::recordLlmCall` only fires in init
6046+
scenarios. General `harness work` cycles never record LLM
6047+
usage, so we have zero data on per-cycle token consumption
6048+
across the 162 done features.
6049+
6050+
v0.15.7 closes that gap with three additions:
6051+
1. `harness token --in <num> --out <num> --model <id>` CLI —
6052+
deterministic write into events.log via the existing
6053+
`recordLlmCall` helper. Caller-provided values (manual
6054+
self-report or hook-driven auto-capture).
6055+
2. `harness metrics` JSON output adds `tokens_input_total`,
6056+
`tokens_output_total`, `llm_call_count`, and a per-model
6057+
breakdown — aggregated from `llm_call` events.
6058+
3. Dashboard surfaces cumulative tokens for the active feature
6059+
when any llm_call event exists.
6060+
6061+
Phase 3 work (A/B case study comparing harness vs vanilla
6062+
Claude on the same task) becomes feasible once this lands —
6063+
the measurement plumbing is the gating dependency.
6064+
acceptance_criteria:
6065+
- "AC-1: `harness token --in <num> --out <num> --model <id> [--feature
6066+
F-N] [--kind <subagent|user>]` writes a single `llm_call` event to
6067+
events.log via `recordLlmCall`. Required flags: --in, --out, --model."
6068+
- "AC-2: `harness metrics --json` adds `tokens_input_total`,
6069+
`tokens_output_total`, `llm_call_count`, and `tokens_by_model:
6070+
{<model_id>: {in, out, calls}}` aggregated from `llm_call` events in the
6071+
window."
6072+
- "AC-3: Dashboard active block renders an extra line `tokens: <total_in>
6073+
in / <total_out> out (<calls> calls)` when the active feature has ≥ 1
6074+
llm_call event. Hidden otherwise."
6075+
- "AC-4: Invalid input (non-integer tokens, empty model, etc.) exits with
6076+
status 3 and a clear error message."
6077+
- "AC-5: Tests cover the CLI happy path, metrics aggregation (single +
6078+
multi-model), dashboard render condition (on/off), and the
6079+
input-validation rejections."
6080+
- "AC-6: Documentation — `commands/work.md` (sidecar mention) or a new
6081+
`commands/token.md` short note explaining manual self-report flow.
6082+
Slash-command UX stays out of scope (TS CLI surface only; hook
6083+
automation is a follow-up)."

.harness/spec.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,6 +2004,19 @@ features:
20042004
test_strategy: tdd
20052005
digest: 'Direct response to the user motive surfaced after the v0.15.5
20062006
multi-aspect verification: "모든 것은 사용자가 요청하는 것이 아니라, 내부적...'
2007+
- id: F-172
2008+
name: work cycle LLM token tracking — measurement infrastructure
2009+
type: feature
2010+
status: planned
2011+
release_target: v0.15.7
2012+
modules:
2013+
- cli_token
2014+
- token_log
2015+
- metrics
2016+
- dashboard
2017+
test_strategy: tdd
2018+
digest: Direct response to the v0.15.6 post-release verification gap. The user's
2019+
real question — "harness vs 그냥 Claude — 작업 퀄...
20072020
goals: []
20082021
constraints:
20092022
tech_stack:

.harness/state.yaml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3941,8 +3941,50 @@ features:
39413941
author: human
39423942
started_at: 2026-05-13T02:20:23Z
39433943
completed_at: 2026-05-13T02:29:52Z
3944+
- id: F-172
3945+
status: done
3946+
gates:
3947+
gate_0:
3948+
last_result: pass
3949+
ts: 2026-05-13T03:07:07Z
3950+
note: "cmd: npm test"
3951+
gate_1:
3952+
last_result: pass
3953+
ts: 2026-05-13T03:07:08Z
3954+
note: "cmd: npm run typecheck"
3955+
gate_2:
3956+
last_result: pass
3957+
ts: 2026-05-13T03:07:09Z
3958+
note: "cmd: npm run lint"
3959+
gate_5:
3960+
last_result: pass
3961+
ts: 2026-05-13T03:07:10Z
3962+
note: "cmd: bash self_check.sh"
3963+
evidence:
3964+
- ts: 2026-05-13T03:07:07Z
3965+
kind: gate_run
3966+
summary: "Gate gate_0 pass (1.7s) · cmd: npm test"
3967+
author: llm
3968+
- ts: 2026-05-13T03:07:08Z
3969+
kind: gate_run
3970+
summary: "Gate gate_1 pass (0.9s) · cmd: npm run typecheck"
3971+
author: llm
3972+
- ts: 2026-05-13T03:07:09Z
3973+
kind: gate_run
3974+
summary: "Gate gate_2 pass (1.6s) · cmd: npm run lint"
3975+
author: llm
3976+
- ts: 2026-05-13T03:07:10Z
3977+
kind: gate_run
3978+
summary: "Gate gate_5 pass (0.5s) · cmd: bash self_check.sh"
3979+
author: llm
3980+
- ts: 2026-05-13T03:07:10Z
3981+
kind: test
3982+
summary: F-172 token tracking infrastructure — harness token CLI + LlmCallEvent.feature 확장 + scenario=work · metrics.tokens 누적 + per-model breakdown · dashboard token_line · 862/862 tests + 9 new (5 tokenLog · 2 metrics · 2 dashboard) · 실증 4 시나리오 (CLI happy + metrics 집계 + dashboard 표시 + invalid input 차단)
3983+
author: human
3984+
started_at: 2026-05-13T03:07:38Z
3985+
completed_at: 2026-05-13T03:07:39Z
39443986
session:
39453987
started_at: 2026-04-23T13:02:49Z
3946-
last_command: /harness:work F-171
3988+
last_command: /harness:work F-172
39473989
last_gate_passed: gate_5
39483990
active_feature_id: null

CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,52 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versio
1111

1212
### Queued
1313

14+
## [0.15.7] — 2026-05-13
15+
16+
**LLM token tracking infrastructure.** The v0.15.6 verification cycle
17+
surfaced a measurement gap: the user's real question — "harness vs
18+
그냥 Claude — 작업 퀄리티 결과물, 토큰 소비량" — could not be
19+
answered because `recordLlmCall` only fired in init scenarios.
20+
General `harness work` cycles never recorded LLM usage, so the
21+
plugin had zero data on per-cycle token consumption across 162+
22+
done features. v0.15.7 closes the plumbing so the next-cycle A/B
23+
case study (vanilla Claude vs harness on the same task) becomes
24+
actually measurable.
25+
26+
### Added
27+
28+
- **F-172** — `harness token --in <num> --out <num> --model <id>
29+
[--feature F-N] [--kind <subagent|user>]` CLI writes a single
30+
`llm_call` event via the existing `recordLlmCall` helper.
31+
`--in` / `--out` validated as non-negative integers (exit 3 on
32+
invalid). `--model` required.
33+
- **F-172**`LlmCallEvent` extended: `scenario` union now includes
34+
`'work'`, plus an optional `feature` field. Backward-compat:
35+
existing init callsites work unchanged.
36+
- **F-172**`MetricsReport.tokens` adds `input_total` +
37+
`output_total` + `call_count` + per-model `by_model` breakdown.
38+
Aggregated from `llm_call` events in the metrics window.
39+
- **F-172** — Dashboard renders `tokens: X in / Y out (N calls)`
40+
line on the active feature when llm_call events exist; hidden on
41+
fresh projects.
42+
43+
### Tests
44+
45+
- 854 → 862 (9 new: 5 tokenLog parity · 2 metrics aggregation · 2
46+
dashboard render condition).
47+
- Empirical: 4 scenarios reproduced (CLI happy / metrics aggregation
48+
/ dashboard visibility / invalid input rejection).
49+
50+
### Follow-up (not in this release)
51+
52+
- Hook automation — auto-capture token usage from Claude Code
53+
session boundaries (`SessionEnd` hook or message-level capture).
54+
Currently requires manual self-report via `harness token`.
55+
- Phase 3 A/B case study — same task built two ways
56+
(vanilla Claude vs harness) with this measurement plumbing in
57+
place. Outcome metrics (code quality + token cost) finally
58+
comparable.
59+
1460
## [0.15.6] — 2026-05-13
1561

1662
**Starter automation.** Direct response to the user motive surfaced

README.ko.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
77
Claude Code 위에서 도는 multi-agent 개발 하네스. 다른 AI 도구가 *능력* 을 더할 때, harness-boot 는 *방향* 을 만듭니다.
88

9-
[![plugin](https://img.shields.io/badge/plugin-v0.15.6-blue)](.claude-plugin/plugin.json)
10-
[![tests](https://img.shields.io/badge/tests-854%20passing-brightgreen)](tests/parity)
9+
[![plugin](https://img.shields.io/badge/plugin-v0.15.7-blue)](.claude-plugin/plugin.json)
10+
[![tests](https://img.shields.io/badge/tests-862%20passing-brightgreen)](tests/parity)
1111
[![license](https://img.shields.io/badge/license-MIT-lightgrey)](LICENSE)
1212

1313
---

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
77
harness-boot is a multi-agent development harness for Claude Code. Where most AI tools add *capability*, we add *focus*.
88

9-
[![plugin](https://img.shields.io/badge/plugin-v0.15.6-blue)](.claude-plugin/plugin.json)
10-
[![tests](https://img.shields.io/badge/tests-854%20passing-brightgreen)](tests/parity)
9+
[![plugin](https://img.shields.io/badge/plugin-v0.15.7-blue)](.claude-plugin/plugin.json)
10+
[![tests](https://img.shields.io/badge/tests-862%20passing-brightgreen)](tests/parity)
1111
[![license](https://img.shields.io/badge/license-MIT-lightgrey)](LICENSE)
1212

1313
---

0 commit comments

Comments
 (0)