sneakoscope 4.2.0 → 4.2.1

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 (34) hide show
  1. package/README.md +2 -2
  2. package/crates/sks-core/Cargo.lock +1 -1
  3. package/crates/sks-core/Cargo.toml +1 -1
  4. package/crates/sks-core/src/main.rs +1 -1
  5. package/dist/bin/sks.js +1 -1
  6. package/dist/core/codex-control/codex-app-server-v2-client.js +86 -2
  7. package/dist/core/codex-control/codex-reliability-shield.js +26 -5
  8. package/dist/core/codex-control/codex-task-runner.js +7 -1
  9. package/dist/core/codex-control/model-call-concurrency.js +1 -1
  10. package/dist/core/commands/qa-loop-command.js +23 -7
  11. package/dist/core/fsx.js +1 -1
  12. package/dist/core/hooks-runtime.js +1 -1
  13. package/dist/core/qa-loop/qa-app-server-driver.js +134 -0
  14. package/dist/core/qa-loop/qa-contract-v2.js +231 -0
  15. package/dist/core/qa-loop/qa-gate-v2.js +132 -0
  16. package/dist/core/qa-loop/qa-runtime-artifacts.js +53 -0
  17. package/dist/core/qa-loop/qa-surface-router.js +114 -0
  18. package/dist/core/qa-loop/qa-types.js +18 -0
  19. package/dist/core/qa-loop.js +83 -26
  20. package/dist/core/release/gate-manifest.js +1 -0
  21. package/dist/core/release/sla-scheduler.js +1 -1
  22. package/dist/core/routes.js +19 -4
  23. package/dist/core/triwiki/triwiki-affected-graph.js +3 -2
  24. package/dist/core/version.js +1 -1
  25. package/dist/scripts/codex-control-all-pipelines-check.js +1 -0
  26. package/dist/scripts/codex-control-model-capacity-fallback-check.js +53 -0
  27. package/dist/scripts/config-managed-merge-callsite-coverage-check.js +7 -1
  28. package/dist/scripts/loop-directive-check-lib.js +78 -1
  29. package/dist/scripts/qa-loop-app-server-driver-check.js +74 -0
  30. package/dist/scripts/qa-loop-surface-router-check.js +49 -0
  31. package/dist/scripts/release-check-dynamic-execute.js +1 -1
  32. package/dist/scripts/runtime-ts-rust-boundary-check.js +1 -1
  33. package/dist/scripts/triwiki-affected-graph-check.js +2 -2
  34. package/package.json +6 -3
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env node
2
+ // @ts-nocheck
3
+ import fs from 'node:fs/promises';
4
+ import os from 'node:os';
5
+ import path from 'node:path';
6
+ import { assertGate, emitGate } from './sks-1-18-gate-lib.js';
7
+ import { buildQaContractV2 } from '../core/qa-loop/qa-contract-v2.js';
8
+ import { evaluateQaGateV2 } from '../core/qa-loop/qa-gate-v2.js';
9
+ import { initializeQaRuntimeArtifacts } from '../core/qa-loop/qa-runtime-artifacts.js';
10
+ import { selectQaSurface } from '../core/qa-loop/qa-surface-router.js';
11
+ const cases = [
12
+ ['localhost no auth chooses Browser', selectQaSurface({ targetUrl: 'http://localhost:3000/settings', prompt: 'test local web settings' }).selected_surface, 'codex_in_app_browser'],
13
+ ['public no auth chooses Browser', selectQaSurface({ targetUrl: 'https://example.com', prompt: 'public marketing page QA' }).selected_surface, 'codex_in_app_browser'],
14
+ ['signed-in browser state chooses Chrome', selectQaSurface({ targetUrl: 'https://example.com/app', prompt: 'verify logged-in cookie profile flow' }).selected_surface, 'codex_chrome_extension'],
15
+ ['extension-dependent site chooses Chrome', selectQaSurface({ targetUrl: 'https://example.com', prompt: 'browser extension dependent QA' }).selected_surface, 'codex_chrome_extension'],
16
+ ['native macOS GUI chooses Computer Use', selectQaSurface({ prompt: 'native macOS Settings GUI bug' }).selected_surface, 'codex_computer_use'],
17
+ ['native Windows GUI chooses Computer Use', selectQaSurface({ prompt: 'Windows desktop app dialog bug' }).selected_surface, 'codex_computer_use'],
18
+ ['structured data without UI chooses MCP', selectQaSurface({ prompt: 'Gmail data sync check', uiRequired: false, targetKind: 'structured_data' }).selected_surface, 'structured_mcp']
19
+ ];
20
+ for (const [label, actual, expected] of cases) {
21
+ assertGate(actual === expected, `${label}: expected ${expected}, got ${actual}`, { actual, expected });
22
+ }
23
+ const contract = buildQaContractV2({
24
+ prompt: 'QA local settings form at http://localhost:3000',
25
+ answers: {
26
+ QA_SCOPE: 'ui_e2e_only',
27
+ TARGET_BASE_URL: 'http://localhost:3000',
28
+ LOGIN_REQUIRED: 'no',
29
+ MAX_QA_CYCLES: ''
30
+ }
31
+ }, { missionId: 'M-router-check' });
32
+ assertGate(contract.runtime.max_cycles === 5, 'QA contract v2 default max cycles must be 5', contract.runtime);
33
+ assertGate(contract.mutation.source_code_patch_policy === 'enabled', 'safe local source fixes must default on unless report-only', contract.mutation);
34
+ const tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-qa-router-'));
35
+ await initializeQaRuntimeArtifacts(tmp, contract, { missionId: 'M-router-check' });
36
+ let gate = await evaluateQaGateV2(tmp);
37
+ assertGate(gate.passed === false, 'UI-required QA cannot pass with zero real actions', gate);
38
+ assertGate(gate.blockers.includes('ui_required_but_real_action_count_zero'), 'zero-action blocker missing', gate);
39
+ await fs.appendFile(path.join(tmp, 'qa-loop', 'action-ledger.jsonl'), `${JSON.stringify({ schema: 'sks.qa-loop-action.v2', status: 'completed', real: true, journey_fingerprint: 'J', kind: 'click' })}\n`);
40
+ await fs.appendFile(path.join(tmp, 'qa-loop', 'observation-ledger.jsonl'), `${JSON.stringify({ schema: 'sks.qa-loop-observation.v2', status: 'observed', real: true, journey_fingerprint: 'J', kind: 'visual_delta' })}\n`);
41
+ gate = await evaluateQaGateV2(tmp);
42
+ assertGate(gate.real_action_count === 1 && gate.observation_count === 1, 'real action and observation ledgers must be counted', gate);
43
+ emitGate('qa-loop:surface-router', {
44
+ matrix_cases: cases.length,
45
+ default_max_cycles: contract.runtime.max_cycles,
46
+ zero_action_blocked: true,
47
+ selected_surface: contract.target.kind
48
+ });
49
+ //# sourceMappingURL=qa-loop-surface-router-check.js.map
@@ -60,7 +60,7 @@ for (const gate of plan.selected) {
60
60
  continue;
61
61
  }
