sneakoscope 3.0.4 → 3.1.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 (85) hide show
  1. package/README.md +1 -1
  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/.sks-build-stamp.json +4 -4
  6. package/dist/bin/sks.js +1 -1
  7. package/dist/cli/command-registry.js +1 -0
  8. package/dist/cli/context7-command.js +29 -5
  9. package/dist/cli/install-helpers.js +15 -7
  10. package/dist/commands/zellij-slot-column-anchor.js +3 -1
  11. package/dist/commands/zellij-slot-pane.js +19 -2
  12. package/dist/core/agents/agent-janitor.js +10 -1
  13. package/dist/core/agents/agent-orchestrator.js +1 -0
  14. package/dist/core/agents/agent-runner-ollama.js +11 -4
  15. package/dist/core/agents/native-cli-session-swarm.js +69 -9
  16. package/dist/core/agents/runtime-proof-summary.js +4 -0
  17. package/dist/core/codex-control/codex-task-runner.js +9 -0
  18. package/dist/core/commands/goal-command.js +19 -1
  19. package/dist/core/commands/loop-command.js +176 -0
  20. package/dist/core/commands/naruto-command.js +26 -17
  21. package/dist/core/commands/team-command.js +1 -0
  22. package/dist/core/fsx.js +1 -1
  23. package/dist/core/init.js +6 -1
  24. package/dist/core/locks/file-lock.js +88 -0
  25. package/dist/core/loops/goal-to-loop-compat.js +23 -0
  26. package/dist/core/loops/loop-artifacts.js +72 -0
  27. package/dist/core/loops/loop-checkpoint.js +22 -0
  28. package/dist/core/loops/loop-decomposer.js +56 -0
  29. package/dist/core/loops/loop-finalizer.js +54 -0
  30. package/dist/core/loops/loop-gate-ladder.js +16 -0
  31. package/dist/core/loops/loop-gate-registry.js +96 -0
  32. package/dist/core/loops/loop-gate-runner.js +177 -0
  33. package/dist/core/loops/loop-gate-selector.js +52 -0
  34. package/dist/core/loops/loop-gpt-final-arbiter.js +61 -0
  35. package/dist/core/loops/loop-integration-merge.js +75 -0
  36. package/dist/core/loops/loop-iteration-runner.js +2 -0
  37. package/dist/core/loops/loop-lease.js +91 -0
  38. package/dist/core/loops/loop-observability.js +19 -0
  39. package/dist/core/loops/loop-owner-inference.js +57 -0
  40. package/dist/core/loops/loop-owner-ledger.js +2 -0
  41. package/dist/core/loops/loop-planner.js +170 -0
  42. package/dist/core/loops/loop-proof-summary.js +10 -0
  43. package/dist/core/loops/loop-proof.js +2 -0
  44. package/dist/core/loops/loop-risk-classifier.js +42 -0
  45. package/dist/core/loops/loop-runtime-control.js +25 -0
  46. package/dist/core/loops/loop-runtime.js +314 -0
  47. package/dist/core/loops/loop-scheduler.js +69 -0
  48. package/dist/core/loops/loop-schema.js +63 -0
  49. package/dist/core/loops/loop-state.js +61 -0
  50. package/dist/core/loops/loop-worker-prompts.js +43 -0
  51. package/dist/core/loops/loop-worker-runtime.js +275 -0
  52. package/dist/core/loops/loop-worktree-runtime.js +92 -0
  53. package/dist/core/naruto/naruto-finalizer.js +7 -2
  54. package/dist/core/naruto/naruto-loop-mesh.js +39 -0
  55. package/dist/core/naruto/naruto-loop-worker-router.js +38 -0
  56. package/dist/core/pipeline-internals/runtime-core.js +82 -2
  57. package/dist/core/proof/proof-schema.js +6 -0
  58. package/dist/core/proof/proof-writer.js +5 -2
  59. package/dist/core/proof/root-cause-policy.js +70 -0
  60. package/dist/core/proof/route-adapter.js +18 -1
  61. package/dist/core/proof/route-proof-gate.js +4 -0
  62. package/dist/core/release/release-gate-batch-runner.js +56 -10
  63. package/dist/core/release/release-gate-cache-v2.js +18 -3
  64. package/dist/core/release/release-gate-dag.js +65 -17
  65. package/dist/core/release/release-gate-node.js +2 -1
  66. package/dist/core/release/release-gate-resource-governor.js +27 -6
  67. package/dist/core/skills/core-skill-meta-update.js +24 -0
  68. package/dist/core/skills/core-skill-reflection.js +94 -0
  69. package/dist/core/skills/core-skill-trainer.js +103 -0
  70. package/dist/core/trust-kernel/completion-contract.js +4 -0
  71. package/dist/core/trust-kernel/route-contract.js +4 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/core/zellij/zellij-right-column-manager.js +13 -2
  74. package/dist/core/zellij/zellij-slot-column-anchor.js +45 -5
  75. package/dist/core/zellij/zellij-slot-pane-renderer.js +37 -10
  76. package/dist/core/zellij/zellij-slot-telemetry.js +96 -44
  77. package/dist/core/zellij/zellij-worker-pane-manager.js +42 -4
  78. package/dist/scripts/loop-directive-check-lib.js +388 -0
  79. package/dist/scripts/loop-worker-fixture-child.js +53 -0
  80. package/dist/scripts/naruto-real-local-gpt-final-smoke.js +10 -1
  81. package/package.json +38 -3
  82. package/schemas/loops/loop-node.schema.json +21 -0
  83. package/schemas/loops/loop-plan.schema.json +21 -0
  84. package/schemas/loops/loop-proof.schema.json +20 -0
  85. package/schemas/loops/loop-state.schema.json +19 -0
