@aiwg/cli 2026.11.1 → 2026.11.3

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.
Files changed (120) hide show
  1. package/agentic/code/addons/aiwg-hooks/canonical/aiwg-prompt-discovery.yaml +9 -0
  2. package/agentic/code/addons/aiwg-hooks/hooks/aiwg-prompt-discovery.cjs +136 -0
  3. package/agentic/code/providers/capability-matrix.yaml +2 -2
  4. package/agentic/code/providers/model-capabilities.v1.json +44 -39
  5. package/agentic/code/providers/model-catalog.v1.json +3 -3
  6. package/dist/src/artifacts/cli.js +10 -11
  7. package/dist/src/artifacts/discover-cli-help.js +25 -0
  8. package/dist/src/artifacts/discover-session-facets.js +2 -1
  9. package/dist/src/artifacts/fortemi-core-prebuilt-freshness.js +28 -0
  10. package/dist/src/artifacts/fortemi-core-sync.js +3 -0
  11. package/dist/src/artifacts/framework-capabilities.js +4 -0
  12. package/dist/src/artifacts/framework-source-digest.js +1 -1
  13. package/dist/src/artifacts/index-builder.js +10 -10
  14. package/dist/src/artifacts/index-dependencies.js +72 -0
  15. package/dist/src/artifacts/query-engine-discover-output.js +13 -5
  16. package/dist/src/artifacts/query-engine-discover.js +49 -21
  17. package/dist/src/artifacts/query-engine-entries.js +56 -2
  18. package/dist/src/artifacts/query-engine-options.js +14 -1
  19. package/dist/src/artifacts/query-engine-scoring.js +8 -4
  20. package/dist/src/artifacts/query-engine-show-card.js +2 -0
  21. package/dist/src/artifacts/query-engine-show-load.js +1 -1
  22. package/dist/src/artifacts/query-engine-show.js +3 -1
  23. package/dist/src/artifacts/query-engine-templates.js +33 -0
  24. package/dist/src/artifacts/query-engine-verbose.js +25 -0
  25. package/dist/src/artifacts/relations-builder.js +49 -4
  26. package/dist/src/artifacts/relations.js +9 -0
  27. package/dist/src/artifacts/template-references.js +42 -0
  28. package/dist/src/artifacts/types.js +1 -1
  29. package/dist/src/cli/handlers/bundle-reconciliation.js +7 -3
  30. package/dist/src/cli/handlers/checkpoint-handoff.js +48 -0
  31. package/dist/src/cli/handlers/checkpoint-record.js +20 -0
  32. package/dist/src/cli/handlers/checkpoint.js +50 -17
  33. package/dist/src/cli/handlers/dataset.js +17 -0
  34. package/dist/src/cli/handlers/decision.js +1 -1
  35. package/dist/src/cli/handlers/doctor-args.js +3 -1
  36. package/dist/src/cli/handlers/doctor-help.js +2 -1
  37. package/dist/src/cli/handlers/help.js +1 -1
  38. package/dist/src/cli/handlers/refresh-bundles.js +2 -1
  39. package/dist/src/cli/handlers/refresh-managed-deployment.js +196 -0
  40. package/dist/src/cli/handlers/refresh.js +10 -2
  41. package/dist/src/cli/handlers/subcommands-discovery.js +8 -1
  42. package/dist/src/cli/handlers/use.js +26 -5
  43. package/dist/src/cli/services/deployment-verification.js +11 -7
  44. package/dist/src/config/decision-config.js +2 -1
  45. package/dist/src/config/jev-credential-reference.js +56 -0
  46. package/dist/src/config/user-config.js +13 -19
  47. package/dist/src/config/worker-write.js +4 -10
  48. package/dist/src/decision/ask.js +3 -2
  49. package/dist/src/decision/jev-credentials.js +22 -0
  50. package/dist/src/decision/ledger.js +15 -15
  51. package/dist/src/decision/offload.js +7 -8
  52. package/dist/src/decision/openbao-kv-resolver.mjs +96 -0
  53. package/dist/src/decision/openbao-runtime.js +101 -0
  54. package/dist/src/delivery/pr.js +2 -0
  55. package/dist/src/delivery/template-sections.js +56 -0
  56. package/dist/src/extensions/claude-hooks-installer.js +61 -53
  57. package/dist/src/extensions/managed-hook-script-state.js +48 -0
  58. package/dist/src/extensions/muse-managed-hooks.js +49 -0
  59. package/dist/src/issues/cli.js +3 -0
  60. package/dist/src/issues/external-cli.js +4 -1
  61. package/dist/src/issues/live.js +9 -2
  62. package/dist/src/issues/local.js +5 -1
  63. package/dist/src/issues/tracker-policy.js +11 -1
  64. package/dist/src/mcp/json-document.d.mts +2 -0
  65. package/dist/src/models/model-capabilities.v1.json +44 -39
  66. package/dist/src/models/model-catalog.v1.json +3 -3
  67. package/dist/src/models/provider-policy.js +8 -0
  68. package/dist/src/models/worker-health-readiness.js +20 -4
  69. package/dist/src/models/worker-health-snapshot.js +29 -0
  70. package/dist/src/models/worker-installation.d.mts +5 -1
  71. package/dist/src/models/worker-installation.mjs +11 -5
  72. package/dist/src/models/worker-qualification-policy.js +54 -0
  73. package/dist/src/providers/capability-matrix.yaml +2 -2
  74. package/dist/src/providers/skill-ownership.d.mts +1 -0
  75. package/dist/src/providers/transformation-receipt-integration.js +4 -2
  76. package/dist/src/providers/transformation-receipt.js +4 -2
  77. package/dist/src/serve/worker-invocation.js +4 -2
  78. package/dist/src/smiths/context-pipeline/workspace-audit.js +34 -17
  79. package/dist/src/smiths/context-pipeline/workspace-context-shared.js +12 -6
  80. package/dist/src/smiths/context-pipeline/workspace-doctor.js +48 -4
  81. package/dist/src/smiths/context-pipeline/workspace-document.js +5 -2
  82. package/dist/src/smiths/context-pipeline/workspace-migration.js +2 -1
  83. package/dist/src/smiths/hook-bridge/codex-translator.js +150 -94
  84. package/dist/src/smiths/hook-bridge/codex-trust.js +50 -0
  85. package/dist/src/smiths/hook-bridge/factory-hook-config.js +132 -0
  86. package/dist/src/smiths/hook-bridge/factory-translator.js +88 -33
  87. package/dist/src/smiths/hook-bridge/factory-trust.js +56 -0
  88. package/dist/src/smiths/hook-bridge/index.js +3 -3
  89. package/dist/src/smiths/hook-bridge/loader.js +10 -2
  90. package/dist/src/smiths/hook-bridge/prompt-discovery-gaps.js +0 -1
  91. package/dist/src/storage/workspace-permissions-health.js +64 -0
  92. package/dist/src/storage/workspace-permissions.js +51 -0
  93. package/package.json +6 -1
  94. package/tools/agents/providers/base-files.mjs +2 -1
  95. package/tools/agents/providers/base-flat-artifacts.mjs +6 -3
  96. package/tools/agents/providers/base-models-platforms.mjs +3 -3
  97. package/tools/agents/providers/base-skill-copy.mjs +2 -0
  98. package/tools/agents/providers/bound-rules-pointer.mjs +21 -0
  99. package/tools/agents/providers/claude-post-deploy.mjs +9 -5
  100. package/tools/agents/providers/codex-post-deploy.mjs +10 -0
  101. package/tools/agents/providers/factory-hooks.mjs +43 -0
  102. package/tools/agents/providers/factory.mjs +4 -91
  103. package/tools/agents/providers/muse-hooks.mjs +4 -43
  104. package/tools/agents/providers/muse-prompt-discovery.mjs +3 -7
  105. package/tools/agents/providers/packaged-codex-agents.mjs +48 -0
  106. package/tools/agents/providers/rule-delivery-surface.mjs +4 -4
  107. package/tools/agents/providers/rule-presentation.mjs +6 -5
  108. package/tools/agents/providers/rule-projection.mjs +10 -2
  109. package/tools/agents/providers/rule-startup.mjs +8 -1
  110. package/tools/cli/decision-offload-report.mjs +9 -2
  111. package/tools/plugin/issue-template-copies.mjs +24 -0
  112. package/tools/plugin/package-plugins.mjs +17 -4
  113. package/tools/ralph-external/lib/claude-adapter.mjs +2 -2
  114. package/tools/ralph-external/lib/factory-adapter.mjs +7 -8
  115. package/tools/ralph-external/lib/worker-artifacts.mjs +4 -2
  116. package/tools/ralph-external/lib/worker-final.mjs +43 -8
  117. package/tools/ralph-external/lib/worker-launch-cli.mjs +10 -1
  118. package/tools/ralph-external/lib/worker-prompt.mjs +35 -0
  119. package/tools/ralph-external/lib/worker-run-directory-refusal.mjs +8 -0
  120. package/tools/ralph-external/session-launcher.mjs +10 -7
