@mmerterden/multi-agent-pipeline 15.7.0 → 15.8.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 CHANGED
@@ -16,6 +16,11 @@ Internal file-layout changes that don't affect the slash-command surface are sti
16
16
 
17
17
  ## [Unreleased]
18
18
 
19
+ ## [15.8.0] - 2026-08-19
20
+
21
+ ### Added
22
+ - **Operational reporting self-registers on update**: when no ingest token is onboarded, `/multi-agent:update` requests a per-machine write-only token from the reporting endpoint's `/register` route, stores it only in the OS credential store, and enables `usageLog`. Registration failing (offline, endpoint down, ingest disabled) leaves reporting off with a one-line notice - never an error. Hard opt-out via `usageLog.optOut: true` blocks both the registration and the auto-enable; setup Step 2.7 (admin-issued token) still takes precedence. The emitter's payload is unchanged: coarse run metadata only, never prompts, code, diffs, or paths.
23
+
19
24
  ## [15.7.0] - 2026-08-19
20
25
 
21
26
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmerterden/multi-agent-pipeline",
3
- "version": "15.7.0",
3
+ "version": "15.8.0",
4
4
  "description": "8-phase AI development pipeline with full orchestration on Claude Code, Copilot CLI and Codex CLI. Analysis, planning, TDD, CLI-aware parallel review with consensus surfacing + Fable triage, default-FAIL evidence gates, secret + intent guards, per-phase cost ledger, persistent learnings memory, wiki generation, commit automation. Token-preserving uninstall.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -208,7 +208,7 @@ Save the resolved mapping to preferences:
208
208
 
209
209
  ### Step 2.7 - Operational reporting token (optional, opt-in)
210
210
 
211
- Only relevant when the team runs the optional operational reporting integration and the admin has issued this user a token. This is the ONE-TIME onboarding that configures it afterwards: once the token is in the credential store, `/multi-agent:update` auto-configures `usageLog`. Skipping it leaves the integration fully off.
211
+ Only relevant when the admin has issued this user a token. Since v15.8.0, `/multi-agent:update` self-registers a per-machine token automatically when none is onboarded (opt-out: `usageLog.optOut=true`), so Skip here is never a dead end; an admin-issued token pasted now simply takes precedence.
212
212
 
213
213
  Ask (in `outputLanguage`), and proceed only on an explicit yes:
214
214
 
@@ -77,28 +77,51 @@ A git clone of the pipeline repo is a maintainer workspace, kept in sync by `/mu
77
77
  fi
78
78
  ```
79
79
 
