@aiwg/cli 2026.11.2 → 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.
@@ -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",
@@ -73,6 +73,22 @@ export async function executeDatasetCommand(ctx, providedService) {
73
73
  exitCode: 1,
74
74
  message: `Unknown dataset action '${action ?? ""}'.`,
75
75
  };
76
+ if (action === "status" && !ids[0])
77
+ return {
78
+ exitCode: 1,
79
+ rawOutput: true,
80
+ message: presentDatasetResult({
81
+ schema: "aiwg.dataset-orchestration/v1",
82
+ action,
83
+ ok: false,
84
+ diagnostics: [{
85
+ code: "DATASET_ARGUMENT_REQUIRED",
86
+ message: "Missing required run ID. Usage: aiwg dataset status <run-id>",
87
+ boundary: "input",
88
+ retryable: false,
89
+ }],
90
+ }, ctx.args.includes("--json")),
91
+ };
76
92
  const s = providedService ?? service(ctx);
77
93
  let result;
78
94
  switch (action) {
@@ -155,6 +171,7 @@ export const datasetHandler = {
155
171
  "source/plan: --file <json>",
156
172
  "preview: <source-id> [--count N] [--offline]",
157
173
  "ingest: <plan-id> --digest <sha256> --idempotency-key <key> [--approve id,id]",
174
+ "status <run-id>: Inspect one run by its required ID.",
158
175
  "All actions: --json for the canonical aiwg.dataset-orchestration/v1 envelope.",
159
176
  ].join("\n"),
160
177
  };
@@ -1,6 +1,7 @@
1
1
  import { ContextWriteJournal } from '../../smiths/context-pipeline/context-file-safety.js';
2
2
  import { trackTemporaryDirectory } from '../../utils/temporary-directory.js';
3
3
  import { codexHookTrustNextStep, readCodexHookTrust } from '../../smiths/hook-bridge/codex-trust.js';
