sneakoscope 4.8.7 → 5.1.2
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 +51 -726
- package/bench/tasks/t01-off-by-one/repo/package.json +9 -0
- package/bench/tasks/t01-off-by-one/repo/src/pagination.js +5 -0
- package/bench/tasks/t01-off-by-one/repo/test.js +5 -0
- package/bench/tasks/t01-off-by-one/task.json +13 -0
- package/bench/tasks/t02-signature-cochange/repo/package.json +9 -0
- package/bench/tasks/t02-signature-cochange/repo/src/admin.js +5 -0
- package/bench/tasks/t02-signature-cochange/repo/src/audit.js +5 -0
- package/bench/tasks/t02-signature-cochange/repo/src/labels.js +3 -0
- package/bench/tasks/t02-signature-cochange/repo/src/profile.js +5 -0
- package/bench/tasks/t02-signature-cochange/repo/test.js +9 -0
- package/bench/tasks/t02-signature-cochange/task.json +12 -0
- package/bench/tasks/t03-type-puzzle/repo/package.json +9 -0
- package/bench/tasks/t03-type-puzzle/repo/src/config.js +4 -0
- package/bench/tasks/t03-type-puzzle/repo/test.js +6 -0
- package/bench/tasks/t03-type-puzzle/task.json +13 -0
- package/bench/tasks/t04-refactor-preserve/repo/package.json +9 -0
- package/bench/tasks/t04-refactor-preserve/repo/src/cart.js +8 -0
- package/bench/tasks/t04-refactor-preserve/repo/test.js +4 -0
- package/bench/tasks/t04-refactor-preserve/task.json +12 -0
- package/bench/tasks/t05-performance/repo/package.json +9 -0
- package/bench/tasks/t05-performance/repo/src/pairs.js +9 -0
- package/bench/tasks/t05-performance/repo/test.js +11 -0
- package/bench/tasks/t05-performance/task.json +12 -0
- package/bench/tasks/t06-mistake-rule/repo/package.json +9 -0
- package/bench/tasks/t06-mistake-rule/repo/src/loader.js +6 -0
- package/bench/tasks/t06-mistake-rule/repo/test.js +7 -0
- package/bench/tasks/t06-mistake-rule/task.json +12 -0
- package/config/bench-baseline.json +7 -0
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/crates/sks-core/src/main.rs +1 -1
- package/dist/bin/install.js +35 -0
- package/dist/bin/sks.js +1 -1
- package/dist/cli/cli-theme.js +51 -0
- package/dist/cli/command-registry.js +15 -4
- package/dist/cli/help-fast.js +18 -8
- package/dist/cli/insane-search-command.js +36 -8
- package/dist/cli/install-helpers.js +32 -0
- package/dist/commands/codex-lb.js +2 -0
- package/dist/commands/doctor.js +62 -6
- package/dist/commands/proof.js +6 -3
- package/dist/config/skills-manifest.json +82 -54
- package/dist/core/agents/agent-conflict-graph.js +5 -0
- package/dist/core/agents/agent-lease.js +5 -0
- package/dist/core/agents/agent-ledger-schemas.js +1 -0
- package/dist/core/agents/agent-orchestrator.js +268 -62
- package/dist/core/agents/agent-output-validator.js +14 -3
- package/dist/core/agents/agent-patch-queue-store.js +95 -2
- package/dist/core/agents/agent-patch-queue.js +6 -3
- package/dist/core/agents/agent-patch-schema.js +13 -0
- package/dist/core/agents/agent-proof-evidence.js +6 -1
- package/dist/core/agents/agent-runner-fake.js +40 -0
- package/dist/core/agents/agent-worker-pipeline.js +36 -2
- package/dist/core/agents/codex-exec-worker-adapter.js +2 -0
- package/dist/core/agents/native-worker-backend-router.js +58 -1
- package/dist/core/codex-app/sks-menubar.js +18 -5
- package/dist/core/codex-app.js +1 -0
- package/dist/core/codex-control/codex-sdk-config-policy.js +2 -1
- package/dist/core/codex-control/codex-sdk-env-policy.js +1 -1
- package/dist/core/codex-control/schemas/agent-worker-result.schema.js +12 -3
- package/dist/core/codex-hooks/codex-hook-managed-install.js +5 -0
- package/dist/core/codex-hooks/codex-hook-state-writer.js +70 -11
- package/dist/core/codex-hooks/codex-hook-trust-doctor.js +2 -2
- package/dist/core/codex-lb/codex-lb-env.js +20 -1
- package/dist/core/commands/basic-cli.js +21 -2
- package/dist/core/commands/check-command.js +37 -5
- package/dist/core/commands/computer-use-command.js +62 -7
- package/dist/core/commands/db-command.js +31 -5
- package/dist/core/commands/fast-mode-command.js +3 -0
- package/dist/core/commands/gate-result-contract.js +43 -0
- package/dist/core/commands/gates-command.js +6 -1
- package/dist/core/commands/gc-command.js +29 -2
- package/dist/core/commands/goal-command.js +9 -2
- package/dist/core/commands/gx-command.js +79 -7
- package/dist/core/commands/image-ux-review-command.js +188 -13
- package/dist/core/commands/mad-db-command.js +85 -176
- package/dist/core/commands/mad-sks-command.js +230 -29
- package/dist/core/commands/menubar-command.js +22 -1
- package/dist/core/commands/naruto-command.js +64 -10
- package/dist/core/commands/plan-command.js +76 -0
- package/dist/core/commands/ppt-command.js +159 -24
- package/dist/core/commands/qa-loop-command.js +6 -2
- package/dist/core/commands/release-command.js +55 -2
- package/dist/core/commands/research-command.js +1 -1
- package/dist/core/commands/review-command.js +217 -0
- package/dist/core/commands/route-success-helpers.js +59 -0
- package/dist/core/commands/run-command.js +19 -7
- package/dist/core/commands/seo-command.js +49 -1
- package/dist/core/commands/ui-command.js +161 -0
- package/dist/core/commands/uninstall-command.js +15 -1
- package/dist/core/db-safety.js +2 -2
- package/dist/core/doctor/doctor-transaction.js +8 -0
- package/dist/core/doctor/doctor-zellij-repair.js +1 -0
- package/dist/core/doctor/imagegen-repair.js +161 -0
- package/dist/core/feature-fixture-runner.js +2 -2
- package/dist/core/feature-fixtures.js +58 -37
- package/dist/core/feature-registry.js +102 -2
- package/dist/core/fsx.js +39 -6
- package/dist/core/image-ux-review/imagegen-adapter.js +48 -11
- package/dist/core/image-ux-review.js +16 -0
- package/dist/core/imagegen/imagegen-capability.js +11 -5
- package/dist/core/imagegen/require-imagegen.js +57 -0
- package/dist/core/init/skills.js +10 -5
- package/dist/core/mad-db/mad-db-coordinator.js +94 -18
- package/dist/core/mad-db/mad-db-policy.js +12 -10
- package/dist/core/mad-sks/executors/executor-base.js +8 -2
- package/dist/core/mad-sks/executors/index.js +4 -0
- package/dist/core/mad-sks/executors/sql-plane-executor.js +194 -0
- package/dist/core/naruto/naruto-active-pool.js +15 -4
- package/dist/core/naruto/naruto-real-worker-child.js +10 -0
- package/dist/core/naruto/naruto-role-policy.js +3 -0
- package/dist/core/naruto/naruto-task-hints.js +10 -0
- package/dist/core/naruto/naruto-work-graph.js +8 -2
- package/dist/core/naruto/naruto-work-item.js +6 -0
- package/dist/core/naruto/solution-tournament.js +101 -0
- package/dist/core/permission-gates.js +30 -0
- package/dist/core/pipeline-internals/runtime-core.js +11 -3
- package/dist/core/pipeline-internals/runtime-gates.js +27 -0
- package/dist/core/ppt-review/index.js +6 -1
- package/dist/core/ppt-review/slide-imagegen-review.js +75 -10
- package/dist/core/ppt.js +70 -2
- package/dist/core/proof/auto-finalize.js +70 -11
- package/dist/core/proof/proof-schema.js +2 -0
- package/dist/core/proof/route-adapter.js +5 -1
- package/dist/core/proof/route-finalizer.js +8 -5
- package/dist/core/proof/selftest-proof-fixtures.js +18 -5
- package/dist/core/proof/validation.js +2 -0
- package/dist/core/provider/model-router.js +53 -0
- package/dist/core/release/release-gate-node.js +3 -0
- package/dist/core/release/release-gate-resource-governor.js +1 -0
- package/dist/core/routes/constants.js +1 -1
- package/dist/core/routes.js +65 -18
- package/dist/core/safety/mutation-guard.js +5 -1
- package/dist/core/stop-gate/gate-evaluator.js +102 -0
- package/dist/core/stop-gate/stop-gate-check.js +16 -1
- package/dist/core/stop-gate/stop-gate-writer.js +4 -0
- package/dist/core/triwiki/agents-md-projector.js +184 -0
- package/dist/core/triwiki-wrongness/wrongness-schema.js +3 -1
- package/dist/core/trust-kernel/trust-kernel-schema.js +1 -0
- package/dist/core/trust-kernel/trust-report.js +1 -1
- package/dist/core/trust-kernel/trust-status.js +2 -0
- package/dist/core/ui/dashboard-html.js +111 -0
- package/dist/core/update/update-migration-state.js +366 -15
- package/dist/core/update-check.js +178 -81
- package/dist/core/verification/diff-quality.js +100 -0
- package/dist/core/verification/impact-scan.js +164 -0
- package/dist/core/verification/machine-feedback.js +146 -0
- package/dist/core/verification/mistake-rule-compiler.js +195 -0
- package/dist/core/version.js +1 -1
- package/dist/core/zellij/zellij-self-heal.js +9 -6
- package/dist/scripts/check-feature-quality.js +2 -2
- package/dist/scripts/cli-output-consistency-check.js +57 -0
- package/dist/scripts/coding-bench-check.js +136 -0
- package/dist/scripts/doctor-imagegen-repair-check.js +62 -0
- package/dist/scripts/ensure-bin-executable.js +11 -3
- package/dist/scripts/harness-benchmark-check.js +104 -0
- package/dist/scripts/legacy-update-e2e-check.js +228 -0
- package/dist/scripts/mad-db-command-check.js +11 -8
- package/dist/scripts/mad-db-route-identity-check.js +8 -6
- package/dist/scripts/mad-db-safety-conflict-matrix-check.js +31 -8
- package/dist/scripts/mad-db-skill-policy-snapshot-check.js +4 -5
- package/dist/scripts/ppt-real-imagegen-wiring-check.js +5 -1
- package/dist/scripts/proof-root-cause-policy-check.js +2 -0
- package/dist/scripts/release-dag-full-coverage-check.js +13 -4
- package/dist/scripts/release-gate-dag-runner.js +14 -0
- package/dist/scripts/release-gate-existence-audit.js +2 -1
- package/dist/scripts/release-gate-planner.js +2 -1
- package/dist/scripts/release-gate-script-parity-check.js +1 -1
- package/dist/scripts/release-metadata-1-19-check.js +2 -1
- package/dist/scripts/seo-geo-feature-fixture-quality-check.js +1 -1
- package/dist/scripts/sks-1-11-gate-lib.js +8 -6
- package/dist/scripts/ux-review-real-loop-fixture-check.js +9 -4
- package/dist/scripts/ux-review-run-wires-imagegen-check.js +4 -0
- package/docs/assets/sneakoscope-architecture-pipeline.jpg +0 -0
- package/docs/demo.tape +28 -0
- package/package.json +67 -3
- package/schemas/codex/completion-proof.schema.json +3 -2
- package/schemas/release/release-gate-node.schema.json +2 -1
- package/dist/scripts/agent-backfill-route-blackbox.js +0 -5
- package/dist/scripts/agent-dynamic-pool-route-blackbox.js +0 -5
- package/dist/scripts/agent-parallel-write-blackbox.js +0 -56
- package/dist/scripts/agent-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/agent-route-blackbox-lib.js +0 -132
- package/dist/scripts/blackbox-command-import-smoke.js +0 -143
- package/dist/scripts/blackbox-global-shim.js +0 -77
- package/dist/scripts/blackbox-matrix.js +0 -70
- package/dist/scripts/blackbox-npx-one-shot.js +0 -69
- package/dist/scripts/blackbox-pack-install.js +0 -174
- package/dist/scripts/brand-neutrality-zero-leakage-blackbox.js +0 -4
- package/dist/scripts/build-once-runner-blackbox.js +0 -34
- package/dist/scripts/codex-0140-integration-blackbox.js +0 -13
- package/dist/scripts/codex-agent-type-blackbox.js +0 -4
- package/dist/scripts/codex-app-harness-blackbox.js +0 -4
- package/dist/scripts/codex-app-skill-agent-blackbox.js +0 -4
- package/dist/scripts/codex-hook-approval-blackbox.js +0 -4
- package/dist/scripts/codex-init-deep-directory-local-blackbox.js +0 -4
- package/dist/scripts/codex-native-feature-broker-blackbox.js +0 -4
- package/dist/scripts/codex-native-pattern-analysis-blackbox.js +0 -4
- package/dist/scripts/codex-native-read-repair-split-blackbox.js +0 -55
- package/dist/scripts/codex-native-reference-cache-blackbox.js +0 -41
- package/dist/scripts/core-skill-integrity-blackbox.js +0 -32
- package/dist/scripts/dfix-fast-blackbox-check.js +0 -37
- package/dist/scripts/dfix-parallel-write-blackbox.js +0 -48
- package/dist/scripts/dfix-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/doctor-context7-mcp-repair-blackbox.js +0 -16
- package/dist/scripts/doctor-dirty-repair-blackbox.js +0 -22
- package/dist/scripts/doctor-dirty-semantic-blackbox.js +0 -8
- package/dist/scripts/doctor-fix-production-blackbox.js +0 -26
- package/dist/scripts/doctor-native-capability-repair-blackbox.js +0 -39
- package/dist/scripts/doctor-startup-config-repair-blackbox.js +0 -13
- package/dist/scripts/doctor-supabase-mcp-repair-blackbox.js +0 -14
- package/dist/scripts/doctor-transaction-engine-blackbox.js +0 -28
- package/dist/scripts/doctor-zellij-fix-blackbox.js +0 -4
- package/dist/scripts/doctor-zellij-no-homebrew-blackbox.js +0 -4
- package/dist/scripts/doctor-zellij-upgrade-blackbox.js +0 -4
- package/dist/scripts/gate-pack-runner-blackbox.js +0 -27
- package/dist/scripts/gate-pack-v2-blackbox.js +0 -18
- package/dist/scripts/geo-cli-blackbox-check.js +0 -18
- package/dist/scripts/loop-collision-blackbox.js +0 -3
- package/dist/scripts/loop-concurrency-oversubscription-blackbox.js +0 -3
- package/dist/scripts/loop-fixture-production-misuse-blackbox.js +0 -3
- package/dist/scripts/loop-kill-interrupt-real-blackbox.js +0 -3
- package/dist/scripts/loop-merge-strategy-blackbox.js +0 -3
- package/dist/scripts/loop-mesh-production-e2e-blackbox.js +0 -3
- package/dist/scripts/loop-side-effect-blackbox.js +0 -3
- package/dist/scripts/mad-db-operation-lifecycle-blackbox.js +0 -29
- package/dist/scripts/mad-sks-actual-executor-blackbox.js +0 -5
- package/dist/scripts/mad-zellij-headless-fallback-blackbox.js +0 -4
- package/dist/scripts/mad-zellij-self-heal-blackbox.js +0 -4
- package/dist/scripts/naruto-loop-mesh-blackbox.js +0 -3
- package/dist/scripts/naruto-real-parallelism-blackbox.js +0 -307
- package/dist/scripts/naruto-worktree-coding-blackbox.js +0 -29
- package/dist/scripts/parallel-runtime-real-blackbox.js +0 -44
- package/dist/scripts/pipeline-codex-native-doctor-mad-routing-real-blackbox.js +0 -77
- package/dist/scripts/pipeline-codex-native-e2e-blackbox.js +0 -13
- package/dist/scripts/pipeline-codex-native-image-routing-real-blackbox.js +0 -50
- package/dist/scripts/pipeline-codex-native-loop-routing-real-blackbox.js +0 -74
- package/dist/scripts/pipeline-codex-native-qa-routing-real-blackbox.js +0 -51
- package/dist/scripts/pipeline-codex-native-research-routing-real-blackbox.js +0 -45
- package/dist/scripts/pipeline-execution-profile-routing-blackbox.js +0 -4
- package/dist/scripts/postinstall-global-doctor-blackbox.js +0 -12
- package/dist/scripts/ppt-full-e2e-blackbox-check.js +0 -109
- package/dist/scripts/ppt-imagegen-blackbox-check.js +0 -46
- package/dist/scripts/project-skill-dedupe-blackbox.js +0 -36
- package/dist/scripts/qa-backfill-route-blackbox.js +0 -5
- package/dist/scripts/qa-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/release-full-parallelism-blackbox.js +0 -41
- package/dist/scripts/release-triwiki-first-runner-blackbox.js +0 -48
- package/dist/scripts/release-wiring-3110-blackbox.js +0 -27
- package/dist/scripts/release-wiring-3112-blackbox.js +0 -17
- package/dist/scripts/release-wiring-3113-blackbox.js +0 -17
- package/dist/scripts/research-backfill-route-blackbox.js +0 -5
- package/dist/scripts/research-final-reviewer-blackbox.js +0 -70
- package/dist/scripts/research-stage-cycle-runtime-blackbox.js +0 -40
- package/dist/scripts/research-synthesis-writer-blackbox.js +0 -24
- package/dist/scripts/route-blackbox-realism-check.js +0 -21
- package/dist/scripts/scheduler-resource-claim-blackbox.js +0 -24
- package/dist/scripts/seo-cli-blackbox-check.js +0 -18
- package/dist/scripts/sks-3110-all-feature-regression-blackbox.js +0 -116
- package/dist/scripts/sks-3112-all-feature-regression-blackbox.js +0 -29
- package/dist/scripts/sks-3113-all-feature-regression-blackbox.js +0 -17
- package/dist/scripts/sks-400-all-feature-regression-blackbox.js +0 -21
- package/dist/scripts/sks-400-extreme-parallel-blackbox.js +0 -8
- package/dist/scripts/sks-400-five-minute-blackbox.js +0 -9
- package/dist/scripts/sks-400-legacy-purge-blackbox.js +0 -8
- package/dist/scripts/sks-401-all-feature-regression-blackbox.js +0 -46
- package/dist/scripts/sks-401-five-minute-actual-blackbox.js +0 -23
- package/dist/scripts/sks-402-all-feature-regression-blackbox.js +0 -9
- package/dist/scripts/sks-402-five-minute-real-blackbox.js +0 -22
- package/dist/scripts/sksd-warm-cache-blackbox.js +0 -12
- package/dist/scripts/supabase-secret-preservation-blackbox.js +0 -29
- package/dist/scripts/team-backfill-route-blackbox.js +0 -5
- package/dist/scripts/team-parallel-write-blackbox.js +0 -55
- package/dist/scripts/team-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/triwiki-affected-graph-blackbox.js +0 -28
- package/dist/scripts/triwiki-proof-bank-blackbox.js +0 -30
- package/dist/scripts/triwiki-proof-bank-lock-blackbox.js +0 -7
- package/dist/scripts/update-preserves-supabase-keys-blackbox.js +0 -27
- package/dist/scripts/ux-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/ux-review-imagegen-blackbox-check.js +0 -67
- package/dist/scripts/zellij-initial-main-only-blackbox.js +0 -28
- package/dist/scripts/zellij-pane-lock-concurrency-blackbox.js +0 -80
- package/dist/scripts/zellij-pane-lock-open-worker-integration-blackbox.js +0 -137
- package/dist/scripts/zellij-self-heal-typed-blackbox.js +0 -4
- package/dist/scripts/zellij-slot-telemetry-real-blackbox.js +0 -20
- package/dist/scripts/zellij-stacked-fallback-integration-blackbox.js +0 -81
- package/dist/scripts/zellij-worker-pane-real-ui-blackbox.js +0 -202
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs/promises';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { buildCodexNativeFeatureMatrix } from '../core/codex-native/codex-native-feature-broker.js';
|
|
5
|
-
import { repairCodexNativeManagedAssets } from '../core/codex-native/codex-native-repair-transaction.js';
|
|
6
|
-
import { createCodexNativeRuntimeFixture, withFixtureEnv } from './codex-native-runtime-e2e-fixture.js';
|
|
7
|
-
const fixture = await createCodexNativeRuntimeFixture({
|
|
8
|
-
hook: 'approved',
|
|
9
|
-
agentType: 'supported',
|
|
10
|
-
appHandoff: true,
|
|
11
|
-
imagePathExposure: true,
|
|
12
|
-
mcpCandidates: true,
|
|
13
|
-
codeModeWebSearch: true
|
|
14
|
-
});
|
|
15
|
-
const previous = process.env.CODEX_HOME;
|
|
16
|
-
process.env.CODEX_HOME = path.join(fixture.root, 'codex-home');
|
|
17
|
-
try {
|
|
18
|
-
await withFixtureEnv(fixture, async () => {
|
|
19
|
-
await buildCodexNativeFeatureMatrix({ root: fixture.root, mode: 'read-only' });
|
|
20
|
-
assertGate(!(await exists(path.join(fixture.root, 'codex-home', 'skills'))), 'read-only matrix created skills');
|
|
21
|
-
assertGate(!(await exists(path.join(fixture.root, 'codex-home', 'agents'))), 'read-only matrix created agent roles');
|
|
22
|
-
const repair = await repairCodexNativeManagedAssets({ root: fixture.root, requestedBy: 'manual', yes: true });
|
|
23
|
-
assertGate(repair.repaired.some((row) => row.asset === 'skills'), 'repair transaction did not include skills', repair);
|
|
24
|
-
assertGate(await exists(path.join(fixture.root, 'codex-home', 'skills')), 'repair transaction did not create managed skills');
|
|
25
|
-
assertGate(await exists(path.join(fixture.root, 'codex-home', 'agents')), 'repair transaction did not create managed agent roles');
|
|
26
|
-
const matrixAfter = await buildCodexNativeFeatureMatrix({ root: fixture.root, mode: 'read-only' });
|
|
27
|
-
assertGate(matrixAfter.features.skill_sync.ok === true || matrixAfter.features.agent_roles.ok === true, 'post-repair read-only matrix did not reflect managed assets', matrixAfter);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
finally {
|
|
31
|
-
if (previous === undefined)
|
|
32
|
-
delete process.env.CODEX_HOME;
|
|
33
|
-
else
|
|
34
|
-
process.env.CODEX_HOME = previous;
|
|
35
|
-
}
|
|
36
|
-
emitGate('codex-native:read-repair-split-blackbox');
|
|
37
|
-
async function exists(file) {
|
|
38
|
-
try {
|
|
39
|
-
await fs.stat(file);
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
catch {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function assertGate(condition, message, detail = {}) {
|
|
47
|
-
if (condition)
|
|
48
|
-
return;
|
|
49
|
-
console.error(JSON.stringify({ ok: false, message, detail }, null, 2));
|
|
50
|
-
process.exit(1);
|
|
51
|
-
}
|
|
52
|
-
function emitGate(gate) {
|
|
53
|
-
console.log(JSON.stringify({ schema: 'sks.release-gate.v1', ok: true, gate }, null, 2));
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=codex-native-read-repair-split-blackbox.js.map
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs/promises';
|
|
3
|
-
import os from 'node:os';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import { runProcess } from '../core/fsx.js';
|
|
6
|
-
import { ensureCodexNativeReferenceSnapshot } from '../core/codex-native/codex-native-reference-cache.js';
|
|
7
|
-
import { analyzeCodexNativeReferenceSource } from '../core/codex-native/codex-native-reference-source.js';
|
|
8
|
-
const missing = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-reference-cache-missing-'));
|
|
9
|
-
const missingReport = await ensureCodexNativeReferenceSnapshot({ root: missing, offline: true });
|
|
10
|
-
assertGate(missingReport.ok === false && missingReport.blockers.includes('source_snapshot_missing'), 'offline no-cache scenario must report source_snapshot_missing', missingReport);
|
|
11
|
-
const missingEvidence = await analyzeCodexNativeReferenceSource({ root: missing, writeReport: false });
|
|
12
|
-
assertGate(missingEvidence.blockers.includes('source_snapshot_missing') && missingEvidence.evidence.length === 0, 'missing cache must not hallucinate evidence', missingEvidence);
|
|
13
|
-
const reused = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-reference-cache-reused-'));
|
|
14
|
-
await fs.mkdir(path.join(reused, '.sneakoscope', 'cache', 'codex-native-reference'), { recursive: true });
|
|
15
|
-
await fs.writeFile(path.join(reused, '.sneakoscope', 'cache', 'codex-native-reference', 'README.md'), 'npx plugin hook agent_type fallback AGENTS.md doctor MCP managed proof\n', 'utf8');
|
|
16
|
-
const reusedReport = await ensureCodexNativeReferenceSnapshot({ root: reused, offline: true });
|
|
17
|
-
assertGate(reusedReport.ok === true && reusedReport.refreshed === false, 'offline existing cache should be reused', reusedReport);
|
|
18
|
-
const source = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-reference-source-'));
|
|
19
|
-
await fs.writeFile(path.join(source, 'README.md'), 'npx plugin hook agent_type fallback AGENTS.md doctor MCP managed proof\n', 'utf8');
|
|
20
|
-
await runProcess('git', ['init'], { cwd: source, timeoutMs: 10_000, maxOutputBytes: 64 * 1024 });
|
|
21
|
-
await runProcess('git', ['add', 'README.md'], { cwd: source, timeoutMs: 10_000, maxOutputBytes: 64 * 1024 });
|
|
22
|
-
await runProcess('git', ['-c', 'user.email=sks@example.invalid', '-c', 'user.name=SKS', 'commit', '-m', 'fixture'], { cwd: source, timeoutMs: 10_000, maxOutputBytes: 64 * 1024 });
|
|
23
|
-
const refreshedRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-reference-cache-refresh-'));
|
|
24
|
-
const refreshed = await ensureCodexNativeReferenceSnapshot({ root: refreshedRoot, sourceUrl: source, refresh: true });
|
|
25
|
-
const serialized = JSON.stringify(refreshed);
|
|
26
|
-
assertGate(refreshed.ok === true && refreshed.refreshed === true && typeof refreshed.source_sha === 'string', 'refresh from local git source should record source sha', refreshed);
|
|
27
|
-
assertGate(!serialized.includes(source), 'cache report leaked raw source URL/path', refreshed);
|
|
28
|
-
const evidence = await analyzeCodexNativeReferenceSource({ root: refreshedRoot, writeReport: true });
|
|
29
|
-
const docs = await fs.readFile(path.join(refreshedRoot, 'docs', 'codex-native-patterns.md'), 'utf8');
|
|
30
|
-
assertGate(!JSON.stringify(evidence).includes(source) && !docs.includes(source), 'reference evidence/docs leaked raw source URL/path', { evidence, docs });
|
|
31
|
-
emitGate('codex-native:reference-cache-blackbox');
|
|
32
|
-
function assertGate(condition, message, detail = {}) {
|
|
33
|
-
if (condition)
|
|
34
|
-
return;
|
|
35
|
-
console.error(JSON.stringify({ ok: false, message, detail }, null, 2));
|
|
36
|
-
process.exit(1);
|
|
37
|
-
}
|
|
38
|
-
function emitGate(gate) {
|
|
39
|
-
console.log(JSON.stringify({ schema: 'sks.release-gate.v1', ok: true, gate }, null, 2));
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=codex-native-reference-cache-blackbox.js.map
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs/promises';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { assertGate, emitGate, makeTempRoot, writeText, writeUserSkill } from './sks-3-1-8-check-lib.js';
|
|
5
|
-
import { syncCoreSkillsIntegrity } from '../core/codex-native/core-skill-integrity.js';
|
|
6
|
-
import { buildSksCoreSkillManifest, renderCoreSkillTemplate } from '../core/codex-native/core-skill-manifest.js';
|
|
7
|
-
import { initProject } from '../core/init.js';
|
|
8
|
-
const root = await makeTempRoot('sks-core-blackbox-');
|
|
9
|
-
const skillsRoot = path.join(root, '.agents', 'skills');
|
|
10
|
-
const expectedSkillCount = buildSksCoreSkillManifest('1970-01-01T00:00:00.000Z').skills.length;
|
|
11
|
-
const first = await syncCoreSkillsIntegrity({ root, apply: true, skillsRoot });
|
|
12
|
-
const second = await syncCoreSkillsIntegrity({ root, apply: true, skillsRoot });
|
|
13
|
-
await writeText(path.join(skillsRoot, 'research', 'SKILL.md'), `${renderCoreSkillTemplate('research')}\nmutated\n`);
|
|
14
|
-
const third = await syncCoreSkillsIntegrity({ root, apply: true, skillsRoot });
|
|
15
|
-
const restoredText = await fs.readFile(path.join(skillsRoot, 'research', 'SKILL.md'), 'utf8');
|
|
16
|
-
const userRoot = path.join(root, 'user-skills');
|
|
17
|
-
await writeUserSkill(root, 'user-skills', 'research', 'research');
|
|
18
|
-
const user = await syncCoreSkillsIntegrity({ root, apply: true, skillsRoot: userRoot });
|
|
19
|
-
const setupRoot = await makeTempRoot('sks-core-setup-blackbox-');
|
|
20
|
-
const setup = await initProject(setupRoot, { force: true, installScope: 'project', localOnly: true, globalCommand: 'sks' });
|
|
21
|
-
const setupIntegrity = await syncCoreSkillsIntegrity({ root: setupRoot, apply: false, skillsRoot: path.join(setupRoot, '.agents', 'skills') });
|
|
22
|
-
const setupRestore = await initProject(setupRoot, { force: true, installScope: 'project', localOnly: true, globalCommand: 'sks' });
|
|
23
|
-
const setupLoopExists = await fs.stat(path.join(setupRoot, '.agents', 'skills', 'loop', 'SKILL.md')).then(() => true, () => false);
|
|
24
|
-
assertGate(first.installed.length === expectedSkillCount, 'blackbox A: first sync installs missing core skills', first);
|
|
25
|
-
assertGate(second.installed.length === 0 && second.restored.length === 0, 'blackbox B: second sync changes nothing', second);
|
|
26
|
-
assertGate(third.restored.length === 1 && restoredText === renderCoreSkillTemplate('research'), 'blackbox C: managed drift restored exactly', third);
|
|
27
|
-
assertGate(user.skipped_user_authored.length === 1, 'blackbox D: user skill is not overwritten', user);
|
|
28
|
-
assertGate((setup.skill_install?.installed_skills || []).length === 0, 'blackbox E: project setup must not install official/core skills locally', setup.skill_install);
|
|
29
|
-
assertGate(setupIntegrity.restored.length === 0 && setupIntegrity.skipped_user_authored.length === 0, 'blackbox F: setup-produced core skills are current', setupIntegrity);
|
|
30
|
-
assertGate((setupRestore.skill_install?.installed_skills || []).length === 0 && !setupLoopExists, 'blackbox G: project setup remains official-skill-free on repeat init', setupRestore.skill_install);
|
|
31
|
-
emitGate('core-skill:integrity-blackbox');
|
|
32
|
-
//# sourceMappingURL=core-skill-integrity-blackbox.js.map
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import fs from 'node:fs';
|
|
4
|
-
import os from 'node:os';
|
|
5
|
-
import path from 'node:path';
|
|
6
|
-
import { spawnSync } from 'node:child_process';
|
|
7
|
-
import { emitGate } from './sks-1-12-real-execution-check-lib.js';
|
|
8
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'sks-dfix-fast-blackbox-'));
|
|
9
|
-
fs.mkdirSync(path.join(root, '.sneakoscope'), { recursive: true });
|
|
10
|
-
fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify({
|
|
11
|
-
private: true,
|
|
12
|
-
type: 'module',
|
|
13
|
-
scripts: {
|
|
14
|
-
test: 'node test.mjs',
|
|
15
|
-
'test:unit': 'node test.mjs',
|
|
16
|
-
'dfix:fixture': 'node test.mjs',
|
|
17
|
-
'dfix:verification': 'node test.mjs'
|
|
18
|
-
}
|
|
19
|
-
}, null, 2));
|
|
20
|
-
fs.writeFileSync(path.join(root, 'value.js'), 'export const value = "bad";\n');
|
|
21
|
-
fs.writeFileSync(path.join(root, 'test.mjs'), 'import { value } from "./value.js"; if (value !== "good") throw new Error("expected good");\n');
|
|
22
|
-
const sks = path.join(process.cwd(), 'dist', 'bin', 'sks.js');
|
|
23
|
-
const env = { ...process.env, SKS_DISABLE_UPDATE_CHECK: '1' };
|
|
24
|
-
const diagnose = run(root, sks, ['dfix', 'diagnose', 'fix value', '--file', 'value.js', '--error', 'AssertionError: expected good at value.js:1', '--json'], env);
|
|
25
|
-
const mission = JSON.parse(diagnose.stdout).mission_id;
|
|
26
|
-
const patch = run(root, sks, ['dfix', 'patch', mission, '--file', 'value.js', '--find', 'bad', '--replace', 'good', '--apply', '--json'], env);
|
|
27
|
-
const verify = run(root, sks, ['dfix', 'verify', mission, '--command', 'node test.mjs', '--verify-auto', '--json'], env);
|
|
28
|
-
const ok = diagnose.status === 0 && patch.status === 0 && verify.status === 0 && fs.readFileSync(path.join(root, 'value.js'), 'utf8').includes('"good"');
|
|
29
|
-
console.log(JSON.stringify({ schema: 'sks.dfix-fast-blackbox-check.v1', ok, mission_id: mission, root }, null, 2));
|
|
30
|
-
if (!ok)
|
|
31
|
-
process.exitCode = 1;
|
|
32
|
-
else
|
|
33
|
-
emitGate('dfix:blackbox-fast', { mission_id: mission });
|
|
34
|
-
function run(cwd, bin, args, env) {
|
|
35
|
-
return spawnSync(process.execPath, [bin, ...args], { cwd, env, encoding: 'utf8', timeout: 30_000 });
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=dfix-fast-blackbox-check.js.map
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import fs from 'node:fs';
|
|
4
|
-
import os from 'node:os';
|
|
5
|
-
import path from 'node:path';
|
|
6
|
-
import { spawnSync } from 'node:child_process';
|
|
7
|
-
import { assertGate, emitGate, importDist, root } from './sks-1-18-gate-lib.js';
|
|
8
|
-
const applyMod = await importDist('core/agents/agent-patch-apply-worker.js');
|
|
9
|
-
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'sks-dfix-patch-'));
|
|
10
|
-
fs.writeFileSync(path.join(tmp, 'copy.txt'), 'old label\n');
|
|
11
|
-
const envelope = {
|
|
12
|
-
schema: 'sks.agent-patch-envelope.v1',
|
|
13
|
-
agent_id: 'dfix-fast-lane',
|
|
14
|
-
session_id: 'dfix-session',
|
|
15
|
-
slot_id: 'dfix-slot',
|
|
16
|
-
generation_index: 1,
|
|
17
|
-
lease_id: 'lease:dfix-fast-lane:copy.txt',
|
|
18
|
-
operations: [{ op: 'replace', path: 'copy.txt', search: 'old label', replace: 'new label' }]
|
|
19
|
-
};
|
|
20
|
-
const applied = await applyMod.applyAgentPatchEnvelope(tmp, envelope);
|
|
21
|
-
const dfixFile = path.join(tmp, 'dfix-route.txt');
|
|
22
|
-
fs.writeFileSync(dfixFile, 'old label\n');
|
|
23
|
-
const diagnose = spawnSync(process.execPath, ['dist/bin/sks.js', 'dfix', 'diagnose', 'dfix parallel write route fixture', '--file', dfixFile, '--json'], { cwd: root, encoding: 'utf8', maxBuffer: 1024 * 1024 });
|
|
24
|
-
const diagnoseJson = parseJson(diagnose.stdout);
|
|
25
|
-
const plan = diagnoseJson?.mission_id
|
|
26
|
-
? spawnSync(process.execPath, ['dist/bin/sks.js', 'dfix', 'plan', diagnoseJson.mission_id, '--file', dfixFile, '--write-mode', 'parallel', '--apply-patches', '--dry-run-patches', '--max-write-agents', '1', '--json'], { cwd: root, encoding: 'utf8', maxBuffer: 1024 * 1024 })
|
|
27
|
-
: { status: 1, stdout: '', stderr: 'diagnose mission missing' };
|
|
28
|
-
const planJson = parseJson(plan.stdout);
|
|
29
|
-
const routePolicy = planJson?.patch_plan?.route_parallel_write || null;
|
|
30
|
-
const report = { schema: 'sks.dfix-parallel-write-blackbox.v1', ok: applied.ok && diagnose.status === 0 && plan.status === 0 && routePolicy?.route_level_flags_wired === true, applied, route_command: { diagnose_status: diagnose.status, plan_status: plan.status, mission_id: diagnoseJson?.mission_id || null, route_policy: routePolicy, stderr_tail: `${diagnose.stderr || ''}${plan.stderr || ''}`.slice(-2000) } };
|
|
31
|
-
const out = path.join(root, '.sneakoscope', 'reports', 'dfix-parallel-write-blackbox.json');
|
|
32
|
-
fs.mkdirSync(path.dirname(out), { recursive: true });
|
|
33
|
-
fs.writeFileSync(out, `${JSON.stringify(report, null, 2)}\n`);
|
|
34
|
-
assertGate(applied.ok === true, 'DFix parallel write blackbox patch failed', report);
|
|
35
|
-
assertGate(fs.readFileSync(path.join(tmp, 'copy.txt'), 'utf8') === 'new label\n', 'DFix parallel write blackbox content mismatch', report);
|
|
36
|
-
assertGate(routePolicy?.write_mode === 'parallel', 'DFix route must record --write-mode parallel', report);
|
|
37
|
-
assertGate(routePolicy?.apply_patches === true, 'DFix route must record --apply-patches', report);
|
|
38
|
-
assertGate(routePolicy?.dry_run_patches === true, 'DFix route must record --dry-run-patches', report);
|
|
39
|
-
emitGate('dfix:parallel-write-blackbox', { changed_files: applied.changed_files.length });
|
|
40
|
-
function parseJson(text) {
|
|
41
|
-
try {
|
|
42
|
-
return JSON.parse(text);
|
|
43
|
-
}
|
|
44
|
-
catch {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=dfix-parallel-write-blackbox.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import { runPatchSwarmRouteBlackbox } from './agent-patch-swarm-gate-lib.js';
|
|
4
|
-
await runPatchSwarmRouteBlackbox({
|
|
5
|
-
gate: 'dfix:patch-swarm-route-blackbox',
|
|
6
|
-
route: '$DFix',
|
|
7
|
-
routeCommand: 'sks dfix',
|
|
8
|
-
reportName: 'dfix-patch-swarm-route-blackbox'
|
|
9
|
-
});
|
|
10
|
-
//# sourceMappingURL=dfix-patch-swarm-route-blackbox.js.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs/promises';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { assertGate, emitGate, makeTempRoot, writeText } from './sks-3-1-8-check-lib.js';
|
|
5
|
-
import { repairContext7Mcp } from '../core/doctor/context7-mcp-repair.js';
|
|
6
|
-
const root = await makeTempRoot('sks-context7-blackbox-');
|
|
7
|
-
const configPath = path.join(root, '.codex', 'config.toml');
|
|
8
|
-
await writeText(configPath, '[mcp_servers.context7]\ncommand = "npx"\n');
|
|
9
|
-
const repaired = await repairContext7Mcp({ root, apply: true });
|
|
10
|
-
const text = await fs.readFile(configPath, 'utf8');
|
|
11
|
-
assertGate(repaired.ok === true && text.includes('https://mcp.context7.com/mcp'), 'Context7 blackbox must write remote URL', { repaired, text });
|
|
12
|
-
await writeText(configPath, '[mcp_servers.context7]\ndisabled = true\ncommand = "npx"\n');
|
|
13
|
-
const disabled = await repairContext7Mcp({ root, apply: true });
|
|
14
|
-
assertGate(disabled.after_transport === 'disabled' && disabled.repaired === false && disabled.disabled_preserved === true, 'Context7 blackbox must preserve explicitly disabled server', disabled);
|
|
15
|
-
emitGate('doctor:context7-mcp-repair-blackbox');
|
|
16
|
-
//# sourceMappingURL=doctor-context7-mcp-repair-blackbox.js.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { assertGate, emitGate, makeTempRoot } from './sks-3-1-8-check-lib.js';
|
|
3
|
-
import { importDist } from './sks-1-18-gate-lib.js';
|
|
4
|
-
const tmp = await makeTempRoot('doctor-dirty-repair-');
|
|
5
|
-
const planner = await importDist('core/doctor/doctor-dirty-planner.js');
|
|
6
|
-
const tx = await importDist('core/doctor/doctor-transaction.js');
|
|
7
|
-
const proofId = planner.markDoctorPhaseClean(tmp, 'setup');
|
|
8
|
-
await tx.writeDoctorFixTransaction({
|
|
9
|
-
root: tmp,
|
|
10
|
-
phases: [],
|
|
11
|
-
proofIdsUsed: [proofId]
|
|
12
|
-
});
|
|
13
|
-
let ran = false;
|
|
14
|
-
const report = await tx.runDoctorFixTransaction({
|
|
15
|
-
root: tmp,
|
|
16
|
-
reportPath: null,
|
|
17
|
-
dirtyPlan: planner.planDoctorDirtyRepair(tmp, ['setup']),
|
|
18
|
-
phases: [{ id: 'setup', run: async () => { ran = true; return { id: 'setup', ok: true }; } }]
|
|
19
|
-
});
|
|
20
|
-
assertGate(ran === false && report.ok === true && report.phases[0].warnings.some((warning) => warning.startsWith('dirty_plan_skipped_clean_phase')), 'dirty repair must skip clean phase', { ran, report });
|
|
21
|
-
emitGate('doctor:dirty-repair-blackbox', { skipped: true });
|
|
22
|
-
//# sourceMappingURL=doctor-dirty-repair-blackbox.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { assertGate, emitGate, readText } from './sks-1-18-gate-lib.js';
|
|
2
|
-
const source = readText('src/core/doctor/doctor-dirty-planner.ts');
|
|
3
|
-
assertGate(!source.includes('stat.isDirectory() ? `dir:${stat.mtimeMs}`'), 'doctor dirty planner must not hash directory mtimes');
|
|
4
|
-
assertGate(!source.includes('mtimeMs, text'), 'doctor dirty planner must not mix file mtime into semantic hashes');
|
|
5
|
-
assertGate(source.includes('phaseSemanticState'), 'doctor dirty planner must include phase-specific semantic state');
|
|
6
|
-
assertGate(source.includes('clean_proof_missing'), 'doctor dirty planner must reject markers with missing proof evidence');
|
|
7
|
-
emitGate('doctor:dirty-semantic-blackbox');
|
|
8
|
-
//# sourceMappingURL=doctor-dirty-semantic-blackbox.js.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { assertGate, emitGate, makeTempRoot, writeText } from './sks-3-1-8-check-lib.js';
|
|
4
|
-
import { repairCodexStartupConfig } from '../core/doctor/codex-startup-config-repair.js';
|
|
5
|
-
import { repairContext7Mcp } from '../core/doctor/context7-mcp-repair.js';
|
|
6
|
-
import { repairSupabaseMcp } from '../core/doctor/supabase-mcp-repair.js';
|
|
7
|
-
import { runDoctorFixTransaction } from '../core/doctor/doctor-transaction.js';
|
|
8
|
-
import { doctorRepairPostcheck } from '../core/doctor/doctor-repair-postcheck.js';
|
|
9
|
-
const root = await makeTempRoot('sks-doctor-production-');
|
|
10
|
-
await writeText(path.join(root, '.codex', 'config.toml'), '[mcp_servers.context7]\ncommand = "npx"\n\n[mcp_servers.supabase]\nurl = "https://supabase.example/mcp"\nread_only = true\n\n[agents.analysis_scout]\nconfig_file = ".codex/agents/stale.toml"\nmessage_role_prefix = "legacy"\n');
|
|
11
|
-
const startup = await repairCodexStartupConfig({ root, apply: true });
|
|
12
|
-
const context7 = await repairContext7Mcp({ root, apply: true });
|
|
13
|
-
const supabase = await repairSupabaseMcp({ root, apply: true });
|
|
14
|
-
const tx = await runDoctorFixTransaction({ root, phases: [
|
|
15
|
-
{ id: 'preflight', run: async () => ({ id: 'preflight', ok: true }) },
|
|
16
|
-
{ id: 'codex_startup_config_repair', run: async () => ({ id: 'codex_startup_config_repair', ok: startup.ok, repaired: true, blockers: startup.blockers, rollback_evidence: 'fixture_config_backup' }) },
|
|
17
|
-
{ id: 'context7_mcp_repair', run: async () => ({ id: 'context7_mcp_repair', ok: context7.ok, repaired: context7.repaired, blockers: context7.blockers, rollback_evidence: 'fixture_context7_backup' }) },
|
|
18
|
-
{ id: 'supabase_mcp_repair', required_for_ready: false, run: async () => ({ id: 'supabase_mcp_repair', ok: supabase.ok, manual_required: supabase.manual_required, required_for_ready: false, blockers: supabase.blockers, warnings: supabase.warnings, rollback_evidence: 'optional_supabase_fixture' }) },
|
|
19
|
-
{ id: 'postcheck', run: async () => ({ id: 'postcheck', ok: true }) }
|
|
20
|
-
] });
|
|
21
|
-
const postcheck = doctorRepairPostcheck(tx);
|
|
22
|
-
assertGate(tx.schema === 'sks.doctor-fix-transaction.v2' && tx.raw_secret_values_recorded === false, 'doctor transaction must write production schema without raw secrets', tx);
|
|
23
|
-
assertGate(tx.phases.every((phase) => typeof phase.duration_ms === 'number' && phase.started_at && phase.completed_at), 'doctor transaction phases must include runtime evidence', tx);
|
|
24
|
-
assertGate(postcheck.ok === true, 'doctor repair postcheck must pass when only manual-required optional phases remain', postcheck);
|
|
25
|
-
emitGate('doctor:fix-production-blackbox', { phases: tx.phases.length });
|
|
26
|
-
//# sourceMappingURL=doctor-fix-production-blackbox.js.map
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { assertGate, emitGate, makeTempRoot, writeText } from './sks-3-1-8-check-lib.js';
|
|
3
|
-
import { repairNativeCapabilities } from '../core/codex-native/native-capability-repair.js';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
const repairableRoot = await makeTempRoot('sks-doctor-native-repairable-');
|
|
6
|
-
process.env.SKS_CHROME_EXTENSION_READY = '1';
|
|
7
|
-
process.env.SKS_COMPUTER_USE_CAPABILITY = 'verified';
|
|
8
|
-
const repairable = await repairNativeCapabilities({ root: repairableRoot, fix: true, yes: true, fixture: 'all-repairable' });
|
|
9
|
-
delete process.env.SKS_CHROME_EXTENSION_READY;
|
|
10
|
-
delete process.env.SKS_COMPUTER_USE_CAPABILITY;
|
|
11
|
-
const manualRoot = await makeTempRoot('sks-doctor-native-manual-');
|
|
12
|
-
const manual = await repairNativeCapabilities({ root: manualRoot, fix: true, yes: true, fixture: 'manual-required' });
|
|
13
|
-
const screenshotBlockedRoot = await makeTempRoot('sks-doctor-native-screenshot-blocked-');
|
|
14
|
-
await writeText(path.join(screenshotBlockedRoot, '.sneakoscope', 'app-screenshots'), 'not-a-directory');
|
|
15
|
-
const screenshotBlocked = await repairNativeCapabilities({
|
|
16
|
-
root: screenshotBlockedRoot,
|
|
17
|
-
fix: false,
|
|
18
|
-
yes: true,
|
|
19
|
-
fixture: 'all-repairable',
|
|
20
|
-
capabilities: ['codex_app_screenshot']
|
|
21
|
-
});
|
|
22
|
-
const corruptContractRoot = await makeTempRoot('sks-doctor-native-contract-repair-');
|
|
23
|
-
await writeText(path.join(corruptContractRoot, '.sneakoscope', 'reports', 'saved-artifact-path-contract.json'), '{"schema":"broken"}\n');
|
|
24
|
-
const corruptContract = await repairNativeCapabilities({
|
|
25
|
-
root: corruptContractRoot,
|
|
26
|
-
fix: true,
|
|
27
|
-
yes: true,
|
|
28
|
-
fixture: 'manual-required',
|
|
29
|
-
capabilities: ['saved_artifact_path_contract']
|
|
30
|
-
});
|
|
31
|
-
assertGate(repairable.ok === true, 'repairable fixture must verify after doctor native repair', repairable);
|
|
32
|
-
assertGate(manual.capabilities.some((state) => state.repairability === 'manual-required' && state.after !== 'verified'), 'manual-only fixture must not fake verified success', manual);
|
|
33
|
-
assertGate(manual.capabilities.find((state) => state.id === 'image_generation')?.after !== 'verified', 'image generation auth missing must not verify', manual);
|
|
34
|
-
assertGate(manual.capabilities.find((state) => state.id === 'chrome_web_review')?.after !== 'verified', 'Chrome/web review missing extension must not verify', manual);
|
|
35
|
-
assertGate(manual.capabilities.find((state) => state.id === 'image_path_exposure')?.after === 'degraded', 'saved artifact path fallback must be degraded rather than verified', manual);
|
|
36
|
-
assertGate(screenshotBlocked.capabilities.find((state) => state.id === 'codex_app_screenshot')?.after === 'blocked', 'unwritable screenshot artifact root must block postcheck', screenshotBlocked);
|
|
37
|
-
assertGate(corruptContract.capabilities.find((state) => state.id === 'saved_artifact_path_contract')?.after === 'verified', 'doctor fix must repair corrupt saved artifact path contract', corruptContract);
|
|
38
|
-
emitGate('doctor:native-capability-repair-blackbox');
|
|
39
|
-
//# sourceMappingURL=doctor-native-capability-repair-blackbox.js.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs/promises';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { assertGate, emitGate, makeTempRoot, writeText } from './sks-3-1-8-check-lib.js';
|
|
5
|
-
import { repairCodexStartupConfig } from '../core/doctor/codex-startup-config-repair.js';
|
|
6
|
-
const root = await makeTempRoot('sks-startup-config-blackbox-');
|
|
7
|
-
await writeText(path.join(root, '.codex', 'config.toml'), '[agents.analysis_scout]\nconfig_file = ".codex/agents/stale.toml"\nmessage_role_prefix = "legacy"\n');
|
|
8
|
-
const report = await repairCodexStartupConfig({ root, apply: true });
|
|
9
|
-
const text = await fs.readFile(path.join(root, '.codex', 'config.toml'), 'utf8');
|
|
10
|
-
assertGate(report.ok === true, 'startup config blackbox must pass postcheck', report);
|
|
11
|
-
assertGate(!text.includes('message_role_prefix') && /config_file = "\//.test(text), 'startup config blackbox must rewrite to absolute config paths and remove unsupported fields', { text });
|
|
12
|
-
emitGate('doctor:startup-config-repair-blackbox');
|
|
13
|
-
//# sourceMappingURL=doctor-startup-config-repair-blackbox.js.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { assertGate, emitGate, makeTempRoot, writeText } from './sks-3-1-8-check-lib.js';
|
|
4
|
-
import { repairSupabaseMcp } from '../core/doctor/supabase-mcp-repair.js';
|
|
5
|
-
const root = await makeTempRoot('sks-supabase-mcp-blackbox-');
|
|
6
|
-
delete process.env.SUPABASE_ACCESS_TOKEN;
|
|
7
|
-
await writeText(path.join(root, '.codex', 'config.toml'), '[mcp_servers.supabase]\nurl = "https://supabase.example/mcp"\nSUPABASE_ACCESS_TOKEN = "env:SUPABASE_ACCESS_TOKEN"\n');
|
|
8
|
-
const unsafe = await repairSupabaseMcp({ root, apply: true });
|
|
9
|
-
assertGate(unsafe.ok === true && unsafe.manual_required === true && unsafe.read_only_migrated === true && unsafe.ready_blocking === false, 'Supabase unsafe write access must be migrated to read-only without passing silently as write-ready', unsafe);
|
|
10
|
-
await writeText(path.join(root, '.codex', 'config.toml'), '[mcp_servers.supabase_sauron]\ndisabled = true\n');
|
|
11
|
-
const optional = await repairSupabaseMcp({ root, apply: true });
|
|
12
|
-
assertGate(optional.ok === true && optional.disabled === true && optional.disabled_preserved === true, 'optional disabled Supabase config must be preserved', optional);
|
|
13
|
-
emitGate('doctor:supabase-mcp-repair-blackbox');
|
|
14
|
-
//# sourceMappingURL=doctor-supabase-mcp-repair-blackbox.js.map
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { assertGate, emitGate, makeTempRoot } from './sks-3-1-8-check-lib.js';
|
|
3
|
-
import { runDoctorFixTransaction } from '../core/doctor/doctor-transaction.js';
|
|
4
|
-
import { doctorRepairPostcheck } from '../core/doctor/doctor-repair-postcheck.js';
|
|
5
|
-
const root = await makeTempRoot('sks-doctor-tx-blackbox-');
|
|
6
|
-
const tx = await runDoctorFixTransaction({
|
|
7
|
-
root,
|
|
8
|
-
phases: [
|
|
9
|
-
{ id: 'preflight', run: async () => ({ id: 'preflight', ok: true, artifact_path: `${root}/preflight.json` }) },
|
|
10
|
-
{
|
|
11
|
-
id: 'postchecked',
|
|
12
|
-
run: async () => ({ id: 'postchecked', ok: true }),
|
|
13
|
-
postcheck: async () => ({ ok: true, warnings: ['postcheck_executed'] })
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
id: 'optional_operator',
|
|
17
|
-
required_for_ready: false,
|
|
18
|
-
run: async () => ({ id: 'optional_operator', ok: false, manual_required: true, required_for_ready: false, blockers: ['operator_action_required'] })
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
reportPath: null
|
|
22
|
-
});
|
|
23
|
-
const postcheck = doctorRepairPostcheck(tx);
|
|
24
|
-
assertGate(tx.ok === true && postcheck.ok === true, 'doctor transaction blackbox must allow optional manual follow-up without blocking readiness', { tx, postcheck });
|
|
25
|
-
assertGate(tx.phases.some((phase) => phase.warnings.includes('postcheck_executed')), 'doctor transaction blackbox must run phase postchecks', tx);
|
|
26
|
-
assertGate(tx.raw_secret_values_recorded === false, 'doctor transaction blackbox must not record raw secrets', tx);
|
|
27
|
-
emitGate('doctor:transaction-engine-blackbox', { phases: tx.phases.length });
|
|
28
|
-
//# sourceMappingURL=doctor-transaction-engine-blackbox.js.map
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import fs from 'node:fs/promises';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { assertGate, emitGate, makeTempRoot } from './sks-3-1-8-check-lib.js';
|
|
5
|
-
import { importDist } from './sks-1-18-gate-lib.js';
|
|
6
|
-
const tmp = await makeTempRoot('sks-gate-pack-');
|
|
7
|
-
await fs.writeFile(path.join(tmp, 'package.json'), JSON.stringify({ version: '4.0.0', scripts: { 'triwiki:proof-card': 'node -e "process.exit(0)"' } }, null, 2));
|
|
8
|
-
await fs.writeFile(path.join(tmp, 'package-lock.json'), JSON.stringify({ lockfileVersion: 3 }));
|
|
9
|
-
await fs.writeFile(path.join(tmp, 'release-gates.v2.json'), JSON.stringify({
|
|
10
|
-
schema: 'sks.release-gates.v2',
|
|
11
|
-
gates: [{
|
|
12
|
-
id: 'triwiki:proof-card',
|
|
13
|
-
command: 'npm run triwiki:proof-card --silent',
|
|
14
|
-
deps: [],
|
|
15
|
-
resource: ['cpu-light'],
|
|
16
|
-
side_effect: 'hermetic',
|
|
17
|
-
timeout_ms: 1000,
|
|
18
|
-
cache: { enabled: true, inputs: ['package.json'] },
|
|
19
|
-
isolation: { home: 'temp', codex_home: 'temp', report_dir: 'per-gate' },
|
|
20
|
-
preset: ['release']
|
|
21
|
-
}]
|
|
22
|
-
}, null, 2));
|
|
23
|
-
const runner = await importDist('core/release/gate-pack-runner.js');
|
|
24
|
-
const report = await runner.executeGatePack({ root: tmp, packId: 'triwiki', mode: 'execute' });
|
|
25
|
-
assertGate(report.ok === true && report.executed === 1 && report.proof_paths.length >= 2, 'gate pack blackbox must execute and write gate plus pack proof', report);
|
|
26
|
-
emitGate('gate-pack:runner-blackbox', { executed: report.executed, proofs: report.proof_paths.length });
|
|
27
|
-
//# sourceMappingURL=gate-pack-runner-blackbox.js.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { assertGate, emitGate, makeTempRoot, writeText } from './sks-3-1-8-check-lib.js';
|
|
4
|
-
import { importDist } from './sks-1-18-gate-lib.js';
|
|
5
|
-
const tmp = await makeTempRoot('sks-gate-pack-v2-');
|
|
6
|
-
await writeText(path.join(tmp, 'package.json'), JSON.stringify({ version: '4.0.2', scripts: { 'triwiki:proof-card': 'node -e "if(!process.env.SKS_GATE_PACK_ARTIFACT) process.exit(2)"' } }, null, 2));
|
|
7
|
-
await writeText(path.join(tmp, 'package-lock.json'), JSON.stringify({ lockfileVersion: 3 }, null, 2));
|
|
8
|
-
await writeText(path.join(tmp, 'release-gates.v2.json'), JSON.stringify({ schema: 'sks.release-gates.v2', gates: [gate('triwiki:proof-card')] }, null, 2));
|
|
9
|
-
await fs.mkdir(path.join(tmp, 'src/core/triwiki'), { recursive: true });
|
|
10
|
-
const runner = await importDist('core/release/gate-pack-runner.js');
|
|
11
|
-
const report = await runner.executeGatePack({ root: tmp, packId: 'triwiki', mode: 'execute' });
|
|
12
|
-
assertGate(report.ok === true && report.executed === 1, 'gate pack v2 must execute through async runner', report);
|
|
13
|
-
assertGate(report.proof_paths.length >= 2, 'gate pack v2 must write gate and pack proofs', report);
|
|
14
|
-
emitGate('gate-pack:v2-blackbox', { executed: report.executed, proofs: report.proof_paths.length });
|
|
15
|
-
function gate(id) {
|
|
16
|
-
return { id, command: `npm run ${id} --silent`, deps: [], resource: ['cpu-light'], side_effect: 'hermetic', timeout_ms: 5000, cache: { enabled: false, inputs: ['package.json'] }, isolation: { home: 'temp', codex_home: 'temp', report_dir: 'per-gate' }, preset: ['release'] };
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=gate-pack-v2-blackbox.js.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import { assertGate, emitGate, runSks, runSksJson } from './search-visibility-gate-lib.js';
|
|
4
|
-
const commands = runSksJson(['commands', '--json']).json;
|
|
5
|
-
assertGate(commands.commands.some((row) => row.name === 'seo-geo-optimizer' && /unified SEO\/GEO optimizer/i.test(row.description)), 'commands --json must expose seo-geo-optimizer');
|
|
6
|
-
assertGate(!commands.commands.some((row) => row.name === 'seo' || row.name === 'geo'), 'commands --json must not expose split seo/geo command surfaces');
|
|
7
|
-
const optimizerUsage = runSks(['usage', 'seo-geo-optimizer']);
|
|
8
|
-
assertGate(/sks seo-geo-optimizer \[seo\|geo\] doctor\|audit\|plan\|apply\|verify\|status\|rollback\|fixture/.test(optimizerUsage.stdout), 'usage seo-geo-optimizer must expose unified lifecycle');
|
|
9
|
-
const doctor = runSksJson(['seo-geo-optimizer', 'doctor', '--mode', 'geo', '--json']).json;
|
|
10
|
-
assertGate(doctor.route === '$SEO-GEO-OPTIMIZER' && doctor.schema === 'sks.search-visibility.doctor-command.v1', 'optimizer geo doctor must preserve unified route identity', doctor);
|
|
11
|
-
const invalid = runSks(['seo-geo-optimizer', 'nonsense-subcommand', '--mode', 'geo'], { allowFailure: true });
|
|
12
|
-
assertGate(invalid.status === 2 && /Usage: sks seo-geo-optimizer/.test(invalid.stderr), 'invalid optimizer subcommand must exit 2 with usage', {
|
|
13
|
-
status: invalid.status,
|
|
14
|
-
stdout: invalid.stdout,
|
|
15
|
-
stderr: invalid.stderr,
|
|
16
|
-
});
|
|
17
|
-
emitGate('geo:cli-blackbox', { adapter: doctor.adapter, confidence: doctor.confidence });
|
|
18
|
-
//# sourceMappingURL=geo-cli-blackbox-check.js.map
|
|
@@ -1,29 +0,0 @@
|
|
|
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 { checkDbOperation, madDbLifecycleHookFromDecision } from '../core/db-safety.js';
|
|
7
|
-
import { createMadDbCapability, MAD_DB_ACK } from '../core/mad-db/mad-db-capability.js';
|
|
8
|
-
import { recordMadDbToolResult } from '../core/mad-db/mad-db-result-lifecycle.js';
|
|
9
|
-
import { createMission, missionDir } from '../core/mission.js';
|
|
10
|
-
import { assertGate, emitGate } from './sks-1-18-gate-lib.js';
|
|
11
|
-
const root = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-mad-db-lifecycle-blackbox-'));
|
|
12
|
-
const mission = await createMission(root, { mode: 'mad-db', prompt: 'lifecycle blackbox fixture' });
|
|
13
|
-
await createMadDbCapability(root, { missionId: mission.id, ack: MAD_DB_ACK, ttlMs: 60000, projectRef: 'fixture-project-ref', status: 'active' });
|
|
14
|
-
const success = await checkDbOperation(root, { mission_id: mission.id }, { tool_name: 'supabase.execute_sql', tool_call_id: 'blackbox-success-call', sql: 'insert into audit_log(id) values (1)' });
|
|
15
|
-
const successHook = madDbLifecycleHookFromDecision(success);
|
|
16
|
-
assertGate(Boolean(successHook), 'success hook missing', success);
|
|
17
|
-
await recordMadDbToolResult({ root, missionId: mission.id, hook: successHook, ok: true, rowCount: 1 });
|
|
18
|
-
const failure = await checkDbOperation(root, { mission_id: mission.id }, { tool_name: 'supabase.execute_sql', tool_call_id: 'blackbox-failure-call', sql: 'update users set flag = true where id = 1' });
|
|
19
|
-
const failureHook = madDbLifecycleHookFromDecision(failure);
|
|
20
|
-
assertGate(Boolean(failureHook), 'failure hook missing', failure);
|
|
21
|
-
await recordMadDbToolResult({ root, missionId: mission.id, hook: failureHook, ok: false, error: 'fixture failure' });
|
|
22
|
-
const ledger = await fs.readFile(path.join(missionDir(root, mission.id), 'mad-db-ledger.jsonl'), 'utf8');
|
|
23
|
-
for (const token of ['db_operation.started', 'db_mutation.allowed', 'db_operation.succeeded', 'db_operation.failed']) {
|
|
24
|
-
assertGate(ledger.includes(token), `Mad-DB ledger missing ${token}`, { ledger });
|
|
25
|
-
}
|
|
26
|
-
assertGate((ledger.match(/db_operation\.succeeded/g) || []).length === 1, 'success terminal event must be recorded exactly once', { ledger });
|
|
27
|
-
assertGate((ledger.match(/db_operation\.failed/g) || []).length === 1, 'failure terminal event must be recorded exactly once', { ledger });
|
|
28
|
-
emitGate('mad-db:operation-lifecycle-blackbox', { succeeded: successHook.operation_id, failed: failureHook.operation_id });
|
|
29
|
-
//# sourceMappingURL=mad-db-operation-lifecycle-blackbox.js.map
|