62
62
  const command = `npm run ${gate.id}`;
63
- if (FORBIDDEN_RECURSIVE_GATES.has(gate.id) || /npm\s+run\s+(release:check|release:real-check|release:publish|publish:npm|publish:dry|prepublishOnly)\b/.test(command)) {
63
+ if (FORBIDDEN_RECURSIVE_GATES.has(gate.id) || /npm\s+run\s+(release:check|release:real-check|release:publish|publish:ignore-scripts|publish:npm|publish:dry|prepublishOnly)\b/.test(command)) {
64
64
  failures.push({ id: gate.id, exit_code: null, stdout_tail: '', stderr_tail: 'forbidden_recursive_gate_spawn' });
65
65
  continue;
66
66
  }
@@ -13,7 +13,7 @@ import { root, assertGate, emitGate, importDist, readText, readJson } from './sk
13
13
  assertGate(!/cargo|rustc/.test(readText('src/scripts/build-dist.ts')), 'build-dist must not invoke cargo/rustc');
14
14
  assertGate(!/cargo|rustc/.test(readText('src/scripts/clean-dist.ts')), 'clean-dist must not invoke cargo/rustc');
15
15
  const pkg = readJson('package.json');
16
- for (const s of ['prepack', 'prepublishOnly', 'publish:dry', 'publish:npm']) {
16
+ for (const s of ['prepack', 'prepublishOnly', 'publish:dry', 'publish:ignore-scripts', 'publish:npm']) {
17
17
  assertGate(!String(pkg.scripts?.[s] || '').includes('cargo'), `publish_script_compiles_rust:${s}`);
18
18
  }
19
19
  // 2) The published binary is JS; no prebuilt native artifact is shipped or required.
@@ -1,10 +1,10 @@
1
1
  // @ts-nocheck
2
2
  import { assertGate, emitGate, importDist, root } from './sks-1-18-gate-lib.js';
3
3
  const mod = await importDist('core/triwiki/triwiki-affected-graph.js');
4
- const graph = mod.computeTriWikiAffectedGraph({ root, changedFiles: ['src/core/triwiki/triwiki-proof-bank.ts'], tier: 'affected' });
4
+ const graph = mod.computeTriWikiAffectedGraph({ root, changedFiles: ['src/core/triwiki/triwiki-proof-bank.ts'], tier: 'affected', includeProofLookup: false });
5
5
  assertGate(graph.schema === 'sks.triwiki-affected-graph.v1', 'affected graph schema mismatch', graph);
6
6
  assertGate(graph.affected_modules.includes('triwiki') && graph.gate_packs.includes('triwiki') && graph.release_equivalent_within_scope === true, 'triwiki file must select triwiki release-equivalent pack', graph);
7
- const full = mod.computeTriWikiAffectedGraph({ root, full: true, tier: 'release' });
7
+ const full = mod.computeTriWikiAffectedGraph({ root, full: true, tier: 'release', includeProofLookup: false });
8
8
  assertGate(full.gates.length > graph.gates.length && full.gate_packs.length >= graph.gate_packs.length && full.conservative_reason === 'full_release_requested', 'full release graph must select the full gate surface', full);
9
9
  emitGate('triwiki:affected-graph', { gates: graph.gates.length, packs: graph.gate_packs, full_gates: full.gates.length });
10
10
  //# sourceMappingURL=triwiki-affected-graph-check.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sneakoscope",
3
3
  "displayName": "ㅅㅋㅅ",
4
- "version": "4.2.0",
4
+ "version": "4.2.1",
5
5
  "description": "Sneakoscope Codex: fast proof-first Codex trust layer with image-based Voxel TriWiki.",
6
6
  "type": "module",
7
7
  "homepage": "https://github.com/mandarange/Sneakoscope-Codex#readme",
@@ -323,6 +323,7 @@
323
323
  "codex-control:side-effect-scope": "node ./dist/scripts/codex-control-side-effect-scope-check.js",
324
324
  "codex-control:all-pipelines": "node ./dist/scripts/codex-control-all-pipelines-check.js",
325
325
  "codex-control:empty-result-retry": "node ./dist/scripts/codex-control-empty-result-retry-check.js",
326
+ "codex-control:model-capacity-fallback": "node ./dist/scripts/codex-control-model-capacity-fallback-check.js",
326
327
  "codex-control:stream-idle-watchdog": "node ./dist/scripts/codex-control-stream-idle-watchdog-check.js",
327
328
  "codex-control:tool-call-sequence-repair": "node ./dist/scripts/codex-control-tool-call-sequence-repair-check.js",
328
329
  "codex-control:keepalive-no-cot-leak": "node ./dist/scripts/codex-control-keepalive-no-cot-leak-check.js",
@@ -359,9 +360,10 @@
359
360
  "coverage": "node --experimental-test-coverage --test \"test/**/*.test.mjs\"",
360
361
  "release:check": "npm run release:check:affected",
361
362
  "release:real-check": "node ./dist/scripts/release-real-check.js",
362
- "release:publish": "npm run publish:npm",
363
+ "release:publish": "npm run publish:ignore-scripts",
363
364
  "publish:dry": "npm run release:metadata && npm run release:version-truth && npm run publish:packlist-performance && npm run release:check:full && node ./dist/scripts/check-publish-tag.js && node ./dist/scripts/release-check-stamp.js verify && npm run release:provenance -- --publish && npm run release:dist-freshness && node ./dist/scripts/release-registry-check.js --require-unpublished && npm --cache /tmp/sks-npm-cache publish --dry-run --ignore-scripts --registry https://registry.npmjs.org/ --access public",
364
- "publish:npm": "npm --cache /tmp/sks-npm-cache publish --registry https://registry.npmjs.org/ --access public",
365
+ "publish:ignore-scripts": "npm run prepublishOnly && npm --cache /tmp/sks-npm-cache publish --ignore-scripts --registry https://registry.npmjs.org/ --access public",
366
+ "publish:npm": "npm run publish:ignore-scripts",
365
367
  "publish:fast": "node -e \"console.error('publish:fast is quarantined; use publish:dry and publish:npm with the release gates.'); process.exit(1)\"",
366
368
  "prepack": "npm run build",
367
369
  "prepublishOnly": "npm run release:metadata && npm run release:version-truth && npm run release:dist-freshness && npm run publish:packlist-performance && node ./dist/scripts/prepublish-release-check-or-fast.js && node ./dist/scripts/check-publish-tag.js && node ./dist/scripts/release-check-stamp.js verify && npm run release:provenance -- --publish && node ./dist/scripts/release-registry-check.js --require-unpublished --require-publish-auth",
@@ -619,6 +621,7 @@
619
621
  "qa-loop:effort-escalation": "node ./dist/scripts/qa-loop-effort-escalation-check.js",
620
622
  "codex:account-usage": "node ./dist/scripts/codex-account-usage-check.js",
621
623
  "qa-loop:budget-policy": "node ./dist/scripts/qa-loop-budget-policy-check.js",
624
+ "qa-loop:surface-router": "node ./dist/scripts/qa-loop-surface-router-check.js",
622
625
  "naruto:parallel-gate-consistency": "node ./dist/scripts/naruto-parallel-gate-consistency-check.js",
623
626
  "codex:0138-doctor": "node ./dist/scripts/codex-0138-doctor-check.js",
624
627
  "doctor:codex-0138-fix": "node ./dist/scripts/doctor-codex-0138-fix-check.js",