agent-orchestrator-kit 0.13.0 β 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +16 -3
- package/bin/agent-orchestrator.js +335 -115
- package/bin/claude-cost-estimate.js +51 -0
- package/bin/spend-collect.js +76 -13
- package/package.json +1 -1
- package/templates/.agents/commands/opsx-propose.md +6 -0
- package/templates/.agents/commands/opsx-review.md +35 -11
- package/templates/.agents/rules/session-handoff.mdc +2 -2
- package/templates/.agents/skills/agent-orchestration/SKILL.md +5 -4
- package/templates/.agents/skills/openspec-propose/SKILL.md +6 -0
- package/templates/.agents/subagents/openspec-guide.md +3 -2
- package/templates/.agents/subagents/session-handoff.md +2 -1
- package/templates/.agents/subagents/spec-architect.md +6 -1
- package/templates/.agents/subagents/spec-archiver.md +2 -1
- package/templates/.agents/subagents/spec-reviewer.md +5 -1
- package/templates/AGENTS.md +1 -1
- package/templates/scripts/cursor-spend-collect.cjs +129 -67
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.14.0] - 2026-09-07
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- **BREAKING: compact metrics schema v2.** Sessions persist `sourceIds`, `sourceTotals`, and `byModel` instead of `sources`; v1 remains readable and `metrics --migrate` performs a schema-only rewrite.
|
|
11
|
+
- Collection now has bounded persist/leftover windows, thread-scoped Amp usage totals and fresh Cost, Claude message dedup/subagent capture, and static Claude/Amp cost estimates.
|
|
12
|
+
- Added `metrics --summary-json` as the aggregate dashboard contract; phase bounds come from `phases.*`, never git history.
|
|
13
|
+
- Kit templates require an exhaustive Tier 2 punch list (full scan before the verdict; schema Checklist / Findings / Required Before Apply / Previous findings). After REQUEST CHANGES the next command is `/opsx:propose`; `openspec-guide` no longer maps RC back to review. Metric: Spec review discovery loops β€ 2.
|
|
14
|
+
|
|
7
15
|
## [0.13.0] - 2026-09-04
|
|
8
16
|
|
|
9
17
|
### Fixed
|
package/README.md
CHANGED
|
@@ -74,7 +74,7 @@ npx agent-orchestrator-kit@latest init --profile generic --ci gitlab --spec-veri
|
|
|
74
74
|
|
|
75
75
|
See [Installation](#installation) for profile/CI options.
|
|
76
76
|
|
|
77
|
-
**π Already have the kit installed? Upgrade to latest (
|
|
77
|
+
**π Already have the kit installed? Upgrade to latest (compact metrics schema v2, exhaustive Tier 2 punch list, bounded collection windows, Claude/Amp estimates, and dashboard JSON in v0.14.0):**
|
|
78
78
|
|
|
79
79
|
```bash
|
|
80
80
|
npx agent-orchestrator-kit@latest update
|
|
@@ -801,13 +801,15 @@ Persist with `runtime: cloud` prints those four steps on stderr; stdout stays th
|
|
|
801
801
|
|
|
802
802
|
Every change accumulates git-tracked `openspec/changes/<name>/metrics.json` β the data source for planning the next feature: how long each phase took, how many sessions it needed, what it cost.
|
|
803
803
|
|
|
804
|
+
Schema v2 stores compact `sourceIds`, `sourceTotals`, and `byModel` per session instead of `sessions[].sources`. This is **BREAKING** for readers of the old event arrays. v1 files are normalized in memory without rewriting; run `npx agent-orchestrator-kit metrics <name> --migrate` for a schema-only rewrite that preserves existing numeric fields and aggregates.
|
|
805
|
+
|
|
804
806
|
- **`## Metrics` self-report** β Session Exit fills `handoff.md` with `platform`, `model`, `input_tokens`, `output_tokens`, `cost_usd`, `amp_credits`, `spend_source` (`unknown` when missing). Persist reads that section; `metrics.json` is the source of truth for what landed. CLI flags do not rewrite the section.
|
|
805
807
|
- **`session.model`** β source product id wins when any collected source has a model; `--model` / `## Metrics: model` / `AOK_MODEL` apply only when sources have no model. Never a Closed role.
|
|
806
808
|
- **Session start** β `handoff --restore` writes a `pending` marker (`startedAt`, expected role).
|
|
807
|
-
- **Session end** β `handoff <name>` closes the pending session
|
|
809
|
+
- **Session end** β `handoff <name>` closes the pending session. Its collect lower bound is `--started-at` or `pending.startedAt` minus 120 seconds; without either it is the previous `endedAt`, or `createdAt` for the first session, with no open-ended scan. Amp usage totals and fresh Cost are authoritative; Claude JSONL is deduplicated by `message.id`, includes subagents, and accepts cwd descendants. Claude uses a versioned Anthropic list-price estimate with cache split; Amp without Cost uses the same model table or the $3/$15 fallback. Estimates never enter billed `costUsd`.
|
|
808
810
|
- **Archive** β successful `archive <name>` always creates or finalizes `metrics.json`, sets `archivedAt`, appends an Archiver session, collects the locked client (Cursor hook / Amp export+usage / Claude JSONL) in `[pending.startedAt, now]` plus leftover of the previous session, and prints the same human summary as `metrics <name>`. `--collect` still runs all three adapters. Leftover apply `## Metrics` that repeats the previous session is ignored so those tokens are not counted twice.
|
|
809
811
|
- **`sessionEnd` leftover** β `scripts/cursor-spend-collect.cjs` also reads the newest `openspec/changes/archive/*-<name>/metrics.json` when the active change folder is gone, so a late hook after archive still attaches. `stop` / `afterAgentResponse` run the same leftover after a successful jsonl append. When `last.threadId` is non-empty, leftover keeps only rows whose `conversationId` matches that id (empty/`null` threadId stays time-only). In a multi-root window leftover walks every candidate that has `openspec/changes`, reading that rootβs jsonl. Aggregates write `costUsdEstimated` with 4 decimal places. Each `phases.<phase>` stores `startedAt` / `endedAt` / `leadTimeMs` from that phaseβs sessions; `durationMs` stays the work-time sum and does not clone `totals.leadTimeMs`.
|
|
810
|
-
- **Leftover without `--collect`** β Scopes to `last.platform` and
|
|
812
|
+
- **Leftover without `--collect`** β Scopes to `last.platform` and Amp thread identity from `threadId` or `sourceIds`. Sessions without a thread id are capped at `endedAt + 120s`; identified sessions may continue to the next pending boundary. Fresh Amp usage totals, Models, and Cost replace cached values.
|
|
811
813
|
- **Cursor `conversationId`** β restore writes `CURSOR_CONVERSATION_ID` into `pending.threadId`; Cursor collect and sessionEnd leftover skip rows whose `conversationId` does not match when a filter id is present (`last.threadId` on leftover).
|
|
812
814
|
- **Canonical role** β `session.role` and `pending.role` store the first known token (`Explorer`, `Architect`, `Spec Reviewer`, `Implementer`, `Archiver`, `Design Intake`); Closed role in `handoff.md` MAY keep a sentence after `β`.
|
|
813
815
|
- **Platform** β `--platform` β `## Metrics: platform` β `AOK_PLATFORM` β **pending client from `--restore`** β host env (Amp / Cursor / Claude Code) β collected sources (`cursor|claude|amp` only). Invalid `--platform` fails before persist/move.
|
|
@@ -834,9 +836,15 @@ npx agent-orchestrator-kit handoff add-thing
|
|
|
834
836
|
npx agent-orchestrator-kit handoff add-thing --collect # optional: Claude JSONL / Amp threads / Cursor hook
|
|
835
837
|
npx agent-orchestrator-kit metrics add-thing # human summary: phases, tokens, cost, roles / models
|
|
836
838
|
npx agent-orchestrator-kit metrics add-thing --json # raw metrics.json (works for archived changes too)
|
|
839
|
+
npx agent-orchestrator-kit metrics add-thing --summary-json # compact dashboard contract
|
|
840
|
+
npx agent-orchestrator-kit metrics add-thing --migrate # rewrite v1 β v2 without numeric recompute
|
|
837
841
|
npx agent-orchestrator-kit archive add-thing --sync # finalize + the same tables as metrics
|
|
838
842
|
```
|
|
839
843
|
|
|
844
|
+
#### ΠΠ»Ρ Π΄Π°ΡΠ±ΠΎΡΠ΄ΡΠ²
|
|
845
|
+
|
|
846
|
+
Use only `phases.<phase>.startedAt`, `endedAt`, and `durationMs` for phase boundaries and duration. Use `totals.leadTimeMs` only for the whole change. Git log MUST NOT be used for phase boundaries; the kit does not provide per-phase commit counts. `metrics <name> --summary-json` returns only aggregate `totals`, `phases`, and spend maps, without sessions or commits.
|
|
847
|
+
|
|
840
848
|
Recording is on by default and never a persist/archive/`gate-check` gate; opt out per persist with `--no-metrics`. Persist and archive collect the locked client without `--collect`; `--collect` runs every adapter. Flags (`--model`, `--platform`, `--input-tokens`, β¦) override session totals in `metrics.json` and do not rewrite the `## Metrics` section.
|
|
841
849
|
|
|
842
850
|
### Skill inventory
|
|
@@ -1007,6 +1015,11 @@ Phase bounds and non-goals: [`openspec/specs/agentic-factory-roadmap/spec.md`](o
|
|
|
1007
1015
|
|
|
1008
1016
|
## Changelog
|
|
1009
1017
|
|
|
1018
|
+
### 0.14.0
|
|
1019
|
+
- **BREAKING: compact metrics schema v2** β sessions persist `sourceIds` / `sourceTotals` / `byModel` instead of `sources`; `metrics --migrate` is schema-only; `metrics --summary-json` for dashboards
|
|
1020
|
+
- Bounded persist/leftover windows, thread-scoped Amp usage + fresh Cost, Claude dedup/subagent capture, static Claude/Amp estimates
|
|
1021
|
+
- Exhaustive Tier 2 punch list in kit templates; after REQUEST CHANGES next command is `/opsx:propose`; Spec review discovery loops β€ 2
|
|
1022
|
+
|
|
1010
1023
|
### 0.13.0
|
|
1011
1024
|
- Amp Cost-once rollup: `Cost: $N` once per qualifying session into `spend` / `spendByPlatform.amp` / `phases` (not ΓN sources; several sessions accumulate)
|
|
1012
1025
|
- Restore without Amp parent locks a fresh `session.json` `lastThreadId` as `amp-session-last`
|