@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
|
@@ -21,14 +21,10 @@ export interface ChangeStatusPolicyArtifact {
|
|
|
21
21
|
status: ArtifactStatusValue;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* `optional` and `skipped` are separate values,
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* could not tell "you may still write this" from "this change says there is
|
|
29
|
-
* nothing to write". The issue schema's delta specs are the case that matters:
|
|
30
|
-
* its own instruction says to write them when the fix changes observable
|
|
31
|
-
* behaviour, and an agent driving off this field was told they were skipped.
|
|
24
|
+
* `optional` and `skipped` are separate values: collapsed into one, a caller
|
|
25
|
+
* cannot tell "you may still write this" from "this change says there is
|
|
26
|
+
* nothing to write". The issue schema's delta specs are the case that matters —
|
|
27
|
+
* its instruction asks for them whenever the fix changes observable behaviour.
|
|
32
28
|
*/
|
|
33
29
|
export type ArtifactStatusValue = 'done' | 'ready' | 'blocked' | 'skipped' | 'optional' | 'stub';
|
|
34
30
|
export interface ChangeNextStepsInput {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-status-policy.d.ts","sourceRoot":"","sources":["../../src/core/change-status-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,YAAY,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,aAAa,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,6BAA6B,EAAE,OAAO,CAAC;IACvC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AAED
|
|
1
|
+
{"version":3,"file":"change-status-policy.d.ts","sourceRoot":"","sources":["../../src/core/change-status-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,YAAY,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,aAAa,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,6BAA6B,EAAE,OAAO,CAAC;IACvC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AAED;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;AAEjG,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,0BAA0B,EAAE,CAAC;IAC/C,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,YAAY,GAAG,SAAS,GACrC,mBAAmB,GAAG,SAAS,CAWjC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,GAAG,aAAa,CAU3E;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,EAAE,CA+BpE"}
|
|
@@ -29,16 +29,14 @@ export function buildNextSteps(input) {
|
|
|
29
29
|
}
|
|
30
30
|
if (input.allArtifactsComplete) {
|
|
31
31
|
steps.push('All planning artifacts are complete; review tasks before implementation.');
|
|
32
|
-
// Still offered: "complete" means every *required* artifact is written,
|
|
33
|
-
// an unwritten optional one is
|
|
32
|
+
// Still offered: "complete" means every *required* artifact is written, so
|
|
33
|
+
// an unwritten optional one is worth naming here.
|
|
34
34
|
steps.push(...optionalSteps(input));
|
|
35
35
|
return steps;
|
|
36
36
|
}
|
|
37
|
-
// A stub is neither ready nor done, so without this the
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
// the template. Human output named it (`[!] design (stub: ...)`); the machine
|
|
41
|
-
// contract left a caller with nothing to do and no reason why.
|
|
37
|
+
// A stub is neither ready nor done, so without this it is the one state
|
|
38
|
+
// reporting `isComplete: false` with no next step — and the one that looks
|
|
39
|
+
// finished from a directory listing.
|
|
42
40
|
const stubs = input.artifactStatuses.filter((artifact) => artifact.status === 'stub');
|
|
43
41
|
for (const stub of stubs) {
|
|
44
42
|
steps.push(`Artifact ${stub.id} is still the unfilled template. Run tospec instructions ${stub.id} --change "${input.changeName}" --json, then replace the file's contents.`);
|
|
@@ -47,16 +45,10 @@ export function buildNextSteps(input) {
|
|
|
47
45
|
return steps;
|
|
48
46
|
}
|
|
49
47
|
/**
|
|
50
|
-
* Optional artifacts an author may still want to write.
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* change's life (round 4 report 12). An agent following `nextSteps` therefore
|
|
55
|
-
* never wrote delta specs for an issue fix, even though the issue schema's own
|
|
56
|
-
* instruction asks for them whenever the fix changes observable behaviour.
|
|
57
|
-
*
|
|
58
|
-
* Phrased as an offer, not an instruction: the whole point of `optional` is
|
|
59
|
-
* that skipping it is a legitimate outcome.
|
|
48
|
+
* Optional artifacts an author may still want to write. Nothing depends on them,
|
|
49
|
+
* so they never reach `ready` and would otherwise appear in no next step at any
|
|
50
|
+
* point in a change's life. Phrased as an offer, not an instruction: skipping
|
|
51
|
+
* an optional artifact is a legitimate outcome.
|
|
60
52
|
*/
|
|
61
53
|
function optionalSteps(input) {
|
|
62
54
|
return input.artifactStatuses
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-status-policy.js","sourceRoot":"","sources":["../../src/core/change-status-policy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"change-status-policy.js","sourceRoot":"","sources":["../../src/core/change-status-policy.ts"],"names":[],"mappings":"AA2CA,MAAM,UAAU,qBAAqB,CACnC,YAAsC;IAEtC,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,UAAU,EAAE,YAAY,CAAC,UAAU;QACnC,aAAa,EAAE,YAAY,CAAC,aAAa;KAC1C,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAyB;IAC1D,OAAO;QACL,IAAI,EAAE,YAAY;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,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IACpC,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,SAAS,aAAa,CAAC,KAA2B;IAChD,OAAO,KAAK,CAAC,gBAAgB;SAC1B,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,KAAK,UAAU,CAAC;SACpD,GAAG,CACF,CAAC,QAAQ,EAAE,EAAE,CACX,aAAa,QAAQ,CAAC,EAAE,4CAA4C,QAAQ,CAAC,EAAE,cAAc,KAAK,CAAC,UAAU,mCAAmC,CACnJ,CAAC;AACN,CAAC"}
|
|
@@ -3,22 +3,17 @@
|
|
|
3
3
|
* report `skill-metrics.ts` builds from Claude Code transcripts.
|
|
4
4
|
*
|
|
5
5
|
* Codex keeps one session tree shared by every project
|
|
6
|
-
* (`<CODEX_HOME or ~/.codex>/sessions/<yyyy>/<mm>/<dd>/rollout-*.jsonl`),
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* instead of resolving a path (see codex-metrics-source spec, "Codex sessions
|
|
11
|
-
* are scoped to a project by their recorded working directory").
|
|
6
|
+
* (`<CODEX_HOME or ~/.codex>/sessions/<yyyy>/<mm>/<dd>/rollout-*.jsonl`), with
|
|
7
|
+
* the working directory recorded once per session (`type: "session_meta"`,
|
|
8
|
+
* `payload.cwd`) rather than encoded into a directory name, so project scoping
|
|
9
|
+
* reads that field instead of resolving a path.
|
|
12
10
|
*
|
|
13
|
-
* Codex transcripts carry nothing like
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* skill's instructions. Skill attribution here is therefore a heuristic, not a
|
|
20
|
-
* recorded fact, and undercounts by construction: a skill run that never
|
|
21
|
-
* re-reads its own instructions file is invisible to it.
|
|
11
|
+
* Codex transcripts carry nothing like `attributionSkill`, and the system prompt
|
|
12
|
+
* lists every installed skill whether used or not, so that listing is no signal.
|
|
13
|
+
* The one event that correlates with a skill being used is a tool-call command
|
|
14
|
+
* reading a path ending in `<skill-name>/SKILL.md`. Attribution here is
|
|
15
|
+
* therefore a heuristic that undercounts: a run that never re-reads its own
|
|
16
|
+
* instructions file is invisible.
|
|
22
17
|
*/
|
|
23
18
|
import { type RunGroupingOptions, type SkillMetrics, type TranscriptEntry } from './skill-metrics.js';
|
|
24
19
|
export interface CodexSessionsDirOptions {
|
|
@@ -26,16 +21,13 @@ export interface CodexSessionsDirOptions {
|
|
|
26
21
|
homedir?: string;
|
|
27
22
|
}
|
|
28
23
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* `~/.codex`. This is the directory to search, not a per-project one — Codex
|
|
32
|
-
* has no equivalent of Claude Code's per-project transcript directory.
|
|
24
|
+
* Codex's session tree (`CODEX_HOME`, else `~/.codex`). The whole directory has
|
|
25
|
+
* to be searched: Codex has no per-project transcript directory.
|
|
33
26
|
*/
|
|
34
27
|
export declare function resolveCodexSessionsDir(options?: CodexSessionsDirOptions): string;
|
|
35
28
|
/**
|
|
36
|
-
* Whether a session's recorded working directory names the given project.
|
|
37
|
-
*
|
|
38
|
-
* with nothing recorded cannot be attributed to any project.
|
|
29
|
+
* Whether a session's recorded working directory names the given project. `null`
|
|
30
|
+
* never matches: a session with nothing recorded belongs to no project.
|
|
39
31
|
*/
|
|
40
32
|
export declare function sessionBelongsToProject(cwd: string | null, rootPath: string): boolean;
|
|
41
33
|
export interface CodexSessionResult {
|
|
@@ -44,18 +36,13 @@ export interface CodexSessionResult {
|
|
|
44
36
|
entries: TranscriptEntry[];
|
|
45
37
|
}
|
|
46
38
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* apply unchanged (design.md D3). Malformed lines are skipped rather than
|
|
51
|
-
* fatal, for the same reason Claude Code transcripts are: an append-only log
|
|
52
|
-
* that can be torn at the tail while a session is live.
|
|
39
|
+
* Produces the same shape `parseTranscript` does for Claude Code, so
|
|
40
|
+
* `buildRuns`/`aggregateRuns` apply unchanged (D3). Malformed lines are skipped:
|
|
41
|
+
* an append-only log can be torn at the tail.
|
|
53
42
|
*
|
|
54
|
-
* Only `function_call`/`custom_tool_call` entries are
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* (`skill: null`), exactly as an unattributed Claude Code entry is: it cannot
|
|
58
|
-
* end a run, but it is not evidence a skill became active either.
|
|
43
|
+
* Only `function_call`/`custom_tool_call` entries are inspected for a `SKILL.md`
|
|
44
|
+
* read. Everything else — including the fixed skill-listing text every session
|
|
45
|
+
* opens with — is folded in unattributed.
|
|
59
46
|
*/
|
|
60
47
|
export declare function parseCodexSession(text: string): CodexSessionResult;
|
|
61
48
|
export interface CodexProjectSession {
|
|
@@ -71,11 +58,8 @@ export interface CodexSessionScan {
|
|
|
71
58
|
sessions: CodexProjectSession[];
|
|
72
59
|
}
|
|
73
60
|
/**
|
|
74
|
-
* Finds and parses every Codex session belonging to one project.
|
|
75
|
-
*
|
|
76
|
-
* Shared by `collectCodexSkillMetrics` and the metrics server, which need
|
|
77
|
-
* exactly this and previously each carried their own copy of the walk — so the
|
|
78
|
-
* probe optimisation could otherwise have been applied to one and not the other.
|
|
61
|
+
* Finds and parses every Codex session belonging to one project. Shared by
|
|
62
|
+
* `collectCodexSkillMetrics` and the metrics server, so the probe reaches both.
|
|
79
63
|
*/
|
|
80
64
|
export declare function scanCodexSessions(rootPath: string, options?: CodexSessionsDirOptions): Promise<CodexSessionScan>;
|
|
81
65
|
export interface CollectCodexMetricsOptions extends RunGroupingOptions, CodexSessionsDirOptions {
|
|
@@ -83,13 +67,9 @@ export interface CollectCodexMetricsOptions extends RunGroupingOptions, CodexSes
|
|
|
83
67
|
sinceMs?: number;
|
|
84
68
|
}
|
|
85
69
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* `
|
|
89
|
-
*
|
|
90
|
-
* A missing sessions directory is a reportable state (`available: false`), not
|
|
91
|
-
* an error, for the same reason it is for Claude Code: the project may simply
|
|
92
|
-
* never have been opened in Codex.
|
|
70
|
+
* The Codex equivalent of `collectSkillMetrics`, over the `SKILL.md`-read
|
|
71
|
+
* heuristic. A missing sessions directory is a reportable state
|
|
72
|
+
* (`available: false`), not an error.
|
|
93
73
|
*/
|
|
94
74
|
export declare function collectCodexSkillMetrics(rootPath: string, options?: CollectCodexMetricsOptions): Promise<SkillMetrics>;
|
|
95
75
|
//# sourceMappingURL=codex-metrics.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-metrics.d.ts","sourceRoot":"","sources":["../../src/core/codex-metrics.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"codex-metrics.d.ts","sourceRoot":"","sources":["../../src/core/codex-metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAOH,OAAO,EAQL,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAC;AAI5B,MAAM,WAAW,uBAAuB;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,GAAE,uBAA4B,GAAG,MAAM,CAMrF;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAKrF;AAED,MAAM,WAAW,kBAAkB;IACjC,uEAAuE;IACvE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AAqCD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CA4ClE;AAwDD,MAAM,WAAW,mBAAmB;IAClC,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,mFAAmF;IACnF,SAAS,EAAE,OAAO,CAAC;IACnB,+DAA+D;IAC/D,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,gBAAgB,CAAC,CA4B3B;AAED,MAAM,WAAW,0BAA2B,SAAQ,kBAAkB,EAAE,uBAAuB;IAC7F,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,YAAY,CAAC,CAqDvB"}
|
|
@@ -3,22 +3,17 @@
|
|
|
3
3
|
* report `skill-metrics.ts` builds from Claude Code transcripts.
|
|
4
4
|
*
|
|
5
5
|
* Codex keeps one session tree shared by every project
|
|
6
|
-
* (`<CODEX_HOME or ~/.codex>/sessions/<yyyy>/<mm>/<dd>/rollout-*.jsonl`),
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* instead of resolving a path (see codex-metrics-source spec, "Codex sessions
|
|
11
|
-
* are scoped to a project by their recorded working directory").
|
|
6
|
+
* (`<CODEX_HOME or ~/.codex>/sessions/<yyyy>/<mm>/<dd>/rollout-*.jsonl`), with
|
|
7
|
+
* the working directory recorded once per session (`type: "session_meta"`,
|
|
8
|
+
* `payload.cwd`) rather than encoded into a directory name, so project scoping
|
|
9
|
+
* reads that field instead of resolving a path.
|
|
12
10
|
*
|
|
13
|
-
* Codex transcripts carry nothing like
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* skill's instructions. Skill attribution here is therefore a heuristic, not a
|
|
20
|
-
* recorded fact, and undercounts by construction: a skill run that never
|
|
21
|
-
* re-reads its own instructions file is invisible to it.
|
|
11
|
+
* Codex transcripts carry nothing like `attributionSkill`, and the system prompt
|
|
12
|
+
* lists every installed skill whether used or not, so that listing is no signal.
|
|
13
|
+
* The one event that correlates with a skill being used is a tool-call command
|
|
14
|
+
* reading a path ending in `<skill-name>/SKILL.md`. Attribution here is
|
|
15
|
+
* therefore a heuristic that undercounts: a run that never re-reads its own
|
|
16
|
+
* instructions file is invisible.
|
|
22
17
|
*/
|
|
23
18
|
import { promises as fs } from 'node:fs';
|
|
24
19
|
import * as os from 'node:os';
|
|
@@ -27,10 +22,8 @@ import fg from 'fast-glob';
|
|
|
27
22
|
import { aggregateRuns, buildRuns, normalizeSkillName, DEFAULT_IDLE_GAP_MS, DEFAULT_SPLIT_GAP_MS, } from './skill-metrics.js';
|
|
28
23
|
const CODEX_HOME_DIR_NAME = '.codex';
|
|
29
24
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* `~/.codex`. This is the directory to search, not a per-project one — Codex
|
|
33
|
-
* has no equivalent of Claude Code's per-project transcript directory.
|
|
25
|
+
* Codex's session tree (`CODEX_HOME`, else `~/.codex`). The whole directory has
|
|
26
|
+
* to be searched: Codex has no per-project transcript directory.
|
|
34
27
|
*/
|
|
35
28
|
export function resolveCodexSessionsDir(options = {}) {
|
|
36
29
|
const env = options.env ?? process.env;
|
|
@@ -40,9 +33,8 @@ export function resolveCodexSessionsDir(options = {}) {
|
|
|
40
33
|
return path.join(home, 'sessions');
|
|
41
34
|
}
|
|
42
35
|
/**
|
|
43
|
-
* Whether a session's recorded working directory names the given project.
|
|
44
|
-
*
|
|
45
|
-
* with nothing recorded cannot be attributed to any project.
|
|
36
|
+
* Whether a session's recorded working directory names the given project. `null`
|
|
37
|
+
* never matches: a session with nothing recorded belongs to no project.
|
|
46
38
|
*/
|
|
47
39
|
export function sessionBelongsToProject(cwd, rootPath) {
|
|
48
40
|
if (cwd === null)
|
|
@@ -52,11 +44,8 @@ export function sessionBelongsToProject(cwd, rootPath) {
|
|
|
52
44
|
return process.platform === 'win32' ? a.toLowerCase() === b.toLowerCase() : a === b;
|
|
53
45
|
}
|
|
54
46
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* single statement defines a session's cwd — the first `session_meta` whose
|
|
58
|
-
* `payload.cwd` is a string — and the probe can never disagree with the parse
|
|
59
|
-
* it exists to skip.
|
|
47
|
+
* Shared by the full parse and the prefix probe, so the probe cannot disagree
|
|
48
|
+
* with the parse it exists to skip.
|
|
60
49
|
*/
|
|
61
50
|
function recordedCwd(record) {
|
|
62
51
|
if (record.type !== 'session_meta')
|
|
@@ -65,17 +54,11 @@ function recordedCwd(record) {
|
|
|
65
54
|
return typeof cwd === 'string' ? cwd : null;
|
|
66
55
|
}
|
|
67
56
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* confirmed to correlate with a skill actually being read, as opposed to
|
|
71
|
-
* merely appearing in the session's fixed skill-listing text (see the module
|
|
72
|
-
* docstring).
|
|
57
|
+
* A path ending in `<skill-name>/SKILL.md`, on either separator — the one signal
|
|
58
|
+
* that a skill was read rather than merely listed.
|
|
73
59
|
*
|
|
74
|
-
* `function_call` arguments are JSON-encoded twice
|
|
75
|
-
*
|
|
76
|
-
* Windows path's single backslash separator survives as a doubled `\\` in the
|
|
77
|
-
* text this matches against. The separator class therefore matches one or
|
|
78
|
-
* more repetitions rather than exactly one.
|
|
60
|
+
* `function_call` arguments are JSON-encoded twice, so a Windows path's single
|
|
61
|
+
* backslash arrives doubled; hence `[\\/]+`.
|
|
79
62
|
*/
|
|
80
63
|
const SKILL_MD_READ_PATTERN = /([^\\/"]+)[\\/]+SKILL\.md/i;
|
|
81
64
|
function extractSkillFromCommandText(text) {
|
|
@@ -83,18 +66,13 @@ function extractSkillFromCommandText(text) {
|
|
|
83
66
|
return match ? match[1] : null;
|
|
84
67
|
}
|
|
85
68
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* apply unchanged (design.md D3). Malformed lines are skipped rather than
|
|
90
|
-
* fatal, for the same reason Claude Code transcripts are: an append-only log
|
|
91
|
-
* that can be torn at the tail while a session is live.
|
|
69
|
+
* Produces the same shape `parseTranscript` does for Claude Code, so
|
|
70
|
+
* `buildRuns`/`aggregateRuns` apply unchanged (D3). Malformed lines are skipped:
|
|
71
|
+
* an append-only log can be torn at the tail.
|
|
92
72
|
*
|
|
93
|
-
* Only `function_call`/`custom_tool_call` entries are
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* (`skill: null`), exactly as an unattributed Claude Code entry is: it cannot
|
|
97
|
-
* end a run, but it is not evidence a skill became active either.
|
|
73
|
+
* Only `function_call`/`custom_tool_call` entries are inspected for a `SKILL.md`
|
|
74
|
+
* read. Everything else — including the fixed skill-listing text every session
|
|
75
|
+
* opens with — is folded in unattributed.
|
|
98
76
|
*/
|
|
99
77
|
export function parseCodexSession(text) {
|
|
100
78
|
let cwd = null;
|
|
@@ -137,19 +115,11 @@ export function parseCodexSession(text) {
|
|
|
137
115
|
entries.sort((a, b) => a.timeMs - b.timeMs);
|
|
138
116
|
return { cwd, entries };
|
|
139
117
|
}
|
|
140
|
-
// -----------------------------------------------------------------------------
|
|
141
|
-
// IO: project scoping without reading whole sessions
|
|
142
|
-
// -----------------------------------------------------------------------------
|
|
143
118
|
/**
|
|
144
|
-
* Bytes read from a session when only its `cwd` is wanted.
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* to be large enough to hold a *complete* line: a line cut by the read boundary
|
|
149
|
-
* fails `JSON.parse` and is indistinguishable from an absent one. 64 KiB clears
|
|
150
|
-
* the observed maximum several times over, and anything the probe cannot settle
|
|
151
|
-
* falls back to a full read — so an unusually long first line costs time, never
|
|
152
|
-
* correctness.
|
|
119
|
+
* Bytes read from a session when only its `cwd` is wanted. `session_meta` is the
|
|
120
|
+
* first line but embeds the whole base-instructions text (~20 KB), and the probe
|
|
121
|
+
* must hold a *complete* line — one cut by the read boundary fails `JSON.parse`
|
|
122
|
+
* and looks absent. Anything inconclusive falls back to a full read.
|
|
153
123
|
*/
|
|
154
124
|
const CWD_PROBE_BYTES = 64 * 1024;
|
|
155
125
|
/** First recorded cwd in already-read text, stopping at the first one found. */
|
|
@@ -171,15 +141,10 @@ function findRecordedCwd(text) {
|
|
|
171
141
|
return null;
|
|
172
142
|
}
|
|
173
143
|
/**
|
|
174
|
-
* Reads just enough of a session to decide which project it belongs to.
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
* by other projects: the history that motivated this held 716 MB of sessions of
|
|
179
|
-
* which one project owned 0.9 MB, and parsing all of it cost ~9 s of the
|
|
180
|
-
* command's startup. Because the deciding field sits on line 0, reading a prefix
|
|
181
|
-
* instead of the whole file makes the cost proportional to this project's share
|
|
182
|
-
* of Codex history rather than to all of it.
|
|
144
|
+
* Reads just enough of a session to decide which project it belongs to. The
|
|
145
|
+
* shared tree is dominated by other projects — one real history held 716 MB of
|
|
146
|
+
* sessions of which this project owned 0.9 MB — and the deciding field sits on
|
|
147
|
+
* line 0, so a prefix read makes the cost proportional to this project's share.
|
|
183
148
|
*/
|
|
184
149
|
async function probeSessionCwd(filePath) {
|
|
185
150
|
const handle = await fs.open(filePath, 'r');
|
|
@@ -187,8 +152,8 @@ async function probeSessionCwd(filePath) {
|
|
|
187
152
|
const buffer = Buffer.alloc(CWD_PROBE_BYTES);
|
|
188
153
|
const { bytesRead } = await handle.read(buffer, 0, CWD_PROBE_BYTES, 0);
|
|
189
154
|
const cwd = findRecordedCwd(buffer.subarray(0, bytesRead).toString('utf8'));
|
|
190
|
-
// A short read means the prefix was the
|
|
191
|
-
// here" is
|
|
155
|
+
// A short read means the prefix was the whole file, so "no session_meta
|
|
156
|
+
// here" is final rather than a reason to read it again.
|
|
192
157
|
return { cwd, conclusive: cwd !== null || bytesRead < CWD_PROBE_BYTES };
|
|
193
158
|
}
|
|
194
159
|
finally {
|
|
@@ -196,18 +161,14 @@ async function probeSessionCwd(filePath) {
|
|
|
196
161
|
}
|
|
197
162
|
}
|
|
198
163
|
/**
|
|
199
|
-
* Finds and parses every Codex session belonging to one project.
|
|
200
|
-
*
|
|
201
|
-
* Shared by `collectCodexSkillMetrics` and the metrics server, which need
|
|
202
|
-
* exactly this and previously each carried their own copy of the walk — so the
|
|
203
|
-
* probe optimisation could otherwise have been applied to one and not the other.
|
|
164
|
+
* Finds and parses every Codex session belonging to one project. Shared by
|
|
165
|
+
* `collectCodexSkillMetrics` and the metrics server, so the probe reaches both.
|
|
204
166
|
*/
|
|
205
167
|
export async function scanCodexSessions(rootPath, options = {}) {
|
|
206
168
|
const sessionsDir = resolveCodexSessionsDir(options);
|
|
207
169
|
// fast-glob returns an empty list for a missing `cwd` rather than throwing,
|
|
208
|
-
// so
|
|
209
|
-
// this
|
|
210
|
-
// but nothing here matches this project" (available: true, sessions: 0).
|
|
170
|
+
// so without this check "Codex never ran here" and "ran, but nothing matches
|
|
171
|
+
// this project" look identical.
|
|
211
172
|
const stat = await fs.stat(sessionsDir).catch(() => null);
|
|
212
173
|
if (!stat)
|
|
213
174
|
return { sessionsDir, available: false, sessions: [] };
|
|
@@ -218,8 +179,7 @@ export async function scanCodexSessions(rootPath, options = {}) {
|
|
|
218
179
|
const probe = await probeSessionCwd(filePath);
|
|
219
180
|
if (probe.conclusive && !sessionBelongsToProject(probe.cwd, rootPath))
|
|
220
181
|
continue;
|
|
221
|
-
// The probe only
|
|
222
|
-
// every session that survives it.
|
|
182
|
+
// The probe only skips work; the full parse stays authoritative.
|
|
223
183
|
const { cwd, entries } = parseCodexSession(await fs.readFile(filePath, 'utf8'));
|
|
224
184
|
if (!sessionBelongsToProject(cwd, rootPath))
|
|
225
185
|
continue;
|
|
@@ -233,13 +193,9 @@ export async function scanCodexSessions(rootPath, options = {}) {
|
|
|
233
193
|
return { sessionsDir, available: true, sessions };
|
|
234
194
|
}
|
|
235
195
|
/**
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
* `
|
|
239
|
-
*
|
|
240
|
-
* A missing sessions directory is a reportable state (`available: false`), not
|
|
241
|
-
* an error, for the same reason it is for Claude Code: the project may simply
|
|
242
|
-
* never have been opened in Codex.
|
|
196
|
+
* The Codex equivalent of `collectSkillMetrics`, over the `SKILL.md`-read
|
|
197
|
+
* heuristic. A missing sessions directory is a reportable state
|
|
198
|
+
* (`available: false`), not an error.
|
|
243
199
|
*/
|
|
244
200
|
export async function collectCodexSkillMetrics(rootPath, options = {}) {
|
|
245
201
|
const thresholds = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-metrics.js","sourceRoot":"","sources":["../../src/core/codex-metrics.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"codex-metrics.js","sourceRoot":"","sources":["../../src/core/codex-metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,WAAW,CAAC;AAE3B,OAAO,EACL,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GAMrB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAOrC;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAO,GAA4B,EAAE;IAC3E,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACvC,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU;QACzB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC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/F,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU;QACV,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC;QAC9B,IAAI,EAAE,OAAO;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Residual Codex Output Detection
|
|
3
|
-
*
|
|
4
2
|
* `.codex` was a write target until Codex turned out to read its skills from
|
|
5
|
-
* `.agents
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* hash-protected precisely because users edit them, so anything that could
|
|
9
|
-
* delete them must not exist here. Removing leftovers stays the user's call.
|
|
3
|
+
* `.agents`, and projects initialized by an earlier version still hold that
|
|
4
|
+
* output. Read-only by design: rule files are content hash-protected precisely
|
|
5
|
+
* because users edit them, so removing leftovers stays the user's call.
|
|
10
6
|
*/
|
|
11
7
|
/**
|
|
12
8
|
* Whether `<projectPath>/.codex` still holds tospec output: a `tospec-` skill
|
|
13
|
-
* directory, or a file under `rules/tospec/`. Either alone is enough
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* Both halves match only what tospec itself writes. The directory merely
|
|
17
|
-
* existing is not enough: a project that only ever kept its own Codex settings
|
|
18
|
-
* there would otherwise be told to delete them.
|
|
9
|
+
* directory, or a file under `rules/tospec/`. Either alone is enough. Both
|
|
10
|
+
* halves match only what tospec writes, so a project keeping its own Codex
|
|
11
|
+
* settings is not told to delete them.
|
|
19
12
|
*/
|
|
20
13
|
export declare function hasResidualCodexOutput(projectPath: string): boolean;
|
|
21
|
-
/**
|
|
22
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Shared by init and update so neither can report what the other suppresses.
|
|
16
|
+
* Split into message and fix because both commands carry it through their
|
|
17
|
+
* `warn` helper: under `--json` a `say()` line is dropped, and the leftover
|
|
18
|
+
* would be reported to a human and hidden from an agent.
|
|
19
|
+
*/
|
|
20
|
+
export declare const RESIDUAL_CODEX_NOTICE = ".codex/ still holds tospec output from an earlier version. tospec no longer writes there \u2014 Codex reads skills from .agents/.";
|
|
21
|
+
export declare const RESIDUAL_CODEX_FIX = "Removing .codex/skills/tospec-* and .codex/rules/tospec/ is optional and entirely up to you; tospec will not touch them.";
|
|
23
22
|
//# sourceMappingURL=codex-residue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-residue.d.ts","sourceRoot":"","sources":["../../src/core/codex-residue.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"codex-residue.d.ts","sourceRoot":"","sources":["../../src/core/codex-residue.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwCH;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAGnE;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,sIAC8F,CAAC;AACjI,eAAO,MAAM,kBAAkB,6HAC6F,CAAC"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Residual Codex Output Detection
|
|
3
|
-
*
|
|
4
2
|
* `.codex` was a write target until Codex turned out to read its skills from
|
|
5
|
-
* `.agents
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* hash-protected precisely because users edit them, so anything that could
|
|
9
|
-
* delete them must not exist here. Removing leftovers stays the user's call.
|
|
3
|
+
* `.agents`, and projects initialized by an earlier version still hold that
|
|
4
|
+
* output. Read-only by design: rule files are content hash-protected precisely
|
|
5
|
+
* because users edit them, so removing leftovers stays the user's call.
|
|
10
6
|
*/
|
|
11
7
|
import path from 'node:path';
|
|
12
8
|
import * as fs from 'node:fs';
|
|
@@ -26,13 +22,10 @@ function hasTospecSkillDir(codexDir) {
|
|
|
26
22
|
}
|
|
27
23
|
}
|
|
28
24
|
/**
|
|
29
|
-
* Scoped to `rules/tospec
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* `.codex/rules/team-style.md` trigger a notice claiming tospec had put it
|
|
34
|
-
* there — the very mistake this module's docstring warns against one paragraph
|
|
35
|
-
* down. Still recursive, so a nested layout from an older version counts.
|
|
25
|
+
* Scoped to `rules/tospec/`, not all of `rules/`: generation only writes under
|
|
26
|
+
* that subdirectory, so scanning the whole tree makes a project's own
|
|
27
|
+
* `.codex/rules/team-style.md` trigger a notice claiming tospec put it there.
|
|
28
|
+
* Still recursive, so a nested layout from an older version counts.
|
|
36
29
|
*/
|
|
37
30
|
function hasTospecRuleFile(codexDir) {
|
|
38
31
|
try {
|
|
@@ -49,17 +42,20 @@ function hasTospecRuleFile(codexDir) {
|
|
|
49
42
|
}
|
|
50
43
|
/**
|
|
51
44
|
* Whether `<projectPath>/.codex` still holds tospec output: a `tospec-` skill
|
|
52
|
-
* directory, or a file under `rules/tospec/`. Either alone is enough
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* Both halves match only what tospec itself writes. The directory merely
|
|
56
|
-
* existing is not enough: a project that only ever kept its own Codex settings
|
|
57
|
-
* there would otherwise be told to delete them.
|
|
45
|
+
* directory, or a file under `rules/tospec/`. Either alone is enough. Both
|
|
46
|
+
* halves match only what tospec writes, so a project keeping its own Codex
|
|
47
|
+
* settings is not told to delete them.
|
|
58
48
|
*/
|
|
59
49
|
export function hasResidualCodexOutput(projectPath) {
|
|
60
50
|
const codexDir = path.join(projectPath, CODEX_DIR);
|
|
61
51
|
return hasTospecSkillDir(codexDir) || hasTospecRuleFile(codexDir);
|
|
62
52
|
}
|
|
63
|
-
/**
|
|
64
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Shared by init and update so neither can report what the other suppresses.
|
|
55
|
+
* Split into message and fix because both commands carry it through their
|
|
56
|
+
* `warn` helper: under `--json` a `say()` line is dropped, and the leftover
|
|
57
|
+
* would be reported to a human and hidden from an agent.
|
|
58
|
+
*/
|
|
59
|
+
export const RESIDUAL_CODEX_NOTICE = '.codex/ still holds tospec output from an earlier version. tospec no longer writes there — Codex reads skills from .agents/.';
|
|
60
|
+
export const RESIDUAL_CODEX_FIX = 'Removing .codex/skills/tospec-* and .codex/rules/tospec/ is optional and entirely up to you; tospec will not touch them.';
|
|
65
61
|
//# sourceMappingURL=codex-residue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-residue.js","sourceRoot":"","sources":["../../src/core/codex-residue.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"codex-residue.js","sourceRoot":"","sources":["../../src/core/codex-residue.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,MAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,wEAAwE;AACxE,MAAM,gBAAgB,GAAG,SAAS,CAAC;AACnC,sFAAsF;AACtF,MAAM,YAAY,GAAG,QAAQ,CAAC;AAE9B,SAAS,iBAAiB,CAAC,QAAgB;IACzC,IAAI,CAAC;QACH,OAAO,EAAE;aACN,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;aACnE,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACrF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,QAAgB;IACzC,IAAI,CAAC;QACH,OAAO,EAAE;aACN,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE;YACvD,SAAS,EAAE,IAAI;YACf,aAAa,EAAE,IAAI;SACpB,CAAC;aACD,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,WAAmB;IACxD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IACnD,OAAO,iBAAiB,CAAC,QAAQ,CAAC,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AACpE,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAChC,8HAA8H,CAAC;AACjI,MAAM,CAAC,MAAM,kBAAkB,GAC7B,0HAA0H,CAAC"}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Claude Code Command Adapter
|
|
3
|
-
*
|
|
4
|
-
* Formats commands for Claude Code following its frontmatter specification.
|
|
5
|
-
*/
|
|
6
1
|
import type { ToolCommandAdapter } from '../types.js';
|
|
7
2
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* command namespace, so commands are invoked as `/tosx:<id>`.
|
|
11
|
-
* Frontmatter: name, description, category, tags
|
|
3
|
+
* The `tosx` sub-folder becomes the command namespace, so what lands at
|
|
4
|
+
* `.claude/commands/tosx/<id>.md` is invoked as `/tosx:<id>`.
|
|
12
5
|
*/
|
|
13
6
|
export declare const claudeAdapter: ToolCommandAdapter;
|
|
14
7
|
//# sourceMappingURL=claude.d.ts.map
|