@@ -0,0 +1,9 @@
1
+ id: aiwg-prompt-discovery
2
+ description: Bounded prompt-time capability candidates and show/rules/apply guidance
3
+ events: [UserPromptSubmit]
4
+ command: node
5
+ args: ['$AIWG_ROOT/agentic/code/addons/aiwg-hooks/hooks/aiwg-prompt-discovery.cjs']
6
+ timeout: 2
7
+ # These bridges map an event but cannot deliver additionalContext to the model.
8
+ # Muse uses its project hook owner; Claude uses claude-hooks-installer.
9
+ degrade-on: [hermes, copilot, grok-build]
@@ -0,0 +1,136 @@
1
+ #!/usr/bin/env node
2
+ // Inject bounded capability discovery at prompt time; errors always fail open.
3
+ const fs = require('node:fs');
4
+ const path = require('node:path');
5
+ const { pathToFileURL } = require('node:url');
6
+ const { Worker } = require('node:worker_threads');
7
+
8
+ const configured = Number(process.env.AIWG_PROMPT_DISCOVERY_TIMEOUT_MS || 1500);
9
+ const budget = Number.isFinite(configured) && configured > 0 ? Math.min(configured, 10000) : 1500;
10
+ const deadline = Date.now() + budget;
11
+ let worker;
12
+ const finish = () => {
13
+ if (worker) void worker.terminate();
14
+ process.exit(0);
15
+ };
16
+ // Covers stdin, runtime lookup, imports, index loading, ranking and output.
17
+ setTimeout(finish, budget);
18
+ process.stdout.on('error', finish);
19
+
20
+ function runtimeModule() {
21
+ const roots = process.env.AIWG_ROOT ? [process.env.AIWG_ROOT] : [];
22
+ if (!roots.length) {
23
+ for (const dir of (process.env.PATH || '').split(path.delimiter)) {
24
+ if (!dir) continue;
25
+ try { roots.push(path.dirname(path.dirname(fs.realpathSync(path.join(dir, 'aiwg'))))); }
26
+ catch { /* This PATH entry has no AIWG executable. */ }
27
+ }
28
+ }
29
+ for (const root of roots) {
30
+ const modulePath = path.join(root, 'dist/src/artifacts/query-engine-discover.js');
31
+ if (fs.existsSync(modulePath)) return pathToFileURL(modulePath).href;
32
+ }
33
+ return null;
34
+ }
35
+
36
+ function shouldDiscover(prompt) {
37
+ if (!prompt || /^\/[a-z][\w:-]*(?:[ \t]+[^\n]*)?$/i.test(prompt)) return false;
38
+ if (/^\[SYSTEM NOTIFICATION - NOT USER INPUT\]/i.test(prompt)
39
+ || /<(?:task-notification|system-reminder|tool[_-]result)(?=[\s>])/i.test(prompt)) return false;
40
+ const words = prompt.split(/\s+/);
41
+ // Short action requests still qualify; bare acknowledgements/options do not.
42
+ const imperative = /\b(add|apply|audit|build|check|create|debug|delete|deploy|describe|disable|document|enable|explain|fetch|find|fix|generate|help|implement|inspect|install|list|look|make|read|refactor|remove|rename|repair|research|review|run|search|set|show|summarize|test|trace|update|use|validate|verify|write)\b/i;
43
+ return words.length >= 4 || imperative.test(prompt);
44
+ }
45
+
46
+ function contextFor(envelope, prompt) {
47
+ const clean = (value, max) => typeof value === 'string'
48
+ ? value.replace(/[\x00-\x1f\x7f]/g, ' ').replace(/[*_]/g, '').replace(/\s+/g, ' ').trim().slice(0, max) : '';
49
+ const prefix = 'AIWG candidates:\n';
50
+ const next = '\nFirst call: aiwg show <type> <name> (best fit) -> rules (--rules --with-rule-bodies; --body) -> apply.'
51
+ + '\nIf none fit, run aiwg discover; never decline without it.';
52
+ const candidates = (Array.isArray(envelope?.results) ? envelope.results : [])
53
+ .filter(r => typeof r?.score === 'number' && Number.isFinite(r.score) && r.score >= 0.20
54
+ && /^[a-z][a-z-]{0,19}$/.test(r.type) && /^[a-zA-Z0-9][a-zA-Z0-9_.:-]{0,69}$/.test(r.name))
55
+ .sort((a, b) => b.score - a.score).slice(0, 3);
56
+ const template = candidates.find(candidate => candidate.templates?.length)?.templates?.[0];
57
+ const templateHint = template && /^[a-zA-Z0-9][a-zA-Z0-9_.:-]{0,69}$/.test(template.name)
58
+ && /^aiwg show template [a-zA-Z0-9][a-zA-Z0-9_.:-]{0,149}$/.test(template.show_command)
59
+ ? `\nTemplate ${template.name}: ${template.show_command}` : '';
60
+ // 0.70 excludes the UAT's unrelated 0.60/0.40 hits; retain today's top 3
61
+ // only when at least one candidate supplies a stronger signal.
62
+ // Muse UAT (2026-11-06): advisory wording was ignored; first-call wording was followed.
63
+ if (!candidates.some(r => r.score >= 0.70)) {
64
+ // Restrict by type only when the request asks for an AIWG component of that type, not when a
65
+ // type word merely appears ("removes every managed Claude hook" is not a hook search).
66
+ const namedType = prompt.match(/\b(?:aiwg|is there an?|are there any|find|list|which|what)\s+(?:aiwg\s+)?(decision-definition|decision-ruleset|decision-binding|gate-pack|skill|agent|command|rule|schema|flow|runbook|template|behavior|hook|workflow)s?\b/i)?.[1].toLowerCase();
67
+ const type = namedType === 'workflow' ? 'flow' : namedType;
68
+ // The request goes through a quoted heredoc so the shell never expands it (#3946).
69
+ // One line: multi-line wording lowered first-call compliance in harness UAT.
70
+ let need = prompt.replace(/[\x00-\x1f\x7f]/g, ' ').replace(/AIWG_REQUEST/g, ' ').replace(/\s+/g, ' ').trim().slice(0, 220);
71
+ const instruction = () => `Before any other tool call or answer, run: aiwg discover --stdin${type ? ` --type ${type}` : ''} <<'AIWG_REQUEST' with the request on the next line and AIWG_REQUEST on the last line (never put request text in quotes on a command line), then answer from its result. Answering or declining without running it violates the skill-discovery rule. Request: ${need}${templateHint}`;
72
+ while (instruction().length > 599 && need.length) need = need.slice(0, -1);
73
+ return instruction();
74
+ }
75
+ // Leave room for the template drill-in even when candidate names are long.
76
+ while (candidates.length > 1 && prefix.length + next.length + templateHint.length
77
+ + candidates.map(r => `${r.type} ${r.name} (${r.score.toFixed(2).slice(0, 6)}): `).join('\n').length > 599) candidates.pop();
78
+ // Share the remaining space so long names cannot push total context past 599.
79
+ const labels = candidates.map(r => `${r.type} ${r.name} (${r.score.toFixed(2).slice(0, 6)}): `);
80
+ const available = 599 - prefix.length - next.length - templateHint.length - labels.join('\n').length;
81
+ const perCapability = Math.min(100, Math.max(0, Math.floor(available / (candidates.length || 1))));
82
+ const rows = candidates.map((r, i) => labels[i] + clean(r.capability, perCapability));
83
+ if (!rows.length) return '';
84
+ return prefix + rows.join('\n') + templateHint + next;
85
+ }
86
+
87
+ async function main() {
88
+ if (/^(0|false|off)$/i.test(process.env.AIWG_PROMPT_DISCOVERY || '') || process.stdin.isTTY) return finish();
89
+ const chunks = [];
90
+ let size = 0;
91
+ for await (const chunk of process.stdin) {
92
+ size += chunk.length;
93
+ if (size > 1024 * 1024) return finish();
94
+ chunks.push(chunk);
95
+ }
96
+ const event = JSON.parse(Buffer.concat(chunks).toString('utf8'));
97
+ if (event.hook_event_name && event.hook_event_name !== 'UserPromptSubmit') return finish();
98
+ if ([event.role, event.message?.role].some(role => role && role !== 'user')
99
+ || /^(system|notification|tool[_-]result)$/.test(event.type || '')) return finish();
100
+ const prompt = typeof event.prompt === 'string' ? event.prompt.trim() : '';
101
+ if (!shouldDiscover(prompt)) return finish();
102
+ const moduleUrl = runtimeModule();
103
+ if (!moduleUrl || Date.now() >= deadline) return finish();
104
+ // The installed discovery API prints a JSON envelope. Capture it inside the
105
+ // isolated worker; no CLI bootstrap and no stdout/stderr leaks to the harness.
106
+ worker = new Worker(`
107
+ const { parentPort, workerData } = require('node:worker_threads');
108
+ console.log = value => {
109
+ if (typeof value === 'string') {
110
+ try { parentPort.postMessage(JSON.parse(value)); } catch {}
111
+ }
112
+ };
113
+ (async () => {
114
+ const { discoverCapability } = await import(workerData.moduleUrl);
115
+ await discoverCapability(workerData.cwd, {
116
+ phrase: workerData.prompt, limit: 3, json: true, jsonPretty: false, promptContext: true,
117
+ resourceSource: 'local', offline: true
118
+ });
119
+ })().catch(() => process.exit(0));
120
+ `, {
121
+ eval: true, stdout: true, stderr: true,
122
+ workerData: { moduleUrl, prompt, cwd: process.cwd() },
123
+ });
124
+ worker.on('message', envelope => {
125
+ if (Date.now() >= deadline) return finish();
126
+ const context = contextFor(envelope, prompt);
127
+ if (context) process.stdout.write(JSON.stringify({
128
+ hookSpecificOutput: { hookEventName: 'UserPromptSubmit', additionalContext: context },
129
+ }) + '\n', finish);
130
+ else finish();
131
+ });
132
+ worker.on('error', finish);
133
+ worker.on('exit', finish);
134
+ }
135
+
136
+ main().catch(finish);
@@ -26,10 +26,10 @@ providers:
26
26
  probe_budget: { status: authorized, calls: 3, tokens: 30000, authorized_by: operator, authorized_at: "2026-10-07", hosts: [titan, noodle] }
