@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
|
@@ -1,30 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The directory layout `tospec init` creates, and the anchors that make it
|
|
3
|
-
* survive version control.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* the first command that looks for one reports the project as uninitialized.
|
|
8
|
-
* Nothing is lost — every writer creates the directory it needs on demand — but
|
|
9
|
-
* a diagnostic that sends the reader to re-run a command that will change
|
|
10
|
-
* nothing is worse than a crash.
|
|
3
|
+
* survive version control. Git does not track an empty directory, so without
|
|
4
|
+
* them a collaborator clones a layout whose directories are gone and the first
|
|
5
|
+
* command reports the project as uninitialized — nothing is lost, but the
|
|
6
|
+
* diagnostic sends the reader to re-run a command that changes nothing.
|
|
11
7
|
*/
|
|
12
8
|
import path from 'path';
|
|
13
9
|
import { promises as fs } from 'fs';
|
|
14
10
|
/**
|
|
15
|
-
* Relative to `tospec/`, in creation order.
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* whether it ends up empty, and `changes/` never does because it holds
|
|
19
|
-
* `archive/`. A name asserting the property would be wrong for the next
|
|
20
|
-
* directory that ships with content.
|
|
11
|
+
* Relative to `tospec/`, in creation order. Not named for anchoring: whether a
|
|
12
|
+
* directory gets an anchor is computed from whether it ends up empty, and
|
|
13
|
+
* `changes/` never does because it holds `archive/`.
|
|
21
14
|
*/
|
|
22
15
|
export const TOSPEC_LAYOUT_DIRS = [
|
|
23
16
|
'specs',
|
|
24
17
|
'changes',
|
|
25
18
|
'changes/archive',
|
|
26
|
-
// Permanent decision records (`tospec decision new`)
|
|
27
|
-
// layout is visible from the start
|
|
19
|
+
// Permanent decision records (`tospec decision new`), scaffolded here so the
|
|
20
|
+
// layout is visible from the start rather than appearing on first use.
|
|
28
21
|
'decisions',
|
|
29
22
|
];
|
|
30
23
|
const DIRECTORY_ANCHOR_FILE_NAME = '.gitkeep';
|
|
@@ -33,27 +26,24 @@ export function tospecLayoutDirs(tospecPath) {
|
|
|
33
26
|
return TOSPEC_LAYOUT_DIRS.map((relative) => path.join(tospecPath, relative));
|
|
34
27
|
}
|
|
35
28
|
/**
|
|
36
|
-
* Anchor `directory` if it is empty.
|
|
37
|
-
*
|
|
38
|
-
* and adding one beside real content leaves a file nobody asked for.
|
|
29
|
+
* Anchor `directory` if it is empty. An anchor exists to make an empty directory
|
|
30
|
+
* representable, so adding one beside real content leaves a file nobody wanted.
|
|
39
31
|
*/
|
|
40
32
|
export async function ensureDirectoryAnchor(directory) {
|
|
41
33
|
if ((await fs.readdir(directory)).length > 0)
|
|
42
34
|
return;
|
|
43
35
|
try {
|
|
44
|
-
// Exclusive create
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
// content the anchor never owned, or write *through* a link into a path
|
|
48
|
-
// outside the project entirely.
|
|
36
|
+
// Exclusive create, closing the window after the emptiness check where a
|
|
37
|
+
// file or link can appear at the anchor's path: an ordinary write would
|
|
38
|
+
// overwrite content the anchor never owned, or write *through* a link.
|
|
49
39
|
await fs.writeFile(path.join(directory, DIRECTORY_ANCHOR_FILE_NAME), '', {
|
|
50
40
|
encoding: 'utf-8',
|
|
51
41
|
flag: 'wx',
|
|
52
42
|
});
|
|
53
43
|
}
|
|
54
44
|
catch (error) {
|
|
55
|
-
// Something is already there, so the directory
|
|
56
|
-
//
|
|
45
|
+
// Something is already there, so the directory needs no anchor: done, not
|
|
46
|
+
// a failure.
|
|
57
47
|
if (error?.code === 'EEXIST')
|
|
58
48
|
return;
|
|
59
49
|
throw error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-layout.js","sourceRoot":"","sources":["../../src/core/project-layout.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"project-layout.js","sourceRoot":"","sources":["../../src/core/project-layout.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,OAAO;IACP,SAAS;IACT,iBAAiB;IACjB,6EAA6E;IAC7E,uEAAuE;IACvE,WAAW;CACH,CAAC;AAEX,MAAM,0BAA0B,GAAG,UAAU,CAAC;AAE9C,yEAAyE;AACzE,MAAM,UAAU,gBAAgB,CAAC,UAAkB;IACjD,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,SAAiB;IAC3D,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO;IAErD,IAAI,CAAC;QACH,yEAAyE;QACzE,wEAAwE;QACxE,uEAAuE;QACvE,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,0BAA0B,CAAC,EAAE,EAAE,EAAE;YACvE,QAAQ,EAAE,OAAO;YACjB,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,0EAA0E;QAC1E,aAAa;QACb,IAAK,KAA+B,EAAE,IAAI,KAAK,QAAQ;YAAE,OAAO;QAChE,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* rule: walk up from the start path to the nearest ancestor that contains a
|
|
6
|
-
* `tospec/` directory; if none is found, treat the current directory as an
|
|
7
|
-
* implicit root (unless the caller forbids it).
|
|
2
|
+
* Root resolution: walk up from the start path to the nearest ancestor holding
|
|
3
|
+
* a `tospec/` directory, else treat the current directory as an implicit root
|
|
4
|
+
* unless the caller forbids it.
|
|
8
5
|
*/
|
|
9
6
|
import { type PlanningHome } from './planning-home.js';
|
|
10
7
|
/**
|
|
11
|
-
* How a command arrived at the root it reports.
|
|
12
|
-
*
|
|
13
|
-
* `
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* to omit `source` entirely, and `JSON.stringify` drops an absent key, so a
|
|
17
|
-
* caller reading `root.source` could not tell "this command does not resolve a
|
|
18
|
-
* root" from "the field was renamed". Naming the case keeps the key present.
|
|
8
|
+
* How a command arrived at the root it reports. `nearest` and `implicit` are the
|
|
9
|
+
* two outcomes of *searching*; `explicit` is the install layer (`init`,
|
|
10
|
+
* `update`, `rules`, `migrate`), which operates on the path it was handed.
|
|
11
|
+
* Naming that case keeps the key present: `JSON.stringify` drops an omitted
|
|
12
|
+
* one, leaving a caller unable to tell it from a renamed field.
|
|
19
13
|
*/
|
|
20
14
|
export type TospecRootSource = 'nearest' | 'implicit' | 'explicit';
|
|
21
15
|
export interface ResolveTospecRootOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-selection.d.ts","sourceRoot":"","sources":["../../src/core/root-selection.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"root-selection.d.ts","sourceRoot":"","sources":["../../src/core/root-selection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,oBAA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AC1E,wBAAgB,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,YAAY,CAOrE;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,OAAO,EAClB,MAAM,GAAE;IACN,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACxB,GACL,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAgBpC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* rule: walk up from the start path to the nearest ancestor that contains a
|
|
6
|
-
* `tospec/` directory; if none is found, treat the current directory as an
|
|
7
|
-
* implicit root (unless the caller forbids it).
|
|
2
|
+
* Root resolution: walk up from the start path to the nearest ancestor holding
|
|
3
|
+
* a `tospec/` directory, else treat the current directory as an implicit root
|
|
4
|
+
* unless the caller forbids it.
|
|
8
5
|
*/
|
|
9
6
|
import * as path from 'node:path';
|
|
10
7
|
import { findRepoPlanningRootSync, getSearchStartDirectory, } from './planning-home.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-selection.js","sourceRoot":"","sources":["../../src/core/root-selection.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"root-selection.js","sourceRoot":"","sources":["../../src/core/root-selection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EACL,wBAAwB,EACxB,uBAAuB,GAExB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAkCrF,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,UAAU,CAA0B;IAE7C,YACE,OAAe,EACf,IAAY,EACZ,OA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AAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,gFAAgF;AAChF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAA+B,CAAC;AAE1F,oFAAoF;AACpF,qBAAa,YAAY;IACjB,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/core/rules.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,gFAAgF;AAChF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAA+B,CAAC;AAE1F,oFAAoF;AACpF,qBAAa,YAAY;IACjB,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkClF;CACF"}
|
package/dist/core/rules.js
CHANGED
|
@@ -16,9 +16,8 @@ export class RulesCommand {
|
|
|
16
16
|
const tools = getConfiguredTools(projectPath);
|
|
17
17
|
if (tools.length === 0) {
|
|
18
18
|
// Not an error: a project can legitimately have no agent configured. The
|
|
19
|
-
// JSON form says so with an empty list
|
|
20
|
-
//
|
|
21
|
-
// English.
|
|
19
|
+
// JSON form says so with an empty list, so a caller need not read English
|
|
20
|
+
// to tell "nothing to do" from "something went wrong".
|
|
22
21
|
if (options.json) {
|
|
23
22
|
emitSuccess({ rules: [], message: 'No configured tools found.' }, { path: projectPath, source: 'explicit' });
|
|
24
23
|
return;
|
package/dist/core/rules.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/core/rules.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eA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K,CAAC,MAAM;oBAClB,IAAI,EAAE,KAAK,CAAC,IAAI;oBAChB,IAAI,EAAE,KAAK,CAAC,WAAW;oBACvB,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBACvD,CAAC,CAAC;aACJ,EACD,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,CAC1C,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema names the command layer keys behaviour on. Kept out of any command
|
|
3
|
+
* module: `workflow/shared.ts` needs the decision name to refuse it for `new
|
|
4
|
+
* change`, and `decision.ts` needs the default schema to complete a root — with
|
|
5
|
+
* the constants living in those two files, each imported the other and the
|
|
6
|
+
* ESM cycle left one of them reading `undefined` depending on entry order.
|
|
7
|
+
*/
|
|
8
|
+
/** The schema `new change` and `templates` fall back to. */
|
|
9
|
+
export declare const DEFAULT_SCHEMA = "sdd";
|
|
10
|
+
/**
|
|
11
|
+
* Backs the ADR writer, not the change graph: a change created against it
|
|
12
|
+
* lands under `tospec/changes/` where `decision list` never sees it, so `new
|
|
13
|
+
* change` refuses it by name.
|
|
14
|
+
*/
|
|
15
|
+
export declare const DECISION_SCHEMA_NAME = "decision";
|
|
16
|
+
//# sourceMappingURL=schema-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-names.d.ts","sourceRoot":"","sources":["../../src/core/schema-names.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,4DAA4D;AAC5D,eAAO,MAAM,cAAc,QAAQ,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,aAAa,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema names the command layer keys behaviour on. Kept out of any command
|
|
3
|
+
* module: `workflow/shared.ts` needs the decision name to refuse it for `new
|
|
4
|
+
* change`, and `decision.ts` needs the default schema to complete a root — with
|
|
5
|
+
* the constants living in those two files, each imported the other and the
|
|
6
|
+
* ESM cycle left one of them reading `undefined` depending on entry order.
|
|
7
|
+
*/
|
|
8
|
+
/** The schema `new change` and `templates` fall back to. */
|
|
9
|
+
export const DEFAULT_SCHEMA = 'sdd';
|
|
10
|
+
/**
|
|
11
|
+
* Backs the ADR writer, not the change graph: a change created against it
|
|
12
|
+
* lands under `tospec/changes/` where `decision list` never sees it, so `new
|
|
13
|
+
* change` refuses it by name.
|
|
14
|
+
*/
|
|
15
|
+
export const DECISION_SCHEMA_NAME = 'decision';
|
|
16
|
+
//# sourceMappingURL=schema-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-names.js","sourceRoot":"","sources":["../../src/core/schema-names.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.schema.d.ts","sourceRoot":"","sources":["../../../src/core/schemas/base.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,cAAc;;;iBASzB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;
|
|
1
|
+
{"version":3,"file":"base.schema.d.ts","sourceRoot":"","sources":["../../../src/core/schemas/base.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,cAAc;;;iBASzB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;iBAoB5B,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -15,23 +15,17 @@ export const RequirementSchema = z.object({
|
|
|
15
15
|
* The `### Requirement: <name>` heading text, without the `Requirement:`
|
|
16
16
|
* prefix.
|
|
17
17
|
*
|
|
18
|
-
* Carried rather than discarded
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* the one command an agent would use to read the current spec withheld the
|
|
22
|
-
* single field needed to write a delta against it, forcing a fall back to
|
|
23
|
-
* parsing raw Markdown.
|
|
18
|
+
* Carried rather than discarded: a MODIFIED, REMOVED or RENAMED delta must
|
|
19
|
+
* reproduce the header exactly and archive hard-fails on a mismatch, so
|
|
20
|
+
* `show --json` has to report it.
|
|
24
21
|
*
|
|
25
22
|
* Optional in the schema so a hand-built Requirement need not supply one;
|
|
26
23
|
* every parsed requirement carries it.
|
|
27
24
|
*/
|
|
28
25
|
name: z.string().optional(),
|
|
29
|
-
// SHALL/MUST body-keyword enforcement lives in the
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
// only" from "keyword in body" and emits a misleading generic error. The
|
|
33
|
-
// validator recovers the header and emits the targeted hint for both the
|
|
34
|
-
// main-spec and change-delta paths (#1156).
|
|
26
|
+
// SHALL/MUST body-keyword enforcement lives in Validator.applySpecRules: the
|
|
27
|
+
// parser collapses the requirement header into `text`, so a Zod refine here
|
|
28
|
+
// cannot tell "keyword in header only" from "keyword in body".
|
|
35
29
|
text: z.string()
|
|
36
30
|
.min(1, VALIDATION_MESSAGES.REQUIREMENT_EMPTY),
|
|
37
31
|
scenarios: z.array(ScenarioSchema)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.schema.js","sourceRoot":"","sources":["../../../src/core/schemas/base.schema.ts"],"names":[],"mappings":"AAAA,OAAO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,EAAE,mBAAmB,CAAC,wBAAwB,CAAC;CACxD,CAAC,CAAC"}
|
|
@@ -35,6 +35,14 @@ export declare const DeltaSchema: z.ZodObject<{
|
|
|
35
35
|
to: z.ZodString;
|
|
36
36
|
}, z.core.$strip>>;
|
|
37
37
|
}, z.core.$strip>;
|
|
38
|
+
/**
|
|
39
|
+
* The *shape* of a parsed change — what `ChangeParser` returns and what `Change`
|
|
40
|
+
* is inferred from — not where a change's rules live. Those are in
|
|
41
|
+
* `schemas/<name>/schema.yaml` (read by `validateSections`) and
|
|
42
|
+
* `validateChangeDeltaSpecs`.
|
|
43
|
+
*
|
|
44
|
+
* Keep it that way: nothing in `src/` runs a rule added here.
|
|
45
|
+
*/
|
|
38
46
|
export declare const ChangeSchema: z.ZodObject<{
|
|
39
47
|
name: z.ZodString;
|
|
40
48
|
why: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change.schema.d.ts","sourceRoot":"","sources":["../../../src/core/schemas/change.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"change.schema.d.ts","sourceRoot":"","sources":["../../../src/core/schemas/change.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,kBAAkB;;;;;EAAsD,CAAC;AAatF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BtB,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUvB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAChD,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -1,27 +1,58 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { RequirementSchema } from './base.schema.js';
|
|
3
|
-
import {
|
|
2
|
+
import { RequirementSchema, ScenarioSchema } from './base.schema.js';
|
|
3
|
+
import { VALIDATION_MESSAGES } from '../validation/constants.js';
|
|
4
4
|
export const DeltaOperationType = z.enum(['ADDED', 'MODIFIED', 'REMOVED', 'RENAMED']);
|
|
5
|
+
/**
|
|
6
|
+
* A requirement as a delta carries it. Identical to RequirementSchema except
|
|
7
|
+
* that the scenario list may be empty, because a REMOVED entry names a
|
|
8
|
+
* requirement that is going away: the canonical form for it is a bullet with
|
|
9
|
+
* Reason/Migration fields, which has no scenarios to restate. The min-1 rule
|
|
10
|
+
* still applies to every other operation — see the refinement below.
|
|
11
|
+
*/
|
|
12
|
+
const DeltaRequirementSchema = RequirementSchema.extend({
|
|
13
|
+
scenarios: z.array(ScenarioSchema),
|
|
14
|
+
});
|
|
5
15
|
export const DeltaSchema = z.object({
|
|
6
16
|
spec: z.string().min(1, VALIDATION_MESSAGES.DELTA_SPEC_EMPTY),
|
|
7
17
|
operation: DeltaOperationType,
|
|
8
18
|
description: z.string().min(1, VALIDATION_MESSAGES.DELTA_DESCRIPTION_EMPTY),
|
|
9
|
-
requirement:
|
|
10
|
-
requirements: z.array(
|
|
19
|
+
requirement: DeltaRequirementSchema.optional(),
|
|
20
|
+
requirements: z.array(DeltaRequirementSchema).optional(),
|
|
11
21
|
rename: z.object({
|
|
12
22
|
from: z.string(),
|
|
13
23
|
to: z.string(),
|
|
14
24
|
}).optional(),
|
|
25
|
+
}).superRefine((delta, ctx) => {
|
|
26
|
+
// Scenario-less requirements are only legal on a REMOVED delta. Enforced here
|
|
27
|
+
// rather than on the field so every operation keeps one shape.
|
|
28
|
+
if (delta.operation === 'REMOVED')
|
|
29
|
+
return;
|
|
30
|
+
const reject = (path) => ctx.addIssue({
|
|
31
|
+
code: z.ZodIssueCode.custom,
|
|
32
|
+
message: VALIDATION_MESSAGES.REQUIREMENT_NO_SCENARIOS,
|
|
33
|
+
path,
|
|
34
|
+
});
|
|
35
|
+
if (delta.requirement && delta.requirement.scenarios.length === 0) {
|
|
36
|
+
reject(['requirement', 'scenarios']);
|
|
37
|
+
}
|
|
38
|
+
delta.requirements?.forEach((requirement, index) => {
|
|
39
|
+
if (requirement.scenarios.length === 0)
|
|
40
|
+
reject(['requirements', index, 'scenarios']);
|
|
41
|
+
});
|
|
15
42
|
});
|
|
43
|
+
/**
|
|
44
|
+
* The *shape* of a parsed change — what `ChangeParser` returns and what `Change`
|
|
45
|
+
* is inferred from — not where a change's rules live. Those are in
|
|
46
|
+
* `schemas/<name>/schema.yaml` (read by `validateSections`) and
|
|
47
|
+
* `validateChangeDeltaSpecs`.
|
|
48
|
+
*
|
|
49
|
+
* Keep it that way: nothing in `src/` runs a rule added here.
|
|
50
|
+
*/
|
|
16
51
|
export const ChangeSchema = z.object({
|
|
17
52
|
name: z.string().min(1, VALIDATION_MESSAGES.CHANGE_NAME_EMPTY),
|
|
18
|
-
why: z.string()
|
|
19
|
-
.min(MIN_WHY_SECTION_LENGTH, VALIDATION_MESSAGES.CHANGE_WHY_TOO_SHORT)
|
|
20
|
-
.max(MAX_WHY_SECTION_LENGTH, VALIDATION_MESSAGES.CHANGE_WHY_TOO_LONG),
|
|
53
|
+
why: z.string(),
|
|
21
54
|
whatChanges: z.string().min(1, VALIDATION_MESSAGES.CHANGE_WHAT_EMPTY),
|
|
22
|
-
deltas: z.array(DeltaSchema)
|
|
23
|
-
.min(1, VALIDATION_MESSAGES.CHANGE_NO_DELTAS)
|
|
24
|
-
.max(MAX_DELTAS_PER_CHANGE, VALIDATION_MESSAGES.CHANGE_TOO_MANY_DELTAS),
|
|
55
|
+
deltas: z.array(DeltaSchema),
|
|
25
56
|
metadata: z.object({
|
|
26
57
|
version: z.string().default('1.0.0'),
|
|
27
58
|
format: z.literal('tospec-change'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change.schema.js","sourceRoot":"","sources":["../../../src/core/schemas/change.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"change.schema.js","sourceRoot":"","sources":["../../../src/core/schemas/change.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAEtF;;;;;;GAMG;AACH,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,MAAM,CAAC;IACtD,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;CACnC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC;IAC7D,SAAS,EAAE,kBAAkB;IAC7B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,mBAAmB,CAAC,uBAAuB,CAAC;IAC3E,WAAW,EAAE,sBAAsB,CAAC,QAAQ,EAAE;IAC9C,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,QAAQ,EAAE;IACxD,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC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WAAW,CAAC;IAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC;QACjB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;QACpC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;QAClC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAClC,CAAC,CAAC,QAAQ,EAAE;CACd,CAAC,CAAC"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Common code shared between init and update commands.
|
|
5
|
-
*/
|
|
6
|
-
export { SKILL_NAMES, LEGACY_SKILL_DIRS, type ToolSkillStatus, type ToolVersionStatus, removeLegacySkillDirs, removeLegacyToolSkillLayout, getToolsWithSkillsDir, getToolSkillStatus, getToolStates, extractGeneratedByVersion, getToolVersionStatus, getConfiguredTools, } from './tool-detection.js';
|
|
7
|
-
export { type SkillTemplateEntry, type CommandTemplateEntry, getSkillTemplates, getCommandTemplates, getCommandContents, generateSkillContent, writeSkillDir, writeToolCommands, } from './skill-generation.js';
|
|
1
|
+
export { SKILL_NAMES, LEGACY_SKILL_DIRS, type ToolSkillStatus, type ToolVersionStatus, removeLegacySkillDirs, removeUnselectedSkillDirs, removeLegacyToolSkillLayout, getToolsWithSkillsDir, getToolSkillStatus, getToolStates, extractGeneratedByVersion, getToolVersionStatus, getConfiguredTools, } from './tool-detection.js';
|
|
2
|
+
export { type SkillTemplateEntry, type CommandTemplateEntry, type WorkflowReferenceGap, getSkillTemplates, getCommandTemplates, getCommandContents, generateSkillContent, writeSkillDir, writeToolCommands, findWorkflowReferenceGaps, describeWorkflowReferenceGaps, } from './skill-generation.js';
|
|
8
3
|
export { planWorkflowRules, writeWorkflowRules } from './rules-generation.js';
|
|
9
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/shared/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Common code shared between init and update commands.
|
|
5
|
-
*/
|
|
6
|
-
export { SKILL_NAMES, LEGACY_SKILL_DIRS, removeLegacySkillDirs, removeLegacyToolSkillLayout, getToolsWithSkillsDir, getToolSkillStatus, getToolStates, extractGeneratedByVersion, getToolVersionStatus, getConfiguredTools, } from './tool-detection.js';
|
|
7
|
-
export { getSkillTemplates, getCommandTemplates, getCommandContents, generateSkillContent, writeSkillDir, writeToolCommands, } from './skill-generation.js';
|
|
1
|
+
export { SKILL_NAMES, LEGACY_SKILL_DIRS, removeLegacySkillDirs, removeUnselectedSkillDirs, removeLegacyToolSkillLayout, getToolsWithSkillsDir, getToolSkillStatus, getToolStates, extractGeneratedByVersion, getToolVersionStatus, getConfiguredTools, } from './tool-detection.js';
|
|
2
|
+
export { getSkillTemplates, getCommandTemplates, getCommandContents, generateSkillContent, writeSkillDir, writeToolCommands, findWorkflowReferenceGaps, describeWorkflowReferenceGaps, } from './skill-generation.js';
|
|
8
3
|
export { planWorkflowRules, writeWorkflowRules } from './rules-generation.js';
|
|
9
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/shared/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,iBAAiB,EAGjB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAIL,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Rules Generation
|
|
3
|
-
*
|
|
4
2
|
* Every rule document tospec writes is managed the same way: a shipped Markdown
|
|
5
3
|
* template, wrapped in a hash-stamped marker, planned read-only before any
|
|
6
|
-
* project write, and refused rather than overwritten once somebody has edited
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* unconditionally, with no marker to tell a generated file from an edited one and
|
|
10
|
-
* no entry in what `rules`/`update` reported. Editing it therefore lost the edit
|
|
11
|
-
* on the next `tospec init`, silently, in the default path, while its sibling in
|
|
12
|
-
* the same directory refused even `--force`. Two standards in one directory teach
|
|
13
|
-
* the safer one and then break it, so there is now only one.
|
|
4
|
+
* project write, and refused rather than overwritten once somebody has edited
|
|
5
|
+
* it. Without the marker there is no way to tell a generated file from an
|
|
6
|
+
* edited one, and `tospec init` silently loses the edit.
|
|
14
7
|
*/
|
|
15
8
|
export interface WorkflowRulePlan {
|
|
16
9
|
toolId: string;
|
|
@@ -28,11 +21,8 @@ export interface WorkflowRulePlan {
|
|
|
28
21
|
/** Read every target before allowing any project mutation. */
|
|
29
22
|
export declare function planWorkflowRules(projectPath: string, toolIds: string[]): Promise<WorkflowRulePlan[]>;
|
|
30
23
|
/**
|
|
31
|
-
* Call only after the complete plan passed preflight.
|
|
32
|
-
*
|
|
33
|
-
* `silent` suppresses the progress prose for a `--json` caller, which reports
|
|
34
|
-
* the same facts from the plan itself — prose on stdout would break the
|
|
35
|
-
* one-document envelope.
|
|
24
|
+
* Call only after the complete plan passed preflight. `silent` suppresses the
|
|
25
|
+
* progress prose for a `--json` caller, whose stdout must stay one document.
|
|
36
26
|
*/
|
|
37
27
|
export declare function writeWorkflowRules(plan: WorkflowRulePlan[], options?: {
|
|
38
28
|
silent?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules-generation.d.ts","sourceRoot":"","sources":["../../../src/core/shared/rules-generation.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"rules-generation.d.ts","sourceRoot":"","sources":["../../../src/core/shared/rules-generation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoEH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;IAC5C;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAuCD,8DAA8D;AAC9D,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAkE3G;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,gBAAgB,EAAE,EACxB,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACjC,OAAO,CAAC,IAAI,CAAC,CAsBf"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Rules Generation
|
|
3
|
-
*
|
|
4
2
|
* Every rule document tospec writes is managed the same way: a shipped Markdown
|
|
5
3
|
* template, wrapped in a hash-stamped marker, planned read-only before any
|
|
6
|
-
* project write, and refused rather than overwritten once somebody has edited
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* unconditionally, with no marker to tell a generated file from an edited one and
|
|
10
|
-
* no entry in what `rules`/`update` reported. Editing it therefore lost the edit
|
|
11
|
-
* on the next `tospec init`, silently, in the default path, while its sibling in
|
|
12
|
-
* the same directory refused even `--force`. Two standards in one directory teach
|
|
13
|
-
* the safer one and then break it, so there is now only one.
|
|
4
|
+
* project write, and refused rather than overwritten once somebody has edited
|
|
5
|
+
* it. Without the marker there is no way to tell a generated file from an
|
|
6
|
+
* edited one, and `tospec init` silently loses the edit.
|
|
14
7
|
*/
|
|
15
8
|
import path from 'node:path';
|
|
16
9
|
import { promises as fs } from 'node:fs';
|
|
@@ -18,9 +11,9 @@ import { createHash } from 'node:crypto';
|
|
|
18
11
|
import { AI_TOOLS, CODEX_TARGET_ID, DECISION_RULE_FILENAME, LEGACY_WORKFLOW_RULE_FILENAME, TOOL_RULES_SUBDIR, WORKFLOW_RULE_FILENAME, } from '../config.js';
|
|
19
12
|
import { FileSystemUtils } from '../../utils/file-system.js';
|
|
20
13
|
/**
|
|
21
|
-
* The exact text the init-only writer produced. Kept verbatim
|
|
22
|
-
* from the template
|
|
23
|
-
*
|
|
14
|
+
* The exact text the init-only writer produced. Kept verbatim rather than
|
|
15
|
+
* regenerated from the template: its only job is to recognise files already on
|
|
16
|
+
* disk, so it must not follow a change to the shipped body.
|
|
24
17
|
*/
|
|
25
18
|
const UNMARKED_DECISION_RULE = `# Decision
|
|
26
19
|
|
|
@@ -50,24 +43,30 @@ function bodyHash(body) {
|
|
|
50
43
|
}
|
|
51
44
|
const managedDocumentPattern = (slug) => new RegExp(`^<!-- tospec:${slug}:v1 sha256=([a-f0-9]{64}) -->\\n([\\s\\S]*\\n)<!-- \\/tospec:${slug} -->\\n$`);
|
|
52
45
|
/**
|
|
53
|
-
* Whether the file is an untouched tospec-generated rule document.
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* into a rule conflict for every project that predates the change.
|
|
46
|
+
* Whether the file is an untouched tospec-generated rule document. Every slug
|
|
47
|
+
* this rule has ever used is accepted, as is any unmarked body a previous tospec
|
|
48
|
+
* wrote: refusing either turns a routine `tospec update` into a rule conflict
|
|
49
|
+
* for every project predating the change.
|
|
58
50
|
*/
|
|
59
51
|
function isIntactDocument(rule, content) {
|
|
60
52
|
if (rule.unmarkedLegacyBodies?.some((body) => content === body))
|
|
61
53
|
return true;
|
|
62
54
|
return [rule.slug, ...(rule.legacySlugs ?? [])].some((slug) => {
|
|
63
55
|
const match = managedDocumentPattern(slug).exec(content);
|
|
64
|
-
// A dedicated file has exactly one frame;
|
|
56
|
+
// A dedicated file has exactly one frame; text outside it is somebody's.
|
|
65
57
|
return match !== null && match[0] === content
|
|
66
58
|
&& !match[2].includes(`<!-- tospec:${slug}:`)
|
|
67
59
|
&& !match[2].includes(`<!-- /tospec:${slug} -->`)
|
|
68
60
|
&& bodyHash(match[2]) === match[1];
|
|
69
61
|
});
|
|
70
62
|
}
|
|
63
|
+
function planAction(previous, content) {
|
|
64
|
+
if (previous === undefined)
|
|
65
|
+
return 'created';
|
|
66
|
+
if (previous === content)
|
|
67
|
+
return 'unchanged';
|
|
68
|
+
return 'updated';
|
|
69
|
+
}
|
|
71
70
|
/** Read every target before allowing any project mutation. */
|
|
72
71
|
export async function planWorkflowRules(projectPath, toolIds) {
|
|
73
72
|
if (toolIds.length === 0)
|
|
@@ -106,14 +105,15 @@ export async function planWorkflowRules(projectPath, toolIds) {
|
|
|
106
105
|
const legacy = path.join(rulesDir, rule.legacyFilename);
|
|
107
106
|
const legacyPrevious = await readIfPresent(legacy);
|
|
108
107
|
if (legacyPrevious !== undefined) {
|
|
109
|
-
// An edited copy under the old name is
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
-
//
|
|
108
|
+
// An edited copy under the old name is reported, not deleted: the
|
|
109
|
+
// rename is tospec's housekeeping, not a reason to drop notes. Named
|
|
110
|
+
// as the old spelling, because a user who never typed that filename
|
|
111
|
+
// cannot otherwise tell why an "old" file blocks the run.
|
|
113
112
|
if (isIntactDocument(rule, legacyPrevious))
|
|
114
113
|
retire = legacy;
|
|
115
|
-
else
|
|
116
|
-
conflicts.push(legacy);
|
|
114
|
+
else {
|
|
115
|
+
conflicts.push(`${legacy} (previous filename of ${rule.filename}; tospec would have renamed it had it not been edited)`);
|
|
116
|
+
}
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
plan.push({
|
|
@@ -121,7 +121,7 @@ export async function planWorkflowRules(projectPath, toolIds) {
|
|
|
121
121
|
rule: rule.filename,
|
|
122
122
|
destination,
|
|
123
123
|
content,
|
|
124
|
-
action: previous
|
|
124
|
+
action: planAction(previous, content),
|
|
125
125
|
...(retire ? { retire } : {}),
|
|
126
126
|
});
|
|
127
127
|
}
|
|
@@ -132,11 +132,8 @@ export async function planWorkflowRules(projectPath, toolIds) {
|
|
|
132
132
|
return plan;
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
|
-
* Call only after the complete plan passed preflight.
|
|
136
|
-
*
|
|
137
|
-
* `silent` suppresses the progress prose for a `--json` caller, which reports
|
|
138
|
-
* the same facts from the plan itself — prose on stdout would break the
|
|
139
|
-
* one-document envelope.
|
|
135
|
+
* Call only after the complete plan passed preflight. `silent` suppresses the
|
|
136
|
+
* progress prose for a `--json` caller, whose stdout must stay one document.
|
|
140
137
|
*/
|
|
141
138
|
export async function writeWorkflowRules(plan, options = {}) {
|
|
142
139
|
const say = (line) => {
|
|
@@ -148,17 +145,16 @@ export async function writeWorkflowRules(plan, options = {}) {
|
|
|
148
145
|
await FileSystemUtils.writeFile(entry.destination, entry.content);
|
|
149
146
|
}
|
|
150
147
|
say(`Rules ${entry.action}: ${entry.destination}`);
|
|
151
|
-
// After the write, never before: a failure between the two would
|
|
152
|
-
//
|
|
148
|
+
// After the write, never before: a failure between the two would leave the
|
|
149
|
+
// project with no rule document at all.
|
|
153
150
|
if (entry.retire) {
|
|
154
151
|
await fs.rm(entry.retire, { force: true });
|
|
155
152
|
say(`Rules removed (renamed): ${entry.retire}`);
|
|
156
153
|
}
|
|
157
154
|
}
|
|
158
|
-
//
|
|
159
|
-
//
|
|
160
|
-
//
|
|
161
|
-
// notice would turn a known limitation into a silent failure.
|
|
155
|
+
// Codex reads AGENTS.md and skill files, never project Markdown under rules/,
|
|
156
|
+
// so the relocated file has no loading path there. Said out loud, or the
|
|
157
|
+
// limitation is silent.
|
|
162
158
|
if (plan.some((entry) => entry.toolId === CODEX_TARGET_ID)) {
|
|
163
159
|
say('Codex: rule documents are reference material; configure loading yourself. Markdown files in .agents/rules/ are not automatically loaded as instructions — Codex takes its text guidance from AGENTS.md and skill files.');
|
|
164
160
|
}
|