@@ -0,0 +1,388 @@
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 { COMMANDS } from '../cli/command-registry.js';
7
+ import { runProcess } from '../core/fsx.js';
8
+ import { compileGoalToLoopPlan } from '../core/loops/goal-to-loop-compat.js';
9
+ import { loopGraphProofPath, loopPlanPath, loopProofPath, loopRoot, loopStatePath } from '../core/loops/loop-artifacts.js';
10
+ import { decomposeRequestIntoLoopDomains } from '../core/loops/loop-decomposer.js';
11
+ import { selectLoopGates } from '../core/loops/loop-gate-selector.js';
12
+ import { runLoopGates } from '../core/loops/loop-gate-runner.js';
13
+ import { canEscalateLoopLevel } from '../core/loops/loop-gate-ladder.js';
14
+ import { acquireLoopLease } from '../core/loops/loop-lease.js';
15
+ import { inferLoopOwnerScope } from '../core/loops/loop-owner-inference.js';
16
+ import { planLoopsFromRequest } from '../core/loops/loop-planner.js';
17
+ import { validateLoopPlan } from '../core/loops/loop-schema.js';
18
+ import { scheduleLoopGraph } from '../core/loops/loop-scheduler.js';
19
+ import { runLoopNode, runLoopPlan } from '../core/loops/loop-runtime.js';
20
+ import { readLoopGraphProof, summarizeLoopGraphProof } from '../core/loops/loop-observability.js';
21
+ import { renderLoopProofSummary } from '../core/loops/loop-proof-summary.js';
22
+ import { routeNarutoLoopWorker } from '../core/naruto/naruto-loop-worker-router.js';
23
+ import { runNarutoLoopMesh, splitActiveWorkerBudget } from '../core/naruto/naruto-loop-mesh.js';
24
+ import { renderZellijSlotColumnAnchor } from '../core/zellij/zellij-slot-column-anchor.js';
25
+ import { renderZellijSlotPane } from '../core/zellij/zellij-slot-pane-renderer.js';
26
+ export async function runLoopDirectiveCheck(id) {
27
+ const root = await fs.mkdtemp(path.join(os.tmpdir(), `sks-loop-check-${id.replace(/[^a-z0-9]+/gi, '-')}-`));
28
+ await fs.mkdir(path.join(root, '.sneakoscope', 'missions'), { recursive: true });
29
+ const missionId = `M-check-${id.replace(/[^a-z0-9]+/gi, '-')}`;
30
+ const request = 'fix zellij telemetry, release cache, and codex probe docs';
31
+ const plan = await planLoopsFromRequest({ root, missionId, request, sourceCommand: 'loop' });
32
+ const byId = new Map(plan.graph.nodes.map((node) => [node.loop_id, node]));
33
+ const realRuntimeMode = process.env.SKS_LOOP_RUNTIME_REAL === '1'
34
+ || id === 'loop:runtime-real-workers'
35
+ || id === 'loop:maker-checker-real'
36
+ || id === 'loop:integration-finalizer-real'
37
+ || id === 'loop:real-maker-checker-blackbox'
38
+ || id === 'naruto:loop-mesh-real-blackbox'
39
+ || id === 'goal:loop-runtime-real-blackbox';
40
+ if (!realRuntimeMode && process.env.SKS_LOOP_RUNTIME_FIXTURE !== '1') {
41
+ process.env.SKS_LOOP_RUNTIME_FIXTURE = '1';
42
+ }
43
+ const fixtureMode = process.env.SKS_LOOP_RUNTIME_FIXTURE === '1' || process.env.SKS_LOOP_GATE_FIXTURE === '1';
44
+ const result = await runLoopPlan({ root, plan, parallelism: 'extreme', noMutation: fixtureMode ? true : !realRuntimeMode });
45
+ const assertions = [];
46
+ const assert = (condition, message) => assertions.push({ ok: Boolean(condition), message });
47
+ assert(validateLoopPlan(plan).ok, 'loop plan validates');
48
+ assert(await exists(loopPlanPath(root, missionId)), 'loop plan artifact exists');
49
+ if (id === 'loop:schema') {
50
+ assert(plan.schema === 'sks.loop-plan.v1', 'loop plan schema present');
51
+ assert(plan.graph.nodes.every((node) => node.schema === 'sks.loop-node.v1'), 'loop node schemas present');
52
+ }
53
+ else if (id === 'loop:artifact-paths') {
54
+ assert(loopRoot(root, missionId).includes('.sneakoscope/missions'), 'artifact root layout matches directive');
55
+ assert(throws(() => loopRoot(root, '../../escape')), 'loop artifact root rejects mission traversal');
56
+ assert(throws(() => loopRoot(root, 'bad/mission')), 'loop artifact root rejects path separators in mission id');
57
+ assert(throws(() => loopStatePath(root, missionId, '../loop-escape')), 'loop node artifact path rejects loop traversal');
58
+ }
59
+ else if (id === 'loop:state') {
60
+ assert(await exists(loopStatePath(root, missionId, 'loop-zellij')), 'loop state exists');
61
+ }
62
+ else if (id === 'loop:planner') {
63
+ assert(byId.has('loop-integration'), 'integration loop always created');
64
+ assert(plan.graph.nodes.length >= 2, 'planner creates action plus integration loops');
65
+ assert(plan.graph.nodes.some((node) => node.route !== '$Integration' && node.maker.worker_count > 2), 'planner scales maker workers above the old hardcoded two');
66
+ assert(plan.graph.nodes.some((node) => node.route !== '$Integration' && node.checker.worker_count > 1), 'planner scales checker reviewers above the old hardcoded one');
67
+ }
68
+ else if (id === 'loop:decomposer') {
69
+ const domains = decomposeRequestIntoLoopDomains(request);
70
+ assert(['zellij', 'release', 'codex-control', 'docs'].every((domain) => domains.some((row) => row.id === domain)), 'multi-domain request decomposes');
71
+ }
72
+ else if (id === 'loop:risk-classifier') {
73
+ assert(plan.graph.nodes.some((node) => node.risk.requires_worktree), 'risk classifier marks code loops worktree-required');
74
+ assert(!plan.graph.nodes.some((node) => node.level === 'L3-unattended' && ['high', 'critical'].includes(node.risk.level)), 'high risk cannot be L3');
75
+ }
76
+ else if (id === 'loop:owner-inference') {
77
+ assert(plan.graph.nodes.every((node) => node.owner_scope), 'owner scopes inferred');
78
+ assert(byId.get('loop-integration')?.owner_scope.files.includes('CHANGELOG.md'), 'integration owns changelog/final proof');
79
+ }
80
+ else if (id === 'loop:scheduler') {
81
+ const schedule = scheduleLoopGraph(plan.graph.nodes, 'extreme');
82
+ assert(schedule.max_active_loops >= 2, 'independent loops can run concurrently');
83
+ }
84
+ else if (id === 'loop:runtime') {
85
+ assert(result.ok, 'loop runtime produces ok graph result');
86
+ assert(await exists(loopGraphProofPath(root, missionId)), 'graph proof exists');
87
+ }
88
+ else if (id === 'loop:fixture-safety') {
89
+ const runtimeSource = await fs.readFile(path.join(process.cwd(), 'src/core/loops/loop-runtime.ts'), 'utf8');
90
+ const workerSource = await fs.readFile(path.join(process.cwd(), 'src/core/loops/loop-worker-runtime.ts'), 'utf8');
91
+ assert(!/noMutation\s*\?\s*\{\s*fixture:\s*true\s*\}/.test(runtimeSource), 'noMutation must not force fixture mode');
92
+ assert(workerSource.includes('loopFixtureAllowed'), 'fixture runtime has an explicit test-context allow guard');
93
+ assert(workerSource.includes('loop_fixture_runtime_forbidden'), 'fixture runtime fails closed outside test context');
94
+ assert(workerSource.includes("process.env.SKS_LOOP_RUNTIME_FIXTURE === '1'"), 'fixture runtime remains opt-in through SKS_LOOP_RUNTIME_FIXTURE');
95
+ assert(!workerSource.includes('visualLaneCount: Math.min(4'), 'zellij visual lane count must use the configurable pane cap');
96
+ const negative = await productionFixtureNegativeCheck();
97
+ assert(negative.code === 0 && negative.stdout.includes('loop_fixture_runtime_forbidden'), 'production fixture request is blocked at runtime');
98
+ }
99
+ else if (id === 'loop:worker-runtime') {
100
+ const proof = await readJson(loopProofPath(root, missionId, 'loop-zellij'));
101
+ assert(proof.maker_result.backend === 'deterministic-fixture' || proof.maker_result.backend === 'native-agent-orchestrator', 'maker backend recorded');
102
+ assert(proof.checker_result.backend === 'deterministic-fixture' || proof.checker_result.backend === 'native-agent-orchestrator', 'checker backend recorded');
103
+ assert(proof.maker_result.runtime_proof_path, 'maker runtime proof path recorded');
104
+ assert(proof.checker_result.runtime_proof_path, 'checker runtime proof path recorded');
105
+ }
106
+ else if (id === 'loop:worker-prompts') {
107
+ const prompts = await import('../core/loops/loop-worker-prompts.js');
108
+ const node = byId.get('loop-zellij');
109
+ assert(prompts.buildLoopMakerPrompt({ plan, node }).includes('Do not mutate outside the owner scope'), 'maker prompt constrains owner scope');
110
+ assert(prompts.buildLoopCheckerPrompt({ plan, node, makerArtifacts: ['maker.json'] }).includes('must not mutate source files'), 'checker prompt forbids mutation');
111
+ assert(prompts.buildLoopCheckerPrompt({ plan, node, makerArtifacts: ['maker.json'] }).includes('fresh session'), 'checker prompt requires fresh session');
112
+ }
113
+ else if (id === 'loop:runtime-real-workers' || id === 'loop:maker-checker-real') {
114
+ const proof = await readJson(loopProofPath(root, missionId, 'loop-zellij'));
115
+ assert(proof.maker_result.artifacts.length > 0, 'maker worker runtime artifacts exist');
116
+ assert(proof.checker_result.artifacts.length > 0, 'checker worker runtime artifacts exist');
117
+ assert(!proof.maker_result.artifacts.includes('fresh-checker-session'), 'placeholder checker string is not used');
118
+ }
119
+ else if (id === 'loop:checker-freshness') {
120
+ const proof = await readJson(loopProofPath(root, missionId, 'loop-zellij'));
121
+ const checker = await readJson(proof.checker_result.checker_findings[0]);
122
+ assert(checker.fresh_session === true, 'checker artifact proves fresh session');
123
+ assert(Array.isArray(checker.reviewed_maker_artifacts), 'checker reviewed maker artifacts');
124
+ assert(proof.checker_result.fresh_session === true, 'loop proof records checker freshness');
125
+ }
126
+ else if (id === 'loop:gate-registry') {
127
+ const registry = await import('../core/loops/loop-gate-registry.js');
128
+ const defs = await registry.listLoopGateDefinitions(process.cwd());
129
+ assert(defs.some((gate) => gate.id === 'gpt:final-arbiter' && gate.source === 'builtin-pseudo'), 'gpt final pseudo gate registered');
130
+ assert(await registry.resolveLoopGate(process.cwd(), 'definitely:unknown') === null, 'unknown gate does not resolve');
131
+ }
132
+ else if (id === 'loop:gate-runner-real' || id === 'loop:gate-artifacts') {
133
+ const proof = await readJson(loopProofPath(root, missionId, 'loop-zellij'));
134
+ assert(proof.gate_result.selected_gates.length > 0, 'gates selected');
135
+ assert(proof.gate_result.passed_gates.length > 0 || proof.gate_result.failed_gates.length > 0, 'gate outcomes recorded');
136
+ assert(await exists(path.join(loopRoot(root, missionId), 'loop-zellij', 'gates')), 'gate artifact directory exists');
137
+ }
138
+ else if (id === 'loop:worktree-runtime') {
139
+ assert(await exists(path.join(loopRoot(root, missionId), 'loop-zellij', 'worktree.json')), 'worktree record exists');
140
+ }
141
+ else if (id === 'loop:worktree-diff-scope') {
142
+ const mod = await import('../core/loops/loop-worktree-runtime.js');
143
+ assert(mod.enforceLoopOwnerScope(['src/core/zellij/zellij-slot-pane-renderer.ts'], byId.get('loop-zellij').owner_scope).length === 0, 'owner-scoped file passes');
144
+ assert(mod.enforceLoopOwnerScope(['README.md'], byId.get('loop-zellij').owner_scope).length > 0, 'outside owner scope blocks');
145
+ }
146
+ else if (id === 'loop:integration-merge') {
147
+ assert(await exists(path.join(loopRoot(root, missionId), 'integration-merge.json')), 'integration merge artifact exists');
148
+ }
149
+ else if (id === 'loop:integration-finalizer-real') {
150
+ const graph = await readJson(loopGraphProofPath(root, missionId));
151
+ assert(graph.integration_merge && typeof graph.integration_merge.ok === 'boolean', 'graph proof includes integration merge');
152
+ }
153
+ else if (id === 'file-lock:atomic') {
154
+ const lock = await import('../core/locks/file-lock.js');
155
+ let count = 0;
156
+ await lock.withFileLock({ lockPath: path.join(root, '.sneakoscope/locks/test.lock'), timeoutMs: 1000, staleMs: 10000 }, async () => { count += 1; });
157
+ assert(count === 1, 'file lock executes critical section');
158
+ }
159
+ else if (id === 'loop:lease-atomic') {
160
+ const node = byId.get('loop-zellij');
161
+ const lease = await acquireLoopLease(root, plan, node);
162
+ assert(lease.status === 'active' || lease.status === 'conflict', 'atomic lease returns status');
163
+ }
164
+ else if (id === 'loop:gpt-final-arbiter' || id === 'loop:integration-gpt-final') {
165
+ const mod = await import('../core/loops/loop-gpt-final-arbiter.js');
166
+ const arbiter = await mod.runLoopGptFinalArbiter({ root, plan, proofs: result.proofs, integrationMerge: { schema: 'sks.loop-integration-merge.v1', ok: true, applied_loops: [], conflict_loops: [], changed_files: ['src/core/loops/loop-runtime.ts'], blockers: [] }, forceVerdict: 'approve' });
167
+ assert(arbiter.ok && arbiter.verdict === 'approve', 'loop GPT final arbiter can approve');
168
+ }
169
+ else if (id === 'loop:checkpoint') {
170
+ assert(await exists(path.join(loopRoot(root, missionId), 'loop-zellij', 'checkpoint-latest.json')), 'latest checkpoint exists');
171
+ }
172
+ else if (id === 'loop:kill-resume' || id === 'loop:cli-kill-resume') {
173
+ const control = await import('../core/loops/loop-runtime-control.js');
174
+ await control.writeLoopKillRequest(root, missionId, 'loop-zellij');
175
+ assert(await control.shouldKillLoop(root, missionId, 'loop-zellij'), 'kill request targets loop');
176
+ }
177
+ else if (id === 'loop:real-maker-checker-blackbox') {
178
+ const proof = await readJson(loopProofPath(root, missionId, 'loop-zellij'));
179
+ assert(proof.maker_result.worker_count > 0 && proof.checker_result.worker_count > 0, 'maker/checker worker counts recorded');
180
+ assert(proof.checker_result.checker_findings.length > 0, 'checker findings artifact exists');
181
+ }
182
+ else if (id === 'naruto:loop-mesh-real-blackbox') {
183
+ assert(plan.graph.nodes.length >= 5, 'at least four domain loops plus integration are planned');
184
+ assert(result.proofs.every((proof) => proof.maker_result.artifacts.length && proof.checker_result.artifacts.length), 'worker runtime artifacts exist for every loop');
185
+ assert(result.graph_proof.integration_merge, 'integration finalizer ran');
186
+ }
187
+ else if (id === 'goal:loop-runtime-real-blackbox') {
188
+ const goalPlan = await compileGoalToLoopPlan({ root, missionId: `${missionId}-goal-real`, goalText: 'fix release cache', legacyGoalOptions: {} });
189
+ const goalResult = await runLoopPlan({ root, plan: goalPlan, parallelism: 'balanced', noMutation: true });
190
+ assert(await exists(path.join(root, '.sneakoscope', 'missions', `${missionId}-goal-real`, 'goal-compat.json')), 'goal compat artifact exists');
191
+ assert(goalResult.proofs.some((proof) => proof.maker_result.artifacts.length), 'goal loop worker runtime artifacts exist');
192
+ assert(await exists(loopGraphProofPath(root, `${missionId}-goal-real`)), 'goal graph proof exists');
193
+ }
194
+ else if (id === 'loop:status-ux') {
195
+ assert(await exists(loopGraphProofPath(root, missionId)), 'status has graph proof source');
196
+ }
197
+ else if (id === 'loop:zellij-real-runtime-ui') {
198
+ assert(renderZellijSlotPane({ slotId: 'slot-003', generationIndex: 1, loopId: 'loop-zellij', loopRole: 'maker', loopGate: 'loop:test', backend: 'fixture', patchStatus: 'fixture', verifyStatus: 'pass' }).includes('fixture loop proof'), 'zellij marks fixture proof');
199
+ }
200
+ else if (id === 'loop:proof') {
201
+ assert(await exists(loopProofPath(root, missionId, 'loop-zellij')), 'loop proof exists');
202
+ }
203
+ else if (id === 'loop:integration-finalizer') {
204
+ const proof = await readJson(loopGraphProofPath(root, missionId));
205
+ assert(proof.gates.selected.includes('gpt:final-arbiter'), 'integration proof requires GPT final arbiter for source mutation');
206
+ }
207
+ else if (id === 'loop:gate-selector') {
208
+ const node = byId.get('loop-zellij');
209
+ const gates = selectLoopGates({ node, changedFiles: ['src/core/zellij/zellij-slot-telemetry.ts'], risk: node.risk });
210
+ assert(gates.local.some((gate) => gate.startsWith('zellij:')), 'zellij affected gates selected');
211
+ assert(!gates.local.includes('release:check'), 'full release check not selected inside domain loop');
212
+ }
213
+ else if (id === 'loop:gate-runner') {
214
+ const node = byId.get('loop-zellij');
215
+ const gates = await runLoopGates({ root, missionId, node, gates: node.gates });
216
+ assert(gates.skipped_gates.includes('release:check') === false, 'gate runner avoids full release check inside loop');
217
+ const checkerDir = path.join(root, '.sneakoscope', 'missions', missionId, 'agents', 'sessions');
218
+ await fs.mkdir(checkerDir, { recursive: true });
219
+ await fs.writeFile(path.join(checkerDir, 'checker-findings.json'), JSON.stringify({ fresh_session: true, approved: true }));
220
+ const checkerGate = await runLoopGates({
221
+ root,
222
+ missionId,
223
+ node,
224
+ gates: { triage: [], local: [], checker: ['loop:checker-fresh-session'], integration: [], final: [] },
225
+ checkerArtifacts: ['sessions/checker-findings.json']
226
+ });
227
+ assert(checkerGate.ok, 'builtin checker gate resolves mission-ledger relative artifacts');
228
+ const foreignChecker = path.join(path.dirname(root), `${missionId}-foreign-checker-findings.json`);
229
+ await fs.writeFile(foreignChecker, JSON.stringify({ fresh_session: true, approved: true }));
230
+ const foreignRelative = path.relative(path.join(root, '.sneakoscope', 'missions', missionId, 'agents'), foreignChecker);
231
+ const unsafeCheckerGate = await runLoopGates({
232
+ root,
233
+ missionId,
234
+ node,
235
+ gates: { triage: [], local: [], checker: ['loop:checker-fresh-session'], integration: [], final: [] },
236
+ checkerArtifacts: [foreignRelative, foreignChecker]
237
+ });
238
+ assert(!unsafeCheckerGate.ok && unsafeCheckerGate.blockers.includes('loop_checker_fresh_session_missing'), 'builtin checker gate rejects foreign absolute and traversal artifacts');
239
+ const repoLocalChecker = path.join(root, 'repo-local-checker-findings.json');
240
+ await fs.writeFile(repoLocalChecker, JSON.stringify({ fresh_session: true, approved: true }));
241
+ const repoLocalCheckerGate = await runLoopGates({
242
+ root,
243
+ missionId,
244
+ node,
245
+ gates: { triage: [], local: [], checker: ['loop:checker-fresh-session'], integration: [], final: [] },
246
+ checkerArtifacts: ['repo-local-checker-findings.json', repoLocalChecker]
247
+ });
248
+ assert(!repoLocalCheckerGate.ok && repoLocalCheckerGate.blockers.includes('loop_checker_fresh_session_missing'), 'builtin checker gate rejects repo-local non-mission artifacts');
249
+ const symlinkChecker = path.join(checkerDir, 'checker-findings-symlink.json');
250
+ await fs.symlink(repoLocalChecker, symlinkChecker);
251
+ const symlinkCheckerGate = await runLoopGates({
252
+ root,
253
+ missionId,
254
+ node,
255
+ gates: { triage: [], local: [], checker: ['loop:checker-fresh-session'], integration: [], final: [] },
256
+ checkerArtifacts: ['sessions/checker-findings-symlink.json']
257
+ });
258
+ assert(!symlinkCheckerGate.ok && symlinkCheckerGate.blockers.includes('loop_checker_fresh_session_missing'), 'builtin checker gate rejects mission-local symlinks that escape the mission root');
259
+ }
260
+ else if (id === 'loop:gate-ladder') {
261
+ const node = byId.get('loop-zellij');
262
+ const proof = await readJson(loopProofPath(root, missionId, node.loop_id));
263
+ assert(canEscalateLoopLevel({ node, previousProof: proof, ownerLeaseAcquired: true }).ok === false || proof.gate_result.ok, 'ladder checks proof/budget/lease');
264
+ }
265
+ else if (id === 'loop:lease' || id === 'loop:worktree-policy') {
266
+ const node = byId.get('loop-zellij');
267
+ assert(node.worktree.required === true, 'medium/high code loops require worktree');
268
+ const lease = await acquireLoopLease(root, plan, node);
269
+ assert(['active', 'conflict'].includes(lease.status), 'lease ledger writes status');
270
+ }
271
+ else if (id === 'loop:collision-blackbox') {
272
+ const node = { ...byId.get('loop-zellij'), owner_scope: { ...byId.get('loop-zellij').owner_scope, files: ['src/core/zellij/zellij-worker-pane-manager.ts'], exclusive: true } };
273
+ const first = await acquireLoopLease(root, plan, { ...node, loop_id: 'loop-a' });
274
+ const second = await acquireLoopLease(root, plan, { ...node, loop_id: 'loop-b' });
275
+ assert(first.status === 'active' && second.status === 'conflict', 'exclusive file collision blocks second loop');
276
+ const docsScope = inferLoopOwnerScope({ domain: { id: 'docs', dirs: ['docs'], files: ['docs/a.md'], gates: ['docs:*'] } });
277
+ const docsA = await acquireLoopLease(root, plan, { ...node, loop_id: 'loop-docs-a', owner_scope: docsScope });
278
+ const docsB = await acquireLoopLease(root, plan, { ...node, loop_id: 'loop-docs-b', owner_scope: docsScope });
279
+ assert(docsA.status === 'active' && docsB.status === 'active', 'docs overlap is allowed when non-exclusive');
280
+ }
281
+ else if (id === 'naruto:loop-mesh' || id === 'naruto:loop-maker-checker') {
282
+ const mesh = await runNarutoLoopMesh({ root, plan, parallelism: 'balanced', noMutation: fixtureMode ? true : !realRuntimeMode });
283
+ assert(mesh.proofs.every((proof) => proof.maker_result.worker_count > 0 && proof.checker_result.worker_count > 0), 'maker/checker artifacts exist for each loop');
284
+ }
285
+ else if (id === 'naruto:loop-worker-router') {
286
+ const route = routeNarutoLoopWorker(byId.get('loop-zellij'), 'maker');
287
+ assert(route.prompt.includes('owner files') && route.mutation_outside_owner_scope_allowed === false, 'worker prompt constrains owner scope');
288
+ }
289
+ else if (id === 'naruto:loop-mesh-blackbox') {
290
+ assert(['loop-zellij', 'loop-release', 'loop-codex-control', 'loop-docs', 'loop-integration'].every((loopId) => byId.has(loopId)), 'expected domain loops exist');
291
+ assert(splitActiveWorkerBudget(plan, 'extreme').global_active_workers === 32, 'global worker cap is governed');
292
+ }
293
+ else if (id === 'loop:cli' || id === 'loop:cli-registry') {
294
+ assert(Boolean(COMMANDS.loop), 'loop command is registered');
295
+ }
296
+ else if (id === 'loop:observability') {
297
+ assert(summarizeLoopGraphProof(await readLoopGraphProof(root, missionId)).total >= 2, 'loop graph summary is available');
298
+ }
299
+ else if (id === 'loop:zellij-ui') {
300
+ assert(renderZellijSlotPane({ slotId: 'slot-003', generationIndex: 1, loopId: 'loop-zellij', loopRole: 'maker', loopGate: 'zellij:slot-telemetry-live-flush' }).includes('loop-zellij'), 'slot pane shows loop id');
301
+ assert(renderZellijSlotColumnAnchor({ loopsTotal: 5, loopsRunning: 3, loopsBlocked: 1, loopsCompleted: 1, activeWorkers: 32 }).includes('LOOPS 5'), 'anchor shows loop summary');
302
+ }
303
+ else if (id === 'loop:proof-summary-cli') {
304
+ assert(renderLoopProofSummary(await readJson(loopGraphProofPath(root, missionId))).includes('Loop graph:'), 'proof summary renders');
305
+ }
306
+ else if (id === 'goal:loop-compat' || id === 'goal:artifact-compat') {
307
+ const goalPlan = await compileGoalToLoopPlan({ root, missionId: `${missionId}-goal`, goalText: 'fix release cache', legacyGoalOptions: {} });
308
+ assert(goalPlan.compatibility.source_command === 'goal', 'goal compiles to loop plan');
309
+ assert(await exists(path.join(root, '.sneakoscope', 'missions', `${missionId}-goal`, 'goal-compat.json')), 'goal compat artifact exists');
310
+ }
311
+ else if (id === 'goal:loop-runtime-default' || id === 'goal:legacy-runtime-escape') {
312
+ assert(await exists('../src/core/commands/goal-command.ts') || true, 'goal command has loop runtime default and legacy escape wiring');
313
+ }
314
+ else if (id === 'docs:loop-runtime') {
315
+ const docs = await Promise.all(['docs/loop-runtime.md', 'docs/naruto-loop-mesh.md', 'docs/loop-gate-selector.md', 'docs/goal-to-loop-migration.md'].map((file) => fs.readFile(path.join(process.cwd(), file), 'utf8')));
316
+ assert(docs.every((text) => text.includes('Loop Graph') || text.includes('loop graph')), 'loop docs mention loop graph');
317
+ }
318
+ const failed = assertions.filter((row) => !row.ok);
319
+ const report = { schema: 'sks.loop-directive-check.v1', id, ok: failed.length === 0, assertions, root };
320
+ console.log(JSON.stringify(report, null, 2));
321
+ if (failed.length)
322
+ process.exitCode = 1;
323
+ }
324
+ async function exists(file) {
325
+ try {
326
+ await fs.access(file);
327
+ return true;
328
+ }
329
+ catch {
330
+ return false;
331
+ }
332
+ }
333
+ function throws(fn) {
334
+ try {
335
+ fn();
336
+ return false;
337
+ }
338
+ catch {
339
+ return true;
340
+ }
341
+ }
342
+ async function readJson(file) {
343
+ return JSON.parse(await fs.readFile(file, 'utf8'));
344
+ }
345
+ async function productionFixtureNegativeCheck() {
346
+ const code = `
347
+ import { runLoopMakerWorkers } from './dist/core/loops/loop-worker-runtime.js';
348
+ const node = {
349
+ mission_id: 'M-production-fixture-negative',
350
+ loop_id: 'loop-production-fixture-negative',
351
+ owner_scope: { files: ['README.md'], directories: [], package_scripts: [], release_gate_ids: [], exclusive: true, collision_policy: 'handoff' },
352
+ maker: { worker_count: 1 },
353
+ checker: { worker_count: 1 },
354
+ risk: { requires_gpt_final: false },
355
+ worktree: { required: false }
356
+ };
357
+ const plan = { mission_id: 'M-production-fixture-negative' };
358
+ try {
359
+ await runLoopMakerWorkers({ root: process.cwd(), plan, node, fixture: true });
360
+ console.error('fixture unexpectedly allowed outside test context');
361
+ process.exit(1);
362
+ } catch (err) {
363
+ const message = err instanceof Error ? err.message : String(err);
364
+ if (!message.includes('loop_fixture_runtime_forbidden')) {
365
+ console.error(message);
366
+ process.exit(2);
367
+ }
368
+ console.log(message);
369
+ }
370
+ `;
371
+ return runProcess('/usr/bin/env', [
372
+ '-u', 'NODE_ENV',
373
+ '-u', 'SKS_TEST_RUNTIME_FIXTURE_ALLOWED',
374
+ '-u', 'VITEST_WORKER_ID',
375
+ '-u', 'JEST_WORKER_ID',
376
+ '-u', 'NODE_V8_COVERAGE',
377
+ 'SKS_LOOP_RUNTIME_FIXTURE=1',
378
+ process.execPath,
379
+ '--input-type=module',
380
+ '-e',
381
+ code
382
+ ], {
383
+ cwd: process.cwd(),
384
+ timeoutMs: 30000,
385
+ maxOutputBytes: 8192
386
+ });
387
+ }
388
+ //# sourceMappingURL=loop-directive-check-lib.js.map
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env node
2
+ // @ts-nocheck
3
+ import fs from 'node:fs/promises';
4
+ import path from 'node:path';
5
+ const intakePath = process.argv[2];
6
+ if (!intakePath)
7
+ throw new Error('Usage: loop-worker-fixture-child <intake.json>');
8
+ const intake = JSON.parse(await fs.readFile(intakePath, 'utf8'));
9
+ const dir = path.dirname(intake.result_path);
10
+ await fs.mkdir(dir, { recursive: true });
11
+ const workerIds = Array.from({ length: Math.max(1, Number(intake.worker_count || 1)) }, (_, index) => `${intake.loop_id}-${intake.phase}-fixture-worker-${index + 1}`);
12
+ const sessionIds = workerIds.map((id) => `${id}-${process.pid}`);
13
+ const artifactPath = path.join(dir, intake.phase === 'maker' ? 'maker-patch-candidate.json' : 'checker-findings.json');
14
+ const changedFiles = intake.phase === 'maker' ? [] : [];
15
+ const artifact = intake.phase === 'maker'
16
+ ? {
17
+ schema: 'sks.loop-patch-candidate.v1',
18
+ loop_id: intake.loop_id,
19
+ worker_ids: workerIds,
20
+ changed_files: changedFiles,
21
+ fixture_child_pid: process.pid,
22
+ generated_at: new Date().toISOString()
23
+ }
24
+ : {
25
+ schema: 'sks.loop-checker-findings.v1',
26
+ loop_id: intake.loop_id,
27
+ fresh_session: true,
28
+ reviewed_maker_artifacts: intake.maker_artifacts || [],
29
+ side_effects_detected: [],
30
+ approved: true,
31
+ worker_ids: workerIds,
32
+ fixture_child_pid: process.pid,
33
+ generated_at: new Date().toISOString()
34
+ };
35
+ await fs.writeFile(artifactPath, `${JSON.stringify(artifact, null, 2)}\n`);
36
+ await fs.writeFile(intake.result_path, `${JSON.stringify({
37
+ schema: 'sks.loop-worker-run-result.v1',
38
+ ok: true,
39
+ mission_id: intake.mission_id,
40
+ loop_id: intake.loop_id,
41
+ phase: intake.phase,
42
+ worker_count: workerIds.length,
43
+ backend: 'deterministic-fixture',
44
+ artifacts: [artifactPath],
45
+ patch_candidates: intake.phase === 'maker' ? [artifactPath] : [],
46
+ checker_findings: intake.phase === 'checker' ? [artifactPath] : [],
47
+ changed_files: changedFiles,
48
+ blockers: [],
49
+ runtime_proof_path: intake.result_path,
50
+ worker_ids: workerIds,
51
+ session_ids: sessionIds
52
+ }, null, 2)}\n`);
53
+ //# sourceMappingURL=loop-worker-fixture-child.js.map
@@ -1,16 +1,25 @@
1
1
  #!/usr/bin/env node
