@su-record/vibe 3.2.13 → 3.2.15
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/CLAUDE.md +15 -14
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/dist/cli/setup/ProjectSetup.d.ts +6 -0
- package/dist/cli/setup/ProjectSetup.d.ts.map +1 -1
- package/dist/cli/setup/ProjectSetup.js +19 -13
- package/dist/cli/setup/ProjectSetup.js.map +1 -1
- package/dist/infra/lib/codex-proxy.d.ts +126 -0
- package/dist/infra/lib/codex-proxy.d.ts.map +1 -1
- package/dist/infra/lib/codex-proxy.js +16 -16
- package/dist/infra/lib/codex-proxy.js.map +1 -1
- package/dist/infra/lib/figma/audit.d.ts.map +1 -1
- package/dist/infra/lib/figma/audit.js +0 -2
- package/dist/infra/lib/figma/audit.js.map +1 -1
- package/dist/infra/lib/figma/extract.d.ts +6 -1
- package/dist/infra/lib/figma/extract.d.ts.map +1 -1
- package/dist/infra/lib/figma/extract.js +17 -15
- package/dist/infra/lib/figma/extract.js.map +1 -1
- package/dist/infra/lib/figma/types.d.ts +103 -0
- package/dist/infra/lib/figma/types.d.ts.map +1 -1
- package/dist/infra/lib/figma/types.js +8 -0
- package/dist/infra/lib/figma/types.js.map +1 -1
- package/hooks/hooks.json +1 -1
- package/hooks/scripts/clone-extract.js +16 -1
- package/hooks/scripts/code-check.js +72 -55
- package/hooks/scripts/lib/anchor.js +74 -0
- package/hooks/scripts/lib/console-allow.js +66 -0
- package/hooks/scripts/lib/dispatcher.js +71 -19
- package/hooks/scripts/lib/inbox.js +60 -0
- package/hooks/scripts/loop-ledger.js +24 -1
- package/hooks/scripts/post-edit-dispatcher.js +4 -3
- package/hooks/scripts/post-edit.js +2 -2
- package/package.json +13 -9
- package/skills/vibe/SKILL.md +2 -1
- package/skills/vibe.clone/references/verification-loops.md +6 -3
- package/skills/vibe.loop/SKILL.md +7 -4
- package/skills/vibe.review/SKILL.md +5 -1
- package/skills/vibe.run/references/e2e-and-autofix.md +1 -1
- package/skills/vibe.run/references/process-steps.md +1 -1
- package/vibe/constitution.md +1 -1
- package/vibe/rules/loop-contract.md +40 -3
- package/vibe/rules/quality/checklist.md +3 -3
- package/vibe/templates/constitution-template.md +1 -1
- package/dist/__tests__/agent-model-sync.test.d.ts +0 -2
- package/dist/__tests__/agent-model-sync.test.d.ts.map +0 -1
- package/dist/__tests__/agent-model-sync.test.js +0 -71
- package/dist/__tests__/agent-model-sync.test.js.map +0 -1
- package/dist/__tests__/architecture.test.d.ts +0 -2
- package/dist/__tests__/architecture.test.d.ts.map +0 -1
- package/dist/__tests__/architecture.test.js +0 -207
- package/dist/__tests__/architecture.test.js.map +0 -1
- package/dist/__tests__/skill-namespace.test.d.ts +0 -2
- package/dist/__tests__/skill-namespace.test.d.ts.map +0 -1
- package/dist/__tests__/skill-namespace.test.js +0 -60
- package/dist/__tests__/skill-namespace.test.js.map +0 -1
- package/dist/__tests__/stakes-contract.test.d.ts +0 -2
- package/dist/__tests__/stakes-contract.test.d.ts.map +0 -1
- package/dist/__tests__/stakes-contract.test.js +0 -166
- package/dist/__tests__/stakes-contract.test.js.map +0 -1
- package/dist/__tests__/stuck-semantics.test.d.ts +0 -2
- package/dist/__tests__/stuck-semantics.test.d.ts.map +0 -1
- package/dist/__tests__/stuck-semantics.test.js +0 -109
- package/dist/__tests__/stuck-semantics.test.js.map +0 -1
- package/dist/__tests__/wiring-integrity.test.d.ts +0 -2
- package/dist/__tests__/wiring-integrity.test.d.ts.map +0 -1
- package/dist/__tests__/wiring-integrity.test.js +0 -160
- package/dist/__tests__/wiring-integrity.test.js.map +0 -1
- package/dist/cli/commands/info.test.d.ts +0 -2
- package/dist/cli/commands/info.test.d.ts.map +0 -1
- package/dist/cli/commands/info.test.js +0 -74
- package/dist/cli/commands/info.test.js.map +0 -1
- package/dist/cli/commands/upgrade.test.d.ts +0 -2
- package/dist/cli/commands/upgrade.test.d.ts.map +0 -1
- package/dist/cli/commands/upgrade.test.js +0 -99
- package/dist/cli/commands/upgrade.test.js.map +0 -1
- package/dist/cli/design/design-md-parser.test.d.ts +0 -2
- package/dist/cli/design/design-md-parser.test.d.ts.map +0 -1
- package/dist/cli/design/design-md-parser.test.js +0 -149
- package/dist/cli/design/design-md-parser.test.js.map +0 -1
- package/dist/cli/detect.characterization.test.d.ts +0 -7
- package/dist/cli/detect.characterization.test.d.ts.map +0 -1
- package/dist/cli/detect.characterization.test.js +0 -294
- package/dist/cli/detect.characterization.test.js.map +0 -1
- package/dist/cli/postinstall/fs-utils.test.d.ts +0 -2
- package/dist/cli/postinstall/fs-utils.test.d.ts.map +0 -1
- package/dist/cli/postinstall/fs-utils.test.js +0 -259
- package/dist/cli/postinstall/fs-utils.test.js.map +0 -1
- package/dist/cli/setup/CodexHooks.test.d.ts +0 -2
- package/dist/cli/setup/CodexHooks.test.d.ts.map +0 -1
- package/dist/cli/setup/CodexHooks.test.js +0 -52
- package/dist/cli/setup/CodexHooks.test.js.map +0 -1
- package/dist/cli/setup/GlobalInstaller.test.d.ts +0 -2
- package/dist/cli/setup/GlobalInstaller.test.d.ts.map +0 -1
- package/dist/cli/setup/GlobalInstaller.test.js +0 -16
- package/dist/cli/setup/GlobalInstaller.test.js.map +0 -1
- package/dist/cli/utils/cli-detector.test.d.ts +0 -2
- package/dist/cli/utils/cli-detector.test.d.ts.map +0 -1
- package/dist/cli/utils/cli-detector.test.js +0 -52
- package/dist/cli/utils/cli-detector.test.js.map +0 -1
- package/dist/infra/lib/SkillFrontmatter.test.d.ts +0 -2
- package/dist/infra/lib/SkillFrontmatter.test.d.ts.map +0 -1
- package/dist/infra/lib/SkillFrontmatter.test.js +0 -60
- package/dist/infra/lib/SkillFrontmatter.test.js.map +0 -1
- package/dist/infra/lib/__tests__/AutomationLevel.test.d.ts +0 -2
- package/dist/infra/lib/__tests__/AutomationLevel.test.d.ts.map +0 -1
- package/dist/infra/lib/__tests__/AutomationLevel.test.js +0 -297
- package/dist/infra/lib/__tests__/AutomationLevel.test.js.map +0 -1
- package/dist/infra/lib/__tests__/ComponentRegistry.test.d.ts +0 -2
- package/dist/infra/lib/__tests__/ComponentRegistry.test.d.ts.map +0 -1
- package/dist/infra/lib/__tests__/ComponentRegistry.test.js +0 -99
- package/dist/infra/lib/__tests__/ComponentRegistry.test.js.map +0 -1
- package/dist/infra/lib/__tests__/DecisionTracer.test.d.ts +0 -2
- package/dist/infra/lib/__tests__/DecisionTracer.test.d.ts.map +0 -1
- package/dist/infra/lib/__tests__/DecisionTracer.test.js +0 -274
- package/dist/infra/lib/__tests__/DecisionTracer.test.js.map +0 -1
- package/dist/infra/lib/__tests__/InteractiveCheckpoint.test.d.ts +0 -2
- package/dist/infra/lib/__tests__/InteractiveCheckpoint.test.d.ts.map +0 -1
- package/dist/infra/lib/__tests__/InteractiveCheckpoint.test.js +0 -350
- package/dist/infra/lib/__tests__/InteractiveCheckpoint.test.js.map +0 -1
- package/dist/infra/lib/__tests__/LoopBreaker.test.d.ts +0 -2
- package/dist/infra/lib/__tests__/LoopBreaker.test.d.ts.map +0 -1
- package/dist/infra/lib/__tests__/LoopBreaker.test.js +0 -340
- package/dist/infra/lib/__tests__/LoopBreaker.test.js.map +0 -1
- package/dist/infra/lib/__tests__/VerificationLoop.test.d.ts +0 -2
- package/dist/infra/lib/__tests__/VerificationLoop.test.d.ts.map +0 -1
- package/dist/infra/lib/__tests__/VerificationLoop.test.js +0 -486
- package/dist/infra/lib/__tests__/VerificationLoop.test.js.map +0 -1
- package/dist/infra/lib/config/GlobalConfigManager.test.d.ts +0 -2
- package/dist/infra/lib/config/GlobalConfigManager.test.d.ts.map +0 -1
- package/dist/infra/lib/config/GlobalConfigManager.test.js +0 -9
- package/dist/infra/lib/config/GlobalConfigManager.test.js.map +0 -1
- package/dist/infra/lib/embedding/__tests__/EmbeddingProvider.test.d.ts +0 -2
- package/dist/infra/lib/embedding/__tests__/EmbeddingProvider.test.d.ts.map +0 -1
- package/dist/infra/lib/embedding/__tests__/EmbeddingProvider.test.js +0 -43
- package/dist/infra/lib/embedding/__tests__/EmbeddingProvider.test.js.map +0 -1
- package/dist/infra/lib/embedding/__tests__/VectorStore.test.d.ts +0 -2
- package/dist/infra/lib/embedding/__tests__/VectorStore.test.d.ts.map +0 -1
- package/dist/infra/lib/embedding/__tests__/VectorStore.test.js +0 -94
- package/dist/infra/lib/embedding/__tests__/VectorStore.test.js.map +0 -1
- package/dist/infra/lib/embedding/__tests__/cosine.test.d.ts +0 -2
- package/dist/infra/lib/embedding/__tests__/cosine.test.d.ts.map +0 -1
- package/dist/infra/lib/embedding/__tests__/cosine.test.js +0 -73
- package/dist/infra/lib/embedding/__tests__/cosine.test.js.map +0 -1
- package/dist/infra/lib/evolution/__tests__/deprecation.test.d.ts +0 -2
- package/dist/infra/lib/evolution/__tests__/deprecation.test.d.ts.map +0 -1
- package/dist/infra/lib/evolution/__tests__/deprecation.test.js +0 -251
- package/dist/infra/lib/evolution/__tests__/deprecation.test.js.map +0 -1
- package/dist/infra/lib/evolution/__tests__/eval.test.d.ts +0 -2
- package/dist/infra/lib/evolution/__tests__/eval.test.d.ts.map +0 -1
- package/dist/infra/lib/evolution/__tests__/eval.test.js +0 -603
- package/dist/infra/lib/evolution/__tests__/eval.test.js.map +0 -1
- package/dist/infra/lib/evolution/__tests__/generation.test.d.ts +0 -2
- package/dist/infra/lib/evolution/__tests__/generation.test.d.ts.map +0 -1
- package/dist/infra/lib/evolution/__tests__/generation.test.js +0 -396
- package/dist/infra/lib/evolution/__tests__/generation.test.js.map +0 -1
- package/dist/infra/lib/evolution/__tests__/insight.test.d.ts +0 -2
- package/dist/infra/lib/evolution/__tests__/insight.test.d.ts.map +0 -1
- package/dist/infra/lib/evolution/__tests__/insight.test.js +0 -204
- package/dist/infra/lib/evolution/__tests__/insight.test.js.map +0 -1
- package/dist/infra/lib/evolution/__tests__/integration.test.d.ts +0 -2
- package/dist/infra/lib/evolution/__tests__/integration.test.d.ts.map +0 -1
- package/dist/infra/lib/evolution/__tests__/integration.test.js +0 -206
- package/dist/infra/lib/evolution/__tests__/integration.test.js.map +0 -1
- package/dist/infra/lib/evolution/__tests__/lifecycle.test.d.ts +0 -2
- package/dist/infra/lib/evolution/__tests__/lifecycle.test.d.ts.map +0 -1
- package/dist/infra/lib/evolution/__tests__/lifecycle.test.js +0 -350
- package/dist/infra/lib/evolution/__tests__/lifecycle.test.js.map +0 -1
- package/dist/infra/lib/evolution/__tests__/parity.test.d.ts +0 -2
- package/dist/infra/lib/evolution/__tests__/parity.test.d.ts.map +0 -1
- package/dist/infra/lib/evolution/__tests__/parity.test.js +0 -319
- package/dist/infra/lib/evolution/__tests__/parity.test.js.map +0 -1
- package/dist/infra/lib/llm/auth/AuthProfileManager.test.d.ts +0 -5
- package/dist/infra/lib/llm/auth/AuthProfileManager.test.d.ts.map +0 -1
- package/dist/infra/lib/llm/auth/AuthProfileManager.test.js +0 -168
- package/dist/infra/lib/llm/auth/AuthProfileManager.test.js.map +0 -1
- package/dist/infra/lib/llm/auth/TokenRefresher.test.d.ts +0 -2
- package/dist/infra/lib/llm/auth/TokenRefresher.test.d.ts.map +0 -1
- package/dist/infra/lib/llm/auth/TokenRefresher.test.js +0 -120
- package/dist/infra/lib/llm/auth/TokenRefresher.test.js.map +0 -1
- package/dist/infra/lib/llm/timeout.test.d.ts +0 -2
- package/dist/infra/lib/llm/timeout.test.d.ts.map +0 -1
- package/dist/infra/lib/llm/timeout.test.js +0 -50
- package/dist/infra/lib/llm/timeout.test.js.map +0 -1
- package/dist/infra/lib/llm-availability.test.d.ts +0 -2
- package/dist/infra/lib/llm-availability.test.d.ts.map +0 -1
- package/dist/infra/lib/llm-availability.test.js +0 -37
- package/dist/infra/lib/llm-availability.test.js.map +0 -1
- package/dist/infra/lib/memory/KnowledgeGraph.test.d.ts +0 -2
- package/dist/infra/lib/memory/KnowledgeGraph.test.d.ts.map +0 -1
- package/dist/infra/lib/memory/KnowledgeGraph.test.js +0 -189
- package/dist/infra/lib/memory/KnowledgeGraph.test.js.map +0 -1
- package/dist/infra/lib/memory/MemorySearch.test.d.ts +0 -2
- package/dist/infra/lib/memory/MemorySearch.test.d.ts.map +0 -1
- package/dist/infra/lib/memory/MemorySearch.test.js +0 -149
- package/dist/infra/lib/memory/MemorySearch.test.js.map +0 -1
- package/dist/infra/lib/memory/MemoryStorage.test.d.ts +0 -2
- package/dist/infra/lib/memory/MemoryStorage.test.d.ts.map +0 -1
- package/dist/infra/lib/memory/MemoryStorage.test.js +0 -198
- package/dist/infra/lib/memory/MemoryStorage.test.js.map +0 -1
- package/dist/infra/lib/memory/SessionRAGRetriever.test.d.ts +0 -2
- package/dist/infra/lib/memory/SessionRAGRetriever.test.d.ts.map +0 -1
- package/dist/infra/lib/memory/SessionRAGRetriever.test.js +0 -180
- package/dist/infra/lib/memory/SessionRAGRetriever.test.js.map +0 -1
- package/dist/infra/lib/memory/SessionRAGStore.test.d.ts +0 -2
- package/dist/infra/lib/memory/SessionRAGStore.test.d.ts.map +0 -1
- package/dist/infra/lib/memory/SessionRAGStore.test.js +0 -326
- package/dist/infra/lib/memory/SessionRAGStore.test.js.map +0 -1
- package/dist/infra/lib/memory/__tests__/InMemoryStorage.test.d.ts +0 -2
- package/dist/infra/lib/memory/__tests__/InMemoryStorage.test.d.ts.map +0 -1
- package/dist/infra/lib/memory/__tests__/InMemoryStorage.test.js +0 -114
- package/dist/infra/lib/memory/__tests__/InMemoryStorage.test.js.map +0 -1
- package/dist/infra/lib/memory/__tests__/ReflectionStore.test.d.ts +0 -2
- package/dist/infra/lib/memory/__tests__/ReflectionStore.test.d.ts.map +0 -1
- package/dist/infra/lib/memory/__tests__/ReflectionStore.test.js +0 -196
- package/dist/infra/lib/memory/__tests__/ReflectionStore.test.js.map +0 -1
- package/dist/infra/lib/memory/index.test.d.ts +0 -2
- package/dist/infra/lib/memory/index.test.d.ts.map +0 -1
- package/dist/infra/lib/memory/index.test.js +0 -23
- package/dist/infra/lib/memory/index.test.js.map +0 -1
- package/dist/infra/lib/telemetry/SkillTelemetry.test.d.ts +0 -2
- package/dist/infra/lib/telemetry/SkillTelemetry.test.d.ts.map +0 -1
- package/dist/infra/lib/telemetry/SkillTelemetry.test.js +0 -124
- package/dist/infra/lib/telemetry/SkillTelemetry.test.js.map +0 -1
- package/dist/infra/lib/ui-ux/Bm25Engine.test.d.ts +0 -2
- package/dist/infra/lib/ui-ux/Bm25Engine.test.d.ts.map +0 -1
- package/dist/infra/lib/ui-ux/Bm25Engine.test.js +0 -159
- package/dist/infra/lib/ui-ux/Bm25Engine.test.js.map +0 -1
- package/dist/infra/lib/ui-ux/CsvDataLoader.test.d.ts +0 -2
- package/dist/infra/lib/ui-ux/CsvDataLoader.test.d.ts.map +0 -1
- package/dist/infra/lib/ui-ux/CsvDataLoader.test.js +0 -141
- package/dist/infra/lib/ui-ux/CsvDataLoader.test.js.map +0 -1
- package/dist/infra/lib/ui-ux/DesignSystemGenerator.test.d.ts +0 -2
- package/dist/infra/lib/ui-ux/DesignSystemGenerator.test.d.ts.map +0 -1
- package/dist/infra/lib/ui-ux/DesignSystemGenerator.test.js +0 -370
- package/dist/infra/lib/ui-ux/DesignSystemGenerator.test.js.map +0 -1
- package/dist/infra/lib/ui-ux/SearchService.test.d.ts +0 -2
- package/dist/infra/lib/ui-ux/SearchService.test.d.ts.map +0 -1
- package/dist/infra/lib/ui-ux/SearchService.test.js +0 -215
- package/dist/infra/lib/ui-ux/SearchService.test.js.map +0 -1
- package/dist/test-helpers/index.d.ts +0 -36
- package/dist/test-helpers/index.d.ts.map +0 -1
- package/dist/test-helpers/index.js +0 -85
- package/dist/test-helpers/index.js.map +0 -1
- package/dist/test-helpers/index.test.d.ts +0 -2
- package/dist/test-helpers/index.test.d.ts.map +0 -1
- package/dist/test-helpers/index.test.js +0 -92
- package/dist/test-helpers/index.test.js.map +0 -1
- package/dist/tests/curated-release-notes.test.d.ts +0 -2
- package/dist/tests/curated-release-notes.test.d.ts.map +0 -1
- package/dist/tests/curated-release-notes.test.js +0 -160
- package/dist/tests/curated-release-notes.test.js.map +0 -1
- package/dist/tools/convention/analyzeComplexity.test.d.ts +0 -2
- package/dist/tools/convention/analyzeComplexity.test.d.ts.map +0 -1
- package/dist/tools/convention/analyzeComplexity.test.js +0 -207
- package/dist/tools/convention/analyzeComplexity.test.js.map +0 -1
- package/dist/tools/convention/validateCodeQuality.test.d.ts +0 -2
- package/dist/tools/convention/validateCodeQuality.test.d.ts.map +0 -1
- package/dist/tools/convention/validateCodeQuality.test.js +0 -230
- package/dist/tools/convention/validateCodeQuality.test.js.map +0 -1
- package/dist/tools/loop/validateLoopDefinition.test.d.ts +0 -14
- package/dist/tools/loop/validateLoopDefinition.test.d.ts.map +0 -1
- package/dist/tools/loop/validateLoopDefinition.test.js +0 -229
- package/dist/tools/loop/validateLoopDefinition.test.js.map +0 -1
- package/dist/tools/spec/executionPacket.test.d.ts +0 -2
- package/dist/tools/spec/executionPacket.test.d.ts.map +0 -1
- package/dist/tools/spec/executionPacket.test.js +0 -374
- package/dist/tools/spec/executionPacket.test.js.map +0 -1
- package/dist/tools/spec/prdParser.test.d.ts +0 -6
- package/dist/tools/spec/prdParser.test.d.ts.map +0 -1
- package/dist/tools/spec/prdParser.test.js +0 -332
- package/dist/tools/spec/prdParser.test.js.map +0 -1
- package/dist/tools/spec/specGenerator.test.d.ts +0 -2
- package/dist/tools/spec/specGenerator.test.d.ts.map +0 -1
- package/dist/tools/spec/specGenerator.test.js +0 -130
- package/dist/tools/spec/specGenerator.test.js.map +0 -1
- package/dist/tools/spec/traceabilityMatrix.path-resolution.test.d.ts +0 -10
- package/dist/tools/spec/traceabilityMatrix.path-resolution.test.d.ts.map +0 -1
- package/dist/tools/spec/traceabilityMatrix.path-resolution.test.js +0 -120
- package/dist/tools/spec/traceabilityMatrix.path-resolution.test.js.map +0 -1
- package/dist/tools/spec/traceabilityMatrix.test.d.ts +0 -6
- package/dist/tools/spec/traceabilityMatrix.test.d.ts.map +0 -1
- package/dist/tools/spec/traceabilityMatrix.test.js +0 -359
- package/dist/tools/spec/traceabilityMatrix.test.js.map +0 -1
- package/hooks/scripts/__tests__/.vibe/command-log.txt +0 -3
- package/hooks/scripts/__tests__/auto-test-debounce.test.js +0 -145
- package/hooks/scripts/__tests__/clone-behaviors.test.js +0 -152
- package/hooks/scripts/__tests__/clone-merge-responsive.test.js +0 -106
- package/hooks/scripts/__tests__/code-check-detectors.test.js +0 -213
- package/hooks/scripts/__tests__/code-check-memory-write.test.js +0 -81
- package/hooks/scripts/__tests__/codex-hook-adapter.test.js +0 -64
- package/hooks/scripts/__tests__/curation-index.test.js +0 -157
- package/hooks/scripts/__tests__/dispatcher-inprocess.test.js +0 -99
- package/hooks/scripts/__tests__/figma-extract.test.js +0 -338
- package/hooks/scripts/__tests__/hook-payload.test.js +0 -29
- package/hooks/scripts/__tests__/llm-orchestrate-antigravity.test.js +0 -66
- package/hooks/scripts/__tests__/loop-ledger.test.js +0 -321
- package/hooks/scripts/__tests__/post-edit-dispatcher.test.js +0 -139
- package/hooks/scripts/__tests__/pre-tool-guard.test.js +0 -523
- package/hooks/scripts/__tests__/recipe-extractor.test.js +0 -244
- package/hooks/scripts/__tests__/run-ledger-verify-required.test.js +0 -151
- package/hooks/scripts/__tests__/run-ledger.test.js +0 -481
- package/hooks/scripts/__tests__/scope-from-spec.test.js +0 -215
- package/hooks/scripts/__tests__/sentinel-guard.test.js +0 -263
- package/hooks/scripts/__tests__/step-counter.test.js +0 -459
- package/hooks/scripts/__tests__/utils-npm-root.test.js +0 -99
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* validateLoopDefinition 테스트
|
|
3
|
-
*
|
|
4
|
-
* 커버리지:
|
|
5
|
-
* - 유효한 전체 정의 (scheduled + ledger, manual + tests, on-event + none)
|
|
6
|
-
* - 각 enum 위반
|
|
7
|
-
* - schedule iff scheduled 조건
|
|
8
|
-
* - test_command iff tests 조건
|
|
9
|
-
* - max_iterations 범위 (경계값 포함)
|
|
10
|
-
* - pipeline non-vibe 항목
|
|
11
|
-
* - 필수 필드 누락
|
|
12
|
-
*/
|
|
13
|
-
import { describe, it, expect } from 'vitest';
|
|
14
|
-
import { validateLoopDefinition } from './validateLoopDefinition.js';
|
|
15
|
-
// ─── Fixture helpers ──────────────────────────────────────────────────
|
|
16
|
-
function makeContent(overrides = {}) {
|
|
17
|
-
const defaults = {
|
|
18
|
-
name: 'nightly-triage',
|
|
19
|
-
trigger: 'scheduled',
|
|
20
|
-
schedule: '0 2 * * *',
|
|
21
|
-
goal: '회귀 항목 자동 처리',
|
|
22
|
-
discover: '오픈 회귀 스캔',
|
|
23
|
-
verify: 'ledger',
|
|
24
|
-
max_iterations: 10,
|
|
25
|
-
isolation: 'none',
|
|
26
|
-
status: 'active',
|
|
27
|
-
};
|
|
28
|
-
const merged = { ...defaults, ...overrides };
|
|
29
|
-
const pipeline = merged['pipeline'] ?? ['vibe.spec', 'vibe.run', 'vibe.verify'];
|
|
30
|
-
delete merged['pipeline'];
|
|
31
|
-
let fm = '---\n';
|
|
32
|
-
for (const [k, v] of Object.entries(merged)) {
|
|
33
|
-
if (v === undefined)
|
|
34
|
-
continue;
|
|
35
|
-
fm += `${k}: ${v}\n`;
|
|
36
|
-
}
|
|
37
|
-
// pipeline 블록 시퀀스
|
|
38
|
-
if (Array.isArray(pipeline) && pipeline.length > 0) {
|
|
39
|
-
fm += 'pipeline:\n';
|
|
40
|
-
for (const item of pipeline) {
|
|
41
|
-
fm += ` - ${item}\n`;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
fm += '---\n\n# 루프 본문\n';
|
|
45
|
-
return fm;
|
|
46
|
-
}
|
|
47
|
-
// ─── 유효한 정의 ──────────────────────────────────────────────────────
|
|
48
|
-
describe('validateLoopDefinition: 유효한 정의', () => {
|
|
49
|
-
it('scheduled + ledger 전체 정의 → valid=true, errors=[]', () => {
|
|
50
|
-
const result = validateLoopDefinition(makeContent());
|
|
51
|
-
expect(result.valid).toBe(true);
|
|
52
|
-
expect(result.errors).toHaveLength(0);
|
|
53
|
-
expect(result.definition).not.toBeNull();
|
|
54
|
-
expect(result.definition?.name).toBe('nightly-triage');
|
|
55
|
-
expect(result.definition?.trigger).toBe('scheduled');
|
|
56
|
-
expect(result.definition?.schedule).toBe('0 2 * * *');
|
|
57
|
-
expect(result.definition?.pipeline).toEqual(['vibe.spec', 'vibe.run', 'vibe.verify']);
|
|
58
|
-
expect(result.definition?.max_iterations).toBe(10);
|
|
59
|
-
});
|
|
60
|
-
it('manual + tests + test_command → valid=true', () => {
|
|
61
|
-
const content = makeContent({
|
|
62
|
-
trigger: 'manual',
|
|
63
|
-
schedule: undefined,
|
|
64
|
-
verify: 'tests',
|
|
65
|
-
test_command: 'npx vitest run',
|
|
66
|
-
});
|
|
67
|
-
const result = validateLoopDefinition(content);
|
|
68
|
-
expect(result.valid).toBe(true);
|
|
69
|
-
expect(result.definition?.trigger).toBe('manual');
|
|
70
|
-
expect(result.definition?.test_command).toBe('npx vitest run');
|
|
71
|
-
});
|
|
72
|
-
it('on-event + none + isolation=worktree → valid=true', () => {
|
|
73
|
-
const content = makeContent({
|
|
74
|
-
trigger: 'on-event',
|
|
75
|
-
schedule: undefined,
|
|
76
|
-
verify: 'none',
|
|
77
|
-
isolation: 'worktree',
|
|
78
|
-
});
|
|
79
|
-
const result = validateLoopDefinition(content);
|
|
80
|
-
expect(result.valid).toBe(true);
|
|
81
|
-
expect(result.definition?.isolation).toBe('worktree');
|
|
82
|
-
});
|
|
83
|
-
it('max_iterations 경계값 1 → valid=true', () => {
|
|
84
|
-
const result = validateLoopDefinition(makeContent({ max_iterations: 1 }));
|
|
85
|
-
expect(result.valid).toBe(true);
|
|
86
|
-
});
|
|
87
|
-
it('max_iterations 경계값 50 → valid=true', () => {
|
|
88
|
-
const result = validateLoopDefinition(makeContent({ max_iterations: 50 }));
|
|
89
|
-
expect(result.valid).toBe(true);
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
// ─── enum 위반 ────────────────────────────────────────────────────────
|
|
93
|
-
describe('validateLoopDefinition: enum 위반', () => {
|
|
94
|
-
it('trigger 유효하지 않은 값 → error 포함', () => {
|
|
95
|
-
const result = validateLoopDefinition(makeContent({ trigger: 'daily', schedule: undefined }));
|
|
96
|
-
expect(result.valid).toBe(false);
|
|
97
|
-
expect(result.errors.some((e) => e.includes('trigger'))).toBe(true);
|
|
98
|
-
});
|
|
99
|
-
it('verify 유효하지 않은 값 → error 포함', () => {
|
|
100
|
-
const result = validateLoopDefinition(makeContent({ verify: 'manual-check' }));
|
|
101
|
-
expect(result.valid).toBe(false);
|
|
102
|
-
expect(result.errors.some((e) => e.includes('verify'))).toBe(true);
|
|
103
|
-
});
|
|
104
|
-
it('isolation 유효하지 않은 값 → error 포함', () => {
|
|
105
|
-
const result = validateLoopDefinition(makeContent({ isolation: 'docker' }));
|
|
106
|
-
expect(result.valid).toBe(false);
|
|
107
|
-
expect(result.errors.some((e) => e.includes('isolation'))).toBe(true);
|
|
108
|
-
});
|
|
109
|
-
it('status 유효하지 않은 값 → error 포함', () => {
|
|
110
|
-
const result = validateLoopDefinition(makeContent({ status: 'running' }));
|
|
111
|
-
expect(result.valid).toBe(false);
|
|
112
|
-
expect(result.errors.some((e) => e.includes('status'))).toBe(true);
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
// ─── schedule iff scheduled ───────────────────────────────────────────
|
|
116
|
-
describe('validateLoopDefinition: schedule 조건', () => {
|
|
117
|
-
it('trigger=scheduled 인데 schedule 없으면 → error', () => {
|
|
118
|
-
const result = validateLoopDefinition(makeContent({ trigger: 'scheduled', schedule: undefined }));
|
|
119
|
-
expect(result.valid).toBe(false);
|
|
120
|
-
expect(result.errors.some((e) => e.includes('schedule'))).toBe(true);
|
|
121
|
-
});
|
|
122
|
-
it('trigger=scheduled + 잘못된 cron 형식 → error', () => {
|
|
123
|
-
const result = validateLoopDefinition(makeContent({ schedule: 'every day' }));
|
|
124
|
-
expect(result.valid).toBe(false);
|
|
125
|
-
expect(result.errors.some((e) => e.includes('cron'))).toBe(true);
|
|
126
|
-
});
|
|
127
|
-
it('trigger=manual 인데 schedule 있으면 → error', () => {
|
|
128
|
-
const content = makeContent({ trigger: 'manual', schedule: '0 2 * * *' });
|
|
129
|
-
const result = validateLoopDefinition(content);
|
|
130
|
-
expect(result.valid).toBe(false);
|
|
131
|
-
expect(result.errors.some((e) => e.includes('schedule'))).toBe(true);
|
|
132
|
-
});
|
|
133
|
-
it('trigger=on-event 인데 schedule 있으면 → error', () => {
|
|
134
|
-
const content = makeContent({ trigger: 'on-event', schedule: '0 2 * * *' });
|
|
135
|
-
const result = validateLoopDefinition(content);
|
|
136
|
-
expect(result.valid).toBe(false);
|
|
137
|
-
expect(result.errors.some((e) => e.includes('schedule'))).toBe(true);
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
// ─── test_command iff tests ───────────────────────────────────────────
|
|
141
|
-
describe('validateLoopDefinition: test_command 조건', () => {
|
|
142
|
-
it('verify=tests 인데 test_command 없으면 → error', () => {
|
|
143
|
-
const content = makeContent({
|
|
144
|
-
trigger: 'manual',
|
|
145
|
-
schedule: undefined,
|
|
146
|
-
verify: 'tests',
|
|
147
|
-
});
|
|
148
|
-
const result = validateLoopDefinition(content);
|
|
149
|
-
expect(result.valid).toBe(false);
|
|
150
|
-
expect(result.errors.some((e) => e.includes('test_command'))).toBe(true);
|
|
151
|
-
});
|
|
152
|
-
it('verify=ledger 인데 test_command 있으면 → error', () => {
|
|
153
|
-
const content = makeContent({ test_command: 'npm test' });
|
|
154
|
-
const result = validateLoopDefinition(content);
|
|
155
|
-
expect(result.valid).toBe(false);
|
|
156
|
-
expect(result.errors.some((e) => e.includes('test_command'))).toBe(true);
|
|
157
|
-
});
|
|
158
|
-
it('verify=none 인데 test_command 있으면 → error', () => {
|
|
159
|
-
const content = makeContent({
|
|
160
|
-
trigger: 'manual',
|
|
161
|
-
schedule: undefined,
|
|
162
|
-
verify: 'none',
|
|
163
|
-
test_command: 'npm test',
|
|
164
|
-
});
|
|
165
|
-
const result = validateLoopDefinition(content);
|
|
166
|
-
expect(result.valid).toBe(false);
|
|
167
|
-
expect(result.errors.some((e) => e.includes('test_command'))).toBe(true);
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
// ─── max_iterations 범위 ──────────────────────────────────────────────
|
|
171
|
-
describe('validateLoopDefinition: max_iterations 범위', () => {
|
|
172
|
-
it('max_iterations=0 → error', () => {
|
|
173
|
-
const result = validateLoopDefinition(makeContent({ max_iterations: 0 }));
|
|
174
|
-
expect(result.valid).toBe(false);
|
|
175
|
-
expect(result.errors.some((e) => e.includes('max_iterations'))).toBe(true);
|
|
176
|
-
});
|
|
177
|
-
it('max_iterations=51 → error', () => {
|
|
178
|
-
const result = validateLoopDefinition(makeContent({ max_iterations: 51 }));
|
|
179
|
-
expect(result.valid).toBe(false);
|
|
180
|
-
expect(result.errors.some((e) => e.includes('max_iterations'))).toBe(true);
|
|
181
|
-
});
|
|
182
|
-
it('max_iterations 누락 → error', () => {
|
|
183
|
-
const content = makeContent({ max_iterations: undefined });
|
|
184
|
-
const result = validateLoopDefinition(content);
|
|
185
|
-
expect(result.valid).toBe(false);
|
|
186
|
-
expect(result.errors.some((e) => e.includes('max_iterations'))).toBe(true);
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
// ─── pipeline non-vibe 항목 ───────────────────────────────────────────
|
|
190
|
-
describe('validateLoopDefinition: pipeline 항목 검사', () => {
|
|
191
|
-
it('pipeline에 non-vibe 항목 포함 → error', () => {
|
|
192
|
-
const content = makeContent({ pipeline: ['vibe.spec', 'npm-test', 'vibe.verify'] });
|
|
193
|
-
const result = validateLoopDefinition(content);
|
|
194
|
-
expect(result.valid).toBe(false);
|
|
195
|
-
expect(result.errors.some((e) => e.includes('npm-test'))).toBe(true);
|
|
196
|
-
});
|
|
197
|
-
it('pipeline 비어 있음 → error', () => {
|
|
198
|
-
const content = makeContent({ pipeline: [] });
|
|
199
|
-
const result = validateLoopDefinition(content);
|
|
200
|
-
expect(result.valid).toBe(false);
|
|
201
|
-
expect(result.errors.some((e) => e.includes('pipeline'))).toBe(true);
|
|
202
|
-
});
|
|
203
|
-
it('pipeline 모두 vibe. 접두사 → valid=true', () => {
|
|
204
|
-
const content = makeContent({ pipeline: ['vibe.analyze', 'vibe.run', 'vibe.verify'] });
|
|
205
|
-
const result = validateLoopDefinition(content);
|
|
206
|
-
expect(result.valid).toBe(true);
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
// ─── 필수 필드 누락 ───────────────────────────────────────────────────
|
|
210
|
-
describe('validateLoopDefinition: 필수 필드 누락', () => {
|
|
211
|
-
it('name 누락 → error', () => {
|
|
212
|
-
const content = makeContent({ name: undefined });
|
|
213
|
-
const result = validateLoopDefinition(content);
|
|
214
|
-
expect(result.valid).toBe(false);
|
|
215
|
-
expect(result.errors.some((e) => e.includes('name'))).toBe(true);
|
|
216
|
-
});
|
|
217
|
-
it('goal 누락 → error', () => {
|
|
218
|
-
const content = makeContent({ goal: undefined });
|
|
219
|
-
const result = validateLoopDefinition(content);
|
|
220
|
-
expect(result.valid).toBe(false);
|
|
221
|
-
expect(result.errors.some((e) => e.includes('goal'))).toBe(true);
|
|
222
|
-
});
|
|
223
|
-
it('frontmatter 없는 문서 → error 다수', () => {
|
|
224
|
-
const result = validateLoopDefinition('# 루프 본문만 있는 파일\n\n내용\n');
|
|
225
|
-
expect(result.valid).toBe(false);
|
|
226
|
-
expect(result.errors.length).toBeGreaterThan(0);
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
//# sourceMappingURL=validateLoopDefinition.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateLoopDefinition.test.js","sourceRoot":"","sources":["../../../src/tools/loop/validateLoopDefinition.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AA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,CAAC,KAAK,CAAC,CAAC;QACjC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,MAAM,GAAG,sBAAsB,CAAC,wBAAwB,CAAC,CAAC;QAChE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"executionPacket.test.d.ts","sourceRoot":"","sources":["../../../src/tools/spec/executionPacket.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,374 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import os from 'os';
|
|
4
|
-
import path from 'path';
|
|
5
|
-
import { compileExecutionPacket, validateExecutionPacket, writeExecutionPacket, } from './executionPacket.js';
|
|
6
|
-
const canonicalSpec = `# SPEC: Example
|
|
7
|
-
|
|
8
|
-
## Context Sources
|
|
9
|
-
- docs/prd.md
|
|
10
|
-
|
|
11
|
-
## Assumptions
|
|
12
|
-
- PostgreSQL 16 is available
|
|
13
|
-
|
|
14
|
-
## Constraints
|
|
15
|
-
- Preserve backward compatibility
|
|
16
|
-
- Do not expose secrets
|
|
17
|
-
|
|
18
|
-
## Requirements
|
|
19
|
-
|
|
20
|
-
| ID | Requirement | Done Criteria |
|
|
21
|
-
|----|-------------|---------------|
|
|
22
|
-
| REQ-example-001 | Build remains valid | D1 |
|
|
23
|
-
| REQ-example-002 | Tests remain valid | D2 |
|
|
24
|
-
|
|
25
|
-
## Done Criteria (deterministic gates)
|
|
26
|
-
|
|
27
|
-
| # | Criterion | Verified by |
|
|
28
|
-
|---|-----------|-------------|
|
|
29
|
-
| D1 | Build succeeds | npm run build exit 0 |
|
|
30
|
-
| D2 | Tests pass | npm test exit 0 |
|
|
31
|
-
|
|
32
|
-
### Evidence Required
|
|
33
|
-
- D1 → build command result
|
|
34
|
-
- D2 → test command result
|
|
35
|
-
`;
|
|
36
|
-
function input(overrides = {}) {
|
|
37
|
-
return {
|
|
38
|
-
canonicalSpec,
|
|
39
|
-
canonicalSpecPath: '.vibe/specs/example.md',
|
|
40
|
-
profile: 'codex',
|
|
41
|
-
...overrides,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
describe('Execution Packet Compiler', () => {
|
|
45
|
-
it('동일 입력은 source/hash와 계약을 보존한 byte-identical packet을 생성', () => {
|
|
46
|
-
const first = compileExecutionPacket(input());
|
|
47
|
-
const second = compileExecutionPacket(input());
|
|
48
|
-
expect(first.ok).toBe(true);
|
|
49
|
-
expect(second).toEqual(first);
|
|
50
|
-
if (!first.ok)
|
|
51
|
-
return;
|
|
52
|
-
expect(JSON.stringify(second)).toBe(JSON.stringify(first));
|
|
53
|
-
expect(first.packet.canonicalSpecHash).toMatch(/^[a-f0-9]{64}$/);
|
|
54
|
-
expect(first.packet.requirements.map(item => item.id))
|
|
55
|
-
.toEqual(['REQ-example-001', 'REQ-example-002']);
|
|
56
|
-
expect(first.packet.doneCriteria.map(item => item.id)).toEqual(['D1', 'D2']);
|
|
57
|
-
expect(first.packet.evidenceRequired.map(item => item.criterionId))
|
|
58
|
-
.toEqual(['D1', 'D2']);
|
|
59
|
-
expect(first.packet.constraints).toEqual([
|
|
60
|
-
'Preserve backward compatibility',
|
|
61
|
-
'Do not expose secrets',
|
|
62
|
-
]);
|
|
63
|
-
expect(first.packet.sourcePointers).toContainEqual({
|
|
64
|
-
id: 'D1',
|
|
65
|
-
path: '.vibe/specs/example.md',
|
|
66
|
-
line: 24,
|
|
67
|
-
});
|
|
68
|
-
expect(first.audit.preservedCriterionIds).toEqual(['D1', 'D2']);
|
|
69
|
-
});
|
|
70
|
-
it('Codex와 Claude Code 프로파일은 동일한 핵심 계약을 보존', () => {
|
|
71
|
-
const codex = compileExecutionPacket(input({ profile: 'codex' }));
|
|
72
|
-
const claude = compileExecutionPacket(input({ profile: 'claude-code' }));
|
|
73
|
-
expect(codex.ok).toBe(true);
|
|
74
|
-
expect(claude.ok).toBe(true);
|
|
75
|
-
if (!codex.ok || !claude.ok)
|
|
76
|
-
return;
|
|
77
|
-
expect(codex.packet.profile).not.toBe(claude.packet.profile);
|
|
78
|
-
expect(codex.packet.contextBudget).not.toBe(claude.packet.contextBudget);
|
|
79
|
-
expect(codex.packet.requirements).toEqual(claude.packet.requirements);
|
|
80
|
-
expect(codex.packet.constraints).toEqual(claude.packet.constraints);
|
|
81
|
-
expect(codex.packet.doneCriteria).toEqual(claude.packet.doneCriteria);
|
|
82
|
-
expect(codex.packet.evidenceRequired).toEqual(claude.packet.evidenceRequired);
|
|
83
|
-
expect(codex.packet.isolationPolicy).toEqual({
|
|
84
|
-
reloadPerScenario: true,
|
|
85
|
-
includeExplorationLogs: false,
|
|
86
|
-
stateSource: 'disk',
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
it('누락된 evidence를 오류 코드와 원본 위치로 보고하고 packet을 생성하지 않음', () => {
|
|
90
|
-
const result = compileExecutionPacket(input({
|
|
91
|
-
canonicalSpec: canonicalSpec.replace('- D2 → test command result\n', ''),
|
|
92
|
-
}));
|
|
93
|
-
expect(result.ok).toBe(false);
|
|
94
|
-
if (result.ok)
|
|
95
|
-
return;
|
|
96
|
-
expect(result.errors).toContainEqual({
|
|
97
|
-
code: 'MISSING_EVIDENCE',
|
|
98
|
-
message: 'Missing evidence: D2',
|
|
99
|
-
sourceId: 'D2',
|
|
100
|
-
sourcePointer: { path: '.vibe/specs/example.md', line: 25 },
|
|
101
|
-
});
|
|
102
|
-
expect(result).not.toHaveProperty('packet');
|
|
103
|
-
});
|
|
104
|
-
it('알 수 없는 criterion 선택과 evidence 참조를 거부', () => {
|
|
105
|
-
const unknownSelection = compileExecutionPacket(input({
|
|
106
|
-
selectedRequirementIds: ['REQ-example-999'],
|
|
107
|
-
}));
|
|
108
|
-
const unknownEvidence = compileExecutionPacket(input({
|
|
109
|
-
canonicalSpec: `${canonicalSpec}- D9 → unknown proof\n`,
|
|
110
|
-
}));
|
|
111
|
-
expect(unknownSelection.ok).toBe(false);
|
|
112
|
-
expect(unknownEvidence.ok).toBe(false);
|
|
113
|
-
if (!unknownSelection.ok) {
|
|
114
|
-
expect(unknownSelection.errors.map(error => error.code))
|
|
115
|
-
.toContain('UNKNOWN_REQUIREMENT_ID');
|
|
116
|
-
}
|
|
117
|
-
if (!unknownEvidence.ok) {
|
|
118
|
-
expect(unknownEvidence.errors.map(error => error.code))
|
|
119
|
-
.toContain('UNKNOWN_EVIDENCE_ID');
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
it('빈 requirement 선택과 알 수 없는 Done Criterion 매핑을 거부', () => {
|
|
123
|
-
const empty = compileExecutionPacket(input({ selectedRequirementIds: [] }));
|
|
124
|
-
const invalidMapping = compileExecutionPacket(input({
|
|
125
|
-
canonicalSpec: canonicalSpec.replace('| D1 |', '| D9 |'),
|
|
126
|
-
}));
|
|
127
|
-
expect(empty).toMatchObject({
|
|
128
|
-
ok: false,
|
|
129
|
-
errors: [{ code: 'EMPTY_SELECTION' }],
|
|
130
|
-
});
|
|
131
|
-
expect(invalidMapping.ok).toBe(false);
|
|
132
|
-
if (!invalidMapping.ok) {
|
|
133
|
-
expect(invalidMapping.errors.map(error => error.code))
|
|
134
|
-
.toContain('INVALID_REQUIREMENT_MAPPING');
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
it('어떤 requirement에도 매핑되지 않은 Done Criterion을 거부', () => {
|
|
138
|
-
const orphaned = canonicalSpec.replace('| REQ-example-002 | Tests remain valid | D2 |\n', '');
|
|
139
|
-
expect(compileExecutionPacket(input({ canonicalSpec: orphaned })))
|
|
140
|
-
.toMatchObject({
|
|
141
|
-
ok: false,
|
|
142
|
-
errors: [{ code: 'INVALID_REQUIREMENT_MAPPING', sourceId: 'D2' }],
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
it('Done Criteria 밖의 D 행은 계약 기준으로 인정하지 않음', () => {
|
|
146
|
-
const misplaced = canonicalSpec.replace('## Done Criteria', '## Unrelated Table');
|
|
147
|
-
expect(compileExecutionPacket(input({ canonicalSpec: misplaced }))).toEqual({
|
|
148
|
-
ok: false,
|
|
149
|
-
errors: [{ code: 'MISSING_DONE_CRITERIA', message: 'No contract criteria found' }],
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
it('profile 필수 Constraints 섹션 누락을 차단', () => {
|
|
153
|
-
const withoutConstraints = canonicalSpec.replace(/## Constraints[\s\S]*?(?=## Done Criteria)/, '');
|
|
154
|
-
const result = compileExecutionPacket(input({ canonicalSpec: withoutConstraints }));
|
|
155
|
-
expect(result).toEqual({
|
|
156
|
-
ok: false,
|
|
157
|
-
errors: [{
|
|
158
|
-
code: 'MISSING_REQUIRED_SECTION',
|
|
159
|
-
message: 'Constraints section is required',
|
|
160
|
-
}],
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
it('Rejected Alternatives (Traps) 섹션을 packet에 보존, 없으면 빈 배열', () => {
|
|
164
|
-
const withTraps = canonicalSpec.replace('## Requirements', '### Rejected Alternatives (Traps)\n- shelve — not thread-safe under multi-writer load\n\n## Requirements');
|
|
165
|
-
const compiled = compileExecutionPacket(input({ canonicalSpec: withTraps }));
|
|
166
|
-
expect(compiled.ok).toBe(true);
|
|
167
|
-
if (!compiled.ok)
|
|
168
|
-
return;
|
|
169
|
-
expect(compiled.packet.rejectedAlternatives)
|
|
170
|
-
.toEqual(['shelve — not thread-safe under multi-writer load']);
|
|
171
|
-
const withoutTraps = compileExecutionPacket(input());
|
|
172
|
-
expect(withoutTraps.ok).toBe(true);
|
|
173
|
-
if (!withoutTraps.ok)
|
|
174
|
-
return;
|
|
175
|
-
expect(withoutTraps.packet.rejectedAlternatives).toEqual([]);
|
|
176
|
-
});
|
|
177
|
-
it('지원하지 않는 runtime profile을 구조화된 오류로 거부', () => {
|
|
178
|
-
const result = Reflect.apply(compileExecutionPacket, undefined, [{
|
|
179
|
-
...input(),
|
|
180
|
-
profile: 'unknown',
|
|
181
|
-
}]);
|
|
182
|
-
expect(result).toEqual({
|
|
183
|
-
ok: false,
|
|
184
|
-
errors: [{ code: 'INVALID_PROFILE', message: 'Unsupported profile: unknown' }],
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
it('반환 packet 변경이 다음 컴파일의 profile 결정성을 오염시키지 않음', () => {
|
|
188
|
-
const first = compileExecutionPacket(input());
|
|
189
|
-
expect(first.ok).toBe(true);
|
|
190
|
-
if (!first.ok)
|
|
191
|
-
return;
|
|
192
|
-
first.packet.isolationPolicy.reloadPerScenario = false;
|
|
193
|
-
const second = compileExecutionPacket(input());
|
|
194
|
-
expect(second.ok).toBe(true);
|
|
195
|
-
if (!second.ok)
|
|
196
|
-
return;
|
|
197
|
-
expect(second.packet.isolationPolicy.reloadPerScenario).toBe(true);
|
|
198
|
-
});
|
|
199
|
-
it('context budget 초과는 문자열 절단 없이 구조화된 오류를 반환', () => {
|
|
200
|
-
const oversizedConstraint = `- ${'x'.repeat(25_000)}`;
|
|
201
|
-
const oversizedSpec = canonicalSpec.replace('- Do not expose secrets', `- Do not expose secrets\n${oversizedConstraint}`);
|
|
202
|
-
const result = compileExecutionPacket(input({ canonicalSpec: oversizedSpec }));
|
|
203
|
-
expect(result).toEqual({
|
|
204
|
-
ok: false,
|
|
205
|
-
errors: [{
|
|
206
|
-
code: 'BUDGET_EXCEEDED',
|
|
207
|
-
message: 'Packet exceeds 24000 characters',
|
|
208
|
-
}],
|
|
209
|
-
});
|
|
210
|
-
expect(result).not.toHaveProperty('packet');
|
|
211
|
-
});
|
|
212
|
-
it('packet 파일을 원자 기록하고 원본 SPEC 변경 시 stale로 판정', () => {
|
|
213
|
-
const projectPath = fs.mkdtempSync(path.join(os.tmpdir(), 'vibe-packet-'));
|
|
214
|
-
const specPath = '.vibe/specs/example.md';
|
|
215
|
-
const absoluteSpecPath = path.join(projectPath, specPath);
|
|
216
|
-
fs.mkdirSync(path.dirname(absoluteSpecPath), { recursive: true });
|
|
217
|
-
fs.writeFileSync(absoluteSpecPath, canonicalSpec);
|
|
218
|
-
try {
|
|
219
|
-
const written = writeExecutionPacket({ projectPath, specPath, profile: 'codex' });
|
|
220
|
-
expect(written.ok).toBe(true);
|
|
221
|
-
if (!written.ok)
|
|
222
|
-
return;
|
|
223
|
-
expect(written.packetPath).toBe('.vibe/packets/example/codex.json');
|
|
224
|
-
expect(fs.existsSync(path.join(projectPath, written.packetPath))).toBe(true);
|
|
225
|
-
expect(validateExecutionPacket({
|
|
226
|
-
projectPath,
|
|
227
|
-
specPath,
|
|
228
|
-
packetPath: written.packetPath,
|
|
229
|
-
})).toMatchObject({ valid: true });
|
|
230
|
-
fs.appendFileSync(absoluteSpecPath, '\n<!-- changed -->\n');
|
|
231
|
-
expect(validateExecutionPacket({
|
|
232
|
-
projectPath,
|
|
233
|
-
specPath,
|
|
234
|
-
packetPath: written.packetPath,
|
|
235
|
-
})).toEqual({
|
|
236
|
-
valid: false,
|
|
237
|
-
code: 'STALE_PACKET',
|
|
238
|
-
message: 'Execution packet does not match the current canonical SPEC',
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
finally {
|
|
242
|
-
fs.rmSync(projectPath, { recursive: true, force: true });
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
it('packet 디렉터리의 symbolic link를 통한 project 외부 쓰기를 거부', () => {
|
|
246
|
-
const projectPath = fs.mkdtempSync(path.join(os.tmpdir(), 'vibe-packet-project-'));
|
|
247
|
-
const outsidePath = fs.mkdtempSync(path.join(os.tmpdir(), 'vibe-packet-outside-'));
|
|
248
|
-
const specPath = '.vibe/specs/example.md';
|
|
249
|
-
const absoluteSpecPath = path.join(projectPath, specPath);
|
|
250
|
-
fs.mkdirSync(path.dirname(absoluteSpecPath), { recursive: true });
|
|
251
|
-
fs.writeFileSync(absoluteSpecPath, canonicalSpec);
|
|
252
|
-
fs.symlinkSync(outsidePath, path.join(projectPath, '.vibe', 'packets'));
|
|
253
|
-
try {
|
|
254
|
-
expect(writeExecutionPacket({ projectPath, specPath, profile: 'codex' }))
|
|
255
|
-
.toEqual({
|
|
256
|
-
ok: false,
|
|
257
|
-
errors: [{
|
|
258
|
-
code: 'INVALID_PATH',
|
|
259
|
-
message: 'Execution packet path contains a symbolic link',
|
|
260
|
-
}],
|
|
261
|
-
});
|
|
262
|
-
expect(fs.readdirSync(outsidePath)).toEqual([]);
|
|
263
|
-
}
|
|
264
|
-
finally {
|
|
265
|
-
fs.rmSync(projectPath, { recursive: true, force: true });
|
|
266
|
-
fs.rmSync(outsidePath, { recursive: true, force: true });
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
it('packet identity가 요청 SPEC과 다르거나 허용 경로 밖이면 거부', () => {
|
|
270
|
-
const projectPath = fs.mkdtempSync(path.join(os.tmpdir(), 'vibe-packet-identity-'));
|
|
271
|
-
const specPath = '.vibe/specs/example.md';
|
|
272
|
-
const absoluteSpecPath = path.join(projectPath, specPath);
|
|
273
|
-
fs.mkdirSync(path.dirname(absoluteSpecPath), { recursive: true });
|
|
274
|
-
fs.writeFileSync(absoluteSpecPath, canonicalSpec);
|
|
275
|
-
try {
|
|
276
|
-
const written = writeExecutionPacket({ projectPath, specPath, profile: 'codex' });
|
|
277
|
-
expect(written.ok).toBe(true);
|
|
278
|
-
if (!written.ok)
|
|
279
|
-
return;
|
|
280
|
-
expect(validateExecutionPacket({
|
|
281
|
-
projectPath,
|
|
282
|
-
specPath: '.vibe/specs/different.md',
|
|
283
|
-
packetPath: written.packetPath,
|
|
284
|
-
})).toMatchObject({ valid: false, code: 'INVALID_PACKET' });
|
|
285
|
-
expect(validateExecutionPacket({
|
|
286
|
-
projectPath,
|
|
287
|
-
specPath,
|
|
288
|
-
packetPath: '.vibe/specs/example.md',
|
|
289
|
-
})).toMatchObject({ valid: false, code: 'INVALID_PACKET' });
|
|
290
|
-
}
|
|
291
|
-
finally {
|
|
292
|
-
fs.rmSync(projectPath, { recursive: true, force: true });
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
it('저장된 packet 계약 본문 변조를 canonical 재컴파일로 거부', () => {
|
|
296
|
-
const projectPath = fs.mkdtempSync(path.join(os.tmpdir(), 'vibe-packet-tamper-'));
|
|
297
|
-
const specPath = '.vibe/specs/example.md';
|
|
298
|
-
const absoluteSpecPath = path.join(projectPath, specPath);
|
|
299
|
-
fs.mkdirSync(path.dirname(absoluteSpecPath), { recursive: true });
|
|
300
|
-
fs.writeFileSync(absoluteSpecPath, canonicalSpec);
|
|
301
|
-
try {
|
|
302
|
-
const written = writeExecutionPacket({ projectPath, specPath, profile: 'codex' });
|
|
303
|
-
expect(written.ok).toBe(true);
|
|
304
|
-
if (!written.ok)
|
|
305
|
-
return;
|
|
306
|
-
const packetFile = path.join(projectPath, written.packetPath);
|
|
307
|
-
fs.writeFileSync(packetFile, JSON.stringify({ ...written.packet, constraints: [] }));
|
|
308
|
-
expect(validateExecutionPacket({
|
|
309
|
-
projectPath,
|
|
310
|
-
specPath,
|
|
311
|
-
packetPath: written.packetPath,
|
|
312
|
-
})).toMatchObject({ valid: false, code: 'INVALID_PACKET' });
|
|
313
|
-
}
|
|
314
|
-
finally {
|
|
315
|
-
fs.rmSync(projectPath, { recursive: true, force: true });
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
it('호출자가 승인하지 않은 requirement subset packet을 거부', () => {
|
|
319
|
-
const projectPath = fs.mkdtempSync(path.join(os.tmpdir(), 'vibe-packet-subset-'));
|
|
320
|
-
const specPath = '.vibe/specs/example.md';
|
|
321
|
-
const absoluteSpecPath = path.join(projectPath, specPath);
|
|
322
|
-
fs.mkdirSync(path.dirname(absoluteSpecPath), { recursive: true });
|
|
323
|
-
fs.writeFileSync(absoluteSpecPath, canonicalSpec);
|
|
324
|
-
try {
|
|
325
|
-
const written = writeExecutionPacket({
|
|
326
|
-
projectPath,
|
|
327
|
-
specPath,
|
|
328
|
-
profile: 'codex',
|
|
329
|
-
selectedRequirementIds: ['REQ-example-001'],
|
|
330
|
-
});
|
|
331
|
-
expect(written.ok).toBe(true);
|
|
332
|
-
if (!written.ok)
|
|
333
|
-
return;
|
|
334
|
-
expect(validateExecutionPacket({
|
|
335
|
-
projectPath,
|
|
336
|
-
specPath,
|
|
337
|
-
packetPath: written.packetPath,
|
|
338
|
-
})).toMatchObject({ valid: false, code: 'INVALID_PACKET' });
|
|
339
|
-
expect(validateExecutionPacket({
|
|
340
|
-
projectPath,
|
|
341
|
-
specPath,
|
|
342
|
-
packetPath: written.packetPath,
|
|
343
|
-
selectedRequirementIds: ['REQ-example-001'],
|
|
344
|
-
})).toEqual({ valid: true });
|
|
345
|
-
}
|
|
346
|
-
finally {
|
|
347
|
-
fs.rmSync(projectPath, { recursive: true, force: true });
|
|
348
|
-
}
|
|
349
|
-
});
|
|
350
|
-
it('symbolic link SPEC을 통한 project 외부 읽기를 거부', () => {
|
|
351
|
-
const projectPath = fs.mkdtempSync(path.join(os.tmpdir(), 'vibe-spec-project-'));
|
|
352
|
-
const outsidePath = fs.mkdtempSync(path.join(os.tmpdir(), 'vibe-spec-outside-'));
|
|
353
|
-
const specPath = '.vibe/specs/example.md';
|
|
354
|
-
const outsideSpec = path.join(outsidePath, 'example.md');
|
|
355
|
-
fs.mkdirSync(path.join(projectPath, '.vibe', 'specs'), { recursive: true });
|
|
356
|
-
fs.writeFileSync(outsideSpec, canonicalSpec);
|
|
357
|
-
fs.symlinkSync(outsideSpec, path.join(projectPath, specPath));
|
|
358
|
-
try {
|
|
359
|
-
expect(writeExecutionPacket({ projectPath, specPath, profile: 'codex' }))
|
|
360
|
-
.toMatchObject({ ok: false, errors: [{ code: 'INVALID_PATH' }] });
|
|
361
|
-
}
|
|
362
|
-
finally {
|
|
363
|
-
fs.rmSync(projectPath, { recursive: true, force: true });
|
|
364
|
-
fs.rmSync(outsidePath, { recursive: true, force: true });
|
|
365
|
-
}
|
|
366
|
-
});
|
|
367
|
-
it('vibe.run 계약은 packet 생성과 stale 거부를 명시', () => {
|
|
368
|
-
const skill = fs.readFileSync(path.join(process.cwd(), 'skills', 'vibe.run', 'SKILL.md'), 'utf-8');
|
|
369
|
-
expect(skill).toContain('writeExecutionPacket');
|
|
370
|
-
expect(skill).toContain('validateExecutionPacket');
|
|
371
|
-
expect(skill).toContain('STALE_PACKET');
|
|
372
|
-
});
|
|
373
|
-
});
|
|
374
|
-
//# sourceMappingURL=executionPacket.test.js.map
|