vigthoria-cli 1.13.18 → 1.13.22

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 (185) hide show
  1. package/completions/_vigthoria +49 -0
  2. package/completions/vigthoria.bash +6 -0
  3. package/completions/vigthoria.fish +41 -0
  4. package/dist/commands/auth.d.ts +1 -0
  5. package/dist/commands/auth.js +84 -135
  6. package/dist/commands/background.d.ts +0 -2
  7. package/dist/commands/background.js +26 -34
  8. package/dist/commands/bridge.js +45 -41
  9. package/dist/commands/cancel.d.ts +1 -0
  10. package/dist/commands/cancel.js +22 -16
  11. package/dist/commands/chat.d.ts +5 -42
  12. package/dist/commands/chat.js +462 -1122
  13. package/dist/commands/coding-registration.d.ts +4 -0
  14. package/dist/commands/coding-registration.js +24 -0
  15. package/dist/commands/config.js +32 -42
  16. package/dist/commands/conversation-registration.d.ts +4 -0
  17. package/dist/commands/conversation-registration.js +122 -0
  18. package/dist/commands/deploy.d.ts +8 -2
  19. package/dist/commands/deploy.js +92 -90
  20. package/dist/commands/device.d.ts +1 -2
  21. package/dist/commands/device.js +37 -21
  22. package/dist/commands/doctor-registration.d.ts +4 -0
  23. package/dist/commands/doctor-registration.js +200 -0
  24. package/dist/commands/edit.js +22 -33
  25. package/dist/commands/explain.js +7 -10
  26. package/dist/commands/fork.d.ts +1 -2
  27. package/dist/commands/fork.js +72 -22
  28. package/dist/commands/game.d.ts +1 -1
  29. package/dist/commands/game.js +17 -6
  30. package/dist/commands/generate.js +7 -9
  31. package/dist/commands/history.js +11 -7
  32. package/dist/commands/hub.d.ts +2 -2
  33. package/dist/commands/hub.js +34 -35
  34. package/dist/commands/legion.d.ts +0 -1
  35. package/dist/commands/legion.js +62 -79
  36. package/dist/commands/music.d.ts +1 -2
  37. package/dist/commands/music.js +62 -27
  38. package/dist/commands/platform-registration.d.ts +4 -0
  39. package/dist/commands/platform-registration.js +45 -0
  40. package/dist/commands/preview.d.ts +0 -1
  41. package/dist/commands/preview.js +82 -35
  42. package/dist/commands/product-run-registration.d.ts +4 -0
  43. package/dist/commands/product-run-registration.js +490 -0
  44. package/dist/commands/replay.d.ts +1 -2
  45. package/dist/commands/replay.js +15 -11
  46. package/dist/commands/repo.d.ts +14 -7
  47. package/dist/commands/repo.js +245 -196
  48. package/dist/commands/review.js +9 -12
  49. package/dist/commands/security.d.ts +1 -2
  50. package/dist/commands/security.js +12 -6
  51. package/dist/commands/update-registration.d.ts +3 -0
  52. package/dist/commands/update-registration.js +338 -0
  53. package/dist/commands/v4-registration.d.ts +4 -0
  54. package/dist/commands/v4-registration.js +24 -0
  55. package/dist/commands/v4.d.ts +1 -1
  56. package/dist/commands/v4.js +46 -8
  57. package/dist/commands/wallet.d.ts +1 -3
  58. package/dist/commands/wallet.js +18 -45
  59. package/dist/commands/workflow.d.ts +2 -0
  60. package/dist/commands/workflow.js +52 -39
  61. package/dist/index.js +122 -1498
  62. package/dist/utils/agent-stream-state.d.ts +27 -0
  63. package/dist/utils/agent-stream-state.js +93 -0
  64. package/dist/utils/agentRoute.d.ts +2 -1
  65. package/dist/utils/agentRoute.js +22 -9
  66. package/dist/utils/agentRunOutcome.d.ts +16 -0
  67. package/dist/utils/agentRunOutcome.js +37 -2
  68. package/dist/utils/api-client-factory.d.ts +8 -0
  69. package/dist/utils/api-client-factory.js +8 -0
  70. package/dist/utils/api.d.ts +45 -269
  71. package/dist/utils/api.js +664 -3210
  72. package/dist/utils/auth-session.d.ts +41 -0
  73. package/dist/utils/auth-session.js +224 -0
  74. package/dist/utils/brain-hub-client.d.ts +0 -4
  75. package/dist/utils/brain-hub-client.js +6 -3
  76. package/dist/utils/bridge-client.js +2 -0
  77. package/dist/utils/capability-health-service.d.ts +48 -0
  78. package/dist/utils/capability-health-service.js +64 -0
  79. package/dist/utils/chat-prompt-policy.d.ts +18 -0
  80. package/dist/utils/chat-prompt-policy.js +61 -0
  81. package/dist/utils/chat-tool-call-parser.d.ts +11 -0
  82. package/dist/utils/chat-tool-call-parser.js +71 -0
  83. package/dist/utils/cli-state.d.ts +22 -4
  84. package/dist/utils/cli-state.js +105 -47
  85. package/dist/utils/code-operations-service.d.ts +104 -0
  86. package/dist/utils/code-operations-service.js +837 -0
  87. package/dist/utils/codebase-indexer.d.ts +1 -0
  88. package/dist/utils/codebase-indexer.js +28 -8
  89. package/dist/utils/command-contract.d.ts +61 -0
  90. package/dist/utils/command-contract.js +149 -0
  91. package/dist/utils/command-policy.d.ts +10 -0
  92. package/dist/utils/command-policy.js +54 -0
  93. package/dist/utils/config.d.ts +13 -5
  94. package/dist/utils/config.js +227 -99
  95. package/dist/utils/context-ranker.js +11 -2
  96. package/dist/utils/context-state.d.ts +39 -0
  97. package/dist/utils/context-state.js +52 -0
  98. package/dist/utils/deckEvents.d.ts +0 -5
  99. package/dist/utils/deckEvents.js +3 -2
  100. package/dist/utils/desktop-bridge-client.js +2 -0
  101. package/dist/utils/direct-output-policy.d.ts +3 -0
  102. package/dist/utils/direct-output-policy.js +76 -0
  103. package/dist/utils/durable-json.d.ts +57 -0
  104. package/dist/utils/durable-json.js +319 -0
  105. package/dist/utils/fastAgentRouter.d.ts +6 -7
  106. package/dist/utils/fastAgentRouter.js +21 -30
  107. package/dist/utils/files.js +21 -13
  108. package/dist/utils/frontend-preview-service.d.ts +76 -0
  109. package/dist/utils/frontend-preview-service.js +482 -0
  110. package/dist/utils/goaEvents.d.ts +0 -4
  111. package/dist/utils/goaEvents.js +5 -2
  112. package/dist/utils/logger.d.ts +2 -1
  113. package/dist/utils/logger.js +27 -20
  114. package/dist/utils/mcp-context-client.d.ts +24 -0
  115. package/dist/utils/mcp-context-client.js +58 -0
  116. package/dist/utils/model-governance.d.ts +18 -0
  117. package/dist/utils/model-governance.js +75 -0
  118. package/dist/utils/model-transport-service.d.ts +44 -0
  119. package/dist/utils/model-transport-service.js +111 -0
  120. package/dist/utils/mutation-journal.d.ts +42 -0
  121. package/dist/utils/mutation-journal.js +387 -0
  122. package/dist/utils/network-policy.d.ts +24 -0
  123. package/dist/utils/network-policy.js +202 -0
  124. package/dist/utils/operator-client.d.ts +45 -0
  125. package/dist/utils/operator-client.js +159 -0
  126. package/dist/utils/post-write-validator.js +7 -9
  127. package/dist/utils/preview-screenshot-adapter.d.ts +13 -0
  128. package/dist/utils/preview-screenshot-adapter.js +36 -0
  129. package/dist/utils/process-policy.d.ts +23 -0
  130. package/dist/utils/process-policy.js +284 -0
  131. package/dist/utils/project-memory.d.ts +13 -3
  132. package/dist/utils/project-memory.js +70 -17
  133. package/dist/utils/prompt-workspace-resolver.d.ts +14 -0
  134. package/dist/utils/prompt-workspace-resolver.js +64 -0
  135. package/dist/utils/release-install.d.ts +11 -0
  136. package/dist/utils/release-install.js +155 -0
  137. package/dist/utils/release-policy.d.ts +64 -0
  138. package/dist/utils/release-policy.js +293 -0
  139. package/dist/utils/requestIntent.js +22 -3
  140. package/dist/utils/runtime-capability.d.ts +8 -0
  141. package/dist/utils/runtime-capability.js +16 -0
  142. package/dist/utils/secret-policy.d.ts +20 -0
  143. package/dist/utils/secret-policy.js +160 -0
  144. package/dist/utils/session.d.ts +34 -2
  145. package/dist/utils/session.js +354 -110
  146. package/dist/utils/tool-approval-service.d.ts +17 -0
  147. package/dist/utils/tool-approval-service.js +78 -0
  148. package/dist/utils/tool-capability-providers.d.ts +57 -0
  149. package/dist/utils/tool-capability-providers.js +57 -0
  150. package/dist/utils/tools.d.ts +2 -23
  151. package/dist/utils/tools.js +216 -508
  152. package/dist/utils/update-policy.d.ts +18 -0
  153. package/dist/utils/update-policy.js +137 -0
  154. package/dist/utils/v3-agent-client.d.ts +40 -0
  155. package/dist/utils/v3-agent-client.js +165 -0
  156. package/dist/utils/v3-workspace-service.d.ts +28 -0
  157. package/dist/utils/v3-workspace-service.js +279 -0
  158. package/dist/utils/vigflow-client.d.ts +95 -0
  159. package/dist/utils/vigflow-client.js +105 -0
  160. package/dist/utils/workspace-boundary.d.ts +45 -0
  161. package/dist/utils/workspace-boundary.js +377 -0
  162. package/dist/utils/workspace-brain-service.d.ts +2 -0
  163. package/dist/utils/workspace-brain-service.js +11 -1
  164. package/dist/utils/workspace-cache.js +37 -15
  165. package/dist/utils/workspace-stream.js +35 -10
  166. package/install.ps1 +86 -143
  167. package/install.sh +76 -81
  168. package/package.json +44 -9
  169. package/release-policy.json +43 -0
  170. package/scripts/release/LOCAL_MACHINE_USER_VERIFICATION.md +1 -1
  171. package/scripts/release/generate-completions.mjs +24 -0
  172. package/scripts/release/install-release.mjs +10 -0
  173. package/scripts/release/publish-cli-release.mjs +116 -0
  174. package/scripts/release/publish-cli-release.sh +2 -70
  175. package/scripts/release/resolve-release-manifest.mjs +26 -0
  176. package/scripts/release/test-balanced-model-live.sh +42 -0
  177. package/scripts/release/validate-live-service-gates.sh +90 -0
  178. package/scripts/release/validate-no-go-gates.sh +135 -172
  179. package/scripts/release/verify-runtime-consistency.mjs +4 -1
  180. package/dist/commands/index.d.ts +0 -12
  181. package/dist/commands/index.js +0 -194
  182. package/dist/commands/update.d.ts +0 -9
  183. package/dist/commands/update.js +0 -301
  184. package/dist/utils/templateInstantPath.d.ts +0 -18
  185. package/dist/utils/templateInstantPath.js +0 -228
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ assertReleaseUrl,
4
+ getReleasePolicy,
5
+ parseReleaseManifestText,
6
+ verifyReleaseSignature,
7
+ } from '../../dist/utils/release-policy.js';
8
+
9
+ const policy = getReleasePolicy();
10
+ const manifestUrl = process.argv[2] || policy.origins.manifest;
11
+ const channel = process.argv[3] || 'stable';
12
+ async function read(url, accept) {
13
+ assertReleaseUrl(url, url === manifestUrl ? 'manifest' : 'signature');
14
+ const response = await fetch(url, {
15
+ redirect: 'manual',
16
+ signal: AbortSignal.timeout(15_000),
17
+ headers: { Accept: accept },
18
+ });
19
+ if (!response.ok || [301, 302, 303, 307, 308].includes(response.status)) throw new Error(`Release resource returned HTTP ${response.status}; redirects are prohibited.`);
20
+ return response.text();
21
+ }
22
+ const manifestText = await read(manifestUrl, 'application/json');
23
+ const entry = parseReleaseManifestText(manifestText, channel);
24
+ const detached = await read(entry.signature.url, 'application/octet-stream');
25
+ verifyReleaseSignature(channel, entry, detached);
26
+ process.stdout.write(`${JSON.stringify(entry)}\n`);
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
5
+ cd "$ROOT"
6
+
7
+ block() {
8
+ echo "BLOCKED: $*" >&2
9
+ exit 2
10
+ }
11
+
12
+ [[ -n "${VIGTHORIA_AUTH_TOKEN:-}" ]] || block "VIGTHORIA_AUTH_TOKEN is required for the credentialed balanced-model probe"
13
+ [[ -n "${VIGTHORIA_SELF_HOSTED_MODELS_API_URL:-}" ]] || block "VIGTHORIA_SELF_HOSTED_MODELS_API_URL is required for the live model infrastructure"
14
+ [[ -x dist/index.js ]] || block "dist/index.js is unavailable; build the candidate first"
15
+
16
+ MODELS_HEALTH="${VIGTHORIA_SELF_HOSTED_MODELS_API_URL%/}/health"
17
+ if ! curl --silent --show-error --fail --connect-timeout 5 --max-time 15 "$MODELS_HEALTH" >/dev/null; then
18
+ block "balanced-model infrastructure is unavailable at the configured endpoint"
19
+ fi
20
+
21
+ PROBE_TMP="$(mktemp -d "${TMPDIR:-/tmp}/vigthoria-balanced-live.XXXXXX")"
22
+ trap 'rm -rf "$PROBE_TMP"' EXIT
23
+
24
+ for attempt in 1 2 3; do
25
+ if node dist/index.js chat --no-agent --model balanced-4b --prompt "reply exactly: ok" --json >"$PROBE_TMP/balanced.json"; then
26
+ break
27
+ fi
28
+ if [[ "$attempt" == "3" ]]; then
29
+ block "balanced-4b remained unavailable after 3 bounded attempts"
30
+ fi
31
+ echo "[retry] balanced-4b transient failure ($attempt/3)"
32
+ sleep 2
33
+ done
34
+
35
+ BALANCED_RESULT="$PROBE_TMP/balanced.json" node --input-type=module - <<'EOF'
36
+ import fs from 'node:fs';
37
+ const result = JSON.parse(fs.readFileSync(process.env.BALANCED_RESULT, 'utf8'));
38
+ if (result.success !== true) throw new Error(`balanced probe failed: ${JSON.stringify(result)}`);
39
+ const allowed = new Set(['Vigthoria-v4-Assistant-9B', 'vigthoria-balanced-4b', 'vigthoria-v3-balanced-4b']);
40
+ if (!allowed.has(result.model)) throw new Error(`unexpected balanced model: ${result.model}`);
41
+ console.log('[pass] credentialed balanced-4b live probe');
42
+ EOF
@@ -0,0 +1,90 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
5
+ cd "$ROOT"
6
+
7
+ block() {
8
+ echo "BLOCKED: $*" >&2
9
+ exit 2
10
+ }
11
+
12
+ [[ -n "${VIGTHORIA_AUTH_TOKEN:-}" ]] || block "an authorized live-test credential is required"
13
+ [[ -n "${VIGTHORIA_SELF_HOSTED_MODELS_API_URL:-}" ]] || block "the live models endpoint is not configured"
14
+ [[ -n "${VIGTHORIA_V3_AGENT_URL:-}" ]] || block "the live V3 endpoint is not configured"
15
+ [[ -n "${VIGTHORIA_TEMPLATE_SERVICE_URL:-}" ]] || block "the live Template Service endpoint is not configured"
16
+ [[ -x dist/index.js ]] || block "dist/index.js is unavailable; build the candidate first"
17
+
18
+ LIVE_TMP="$(mktemp -d "${TMPDIR:-/tmp}/vigthoria-live-services.XXXXXX")"
19
+ trap 'rm -rf "$LIVE_TMP"' EXIT
20
+ export VIGTHORIA_NO_BANNER=1
21
+ export VIGTHORIA_NO_UPDATE_CHECK=1
22
+
23
+ echo "[AUTH PREFLIGHT] invalid session message"
24
+ VIGTHORIA_AUTH_TOKEN=invalid-token-for-preflight node dist/index.js chat --no-agent --model balanced-4b --prompt "ok" --json >"$LIVE_TMP/auth.json" 2>/dev/null || true
25
+ AUTH_RESULT="$LIVE_TMP/auth.json" node --input-type=module - <<'EOF'
26
+ import fs from 'node:fs';
27
+ const result = JSON.parse(fs.readFileSync(process.env.AUTH_RESULT, 'utf8'));
28
+ const expected = 'Vigthoria Gate way user authentification failed. Please log out and login again.';
29
+ if (result.success !== false || result.error !== expected) throw new Error(`unexpected auth preflight: ${JSON.stringify(result)}`);
30
+ console.log('[pass] live auth preflight message');
31
+ EOF
32
+
33
+ echo "[6.2] balanced-4b credentialed probe"
34
+ bash scripts/release/test-balanced-model-live.sh
35
+
36
+ echo "[6.9/6.12] live aliases"
37
+ node dist/index.js hyper-loop status >"$LIVE_TMP/hyperloop.txt"
38
+ node dist/index.js devtools status >"$LIVE_TMP/devtools.txt"
39
+
40
+ echo "[7.1/7.3/7.4] configured live service health"
41
+ for url in "${VIGTHORIA_V3_AGENT_URL%/}/health" "${VIGTHORIA_SELF_HOSTED_MODELS_API_URL%/}/health" "${VIGTHORIA_TEMPLATE_SERVICE_URL%/}/health"; do
42
+ if ! code="$(curl --silent --show-error --connect-timeout 5 --max-time 15 --output /dev/null --write-out '%{http_code}' "$url")"; then
43
+ block "live infrastructure is unavailable at $url"
44
+ fi
45
+ echo "$url => $code"
46
+ [[ "$code" == "200" ]] || block "live infrastructure returned HTTP $code at $url"
47
+ done
48
+
49
+ echo "[7.2/7.8/12.3] live models inventory"
50
+ MODELS_INVENTORY="${VIGTHORIA_SELF_HOSTED_MODELS_API_URL%/}/v1/models"
51
+ if ! curl --silent --show-error --fail --connect-timeout 5 --max-time 15 "$MODELS_INVENTORY" >"$LIVE_TMP/models.json"; then
52
+ block "model inventory is unavailable"
53
+ fi
54
+ MODELS_RESULT="$LIVE_TMP/models.json" node --input-type=module - <<'EOF'
55
+ import fs from 'node:fs';
56
+ const ids = new Set((JSON.parse(fs.readFileSync(process.env.MODELS_RESULT, 'utf8')).data || []).map((model) => model.id || ''));
57
+ const hasRouter = ['Vigthoria-v4-Assistant-9B', 'vigthoria-balanced-4b', 'vigthoria-balanced-4b:latest', 'vigthoria-v3-balanced-4b', 'vigthoria-v3-balanced-4b:latest', 'vigthoria-fast-9b', 'vigthoria-fast-9b:latest'].some((model) => ids.has(model));
58
+ const hasCreative = ['Vigthoria-v4-Creative-27B', 'vigthoria-creative-9b-v4', 'vigthoria-creative-9b-v4:latest', 'vigthoria-fast-9b', 'vigthoria-fast-9b:latest'].some((model) => ids.has(model));
59
+ const hasCode = ids.has('Vigthoria-v4-Code-27B') || [...ids].some((model) => /^vigthoria-v3(?:\.\d+)?-code-35b(?:-|:|$)/.test(model));
60
+ if (!hasRouter || !hasCreative || !hasCode) throw new Error(`required model families missing: ${JSON.stringify([...ids].sort())}`);
61
+ console.log('[pass] live model inventory gates');
62
+ EOF
63
+
64
+ echo "[7.5 policy] secured hosted HyperLoop endpoint"
65
+ if ! code="$(curl --silent --show-error --connect-timeout 5 --max-time 15 --output /dev/null --write-out '%{http_code}' https://coder.vigthoria.io/api/hyperloop/health)"; then
66
+ block "hosted HyperLoop endpoint is unavailable"
67
+ fi
68
+ echo "unauth_hyperloop_code=$code"
69
+ [[ "$code" == "401" || "$code" == "302" ]]
70
+
71
+ echo "[12.1] live no-agent governance fallback"
72
+ for attempt in 1 2 3; do
73
+ if node dist/index.js chat --no-agent --model creative-v4 --prompt "say ok" --json >"$LIVE_TMP/creative.json"; then
74
+ break
75
+ fi
76
+ if [[ "$attempt" == "3" ]]; then
77
+ block "governance fallback remained unavailable after 3 bounded attempts"
78
+ fi
79
+ echo "[retry] governance fallback transient failure ($attempt/3)"
80
+ sleep 2
81
+ done
82
+ CREATIVE_RESULT="$LIVE_TMP/creative.json" node --input-type=module - <<'EOF'
83
+ import fs from 'node:fs';
84
+ const result = JSON.parse(fs.readFileSync(process.env.CREATIVE_RESULT, 'utf8'));
85
+ if (result.success !== true || result.model !== 'Vigthoria-v4-Code-27B') throw new Error(`unexpected governance result: ${JSON.stringify(result)}`);
86
+ if (result.metadata?.modelFallback?.reason !== 'governance-blocked-model') throw new Error(`missing governance fallback metadata: ${JSON.stringify(result)}`);
87
+ console.log('[pass] live governance fallback metadata');
88
+ EOF
89
+
90
+ echo "ALL CREDENTIALED LIVE SERVICE GATES PASSED"
@@ -4,60 +4,112 @@ set -euo pipefail
4
4
  ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