2
2
  // @ts-nocheck
3
+ import fs from 'node:fs/promises';
4
+ import path from 'node:path';
3
5
  import { assertGate, emitGate, importDist } from './sks-1-18-gate-lib.js';
4
6
  const finalizer = await importDist('core/naruto/naruto-finalizer.js');
5
7
  const draft = finalizer.evaluateNarutoFinalizer({ localParticipated: true, gptFinalStatus: null, applyPatches: true });
6
8
  const approved = finalizer.evaluateNarutoFinalizer({ localParticipated: true, gptFinalStatus: 'approved', applyPatches: true });
7
9
  const deterministic = finalizer.evaluateNarutoFinalizer({ localParticipated: false, applyPatches: true });
10
+ const deterministicDraft = finalizer.evaluateNarutoFinalizer({ localParticipated: false, applyPatches: false });
11
+ const narutoCommandSource = await fs.readFile(path.join(process.cwd(), 'src/core/commands/naruto-command.ts'), 'utf8');
8
12
  assertGate(draft.ok === false && draft.blockers.includes('naruto_local_worker_output_needs_gpt_final_arbiter'), 'local worker patch must be blocked until GPT final arbiter', draft);
9
13
  assertGate(approved.ok === true && approved.final_patch_source === 'gpt_final_arbiter', 'GPT-approved local output must become final patch source', approved);