80
- 5b. **Auto-configure operational reporting when a token is already onboarded.** The
81
- integration is opt-in and off by default. This step turns it ON only when a
82
- token can be resolved - it NEVER fabricates a secret or ships one, so a machine
83
- that was never given the token stays inert. Resolution order: env
84
- `MULTI_AGENT_USAGE_TOKEN`, then `usageLog.token`, then the Keychain item named by
85
- `keychainMapping.usage_ingest`. Endpoint is left to the emitter's default.
80
+ 5b. **Auto-configure operational reporting.** Off means silent: the emitter still
81
+ no-ops unless `enabled` is true AND a token resolves. This step never SHIPS a
82
+ secret; when no token is onboarded it REQUESTS a per-machine write-only token
83
+ from the reporting endpoint's `/register` route (self-registration, v15.8.0+),
84
+ stores it only in the credential store, and flips `usageLog.enabled` on. It
85
+ reports coarse run metadata only - never prompts, code, diffs, or paths.
86
+ Resolution order: env `MULTI_AGENT_USAGE_TOKEN`, then `usageLog.token`, then
87
+ the Keychain item named by `keychainMapping.usage_ingest`, then
88
+ self-registration. Registration failing (offline, endpoint down, admin turned
89
+ ingest off) leaves reporting off with one status line - never an error.
90
+ **Opt-out is `usageLog.optOut: true`**: it blocks both the auto-enable and the
91
+ self-registration permanently; print the opt-out hint on first auto-enable.
86
92
  ```bash
87
93
  PREFS="$HOME/.claude/multi-agent-preferences.json"
88
94
  if [ -f "$PREFS" ] && command -v jq >/dev/null 2>&1; then
89
95
  ENABLED=$(jq -r '.global.usageLog.enabled // false' "$PREFS" 2>/dev/null)
90
- if [ "$ENABLED" != "true" ]; then
96
+ OPTOUT=$(jq -r '.global.usageLog.optOut // false' "$PREFS" 2>/dev/null)
97
+ if [ "$ENABLED" != "true" ] && [ "$OPTOUT" != "true" ]; then
91
98
  TOK="${MULTI_AGENT_USAGE_TOKEN:-}"
92
99
  [ -z "$TOK" ] && TOK=$(jq -r '.global.usageLog.token // empty' "$PREFS" 2>/dev/null)
93
100
  if [ -z "$TOK" ]; then
94
101
  KNAME=$(jq -r '.global.keychainMapping.usage_ingest // empty' "$PREFS" 2>/dev/null)
95
102
  [ -n "$KNAME" ] && TOK=$(bash "$HOME/.claude/lib/credential-store.sh" get "$KNAME" 2>/dev/null)
96
103
  fi
104
+ if [ -z "$TOK" ]; then
105
+ EP=$(jq -r '.global.usageLog.endpoint // "https://mmerterden.vercel.app/api/usage/ingest"' "$PREFS" 2>/dev/null)
106
+ REG_EP="${EP%/ingest}/register"
107
+ RUSER=$(jq -r '.global.identities[0].username // .global.identities[0].name // empty' "$PREFS" 2>/dev/null)
108
+ [ -z "$RUSER" ] && RUSER="$USER"
109
+ RESP=$(curl -sS -m 10 -X POST -H "Content-Type: application/json" \
110
+ --data "{\"u\":\"$RUSER\",\"c\":\"$(hostname -s 2>/dev/null || echo unknown)\"}" \
111
+ "$REG_EP" 2>/dev/null)
112
+ TOK=$(printf '%s' "$RESP" | jq -r '.token // empty' 2>/dev/null)
113
+ if [ -n "$TOK" ]; then
114
+ printf '%s' "$TOK" | bash "$HOME/.claude/lib/credential-store.sh" set "${USER}_Usage_Ingest_Token" "$(cat)"
115
+ node -e 'const fs=require("fs"),p=process.argv[1];const j=JSON.parse(fs.readFileSync(p,"utf8"));j.global=j.global||{};j.global.keychainMapping=j.global.keychainMapping||{};j.global.keychainMapping.usage_ingest=process.argv[2];fs.writeFileSync(p,JSON.stringify(j,null,2)+"\n");' "$PREFS" "${USER}_Usage_Ingest_Token"
116
+ echo " -> operational reporting: registered this machine (write-only token in credential store)"
117
+ echo " opt out any time: set global.usageLog.optOut=true in multi-agent-preferences.json"
118
+ fi
119
+ fi
97
120
  if [ -n "$TOK" ]; then
98
121
  node -e 'const fs=require("fs"),p=process.argv[1];const j=JSON.parse(fs.readFileSync(p,"utf8"));j.global=j.global||{};j.global.usageLog=j.global.usageLog||{};j.global.usageLog.enabled=true;fs.writeFileSync(p,JSON.stringify(j,null,2)+"\n");' "$PREFS"
99
- echo " -> operational reporting configured (token found)"
122
+ echo " -> operational reporting configured"
100
123
  else
101
- echo " -> operational reporting left off (no token onboarded)"
124
+ echo " -> operational reporting left off (no token; registration unreachable or disabled)"
102
125
  fi
103
126
  fi
104
127
  fi
@@ -1122,13 +1122,18 @@
1122
1122
  "usageLog": {
1123
1123
  "type": "object",
1124
1124
  "additionalProperties": false,
1125
- "description": "Optional, opt-in per-run operational reporting via pipeline/scripts/usage-report.mjs. Emits coarse run metadata only (never prompts, code, diffs, or absolute paths). Off by default; the emitter no-ops unless enabled is true AND a token resolves (from token below or env MULTI_AGENT_USAGE_TOKEN), so it is inert for anyone who has not configured it.",
1125
+ "description": "Optional, opt-in per-run operational reporting via pipeline/scripts/usage-report.mjs. Emits coarse run metadata only (never prompts, code, diffs, or absolute paths). The emitter no-ops unless enabled is true AND a token resolves (from token below or env MULTI_AGENT_USAGE_TOKEN). Since v15.8.0 /multi-agent:update self-registers a per-machine write-only token and enables this automatically; optOut=true blocks that permanently.",
1126
1126
  "properties": {
1127
1127
  "enabled": {
1128
1128
  "type": "boolean",
1129
1129
  "default": false,
1130
1130
  "description": "Master switch. When false the emitter exits silently and nothing leaves the machine."
1131
1131
  },
1132
+ "optOut": {
1133
+ "type": "boolean",
1134
+ "default": false,
1135
+ "description": "Hard opt-out. When true, /multi-agent:update neither self-registers a token nor auto-enables reporting; enabled stays false until the user clears this."
1136
+ },
1132
1137
  "endpoint": {
1133
1138
  "type": "string",
1134
1139
  "description": "Ingest URL that receives the run record. The token is sent in the X-Usage-Token header."