5
5
  cd "$ROOT"
6
6
 
7
- CLI="node dist/index.js"
8
- SERVICE_IDENTITY_MODE="${VIGTHORIA_TEST_SERVICE_IDENTITY:-0}"
9
- unset V3_SERVICE_KEY
10
- unset HYPERLOOP_SERVICE_KEY
11
- # Release validation runs against local model-router in this environment
12
- export VIGTHORIA_SELF_HOSTED_MODELS_API_URL="http://127.0.0.1:4009"
13
-
14
- echo "[0.1-0.6] source/dist consistency"
15
- node scripts/release/verify-runtime-consistency.mjs >/tmp/vig-verify-runtime.json
16
- cat /tmp/vig-verify-runtime.json
17
-
18
- echo "[0.2] build exits 0"
19
- npm run build >/tmp/vig-build.log 2>&1
20
-
21
- echo "[0.3] dist/index.js exists"
22
- [[ -x dist/index.js ]]
23
-
24
- echo "[AUTH PREFLIGHT] invalid session message"
25
- AUTH_JSON=$(VIGTHORIA_AUTH_TOKEN=invalid-token-for-preflight $CLI chat --no-agent --model balanced-4b --prompt "ok" --json 2>/dev/null || true)
26
- echo "$AUTH_JSON"
27
- printf '%s
28
- ' "$AUTH_JSON" > /tmp/vig-auth-preflight.json
29
- python3 - << 'PY'
30
- import json
31
- import re
32
- with open('/tmp/vig-auth-preflight.json','r',encoding='utf-8') as f:
33
- j=json.load(f)
34
- msg='Vigthoria Gate way user authentification failed. Please log out and login again.'
35
- assert j.get('success') is False, 'expected success=false for invalid token preflight'
36
- assert j.get('error') == msg, f"unexpected auth message: {j.get('error')}"
37
- print('[pass] auth preflight message')
38
- PY
39
-
40
- if [[ "$SERVICE_IDENTITY_MODE" == "1" ]]; then
41
- # From this point onward the no-go suite exercises server-local model and
42
- # tool routes without borrowing a human account session. The invalid-token
43
- # gateway assertion above always runs against the canonical public boundary.
44
- export VIGTHORIA_LOCAL_TEST_MODE=1
45
- export VIGTHORIA_LOCAL_TEST_TOKEN="vigthoria-release-service-identity"
46
- export VIGTHORIA_AUTH_TOKEN="$VIGTHORIA_LOCAL_TEST_TOKEN"
47
- fi
48
-
49
- echo "[1.1] ranker includes agent.py top10 for SSE prompt"
50
- node - << 'EOF2'
51
- import('./dist/utils/context-ranker.js').then((m)=>{
52
- const r=m.buildSemanticContext('/var/www/V3-Code-Agent','fix the streaming SSE event handler',10);
53
- const idx=r.topFiles.findIndex((f)=>f.path==='agent.py');
54
- console.log('agent_idx_top10=' + idx);
55
- if (idx < 0) process.exit(1);
56
- });
57
- EOF2
58
-
59
- echo "[2.1/2.4] tsc validator emits passing result"
60
- node --input-type=module - << 'EOF2'
7
+ VALIDATION_TMP="$(mktemp -d "${TMPDIR:-/tmp}/vigthoria-no-go.XXXXXX")"
8
+ trap 'rm -rf "$VALIDATION_TMP"' EXIT
9
+ mkdir -p "$VALIDATION_TMP/home"
10
+
11
+ export HOME="$VALIDATION_TMP/home"
12
+ export USERPROFILE="$HOME"
13
+ export npm_config_cache="$VALIDATION_TMP/npm-cache"
14
+ export npm_config_update_notifier=false
15
+ export VIGTHORIA_NO_BANNER=1
16
+ export VIGTHORIA_NO_UPDATE_CHECK=1
17
+ export VIGTHORIA_OFFLINE=1
18
+ unset VIGTHORIA_AUTH_TOKEN VIGTHORIA_TOKEN VIGTHORIA_LOCAL_TEST_MODE
19
+ unset VIGTHORIA_LOCAL_TEST_TOKEN V3_SERVICE_KEY HYPERLOOP_SERVICE_KEY
20
+ unset VIGTHORIA_API_URL VIGTHORIA_MODELS_API_URL
21
+ unset VIGTHORIA_SELF_HOSTED_MODELS_API_URL VIGTHORIA_V3_AGENT_URL
22
+
23
+ echo "[0.1] clean build"
24
+ npm run build >"$VALIDATION_TMP/build.log" 2>&1
25
+
26
+ echo "[0.2] source/dist consistency"
27
+ node scripts/release/verify-runtime-consistency.mjs >"$VALIDATION_TMP/runtime.json"
28
+ cat "$VALIDATION_TMP/runtime.json"
29
+
30
+ echo "[0.3] package, lockfile, and runtime identity"
31
+ node --input-type=module - <<'EOF'
32
+ import fs from 'node:fs';
33
+ import { spawnSync } from 'node:child_process';
34
+ const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
35
+ const lock = JSON.parse(fs.readFileSync('package-lock.json', 'utf8'));
36
+ const runtime = spawnSync(process.execPath, ['dist/index.js', '--version'], { encoding: 'utf8' });
37
+ if (runtime.status !== 0) throw new Error(runtime.stderr || 'runtime --version failed');
38
+ const versions = [pkg.version, lock.version, lock.packages?.['']?.version, runtime.stdout.trim()];
39
+ if (new Set(versions).size !== 1) throw new Error(`identity mismatch: ${versions.join(', ')}`);
40
+ console.log(`[pass] identity ${versions[0]}`);
41
+ EOF
42
+
43
+ echo "[0.4] strict TypeScript compilation"
44
+ ./node_modules/.bin/tsc --noEmit
45
+
46
+ echo "[0.5] source, import, command, JSON, and golden contracts"
47
+ node scripts/run-test-suite.mjs check
48
+ node scripts/architecture/verify-source-boundaries.mjs
49
+ node scripts/architecture/verify-import-graph.mjs --check
50
+ node scripts/architecture/capture-command-manifest.mjs --check
51
+ node scripts/architecture/verify-json-contracts.mjs
52
+ node scripts/architecture/capture-golden-contracts.mjs --check
53
+
54
+ echo "[0.6] package hygiene"
55
+ node scripts/verify-package-hygiene.js
56
+
57
+ echo "[0.7] authoritative Phase 1 security contracts"
58
+ node scripts/test-dependency-security.mjs
59
+ node scripts/test-network-policy.mjs
60
+ node scripts/test-installer-trust-policy.mjs
61
+ node scripts/test-workspace-archive-containment.mjs
62
+ node scripts/test-public-repo-clone.mjs
63
+ node scripts/test-process-approval-safety.mjs
64
+ node scripts/test-mutation-preview-transaction.mjs
65
+ node scripts/test-preview-screenshot-adapter.mjs
66
+ node scripts/test-frontend-preview-service.mjs
67
+ node scripts/test-prompt-workspace-resolver.mjs
68
+ node scripts/test-context-secret-hygiene.mjs
69
+ node scripts/test-vigflow-client.mjs
70
+ node scripts/test-operator-client.mjs
71
+ node scripts/test-mcp-context-client.mjs
72
+ node scripts/test-code-operations-service.mjs
73
+ node scripts/test-capability-health-service.mjs
74
+ node scripts/test-model-transport-service.mjs
75
+ node scripts/test-chat-tool-call-parser.mjs
76
+ node scripts/test-chat-prompt-policy.mjs
77
+ node scripts/test-tool-capability-providers.mjs
78
+ node scripts/test-agent-stream-state.mjs
79
+ node scripts/test-direct-output-policy.mjs
80
+
81
+ echo "[0.8] authoritative Phase 2 state/auth/session contracts"
82
+ node scripts/test-durable-json-state.mjs
83
+ node scripts/test-auth-state.mjs
84
+ node scripts/test-session-durable-lifecycle.mjs
85
+ node scripts/test-session-project-match.mjs
86
+ node scripts/test-external-client-resume.mjs
87
+ node scripts/test-context-state-ownership.mjs
88
+ node scripts/test-game-command.mjs
89
+
90
+ echo "[0.9] Phase 3 command error/exit/JSON foundation"
91
+ node scripts/test-command-contract.mjs
92
+ node scripts/test-update-policy.mjs
93
+ node scripts/test-release-delivery.mjs
94
+ node scripts/test-timeout-cancellation.mjs
95
+
96
+ echo "[1.1] ranker includes agent.py in top 10 for an SSE prompt"
97
+ RANKER_FIXTURE="$VALIDATION_TMP/ranker" node --input-type=module - <<'EOF'
98
+ import fs from 'node:fs';
99
+ import path from 'node:path';
100
+ import { buildSemanticContext } from './dist/utils/context-ranker.js';
101
+ const fixture = process.env.RANKER_FIXTURE;
102
+ fs.mkdirSync(fixture, { recursive: true });
103
+ fs.writeFileSync(path.join(fixture, 'agent.py'), 'def stream_sse_event():\n return "event: done"\n');
104
+ fs.writeFileSync(path.join(fixture, 'unrelated.txt'), 'static documentation\n');
105
+ const result = buildSemanticContext(fixture, 'fix the streaming SSE event handler', 10);
106
+ const index = result.topFiles.findIndex((file) => file.path === 'agent.py');
107
+ console.log(`agent_idx_top10=${index}`);
108
+ if (index < 0) process.exit(1);
109
+ EOF
110
+
111
+ echo "[2.1/2.4] TypeScript post-write validator"
112
+ node --input-type=module - <<'EOF'
61
113
  import fs from 'node:fs';