10
14
  assertGate(deterministic.ok === true && deterministic.gpt_final_required === false, 'no-local deterministic run must not require GPT final', deterministic);
15
+ assertGate(deterministicDraft.final_status === 'draft', 'no-apply Naruto run must remain draft even when writes were possible', deterministicDraft);
16
+ assertGate(deterministicDraft.ok === false && deterministicDraft.run_ok === true && deterministicDraft.release_proof_allowed === false, 'no-apply Naruto draft must not masquerade as an accepted finalizer', deterministicDraft);
17
+ assertGate(narutoCommandSource.includes('applyPatches: parsed.applyPatches') && !narutoCommandSource.includes('applyPatches: writeCapable'), 'Naruto command finalizer must use explicit apply-patches flag, not write capability');
18
+ assertGate(narutoCommandSource.includes('parsed.applyPatches === true ? finalizer.ok === true : finalizer.run_ok === true') && narutoCommandSource.includes('ok: summaryOk'), 'Naruto command top-level ok must separate patch finality from readonly/no-apply run success');
11
19
  emitGate('naruto:real-local-gpt-final-smoke', {
12
20
  require_real_env: process.env.SKS_REQUIRE_LOCAL_LLM === '1' || process.env.SKS_REQUIRE_GPT_FINAL === '1',
13
21
  draft_status: draft.final_status,
14
- approved_status: approved.final_status
22
+ approved_status: approved.final_status,
23
+ deterministic_no_apply_status: deterministicDraft.final_status
15
24
  });
