spectra-cli 4.2.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -5
- package/dist/.spectra-build-meta.json +9 -0
- package/dist/adapters/language-adapter.d.ts +7 -12
- package/dist/adapters/language-adapter.d.ts.map +1 -1
- package/dist/adapters/python-adapter.d.ts.map +1 -1
- package/dist/adapters/python-adapter.js +11 -2
- package/dist/adapters/python-adapter.js.map +1 -1
- package/dist/batch/batch-orchestrator.d.ts +44 -1
- package/dist/batch/batch-orchestrator.d.ts.map +1 -1
- package/dist/batch/batch-orchestrator.js +312 -76
- package/dist/batch/batch-orchestrator.js.map +1 -1
- package/dist/batch/delta-regenerator.d.ts.map +1 -1
- package/dist/batch/delta-regenerator.js +21 -28
- package/dist/batch/delta-regenerator.js.map +1 -1
- package/dist/batch/module-grouper.d.ts +7 -0
- package/dist/batch/module-grouper.d.ts.map +1 -1
- package/dist/batch/module-grouper.js +2 -0
- package/dist/batch/module-grouper.js.map +1 -1
- package/dist/batch/regen-plan.d.ts +78 -0
- package/dist/batch/regen-plan.d.ts.map +1 -0
- package/dist/batch/regen-plan.js +93 -0
- package/dist/batch/regen-plan.js.map +1 -0
- package/dist/cli/commands/batch.d.ts.map +1 -1
- package/dist/cli/commands/batch.js +36 -8
- package/dist/cli/commands/batch.js.map +1 -1
- package/dist/cli/commands/scaffold-kb.d.ts +9 -0
- package/dist/cli/commands/scaffold-kb.d.ts.map +1 -0
- package/dist/cli/commands/scaffold-kb.js +179 -0
- package/dist/cli/commands/scaffold-kb.js.map +1 -0
- package/dist/cli/index.js +24 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/utils/error-handler.d.ts +0 -6
- package/dist/cli/utils/error-handler.d.ts.map +1 -1
- package/dist/cli/utils/error-handler.js +0 -13
- package/dist/cli/utils/error-handler.js.map +1 -1
- package/dist/cli/utils/parse-args.d.ts +43 -3
- package/dist/cli/utils/parse-args.d.ts.map +1 -1
- package/dist/cli/utils/parse-args.js +98 -12
- package/dist/cli/utils/parse-args.js.map +1 -1
- package/dist/cli/version-meta.d.ts +16 -0
- package/dist/cli/version-meta.d.ts.map +1 -0
- package/dist/cli/version-meta.js +28 -0
- package/dist/cli/version-meta.js.map +1 -0
- package/dist/core/ast-analyzer.d.ts.map +1 -1
- package/dist/core/ast-analyzer.js +7 -11
- package/dist/core/ast-analyzer.js.map +1 -1
- package/dist/core/import-resolver.d.ts +70 -67
- package/dist/core/import-resolver.d.ts.map +1 -1
- package/dist/core/import-resolver.js +341 -200
- package/dist/core/import-resolver.js.map +1 -1
- package/dist/core/single-spec-orchestrator.d.ts +21 -0
- package/dist/core/single-spec-orchestrator.d.ts.map +1 -1
- package/dist/core/single-spec-orchestrator.js +41 -14
- package/dist/core/single-spec-orchestrator.js.map +1 -1
- package/dist/core/skeleton-hash.d.ts +33 -0
- package/dist/core/skeleton-hash.d.ts.map +1 -0
- package/dist/core/skeleton-hash.js +76 -0
- package/dist/core/skeleton-hash.js.map +1 -0
- package/dist/core/tree-sitter-analyzer.d.ts +3 -2
- package/dist/core/tree-sitter-analyzer.d.ts.map +1 -1
- package/dist/core/tree-sitter-analyzer.js +5 -6
- package/dist/core/tree-sitter-analyzer.js.map +1 -1
- package/dist/core/tree-sitter-fallback.d.ts +7 -2
- package/dist/core/tree-sitter-fallback.d.ts.map +1 -1
- package/dist/core/tree-sitter-fallback.js +18 -15
- package/dist/core/tree-sitter-fallback.js.map +1 -1
- package/dist/extraction/image-extractor.d.ts.map +1 -1
- package/dist/extraction/image-extractor.js +3 -1
- package/dist/extraction/image-extractor.js.map +1 -1
- package/dist/extraction/markdown-extractor.d.ts.map +1 -1
- package/dist/extraction/markdown-extractor.js +3 -1
- package/dist/extraction/markdown-extractor.js.map +1 -1
- package/dist/generator/frontmatter.d.ts +5 -0
- package/dist/generator/frontmatter.d.ts.map +1 -1
- package/dist/generator/frontmatter.js +4 -0
- package/dist/generator/frontmatter.js.map +1 -1
- package/dist/kb-mcp/index.d.ts +14 -0
- package/dist/kb-mcp/index.d.ts.map +1 -0
- package/dist/kb-mcp/index.js +24 -0
- package/dist/kb-mcp/index.js.map +1 -0
- package/dist/kb-mcp/lib/kb-error.d.ts +21 -0
- package/dist/kb-mcp/lib/kb-error.d.ts.map +1 -0
- package/dist/kb-mcp/lib/kb-error.js +28 -0
- package/dist/kb-mcp/lib/kb-error.js.map +1 -0
- package/dist/kb-mcp/lib/kb-locator.d.ts +58 -0
- package/dist/kb-mcp/lib/kb-locator.d.ts.map +1 -0
- package/dist/kb-mcp/lib/kb-locator.js +85 -0
- package/dist/kb-mcp/lib/kb-locator.js.map +1 -0
- package/dist/kb-mcp/lib/result-merger.d.ts +35 -0
- package/dist/kb-mcp/lib/result-merger.d.ts.map +1 -0
- package/dist/kb-mcp/lib/result-merger.js +64 -0
- package/dist/kb-mcp/lib/result-merger.js.map +1 -0
- package/dist/kb-mcp/server.d.ts +12 -0
- package/dist/kb-mcp/server.d.ts.map +1 -0
- package/dist/kb-mcp/server.js +29 -0
- package/dist/kb-mcp/server.js.map +1 -0
- package/dist/kb-mcp/tools/kb-api-lookup.d.ts +28 -0
- package/dist/kb-mcp/tools/kb-api-lookup.d.ts.map +1 -0
- package/dist/kb-mcp/tools/kb-api-lookup.js +237 -0
- package/dist/kb-mcp/tools/kb-api-lookup.js.map +1 -0
- package/dist/kb-mcp/tools/kb-doc-lookup.d.ts +20 -0
- package/dist/kb-mcp/tools/kb-doc-lookup.d.ts.map +1 -0
- package/dist/kb-mcp/tools/kb-doc-lookup.js +92 -0
- package/dist/kb-mcp/tools/kb-doc-lookup.js.map +1 -0
- package/dist/kb-mcp/tools/kb-search.d.ts +23 -0
- package/dist/kb-mcp/tools/kb-search.d.ts.map +1 -0
- package/dist/kb-mcp/tools/kb-search.js +126 -0
- package/dist/kb-mcp/tools/kb-search.js.map +1 -0
- package/dist/knowledge-graph/import-resolver.d.ts +11 -86
- package/dist/knowledge-graph/import-resolver.d.ts.map +1 -1
- package/dist/knowledge-graph/import-resolver.js +10 -333
- package/dist/knowledge-graph/import-resolver.js.map +1 -1
- package/dist/knowledge-graph/incremental.d.ts +25 -4
- package/dist/knowledge-graph/incremental.d.ts.map +1 -1
- package/dist/knowledge-graph/incremental.js +37 -15
- package/dist/knowledge-graph/incremental.js.map +1 -1
- package/dist/knowledge-graph/index.d.ts +11 -0
- package/dist/knowledge-graph/index.d.ts.map +1 -1
- package/dist/knowledge-graph/index.js +43 -1
- package/dist/knowledge-graph/index.js.map +1 -1
- package/dist/knowledge-graph/module-derivation.d.ts +14 -0
- package/dist/knowledge-graph/module-derivation.d.ts.map +1 -1
- package/dist/knowledge-graph/module-derivation.js +44 -44
- package/dist/knowledge-graph/module-derivation.js.map +1 -1
- package/dist/knowledge-graph/persistence.d.ts +56 -16
- package/dist/knowledge-graph/persistence.d.ts.map +1 -1
- package/dist/knowledge-graph/persistence.js +86 -32
- package/dist/knowledge-graph/persistence.js.map +1 -1
- package/dist/knowledge-graph/query-helpers.d.ts +39 -12
- package/dist/knowledge-graph/query-helpers.d.ts.map +1 -1
- package/dist/knowledge-graph/query-helpers.js +199 -34
- package/dist/knowledge-graph/query-helpers.js.map +1 -1
- package/dist/knowledge-graph/relativize.d.ts +51 -0
- package/dist/knowledge-graph/relativize.d.ts.map +1 -0
- package/dist/knowledge-graph/relativize.js +104 -0
- package/dist/knowledge-graph/relativize.js.map +1 -0
- package/dist/mcp/agent-context-tools.d.ts +3 -54
- package/dist/mcp/agent-context-tools.d.ts.map +1 -1
- package/dist/mcp/agent-context-tools.js +141 -189
- package/dist/mcp/agent-context-tools.js.map +1 -1
- package/dist/mcp/file-nav-tools.d.ts +42 -0
- package/dist/mcp/file-nav-tools.d.ts.map +1 -0
- package/dist/mcp/file-nav-tools.js +318 -0
- package/dist/mcp/file-nav-tools.js.map +1 -0
- package/dist/mcp/graph-tools.d.ts +2 -0
- package/dist/mcp/graph-tools.d.ts.map +1 -1
- package/dist/mcp/graph-tools.js +134 -123
- package/dist/mcp/graph-tools.js.map +1 -1
- package/dist/mcp/lib/file-nav-helpers.d.ts +128 -0
- package/dist/mcp/lib/file-nav-helpers.d.ts.map +1 -0
- package/dist/mcp/lib/file-nav-helpers.js +305 -0
- package/dist/mcp/lib/file-nav-helpers.js.map +1 -0
- package/dist/mcp/lib/telemetry.d.ts +69 -0
- package/dist/mcp/lib/telemetry.d.ts.map +1 -0
- package/dist/mcp/lib/telemetry.js +113 -0
- package/dist/mcp/lib/telemetry.js.map +1 -0
- package/dist/mcp/lib/tool-response.d.ts +46 -0
- package/dist/mcp/lib/tool-response.d.ts.map +1 -0
- package/dist/mcp/lib/tool-response.js +83 -0
- package/dist/mcp/lib/tool-response.js.map +1 -0
- package/dist/mcp/server.d.ts +13 -2
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +209 -150
- package/dist/mcp/server.js.map +1 -1
- package/dist/models/code-skeleton.d.ts +4 -2
- package/dist/models/code-skeleton.d.ts.map +1 -1
- package/dist/models/code-skeleton.js +2 -1
- package/dist/models/code-skeleton.js.map +1 -1
- package/dist/models/module-spec.d.ts +18 -0
- package/dist/models/module-spec.d.ts.map +1 -1
- package/dist/models/module-spec.js +6 -0
- package/dist/models/module-spec.js.map +1 -1
- package/dist/panoramic/builders/doc-graph-builder.d.ts +13 -0
- package/dist/panoramic/builders/doc-graph-builder.d.ts.map +1 -1
- package/dist/panoramic/builders/doc-graph-builder.js +20 -0
- package/dist/panoramic/builders/doc-graph-builder.js.map +1 -1
- package/dist/panoramic/graph/graph-builder.d.ts +72 -2
- package/dist/panoramic/graph/graph-builder.d.ts.map +1 -1
- package/dist/panoramic/graph/graph-builder.js +257 -51
- package/dist/panoramic/graph/graph-builder.js.map +1 -1
- package/dist/panoramic/graph/graph-query.d.ts +16 -0
- package/dist/panoramic/graph/graph-query.d.ts.map +1 -1
- package/dist/panoramic/graph/graph-query.js +49 -1
- package/dist/panoramic/graph/graph-query.js.map +1 -1
- package/dist/panoramic/graph/index.d.ts +2 -1
- package/dist/panoramic/graph/index.d.ts.map +1 -1
- package/dist/panoramic/graph/index.js +1 -1
- package/dist/panoramic/graph/index.js.map +1 -1
- package/dist/panoramic/pipelines/adr-evidence-verifier.d.ts.map +1 -1
- package/dist/panoramic/pipelines/adr-evidence-verifier.js +1 -29
- package/dist/panoramic/pipelines/adr-evidence-verifier.js.map +1 -1
- package/dist/panoramic/query.d.ts +1 -0
- package/dist/panoramic/query.d.ts.map +1 -1
- package/dist/panoramic/query.js +5 -0
- package/dist/panoramic/query.js.map +1 -1
- package/dist/scaffold-kb/api-entities-serializer.d.ts +12 -0
- package/dist/scaffold-kb/api-entities-serializer.d.ts.map +1 -0
- package/dist/scaffold-kb/api-entities-serializer.js +144 -0
- package/dist/scaffold-kb/api-entities-serializer.js.map +1 -0
- package/dist/scaffold-kb/arbitration.d.ts +44 -0
- package/dist/scaffold-kb/arbitration.d.ts.map +1 -0
- package/dist/scaffold-kb/arbitration.js +144 -0
- package/dist/scaffold-kb/arbitration.js.map +1 -0
- package/dist/scaffold-kb/chunk-splitter.d.ts +20 -0
- package/dist/scaffold-kb/chunk-splitter.d.ts.map +1 -0
- package/dist/scaffold-kb/chunk-splitter.js +309 -0
- package/dist/scaffold-kb/chunk-splitter.js.map +1 -0
- package/dist/scaffold-kb/doc-graph-builder.d.ts +26 -0
- package/dist/scaffold-kb/doc-graph-builder.d.ts.map +1 -0
- package/dist/scaffold-kb/doc-graph-builder.js +72 -0
- package/dist/scaffold-kb/doc-graph-builder.js.map +1 -0
- package/dist/scaffold-kb/entity-extractor.d.ts +40 -0
- package/dist/scaffold-kb/entity-extractor.d.ts.map +1 -0
- package/dist/scaffold-kb/entity-extractor.js +0 -0
- package/dist/scaffold-kb/entity-extractor.js.map +1 -0
- package/dist/scaffold-kb/entity-heuristic.d.ts +14 -0
- package/dist/scaffold-kb/entity-heuristic.d.ts.map +1 -0
- package/dist/scaffold-kb/entity-heuristic.js +107 -0
- package/dist/scaffold-kb/entity-heuristic.js.map +1 -0
- package/dist/scaffold-kb/entity-matcher.d.ts +20 -0
- package/dist/scaffold-kb/entity-matcher.d.ts.map +1 -0
- package/dist/scaffold-kb/entity-matcher.js +53 -0
- package/dist/scaffold-kb/entity-matcher.js.map +1 -0
- package/dist/scaffold-kb/entity-util.d.ts +11 -0
- package/dist/scaffold-kb/entity-util.d.ts.map +1 -0
- package/dist/scaffold-kb/entity-util.js +23 -0
- package/dist/scaffold-kb/entity-util.js.map +1 -0
- package/dist/scaffold-kb/evidence-envelope.d.ts +17 -0
- package/dist/scaffold-kb/evidence-envelope.d.ts.map +1 -0
- package/dist/scaffold-kb/evidence-envelope.js +32 -0
- package/dist/scaffold-kb/evidence-envelope.js.map +1 -0
- package/dist/scaffold-kb/index.d.ts +20 -0
- package/dist/scaffold-kb/index.d.ts.map +1 -0
- package/dist/scaffold-kb/index.js +102 -0
- package/dist/scaffold-kb/index.js.map +1 -0
- package/dist/scaffold-kb/ingest/ingest-core.d.ts +47 -0
- package/dist/scaffold-kb/ingest/ingest-core.d.ts.map +1 -0
- package/dist/scaffold-kb/ingest/ingest-core.js +231 -0
- package/dist/scaffold-kb/ingest/ingest-core.js.map +1 -0
- package/dist/scaffold-kb/ingest/office-parser.d.ts +33 -0
- package/dist/scaffold-kb/ingest/office-parser.d.ts.map +1 -0
- package/dist/scaffold-kb/ingest/office-parser.js +187 -0
- package/dist/scaffold-kb/ingest/office-parser.js.map +1 -0
- package/dist/scaffold-kb/ingest/url-fetcher.d.ts +43 -0
- package/dist/scaffold-kb/ingest/url-fetcher.d.ts.map +1 -0
- package/dist/scaffold-kb/ingest/url-fetcher.js +245 -0
- package/dist/scaffold-kb/ingest/url-fetcher.js.map +1 -0
- package/dist/scaffold-kb/ingester.d.ts +38 -0
- package/dist/scaffold-kb/ingester.d.ts.map +1 -0
- package/dist/scaffold-kb/ingester.js +261 -0
- package/dist/scaffold-kb/ingester.js.map +1 -0
- package/dist/scaffold-kb/injection-format.d.ts +25 -0
- package/dist/scaffold-kb/injection-format.d.ts.map +1 -0
- package/dist/scaffold-kb/injection-format.js +55 -0
- package/dist/scaffold-kb/injection-format.js.map +1 -0
- package/dist/scaffold-kb/kb-writer.d.ts +13 -0
- package/dist/scaffold-kb/kb-writer.d.ts.map +1 -0
- package/dist/scaffold-kb/kb-writer.js +69 -0
- package/dist/scaffold-kb/kb-writer.js.map +1 -0
- package/dist/scaffold-kb/keyword-extract.d.ts +16 -0
- package/dist/scaffold-kb/keyword-extract.d.ts.map +1 -0
- package/dist/scaffold-kb/keyword-extract.js +49 -0
- package/dist/scaffold-kb/keyword-extract.js.map +1 -0
- package/dist/scaffold-kb/query-sanitizer.d.ts +28 -0
- package/dist/scaffold-kb/query-sanitizer.d.ts.map +1 -0
- package/dist/scaffold-kb/query-sanitizer.js +38 -0
- package/dist/scaffold-kb/query-sanitizer.js.map +1 -0
- package/dist/scaffold-kb/recall-eval.d.ts +48 -0
- package/dist/scaffold-kb/recall-eval.d.ts.map +1 -0
- package/dist/scaffold-kb/recall-eval.js +55 -0
- package/dist/scaffold-kb/recall-eval.js.map +1 -0
- package/dist/scaffold-kb/schema-compat.d.ts +22 -0
- package/dist/scaffold-kb/schema-compat.d.ts.map +1 -0
- package/dist/scaffold-kb/schema-compat.js +32 -0
- package/dist/scaffold-kb/schema-compat.js.map +1 -0
- package/dist/scaffold-kb/search-core.d.ts +42 -0
- package/dist/scaffold-kb/search-core.d.ts.map +1 -0
- package/dist/scaffold-kb/search-core.js +89 -0
- package/dist/scaffold-kb/search-core.js.map +1 -0
- package/dist/scaffold-kb/sqlite-engine.d.ts +58 -0
- package/dist/scaffold-kb/sqlite-engine.d.ts.map +1 -0
- package/dist/scaffold-kb/sqlite-engine.js +61 -0
- package/dist/scaffold-kb/sqlite-engine.js.map +1 -0
- package/dist/scaffold-kb/sqlite-writer.d.ts +18 -0
- package/dist/scaffold-kb/sqlite-writer.d.ts.map +1 -0
- package/dist/scaffold-kb/sqlite-writer.js +76 -0
- package/dist/scaffold-kb/sqlite-writer.js.map +1 -0
- package/dist/scaffold-kb/tokenizer.d.ts +26 -0
- package/dist/scaffold-kb/tokenizer.d.ts.map +1 -0
- package/dist/scaffold-kb/tokenizer.js +97 -0
- package/dist/scaffold-kb/tokenizer.js.map +1 -0
- package/dist/scaffold-kb/types.d.ts +157 -0
- package/dist/scaffold-kb/types.d.ts.map +1 -0
- package/dist/scaffold-kb/types.js +5 -0
- package/dist/scaffold-kb/types.js.map +1 -0
- package/dist/utils/file-scanner.d.ts +15 -0
- package/dist/utils/file-scanner.d.ts.map +1 -1
- package/dist/utils/file-scanner.js +17 -0
- package/dist/utils/file-scanner.js.map +1 -1
- package/dist/utils/string-distance.d.ts +20 -0
- package/dist/utils/string-distance.d.ts.map +1 -0
- package/dist/utils/string-distance.js +38 -0
- package/dist/utils/string-distance.js.map +1 -0
- package/package.json +11 -2
- package/plugins/demo-kb-en/.claude-plugin/plugin.json +11 -0
- package/plugins/demo-kb-en/.mcp.json +8 -0
- package/plugins/demo-kb-en/FIXTURE.json +23 -0
- package/plugins/demo-kb-en/FIXTURE.md +53 -0
- package/plugins/demo-kb-en/ingest-samples/meeting-notes.md +13 -0
- package/plugins/demo-kb-en/kb/api-entities.json +3445 -0
- package/plugins/demo-kb-en/kb/chunks.sqlite +0 -0
- package/plugins/demo-kb-en/kb/doc-graph.json +113 -0
- package/plugins/demo-kb-zh/.claude-plugin/plugin.json +11 -0
- package/plugins/demo-kb-zh/.mcp.json +8 -0
- package/plugins/demo-kb-zh/FIXTURE.json +23 -0
- package/plugins/demo-kb-zh/FIXTURE.md +63 -0
- package/plugins/demo-kb-zh/ingest-samples/meeting-notes.md +13 -0
- package/plugins/demo-kb-zh/kb/api-entities.json +990 -0
- package/plugins/demo-kb-zh/kb/chunks.sqlite +0 -0
- package/plugins/demo-kb-zh/kb/doc-graph.json +113 -0
- package/plugins/spec-driver/.claude-plugin/plugin.json +1 -1
- package/plugins/spec-driver/README.md +33 -1
- package/plugins/spec-driver/agents/verify.md +88 -0
- package/plugins/spec-driver/config/orchestration.yaml +39 -31
- package/plugins/spec-driver/contracts/orchestration-overrides-contract.yaml +27 -0
- package/plugins/spec-driver/contracts/orchestration-schema.mjs +272 -227
- package/plugins/spec-driver/contracts/wrapper-source-of-truth.yaml +3 -0
- package/plugins/spec-driver/hooks/hooks.json +9 -0
- package/plugins/spec-driver/hooks/stop-fix-compliance-check.sh +36 -0
- package/plugins/spec-driver/lib/delegation-contract.mjs +84 -0
- package/plugins/spec-driver/lib/orchestration-resolver.mjs +49 -0
- package/plugins/spec-driver/lib/orchestrator.mjs +29 -1
- package/plugins/spec-driver/scripts/codex-skills.sh +28 -28
- package/plugins/spec-driver/scripts/dev/spike-fix-compliance-e2e.mjs +130 -0
- package/plugins/spec-driver/scripts/fix-compliance-judge.mjs +415 -0
- package/plugins/spec-driver/scripts/generate-adoption-insights.mjs +48 -1
- package/plugins/spec-driver/scripts/goal-loop-cli.mjs +307 -0
- package/plugins/spec-driver/scripts/init-project.sh +56 -0
- package/plugins/spec-driver/scripts/kb-prequery.mjs +125 -0
- package/plugins/spec-driver/scripts/lib/config-schema.mjs +200 -94
- package/plugins/spec-driver/scripts/lib/ensure-gitignore.sh +277 -0
- package/plugins/spec-driver/scripts/lib/extract-wrapper-body.mjs +136 -0
- package/plugins/spec-driver/scripts/lib/fix-compliance-core.mjs +434 -0
- package/plugins/spec-driver/scripts/lib/fix-compliance-io.mjs +335 -0
- package/plugins/spec-driver/scripts/lib/goal-loop-core.mjs +783 -0
- package/plugins/spec-driver/scripts/lib/init-project-output.sh +28 -0
- package/plugins/spec-driver/scripts/lib/load-zod.mjs +62 -0
- package/plugins/spec-driver/scripts/lib/project-profile-resolver.mjs +141 -49
- package/plugins/spec-driver/scripts/lib/project-profile-schema.mjs +88 -54
- package/plugins/spec-driver/scripts/postinstall.sh +13 -1
- package/plugins/spec-driver/scripts/record-workflow-run.mjs +75 -0
- package/plugins/spec-driver/scripts/sync-delegation-contract.mjs +187 -0
- package/plugins/spec-driver/scripts/validate-orchestrator-models.mjs +156 -0
- package/plugins/spec-driver/scripts/validate-wrapper-sources.mjs +46 -1
- package/plugins/spec-driver/skills/spec-driver-feature/SKILL.md +292 -0
- package/plugins/spec-driver/skills/spec-driver-fix/SKILL.md +87 -8
- package/plugins/spec-driver/skills/spec-driver-implement/SKILL.md +8 -0
- package/plugins/spec-driver/skills/spec-driver-resume/SKILL.md +12 -1
- package/plugins/spec-driver/skills/spec-driver-story/SKILL.md +20 -0
- package/plugins/spec-driver/templates/delegation-contract.md +27 -0
- package/plugins/spec-driver/templates/goal-loop-override-template.yaml +284 -0
- package/plugins/spec-driver/templates/specify-base/project-context-template.yaml +10 -0
- package/plugins/spectra/.claude-plugin/plugin.json +1 -1
- package/plugins/spectra/README.md +1 -1
- package/templates/module-spec.hbs +1 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
# ═══════════════════════════════════════════════════════════════
|
|
2
|
+
# goal_loop golden override 模板(Feature 201,FR-016)
|
|
3
|
+
# ═══════════════════════════════════════════════════════════════
|
|
4
|
+
#
|
|
5
|
+
# 【使用方法】
|
|
6
|
+
# 1. 把本文件**整段内容**复制到项目根的 `.specify/orchestration-overrides.yaml`
|
|
7
|
+
# 2. 该 override 会激活 feature mode implement phase 的 goal_loop 闭环
|
|
8
|
+
# (metric 驱动的 implement→verify 自主迭代,详见 feature SKILL.md「goal_loop 闭环编排」)
|
|
9
|
+
# 3. 验证生效:
|
|
10
|
+
# node plugins/spec-driver/scripts/orchestrator-cli.mjs effective-orchestration feature --annotate
|
|
11
|
+
# 预期:implement phase 的 agent_mode 为 goal_loop。
|
|
12
|
+
# 注意(W6 修正):本模板内容与 base 等价,但因 resolver 对 modes.feature 是**整段替换**语义,
|
|
13
|
+
# 解析后所有 phase 的 source 均标注为 overrides(**非部分继承 base**)——不要误以为只有 implement 一处来自 overrides。
|
|
14
|
+
# 4. goal_loop 预算/迭代参数(max_iterations 等)在 spec-driver.config.yaml 的 goal_loop 段配置。
|
|
15
|
+
#
|
|
16
|
+
# 【goal_loop 命令集完整性校验(F204)】
|
|
17
|
+
# full_required_kinds 声明 full 轮必须出现的命令类别(build/test/lint/check)。缺则 core
|
|
18
|
+
# decideStop 返回 INCOMPLETE_FULL_VERIFY、止步 GATE_VERIFY,不 REACHED_GOAL。
|
|
19
|
+
# 默认 [](跳过校验);推荐配置如下(适用于大多数 TypeScript 项目,写入 spec-driver.config.yaml):
|
|
20
|
+
#
|
|
21
|
+
# goal_loop:
|
|
22
|
+
# full_required_kinds:
|
|
23
|
+
# - build
|
|
24
|
+
# - test
|
|
25
|
+
# - lint
|
|
26
|
+
# - check
|
|
27
|
+
#
|
|
28
|
+
# 注意:verify 子代理必须在 layer2_commands 每条命令上标注 kind 字段,否则即使 kind 实际覆盖,
|
|
29
|
+
# 校验也会视为缺失(漏标 kind = 不贡献 = 视为缺失)。
|
|
30
|
+
# 注意:本仓库 simple-yaml parser 只认 block-sequence(每行 - item),不认 inline flow ['a','b']。
|
|
31
|
+
#
|
|
32
|
+
# 【激活边界(W7)】
|
|
33
|
+
# 本模板仅声明 implement phase 的 agent_mode=goal_loop **标签**;goal_loop 的 runtime dispatch
|
|
34
|
+
# 分支(实际的 implement→verify 自主迭代闭环)在 feature SKILL.md(Feature 201 Phase B/C 实现)。
|
|
35
|
+
# 在 Phase B/C 落地前,复制本模板只改变 effective config 的标签,不会触发闭环行为。
|
|
36
|
+
#
|
|
37
|
+
# 【整段替换语义(重要)】
|
|
38
|
+
# resolver 对 modes.<mode> 是**整段替换**、**不继承 base**(见 orchestration-resolver.mjs)。
|
|
39
|
+
# 因此本模板必须携带 feature mode 的**完整 phase 列表**(与 base orchestration.yaml 逐字段一致),
|
|
40
|
+
# 仅把 implement phase(id="6")的 agent_mode 从 single 改为 goal_loop。
|
|
41
|
+
# 若删减任何 phase,feature 编排会缺步骤;若改动其他字段,会偏离 base 行为。
|
|
42
|
+
#
|
|
43
|
+
# 【漂移风险(FR-016 诚实标注)】
|
|
44
|
+
# 整段替换是 MVP 折中:当 base orchestration.yaml 的 feature phase 序列未来变更时,
|
|
45
|
+
# 已复制的本 override 会**静默漂移**(仍跑旧 phase 序列)。两道防线:
|
|
46
|
+
# - 本模板携带 version 字段(须与 base orchestration.yaml 的 version 一致);
|
|
47
|
+
# version 不一致时 resolver 发出 orchestration-overrides.version-mismatch warning 并降级回 base。
|
|
48
|
+
# - CI 测试(T-GL-03b)直接 parse **本模板文件本体**,断言除 implement.agent_mode 外与 base
|
|
49
|
+
# 逐字段等价;base 改了而本模板没跟会失败(守护模板本体,非仅守护测试 fixture)。
|
|
50
|
+
# phase 序列单源化(消除整段替换漂移)留后续 milestone(spec Out of Scope #2)。
|
|
51
|
+
# base feature phase 序列变更后,请重新依据最新 base 生成本模板(或运行 generate-template feature 后改 implement)。
|
|
52
|
+
#
|
|
53
|
+
# 【reward hacking 残留风险声明(FR-023)】
|
|
54
|
+
# goal_loop 的职责分离(独立 verify 子代理实跑命令、不接受 implement 自报达标)堵死了
|
|
55
|
+
# "implement 自证达标"通道,但**无法阻止 implement 子代理篡改测试本身使其 trivially 变绿**
|
|
56
|
+
# (测试过拟合 / 长程局部最优)。这是诚实记录的残留风险,缓解依赖:
|
|
57
|
+
# - GATE_VERIFY(always / critical)人工终局收口(每次都看到完整迭代日志和最终改动)
|
|
58
|
+
# - Layer 1.5 证据状态(COMPLIANT 要求实际执行证据)
|
|
59
|
+
# - Codex 对抗审查(每 phase commit 前运行)
|
|
60
|
+
# GATE_IMPLEMENT_MID 默认 on_failure / non_critical(仅 implement mode),goal_loop 不把它
|
|
61
|
+
# 当作护栏;如未来要依赖它须在 override 中显式升级为 always / critical,否则不得当强护栏宣称。
|
|
62
|
+
#
|
|
63
|
+
# version 必须与 base orchestration.yaml 的 version 一致(当前 base = "1.0")
|
|
64
|
+
version: "1.0"
|
|
65
|
+
|
|
66
|
+
modes:
|
|
67
|
+
feature:
|
|
68
|
+
name: "Spec-Driven Development(完整 10 阶段)"
|
|
69
|
+
description: "包含完整的调研、规范、规划、实现、验证流程"
|
|
70
|
+
phases:
|
|
71
|
+
# Phase 0: 宪法检查
|
|
72
|
+
- id: "0"
|
|
73
|
+
name: constitution_check
|
|
74
|
+
display_name: 项目宪法检查
|
|
75
|
+
agent: null
|
|
76
|
+
agent_mode: inline
|
|
77
|
+
gates_before: null
|
|
78
|
+
gates_after: null
|
|
79
|
+
conditional: null
|
|
80
|
+
skip_if_exists: null
|
|
81
|
+
is_critical: false
|
|
82
|
+
|
|
83
|
+
# Phase 0.5: 调研模式确定
|
|
84
|
+
- id: "0.5"
|
|
85
|
+
name: research_mode_determination
|
|
86
|
+
display_name: 调研模式确定
|
|
87
|
+
agent: null
|
|
88
|
+
agent_mode: inline
|
|
89
|
+
gates_before: null
|
|
90
|
+
gates_after: null
|
|
91
|
+
conditional: null
|
|
92
|
+
skip_if_exists: null
|
|
93
|
+
is_critical: false
|
|
94
|
+
|
|
95
|
+
# Phase 1a: 产品调研(RESEARCH_GROUP 成员)
|
|
96
|
+
- id: "1a"
|
|
97
|
+
name: product_research
|
|
98
|
+
display_name: 产品调研
|
|
99
|
+
agent: product-research
|
|
100
|
+
agent_mode: single
|
|
101
|
+
gates_before: null
|
|
102
|
+
gates_after: null
|
|
103
|
+
conditional: "research_mode in [full, product-only]"
|
|
104
|
+
skip_if_exists: "research/product-research.md"
|
|
105
|
+
is_critical: false
|
|
106
|
+
|
|
107
|
+
# Phase 1b: 技术调研(RESEARCH_GROUP 成员)
|
|
108
|
+
- id: "1b"
|
|
109
|
+
name: tech_research
|
|
110
|
+
display_name: 技术调研
|
|
111
|
+
agent: tech-research
|
|
112
|
+
agent_mode: single
|
|
113
|
+
gates_before: null
|
|
114
|
+
gates_after: null
|
|
115
|
+
conditional: "research_mode in [full, tech-only, codebase-scan, custom]"
|
|
116
|
+
skip_if_exists: "research/tech-research.md"
|
|
117
|
+
is_critical: false
|
|
118
|
+
|
|
119
|
+
# Phase 1c: 产研汇总(RESEARCH_GROUP 汇合点)
|
|
120
|
+
- id: "1c"
|
|
121
|
+
name: research_synthesis
|
|
122
|
+
display_name: 产研汇总
|
|
123
|
+
agent: null
|
|
124
|
+
agent_mode: inline
|
|
125
|
+
gates_before: null
|
|
126
|
+
gates_after:
|
|
127
|
+
- GATE_RESEARCH
|
|
128
|
+
conditional: "research_mode in [full]"
|
|
129
|
+
skip_if_exists: "research/research-synthesis.md"
|
|
130
|
+
is_critical: false
|
|
131
|
+
|
|
132
|
+
# Phase 1d: 在线调研补充
|
|
133
|
+
- id: "1d"
|
|
134
|
+
name: online_research
|
|
135
|
+
display_name: 在线调研补充
|
|
136
|
+
agent: null
|
|
137
|
+
agent_mode: inline
|
|
138
|
+
gates_before: null
|
|
139
|
+
gates_after: null
|
|
140
|
+
conditional: "online_research_required == true"
|
|
141
|
+
skip_if_exists: "research/online-research.md"
|
|
142
|
+
is_critical: false
|
|
143
|
+
|
|
144
|
+
# Phase 2: 需求规范
|
|
145
|
+
- id: "2"
|
|
146
|
+
name: specify
|
|
147
|
+
display_name: 需求规范
|
|
148
|
+
agent: specify
|
|
149
|
+
agent_mode: single
|
|
150
|
+
gates_before:
|
|
151
|
+
- GATE_RESEARCH
|
|
152
|
+
gates_after: null
|
|
153
|
+
conditional: null
|
|
154
|
+
skip_if_exists: "spec.md"
|
|
155
|
+
is_critical: true
|
|
156
|
+
|
|
157
|
+
# Phase 3: 需求澄清 + 质量检查(并行 DESIGN_PREP_GROUP)
|
|
158
|
+
- id: "3"
|
|
159
|
+
name: clarify_and_checklist
|
|
160
|
+
display_name: 需求澄清 + 质量检查
|
|
161
|
+
agent:
|
|
162
|
+
- clarify
|
|
163
|
+
- quality_checklist
|
|
164
|
+
agent_mode: parallel_group
|
|
165
|
+
gates_before: null
|
|
166
|
+
gates_after: null
|
|
167
|
+
conditional: null
|
|
168
|
+
skip_if_exists: null
|
|
169
|
+
is_critical: false
|
|
170
|
+
|
|
171
|
+
# Phase 3.5: GATE_DESIGN(编排器执行)
|
|
172
|
+
- id: "3.5"
|
|
173
|
+
name: gate_design
|
|
174
|
+
display_name: 规范质量门禁
|
|
175
|
+
agent: null
|
|
176
|
+
agent_mode: gate
|
|
177
|
+
gates_before: null
|
|
178
|
+
gates_after:
|
|
179
|
+
- GATE_DESIGN
|
|
180
|
+
conditional: null
|
|
181
|
+
skip_if_exists: null
|
|
182
|
+
is_critical: true
|
|
183
|
+
|
|
184
|
+
# Phase 4: 技术规划
|
|
185
|
+
- id: "4"
|
|
186
|
+
name: plan
|
|
187
|
+
display_name: 技术规划
|
|
188
|
+
agent: plan
|
|
189
|
+
agent_mode: single
|
|
190
|
+
gates_before:
|
|
191
|
+
- GATE_DESIGN
|
|
192
|
+
gates_after: null
|
|
193
|
+
conditional: null
|
|
194
|
+
skip_if_exists: "plan.md"
|
|
195
|
+
is_critical: true
|
|
196
|
+
|
|
197
|
+
# Phase 5: 任务分解
|
|
198
|
+
- id: "5"
|
|
199
|
+
name: tasks
|
|
200
|
+
display_name: 任务分解
|
|
201
|
+
agent: tasks
|
|
202
|
+
agent_mode: single
|
|
203
|
+
gates_before: null
|
|
204
|
+
gates_after: null
|
|
205
|
+
conditional: null
|
|
206
|
+
skip_if_exists: "tasks.md"
|
|
207
|
+
is_critical: true
|
|
208
|
+
|
|
209
|
+
# Phase 5.5: 一致性分析 + GATE_ANALYSIS
|
|
210
|
+
- id: "5.5"
|
|
211
|
+
name: analyze
|
|
212
|
+
display_name: 一致性分析
|
|
213
|
+
agent: analyze
|
|
214
|
+
agent_mode: single
|
|
215
|
+
gates_before: null
|
|
216
|
+
gates_after:
|
|
217
|
+
- GATE_ANALYSIS
|
|
218
|
+
- GATE_TASKS
|
|
219
|
+
conditional: null
|
|
220
|
+
skip_if_exists: null
|
|
221
|
+
is_critical: false
|
|
222
|
+
|
|
223
|
+
# Phase 6: 代码实现 —— goal_loop 激活点(本模板唯一与 base 不同的字段)
|
|
224
|
+
# base 默认 agent_mode: single;此处改为 goal_loop 以启用 implement→verify 自主迭代闭环。
|
|
225
|
+
- id: "6"
|
|
226
|
+
name: implement
|
|
227
|
+
display_name: 代码实现
|
|
228
|
+
agent: implement
|
|
229
|
+
agent_mode: goal_loop
|
|
230
|
+
gates_before:
|
|
231
|
+
- GATE_TASKS
|
|
232
|
+
gates_after: null
|
|
233
|
+
conditional: null
|
|
234
|
+
skip_if_exists: null
|
|
235
|
+
is_critical: true
|
|
236
|
+
|
|
237
|
+
# Phase 6.5: 编排器独立验证
|
|
238
|
+
- id: "6.5"
|
|
239
|
+
name: verify_independent
|
|
240
|
+
display_name: 编排器独立验证
|
|
241
|
+
agent: null
|
|
242
|
+
agent_mode: orchestrator_verify
|
|
243
|
+
gates_before: null
|
|
244
|
+
gates_after: null
|
|
245
|
+
conditional: null
|
|
246
|
+
skip_if_exists: null
|
|
247
|
+
is_critical: false
|
|
248
|
+
|
|
249
|
+
# Phase 7a: Spec 合规审查(VERIFY_GROUP 成员)
|
|
250
|
+
- id: "7a"
|
|
251
|
+
name: spec_review
|
|
252
|
+
display_name: Spec 合规审查
|
|
253
|
+
agent: spec-review
|
|
254
|
+
agent_mode: single
|
|
255
|
+
gates_before: null
|
|
256
|
+
gates_after: null
|
|
257
|
+
conditional: null
|
|
258
|
+
skip_if_exists: null
|
|
259
|
+
is_critical: false
|
|
260
|
+
|
|
261
|
+
# Phase 7b: 代码质量审查(VERIFY_GROUP 成员)
|
|
262
|
+
- id: "7b"
|
|
263
|
+
name: quality_review
|
|
264
|
+
display_name: 代码质量审查
|
|
265
|
+
agent: quality-review
|
|
266
|
+
agent_mode: single
|
|
267
|
+
gates_before: null
|
|
268
|
+
gates_after: null
|
|
269
|
+
conditional: null
|
|
270
|
+
skip_if_exists: null
|
|
271
|
+
is_critical: false
|
|
272
|
+
|
|
273
|
+
# Phase 7c: 工具链验证 + 证据核查(VERIFY_GROUP 汇合点)
|
|
274
|
+
- id: "7c"
|
|
275
|
+
name: verify
|
|
276
|
+
display_name: 工具链验证 + 证据核查
|
|
277
|
+
agent: verify
|
|
278
|
+
agent_mode: single
|
|
279
|
+
gates_before: null
|
|
280
|
+
gates_after:
|
|
281
|
+
- GATE_VERIFY
|
|
282
|
+
conditional: null
|
|
283
|
+
skip_if_exists: "verification/verification-report.md"
|
|
284
|
+
is_critical: true
|
|
@@ -38,3 +38,13 @@ workflow_preferences:
|
|
|
38
38
|
|
|
39
39
|
forbidden_changes: []
|
|
40
40
|
notes: []
|
|
41
|
+
|
|
42
|
+
# F191 — scaffold-kb 知识库预查注入(可选;默认关闭)。
|
|
43
|
+
# 配置后,spec-driver 在 specify 阶段前自动用需求关键词检索 KB,把命中文档作为
|
|
44
|
+
# untrusted-evidence 注入设计上下文(需已安装 spectra 且 KB 已构建;不可用则静默降级)。
|
|
45
|
+
# knowledge_sources:
|
|
46
|
+
# enabled: true
|
|
47
|
+
# vendor_kb: "plugins/<vendor-plugin>/kb" # 厂商库 kb/ 路径(相对项目根或绝对)
|
|
48
|
+
# project_kb: ".spectra/kb" # 项目库 kb/ 路径(可选)
|
|
49
|
+
# top_k: 3 # 注入条数(默认 3)
|
|
50
|
+
# max_inject_chars: 6000 # 注入总字符上限(默认 6000)
|
|
@@ -22,6 +22,7 @@ durationMs: {{frontmatter.durationMs}}
|
|
|
22
22
|
llmModel: "{{frontmatter.llmModel}}"
|
|
23
23
|
fallbackReason: {{#if frontmatter.fallbackReason}}"{{frontmatter.fallbackReason}}"{{else}}null{{/if}}
|
|
24
24
|
{{/if}}{{#if frontmatter.generatedByMode}}generatedByMode: {{frontmatter.generatedByMode}}
|
|
25
|
+
{{/if}}{{#if frontmatter.sourceTargetKey}}sourceTargetKey: {{frontmatter.sourceTargetKey}}
|
|
25
26
|
{{/if}}---
|
|
26
27
|
|
|
27
28
|
<a id="module-spec"></a>
|