4
+ import { factoryHookTrustNextStep, readFactoryHookTrust } from '../../smiths/hook-bridge/factory-trust.js';
4
5
  /**
5
6
  * Use Command Handler
6
7
  *
@@ -1413,6 +1414,9 @@ export function validateUseOptions(args, preparedCapabilities = new Set()) {
1413
1414
  if (USE_FLAGS_WITH_VALUES.has(arg)) {
1414
1415
  if (!args[i + 1] || args[i + 1].startsWith('-'))
1415
1416
  return `Missing value for option '${arg}'. See aiwg use --help.`;
1417
+ if ((arg === '--provider' || arg === '--platform') && args[i + 1].includes(',')) {
1418
+ return `Option '${arg}' accepts one provider. Use --providers for a comma-separated list. See aiwg use --help.`;
1419
+ }
1416
1420
  i++;
1417
1421
  }
1418
1422
  else if (arg.startsWith('-') && !USE_BOOLEAN_FLAGS.has(arg)) {
@@ -2593,6 +2597,12 @@ export class UseHandler {
2593
2597
  result.findings.push({
2594
2598
  id: 'codex-prompt-discovery-trust', provider: 'codex', severity: 'info', message: codexTrustStep,
2595
2599
  });
2600
+ const factoryTrustStep = !dryRun && result.exitCode === 0 && requestedScope === 'project' && providers.includes('factory')
2601
+ ? factoryHookTrustNextStep(await readFactoryHookTrust(projectDir)) : '';
2602
+ if (factoryTrustStep)
2603
+ result.findings.push({
2604
+ id: 'factory-hook-trust', provider: 'factory', severity: 'info', message: factoryTrustStep,
2605
+ });
2596
2606
  if (json) {
2597
2607
  return { exitCode: result.exitCode, message: JSON.stringify(result, null, 2), rawOutput: true };
2598
2608
  }
@@ -2617,7 +2627,7 @@ export class UseHandler {
2617
2627
  });
2618
2628
  return {
2619
2629
  exitCode: result.exitCode,
2620
- message: [coreResult.message, rendered, ...(previewActions ? [...previewActions].sort() : []), codexTrustStep].filter(Boolean).join('\n'),
2630
+ message: [coreResult.message, rendered, ...(previewActions ? [...previewActions].sort() : []), codexTrustStep, factoryTrustStep].filter(Boolean).join('\n'),
2621
2631
  };
2622
2632
  }
2623
2633
  async executeCore(ctx, resolvedProviders) {
@@ -2765,10 +2775,14 @@ export class UseHandler {
2765
2775
  : null;
2766
2776
  const projectDir = getProjectDir(ctx, remainingArgs);
2767
2777
  let config = await readAiwgConfig(projectDir);
2768
- if (detectScope(remainingArgs) === 'project' && remainingArgs.includes('--scope')) {
2778
+ // Validate the entire selection before auto-init can persist provider IDs (#3958).
2779
+ {
2769
2780
  for (const requested of configuredGlobalProviders(remainingArgs, config)) {
2770
2781
  const resolved = await resolveProjectLocalProviderAdapter(projectDir, requested);
2771
- if (normalizeProviderDefinitionId(resolved.provider) === 'hermes') {
2782
+ const provider = normalizeProviderDefinitionId(resolved.provider);
2783
+ if (!provider)
2784
+ return { exitCode: 1, message: unsupportedProviderMessage(requested) ?? `Unknown provider: ${requested}` };
2785
+ if (detectScope(remainingArgs) === 'project' && remainingArgs.includes('--scope') && provider === 'hermes') {
2772
2786
  return { exitCode: 1, message: "Hermes does not support --scope project: it discovers skills only under HERMES_HOME/skills (default ~/.hermes/skills). Use --scope user or an isolated HERMES_HOME profile shared with Hermes." };
2773
2787
  }
2774
2788
  }
@@ -594,7 +594,7 @@ export async function verifyProviderDeployment(options) {
594
594
  }
595
595
  const diagnostics = await diagnoseWorkspaceContext(options.projectRoot);
596
596
  for (const diagnostic of diagnostics) {
597
- if (diagnostic.code === 'codex-prompt-discovery-trust')
597
+ if (['codex-prompt-discovery-trust', 'factory-hook-trust'].includes(diagnostic.code))
598
598
  continue; // Doctor advisory; use appends its short next step.
599
599
  if (diagnostic.severity === 'info')
600
600
  continue;
@@ -2,12 +2,13 @@ import { readFileSync } from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import { parseYamlSimple } from './user-config.js';
4
4
  import { resolveUserConfigDir } from './user-config-dir.mjs';
5
+ import { validateJevConfig } from './jev-credential-reference.js';
5
6
  export function validateDecisionConfig(value) {
6
7
  if (value === undefined)
7
8
  return [];
8
9
  if (!value || typeof value !== 'object' || Array.isArray(value))
9
10
  return ['decision must be an object'];
10
- const errors = [];
11
+ const errors = validateJevConfig(value.jev);
11
12
  const { enabled, ask, offload_report: report } = value;
12
13
  if (enabled !== undefined && typeof enabled !== 'boolean')
13
14
  errors.push('decision.enabled must be a boolean');
@@ -0,0 +1,56 @@
1
+ // Validate and load reference-only Jev configuration in the existing decision scope.
2
+ import { readFileSync } from 'node:fs';
3
+ import path from 'node:path';
4
+ import { parseYamlSimple } from './user-config.js';
5
+ import { resolveUserConfigDir } from './user-config-dir.mjs';
6
+ const segment = /^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/;
7
+ const object = (value) => Boolean(value) && typeof value === 'object' && !Array.isArray(value);
8
+ const only = (value, keys) => Object.keys(value).every(key => keys.includes(key));
9
+ function validOrigin(value) {
10
+ if (typeof value !== 'string')
11
+ return false;
12
+ try {
13
+ const url = new URL(value);
14
+ return url.protocol === 'https:' && !url.username && !url.password && !url.search && !url.hash && url.pathname === '/';
15
+ }
16
+ catch {
17
+ return false;
18
+ }
19
+ }
20
+ export function validJevReference(value) {
21
+ if (!object(value) || !only(value, ['source', 'addr', 'path', 'field', 'auth']) || value.source !== 'openbao'
22
+ || (value.addr !== undefined && !validOrigin(value.addr)))
23
+ return false;
24
+ const parts = typeof value.path === 'string' ? value.path.split('/') : [];
25
+ return parts.length >= 3 && parts[1] === 'data' && parts.every(part => segment.test(part))
26
+ && typeof value.field === 'string' && segment.test(value.field)
27
+ && object(value.auth) && only(value.auth, ['method', 'role']) && value.auth.method === 'approle'
28
+ && typeof value.auth.role === 'string' && segment.test(value.auth.role);
29
+ }
30
+ export function validateJevConfig(value) {
31
+ if (value === undefined)
32
+ return [];
33
+ return object(value) && only(value, ['credential']) && validJevReference(value.credential)
34
+ ? [] : ['decision.jev.credential must be an OpenBao KV v2 reference with field and AppRole; values and extra keys are forbidden'];
35
+ }
36
+ export function readJevReference(options = {}) {
37
+ const read = (file, yaml = false) => {
38
+ let raw;
39
+ try {
40
+ raw = readFileSync(file, 'utf8');
41
+ }
42
+ catch (error) {
43
+ if (error.code === 'ENOENT')
44
+ return undefined;
45
+ throw error;
46
+ }
47
+ const config = (yaml ? parseYamlSimple(raw) : JSON.parse(raw));
48
+ const value = config.decision?.jev;
49
+ if (validateJevConfig(value).length)
50
+ throw new Error('credential-unavailable');
51
+ return value?.credential;
52
+ };
53
+ return read(path.join(options.cwd ?? process.cwd(), '.aiwg', 'aiwg.config'))
54
+ ?? read(path.join(resolveUserConfigDir(options), 'config.yaml'), true);
55
+ }
56
+ //# sourceMappingURL=jev-credential-reference.js.map
@@ -299,12 +299,12 @@ export class UserConfig {
299
299
  // ============================================
300
300
  /**
301
301
  * Minimal YAML parser for flat/nested config files.
302
- * Handles the subset we use: scalars, nested objects (2 levels).
302
+ * Handles the subset we use: scalars, nested objects.
303
303
  * For complex YAML, users should use a full parser.
304
304
  */
