vigthoria-cli 1.9.5 → 1.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/commands/auth.js +87 -8
- package/dist/commands/bridge.js +3 -8
- package/dist/commands/chat.js +31 -19
- package/dist/commands/legion.js +20 -11
- package/dist/commands/security.d.ts +20 -0
- package/dist/commands/security.js +98 -0
- package/dist/index.js +41 -15
- package/dist/utils/api.d.ts +6 -5
- package/dist/utils/api.js +166 -48
- package/dist/utils/config.js +1 -1
- package/dist/utils/tools.js +29 -5
- package/install.ps1 +322 -0
- package/install.sh +314 -0
- package/package.json +12 -3
- package/scripts/release/LOCAL_MACHINE_USER_VERIFICATION.md +159 -0
- package/scripts/release/publish-cli-release.sh +73 -0
- package/scripts/release/validate-no-go-gates.sh +129 -0
- package/scripts/release/verify-runtime-consistency.mjs +64 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Vigthoria CLI Local Machine Verification Checklist
|
|
2
|
+
|
|
3
|
+
Use this checklist on real user machines before and after rollout. The goal is to verify install, auth, routing, update, and core command reliability in the same environment users run.
|
|
4
|
+
|
|
5
|
+
## 1. Preflight
|
|
6
|
+
|
|
7
|
+
- [ ] Node.js `>=18` available
|
|
8
|
+
- [ ] `npm` available
|
|
9
|
+
- [ ] No stale shell aliases shadowing `vigthoria`
|
|
10
|
+
- [ ] Network access to:
|
|
11
|
+
- `https://coder.vigthoria.io`
|
|
12
|
+
- `https://api.vigthoria.io`
|
|
13
|
+
- [ ] If running browser runtime proofs: Chrome available for Puppeteer
|
|
14
|
+
|
|
15
|
+
Commands:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
node -v
|
|
19
|
+
npm -v
|
|
20
|
+
which vigthoria || where.exe vigthoria
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 2. Install and Version Integrity
|
|
24
|
+
|
|
25
|
+
- [ ] Install succeeds
|
|
26
|
+
- [ ] Reported version matches release target
|
|
27
|
+
- [ ] Binary resolves to expected package
|
|
28
|
+
|
|
29
|
+
Commands:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install -g vigthoria-cli@latest
|
|
33
|
+
vigthoria --version
|
|
34
|
+
vigthoria doctor
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Expected:
|
|
38
|
+
- `vigthoria --version` shows current release version
|
|
39
|
+
- `doctor` returns diagnostics without crash
|
|
40
|
+
|
|
41
|
+
## 3. Auth Reliability
|
|
42
|
+
|
|
43
|
+
- [ ] Login works
|
|
44
|
+
- [ ] Status shows account, plan, health lines
|
|
45
|
+
- [ ] Invalid token is rejected with gateway-auth message
|
|
46
|
+
|
|
47
|
+
Commands:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
vigthoria login
|
|
51
|
+
vigthoria status
|
|
52
|
+
VIGTHORIA_AUTH_TOKEN=invalid-token-for-preflight vigthoria chat --no-agent --model balanced-4b --prompt "ok" --json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Expected:
|
|
56
|
+
- `status` includes `Account Status`, `Plan`, `Overall`, `Coder API`, `Models API`
|
|
57
|
+
- Invalid-token command returns JSON with `success: false` and gateway-auth failure message
|
|
58
|
+
|
|
59
|
+
## 4. Model and Routing Checks
|
|
60
|
+
|
|
61
|
+
- [ ] Balanced path resolves to balanced model
|
|
62
|
+
- [ ] Governance fallback maps blocked no-agent models to `vigthoria-v3-code-35b`
|
|
63
|
+
- [ ] Agent direct mode prints command/tool flow (non-JSON mode)
|
|
64
|
+
|
|
65
|
+
Commands:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
vigthoria chat --no-agent --model balanced-4b --prompt "reply exactly: ok" --json
|
|
69
|
+
vigthoria chat --no-agent --model creative --prompt "say ok" --json
|
|
70
|
+
vigthoria agent --prompt "Read one file and summarize it" --auto-approve
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Expected:
|
|
74
|
+
- balanced output model: `vigthoria-balanced-4b`
|
|
75
|
+
- creative output model: `vigthoria-v3-code-35b`
|
|
76
|
+
- agent run shows direct prompt execution and tool activity
|
|
77
|
+
|
|
78
|
+
## 5. Command Surface Smoke Tests
|
|
79
|
+
|
|
80
|
+
- [ ] Aliases work
|
|
81
|
+
- [ ] Bridge status prints valid section and hidden internal endpoints
|
|
82
|
+
- [ ] Operator JSON command succeeds
|
|
83
|
+
|
|
84
|
+
Commands:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
vigthoria hyper-loop status
|
|
88
|
+
vigthoria devtools connect
|
|
89
|
+
vigthoria bridge status
|
|
90
|
+
vigthoria operator --prompt "status check" --json
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Expected:
|
|
94
|
+
- No crashes
|
|
95
|
+
- `bridge status` shows `DevTools Bridge` and either `Reachable` or `Not running`
|
|
96
|
+
- Operator JSON has `success: true`
|
|
97
|
+
|
|
98
|
+
## 6. Update Path
|
|
99
|
+
|
|
100
|
+
- [ ] Update check works
|
|
101
|
+
- [ ] Upgrade path works from npm/manifest
|
|
102
|
+
|
|
103
|
+
Commands:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
vigthoria update --check
|
|
107
|
+
vigthoria update
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Expected:
|
|
111
|
+
- No script errors
|
|
112
|
+
- Clear success/fallback guidance if update source fails
|
|
113
|
+
|
|
114
|
+
## 7. Release Gate (Local Build Validation)
|
|
115
|
+
|
|
116
|
+
Run this on release candidate machines when validating local package changes.
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
npm run build
|
|
120
|
+
npm run validate:no-go
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Expected:
|
|
124
|
+
- `ALL NO-GO GATES PASSED`
|
|
125
|
+
|
|
126
|
+
## 8. Environment-Specific Prerequisites
|
|
127
|
+
|
|
128
|
+
These are external dependencies, not CLI code regressions:
|
|
129
|
+
|
|
130
|
+
- Workflow E2E requires reachable VigFlow backend
|
|
131
|
+
- Live repo/game/platform E2E requires:
|
|
132
|
+
- `VIGTHORIA_COMMUNITY_EMAIL`
|
|
133
|
+
- `VIGTHORIA_COMMUNITY_PASSWORD`
|
|
134
|
+
- Browser proof requires Chrome installed for Puppeteer runtime
|
|
135
|
+
|
|
136
|
+
## 9. Rollback Readiness
|
|
137
|
+
|
|
138
|
+
- [ ] Previous known-good CLI version pinned
|
|
139
|
+
- [ ] One-command rollback documented
|
|
140
|
+
- [ ] Support note prepared for users
|
|
141
|
+
|
|
142
|
+
Example rollback:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
npm install -g vigthoria-cli@<known-good-version>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## 10. Signoff Template
|
|
149
|
+
|
|
150
|
+
- Machine/OS:
|
|
151
|
+
- Node/NPM versions:
|
|
152
|
+
- CLI version validated:
|
|
153
|
+
- Auth check: PASS/FAIL
|
|
154
|
+
- Model routing check: PASS/FAIL
|
|
155
|
+
- Command smoke check: PASS/FAIL
|
|
156
|
+
- Update check: PASS/FAIL
|
|
157
|
+
- No-go gate: PASS/FAIL
|
|
158
|
+
- Approved by:
|
|
159
|
+
- Timestamp:
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Publish Vigthoria CLI release artifact + manifest entry.
|
|
5
|
+
# Usage:
|
|
6
|
+
# HOST_DOWNLOADS_DIR=/path/to/downloads \
|
|
7
|
+
# HOST_MANIFEST_FILE=/path/to/releases/manifest.json \
|
|
8
|
+
# ./scripts/release/publish-cli-release.sh 1.9.0
|
|
9
|
+
|
|
10
|
+
VERSION="${1:-}"
|
|
11
|
+
if [[ -z "$VERSION" ]]; then
|
|
12
|
+
echo "Usage: $0 <version>"
|
|
13
|
+
exit 1
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
17
|
+
PKG_FILE="$REPO_ROOT/vigthoria-cli-${VERSION}.tgz"
|
|
18
|
+
HOST_DOWNLOADS_DIR="${HOST_DOWNLOADS_DIR:-}"
|
|
19
|
+
HOST_MANIFEST_FILE="${HOST_MANIFEST_FILE:-}"
|
|
20
|
+
PUBLIC_BASE_URL="${PUBLIC_BASE_URL:-https://cli.vigthoria.io/downloads}"
|
|
21
|
+
CHANNEL="${CHANNEL:-stable}"
|
|
22
|
+
|
|
23
|
+
if [[ ! -f "$PKG_FILE" ]]; then
|
|
24
|
+
echo "Artifact not found: $PKG_FILE"
|
|
25
|
+
echo "Run: npm pack"
|
|
26
|
+
exit 1
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
if [[ -z "$HOST_DOWNLOADS_DIR" || -z "$HOST_MANIFEST_FILE" ]]; then
|
|
30
|
+
echo "Set HOST_DOWNLOADS_DIR and HOST_MANIFEST_FILE before running."
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
SHA256="$(sha256sum "$PKG_FILE" | awk '{print $1}')"
|
|
35
|
+
URL="$PUBLIC_BASE_URL/vigthoria-cli-${VERSION}.tgz"
|
|
36
|
+
|
|
37
|
+
echo "Publishing vigthoria-cli v${VERSION}"
|
|
38
|
+
echo "Artifact: $PKG_FILE"
|
|
39
|
+
echo "SHA256: $SHA256"
|
|
40
|
+
echo "URL: $URL"
|
|
41
|
+
|
|
42
|
+
install -d "$HOST_DOWNLOADS_DIR"
|
|
43
|
+
cp -f "$PKG_FILE" "$HOST_DOWNLOADS_DIR/"
|
|
44
|
+
|
|
45
|
+
echo "Copied artifact to $HOST_DOWNLOADS_DIR"
|
|
46
|
+
|
|
47
|
+
if [[ ! -f "$HOST_MANIFEST_FILE" ]]; then
|
|
48
|
+
echo "Manifest does not exist at: $HOST_MANIFEST_FILE"
|
|
49
|
+
echo "Create it first with {\"channels\":{\"stable\":{}}}"
|
|
50
|
+
exit 1
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
python3 - << PYEOF
|
|
54
|
+
import json, pathlib
|
|
55
|
+
manifest_path = pathlib.Path(r"$HOST_MANIFEST_FILE")
|
|
56
|
+
data = json.loads(manifest_path.read_text())
|
|
57
|
+
data.setdefault("channels", {})
|
|
58
|
+
data["channels"].setdefault("$CHANNEL", {})
|
|
59
|
+
data["channels"]["$CHANNEL"].update({
|
|
60
|
+
"version": "$VERSION",
|
|
61
|
+
"url": "$URL",
|
|
62
|
+
"sha256": "$SHA256",
|
|
63
|
+
"notes": "Automated publish via scripts/release/publish-cli-release.sh"
|
|
64
|
+
})
|
|
65
|
+
manifest_path.write_text(json.dumps(data, indent=2) + "\n")
|
|
66
|
+
print("Manifest updated:", manifest_path)
|
|
67
|
+
PYEOF
|
|
68
|
+
|
|
69
|
+
echo "Publish complete."
|
|
70
|
+
echo "Verification commands:"
|
|
71
|
+
echo " curl -I $URL"
|
|
72
|
+
echo " curl -fsSL https://coder.vigthoria.io/releases/manifest.json | head -40"
|
|
73
|
+
echo " node dist/index.js update --check --manifest https://coder.vigthoria.io/releases/manifest.json --channel $CHANNEL"
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
ROOT="/var/www/vigthoria-coder/VigthoriaCoderMain/vigthoria-cli"
|
|
5
|
+
cd "$ROOT"
|
|
6
|
+
|
|
7
|
+
CLI="node dist/index.js"
|
|
8
|
+
unset V3_SERVICE_KEY
|
|
9
|
+
unset HYPERLOOP_SERVICE_KEY
|
|
10
|
+
|
|
11
|
+
echo "[0.1-0.6] source/dist consistency"
|
|
12
|
+
node scripts/release/verify-runtime-consistency.mjs >/tmp/vig-verify-runtime.json
|
|
13
|
+
cat /tmp/vig-verify-runtime.json
|
|
14
|
+
|
|
15
|
+
echo "[0.2] build exits 0"
|
|
16
|
+
npm run build >/tmp/vig-build.log 2>&1
|
|
17
|
+
|
|
18
|
+
echo "[0.3] dist/index.js exists"
|
|
19
|
+
[[ -x dist/index.js ]]
|
|
20
|
+
|
|
21
|
+
echo "[AUTH PREFLIGHT] invalid session message"
|
|
22
|
+
AUTH_JSON=$(VIGTHORIA_AUTH_TOKEN=invalid-token-for-preflight $CLI chat --no-agent --model balanced-4b --prompt "ok" --json 2>/dev/null || true)
|
|
23
|
+
echo "$AUTH_JSON"
|
|
24
|
+
printf '%s
|
|
25
|
+
' "$AUTH_JSON" > /tmp/vig-auth-preflight.json
|
|
26
|
+
python3 - << 'PY'
|
|
27
|
+
import json
|
|
28
|
+
with open('/tmp/vig-auth-preflight.json','r',encoding='utf-8') as f:
|
|
29
|
+
j=json.load(f)
|
|
30
|
+
msg='Vigthoria Gate way user authentification failed. Please log out and login again.'
|
|
31
|
+
assert j.get('success') is False, 'expected success=false for invalid token preflight'
|
|
32
|
+
assert j.get('error') == msg, f"unexpected auth message: {j.get('error')}"
|
|
33
|
+
print('[pass] auth preflight message')
|
|
34
|
+
PY
|
|
35
|
+
|
|
36
|
+
echo "[1.1] ranker includes agent.py top10 for SSE prompt"
|
|
37
|
+
node - << 'EOF2'
|
|
38
|
+
import('./dist/utils/context-ranker.js').then((m)=>{
|
|
39
|
+
const r=m.buildSemanticContext('/var/www/V3-Code-Agent','fix the streaming SSE event handler',10);
|
|
40
|
+
const idx=r.topFiles.findIndex((f)=>f.path==='agent.py');
|
|
41
|
+
console.log('agent_idx_top10=' + idx);
|
|
42
|
+
if (idx < 0) process.exit(1);
|
|
43
|
+
});
|
|
44
|
+
EOF2
|
|
45
|
+
|
|
46
|
+
echo "[2.1/2.4] tsc validator emits passing result"
|
|
47
|
+
node - << 'EOF2'
|
|
48
|
+
import fs from 'node:fs';
|
|
49
|
+
import os from 'node:os';
|
|
50
|
+
import path from 'node:path';
|
|
51
|
+
import { runPostWriteValidation } from './dist/utils/post-write-validator.js';
|
|
52
|
+
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'vig-tsc-'));
|
|
53
|
+
fs.mkdirSync(path.join(tmp, 'src'));
|
|
54
|
+
fs.writeFileSync(path.join(tmp, 'tsconfig.json'), JSON.stringify({ compilerOptions: { target: 'ES2020', module: 'ESNext' }, include: ['src/**/*.ts'] }));
|
|
55
|
+
fs.writeFileSync(path.join(tmp, 'src', 'index.ts'), 'export const ok:number = 1;\n');
|
|
56
|
+
const res = await runPostWriteValidation(tmp);
|
|
57
|
+
const tsc = res.find((r)=>r.tool==='tsc');
|
|
58
|
+
console.log(JSON.stringify(tsc || null));
|
|
59
|
+
if (!tsc || !tsc.ran || !tsc.passed) process.exit(1);
|
|
60
|
+
EOF2
|
|
61
|
+
|
|
62
|
+
echo "[6.2] balanced-4b no-agent path"
|
|
63
|
+
$CLI chat --no-agent --model balanced-4b --prompt "reply exactly: ok" --json >/tmp/vig-balanced.json
|
|
64
|
+
python3 - << 'PY'
|
|
65
|
+
import json
|
|
66
|
+
j=json.load(open('/tmp/vig-balanced.json'))
|
|
67
|
+
assert j.get('success') is True
|
|
68
|
+
assert j.get('model') == 'vigthoria-balanced-4b', j
|
|
69
|
+
print('[pass] balanced-4b')
|
|
70
|
+
PY
|
|
71
|
+
|
|
72
|
+
echo "[6.9/6.12] aliases available"
|
|
73
|
+
$CLI hyper-loop status >/tmp/vig-hyperloop.txt
|
|
74
|
+
$CLI devtools connect >/tmp/vig-devtools.txt
|
|
75
|
+
|
|
76
|
+
echo "[6.11] operator flow"
|
|
77
|
+
$CLI operator --prompt "status check" --json >/tmp/vig-operator.json
|
|
78
|
+
python3 - << 'PY'
|
|
79
|
+
import json
|
|
80
|
+
j=json.load(open('/tmp/vig-operator.json'))
|
|
81
|
+
assert j.get('success') is True, j
|
|
82
|
+
print('[pass] operator flow')
|
|
83
|
+
PY
|
|
84
|
+
|
|
85
|
+
echo "[7.1/7.3/7.4] local service health"
|
|
86
|
+
for u in http://localhost:8030/health http://localhost:4008/health http://localhost:4011/health; do
|
|
87
|
+
code=$(curl -s -o /dev/null -w "%{http_code}" "$u")
|
|
88
|
+
echo "$u => $code"
|
|
89
|
+
[[ "$code" == "200" ]]
|
|
90
|
+
done
|
|
91
|
+
|
|
92
|
+
echo "[7.2/7.8/12.3] models inventory"
|
|
93
|
+
curl -s http://localhost:4009/v1/models >/tmp/vig-models.json
|
|
94
|
+
python3 - << 'PY'
|
|
95
|
+
import json
|
|
96
|
+
ids={m.get('id','') for m in json.load(open('/tmp/vig-models.json')).get('data',[])}
|
|
97
|
+
assert ('vigthoria-balanced-4b' in ids) or ('vigthoria-balanced-4b:latest' in ids)
|
|
98
|
+
assert 'vigthoria-creative-9b-v4' in ids
|
|
99
|
+
assert any('vigthoria-v3-code-35b' in i for i in ids)
|
|
100
|
+
print('[pass] model inventory gates')
|
|
101
|
+
PY
|
|
102
|
+
|
|
103
|
+
echo "[7.5 policy] secured hyperloop endpoint"
|
|
104
|
+
code=$(curl -s -o /dev/null -w "%{http_code}" https://coder.vigthoria.io/api/hyperloop/health)
|
|
105
|
+
echo "unauth_hyperloop_code=$code"
|
|
106
|
+
[[ "$code" == "401" ]]
|
|
107
|
+
|
|
108
|
+
echo "[8.2] runtime symlink guard signals"
|
|
109
|
+
rg -n "realpathSync|results.length >= maxFiles|pattern = kw.length <= 4" dist/utils/context-ranker.js >/tmp/vig-ranker-signals.txt
|
|
110
|
+
cat /tmp/vig-ranker-signals.txt
|
|
111
|
+
|
|
112
|
+
echo "[9.5/9.7/9.16] release URL consistency"
|
|
113
|
+
rg -n "coder.vigthoria.io/releases" install.ps1 install.sh README.md >/tmp/vig-release-urls.txt
|
|
114
|
+
cat /tmp/vig-release-urls.txt
|
|
115
|
+
|
|
116
|
+
echo "[12.1] no-agent governance fallback"
|
|
117
|
+
$CLI chat --no-agent --model creative --prompt "say ok" --json >/tmp/vig-creative.json
|
|
118
|
+
python3 - << 'PY'
|
|
119
|
+
import json
|
|
120
|
+
j=json.load(open('/tmp/vig-creative.json'))
|
|
121
|
+
assert j.get('success') is True
|
|
122
|
+
assert j.get('model') == 'vigthoria-v3-code-35b', j
|
|
123
|
+
md=j.get('metadata') or {}
|
|
124
|
+
fb=md.get('modelFallback') or {}
|
|
125
|
+
assert fb.get('reason') == 'governance-blocked-model', j
|
|
126
|
+
print('[pass] governance fallback metadata')
|
|
127
|
+
PY
|
|
128
|
+
|
|
129
|
+
echo "ALL NO-GO GATES PASSED"
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
|
|
5
|
+
function findPackageJson() {
|
|
6
|
+
const candidates = [
|
|
7
|
+
path.join(process.cwd(), 'package.json'),
|
|
8
|
+
path.join(process.cwd(), 'node_modules', 'vigthoria-cli', 'package.json'),
|
|
9
|
+
path.join(process.env.APPDATA || '', 'npm', 'node_modules', 'vigthoria-cli', 'package.json'),
|
|
10
|
+
];
|
|
11
|
+
for (const p of candidates) {
|
|
12
|
+
if (p && fs.existsSync(p)) return p;
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function exists(p) {
|
|
18
|
+
try { return fs.existsSync(p); } catch { return false; }
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const pkgPath = findPackageJson();
|
|
22
|
+
if (!pkgPath) {
|
|
23
|
+
console.error('[verify] FAIL: package.json not found in expected locations');
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
28
|
+
const targetVersion = process.argv[2] || String(pkg.version || '');
|
|
29
|
+
const baseDir = path.dirname(pkgPath);
|
|
30
|
+
const isNodeModulesInstall = baseDir.endsWith(path.join('node_modules', 'vigthoria-cli'));
|
|
31
|
+
const projectRoot = isNodeModulesInstall ? baseDir : process.cwd();
|
|
32
|
+
|
|
33
|
+
const srcUtils = path.join(projectRoot, 'src', 'utils');
|
|
34
|
+
const distUtils = path.join(projectRoot, 'dist', 'utils');
|
|
35
|
+
const requiredSrc = ['context-ranker.ts', 'post-write-validator.ts', 'task-display.ts', 'workspace-cache.ts'];
|
|
36
|
+
const requiredDist = ['context-ranker.js', 'post-write-validator.js', 'task-display.js', 'workspace-cache.js'];
|
|
37
|
+
|
|
38
|
+
const sourceSnapshotExpected = !isNodeModulesInstall && exists(srcUtils);
|
|
39
|
+
const missingSrc = sourceSnapshotExpected ? requiredSrc.filter((f) => !exists(path.join(srcUtils, f))) : [];
|
|
40
|
+
const missingDist = requiredDist.filter((f) => !exists(path.join(distUtils, f)));
|
|
41
|
+
|
|
42
|
+
const report = {
|
|
43
|
+
targetVersion,
|
|
44
|
+
packageVersion: String(pkg.version || ''),
|
|
45
|
+
packageJsonPath: pkgPath,
|
|
46
|
+
projectRoot,
|
|
47
|
+
srcUtils,
|
|
48
|
+
distUtils,
|
|
49
|
+
missingSrc,
|
|
50
|
+
missingDist,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
console.log(JSON.stringify(report, null, 2));
|
|
54
|
+
|
|
55
|
+
if (report.packageVersion !== targetVersion) {
|
|
56
|
+
console.error(`[verify] FAIL: version mismatch (${report.packageVersion} != ${targetVersion})`);
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
if (missingSrc.length > 0 || missingDist.length > 0) {
|
|
60
|
+
console.error('[verify] FAIL: required utility modules missing');
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
console.log('[verify] PASS: runtime/source snapshot is consistent');
|