@seanmars/tospec 0.19.0-beta.8 → 0.21.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/CHANGELOG.md +89 -296
- package/README.md +69 -82
- package/assets/dashboard/app.js +11 -0
- package/assets/dashboard/style.css +7 -0
- package/bin/tospec.js +1 -1
- package/dist/cli/index.d.ts +6 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +120 -112
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/config.d.ts +9 -17
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +300 -145
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/dashboard.d.ts +57 -99
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dashboard.js +252 -330
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/decision.d.ts +38 -27
- package/dist/commands/decision.d.ts.map +1 -1
- package/dist/commands/decision.js +301 -131
- package/dist/commands/decision.js.map +1 -1
- package/dist/commands/metrics.d.ts +28 -51
- package/dist/commands/metrics.d.ts.map +1 -1
- package/dist/commands/metrics.js +62 -93
- package/dist/commands/metrics.js.map +1 -1
- package/dist/commands/shared-output.d.ts +12 -27
- package/dist/commands/shared-output.d.ts.map +1 -1
- package/dist/commands/shared-output.js +22 -45
- package/dist/commands/shared-output.js.map +1 -1
- package/dist/commands/show.d.ts +4 -7
- package/dist/commands/show.d.ts.map +1 -1
- package/dist/commands/show.js +23 -11
- package/dist/commands/show.js.map +1 -1
- package/dist/commands/validate.d.ts +34 -58
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +228 -142
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/workflow/index.d.ts +1 -5
- package/dist/commands/workflow/index.d.ts.map +1 -1
- package/dist/commands/workflow/index.js +1 -5
- package/dist/commands/workflow/index.js.map +1 -1
- package/dist/commands/workflow/instructions.d.ts +14 -24
- package/dist/commands/workflow/instructions.d.ts.map +1 -1
- package/dist/commands/workflow/instructions.js +230 -132
- package/dist/commands/workflow/instructions.js.map +1 -1
- package/dist/commands/workflow/new-change.d.ts +2 -5
- package/dist/commands/workflow/new-change.d.ts.map +1 -1
- package/dist/commands/workflow/new-change.js +75 -34
- package/dist/commands/workflow/new-change.js.map +1 -1
- package/dist/commands/workflow/schemas.d.ts +1 -5
- package/dist/commands/workflow/schemas.d.ts.map +1 -1
- package/dist/commands/workflow/schemas.js +6 -17
- package/dist/commands/workflow/schemas.js.map +1 -1
- package/dist/commands/workflow/shared.d.ts +37 -42
- package/dist/commands/workflow/shared.d.ts.map +1 -1
- package/dist/commands/workflow/shared.js +23 -54
- package/dist/commands/workflow/shared.js.map +1 -1
- package/dist/commands/workflow/status.d.ts +7 -17
- package/dist/commands/workflow/status.d.ts.map +1 -1
- package/dist/commands/workflow/status.js +57 -72
- package/dist/commands/workflow/status.js.map +1 -1
- package/dist/commands/workflow/templates.d.ts +8 -8
- package/dist/commands/workflow/templates.d.ts.map +1 -1
- package/dist/commands/workflow/templates.js +32 -46
- package/dist/commands/workflow/templates.js.map +1 -1
- package/dist/core/archive.d.ts +33 -31
- package/dist/core/archive.d.ts.map +1 -1
- package/dist/core/archive.js +322 -284
- package/dist/core/archive.js.map +1 -1
- package/dist/core/artifact-graph/graph.d.ts +25 -42
- package/dist/core/artifact-graph/graph.d.ts.map +1 -1
- package/dist/core/artifact-graph/graph.js +45 -63
- package/dist/core/artifact-graph/graph.js.map +1 -1
- package/dist/core/artifact-graph/index.d.ts +1 -1
- package/dist/core/artifact-graph/index.d.ts.map +1 -1
- package/dist/core/artifact-graph/index.js +1 -1
- package/dist/core/artifact-graph/index.js.map +1 -1
- package/dist/core/artifact-graph/instruction-loader.d.ts +54 -120
- package/dist/core/artifact-graph/instruction-loader.d.ts.map +1 -1
- package/dist/core/artifact-graph/instruction-loader.js +129 -111
- package/dist/core/artifact-graph/instruction-loader.js.map +1 -1
- package/dist/core/artifact-graph/outputs.d.ts +9 -23
- package/dist/core/artifact-graph/outputs.d.ts.map +1 -1
- package/dist/core/artifact-graph/outputs.js +45 -38
- package/dist/core/artifact-graph/outputs.js.map +1 -1
- package/dist/core/artifact-graph/resolver.d.ts +36 -81
- package/dist/core/artifact-graph/resolver.d.ts.map +1 -1
- package/dist/core/artifact-graph/resolver.js +60 -101
- package/dist/core/artifact-graph/resolver.js.map +1 -1
- package/dist/core/artifact-graph/schema.d.ts +0 -6
- package/dist/core/artifact-graph/schema.d.ts.map +1 -1
- package/dist/core/artifact-graph/schema.js +7 -32
- package/dist/core/artifact-graph/schema.js.map +1 -1
- package/dist/core/artifact-graph/state.d.ts +1 -8
- package/dist/core/artifact-graph/state.d.ts.map +1 -1
- package/dist/core/artifact-graph/state.js +2 -17
- package/dist/core/artifact-graph/state.js.map +1 -1
- package/dist/core/artifact-graph/stub-detection.d.ts +6 -14
- package/dist/core/artifact-graph/stub-detection.d.ts.map +1 -1
- package/dist/core/artifact-graph/stub-detection.js +13 -16
- package/dist/core/artifact-graph/stub-detection.js.map +1 -1
- package/dist/core/artifact-graph/types.d.ts +4 -0
- package/dist/core/artifact-graph/types.d.ts.map +1 -1
- package/dist/core/artifact-graph/types.js +46 -11
- package/dist/core/artifact-graph/types.js.map +1 -1
- package/dist/core/available-tools.d.ts +3 -12
- package/dist/core/available-tools.d.ts.map +1 -1
- package/dist/core/available-tools.js +4 -13
- package/dist/core/available-tools.js.map +1 -1
- package/dist/core/change-metadata/schema.d.ts +1 -1
- package/dist/core/change-metadata/schema.d.ts.map +1 -1
- package/dist/core/change-metadata/schema.js +10 -7
- package/dist/core/change-metadata/schema.js.map +1 -1
- package/dist/core/change-presenter.d.ts +16 -27
- package/dist/core/change-presenter.d.ts.map +1 -1
- package/dist/core/change-presenter.js +53 -53
- package/dist/core/change-presenter.js.map +1 -1
- package/dist/core/change-status-policy.d.ts +4 -8
- package/dist/core/change-status-policy.d.ts.map +1 -1
- package/dist/core/change-status-policy.js +9 -17
- package/dist/core/change-status-policy.js.map +1 -1
- package/dist/core/codex-metrics.d.ts +25 -45
- package/dist/core/codex-metrics.d.ts.map +1 -1
- package/dist/core/codex-metrics.js +44 -88
- package/dist/core/codex-metrics.js.map +1 -1
- package/dist/core/codex-residue.d.ts +14 -15
- package/dist/core/codex-residue.d.ts.map +1 -1
- package/dist/core/codex-residue.js +18 -22
- package/dist/core/codex-residue.js.map +1 -1
- package/dist/core/command-generation/adapters/claude.d.ts +2 -9
- package/dist/core/command-generation/adapters/claude.d.ts.map +1 -1
- package/dist/core/command-generation/adapters/claude.js +2 -12
- package/dist/core/command-generation/adapters/claude.js.map +1 -1
- package/dist/core/command-generation/adapters/index.d.ts +1 -9
- package/dist/core/command-generation/adapters/index.d.ts.map +1 -1
- package/dist/core/command-generation/adapters/index.js +1 -9
- package/dist/core/command-generation/adapters/index.js.map +1 -1
- package/dist/core/command-generation/generator.d.ts +0 -17
- package/dist/core/command-generation/generator.d.ts.map +1 -1
- package/dist/core/command-generation/generator.js +0 -17
- package/dist/core/command-generation/generator.js.map +1 -1
- package/dist/core/command-generation/index.d.ts +2 -5
- package/dist/core/command-generation/index.d.ts.map +1 -1
- package/dist/core/command-generation/index.js +0 -9
- package/dist/core/command-generation/index.js.map +1 -1
- package/dist/core/command-generation/types.d.ts +10 -36
- package/dist/core/command-generation/types.d.ts.map +1 -1
- package/dist/core/command-generation/types.js +0 -6
- package/dist/core/command-generation/types.js.map +1 -1
- package/dist/core/command-generation/yaml.d.ts +3 -18
- package/dist/core/command-generation/yaml.d.ts.map +1 -1
- package/dist/core/command-generation/yaml.js +5 -23
- package/dist/core/command-generation/yaml.js.map +1 -1
- package/dist/core/config-prompts.d.ts +2 -4
- package/dist/core/config-prompts.d.ts.map +1 -1
- package/dist/core/config-prompts.js +2 -7
- package/dist/core/config-prompts.js.map +1 -1
- package/dist/core/config-schema.d.ts +7 -41
- package/dist/core/config-schema.d.ts.map +1 -1
- package/dist/core/config-schema.js +35 -74
- package/dist/core/config-schema.js.map +1 -1
- package/dist/core/config.d.ts +25 -49
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +22 -45
- package/dist/core/config.js.map +1 -1
- package/dist/core/dashboard-activity.d.ts +7 -9
- package/dist/core/dashboard-activity.d.ts.map +1 -1
- package/dist/core/dashboard-activity.js +34 -25
- package/dist/core/dashboard-activity.js.map +1 -1
- package/dist/core/dashboard-data.d.ts +35 -22
- package/dist/core/dashboard-data.d.ts.map +1 -1
- package/dist/core/dashboard-data.js +57 -72
- package/dist/core/dashboard-data.js.map +1 -1
- package/dist/core/global-config.d.ts +24 -53
- package/dist/core/global-config.d.ts.map +1 -1
- package/dist/core/global-config.js +38 -67
- package/dist/core/global-config.js.map +1 -1
- package/dist/core/init.d.ts +12 -28
- package/dist/core/init.d.ts.map +1 -1
- package/dist/core/init.js +93 -169
- package/dist/core/init.js.map +1 -1
- package/dist/core/list.d.ts.map +1 -1
- package/dist/core/list.js +95 -41
- package/dist/core/list.js.map +1 -1
- package/dist/core/local-server.d.ts +41 -83
- package/dist/core/local-server.d.ts.map +1 -1
- package/dist/core/local-server.js +53 -98
- package/dist/core/local-server.js.map +1 -1
- package/dist/core/markdown-render.d.ts +15 -23
- package/dist/core/markdown-render.d.ts.map +1 -1
- package/dist/core/markdown-render.js +25 -34
- package/dist/core/markdown-render.js.map +1 -1
- package/dist/core/migrate.d.ts +19 -16
- package/dist/core/migrate.d.ts.map +1 -1
- package/dist/core/migrate.js +162 -136
- package/dist/core/migrate.js.map +1 -1
- package/dist/core/parsers/change-parser.d.ts +7 -10
- package/dist/core/parsers/change-parser.d.ts.map +1 -1
- package/dist/core/parsers/change-parser.js +48 -56
- package/dist/core/parsers/change-parser.js.map +1 -1
- package/dist/core/parsers/markdown-parser.d.ts +8 -9
- package/dist/core/parsers/markdown-parser.d.ts.map +1 -1
- package/dist/core/parsers/markdown-parser.js +23 -30
- package/dist/core/parsers/markdown-parser.js.map +1 -1
- package/dist/core/parsers/requirement-blocks.d.ts +43 -15
- package/dist/core/parsers/requirement-blocks.d.ts.map +1 -1
- package/dist/core/parsers/requirement-blocks.js +142 -70
- package/dist/core/parsers/requirement-blocks.js.map +1 -1
- package/dist/core/parsers/requirement-text.d.ts +73 -79
- package/dist/core/parsers/requirement-text.d.ts.map +1 -1
- package/dist/core/parsers/requirement-text.js +137 -79
- package/dist/core/parsers/requirement-text.js.map +1 -1
- package/dist/core/parsers/spec-structure.d.ts.map +1 -1
- package/dist/core/parsers/spec-structure.js +10 -6
- package/dist/core/parsers/spec-structure.js.map +1 -1
- package/dist/core/profiles.d.ts +3 -10
- package/dist/core/profiles.d.ts.map +1 -1
- package/dist/core/profiles.js +5 -12
- package/dist/core/profiles.js.map +1 -1
- package/dist/core/project-config.d.ts +43 -44
- package/dist/core/project-config.d.ts.map +1 -1
- package/dist/core/project-config.js +107 -82
- package/dist/core/project-config.js.map +1 -1
- package/dist/core/project-layout.d.ts +9 -17
- package/dist/core/project-layout.d.ts.map +1 -1
- package/dist/core/project-layout.js +16 -26
- package/dist/core/project-layout.js.map +1 -1
- package/dist/core/root-selection.d.ts +8 -14
- package/dist/core/root-selection.d.ts.map +1 -1
- package/dist/core/root-selection.js +3 -6
- package/dist/core/root-selection.js.map +1 -1
- package/dist/core/rules.d.ts.map +1 -1
- package/dist/core/rules.js +2 -3
- package/dist/core/rules.js.map +1 -1
- package/dist/core/schema-names.d.ts +16 -0
- package/dist/core/schema-names.d.ts.map +1 -0
- package/dist/core/schema-names.js +16 -0
- package/dist/core/schema-names.js.map +1 -0
- package/dist/core/schemas/base.schema.d.ts.map +1 -1
- package/dist/core/schemas/base.schema.js +6 -12
- package/dist/core/schemas/base.schema.js.map +1 -1
- package/dist/core/schemas/change.schema.d.ts +8 -0
- package/dist/core/schemas/change.schema.d.ts.map +1 -1
- package/dist/core/schemas/change.schema.js +41 -10
- package/dist/core/schemas/change.schema.js.map +1 -1
- package/dist/core/shared/index.d.ts +2 -7
- package/dist/core/shared/index.d.ts.map +1 -1
- package/dist/core/shared/index.js +2 -7
- package/dist/core/shared/index.js.map +1 -1
- package/dist/core/shared/rules-generation.d.ts +5 -15
- package/dist/core/shared/rules-generation.d.ts.map +1 -1
- package/dist/core/shared/rules-generation.js +33 -37
- package/dist/core/shared/rules-generation.js.map +1 -1
- package/dist/core/shared/skill-generation.d.ts +28 -43
- package/dist/core/shared/skill-generation.d.ts.map +1 -1
- package/dist/core/shared/skill-generation.js +82 -51
- package/dist/core/shared/skill-generation.js.map +1 -1
- package/dist/core/shared/tool-detection.d.ts +35 -76
- package/dist/core/shared/tool-detection.d.ts.map +1 -1
- package/dist/core/shared/tool-detection.js +73 -93
- package/dist/core/shared/tool-detection.js.map +1 -1
- package/dist/core/skill-metrics.d.ts +36 -63
- package/dist/core/skill-metrics.d.ts.map +1 -1
- package/dist/core/skill-metrics.js +34 -73
- package/dist/core/skill-metrics.js.map +1 -1
- package/dist/core/spec-presenter.d.ts.map +1 -1
- package/dist/core/spec-presenter.js +5 -10
- package/dist/core/spec-presenter.js.map +1 -1
- package/dist/core/specs-apply.d.ts +16 -31
- package/dist/core/specs-apply.d.ts.map +1 -1
- package/dist/core/specs-apply.js +146 -195
- package/dist/core/specs-apply.js.map +1 -1
- package/dist/core/templates/fragments/interview.d.ts +2 -6
- package/dist/core/templates/fragments/interview.d.ts.map +1 -1
- package/dist/core/templates/fragments/interview.js +2 -6
- package/dist/core/templates/fragments/interview.js.map +1 -1
- package/dist/core/templates/fragments/next-step.d.ts +4 -8
- package/dist/core/templates/fragments/next-step.d.ts.map +1 -1
- package/dist/core/templates/fragments/next-step.js +4 -8
- package/dist/core/templates/fragments/next-step.js.map +1 -1
- package/dist/core/templates/fragments/validate.d.ts +13 -0
- package/dist/core/templates/fragments/validate.d.ts.map +1 -0
- package/dist/core/templates/fragments/validate.js +13 -0
- package/dist/core/templates/fragments/validate.js.map +1 -0
- package/dist/core/templates/fragments/verify.d.ts +9 -12
- package/dist/core/templates/fragments/verify.d.ts.map +1 -1
- package/dist/core/templates/fragments/verify.js +9 -12
- package/dist/core/templates/fragments/verify.js.map +1 -1
- package/dist/core/templates/index.d.ts +0 -6
- package/dist/core/templates/index.d.ts.map +1 -1
- package/dist/core/templates/index.js +0 -7
- package/dist/core/templates/index.js.map +1 -1
- package/dist/core/templates/skill-templates.d.ts +1 -5
- package/dist/core/templates/skill-templates.d.ts.map +1 -1
- package/dist/core/templates/skill-templates.js +0 -5
- package/dist/core/templates/skill-templates.js.map +1 -1
- package/dist/core/templates/types.d.ts +3 -7
- package/dist/core/templates/types.d.ts.map +1 -1
- package/dist/core/templates/types.js +0 -3
- package/dist/core/templates/types.js.map +1 -1
- package/dist/core/templates/workflows/apply.d.ts +3 -9
- package/dist/core/templates/workflows/apply.d.ts.map +1 -1
- package/dist/core/templates/workflows/apply.js +11 -13
- package/dist/core/templates/workflows/apply.js.map +1 -1
- package/dist/core/templates/workflows/archive.d.ts +0 -6
- package/dist/core/templates/workflows/archive.d.ts.map +1 -1
- package/dist/core/templates/workflows/archive.js +16 -5
- package/dist/core/templates/workflows/archive.js.map +1 -1
- package/dist/core/templates/workflows/decision.js +3 -3
- package/dist/core/templates/workflows/decision.js.map +1 -1
- package/dist/core/templates/workflows/explore.js +1 -1
- package/dist/core/templates/workflows/grill.d.ts.map +1 -1
- package/dist/core/templates/workflows/grill.js +0 -2
- package/dist/core/templates/workflows/grill.js.map +1 -1
- package/dist/core/templates/workflows/issue.d.ts +0 -6
- package/dist/core/templates/workflows/issue.d.ts.map +1 -1
- package/dist/core/templates/workflows/issue.js +3 -2
- package/dist/core/templates/workflows/issue.js.map +1 -1
- package/dist/core/templates/workflows/propose.d.ts +0 -6
- package/dist/core/templates/workflows/propose.d.ts.map +1 -1
- package/dist/core/templates/workflows/propose.js +2 -2
- package/dist/core/templates/workflows/propose.js.map +1 -1
- package/dist/core/templates/workflows/sync.d.ts +2 -8
- package/dist/core/templates/workflows/sync.d.ts.map +1 -1
- package/dist/core/templates/workflows/sync.js +4 -3
- package/dist/core/templates/workflows/sync.js.map +1 -1
- package/dist/core/templates/workflows/update.d.ts +0 -6
- package/dist/core/templates/workflows/update.d.ts.map +1 -1
- package/dist/core/templates/workflows/update.js +9 -2
- package/dist/core/templates/workflows/update.js.map +1 -1
- package/dist/core/update.d.ts +10 -36
- package/dist/core/update.d.ts.map +1 -1
- package/dist/core/update.js +59 -126
- package/dist/core/update.js.map +1 -1
- package/dist/core/user-state-migration.d.ts +13 -15
- package/dist/core/user-state-migration.d.ts.map +1 -1
- package/dist/core/user-state-migration.js +30 -23
- package/dist/core/user-state-migration.js.map +1 -1
- package/dist/core/validation/constants.d.ts +4 -10
- package/dist/core/validation/constants.d.ts.map +1 -1
- package/dist/core/validation/constants.js +25 -25
- package/dist/core/validation/constants.js.map +1 -1
- package/dist/core/validation/prose-length.d.ts +15 -0
- package/dist/core/validation/prose-length.d.ts.map +1 -0
- package/dist/core/validation/prose-length.js +29 -0
- package/dist/core/validation/prose-length.js.map +1 -0
- package/dist/core/validation/purpose-placeholder.d.ts +9 -16
- package/dist/core/validation/purpose-placeholder.d.ts.map +1 -1
- package/dist/core/validation/purpose-placeholder.js +30 -44
- package/dist/core/validation/purpose-placeholder.js.map +1 -1
- package/dist/core/validation/section-validator.d.ts +4 -4
- package/dist/core/validation/section-validator.d.ts.map +1 -1
- package/dist/core/validation/section-validator.js +30 -12
- package/dist/core/validation/section-validator.js.map +1 -1
- package/dist/core/validation/task-numbering.d.ts +6 -3
- package/dist/core/validation/task-numbering.d.ts.map +1 -1
- package/dist/core/validation/task-numbering.js +23 -11
- package/dist/core/validation/task-numbering.js.map +1 -1
- package/dist/core/validation/types.d.ts +18 -0
- package/dist/core/validation/types.d.ts.map +1 -1
- package/dist/core/validation/types.js +12 -1
- package/dist/core/validation/types.js.map +1 -1
- package/dist/core/validation/validator.d.ts +42 -68
- package/dist/core/validation/validator.d.ts.map +1 -1
- package/dist/core/validation/validator.js +474 -285
- package/dist/core/validation/validator.js.map +1 -1
- package/dist/prompts/searchable-multi-select.d.ts +3 -8
- package/dist/prompts/searchable-multi-select.d.ts.map +1 -1
- package/dist/prompts/searchable-multi-select.js +16 -39
- package/dist/prompts/searchable-multi-select.js.map +1 -1
- package/dist/utils/change-metadata.d.ts +11 -50
- package/dist/utils/change-metadata.d.ts.map +1 -1
- package/dist/utils/change-metadata.js +48 -67
- package/dist/utils/change-metadata.js.map +1 -1
- package/dist/utils/change-utils.d.ts +24 -76
- package/dist/utils/change-utils.d.ts.map +1 -1
- package/dist/utils/change-utils.js +95 -142
- package/dist/utils/change-utils.js.map +1 -1
- package/dist/utils/file-lock.d.ts +39 -0
- package/dist/utils/file-lock.d.ts.map +1 -0
- package/dist/utils/file-lock.js +149 -0
- package/dist/utils/file-lock.js.map +1 -0
- package/dist/utils/file-system.d.ts +12 -32
- package/dist/utils/file-system.d.ts.map +1 -1
- package/dist/utils/file-system.js +41 -45
- package/dist/utils/file-system.js.map +1 -1
- package/dist/utils/frontmatter.d.ts +7 -11
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +11 -11
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/interactive.d.ts +4 -9
- package/dist/utils/interactive.d.ts.map +1 -1
- package/dist/utils/interactive.js +2 -4
- package/dist/utils/interactive.js.map +1 -1
- package/dist/utils/item-discovery.d.ts +10 -20
- package/dist/utils/item-discovery.d.ts.map +1 -1
- package/dist/utils/item-discovery.js +31 -55
- package/dist/utils/item-discovery.js.map +1 -1
- package/dist/utils/link.d.ts +9 -18
- package/dist/utils/link.d.ts.map +1 -1
- package/dist/utils/link.js +9 -18
- package/dist/utils/link.js.map +1 -1
- package/dist/utils/requirement-diff.d.ts +13 -23
- package/dist/utils/requirement-diff.d.ts.map +1 -1
- package/dist/utils/requirement-diff.js +13 -23
- package/dist/utils/requirement-diff.js.map +1 -1
- package/dist/utils/spec-files.d.ts +7 -20
- package/dist/utils/spec-files.d.ts.map +1 -1
- package/dist/utils/spec-files.js +26 -51
- package/dist/utils/spec-files.js.map +1 -1
- package/dist/utils/task-progress.d.ts +11 -9
- package/dist/utils/task-progress.d.ts.map +1 -1
- package/dist/utils/task-progress.js +53 -32
- package/dist/utils/task-progress.js.map +1 -1
- package/dist/utils/timestamp.d.ts +5 -8
- package/dist/utils/timestamp.d.ts.map +1 -1
- package/dist/utils/timestamp.js +5 -8
- package/dist/utils/timestamp.js.map +1 -1
- package/package.json +2 -3
- package/schemas/issue/schema.yaml +8 -1
- package/schemas/issue/templates/spec.md +20 -3
- package/schemas/sdd/schema.yaml +20 -1
- package/schemas/sdd/templates/spec.md +20 -3
|
@@ -3,9 +3,6 @@ import * as path from 'node:path';
|
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { getGlobalConfigDir, getLegacyDataDir } from '../global-config.js';
|
|
5
5
|
import { parseSchema, SchemaValidationError } from './schema.js';
|
|
6
|
-
/**
|
|
7
|
-
* Error thrown when loading a schema fails.
|
|
8
|
-
*/
|
|
9
6
|
export class SchemaLoadError extends Error {
|
|
10
7
|
schemaPath;
|
|
11
8
|
cause;
|
|
@@ -16,13 +13,9 @@ export class SchemaLoadError extends Error {
|
|
|
16
13
|
this.name = 'SchemaLoadError';
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
|
-
/**
|
|
20
|
-
* Gets the package's built-in schemas directory path.
|
|
21
|
-
* Uses import.meta.url to resolve relative to the current module.
|
|
22
|
-
*/
|
|
16
|
+
/** Walks up from dist/core/artifact-graph/ to the package root's schemas/. */
|
|
23
17
|
export function getPackageSchemasDir() {
|
|
24
18
|
const currentFile = fileURLToPath(import.meta.url);
|
|
25
|
-
// Navigate from dist/core/artifact-graph/ to package root's schemas/
|
|
26
19
|
return path.join(path.dirname(currentFile), '..', '..', '..', 'schemas');
|
|
27
20
|
}
|
|
28
21
|
/**
|
|
@@ -38,27 +31,18 @@ export function getUserSchemasDir() {
|
|
|
38
31
|
}
|
|
39
32
|
/**
|
|
40
33
|
* Where overrides sit until an install migrates. Ranked below the current user
|
|
41
|
-
* directory, so a migrated copy wins and a not-yet-migrated one still applies
|
|
42
|
-
* per schema name, because every lookup walks this list name by name.
|
|
34
|
+
* directory, so a migrated copy wins and a not-yet-migrated one still applies.
|
|
43
35
|
*/
|
|
44
36
|
function getLegacySchemasDir() {
|
|
45
37
|
return path.join(getLegacyDataDir(), 'schemas');
|
|
46
38
|
}
|
|
47
|
-
/**
|
|
48
|
-
* Gets the project-local schemas directory path.
|
|
49
|
-
* @param projectRoot - The project root directory
|
|
50
|
-
* @returns The path to the project's schemas directory
|
|
51
|
-
*/
|
|
52
39
|
export function getProjectSchemasDir(projectRoot) {
|
|
53
40
|
return path.join(projectRoot, 'tospec', 'schemas');
|
|
54
41
|
}
|
|
55
42
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* `
|
|
59
|
-
* directory has `isDirectory() === false`; such entries are dereferenced via
|
|
60
|
-
* `statSync` to admit symlinked schema dirs while still rejecting
|
|
61
|
-
* symlinks-to-files and broken/dangling links.
|
|
43
|
+
* True for real directories and for symlinks pointing at one. `Dirent`'s
|
|
44
|
+
* `isDirectory()` reports the raw entry type, so a symlinked schema dir needs
|
|
45
|
+
* the `statSync` dereference below.
|
|
62
46
|
*/
|
|
63
47
|
export function isSchemaDir(parentDir, entry) {
|
|
64
48
|
if (entry.isDirectory()) {
|
|
@@ -74,21 +58,6 @@ export function isSchemaDir(parentDir, entry) {
|
|
|
74
58
|
}
|
|
75
59
|
return false;
|
|
76
60
|
}
|
|
77
|
-
/**
|
|
78
|
-
* Resolves a schema name to its directory path.
|
|
79
|
-
*
|
|
80
|
-
* Resolution order (when projectRoot is provided):
|
|
81
|
-
* 1. Project-local: <projectRoot>/tospec/schemas/<name>/schema.yaml
|
|
82
|
-
* 2. User override: ${XDG_DATA_HOME}/tospec/schemas/<name>/schema.yaml
|
|
83
|
-
* 3. Package built-in: <package>/schemas/<name>/schema.yaml
|
|
84
|
-
*
|
|
85
|
-
* When projectRoot is not provided, only user override and package built-in are checked
|
|
86
|
-
* (backward compatible behavior).
|
|
87
|
-
*
|
|
88
|
-
* @param name - Schema name (e.g., "sdd")
|
|
89
|
-
* @param projectRoot - Optional project root directory for project-local schema resolution
|
|
90
|
-
* @returns The path to the schema directory, or null if not found
|
|
91
|
-
*/
|
|
92
61
|
/**
|
|
93
62
|
* Identity of a file's current contents, for cache invalidation. Null when the
|
|
94
63
|
* file cannot be stat'd, which disables caching for that path rather than
|
|
@@ -105,6 +74,16 @@ export function fileStamp(filePath) {
|
|
|
105
74
|
}
|
|
106
75
|
/** Parsed schemas keyed by path, invalidated when the file's stamp changes. */
|
|
107
76
|
const schemaCache = new Map();
|
|
77
|
+
/**
|
|
78
|
+
* One wording for a schema that will not parse, so `tospec schemas` and
|
|
79
|
+
* `tospec templates --schema <name>` say the same thing about the same file.
|
|
80
|
+
*/
|
|
81
|
+
function schemaParseFailureMessage(schemaPath, error) {
|
|
82
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
83
|
+
return error instanceof SchemaValidationError
|
|
84
|
+
? `Invalid schema at '${schemaPath}': ${detail}`
|
|
85
|
+
: `Failed to parse schema at '${schemaPath}': ${detail}`;
|
|
86
|
+
}
|
|
108
87
|
/**
|
|
109
88
|
* The schema search path, **lowest precedence first** (package → user →
|
|
110
89
|
* project). Every lookup and listing walks this one list, so adding a source
|
|
@@ -113,9 +92,9 @@ const schemaCache = new Map();
|
|
|
113
92
|
function schemaSources(projectRoot) {
|
|
114
93
|
return [
|
|
115
94
|
{ dir: getPackageSchemasDir(), source: 'package' },
|
|
116
|
-
// Both report 'user'
|
|
117
|
-
// and a 'legacy' value would widen the agent-facing JSON contract
|
|
118
|
-
// something that stops existing once migration runs.
|
|
95
|
+
// Both report 'user': the legacy entry is another address for the same
|
|
96
|
+
// layer, and a 'legacy' value would widen the agent-facing JSON contract
|
|
97
|
+
// with something that stops existing once migration runs.
|
|
119
98
|
{ dir: getLegacySchemasDir(), source: 'user' },
|
|
120
99
|
{ dir: getUserSchemasDir(), source: 'user' },
|
|
121
100
|
...(projectRoot
|
|
@@ -132,53 +111,54 @@ function scanSchemaDir(dir) {
|
|
|
132
111
|
.filter((entry) => isSchemaDir(dir, entry) && fs.existsSync(path.join(dir, entry.name, 'schema.yaml')))
|
|
133
112
|
.map((entry) => entry.name);
|
|
134
113
|
}
|
|
135
|
-
|
|
114
|
+
/**
|
|
115
|
+
* The directory holding `<name>/schema.yaml` and the layer it came from, or
|
|
116
|
+
* null when no layer has one. Project-local wins over the user override, which
|
|
117
|
+
* wins over the package built-in; without `projectRoot` only the last two are
|
|
118
|
+
* searched.
|
|
119
|
+
*
|
|
120
|
+
* The layer is resolved here rather than re-derived from the path by each
|
|
121
|
+
* caller: a directory is the *whole* schema, templates included, so "which layer
|
|
122
|
+
* won" is what explains a file the winning layer does not have.
|
|
123
|
+
*/
|
|
124
|
+
export function getSchemaDirWithSource(name, projectRoot) {
|
|
136
125
|
// Highest precedence first: project overrides user overrides package.
|
|
137
|
-
for (const { dir } of schemaSources(projectRoot).reverse()) {
|
|
126
|
+
for (const { dir, source } of schemaSources(projectRoot).reverse()) {
|
|
138
127
|
const candidate = path.join(dir, name);
|
|
139
128
|
if (fs.existsSync(path.join(candidate, 'schema.yaml'))) {
|
|
140
|
-
return candidate;
|
|
129
|
+
return { dir: candidate, source };
|
|
141
130
|
}
|
|
142
131
|
}
|
|
143
132
|
return null;
|
|
144
133
|
}
|
|
134
|
+
/** As `getSchemaDirWithSource`, for callers that only need the path. */
|
|
135
|
+
export function getSchemaDir(name, projectRoot) {
|
|
136
|
+
return getSchemaDirWithSource(name, projectRoot)?.dir ?? null;
|
|
137
|
+
}
|
|
145
138
|
/**
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* Resolution order (when projectRoot is provided):
|
|
149
|
-
* 1. Project-local: <projectRoot>/tospec/schemas/<name>/schema.yaml
|
|
150
|
-
* 2. User override: ${XDG_DATA_HOME}/tospec/schemas/<name>/schema.yaml
|
|
151
|
-
* 3. Package built-in: <package>/schemas/<name>/schema.yaml
|
|
139
|
+
* The parsed schema, resolved through `getSchemaDir`'s precedence order.
|
|
152
140
|
*
|
|
153
|
-
*
|
|
154
|
-
* (backward compatible behavior).
|
|
155
|
-
*
|
|
156
|
-
* @param name - Schema name (e.g., "sdd")
|
|
157
|
-
* @param projectRoot - Optional project root directory for project-local schema resolution
|
|
158
|
-
* @returns The resolved schema object
|
|
159
|
-
* @throws Error if schema is not found in any location
|
|
141
|
+
* @throws SchemaLoadError when the file cannot be read or does not parse.
|
|
160
142
|
*/
|
|
161
143
|
export function resolveSchema(name, projectRoot) {
|
|
162
|
-
// Normalize name (remove .yaml extension if provided)
|
|
163
144
|
const normalizedName = name.replace(/\.ya?ml$/, '');
|
|
164
145
|
const schemaDir = getSchemaDir(normalizedName, projectRoot);
|
|
165
146
|
if (!schemaDir) {
|
|
166
|
-
// Loadable, not merely present:
|
|
167
|
-
//
|
|
147
|
+
// Loadable, not merely present: a name whose schema.yaml does not parse is
|
|
148
|
+
// a choice that cannot work.
|
|
168
149
|
const availableSchemas = listLoadableSchemas(projectRoot);
|
|
169
150
|
throw new Error(`Schema '${normalizedName}' not found. Available schemas: ${availableSchemas.join(', ')}`);
|
|
170
151
|
}
|
|
171
152
|
const schemaPath = path.join(schemaDir, 'schema.yaml');
|
|
172
|
-
// A
|
|
173
|
-
//
|
|
174
|
-
// dominates
|
|
153
|
+
// A status/list run resolves the same schema once per change and the dashboard
|
|
154
|
+
// re-resolves on every refresh, where the yaml + Zod + cycle-check parse
|
|
155
|
+
// dominates. One statSync decides whether it can be skipped.
|
|
175
156
|
const stamp = fileStamp(schemaPath);
|
|
176
157
|
const cached = stamp === null ? undefined : schemaCache.get(schemaPath);
|
|
177
158
|
if (cached && cached.stamp === stamp) {
|
|
178
159
|
// Cloned so a caller mutating its schema cannot corrupt later resolutions.
|
|
179
160
|
return structuredClone(cached.schema);
|
|
180
161
|
}
|
|
181
|
-
// Load and parse the schema
|
|
182
162
|
let content;
|
|
183
163
|
try {
|
|
184
164
|
content = fs.readFileSync(schemaPath, 'utf-8');
|
|
@@ -195,19 +175,11 @@ export function resolveSchema(name, projectRoot) {
|
|
|
195
175
|
return schema;
|
|
196
176
|
}
|
|
197
177
|
catch (err) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
const parseError = err instanceof Error ? err : new Error(String(err));
|
|
202
|
-
throw new SchemaLoadError(`Failed to parse schema at '${schemaPath}': ${parseError.message}`, schemaPath, parseError);
|
|
178
|
+
const cause = err instanceof Error ? err : new Error(String(err));
|
|
179
|
+
throw new SchemaLoadError(schemaParseFailureMessage(schemaPath, err), schemaPath, cause);
|
|
203
180
|
}
|
|
204
181
|
}
|
|
205
|
-
/**
|
|
206
|
-
* Lists all available schema names.
|
|
207
|
-
* Combines project-local, user override, and package built-in schemas.
|
|
208
|
-
*
|
|
209
|
-
* @param projectRoot - Optional project root directory for project-local schema resolution
|
|
210
|
-
*/
|
|
182
|
+
/** Every schema name on disk across all three layers. */
|
|
211
183
|
export function listSchemas(projectRoot) {
|
|
212
184
|
const schemas = new Set();
|
|
213
185
|
for (const { dir } of schemaSources(projectRoot)) {
|
|
@@ -219,12 +191,9 @@ export function listSchemas(projectRoot) {
|
|
|
219
191
|
}
|
|
220
192
|
/**
|
|
221
193
|
* Names of the schemas that actually load — what an "Available schemas:" list
|
|
222
|
-
* has to mean.
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
* offered as a choice and then produced an unusable change (round 4 report 5).
|
|
226
|
-
* Anything phrased as advice to the user belongs on this list; enumeration of
|
|
227
|
-
* what is on disk stays on `listSchemas`.
|
|
194
|
+
* has to mean. `listSchemas` reports directory names, so a schema.yaml with a
|
|
195
|
+
* typo in it would be offered as a choice. Anything phrased as advice to the
|
|
196
|
+
* user belongs here.
|
|
228
197
|
*/
|
|
229
198
|
export function listLoadableSchemas(projectRoot) {
|
|
230
199
|
return listSchemasWithInfo(projectRoot)
|
|
@@ -232,24 +201,22 @@ export function listLoadableSchemas(projectRoot) {
|
|
|
232
201
|
.map((schema) => schema.name);
|
|
233
202
|
}
|
|
234
203
|
/**
|
|
235
|
-
*
|
|
236
|
-
*
|
|
204
|
+
* Every schema with its description and artifact list, for agent skills that
|
|
205
|
+
* present a schema choice.
|
|
237
206
|
*
|
|
238
207
|
* A schema that fails to parse is reported with `error` set, but only when no
|
|
239
208
|
* lower-precedence layer supplies a working schema of that name — a broken
|
|
240
209
|
* project override must not hide the package schema it shadows.
|
|
241
|
-
*
|
|
242
|
-
* @param projectRoot - Optional project root directory for project-local schema resolution
|
|
243
210
|
*/
|
|
244
211
|
export function listSchemasWithInfo(projectRoot) {
|
|
245
212
|
const schemas = [];
|
|
246
213
|
const seenNames = new Set();
|
|
247
|
-
// Keyed by name so the highest-precedence failure is the one reported, and
|
|
248
|
-
//
|
|
214
|
+
// Keyed by name so the highest-precedence failure is the one reported, and a
|
|
215
|
+
// later success removes it.
|
|
249
216
|
const broken = new Map();
|
|
250
217
|
// Highest precedence first, so an overridden schema is skipped rather than
|
|
251
|
-
// replaced. A schema that fails to parse is not marked seen — the next
|
|
252
|
-
//
|
|
218
|
+
// replaced. A schema that fails to parse is not marked seen — the next source
|
|
219
|
+
// down still gets a chance to supply it.
|
|
253
220
|
for (const { dir, source } of schemaSources(projectRoot).reverse()) {
|
|
254
221
|
for (const name of scanSchemaDir(dir)) {
|
|
255
222
|
if (seenNames.has(name))
|
|
@@ -269,20 +236,13 @@ export function listSchemasWithInfo(projectRoot) {
|
|
|
269
236
|
catch (error) {
|
|
270
237
|
if (broken.has(name))
|
|
271
238
|
continue;
|
|
272
|
-
const schemaPath = path.join(dir, name, 'schema.yaml');
|
|
273
|
-
const detail = error instanceof Error ? error.message : String(error);
|
|
274
239
|
broken.set(name, {
|
|
275
240
|
name,
|
|
276
241
|
description: '',
|
|
277
242
|
artifacts: [],
|
|
278
243
|
source,
|
|
279
244
|
path: path.join(dir, name),
|
|
280
|
-
|
|
281
|
-
// and the one who runs `tospec templates --schema <name>` read the
|
|
282
|
-
// same sentence about the same file.
|
|
283
|
-
error: error instanceof SchemaValidationError
|
|
284
|
-
? `Invalid schema at '${schemaPath}': ${detail}`
|
|
285
|
-
: `Failed to parse schema at '${schemaPath}': ${detail}`,
|
|
245
|
+
error: schemaParseFailureMessage(path.join(dir, name, 'schema.yaml'), error),
|
|
286
246
|
});
|
|
287
247
|
}
|
|
288
248
|
}
|
|
@@ -292,13 +252,12 @@ export function listSchemasWithInfo(projectRoot) {
|
|
|
292
252
|
/**
|
|
293
253
|
* Union of every artifact ID across every available schema.
|
|
294
254
|
*
|
|
295
|
-
* Config keys
|
|
296
|
-
* legitimately name an artifact from any schema, so they
|
|
297
|
-
*
|
|
255
|
+
* Config keys scoped per-artifact but stored globally (`rules:`) can
|
|
256
|
+
* legitimately name an artifact from any schema, so they are checked against the
|
|
257
|
+
* union rather than the current change's schema.
|
|
298
258
|
*
|
|
299
|
-
* Built on listSchemasWithInfo
|
|
300
|
-
*
|
|
301
|
-
* custom schema must not turn every rules key into an unknown ID.
|
|
259
|
+
* Built on listSchemasWithInfo to inherit its tolerance for a schema that fails
|
|
260
|
+
* to parse: one broken custom schema must not turn every rules key unknown.
|
|
302
261
|
*/
|
|
303
262
|
export function collectAllArtifactIds(projectRoot) {
|
|
304
263
|
return new Set(listSchemasWithInfo(projectRoot).flatMap((schema) => schema.artifacts));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.js","sourceRoot":"","sources":["../../../src/core/artifact-graph/resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGjE
|
|
1
|
+
{"version":3,"file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C,CAAC;AACzF,CAAC"}
|
|
@@ -2,12 +2,6 @@ import { type SchemaYaml } from './types.js';
|
|
|
2
2
|
export declare class SchemaValidationError extends Error {
|
|
3
3
|
constructor(message: string);
|
|
4
4
|
}
|
|
5
|
-
/**
|
|
6
|
-
* Loads and validates an artifact schema from a YAML file.
|
|
7
|
-
*/
|
|
8
5
|
export declare function loadSchema(filePath: string): SchemaYaml;
|
|
9
|
-
/**
|
|
10
|
-
* Parses and validates an artifact schema from YAML content.
|
|
11
|
-
*/
|
|
12
6
|
export declare function parseSchema(yamlContent: string): SchemaYaml;
|
|
13
7
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/core/artifact-graph/schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,KAAK,UAAU,EAAiB,MAAM,YAAY,CAAC;AAE9E,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAED
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/core/artifact-graph/schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,KAAK,UAAU,EAAiB,MAAM,YAAY,CAAC;AAE9E,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAEvD;AAED,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU,CAmB3D"}
|
|
@@ -7,44 +7,29 @@ export class SchemaValidationError extends Error {
|
|
|
7
7
|
this.name = 'SchemaValidationError';
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
11
|
-
* Loads and validates an artifact schema from a YAML file.
|
|
12
|
-
*/
|
|
13
10
|
export function loadSchema(filePath) {
|
|
14
|
-
|
|
15
|
-
return parseSchema(content);
|
|
11
|
+
return parseSchema(fs.readFileSync(filePath, 'utf-8'));
|
|
16
12
|
}
|
|
17
|
-
/**
|
|
18
|
-
* Parses and validates an artifact schema from YAML content.
|
|
19
|
-
*/
|
|
20
13
|
export function parseSchema(yamlContent) {
|
|
21
14
|
const parsed = parseYaml(yamlContent);
|
|
22
|
-
// Validate with Zod
|
|
23
15
|
const result = SchemaYamlSchema.safeParse(parsed);
|
|
24
16
|
if (!result.success) {
|
|
25
17
|
const errors = result.error.issues.map(e => `${e.path.join('.')}: ${e.message}`).join(', ');
|
|
26
18
|
throw new SchemaValidationError(`Invalid schema: ${errors}`);
|
|
27
19
|
}
|
|
28
20
|
const schema = result.data;
|
|
29
|
-
// Check for duplicate artifact IDs
|
|
30
21
|
validateNoDuplicateIds(schema.artifacts);
|
|
31
|
-
// Check that all requires references are valid
|
|
32
22
|
validateRequiresReferences(schema.artifacts);
|
|
33
|
-
// Check for cycles
|
|
34
23
|
validateNoCycles(schema.artifacts);
|
|
35
|
-
// apply.requires names artifacts too,
|
|
36
|
-
//
|
|
37
|
-
// applyRequires: ["ghost"], sending agents to look for an artifact the schema
|
|
38
|
-
// never defines.
|
|
24
|
+
// apply.requires names artifacts too: unchecked, an unknown id reaches
|
|
25
|
+
// `status --json` verbatim as applyRequires: ["ghost"].
|
|
39
26
|
validateApplyReferences(schema);
|
|
40
27
|
return schema;
|
|
41
28
|
}
|
|
42
29
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* directory, not an artifact id, and that file legitimately does not exist until
|
|
47
|
-
* the change is scaffolded.
|
|
30
|
+
* `tracks` is not checked alongside `requires`: it names a file inside the
|
|
31
|
+
* change directory, not an artifact id, and that file legitimately does not
|
|
32
|
+
* exist until the change is scaffolded.
|
|
48
33
|
*/
|
|
49
34
|
function validateApplyReferences(schema) {
|
|
50
35
|
if (!schema.apply)
|
|
@@ -56,9 +41,6 @@ function validateApplyReferences(schema) {
|
|
|
56
41
|
}
|
|
57
42
|
}
|
|
58
43
|
}
|
|
59
|
-
/**
|
|
60
|
-
* Validates that there are no duplicate artifact IDs.
|
|
61
|
-
*/
|
|
62
44
|
function validateNoDuplicateIds(artifacts) {
|
|
63
45
|
const seen = new Set();
|
|
64
46
|
for (const artifact of artifacts) {
|
|
@@ -68,9 +50,6 @@ function validateNoDuplicateIds(artifacts) {
|
|
|
68
50
|
seen.add(artifact.id);
|
|
69
51
|
}
|
|
70
52
|
}
|
|
71
|
-
/**
|
|
72
|
-
* Validates that all `requires` references point to valid artifact IDs.
|
|
73
|
-
*/
|
|
74
53
|
function validateRequiresReferences(artifacts) {
|
|
75
54
|
const validIds = new Set(artifacts.map(a => a.id));
|
|
76
55
|
for (const artifact of artifacts) {
|
|
@@ -81,10 +60,7 @@ function validateRequiresReferences(artifacts) {
|
|
|
81
60
|
}
|
|
82
61
|
}
|
|
83
62
|
}
|
|
84
|
-
/**
|
|
85
|
-
* Validates that there are no cyclic dependencies.
|
|
86
|
-
* Uses DFS to detect cycles and reports the full cycle path.
|
|
87
|
-
*/
|
|
63
|
+
/** DFS cycle detection; the thrown message names the full cycle path. */
|
|
88
64
|
function validateNoCycles(artifacts) {
|
|
89
65
|
const artifactMap = new Map(artifacts.map(a => [a.id, a]));
|
|
90
66
|
const visited = new Set();
|
|
@@ -104,7 +80,6 @@ function validateNoCycles(artifacts) {
|
|
|
104
80
|
return cycle;
|
|
105
81
|
}
|
|
106
82
|
else if (inStack.has(dep)) {
|
|
107
|
-
// Found a cycle - reconstruct the path
|
|
108
83
|
const cyclePath = [dep];
|
|
109
84
|
let current = id;
|
|
110
85
|
while (current !== dep) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/core/artifact-graph/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAA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ACpB,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;gBACvB,IAAI,KAAK;oBAAE,OAAO,KAAK,CAAC;YAC1B,CAAC;iBAAM,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC5B,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,CAAC;gBACxB,IAAI,OAAO,GAAG,EAAE,CAAC;gBACjB,OAAO,OAAO,KAAK,GAAG,EAAE,CAAC;oBACvB,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;oBAC3B,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAE,CAAC;gBACjC,CAAC;gBACD,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;gBACvB,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;YAC9B,MAAM,KAAK,GAAG,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YAC/B,IAAI,KAAK,EAAE,CAAC;gBACV,MAAM,IAAI,qBAAqB,CAAC,+BAA+B,KAAK,EAAE,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import type { CompletedSet } from './types.js';
|
|
2
2
|
import type { ArtifactGraph } from './graph.js';
|
|
3
|
-
/**
|
|
4
|
-
* Detects which artifacts are completed by checking file existence in the change directory.
|
|
5
|
-
* Returns a Set of completed artifact IDs.
|
|
6
|
-
*
|
|
7
|
-
* @param graph - The artifact graph to check
|
|
8
|
-
* @param changeDir - The change directory to scan for files
|
|
9
|
-
* @returns Set of artifact IDs whose generated files exist
|
|
10
|
-
*/
|
|
3
|
+
/** Artifact IDs whose `generates` output (path or glob) exists on disk. */
|
|
11
4
|
export declare function detectCompleted(graph: ArtifactGraph, changeDir: string): CompletedSet;
|
|
12
5
|
//# sourceMappingURL=state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/core/artifact-graph/state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/core/artifact-graph/state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,2EAA2E;AAC3E,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY,CAarF"}
|
|
@@ -1,31 +1,16 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
import { artifactOutputExists } from './outputs.js';
|
|
3
|
-
/**
|
|
4
|
-
* Detects which artifacts are completed by checking file existence in the change directory.
|
|
5
|
-
* Returns a Set of completed artifact IDs.
|
|
6
|
-
*
|
|
7
|
-
* @param graph - The artifact graph to check
|
|
8
|
-
* @param changeDir - The change directory to scan for files
|
|
9
|
-
* @returns Set of artifact IDs whose generated files exist
|
|
10
|
-
*/
|
|
3
|
+
/** Artifact IDs whose `generates` output (path or glob) exists on disk. */
|
|
11
4
|
export function detectCompleted(graph, changeDir) {
|
|
12
5
|
const completed = new Set();
|
|
13
|
-
// Handle missing change directory gracefully
|
|
14
6
|
if (!fs.existsSync(changeDir)) {
|
|
15
7
|
return completed;
|
|
16
8
|
}
|
|
17
9
|
for (const artifact of graph.getAllArtifacts()) {
|
|
18
|
-
if (
|
|
10
|
+
if (artifactOutputExists(changeDir, artifact.generates)) {
|
|
19
11
|
completed.add(artifact.id);
|
|
20
12
|
}
|
|
21
13
|
}
|
|
22
14
|
return completed;
|
|
23
15
|
}
|
|
24
|
-
/**
|
|
25
|
-
* Checks if an artifact is complete by checking if its generated file(s) exist.
|
|
26
|
-
* Supports both simple paths and glob patterns.
|
|
27
|
-
*/
|
|
28
|
-
function isArtifactComplete(generates, changeDir) {
|
|
29
|
-
return artifactOutputExists(changeDir, generates);
|
|
30
|
-
}
|
|
31
16
|
//# sourceMappingURL=state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/core/artifact-graph/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAG9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/core/artifact-graph/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAG9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,2EAA2E;AAC3E,MAAM,UAAU,eAAe,CAAC,KAAoB,EAAE,SAAiB;IACrE,MAAM,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;IACpC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,KAAK,MAAM,QAAQ,IAAI,KAAK,CAAC,eAAe,EAAE,EAAE,CAAC;QAC/C,IAAI,oBAAoB,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YACxD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The one definition of "this artifact file is still the template"
|
|
2
|
+
* The one definition of "this artifact file is still the template": empty,
|
|
3
|
+
* whitespace-only, or byte-identical to it.
|
|
3
4
|
*
|
|
4
|
-
* `status` and `validate
|
|
5
|
-
*
|
|
6
|
-
* a change whose proposal, design and tasks were verbatim templates was
|
|
7
|
-
* reported valid by the command CI and agents call as the last gate before
|
|
8
|
-
* archive (round 4 report 4). Sharing the predicate is what keeps the two
|
|
9
|
-
* answers the same.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* True when the file is empty/whitespace-only or byte-identical to its
|
|
13
|
-
* template.
|
|
5
|
+
* Shared by `status` and `validate`, which must agree: a change of verbatim
|
|
6
|
+
* templates would otherwise pass the last gate before archive.
|
|
14
7
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* `validation/section-validator.ts`, which measure real content per section.
|
|
8
|
+
* Cheap on purpose. A deeper "headings replaced, placeholders left" analysis
|
|
9
|
+
* belongs to the section rules in `validation/section-validator.ts`.
|
|
18
10
|
*/
|
|
19
11
|
export declare function isStubArtifactFile(file: string, schemaName: string, templatePath: string, projectRoot: string): boolean;
|
|
20
12
|
//# sourceMappingURL=stub-detection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stub-detection.d.ts","sourceRoot":"","sources":["../../../src/core/artifact-graph/stub-detection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stub-detection.d.ts","sourceRoot":"","sources":["../../../src/core/artifact-graph/stub-detection.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,GAClB,OAAO,CAqBT"}
|
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The one definition of "this artifact file is still the template".
|
|
3
|
-
*
|
|
4
|
-
* `status` and `validate` both need it and used to disagree: `status` computed
|
|
5
|
-
* it (reporting `stub`) while `validate --strict` had no notion of it at all, so
|
|
6
|
-
* a change whose proposal, design and tasks were verbatim templates was
|
|
7
|
-
* reported valid by the command CI and agents call as the last gate before
|
|
8
|
-
* archive (round 4 report 4). Sharing the predicate is what keeps the two
|
|
9
|
-
* answers the same.
|
|
10
|
-
*/
|
|
11
1
|
import * as fs from 'fs';
|
|
2
|
+
import { stripBom } from '../parsers/requirement-text.js';
|
|
12
3
|
import { loadTemplate } from './instruction-loader.js';
|
|
13
4
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
5
|
+
* The one definition of "this artifact file is still the template": empty,
|
|
6
|
+
* whitespace-only, or byte-identical to it.
|
|
7
|
+
*
|
|
8
|
+
* Shared by `status` and `validate`, which must agree: a change of verbatim
|
|
9
|
+
* templates would otherwise pass the last gate before archive.
|
|
16
10
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* `validation/section-validator.ts`, which measure real content per section.
|
|
11
|
+
* Cheap on purpose. A deeper "headings replaced, placeholders left" analysis
|
|
12
|
+
* belongs to the section rules in `validation/section-validator.ts`.
|
|
20
13
|
*/
|
|
21
14
|
export function isStubArtifactFile(file, schemaName, templatePath, projectRoot) {
|
|
22
15
|
let content;
|
|
@@ -37,6 +30,10 @@ export function isStubArtifactFile(file, schemaName, templatePath, projectRoot)
|
|
|
37
30
|
// No template to compare against — say nothing rather than guess.
|
|
38
31
|
return false;
|
|
39
32
|
}
|
|
40
|
-
|
|
33
|
+
// Compared BOM-free: this is a byte-identity test, so opening the untouched
|
|
34
|
+
// template in a Windows editor and saving it would otherwise make a verbatim
|
|
35
|
+
// stub look edited — inverting the gate, which exists to stop exactly that
|
|
36
|
+
// file reaching archive. The template ships from the package and never has one.
|
|
37
|
+
return stripBom(content) === template;
|
|
41
38
|
}
|
|
42
39
|
//# sourceMappingURL=stub-detection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stub-detection.js","sourceRoot":"","sources":["../../../src/core/artifact-graph/stub-detection.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"stub-detection.js","sourceRoot":"","sources":["../../../src/core/artifact-graph/stub-detection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAY,EACZ,UAAkB,EAClB,YAAoB,EACpB,WAAmB;IAEnB,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,4EAA4E;QAC5E,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7C,IAAI,QAAgB,CAAC;IACrB,IAAI,CAAC;QACH,QAAQ,GAAG,YAAY,CAAC,UAAU,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;IACjE,CAAC;IAAC,MAAM,CAAC;QACP,kEAAkE;QAClE,OAAO,KAAK,CAAC;IACf,CAAC;IACD,4EAA4E;IAC5E,6EAA6E;IAC7E,2EAA2E;IAC3E,gFAAgF;IAChF,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;AACxC,CAAC"}
|