@specship/specship-win32-arm64 0.24.0 → 0.28.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/bin/specship.cmd +31 -1
- package/lib/dist/activation/cheatsheet.d.ts +17 -1
- package/lib/dist/activation/cheatsheet.d.ts.map +1 -1
- package/lib/dist/activation/cheatsheet.js +47 -3
- package/lib/dist/activation/cheatsheet.js.map +1 -1
- package/lib/dist/activation/hook-output.d.ts +80 -0
- package/lib/dist/activation/hook-output.d.ts.map +1 -0
- package/lib/dist/activation/hook-output.js +103 -0
- package/lib/dist/activation/hook-output.js.map +1 -0
- package/lib/dist/activation/search-intercept.d.ts +60 -29
- package/lib/dist/activation/search-intercept.d.ts.map +1 -1
- package/lib/dist/activation/search-intercept.js +159 -55
- package/lib/dist/activation/search-intercept.js.map +1 -1
- package/lib/dist/activation/steering.d.ts +11 -13
- package/lib/dist/activation/steering.d.ts.map +1 -1
- package/lib/dist/activation/steering.js +25 -10
- package/lib/dist/activation/steering.js.map +1 -1
- package/lib/dist/behaviour/behaviour-surface.d.ts +47 -0
- package/lib/dist/behaviour/behaviour-surface.d.ts.map +1 -1
- package/lib/dist/behaviour/behaviour-surface.js +108 -2
- package/lib/dist/behaviour/behaviour-surface.js.map +1 -1
- package/lib/dist/bin/node-version-check.d.ts +22 -7
- package/lib/dist/bin/node-version-check.d.ts.map +1 -1
- package/lib/dist/bin/node-version-check.js +39 -9
- package/lib/dist/bin/node-version-check.js.map +1 -1
- package/lib/dist/bin/specship.js +989 -116
- package/lib/dist/bin/specship.js.map +1 -1
- package/lib/dist/commands/specship/learn.md +27 -3
- package/lib/dist/commands/specship/spec.md +85 -15
- package/lib/dist/db/spec-queries.d.ts +73 -3
- package/lib/dist/db/spec-queries.d.ts.map +1 -1
- package/lib/dist/db/spec-queries.js +139 -5
- package/lib/dist/db/spec-queries.js.map +1 -1
- package/lib/dist/db/sqlite-adapter.d.ts +7 -5
- package/lib/dist/db/sqlite-adapter.d.ts.map +1 -1
- package/lib/dist/db/sqlite-adapter.js +11 -9
- package/lib/dist/db/sqlite-adapter.js.map +1 -1
- package/lib/dist/enforce/changed-files.d.ts +39 -0
- package/lib/dist/enforce/changed-files.d.ts.map +1 -0
- package/lib/dist/enforce/changed-files.js +114 -0
- package/lib/dist/enforce/changed-files.js.map +1 -0
- package/lib/dist/enforce/enforce.d.ts +53 -2
- package/lib/dist/enforce/enforce.d.ts.map +1 -1
- package/lib/dist/enforce/enforce.js +95 -8
- package/lib/dist/enforce/enforce.js.map +1 -1
- package/lib/dist/enforce/mutation.d.ts +46 -0
- package/lib/dist/enforce/mutation.d.ts.map +1 -0
- package/lib/dist/enforce/mutation.js +104 -0
- package/lib/dist/enforce/mutation.js.map +1 -0
- package/lib/dist/enforce/suppressions.d.ts +33 -0
- package/lib/dist/enforce/suppressions.d.ts.map +1 -0
- package/lib/dist/enforce/suppressions.js +159 -0
- package/lib/dist/enforce/suppressions.js.map +1 -0
- package/lib/dist/extraction/grammars.d.ts +10 -0
- package/lib/dist/extraction/grammars.d.ts.map +1 -1
- package/lib/dist/extraction/grammars.js +32 -3
- package/lib/dist/extraction/grammars.js.map +1 -1
- package/lib/dist/extraction/index.d.ts +7 -0
- package/lib/dist/extraction/index.d.ts.map +1 -1
- package/lib/dist/extraction/index.js.map +1 -1
- package/lib/dist/extraction/specs/markdown-spec-extractor.d.ts +7 -0
- package/lib/dist/extraction/specs/markdown-spec-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/specs/markdown-spec-extractor.js +97 -10
- package/lib/dist/extraction/specs/markdown-spec-extractor.js.map +1 -1
- package/lib/dist/extraction/wasm/tree-sitter-pascal.wasm.gz +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-scala.wasm.gz +0 -0
- package/lib/dist/graph/spec-coverage.d.ts +142 -0
- package/lib/dist/graph/spec-coverage.d.ts.map +1 -0
- package/lib/dist/graph/spec-coverage.js +276 -0
- package/lib/dist/graph/spec-coverage.js.map +1 -0
- package/lib/dist/health/smoke-check.js +2 -2
- package/lib/dist/health/smoke-check.js.map +1 -1
- package/lib/dist/index.d.ts +75 -7
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +191 -23
- package/lib/dist/index.js.map +1 -1
- package/lib/dist/installer/gemini-commands.d.ts +107 -0
- package/lib/dist/installer/gemini-commands.d.ts.map +1 -0
- package/lib/dist/installer/gemini-commands.js +264 -0
- package/lib/dist/installer/gemini-commands.js.map +1 -0
- package/lib/dist/installer/index.d.ts +55 -8
- package/lib/dist/installer/index.d.ts.map +1 -1
- package/lib/dist/installer/index.js +72 -53
- package/lib/dist/installer/index.js.map +1 -1
- package/lib/dist/installer/init-offer.d.ts +14 -9
- package/lib/dist/installer/init-offer.d.ts.map +1 -1
- package/lib/dist/installer/init-offer.js +13 -9
- package/lib/dist/installer/init-offer.js.map +1 -1
- package/lib/dist/installer/install-defaults.d.ts +81 -0
- package/lib/dist/installer/install-defaults.d.ts.map +1 -0
- package/lib/dist/installer/install-defaults.js +95 -0
- package/lib/dist/installer/install-defaults.js.map +1 -0
- package/lib/dist/installer/instructions-template.d.ts +22 -0
- package/lib/dist/installer/instructions-template.d.ts.map +1 -1
- package/lib/dist/installer/instructions-template.js +37 -1
- package/lib/dist/installer/instructions-template.js.map +1 -1
- package/lib/dist/installer/targets/claude.d.ts +18 -0
- package/lib/dist/installer/targets/claude.d.ts.map +1 -1
- package/lib/dist/installer/targets/claude.js +70 -23
- package/lib/dist/installer/targets/claude.js.map +1 -1
- package/lib/dist/installer/targets/gemini.d.ts +85 -12
- package/lib/dist/installer/targets/gemini.d.ts.map +1 -1
- package/lib/dist/installer/targets/gemini.js +527 -30
- package/lib/dist/installer/targets/gemini.js.map +1 -1
- package/lib/dist/installer/targets/shared.d.ts +13 -0
- package/lib/dist/installer/targets/shared.d.ts.map +1 -1
- package/lib/dist/installer/targets/shared.js +22 -4
- package/lib/dist/installer/targets/shared.js.map +1 -1
- package/lib/dist/installer/targets/types.d.ts +12 -0
- package/lib/dist/installer/targets/types.d.ts.map +1 -1
- package/lib/dist/jira/auto-publish.d.ts +71 -4
- package/lib/dist/jira/auto-publish.d.ts.map +1 -1
- package/lib/dist/jira/auto-publish.js +186 -17
- package/lib/dist/jira/auto-publish.js.map +1 -1
- package/lib/dist/jira/reconcile.d.ts +24 -1
- package/lib/dist/jira/reconcile.d.ts.map +1 -1
- package/lib/dist/jira/reconcile.js +46 -2
- package/lib/dist/jira/reconcile.js.map +1 -1
- package/lib/dist/jira/repo-config.d.ts +9 -0
- package/lib/dist/jira/repo-config.d.ts.map +1 -1
- package/lib/dist/jira/repo-config.js +11 -0
- package/lib/dist/jira/repo-config.js.map +1 -1
- package/lib/dist/jira/types.d.ts +7 -0
- package/lib/dist/jira/types.d.ts.map +1 -1
- package/lib/dist/jira/types.js.map +1 -1
- package/lib/dist/knowledge/enforce.d.ts +75 -0
- package/lib/dist/knowledge/enforce.d.ts.map +1 -0
- package/lib/dist/knowledge/enforce.js +250 -0
- package/lib/dist/knowledge/enforce.js.map +1 -0
- package/lib/dist/knowledge/facts.d.ts +33 -0
- package/lib/dist/knowledge/facts.d.ts.map +1 -0
- package/lib/dist/knowledge/facts.js +117 -0
- package/lib/dist/knowledge/facts.js.map +1 -0
- package/lib/dist/knowledge/proposals.d.ts +88 -0
- package/lib/dist/knowledge/proposals.d.ts.map +1 -0
- package/lib/dist/knowledge/proposals.js +360 -0
- package/lib/dist/knowledge/proposals.js.map +1 -0
- package/lib/dist/knowledge/stale.d.ts +64 -0
- package/lib/dist/knowledge/stale.d.ts.map +1 -0
- package/lib/dist/knowledge/stale.js +174 -0
- package/lib/dist/knowledge/stale.js.map +1 -0
- package/lib/dist/mcp/fitness-tool.d.ts +5 -6
- package/lib/dist/mcp/fitness-tool.d.ts.map +1 -1
- package/lib/dist/mcp/fitness-tool.js +0 -16
- package/lib/dist/mcp/fitness-tool.js.map +1 -1
- package/lib/dist/mcp/gemini-session.d.ts +50 -0
- package/lib/dist/mcp/gemini-session.d.ts.map +1 -0
- package/lib/dist/mcp/gemini-session.js +159 -0
- package/lib/dist/mcp/gemini-session.js.map +1 -0
- package/lib/dist/mcp/health-tool.d.ts +26 -0
- package/lib/dist/mcp/health-tool.d.ts.map +1 -0
- package/lib/dist/mcp/health-tool.js +50 -0
- package/lib/dist/mcp/health-tool.js.map +1 -0
- package/lib/dist/mcp/jira-tools.d.ts.map +1 -1
- package/lib/dist/mcp/jira-tools.js +25 -0
- package/lib/dist/mcp/jira-tools.js.map +1 -1
- package/lib/dist/mcp/maintainability-tool.d.ts +5 -7
- package/lib/dist/mcp/maintainability-tool.d.ts.map +1 -1
- package/lib/dist/mcp/maintainability-tool.js +0 -16
- package/lib/dist/mcp/maintainability-tool.js.map +1 -1
- package/lib/dist/mcp/model-context.d.ts +31 -7
- package/lib/dist/mcp/model-context.d.ts.map +1 -1
- package/lib/dist/mcp/model-context.js +70 -21
- package/lib/dist/mcp/model-context.js.map +1 -1
- package/lib/dist/mcp/proxy.d.ts.map +1 -1
- package/lib/dist/mcp/proxy.js +5 -2
- package/lib/dist/mcp/proxy.js.map +1 -1
- package/lib/dist/mcp/server-instructions.d.ts +16 -15
- package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
- package/lib/dist/mcp/server-instructions.js +72 -5
- package/lib/dist/mcp/server-instructions.js.map +1 -1
- package/lib/dist/mcp/session.js +1 -1
- package/lib/dist/mcp/session.js.map +1 -1
- package/lib/dist/mcp/spec-tools.d.ts +9 -1
- package/lib/dist/mcp/spec-tools.d.ts.map +1 -1
- package/lib/dist/mcp/spec-tools.js +282 -49
- package/lib/dist/mcp/spec-tools.js.map +1 -1
- package/lib/dist/mcp/tools.d.ts +49 -9
- package/lib/dist/mcp/tools.d.ts.map +1 -1
- package/lib/dist/mcp/tools.js +210 -58
- package/lib/dist/mcp/tools.js.map +1 -1
- package/lib/dist/pulse/pulse.d.ts +93 -0
- package/lib/dist/pulse/pulse.d.ts.map +1 -0
- package/lib/dist/pulse/pulse.js +401 -0
- package/lib/dist/pulse/pulse.js.map +1 -0
- package/lib/dist/reflect/apply.d.ts.map +1 -1
- package/lib/dist/reflect/apply.js +38 -3
- package/lib/dist/reflect/apply.js.map +1 -1
- package/lib/dist/reflect/auto-sweep.d.ts +26 -0
- package/lib/dist/reflect/auto-sweep.d.ts.map +1 -0
- package/lib/dist/reflect/auto-sweep.js +90 -0
- package/lib/dist/reflect/auto-sweep.js.map +1 -0
- package/lib/dist/reflect/cli.d.ts +62 -0
- package/lib/dist/reflect/cli.d.ts.map +1 -0
- package/lib/dist/reflect/cli.js +163 -0
- package/lib/dist/reflect/cli.js.map +1 -0
- package/lib/dist/reflect/miner.d.ts.map +1 -1
- package/lib/dist/reflect/miner.js +119 -0
- package/lib/dist/reflect/miner.js.map +1 -1
- package/lib/dist/reflect/sweep.d.ts +1 -0
- package/lib/dist/reflect/sweep.d.ts.map +1 -1
- package/lib/dist/reflect/sweep.js +62 -13
- package/lib/dist/reflect/sweep.js.map +1 -1
- package/lib/dist/reflect/targets.d.ts +2 -0
- package/lib/dist/reflect/targets.d.ts.map +1 -1
- package/lib/dist/reflect/targets.js +33 -0
- package/lib/dist/reflect/targets.js.map +1 -1
- package/lib/dist/reflect/types.d.ts +19 -2
- package/lib/dist/reflect/types.d.ts.map +1 -1
- package/lib/dist/resolution/spec-link-resolver.d.ts +44 -2
- package/lib/dist/resolution/spec-link-resolver.d.ts.map +1 -1
- package/lib/dist/resolution/spec-link-resolver.js +132 -0
- package/lib/dist/resolution/spec-link-resolver.js.map +1 -1
- package/lib/dist/resolution/test-title-links.d.ts +62 -0
- package/lib/dist/resolution/test-title-links.d.ts.map +1 -0
- package/lib/dist/resolution/test-title-links.js +97 -0
- package/lib/dist/resolution/test-title-links.js.map +1 -0
- package/lib/dist/search/query-parser.d.ts.map +1 -1
- package/lib/dist/search/query-parser.js +6 -1
- package/lib/dist/search/query-parser.js.map +1 -1
- package/lib/dist/server/project-registry.js +1 -1
- package/lib/dist/server/routes/claude.js +24 -43
- package/lib/dist/server/routes/graph.js +53 -7
- package/lib/dist/server/routes/knowledge.js +118 -0
- package/lib/dist/server/routes/mcp.js +4 -3
- package/lib/dist/server/routes/projects.js +4 -4
- package/lib/dist/server/routes/spec.js +49 -7
- package/lib/dist/server/server.js +31 -17
- package/lib/dist/skills/spec-author/SKILL.md +164 -0
- package/lib/dist/skills/spec-author/references/format.md +210 -0
- package/lib/dist/skills/spec-author/references/gap-questions.md +152 -0
- package/lib/dist/skills/spec-author/references/quality-rubric.md +125 -0
- package/lib/dist/skills/spec-author/references/review-checklist.md +175 -0
- package/lib/dist/spec-lint/lint.d.ts +82 -0
- package/lib/dist/spec-lint/lint.d.ts.map +1 -0
- package/lib/dist/spec-lint/lint.js +491 -0
- package/lib/dist/spec-lint/lint.js.map +1 -0
- package/lib/dist/spec-quality/criterion-ids.d.ts +13 -0
- package/lib/dist/spec-quality/criterion-ids.d.ts.map +1 -0
- package/lib/dist/spec-quality/criterion-ids.js +38 -0
- package/lib/dist/spec-quality/criterion-ids.js.map +1 -0
- package/lib/dist/spec-quality/evidence-kind.d.ts +54 -0
- package/lib/dist/spec-quality/evidence-kind.d.ts.map +1 -0
- package/lib/dist/spec-quality/evidence-kind.js +183 -0
- package/lib/dist/spec-quality/evidence-kind.js.map +1 -0
- package/lib/dist/spec-quality/link-persist.d.ts +65 -0
- package/lib/dist/spec-quality/link-persist.d.ts.map +1 -0
- package/lib/dist/spec-quality/link-persist.js +249 -0
- package/lib/dist/spec-quality/link-persist.js.map +1 -0
- package/lib/dist/spec-quality/plan-scope.d.ts +38 -0
- package/lib/dist/spec-quality/plan-scope.d.ts.map +1 -0
- package/lib/dist/spec-quality/plan-scope.js +129 -0
- package/lib/dist/spec-quality/plan-scope.js.map +1 -0
- package/lib/dist/spec-quality/postcheck.d.ts +85 -0
- package/lib/dist/spec-quality/postcheck.d.ts.map +1 -0
- package/lib/dist/spec-quality/postcheck.js +390 -0
- package/lib/dist/spec-quality/postcheck.js.map +1 -0
- package/lib/dist/spec-quality/readiness.d.ts +72 -0
- package/lib/dist/spec-quality/readiness.d.ts.map +1 -0
- package/lib/dist/spec-quality/readiness.js +226 -0
- package/lib/dist/spec-quality/readiness.js.map +1 -0
- package/lib/dist/statusline/index.js.map +1 -1
- package/lib/dist/statusline/render.d.ts +1 -1
- package/lib/dist/statusline/render.d.ts.map +1 -1
- package/lib/dist/statusline/render.js +3 -1
- package/lib/dist/statusline/render.js.map +1 -1
- package/lib/dist/ui/assets/index-BzuUWUAE.js +50 -0
- package/lib/dist/ui/index.html +1 -1
- package/lib/dist/verify/report-ingest.d.ts +88 -0
- package/lib/dist/verify/report-ingest.d.ts.map +1 -0
- package/lib/dist/verify/report-ingest.js +269 -0
- package/lib/dist/verify/report-ingest.js.map +1 -0
- package/lib/dist/workflows/agents/claude.d.ts +16 -0
- package/lib/dist/workflows/agents/claude.d.ts.map +1 -0
- package/lib/dist/workflows/agents/claude.js +82 -0
- package/lib/dist/workflows/agents/claude.js.map +1 -0
- package/lib/dist/workflows/agents/gemini.d.ts +21 -0
- package/lib/dist/workflows/agents/gemini.d.ts.map +1 -0
- package/lib/dist/workflows/agents/gemini.js +124 -0
- package/lib/dist/workflows/agents/gemini.js.map +1 -0
- package/lib/dist/workflows/agents/index.d.ts +28 -0
- package/lib/dist/workflows/agents/index.d.ts.map +1 -0
- package/lib/dist/workflows/agents/index.js +104 -0
- package/lib/dist/workflows/agents/index.js.map +1 -0
- package/lib/dist/workflows/agents/types.d.ts +55 -0
- package/lib/dist/workflows/agents/types.d.ts.map +1 -0
- package/lib/dist/workflows/agents/types.js +46 -0
- package/lib/dist/workflows/agents/types.js.map +1 -0
- package/lib/dist/workflows/batch.d.ts +63 -0
- package/lib/dist/workflows/batch.d.ts.map +1 -0
- package/lib/dist/workflows/batch.js +151 -0
- package/lib/dist/workflows/batch.js.map +1 -0
- package/lib/dist/workflows/defaults/claude-design-implement.yaml +3 -4
- package/lib/dist/workflows/defaults/spec-author.yaml +11 -9
- package/lib/dist/workflows/defaults/spec-fix.yaml +103 -12
- package/lib/dist/workflows/defaults/spec-implement-mixed.yaml +21 -193
- package/lib/dist/workflows/defaults/spec-implement.yaml +701 -41
- package/lib/dist/workflows/defaults/spec-verify.yaml +60 -9
- package/lib/dist/workflows/discovery.d.ts +13 -0
- package/lib/dist/workflows/discovery.d.ts.map +1 -1
- package/lib/dist/workflows/discovery.js +79 -17
- package/lib/dist/workflows/discovery.js.map +1 -1
- package/lib/dist/workflows/executor.d.ts +18 -0
- package/lib/dist/workflows/executor.d.ts.map +1 -1
- package/lib/dist/workflows/executor.js +130 -33
- package/lib/dist/workflows/executor.js.map +1 -1
- package/lib/dist/workflows/gc.d.ts +50 -0
- package/lib/dist/workflows/gc.d.ts.map +1 -0
- package/lib/dist/workflows/gc.js +120 -0
- package/lib/dist/workflows/gc.js.map +1 -0
- package/lib/dist/workflows/merge-queue.d.ts +64 -0
- package/lib/dist/workflows/merge-queue.d.ts.map +1 -0
- package/lib/dist/workflows/merge-queue.js +162 -0
- package/lib/dist/workflows/merge-queue.js.map +1 -0
- package/lib/dist/workflows/runners/approval.d.ts +1 -1
- package/lib/dist/workflows/runners/approval.d.ts.map +1 -1
- package/lib/dist/workflows/runners/approval.js +11 -2
- package/lib/dist/workflows/runners/approval.js.map +1 -1
- package/lib/dist/workflows/runners/bash.d.ts +15 -0
- package/lib/dist/workflows/runners/bash.d.ts.map +1 -1
- package/lib/dist/workflows/runners/bash.js +50 -1
- package/lib/dist/workflows/runners/bash.js.map +1 -1
- package/lib/dist/workflows/runners/prompt.d.ts +16 -41
- package/lib/dist/workflows/runners/prompt.d.ts.map +1 -1
- package/lib/dist/workflows/runners/prompt.js +55 -120
- package/lib/dist/workflows/runners/prompt.js.map +1 -1
- package/lib/dist/workflows/runners/types.d.ts +12 -0
- package/lib/dist/workflows/runners/types.d.ts.map +1 -1
- package/lib/dist/workflows/schemas/workflow.d.ts +17 -0
- package/lib/dist/workflows/schemas/workflow.d.ts.map +1 -1
- package/lib/dist/workflows/schemas/workflow.js +27 -0
- package/lib/dist/workflows/schemas/workflow.js.map +1 -1
- package/lib/node_modules/.package-lock.json +1 -1
- package/lib/package.json +8 -4
- package/package.json +5 -3
- package/lib/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/lib/dist/server/ingest/impact-query.js +0 -343
- package/lib/dist/server/routes/events.js +0 -152
- package/lib/dist/ui/assets/index-CjjaftDw.js +0 -50
- package/node.exe +0 -4
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read domain facts straight from disk (KNOWLEDGE-DOC).
|
|
3
|
+
*
|
|
4
|
+
* The knowledge commands (`stale`, `check`) are file-based: they must work on
|
|
5
|
+
* a project that has never been indexed, so they read `specs/domain/**\/*.md`
|
|
6
|
+
* and run each file through the real `MarkdownSpecExtractor` — the same parse
|
|
7
|
+
* the indexer and the lint use, so all three agree on what a fact says.
|
|
8
|
+
*
|
|
9
|
+
* Read-only. Nothing in `src/knowledge/` writes to `specs/domain/`
|
|
10
|
+
* (DOM-SPECSHIP-003: domain knowledge is human-confirmed, never auto-extracted).
|
|
11
|
+
*/
|
|
12
|
+
export interface DomainFactFile {
|
|
13
|
+
/** The fact's `DOM-<AREA>-NNN` id. */
|
|
14
|
+
id: string;
|
|
15
|
+
/** Project-relative, forward-slashed path of the fact file. */
|
|
16
|
+
filePath: string;
|
|
17
|
+
/** The fact's frontmatter `type` (term / rule / decision / constraint / external), when set. */
|
|
18
|
+
type?: string;
|
|
19
|
+
/** Frontmatter metadata (for an external fact: dependency, version, source, fixture). */
|
|
20
|
+
metadata: Record<string, unknown>;
|
|
21
|
+
/** Post-frontmatter prose. */
|
|
22
|
+
body: string;
|
|
23
|
+
}
|
|
24
|
+
/** Every addressable domain fact under `<projectRoot>/specs/domain/`, sorted by path. */
|
|
25
|
+
export declare function loadDomainFacts(projectRoot: string): DomainFactFile[];
|
|
26
|
+
/**
|
|
27
|
+
* Split a `fixture:` frontmatter value into `path:Symbol` entries
|
|
28
|
+
* (REQ-KNOW-006). The frontmatter parser is single-line `key: value` only (no
|
|
29
|
+
* YAML lists), so several fixtures are written comma-separated; an optional
|
|
30
|
+
* surrounding `[ ... ]` (YAML flow style) is tolerated.
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseFixtureList(value: unknown): string[];
|
|
33
|
+
//# sourceMappingURL=facts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facts.d.ts","sourceRoot":"","sources":["../../src/knowledge/facts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,MAAM,WAAW,cAAc;IAC7B,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB,gGAAgG;IAChG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yFAAyF;IACzF,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;AAmBD,yFAAyF;AACzF,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,EAAE,CA0BrE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAQzD"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Read domain facts straight from disk (KNOWLEDGE-DOC).
|
|
4
|
+
*
|
|
5
|
+
* The knowledge commands (`stale`, `check`) are file-based: they must work on
|
|
6
|
+
* a project that has never been indexed, so they read `specs/domain/**\/*.md`
|
|
7
|
+
* and run each file through the real `MarkdownSpecExtractor` — the same parse
|
|
8
|
+
* the indexer and the lint use, so all three agree on what a fact says.
|
|
9
|
+
*
|
|
10
|
+
* Read-only. Nothing in `src/knowledge/` writes to `specs/domain/`
|
|
11
|
+
* (DOM-SPECSHIP-003: domain knowledge is human-confirmed, never auto-extracted).
|
|
12
|
+
*/
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.loadDomainFacts = loadDomainFacts;
|
|
48
|
+
exports.parseFixtureList = parseFixtureList;
|
|
49
|
+
const fs = __importStar(require("fs"));
|
|
50
|
+
const path = __importStar(require("path"));
|
|
51
|
+
const markdown_spec_extractor_1 = require("../extraction/specs/markdown-spec-extractor");
|
|
52
|
+
/** Recursively list `*.md` files under `dir` (sorted, forward-slashed, relative to `root`). */
|
|
53
|
+
function listMarkdown(dir, root, out) {
|
|
54
|
+
let entries;
|
|
55
|
+
try {
|
|
56
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
for (const e of entries) {
|
|
62
|
+
const full = path.join(dir, e.name);
|
|
63
|
+
if (e.isDirectory())
|
|
64
|
+
listMarkdown(full, root, out);
|
|
65
|
+
else if (e.isFile() && e.name.toLowerCase().endsWith('.md')) {
|
|
66
|
+
out.push(path.relative(root, full).split(path.sep).join('/'));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/** Every addressable domain fact under `<projectRoot>/specs/domain/`, sorted by path. */
|
|
71
|
+
function loadDomainFacts(projectRoot) {
|
|
72
|
+
const files = [];
|
|
73
|
+
listMarkdown(path.join(projectRoot, 'specs', 'domain'), projectRoot, files);
|
|
74
|
+
files.sort();
|
|
75
|
+
const facts = [];
|
|
76
|
+
for (const rel of files) {
|
|
77
|
+
let source;
|
|
78
|
+
try {
|
|
79
|
+
source = fs.readFileSync(path.join(projectRoot, rel), 'utf8');
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const result = new markdown_spec_extractor_1.MarkdownSpecExtractor(rel, source).extract();
|
|
85
|
+
for (const spec of result.specs) {
|
|
86
|
+
if (spec.kind !== 'domain')
|
|
87
|
+
continue;
|
|
88
|
+
const metadata = (spec.metadata ?? {});
|
|
89
|
+
facts.push({
|
|
90
|
+
id: spec.id,
|
|
91
|
+
filePath: rel,
|
|
92
|
+
type: typeof metadata.type === 'string' ? metadata.type : undefined,
|
|
93
|
+
metadata,
|
|
94
|
+
body: spec.body,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return facts;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Split a `fixture:` frontmatter value into `path:Symbol` entries
|
|
102
|
+
* (REQ-KNOW-006). The frontmatter parser is single-line `key: value` only (no
|
|
103
|
+
* YAML lists), so several fixtures are written comma-separated; an optional
|
|
104
|
+
* surrounding `[ ... ]` (YAML flow style) is tolerated.
|
|
105
|
+
*/
|
|
106
|
+
function parseFixtureList(value) {
|
|
107
|
+
if (typeof value !== 'string')
|
|
108
|
+
return [];
|
|
109
|
+
let v = value.trim();
|
|
110
|
+
if (v.startsWith('[') && v.endsWith(']'))
|
|
111
|
+
v = v.slice(1, -1);
|
|
112
|
+
return v
|
|
113
|
+
.split(',')
|
|
114
|
+
.map((s) => s.trim().replace(/^['"]|['"]$/g, ''))
|
|
115
|
+
.filter((s) => s.length > 0);
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=facts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facts.js","sourceRoot":"","sources":["../../src/knowledge/facts.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCH,0CA0BC;AAQD,4CAQC;AA7ED,uCAAyB;AACzB,2CAA6B;AAC7B,yFAAoF;AAepF,+FAA+F;AAC/F,SAAS,YAAY,CAAC,GAAW,EAAE,IAAY,EAAE,GAAa;IAC5D,IAAI,OAAoB,CAAC;IACzB,IAAI,CAAC;QACH,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;IACT,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,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only PROPOSE a fact. Proposals live outside the spec tree, in
|
|
6
|
+
* `.specship/knowledge/proposals/<slug>.md`, and nothing reaches `specs/domain/`
|
|
7
|
+
* until a human runs `apply` on one.
|
|
8
|
+
*
|
|
9
|
+
* ## Proposal file format
|
|
10
|
+
*
|
|
11
|
+
* A proposal is a complete domain-fact file (frontmatter + markdown body),
|
|
12
|
+
* identical to what will land in `specs/domain/`, with two relaxations:
|
|
13
|
+
*
|
|
14
|
+
* ```markdown
|
|
15
|
+
* ---
|
|
16
|
+
* id: DOM-<AREA>-NEW # optional placeholder; absent is fine too
|
|
17
|
+
* area: SPECSHIP # optional; which DOM-<AREA>- prefix to number in
|
|
18
|
+
* title: Gemini policy uses [[rule]] tables
|
|
19
|
+
* type: external # term | rule | decision | constraint | external
|
|
20
|
+
* dependency: @google/gemini-cli
|
|
21
|
+
* version: 0.28.0
|
|
22
|
+
* source: packages/core/src/policy/toml-loader.ts:loadPolicyFromToml
|
|
23
|
+
* depends_on: REQ-GEMINI-009
|
|
24
|
+
* ---
|
|
25
|
+
*
|
|
26
|
+
* # Gemini policy uses [[rule]] tables
|
|
27
|
+
*
|
|
28
|
+
* Prose…
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* - The proposal id is its file slug (`<slug>.md` → `<slug>`).
|
|
32
|
+
* - `id` is reassigned on apply to the next free `DOM-<AREA>-NNN` (3-digit),
|
|
33
|
+
* so it may be absent, a placeholder (`DOM-<AREA>-NEW`, `DOM-FOO-NEW`) or
|
|
34
|
+
* anything else — it is never trusted as final.
|
|
35
|
+
* - `<AREA>` resolution, first hit wins: the `area:` key; the area of a
|
|
36
|
+
* `DOM-<AREA>-…` id that names a concrete area; the most common
|
|
37
|
+
* `DOM-<AREA>-` prefix among existing `specs/domain/**` facts; `DOMAIN`.
|
|
38
|
+
* - `area:` is a proposal-only key and is stripped on apply.
|
|
39
|
+
*
|
|
40
|
+
* Pure over the file system: no database, no host/agent coupling.
|
|
41
|
+
*/
|
|
42
|
+
import { type LintFinding } from '../spec-lint/lint';
|
|
43
|
+
/** One pending proposal, as listed. */
|
|
44
|
+
export interface KnowledgeProposal {
|
|
45
|
+
/** The proposal id: its file slug (`<slug>.md` → `<slug>`). */
|
|
46
|
+
id: string;
|
|
47
|
+
title: string;
|
|
48
|
+
/** The fact's `type:` frontmatter value, or `''` when absent. */
|
|
49
|
+
type: string;
|
|
50
|
+
/** Absolute path of the proposal file. */
|
|
51
|
+
path: string;
|
|
52
|
+
}
|
|
53
|
+
/** The result of a successful apply. */
|
|
54
|
+
export interface AppliedProposal {
|
|
55
|
+
/** The assigned domain id, e.g. `DOM-SPECSHIP-005`. */
|
|
56
|
+
id: string;
|
|
57
|
+
/** Project-relative path of the written fact, e.g. `specs/domain/foo.md`. */
|
|
58
|
+
path: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Thrown by `applyProposal` when the resulting fact would not pass lint
|
|
62
|
+
* (REQ-KNOW-004.A3). The proposal is left in place; `findings` carries every
|
|
63
|
+
* error finding so the caller can show them.
|
|
64
|
+
*/
|
|
65
|
+
export declare class ProposalRefusedError extends Error {
|
|
66
|
+
readonly proposalId: string;
|
|
67
|
+
readonly findings: LintFinding[];
|
|
68
|
+
constructor(proposalId: string, findings: LintFinding[]);
|
|
69
|
+
}
|
|
70
|
+
/** Absolute path of the proposals directory for a project. */
|
|
71
|
+
export declare function proposalsDir(projectRoot: string): string;
|
|
72
|
+
/** The next free `DOM-<AREA>-NNN` (3-digit, max+1 within the area). */
|
|
73
|
+
export declare function nextDomainId(area: string, existingIds: string[]): string;
|
|
74
|
+
/** List every pending proposal, sorted by id. */
|
|
75
|
+
export declare function listProposals(projectRoot: string): KnowledgeProposal[];
|
|
76
|
+
/**
|
|
77
|
+
* Apply a confirmed proposal (REQ-KNOW-004.A2/A3): assign the next free
|
|
78
|
+
* `DOM-<AREA>-NNN`, lint the result under its target path, write it to
|
|
79
|
+
* `specs/domain/<slug>.md` (never overwriting — `<slug>-2.md`, …) and delete
|
|
80
|
+
* the proposal. Throws `ProposalRefusedError` — leaving the proposal in place
|
|
81
|
+
* and writing nothing — when lint reports any error.
|
|
82
|
+
*/
|
|
83
|
+
export declare function applyProposal(projectRoot: string, proposalId: string): AppliedProposal;
|
|
84
|
+
/** Reject a proposal (REQ-KNOW-004.A4): delete it; nothing touches `specs/domain/`. */
|
|
85
|
+
export declare function rejectProposal(projectRoot: string, proposalId: string): void;
|
|
86
|
+
/** Human-readable proposal listing for the CLI. */
|
|
87
|
+
export declare function formatProposalList(proposals: KnowledgeProposal[]): string;
|
|
88
|
+
//# sourceMappingURL=proposals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proposals.d.ts","sourceRoot":"","sources":["../../src/knowledge/proposals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAKH,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErE,uCAAuC;AACvC,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wCAAwC;AACxC,MAAM,WAAW,eAAe;IAC9B,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,WAAW,EAAE,CAAC;gBACrB,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE;CASxD;AAOD,8DAA8D;AAC9D,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAExD;AAiID,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,MAAM,CAOxE;AAoDD,iDAAiD;AACjD,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAsBtE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,eAAe,CA2BtF;AAED,uFAAuF;AACvF,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAE5E;AAED,mDAAmD;AACnD,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAazE"}
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Knowledge proposals store (KNOWLEDGE-DOC, REQ-KNOW-004 A2–A4).
|
|
4
|
+
*
|
|
5
|
+
* Domain knowledge is human-confirmed, never auto-extracted (DOM-SPECSHIP-003):
|
|
6
|
+
* a pipeline may only PROPOSE a fact. Proposals live outside the spec tree, in
|
|
7
|
+
* `.specship/knowledge/proposals/<slug>.md`, and nothing reaches `specs/domain/`
|
|
8
|
+
* until a human runs `apply` on one.
|
|
9
|
+
*
|
|
10
|
+
* ## Proposal file format
|
|
11
|
+
*
|
|
12
|
+
* A proposal is a complete domain-fact file (frontmatter + markdown body),
|
|
13
|
+
* identical to what will land in `specs/domain/`, with two relaxations:
|
|
14
|
+
*
|
|
15
|
+
* ```markdown
|
|
16
|
+
* ---
|
|
17
|
+
* id: DOM-<AREA>-NEW # optional placeholder; absent is fine too
|
|
18
|
+
* area: SPECSHIP # optional; which DOM-<AREA>- prefix to number in
|
|
19
|
+
* title: Gemini policy uses [[rule]] tables
|
|
20
|
+
* type: external # term | rule | decision | constraint | external
|
|
21
|
+
* dependency: @google/gemini-cli
|
|
22
|
+
* version: 0.28.0
|
|
23
|
+
* source: packages/core/src/policy/toml-loader.ts:loadPolicyFromToml
|
|
24
|
+
* depends_on: REQ-GEMINI-009
|
|
25
|
+
* ---
|
|
26
|
+
*
|
|
27
|
+
* # Gemini policy uses [[rule]] tables
|
|
28
|
+
*
|
|
29
|
+
* Prose…
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* - The proposal id is its file slug (`<slug>.md` → `<slug>`).
|
|
33
|
+
* - `id` is reassigned on apply to the next free `DOM-<AREA>-NNN` (3-digit),
|
|
34
|
+
* so it may be absent, a placeholder (`DOM-<AREA>-NEW`, `DOM-FOO-NEW`) or
|
|
35
|
+
* anything else — it is never trusted as final.
|
|
36
|
+
* - `<AREA>` resolution, first hit wins: the `area:` key; the area of a
|
|
37
|
+
* `DOM-<AREA>-…` id that names a concrete area; the most common
|
|
38
|
+
* `DOM-<AREA>-` prefix among existing `specs/domain/**` facts; `DOMAIN`.
|
|
39
|
+
* - `area:` is a proposal-only key and is stripped on apply.
|
|
40
|
+
*
|
|
41
|
+
* Pure over the file system: no database, no host/agent coupling.
|
|
42
|
+
*/
|
|
43
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
44
|
+
if (k2 === undefined) k2 = k;
|
|
45
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
46
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
47
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
48
|
+
}
|
|
49
|
+
Object.defineProperty(o, k2, desc);
|
|
50
|
+
}) : (function(o, m, k, k2) {
|
|
51
|
+
if (k2 === undefined) k2 = k;
|
|
52
|
+
o[k2] = m[k];
|
|
53
|
+
}));
|
|
54
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
55
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
56
|
+
}) : function(o, v) {
|
|
57
|
+
o["default"] = v;
|
|
58
|
+
});
|
|
59
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
60
|
+
var ownKeys = function(o) {
|
|
61
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
62
|
+
var ar = [];
|
|
63
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
64
|
+
return ar;
|
|
65
|
+
};
|
|
66
|
+
return ownKeys(o);
|
|
67
|
+
};
|
|
68
|
+
return function (mod) {
|
|
69
|
+
if (mod && mod.__esModule) return mod;
|
|
70
|
+
var result = {};
|
|
71
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
72
|
+
__setModuleDefault(result, mod);
|
|
73
|
+
return result;
|
|
74
|
+
};
|
|
75
|
+
})();
|
|
76
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
77
|
+
exports.ProposalRefusedError = void 0;
|
|
78
|
+
exports.proposalsDir = proposalsDir;
|
|
79
|
+
exports.nextDomainId = nextDomainId;
|
|
80
|
+
exports.listProposals = listProposals;
|
|
81
|
+
exports.applyProposal = applyProposal;
|
|
82
|
+
exports.rejectProposal = rejectProposal;
|
|
83
|
+
exports.formatProposalList = formatProposalList;
|
|
84
|
+
const fs = __importStar(require("fs"));
|
|
85
|
+
const path = __importStar(require("path"));
|
|
86
|
+
const directory_1 = require("../directory");
|
|
87
|
+
const lint_1 = require("../spec-lint/lint");
|
|
88
|
+
/**
|
|
89
|
+
* Thrown by `applyProposal` when the resulting fact would not pass lint
|
|
90
|
+
* (REQ-KNOW-004.A3). The proposal is left in place; `findings` carries every
|
|
91
|
+
* error finding so the caller can show them.
|
|
92
|
+
*/
|
|
93
|
+
class ProposalRefusedError extends Error {
|
|
94
|
+
proposalId;
|
|
95
|
+
findings;
|
|
96
|
+
constructor(proposalId, findings) {
|
|
97
|
+
super(`Proposal "${proposalId}" refused — it would fail lint:\n` +
|
|
98
|
+
findings.map((f) => ` ${f.code}: ${f.message}`).join('\n'));
|
|
99
|
+
this.name = 'ProposalRefusedError';
|
|
100
|
+
this.proposalId = proposalId;
|
|
101
|
+
this.findings = findings;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.ProposalRefusedError = ProposalRefusedError;
|
|
105
|
+
const DEFAULT_AREA = 'DOMAIN';
|
|
106
|
+
const PLACEHOLDER_AREA = '<AREA>';
|
|
107
|
+
const SLUG_RE = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
108
|
+
const DOMAIN_ID_RE = /^DOM-([A-Z0-9_]+)-(\d+)$/;
|
|
109
|
+
/** Absolute path of the proposals directory for a project. */
|
|
110
|
+
function proposalsDir(projectRoot) {
|
|
111
|
+
return path.join((0, directory_1.getSpecShipDir)(projectRoot), 'knowledge', 'proposals');
|
|
112
|
+
}
|
|
113
|
+
function domainDir(projectRoot) {
|
|
114
|
+
return path.join(projectRoot, 'specs', 'domain');
|
|
115
|
+
}
|
|
116
|
+
function assertSlug(proposalId) {
|
|
117
|
+
if (!SLUG_RE.test(proposalId) || proposalId.includes('..')) {
|
|
118
|
+
throw new Error(`Invalid proposal id "${proposalId}"`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function proposalPath(projectRoot, proposalId) {
|
|
122
|
+
assertSlug(proposalId);
|
|
123
|
+
const p = path.join(proposalsDir(projectRoot), `${proposalId}.md`);
|
|
124
|
+
if (!fs.existsSync(p))
|
|
125
|
+
throw new Error(`No pending proposal "${proposalId}"`);
|
|
126
|
+
return p;
|
|
127
|
+
}
|
|
128
|
+
function splitFrontmatter(source) {
|
|
129
|
+
const lines = source.split(/\r?\n/);
|
|
130
|
+
if ((lines[0] ?? '').trim() !== '---')
|
|
131
|
+
return { fm: [], body: source, hasFrontmatter: false };
|
|
132
|
+
for (let i = 1; i < lines.length; i++) {
|
|
133
|
+
if ((lines[i] ?? '').trim() === '---') {
|
|
134
|
+
return { fm: lines.slice(1, i), body: lines.slice(i + 1).join('\n'), hasFrontmatter: true };
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return { fm: [], body: source, hasFrontmatter: false };
|
|
138
|
+
}
|
|
139
|
+
function fmValue(fm, key) {
|
|
140
|
+
for (const raw of fm) {
|
|
141
|
+
const line = raw.trim();
|
|
142
|
+
const idx = line.indexOf(':');
|
|
143
|
+
if (idx <= 0 || line.slice(0, idx).trim() !== key)
|
|
144
|
+
continue;
|
|
145
|
+
let v = line.slice(idx + 1).trim();
|
|
146
|
+
if ((v.startsWith('"') && v.endsWith('"')) || (v.startsWith("'") && v.endsWith("'"))) {
|
|
147
|
+
v = v.slice(1, -1);
|
|
148
|
+
}
|
|
149
|
+
return v;
|
|
150
|
+
}
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
function isKey(raw, key) {
|
|
154
|
+
const line = raw.trim();
|
|
155
|
+
const idx = line.indexOf(':');
|
|
156
|
+
return idx > 0 && line.slice(0, idx).trim() === key;
|
|
157
|
+
}
|
|
158
|
+
function firstHeading(body) {
|
|
159
|
+
for (const line of body.split(/\r?\n/)) {
|
|
160
|
+
const m = line.match(/^#{1,6}\s+(.+?)\s*$/);
|
|
161
|
+
if (m && m[1])
|
|
162
|
+
return m[1];
|
|
163
|
+
}
|
|
164
|
+
return undefined;
|
|
165
|
+
}
|
|
166
|
+
// ---------------------------------------------------------------------------
|
|
167
|
+
// Existing domain ids
|
|
168
|
+
// ---------------------------------------------------------------------------
|
|
169
|
+
function walkMarkdown(dir, out) {
|
|
170
|
+
let entries;
|
|
171
|
+
try {
|
|
172
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
for (const e of entries) {
|
|
178
|
+
const p = path.join(dir, e.name);
|
|
179
|
+
if (e.isDirectory())
|
|
180
|
+
walkMarkdown(p, out);
|
|
181
|
+
else if (e.isFile() && e.name.endsWith('.md'))
|
|
182
|
+
out.push(p);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/** Every `id:` declared by a fact under `specs/domain/**`. */
|
|
186
|
+
function existingDomainIds(projectRoot) {
|
|
187
|
+
const files = [];
|
|
188
|
+
walkMarkdown(domainDir(projectRoot), files);
|
|
189
|
+
const ids = [];
|
|
190
|
+
for (const f of files) {
|
|
191
|
+
const id = fmValue(splitFrontmatter(fs.readFileSync(f, 'utf-8')).fm, 'id');
|
|
192
|
+
if (id)
|
|
193
|
+
ids.push(id);
|
|
194
|
+
}
|
|
195
|
+
return ids;
|
|
196
|
+
}
|
|
197
|
+
/** The most common `DOM-<AREA>-` prefix among existing facts, if any. */
|
|
198
|
+
function dominantArea(ids) {
|
|
199
|
+
const counts = new Map();
|
|
200
|
+
for (const id of ids) {
|
|
201
|
+
const m = id.match(DOMAIN_ID_RE);
|
|
202
|
+
if (m && m[1])
|
|
203
|
+
counts.set(m[1], (counts.get(m[1]) ?? 0) + 1);
|
|
204
|
+
}
|
|
205
|
+
let best;
|
|
206
|
+
let bestN = 0;
|
|
207
|
+
for (const [area, n] of counts) {
|
|
208
|
+
if (n > bestN || (n === bestN && best !== undefined && area < best)) {
|
|
209
|
+
best = area;
|
|
210
|
+
bestN = n;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return best;
|
|
214
|
+
}
|
|
215
|
+
function resolveArea(fm, ids) {
|
|
216
|
+
const explicit = fmValue(fm, 'area');
|
|
217
|
+
if (explicit && /^[A-Za-z0-9_]+$/.test(explicit))
|
|
218
|
+
return explicit.toUpperCase();
|
|
219
|
+
const id = fmValue(fm, 'id');
|
|
220
|
+
const m = id?.match(/^DOM-([^-]+)-/);
|
|
221
|
+
if (m && m[1] && m[1] !== PLACEHOLDER_AREA && /^[A-Za-z0-9_]+$/.test(m[1])) {
|
|
222
|
+
return m[1].toUpperCase();
|
|
223
|
+
}
|
|
224
|
+
return dominantArea(ids) ?? DEFAULT_AREA;
|
|
225
|
+
}
|
|
226
|
+
/** The next free `DOM-<AREA>-NNN` (3-digit, max+1 within the area). */
|
|
227
|
+
function nextDomainId(area, existingIds) {
|
|
228
|
+
let max = 0;
|
|
229
|
+
for (const id of existingIds) {
|
|
230
|
+
const m = id.match(DOMAIN_ID_RE);
|
|
231
|
+
if (m && m[1] === area && m[2])
|
|
232
|
+
max = Math.max(max, parseInt(m[2], 10));
|
|
233
|
+
}
|
|
234
|
+
return `DOM-${area}-${String(max + 1).padStart(3, '0')}`;
|
|
235
|
+
}
|
|
236
|
+
/** Rewrite the proposal's frontmatter: set the real id, strip `area:`. */
|
|
237
|
+
function materialize(source, id) {
|
|
238
|
+
const split = splitFrontmatter(source);
|
|
239
|
+
const fm = split.fm.filter((l) => !isKey(l, 'id') && !isKey(l, 'area'));
|
|
240
|
+
const body = split.hasFrontmatter ? split.body : source;
|
|
241
|
+
return ['---', `id: ${id}`, ...fm, '---', body].join('\n');
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Provenance check for `type: external` facts (REQ-KNOW-001.A2). The spec
|
|
245
|
+
* linter carries this rule; it is mirrored here so `apply` refuses an
|
|
246
|
+
* external fact without provenance even against a linter that predates it.
|
|
247
|
+
* Returns the missing field alongside each finding so `applyProposal` can
|
|
248
|
+
* skip fields the linter already reported.
|
|
249
|
+
*/
|
|
250
|
+
function externalProvenanceFindings(filePath, source) {
|
|
251
|
+
const fm = splitFrontmatter(source).fm;
|
|
252
|
+
if (fmValue(fm, 'type') !== 'external')
|
|
253
|
+
return [];
|
|
254
|
+
const out = [];
|
|
255
|
+
for (const field of ['dependency', 'version', 'source']) {
|
|
256
|
+
if (!fmValue(fm, field)) {
|
|
257
|
+
out.push({
|
|
258
|
+
field,
|
|
259
|
+
finding: {
|
|
260
|
+
code: 'knowledge_external_missing_provenance',
|
|
261
|
+
severity: 'error',
|
|
262
|
+
filePath,
|
|
263
|
+
line: 1,
|
|
264
|
+
message: `External fact is missing required field "${field}"`,
|
|
265
|
+
},
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return out;
|
|
270
|
+
}
|
|
271
|
+
function uniqueTarget(projectRoot, slug) {
|
|
272
|
+
const dir = domainDir(projectRoot);
|
|
273
|
+
let candidate = `${slug}.md`;
|
|
274
|
+
for (let n = 2; fs.existsSync(path.join(dir, candidate)); n++)
|
|
275
|
+
candidate = `${slug}-${n}.md`;
|
|
276
|
+
return candidate;
|
|
277
|
+
}
|
|
278
|
+
// ---------------------------------------------------------------------------
|
|
279
|
+
// Public API
|
|
280
|
+
// ---------------------------------------------------------------------------
|
|
281
|
+
/** List every pending proposal, sorted by id. */
|
|
282
|
+
function listProposals(projectRoot) {
|
|
283
|
+
const dir = proposalsDir(projectRoot);
|
|
284
|
+
let names;
|
|
285
|
+
try {
|
|
286
|
+
names = fs.readdirSync(dir).filter((n) => n.endsWith('.md'));
|
|
287
|
+
}
|
|
288
|
+
catch {
|
|
289
|
+
return [];
|
|
290
|
+
}
|
|
291
|
+
const out = [];
|
|
292
|
+
for (const name of names.sort()) {
|
|
293
|
+
const id = name.slice(0, -3);
|
|
294
|
+
if (!SLUG_RE.test(id))
|
|
295
|
+
continue;
|
|
296
|
+
const p = path.join(dir, name);
|
|
297
|
+
const split = splitFrontmatter(fs.readFileSync(p, 'utf-8'));
|
|
298
|
+
out.push({
|
|
299
|
+
id,
|
|
300
|
+
title: fmValue(split.fm, 'title') || firstHeading(split.body) || id,
|
|
301
|
+
type: fmValue(split.fm, 'type') ?? '',
|
|
302
|
+
path: p,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
return out;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Apply a confirmed proposal (REQ-KNOW-004.A2/A3): assign the next free
|
|
309
|
+
* `DOM-<AREA>-NNN`, lint the result under its target path, write it to
|
|
310
|
+
* `specs/domain/<slug>.md` (never overwriting — `<slug>-2.md`, …) and delete
|
|
311
|
+
* the proposal. Throws `ProposalRefusedError` — leaving the proposal in place
|
|
312
|
+
* and writing nothing — when lint reports any error.
|
|
313
|
+
*/
|
|
314
|
+
function applyProposal(projectRoot, proposalId) {
|
|
315
|
+
const src = proposalPath(projectRoot, proposalId);
|
|
316
|
+
const source = fs.readFileSync(src, 'utf-8');
|
|
317
|
+
const ids = existingDomainIds(projectRoot);
|
|
318
|
+
const area = resolveArea(splitFrontmatter(source).fm, ids);
|
|
319
|
+
const id = nextDomainId(area, ids);
|
|
320
|
+
const content = materialize(source, id);
|
|
321
|
+
const fileName = uniqueTarget(projectRoot, proposalId);
|
|
322
|
+
const relPath = `specs/domain/${fileName}`;
|
|
323
|
+
const lintErrors = (0, lint_1.lintSpecSource)(relPath, content).filter((f) => f.severity === 'error');
|
|
324
|
+
// Keep a mirrored provenance finding only when the linter did not already
|
|
325
|
+
// report that field, so a linter carrying the rule yields no duplicates.
|
|
326
|
+
const errors = [
|
|
327
|
+
...lintErrors,
|
|
328
|
+
...externalProvenanceFindings(relPath, content)
|
|
329
|
+
.filter(({ field }) => !lintErrors.some((e) => e.message.includes(field)))
|
|
330
|
+
.map(({ finding }) => finding),
|
|
331
|
+
];
|
|
332
|
+
if (errors.length > 0)
|
|
333
|
+
throw new ProposalRefusedError(proposalId, errors);
|
|
334
|
+
fs.mkdirSync(domainDir(projectRoot), { recursive: true });
|
|
335
|
+
// `wx` — fail rather than overwrite should a file appear in the meantime.
|
|
336
|
+
fs.writeFileSync(path.join(projectRoot, relPath), content, { encoding: 'utf-8', flag: 'wx' });
|
|
337
|
+
fs.unlinkSync(src);
|
|
338
|
+
return { id, path: relPath };
|
|
339
|
+
}
|
|
340
|
+
/** Reject a proposal (REQ-KNOW-004.A4): delete it; nothing touches `specs/domain/`. */
|
|
341
|
+
function rejectProposal(projectRoot, proposalId) {
|
|
342
|
+
fs.unlinkSync(proposalPath(projectRoot, proposalId));
|
|
343
|
+
}
|
|
344
|
+
/** Human-readable proposal listing for the CLI. */
|
|
345
|
+
function formatProposalList(proposals) {
|
|
346
|
+
if (proposals.length === 0)
|
|
347
|
+
return 'No pending knowledge proposals.';
|
|
348
|
+
const idW = Math.max(2, ...proposals.map((p) => p.id.length));
|
|
349
|
+
const typeW = Math.max(4, ...proposals.map((p) => p.type.length));
|
|
350
|
+
const lines = [
|
|
351
|
+
`${proposals.length} pending knowledge proposal${proposals.length === 1 ? '' : 's'}:`,
|
|
352
|
+
'',
|
|
353
|
+
` ${'ID'.padEnd(idW)} ${'TYPE'.padEnd(typeW)} TITLE`,
|
|
354
|
+
...proposals.map((p) => ` ${p.id.padEnd(idW)} ${(p.type || '-').padEnd(typeW)} ${p.title}`),
|
|
355
|
+
'',
|
|
356
|
+
'Apply with `specship knowledge apply <id>`, or reject with `specship knowledge reject <id>`.',
|
|
357
|
+
];
|
|
358
|
+
return lines.join('\n');
|
|
359
|
+
}
|
|
360
|
+
//# sourceMappingURL=proposals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proposals.js","sourceRoot":"","sources":["../../src/knowledge/proposals.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDH,oCAEC;AAkID,oCAOC;AAqDD,sCAsBC;AASD,sCA2BC;AAGD,wCAEC;AAGD,gDAaC;AAhUD,uCAAyB;AACzB,2CAA6B;AAC7B,4CAA8C;AAC9C,4CAAqE;AAqBrE;;;;GAIG;AACH,MAAa,oBAAqB,SAAQ,KAAK;IACpC,UAAU,CAAS;IACnB,QAAQ,CAAgB;IACjC,YAAY,UAAkB,EAAE,QAAuB;QACrD,KAAK,CACH,aAAa,UAAU,mCAAmC;YACxD,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAC9D,CAAC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