@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,244 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* recipe-extractor.js — Phase 3 테스트
|
|
3
|
-
*
|
|
4
|
-
* 검증 범위:
|
|
5
|
-
* - 휴리스틱 게이트: total_tools≥8 AND fails≥3 AND last=success
|
|
6
|
-
* - VIBE_RECIPE_LLM=mock 으로 LLM 우회 (외부 의존 0)
|
|
7
|
-
* - frontmatter schema 충족
|
|
8
|
-
* - silent fail 정책 (jsonl 없음 / 게이트 실패 / 디렉토리 부재)
|
|
9
|
-
*
|
|
10
|
-
* 외부 의존:
|
|
11
|
-
* - 실제 claude CLI 는 호출하지 않음 (mock 모드 사용)
|
|
12
|
-
*/
|
|
13
|
-
import { describe, it, expect, beforeEach } from 'vitest';
|
|
14
|
-
import { spawnSync } from 'child_process';
|
|
15
|
-
import fs from 'fs';
|
|
16
|
-
import os from 'os';
|
|
17
|
-
import path from 'path';
|
|
18
|
-
import { fileURLToPath } from 'url';
|
|
19
|
-
|
|
20
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
21
|
-
const SCRIPT = path.resolve(__dirname, '..', 'recipe-extractor.js');
|
|
22
|
-
|
|
23
|
-
function makeTmpProject() {
|
|
24
|
-
return fs.mkdtempSync(path.join(os.tmpdir(), 'vibe-recipe-extractor-'));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function writeJsonl(projectDir, records) {
|
|
28
|
-
const dir = path.join(projectDir, '.vibe', 'metrics');
|
|
29
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
30
|
-
const lines = records.map((r) => JSON.stringify(r)).join('\n') + '\n';
|
|
31
|
-
fs.writeFileSync(path.join(dir, 'current-run.jsonl'), lines);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function writeRunMeta(projectDir, meta) {
|
|
35
|
-
const dir = path.join(projectDir, '.vibe', 'metrics');
|
|
36
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
37
|
-
fs.writeFileSync(path.join(dir, 'current-run.json'), JSON.stringify(meta));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function runExtractor(projectDir, { mock = true } = {}) {
|
|
41
|
-
const result = spawnSync('node', [SCRIPT], {
|
|
42
|
-
encoding: 'utf-8',
|
|
43
|
-
timeout: 5000,
|
|
44
|
-
env: {
|
|
45
|
-
...process.env,
|
|
46
|
-
CLAUDE_PROJECT_DIR: projectDir,
|
|
47
|
-
...(mock ? { VIBE_RECIPE_LLM: 'mock' } : {}),
|
|
48
|
-
VIBE_HOOK_DEPTH: '0',
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
return result;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function listRecipes(projectDir) {
|
|
55
|
-
const dir = path.join(projectDir, '.vibe', 'recipes');
|
|
56
|
-
if (!fs.existsSync(dir)) return [];
|
|
57
|
-
return fs.readdirSync(dir).filter((f) => f.endsWith('.md'));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function makeRecord({ tool = 'Bash', ok = true, file = null, category = null }) {
|
|
61
|
-
return {
|
|
62
|
-
ts: new Date().toISOString(),
|
|
63
|
-
tool,
|
|
64
|
-
ok,
|
|
65
|
-
target_file: file,
|
|
66
|
-
error_category: ok ? null : category,
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
describe('recipe-extractor (Phase 3)', () => {
|
|
71
|
-
let projectDir;
|
|
72
|
-
|
|
73
|
-
beforeEach(() => {
|
|
74
|
-
projectDir = makeTmpProject();
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
// ───────── 게이트 통과 조건 ─────────
|
|
78
|
-
describe('휴리스틱 게이트', () => {
|
|
79
|
-
it('총 ≥8 + 실패 ≥3 + 마지막 성공 → recipe 생성', () => {
|
|
80
|
-
const records = [
|
|
81
|
-
makeRecord({ ok: false, category: 'integration' }),
|
|
82
|
-
makeRecord({ ok: false, category: 'integration' }),
|
|
83
|
-
makeRecord({ ok: false, category: 'auth' }),
|
|
84
|
-
makeRecord({ ok: true }),
|
|
85
|
-
makeRecord({ ok: true }),
|
|
86
|
-
makeRecord({ ok: true, tool: 'Edit', file: 'src/foo.ts' }),
|
|
87
|
-
makeRecord({ ok: true, tool: 'Read', file: 'src/foo.ts' }),
|
|
88
|
-
makeRecord({ ok: true, tool: 'Bash' }), // 마지막=성공
|
|
89
|
-
];
|
|
90
|
-
writeJsonl(projectDir, records);
|
|
91
|
-
writeRunMeta(projectDir, { feature: 'auth-fix', startedAt: '2026-05-07T00:00:00.000Z', steps: 8 });
|
|
92
|
-
|
|
93
|
-
const r = runExtractor(projectDir);
|
|
94
|
-
expect(r.status).toBe(0);
|
|
95
|
-
expect(listRecipes(projectDir)).toHaveLength(1);
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
it('툴콜 부족 (<8) → 생성 안 함', () => {
|
|
99
|
-
const records = [
|
|
100
|
-
makeRecord({ ok: false, category: 'integration' }),
|
|
101
|
-
makeRecord({ ok: false, category: 'integration' }),
|
|
102
|
-
makeRecord({ ok: false, category: 'integration' }),
|
|
103
|
-
makeRecord({ ok: true }),
|
|
104
|
-
];
|
|
105
|
-
writeJsonl(projectDir, records);
|
|
106
|
-
writeRunMeta(projectDir, { feature: 'x' });
|
|
107
|
-
runExtractor(projectDir);
|
|
108
|
-
expect(listRecipes(projectDir)).toHaveLength(0);
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
it('실패 부족 (<3) → 생성 안 함', () => {
|
|
112
|
-
const records = Array.from({ length: 10 }, () => makeRecord({ ok: true }));
|
|
113
|
-
records[0] = makeRecord({ ok: false, category: 'other' });
|
|
114
|
-
records[1] = makeRecord({ ok: false, category: 'other' });
|
|
115
|
-
writeJsonl(projectDir, records);
|
|
116
|
-
writeRunMeta(projectDir, { feature: 'x' });
|
|
117
|
-
runExtractor(projectDir);
|
|
118
|
-
expect(listRecipes(projectDir)).toHaveLength(0);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it('마지막 호출이 실패 → 생성 안 함 (task 미완료)', () => {
|
|
122
|
-
const records = [
|
|
123
|
-
...Array.from({ length: 5 }, () => makeRecord({ ok: true })),
|
|
124
|
-
makeRecord({ ok: false, category: 'integration' }),
|
|
125
|
-
makeRecord({ ok: false, category: 'integration' }),
|
|
126
|
-
makeRecord({ ok: false, category: 'integration' }),
|
|
127
|
-
];
|
|
128
|
-
writeJsonl(projectDir, records);
|
|
129
|
-
writeRunMeta(projectDir, { feature: 'x' });
|
|
130
|
-
runExtractor(projectDir);
|
|
131
|
-
expect(listRecipes(projectDir)).toHaveLength(0);
|
|
132
|
-
});
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
// ───────── frontmatter 검증 ─────────
|
|
136
|
-
describe('frontmatter schema', () => {
|
|
137
|
-
function makeQualifyingRun() {
|
|
138
|
-
const records = [
|
|
139
|
-
makeRecord({ tool: 'Bash', ok: false, category: 'integration' }),
|
|
140
|
-
makeRecord({ tool: 'Bash', ok: false, category: 'integration' }),
|
|
141
|
-
makeRecord({ tool: 'Edit', file: 'src/foo.ts', ok: false, category: 'type-narrow' }),
|
|
142
|
-
makeRecord({ tool: 'Edit', file: 'src/foo.ts', ok: true }),
|
|
143
|
-
makeRecord({ tool: 'Read', file: 'src/foo.ts', ok: true }),
|
|
144
|
-
makeRecord({ tool: 'Bash', ok: true }),
|
|
145
|
-
makeRecord({ tool: 'Bash', ok: true }),
|
|
146
|
-
makeRecord({ tool: 'Bash', ok: true }),
|
|
147
|
-
];
|
|
148
|
-
writeJsonl(projectDir, records);
|
|
149
|
-
writeRunMeta(projectDir, { feature: 'login flow', startedAt: '2026-05-07T10:00:00.000Z', steps: 8 });
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
it('생성된 recipe 의 frontmatter 가 schema 충족', () => {
|
|
153
|
-
makeQualifyingRun();
|
|
154
|
-
runExtractor(projectDir);
|
|
155
|
-
const [filename] = listRecipes(projectDir);
|
|
156
|
-
const content = fs.readFileSync(path.join(projectDir, '.vibe', 'recipes', filename), 'utf-8');
|
|
157
|
-
|
|
158
|
-
expect(content).toMatch(/^---\n/);
|
|
159
|
-
expect(content).toMatch(/^slug: login-flow__\d{8}-\d{6}$/m);
|
|
160
|
-
expect(content).toMatch(/^type: recipe$/m);
|
|
161
|
-
expect(content).toMatch(/^symptom-context: "login flow"$/m);
|
|
162
|
-
expect(content).toMatch(/^recipe: ".+"$/m);
|
|
163
|
-
expect(content).toMatch(/^tools-touched: \[/m);
|
|
164
|
-
expect(content).toMatch(/^retry-count-saved: 3$/m);
|
|
165
|
-
expect(content).toMatch(/^created: \d{4}-\d{2}-\d{2}$/m);
|
|
166
|
-
expect(content).toMatch(/^source-run: "2026-05-07T10:00:00\.000Z"$/m);
|
|
167
|
-
expect(content).toMatch(/^confidence: low$/m);
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
it('파일명이 timestamp slug 포함', () => {
|
|
171
|
-
makeQualifyingRun();
|
|
172
|
-
runExtractor(projectDir);
|
|
173
|
-
const [filename] = listRecipes(projectDir);
|
|
174
|
-
expect(filename).toMatch(/^login-flow__\d{8}-\d{6}\.md$/);
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
it('feature 누락 시 anon slug', () => {
|
|
178
|
-
const records = Array.from({ length: 8 }, (_, i) => makeRecord({
|
|
179
|
-
ok: i < 3 ? false : true,
|
|
180
|
-
category: i < 3 ? 'integration' : null,
|
|
181
|
-
}));
|
|
182
|
-
writeJsonl(projectDir, records);
|
|
183
|
-
writeRunMeta(projectDir, { feature: null });
|
|
184
|
-
runExtractor(projectDir);
|
|
185
|
-
const [filename] = listRecipes(projectDir);
|
|
186
|
-
expect(filename).toMatch(/^anon__/);
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
// ───────── 안전성 ─────────
|
|
191
|
-
describe('silent fail 정책', () => {
|
|
192
|
-
it('jsonl 없음 → exit 0, 파일 생성 안 함', () => {
|
|
193
|
-
const r = runExtractor(projectDir);
|
|
194
|
-
expect(r.status).toBe(0);
|
|
195
|
-
expect(listRecipes(projectDir)).toHaveLength(0);
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
it('빈 jsonl → exit 0, 생성 안 함', () => {
|
|
199
|
-
writeJsonl(projectDir, []);
|
|
200
|
-
const r = runExtractor(projectDir);
|
|
201
|
-
expect(r.status).toBe(0);
|
|
202
|
-
expect(listRecipes(projectDir)).toHaveLength(0);
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
it('VIBE_HOOK_DEPTH≥1 → 재귀 가드, 생성 안 함', () => {
|
|
206
|
-
const records = [
|
|
207
|
-
...Array.from({ length: 5 }, () => makeRecord({ ok: false, category: 'integration' })),
|
|
208
|
-
makeRecord({ ok: true }), makeRecord({ ok: true }), makeRecord({ ok: true }),
|
|
209
|
-
];
|
|
210
|
-
writeJsonl(projectDir, records);
|
|
211
|
-
writeRunMeta(projectDir, { feature: 'x' });
|
|
212
|
-
|
|
213
|
-
const r = spawnSync('node', [SCRIPT], {
|
|
214
|
-
encoding: 'utf-8',
|
|
215
|
-
timeout: 5000,
|
|
216
|
-
env: {
|
|
217
|
-
...process.env,
|
|
218
|
-
CLAUDE_PROJECT_DIR: projectDir,
|
|
219
|
-
VIBE_RECIPE_LLM: 'mock',
|
|
220
|
-
VIBE_HOOK_DEPTH: '1',
|
|
221
|
-
},
|
|
222
|
-
});
|
|
223
|
-
expect(r.status).toBe(0);
|
|
224
|
-
expect(listRecipes(projectDir)).toHaveLength(0);
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
it('손상된 jsonl 라인은 무시', () => {
|
|
228
|
-
const dir = path.join(projectDir, '.vibe', 'metrics');
|
|
229
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
230
|
-
// 일부 라인 손상 + 8개 정상
|
|
231
|
-
const good = Array.from({ length: 8 }, (_, i) => JSON.stringify(makeRecord({
|
|
232
|
-
ok: i < 3 ? false : true,
|
|
233
|
-
category: i < 3 ? 'integration' : null,
|
|
234
|
-
})));
|
|
235
|
-
const lines = ['{ broken', ...good].join('\n') + '\n';
|
|
236
|
-
fs.writeFileSync(path.join(dir, 'current-run.jsonl'), lines);
|
|
237
|
-
writeRunMeta(projectDir, { feature: 'x' });
|
|
238
|
-
|
|
239
|
-
const r = runExtractor(projectDir);
|
|
240
|
-
expect(r.status).toBe(0);
|
|
241
|
-
expect(listRecipes(projectDir)).toHaveLength(1);
|
|
242
|
-
});
|
|
243
|
-
});
|
|
244
|
-
});
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* run-ledger verifyRequired 확장 테스트
|
|
3
|
-
*
|
|
4
|
-
* 검증 대상:
|
|
5
|
-
* - recordVerifyRequired: verifyRequired=true, reason 설정
|
|
6
|
-
* - recordVerify(pass) → verifyRequired 클리어
|
|
7
|
-
* - recordVerify(fail) → verifyRequired 유지
|
|
8
|
-
* - auto-commit 게이트: verifyRequired=true 시 skip
|
|
9
|
-
*/
|
|
10
|
-
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
11
|
-
import { fileURLToPath } from 'url';
|
|
12
|
-
import path from 'path';
|
|
13
|
-
import fs from 'fs';
|
|
14
|
-
import os from 'os';
|
|
15
|
-
|
|
16
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
17
|
-
|
|
18
|
-
let tmpDir;
|
|
19
|
-
beforeEach(() => {
|
|
20
|
-
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'vibe-verify-required-'));
|
|
21
|
-
});
|
|
22
|
-
afterEach(() => {
|
|
23
|
-
try { fs.rmSync(tmpDir, { recursive: true, force: true }); } catch { /* ignore */ }
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
async function importLedger() {
|
|
27
|
-
const ledgerPath = path.resolve(__dirname, '..', 'lib', 'run-ledger.js');
|
|
28
|
-
return import(ledgerPath);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
describe('run-ledger: verifyRequired', () => {
|
|
32
|
-
it('초기 상태: verifyRequired 없음', async () => {
|
|
33
|
-
const { recordRunStart, readLedger } = await importLedger();
|
|
34
|
-
recordRunStart(tmpDir, 'feat');
|
|
35
|
-
const ledger = readLedger(tmpDir);
|
|
36
|
-
// verifyRequired는 undefined 또는 false여야 함
|
|
37
|
-
expect(ledger.verifyRequired).toBeFalsy();
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it('recordVerifyRequired → verifyRequired=true, reason 설정', async () => {
|
|
41
|
-
const { recordRunStart, recordVerifyRequired, readLedger } = await importLedger();
|
|
42
|
-
recordRunStart(tmpDir, 'feat');
|
|
43
|
-
recordVerifyRequired(tmpDir, 'P1 any-type line 5');
|
|
44
|
-
const ledger = readLedger(tmpDir);
|
|
45
|
-
expect(ledger.verifyRequired).toBe(true);
|
|
46
|
-
expect(ledger.verifyRequiredReason).toBe('P1 any-type line 5');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('recordVerify(pass) → verifyRequired 클리어', async () => {
|
|
50
|
-
const { recordRunStart, recordVerifyRequired, recordVerify, readLedger } = await importLedger();
|
|
51
|
-
recordRunStart(tmpDir, 'feat');
|
|
52
|
-
recordVerifyRequired(tmpDir, 'P1 console.log found');
|
|
53
|
-
const started = readLedger(tmpDir);
|
|
54
|
-
recordVerify(tmpDir, true, {
|
|
55
|
-
runId: started.runId,
|
|
56
|
-
verificationResults: [{ command: 'npm test', exitCode: 0 }],
|
|
57
|
-
});
|
|
58
|
-
const ledger = readLedger(tmpDir);
|
|
59
|
-
expect(ledger.verifyRequired).toBe(false);
|
|
60
|
-
expect(ledger.verifyRequiredReason).toBeNull();
|
|
61
|
-
expect(ledger.verifyPassed).toBe(true);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it('recordVerify(fail) → verifyRequired 유지됨', async () => {
|
|
65
|
-
const { recordRunStart, recordVerifyRequired, recordVerify, readLedger } = await importLedger();
|
|
66
|
-
recordRunStart(tmpDir, 'feat');
|
|
67
|
-
recordVerifyRequired(tmpDir, 'P1 issue');
|
|
68
|
-
const started = readLedger(tmpDir);
|
|
69
|
-
recordVerify(tmpDir, false, { runId: started.runId, verificationResults: [] });
|
|
70
|
-
const ledger = readLedger(tmpDir);
|
|
71
|
-
// fail 시 verifyRequired는 유지되어야 함
|
|
72
|
-
expect(ledger.verifyRequired).toBe(true);
|
|
73
|
-
expect(ledger.verifyPassed).toBe(false);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it('reason 없이 recordVerifyRequired → 기본 reason 설정', async () => {
|
|
77
|
-
const { recordRunStart, recordVerifyRequired, readLedger } = await importLedger();
|
|
78
|
-
recordRunStart(tmpDir, 'feat');
|
|
79
|
-
recordVerifyRequired(tmpDir, '');
|
|
80
|
-
const ledger = readLedger(tmpDir);
|
|
81
|
-
expect(ledger.verifyRequired).toBe(true);
|
|
82
|
-
expect(typeof ledger.verifyRequiredReason).toBe('string');
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it('recordVerifyRequired fail-open (레저 없이도 작동)', async () => {
|
|
86
|
-
const { recordVerifyRequired, readLedger } = await importLedger();
|
|
87
|
-
// runStart 없이 호출
|
|
88
|
-
recordVerifyRequired(tmpDir, 'standalone P1');
|
|
89
|
-
const ledger = readLedger(tmpDir);
|
|
90
|
-
expect(ledger.verifyRequired).toBe(true);
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
describe('auto-commit: verifyRequired 게이트 로직', () => {
|
|
95
|
-
function autoCommitGatePass(ledger) {
|
|
96
|
-
if (!ledger) return true;
|
|
97
|
-
|
|
98
|
-
// verify 게이트 (기존)
|
|
99
|
-
if (ledger.runStarted) {
|
|
100
|
-
const verifyOk = ledger.verifyPassed === true
|
|
101
|
-
&& ledger.verifyAt
|
|
102
|
-
&& ledger.verifyAt > ledger.runStarted;
|
|
103
|
-
if (!verifyOk) return false;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// verifyRequired 게이트 (신규)
|
|
107
|
-
if (ledger.verifyRequired === true) return false;
|
|
108
|
-
|
|
109
|
-
return true;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
it('verifyRequired=true → 차단', () => {
|
|
113
|
-
expect(autoCommitGatePass({
|
|
114
|
-
runStarted: null,
|
|
115
|
-
verifyRequired: true,
|
|
116
|
-
verifyRequiredReason: 'P1 any-type',
|
|
117
|
-
})).toBe(false);
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
it('verifyRequired=false → 통과 (verifyRequired만 확인 시)', () => {
|
|
121
|
-
expect(autoCommitGatePass({
|
|
122
|
-
runStarted: null,
|
|
123
|
-
verifyRequired: false,
|
|
124
|
-
})).toBe(true);
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
it('verifyRequired=undefined → 통과 (기존 레저 호환)', () => {
|
|
128
|
-
expect(autoCommitGatePass({
|
|
129
|
-
runStarted: null,
|
|
130
|
-
verifyRequired: undefined,
|
|
131
|
-
})).toBe(true);
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
it('runStarted + verifyPassed + verifyRequired=true → 차단 (verifyRequired 우선)', () => {
|
|
135
|
-
expect(autoCommitGatePass({
|
|
136
|
-
runStarted: '2026-01-01T10:00:00.000Z',
|
|
137
|
-
verifyPassed: true,
|
|
138
|
-
verifyAt: '2026-01-01T10:05:00.000Z',
|
|
139
|
-
verifyRequired: true,
|
|
140
|
-
})).toBe(false);
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
it('runStarted + verifyPassed + verifyRequired=false → 통과', () => {
|
|
144
|
-
expect(autoCommitGatePass({
|
|
145
|
-
runStarted: '2026-01-01T10:00:00.000Z',
|
|
146
|
-
verifyPassed: true,
|
|
147
|
-
verifyAt: '2026-01-01T10:05:00.000Z',
|
|
148
|
-
verifyRequired: false,
|
|
149
|
-
})).toBe(true);
|
|
150
|
-
});
|
|
151
|
-
});
|