305
305
  export function parseYamlSimple(content) {
306
306
  const result = {};
307
- let currentSection = null;
307
+ const sections = [{ indent: -1, value: result }];
308
308
  for (const line of content.split('\n')) {
309
309
  // Skip comments and empty lines
310
310
  if (line.trim().startsWith('#') || line.trim() === '')
@@ -321,24 +321,18 @@ export function parseYamlSimple(content) {
321
321
  if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
322
322
  throw new Error('Unsafe config key: prototype-related names are not allowed');
323
323
  }
324
- if (indent === 0) {
325
- if (rawValue === '' || rawValue === undefined) {
326
- // Section header
327
- currentSection = key;
328
- if (!Object.hasOwn(result, key)) {
329
- result[key] = {};
330
- }
331
- }
332
- else {
333
- // Top-level key-value
334
- currentSection = null;
335
- result[key] = parseScalar(rawValue);
336
- }
324
+ while (sections.length > 1 && sections.at(-1).indent >= indent)
325
+ sections.pop();
326
+ const parent = sections.at(-1);
327
+ if (indent !== 0 && (indent < 2 || sections.length === 1))
328
+ continue;
329
+ if (rawValue === '') {
330
+ const section = {};
331
+ parent.value[key] = section;
332
+ sections.push({ indent, value: section });
337
333
  }
338
- else if (currentSection && indent >= 2) {
339
- // Nested key under current section
340
- const section = result[currentSection];
341
- section[key] = parseScalar(rawValue);
334
+ else {
335
+ parent.value[key] = parseScalar(rawValue);
342
336
  }
343
337
  }
344
338
  return result;
@@ -1,4 +1,5 @@
1
1
  import { aggregateModalAnswers } from './ensemble/aggregate.js';
2
+ import { JevReferenceUnavailable } from './openbao-runtime.js';
2
3
  import { readAiwgConfigCandidate } from '../config/aiwg-config.js';
3
4
  import { readFile } from 'node:fs/promises';
4
5
  import { JEV_ENDPOINT, JevDecisionAdapter } from './adapters/jev.js';
@@ -358,8 +359,8 @@ export async function askDecision(input, options = {}) {
358
359
  try {
359
360
  credential = await lookupJevCredential(options);
360
361
  }
361
- catch {
362
- return finish('not-configured');
362
+ catch (error) {
363
+ return finish(error instanceof JevReferenceUnavailable ? 'credential-unavailable' : 'not-configured');
363
364
  }
364
365
  if (!credential?.enabled || !credential.token)
365
366
  return finish('not-configured');
@@ -6,6 +6,8 @@ import path from 'node:path';
6
6
  import { randomUUID } from 'node:crypto';
7
7
  import { JevCredentialError } from './adapters/jev.js';
8
8
  import { readPrivateValueFile } from '../auth/sensitive-input.js';
9
+ import { readJevReference } from '../config/jev-credential-reference.js';
10
+ import { JevReferenceUnavailable, resolveOpenBaoJev } from './openbao-runtime.js';
9
11
  export const JEV_CREDENTIAL_REF = 'typesafe-api';
10
12
  export const JEV_DEFAULT_REGION = 'us';
11
13
  function env(options) {
@@ -77,6 +79,20 @@ export async function lookupJevCredential(options = {}) {
77
79
  const environment = env(options);
78
80
  const forced = environment.AIWG_DECISION_ENABLED;
79
81
  const envToken = environment.JEV_API_KEY?.trim() || environment.AIWG_DECISION_JEV_API_KEY?.trim();
82
+ if (!envToken) {
83
+ try {
84
+ const reference = readJevReference(options);
85
+ if (reference) {
86
+ const { enabled } = resolveDecisionEnablement(options);
87
+ return { source: 'openbao', token: enabled ? await resolveOpenBaoJev(reference, environment) : '', enabled,
88
+ region: environment.AIWG_DECISION_JEV_REGION?.trim() || JEV_DEFAULT_REGION,
89
+ ...(environment.AIWG_DECISION_JEV_ENDPOINT?.trim() ? { endpoint: environment.AIWG_DECISION_JEV_ENDPOINT.trim() } : {}) };
90
+ }
91
+ }
92
+ catch {
93
+ throw new JevReferenceUnavailable();
94
+ }
95
+ }
80
96
  const fileRecord = envToken && (forced === '0' || forced === '1') ? null : await readCredentialFile(options);
81
97
  const enablement = resolveDecisionEnablement(options);
82
98
  const enabled = enablement.source === 'default' ? fileRecord?.enabled === true : enablement.enabled;
@@ -96,6 +112,12 @@ export async function lookupJevCredential(options = {}) {
96
112
  /** Offline metadata-only inspection. Never probes Jev and never returns credential bytes. */
97
113
  export async function inspectJevCredential(options = {}) {
98
114
  try {
115
+ const environment = env(options);
116
+ if (!(environment.JEV_API_KEY?.trim() || environment.AIWG_DECISION_JEV_API_KEY?.trim())) {
117
+ const reference = readJevReference(options);
118
+ if (reference)
119
+ return { configured: true, enabled: resolveDecisionEnablement(options).enabled, source: 'openbao', path: reference.path };
120
+ }
99
121
  const credential = await lookupJevCredential(options);
100
122
  if (!credential)
101
123
  return { configured: false, enabled: false, source: 'none' };
@@ -509,7 +509,7 @@ export async function buildDecisionOffloadSnapshot(options) {
509
509
  since: sessionId ? null : since.toISOString(), windowHours: sessionId ? null : windowHours, generatedAt: now.toISOString() },
510
510
  readiness: {
511
511
  ask: { state: askReadinessState(askConfigured, latestTransportEvidence), configured: credential.configured,
512
- enabled: credential.enabled, source: credential.source, probed: false },
512
+ enabled: credential.enabled, source: credential.source, ...(credential.path ? { path: credential.path } : {}), probed: false },
513
513
  evaluate: { state: evaluateState, enabled: enablement?.enabled ?? null,
514
514
  source: configReadable && enablement ? enablement.source : 'unknown', probed: false },
515
515
  observed: latestObserved ? {
@@ -0,0 +1,96 @@
1
+ // Shared exact-path OpenBao KV policy for runtime and qualification callers.
2
+ export class CredentialResolutionError extends Error {
3
+ constructor(category) {
4
+ super('credential resolution failed');
5
+ this.name = 'CredentialResolutionError';
6
+ this.category = category;
7
+ }
8
+ }
9
+
10
+ const SEGMENT = /^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/;
11
+ const REF = /^[a-z0-9][a-z0-9._-]{0,63}$/;
12
+
13
+ /** Validates the host-only config. It holds locators, never secret values. */
14
+ export function validateResolverConfig(config) {
15
+ const fail = () => { throw new CredentialResolutionError('configuration'); };
16
+ if (!config || typeof config !== 'object' || Array.isArray(config)) fail();
17
+ const allowed = ['schemaVersion', 'addr', 'caFile', 'appRole', 'tokenScript', 'mount', 'refs'];
18
+ if (Object.keys(config).some(key => !allowed.includes(key)) || config.schemaVersion !== 'openbao-kv-resolver-config/v1') fail();
19
+ let addr;
20
+ try { addr = new URL(config.addr); } catch { fail(); }
21
+ if (addr.protocol !== 'https:' || addr.username || addr.password || addr.search || addr.hash || addr.pathname !== '/') fail();
22
+ if (config.caFile !== undefined && (typeof config.caFile !== 'string' || !config.caFile.startsWith('/'))) fail();
23
+ if (!SEGMENT.test(config.appRole ?? '') || typeof config.tokenScript !== 'string' || !config.tokenScript.startsWith('/') || !SEGMENT.test(config.mount ?? '')) fail();
24
+ if (!config.refs || typeof config.refs !== 'object' || Array.isArray(config.refs) || !Object.keys(config.refs).length) fail();
25
+ for (const [ref, target] of Object.entries(config.refs)) {
26
+ if (!REF.test(ref) || !target || typeof target !== 'object' || Object.keys(target).some(key => !['path', 'field'].includes(key))) fail();
27
+ if (typeof target.path !== 'string' || !target.path.split('/').every(part => SEGMENT.test(part))) fail();
28
+ if (target.field !== undefined && !SEGMENT.test(target.field)) fail();
29
+ }
30
+ return config;
31
+ }
32
+
33
+ /**
34
+ * Creates the resolver. `tokenProvider` and `request` are injectable for offline tests.
35
+ * Granted values are cached per logical ref for the run and zeroed by `dispose()`.
36
+ */
37
+ export function createOpenBaoKvResolver(rawConfig, seams) {
38
+ // Refuse a process that has disabled TLS verification globally, even with an injected request seam.
39
+ if (process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0') throw new CredentialResolutionError('configuration');
40
+ const config = validateResolverConfig(rawConfig);
41
+ const tokenProvider = seams.tokenProvider;
42
+ const request = seams.request;
43
+ const entries = [];
44
+ const cache = new Map();
45
+ let token;
46
+ let disposed = false;
47
+ let seq = 0;
48
+ const record = (op, ref, outcome, httpStatus) => { entries.push({ seq: ++seq, op, ref, outcome, httpStatus }); };
49
+ const login = () => {
50
+ token ??= tokenProvider().then(value => { record('login', null, 'granted', null); return value; },
51
+ () => { record('login', null, 'failed', null); throw new CredentialResolutionError('failed'); });
52
+ return token;
53
+ };
54
+ return {
55
+ async resolveCredential(ref) {
56
+ if (disposed) throw new CredentialResolutionError('failed');
57
+ const target = typeof ref === 'string' && REF.test(ref) ? config.refs[ref] : undefined;
58
+ if (!target || !Object.hasOwn(config.refs, ref)) { record('read', REF.test(String(ref)) ? ref : 'invalid-ref', 'configuration', null); throw new CredentialResolutionError('configuration'); }
59
+ if (cache.has(ref)) return new Uint8Array(cache.get(ref));
60
+ const value = await login();
61
+ const url = new URL(`/v1/${config.mount}/data/${target.path}`, config.addr);
62
+ let response;
63
+ try { response = await request(url, { 'X-Vault-Token': value, accept: 'application/json' }); }
64
+ catch { record('read', ref, 'failed', null); throw new CredentialResolutionError('failed'); }
65
+ const status = response?.status ?? 0;
66
+ if (status === 403) { record('read', ref, 'denied', status); throw new CredentialResolutionError('denied'); }
67
+ if (status === 404) { record('read', ref, 'missing', status); throw new CredentialResolutionError('missing'); }
68
+ const data = status === 200 ? response.json?.data?.data : undefined;
69
+ const keys = data && typeof data === 'object' && !Array.isArray(data) ? Object.keys(data) : [];
70
+ const field = target.field ?? (keys.length === 1 ? keys[0] : undefined);
71
+ const secret = field !== undefined && data ? data[field] : undefined;
72
+ if (typeof secret !== 'string' || !secret) { record('read', ref, status === 200 ? 'configuration' : 'failed', status); throw new CredentialResolutionError(status === 200 ? 'configuration' : 'failed'); }
73
+ record('read', ref, 'granted', status);
74
+ const bytes = new TextEncoder().encode(secret);
75
+ cache.set(ref, bytes);
76
+ return new Uint8Array(bytes);
77
+ },
78
+ /** Sanitized: logical refs, operation, outcome and HTTP status only. */
79
+ audit: () => entries.map(entry => ({ ...entry })),
80
+ /** Zeroes cached values and revokes the AppRole token itself. Revocation failure is recorded, never thrown. */
81
+ async dispose() {
82
+ disposed = true;
83
+ for (const bytes of cache.values()) bytes.fill(0);
84
+ cache.clear();
85
+ const pending = token; token = undefined;
86
+ if (!pending) return;
87
+ let value;
88
+ try { value = await pending; } catch { return; }
89
+ try {
90
+ const response = await request(new URL('/v1/auth/token/revoke-self', config.addr), { 'X-Vault-Token': value }, 'POST');
91
+ const status = response?.status ?? 0;
92
+ record('revoke', null, status === 204 || status === 200 ? 'revoked' : 'failed', status);
93
+ } catch { record('revoke', null, 'failed', null); }
94
+ },
95
+ };
96
+ }
@@ -0,0 +1,101 @@
1
+ // Resolve Jev references through the shared KV policy and host native secret store.
2
+ import { request as httpsRequest } from 'node:https';
3
+ import { readFile } from 'node:fs/promises';
4
+ import { createSecretStore } from '../auth/credential-store.js';
5
+ // @ts-expect-error Shared ESM policy also consumed directly by qualification tools.
6
+ import { createOpenBaoKvResolver } from './openbao-kv-resolver.mjs';
7
+ export class JevReferenceUnavailable extends Error {
8
+ constructor() { super('credential-unavailable'); }
9
+ }
10
+ const cache = new Map();
11
+ const safeToken = (value) => typeof value === 'string' && /^[\x21-\x7e]{1,4096}$/.test(value);
12
+ /** Fixed diagnostics, no redirects, bounded body and deadline, verified TLS only. */
13
+ function requestJson(url, method, headers, ca, body) {
14
+ return new Promise((resolve, reject) => {
15
+ const fail = () => { reject(new JevReferenceUnavailable()); };
16
+ const req = httpsRequest(url, { method, headers, ca, rejectUnauthorized: true, timeout: 10_000 }, res => {
17
+ const chunks = [];
18
+ let size = 0;
19
+ res.on('data', (chunk) => {
20
+ size += chunk.length;
21
+ if (size > 64 * 1024) {
22
+ req.destroy();
23
+ fail();
24
+ }
25
+ else
26
+ chunks.push(chunk);
27
+ });
28
+ res.on('error', fail);
29
+ res.on('aborted', fail);
30
+ res.on('end', () => {
31
+ let json;
32
+ try {
33
+ json = JSON.parse(Buffer.concat(chunks).toString('utf8'));
34
+ }
35
+ catch {
36
+ json = null;
37
+ }
38
+ resolve({ status: res.statusCode ?? 0, json });
39
+ });
40
+ });
41
+ const deadline = setTimeout(() => { req.destroy(); fail(); }, 10_000);
42
+ req.on('close', () => clearTimeout(deadline));
43
+ req.on('error', fail);
44
+ req.on('timeout', () => { req.destroy(); fail(); });
45
+ req.end(body);
46
+ });
47
+ }
48
+ export async function resolveOpenBaoJev(ref, env) {
49
+ try {
50
+ const addr = new URL(env.BAO_ADDR?.trim() || ref.addr || '');
51
+ if (addr.protocol !== 'https:' || addr.username || addr.password || addr.search || addr.hash || addr.pathname !== '/'
52
+ || env.NODE_TLS_REJECT_UNAUTHORIZED === '0' || process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0')
53
+ throw new JevReferenceUnavailable();
54
+ const key = JSON.stringify([addr.href, env.BAO_CACERT, ref]);
55
+ let pending = cache.get(key);
56
+ if (!pending) {
57
+ pending = resolveReference(ref, addr, env).catch(() => { cache.delete(key); throw new JevReferenceUnavailable(); });
58
+ cache.set(key, pending);
59
+ }
60
+ return await pending;
61
+ }
62
+ catch {
63
+ throw new JevReferenceUnavailable();
64
+ }
65
+ }
66
+ async function resolveReference(ref, addr, env) {
67
+ const ca = env.BAO_CACERT ? await readFile(env.BAO_CACERT) : undefined;
68
+ const [mount, , ...segments] = ref.path.split('/');
69
+ const resolver = createOpenBaoKvResolver({ schemaVersion: 'openbao-kv-resolver-config/v1', addr: addr.href,
70
+ appRole: ref.auth.role, tokenScript: '/unused-native-store', mount,
71
+ refs: { jev: { path: segments.join('/'), field: ref.field } } }, {
72
+ tokenProvider: async () => {
73
+ const read = (suffix) => createSecretStore({ service: 'aiwg.openbao', account: `${addr.origin}/${ref.auth.role}:${suffix}` }).loadSecret();
74
+ const [roleId, secretId] = await Promise.all([read('role-id'), read('secret-id')]);
75
+ if (!safeToken(roleId) || !safeToken(secretId))
76
+ throw new JevReferenceUnavailable();
77
+ const result = await requestJson(new URL('/v1/auth/approle/login', addr), 'POST', { 'content-type': 'application/json' }, ca, JSON.stringify({ role_id: roleId, secret_id: secretId }));
78
+ const token = result.json?.auth?.client_token;
79
+ if (result.status !== 200 || !safeToken(token))
80
+ throw new JevReferenceUnavailable();
81
+ return token;
82
+ },
83
+ request: (url, headers, method = 'GET') => requestJson(url, method, headers, ca),
84
+ });
85
+ try {
86
+ const bytes = await resolver.resolveCredential('jev');
87
+ try {
88
+ const token = new TextDecoder().decode(bytes);
89
+ if (!safeToken(token))
90
+ throw new JevReferenceUnavailable();
91
+ return token;
92
+ }
93
+ finally {
94
+ bytes.fill(0);
95
+ }
96
+ }
97
+ finally {
98
+ await resolver.dispose();
99
+ }
100
+ }
101
+ //# sourceMappingURL=openbao-runtime.js.map
@@ -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",
@@ -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
@@ -8,6 +8,7 @@ import { PROVIDER_BOOTSTRAP_START, readOptional, resolveProjectRelative, WORKSPA
8
8
  import { BOOTSTRAP_AUTHORITY_SIGNATURE, WORKSPACE_PRECEDENCE_SIGNATURE, WORKSPACE_PRECEDENCE_SUPERSEDED } from './workspace-document.js';
9
9
  import { configuredProviders } from './workspace-migration.js';
10
10
  import { diagnoseCodexHookTrust } from '../hook-bridge/codex-trust.js';
11
+ import { diagnoseFactoryHookTrust } from '../hook-bridge/factory-trust.js';
11
12
  import { maskCodeRegions } from './code-regions.js';
12
13
  export { maskCodeRegions } from './code-regions.js';
13
14
  export function markdownLinks(content) {
@@ -40,6 +41,9 @@ export async function diagnoseWorkspaceContext(projectPath) {
40
41
  const codexTrust = await diagnoseCodexHookTrust(projectPath);
41
42
  if (codexTrust)
42
43
  diagnostics.push(codexTrust);
44
+ const factoryTrust = await diagnoseFactoryHookTrust(projectPath);
45
+ if (factoryTrust)
46
+ diagnostics.push(factoryTrust);
43
47
  const root = path.resolve(projectPath);
44
48
  const scopes = new Map();
45
49
  // Ordinary subdirectories share root policy; repository/project markers start a separate scope.
@@ -0,0 +1,56 @@
1
+ // Read Factory project hook prerequisites without granting trust or creating commits.
2
+ import { execFile } from 'node:child_process';
3
+ import { promises as fs } from 'node:fs';
4
+ import { homedir } from 'node:os';
5
+ import path from 'node:path';
6
+ import { promisify } from 'node:util';
7
+ import { isFactoryManaged, readFactoryDocument } from './factory-hook-config.js';
8
+ const execFileAsync = promisify(execFile);
9
+ export const FACTORY_HOOK_TRUST_NEXT_STEP = 'Trust this folder in droid; project hooks load only in a git repository with at least one commit.';
10
+ export function factoryHookTrustNextStep(trust) {
11
+ return trust && (trust.project !== 'trusted' || !trust.gitCommit) ? FACTORY_HOOK_TRUST_NEXT_STEP : '';
12
+ }
13
+ export async function readFactoryHookTrust(projectPath) {
14
+ const root = path.resolve(projectPath);
15
+ try {
16
+ const doc = readFactoryDocument(path.join(root, '.factory/hooks.json'));
17
+ if (!Object.values(doc.hooks ?? {}).some(groups => groups.some(group => group.hooks.some(hook => hook.type === 'command' && isFactoryManaged(hook)))))
18
+ return null;
19
+ }
20
+ catch {
21
+ // Missing/broken installations are handled by deployment drift checks.
22
+ return null;
23
+ }
24
+ const trust = { project: 'unknown', gitCommit: false };
25
+ try {
26
+ const config = JSON.parse(await fs.readFile(path.join(process.env.HOME || homedir(), '.factory/settings.json'), 'utf8'));
27
+ const folders = config?.trustedFolders;
28
+ // Droid records trust as object keys; values are not trust booleans.
29
+ if (folders && typeof folders === 'object' && !Array.isArray(folders)) {
30
+ trust.project = Object.hasOwn(folders, root) ? 'trusted' : 'untrusted';
31
+ }
32
+ }
33
+ catch {
34
+ // Missing, unreadable, or malformed settings cannot establish trust.
35
+ }
36
+ try {
37
+ await execFileAsync('git', ['rev-parse', '--verify', 'HEAD'], {
38
+ cwd: root, timeout: 2000, maxBuffer: 4096, windowsHide: true,
39
+ });
40
+ trust.gitCommit = true;
41
+ }
42
+ catch {
43
+ // Non-repositories, unborn HEAD, missing git, and timeouts leave this unverified.
44
+ }
45
+ return trust;
46
+ }
47
+ export async function diagnoseFactoryHookTrust(projectPath) {
48
+ const trust = await readFactoryHookTrust(projectPath);
49
+ const nextStep = factoryHookTrustNextStep(trust);
50
+ return trust && nextStep ? {
51
+ severity: 'warning', code: 'factory-hook-trust', path: '.factory/hooks.json',
52
+ message: 'Factory project hooks installed but inactive or unverified. '
53
+ + `Project trust: ${trust.project}; Git commit: ${trust.gitCommit ? 'present' : 'missing or unverified'}. ${nextStep}`,
54
+ } : null;
55
+ }
56
+ //# sourceMappingURL=factory-trust.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiwg/cli",
3
- "version": "2026.11.2",
3
+ "version": "2026.11.3",
4
4
  "description": "Lightweight AIWG CLI for signed, versioned web-backed resources.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -28,6 +28,8 @@ export function formatDecisionOffloadReport(snapshot) {
28
28
  const opportunities = snapshot.opportunities?.organic;
29
29
  lines.push(` Scope: ${snapshot.scope?.mode ?? 'unknown'}${snapshot.scope?.sessionId ? ` (${snapshot.scope.sessionId})` : ''}`);
30
30
  lines.push(` Ask: ${snapshot.readiness?.ask?.state ?? 'unknown'}; evaluate: ${snapshot.readiness?.evaluate?.state ?? 'unknown'} (no probe)`);
31
+ const credential = snapshot.readiness?.ask;
32
+ if (credential?.source) lines.push(` Credential source: ${credential.source}${credential.path ? `; path: ${credential.path}` : ''}`);
31
33
  lines.push(` Completed calls: ${calls?.completed ?? 'unknown'}; answered: ${calls?.answered ?? 'unknown'}; fallback: ${calls?.fallback ?? 'unknown'}`);
32
34
  if (calls) {
33
35
  lines.push(` Estimated LLM tokens avoided: ${calls.llmTokensAvoided}; Jev tokens: ${calls.jevTokens}`);
@@ -43,6 +43,7 @@ const PLUGIN_CONFIGS = {
43
43
  },
44
44
  extraCopy: [
45
45
  { from: 'agentic/code/frameworks/sdlc-complete/templates/issue-comments', to: 'templates/issue-comments' },
46
+ ...['milestone-worker-brief.md', 'verification-oracle-checklist.md'].map(name => ({ from: `agentic/code/frameworks/sdlc-complete/templates/management/${name}`, to: `templates/management/${name}` })),
46
47
  ...['threat-assessment.mjs', 'threat-assessment'].map(name => ({ from: `tools/security/${name}`, to: `tools/security/${name}` })),
47
48
  { from: 'agentic/code/frameworks/sdlc-complete/flows/flow-architecture-evolution.playbook.yaml', to: 'flows/flow-architecture-evolution.playbook.yaml' },
48
49
  { from: 'agentic/code/frameworks/sdlc-complete/flows/flow-release.playbook.yaml', to: 'flows/flow-release.playbook.yaml' }
@@ -301,6 +302,7 @@ Core AIWG utilities for context regeneration and workspace management.
301
302
  },
302
303
  extraCopy: [
303
304
  { from: 'agentic/code/frameworks/sdlc-complete/templates/issue-comments', to: 'templates/issue-comments' },
305
+ ...['milestone-worker-brief.md', 'verification-oracle-checklist.md'].map(name => ({ from: `agentic/code/frameworks/sdlc-complete/templates/management/${name}`, to: `templates/management/${name}` })),
304
306
  { from: 'agentic/code/frameworks/sdlc-complete/flows/flow-architecture-evolution.playbook.yaml', to: 'flows/flow-architecture-evolution.playbook.yaml' },
305
307
  { from: 'agentic/code/frameworks/sdlc-complete/flows/flow-release.playbook.yaml', to: 'flows/flow-release.playbook.yaml' }
306
308
  ],
@@ -336,6 +338,8 @@ Then install in Codex via the \`/plugins\` command or the repo marketplace.
336
338
  agents: 'agentic/code/frameworks/forensics-complete/agents',
337
339
  skills: 'agentic/code/frameworks/forensics-complete/skills'
338
340
  },
341
+ extraCopy: ['evidence-integrity', 'non-destructive'].map(name =>
342
+ ({ from: `agentic/code/frameworks/forensics-complete/rules/${name}.md`, to: `rules/${name}.md` })),
339
343
  readme: `# AIWG Forensics Complete
340
344
 
341
345
  Digital forensics and incident response framework with 14 specialized agents.
@@ -380,7 +384,8 @@ Digital forensics and incident response framework with 14 specialized agents.
380
384
  skills: 'agentic/code/frameworks/security-engineering/skills'
381
385
  },
382
386
  extraCopy: [
383
- { from: 'agentic/code/frameworks/security-engineering/rules/ci-action-pinning.md', to: 'rules/ci-action-pinning.md' }
387
+ { from: 'agentic/code/frameworks/security-engineering/rules/ci-action-pinning.md', to: 'rules/ci-action-pinning.md' },
388
+ { from: 'agentic/code/frameworks/security-engineering/rules/published-port-binding.md', to: 'rules/published-port-binding.md' }
384
389
  ],
385
390
  readme: `# AIWG Security Engineering
386
391
 
@@ -13,12 +13,12 @@ import { homedir } from 'os';
13
13
  import { ProviderAdapter, registerProvider } from './provider-adapter.mjs';
14
14
  import { classifyWorkerHealthFailure, healthEventMatchesBinding } from './worker-health.mjs';
15
15
 
16
- /** Help-only evidence: /home/roctinam/.local/bin/claude 2.1.295, 2026-10-09.
16
+ /** Help-only evidence: /home/roctinam/.local/bin/claude 2.1.319, 2026-11-07.
17
17
  * Exact help excerpts and unavailable controls: docs/providers/claude-direct.md.
18
18
  * No inference or credential inspection was performed to establish this syntax.
19
19
  */
20
20
  export const interfaceVersion = 1;
21
- export const CLAUDE_SUPPORTED_VERSIONS = Object.freeze(['2.1.295']);
21
+ export const CLAUDE_SUPPORTED_VERSIONS = Object.freeze(['>=2.1.295 <2.2.0']);
22
22
  export const CLAUDE_DIRECT_EFFORT_VALUES = Object.freeze(['low', 'medium', 'high', 'xhigh', 'max']);
23
23
  // Named aliases --help documents (opus/sonnet/fable) plus other known moving
24
24
  // pointers: 'default', 'haiku', and the Max-plan 'opusplan' alias. None of