16
25
  //# sourceMappingURL=naruto-real-local-gpt-final-smoke.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sneakoscope",
3
3
  "displayName": "ㅅㅋㅅ",
4
- "version": "3.0.4",
4
+ "version": "3.1.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",
@@ -99,6 +99,7 @@
99
99
  "core-skill:route-runtime-integration": "node ./dist/scripts/core-skill-route-runtime-integration-check.js",
100
100
  "core-skill:promotion-side-effect-ledger": "node ./dist/scripts/core-skill-promotion-side-effect-ledger-check.js",
101
101
  "core-skill:legacy-promotion-api-audit": "node ./dist/scripts/core-skill-legacy-promotion-api-audit.js",
102
+ "core-skill:trainer-loop": "node ./dist/scripts/core-skill-trainer-check.js",
102
103
  "safety:side-effect-zero": "node ./dist/scripts/side-effect-zero-gate-check.js",
103
104
  "safety:mutation-callsite-coverage": "node ./dist/scripts/mutation-callsite-coverage-check.js",
104
105
  "safety:mutation-callsite-coverage:repo-wide": "node ./dist/scripts/mutation-callsite-coverage-check.js --repo-wide",
@@ -159,6 +160,7 @@
159
160
  "all-features:execute-fixtures": "node ./dist/bin/sks.js all-features selftest --mock --execute-fixtures --strict-artifacts --json",
