@su-record/vibe 3.2.14 → 3.2.16
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/dist/cli/commands/index.d.ts +1 -1
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +1 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/info.d.ts +3 -1
- package/dist/cli/commands/info.d.ts.map +1 -1
- package/dist/cli/commands/info.js +12 -3
- package/dist/cli/commands/info.js.map +1 -1
- package/dist/cli/commands/init.d.ts +0 -7
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +5 -37
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +4 -6
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/upgrade.d.ts +1 -1
- package/dist/cli/commands/upgrade.d.ts.map +1 -1
- package/dist/cli/commands/upgrade.js +7 -2
- package/dist/cli/commands/upgrade.js.map +1 -1
- package/dist/cli/postinstall/claude-agents.js +1 -1
- package/dist/cli/postinstall/claude-agents.js.map +1 -1
- package/dist/cli/postinstall/constants.d.ts +0 -1
- package/dist/cli/postinstall/constants.d.ts.map +1 -1
- package/dist/cli/postinstall/constants.js +0 -8
- package/dist/cli/postinstall/constants.js.map +1 -1
- package/dist/cli/postinstall/main.d.ts.map +1 -1
- package/dist/cli/postinstall/main.js +20 -13
- package/dist/cli/postinstall/main.js.map +1 -1
- package/dist/cli/postinstall.d.ts +0 -3
- package/dist/cli/postinstall.d.ts.map +1 -1
- package/dist/cli/postinstall.js +0 -3
- package/dist/cli/postinstall.js.map +1 -1
- package/dist/cli/setup/InstallHome.d.ts +27 -0
- package/dist/cli/setup/InstallHome.d.ts.map +1 -0
- package/dist/cli/setup/InstallHome.js +105 -0
- package/dist/cli/setup/InstallHome.js.map +1 -0
- package/dist/cli/setup/ProjectSetup.d.ts +0 -8
- package/dist/cli/setup/ProjectSetup.d.ts.map +1 -1
- package/dist/cli/setup/ProjectSetup.js +0 -96
- package/dist/cli/setup/ProjectSetup.js.map +1 -1
- package/dist/cli/setup.d.ts +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +1 -1
- package/dist/cli/setup.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/scripts/clone-extract.js +16 -1
- package/hooks/scripts/code-check.js +12 -5
- package/hooks/scripts/lib/dispatcher.js +43 -3
- package/hooks/scripts/utils.js +32 -2
- package/package.json +10 -8
- 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__/engines-contract.test.d.ts +0 -2
- package/dist/__tests__/engines-contract.test.d.ts.map +0 -1
- package/dist/__tests__/engines-contract.test.js +0 -72
- package/dist/__tests__/engines-contract.test.js.map +0 -1
- package/dist/__tests__/instruction-drift.test.d.ts +0 -2
- package/dist/__tests__/instruction-drift.test.d.ts.map +0 -1
- package/dist/__tests__/instruction-drift.test.js +0 -116
- package/dist/__tests__/instruction-drift.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 -173
- 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 -161
- 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/cursor-agents.d.ts +0 -13
- package/dist/cli/postinstall/cursor-agents.d.ts.map +0 -1
- package/dist/cli/postinstall/cursor-agents.js +0 -89
- package/dist/cli/postinstall/cursor-agents.js.map +0 -1
- package/dist/cli/postinstall/cursor-rules.d.ts +0 -11
- package/dist/cli/postinstall/cursor-rules.d.ts.map +0 -1
- package/dist/cli/postinstall/cursor-rules.js +0 -205
- package/dist/cli/postinstall/cursor-rules.js.map +0 -1
- package/dist/cli/postinstall/cursor-skills.d.ts +0 -9
- package/dist/cli/postinstall/cursor-skills.d.ts.map +0 -1
- package/dist/cli/postinstall/cursor-skills.js +0 -796
- package/dist/cli/postinstall/cursor-skills.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__/anchor-inbox.test.js +0 -119
- 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-false-positive.test.js +0 -74
- 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__/fixtures/seq-harness.js +0 -13
- package/hooks/scripts/__tests__/fixtures/seq-step.js +0 -22
- 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__/stop-dispatcher-sequential.test.js +0 -74
- package/hooks/scripts/__tests__/utils-npm-root.test.js +0 -99
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* code-check 오탐 회귀 테스트
|
|
3
|
-
*
|
|
4
|
-
* 재현했던 결함: `any` 를 금지하는 문서 문장(주석·템플릿 리터럴)이 그 자체로
|
|
5
|
-
* P1 any-type 으로 잡혀, ProjectSetup.ts 를 편집할 때마다 고칠 수 없는 경고가
|
|
6
|
-
* additionalContext 에 주입됐다. 이스케이프된 백틱(\`)이 템플릿 리터럴을
|
|
7
|
-
* 조기 종료시킨 것이 직접 원인.
|
|
8
|
-
*/
|
|
9
|
-
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
|
|
10
|
-
import { mkdtempSync, rmSync, writeFileSync } from 'fs';
|
|
11
|
-
import { tmpdir } from 'os';
|
|
12
|
-
import path from 'path';
|
|
13
|
-
import { run } from '../code-check.js';
|
|
14
|
-
|
|
15
|
-
let dir;
|
|
16
|
-
|
|
17
|
-
const write = (name, content) => {
|
|
18
|
-
const p = path.join(dir, name);
|
|
19
|
-
writeFileSync(p, content, 'utf-8');
|
|
20
|
-
return p;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const findingsFor = async (filePath) => (await run({ filePath })).findings;
|
|
24
|
-
|
|
25
|
-
beforeAll(() => {
|
|
26
|
-
dir = mkdtempSync(path.join(tmpdir(), 'code-check-fp-'));
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
afterAll(() => {
|
|
30
|
-
rmSync(dir, { recursive: true, force: true });
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
describe('code-check: any 탐지는 코드 구간에만 적용된다', () => {
|
|
34
|
-
it('줄 주석 안의 as any 는 P1 이 아니다', async () => {
|
|
35
|
-
const f = write('line-comment.ts', '// as any 를 쓰지 말 것\nexport const a = 1;\n');
|
|
36
|
-
expect(await findingsFor(f)).toEqual([]);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('블록 주석 안의 : any 는 P1 이 아니다', async () => {
|
|
40
|
-
const f = write('block-comment.ts', '/**\n * 금지: : any\n */\nexport const b = 2;\n');
|
|
41
|
-
expect(await findingsFor(f)).toEqual([]);
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it('여러 줄 템플릿 리터럴 안의 any 는 P1 이 아니다', async () => {
|
|
45
|
-
const f = write('template.ts', 'export const DOC = `\n금지 패턴: any / as any / @ts-ignore\n`;\n');
|
|
46
|
-
expect(await findingsFor(f)).toEqual([]);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('이스케이프된 백틱이 템플릿 리터럴을 조기 종료시키지 않는다', async () => {
|
|
50
|
-
// 직접 원인 회귀: \` 를 종료 백틱으로 오인하면 다음 줄부터 코드로 오판한다
|
|
51
|
-
const f = write('escaped-backtick.ts', [
|
|
52
|
-
'export const RULES = `',
|
|
53
|
-
'- 금지: \\`any\\`/\\`as any\\`/\\`@ts-ignore\\`',
|
|
54
|
-
'- 금지: \\`console.log\\`',
|
|
55
|
-
'`;',
|
|
56
|
-
'',
|
|
57
|
-
].join('\n'));
|
|
58
|
-
expect(await findingsFor(f)).toEqual([]);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('실제 코드의 any 는 여전히 P1 으로 잡힌다', async () => {
|
|
62
|
-
const f = write('real.ts', 'export function real(x: any): void { void x; }\n');
|
|
63
|
-
const findings = await findingsFor(f);
|
|
64
|
-
expect(findings).toHaveLength(1);
|
|
65
|
-
expect(findings[0]).toContain('P1 any-type');
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it('주석과 실제 코드가 섞이면 실제 코드만 잡는다', async () => {
|
|
69
|
-
const f = write('mixed.ts', '// as any 금지\nexport function g(y: any): void { void y; }\n');
|
|
70
|
-
const findings = await findingsFor(f);
|
|
71
|
-
expect(findings).toHaveLength(1);
|
|
72
|
-
expect(findings[0]).toContain('line 2');
|
|
73
|
-
});
|
|
74
|
-
});
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* code-check.js — C1 회귀 테스트: SQLite addObservation 조건화
|
|
3
|
-
*
|
|
4
|
-
* 검증 대상:
|
|
5
|
-
* - 무위반(clean) Edit → memories.db 자체가 생성되지 않음 (SQLite write 없음)
|
|
6
|
-
* - 위반(violation) Edit → memories.db 생성 (addObservation 기록)
|
|
7
|
-
* - 코드 확장자가 아닌 파일 → 동적 import 전 조기 반환 (write 없음)
|
|
8
|
-
*
|
|
9
|
-
* dist 빌드 필요 (BASE_URL = dist/tools) — `npm run build` 이후 실행.
|
|
10
|
-
* 패턴: 훅 스크립트 공통의 spawnSync 방식 (post-edit-dispatcher.test.js 참고).
|
|
11
|
-
*/
|
|
12
|
-
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
13
|
-
import { spawnSync } from 'child_process';
|
|
14
|
-
import fs from 'fs';
|
|
15
|
-
import os from 'os';
|
|
16
|
-
import path from 'path';
|
|
17
|
-
import { fileURLToPath } from 'url';
|
|
18
|
-
|
|
19
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
20
|
-
const SCRIPT = path.resolve(__dirname, '..', 'code-check.js');
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* 격리된 임시 프로젝트에서 code-check 를 1회 실행.
|
|
24
|
-
* stdin 으로 PostToolUse payload 전달.
|
|
25
|
-
*/
|
|
26
|
-
function runCodeCheck({ filePath, projectDir }) {
|
|
27
|
-
const payload = { tool_name: 'Edit', tool_input: { file_path: filePath } };
|
|
28
|
-
return spawnSync('node', [SCRIPT], {
|
|
29
|
-
input: JSON.stringify(payload),
|
|
30
|
-
encoding: 'utf-8',
|
|
31
|
-
timeout: 15000,
|
|
32
|
-
env: { ...process.env, CLAUDE_PROJECT_DIR: projectDir },
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function memoriesDbPath(projectDir) {
|
|
37
|
-
return path.join(projectDir, '.vibe', 'memories', 'memories.db');
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
describe('code-check.js: 위반 시에만 SQLite 기록 (C1)', () => {
|
|
41
|
-
let projectDir;
|
|
42
|
-
|
|
43
|
-
beforeEach(() => {
|
|
44
|
-
projectDir = fs.mkdtempSync(path.join(os.tmpdir(), 'vibe-code-check-'));
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
afterEach(() => {
|
|
48
|
-
try { fs.rmSync(projectDir, { recursive: true, force: true }); } catch { /* ignore */ }
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('무위반 TS 파일 편집 → memories.db 미생성 (SQLite write 없음)', () => {
|
|
52
|
-
const filePath = path.join(projectDir, 'clean.ts');
|
|
53
|
-
fs.writeFileSync(filePath, 'export function add(a: number, b: number): number {\n return a + b;\n}\n');
|
|
54
|
-
|
|
55
|
-
const result = runCodeCheck({ filePath, projectDir });
|
|
56
|
-
|
|
57
|
-
expect(result.status).toBe(0);
|
|
58
|
-
expect(fs.existsSync(memoriesDbPath(projectDir))).toBe(false);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('any 타입 위반이 있는 TS 파일 편집 → memories.db 생성 (SQLite write 발생)', () => {
|
|
62
|
-
const filePath = path.join(projectDir, 'dirty.ts');
|
|
63
|
-
fs.writeFileSync(filePath, 'export function foo(x: any): any {\n return x;\n}\n');
|
|
64
|
-
|
|
65
|
-
const result = runCodeCheck({ filePath, projectDir });
|
|
66
|
-
|
|
67
|
-
expect(result.status).toBe(0);
|
|
68
|
-
expect(result.stdout).toContain('any-type');
|
|
69
|
-
expect(fs.existsSync(memoriesDbPath(projectDir))).toBe(true);
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('코드 확장자가 아닌 파일(.md) → 동적 import 조기 반환, memories.db 미생성', () => {
|
|
73
|
-
const filePath = path.join(projectDir, 'notes.md');
|
|
74
|
-
fs.writeFileSync(filePath, "console.log('should not trigger memory write')\n");
|
|
75
|
-
|
|
76
|
-
const result = runCodeCheck({ filePath, projectDir });
|
|
77
|
-
|
|
78
|
-
expect(result.status).toBe(0);
|
|
79
|
-
expect(fs.existsSync(memoriesDbPath(projectDir))).toBe(false);
|
|
80
|
-
});
|
|
81
|
-
});
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { spawnSync } from 'child_process';
|
|
3
|
-
import fs from 'fs';
|
|
4
|
-
import os from 'os';
|
|
5
|
-
import path from 'path';
|
|
6
|
-
import { fileURLToPath } from 'url';
|
|
7
|
-
|
|
8
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
-
const ADAPTER = path.resolve(__dirname, '..', 'codex-hook-adapter.js');
|
|
10
|
-
|
|
11
|
-
describe('codex-hook-adapter', () => {
|
|
12
|
-
it('converts a PreToolUse denial into Codex permission output', () => {
|
|
13
|
-
const cwd = fs.mkdtempSync(path.join(os.tmpdir(), 'vibe-codex-adapter-'));
|
|
14
|
-
const payload = JSON.stringify({
|
|
15
|
-
tool_name: 'Bash',
|
|
16
|
-
tool_input: { command: 'rm -rf /' },
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const result = spawnSync(process.execPath, [ADAPTER, 'PreToolUse'], {
|
|
20
|
-
cwd,
|
|
21
|
-
input: payload,
|
|
22
|
-
encoding: 'utf-8',
|
|
23
|
-
timeout: 5000,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
expect(result.status).toBe(2);
|
|
27
|
-
const output = JSON.parse(result.stdout.trim());
|
|
28
|
-
expect(output.hookSpecificOutput.permissionDecision).toBe('deny');
|
|
29
|
-
expect(output.hookSpecificOutput.permissionDecisionReason).toContain('Deleting root or home directory');
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Codex 에는 CC 의 context_window_* Notification 등가물이 없어, PreCompact 를
|
|
34
|
-
* 붙이기 전까지 압축 전 체크포인트가 아예 저장되지 않았다.
|
|
35
|
-
*/
|
|
36
|
-
it('handles PreCompact without failing or injecting context', () => {
|
|
37
|
-
const cwd = fs.mkdtempSync(path.join(os.tmpdir(), 'vibe-codex-precompact-'));
|
|
38
|
-
|
|
39
|
-
const result = spawnSync(process.execPath, [ADAPTER, 'PreCompact'], {
|
|
40
|
-
cwd,
|
|
41
|
-
input: JSON.stringify({ cwd }),
|
|
42
|
-
encoding: 'utf-8',
|
|
43
|
-
timeout: 30000,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
expect(result.status).toBe(0);
|
|
47
|
-
// 압축 직전에 컨텍스트를 더 늘리면 역효과 — stdout 주입이 없어야 한다
|
|
48
|
-
expect(result.stdout.trim()).toBe('');
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('ignores unknown events instead of erroring', () => {
|
|
52
|
-
const cwd = fs.mkdtempSync(path.join(os.tmpdir(), 'vibe-codex-unknown-'));
|
|
53
|
-
|
|
54
|
-
const result = spawnSync(process.execPath, [ADAPTER, 'SubagentStop'], {
|
|
55
|
-
cwd,
|
|
56
|
-
input: JSON.stringify({ cwd }),
|
|
57
|
-
encoding: 'utf-8',
|
|
58
|
-
timeout: 10000,
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
expect(result.status).toBe(0);
|
|
62
|
-
expect(result.stdout.trim()).toBe('');
|
|
63
|
-
});
|
|
64
|
-
});
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* curation-index.js — Phase 3 인덱스 로더 테스트
|
|
3
|
-
*
|
|
4
|
-
* session-start.js 가 다음 세션에 prepend 할 1줄 요약을 만드는 모듈.
|
|
5
|
-
* 본격 YAML parser 의존 없이 우리가 작성한 frontmatter 형식만 처리한다.
|
|
6
|
-
*/
|
|
7
|
-
import { describe, it, expect, beforeEach } from 'vitest';
|
|
8
|
-
import fs from 'fs';
|
|
9
|
-
import os from 'os';
|
|
10
|
-
import path from 'path';
|
|
11
|
-
import { loadCurationIndex, _internal } from '../lib/curation-index.js';
|
|
12
|
-
|
|
13
|
-
const { parseFrontmatter } = _internal;
|
|
14
|
-
|
|
15
|
-
function makeTmpProject() {
|
|
16
|
-
return fs.mkdtempSync(path.join(os.tmpdir(), 'vibe-curation-index-'));
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function writeRecipe(projectDir, filename, frontmatter, body = 'body text') {
|
|
20
|
-
const dir = path.join(projectDir, '.vibe', 'recipes');
|
|
21
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
22
|
-
const fm = Object.entries(frontmatter)
|
|
23
|
-
.map(([k, v]) => typeof v === 'string' ? `${k}: "${v}"` : `${k}: ${v}`)
|
|
24
|
-
.join('\n');
|
|
25
|
-
fs.writeFileSync(path.join(dir, filename), `---\n${fm}\n---\n\n${body}\n`);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function writeAntiPattern(projectDir, filename, frontmatter, body = 'body') {
|
|
29
|
-
const dir = path.join(projectDir, '.vibe', 'anti-patterns');
|
|
30
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
31
|
-
const fm = Object.entries(frontmatter)
|
|
32
|
-
.map(([k, v]) => typeof v === 'string' ? `${k}: "${v}"` : `${k}: ${v}`)
|
|
33
|
-
.join('\n');
|
|
34
|
-
fs.writeFileSync(path.join(dir, filename), `---\n${fm}\n---\n\n${body}\n`);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
describe('parseFrontmatter', () => {
|
|
38
|
-
it('단순 key-value 파싱', () => {
|
|
39
|
-
const input = `---\nslug: foo\ntype: recipe\n---\nbody`;
|
|
40
|
-
expect(parseFrontmatter(input)).toEqual({ slug: 'foo', type: 'recipe' });
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('따옴표로 감싼 값', () => {
|
|
44
|
-
const input = `---\nrecipe: "use claude --model"\n---\n`;
|
|
45
|
-
expect(parseFrontmatter(input).recipe).toBe('use claude --model');
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('이스케이프된 따옴표', () => {
|
|
49
|
-
const input = `---\nmsg: "say \\"hi\\""\n---\n`;
|
|
50
|
-
expect(parseFrontmatter(input).msg).toBe('say "hi"');
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('frontmatter 가 없으면 null', () => {
|
|
54
|
-
expect(parseFrontmatter('no frontmatter here')).toBeNull();
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it('알 수 없는 라인 무시', () => {
|
|
58
|
-
const input = `---\nslug: foo\n# comment line\nrandom garbage\ntype: recipe\n---\n`;
|
|
59
|
-
expect(parseFrontmatter(input)).toEqual({ slug: 'foo', type: 'recipe' });
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
describe('loadCurationIndex', () => {
|
|
64
|
-
let projectDir;
|
|
65
|
-
|
|
66
|
-
beforeEach(() => {
|
|
67
|
-
projectDir = makeTmpProject();
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('빈 .vibe/ 면 빈 인덱스', () => {
|
|
71
|
-
const idx = loadCurationIndex(projectDir);
|
|
72
|
-
expect(idx.recipes).toEqual([]);
|
|
73
|
-
expect(idx.antiPatterns).toEqual([]);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it('recipe 1개 로드', () => {
|
|
77
|
-
writeRecipe(projectDir, 'a.md', {
|
|
78
|
-
slug: 'login__20260507-100000',
|
|
79
|
-
type: 'recipe',
|
|
80
|
-
'symptom-context': 'login flow',
|
|
81
|
-
recipe: 'pin model and retry transient',
|
|
82
|
-
created: '2026-05-07',
|
|
83
|
-
});
|
|
84
|
-
const idx = loadCurationIndex(projectDir);
|
|
85
|
-
expect(idx.recipes).toHaveLength(1);
|
|
86
|
-
expect(idx.recipes[0]).toEqual({
|
|
87
|
-
slug: 'login__20260507-100000',
|
|
88
|
-
summary: 'pin model and retry transient',
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
it('recipe 정렬: created 내림차순', () => {
|
|
93
|
-
writeRecipe(projectDir, 'old.md', { slug: 'old', recipe: 'old', created: '2026-01-01' });
|
|
94
|
-
writeRecipe(projectDir, 'mid.md', { slug: 'mid', recipe: 'mid', created: '2026-03-01' });
|
|
95
|
-
writeRecipe(projectDir, 'new.md', { slug: 'new', recipe: 'new', created: '2026-05-01' });
|
|
96
|
-
const idx = loadCurationIndex(projectDir);
|
|
97
|
-
expect(idx.recipes.map((r) => r.slug)).toEqual(['new', 'mid', 'old']);
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('limit 적용', () => {
|
|
101
|
-
for (let i = 0; i < 10; i++) {
|
|
102
|
-
writeRecipe(projectDir, `r${i}.md`, {
|
|
103
|
-
slug: `r${i}`,
|
|
104
|
-
recipe: `recipe ${i}`,
|
|
105
|
-
created: `2026-05-${String(i + 1).padStart(2, '0')}`,
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
const idx = loadCurationIndex(projectDir, { recipeLimit: 3 });
|
|
109
|
-
expect(idx.recipes).toHaveLength(3);
|
|
110
|
-
expect(idx.recipes[0].slug).toBe('r9');
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
it('anti-pattern 로드 — tag + suggested-stop', () => {
|
|
114
|
-
writeAntiPattern(projectDir, 'a.md', {
|
|
115
|
-
slug: 'nullability__src__20260507',
|
|
116
|
-
type: 'anti-pattern',
|
|
117
|
-
'root-cause-tag': 'nullability',
|
|
118
|
-
'trigger-signature': '(file=src/x.ts, category=nullability)',
|
|
119
|
-
'suggested-stop': '같은 위치 null 처리 반복 — 타입 가드 필요',
|
|
120
|
-
created: '2026-05-07',
|
|
121
|
-
});
|
|
122
|
-
const idx = loadCurationIndex(projectDir);
|
|
123
|
-
expect(idx.antiPatterns).toHaveLength(1);
|
|
124
|
-
expect(idx.antiPatterns[0].tag).toBe('nullability');
|
|
125
|
-
expect(idx.antiPatterns[0].summary).toBe('같은 위치 null 처리 반복 — 타입 가드 필요');
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
it('frontmatter 손상 파일은 스킵', () => {
|
|
129
|
-
writeRecipe(projectDir, 'good.md', { slug: 'good', recipe: 'works', created: '2026-05-07' });
|
|
130
|
-
fs.writeFileSync(path.join(projectDir, '.vibe', 'recipes', 'broken.md'), 'no frontmatter');
|
|
131
|
-
fs.writeFileSync(path.join(projectDir, '.vibe', 'recipes', 'no-slug.md'), '---\ntype: recipe\n---\n');
|
|
132
|
-
const idx = loadCurationIndex(projectDir);
|
|
133
|
-
expect(idx.recipes).toHaveLength(1);
|
|
134
|
-
expect(idx.recipes[0].slug).toBe('good');
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
it('README.md, _cluster*.md 등 메타 파일 제외', () => {
|
|
138
|
-
writeRecipe(projectDir, 'r.md', { slug: 'r', recipe: 'good', created: '2026-05-07' });
|
|
139
|
-
fs.writeFileSync(path.join(projectDir, '.vibe', 'recipes', 'README.md'), '---\nslug: should-skip\n---\n');
|
|
140
|
-
fs.writeFileSync(path.join(projectDir, '.vibe', 'recipes', '_cluster-x.md'), '---\nslug: should-skip\n---\n');
|
|
141
|
-
const idx = loadCurationIndex(projectDir);
|
|
142
|
-
expect(idx.recipes.map((r) => r.slug)).toEqual(['r']);
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
it('recipe + anti-pattern 동시 로드 (독립)', () => {
|
|
146
|
-
writeRecipe(projectDir, 'r.md', { slug: 'r', recipe: 'do this', created: '2026-05-07' });
|
|
147
|
-
writeAntiPattern(projectDir, 'a.md', {
|
|
148
|
-
slug: 'a',
|
|
149
|
-
'root-cause-tag': 'auth',
|
|
150
|
-
'suggested-stop': 'check tokens',
|
|
151
|
-
created: '2026-05-07',
|
|
152
|
-
});
|
|
153
|
-
const idx = loadCurationIndex(projectDir);
|
|
154
|
-
expect(idx.recipes).toHaveLength(1);
|
|
155
|
-
expect(idx.antiPatterns).toHaveLength(1);
|
|
156
|
-
});
|
|
157
|
-
});
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* in-process 디스패처 외부 계약 테스트
|
|
3
|
-
*
|
|
4
|
-
* SPEC: .vibe/specs/hook-dispatcher-inprocess.md
|
|
5
|
-
* 디스패처를 Claude Code와 동일하게 CLI로 spawn하여 검증한다 —
|
|
6
|
-
* 내부 구현(in-process)이 아니라 외부 계약(exit code, stdout 주입)이 대상.
|
|
7
|
-
*/
|
|
8
|
-
import { describe, it, expect } from 'vitest';
|
|
9
|
-
import { execFileSync } from 'child_process';
|
|
10
|
-
import path from 'path';
|
|
11
|
-
import { fileURLToPath } from 'url';
|
|
12
|
-
|
|
13
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
-
const PRE_DISPATCHER = path.resolve(__dirname, '..', 'pre-tool-dispatcher.js');
|
|
15
|
-
const POST_DISPATCHER = path.resolve(__dirname, '..', 'post-edit-dispatcher.js');
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* 디스패처를 stdin 페이로드와 함께 실행. { stdout, exitCode } 반환.
|
|
19
|
-
*/
|
|
20
|
-
function runDispatcher(script, args, payload) {
|
|
21
|
-
const input = typeof payload === 'string' ? payload : JSON.stringify(payload);
|
|
22
|
-
try {
|
|
23
|
-
const stdout = execFileSync('node', [script, ...args], {
|
|
24
|
-
encoding: 'utf-8',
|
|
25
|
-
input,
|
|
26
|
-
timeout: 15000,
|
|
27
|
-
// scope.json이 없는 격리된 cwd에서 실행 (scope-guard no-op 보장)
|
|
28
|
-
env: { ...process.env, CLAUDE_PROJECT_DIR: __dirname },
|
|
29
|
-
});
|
|
30
|
-
return { stdout: stdout.trim(), exitCode: 0 };
|
|
31
|
-
} catch (err) {
|
|
32
|
-
return { stdout: (err.stdout || '').trim(), exitCode: err.status };
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
describe('pre-tool-dispatcher (in-process)', () => {
|
|
37
|
-
it('AC-1: 위험 Bash 명령은 exit 2로 deny', () => {
|
|
38
|
-
const { exitCode } = runDispatcher(PRE_DISPATCHER, ['Bash'], {
|
|
39
|
-
tool_name: 'Bash',
|
|
40
|
-
tool_input: { command: 'rm -rf /' },
|
|
41
|
-
});
|
|
42
|
-
expect(exitCode).toBe(2);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it('AC-2: sentinel 경로 Edit은 exit 2 + stdout에 block JSON 주입', () => {
|
|
46
|
-
// 실제 sentinel 경로: src/infra/lib/evolution/ (autonomy/ 는 팬텀 경로였음)
|
|
47
|
-
const { stdout, exitCode } = runDispatcher(PRE_DISPATCHER, ['Edit'], {
|
|
48
|
-
tool_name: 'Edit',
|
|
49
|
-
tool_input: { file_path: 'src/infra/lib/evolution/GuardAnalyzer.ts', old_string: 'a', new_string: 'b' },
|
|
50
|
-
});
|
|
51
|
-
expect(exitCode).toBe(2);
|
|
52
|
-
expect(stdout).toContain('"decision":"block"');
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('AC-3: 안전한 Bash 명령은 exit 0', () => {
|
|
56
|
-
const { exitCode } = runDispatcher(PRE_DISPATCHER, ['Bash'], {
|
|
57
|
-
tool_name: 'Bash',
|
|
58
|
-
tool_input: { command: 'ls -la' },
|
|
59
|
-
});
|
|
60
|
-
expect(exitCode).toBe(0);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('AC-3: 안전한 Edit은 exit 0 (scope.json 없음 → scope-guard no-op)', () => {
|
|
64
|
-
const { exitCode } = runDispatcher(PRE_DISPATCHER, ['Edit'], {
|
|
65
|
-
tool_name: 'Edit',
|
|
66
|
-
tool_input: { file_path: 'src/cli/index.ts', old_string: 'a', new_string: 'b' },
|
|
67
|
-
});
|
|
68
|
-
expect(exitCode).toBe(0);
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('AC-2 변형: 위험 명령이 sentinel 경로를 노리면 sentinel-guard가 차단', () => {
|
|
72
|
-
// 실제 sentinel 경로: src/infra/lib/evolution/
|
|
73
|
-
const { exitCode } = runDispatcher(PRE_DISPATCHER, ['Bash'], {
|
|
74
|
-
tool_name: 'Bash',
|
|
75
|
-
tool_input: { command: 'rm -rf src/infra/lib/evolution/' },
|
|
76
|
-
});
|
|
77
|
-
expect(exitCode).toBe(2);
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
describe('post-edit-dispatcher (in-process)', () => {
|
|
82
|
-
it('AC-4: 손상된 stdin(비JSON)에도 exit 0 (fail-open)', () => {
|
|
83
|
-
const { exitCode } = runDispatcher(POST_DISPATCHER, [], 'not-json');
|
|
84
|
-
expect(exitCode).toBe(0);
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it('AC-4: 빈 페이로드에도 exit 0', () => {
|
|
88
|
-
const { exitCode } = runDispatcher(POST_DISPATCHER, [], {});
|
|
89
|
-
expect(exitCode).toBe(0);
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
it('존재하지 않는 파일 경로 페이로드에도 exit 0 (step 내부 격리)', () => {
|
|
93
|
-
const { exitCode } = runDispatcher(POST_DISPATCHER, [], {
|
|
94
|
-
tool_name: 'Edit',
|
|
95
|
-
tool_input: { file_path: '/nonexistent/__vibe_test__.xyz' },
|
|
96
|
-
});
|
|
97
|
-
expect(exitCode).toBe(0);
|
|
98
|
-
});
|
|
99
|
-
});
|