@kynetic-ai/spec 0.1.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +250 -17
- package/dist/acp/client.d.ts +18 -4
- package/dist/acp/client.d.ts.map +1 -1
- package/dist/acp/client.js +44 -26
- package/dist/acp/client.js.map +1 -1
- package/dist/acp/framing.d.ts +2 -2
- package/dist/acp/framing.d.ts.map +1 -1
- package/dist/acp/framing.js +37 -29
- package/dist/acp/framing.js.map +1 -1
- package/dist/acp/index.d.ts +6 -7
- package/dist/acp/index.d.ts.map +1 -1
- package/dist/acp/index.js +3 -3
- package/dist/acp/index.js.map +1 -1
- package/dist/acp/types.d.ts +5 -5
- package/dist/acp/types.d.ts.map +1 -1
- package/dist/acp/types.js +18 -18
- package/dist/acp/types.js.map +1 -1
- package/dist/agents/adapters.d.ts.map +1 -1
- package/dist/agents/adapters.js +24 -13
- package/dist/agents/adapters.js.map +1 -1
- package/dist/agents/index.d.ts +2 -2
- package/dist/agents/index.js +2 -2
- package/dist/agents/spawner.d.ts +4 -4
- package/dist/agents/spawner.d.ts.map +1 -1
- package/dist/agents/spawner.js +6 -6
- package/dist/agents/spawner.js.map +1 -1
- package/dist/cli/batch-context.d.ts +43 -0
- package/dist/cli/batch-context.d.ts.map +1 -0
- package/dist/cli/batch-context.js +93 -0
- package/dist/cli/batch-context.js.map +1 -0
- package/dist/cli/batch-exec.d.ts +107 -0
- package/dist/cli/batch-exec.d.ts.map +1 -0
- package/dist/cli/batch-exec.js +706 -0
- package/dist/cli/batch-exec.js.map +1 -0
- package/dist/cli/batch.d.ts +4 -2
- package/dist/cli/batch.d.ts.map +1 -1
- package/dist/cli/batch.js +15 -14
- package/dist/cli/batch.js.map +1 -1
- package/dist/cli/command-annotations.d.ts +23 -0
- package/dist/cli/command-annotations.d.ts.map +1 -0
- package/dist/cli/command-annotations.js +27 -0
- package/dist/cli/command-annotations.js.map +1 -0
- package/dist/cli/commands/agents.d.ts +46 -0
- package/dist/cli/commands/agents.d.ts.map +1 -0
- package/dist/cli/commands/agents.js +377 -0
- package/dist/cli/commands/agents.js.map +1 -0
- package/dist/cli/commands/batch.d.ts +20 -0
- package/dist/cli/commands/batch.d.ts.map +1 -0
- package/dist/cli/commands/batch.js +214 -0
- package/dist/cli/commands/batch.js.map +1 -0
- package/dist/cli/commands/clone-for-testing.d.ts +1 -1
- package/dist/cli/commands/clone-for-testing.d.ts.map +1 -1
- package/dist/cli/commands/clone-for-testing.js +37 -47
- package/dist/cli/commands/clone-for-testing.js.map +1 -1
- package/dist/cli/commands/derive.d.ts +1 -1
- package/dist/cli/commands/derive.d.ts.map +1 -1
- package/dist/cli/commands/derive.js +141 -88
- package/dist/cli/commands/derive.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +11 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +152 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/export.d.ts +12 -0
- package/dist/cli/commands/export.d.ts.map +1 -0
- package/dist/cli/commands/export.js +134 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/help.d.ts +1 -1
- package/dist/cli/commands/help.d.ts.map +1 -1
- package/dist/cli/commands/help.js +163 -37
- package/dist/cli/commands/help.js.map +1 -1
- package/dist/cli/commands/inbox.d.ts +1 -1
- package/dist/cli/commands/inbox.d.ts.map +1 -1
- package/dist/cli/commands/inbox.js +178 -56
- package/dist/cli/commands/inbox.js.map +1 -1
- package/dist/cli/commands/index.d.ts +31 -19
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +31 -19
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +5 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +108 -57
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/item.d.ts +1 -1
- package/dist/cli/commands/item.d.ts.map +1 -1
- package/dist/cli/commands/item.js +557 -274
- package/dist/cli/commands/item.js.map +1 -1
- package/dist/cli/commands/link.d.ts +1 -1
- package/dist/cli/commands/link.d.ts.map +1 -1
- package/dist/cli/commands/link.js +55 -46
- package/dist/cli/commands/link.js.map +1 -1
- package/dist/cli/commands/log.d.ts +1 -1
- package/dist/cli/commands/log.d.ts.map +1 -1
- package/dist/cli/commands/log.js +58 -51
- package/dist/cli/commands/log.js.map +1 -1
- package/dist/cli/commands/merge-driver.d.ts +19 -0
- package/dist/cli/commands/merge-driver.d.ts.map +1 -0
- package/dist/cli/commands/merge-driver.js +398 -0
- package/dist/cli/commands/merge-driver.js.map +1 -0
- package/dist/cli/commands/meta.d.ts +1 -1
- package/dist/cli/commands/meta.d.ts.map +1 -1
- package/dist/cli/commands/meta.js +534 -399
- package/dist/cli/commands/meta.js.map +1 -1
- package/dist/cli/commands/module.d.ts +1 -1
- package/dist/cli/commands/module.d.ts.map +1 -1
- package/dist/cli/commands/module.js +30 -25
- package/dist/cli/commands/module.js.map +1 -1
- package/dist/cli/commands/plan-import.d.ts +11 -0
- package/dist/cli/commands/plan-import.d.ts.map +1 -0
- package/dist/cli/commands/plan-import.js +547 -0
- package/dist/cli/commands/plan-import.js.map +1 -0
- package/dist/cli/commands/plan.d.ts +10 -0
- package/dist/cli/commands/plan.d.ts.map +1 -0
- package/dist/cli/commands/plan.js +421 -0
- package/dist/cli/commands/plan.js.map +1 -0
- package/dist/cli/commands/ralph.d.ts +1 -1
- package/dist/cli/commands/ralph.d.ts.map +1 -1
- package/dist/cli/commands/ralph.js +1109 -170
- package/dist/cli/commands/ralph.js.map +1 -1
- package/dist/cli/commands/refs.d.ts +13 -0
- package/dist/cli/commands/refs.d.ts.map +1 -0
- package/dist/cli/commands/refs.js +283 -0
- package/dist/cli/commands/refs.js.map +1 -0
- package/dist/cli/commands/search.d.ts +1 -1
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/search.js +199 -37
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/serve.d.ts +10 -0
- package/dist/cli/commands/serve.d.ts.map +1 -0
- package/dist/cli/commands/serve.js +491 -0
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/commands/session.d.ts +25 -6
- package/dist/cli/commands/session.d.ts.map +1 -1
- package/dist/cli/commands/session.js +810 -127
- package/dist/cli/commands/session.js.map +1 -1
- package/dist/cli/commands/setup-seeding.d.ts +81 -0
- package/dist/cli/commands/setup-seeding.d.ts.map +1 -0
- package/dist/cli/commands/setup-seeding.js +292 -0
- package/dist/cli/commands/setup-seeding.js.map +1 -0
- package/dist/cli/commands/setup.d.ts +77 -3
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +1267 -274
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/shadow.d.ts +1 -1
- package/dist/cli/commands/shadow.d.ts.map +1 -1
- package/dist/cli/commands/shadow.js +70 -50
- package/dist/cli/commands/shadow.js.map +1 -1
- package/dist/cli/commands/skill-crud.d.ts +58 -0
- package/dist/cli/commands/skill-crud.d.ts.map +1 -0
- package/dist/cli/commands/skill-crud.js +753 -0
- package/dist/cli/commands/skill-crud.js.map +1 -0
- package/dist/cli/commands/skill-diff.d.ts +27 -0
- package/dist/cli/commands/skill-diff.d.ts.map +1 -0
- package/dist/cli/commands/skill-diff.js +840 -0
- package/dist/cli/commands/skill-diff.js.map +1 -0
- package/dist/cli/commands/skill-install.d.ts +56 -0
- package/dist/cli/commands/skill-install.d.ts.map +1 -0
- package/dist/cli/commands/skill-install.js +509 -0
- package/dist/cli/commands/skill-install.js.map +1 -0
- package/dist/cli/commands/skill.d.ts +20 -0
- package/dist/cli/commands/skill.d.ts.map +1 -0
- package/dist/cli/commands/skill.js +36 -0
- package/dist/cli/commands/skill.js.map +1 -0
- package/dist/cli/commands/task.d.ts +1 -1
- package/dist/cli/commands/task.d.ts.map +1 -1
- package/dist/cli/commands/task.js +584 -350
- package/dist/cli/commands/task.js.map +1 -1
- package/dist/cli/commands/tasks.d.ts +26 -1
- package/dist/cli/commands/tasks.d.ts.map +1 -1
- package/dist/cli/commands/tasks.js +225 -122
- package/dist/cli/commands/tasks.js.map +1 -1
- package/dist/cli/commands/trait.d.ts +1 -1
- package/dist/cli/commands/trait.d.ts.map +1 -1
- package/dist/cli/commands/trait.js +166 -101
- package/dist/cli/commands/trait.js.map +1 -1
- package/dist/cli/commands/triage.d.ts +7 -0
- package/dist/cli/commands/triage.d.ts.map +1 -0
- package/dist/cli/commands/triage.js +483 -0
- package/dist/cli/commands/triage.js.map +1 -0
- package/dist/cli/commands/util.d.ts +7 -0
- package/dist/cli/commands/util.d.ts.map +1 -0
- package/dist/cli/commands/util.js +30 -0
- package/dist/cli/commands/util.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +1 -1
- package/dist/cli/commands/validate.d.ts.map +1 -1
- package/dist/cli/commands/validate.js +264 -83
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/commands/workflow.d.ts +16 -0
- package/dist/cli/commands/workflow.d.ts.map +1 -0
- package/dist/cli/commands/workflow.js +851 -0
- package/dist/cli/commands/workflow.js.map +1 -0
- package/dist/cli/exit-codes.d.ts +7 -0
- package/dist/cli/exit-codes.d.ts.map +1 -1
- package/dist/cli/exit-codes.js +26 -18
- package/dist/cli/exit-codes.js.map +1 -1
- package/dist/cli/help/content.d.ts.map +1 -1
- package/dist/cli/help/content.js +86 -71
- package/dist/cli/help/content.js.map +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +131 -19
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/introspection.d.ts +6 -2
- package/dist/cli/introspection.d.ts.map +1 -1
- package/dist/cli/introspection.js +11 -8
- package/dist/cli/introspection.js.map +1 -1
- package/dist/cli/output.d.ts +64 -4
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +237 -85
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/parse-utils.d.ts +21 -0
- package/dist/cli/parse-utils.d.ts.map +1 -0
- package/dist/cli/parse-utils.js +32 -0
- package/dist/cli/parse-utils.js.map +1 -0
- package/dist/cli/pid-utils.d.ts +72 -0
- package/dist/cli/pid-utils.d.ts.map +1 -0
- package/dist/cli/pid-utils.js +174 -0
- package/dist/cli/pid-utils.js.map +1 -0
- package/dist/cli/suggest.d.ts.map +1 -1
- package/dist/cli/suggest.js +1 -2
- package/dist/cli/suggest.js.map +1 -1
- package/dist/cli/validators.d.ts +43 -0
- package/dist/cli/validators.d.ts.map +1 -0
- package/dist/cli/validators.js +84 -0
- package/dist/cli/validators.js.map +1 -0
- package/dist/daemon/index.ts +52 -0
- package/dist/daemon/middleware/project-context.ts +126 -0
- package/dist/daemon/pid.ts +179 -0
- package/dist/daemon/project-context.ts +343 -0
- package/dist/daemon/routes/inbox.ts +164 -0
- package/dist/daemon/routes/items.ts +322 -0
- package/dist/daemon/routes/meta.ts +118 -0
- package/dist/daemon/routes/projects.ts +162 -0
- package/dist/daemon/routes/tasks.ts +327 -0
- package/dist/daemon/routes/triage.ts +402 -0
- package/dist/daemon/routes/validation.ts +248 -0
- package/dist/daemon/server.ts +408 -0
- package/dist/daemon/watcher.ts +195 -0
- package/dist/daemon/websocket/handler.ts +138 -0
- package/dist/daemon/websocket/heartbeat.ts +71 -0
- package/dist/daemon/websocket/pubsub.ts +125 -0
- package/dist/daemon/websocket/types.ts +66 -0
- package/dist/export/html.d.ts +19 -0
- package/dist/export/html.d.ts.map +1 -0
- package/dist/export/html.js +239 -0
- package/dist/export/html.js.map +1 -0
- package/dist/export/index.d.ts +10 -0
- package/dist/export/index.d.ts.map +1 -0
- package/dist/export/index.js +10 -0
- package/dist/export/index.js.map +1 -0
- package/dist/export/json.d.ts +24 -0
- package/dist/export/json.d.ts.map +1 -0
- package/dist/export/json.js +198 -0
- package/dist/export/json.js.map +1 -0
- package/dist/export/triage.d.ts +51 -0
- package/dist/export/triage.d.ts.map +1 -0
- package/dist/export/triage.js +83 -0
- package/dist/export/triage.js.map +1 -0
- package/dist/export/types.d.ts +122 -0
- package/dist/export/types.d.ts.map +1 -0
- package/dist/export/types.js +9 -0
- package/dist/export/types.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/lib/claude-plugin-registry.d.ts +66 -0
- package/dist/lib/claude-plugin-registry.d.ts.map +1 -0
- package/dist/lib/claude-plugin-registry.js +318 -0
- package/dist/lib/claude-plugin-registry.js.map +1 -0
- package/dist/merge/arrays.d.ts +87 -0
- package/dist/merge/arrays.d.ts.map +1 -0
- package/dist/merge/arrays.js +164 -0
- package/dist/merge/arrays.js.map +1 -0
- package/dist/merge/file-type.d.ts +32 -0
- package/dist/merge/file-type.d.ts.map +1 -0
- package/dist/merge/file-type.js +70 -0
- package/dist/merge/file-type.js.map +1 -0
- package/dist/merge/index.d.ts +14 -0
- package/dist/merge/index.d.ts.map +1 -0
- package/dist/merge/index.js +11 -0
- package/dist/merge/index.js.map +1 -0
- package/dist/merge/objects.d.ts +46 -0
- package/dist/merge/objects.d.ts.map +1 -0
- package/dist/merge/objects.js +193 -0
- package/dist/merge/objects.js.map +1 -0
- package/dist/merge/parse.d.ts +23 -0
- package/dist/merge/parse.d.ts.map +1 -0
- package/dist/merge/parse.js +78 -0
- package/dist/merge/parse.js.map +1 -0
- package/dist/merge/resolve.d.ts +66 -0
- package/dist/merge/resolve.d.ts.map +1 -0
- package/dist/merge/resolve.js +189 -0
- package/dist/merge/resolve.js.map +1 -0
- package/dist/merge/types.d.ts +82 -0
- package/dist/merge/types.d.ts.map +1 -0
- package/dist/merge/types.js +8 -0
- package/dist/merge/types.js.map +1 -0
- package/dist/parser/agent-data-sections.d.ts +53 -0
- package/dist/parser/agent-data-sections.d.ts.map +1 -0
- package/dist/parser/agent-data-sections.js +118 -0
- package/dist/parser/agent-data-sections.js.map +1 -0
- package/dist/parser/alignment.d.ts +4 -4
- package/dist/parser/alignment.d.ts.map +1 -1
- package/dist/parser/alignment.js +27 -22
- package/dist/parser/alignment.js.map +1 -1
- package/dist/parser/assess.d.ts +5 -5
- package/dist/parser/assess.d.ts.map +1 -1
- package/dist/parser/assess.js +36 -32
- package/dist/parser/assess.js.map +1 -1
- package/dist/parser/config.d.ts +457 -0
- package/dist/parser/config.d.ts.map +1 -0
- package/dist/parser/config.js +373 -0
- package/dist/parser/config.js.map +1 -0
- package/dist/parser/convention-validation.d.ts +1 -1
- package/dist/parser/convention-validation.d.ts.map +1 -1
- package/dist/parser/convention-validation.js +21 -16
- package/dist/parser/convention-validation.js.map +1 -1
- package/dist/parser/coverage-cache.d.ts +49 -0
- package/dist/parser/coverage-cache.d.ts.map +1 -0
- package/dist/parser/coverage-cache.js +123 -0
- package/dist/parser/coverage-cache.js.map +1 -0
- package/dist/parser/daemon-status.d.ts +37 -0
- package/dist/parser/daemon-status.d.ts.map +1 -0
- package/dist/parser/daemon-status.js +67 -0
- package/dist/parser/daemon-status.js.map +1 -0
- package/dist/parser/doctor.d.ts +107 -0
- package/dist/parser/doctor.d.ts.map +1 -0
- package/dist/parser/doctor.js +366 -0
- package/dist/parser/doctor.js.map +1 -0
- package/dist/parser/fix.d.ts +1 -1
- package/dist/parser/fix.d.ts.map +1 -1
- package/dist/parser/fix.js +31 -27
- package/dist/parser/fix.js.map +1 -1
- package/dist/parser/index.d.ts +16 -11
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/parser/index.js +16 -11
- package/dist/parser/index.js.map +1 -1
- package/dist/parser/items.d.ts +8 -2
- package/dist/parser/items.d.ts.map +1 -1
- package/dist/parser/items.js +71 -35
- package/dist/parser/items.js.map +1 -1
- package/dist/parser/meta.d.ts +167 -9
- package/dist/parser/meta.d.ts.map +1 -1
- package/dist/parser/meta.js +379 -46
- package/dist/parser/meta.js.map +1 -1
- package/dist/parser/plan-document.d.ts +197 -0
- package/dist/parser/plan-document.d.ts.map +1 -0
- package/dist/parser/plan-document.js +341 -0
- package/dist/parser/plan-document.js.map +1 -0
- package/dist/parser/plans.d.ts +59 -0
- package/dist/parser/plans.d.ts.map +1 -0
- package/dist/parser/plans.js +239 -0
- package/dist/parser/plans.js.map +1 -0
- package/dist/parser/refs.d.ts +22 -9
- package/dist/parser/refs.d.ts.map +1 -1
- package/dist/parser/refs.js +102 -50
- package/dist/parser/refs.js.map +1 -1
- package/dist/parser/setup-status.d.ts +71 -0
- package/dist/parser/setup-status.d.ts.map +1 -0
- package/dist/parser/setup-status.js +269 -0
- package/dist/parser/setup-status.js.map +1 -0
- package/dist/parser/shadow.d.ts +150 -19
- package/dist/parser/shadow.d.ts.map +1 -1
- package/dist/parser/shadow.js +548 -187
- package/dist/parser/shadow.js.map +1 -1
- package/dist/parser/skill-render.d.ts +317 -0
- package/dist/parser/skill-render.d.ts.map +1 -0
- package/dist/parser/skill-render.js +943 -0
- package/dist/parser/skill-render.js.map +1 -0
- package/dist/parser/traits.d.ts +3 -3
- package/dist/parser/traits.d.ts.map +1 -1
- package/dist/parser/traits.js +2 -2
- package/dist/parser/traits.js.map +1 -1
- package/dist/parser/validate-skills.d.ts +32 -0
- package/dist/parser/validate-skills.d.ts.map +1 -0
- package/dist/parser/validate-skills.js +202 -0
- package/dist/parser/validate-skills.js.map +1 -0
- package/dist/parser/validate.d.ts +45 -3
- package/dist/parser/validate.d.ts.map +1 -1
- package/dist/parser/validate.js +622 -105
- package/dist/parser/validate.js.map +1 -1
- package/dist/parser/yaml.d.ts +83 -19
- package/dist/parser/yaml.d.ts.map +1 -1
- package/dist/parser/yaml.js +478 -173
- package/dist/parser/yaml.js.map +1 -1
- package/dist/ralph/cli-renderer.d.ts +8 -1
- package/dist/ralph/cli-renderer.d.ts.map +1 -1
- package/dist/ralph/cli-renderer.js +105 -34
- package/dist/ralph/cli-renderer.js.map +1 -1
- package/dist/ralph/events.d.ts +10 -10
- package/dist/ralph/events.d.ts.map +1 -1
- package/dist/ralph/events.js +301 -98
- package/dist/ralph/events.js.map +1 -1
- package/dist/ralph/index.d.ts +5 -2
- package/dist/ralph/index.d.ts.map +1 -1
- package/dist/ralph/index.js +9 -3
- package/dist/ralph/index.js.map +1 -1
- package/dist/ralph/loop-errors.d.ts +83 -0
- package/dist/ralph/loop-errors.d.ts.map +1 -0
- package/dist/ralph/loop-errors.js +150 -0
- package/dist/ralph/loop-errors.js.map +1 -0
- package/dist/ralph/subagent.d.ts +94 -0
- package/dist/ralph/subagent.d.ts.map +1 -0
- package/dist/ralph/subagent.js +193 -0
- package/dist/ralph/subagent.js.map +1 -0
- package/dist/ralph/wrap-up.d.ts +125 -0
- package/dist/ralph/wrap-up.d.ts.map +1 -0
- package/dist/ralph/wrap-up.js +270 -0
- package/dist/ralph/wrap-up.js.map +1 -0
- package/dist/schema/batch.d.ts +97 -0
- package/dist/schema/batch.d.ts.map +1 -0
- package/dist/schema/batch.js +24 -0
- package/dist/schema/batch.js.map +1 -0
- package/dist/schema/common.d.ts +8 -2
- package/dist/schema/common.d.ts.map +1 -1
- package/dist/schema/common.js +42 -31
- package/dist/schema/common.js.map +1 -1
- package/dist/schema/inbox.d.ts +12 -12
- package/dist/schema/inbox.js +4 -4
- package/dist/schema/inbox.js.map +1 -1
- package/dist/schema/index.d.ts +8 -5
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +8 -5
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/meta.d.ts +1454 -27
- package/dist/schema/meta.d.ts.map +1 -1
- package/dist/schema/meta.js +198 -21
- package/dist/schema/meta.js.map +1 -1
- package/dist/schema/plan.d.ts +285 -0
- package/dist/schema/plan.d.ts.map +1 -0
- package/dist/schema/plan.js +81 -0
- package/dist/schema/plan.js.map +1 -0
- package/dist/schema/spec.d.ts +72 -33
- package/dist/schema/spec.d.ts.map +1 -1
- package/dist/schema/spec.js +22 -9
- package/dist/schema/spec.js.map +1 -1
- package/dist/schema/task.d.ts +172 -161
- package/dist/schema/task.d.ts.map +1 -1
- package/dist/schema/task.js +21 -12
- package/dist/schema/task.js.map +1 -1
- package/dist/schema/triage.d.ts +266 -0
- package/dist/schema/triage.d.ts.map +1 -0
- package/dist/schema/triage.js +134 -0
- package/dist/schema/triage.js.map +1 -0
- package/dist/sessions/index.d.ts +2 -2
- package/dist/sessions/index.d.ts.map +1 -1
- package/dist/sessions/index.js +3 -3
- package/dist/sessions/index.js.map +1 -1
- package/dist/sessions/store.d.ts +241 -1
- package/dist/sessions/store.d.ts.map +1 -1
- package/dist/sessions/store.js +810 -31
- package/dist/sessions/store.js.map +1 -1
- package/dist/sessions/types.d.ts +10 -10
- package/dist/sessions/types.d.ts.map +1 -1
- package/dist/sessions/types.js +10 -9
- package/dist/sessions/types.js.map +1 -1
- package/dist/strings/errors.d.ts +55 -0
- package/dist/strings/errors.d.ts.map +1 -1
- package/dist/strings/errors.js +138 -106
- package/dist/strings/errors.js.map +1 -1
- package/dist/strings/guidance.d.ts.map +1 -1
- package/dist/strings/guidance.js +16 -16
- package/dist/strings/guidance.js.map +1 -1
- package/dist/strings/index.d.ts +4 -4
- package/dist/strings/index.d.ts.map +1 -1
- package/dist/strings/index.js +4 -4
- package/dist/strings/index.js.map +1 -1
- package/dist/strings/labels.d.ts +4 -0
- package/dist/strings/labels.d.ts.map +1 -1
- package/dist/strings/labels.js +45 -41
- package/dist/strings/labels.js.map +1 -1
- package/dist/strings/validation.d.ts.map +1 -1
- package/dist/strings/validation.js +71 -71
- package/dist/strings/validation.js.map +1 -1
- package/dist/triage/actions.d.ts +27 -0
- package/dist/triage/actions.d.ts.map +1 -0
- package/dist/triage/actions.js +95 -0
- package/dist/triage/actions.js.map +1 -0
- package/dist/triage/constants.d.ts +6 -0
- package/dist/triage/constants.d.ts.map +1 -0
- package/dist/triage/constants.js +7 -0
- package/dist/triage/constants.js.map +1 -0
- package/dist/triage/index.d.ts +3 -0
- package/dist/triage/index.d.ts.map +1 -0
- package/dist/triage/index.js +3 -0
- package/dist/triage/index.js.map +1 -0
- package/dist/utils/commit.d.ts +1 -1
- package/dist/utils/commit.d.ts.map +1 -1
- package/dist/utils/commit.js +28 -26
- package/dist/utils/commit.js.map +1 -1
- package/dist/utils/git.d.ts +1 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +40 -38
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/grep.js +11 -11
- package/dist/utils/grep.js.map +1 -1
- package/dist/utils/index.d.ts +7 -7
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +4 -4
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/time.d.ts.map +1 -1
- package/dist/utils/time.js +10 -10
- package/dist/utils/time.js.map +1 -1
- package/package.json +28 -5
- package/plugin/.claude-plugin/marketplace.json +17 -0
- package/plugin/.claude-plugin/plugin.json +5 -0
- package/plugin/plugins/kspec/skills/create-workflow/SKILL.md +235 -0
- package/plugin/plugins/kspec/skills/help/SKILL.md +42 -0
- package/plugin/plugins/kspec/skills/observations/SKILL.md +143 -0
- package/plugin/plugins/kspec/skills/plan/SKILL.md +343 -0
- package/plugin/plugins/kspec/skills/reflect/SKILL.md +161 -0
- package/plugin/plugins/kspec/skills/review/SKILL.md +193 -0
- package/plugin/plugins/kspec/skills/task-work/SKILL.md +303 -0
- package/plugin/plugins/kspec/skills/triage/SKILL.md +206 -0
- package/plugin/plugins/kspec/skills/triage/docs/automation.md +120 -0
- package/plugin/plugins/kspec/skills/triage/docs/inbox.md +144 -0
- package/plugin/plugins/kspec/skills/triage/docs/observations.md +85 -0
- package/plugin/plugins/kspec/skills/triage-automation/SKILL.md +140 -0
- package/plugin/plugins/kspec/skills/triage-inbox/SKILL.md +232 -0
- package/plugin/plugins/kspec/skills/writing-specs/SKILL.md +340 -0
- package/templates/agents-sections/01-quick-start.md +22 -0
- package/templates/agents-sections/02-shadow-branch.md +34 -0
- package/templates/agents-sections/03-task-lifecycle.md +48 -0
- package/templates/agents-sections/04-pr-workflow.md +17 -0
- package/templates/agents-sections/05-commit-convention.md +27 -0
- package/templates/agents-sections/06-ralph-loop.md +45 -0
- package/templates/hooks/pre-commit +34 -0
- package/templates/skills/create-workflow/SKILL.md +228 -0
- package/templates/skills/help/SKILL.md +37 -0
- package/templates/skills/manifest.yaml +60 -0
- package/templates/skills/observations/SKILL.md +137 -0
- package/templates/skills/plan/SKILL.md +336 -0
- package/templates/skills/reflect/SKILL.md +155 -0
- package/templates/skills/review/SKILL.md +186 -0
- package/templates/skills/task-work/SKILL.md +296 -0
- package/templates/skills/triage/SKILL.md +199 -0
- package/templates/skills/triage/docs/automation.md +120 -0
- package/templates/skills/triage/docs/inbox.md +144 -0
- package/templates/skills/triage/docs/observations.md +85 -0
- package/templates/skills/triage-automation/SKILL.md +134 -0
- package/templates/skills/triage-inbox/SKILL.md +225 -0
- package/templates/skills/writing-specs/SKILL.md +333 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conflict resolution for semantic YAML merge.
|
|
3
|
+
*
|
|
4
|
+
* Handles interactive prompts for conflicts and formatting
|
|
5
|
+
* conflicts as YAML comments in non-interactive mode.
|
|
6
|
+
*/
|
|
7
|
+
import * as readline from "node:readline/promises";
|
|
8
|
+
import { stdin as input, stdout as output } from "node:process";
|
|
9
|
+
/**
|
|
10
|
+
* AC: @yaml-merge-driver ac-4
|
|
11
|
+
* Prompt user interactively to resolve a scalar field conflict.
|
|
12
|
+
*
|
|
13
|
+
* @param conflict The conflict to resolve
|
|
14
|
+
* @param createInterface Optional readline factory for testing
|
|
15
|
+
* @returns The resolution choice and value
|
|
16
|
+
*/
|
|
17
|
+
export async function promptScalarConflict(conflict, createInterface) {
|
|
18
|
+
const factory = createInterface || readline.createInterface;
|
|
19
|
+
const rl = factory({ input, output });
|
|
20
|
+
try {
|
|
21
|
+
console.log(`\n${conflict.description}`);
|
|
22
|
+
console.log(`Path: ${conflict.path}`);
|
|
23
|
+
console.log(` [1] Ours: ${formatValue(conflict.oursValue)}`);
|
|
24
|
+
console.log(` [2] Theirs: ${formatValue(conflict.theirsValue)}`);
|
|
25
|
+
console.log(` [3] Skip (leave unresolved)`);
|
|
26
|
+
const answer = await rl.question("\nChoose [1/2/3]: ");
|
|
27
|
+
switch (answer.trim()) {
|
|
28
|
+
case "1":
|
|
29
|
+
return {
|
|
30
|
+
conflict,
|
|
31
|
+
choice: "ours",
|
|
32
|
+
value: conflict.oursValue,
|
|
33
|
+
};
|
|
34
|
+
case "2":
|
|
35
|
+
return {
|
|
36
|
+
conflict,
|
|
37
|
+
choice: "theirs",
|
|
38
|
+
value: conflict.theirsValue,
|
|
39
|
+
};
|
|
40
|
+
case "3":
|
|
41
|
+
default:
|
|
42
|
+
return {
|
|
43
|
+
conflict,
|
|
44
|
+
choice: "skip",
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
rl.close();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* AC: @yaml-merge-driver ac-8
|
|
54
|
+
* Prompt user to choose between deletion and keeping modified version.
|
|
55
|
+
*
|
|
56
|
+
* @param conflict The delete-modify conflict to resolve
|
|
57
|
+
* @param createInterface Optional readline factory for testing
|
|
58
|
+
* @returns The resolution choice
|
|
59
|
+
*/
|
|
60
|
+
export async function promptDeleteModifyConflict(conflict, createInterface) {
|
|
61
|
+
const factory = createInterface || readline.createInterface;
|
|
62
|
+
const rl = factory({ input, output });
|
|
63
|
+
try {
|
|
64
|
+
console.log(`\n${conflict.description}`);
|
|
65
|
+
console.log(`Path: ${conflict.path}`);
|
|
66
|
+
// Determine which side deleted
|
|
67
|
+
const deletedInOurs = conflict.oursValue === undefined;
|
|
68
|
+
if (deletedInOurs) {
|
|
69
|
+
console.log(` [1] Delete (ours deleted this)`);
|
|
70
|
+
console.log(` [2] Keep modified version: ${formatValue(conflict.theirsValue)}`);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
console.log(` [1] Keep modified version: ${formatValue(conflict.oursValue)}`);
|
|
74
|
+
console.log(` [2] Delete (theirs deleted this)`);
|
|
75
|
+
}
|
|
76
|
+
console.log(` [3] Skip (leave unresolved)`);
|
|
77
|
+
const answer = await rl.question("\nChoose [1/2/3]: ");
|
|
78
|
+
switch (answer.trim()) {
|
|
79
|
+
case "1":
|
|
80
|
+
return {
|
|
81
|
+
conflict,
|
|
82
|
+
choice: "ours",
|
|
83
|
+
value: deletedInOurs ? undefined : conflict.oursValue,
|
|
84
|
+
};
|
|
85
|
+
case "2":
|
|
86
|
+
return {
|
|
87
|
+
conflict,
|
|
88
|
+
choice: "theirs",
|
|
89
|
+
value: deletedInOurs ? conflict.theirsValue : undefined,
|
|
90
|
+
};
|
|
91
|
+
case "3":
|
|
92
|
+
default:
|
|
93
|
+
return {
|
|
94
|
+
conflict,
|
|
95
|
+
choice: "skip",
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
rl.close();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Resolve multiple conflicts interactively.
|
|
105
|
+
*
|
|
106
|
+
* @param conflicts Array of conflicts to resolve
|
|
107
|
+
* @returns Array of resolutions
|
|
108
|
+
*/
|
|
109
|
+
export async function resolveConflictsInteractive(conflicts) {
|
|
110
|
+
const resolutions = [];
|
|
111
|
+
for (const conflict of conflicts) {
|
|
112
|
+
let resolution;
|
|
113
|
+
switch (conflict.type) {
|
|
114
|
+
case "scalar_field":
|
|
115
|
+
resolution = await promptScalarConflict(conflict);
|
|
116
|
+
break;
|
|
117
|
+
case "delete_modify":
|
|
118
|
+
resolution = await promptDeleteModifyConflict(conflict);
|
|
119
|
+
break;
|
|
120
|
+
case "nested_conflict":
|
|
121
|
+
// Nested conflicts should have been flattened to scalar conflicts
|
|
122
|
+
resolution = await promptScalarConflict(conflict);
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
resolutions.push(resolution);
|
|
126
|
+
}
|
|
127
|
+
return resolutions;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* AC: @yaml-merge-driver ac-10
|
|
131
|
+
* Format a conflict as a YAML comment for non-interactive mode.
|
|
132
|
+
*
|
|
133
|
+
* Example output:
|
|
134
|
+
* ```yaml
|
|
135
|
+
* # CONFLICT: Field "title" modified with different values in both branches
|
|
136
|
+
* # Path: tasks[0].title
|
|
137
|
+
* # Ours: "Fix authentication bug"
|
|
138
|
+
* # Theirs: "Fix auth issue"
|
|
139
|
+
* title: "Fix authentication bug" # Using ours
|
|
140
|
+
* ```
|
|
141
|
+
*
|
|
142
|
+
* @param conflict The conflict to format
|
|
143
|
+
* @returns YAML comment lines
|
|
144
|
+
*/
|
|
145
|
+
export function formatConflictComment(conflict) {
|
|
146
|
+
const lines = [];
|
|
147
|
+
lines.push(`# CONFLICT: ${conflict.description}`);
|
|
148
|
+
lines.push(`# Path: ${conflict.path}`);
|
|
149
|
+
if (conflict.ulid) {
|
|
150
|
+
lines.push(`# ULID: ${conflict.ulid}`);
|
|
151
|
+
}
|
|
152
|
+
lines.push(`# Ours: ${formatValue(conflict.oursValue)}`);
|
|
153
|
+
lines.push(`# Theirs: ${formatValue(conflict.theirsValue)}`);
|
|
154
|
+
lines.push(`# Resolution: Using ours (run merge interactively to resolve)`);
|
|
155
|
+
return lines;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Format a value for display in prompts or comments.
|
|
159
|
+
* Handles primitives, arrays, and objects concisely.
|
|
160
|
+
*/
|
|
161
|
+
function formatValue(value) {
|
|
162
|
+
if (value === undefined)
|
|
163
|
+
return "<deleted>";
|
|
164
|
+
if (value === null)
|
|
165
|
+
return "null";
|
|
166
|
+
if (typeof value === "string")
|
|
167
|
+
return `"${value}"`;
|
|
168
|
+
if (typeof value === "number" || typeof value === "boolean")
|
|
169
|
+
return String(value);
|
|
170
|
+
if (Array.isArray(value)) {
|
|
171
|
+
if (value.length === 0)
|
|
172
|
+
return "[]";
|
|
173
|
+
if (value.length <= 3) {
|
|
174
|
+
return `[${value.map(formatValue).join(", ")}]`;
|
|
175
|
+
}
|
|
176
|
+
return `[${value.length} items]`;
|
|
177
|
+
}
|
|
178
|
+
if (typeof value === "object") {
|
|
179
|
+
const keys = Object.keys(value);
|
|
180
|
+
if (keys.length === 0)
|
|
181
|
+
return "{}";
|
|
182
|
+
if (keys.length === 1) {
|
|
183
|
+
return `{${keys[0]}}`;
|
|
184
|
+
}
|
|
185
|
+
return `{${keys.length} fields}`;
|
|
186
|
+
}
|
|
187
|
+
return String(value);
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/merge/resolve.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAmBhE;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,QAAsB,EACtB,eAAiD;IAEjD,MAAM,OAAO,GAAG,eAAe,IAAI,QAAQ,CAAC,eAAe,CAAC;IAC5D,MAAM,EAAE,GAAG,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAEtC,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,SAAS,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,iBAAiB,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAChE,OAAO,CAAC,GAAG,CAAC,iBAAiB,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAClE,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,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AAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACpC,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YACtB,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QAClD,CAAC;QACD,OAAO,IAAI,KAAK,CAAC,MAAM,SAAS,CAAC;IACnC,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACnC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;QACxB,CAAC;QACD,OAAO,IAAI,IAAI,CAAC,MAAM,UAAU,CAAC;IACnC,CAAC;IAED,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for semantic YAML merge driver.
|
|
3
|
+
*
|
|
4
|
+
* The merge driver parses kspec YAML files and merges them semantically,
|
|
5
|
+
* understanding the structure of tasks, items, and other entities.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Result of a merge operation
|
|
9
|
+
*/
|
|
10
|
+
export interface MergeResult {
|
|
11
|
+
/** The merged YAML content */
|
|
12
|
+
content: string;
|
|
13
|
+
/** Whether conflicts were detected */
|
|
14
|
+
hasConflicts: boolean;
|
|
15
|
+
/** Conflict information (empty if no conflicts) */
|
|
16
|
+
conflicts: ConflictInfo[];
|
|
17
|
+
/** Whether parsing failed (triggers fallback) */
|
|
18
|
+
parseFailed: boolean;
|
|
19
|
+
/** Error message if parse failed */
|
|
20
|
+
parseError?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Information about a conflict that requires resolution
|
|
24
|
+
*/
|
|
25
|
+
export interface ConflictInfo {
|
|
26
|
+
/** Type of conflict */
|
|
27
|
+
type: ConflictType;
|
|
28
|
+
/** Path to the conflicting field (e.g., "tasks[0].title") */
|
|
29
|
+
path: string;
|
|
30
|
+
/** ULID of the item with conflict (if applicable) */
|
|
31
|
+
ulid?: string;
|
|
32
|
+
/** Value from "ours" branch */
|
|
33
|
+
oursValue: unknown;
|
|
34
|
+
/** Value from "theirs" branch */
|
|
35
|
+
theirsValue: unknown;
|
|
36
|
+
/** Description of the conflict */
|
|
37
|
+
description: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Types of conflicts that can occur during merge
|
|
41
|
+
*/
|
|
42
|
+
export type ConflictType = "scalar_field" | "delete_modify" | "nested_conflict";
|
|
43
|
+
/**
|
|
44
|
+
* Options for merge operations
|
|
45
|
+
*/
|
|
46
|
+
export interface MergeOptions {
|
|
47
|
+
/** Whether to run in non-interactive mode (no prompts) */
|
|
48
|
+
nonInteractive?: boolean;
|
|
49
|
+
/** Output file path for merged result */
|
|
50
|
+
outputPath: string;
|
|
51
|
+
/** Path to "base" version (common ancestor) */
|
|
52
|
+
basePath: string;
|
|
53
|
+
/** Path to "ours" version (current branch) */
|
|
54
|
+
oursPath: string;
|
|
55
|
+
/** Path to "theirs" version (incoming branch) */
|
|
56
|
+
theirsPath: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Parsed versions of a file for merging
|
|
60
|
+
*/
|
|
61
|
+
export interface ParsedVersions {
|
|
62
|
+
/** Common ancestor version */
|
|
63
|
+
base: unknown;
|
|
64
|
+
/** Current branch version */
|
|
65
|
+
ours: unknown;
|
|
66
|
+
/** Incoming branch version */
|
|
67
|
+
theirs: unknown;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Result of parsing all three versions
|
|
71
|
+
*/
|
|
72
|
+
export interface ParseResult {
|
|
73
|
+
/** Whether parsing succeeded */
|
|
74
|
+
success: boolean;
|
|
75
|
+
/** Parsed versions (undefined if parse failed) */
|
|
76
|
+
versions?: ParsedVersions;
|
|
77
|
+
/** Error message if parse failed */
|
|
78
|
+
error?: string;
|
|
79
|
+
/** Which file failed to parse (if applicable) */
|
|
80
|
+
failedFile?: "base" | "ours" | "theirs";
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/merge/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,YAAY,EAAE,OAAO,CAAC;IACtB,mDAAmD;IACnD,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,iDAAiD;IACjD,WAAW,EAAE,OAAO,CAAC;IACrB,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,uBAAuB;IACvB,IAAI,EAAE,YAAY,CAAC;IACnB,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,iCAAiC;IACjC,WAAW,EAAE,OAAO,CAAC;IACrB,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,cAAc,GACd,eAAe,GACf,iBAAiB,CAAC;AAEtB;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,0DAA0D;IAC1D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,6BAA6B;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,8BAA8B;IAC9B,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/merge/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated data sections for agent instructions.
|
|
3
|
+
*
|
|
4
|
+
* Library functions that generate markdown sections from kspec meta data:
|
|
5
|
+
* skills table, conventions summary, and workflows summary.
|
|
6
|
+
*
|
|
7
|
+
* AC: @agent-data-sections ac-1 - generateSkillsTable returns markdown table
|
|
8
|
+
* AC: @agent-data-sections ac-2 - generateConventionsSummary returns markdown section
|
|
9
|
+
* AC: @agent-data-sections ac-3 - generateWorkflowsSummary returns markdown section
|
|
10
|
+
*/
|
|
11
|
+
import type { LoadedConvention, LoadedSkill, LoadedWorkflow } from "./meta.js";
|
|
12
|
+
/**
|
|
13
|
+
* Generate a markdown table for skills.
|
|
14
|
+
*
|
|
15
|
+
* AC: @agent-data-sections ac-1
|
|
16
|
+
* Given: skills in meta with varying names and descriptions
|
|
17
|
+
* When: generateSkillsTable is called
|
|
18
|
+
* Then: a markdown table is returned with columns for skill name, description, and invocation
|
|
19
|
+
*
|
|
20
|
+
* @param skills - Array of loaded skills from meta
|
|
21
|
+
* @returns Markdown table string with columns: name (as description), description, invocation
|
|
22
|
+
*/
|
|
23
|
+
export declare function generateSkillsTable(skills: LoadedSkill[]): string;
|
|
24
|
+
/**
|
|
25
|
+
* Intro paragraph for the conventions section.
|
|
26
|
+
* Extracted as a constant for future configurability.
|
|
27
|
+
*/
|
|
28
|
+
export declare const CONVENTIONS_INTRO = "These are the project's agreed-upon conventions. Follow them in all contributions to maintain consistency.";
|
|
29
|
+
/**
|
|
30
|
+
* Generate a markdown section summarizing conventions by domain.
|
|
31
|
+
*
|
|
32
|
+
* AC: @agent-data-sections ac-2
|
|
33
|
+
* Given: conventions in meta with rules arrays
|
|
34
|
+
* When: generateConventionsSummary is called
|
|
35
|
+
* Then: a markdown section is returned listing each domain with its rules
|
|
36
|
+
*
|
|
37
|
+
* @param conventions - Array of loaded conventions from meta
|
|
38
|
+
* @returns Markdown section string with domain headers, rules as list items, and examples
|
|
39
|
+
*/
|
|
40
|
+
export declare function generateConventionsSummary(conventions: LoadedConvention[]): string;
|
|
41
|
+
/**
|
|
42
|
+
* Generate a markdown section summarizing workflows.
|
|
43
|
+
*
|
|
44
|
+
* AC: @agent-data-sections ac-3
|
|
45
|
+
* Given: workflows in meta with triggers and descriptions
|
|
46
|
+
* When: generateWorkflowsSummary is called
|
|
47
|
+
* Then: a markdown section is returned listing each workflow with its trigger
|
|
48
|
+
*
|
|
49
|
+
* @param workflows - Array of loaded workflows from meta
|
|
50
|
+
* @returns Markdown section string with workflow list including triggers
|
|
51
|
+
*/
|
|
52
|
+
export declare function generateWorkflowsSummary(workflows: LoadedWorkflow[]): string;
|
|
53
|
+
//# sourceMappingURL=agent-data-sections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-data-sections.d.ts","sourceRoot":"","sources":["../../src/parser/agent-data-sections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE/E;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CA4BjE;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,+GACgF,CAAC;AAE/G;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,gBAAgB,EAAE,GAC9B,MAAM,CAsCR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG,MAAM,CAiB5E"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated data sections for agent instructions.
|
|
3
|
+
*
|
|
4
|
+
* Library functions that generate markdown sections from kspec meta data:
|
|
5
|
+
* skills table, conventions summary, and workflows summary.
|
|
6
|
+
*
|
|
7
|
+
* AC: @agent-data-sections ac-1 - generateSkillsTable returns markdown table
|
|
8
|
+
* AC: @agent-data-sections ac-2 - generateConventionsSummary returns markdown section
|
|
9
|
+
* AC: @agent-data-sections ac-3 - generateWorkflowsSummary returns markdown section
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Generate a markdown table for skills.
|
|
13
|
+
*
|
|
14
|
+
* AC: @agent-data-sections ac-1
|
|
15
|
+
* Given: skills in meta with varying names and descriptions
|
|
16
|
+
* When: generateSkillsTable is called
|
|
17
|
+
* Then: a markdown table is returned with columns for skill name, description, and invocation
|
|
18
|
+
*
|
|
19
|
+
* @param skills - Array of loaded skills from meta
|
|
20
|
+
* @returns Markdown table string with columns: name (as description), description, invocation
|
|
21
|
+
*/
|
|
22
|
+
export function generateSkillsTable(skills) {
|
|
23
|
+
if (skills.length === 0) {
|
|
24
|
+
return "";
|
|
25
|
+
}
|
|
26
|
+
const lines = [
|
|
27
|
+
"## Finding Information",
|
|
28
|
+
"",
|
|
29
|
+
"Use skills and CLI help for detailed documentation:",
|
|
30
|
+
"",
|
|
31
|
+
"| Need | Where to look |",
|
|
32
|
+
"|------|---------------|",
|
|
33
|
+
];
|
|
34
|
+
for (const skill of skills) {
|
|
35
|
+
const description = skill.description || skill.name;
|
|
36
|
+
// Core skills in plugin system are invoked as /kspec:<id>, project skills as /<id>
|
|
37
|
+
const invocation = skill.origin === "core" ? `kspec:${skill.id}` : skill.id;
|
|
38
|
+
lines.push(`| ${description} | \`/${invocation}\` skill |`);
|
|
39
|
+
}
|
|
40
|
+
lines.push("");
|
|
41
|
+
lines.push("Skills inject their full documentation when invoked — you don't need to memorize their contents.");
|
|
42
|
+
lines.push("");
|
|
43
|
+
return lines.join("\n");
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Intro paragraph for the conventions section.
|
|
47
|
+
* Extracted as a constant for future configurability.
|
|
48
|
+
*/
|
|
49
|
+
export const CONVENTIONS_INTRO = "These are the project's agreed-upon conventions. Follow them in all contributions to maintain consistency.";
|
|
50
|
+
/**
|
|
51
|
+
* Generate a markdown section summarizing conventions by domain.
|
|
52
|
+
*
|
|
53
|
+
* AC: @agent-data-sections ac-2
|
|
54
|
+
* Given: conventions in meta with rules arrays
|
|
55
|
+
* When: generateConventionsSummary is called
|
|
56
|
+
* Then: a markdown section is returned listing each domain with its rules
|
|
57
|
+
*
|
|
58
|
+
* @param conventions - Array of loaded conventions from meta
|
|
59
|
+
* @returns Markdown section string with domain headers, rules as list items, and examples
|
|
60
|
+
*/
|
|
61
|
+
export function generateConventionsSummary(conventions) {
|
|
62
|
+
if (conventions.length === 0) {
|
|
63
|
+
return "";
|
|
64
|
+
}
|
|
65
|
+
const lines = ["## Conventions", "", CONVENTIONS_INTRO, ""];
|
|
66
|
+
for (const convention of conventions) {
|
|
67
|
+
lines.push(`### ${convention.domain}`);
|
|
68
|
+
lines.push("");
|
|
69
|
+
for (const rule of convention.rules) {
|
|
70
|
+
lines.push(`- ${rule}`);
|
|
71
|
+
}
|
|
72
|
+
// Render examples when present
|
|
73
|
+
if (convention.examples && convention.examples.length > 0) {
|
|
74
|
+
lines.push("");
|
|
75
|
+
lines.push("**Examples:**");
|
|
76
|
+
for (const example of convention.examples) {
|
|
77
|
+
const combinedLength = example.good.length + example.bad.length;
|
|
78
|
+
if (combinedLength > 80) {
|
|
79
|
+
// Long format: quoted, separate lines
|
|
80
|
+
lines.push(`- Good: "${example.good}"`);
|
|
81
|
+
lines.push(`- Bad: "${example.bad}"`);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
// Short format: inline code with em-dash
|
|
85
|
+
lines.push(`- Good: \`${example.good}\` — Bad: \`${example.bad}\``);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
lines.push("");
|
|
90
|
+
}
|
|
91
|
+
return lines.join("\n");
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Generate a markdown section summarizing workflows.
|
|
95
|
+
*
|
|
96
|
+
* AC: @agent-data-sections ac-3
|
|
97
|
+
* Given: workflows in meta with triggers and descriptions
|
|
98
|
+
* When: generateWorkflowsSummary is called
|
|
99
|
+
* Then: a markdown section is returned listing each workflow with its trigger
|
|
100
|
+
*
|
|
101
|
+
* @param workflows - Array of loaded workflows from meta
|
|
102
|
+
* @returns Markdown section string with workflow list including triggers
|
|
103
|
+
*/
|
|
104
|
+
export function generateWorkflowsSummary(workflows) {
|
|
105
|
+
if (workflows.length === 0) {
|
|
106
|
+
return "";
|
|
107
|
+
}
|
|
108
|
+
const lines = ["## Workflows", "", "Available workflows:", ""];
|
|
109
|
+
for (const workflow of workflows) {
|
|
110
|
+
const description = workflow.description || workflow.trigger;
|
|
111
|
+
lines.push(`- **${workflow.id}**: ${description}`);
|
|
112
|
+
}
|
|
113
|
+
lines.push("");
|
|
114
|
+
lines.push("Use `kspec workflow start @workflow-id` to start a workflow.");
|
|
115
|
+
lines.push("");
|
|
116
|
+
return lines.join("\n");
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=agent-data-sections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-data-sections.js","sourceRoot":"","sources":["../../src/parser/agent-data-sections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAqB;IACvD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAAa;QACtB,wBAAwB;QACxB,EAAE;QACF,qDAAqD;QACrD,EAAE;QACF,0BAA0B;QAC1B,0BAA0B;KAC3B,CAAC;IAEF,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,IAAI,CAAC;QACpD,mFAAmF;QACnF,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5E,KAAK,CAAC,IAAI,CAAC,KAAK,WAAW,SAAS,UAAU,YAAY,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CACR,kGAAkG,CACnG,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAC5B,4GAA4G,CAAC;AAE/G;;;;;;;;;;GAUG;AACH,MAAM,UA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H,CAAC;QACH,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,wBAAwB,CAAC,SAA2B;IAClE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAAa,CAAC,cAAc,EAAE,EAAE,EAAE,sBAAsB,EAAE,EAAE,CAAC,CAAC;IAEzE,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,MAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,IAAI,QAAQ,CAAC,OAAO,CAAC;QAC7D,KAAK,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,EAAE,OAAO,WAAW,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;IAC3E,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Provides bidirectional mapping from spec items to implementing tasks,
|
|
5
5
|
* and detects alignment issues like orphaned specs or stale implementation status.
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
8
|
-
import type { ReferenceIndex } from
|
|
9
|
-
import type {
|
|
7
|
+
import type { ImplementationStatus } from "../schema/index.js";
|
|
8
|
+
import type { ReferenceIndex } from "./refs.js";
|
|
9
|
+
import type { KspecContext, LoadedSpecItem, LoadedTask } from "./yaml.js";
|
|
10
10
|
/**
|
|
11
11
|
* Summary of a spec item's implementation status based on linked tasks
|
|
12
12
|
*/
|
|
@@ -31,7 +31,7 @@ export interface LinkedTaskSummary {
|
|
|
31
31
|
* Alignment warning
|
|
32
32
|
*/
|
|
33
33
|
export interface AlignmentWarning {
|
|
34
|
-
type:
|
|
34
|
+
type: "orphaned_spec" | "status_mismatch" | "stale_implementation";
|
|
35
35
|
specUlid?: string;
|
|
36
36
|
specTitle?: string;
|
|
37
37
|
taskUlid?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alignment.d.ts","sourceRoot":"","sources":["../../src/parser/alignment.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"alignment.d.ts","sourceRoot":"","sources":["../../src/parser/alignment.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAO1E;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,oBAAoB,CAAC;IACpC,cAAc,EAAE,oBAAoB,CAAC;IACrC,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,eAAe,GAAG,iBAAiB,GAAG,sBAAsB,CAAC;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,C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AACH,wBAAsB,4BAA4B,CAChD,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,UAAU,EAAE,EACtB,QAAQ,EAAE,cAAc,EAAE,EAC1B,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CA6C5B"}
|
package/dist/parser/alignment.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides bidirectional mapping from spec items to implementing tasks,
|
|
5
5
|
* and detects alignment issues like orphaned specs or stale implementation status.
|
|
6
6
|
*/
|
|
7
|
-
import { updateSpecItem } from
|
|
7
|
+
import { updateSpecItem } from "./yaml.js";
|
|
8
8
|
// ============================================================
|
|
9
9
|
// ALIGNMENT INDEX
|
|
10
10
|
// ============================================================
|
|
@@ -61,7 +61,7 @@ export class AlignmentIndex {
|
|
|
61
61
|
getTasksForSpec(specUlid) {
|
|
62
62
|
const taskUlids = this.specToTasks.get(specUlid) || [];
|
|
63
63
|
return taskUlids
|
|
64
|
-
.map(ulid => this.tasks.get(ulid))
|
|
64
|
+
.map((ulid) => this.tasks.get(ulid))
|
|
65
65
|
.filter((t) => t !== undefined);
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
@@ -83,25 +83,25 @@ export class AlignmentIndex {
|
|
|
83
83
|
calculateExpectedStatus(specUlid) {
|
|
84
84
|
const taskUlids = this.specToTasks.get(specUlid) || [];
|
|
85
85
|
if (taskUlids.length === 0) {
|
|
86
|
-
return
|
|
86
|
+
return "not_started";
|
|
87
87
|
}
|
|
88
88
|
const tasks = taskUlids
|
|
89
|
-
.map(ulid => this.tasks.get(ulid))
|
|
89
|
+
.map((ulid) => this.tasks.get(ulid))
|
|
90
90
|
.filter((t) => t !== undefined);
|
|
91
91
|
if (tasks.length === 0) {
|
|
92
|
-
return
|
|
92
|
+
return "not_started";
|
|
93
93
|
}
|
|
94
94
|
// Check task statuses
|
|
95
|
-
const hasInProgress = tasks.some(t => t.status ===
|
|
96
|
-
const allCompleted = tasks.every(t => t.status ===
|
|
97
|
-
const someCompleted = tasks.some(t => t.status ===
|
|
95
|
+
const hasInProgress = tasks.some((t) => t.status === "in_progress");
|
|
96
|
+
const allCompleted = tasks.every((t) => t.status === "completed");
|
|
97
|
+
const someCompleted = tasks.some((t) => t.status === "completed");
|
|
98
98
|
if (allCompleted) {
|
|
99
|
-
return
|
|
99
|
+
return "implemented";
|
|
100
100
|
}
|
|
101
101
|
if (hasInProgress || someCompleted) {
|
|
102
|
-
return
|
|
102
|
+
return "in_progress";
|
|
103
103
|
}
|
|
104
|
-
return
|
|
104
|
+
return "not_started";
|
|
105
105
|
}
|
|
106
106
|
/**
|
|
107
107
|
* Get implementation summary for a spec item
|
|
@@ -112,15 +112,15 @@ export class AlignmentIndex {
|
|
|
112
112
|
return undefined;
|
|
113
113
|
const taskUlids = this.specToTasks.get(specUlid) || [];
|
|
114
114
|
const linkedTasks = taskUlids
|
|
115
|
-
.map(ulid => this.tasks.get(ulid))
|
|
115
|
+
.map((ulid) => this.tasks.get(ulid))
|
|
116
116
|
.filter((t) => t !== undefined)
|
|
117
|
-
.map(t => ({
|
|
117
|
+
.map((t) => ({
|
|
118
118
|
taskUlid: t._ulid,
|
|
119
119
|
taskTitle: t.title,
|
|
120
120
|
taskStatus: t.status,
|
|
121
121
|
hasNotes: t.notes.length > 0,
|
|
122
122
|
}));
|
|
123
|
-
const currentStatus = spec.status?.implementation ||
|
|
123
|
+
const currentStatus = spec.status?.implementation || "not_started";
|
|
124
124
|
const expectedStatus = this.calculateExpectedStatus(specUlid);
|
|
125
125
|
return {
|
|
126
126
|
specUlid,
|
|
@@ -139,12 +139,17 @@ export class AlignmentIndex {
|
|
|
139
139
|
// Check each spec item
|
|
140
140
|
for (const [specUlid, spec] of this.specItems) {
|
|
141
141
|
const taskUlids = this.specToTasks.get(specUlid) || [];
|
|
142
|
-
const currentStatus = spec.status?.implementation ||
|
|
142
|
+
const currentStatus = spec.status?.implementation || "not_started";
|
|
143
143
|
const expectedStatus = this.calculateExpectedStatus(specUlid);
|
|
144
144
|
// Orphaned spec (no tasks)
|
|
145
|
-
|
|
145
|
+
// AC: @trait-retrospective ac-1
|
|
146
|
+
// Skip retrospective specs from orphaned warnings
|
|
147
|
+
const isRetrospective = spec.traits?.includes("@trait-retrospective");
|
|
148
|
+
if (taskUlids.length === 0 &&
|
|
149
|
+
currentStatus === "not_started" &&
|
|
150
|
+
!isRetrospective) {
|
|
146
151
|
warnings.push({
|
|
147
|
-
type:
|
|
152
|
+
type: "orphaned_spec",
|
|
148
153
|
specUlid,
|
|
149
154
|
specTitle: spec.title,
|
|
150
155
|
message: `Spec item "${spec.title}" has no implementing tasks`,
|
|
@@ -153,7 +158,7 @@ export class AlignmentIndex {
|
|
|
153
158
|
// Status mismatch
|
|
154
159
|
if (currentStatus !== expectedStatus) {
|
|
155
160
|
warnings.push({
|
|
156
|
-
type:
|
|
161
|
+
type: "status_mismatch",
|
|
157
162
|
specUlid,
|
|
158
163
|
specTitle: spec.title,
|
|
159
164
|
message: `Spec "${spec.title}" status is "${currentStatus}" but should be "${expectedStatus}" based on task progress`,
|
|
@@ -162,7 +167,7 @@ export class AlignmentIndex {
|
|
|
162
167
|
}
|
|
163
168
|
// Check completed tasks with stale spec status
|
|
164
169
|
for (const [taskUlid, task] of this.tasks) {
|
|
165
|
-
if (task.status ===
|
|
170
|
+
if (task.status === "completed" && task.spec_ref) {
|
|
166
171
|
const specRef = this.taskToSpec.get(taskUlid);
|
|
167
172
|
if (specRef) {
|
|
168
173
|
// Note: We already checked this via spec iteration above
|
|
@@ -230,7 +235,7 @@ export async function syncSpecImplementationStatus(ctx, task, allTasks, allItems
|
|
|
230
235
|
return null;
|
|
231
236
|
}
|
|
232
237
|
// Find the spec item
|
|
233
|
-
const specItem = allItems.find(item => item._ulid === result.ulid);
|
|
238
|
+
const specItem = allItems.find((item) => item._ulid === result.ulid);
|
|
234
239
|
if (!specItem) {
|
|
235
240
|
return null;
|
|
236
241
|
}
|
|
@@ -238,7 +243,7 @@ export async function syncSpecImplementationStatus(ctx, task, allTasks, allItems
|
|
|
238
243
|
const alignmentIndex = new AlignmentIndex(allTasks, allItems);
|
|
239
244
|
alignmentIndex.buildLinks(refIndex);
|
|
240
245
|
const expectedStatus = alignmentIndex.calculateExpectedStatus(specItem._ulid);
|
|
241
|
-
const currentStatus = specItem.status?.implementation ||
|
|
246
|
+
const currentStatus = specItem.status?.implementation || "not_started";
|
|
242
247
|
// No change needed
|
|
243
248
|
if (currentStatus === expectedStatus) {
|
|
244
249
|
return null;
|
|
@@ -246,7 +251,7 @@ export async function syncSpecImplementationStatus(ctx, task, allTasks, allItems
|
|
|
246
251
|
// Update the spec item
|
|
247
252
|
await updateSpecItem(ctx, specItem, {
|
|
248
253
|
status: {
|
|
249
|
-
maturity: specItem.status?.maturity ||
|
|
254
|
+
maturity: specItem.status?.maturity || "draft",
|
|
250
255
|
implementation: expectedStatus,
|
|
251
256
|
},
|
|
252
257
|
});
|