27
27
  coverage:
28
28
  profile_issue: "roctinam/aiwg#2900"
29
- source_date: "2026-10-08"
29
+ source_date: "2026-11-07"
30
30
  live_qualified: false
31
31
  sources:
32
- - "host-help: claude 2.1.295 on titan (--version/--help only)"
32
+ - "host-help: claude 2.1.319 on titan (--version/--help/-p --help only)"
33
33
  - "tools/ralph-external/lib/claude-adapter.mjs"
34
34
  status: stable
35
35
  daemon_tier: unsupported
@@ -256,7 +256,7 @@
256
256
  "id": "claude-direct",
257
257
  "provider": "claude",
258
258
  "adapterVersion": "1",
259
- "supportedVersions": "2.1.295",
259
+ "supportedVersions": ">=2.1.295 <2.2.0",
260
260
  "runtimeDriver": "installed:claude",
261
261
  "catalogAdapter": {
262
262
  "kind": "file",
@@ -329,67 +329,67 @@
329
329
  "invocationProfiles": {
330
330
  "direct-shell": {
331
331
  "transport": "shell",
332
- "supportedVersions": "2.1.295",
332
+ "supportedVersions": ">=2.1.295 <2.2.0",
333
333
  "controls": {
334
334
  "model": {
335
335
  "support": "unqualified",
336
336
  "mapping": "--model ${model}; moving aliases denied",
337
- "evidence": "H: claude 2.1.295 --help (2026-10-09); --model <model> Model for the current session. Provide; full verbatim excerpts: docs/providers/claude-direct.md"
337
+ "evidence": "H: claude 2.1.319 --help and -p --help (2026-11-07); --model <model> Model for the current session. Provide; full verbatim excerpts: docs/providers/claude-direct.md"
338
338
  },
339
339
  "effort": {
340
340
  "support": "unqualified",
341
341
  "mapping": "--effort ${effort}; explicit low/medium/high/xhigh/max",
342
- "evidence": "H: claude 2.1.295 --help (2026-10-09); --effort <level> Effort level for the current session (low, medium, high, xhigh, max); full verbatim excerpts: docs/providers/claude-direct.md"
342
+ "evidence": "H: claude 2.1.319 --help and -p --help (2026-11-07); --effort <level> Effort level for the current session (low, medium, high, xhigh, max); full verbatim excerpts: docs/providers/claude-direct.md"
343
343
  },
344
344
  "sandbox": {
345
345
  "support": "unqualified",
346
346
  "mapping": "partial: --restricted confines whitelisted file tools, scoped by --tools/--allowedTools (workspace-write: Read,Glob,Grep,Edit,Write; read-only: Read,Glob,Grep); OS sandbox unavailable in CLI, external boundary required",
347
- "evidence": "H: claude 2.1.295 --help (2026-10-09); --restricted Restricted mode: removes the built-in tools that run commands or code; full verbatim excerpts: docs/providers/claude-direct.md"
347
+ "evidence": "H: claude 2.1.319 --help and -p --help (2026-11-07); --restricted Restricted mode: removes the built-in tools that run commands or code; full verbatim excerpts: docs/providers/claude-direct.md"
348
348
  },
349
349
  "approval": {
350
350
  "support": "unqualified",
351
351
  "mapping": "--permission-mode dontAsk --permission-prompts none; prompting and bypass modes denied",
352
- "evidence": "H: claude 2.1.295 --help (2026-10-09); --permission-prompts <target> Who answers permission prompts with --print: \"host\" (the SDK host or --permission-prompt-tool) or \"none\" (nobody: anything that would prompt is denied automatically; the permission mode still decides everything else); full verbatim excerpts: docs/providers/claude-direct.md"
352
+ "evidence": "H: claude 2.1.319 --help and -p --help (2026-11-07); --permission-prompts <target> Who answers permission prompts with --print: \"host\" (the SDK host or --permission-prompt-tool) or \"none\" (nobody: anything that would prompt is denied automatically; the permission mode still decides everything else); full verbatim excerpts: docs/providers/claude-direct.md"
353
353
  },
354
354
  "workdir": {
355
355
  "support": "unqualified",
356
356
  "mapping": "spawn cwd from conductor; no invented --cwd flag",
357
- "evidence": "H: claude 2.1.295 --help (2026-10-09); Usage: claude [options] [command] [prompt]; no workspace switch is emitted; full verbatim excerpts: docs/providers/claude-direct.md"
357
+ "evidence": "H: claude 2.1.319 --help and -p --help (2026-11-07); Usage: claude [options] [command] [prompt]; no workspace switch is emitted; full verbatim excerpts: docs/providers/claude-direct.md"
358
358
  },
359
359
  "finalOutput": {
360
360
  "support": "unqualified",
361
361
  "mapping": "parse exactly one success result envelope from stdout; result JSON text or structured_output; exit-zero error fails",
362
- "evidence": "H: claude 2.1.295 --help (2026-10-09); --output-format <format> Output format (only works with --print): \"text\" (default), \"json\" (single result), or \"stream-json\" (realtime streaming); full verbatim excerpts: docs/providers/claude-direct.md"
362
+ "evidence": "H: claude 2.1.319 --help and -p --help (2026-11-07); --output-format <format> Output format (only works with --print): \"text\" (default), \"json\" (single result), or \"stream-json\" (realtime streaming); full verbatim excerpts: docs/providers/claude-direct.md"
363
363
  },
364
364
  "stdin": {
365
365
  "support": "unqualified",
366
366
  "mapping": "--input-format text; brief-text on stdin through EOF; never prompt argv",
367
- "evidence": "H: claude 2.1.295 --help (2026-10-09); --input-format <format> Input format (only works with --print): \"text\" (default), or \"stream-json\"; full verbatim excerpts: docs/providers/claude-direct.md"
367
+ "evidence": "H: claude 2.1.319 --help and -p --help (2026-11-07); --input-format <format> Input format (only works with --print): \"text\" (default), or \"stream-json\"; full verbatim excerpts: docs/providers/claude-direct.md"
368
368
  },
369
369
  "structuredOutput": {
370
370
  "support": "unqualified",
371
371
  "mapping": "unavailable in current renderer: CLI --json-schema exists but schema input is not passed to this driver",
372
- "evidence": "H: claude 2.1.295 --help (2026-10-09); --json-schema <schema> JSON Schema for structured output validation.; full verbatim excerpts: docs/providers/claude-direct.md"
372
+ "evidence": "H: claude 2.1.319 --help and -p --help (2026-11-07); --json-schema <schema> JSON Schema for structured output validation (only works with --print).; full verbatim excerpts: docs/providers/claude-direct.md"
373
373
  },
374
374
  "stepCap": {
375
375
  "support": "unqualified",
376
376
  "mapping": "unavailable: --max-turns is not listed by installed help; never emitted",
377
- "evidence": "H: claude 2.1.295 --help (2026-10-09); No --max-turns line appears in claude 2.1.295 --help; full verbatim excerpts: docs/providers/claude-direct.md"
377
+ "evidence": "H: claude 2.1.319 --help and -p --help (2026-11-07); No --max-turns line appears in claude 2.1.319 --help or -p --help; full verbatim excerpts: docs/providers/claude-direct.md"
378
378
  },
379
379
  "trust": {
380
380
  "support": "unqualified",
381
381
  "mapping": "--print --safe-mode --restricted --setting-sources \"\" --strict-mcp-config --mcp-config {\"mcpServers\":{}}; inherited customization disabled",
382
- "evidence": "H: claude 2.1.295 --help (2026-10-09); --safe-mode Start with all customizations (CLAUDE.md, skills, installed plugins, hooks, MCP servers, custom commands and agents, output styles, workflows, custom themes, keybindings, and more) disabled; full verbatim excerpts: docs/providers/claude-direct.md"
382
+ "evidence": "H: claude 2.1.319 --help and -p --help (2026-11-07); --safe-mode Start with all customizations (CLAUDE.md, skills, installed plugins, hooks, MCP servers, custom commands and agents, output styles, workflows, custom themes, keybindings, and more) disabled; full verbatim excerpts: docs/providers/claude-direct.md"
383
383
  },
384
384
  "children": {
385
385
  "support": "unqualified",
386
386
  "mapping": "--tools/--allowedTools Read,Glob,Grep,Edit,Write (workspace-write) or Read,Glob,Grep (read-only) --disallowedTools Agent,Task,Bash,PowerShell,REPL,WebFetch; no child/command tool or external MCP",
387
- "evidence": "H: claude 2.1.295 --help (2026-10-09); --tools <tools...> Specify the list of available tools from the built-in set.; full verbatim excerpts: docs/providers/claude-direct.md"
387
+ "evidence": "H: claude 2.1.319 --help and -p --help (2026-11-07); --tools <tools...> Specify the list of available tools from the built-in set.; full verbatim excerpts: docs/providers/claude-direct.md"
388
388
  },
389
389
  "fallback": {
390
390
  "support": "unqualified",
391
391
  "mapping": "exact model; --safe-mode; never emit --fallback-model; model substitutions do not qualify the profile",
392
- "evidence": "H: claude 2.1.295 --help (2026-10-09); --fallback-model <model> Enable automatic fallback to specified model(s) when the default model is overloaded or not available.; full verbatim excerpts: docs/providers/claude-direct.md"
392
+ "evidence": "H: claude 2.1.319 --help and -p --help (2026-11-07); --fallback-model <model> Enable automatic fallback to specified model(s) when the default model is overloaded or not available.; full verbatim excerpts: docs/providers/claude-direct.md"
393
393
  }
394
394
  },
395
395
  "envAllowlist": [
@@ -403,6 +403,7 @@
403
403
  "Final output is the captured .stdout JSONL stream, not a CLI-created finalPath file. Normalize with ClaudeAdapter.parseWorkerFinal before verification.",
404
404
  "Unavailable: renderer schema input, help-evidenced turn cap, native MCP reasoning worker. claude mcp serve exposes only debug/help/verbose and is a code-tools server.",
405
405
  "Commands, Agent/Task, inherited MCP, hooks, plugins and skills are disabled in this restricted file-tools profile.",
406
+ "Version policy: >=2.1.295 <2.2.0 preserves the earlier help-verified baseline and accepts compatible 2.1 patch updates; 2.1.319 help was rechecked on titan on 2026-11-07. Range/resolver tests cover 2.1.317 and 2.1.319 synthetically, not live inference. Older versions, prereleases and 2.2+ remain blocked.",
406
407
  "Bare mode is not used: installed help states it changes auth to API-key-only. No account or credential files were inspected."
407
408
  ],
408
409
  "health": {
@@ -429,8 +430,8 @@
429
430
  {
430
431
  "kind": "help",
431
432
  "ref": "docs/providers/claude-direct.md",
432
- "observedAt": "2026-10-09T00:00:00Z",
433
- "cliVersion": "2.1.295"
433
+ "observedAt": "2026-11-08T01:49:23Z",
434
+ "cliVersion": "2.1.319"
434
435
  },
435
436
  {
436
437
  "kind": "repository",
@@ -1079,7 +1080,7 @@
1079
1080
  "agent": "native",
1080
1081
  "skill": "informational",
1081
1082
  "globalChild": "native",
1082
- "identifierSyntax": "Factory model ID or Light/Medium/Heavy complexity",
1083
+ "identifierSyntax": "Factory built-in model ID or custom BYOK model selector",
1083
1084
  "effortValues": [
1084
1085
  "low",
1085
1086
  "medium",
@@ -1097,7 +1098,7 @@
1097
1098
  "id": "factory-direct",
1098
1099
  "provider": "factory",
1099
1100
  "adapterVersion": "1",
1100
- "supportedVersions": "0.238.0",
1101
+ "supportedVersions": "1.0.0",
1101
1102
  "runtimeDriver": "installed:factory",
1102
1103
  "catalogAdapter": {
1103
1104
  "kind": "file",
@@ -1122,7 +1123,7 @@
1122
1123
  ],
1123
1124
  "stdin": "brief-text",
1124
1125
  "cwd": "${workspace}",
1125
- "envAllowlist": ["FACTORY_API_KEY", "HOME", "PATH"],
1126
+ "envAllowlist": ["FACTORY_API_KEY", "HOME", "OPENROUTER_API_KEY", "PATH"],
1126
1127
  "versionArgv": [
1127
1128
  "--version"
1128
1129
  ],
@@ -1147,78 +1148,82 @@
1147
1148
  "invocationProfiles": {
1148
1149
  "direct-shell": {
1149
1150
  "transport": "shell",
1150
- "supportedVersions": "0.238.0",
1151
+ "supportedVersions": "1.0.0",
1151
1152
  "controls": {
1152
1153
  "model": {
1153
1154
  "support": "unqualified",
1154
- "mapping": "[-m/--model MODEL]; exact catalog model ID, never the CLI default (gpt-6-sol) or a generic alias",
1155
- "evidence": "H: droid-cli 0.238.0 exec --help documents -m/--model <id> (default: \"gpt-6-sol\"); unqualified until live model-pin evidence"
1155
+ "mapping": "[-m/--model MODEL]; exact catalog model ID, never the CLI default or a generic alias",
1156
+ "evidence": "H: droid-cli 1.0.0 exec --help documents -m/--model <id>; unqualified until live model-pin evidence"
1156
1157
  },
1157
1158
  "effort": {
1158
1159
  "support": "unqualified",
1159
1160
  "mapping": "[-r/--reasoning-effort LEVEL]; valid levels are model-dependent (exec --help 'Model details'); never the per-model default",
1160
- "evidence": "H: droid-cli 0.238.0 exec --help documents -r/--reasoning-effort <level> (defaults per model); unqualified until live evidence"
1161
+ "evidence": "H: droid-cli 1.0.0 exec --help documents -r/--reasoning-effort <level> (defaults per model); unqualified until live evidence"
1161
1162
  },
1162
1163
  "sandbox": {
1163
1164
  "support": "unqualified",
1164
1165
  "mapping": "workspace-write -> [--auto low]; read-only -> no --auto flag (the CLI's own documented read-only default); --skip-permissions-unsafe and the medium/high --auto tiers are out of this contract's scope and are never emitted",
1165
- "evidence": "H: droid-cli 0.238.0 exec --help documents --auto <level> (low|medium|high), its 'Autonomy Levels' default read-only mode, and --skip-permissions-unsafe ('Bypass all checks - DANGEROUS!'); unqualified until live evidence"
1166
+ "evidence": "H: droid-cli 1.0.0 exec --help documents --auto <level> (low|medium|high), its 'Autonomy Levels' default read-only mode, and --skip-permissions-unsafe ('Bypass all checks - DANGEROUS!'); unqualified until live evidence"
1166
1167
  },
1167
1168
  "approval": {
1168
1169
  "support": "unqualified",
1169
1170
  "mapping": "unavailable as a separate flag: exec is non-interactive by construction and --auto (the sandbox control) is the only permission gate",
1170
- "evidence": "H: droid-cli 0.238.0 exec --help documents exec as 'Run non-interactively (for scripts/automation)' with no approval-prompt flag; unqualified until live evidence"
1171
+ "evidence": "H: prior droid-cli 0.238.0 exec --help documents exec as 'Run non-interactively (for scripts/automation)' with no approval-prompt flag; not reverified on 1.0.0, unqualified until live evidence"
1171
1172
  },
1172
1173
  "workdir": {
1173
1174
  "support": "unqualified",
1174
1175
  "mapping": "[--cwd W] conductor working root, plus the conductor process cwd",
1175
- "evidence": "H: droid-cli 0.238.0 exec --help documents --cwd <path>; unqualified until live evidence"
1176
+ "evidence": "H: droid-cli 1.0.0 exec --help documents --cwd <path>; unqualified until live evidence"
1176
1177
  },
1177
1178
  "finalOutput": {
1178
1179
  "support": "unqualified",
1179
1180
  "mapping": "unavailable as a file target: no -o/output-file flag is documented for exec (-o/--output-format selects stream shape, not a destination); the final is the last type:\"result\" line of the captured --output-format stream-json stdout stream",
1180
- "evidence": "H: droid-cli 0.238.0 exec --help documents -o/--output-format <text|json|stream-json|stream-jsonrpc|acp> with no file-path argument; D: https://docs.factory.com/droid-exec/overview documents the terminal result object shape; unqualified until live evidence"
1181
+ "evidence": "H: droid-cli 1.0.0 exec --help documents -o/--output-format <text|json|stream-json|stream-jsonrpc|acp> with no file-path argument; D: https://docs.factory.com/droid-exec/overview documents the terminal result object shape; unqualified until live evidence"
1181
1182
  },
1182
1183
  "stdin": {
1183
1184
  "support": "unqualified",
1184
1185
  "mapping": "brief-text: omitting the prompt argument makes exec read the prompt from stdin to EOF; brief text never enters argv, rendered commands or serialized plans",
1185
- "evidence": "H: droid-cli 0.238.0 exec --help's own Examples ('echo \"analyze code\" | droid exec', 'cat prompt.txt | droid exec --auto low'); unqualified until live evidence"
1186
+ "evidence": "H: titan eval on droid-cli 1.0.0 verified stdin ingestion: the brief was echoed as the first stream-json message. Live result pending: blocked by 402 No active subscription; no successful inference recorded"
1186
1187
  },
1187
1188
  "structuredOutput": {
1188
1189
  "support": "unqualified",
1189
1190
  "mapping": "unavailable: no --output-schema-equivalent flag is documented for exec",
1190
- "evidence": "H: droid-cli 0.238.0 exec --help advertises no output-schema flag; unqualified until live evidence"
1191
+ "evidence": "H: prior droid-cli 0.238.0 exec --help advertises no output-schema flag; not reverified on 1.0.0, unqualified until live evidence"
1191
1192
  },
1192
1193
  "stepCap": {
1193
1194
  "support": "unqualified",
1194
- "mapping": "unavailable: no step or turn cap flag is evidenced on 0.238.0; deadline and output-byte bounds come from the invoking shell",
1195
- "evidence": "H: droid-cli 0.238.0 exec --help advertises no step-cap flag; unknown controls block tasks requiring them"
1195
+ "mapping": "unavailable: no step or turn cap flag is evidenced on 1.0.0; deadline and output-byte bounds come from the invoking shell",
1196
+ "evidence": "H: prior droid-cli 0.238.0 exec --help advertises no step-cap flag; unknown controls block tasks requiring them"
1196
1197
  },
1197
1198
  "trust": {
1198
1199
  "support": "unqualified",
1199
- "mapping": "unknown: workspace-trust behaviour is not evidenced for non-interactive exec on 0.238.0",
1200
- "evidence": "H: droid-cli 0.238.0 exec --help documents no trust-prompt flag for exec; unqualified until live evidence"
1200
+ "mapping": "unknown: workspace-trust behaviour is not evidenced for non-interactive exec on 1.0.0",
1201
+ "evidence": "H: prior droid-cli 0.238.0 exec --help documents no trust-prompt flag for exec; not reverified on 1.0.0, unqualified until live evidence"
1201
1202
  },
1202
1203
  "children": {
1203
1204
  "support": "unqualified",
1204
1205
  "mapping": "controllable: --mission spawns worker sessions via factoryd (never emitted by this profile, which keeps every run single-agent)",
1205
- "evidence": "H: droid-cli 0.238.0 exec --help documents --mission/--worker-model/--validator-model as mission-mode only; the direct profile never emits them; unqualified until live evidence"
1206
+ "evidence": "H: prior droid-cli 0.238.0 exec --help documents --mission/--worker-model/--validator-model as mission-mode only; the direct profile never emits them; not reverified on 1.0.0, unqualified until live evidence"
1206
1207
  },
1207
1208
  "fallback": {
1208
1209
  "support": "unqualified",
1209
1210
  "mapping": "unavailable: no non-mission fallback-model flag is documented for exec (--spec-model/--worker-model/--validator-model are mission-mode only)",
1210
- "evidence": "H: droid-cli 0.238.0 exec --help scopes --spec-model/--worker-model/--validator-model to --mission/--use-spec; unknown controls block tasks requiring them"
1211
+ "evidence": "H: prior droid-cli 0.238.0 exec --help scopes --spec-model/--worker-model/--validator-model to --mission/--use-spec; unknown controls block tasks requiring them"
1211
1212
  }
1212
1213
  },
1213
- "envAllowlist": ["FACTORY_API_KEY", "HOME", "PATH"],
1214
+ "envAllowlist": ["FACTORY_API_KEY", "HOME", "OPENROUTER_API_KEY", "PATH"],
1214
1215
  "pitfalls": [
1215
1216
  "Documentation/help and synthetic observations are not authenticated live qualification.",
1217
+ "Titan 1.0.0 eval (2026-11-06, BYOK custom model via OpenRouter): the brief on stdin returns the exact smoke reply in read-only mode and with --auto low; -m selects the custom model and the stream-json system event reports it. Catalog evidence stays H; live qualification is recorded only by aiwg doctor --probe-workers --qualify.",
1218
+ "-r/--reasoning-effort is accepted but ignored for BYOK custom models: the system event reports reasoning_effort none, so effort is not enforceable on them.",
1219
+ "droid relabels custom model IDs by display name: custom:<name>-2 is reported back as custom:<name>-0. Match the model by name, not by the numeric suffix.",
1220
+ "Under --auto low a command above the tier ends the run with exit 1 and the error Exec ended early: insufficient permission to proceed; nothing runs.",
1216
1221
  "Unknown model, effort, permission or required step mappings block dispatch.",
1217
1222
  "Native MCP/client, MSP/ACP, gateway and conversation capabilities do not establish worker authority.",
1218
1223
  "--skip-permissions-unsafe is Ralph-loop legacy and never part of the direct profile.",
1219
1224
  "The stream-json/json event vocabulary (assistant/user/tool_call/tool_result/hook/error/result) is doc-sourced (docs.factory.com), not help-verified; it never promotes qualification status beyond unqualified.",
1220
1225
  "There is no -o/output-file flag on exec: the final is read from the captured stdout stream, never a separate file.",
1221
- "FACTORY_API_KEY must be present for auth; HOME locates ~/.factory/settings.json for persistent settings."
1226
+ "Auth is the Factory account (FACTORY_API_KEY or keyring) or a BYOK customModels entry in ~/.factory/settings.json whose apiKey is an env reference; the launch env must carry that variable (OPENROUTER_API_KEY is allowlisted; a BYOK key under another name blocks with Custom model apiKey references the environment variable ... which is not set). HOME locates ~/.factory/settings.json."
1222
1227
  ],
1223
1228
  "health": {
1224
1229
  "version": 1,
@@ -1244,8 +1249,8 @@
1244
1249
  {
1245
1250
  "kind": "help",
1246
1251
  "ref": "tools/ralph-external/lib/factory-adapter.mjs",
1247
- "observedAt": "2026-10-10T00:00:00Z",
1248
- "cliVersion": "0.238.0"
1252
+ "observedAt": "2026-11-06T00:00:00Z",
1253
+ "cliVersion": "1.0.0"
1249
1254
  },
1250
1255
  {
1251
1256
  "kind": "documentation",
@@ -162,17 +162,17 @@
162
162
  "factory": {
163
163
  "roles": {
164
164
  "reasoning": {
165
- "id": "heavy",
165
+ "id": "claude-opus-5",
166
166
  "status": "active",
167
167
  "observed": false
168
168
  },
169
169
  "coding": {
170
- "id": "medium",
170
+ "id": "claude-sonnet-5",
171
171
  "status": "active",
172
172
  "observed": false
173
173
  },
174
174
  "efficiency": {
175
- "id": "light",
175
+ "id": "claude-haiku-4-5-20251001",
176
176
  "status": "active",
177
177
  "observed": false
178
178
  }
@@ -19,11 +19,13 @@
19
19
  import path from 'node:path';
20
20
  import { readFileSync } from 'node:fs';
21
21
  import { fileURLToPath } from 'node:url';
22
- import { GRAPH_CONFIGS, OPERATIONAL_DISCOVERY_TYPES, OPERATIONAL_SHOW_TYPES, isOperationalShowType, loadUserGraphConfigs, loadGlobalGraphConfigs, orderedGraphEntries, } from './types.js';
22
+ import { GRAPH_CONFIGS, OPERATIONAL_SHOW_TYPES, isOperationalShowType, loadUserGraphConfigs, loadGlobalGraphConfigs, orderedGraphEntries, } from './types.js';
23
23
  import { SUPPORTED_VIEWS } from './corpus-views/renderers.js';
24
24
  import { parseResourceSelector, readVerifiedRegularFile, } from '../resources/web-release.js';
25
25
  import { findPackageRoot } from '../cli/find-package-root.js';
26
26
  import { createResourceCredentialProvider, prepareResourceCredentials } from '../auth/resource-credentials.js';
27
+ import { readDiscoverPhrase } from './query-engine-options.js';
28
+ import { printDiscoverUsage } from './discover-cli-help.js';
27
29
  const MAX_RESOURCE_TRUST_ROOT_BYTES = 64 * 1024;
28
30
  function webReleaseOptionsFromEnvironment(credentialProvider = createResourceCredentialProvider(process.env)) {
29
31
  const baseUrl = process.env.AIWG_RESOURCE_BASE_URL;
@@ -1465,6 +1467,10 @@ const DISCOVER_VALUE_FLAGS = new Set([
1465
1467
  * @implements #1214
1466
1468
  */
1467
1469
  async function handleDiscover(args) {
1470
+ if (args.includes('--help') || args.includes('-h')) {
1471
+ printDiscoverUsage();
1472
+ return;
1473
+ }
1468
1474
  const credentials = await prepareResourceCredentials(args);
1469
1475
  args = credentials.args;
1470
1476
  const { discoverCapability } = await import('./query-engine-discover.js');
@@ -1489,18 +1495,10 @@ async function handleDiscover(args) {
1489
1495
  index += 1;
1490
1496
  }
1491
1497
  }
1492
- const phrase = textParts.join(' ').trim();
1498
+ const phrase = await readDiscoverPhrase(textParts, flags);
1493
1499
  if (!phrase) {
1494
1500
  console.error('Error: aiwg index discover requires a search phrase');
1495
- console.log('');
1496
- console.log('Usage: aiwg index discover "<phrase>" [--type <kinds>] [--limit N] [--json|--format json|text] [--pretty|--compact] [--graph <name>] [--backend local|fortemi-core] [--resource-source local|web|auto] [--aiwg-version <version|range|digest|channel>] [--offline]');
1497
- console.log('');
1498
- console.log('Examples:');
1499
- console.log(' aiwg index discover "create intake"');
1500
- console.log(' aiwg index discover "deploy production" --limit 5');
1501
- console.log(` aiwg index discover "audit security" --type ${OPERATIONAL_DISCOVERY_TYPES.join(',')}`);
1502
- console.log(' aiwg index discover "intake" --format json --pretty');
1503
- console.log(' aiwg discover "intake" --resource-source web --aiwg-version stable');
1501
+ printDiscoverUsage();
1504
1502
  process.exit(1);
1505
1503
  }
1506
1504
  const typeValue = parseFlagValue(flags, '--type', 'Error: --type requires a value');
@@ -1542,6 +1540,7 @@ async function handleDiscover(args) {
1542
1540
  offline,
1543
1541
  webReleaseOptions,
1544
1542
  includePaths: false,
1543
+ noBuild: flags.includes('--no-build'),
1545
1544
  verbose: flags.includes('--verbose') || flags.includes('--debug'),
1546
1545
  });
1547
1546
  }
@@ -0,0 +1,25 @@
1
+ // Keep discover usage shared between top-level help and the index alias.
2
+ export function printDiscoverUsage() {
3
+ console.log(`Usage: aiwg discover [<phrase> | --stdin] [options]
4
+ aiwg index discover [<phrase> | --stdin] [options]
5
+
6
+ --stdin Read and trim the phrase from stdin; excludes positional text
7
+ --type <kinds> Filter comma-separated artifact types (e.g. skill,template)
8
+ --limit N Maximum results (default: 5)
9
+ --json Emit JSON (--format json|text also supported)
10
+ --pretty | --compact JSON formatting (default: pretty)
11
+ --graph <name> Search a specific graph
12
+ --backend local|fortemi-core
13
+ --resource-source local|web|auto
14
+ --aiwg-version <version|range|digest|channel>
15
+ --offline Require cached web resources
16
+ --no-build Read cached local metadata only
17
+ --verbose, --debug Show cache fallback diagnostics
18
+ --help, -h Show this help
19
+
20
+ Pass shell-sensitive requests with a quoted heredoc:
21
+ aiwg discover --stdin <<'AIWG_REQUEST'
22
+ <the request, verbatim>
23
+ AIWG_REQUEST`);
24
+ }
25
+ //# sourceMappingURL=discover-cli-help.js.map
@@ -2,7 +2,8 @@ export const SESSION_FACETS = [
2
2
  {
3
3
  facet: 'feature-domain', label: 'Session checkpoint and handoff',
4
4
  intents: ['resume conductor handoff', 'continue session handoff', 'write session handoff',
5
- 'create session handoff', 'resume interrupted work'],
5
+ 'create session handoff', 'resume interrupted work', 'handoff',
6
+ 'hand off to a new session', 'split this session', 'prepare a handoff for a new session'],
6
7
  capabilities: ['checkpoint'],
7
8
  },
8
9
  {
@@ -0,0 +1,28 @@
1
+ // Bind prebuilt framework exports to their package/source identity and repair path.
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+ import { frameworkSourceDigest } from './framework-source-digest.js';
5
+ import { inferInstallationMethod } from '../installation/manager.mjs';
6
+ export function prebuiltFrameworkFreshnessReason(root, manifest) {
7
+ try {
8
+ const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
9
+ if (typeof manifest.package_version !== 'string' || manifest.package_version !== pkg.version) {
10
+ return `prebuilt package version '${manifest.package_version ?? 'missing'}' differs from current package version '${pkg.version}'`;
11
+ }
12
+ if (typeof manifest.source_digest !== 'string' || manifest.source_digest !== frameworkSourceDigest(root, false)) {
13
+ return 'prebuilt source digest differs from current framework sources (modified, added or removed source)';
14
+ }
15
+ return null;
16
+ }
17
+ catch (error) {
18
+ return `prebuilt source identity is unreadable: ${error instanceof Error ? error.message : String(error)}`;
19
+ }
20
+ }
21
+ export function fortemiCorePrebuiltRepairHint(root) {
22
+ if (inferInstallationMethod(root) === 'source') {
23
+ const quotedRoot = `'${root.replaceAll("'", "'\\''")}'`;
24
+ return `run npm --prefix ${quotedRoot} run release:fortemi-index to rebuild this source checkout's framework index`;
25
+ }
26
+ return 'run "aiwg index sync --backend fortemi-core --graph framework" to rebuild the local framework cache';
27
+ }
28
+ //# sourceMappingURL=fortemi-core-prebuilt-freshness.js.map
@@ -7,6 +7,7 @@ import { GRAPH_CONFIGS, getProjectIndexRoot, loadGlobalGraphConfigs } from "./ty
7
7
  import { buildAiwgFortemiIndexExport, } from "./browser-export.js";
8
8
  import { loadGraphIndexFile, publishIndexFiles } from "./index-reader.js";
9
9
  import { getFrameworkIndexBaseDir } from './framework-index-paths.js';
10
+ import { prebuiltFrameworkFreshnessReason } from './fortemi-core-prebuilt-freshness.js';
10
11
  export function getFortemiCoreIndexDir(cwd, graph) {
11
12
  loadGlobalGraphConfigs();
12
13
  if (graph === 'framework')
@@ -387,6 +388,8 @@ export function getFortemiCorePrebuiltStatus(graph = "framework", packageRoot) {
387
388
  else if (!Array.isArray(exported.items) || exported.items.length !== prebuiltManifest.item_count) {
388
389
  reason = "prebuilt export item count does not match manifest";
389
390
  }
391
+ if (!reason && graph === 'framework')
392
+ reason = prebuiltFrameworkFreshnessReason(path.resolve(dir, '../../..'), prebuiltManifest);
390
393
  }
391
394
  catch (err) {
392
395
  reason = `prebuilt export file is unreadable: ${err instanceof Error ? err.message : String(err)}`;
@@ -6,6 +6,10 @@ import { frameworkSourceDigest } from './framework-source-digest.js';
6
6
  import { acquireDirectoryLock, DirectoryLockContentionError } from './prebuilt-build-lock.js';
7
7
  import { FRAMEWORK_CORPUS_KINDS as CORPUS_KINDS, resolveFrameworkCorpusRoot } from './framework-index-paths.js';
8
8
  export { resolveFrameworkCorpusRoot } from './framework-index-paths.js';
9
+ /** Permission failures allow query callers to serve existing indexes without writes. */
10
+ export function isIndexWritePermissionError(error) {
11
+ return ['EROFS', 'EACCES', 'EPERM'].includes(error?.code ?? '');
12
+ }
9
13
  function readText(file) {
10
14
  try {
11
15
  return fs.readFileSync(file, 'utf8');
@@ -3,7 +3,7 @@ import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { createHash } from 'node:crypto';
5
5
  import { BUILTIN_GRAPH_CONFIGS, INDEX_EXTRACTOR_VERSION, getGraphIndexDir } from './types.js';
6
- export const FRAMEWORK_RELATIONS_REVISION = 3;
6
+ export const FRAMEWORK_RELATIONS_REVISION = 4;
7
7
  const REVISION = FRAMEWORK_RELATIONS_REVISION;
8
8
  const sha256 = (value) => createHash('sha256').update(value).digest('hex');
9
9
  /** No absolute paths, git revision or mtimes enter the portable digest. */