@hybridlabor-api/aos 4.7.1 → 4.7.2

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.
@@ -823,7 +823,7 @@ if (mandatorySkillNames.length > 0) {
823
823
  let message = `--skill named skill(s) that could not be found on this machine: ${missing.join(', ')}. `;
824
824
  if (storeMatches.length > 0) {
825
825
  message += `Found in the AOS / ECC Store: ${storeMatches.join(', ')}. ` +
826
- `Run: aos store install ${storeMatches.join(' ')} ` +
826
+ `Run: aos store install ${storeMatches.join(' ')} --net ` +
827
827
  'Then re-run your startcycle command. ';
828
828
  } else if (near.length > 0) {
829
829
  message += `Did you mean: ${near.join(', ')}? `;
@@ -6,7 +6,7 @@
6
6
  // node bin/aos-doctor.mjs [--json] [--net]
7
7
 
8
8
  import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
9
- import { execFileSync, execSync } from 'node:child_process';
9
+ import { execFileSync } from 'node:child_process';
10
10
  import { connect } from 'node:net';
11
11
  import os from 'node:os';
12
12
  import path from 'node:path';
@@ -49,7 +49,7 @@ const add = (area, name, ok, detail, fix, warningOnly = false) => {
49
49
  };
50
50
 
51
51
  const which = (bin) => {
52
- const probe = IS_WIN ? 'where' : 'which';
52
+ const probe = IS_WIN ? 'where.exe' : 'which';
53
53
  try {
54
54
  return tilde(execFileSync(probe, [bin], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim().split(/\r?\n/)[0]);
55
55
  } catch {
@@ -107,6 +107,26 @@ function checkAosCore() {
107
107
  manifest ? `v${manifest.version || '4.x'} · tier ${manifest.tier || 'full'} · modules: ${(manifest.installedModules || []).join(', ') || 'default'}` : `${manifestPath} missing or unreadable`,
108
108
  'Run the AOS installer: npx @hybridlabor-api/aos@latest');
109
109
 
110
+ // Network version check gated by --net
111
+ if (NET) {
112
+ try {
113
+ const npmBin = IS_WIN ? 'npm.cmd' : 'npm';
114
+ const latest = execFileSync(npmBin, ['view', '@hybridlabor-api/aos', 'version'], {
115
+ encoding: 'utf8',
116
+ timeout: 8000,
117
+ stdio: ['ignore', 'pipe', 'ignore'],
118
+ shell: IS_WIN
119
+ }).trim();
120
+ const currentVer = manifest?.version || '4.7.1';
121
+ add('aos-core', 'Version vs npm', currentVer === latest, `local v${currentVer} · npm v${latest}`,
122
+ 'Run: npx @hybridlabor-api/aos@latest');
123
+ } catch {
124
+ add('aos-core', 'Version vs npm', false, 'npm view failed (offline or network timeout)', 'Re-run with network or omit --net', true);
125
+ }
126
+ } else {
127
+ add('aos-core', 'Version vs npm', true, 'Skipped (offline mode — pass --net to check npm)', '', true);
128
+ }
129
+
110
130
  // Check store index
111
131
  const storeIndexCandidates = [
112
132
  path.join(path.dirname(new URL(import.meta.url).pathname), '..', 'lib', 'ecc-store-index.json'),
@@ -284,7 +304,7 @@ async function checkDaemonsAndModules() {
284
304
  if (IS_MAC && aoBin) {
285
305
  let signed = false;
286
306
  try {
287
- execSync(`codesign -v "${aoBin}"`, { stdio: 'ignore' });
307
+ execFileSync('codesign', ['-v', aoBin], { stdio: 'ignore' });
288
308
  signed = true;
289
309
  } catch {}
290
310
  add('security', 'AO Binary Signature (AMFI)', signed,
package/bin/aos-store.mjs CHANGED
@@ -12,6 +12,7 @@ const index = JSON.parse(readFileSync(INDEX_PATH, 'utf8'));
12
12
  const args = process.argv.slice(2);
13
13
  const dryRun = args.includes('--dry-run');
14
14
  const project = args.includes('--project');
15
+ const net = args.includes('--net');
15
16
  const positional = args.filter((arg) => !arg.startsWith('--'));
16
17
  const option = (name) => args.find((arg) => arg === name || arg.startsWith(`${name}=`))?.split('=').slice(1).join('=');
17
18
 
@@ -121,6 +122,9 @@ async function install(name) {
121
122
  for (const target of targets) console.log(`[dry-run] write ${target}`);
122
123
  return;
123
124
  }
125
+ if (!net) {
126
+ throw new Error(`Downloading '${name}' requires internet access to fetch from upstream GitHub. Pass --net to confirm: aos store install ${name} --net`);
127
+ }
124
128
  const content = await download(item.upstream_path);
125
129
  const digest = createHash('sha256').update(content).digest('hex');
126
130
  if (digest !== item.sha256) throw new Error(`SHA-256 mismatch for ${name}: expected ${item.sha256}, got ${digest}`);
@@ -135,7 +139,7 @@ function usage() {
135
139
  console.log('Usage:');
136
140
  console.log(' aos store list [--type=skills|agents]');
137
141
  console.log(' aos store search <query>');
138
- console.log(' aos store install <name> [--project] [--dry-run]');
142
+ console.log(' aos store install <name> [--project] [--dry-run] [--net]');
139
143
  }
140
144
 
141
145
  async function main() {
package/installer.js CHANGED
@@ -41,7 +41,7 @@ function verifyDaemonListening(port, name, timeoutMs = 4000) {
41
41
  tryConnect();
42
42
  });
43
43
  }
44
- const { execSync, spawn, spawnSync, exec } = require('child_process');
44
+ const { execSync, spawn, spawnSync, exec, execFileSync } = require('child_process');
45
45
  const clack = require('@clack/prompts');
46
46
 
47
47
  const {
@@ -233,8 +233,12 @@ const conditionalMcpConfigKeys = [
233
233
 
234
234
  function hasExecutable(binary) {
235
235
  try {
236
- const lookup = process.platform === 'win32' ? `where ${binary}` : `command -v ${binary}`;
237
- execSync(lookup, { stdio: 'ignore' });
236
+ if (process.platform === 'win32') {
237
+ execFileSync('where.exe', [binary], { stdio: 'ignore' });
238
+ } else {
239
+ if (!/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(binary)) return false;
240
+ execSync(`command -v ${binary}`, { stdio: 'ignore' });
241
+ }
238
242
  return true;
239
243
  } catch (e) {
240
244
  return false;
@@ -250,7 +254,7 @@ function findWindowsGoBin() {
250
254
  if (process.platform !== 'win32') return null;
251
255
  const candidates = [];
252
256
  try {
253
- const found = execSync('where.exe go', { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] })
257
+ const found = execFileSync('where.exe', ['go'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] })
254
258
  .split(/\r?\n/).map(s => s.trim()).find(Boolean);
255
259
  if (found) candidates.push(path.dirname(found));
256
260
  } catch (_) { /* PATH can be stale immediately after installation */ }
@@ -2192,8 +2196,11 @@ async function installOpenWikiVisualizer() {
2192
2196
  // bin dir, so resolve the absolute binary path now instead of relying on PATH at boot.
2193
2197
  let openwikiBin = 'openwiki';
2194
2198
  try {
2195
- const lookup = process.platform === 'win32' ? 'where openwiki' : 'command -v openwiki';
2196
- openwikiBin = execSync(lookup, { encoding: 'utf8' }).split(/\r?\n/)[0].trim() || 'openwiki';
2199
+ if (process.platform === 'win32') {
2200
+ openwikiBin = execFileSync('where.exe', ['openwiki'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).split(/\r?\n/)[0].trim() || 'openwiki';
2201
+ } else {
2202
+ openwikiBin = execSync('command -v openwiki', { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).split(/\r?\n/)[0].trim() || 'openwiki';
2203
+ }
2197
2204
  } catch (e) { logDebug(e, 'openwiki path lookup'); }
2198
2205
 
2199
2206
  // The openwiki CLI is a Node script (#!/usr/bin/env node shebang). Under
@@ -2202,8 +2209,11 @@ async function installOpenWikiVisualizer() {
2202
2209
  // the interpreter itself is baked in as an absolute path.
2203
2210
  let nodeBin = 'node';
2204
2211
  try {
2205
- const lookup = process.platform === 'win32' ? 'where node' : 'command -v node';
2206
- nodeBin = execSync(lookup, { encoding: 'utf8' }).split(/\r?\n/)[0].trim() || 'node';
2212
+ if (process.platform === 'win32') {
2213
+ nodeBin = execFileSync('where.exe', ['node'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).split(/\r?\n/)[0].trim() || 'node';
2214
+ } else {
2215
+ nodeBin = execSync('command -v node', { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).split(/\r?\n/)[0].trim() || 'node';
2216
+ }
2207
2217
  } catch (e) { logDebug(e, 'node path lookup'); }
2208
2218
 
2209
2219
  // Which wiki :4321 serves is per-machine setup configuration, not a
@@ -2444,11 +2454,11 @@ async function installOSAgentWorkspace() {
2444
2454
  }, 'AO cannot be started without its binary.');
2445
2455
 
2446
2456
  try {
2447
- execSync(`codesign -v "${binTarget}"`, { stdio: 'ignore' });
2457
+ execFileSync('codesign', ['-v', binTarget], { stdio: 'ignore' });
2448
2458
  } catch {
2449
2459
  log.warn('The ao binary is not code-signed — AMFI will kill it at launch.');
2450
2460
  try {
2451
- execSync(`codesign -s - -f "${binTarget}"`, { stdio: 'ignore' });
2461
+ execFileSync('codesign', ['-s', '-', '-f', binTarget], { stdio: 'ignore' });
2452
2462
  log.step('Signed it ad-hoc.');
2453
2463
  } catch (e) { log.warn(`Could not sign it: ${e.message}`); }
2454
2464
  }
@@ -2463,12 +2473,12 @@ async function installOSAgentWorkspace() {
2463
2473
  // service definition changes upstream.
2464
2474
  const legacyPlist = path.join(homeDir, 'Library', 'LaunchAgents', 'com.bdb.agent-workspace.plist');
2465
2475
  if (fs.existsSync(legacyPlist)) {
2466
- try { execSync(`launchctl unload "${legacyPlist}" 2>/dev/null`, { stdio: 'ignore' }); } catch (e) { logDebug(e, 'unload legacy ao agent'); }
2476
+ try { execFileSync('launchctl', ['unload', legacyPlist], { stdio: 'ignore' }); } catch (e) { logDebug(e, 'unload legacy ao agent'); }
2467
2477
  try { fs.unlinkSync(legacyPlist); log.step('Removed the old com.bdb.agent-workspace service.'); } catch (e) { logDebug(e, 'remove legacy plist'); }
2468
2478
  }
2469
2479
 
2470
2480
  installStep('register the AO service', () => {
2471
- execSync(`"${binTarget}" service install`, { stdio: 'ignore' });
2481
+ execFileSync(binTarget, ['service', 'install'], { stdio: 'ignore' });
2472
2482
  }, 'Start it by hand with: ao service install');
2473
2483
 
2474
2484
  if (await verifyDaemonListening(3101, 'AO Orchestrator', 8000)) {
@@ -2942,8 +2952,11 @@ async function installMcpsForTarget(paths, ctx) {
2942
2952
 
2943
2953
  let uvPath = 'uv';
2944
2954
  try {
2945
- const whichCmd = process.platform === 'win32' ? 'where uv' : 'which uv';
2946
- uvPath = execSync(whichCmd, { stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim().split(/\r?\n/)[0];
2955
+ if (process.platform === 'win32') {
2956
+ uvPath = execFileSync('where.exe', ['uv'], { stdio: ['ignore', 'pipe', 'ignore'], encoding: 'utf8' }).trim().split(/\r?\n/)[0];
2957
+ } else {
2958
+ uvPath = execSync('command -v uv', { stdio: ['ignore', 'pipe', 'ignore'], encoding: 'utf8' }).trim().split(/\r?\n/)[0];
2959
+ }
2947
2960
  } catch (e) {
2948
2961
  if (fs.existsSync(path.join(homeDir, '.local', 'bin', 'uv'))) uvPath = path.join(homeDir, '.local', 'bin', 'uv');
2949
2962
  else if (fs.existsSync(path.join(homeDir, '.cargo', 'bin', 'uv'))) uvPath = path.join(homeDir, '.cargo', 'bin', 'uv');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hybridlabor-api/aos",
3
- "version": "4.7.1",
3
+ "version": "4.7.2",
4
4
  "description": "AOS — A Curated AI AGENT OS. Optimized agent skills and add-ons like memB, OpenWiki, Heimdall Token Saver, and Godmode architectures.",
5
5
  "main": "installer.js",
6
6
  "engines": {
@@ -52,6 +52,7 @@
52
52
  ".codex-plugin/",
53
53
  ".opencode/",
54
54
  "docs/",
55
+ "!docs/handover/**",
55
56
  "assets/",
56
57
  "skills/",
57
58
  "mcps/",
@@ -52,7 +52,7 @@ const tilde = (p) => (p || '').replace(HOME, '~');
52
52
  // `which` does not exist on native Windows; cmd ships `where`, which prints one
53
53
  // path per line.
54
54
  const which = (bin) => {
55
- const probe = process.platform === 'win32' ? 'where' : 'which';
55
+ const probe = process.platform === 'win32' ? 'where.exe' : 'which';
56
56
  try { return tilde(execFileSync(probe, [bin], { encoding: 'utf8' }).trim().split(/\r?\n/)[0]); } catch { return null; }
57
57
  };
58
58
  const dirCount = (p) => { try { return readdirSync(p, { withFileTypes: true }).filter(d => d.isDirectory()).length; } catch { return 0; } };
@@ -100,7 +100,13 @@ function checkAos() {
100
100
 
101
101
  if (manifest && NET) {
102
102
  try {
103
- const latest = execFileSync('npm', ['view', '@hybridlabor-api/aos', 'version'], { encoding: 'utf8', timeout: 8000 }).trim();
103
+ const npmBin = IS_WIN ? 'npm.cmd' : 'npm';
104
+ const latest = execFileSync(npmBin, ['view', '@hybridlabor-api/aos', 'version'], {
105
+ encoding: 'utf8',
106
+ timeout: 8000,
107
+ stdio: ['ignore', 'pipe', 'ignore'],
108
+ shell: IS_WIN
109
+ }).trim();
104
110
  add('aos', 'version vs npm', manifest.version === latest, `local v${manifest.version} · npm v${latest}`,
105
111
  'npx -y @hybridlabor-api/aos@latest');
106
112
  } catch {
@@ -46,7 +46,7 @@ Reach for `test-driven-development` or `tdd-workflow` on their own when you want
46
46
  When no native AOS skill fits, search the markdown-only ECC store before starting a pipeline:
47
47
 
48
48
  - `aos store search <query>` finds available fallback skills and agents.
49
- - `aos store install <name>` installs a verified item after explicit user action.
49
+ - `aos store install <name> --net` installs a verified item after explicit user action.
50
50
  - `aos store list --type=skills` and `aos store list --type=agents` show the catalogue.
51
51
  - The core remains the trusted AOS skill set; the store is a fallback, not a reason to bypass the startcycle validation.
52
52
  - A missing `--skill` is reported by the dispatcher with the exact install command. It never downloads during a run.
@@ -1,58 +0,0 @@
1
- # agenttrail for AO — waiting questions & GO/Nein handover
2
-
3
- AO (the Go daemon shipped as `@hybridlabor-api/bdb-agent-orchestrator`, binary at `~/.local/bin/ao`) can mirror what the agenttrail live map shows: an agent that waits on the human appears as a question with GO / Nein, and AO surfaces "Needs you" in its own UI — then types the human's decision into the waiting session (approved_plan_go.md:25, :57). agenttrail is the live-map daemon vendored into AOS at `skills/global_config/agenttrail/bin/agenttrail.mjs`, run as `aos-trail`; one daemon per repo, bound to 127.0.0.1 only. This document lists the HTTP surfaces AO may call and the things it must never do. The ask/answer endpoints are the AOS patch defined in production_artifacts/00_execution_plan.md ({#ask-engine}, lines 8-13) and production_artifacts/approved_plan_go.md; `/whoami` and `/model` already exist in the vendored daemon (agenttrail.mjs:583-584, :674-675).
4
-
5
- ## What AO calls
6
-
7
- ### 1. Find the repo's daemon — `GET /whoami`
8
-
9
- Probe `http://127.0.0.1:5330` through `5344` and match `repoPath` against the repo AO is working in — the same pattern the daemon itself uses for boot dedup (agenttrail.mjs:733-741):
10
-
11
- ```sh
12
- curl -s http://127.0.0.1:$p/whoami
13
- # {"project":"aos","port":5330,"repoPath":"/Users/tim/dev/bdb-dev/aos-wt-go"}
14
- ```
15
-
16
- Stop at the first match. If no daemon answers there is nothing to mirror — do not spawn a daemon from AO; the asker's CLI already prints `start: aos-trail . --plan …` on stderr (00_execution_plan.md:5). The `AGENTTRAIL_PORT` env var pins a single port and wins over the probe range (agenttrail.mjs:91).
17
-
18
- ### 2. Read open questions — `GET /model`, `GET /ask/<id>`, `GET /events`
19
-
20
- - `GET /model` carries `asks`: one object per question `{id, question, askedBy, askedAt, expiryAt, status: 'pending' | 'go' | 'deny', decidedAt, by, expired}`. Show every ask, oldest first (`askedAt` ascending — approved_plan_go.md:36).
21
- - `GET /ask/<id>` returns one ask plus the last 10 decisions — the "wer · wann · was" log (00_execution_plan.md:13).
22
- - `GET /events` is the SSE stream; activity ticks carry `asks` too (00_execution_plan.md:10), so AO can mirror live instead of polling.
23
-
24
- A pending question past `expiryAt` flips to `status: 'deny'` with `expired: true` — render it greyed out (abgelaufen), never as a live GO/Nein pair (00_execution_plan.md:52).
25
-
26
- ### 3. Answer — `POST /answer`
27
-
28
- ```sh
29
- curl -s -X POST http://127.0.0.1:$port/answer \
30
- -H 'Content-Type: application/json' \
31
- --data '{"id":"<ask-id>","decision":"go"}' # or "deny"
32
- ```
33
-
34
- - The `content-type` header must be exactly `application/json` — a missing or different header (`text/plain`, JSON with a charset suffix) is rejected (00_execution_plan.md:13).
35
- - The body `{id, decision}` is capped at 4 KB.
36
- - `origin`: browser callers always send it, and it must equal the daemon's own `http://localhost:<port>` or `http://127.0.0.1:<port>`; AO is a local non-browser caller and may omit the header entirely (00_execution_plan.md:51 — the curl above does). If AO sends an `origin`, it must be the daemon's own.
37
- - A valid answer sets the ask's status + `decidedAt` + `by: 'you'` and appends `{question, decision, by, at}` to the timestamped decision log; timeout denials land there too, as `by: 'timeout'` (00_execution_plan.md:13).
38
- - The daemon binds 127.0.0.1 only (agenttrail.mjs:700) and sets no `Access-Control-*` header and no `OPTIONS` handler anywhere in its route chain (agenttrail.mjs:572-689) — that absence is the CSRF protection for the map's browser buttons. AO must not ask for CORS to be relaxed.
39
-
40
- That is the whole surface: AO does not call the daemon's other mutating endpoints (`/spawn`, `/setup`, `/setup-board`, `/hook`) and never writes into the repo — the daemon itself never touches the repo; state lives under `~/.agenttrail` (agenttrail.mjs:307).
41
-
42
- ## What the answer means
43
-
44
- `aos-trail ask "<question>"` blocks until the question is answered or expires and exits 0 on go, 1 on deny/timeout (00_execution_plan.md:5). The default deadline is 30 minutes, overridable per question via the asker's `--timeout <10s|30m|2h|N>`; expiry auto-denies and is logged like a human decision (00_execution_plan.md:52). Questions and the decision log persist across daemon restarts in `~/.agenttrail/<repo-hash>.json` (agenttrail.mjs:308).
45
-
46
- ## Mirroring in AO's UI
47
-
48
- - Pending ask → a pinned "Needs you" card with the question, the asking agent (`askedBy`), elapsed time, and one GO and one Nein button.
49
- - AO answers `POST /answer` only after the human clicked or said the decision for that exact ask id, and only then may it type that decision into the waiting session (approved_plan_go.md:57 — AO already recognizes "Needs You GO" and can write to the terminal, :25).
50
- - Re-check `GET /ask/<id>` immediately before typing: the human may have answered on the map instead, or the question may have expired meanwhile.
51
-
52
- ## Hard rules
53
-
54
- - The AO button never authorizes `git push`, `npm publish`, `npm version` or recursive `rm` (approved_plan_go.md:30). Those four stay under go-gate's sole authority (`.claude/hooks/go-gate.mjs:43-49`), which opens only for the literal, human-typed `GO` as the last message in the session transcript (go-gate.mjs:10-13, transcript-only check in main() :116-151). The ask/answer flow only resolves explicit `aos-trail ask` questions and never writes to any session transcript — the map and AO remain "an observer and an answer relay, never a permission system" (00_execution_plan.md:50, approved_plan_go.md:49).
55
- - Never answer without the human. No batching, no defaults, no "the agent seemed sure" — one answer per explicit human decision, per question id.
56
- - Never auto-retry a timed-out question. Expiry → deny is final (`by: 'timeout'` in the log); only the human asking again starts a new question (approved_plan_go.md:57; the same "no silent retries / a fresh GO per action" rule the gate runs on, go-gate.mjs:13).
57
- - Never read `~/.agenttrail/<repo-hash>.json` or anything else inside `~/.agenttrail/` directly (agenttrail.mjs:307-308). Those files are internal state with no format contract — use the HTTP surfaces above.
58
- - Keep the CSRF contract intact: exact `Content-Type: application/json`, own-or-absent `origin`, and never relay an answer through web content the agent loaded.
@@ -1,51 +0,0 @@
1
- # deja for AO — session-memory handover
2
-
3
- AO (the Go daemon shipped as `@hybridlabor-api/bdb-agent-orchestrator`, binary at `~/.local/bin/ao`) can ask deja — the local session-memory engine installed together with memB by the AOS installer — for project history. This document lists the surfaces AO may call and the two things it must not do. Every command below is verified against deja-vu 0.21.1.
4
-
5
- ## What AO calls at session start
6
-
7
- Run in the project directory:
8
-
9
- ```sh
10
- deja wip --json
11
- ```
12
-
13
- The answer is what the last session in that directory was doing (deja-vu docs/json-output.md:1192-1223):
14
-
15
- ```json
16
- {
17
- "schema_version": 2,
18
- "session": "ses_fb76fff…",
19
- "harness": "opencode",
20
- "asked": "the orders worker is exhausting its database connections under load",
21
- "decision": "bound every orders-worker query with a context",
22
- "files": ["internal/worker/orders.go"],
23
- "command": "go test ./internal/worker/...",
24
- "command_failed": true,
25
- "lines": ["working on: …", "settled: …"]
26
- }
27
- ```
28
-
29
- - `schema_version: 2` is the only guaranteed field. Every other field is optional and omitted when the transcript does not carry it — treat all of them as nullable.
30
- - `lines` is the inject-verbatim form: one string per fact, in display order. A caller that wants to show the digest reads `lines` and does not re-assemble the fields.
31
-
32
- ## Untrusted historical data
33
-
34
- Everything deja returns is transcript-derived and may carry text an attacker influenced: a directive copied from a web page persists in the index and replays into later sessions. deja-vu wraps its own agent-facing recall in `<deja-recall>` markers with an untrusted-data preamble (deja-vu docs/SECURITY-MODEL.md:235-245). AO must label or wrap the content the same way before it reaches a model, and instructions inside it must not be followed.
35
-
36
- ## Other surfaces AO may use
37
-
38
- - `deja fix "<error>" --json` — what this machine ran after that error. Rows carry `command` or `edit`; `candidate: true` marks ran-next-but-unconfirmed evidence, not a guaranteed fix (deja-vu docs/json-output.md:763).
39
- - `deja last --json` — recent session metadata, never message bodies (deja-vu docs/json-output.md:200).
40
- - `deja handoff [id-prefix]` — the handoff digest for a session (deja-vu CLI reference, docs/guide/commands.html).
41
- - `deja blame <path> --json` — which sessions discussed a file; a top-level JSON array, no envelope (deja-vu docs/json-output.md:1107).
42
- - `deja doctor --json --offline` — index and store health; `--offline` keeps the version check off the network (deja-vu docs/json-output.md:356).
43
-
44
- ## Stability contract
45
-
46
- Envelope-shaped answers carry `schema_version: 2`. Within a version, changes are additive only: existing field names, types and meanings stay the same. Bumping the version signals a breaking change, so branch on `schema_version` before parsing the rest of the envelope (deja-vu docs/json-output.md:7-28). `deja blame --json` returns a bare array and carries no version; its element shapes are stable.
47
-
48
- ## Hard rules
49
-
50
- - Never read `~/.cache/deja/index.db` or anything else inside the index directory (`manifest.gob`, `sessions.gob`, `records.bin`, the buckets, the sidecars) directly. The format has moved forty-odd times and is explicitly not a contract (deja-vu docs/INTEGRATING.md:102-106). Use the CLI surfaces above.
51
- - AO must NOT run `deja install --auto` and must not wire session-start auto-recall. The approved AOS plan rules both out (production_artifacts/approved_plan_deja.md:61-66): a second writer into agent configs, and old history injected automatically at every session start, are exactly the injection vectors AOS installed deja to avoid. AO calls the `deja` CLI itself, on demand, in the project directory.