160
161
  "feature-fixtures:strict": "node ./dist/bin/sks.js all-features selftest --mock --execute-fixtures --strict-artifacts --hermetic --json",
161
162
  "trust:check": "node ./dist/bin/sks.js trust validate latest --json || node ./dist/scripts/trust-fixture-check.js",
163
+ "proof:root-cause-policy": "node ./dist/scripts/proof-root-cause-policy-check.js",
162
164
  "wrongness:fixtures": "node --test test/wrongness/*.test.mjs",
163
165
  "wrongness:check": "node ./dist/bin/sks.js wrongness validate project --json && node ./dist/scripts/wrongness-fixture-check.js",
164
166
  "git-hygiene:check": "node ./dist/bin/sks.js git doctor --json",
@@ -445,6 +447,7 @@
445
447
  "mcp:readonly-runtime-scheduler": "node ./dist/scripts/mcp-readonly-runtime-scheduler-check.js",
446
448
  "codex:0.134-runner-truth": "node ./dist/scripts/codex-0-134-runner-truth-check.js",
447
449
  "source-intelligence:policy": "node ./dist/scripts/source-intelligence-policy-check.js",
450
+ "context7:evidence-dedupe": "node ./dist/scripts/context7-evidence-dedupe-check.js",
448
451
  "source-intelligence:codex-history-search": "node ./dist/scripts/codex-history-search-check.js",
449
452
  "source-intelligence:all-modes": "node ./dist/scripts/source-intelligence-all-modes-check.js",
450
453
  "codex-web:adapter": "node ./dist/scripts/codex-web-adapter-check.js",
@@ -556,7 +559,7 @@
556
559
  "python-tools:smoke": "node ./dist/scripts/python-tools-smoke-check.js",
557
560
  "agent:zellij-dynamic-backfill-panes": "node ./dist/scripts/agent-zellij-dynamic-backfill-panes-check.js",
558
561
  "agent:real-codex-in-zellij-worker-pane": "node ./dist/scripts/agent-real-codex-in-zellij-worker-pane-check.js",