62
114
  import os from 'node:os';
63
115
  import path from 'node:path';
@@ -66,125 +118,36 @@ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'vig-tsc-'));
66
118
  fs.mkdirSync(path.join(tmp, 'src'));
67
119
  fs.writeFileSync(path.join(tmp, 'tsconfig.json'), JSON.stringify({ compilerOptions: { target: 'ES2020', module: 'ESNext' }, include: ['src/**/*.ts'] }));
68
120
  fs.writeFileSync(path.join(tmp, 'src', 'index.ts'), 'export const ok:number = 1;\n');
69
- const res = await runPostWriteValidation(tmp);
70
- const tsc = res.find((r)=>r.tool==='tsc');
121
+ const results = await runPostWriteValidation(tmp);
122
+ const tsc = results.find((result) => result.tool === 'tsc');
71
123
  console.log(JSON.stringify(tsc || null));
72
124
  if (!tsc || !tsc.ran || !tsc.passed) process.exit(1);
73
- EOF2
74
-
75
- echo "[6.2] balanced-4b no-agent path"
76
- for attempt in 1 2 3; do
77
- if $CLI chat --no-agent --model balanced-4b --prompt "reply exactly: ok" --json >/tmp/vig-balanced.json; then
78
- break
79
- fi
80
- if [[ "$attempt" == "3" ]]; then
81
- echo "[fail] balanced-4b remained unavailable after 3 attempts"
82
- exit 1
83
- fi
84
- echo "[retry] balanced-4b transient failure ($attempt/3)"
85
- sleep 2
86
- done
87
- python3 - << 'PY'
88
- import json
89
- j=json.load(open('/tmp/vig-balanced.json'))
90
- assert j.get('success') is True
91
- assert j.get('model') in ('vigthoria-balanced-4b', 'vigthoria-v3-balanced-4b'), j
92
- print('[pass] balanced-4b')
93
- PY
94
-
95
- echo "[6.9/6.12] aliases available"
96
- $CLI hyper-loop status >/tmp/vig-hyperloop.txt
97
- $CLI devtools connect >/tmp/vig-devtools.txt
98
-
99
- echo "[6.11] operator flow"
100
- if [[ "$SERVICE_IDENTITY_MODE" == "1" ]]; then
101
- echo "[skip] paid-user operator probe (isolated release service identity)"
102
- else
103
- $CLI operator --prompt "reply with exactly: OK" --json >/tmp/vig-operator.json
104
- python3 - << 'PY'
105
- import json
106
- j=json.load(open('/tmp/vig-operator.json'))
107
- assert j.get('success') is True, j
108
- print('[pass] operator flow')
109
- PY
110
- fi
111
-
112
- echo "[7.1/7.3/7.4] local service health"
113
- for u in http://localhost:8030/health http://localhost:4009/health http://localhost:4011/health; do
114
- code=$(curl -s -o /dev/null -w "%{http_code}" "$u")
115
- echo "$u => $code"
116
- [[ "$code" == "200" ]]
117
- done
118
-
119
- echo "[7.2/7.8/12.3] models inventory"
120
- curl -s http://localhost:4009/v1/models >/tmp/vig-models.json
121
- python3 - << 'PY'
122
- import json
123
- import re
124
- ids={m.get('id','') for m in json.load(open('/tmp/vig-models.json')).get('data',[])}
125
- if ids:
126
- has_router = any(
127
- m in ids for m in (
128
- 'vigthoria-balanced-4b', 'vigthoria-balanced-4b:latest',
129
- 'vigthoria-v3-balanced-4b', 'vigthoria-v3-balanced-4b:latest',
130
- 'vigthoria-fast-9b', 'vigthoria-fast-9b:latest',
131
- )
132
- )
133
- has_creative = any(
134
- m in ids for m in (
135
- 'vigthoria-creative-9b-v4', 'vigthoria-creative-9b-v4:latest',
136
- 'vigthoria-fast-9b', 'vigthoria-fast-9b:latest',
137
- )
138
- )
139
- has_code = any(re.search(r'^vigthoria-v3(?:\.\d+)?-code-35b(?:-|:|$)', i) for i in ids)
140
- assert has_router, f'missing router model in inventory: {sorted(ids)}'
141
- assert has_creative, f'missing creative/fast model in inventory: {sorted(ids)}'
142
- assert has_code, f'missing code model in inventory: {sorted(ids)}'
143
- else:
144
- print('[warn] model inventory empty on this host; route proof above is authoritative')
145
- print('[pass] model inventory gates')
146
- PY
147
-
148
- echo "[7.5 policy] secured hyperloop endpoint"
149
- code=$(curl -s -o /dev/null -w "%{http_code}" https://coder.vigthoria.io/api/hyperloop/health)
150
- echo "unauth_hyperloop_code=$code"
151
- # 401 = correct JSON auth error for API callers. 302 (redirect to /login) is
152
- # also acceptable defense-in-depth: it still requires auth, just via the
153
- # browser-session redirect path some legacy middleware uses.
154
- [[ "$code" == "401" || "$code" == "302" ]]
125
+ EOF
126
+
127
+ echo "[6.2/12.1] deterministic routing and model-governance contracts"
128
+ node scripts/test-request-intent.js
129
+ VIGTHORIA_AGENT_LLM_ROUTER=0 node scripts/test-agent-route.js
130
+ VIGTHORIA_AGENT_LLM_ROUTER=0 node scripts/test-local-use-cases.js
131
+ node scripts/test-fast-router-capability.js
132
+ node scripts/test-agent-routing-policy.js
133
+ node scripts/test-model-governance-no-agent.js
134
+ node scripts/test-model-governance.mjs
135
+
136
+ echo "[context] deterministic budget, path, stream, error, and outcome contracts"
137
+ node scripts/test-context-budget.js
138
+ node scripts/test-v3-workspace-path.js
139
+ node scripts/test-v3-stream-events.js
140
+ node scripts/test-v3-agent-client.mjs
141
+ node scripts/test-v3-workspace-service.mjs
142
+ node scripts/test-error-wording.mjs
143
+ node scripts/test-agent-run-outcome.js
155
144
 
156
145
  echo "[8.2] runtime symlink guard signals"
157
- rg -n "realpathSync|results.length >= maxFiles|pattern = kw.length <= 4" dist/utils/context-ranker.js >/tmp/vig-ranker-signals.txt
158
- cat /tmp/vig-ranker-signals.txt
159
-
160
- echo "[9.5/9.7/9.16] release URL consistency"
161
- rg -n "coder.vigthoria.io/releases" install.ps1 install.sh README.md >/tmp/vig-release-urls.txt
162
- cat /tmp/vig-release-urls.txt
163
-
164
- echo "[12.1] no-agent governance fallback"
165
- for attempt in 1 2 3; do
166
- if $CLI chat --no-agent --model creative --prompt "say ok" --json >/tmp/vig-creative.json; then
167
- break
168
- fi
169
- if [[ "$attempt" == "3" ]]; then
170
- echo "[fail] governance fallback remained unavailable after 3 attempts"
171
- exit 1
172
- fi
173
- echo "[retry] governance fallback transient failure ($attempt/3)"
174
- sleep 2
175
- done
176
- python3 - << 'PY'
177
- import json
178
- j=json.load(open('/tmp/vig-creative.json'))
179
- assert j.get('success') is True
180
- assert j.get('model') == 'vigthoria-v3-code-35b', j
181
- md=j.get('metadata') or {}
182
- fb=md.get('modelFallback') or {}
183
- assert fb.get('reason') == 'governance-blocked-model', j
184
- print('[pass] governance fallback metadata')
185
- PY
186
-
187
- echo "[outcome-truth] agent run outcome regression"
188
- npm run test:agent:outcome
189
-
190
- echo "ALL NO-GO GATES PASSED"
146
+ rg -n "realpathSync|results.length >= maxFiles|pattern = kw.length <= 4" dist/utils/context-ranker.js >"$VALIDATION_TMP/ranker-signals.txt"
147
+ cat "$VALIDATION_TMP/ranker-signals.txt"
148
+
149
+ echo "[9.5/9.7/9.16] release policy and canonical URL consistency"
150
+ rg -n "extension.vigthoria.io/downloads/manifest.json|release-policy.json|resolve-release-manifest" release-policy.json install.ps1 install.sh src/utils/release-policy.ts scripts/release >"$VALIDATION_TMP/release-urls.txt"
151
+ cat "$VALIDATION_TMP/release-urls.txt"
152
+
153
+ echo "ALL HERMETIC NO-GO GATES PASSED"
@@ -38,6 +38,8 @@ const requiredDist = ['context-ranker.js', 'post-write-validator.js', 'task-disp
38
38
  const sourceSnapshotExpected = !isNodeModulesInstall && exists(srcUtils);
39
39
  const missingSrc = sourceSnapshotExpected ? requiredSrc.filter((f) => !exists(path.join(srcUtils, f))) : [];
40
40
  const missingDist = requiredDist.filter((f) => !exists(path.join(distUtils, f)));
41
+ const requiredDelivery = ['release-policy.json', 'completions/vigthoria.bash', 'completions/_vigthoria', 'completions/vigthoria.fish'];
42
+ const missingDelivery = requiredDelivery.filter((file) => !exists(path.join(projectRoot, file)));
41
43
 
42
44
  const report = {
43
45
  targetVersion,
@@ -48,6 +50,7 @@ const report = {
48
50
  distUtils,
49
51
  missingSrc,
50
52
  missingDist,
53
+ missingDelivery,
51
54
  };
52
55
 
53
56
  console.log(JSON.stringify(report, null, 2));
@@ -56,7 +59,7 @@ if (report.packageVersion !== targetVersion) {
56
59
  console.error(`[verify] FAIL: version mismatch (${report.packageVersion} != ${targetVersion})`);
57
60
  process.exit(1);
58
61
  }
59
- if (missingSrc.length > 0 || missingDist.length > 0) {
62
+ if (missingSrc.length > 0 || missingDist.length > 0 || missingDelivery.length > 0) {
60
63
  console.error('[verify] FAIL: required utility modules missing');
61
64
  process.exit(1);
62
65
  }
@@ -1,12 +0,0 @@
1
- import { Command } from 'commander';
2
- export interface CommandRegistrationResult {
3
- name: string;
4
- registered: boolean;
5
- error?: Error;
6
- }
7
- export type CommandRegistrar = (program: Command) => void;
8
- export declare function resolveCommand(name: string): CommandRegistrar | null;
9
- export declare function registerCommands(cli: any): void;
10
- export declare const setupCommands: typeof registerCommands;
11
- export declare const configureCommands: typeof registerCommands;
12
- export default registerCommands;