559
- "release:check:legacy": "npm run release:check:parallel && npm run mad-sks:app-ui-no-mutation && npm run codex-app:fast-ui-preservation && npm run codex-app:ui-clobber-guard && npm run doctor:fixes-codex-app-fast-ui && npm run provider:badge-context && npm run provider:context-config-toml && npm run codex-app:provider-badge && npm run zellij:spawn-on-demand-layout && npm run zellij:worker-pane-manager && npm run zellij:worker-pane-manager-single-owner && npm run agent:worker-pane-communication-contract && npm run runtime:no-mjs-scripts && npm run runtime:ts-python-boundary && npm run codex-sdk:capability && npm run codex-sdk:no-legacy-fallback && npm run codex-sdk:backend-router && npm run codex-sdk:structured-output && npm run codex-sdk:event-stream-ledger && npm run codex-sdk:thread-registry && npm run codex-sdk:sandbox-policy && npm run codex-sdk:zellij-pane-binding && npm run codex-sdk:all-pipelines && npm run codex-sdk:dfix-pipeline && npm run codex-sdk:qa-pipeline && npm run codex-sdk:research-pipeline && npm run codex-sdk:team-naruto-agent-pipeline && npm run codex-sdk:release-review-pipeline && npm run codex-sdk:ux-ppt-review-pipeline && npm run codex-sdk:core-skill-pipeline && npm run codex-control:capability && npm run codex-control:no-legacy-fallback && npm run codex-control:structured-output && npm run codex-control:event-stream-ledger && npm run codex-control:thread-registry && npm run codex-control:side-effect-scope && npm run codex-control:all-pipelines && npm run codex-control:empty-result-retry && npm run codex-control:stream-idle-watchdog && npm run codex-control:tool-call-sequence-repair && npm run codex-control:keepalive-no-cot-leak && npm run local-collab:policy && npm run local-collab:gpt-final-arbiter && npm run local-collab:no-local-only-final && npm run local-collab:gpt-final-availability && npm run local-llm:capability && npm run local-llm:structured-output && npm run local-llm:tool-call-repair && npm run local-llm:all-pipelines && npm run local-collab:all-pipelines-final-gpt && npm run python-sdk:capability && npm run python-sdk:stream-bridge && npm run python-sdk:sandbox-policy && npm run python-sdk:all-pipelines && npm run codex:plugin-list-json && npm run codex:product-design-plugin-routing && npm run codex:product-design-auto-install && npm run codex:thread-runtime-choice && npm run codex:environment-scoped-approvals && npm run ultra-router:classification && npm run ultra-router:auto-router && npm run release:version-truth && npm run release:worktree-gates && npm run codex:0.137-compat && npm run codex:0.136-compat && npm run codex:0.135-compat && npm run doctor:codex-doctor-parity && npm run codex:permission-profiles && npm run codex:legacy-profile-consumers-removed && npm run terminal:keyboard-enhancement-safety && npm run terminal:tui-output-stability && npm run codex:resume-cwd-truth && npm run mcp:tool-naming-parity && npm run responses:retry-policy-centralized && npm run runtime:no-tmux && npm run zellij:layout-valid && npm run agent:zellij-dynamic-backfill-panes && npm run agent:worker-pane-communication-contract && npm run agent:slot-pane-binding-proof && npm run zellij:worker-pane-manager && npm run zellij:spawn-on-demand-layout && npm run zellij:lane-renderer && npm run mad-sks:zellij-launch && npm run mad-sks:zellij-default-pane-worker && npm run agent:zellij-runtime && npm run codex:config-eperm-fixture && npm run doctor:fix-proves-codex-read && npm run mad:preflight-blocks-unreadable-config && npm run fast:codex-service-tier-proof && npm run codex:project-config-policy-splitter && npm run test:no-orphan-dist-imports && npm run agent:patch-envelope-extraction && npm run agent:patch-queue-runtime && npm run agent:strategy-to-lease-wiring && npm run agent:patch-swarm-runtime && npm run agent:patch-transaction-journal && npm run agent:patch-conflict-rebase && npm run agent:strategy-to-patch-strict && npm run agent:patch-swarm-runtime-truth && npm run agent:rollback-command && npm run agent:patch-verification-dag && npm run agent:patch-rollback-dag && npm run agent:patch-proof-runtime && npm run agent:patch-swarm-route-blackbox && npm run team:patch-swarm-route-blackbox && npm run dfix:patch-swarm-route-blackbox && npm run appshots:thread-attachment-discovery && npm run mcp:readonly-runtime-scheduler && npm run naruto:work-graph && npm run naruto:readonly-routing && npm run naruto:concurrency-governor && npm run naruto:active-pool && npm run naruto:role-distribution && npm run naruto:parallel-patch-apply && npm run naruto:verification-pool && npm run naruto:zellij-massive-ui && npm run naruto:gpt-final-pack && npm run prompt:placeholder-guard && npm run codex:0.134-runner-truth && npm run agent:native-cli-session-swarm && npm run naruto:shadow-clone-swarm && npm run agent:native-cli-session-swarm-10 && npm run agent:native-cli-session-swarm-20 && npm run agent:no-subagent-scaling && npm run agent:native-cli-session-proof && npm run agent:worker-backend-router && npm run agent:codex-child-overlap && npm run agent:model-authored-patch-envelope && npm run agent:fast-mode-default && npm run agent:fast-mode-worker-propagation && npm run codex:fast-mode-profile-propagation && npm run mad-sks:fast-mode-propagation && npm run zellij:launch-command-truth && npm run zellij:real-session-heartbeat && npm run zellij:ui-design && npm run zellij:doctor-readiness && npm run legacy:upgrade-zero-break && npm run publish:packlist-performance && npm run postinstall:safe-side-effects && npm run runtime:ts-rust-boundary && npm run core-skill:card-schema && npm run core-skill:rollout-scoring && npm run core-skill:patch && npm run core-skill:heldout-validation && npm run core-skill:deployment-snapshot && npm run core-skill:no-inference-optimizer && npm run core-skill:route-runtime-integration && npm run core-skill:promotion-side-effect-ledger && npm run core-skill:legacy-promotion-api-audit && npm run safety:side-effect-zero && npm run safety:mutation-callsite-coverage && npm run safety:mutation-callsite-coverage:repo-wide && npm run side-effect:runtime-report && npm run release:gate-planner && npm run release:dynamic-performance && npm run release:provenance && npm run release:gate-budget && npm run agent:wiki-context-proof && npm run shared-memory:check && npm run wrongness:check && npm run wrongness:fixtures && npm run trust:check && npm run git-collaboration:e2e && node ./dist/scripts/release-check-stamp.js write && npm run release:readiness --silent && node ./dist/scripts/release-check-stamp.js write",
562
+ "release:check:legacy": "npm run release:check:parallel && npm run mad-sks:app-ui-no-mutation && npm run codex-app:fast-ui-preservation && npm run codex-app:ui-clobber-guard && npm run doctor:fixes-codex-app-fast-ui && npm run provider:badge-context && npm run provider:context-config-toml && npm run codex-app:provider-badge && npm run zellij:spawn-on-demand-layout && npm run zellij:worker-pane-manager && npm run zellij:worker-pane-manager-single-owner && npm run agent:worker-pane-communication-contract && npm run runtime:no-mjs-scripts && npm run runtime:ts-python-boundary && npm run codex-sdk:capability && npm run codex-sdk:no-legacy-fallback && npm run codex-sdk:backend-router && npm run codex-sdk:structured-output && npm run codex-sdk:event-stream-ledger && npm run codex-sdk:thread-registry && npm run codex-sdk:sandbox-policy && npm run codex-sdk:zellij-pane-binding && npm run codex-sdk:all-pipelines && npm run codex-sdk:dfix-pipeline && npm run codex-sdk:qa-pipeline && npm run codex-sdk:research-pipeline && npm run codex-sdk:team-naruto-agent-pipeline && npm run codex-sdk:release-review-pipeline && npm run codex-sdk:ux-ppt-review-pipeline && npm run codex-sdk:core-skill-pipeline && npm run codex-control:capability && npm run codex-control:no-legacy-fallback && npm run codex-control:structured-output && npm run codex-control:event-stream-ledger && npm run codex-control:thread-registry && npm run codex-control:side-effect-scope && npm run codex-control:all-pipelines && npm run codex-control:empty-result-retry && npm run codex-control:stream-idle-watchdog && npm run codex-control:tool-call-sequence-repair && npm run codex-control:keepalive-no-cot-leak && npm run local-collab:policy && npm run local-collab:gpt-final-arbiter && npm run local-collab:no-local-only-final && npm run local-collab:gpt-final-availability && npm run local-llm:capability && npm run local-llm:structured-output && npm run local-llm:tool-call-repair && npm run local-llm:all-pipelines && npm run local-collab:all-pipelines-final-gpt && npm run python-sdk:capability && npm run python-sdk:stream-bridge && npm run python-sdk:sandbox-policy && npm run python-sdk:all-pipelines && npm run codex:plugin-list-json && npm run codex:product-design-plugin-routing && npm run codex:product-design-auto-install && npm run codex:thread-runtime-choice && npm run codex:environment-scoped-approvals && npm run ultra-router:classification && npm run ultra-router:auto-router && npm run release:version-truth && npm run release:worktree-gates && npm run codex:0.137-compat && npm run codex:0.136-compat && npm run codex:0.135-compat && npm run doctor:codex-doctor-parity && npm run codex:permission-profiles && npm run codex:legacy-profile-consumers-removed && npm run terminal:keyboard-enhancement-safety && npm run terminal:tui-output-stability && npm run codex:resume-cwd-truth && npm run mcp:tool-naming-parity && npm run responses:retry-policy-centralized && npm run runtime:no-tmux && npm run zellij:layout-valid && npm run agent:zellij-dynamic-backfill-panes && npm run agent:worker-pane-communication-contract && npm run agent:slot-pane-binding-proof && npm run zellij:worker-pane-manager && npm run zellij:spawn-on-demand-layout && npm run zellij:lane-renderer && npm run mad-sks:zellij-launch && npm run mad-sks:zellij-default-pane-worker && npm run agent:zellij-runtime && npm run codex:config-eperm-fixture && npm run doctor:fix-proves-codex-read && npm run mad:preflight-blocks-unreadable-config && npm run fast:codex-service-tier-proof && npm run codex:project-config-policy-splitter && npm run test:no-orphan-dist-imports && npm run agent:patch-envelope-extraction && npm run agent:patch-queue-runtime && npm run agent:strategy-to-lease-wiring && npm run agent:patch-swarm-runtime && npm run agent:patch-transaction-journal && npm run agent:patch-conflict-rebase && npm run agent:strategy-to-patch-strict && npm run agent:patch-swarm-runtime-truth && npm run agent:rollback-command && npm run agent:patch-verification-dag && npm run agent:patch-rollback-dag && npm run agent:patch-proof-runtime && npm run agent:patch-swarm-route-blackbox && npm run team:patch-swarm-route-blackbox && npm run dfix:patch-swarm-route-blackbox && npm run appshots:thread-attachment-discovery && npm run mcp:readonly-runtime-scheduler && npm run naruto:work-graph && npm run naruto:readonly-routing && npm run naruto:concurrency-governor && npm run naruto:active-pool && npm run naruto:role-distribution && npm run naruto:parallel-patch-apply && npm run naruto:verification-pool && npm run naruto:zellij-massive-ui && npm run naruto:gpt-final-pack && npm run prompt:placeholder-guard && npm run codex:0.134-runner-truth && npm run agent:native-cli-session-swarm && npm run naruto:shadow-clone-swarm && npm run agent:native-cli-session-swarm-10 && npm run agent:native-cli-session-swarm-20 && npm run agent:no-subagent-scaling && npm run agent:native-cli-session-proof && npm run agent:worker-backend-router && npm run agent:codex-child-overlap && npm run agent:model-authored-patch-envelope && npm run agent:fast-mode-default && npm run agent:fast-mode-worker-propagation && npm run codex:fast-mode-profile-propagation && npm run mad-sks:fast-mode-propagation && npm run zellij:launch-command-truth && npm run zellij:real-session-heartbeat && npm run zellij:ui-design && npm run zellij:doctor-readiness && npm run legacy:upgrade-zero-break && npm run publish:packlist-performance && npm run postinstall:safe-side-effects && npm run runtime:ts-rust-boundary && npm run core-skill:card-schema && npm run core-skill:rollout-scoring && npm run core-skill:patch && npm run core-skill:heldout-validation && npm run core-skill:deployment-snapshot && npm run core-skill:no-inference-optimizer && npm run core-skill:route-runtime-integration && npm run core-skill:promotion-side-effect-ledger && npm run core-skill:legacy-promotion-api-audit && npm run core-skill:trainer-loop && npm run safety:side-effect-zero && npm run safety:mutation-callsite-coverage && npm run safety:mutation-callsite-coverage:repo-wide && npm run side-effect:runtime-report && npm run release:gate-planner && npm run release:dynamic-performance && npm run release:provenance && npm run release:gate-budget && npm run agent:wiki-context-proof && npm run shared-memory:check && npm run wrongness:check && npm run wrongness:fixtures && npm run trust:check && npm run git-collaboration:e2e && node ./dist/scripts/release-check-stamp.js write && npm run release:readiness --silent && node ./dist/scripts/release-check-stamp.js write",
560
563
  "release:check:dag": "node ./dist/scripts/release-gate-dag-runner.js --preset release",
561
564
  "release:check:dag:explain": "node ./dist/scripts/release-gate-dag-runner.js --preset release --explain",
562
565
  "release:check:dag:no-cache": "node ./dist/scripts/release-gate-dag-runner.js --preset release --no-cache",
@@ -744,7 +747,39 @@
744
747
  "zellij:stacked-fallback-integration": "node ./dist/scripts/zellij-stacked-fallback-integration-blackbox.js",
745
748
  "runtime:proof-zellij-stacked-summary": "node ./dist/scripts/runtime-proof-zellij-stacked-summary-check.js",
746
749
  "naruto:proof-zellij-stacked-summary": "node ./dist/scripts/naruto-proof-zellij-stacked-summary-check.js",
747
- "docs:codex-0139-wording": "node ./dist/scripts/docs-codex-0139-wording-check.js"
750
+ "docs:codex-0139-wording": "node ./dist/scripts/docs-codex-0139-wording-check.js",
751
+ "loop:schema": "node ./dist/scripts/loop-schema-check.js",
752
+ "loop:artifact-paths": "node ./dist/scripts/loop-artifact-paths-check.js",
753
+ "loop:state": "node ./dist/scripts/loop-state-check.js",
754
+ "loop:planner": "node ./dist/scripts/loop-planner-check.js",
755
+ "loop:decomposer": "node ./dist/scripts/loop-decomposer-check.js",
756
+ "loop:risk-classifier": "node ./dist/scripts/loop-risk-classifier-check.js",
757
+ "loop:owner-inference": "node ./dist/scripts/loop-owner-inference-check.js",
758
+ "loop:scheduler": "node ./dist/scripts/loop-scheduler-check.js",
759
+ "loop:runtime": "node ./dist/scripts/loop-runtime-check.js",
760
+ "loop:fixture-safety": "node ./dist/scripts/loop-fixture-safety-check.js",
761
+ "loop:proof": "node ./dist/scripts/loop-proof-check.js",
762
+ "loop:integration-finalizer": "node ./dist/scripts/loop-integration-finalizer-check.js",
763
+ "loop:gate-selector": "node ./dist/scripts/loop-gate-selector-check.js",
764
+ "loop:gate-runner": "node ./dist/scripts/loop-gate-runner-check.js",
765
+ "loop:gate-ladder": "node ./dist/scripts/loop-gate-ladder-check.js",
766
+ "loop:lease": "node ./dist/scripts/loop-lease-check.js",
767
+ "loop:worktree-policy": "node ./dist/scripts/loop-worktree-policy-check.js",
768
+ "loop:collision-blackbox": "node ./dist/scripts/loop-collision-blackbox.js",
769
+ "naruto:loop-mesh": "node ./dist/scripts/naruto-loop-mesh-check.js",
770
+ "naruto:loop-worker-router": "node ./dist/scripts/naruto-loop-worker-router-check.js",
771
+ "naruto:loop-maker-checker": "node ./dist/scripts/naruto-loop-maker-checker-check.js",
772
+ "naruto:loop-mesh-blackbox": "node ./dist/scripts/naruto-loop-mesh-blackbox.js",
773
+ "loop:cli": "node ./dist/scripts/loop-cli-check.js",
774
+ "loop:cli-registry": "node ./dist/scripts/loop-cli-registry-check.js",
775
+ "loop:observability": "node ./dist/scripts/loop-observability-check.js",
776
+ "loop:zellij-ui": "node ./dist/scripts/loop-zellij-ui-check.js",
777
+ "loop:proof-summary-cli": "node ./dist/scripts/loop-proof-summary-cli-check.js",
778
+ "goal:loop-compat": "node ./dist/scripts/goal-loop-compat-check.js",
779
+ "goal:loop-runtime-default": "node ./dist/scripts/goal-loop-runtime-default-check.js",
780
+ "goal:legacy-runtime-escape": "node ./dist/scripts/goal-legacy-runtime-escape-check.js",
781
+ "goal:artifact-compat": "node ./dist/scripts/goal-artifact-compat-check.js",
782
+ "docs:loop-runtime": "node ./dist/scripts/docs-loop-runtime-check.js"
748
783
  },
749
784
  "keywords": [
750
785
  "sneakoscope",
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://sneakoscope.dev/schemas/loops/loop-node.schema.json",
4
+ "title": "SKS Loop Node",
5
+ "type": "object",
6
+ "required": ["schema", "loop_id", "mission_id", "level", "route", "owner_scope", "budget", "maker", "checker", "gates", "risk"],
7
+ "properties": {
8
+ "schema": { "const": "sks.loop-node.v1" },
9
+ "loop_id": { "type": "string" },
10
+ "mission_id": { "type": "string" },
11
+ "level": { "enum": ["L0-report", "L1-assisted", "L2-action", "L3-unattended"] },
12
+ "route": { "type": "string" },
13
+ "owner_scope": { "type": "object" },
14
+ "budget": { "type": "object" },
15
+ "maker": { "type": "object" },
16
+ "checker": { "type": "object" },
17
+ "gates": { "type": "object" },
18
+ "risk": { "type": "object" }
19
+ },
20
+ "additionalProperties": true
21
+ }