@rpamis/comet 0.4.0-beta.6 → 0.4.0-beta.7
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 +209 -74
- package/assets/manifest.json +14 -5
- package/assets/skills/comet/SKILL.md +17 -282
- package/assets/skills/comet/reference/comet-yaml-fields.md +1 -1
- package/assets/skills/comet/reference/context-recovery.md +3 -3
- package/assets/skills/comet/reference/intent-frame.md +2 -2
- package/assets/skills/comet/reference/scripts.md +2 -2
- package/assets/skills/comet/rules/comet-workflow-guard.en.md +32 -0
- package/assets/skills/comet/rules/comet-workflow-guard.md +32 -0
- package/assets/skills/comet/scripts/comet-entry-runtime.mjs +7834 -0
- package/assets/skills/comet/scripts/comet-hook-router.mjs +10307 -0
- package/assets/skills/comet/scripts/comet-runtime.mjs +612 -499
- package/assets/skills/comet-any/SKILL.md +4 -4
- package/assets/skills/comet-any/reference/authoring-subagents.md +1 -1
- package/assets/skills/comet-any/reference/bundle-authoring.md +1 -1
- package/assets/skills/comet-any/reference/subagents/reference-author.md +1 -1
- package/assets/skills/comet-any/reference/subagents/script-author.md +1 -1
- package/assets/skills/comet-any/reference/subagents/skill-core-author.md +1 -1
- package/assets/skills/comet-any/reference/subagents/skill-reviewer.md +2 -2
- package/assets/skills/comet-any/reference/subagents/workflow-entry-author.md +3 -3
- package/assets/skills/comet-archive/SKILL.md +1 -2
- package/assets/skills/comet-build/SKILL.md +1 -1
- package/assets/skills/comet-classic/SKILL.md +293 -0
- package/assets/skills/comet-design/SKILL.md +1 -1
- package/assets/skills/comet-hotfix/SKILL.md +4 -4
- package/assets/skills/comet-native/SKILL.md +257 -0
- package/assets/skills/comet-native/reference/artifacts.md +204 -0
- package/assets/skills/comet-native/reference/commands.md +118 -0
- package/assets/skills/comet-native/reference/recovery.md +143 -0
- package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +4 -0
- package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +28898 -0
- package/assets/skills/comet-open/SKILL.md +4 -4
- package/assets/skills/comet-tweak/SKILL.md +7 -7
- package/assets/skills-zh/comet/SKILL.md +17 -270
- package/assets/skills-zh/comet/reference/comet-yaml-fields.md +1 -1
- package/assets/skills-zh/comet/reference/context-recovery.md +3 -3
- package/assets/skills-zh/comet/reference/intent-frame.md +2 -2
- package/assets/skills-zh/comet/reference/scripts.md +2 -2
- package/assets/skills-zh/comet-any/SKILL.md +4 -4
- package/assets/skills-zh/comet-any/reference/authoring-subagents.md +1 -1
- package/assets/skills-zh/comet-any/reference/bundle-authoring.md +1 -1
- package/assets/skills-zh/comet-any/reference/subagents/reference-author.md +1 -1
- package/assets/skills-zh/comet-any/reference/subagents/script-author.md +1 -1
- package/assets/skills-zh/comet-any/reference/subagents/skill-core-author.md +1 -1
- package/assets/skills-zh/comet-any/reference/subagents/skill-reviewer.md +2 -2
- package/assets/skills-zh/comet-any/reference/subagents/workflow-entry-author.md +3 -3
- package/assets/skills-zh/comet-archive/SKILL.md +1 -2
- package/assets/skills-zh/comet-build/SKILL.md +1 -1
- package/assets/skills-zh/comet-classic/SKILL.md +281 -0
- package/assets/skills-zh/comet-design/SKILL.md +1 -1
- package/assets/skills-zh/comet-hotfix/SKILL.md +4 -4
- package/assets/skills-zh/comet-native/SKILL.md +257 -0
- package/assets/skills-zh/comet-native/reference/artifacts.md +206 -0
- package/assets/skills-zh/comet-native/reference/commands.md +118 -0
- package/assets/skills-zh/comet-native/reference/recovery.md +143 -0
- package/assets/skills-zh/comet-open/SKILL.md +4 -4
- package/assets/skills-zh/comet-tweak/SKILL.md +7 -7
- package/dist/app/cli/index.js +59 -13
- package/dist/app/cli/index.js.map +1 -1
- package/dist/app/commands/command-result.d.ts +6 -0
- package/dist/app/commands/command-result.d.ts.map +1 -0
- package/dist/app/commands/command-result.js +4 -0
- package/dist/app/commands/command-result.js.map +1 -0
- package/dist/app/commands/doctor.d.ts +1 -0
- package/dist/app/commands/doctor.d.ts.map +1 -1
- package/dist/app/commands/doctor.js +201 -26
- package/dist/app/commands/doctor.js.map +1 -1
- package/dist/app/commands/eval.d.ts +3 -1
- package/dist/app/commands/eval.d.ts.map +1 -1
- package/dist/app/commands/eval.js +17 -7
- package/dist/app/commands/eval.js.map +1 -1
- package/dist/app/commands/i18n.d.ts +1 -1
- package/dist/app/commands/i18n.d.ts.map +1 -1
- package/dist/app/commands/i18n.js +6 -2
- package/dist/app/commands/i18n.js.map +1 -1
- package/dist/app/commands/init.d.ts +10 -2
- package/dist/app/commands/init.d.ts.map +1 -1
- package/dist/app/commands/init.js +331 -50
- package/dist/app/commands/init.js.map +1 -1
- package/dist/app/commands/native.d.ts +2 -0
- package/dist/app/commands/native.d.ts.map +1 -0
- package/dist/app/commands/native.js +10 -0
- package/dist/app/commands/native.js.map +1 -0
- package/dist/app/commands/project-scope-selection.d.ts.map +1 -1
- package/dist/app/commands/project-scope-selection.js +2 -0
- package/dist/app/commands/project-scope-selection.js.map +1 -1
- package/dist/app/commands/resume-probe.d.ts.map +1 -1
- package/dist/app/commands/resume-probe.js +8 -2
- package/dist/app/commands/resume-probe.js.map +1 -1
- package/dist/app/commands/status.d.ts +0 -32
- package/dist/app/commands/status.d.ts.map +1 -1
- package/dist/app/commands/status.js +44 -177
- package/dist/app/commands/status.js.map +1 -1
- package/dist/app/commands/update.d.ts +20 -4
- package/dist/app/commands/update.d.ts.map +1 -1
- package/dist/app/commands/update.js +698 -90
- package/dist/app/commands/update.js.map +1 -1
- package/dist/app/commands/workflow.d.ts +6 -0
- package/dist/app/commands/workflow.d.ts.map +1 -0
- package/dist/app/commands/workflow.js +11 -0
- package/dist/app/commands/workflow.js.map +1 -0
- package/dist/config/repository-layout.json +21 -1
- package/dist/domains/comet-classic/classic-archive.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-archive.js +3 -0
- package/dist/domains/comet-classic/classic-archive.js.map +1 -1
- package/dist/domains/comet-classic/classic-current-change.d.ts +3 -5
- package/dist/domains/comet-classic/classic-current-change.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-current-change.js +31 -57
- package/dist/domains/comet-classic/classic-current-change.js.map +1 -1
- package/dist/domains/comet-classic/classic-hook-guard.d.ts +9 -0
- package/dist/domains/comet-classic/classic-hook-guard.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-hook-guard.js +84 -11
- package/dist/domains/comet-classic/classic-hook-guard.js.map +1 -1
- package/dist/domains/comet-classic/classic-project-config.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-project-config.js +12 -8
- package/dist/domains/comet-classic/classic-project-config.js.map +1 -1
- package/dist/domains/comet-classic/classic-runtime-run.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-runtime-run.js +9 -1
- package/dist/domains/comet-classic/classic-runtime-run.js.map +1 -1
- package/dist/domains/comet-entry/current-selection-repair.d.ts +17 -0
- package/dist/domains/comet-entry/current-selection-repair.d.ts.map +1 -0
- package/dist/domains/comet-entry/current-selection-repair.js +19 -0
- package/dist/domains/comet-entry/current-selection-repair.js.map +1 -0
- package/dist/domains/comet-entry/current-selection.d.ts +28 -0
- package/dist/domains/comet-entry/current-selection.d.ts.map +1 -0
- package/dist/domains/comet-entry/current-selection.js +116 -0
- package/dist/domains/comet-entry/current-selection.js.map +1 -0
- package/dist/domains/comet-entry/entry-runtime-entry.d.ts +2 -0
- package/dist/domains/comet-entry/entry-runtime-entry.d.ts.map +1 -0
- package/dist/domains/comet-entry/entry-runtime-entry.js +3 -0
- package/dist/domains/comet-entry/entry-runtime-entry.js.map +1 -0
- package/dist/domains/comet-entry/entry-runtime.d.ts +7 -0
- package/dist/domains/comet-entry/entry-runtime.d.ts.map +1 -0
- package/dist/domains/comet-entry/entry-runtime.js +55 -0
- package/dist/domains/comet-entry/entry-runtime.js.map +1 -0
- package/dist/domains/comet-entry/hook-adapter.d.ts +6 -0
- package/dist/domains/comet-entry/hook-adapter.d.ts.map +1 -0
- package/dist/domains/comet-entry/hook-adapter.js +202 -0
- package/dist/domains/comet-entry/hook-adapter.js.map +1 -0
- package/dist/domains/comet-entry/hook-router-entry.d.ts +8 -0
- package/dist/domains/comet-entry/hook-router-entry.d.ts.map +1 -0
- package/dist/domains/comet-entry/hook-router-entry.js +92 -0
- package/dist/domains/comet-entry/hook-router-entry.js.map +1 -0
- package/dist/domains/comet-entry/hook-router.d.ts +32 -0
- package/dist/domains/comet-entry/hook-router.d.ts.map +1 -0
- package/dist/domains/comet-entry/hook-router.js +133 -0
- package/dist/domains/comet-entry/hook-router.js.map +1 -0
- package/dist/domains/comet-entry/hook-types.d.ts +20 -0
- package/dist/domains/comet-entry/hook-types.d.ts.map +1 -0
- package/dist/domains/comet-entry/hook-types.js +2 -0
- package/dist/domains/comet-entry/hook-types.js.map +1 -0
- package/dist/domains/comet-entry/init-workflow.d.ts +16 -0
- package/dist/domains/comet-entry/init-workflow.d.ts.map +1 -0
- package/dist/domains/comet-entry/init-workflow.js +103 -0
- package/dist/domains/comet-entry/init-workflow.js.map +1 -0
- package/dist/domains/comet-entry/project-status.d.ts +3 -0
- package/dist/domains/comet-entry/project-status.d.ts.map +1 -0
- package/dist/domains/comet-entry/project-status.js +222 -0
- package/dist/domains/comet-entry/project-status.js.map +1 -0
- package/dist/domains/comet-entry/resolve-entry.d.ts +3 -0
- package/dist/domains/comet-entry/resolve-entry.d.ts.map +1 -0
- package/dist/domains/comet-entry/resolve-entry.js +22 -0
- package/dist/domains/comet-entry/resolve-entry.js.map +1 -0
- package/dist/domains/comet-entry/resume-probe.d.ts +34 -0
- package/dist/domains/comet-entry/resume-probe.d.ts.map +1 -0
- package/dist/domains/comet-entry/resume-probe.js +458 -0
- package/dist/domains/comet-entry/resume-probe.js.map +1 -0
- package/dist/domains/comet-entry/types.d.ts +59 -0
- package/dist/domains/comet-entry/types.d.ts.map +1 -0
- package/dist/domains/comet-entry/types.js +2 -0
- package/dist/domains/comet-entry/types.js.map +1 -0
- package/dist/domains/comet-entry/workflow-resolution.d.ts +8 -0
- package/dist/domains/comet-entry/workflow-resolution.d.ts.map +1 -0
- package/dist/domains/comet-entry/workflow-resolution.js +16 -0
- package/dist/domains/comet-entry/workflow-resolution.js.map +1 -0
- package/dist/domains/comet-native/index.d.ts +35 -0
- package/dist/domains/comet-native/index.d.ts.map +1 -0
- package/dist/domains/comet-native/index.js +35 -0
- package/dist/domains/comet-native/index.js.map +1 -0
- package/dist/domains/comet-native/native-acceptance.d.ts +42 -0
- package/dist/domains/comet-native/native-acceptance.d.ts.map +1 -0
- package/dist/domains/comet-native/native-acceptance.js +503 -0
- package/dist/domains/comet-native/native-acceptance.js.map +1 -0
- package/dist/domains/comet-native/native-archive-content.d.ts +26 -0
- package/dist/domains/comet-native/native-archive-content.d.ts.map +1 -0
- package/dist/domains/comet-native/native-archive-content.js +159 -0
- package/dist/domains/comet-native/native-archive-content.js.map +1 -0
- package/dist/domains/comet-native/native-archive-inspection.d.ts +9 -0
- package/dist/domains/comet-native/native-archive-inspection.d.ts.map +1 -0
- package/dist/domains/comet-native/native-archive-inspection.js +94 -0
- package/dist/domains/comet-native/native-archive-inspection.js.map +1 -0
- package/dist/domains/comet-native/native-archive-preflight.d.ts +52 -0
- package/dist/domains/comet-native/native-archive-preflight.d.ts.map +1 -0
- package/dist/domains/comet-native/native-archive-preflight.js +214 -0
- package/dist/domains/comet-native/native-archive-preflight.js.map +1 -0
- package/dist/domains/comet-native/native-archive-transaction.d.ts +19 -0
- package/dist/domains/comet-native/native-archive-transaction.d.ts.map +1 -0
- package/dist/domains/comet-native/native-archive-transaction.js +1181 -0
- package/dist/domains/comet-native/native-archive-transaction.js.map +1 -0
- package/dist/domains/comet-native/native-archive.d.ts +36 -0
- package/dist/domains/comet-native/native-archive.d.ts.map +1 -0
- package/dist/domains/comet-native/native-archive.js +403 -0
- package/dist/domains/comet-native/native-archive.js.map +1 -0
- package/dist/domains/comet-native/native-artifacts.d.ts +10 -0
- package/dist/domains/comet-native/native-artifacts.d.ts.map +1 -0
- package/dist/domains/comet-native/native-artifacts.js +204 -0
- package/dist/domains/comet-native/native-artifacts.js.map +1 -0
- package/dist/domains/comet-native/native-atomic-file.d.ts +10 -0
- package/dist/domains/comet-native/native-atomic-file.d.ts.map +1 -0
- package/dist/domains/comet-native/native-atomic-file.js +175 -0
- package/dist/domains/comet-native/native-atomic-file.js.map +1 -0
- package/dist/domains/comet-native/native-bounded-file.d.ts +19 -0
- package/dist/domains/comet-native/native-bounded-file.d.ts.map +1 -0
- package/dist/domains/comet-native/native-bounded-file.js +180 -0
- package/dist/domains/comet-native/native-bounded-file.js.map +1 -0
- package/dist/domains/comet-native/native-build-evidence.d.ts +42 -0
- package/dist/domains/comet-native/native-build-evidence.d.ts.map +1 -0
- package/dist/domains/comet-native/native-build-evidence.js +257 -0
- package/dist/domains/comet-native/native-build-evidence.js.map +1 -0
- package/dist/domains/comet-native/native-canonical-hash.d.ts +10 -0
- package/dist/domains/comet-native/native-canonical-hash.d.ts.map +1 -0
- package/dist/domains/comet-native/native-canonical-hash.js +100 -0
- package/dist/domains/comet-native/native-canonical-hash.js.map +1 -0
- package/dist/domains/comet-native/native-change-recovery.d.ts +11 -0
- package/dist/domains/comet-native/native-change-recovery.d.ts.map +1 -0
- package/dist/domains/comet-native/native-change-recovery.js +15 -0
- package/dist/domains/comet-native/native-change-recovery.js.map +1 -0
- package/dist/domains/comet-native/native-change.d.ts +61 -0
- package/dist/domains/comet-native/native-change.d.ts.map +1 -0
- package/dist/domains/comet-native/native-change.js +696 -0
- package/dist/domains/comet-native/native-change.js.map +1 -0
- package/dist/domains/comet-native/native-check-receipt-model.d.ts +63 -0
- package/dist/domains/comet-native/native-check-receipt-model.d.ts.map +1 -0
- package/dist/domains/comet-native/native-check-receipt-model.js +347 -0
- package/dist/domains/comet-native/native-check-receipt-model.js.map +1 -0
- package/dist/domains/comet-native/native-check-receipt-storage.d.ts +10 -0
- package/dist/domains/comet-native/native-check-receipt-storage.d.ts.map +1 -0
- package/dist/domains/comet-native/native-check-receipt-storage.js +196 -0
- package/dist/domains/comet-native/native-check-receipt-storage.js.map +1 -0
- package/dist/domains/comet-native/native-check-receipt.d.ts +19 -0
- package/dist/domains/comet-native/native-check-receipt.d.ts.map +1 -0
- package/dist/domains/comet-native/native-check-receipt.js +446 -0
- package/dist/domains/comet-native/native-check-receipt.js.map +1 -0
- package/dist/domains/comet-native/native-check.d.ts +18 -0
- package/dist/domains/comet-native/native-check.d.ts.map +1 -0
- package/dist/domains/comet-native/native-check.js +29 -0
- package/dist/domains/comet-native/native-check.js.map +1 -0
- package/dist/domains/comet-native/native-checkpoint-journal.d.ts +13 -0
- package/dist/domains/comet-native/native-checkpoint-journal.d.ts.map +1 -0
- package/dist/domains/comet-native/native-checkpoint-journal.js +53 -0
- package/dist/domains/comet-native/native-checkpoint-journal.js.map +1 -0
- package/dist/domains/comet-native/native-checkpoint-storage.d.ts +43 -0
- package/dist/domains/comet-native/native-checkpoint-storage.d.ts.map +1 -0
- package/dist/domains/comet-native/native-checkpoint-storage.js +487 -0
- package/dist/domains/comet-native/native-checkpoint-storage.js.map +1 -0
- package/dist/domains/comet-native/native-cli-entry.d.ts +2 -0
- package/dist/domains/comet-native/native-cli-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-cli-entry.js +18 -0
- package/dist/domains/comet-native/native-cli-entry.js.map +1 -0
- package/dist/domains/comet-native/native-cli.d.ts +7 -0
- package/dist/domains/comet-native/native-cli.d.ts.map +1 -0
- package/dist/domains/comet-native/native-cli.js +642 -0
- package/dist/domains/comet-native/native-cli.js.map +1 -0
- package/dist/domains/comet-native/native-config.d.ts +15 -0
- package/dist/domains/comet-native/native-config.d.ts.map +1 -0
- package/dist/domains/comet-native/native-config.js +281 -0
- package/dist/domains/comet-native/native-config.js.map +1 -0
- package/dist/domains/comet-native/native-conflict-inspection.d.ts +17 -0
- package/dist/domains/comet-native/native-conflict-inspection.d.ts.map +1 -0
- package/dist/domains/comet-native/native-conflict-inspection.js +90 -0
- package/dist/domains/comet-native/native-conflict-inspection.js.map +1 -0
- package/dist/domains/comet-native/native-conflict-radar.d.ts +75 -0
- package/dist/domains/comet-native/native-conflict-radar.d.ts.map +1 -0
- package/dist/domains/comet-native/native-conflict-radar.js +326 -0
- package/dist/domains/comet-native/native-conflict-radar.js.map +1 -0
- package/dist/domains/comet-native/native-continuation.d.ts +9 -0
- package/dist/domains/comet-native/native-continuation.d.ts.map +1 -0
- package/dist/domains/comet-native/native-continuation.js +146 -0
- package/dist/domains/comet-native/native-continuation.js.map +1 -0
- package/dist/domains/comet-native/native-contract-files.d.ts +24 -0
- package/dist/domains/comet-native/native-contract-files.d.ts.map +1 -0
- package/dist/domains/comet-native/native-contract-files.js +66 -0
- package/dist/domains/comet-native/native-contract-files.js.map +1 -0
- package/dist/domains/comet-native/native-contract.d.ts +41 -0
- package/dist/domains/comet-native/native-contract.d.ts.map +1 -0
- package/dist/domains/comet-native/native-contract.js +141 -0
- package/dist/domains/comet-native/native-contract.js.map +1 -0
- package/dist/domains/comet-native/native-diagnostics.d.ts +18 -0
- package/dist/domains/comet-native/native-diagnostics.d.ts.map +1 -0
- package/dist/domains/comet-native/native-diagnostics.js +522 -0
- package/dist/domains/comet-native/native-diagnostics.js.map +1 -0
- package/dist/domains/comet-native/native-doctor.d.ts +12 -0
- package/dist/domains/comet-native/native-doctor.d.ts.map +1 -0
- package/dist/domains/comet-native/native-doctor.js +768 -0
- package/dist/domains/comet-native/native-doctor.js.map +1 -0
- package/dist/domains/comet-native/native-evidence-retention.d.ts +37 -0
- package/dist/domains/comet-native/native-evidence-retention.d.ts.map +1 -0
- package/dist/domains/comet-native/native-evidence-retention.js +885 -0
- package/dist/domains/comet-native/native-evidence-retention.js.map +1 -0
- package/dist/domains/comet-native/native-evidence-storage.d.ts +41 -0
- package/dist/domains/comet-native/native-evidence-storage.d.ts.map +1 -0
- package/dist/domains/comet-native/native-evidence-storage.js +351 -0
- package/dist/domains/comet-native/native-evidence-storage.js.map +1 -0
- package/dist/domains/comet-native/native-findings.d.ts +8 -0
- package/dist/domains/comet-native/native-findings.d.ts.map +1 -0
- package/dist/domains/comet-native/native-findings.js +238 -0
- package/dist/domains/comet-native/native-findings.js.map +1 -0
- package/dist/domains/comet-native/native-guards.d.ts +7 -0
- package/dist/domains/comet-native/native-guards.d.ts.map +1 -0
- package/dist/domains/comet-native/native-guards.js +126 -0
- package/dist/domains/comet-native/native-guards.js.map +1 -0
- package/dist/domains/comet-native/native-hash.d.ts +3 -0
- package/dist/domains/comet-native/native-hash.d.ts.map +1 -0
- package/dist/domains/comet-native/native-hash.js +12 -0
- package/dist/domains/comet-native/native-hash.js.map +1 -0
- package/dist/domains/comet-native/native-hook-guard.d.ts +17 -0
- package/dist/domains/comet-native/native-hook-guard.d.ts.map +1 -0
- package/dist/domains/comet-native/native-hook-guard.js +154 -0
- package/dist/domains/comet-native/native-hook-guard.js.map +1 -0
- package/dist/domains/comet-native/native-lock.d.ts +47 -0
- package/dist/domains/comet-native/native-lock.d.ts.map +1 -0
- package/dist/domains/comet-native/native-lock.js +395 -0
- package/dist/domains/comet-native/native-lock.js.map +1 -0
- package/dist/domains/comet-native/native-mutation-lock.d.ts +5 -0
- package/dist/domains/comet-native/native-mutation-lock.d.ts.map +1 -0
- package/dist/domains/comet-native/native-mutation-lock.js +66 -0
- package/dist/domains/comet-native/native-mutation-lock.js.map +1 -0
- package/dist/domains/comet-native/native-paths.d.ts +10 -0
- package/dist/domains/comet-native/native-paths.d.ts.map +1 -0
- package/dist/domains/comet-native/native-paths.js +171 -0
- package/dist/domains/comet-native/native-paths.js.map +1 -0
- package/dist/domains/comet-native/native-progress-checkpoint.d.ts +13 -0
- package/dist/domains/comet-native/native-progress-checkpoint.d.ts.map +1 -0
- package/dist/domains/comet-native/native-progress-checkpoint.js +104 -0
- package/dist/domains/comet-native/native-progress-checkpoint.js.map +1 -0
- package/dist/domains/comet-native/native-protected-file.d.ts +113 -0
- package/dist/domains/comet-native/native-protected-file.d.ts.map +1 -0
- package/dist/domains/comet-native/native-protected-file.js +509 -0
- package/dist/domains/comet-native/native-protected-file.js.map +1 -0
- package/dist/domains/comet-native/native-redaction.d.ts +2 -0
- package/dist/domains/comet-native/native-redaction.d.ts.map +1 -0
- package/dist/domains/comet-native/native-redaction.js +18 -0
- package/dist/domains/comet-native/native-redaction.js.map +1 -0
- package/dist/domains/comet-native/native-repair-integration.d.ts +42 -0
- package/dist/domains/comet-native/native-repair-integration.d.ts.map +1 -0
- package/dist/domains/comet-native/native-repair-integration.js +184 -0
- package/dist/domains/comet-native/native-repair-integration.js.map +1 -0
- package/dist/domains/comet-native/native-repair-runtime.d.ts +73 -0
- package/dist/domains/comet-native/native-repair-runtime.d.ts.map +1 -0
- package/dist/domains/comet-native/native-repair-runtime.js +509 -0
- package/dist/domains/comet-native/native-repair-runtime.js.map +1 -0
- package/dist/domains/comet-native/native-repair-stagnation.d.ts +85 -0
- package/dist/domains/comet-native/native-repair-stagnation.d.ts.map +1 -0
- package/dist/domains/comet-native/native-repair-stagnation.js +256 -0
- package/dist/domains/comet-native/native-repair-stagnation.js.map +1 -0
- package/dist/domains/comet-native/native-resume-view.d.ts +14 -0
- package/dist/domains/comet-native/native-resume-view.d.ts.map +1 -0
- package/dist/domains/comet-native/native-resume-view.js +105 -0
- package/dist/domains/comet-native/native-resume-view.js.map +1 -0
- package/dist/domains/comet-native/native-revision.d.ts +20 -0
- package/dist/domains/comet-native/native-revision.d.ts.map +1 -0
- package/dist/domains/comet-native/native-revision.js +32 -0
- package/dist/domains/comet-native/native-revision.js.map +1 -0
- package/dist/domains/comet-native/native-root-move.d.ts +20 -0
- package/dist/domains/comet-native/native-root-move.d.ts.map +1 -0
- package/dist/domains/comet-native/native-root-move.js +812 -0
- package/dist/domains/comet-native/native-root-move.js.map +1 -0
- package/dist/domains/comet-native/native-run-consistency.d.ts +3 -0
- package/dist/domains/comet-native/native-run-consistency.d.ts.map +1 -0
- package/dist/domains/comet-native/native-run-consistency.js +136 -0
- package/dist/domains/comet-native/native-run-consistency.js.map +1 -0
- package/dist/domains/comet-native/native-run-store.d.ts +41 -0
- package/dist/domains/comet-native/native-run-store.d.ts.map +1 -0
- package/dist/domains/comet-native/native-run-store.js +451 -0
- package/dist/domains/comet-native/native-run-store.js.map +1 -0
- package/dist/domains/comet-native/native-runtime-package.d.ts +16 -0
- package/dist/domains/comet-native/native-runtime-package.d.ts.map +1 -0
- package/dist/domains/comet-native/native-runtime-package.js +72 -0
- package/dist/domains/comet-native/native-runtime-package.js.map +1 -0
- package/dist/domains/comet-native/native-schema-migration.d.ts +11 -0
- package/dist/domains/comet-native/native-schema-migration.d.ts.map +1 -0
- package/dist/domains/comet-native/native-schema-migration.js +899 -0
- package/dist/domains/comet-native/native-schema-migration.js.map +1 -0
- package/dist/domains/comet-native/native-selection.d.ts +12 -0
- package/dist/domains/comet-native/native-selection.d.ts.map +1 -0
- package/dist/domains/comet-native/native-selection.js +52 -0
- package/dist/domains/comet-native/native-selection.js.map +1 -0
- package/dist/domains/comet-native/native-sensitive-paths.d.ts +7 -0
- package/dist/domains/comet-native/native-sensitive-paths.d.ts.map +1 -0
- package/dist/domains/comet-native/native-sensitive-paths.js +69 -0
- package/dist/domains/comet-native/native-sensitive-paths.js.map +1 -0
- package/dist/domains/comet-native/native-snapshot.d.ts +74 -0
- package/dist/domains/comet-native/native-snapshot.d.ts.map +1 -0
- package/dist/domains/comet-native/native-snapshot.js +2308 -0
- package/dist/domains/comet-native/native-snapshot.js.map +1 -0
- package/dist/domains/comet-native/native-specs.d.ts +12 -0
- package/dist/domains/comet-native/native-specs.d.ts.map +1 -0
- package/dist/domains/comet-native/native-specs.js +270 -0
- package/dist/domains/comet-native/native-specs.js.map +1 -0
- package/dist/domains/comet-native/native-trajectory-limits.d.ts +7 -0
- package/dist/domains/comet-native/native-trajectory-limits.d.ts.map +1 -0
- package/dist/domains/comet-native/native-trajectory-limits.js +13 -0
- package/dist/domains/comet-native/native-trajectory-limits.js.map +1 -0
- package/dist/domains/comet-native/native-trajectory-recovery.d.ts +37 -0
- package/dist/domains/comet-native/native-trajectory-recovery.d.ts.map +1 -0
- package/dist/domains/comet-native/native-trajectory-recovery.js +133 -0
- package/dist/domains/comet-native/native-trajectory-recovery.js.map +1 -0
- package/dist/domains/comet-native/native-trajectory.d.ts +16 -0
- package/dist/domains/comet-native/native-trajectory.d.ts.map +1 -0
- package/dist/domains/comet-native/native-trajectory.js +27 -0
- package/dist/domains/comet-native/native-trajectory.js.map +1 -0
- package/dist/domains/comet-native/native-transaction.d.ts +45 -0
- package/dist/domains/comet-native/native-transaction.d.ts.map +1 -0
- package/dist/domains/comet-native/native-transaction.js +846 -0
- package/dist/domains/comet-native/native-transaction.js.map +1 -0
- package/dist/domains/comet-native/native-transition-evidence.d.ts +4 -0
- package/dist/domains/comet-native/native-transition-evidence.d.ts.map +1 -0
- package/dist/domains/comet-native/native-transition-evidence.js +20 -0
- package/dist/domains/comet-native/native-transition-evidence.js.map +1 -0
- package/dist/domains/comet-native/native-transition-journal.d.ts +30 -0
- package/dist/domains/comet-native/native-transition-journal.d.ts.map +1 -0
- package/dist/domains/comet-native/native-transition-journal.js +819 -0
- package/dist/domains/comet-native/native-transition-journal.js.map +1 -0
- package/dist/domains/comet-native/native-transitions.d.ts +13 -0
- package/dist/domains/comet-native/native-transitions.d.ts.map +1 -0
- package/dist/domains/comet-native/native-transitions.js +632 -0
- package/dist/domains/comet-native/native-transitions.js.map +1 -0
- package/dist/domains/comet-native/native-types.d.ts +547 -0
- package/dist/domains/comet-native/native-types.d.ts.map +1 -0
- package/dist/domains/comet-native/native-types.js +8 -0
- package/dist/domains/comet-native/native-types.js.map +1 -0
- package/dist/domains/comet-native/native-verification-evidence.d.ts +86 -0
- package/dist/domains/comet-native/native-verification-evidence.d.ts.map +1 -0
- package/dist/domains/comet-native/native-verification-evidence.js +480 -0
- package/dist/domains/comet-native/native-verification-evidence.js.map +1 -0
- package/dist/domains/comet-native/native-verification-runtime.d.ts +58 -0
- package/dist/domains/comet-native/native-verification-runtime.d.ts.map +1 -0
- package/dist/domains/comet-native/native-verification-runtime.js +321 -0
- package/dist/domains/comet-native/native-verification-runtime.js.map +1 -0
- package/dist/domains/comet-native/native-verification-scope.d.ts +117 -0
- package/dist/domains/comet-native/native-verification-scope.d.ts.map +1 -0
- package/dist/domains/comet-native/native-verification-scope.js +1040 -0
- package/dist/domains/comet-native/native-verification-scope.js.map +1 -0
- package/dist/domains/comet-native/native-workspace.d.ts +46 -0
- package/dist/domains/comet-native/native-workspace.d.ts.map +1 -0
- package/dist/domains/comet-native/native-workspace.js +276 -0
- package/dist/domains/comet-native/native-workspace.js.map +1 -0
- package/dist/domains/dashboard/collector.d.ts.map +1 -1
- package/dist/domains/dashboard/collector.js +9 -1
- package/dist/domains/dashboard/collector.js.map +1 -1
- package/dist/domains/dashboard/native-adapter.d.ts +157 -0
- package/dist/domains/dashboard/native-adapter.d.ts.map +1 -0
- package/dist/domains/dashboard/native-adapter.js +302 -0
- package/dist/domains/dashboard/native-adapter.js.map +1 -0
- package/dist/domains/dashboard/native-collector.d.ts +6 -0
- package/dist/domains/dashboard/native-collector.d.ts.map +1 -0
- package/dist/domains/dashboard/native-collector.js +285 -0
- package/dist/domains/dashboard/native-collector.js.map +1 -0
- package/dist/domains/dashboard/types.d.ts +5 -0
- package/dist/domains/dashboard/types.d.ts.map +1 -1
- package/dist/domains/dashboard/web/assets/{arc-TGVUG2WN.js → arc-CxdiLJ50.js} +1 -1
- package/dist/domains/dashboard/web/assets/{architectureDiagram-3BPJPVTR-ASHmiHoP.js → architectureDiagram-3BPJPVTR-D5YCQu4e.js} +1 -1
- package/dist/domains/dashboard/web/assets/{blockDiagram-GPEHLZMM-CwASxBKe.js → blockDiagram-GPEHLZMM-8NfdCOQ8.js} +1 -1
- package/dist/domains/dashboard/web/assets/{c4Diagram-AAUBKEIU-BU8z_WNk.js → c4Diagram-AAUBKEIU-B3cFnNT7.js} +1 -1
- package/dist/domains/dashboard/web/assets/channel-B6AFly29.js +1 -0
- package/dist/domains/dashboard/web/assets/{chunk-2J33WTMH-CBGlUx4_.js → chunk-2J33WTMH-CBNfW-Dr.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-4BX2VUAB-CS-iGcFz.js → chunk-4BX2VUAB-vWyemRBr.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-55IACEB6-BUtCVJat.js → chunk-55IACEB6-H6haOo2C.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-727SXJPM-C94tj_pf.js → chunk-727SXJPM-D02UjGND.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-AQP2D5EJ-BFOKcpdG.js → chunk-AQP2D5EJ-wKsbOw_T.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-FMBD7UC4-Dmx8B-st.js → chunk-FMBD7UC4-eYFEZimP.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-ND2GUHAM-DYV00CNn.js → chunk-ND2GUHAM-fMaIDDI2.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-QZHKN3VN-DMJJyQnw.js → chunk-QZHKN3VN-C9rhF6Hm.js} +1 -1
- package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-BcnrxOTt.js +1 -0
- package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-BcnrxOTt.js +1 -0
- package/dist/domains/dashboard/web/assets/{cose-bilkent-S5V4N54A-P4nE2rea.js → cose-bilkent-S5V4N54A-CbaShPub.js} +1 -1
- package/dist/domains/dashboard/web/assets/{cynefin-VYW2F7L2-C-R1HXDv.js → cynefin-VYW2F7L2-DN4emAQv.js} +1 -1
- package/dist/domains/dashboard/web/assets/{dagre-BM42HDAG-BH8d-C9z.js → dagre-BM42HDAG-BpSzbk_V.js} +1 -1
- package/dist/domains/dashboard/web/assets/demo-BuVau32v.js +25 -0
- package/dist/domains/dashboard/web/assets/{diagram-2AECGRRQ-DpXTgQIH.js → diagram-2AECGRRQ-CfXwGGpQ.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-5GNKFQAL-DSiFJzSw.js → diagram-5GNKFQAL-DMp0Zmot.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-KO2AKTUF-DULMkben.js → diagram-KO2AKTUF-C7ZvofsM.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-LMA3HP47-Pi8m_NO9.js → diagram-LMA3HP47-BjmxFnap.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-OG6HWLK6-BSe6bCWm.js → diagram-OG6HWLK6-DFBG1Iqy.js} +1 -1
- package/dist/domains/dashboard/web/assets/{erDiagram-TEJ5UH35-zb-FEcbq.js → erDiagram-TEJ5UH35-MpNT7dzt.js} +1 -1
- package/dist/domains/dashboard/web/assets/{flowDiagram-I6XJVG4X-Dr-Gk0z2.js → flowDiagram-I6XJVG4X-_1wAR6c1.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ganttDiagram-6RSMTGT7-qs6Zb2A6.js → ganttDiagram-6RSMTGT7-DJKjDeWl.js} +1 -1
- package/dist/domains/dashboard/web/assets/{gitGraphDiagram-PVQCEYII-BQ314orT.js → gitGraphDiagram-PVQCEYII-BL7yUEn-.js} +1 -1
- package/dist/domains/dashboard/web/assets/index-CjE9mHGb.js +24 -0
- package/dist/domains/dashboard/web/assets/index-D-AGxvI4.css +1 -0
- package/dist/domains/dashboard/web/assets/{infoDiagram-5YYISTIA-O0bQp98A.js → infoDiagram-5YYISTIA-Bt5fqrOd.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ishikawaDiagram-YF4QCWOH-BPC7wbKh.js → ishikawaDiagram-YF4QCWOH-COCMcjBM.js} +1 -1
- package/dist/domains/dashboard/web/assets/{journeyDiagram-JHISSGLW-ohViOd4b.js → journeyDiagram-JHISSGLW-DGcpcWny.js} +1 -1
- package/dist/domains/dashboard/web/assets/{kanban-definition-UN3LZRKU-CHleNdbG.js → kanban-definition-UN3LZRKU-QSBNsWMP.js} +1 -1
- package/dist/domains/dashboard/web/assets/{linear-CyqiW--Q.js → linear-9uyeeBZf.js} +1 -1
- package/dist/domains/dashboard/web/assets/{mermaid.core-qS9XvtaK.js → mermaid.core-CkNdB471.js} +4 -4
- package/dist/domains/dashboard/web/assets/{mindmap-definition-RKZ34NQL-oaGkqO9l.js → mindmap-definition-RKZ34NQL-CiNxI0gP.js} +1 -1
- package/dist/domains/dashboard/web/assets/{pieDiagram-4H26LBE5-CPcB-AFh.js → pieDiagram-4H26LBE5-BLJ6QnRO.js} +1 -1
- package/dist/domains/dashboard/web/assets/{quadrantDiagram-W4KKPZXB-LFy52Qtj.js → quadrantDiagram-W4KKPZXB-CflW-eFH.js} +1 -1
- package/dist/domains/dashboard/web/assets/{requirementDiagram-4Y6WPE33-BdjeaYP_.js → requirementDiagram-4Y6WPE33-B9HLmRWH.js} +1 -1
- package/dist/domains/dashboard/web/assets/{sankeyDiagram-5OEKKPKP-DDJ4styL.js → sankeyDiagram-5OEKKPKP-6xnco5k5.js} +1 -1
- package/dist/domains/dashboard/web/assets/{sequenceDiagram-3UESZ5HK-BL5bFNoz.js → sequenceDiagram-3UESZ5HK-Dp1rujNZ.js} +1 -1
- package/dist/domains/dashboard/web/assets/{stateDiagram-AJRCARHV-BNUfikui.js → stateDiagram-AJRCARHV-C1Xc90ek.js} +1 -1
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-p-qmzXyE.js +1 -0
- package/dist/domains/dashboard/web/assets/{timeline-definition-PNZ67QCA--ps2uu6L.js → timeline-definition-PNZ67QCA-g9s-m5Z4.js} +1 -1
- package/dist/domains/dashboard/web/assets/{vennDiagram-CIIHVFJN-C2q8q26c.js → vennDiagram-CIIHVFJN-rkEyhyCc.js} +1 -1
- package/dist/domains/dashboard/web/assets/{wardleyDiagram-YWT4CUSO-BUH9gXqd.js → wardleyDiagram-YWT4CUSO-CJLrWGXc.js} +1 -1
- package/dist/domains/dashboard/web/assets/{xychartDiagram-2RQKCTM6-B-DielEy.js → xychartDiagram-2RQKCTM6-BxJvPNqo.js} +1 -1
- package/dist/domains/dashboard/web/index.html +2 -2
- package/dist/domains/engine/storage-layout.d.ts +14 -0
- package/dist/domains/engine/storage-layout.d.ts.map +1 -0
- package/dist/domains/engine/storage-layout.js +32 -0
- package/dist/domains/engine/storage-layout.js.map +1 -0
- package/dist/domains/engine/storage-run.d.ts +9 -0
- package/dist/domains/engine/storage-run.d.ts.map +1 -0
- package/dist/domains/engine/storage-run.js +116 -0
- package/dist/domains/engine/storage-run.js.map +1 -0
- package/dist/domains/factory/package.d.ts.map +1 -1
- package/dist/domains/factory/package.js +5 -3
- package/dist/domains/factory/package.js.map +1 -1
- package/dist/domains/integrations/openspec.d.ts.map +1 -1
- package/dist/domains/integrations/openspec.js +8 -6
- package/dist/domains/integrations/openspec.js.map +1 -1
- package/dist/domains/skill/platform-inspect.d.ts +6 -2
- package/dist/domains/skill/platform-inspect.d.ts.map +1 -1
- package/dist/domains/skill/platform-inspect.js +52 -8
- package/dist/domains/skill/platform-inspect.js.map +1 -1
- package/dist/domains/skill/platform-install.d.ts +18 -7
- package/dist/domains/skill/platform-install.d.ts.map +1 -1
- package/dist/domains/skill/platform-install.js +338 -71
- package/dist/domains/skill/platform-install.js.map +1 -1
- package/dist/domains/skill/project-instructions.d.ts.map +1 -1
- package/dist/domains/skill/project-instructions.js +12 -6
- package/dist/domains/skill/project-instructions.js.map +1 -1
- package/dist/domains/skill/uninstall.d.ts.map +1 -1
- package/dist/domains/skill/uninstall.js +15 -3
- package/dist/domains/skill/uninstall.js.map +1 -1
- package/dist/domains/workflow-contract/builtins.d.ts +6 -0
- package/dist/domains/workflow-contract/builtins.d.ts.map +1 -1
- package/dist/domains/workflow-contract/builtins.js +137 -0
- package/dist/domains/workflow-contract/builtins.js.map +1 -1
- package/dist/domains/workflow-contract/index.d.ts +3 -1
- package/dist/domains/workflow-contract/index.d.ts.map +1 -1
- package/dist/domains/workflow-contract/index.js +2 -1
- package/dist/domains/workflow-contract/index.js.map +1 -1
- package/dist/domains/workflow-contract/normalize.d.ts.map +1 -1
- package/dist/domains/workflow-contract/normalize.js +28 -10
- package/dist/domains/workflow-contract/normalize.js.map +1 -1
- package/dist/domains/workflow-contract/project-config.d.ts +7 -0
- package/dist/domains/workflow-contract/project-config.d.ts.map +1 -0
- package/dist/domains/workflow-contract/project-config.js +110 -0
- package/dist/domains/workflow-contract/project-config.js.map +1 -0
- package/dist/domains/workflow-contract/types.d.ts +4 -2
- package/dist/domains/workflow-contract/types.d.ts.map +1 -1
- package/dist/domains/workflow-contract/validation.d.ts.map +1 -1
- package/dist/domains/workflow-contract/validation.js +14 -5
- package/dist/domains/workflow-contract/validation.js.map +1 -1
- package/dist/platform/install/detect.d.ts +3 -1
- package/dist/platform/install/detect.d.ts.map +1 -1
- package/dist/platform/install/detect.js +4 -1
- package/dist/platform/install/detect.js.map +1 -1
- package/dist/platform/install/project-registry.js +2 -2
- package/dist/platform/install/project-registry.js.map +1 -1
- package/dist/platform/paths/repository-layout.d.ts +16 -0
- package/dist/platform/paths/repository-layout.d.ts.map +1 -1
- package/dist/platform/paths/repository-layout.js.map +1 -1
- package/eval/local/README.md +50 -0
- package/eval/local/scripts/compare_baselines.py +127 -1
- package/eval/local/scripts/regression_check.py +3 -4
- package/eval/local/tasks/comet-native-clarification/environment/Dockerfile +27 -0
- package/eval/local/tasks/comet-native-clarification/environment/test_wordcount.py +25 -0
- package/eval/local/tasks/comet-native-clarification/environment/wordcount.py +36 -0
- package/eval/local/tasks/comet-native-clarification/instruction.md +7 -0
- package/eval/local/tasks/comet-native-clarification/task.toml +40 -0
- package/eval/local/tasks/comet-native-clarification/validation/test_native_clarification.py +193 -0
- package/eval/local/tasks/comet-native-clarification-modes/environment/Dockerfile +27 -0
- package/eval/local/tasks/comet-native-clarification-modes/environment/test_wordcount.py +25 -0
- package/eval/local/tasks/comet-native-clarification-modes/environment/wordcount.py +36 -0
- package/eval/local/tasks/comet-native-clarification-modes/instruction.md +13 -0
- package/eval/local/tasks/comet-native-clarification-modes/task.toml +39 -0
- package/eval/local/tasks/comet-native-clarification-modes/validation/test_native_clarification_modes.py +235 -0
- package/eval/local/tasks/comet-native-interrupted-transition/environment/.comet/config.yaml +6 -0
- package/eval/local/tasks/comet-native-interrupted-transition/environment/Dockerfile +28 -0
- package/eval/local/tasks/comet-native-interrupted-transition/environment/docs/comet/changes/add-character-counting/brief.md +17 -0
- package/eval/local/tasks/comet-native-interrupted-transition/environment/docs/comet/changes/add-character-counting/comet-state.yaml +12 -0
- package/eval/local/tasks/comet-native-interrupted-transition/environment/docs/comet/changes/add-character-counting/runtime/transition.json +69 -0
- package/eval/local/tasks/comet-native-interrupted-transition/environment/docs/comet/changes/add-character-counting/specs/character-counting/spec.md +3 -0
- package/eval/local/tasks/comet-native-interrupted-transition/environment/test_wordcount.py +20 -0
- package/eval/local/tasks/comet-native-interrupted-transition/environment/wordcount.py +27 -0
- package/eval/local/tasks/comet-native-interrupted-transition/instruction.md +7 -0
- package/eval/local/tasks/comet-native-interrupted-transition/task.toml +35 -0
- package/eval/local/tasks/comet-native-interrupted-transition/validation/test_native_interrupted_transition.py +63 -0
- package/eval/local/tasks/comet-native-repository-fact/environment/Dockerfile +26 -0
- package/eval/local/tasks/comet-native-repository-fact/environment/PRODUCT_RULES.md +3 -0
- package/eval/local/tasks/comet-native-repository-fact/environment/test_wordcount.py +20 -0
- package/eval/local/tasks/comet-native-repository-fact/environment/wordcount.py +27 -0
- package/eval/local/tasks/comet-native-repository-fact/instruction.md +7 -0
- package/eval/local/tasks/comet-native-repository-fact/task.toml +35 -0
- package/eval/local/tasks/comet-native-repository-fact/validation/test_native_repository_fact.py +53 -0
- package/eval/local/tasks/comet-native-wave-b-decision-resume/environment/Dockerfile +27 -0
- package/eval/local/tasks/comet-native-wave-b-decision-resume/environment/test_wordcount.py +27 -0
- package/eval/local/tasks/comet-native-wave-b-decision-resume/environment/wordcount.py +36 -0
- package/eval/local/tasks/comet-native-wave-b-decision-resume/instruction.md +9 -0
- package/eval/local/tasks/comet-native-wave-b-decision-resume/task.toml +40 -0
- package/eval/local/tasks/comet-native-wave-b-decision-resume/validation/test_native_wave_b_decision_resume.py +208 -0
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/environment/Dockerfile +27 -0
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/environment/test_wordcount.py +27 -0
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/environment/wordcount.py +36 -0
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/instruction.md +11 -0
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/task.toml +36 -0
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/validation/test_native_wave_c_verification_integrity.py +344 -0
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/environment/Dockerfile +27 -0
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/environment/test_wordcount.py +27 -0
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/environment/wordcount.py +36 -0
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/instruction.md +11 -0
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/task.toml +37 -0
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/validation/test_native_wave_d_stagnation_stop.py +284 -0
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/environment/.include-trusted-native-runtime +1 -0
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/environment/Dockerfile +27 -0
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/environment/test_wordcount.py +27 -0
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/environment/wordcount.py +36 -0
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/instruction.md +9 -0
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/task.toml +37 -0
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/validation/test_native_wave_e_parallel_safety.py +309 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/.include-current-comet-cli +1 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/Dockerfile +31 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/current-comet-package.json +18 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/current-comet.sh +14 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/test_wordcount.py +27 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/wordcount.py +36 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/instruction.md +7 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/task.toml +36 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/validation/test_native_wave_f_dashboard_readonly.py +469 -0
- package/eval/local/tasks/comet-native-workflow/environment/Dockerfile +27 -0
- package/eval/local/tasks/comet-native-workflow/environment/test_wordcount.py +25 -0
- package/eval/local/tasks/comet-native-workflow/environment/wordcount.py +36 -0
- package/eval/local/tasks/comet-native-workflow/instruction.md +14 -0
- package/eval/local/tasks/comet-native-workflow/task.toml +36 -0
- package/eval/local/tasks/comet-native-workflow/validation/test_native_workflow.py +149 -0
- package/eval/local/tasks/index.yaml +61 -0
- package/eval/local/tests/conftest.py +407 -22
- package/eval/local/tests/scaffold/test_aligned_comparison.py +1012 -0
- package/eval/local/tests/scaffold/test_conftest_helpers.py +187 -7
- package/eval/local/tests/scaffold/test_logging.py +135 -1
- package/eval/local/tests/scaffold/test_manifests.py +2 -0
- package/eval/local/tests/scaffold/test_native_aligned_eval.py +346 -0
- package/eval/local/tests/scaffold/test_native_wave_evaluations.py +1889 -0
- package/eval/local/tests/scaffold/test_profiles.py +33 -0
- package/eval/local/tests/scaffold/test_sample_quality.py +57 -0
- package/eval/local/tests/scaffold/test_tasks.py +377 -1
- package/eval/local/tests/scaffold/test_treatments.py +59 -13
- package/eval/local/tests/scaffold/test_utils.py +277 -4
- package/eval/local/tests/tasks/__init__.py +1 -0
- package/eval/local/tests/tasks/test_tasks.py +104 -78
- package/eval/local/tests/tasks/test_validation_scripts.py +37 -0
- package/eval/local/treatments/comet/comet_native_phase1.yaml +66 -0
- package/eval/scaffold/python/aligned_comparison.py +1631 -0
- package/eval/scaffold/python/generic_llm_judge.py +3 -1
- package/eval/scaffold/python/llm_judge.py +0 -3
- package/eval/scaffold/python/logging.py +115 -16
- package/eval/scaffold/python/manifests.py +2 -0
- package/eval/scaffold/python/native_eval.py +138 -0
- package/eval/scaffold/python/pass_at_k.py +0 -1
- package/eval/scaffold/python/report_outputs.py +226 -44
- package/eval/scaffold/python/sample_quality.py +45 -2
- package/eval/scaffold/python/tasks.py +11 -0
- package/eval/scaffold/python/utils.py +108 -20
- package/eval/scaffold/python/validation/__init__.py +15 -5
- package/eval/scaffold/python/validation/comet_workflow.py +10 -5
- package/eval/scaffold/python/validation/generic_rubric.py +1 -2
- package/eval/scaffold/python/validation/native_wave.py +2154 -0
- package/eval/scaffold/python/validation/native_workflow.py +252 -0
- package/eval/scaffold/python/validation/rubric.py +0 -2
- package/eval/scaffold/shell/completion-point.sh +18 -0
- package/eval/scaffold/shell/decision-point.sh +35 -0
- package/eval/scaffold/shell/docker.sh +150 -9
- package/eval/scaffold/shell/run-claude-loop.sh +57 -27
- package/package.json +19 -5
- package/dist/domains/dashboard/web/assets/channel-kp6Ng2JJ.js +0 -1
- package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-yBDjgMY_.js +0 -1
- package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-yBDjgMY_.js +0 -1
- package/dist/domains/dashboard/web/assets/demo-DQyfozbi.js +0 -1
- package/dist/domains/dashboard/web/assets/index-BLAfkNTu.css +0 -1
- package/dist/domains/dashboard/web/assets/index-DtLUOcAW.js +0 -24
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-DGrsmWts.js +0 -1
- package/eval/.env.example +0 -52
- package/eval/langsmith/.env.example +0 -16
|
@@ -126,17 +126,17 @@ var require_visit = __commonJS({
|
|
|
126
126
|
visit.BREAK = BREAK;
|
|
127
127
|
visit.SKIP = SKIP;
|
|
128
128
|
visit.REMOVE = REMOVE;
|
|
129
|
-
function visit_(key, node, visitor,
|
|
130
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
129
|
+
function visit_(key, node, visitor, path24) {
|
|
130
|
+
const ctrl = callVisitor(key, node, visitor, path24);
|
|
131
131
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
132
|
-
replaceNode(key,
|
|
133
|
-
return visit_(key, ctrl, visitor,
|
|
132
|
+
replaceNode(key, path24, ctrl);
|
|
133
|
+
return visit_(key, ctrl, visitor, path24);
|
|
134
134
|
}
|
|
135
135
|
if (typeof ctrl !== "symbol") {
|
|
136
136
|
if (identity.isCollection(node)) {
|
|
137
|
-
|
|
137
|
+
path24 = Object.freeze(path24.concat(node));
|
|
138
138
|
for (let i = 0; i < node.items.length; ++i) {
|
|
139
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
139
|
+
const ci = visit_(i, node.items[i], visitor, path24);
|
|
140
140
|
if (typeof ci === "number")
|
|
141
141
|
i = ci - 1;
|
|
142
142
|
else if (ci === BREAK)
|
|
@@ -147,13 +147,13 @@ var require_visit = __commonJS({
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
} else if (identity.isPair(node)) {
|
|
150
|
-
|
|
151
|
-
const ck = visit_("key", node.key, visitor,
|
|
150
|
+
path24 = Object.freeze(path24.concat(node));
|
|
151
|
+
const ck = visit_("key", node.key, visitor, path24);
|
|
152
152
|
if (ck === BREAK)
|
|
153
153
|
return BREAK;
|
|
154
154
|
else if (ck === REMOVE)
|
|
155
155
|
node.key = null;
|
|
156
|
-
const cv = visit_("value", node.value, visitor,
|
|
156
|
+
const cv = visit_("value", node.value, visitor, path24);
|
|
157
157
|
if (cv === BREAK)
|
|
158
158
|
return BREAK;
|
|
159
159
|
else if (cv === REMOVE)
|
|
@@ -174,17 +174,17 @@ var require_visit = __commonJS({
|
|
|
174
174
|
visitAsync.BREAK = BREAK;
|
|
175
175
|
visitAsync.SKIP = SKIP;
|
|
176
176
|
visitAsync.REMOVE = REMOVE;
|
|
177
|
-
async function visitAsync_(key, node, visitor,
|
|
178
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
177
|
+
async function visitAsync_(key, node, visitor, path24) {
|
|
178
|
+
const ctrl = await callVisitor(key, node, visitor, path24);
|
|
179
179
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
180
|
-
replaceNode(key,
|
|
181
|
-
return visitAsync_(key, ctrl, visitor,
|
|
180
|
+
replaceNode(key, path24, ctrl);
|
|
181
|
+
return visitAsync_(key, ctrl, visitor, path24);
|
|
182
182
|
}
|
|
183
183
|
if (typeof ctrl !== "symbol") {
|
|
184
184
|
if (identity.isCollection(node)) {
|
|
185
|
-
|
|
185
|
+
path24 = Object.freeze(path24.concat(node));
|
|
186
186
|
for (let i = 0; i < node.items.length; ++i) {
|
|
187
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
187
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path24);
|
|
188
188
|
if (typeof ci === "number")
|
|
189
189
|
i = ci - 1;
|
|
190
190
|
else if (ci === BREAK)
|
|
@@ -195,13 +195,13 @@ var require_visit = __commonJS({
|
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
} else if (identity.isPair(node)) {
|
|
198
|
-
|
|
199
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
198
|
+
path24 = Object.freeze(path24.concat(node));
|
|
199
|
+
const ck = await visitAsync_("key", node.key, visitor, path24);
|
|
200
200
|
if (ck === BREAK)
|
|
201
201
|
return BREAK;
|
|
202
202
|
else if (ck === REMOVE)
|
|
203
203
|
node.key = null;
|
|
204
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
204
|
+
const cv = await visitAsync_("value", node.value, visitor, path24);
|
|
205
205
|
if (cv === BREAK)
|
|
206
206
|
return BREAK;
|
|
207
207
|
else if (cv === REMOVE)
|
|
@@ -228,23 +228,23 @@ var require_visit = __commonJS({
|
|
|
228
228
|
}
|
|
229
229
|
return visitor;
|
|
230
230
|
}
|
|
231
|
-
function callVisitor(key, node, visitor,
|
|
231
|
+
function callVisitor(key, node, visitor, path24) {
|
|
232
232
|
if (typeof visitor === "function")
|
|
233
|
-
return visitor(key, node,
|
|
233
|
+
return visitor(key, node, path24);
|
|
234
234
|
if (identity.isMap(node))
|
|
235
|
-
return visitor.Map?.(key, node,
|
|
235
|
+
return visitor.Map?.(key, node, path24);
|
|
236
236
|
if (identity.isSeq(node))
|
|
237
|
-
return visitor.Seq?.(key, node,
|
|
237
|
+
return visitor.Seq?.(key, node, path24);
|
|
238
238
|
if (identity.isPair(node))
|
|
239
|
-
return visitor.Pair?.(key, node,
|
|
239
|
+
return visitor.Pair?.(key, node, path24);
|
|
240
240
|
if (identity.isScalar(node))
|
|
241
|
-
return visitor.Scalar?.(key, node,
|
|
241
|
+
return visitor.Scalar?.(key, node, path24);
|
|
242
242
|
if (identity.isAlias(node))
|
|
243
|
-
return visitor.Alias?.(key, node,
|
|
243
|
+
return visitor.Alias?.(key, node, path24);
|
|
244
244
|
return void 0;
|
|
245
245
|
}
|
|
246
|
-
function replaceNode(key,
|
|
247
|
-
const parent =
|
|
246
|
+
function replaceNode(key, path24, node) {
|
|
247
|
+
const parent = path24[path24.length - 1];
|
|
248
248
|
if (identity.isCollection(parent)) {
|
|
249
249
|
parent.items[key] = node;
|
|
250
250
|
} else if (identity.isPair(parent)) {
|
|
@@ -854,10 +854,10 @@ var require_Collection = __commonJS({
|
|
|
854
854
|
var createNode = require_createNode();
|
|
855
855
|
var identity = require_identity();
|
|
856
856
|
var Node = require_Node();
|
|
857
|
-
function collectionFromPath(schema,
|
|
857
|
+
function collectionFromPath(schema, path24, value) {
|
|
858
858
|
let v = value;
|
|
859
|
-
for (let i =
|
|
860
|
-
const k =
|
|
859
|
+
for (let i = path24.length - 1; i >= 0; --i) {
|
|
860
|
+
const k = path24[i];
|
|
861
861
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
862
862
|
const a = [];
|
|
863
863
|
a[k] = v;
|
|
@@ -876,7 +876,7 @@ var require_Collection = __commonJS({
|
|
|
876
876
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
877
877
|
});
|
|
878
878
|
}
|
|
879
|
-
var isEmptyPath = (
|
|
879
|
+
var isEmptyPath = (path24) => path24 == null || typeof path24 === "object" && !!path24[Symbol.iterator]().next().done;
|
|
880
880
|
var Collection = class extends Node.NodeBase {
|
|
881
881
|
constructor(type, schema) {
|
|
882
882
|
super(type);
|
|
@@ -906,11 +906,11 @@ var require_Collection = __commonJS({
|
|
|
906
906
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
907
907
|
* that already exists in the map.
|
|
908
908
|
*/
|
|
909
|
-
addIn(
|
|
910
|
-
if (isEmptyPath(
|
|
909
|
+
addIn(path24, value) {
|
|
910
|
+
if (isEmptyPath(path24))
|
|
911
911
|
this.add(value);
|
|
912
912
|
else {
|
|
913
|
-
const [key, ...rest] =
|
|
913
|
+
const [key, ...rest] = path24;
|
|
914
914
|
const node = this.get(key, true);
|
|
915
915
|
if (identity.isCollection(node))
|
|
916
916
|
node.addIn(rest, value);
|
|
@@ -924,8 +924,8 @@ var require_Collection = __commonJS({
|
|
|
924
924
|
* Removes a value from the collection.
|
|
925
925
|
* @returns `true` if the item was found and removed.
|
|
926
926
|
*/
|
|
927
|
-
deleteIn(
|
|
928
|
-
const [key, ...rest] =
|
|
927
|
+
deleteIn(path24) {
|
|
928
|
+
const [key, ...rest] = path24;
|
|
929
929
|
if (rest.length === 0)
|
|
930
930
|
return this.delete(key);
|
|
931
931
|
const node = this.get(key, true);
|
|
@@ -939,8 +939,8 @@ var require_Collection = __commonJS({
|
|
|
939
939
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
940
940
|
* `true` (collections are always returned intact).
|
|
941
941
|
*/
|
|
942
|
-
getIn(
|
|
943
|
-
const [key, ...rest] =
|
|
942
|
+
getIn(path24, keepScalar) {
|
|
943
|
+
const [key, ...rest] = path24;
|
|
944
944
|
const node = this.get(key, true);
|
|
945
945
|
if (rest.length === 0)
|
|
946
946
|
return !keepScalar && identity.isScalar(node) ? node.value : node;
|
|
@@ -958,8 +958,8 @@ var require_Collection = __commonJS({
|
|
|
958
958
|
/**
|
|
959
959
|
* Checks if the collection includes a value with the key `key`.
|
|
960
960
|
*/
|
|
961
|
-
hasIn(
|
|
962
|
-
const [key, ...rest] =
|
|
961
|
+
hasIn(path24) {
|
|
962
|
+
const [key, ...rest] = path24;
|
|
963
963
|
if (rest.length === 0)
|
|
964
964
|
return this.has(key);
|
|
965
965
|
const node = this.get(key, true);
|
|
@@ -969,8 +969,8 @@ var require_Collection = __commonJS({
|
|
|
969
969
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
970
970
|
* boolean to add/remove the item from the set.
|
|
971
971
|
*/
|
|
972
|
-
setIn(
|
|
973
|
-
const [key, ...rest] =
|
|
972
|
+
setIn(path24, value) {
|
|
973
|
+
const [key, ...rest] = path24;
|
|
974
974
|
if (rest.length === 0) {
|
|
975
975
|
this.set(key, value);
|
|
976
976
|
} else {
|
|
@@ -3485,9 +3485,9 @@ var require_Document = __commonJS({
|
|
|
3485
3485
|
this.contents.add(value);
|
|
3486
3486
|
}
|
|
3487
3487
|
/** Adds a value to the document. */
|
|
3488
|
-
addIn(
|
|
3488
|
+
addIn(path24, value) {
|
|
3489
3489
|
if (assertCollection(this.contents))
|
|
3490
|
-
this.contents.addIn(
|
|
3490
|
+
this.contents.addIn(path24, value);
|
|
3491
3491
|
}
|
|
3492
3492
|
/**
|
|
3493
3493
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -3562,14 +3562,14 @@ var require_Document = __commonJS({
|
|
|
3562
3562
|
* Removes a value from the document.
|
|
3563
3563
|
* @returns `true` if the item was found and removed.
|
|
3564
3564
|
*/
|
|
3565
|
-
deleteIn(
|
|
3566
|
-
if (Collection.isEmptyPath(
|
|
3565
|
+
deleteIn(path24) {
|
|
3566
|
+
if (Collection.isEmptyPath(path24)) {
|
|
3567
3567
|
if (this.contents == null)
|
|
3568
3568
|
return false;
|
|
3569
3569
|
this.contents = null;
|
|
3570
3570
|
return true;
|
|
3571
3571
|
}
|
|
3572
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
3572
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path24) : false;
|
|
3573
3573
|
}
|
|
3574
3574
|
/**
|
|
3575
3575
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -3584,10 +3584,10 @@ var require_Document = __commonJS({
|
|
|
3584
3584
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
3585
3585
|
* `true` (collections are always returned intact).
|
|
3586
3586
|
*/
|
|
3587
|
-
getIn(
|
|
3588
|
-
if (Collection.isEmptyPath(
|
|
3587
|
+
getIn(path24, keepScalar) {
|
|
3588
|
+
if (Collection.isEmptyPath(path24))
|
|
3589
3589
|
return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
3590
|
-
return identity.isCollection(this.contents) ? this.contents.getIn(
|
|
3590
|
+
return identity.isCollection(this.contents) ? this.contents.getIn(path24, keepScalar) : void 0;
|
|
3591
3591
|
}
|
|
3592
3592
|
/**
|
|
3593
3593
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -3598,10 +3598,10 @@ var require_Document = __commonJS({
|
|
|
3598
3598
|
/**
|
|
3599
3599
|
* Checks if the document includes a value at `path`.
|
|
3600
3600
|
*/
|
|
3601
|
-
hasIn(
|
|
3602
|
-
if (Collection.isEmptyPath(
|
|
3601
|
+
hasIn(path24) {
|
|
3602
|
+
if (Collection.isEmptyPath(path24))
|
|
3603
3603
|
return this.contents !== void 0;
|
|
3604
|
-
return identity.isCollection(this.contents) ? this.contents.hasIn(
|
|
3604
|
+
return identity.isCollection(this.contents) ? this.contents.hasIn(path24) : false;
|
|
3605
3605
|
}
|
|
3606
3606
|
/**
|
|
3607
3607
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -3618,13 +3618,13 @@ var require_Document = __commonJS({
|
|
|
3618
3618
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
3619
3619
|
* boolean to add/remove the item from the set.
|
|
3620
3620
|
*/
|
|
3621
|
-
setIn(
|
|
3622
|
-
if (Collection.isEmptyPath(
|
|
3621
|
+
setIn(path24, value) {
|
|
3622
|
+
if (Collection.isEmptyPath(path24)) {
|
|
3623
3623
|
this.contents = value;
|
|
3624
3624
|
} else if (this.contents == null) {
|
|
3625
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
3625
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path24), value);
|
|
3626
3626
|
} else if (assertCollection(this.contents)) {
|
|
3627
|
-
this.contents.setIn(
|
|
3627
|
+
this.contents.setIn(path24, value);
|
|
3628
3628
|
}
|
|
3629
3629
|
}
|
|
3630
3630
|
/**
|
|
@@ -5584,9 +5584,9 @@ var require_cst_visit = __commonJS({
|
|
|
5584
5584
|
visit.BREAK = BREAK;
|
|
5585
5585
|
visit.SKIP = SKIP;
|
|
5586
5586
|
visit.REMOVE = REMOVE;
|
|
5587
|
-
visit.itemAtPath = (cst,
|
|
5587
|
+
visit.itemAtPath = (cst, path24) => {
|
|
5588
5588
|
let item = cst;
|
|
5589
|
-
for (const [field2, index] of
|
|
5589
|
+
for (const [field2, index] of path24) {
|
|
5590
5590
|
const tok = item?.[field2];
|
|
5591
5591
|
if (tok && "items" in tok) {
|
|
5592
5592
|
item = tok.items[index];
|
|
@@ -5595,23 +5595,23 @@ var require_cst_visit = __commonJS({
|
|
|
5595
5595
|
}
|
|
5596
5596
|
return item;
|
|
5597
5597
|
};
|
|
5598
|
-
visit.parentCollection = (cst,
|
|
5599
|
-
const parent = visit.itemAtPath(cst,
|
|
5600
|
-
const field2 =
|
|
5598
|
+
visit.parentCollection = (cst, path24) => {
|
|
5599
|
+
const parent = visit.itemAtPath(cst, path24.slice(0, -1));
|
|
5600
|
+
const field2 = path24[path24.length - 1][0];
|
|
5601
5601
|
const coll = parent?.[field2];
|
|
5602
5602
|
if (coll && "items" in coll)
|
|
5603
5603
|
return coll;
|
|
5604
5604
|
throw new Error("Parent collection not found");
|
|
5605
5605
|
};
|
|
5606
|
-
function _visit(
|
|
5607
|
-
let ctrl = visitor(item,
|
|
5606
|
+
function _visit(path24, item, visitor) {
|
|
5607
|
+
let ctrl = visitor(item, path24);
|
|
5608
5608
|
if (typeof ctrl === "symbol")
|
|
5609
5609
|
return ctrl;
|
|
5610
5610
|
for (const field2 of ["key", "value"]) {
|
|
5611
5611
|
const token = item[field2];
|
|
5612
5612
|
if (token && "items" in token) {
|
|
5613
5613
|
for (let i = 0; i < token.items.length; ++i) {
|
|
5614
|
-
const ci = _visit(Object.freeze(
|
|
5614
|
+
const ci = _visit(Object.freeze(path24.concat([[field2, i]])), token.items[i], visitor);
|
|
5615
5615
|
if (typeof ci === "number")
|
|
5616
5616
|
i = ci - 1;
|
|
5617
5617
|
else if (ci === BREAK)
|
|
@@ -5622,10 +5622,10 @@ var require_cst_visit = __commonJS({
|
|
|
5622
5622
|
}
|
|
5623
5623
|
}
|
|
5624
5624
|
if (typeof ctrl === "function" && field2 === "key")
|
|
5625
|
-
ctrl = ctrl(item,
|
|
5625
|
+
ctrl = ctrl(item, path24);
|
|
5626
5626
|
}
|
|
5627
5627
|
}
|
|
5628
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
5628
|
+
return typeof ctrl === "function" ? ctrl(item, path24) : ctrl;
|
|
5629
5629
|
}
|
|
5630
5630
|
exports.visit = visit;
|
|
5631
5631
|
}
|
|
@@ -6927,14 +6927,14 @@ var require_parser = __commonJS({
|
|
|
6927
6927
|
case "scalar":
|
|
6928
6928
|
case "single-quoted-scalar":
|
|
6929
6929
|
case "double-quoted-scalar": {
|
|
6930
|
-
const
|
|
6930
|
+
const fs23 = this.flowScalar(this.type);
|
|
6931
6931
|
if (atNextItem || it.value) {
|
|
6932
|
-
map.items.push({ start, key:
|
|
6932
|
+
map.items.push({ start, key: fs23, sep: [] });
|
|
6933
6933
|
this.onKeyLine = true;
|
|
6934
6934
|
} else if (it.sep) {
|
|
6935
|
-
this.stack.push(
|
|
6935
|
+
this.stack.push(fs23);
|
|
6936
6936
|
} else {
|
|
6937
|
-
Object.assign(it, { key:
|
|
6937
|
+
Object.assign(it, { key: fs23, sep: [] });
|
|
6938
6938
|
this.onKeyLine = true;
|
|
6939
6939
|
}
|
|
6940
6940
|
return;
|
|
@@ -7062,13 +7062,13 @@ var require_parser = __commonJS({
|
|
|
7062
7062
|
case "scalar":
|
|
7063
7063
|
case "single-quoted-scalar":
|
|
7064
7064
|
case "double-quoted-scalar": {
|
|
7065
|
-
const
|
|
7065
|
+
const fs23 = this.flowScalar(this.type);
|
|
7066
7066
|
if (!it || it.value)
|
|
7067
|
-
fc.items.push({ start: [], key:
|
|
7067
|
+
fc.items.push({ start: [], key: fs23, sep: [] });
|
|
7068
7068
|
else if (it.sep)
|
|
7069
|
-
this.stack.push(
|
|
7069
|
+
this.stack.push(fs23);
|
|
7070
7070
|
else
|
|
7071
|
-
Object.assign(it, { key:
|
|
7071
|
+
Object.assign(it, { key: fs23, sep: [] });
|
|
7072
7072
|
return;
|
|
7073
7073
|
}
|
|
7074
7074
|
case "flow-map-end":
|
|
@@ -7546,8 +7546,8 @@ import { pathToFileURL } from "url";
|
|
|
7546
7546
|
// domains/comet-classic/classic-archive.ts
|
|
7547
7547
|
import { createHash as createHash3 } from "crypto";
|
|
7548
7548
|
import { spawnSync } from "child_process";
|
|
7549
|
-
import { promises as
|
|
7550
|
-
import
|
|
7549
|
+
import { promises as fs14 } from "fs";
|
|
7550
|
+
import path15 from "path";
|
|
7551
7551
|
|
|
7552
7552
|
// domains/comet-classic/classic-paths.ts
|
|
7553
7553
|
import { promises as fs } from "fs";
|
|
@@ -9016,6 +9016,11 @@ async function fileExists2(file) {
|
|
|
9016
9016
|
throw error;
|
|
9017
9017
|
}
|
|
9018
9018
|
}
|
|
9019
|
+
async function isClassicRuntimePackageRoot(root) {
|
|
9020
|
+
if (!await directoryExists(root)) return false;
|
|
9021
|
+
if (await fileExists2(path10.join(root, "skill.yaml"))) return true;
|
|
9022
|
+
return await fileExists2(path10.join(root, "SKILL.md")) && await fileExists2(path10.join(root, "comet", "skill.yaml"));
|
|
9023
|
+
}
|
|
9019
9024
|
function embeddedClassicRuntimePackage(root) {
|
|
9020
9025
|
return {
|
|
9021
9026
|
root,
|
|
@@ -9254,7 +9259,7 @@ async function classicRuntimeRoot() {
|
|
|
9254
9259
|
path10.resolve("assets", "skills", "comet-classic")
|
|
9255
9260
|
].filter((candidate) => Boolean(candidate));
|
|
9256
9261
|
for (const candidate of candidates) {
|
|
9257
|
-
if (await
|
|
9262
|
+
if (await isClassicRuntimePackageRoot(candidate)) return candidate;
|
|
9258
9263
|
}
|
|
9259
9264
|
return null;
|
|
9260
9265
|
}
|
|
@@ -9525,6 +9530,324 @@ function applyClassicTransition(current, event, options = {}) {
|
|
|
9525
9530
|
return { classic, effects, definition };
|
|
9526
9531
|
}
|
|
9527
9532
|
|
|
9533
|
+
// domains/comet-classic/classic-current-change.ts
|
|
9534
|
+
import { promises as fs13 } from "fs";
|
|
9535
|
+
import path14 from "path";
|
|
9536
|
+
|
|
9537
|
+
// domains/comet-entry/current-selection.ts
|
|
9538
|
+
import { randomUUID as randomUUID6 } from "crypto";
|
|
9539
|
+
import { promises as fs11 } from "fs";
|
|
9540
|
+
import path12 from "path";
|
|
9541
|
+
var COMET_CURRENT_SELECTION_SCHEMA = "comet.selection.v2";
|
|
9542
|
+
var COMET_CURRENT_SELECTION_MAX_BYTES = 16 * 1024;
|
|
9543
|
+
function cometCurrentSelectionFile(projectRoot2) {
|
|
9544
|
+
return path12.join(projectRoot2, ".comet", "current-change.json");
|
|
9545
|
+
}
|
|
9546
|
+
function isRecord(value) {
|
|
9547
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
9548
|
+
}
|
|
9549
|
+
function validBranch(value) {
|
|
9550
|
+
return value === null || typeof value === "string";
|
|
9551
|
+
}
|
|
9552
|
+
function parseSelection(source) {
|
|
9553
|
+
let value;
|
|
9554
|
+
try {
|
|
9555
|
+
value = JSON.parse(source);
|
|
9556
|
+
} catch (error) {
|
|
9557
|
+
throw new Error(
|
|
9558
|
+
`current change selection contains invalid JSON: ${error instanceof Error ? error.message : String(error)}`,
|
|
9559
|
+
{ cause: error }
|
|
9560
|
+
);
|
|
9561
|
+
}
|
|
9562
|
+
if (!isRecord(value)) {
|
|
9563
|
+
throw new Error("current change selection must be a JSON object");
|
|
9564
|
+
}
|
|
9565
|
+
if (value.version === 1) {
|
|
9566
|
+
if (typeof value.change !== "string") {
|
|
9567
|
+
throw new Error("legacy current change selection change must be a string");
|
|
9568
|
+
}
|
|
9569
|
+
if (value.branch !== void 0 && !validBranch(value.branch)) {
|
|
9570
|
+
throw new Error("legacy current change selection branch must be a string or null");
|
|
9571
|
+
}
|
|
9572
|
+
return {
|
|
9573
|
+
selection: {
|
|
9574
|
+
schema: COMET_CURRENT_SELECTION_SCHEMA,
|
|
9575
|
+
workflow: "classic",
|
|
9576
|
+
change: value.change,
|
|
9577
|
+
branch: value.branch ?? null
|
|
9578
|
+
},
|
|
9579
|
+
legacy: true
|
|
9580
|
+
};
|
|
9581
|
+
}
|
|
9582
|
+
if (value.schema !== COMET_CURRENT_SELECTION_SCHEMA) {
|
|
9583
|
+
throw new Error(`current change selection schema must be ${COMET_CURRENT_SELECTION_SCHEMA}`);
|
|
9584
|
+
}
|
|
9585
|
+
if (value.workflow !== "native" && value.workflow !== "classic") {
|
|
9586
|
+
throw new Error("current change selection workflow must be native or classic");
|
|
9587
|
+
}
|
|
9588
|
+
if (typeof value.change !== "string") {
|
|
9589
|
+
throw new Error("current change selection change must be a string");
|
|
9590
|
+
}
|
|
9591
|
+
if (!validBranch(value.branch)) {
|
|
9592
|
+
throw new Error("current change selection branch must be a string or null");
|
|
9593
|
+
}
|
|
9594
|
+
if (value.workflow === "native" && value.branch !== null) {
|
|
9595
|
+
throw new Error("Native current change selection branch must be null");
|
|
9596
|
+
}
|
|
9597
|
+
return { selection: value, legacy: false };
|
|
9598
|
+
}
|
|
9599
|
+
async function readCometCurrentSelection(projectRoot2) {
|
|
9600
|
+
let source;
|
|
9601
|
+
try {
|
|
9602
|
+
const stat = await fs11.lstat(cometCurrentSelectionFile(projectRoot2));
|
|
9603
|
+
if (stat.isSymbolicLink() || !stat.isFile()) {
|
|
9604
|
+
throw new Error("current change selection must be a regular file");
|
|
9605
|
+
}
|
|
9606
|
+
if (stat.size > COMET_CURRENT_SELECTION_MAX_BYTES) {
|
|
9607
|
+
throw new Error(
|
|
9608
|
+
`current change selection exceeds ${COMET_CURRENT_SELECTION_MAX_BYTES} bytes`
|
|
9609
|
+
);
|
|
9610
|
+
}
|
|
9611
|
+
source = await fs11.readFile(cometCurrentSelectionFile(projectRoot2), "utf8");
|
|
9612
|
+
} catch (error) {
|
|
9613
|
+
if (error.code === "ENOENT") return { status: "missing" };
|
|
9614
|
+
throw new Error(
|
|
9615
|
+
`cannot read current change selection: ${error instanceof Error ? error.message : String(error)}`,
|
|
9616
|
+
{ cause: error }
|
|
9617
|
+
);
|
|
9618
|
+
}
|
|
9619
|
+
const parsed = parseSelection(source);
|
|
9620
|
+
return { status: "selected", ...parsed };
|
|
9621
|
+
}
|
|
9622
|
+
async function writeCometCurrentSelection(projectRoot2, selection) {
|
|
9623
|
+
const parsed = parseSelection(JSON.stringify(selection));
|
|
9624
|
+
if (parsed.legacy) throw new Error("cannot write a legacy current change selection");
|
|
9625
|
+
const file = cometCurrentSelectionFile(projectRoot2);
|
|
9626
|
+
const temporary = `${file}.${randomUUID6()}.tmp`;
|
|
9627
|
+
await fs11.mkdir(path12.dirname(file), { recursive: true });
|
|
9628
|
+
try {
|
|
9629
|
+
await fs11.writeFile(temporary, `${JSON.stringify(parsed.selection, null, 2)}
|
|
9630
|
+
`, "utf8");
|
|
9631
|
+
await fs11.rename(temporary, file);
|
|
9632
|
+
} catch (error) {
|
|
9633
|
+
await fs11.rm(temporary, { force: true });
|
|
9634
|
+
throw error;
|
|
9635
|
+
}
|
|
9636
|
+
}
|
|
9637
|
+
async function clearCometCurrentSelection(projectRoot2) {
|
|
9638
|
+
await fs11.rm(cometCurrentSelectionFile(projectRoot2), { force: true });
|
|
9639
|
+
}
|
|
9640
|
+
async function clearCometCurrentSelectionIf(projectRoot2, workflow, change) {
|
|
9641
|
+
const current = await readCometCurrentSelection(projectRoot2);
|
|
9642
|
+
if (current.status !== "selected" || current.selection.workflow !== workflow || current.selection.change !== change) {
|
|
9643
|
+
return false;
|
|
9644
|
+
}
|
|
9645
|
+
await clearCometCurrentSelection(projectRoot2);
|
|
9646
|
+
return true;
|
|
9647
|
+
}
|
|
9648
|
+
|
|
9649
|
+
// domains/comet-classic/classic-branch-binding.ts
|
|
9650
|
+
var import_yaml3 = __toESM(require_dist(), 1);
|
|
9651
|
+
import { execFileSync } from "child_process";
|
|
9652
|
+
import { randomUUID as randomUUID7 } from "crypto";
|
|
9653
|
+
import { promises as fs12 } from "fs";
|
|
9654
|
+
import path13 from "path";
|
|
9655
|
+
function liveGitBranch(cwd) {
|
|
9656
|
+
try {
|
|
9657
|
+
const branch = execFileSync("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
|
|
9658
|
+
cwd,
|
|
9659
|
+
encoding: "utf8",
|
|
9660
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
9661
|
+
}).trim();
|
|
9662
|
+
return branch && branch !== "HEAD" ? branch : null;
|
|
9663
|
+
} catch {
|
|
9664
|
+
return null;
|
|
9665
|
+
}
|
|
9666
|
+
}
|
|
9667
|
+
function isGitWorkTree(cwd) {
|
|
9668
|
+
try {
|
|
9669
|
+
return execFileSync("git", ["rev-parse", "--is-inside-work-tree"], {
|
|
9670
|
+
cwd,
|
|
9671
|
+
encoding: "utf8",
|
|
9672
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
9673
|
+
}).trim() === "true";
|
|
9674
|
+
} catch {
|
|
9675
|
+
return false;
|
|
9676
|
+
}
|
|
9677
|
+
}
|
|
9678
|
+
var BOUND_BRANCH_ISOLATIONS = ["current", "branch", "worktree"];
|
|
9679
|
+
function requiresBranchBinding(isolation) {
|
|
9680
|
+
return BOUND_BRANCH_ISOLATIONS.includes(isolation);
|
|
9681
|
+
}
|
|
9682
|
+
function evaluateBranchBinding(input) {
|
|
9683
|
+
if (!requiresBranchBinding(input.isolation)) return { status: "not-applicable" };
|
|
9684
|
+
if (input.boundBranch === null && input.currentBranch === null && input.gitWorkTree === false) {
|
|
9685
|
+
return { status: "not-applicable" };
|
|
9686
|
+
}
|
|
9687
|
+
if (input.boundBranch === null) {
|
|
9688
|
+
return input.currentBranch === null ? { status: "unbound-detached" } : { status: "needs-heal", branch: input.currentBranch };
|
|
9689
|
+
}
|
|
9690
|
+
if (input.currentBranch === input.boundBranch) return { status: "ok" };
|
|
9691
|
+
return { status: "drift", boundBranch: input.boundBranch, currentBranch: input.currentBranch };
|
|
9692
|
+
}
|
|
9693
|
+
async function resolveBranchBinding(changeDir, options) {
|
|
9694
|
+
const file = path13.join(changeDir, ".comet.yaml");
|
|
9695
|
+
const document = (0, import_yaml3.parseDocument)(await fs12.readFile(file, "utf8"), { uniqueKeys: false });
|
|
9696
|
+
if (document.errors.length > 0) {
|
|
9697
|
+
throw new Error(`Invalid .comet.yaml: ${document.errors[0].message}`);
|
|
9698
|
+
}
|
|
9699
|
+
const record = document.toJS() ?? {};
|
|
9700
|
+
const isolation = typeof record.isolation === "string" ? record.isolation : null;
|
|
9701
|
+
const boundBranch = typeof record.bound_branch === "string" && record.bound_branch !== "" ? record.bound_branch : null;
|
|
9702
|
+
const bindingRequired = requiresBranchBinding(isolation);
|
|
9703
|
+
const currentBranch = liveGitBranch(options.cwd);
|
|
9704
|
+
const gitWorkTree = bindingRequired && boundBranch === null && currentBranch === null ? isGitWorkTree(options.cwd) : true;
|
|
9705
|
+
const verdict = evaluateBranchBinding({ isolation, boundBranch, currentBranch, gitWorkTree });
|
|
9706
|
+
if (verdict.status === "needs-heal" && options.heal) {
|
|
9707
|
+
await healBoundBranch(changeDir, verdict.branch);
|
|
9708
|
+
return { status: "healed", branch: verdict.branch, bindingRequired, currentBranch };
|
|
9709
|
+
}
|
|
9710
|
+
return { ...verdict, bindingRequired, currentBranch };
|
|
9711
|
+
}
|
|
9712
|
+
async function healBoundBranch(changeDir, branch) {
|
|
9713
|
+
const file = path13.join(changeDir, ".comet.yaml");
|
|
9714
|
+
const document = (0, import_yaml3.parseDocument)(await fs12.readFile(file, "utf8"), { uniqueKeys: false });
|
|
9715
|
+
document.set("bound_branch", branch);
|
|
9716
|
+
const temporary = `${file}.${randomUUID7()}.tmp`;
|
|
9717
|
+
try {
|
|
9718
|
+
await fs12.writeFile(temporary, document.toString(), "utf8");
|
|
9719
|
+
await fs12.rename(temporary, file);
|
|
9720
|
+
} catch (error) {
|
|
9721
|
+
await fs12.rm(temporary, { force: true });
|
|
9722
|
+
throw error;
|
|
9723
|
+
}
|
|
9724
|
+
}
|
|
9725
|
+
function branchLabel(currentBranch) {
|
|
9726
|
+
return currentBranch ?? "detached HEAD";
|
|
9727
|
+
}
|
|
9728
|
+
function driftBlockedMessage(change, boundBranch, currentBranch) {
|
|
9729
|
+
return `change '${change}' is bound to branch '${boundBranch}', but current branch is '${branchLabel(currentBranch)}'.
|
|
9730
|
+
Next: ask the user to confirm — switch back to '${boundBranch}', or run \`comet state rebind ${change}\` after explicit confirmation.`;
|
|
9731
|
+
}
|
|
9732
|
+
function driftStaleReason(change, boundBranch, currentBranch) {
|
|
9733
|
+
return `change '${change}' is bound to branch '${boundBranch}', but current branch is '${branchLabel(currentBranch)}'`;
|
|
9734
|
+
}
|
|
9735
|
+
function unboundDetachedMessage(change) {
|
|
9736
|
+
return `change '${change}' uses a branch-bound workspace mode but has no bound branch and HEAD is detached; checkout a branch first before continuing.`;
|
|
9737
|
+
}
|
|
9738
|
+
|
|
9739
|
+
// domains/comet-classic/classic-current-change.ts
|
|
9740
|
+
function changeDirectory(projectRoot2, changeName) {
|
|
9741
|
+
return path14.join(projectRoot2, "openspec", "changes", changeName);
|
|
9742
|
+
}
|
|
9743
|
+
async function validateActiveChange(projectRoot2, changeName) {
|
|
9744
|
+
assertOpenSpecChangeName(changeName);
|
|
9745
|
+
const changeDir = changeDirectory(projectRoot2, changeName);
|
|
9746
|
+
try {
|
|
9747
|
+
await fs13.access(path14.join(changeDir, ".comet.yaml"));
|
|
9748
|
+
} catch (error) {
|
|
9749
|
+
if (error.code === "ENOENT") {
|
|
9750
|
+
throw new Error(
|
|
9751
|
+
`Cannot select current change '${changeName}': active change state not found`,
|
|
9752
|
+
{
|
|
9753
|
+
cause: error
|
|
9754
|
+
}
|
|
9755
|
+
);
|
|
9756
|
+
}
|
|
9757
|
+
throw error;
|
|
9758
|
+
}
|
|
9759
|
+
const projection = await readClassicState(changeDir, { migrate: false });
|
|
9760
|
+
if (!projection.classic) {
|
|
9761
|
+
throw new Error(`Cannot select current change '${changeName}': Classic state is incomplete`);
|
|
9762
|
+
}
|
|
9763
|
+
if (projection.classic.archived) {
|
|
9764
|
+
throw new Error(`Cannot select current change '${changeName}': change is archived`);
|
|
9765
|
+
}
|
|
9766
|
+
}
|
|
9767
|
+
async function selectCurrentChange(projectRoot2, changeName) {
|
|
9768
|
+
await validateActiveChange(projectRoot2, changeName);
|
|
9769
|
+
const outcome = await resolveBranchBinding(changeDirectory(projectRoot2, changeName), {
|
|
9770
|
+
heal: true,
|
|
9771
|
+
cwd: projectRoot2
|
|
9772
|
+
});
|
|
9773
|
+
if (outcome.status === "drift") {
|
|
9774
|
+
throw new Error(driftStaleReason(changeName, outcome.boundBranch, outcome.currentBranch));
|
|
9775
|
+
}
|
|
9776
|
+
if (outcome.status === "unbound-detached") {
|
|
9777
|
+
throw new Error(unboundDetachedMessage(changeName));
|
|
9778
|
+
}
|
|
9779
|
+
const selection = {
|
|
9780
|
+
schema: "comet.selection.v2",
|
|
9781
|
+
workflow: "classic",
|
|
9782
|
+
change: changeName,
|
|
9783
|
+
branch: outcome.currentBranch
|
|
9784
|
+
};
|
|
9785
|
+
await writeCometCurrentSelection(projectRoot2, selection);
|
|
9786
|
+
return selection;
|
|
9787
|
+
}
|
|
9788
|
+
async function resolveCurrentChange(projectRoot2) {
|
|
9789
|
+
let current;
|
|
9790
|
+
try {
|
|
9791
|
+
current = await readCometCurrentSelection(projectRoot2);
|
|
9792
|
+
} catch (error) {
|
|
9793
|
+
return {
|
|
9794
|
+
status: "stale",
|
|
9795
|
+
reason: error instanceof Error ? error.message : String(error)
|
|
9796
|
+
};
|
|
9797
|
+
}
|
|
9798
|
+
if (current.status === "missing") return { status: "missing" };
|
|
9799
|
+
if (current.selection.workflow !== "classic") {
|
|
9800
|
+
return {
|
|
9801
|
+
status: "stale",
|
|
9802
|
+
reason: `current change '${current.selection.change}' belongs to Native, not Classic`
|
|
9803
|
+
};
|
|
9804
|
+
}
|
|
9805
|
+
const selection = current.selection;
|
|
9806
|
+
try {
|
|
9807
|
+
await validateActiveChange(projectRoot2, selection.change);
|
|
9808
|
+
} catch (error) {
|
|
9809
|
+
return {
|
|
9810
|
+
status: "stale",
|
|
9811
|
+
reason: error instanceof Error ? error.message : String(error)
|
|
9812
|
+
};
|
|
9813
|
+
}
|
|
9814
|
+
const outcome = await resolveBranchBinding(changeDirectory(projectRoot2, selection.change), {
|
|
9815
|
+
heal: false,
|
|
9816
|
+
cwd: projectRoot2
|
|
9817
|
+
});
|
|
9818
|
+
if (outcome.status === "drift") {
|
|
9819
|
+
return {
|
|
9820
|
+
status: "stale",
|
|
9821
|
+
reason: driftStaleReason(selection.change, outcome.boundBranch, outcome.currentBranch)
|
|
9822
|
+
};
|
|
9823
|
+
}
|
|
9824
|
+
if (outcome.status === "unbound-detached") {
|
|
9825
|
+
return { status: "stale", reason: unboundDetachedMessage(selection.change) };
|
|
9826
|
+
}
|
|
9827
|
+
if (outcome.status === "ok") return { status: "selected", selection };
|
|
9828
|
+
if (selection.branch !== null && outcome.currentBranch !== selection.branch) {
|
|
9829
|
+
return {
|
|
9830
|
+
status: "stale",
|
|
9831
|
+
reason: `current change '${selection.change}' was selected on branch '${selection.branch}', current branch is '${outcome.currentBranch ?? "detached HEAD"}'`
|
|
9832
|
+
};
|
|
9833
|
+
}
|
|
9834
|
+
return { status: "selected", selection };
|
|
9835
|
+
}
|
|
9836
|
+
async function clearCurrentChange(projectRoot2) {
|
|
9837
|
+
let current;
|
|
9838
|
+
try {
|
|
9839
|
+
current = await readCometCurrentSelection(projectRoot2);
|
|
9840
|
+
} catch {
|
|
9841
|
+
return;
|
|
9842
|
+
}
|
|
9843
|
+
if (current.status === "selected" && current.selection.workflow === "classic") {
|
|
9844
|
+
await clearCometCurrentSelection(projectRoot2);
|
|
9845
|
+
}
|
|
9846
|
+
}
|
|
9847
|
+
async function clearCurrentChangeIf(projectRoot2, change) {
|
|
9848
|
+
return clearCometCurrentSelectionIf(projectRoot2, "classic", change);
|
|
9849
|
+
}
|
|
9850
|
+
|
|
9528
9851
|
// domains/comet-classic/classic-archive.ts
|
|
9529
9852
|
var GREEN = "\x1B[32m";
|
|
9530
9853
|
var RED = "\x1B[31m";
|
|
@@ -9559,7 +9882,7 @@ var ArchiveOutput = class {
|
|
|
9559
9882
|
};
|
|
9560
9883
|
async function exists2(file) {
|
|
9561
9884
|
try {
|
|
9562
|
-
await
|
|
9885
|
+
await fs14.access(file);
|
|
9563
9886
|
return true;
|
|
9564
9887
|
} catch (error) {
|
|
9565
9888
|
if (error.code === "ENOENT") return false;
|
|
@@ -9613,10 +9936,10 @@ async function findArchiveDir(change, preferred) {
|
|
|
9613
9936
|
if (await exists2(preferred)) return preferred;
|
|
9614
9937
|
const archiveRoot = "openspec/changes/archive";
|
|
9615
9938
|
if (!await exists2(archiveRoot)) return null;
|
|
9616
|
-
for (const entry2 of (await
|
|
9939
|
+
for (const entry2 of (await fs14.readdir(archiveRoot)).sort()) {
|
|
9617
9940
|
if (!entry2.endsWith(`-${change}`)) continue;
|
|
9618
9941
|
const candidate = `${archiveRoot}/${entry2}`;
|
|
9619
|
-
if ((await
|
|
9942
|
+
if ((await fs14.stat(candidate)).isDirectory()) return candidate;
|
|
9620
9943
|
}
|
|
9621
9944
|
return null;
|
|
9622
9945
|
}
|
|
@@ -9646,9 +9969,9 @@ async function annotateFrontmatter(output, file, archiveName, extraFields, dryRu
|
|
|
9646
9969
|
output.stepsTotal += 1;
|
|
9647
9970
|
return;
|
|
9648
9971
|
}
|
|
9649
|
-
const original = await
|
|
9972
|
+
const original = await fs14.readFile(file, "utf8");
|
|
9650
9973
|
const updated = annotatedMarkdown(original, archiveName, extraFields);
|
|
9651
|
-
await
|
|
9974
|
+
await fs14.writeFile(file, updated);
|
|
9652
9975
|
output.stderr.push(green(` [OK] Annotated: ${file}`));
|
|
9653
9976
|
output.stepsOk += 1;
|
|
9654
9977
|
output.stepsTotal += 1;
|
|
@@ -9657,10 +9980,10 @@ async function verifyMainSpecsClean() {
|
|
|
9657
9980
|
const specsRoot = "openspec/specs";
|
|
9658
9981
|
if (!await exists2(specsRoot)) return;
|
|
9659
9982
|
let found = false;
|
|
9660
|
-
for (const entry2 of await
|
|
9983
|
+
for (const entry2 of await fs14.readdir(specsRoot)) {
|
|
9661
9984
|
const specFile = `${specsRoot}/${entry2}/spec.md`;
|
|
9662
9985
|
if (!await exists2(specFile)) continue;
|
|
9663
|
-
const matches = (await
|
|
9986
|
+
const matches = (await fs14.readFile(specFile, "utf8")).split(/\r?\n/u).map((line, index) => ({ line, number: index + 1 })).filter((item) => /^## (ADDED|MODIFIED|REMOVED|RENAMED) Requirements$/u.test(item.line));
|
|
9664
9987
|
if (matches.length > 0) {
|
|
9665
9988
|
found = true;
|
|
9666
9989
|
process.stderr.write(
|
|
@@ -9692,7 +10015,7 @@ var classicArchiveCommand = async (args) => {
|
|
|
9692
10015
|
}
|
|
9693
10016
|
if (recoveredArchive) {
|
|
9694
10017
|
archiveDir = recoveredArchive;
|
|
9695
|
-
archiveName =
|
|
10018
|
+
archiveName = path15.basename(recoveredArchive);
|
|
9696
10019
|
}
|
|
9697
10020
|
const projection = await readClassicState(changeDir);
|
|
9698
10021
|
if (!projection.classic) {
|
|
@@ -9787,7 +10110,7 @@ var classicArchiveCommand = async (args) => {
|
|
|
9787
10110
|
return output.toResult(1);
|
|
9788
10111
|
}
|
|
9789
10112
|
archiveDir = resolvedArchive;
|
|
9790
|
-
archiveName =
|
|
10113
|
+
archiveName = path15.basename(resolvedArchive);
|
|
9791
10114
|
output.stderr.push(green(` [OK] OpenSpec archive completed: ${archiveDir}`));
|
|
9792
10115
|
output.stepsOk += 1;
|
|
9793
10116
|
output.stepsTotal += 1;
|
|
@@ -9894,6 +10217,7 @@ var classicArchiveCommand = async (args) => {
|
|
|
9894
10217
|
output.stepsOk += 1;
|
|
9895
10218
|
output.stepsTotal += 1;
|
|
9896
10219
|
}
|
|
10220
|
+
if (!dryRun) await clearCurrentChangeIf(process.cwd(), change);
|
|
9897
10221
|
output.stderr.push("");
|
|
9898
10222
|
output.stderr.push(
|
|
9899
10223
|
dryRun ? yellow(`Dry run complete. ${output.stepsOk}/${output.stepsTotal} steps would succeed.`) : green(`Archive complete. ${output.stepsOk}/${output.stepsTotal} steps succeeded.`)
|
|
@@ -9914,27 +10238,27 @@ var classicArchiveCommand = async (args) => {
|
|
|
9914
10238
|
var import_yaml6 = __toESM(require_dist(), 1);
|
|
9915
10239
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
9916
10240
|
import { createHash as createHash4 } from "crypto";
|
|
9917
|
-
import { existsSync, promises as
|
|
9918
|
-
import
|
|
10241
|
+
import { existsSync, promises as fs18, readFileSync } from "fs";
|
|
10242
|
+
import path19 from "path";
|
|
9919
10243
|
|
|
9920
10244
|
// domains/comet-classic/classic-command-checks.ts
|
|
9921
|
-
import
|
|
10245
|
+
import path16 from "path";
|
|
9922
10246
|
function validateScope(scope) {
|
|
9923
10247
|
if (scope !== "build" && scope !== "verify") {
|
|
9924
10248
|
throw new Error(`Invalid command check scope: '${String(scope)}'`);
|
|
9925
10249
|
}
|
|
9926
10250
|
}
|
|
9927
10251
|
function projectRoot(changeDir) {
|
|
9928
|
-
return
|
|
10252
|
+
return path16.resolve(changeDir, "..", "..", "..");
|
|
9929
10253
|
}
|
|
9930
10254
|
function normalizedCwd(changeDir, cwd = ".") {
|
|
9931
10255
|
if (cwd.trim().length === 0) throw new Error("Command check cwd cannot be blank");
|
|
9932
10256
|
const root = projectRoot(changeDir);
|
|
9933
|
-
const target =
|
|
9934
|
-
if (target !== root && !target.startsWith(root +
|
|
10257
|
+
const target = path16.resolve(root, cwd);
|
|
10258
|
+
if (target !== root && !target.startsWith(root + path16.sep)) {
|
|
9935
10259
|
throw new Error(`Command check cwd must resolve within the project root: '${cwd}'`);
|
|
9936
10260
|
}
|
|
9937
|
-
return
|
|
10261
|
+
return path16.relative(root, target).replaceAll("\\", "/") || ".";
|
|
9938
10262
|
}
|
|
9939
10263
|
function validRecord(changeDir, event) {
|
|
9940
10264
|
if (event.type !== "command_check_recorded") return null;
|
|
@@ -10095,9 +10419,9 @@ async function inspectClassicChange(changeDir, name) {
|
|
|
10095
10419
|
}
|
|
10096
10420
|
|
|
10097
10421
|
// domains/comet-classic/classic-validate-command.ts
|
|
10098
|
-
var
|
|
10099
|
-
import { promises as
|
|
10100
|
-
import
|
|
10422
|
+
var import_yaml4 = __toESM(require_dist(), 1);
|
|
10423
|
+
import { promises as fs15 } from "fs";
|
|
10424
|
+
import path17 from "path";
|
|
10101
10425
|
var GREEN2 = "\x1B[32m";
|
|
10102
10426
|
var RED2 = "\x1B[31m";
|
|
10103
10427
|
var YELLOW2 = "\x1B[33m";
|
|
@@ -10147,7 +10471,7 @@ function color(code, message) {
|
|
|
10147
10471
|
}
|
|
10148
10472
|
async function exists3(file) {
|
|
10149
10473
|
try {
|
|
10150
|
-
await
|
|
10474
|
+
await fs15.access(file);
|
|
10151
10475
|
return true;
|
|
10152
10476
|
} catch (error) {
|
|
10153
10477
|
if (error.code === "ENOENT") return false;
|
|
@@ -10168,7 +10492,7 @@ var classicValidateCommand = async (args) => {
|
|
|
10168
10492
|
};
|
|
10169
10493
|
}
|
|
10170
10494
|
const { directory, label } = await resolveClassicChangeDirectory(name);
|
|
10171
|
-
const yamlFile =
|
|
10495
|
+
const yamlFile = path17.join(directory, ".comet.yaml");
|
|
10172
10496
|
const lines = [`[VALIDATE] ${label}/.comet.yaml`];
|
|
10173
10497
|
let errors = 0;
|
|
10174
10498
|
let warnings = 0;
|
|
@@ -10182,7 +10506,7 @@ var classicValidateCommand = async (args) => {
|
|
|
10182
10506
|
};
|
|
10183
10507
|
let source;
|
|
10184
10508
|
try {
|
|
10185
|
-
source = await
|
|
10509
|
+
source = await fs15.readFile(yamlFile, "utf8");
|
|
10186
10510
|
} catch (error) {
|
|
10187
10511
|
if (error.code === "ENOENT") {
|
|
10188
10512
|
fail3(".comet.yaml does not exist");
|
|
@@ -10191,10 +10515,10 @@ var classicValidateCommand = async (args) => {
|
|
|
10191
10515
|
}
|
|
10192
10516
|
throw error;
|
|
10193
10517
|
}
|
|
10194
|
-
const document = (0,
|
|
10195
|
-
if (document.errors.length > 0 || !(0,
|
|
10518
|
+
const document = (0, import_yaml4.parseDocument)(source);
|
|
10519
|
+
if (document.errors.length > 0 || !(0, import_yaml4.isMap)(document.contents)) {
|
|
10196
10520
|
for (const error of document.errors) fail3(error.message);
|
|
10197
|
-
if (!(0,
|
|
10521
|
+
if (!(0, import_yaml4.isMap)(document.contents)) fail3("document root must be a mapping");
|
|
10198
10522
|
lines.push("", color(RED2, `${errors} error(s), ${warnings} warning(s) — validation FAILED`));
|
|
10199
10523
|
return { exitCode: 1, stderr: lines.join("\n") };
|
|
10200
10524
|
}
|
|
@@ -10231,7 +10555,7 @@ var classicValidateCommand = async (args) => {
|
|
|
10231
10555
|
}
|
|
10232
10556
|
for (const field2 of ["design_doc", "plan", "handoff_context"]) {
|
|
10233
10557
|
const value = text(record[field2]);
|
|
10234
|
-
if (value && !await exists3(
|
|
10558
|
+
if (value && !await exists3(path17.resolve(value))) {
|
|
10235
10559
|
fail3(`${field2}='${value}' does not exist on disk`);
|
|
10236
10560
|
}
|
|
10237
10561
|
}
|
|
@@ -10254,16 +10578,16 @@ var classicValidateCommand = async (args) => {
|
|
|
10254
10578
|
};
|
|
10255
10579
|
|
|
10256
10580
|
// domains/comet-classic/classic-project-config.ts
|
|
10257
|
-
var
|
|
10581
|
+
var import_yaml5 = __toESM(require_dist(), 1);
|
|
10258
10582
|
import os from "os";
|
|
10259
|
-
import { promises as
|
|
10260
|
-
import
|
|
10583
|
+
import { promises as fs17 } from "fs";
|
|
10584
|
+
import path18 from "path";
|
|
10261
10585
|
|
|
10262
10586
|
// platform/fs/file-system.ts
|
|
10263
|
-
import { promises as
|
|
10587
|
+
import { promises as fs16 } from "fs";
|
|
10264
10588
|
async function fileExists3(filePath) {
|
|
10265
10589
|
try {
|
|
10266
|
-
await
|
|
10590
|
+
await fs16.access(filePath);
|
|
10267
10591
|
return true;
|
|
10268
10592
|
} catch (error) {
|
|
10269
10593
|
if (isNotFoundError(error)) return false;
|
|
@@ -10272,7 +10596,7 @@ async function fileExists3(filePath) {
|
|
|
10272
10596
|
}
|
|
10273
10597
|
async function readDir(dirPath) {
|
|
10274
10598
|
try {
|
|
10275
|
-
return await
|
|
10599
|
+
return await fs16.readdir(dirPath);
|
|
10276
10600
|
} catch (error) {
|
|
10277
10601
|
const code = error?.code;
|
|
10278
10602
|
if (code === "ENOENT" || code === "ENOTDIR") {
|
|
@@ -10290,9 +10614,9 @@ function configCandidates(options = {}) {
|
|
|
10290
10614
|
const cwd = options.cwd ?? process.cwd();
|
|
10291
10615
|
const homeDir = options.homeDir ?? os.homedir();
|
|
10292
10616
|
const candidates = [
|
|
10293
|
-
{ file:
|
|
10617
|
+
{ file: path18.resolve(cwd, ".comet", "config.yaml"), source: ".comet/config.yaml" },
|
|
10294
10618
|
{
|
|
10295
|
-
file:
|
|
10619
|
+
file: path18.resolve(homeDir, ".comet", "config.yaml"),
|
|
10296
10620
|
source: "~/.comet/config.yaml"
|
|
10297
10621
|
}
|
|
10298
10622
|
];
|
|
@@ -10303,106 +10627,20 @@ function configCandidates(options = {}) {
|
|
|
10303
10627
|
async function readClassicConfigValue(field2, options = {}) {
|
|
10304
10628
|
for (const candidate of configCandidates(options)) {
|
|
10305
10629
|
if (!await fileExists3(candidate.file)) continue;
|
|
10306
|
-
const document = (0,
|
|
10630
|
+
const document = (0, import_yaml5.parseDocument)(await fs17.readFile(candidate.file, "utf8"), {
|
|
10307
10631
|
uniqueKeys: false
|
|
10308
10632
|
});
|
|
10309
|
-
const
|
|
10633
|
+
const root = document.toJS();
|
|
10634
|
+
if (!root || typeof root !== "object" || Array.isArray(root)) continue;
|
|
10635
|
+
const classic = root.classic;
|
|
10636
|
+
if (!classic || typeof classic !== "object" || Array.isArray(classic)) continue;
|
|
10637
|
+
const value = classic[field2];
|
|
10310
10638
|
if (value === null || value === void 0) continue;
|
|
10311
10639
|
return { value: String(value), source: candidate.source };
|
|
10312
10640
|
}
|
|
10313
10641
|
return null;
|
|
10314
10642
|
}
|
|
10315
10643
|
|
|
10316
|
-
// domains/comet-classic/classic-branch-binding.ts
|
|
10317
|
-
var import_yaml5 = __toESM(require_dist(), 1);
|
|
10318
|
-
import { execFileSync } from "child_process";
|
|
10319
|
-
import { randomUUID as randomUUID6 } from "crypto";
|
|
10320
|
-
import { promises as fs15 } from "fs";
|
|
10321
|
-
import path16 from "path";
|
|
10322
|
-
function liveGitBranch(cwd) {
|
|
10323
|
-
try {
|
|
10324
|
-
const branch = execFileSync("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
|
|
10325
|
-
cwd,
|
|
10326
|
-
encoding: "utf8",
|
|
10327
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
10328
|
-
}).trim();
|
|
10329
|
-
return branch && branch !== "HEAD" ? branch : null;
|
|
10330
|
-
} catch {
|
|
10331
|
-
return null;
|
|
10332
|
-
}
|
|
10333
|
-
}
|
|
10334
|
-
function isGitWorkTree(cwd) {
|
|
10335
|
-
try {
|
|
10336
|
-
return execFileSync("git", ["rev-parse", "--is-inside-work-tree"], {
|
|
10337
|
-
cwd,
|
|
10338
|
-
encoding: "utf8",
|
|
10339
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
10340
|
-
}).trim() === "true";
|
|
10341
|
-
} catch {
|
|
10342
|
-
return false;
|
|
10343
|
-
}
|
|
10344
|
-
}
|
|
10345
|
-
var BOUND_BRANCH_ISOLATIONS = ["current", "branch", "worktree"];
|
|
10346
|
-
function requiresBranchBinding(isolation) {
|
|
10347
|
-
return BOUND_BRANCH_ISOLATIONS.includes(isolation);
|
|
10348
|
-
}
|
|
10349
|
-
function evaluateBranchBinding(input) {
|
|
10350
|
-
if (!requiresBranchBinding(input.isolation)) return { status: "not-applicable" };
|
|
10351
|
-
if (input.boundBranch === null && input.currentBranch === null && input.gitWorkTree === false) {
|
|
10352
|
-
return { status: "not-applicable" };
|
|
10353
|
-
}
|
|
10354
|
-
if (input.boundBranch === null) {
|
|
10355
|
-
return input.currentBranch === null ? { status: "unbound-detached" } : { status: "needs-heal", branch: input.currentBranch };
|
|
10356
|
-
}
|
|
10357
|
-
if (input.currentBranch === input.boundBranch) return { status: "ok" };
|
|
10358
|
-
return { status: "drift", boundBranch: input.boundBranch, currentBranch: input.currentBranch };
|
|
10359
|
-
}
|
|
10360
|
-
async function resolveBranchBinding(changeDir, options) {
|
|
10361
|
-
const file = path16.join(changeDir, ".comet.yaml");
|
|
10362
|
-
const document = (0, import_yaml5.parseDocument)(await fs15.readFile(file, "utf8"), { uniqueKeys: false });
|
|
10363
|
-
if (document.errors.length > 0) {
|
|
10364
|
-
throw new Error(`Invalid .comet.yaml: ${document.errors[0].message}`);
|
|
10365
|
-
}
|
|
10366
|
-
const record = document.toJS() ?? {};
|
|
10367
|
-
const isolation = typeof record.isolation === "string" ? record.isolation : null;
|
|
10368
|
-
const boundBranch = typeof record.bound_branch === "string" && record.bound_branch !== "" ? record.bound_branch : null;
|
|
10369
|
-
const bindingRequired = requiresBranchBinding(isolation);
|
|
10370
|
-
const currentBranch = liveGitBranch(options.cwd);
|
|
10371
|
-
const gitWorkTree = bindingRequired && boundBranch === null && currentBranch === null ? isGitWorkTree(options.cwd) : true;
|
|
10372
|
-
const verdict = evaluateBranchBinding({ isolation, boundBranch, currentBranch, gitWorkTree });
|
|
10373
|
-
if (verdict.status === "needs-heal" && options.heal) {
|
|
10374
|
-
await healBoundBranch(changeDir, verdict.branch);
|
|
10375
|
-
return { status: "healed", branch: verdict.branch, bindingRequired, currentBranch };
|
|
10376
|
-
}
|
|
10377
|
-
return { ...verdict, bindingRequired, currentBranch };
|
|
10378
|
-
}
|
|
10379
|
-
async function healBoundBranch(changeDir, branch) {
|
|
10380
|
-
const file = path16.join(changeDir, ".comet.yaml");
|
|
10381
|
-
const document = (0, import_yaml5.parseDocument)(await fs15.readFile(file, "utf8"), { uniqueKeys: false });
|
|
10382
|
-
document.set("bound_branch", branch);
|
|
10383
|
-
const temporary = `${file}.${randomUUID6()}.tmp`;
|
|
10384
|
-
try {
|
|
10385
|
-
await fs15.writeFile(temporary, document.toString(), "utf8");
|
|
10386
|
-
await fs15.rename(temporary, file);
|
|
10387
|
-
} catch (error) {
|
|
10388
|
-
await fs15.rm(temporary, { force: true });
|
|
10389
|
-
throw error;
|
|
10390
|
-
}
|
|
10391
|
-
}
|
|
10392
|
-
function branchLabel(currentBranch) {
|
|
10393
|
-
return currentBranch ?? "detached HEAD";
|
|
10394
|
-
}
|
|
10395
|
-
function driftBlockedMessage(change, boundBranch, currentBranch) {
|
|
10396
|
-
return `change '${change}' is bound to branch '${boundBranch}', but current branch is '${branchLabel(currentBranch)}'.
|
|
10397
|
-
Next: ask the user to confirm — switch back to '${boundBranch}', or run \`comet state rebind ${change}\` after explicit confirmation.`;
|
|
10398
|
-
}
|
|
10399
|
-
function driftStaleReason(change, boundBranch, currentBranch) {
|
|
10400
|
-
return `change '${change}' is bound to branch '${boundBranch}', but current branch is '${branchLabel(currentBranch)}'`;
|
|
10401
|
-
}
|
|
10402
|
-
function unboundDetachedMessage(change) {
|
|
10403
|
-
return `change '${change}' uses a branch-bound workspace mode but has no bound branch and HEAD is detached; checkout a branch first before continuing.`;
|
|
10404
|
-
}
|
|
10405
|
-
|
|
10406
10644
|
// domains/comet-classic/classic-guard.ts
|
|
10407
10645
|
var GREEN3 = "\x1B[32m";
|
|
10408
10646
|
var RED3 = "\x1B[31m";
|
|
@@ -10467,7 +10705,7 @@ var GuardOutput = class {
|
|
|
10467
10705
|
};
|
|
10468
10706
|
async function exists4(file) {
|
|
10469
10707
|
try {
|
|
10470
|
-
await
|
|
10708
|
+
await fs18.access(file);
|
|
10471
10709
|
return true;
|
|
10472
10710
|
} catch (error) {
|
|
10473
10711
|
if (error.code === "ENOENT") return false;
|
|
@@ -10476,7 +10714,7 @@ async function exists4(file) {
|
|
|
10476
10714
|
}
|
|
10477
10715
|
async function nonempty(file) {
|
|
10478
10716
|
try {
|
|
10479
|
-
return (await
|
|
10717
|
+
return (await fs18.stat(file)).size > 0;
|
|
10480
10718
|
} catch (error) {
|
|
10481
10719
|
if (error.code === "ENOENT") return false;
|
|
10482
10720
|
throw error;
|
|
@@ -10490,8 +10728,8 @@ async function resolveChangeDir(name) {
|
|
|
10490
10728
|
return (await resolveClassicChangeDirectory(name)).label;
|
|
10491
10729
|
}
|
|
10492
10730
|
async function readField(changeDir, field2) {
|
|
10493
|
-
const file =
|
|
10494
|
-
const document = (0, import_yaml6.parseDocument)(await
|
|
10731
|
+
const file = path19.join(changeDir, ".comet.yaml");
|
|
10732
|
+
const document = (0, import_yaml6.parseDocument)(await fs18.readFile(file, "utf8"), { uniqueKeys: false });
|
|
10495
10733
|
if (document.errors.length > 0) {
|
|
10496
10734
|
throw new GuardFailure(`ERROR: Invalid .comet.yaml: ${document.errors[0].message}`);
|
|
10497
10735
|
}
|
|
@@ -10532,7 +10770,7 @@ function countEnglishWords(source) {
|
|
|
10532
10770
|
}
|
|
10533
10771
|
async function documentLanguageMatchesConfigured(changeDir, file) {
|
|
10534
10772
|
const language = await configuredLanguage(changeDir);
|
|
10535
|
-
const source = stripFencedCodeBlocks(await
|
|
10773
|
+
const source = stripFencedCodeBlocks(await fs18.readFile(file, "utf8"));
|
|
10536
10774
|
const cjk = countCjkChars(source);
|
|
10537
10775
|
const englishWords = countEnglishWords(source);
|
|
10538
10776
|
if (language === "zh-CN" && cjk < 20 && englishWords >= 20) {
|
|
@@ -10556,7 +10794,7 @@ async function handoffSourceFiles(changeDir) {
|
|
|
10556
10794
|
const files = [`${changeDir}/proposal.md`, `${changeDir}/design.md`, `${changeDir}/tasks.md`];
|
|
10557
10795
|
const specs = `${changeDir}/specs`;
|
|
10558
10796
|
if (await exists4(specs)) {
|
|
10559
|
-
for (const entry2 of (await
|
|
10797
|
+
for (const entry2 of (await fs18.readdir(specs)).sort()) {
|
|
10560
10798
|
const spec = `${specs}/${entry2}/spec.md`;
|
|
10561
10799
|
if (await exists4(spec)) files.push(spec);
|
|
10562
10800
|
}
|
|
@@ -10576,7 +10814,7 @@ async function preflight(changeDir, name) {
|
|
|
10576
10814
|
if (!await exists4(changeDir)) {
|
|
10577
10815
|
throw new GuardFailure(red2(`FATAL: change directory not found: ${changeDir}`));
|
|
10578
10816
|
}
|
|
10579
|
-
if (!await exists4(
|
|
10817
|
+
if (!await exists4(path19.join(changeDir, ".comet.yaml"))) {
|
|
10580
10818
|
throw new GuardFailure(red2(`FATAL: .comet.yaml not found in ${changeDir}`));
|
|
10581
10819
|
}
|
|
10582
10820
|
const result5 = await classicValidateCommand([name], { json: false });
|
|
@@ -10646,9 +10884,9 @@ var INFERRED_COMMAND_SOURCES = [
|
|
|
10646
10884
|
"Cargo.toml"
|
|
10647
10885
|
];
|
|
10648
10886
|
async function removedProjectCommandField(field2) {
|
|
10649
|
-
const config =
|
|
10887
|
+
const config = path19.join(".comet", "config.yaml");
|
|
10650
10888
|
if (!await exists4(config)) return false;
|
|
10651
|
-
const document = (0, import_yaml6.parseDocument)(await
|
|
10889
|
+
const document = (0, import_yaml6.parseDocument)(await fs18.readFile(config, "utf8"));
|
|
10652
10890
|
if (document.errors.length > 0) {
|
|
10653
10891
|
throw new Error(
|
|
10654
10892
|
`.comet/config.yaml is invalid YAML (${document.errors[0].message}); cannot check for removed "${field2}" field. Fix the config and retry.`
|
|
@@ -10729,14 +10967,14 @@ ${recoveryCommand(change, scope, recorded.command)}`
|
|
|
10729
10967
|
return { status: 0, output: evidenceDetail(recorded) };
|
|
10730
10968
|
}
|
|
10731
10969
|
async function tasksAllDone(changeDir) {
|
|
10732
|
-
const tasks =
|
|
10970
|
+
const tasks = path19.join(changeDir, "tasks.md");
|
|
10733
10971
|
if (!await exists4(tasks)) {
|
|
10734
10972
|
return fail(
|
|
10735
10973
|
`tasks.md is missing at ${tasks}
|
|
10736
10974
|
Next: restore or create tasks.md for this change before leaving build.`
|
|
10737
10975
|
);
|
|
10738
10976
|
}
|
|
10739
|
-
const source = await
|
|
10977
|
+
const source = await fs18.readFile(tasks, "utf8");
|
|
10740
10978
|
if (!/- \[x\]/u.test(source)) {
|
|
10741
10979
|
return fail(
|
|
10742
10980
|
"tasks.md has no completed tasks.\nNext: complete implementation tasks and mark them with '- [x]'."
|
|
@@ -10753,9 +10991,9 @@ Next: complete or explicitly remove unfinished tasks, then mark tasks.md with '-
|
|
|
10753
10991
|
return pass();
|
|
10754
10992
|
}
|
|
10755
10993
|
async function tasksHasAny(changeDir) {
|
|
10756
|
-
const tasks =
|
|
10994
|
+
const tasks = path19.join(changeDir, "tasks.md");
|
|
10757
10995
|
if (!await exists4(tasks)) return false;
|
|
10758
|
-
return /- \[/u.test(await
|
|
10996
|
+
return /- \[/u.test(await fs18.readFile(tasks, "utf8"));
|
|
10759
10997
|
}
|
|
10760
10998
|
async function planTasksAllDone(changeDir) {
|
|
10761
10999
|
const plan = await readField(changeDir, "plan");
|
|
@@ -10766,7 +11004,7 @@ async function planTasksAllDone(changeDir) {
|
|
|
10766
11004
|
Next: restore the Superpowers plan file or update .comet.yaml plan before leaving build.`
|
|
10767
11005
|
);
|
|
10768
11006
|
}
|
|
10769
|
-
const source = await
|
|
11007
|
+
const source = await fs18.readFile(plan, "utf8");
|
|
10770
11008
|
const unfinished = source.split(/\r?\n/u).map((line, index) => ({ line, number: index + 1 })).filter((entry2) => /^\s*- \[ \]/u.test(entry2.line));
|
|
10771
11009
|
if (unfinished.length > 0) {
|
|
10772
11010
|
return fail(
|
|
@@ -10880,7 +11118,7 @@ async function archivedIsTrue(changeDir) {
|
|
|
10880
11118
|
return await readField(changeDir, "archived") === "true";
|
|
10881
11119
|
}
|
|
10882
11120
|
async function designDocFrontmatterHas(designDoc, field2, expected) {
|
|
10883
|
-
const source = (await
|
|
11121
|
+
const source = (await fs18.readFile(designDoc, "utf8")).replace(/^\uFEFF/u, "");
|
|
10884
11122
|
let inFrontmatter = false;
|
|
10885
11123
|
for (const line of source.split(/\r?\n/u)) {
|
|
10886
11124
|
if (!inFrontmatter) {
|
|
@@ -10945,7 +11183,7 @@ async function designHandoffMarkdownTraceable(changeDir) {
|
|
|
10945
11183
|
const markdown = `${context.replace(/\.json$/u, "")}.md`;
|
|
10946
11184
|
if (!await nonempty(markdown))
|
|
10947
11185
|
return fail(`design handoff markdown is missing or empty: ${markdown}`);
|
|
10948
|
-
const source = await
|
|
11186
|
+
const source = await fs18.readFile(markdown, "utf8");
|
|
10949
11187
|
const problems = [];
|
|
10950
11188
|
if (!/^Generated-by: comet-handoff\.sh$/mu.test(source)) {
|
|
10951
11189
|
problems.push("handoff markdown is missing Generated-by marker");
|
|
@@ -10972,7 +11210,7 @@ async function betaSpecJsonStructurallyValid(changeDir) {
|
|
|
10972
11210
|
const context = await readField(changeDir, "handoff_context");
|
|
10973
11211
|
if (!context || context === "null") return fail("handoff_context is missing from .comet.yaml");
|
|
10974
11212
|
if (!await nonempty(context)) return fail(`spec-context.json is missing or empty: ${context}`);
|
|
10975
|
-
const source = await
|
|
11213
|
+
const source = await fs18.readFile(context, "utf8");
|
|
10976
11214
|
const problems = [];
|
|
10977
11215
|
let parsed;
|
|
10978
11216
|
try {
|
|
@@ -11009,19 +11247,19 @@ async function guardOpenChecks(output, changeDir) {
|
|
|
11009
11247
|
const checks = [
|
|
11010
11248
|
check(
|
|
11011
11249
|
"proposal.md exists and non-empty",
|
|
11012
|
-
async () => await nonempty(
|
|
11250
|
+
async () => await nonempty(path19.join(changeDir, "proposal.md")) ? pass() : fail("")
|
|
11013
11251
|
),
|
|
11014
11252
|
check(
|
|
11015
11253
|
"proposal.md matches configured language",
|
|
11016
|
-
() => documentLanguageMatchesConfigured(changeDir,
|
|
11254
|
+
() => documentLanguageMatchesConfigured(changeDir, path19.join(changeDir, "proposal.md"))
|
|
11017
11255
|
),
|
|
11018
11256
|
check(
|
|
11019
11257
|
"tasks.md exists and non-empty",
|
|
11020
|
-
async () => await nonempty(
|
|
11258
|
+
async () => await nonempty(path19.join(changeDir, "tasks.md")) ? pass() : fail("")
|
|
11021
11259
|
),
|
|
11022
11260
|
check(
|
|
11023
11261
|
"tasks.md matches configured language",
|
|
11024
|
-
() => documentLanguageMatchesConfigured(changeDir,
|
|
11262
|
+
() => documentLanguageMatchesConfigured(changeDir, path19.join(changeDir, "tasks.md"))
|
|
11025
11263
|
),
|
|
11026
11264
|
check(
|
|
11027
11265
|
"tasks.md has at least one task",
|
|
@@ -11034,11 +11272,11 @@ async function guardOpenChecks(output, changeDir) {
|
|
|
11034
11272
|
0,
|
|
11035
11273
|
check(
|
|
11036
11274
|
"design.md exists and non-empty",
|
|
11037
|
-
async () => await nonempty(
|
|
11275
|
+
async () => await nonempty(path19.join(changeDir, "design.md")) ? pass() : fail("")
|
|
11038
11276
|
),
|
|
11039
11277
|
check(
|
|
11040
11278
|
"design.md matches configured language",
|
|
11041
|
-
() => documentLanguageMatchesConfigured(changeDir,
|
|
11279
|
+
() => documentLanguageMatchesConfigured(changeDir, path19.join(changeDir, "design.md"))
|
|
11042
11280
|
)
|
|
11043
11281
|
);
|
|
11044
11282
|
}
|
|
@@ -11050,27 +11288,27 @@ async function guardDesignChecks(output, changeDir, change) {
|
|
|
11050
11288
|
const builders = [
|
|
11051
11289
|
check(
|
|
11052
11290
|
"proposal.md exists",
|
|
11053
|
-
async () => await nonempty(
|
|
11291
|
+
async () => await nonempty(path19.join(changeDir, "proposal.md")) ? pass() : fail("")
|
|
11054
11292
|
),
|
|
11055
11293
|
check(
|
|
11056
11294
|
"proposal.md matches configured language",
|
|
11057
|
-
() => documentLanguageMatchesConfigured(changeDir,
|
|
11295
|
+
() => documentLanguageMatchesConfigured(changeDir, path19.join(changeDir, "proposal.md"))
|
|
11058
11296
|
),
|
|
11059
11297
|
check(
|
|
11060
11298
|
"design.md exists",
|
|
11061
|
-
async () => await nonempty(
|
|
11299
|
+
async () => await nonempty(path19.join(changeDir, "design.md")) ? pass() : fail("")
|
|
11062
11300
|
),
|
|
11063
11301
|
check(
|
|
11064
11302
|
"design.md matches configured language",
|
|
11065
|
-
() => documentLanguageMatchesConfigured(changeDir,
|
|
11303
|
+
() => documentLanguageMatchesConfigured(changeDir, path19.join(changeDir, "design.md"))
|
|
11066
11304
|
),
|
|
11067
11305
|
check(
|
|
11068
11306
|
"tasks.md exists",
|
|
11069
|
-
async () => await nonempty(
|
|
11307
|
+
async () => await nonempty(path19.join(changeDir, "tasks.md")) ? pass() : fail("")
|
|
11070
11308
|
),
|
|
11071
11309
|
check(
|
|
11072
11310
|
"tasks.md matches configured language",
|
|
11073
|
-
() => documentLanguageMatchesConfigured(changeDir,
|
|
11311
|
+
() => documentLanguageMatchesConfigured(changeDir, path19.join(changeDir, "tasks.md"))
|
|
11074
11312
|
),
|
|
11075
11313
|
check("design handoff context exists", () => designHandoffContextValid(changeDir, change)),
|
|
11076
11314
|
check("design handoff markdown is traceable", () => designHandoffMarkdownTraceable(changeDir))
|
|
@@ -11132,11 +11370,11 @@ async function guardBuildChecks(output, changeDir, change, run) {
|
|
|
11132
11370
|
check("Superpowers plan all tasks checked", () => planTasksAllDone(changeDir)),
|
|
11133
11371
|
check(
|
|
11134
11372
|
"proposal.md exists",
|
|
11135
|
-
async () => await nonempty(
|
|
11373
|
+
async () => await nonempty(path19.join(changeDir, "proposal.md")) ? pass() : fail("")
|
|
11136
11374
|
),
|
|
11137
11375
|
check(
|
|
11138
11376
|
"proposal.md matches configured language",
|
|
11139
|
-
() => documentLanguageMatchesConfigured(changeDir,
|
|
11377
|
+
() => documentLanguageMatchesConfigured(changeDir, path19.join(changeDir, "proposal.md"))
|
|
11140
11378
|
),
|
|
11141
11379
|
check("Superpowers plan matches configured language", async () => {
|
|
11142
11380
|
const plan = await readField(changeDir, "plan");
|
|
@@ -11178,11 +11416,11 @@ async function guardArchiveChecks(output, changeDir, change) {
|
|
|
11178
11416
|
check("archived is true", async () => await archivedIsTrue(changeDir) ? pass() : fail("")),
|
|
11179
11417
|
check(
|
|
11180
11418
|
"proposal.md exists",
|
|
11181
|
-
async () => await nonempty(
|
|
11419
|
+
async () => await nonempty(path19.join(changeDir, "proposal.md")) ? pass() : fail("")
|
|
11182
11420
|
),
|
|
11183
11421
|
check(
|
|
11184
11422
|
"design.md exists",
|
|
11185
|
-
async () => await nonempty(
|
|
11423
|
+
async () => await nonempty(path19.join(changeDir, "design.md")) ? pass() : fail("")
|
|
11186
11424
|
),
|
|
11187
11425
|
check("tasks.md all tasks checked", () => tasksAllDone(changeDir)),
|
|
11188
11426
|
check(
|
|
@@ -11272,8 +11510,8 @@ Valid phases: open, design, build, verify, archive`
|
|
|
11272
11510
|
// domains/comet-classic/classic-handoff.ts
|
|
11273
11511
|
var import_yaml7 = __toESM(require_dist(), 1);
|
|
11274
11512
|
import { createHash as createHash5 } from "crypto";
|
|
11275
|
-
import { promises as
|
|
11276
|
-
import
|
|
11513
|
+
import { promises as fs19, readFileSync as readFileSync2 } from "fs";
|
|
11514
|
+
import path20 from "path";
|
|
11277
11515
|
var GREEN4 = "\x1B[32m";
|
|
11278
11516
|
var RED4 = "\x1B[31m";
|
|
11279
11517
|
var YELLOW4 = "\x1B[33m";
|
|
@@ -11307,7 +11545,7 @@ var HandoffOutput = class {
|
|
|
11307
11545
|
};
|
|
11308
11546
|
async function exists5(file) {
|
|
11309
11547
|
try {
|
|
11310
|
-
await
|
|
11548
|
+
await fs19.access(file);
|
|
11311
11549
|
return true;
|
|
11312
11550
|
} catch (error) {
|
|
11313
11551
|
if (error.code === "ENOENT") return false;
|
|
@@ -11316,7 +11554,7 @@ async function exists5(file) {
|
|
|
11316
11554
|
}
|
|
11317
11555
|
async function nonempty2(file) {
|
|
11318
11556
|
try {
|
|
11319
|
-
return (await
|
|
11557
|
+
return (await fs19.stat(file)).size > 0;
|
|
11320
11558
|
} catch (error) {
|
|
11321
11559
|
if (error.code === "ENOENT") return false;
|
|
11322
11560
|
throw error;
|
|
@@ -11345,7 +11583,7 @@ async function handoffSourceFiles2(changeDir) {
|
|
|
11345
11583
|
const files = [`${changeDir}/proposal.md`, `${changeDir}/design.md`, `${changeDir}/tasks.md`];
|
|
11346
11584
|
const specs = `${changeDir}/specs`;
|
|
11347
11585
|
if (await exists5(specs)) {
|
|
11348
|
-
for (const entry2 of (await
|
|
11586
|
+
for (const entry2 of (await fs19.readdir(specs)).sort()) {
|
|
11349
11587
|
const spec = `${specs}/${entry2}/spec.md`;
|
|
11350
11588
|
if (await exists5(spec)) files.push(spec);
|
|
11351
11589
|
}
|
|
@@ -11393,7 +11631,7 @@ async function writeMarkdownContext(changeDir, change, mode, contextHash, output
|
|
|
11393
11631
|
];
|
|
11394
11632
|
for (const file of await handoffSourceFiles2(changeDir)) {
|
|
11395
11633
|
if (!await exists5(file)) continue;
|
|
11396
|
-
const content = await
|
|
11634
|
+
const content = await fs19.readFile(file, "utf8");
|
|
11397
11635
|
const total = lineCount(content);
|
|
11398
11636
|
lines.push(
|
|
11399
11637
|
`## ${file}`,
|
|
@@ -11418,7 +11656,7 @@ async function writeMarkdownContext(changeDir, change, mode, contextHash, output
|
|
|
11418
11656
|
}
|
|
11419
11657
|
lines.push("");
|
|
11420
11658
|
}
|
|
11421
|
-
await
|
|
11659
|
+
await fs19.writeFile(output, lines.join("\n"));
|
|
11422
11660
|
}
|
|
11423
11661
|
async function writeJsonContext(changeDir, change, mode, contextHash, output) {
|
|
11424
11662
|
const entries = [];
|
|
@@ -11441,7 +11679,7 @@ async function writeJsonContext(changeDir, change, mode, contextHash, output) {
|
|
|
11441
11679
|
"}",
|
|
11442
11680
|
""
|
|
11443
11681
|
].join("\n");
|
|
11444
|
-
await
|
|
11682
|
+
await fs19.writeFile(output, document);
|
|
11445
11683
|
}
|
|
11446
11684
|
async function writeSpecProjectionForFile(file, content) {
|
|
11447
11685
|
return [
|
|
@@ -11481,11 +11719,11 @@ async function writeSpecMarkdownContext(changeDir, change, contextHash, output)
|
|
|
11481
11719
|
const specs = `${changeDir}/specs`;
|
|
11482
11720
|
let projected = false;
|
|
11483
11721
|
if (await exists5(specs)) {
|
|
11484
|
-
for (const entry2 of (await
|
|
11722
|
+
for (const entry2 of (await fs19.readdir(specs)).sort()) {
|
|
11485
11723
|
const spec = `${specs}/${entry2}/spec.md`;
|
|
11486
11724
|
if (!await exists5(spec)) continue;
|
|
11487
11725
|
projected = true;
|
|
11488
|
-
lines.push(...await writeSpecProjectionForFile(spec, await
|
|
11726
|
+
lines.push(...await writeSpecProjectionForFile(spec, await fs19.readFile(spec, "utf8")));
|
|
11489
11727
|
}
|
|
11490
11728
|
}
|
|
11491
11729
|
if (!projected) {
|
|
@@ -11494,7 +11732,7 @@ async function writeSpecMarkdownContext(changeDir, change, contextHash, output)
|
|
|
11494
11732
|
lines.push(
|
|
11495
11733
|
"Full source files remain canonical. If a required heading or scenario is missing here, regenerate the handoff or read the source spec directly. Supporting files (proposal, design, tasks) are referenced by hash only."
|
|
11496
11734
|
);
|
|
11497
|
-
await
|
|
11735
|
+
await fs19.writeFile(output, lines.join("\n"));
|
|
11498
11736
|
}
|
|
11499
11737
|
async function writeSpecJsonContext(changeDir, change, contextHash, output) {
|
|
11500
11738
|
const entries = [];
|
|
@@ -11503,7 +11741,7 @@ async function writeSpecJsonContext(changeDir, change, contextHash, output) {
|
|
|
11503
11741
|
const role = /\/specs\/[^/]+\/spec\.md$/u.test(file) ? "spec" : "supporting";
|
|
11504
11742
|
entries.push({ path: file, sha256: hashFile2(file), role });
|
|
11505
11743
|
}
|
|
11506
|
-
await
|
|
11744
|
+
await fs19.writeFile(
|
|
11507
11745
|
output,
|
|
11508
11746
|
`${JSON.stringify(
|
|
11509
11747
|
{
|
|
@@ -11522,8 +11760,8 @@ async function writeSpecJsonContext(changeDir, change, contextHash, output) {
|
|
|
11522
11760
|
);
|
|
11523
11761
|
}
|
|
11524
11762
|
async function readField2(changeDir, field2) {
|
|
11525
|
-
const file =
|
|
11526
|
-
const document = (0, import_yaml7.parseDocument)(await
|
|
11763
|
+
const file = path20.join(changeDir, ".comet.yaml");
|
|
11764
|
+
const document = (0, import_yaml7.parseDocument)(await fs19.readFile(file, "utf8"), { uniqueKeys: false });
|
|
11527
11765
|
if (document.errors.length > 0) {
|
|
11528
11766
|
throw new HandoffFailure(`ERROR: Invalid .comet.yaml: ${document.errors[0].message}`);
|
|
11529
11767
|
}
|
|
@@ -11557,7 +11795,7 @@ async function completedHandoffIsCurrent(changeDir, run, contextHash, contextJso
|
|
|
11557
11795
|
readCheckpoint(changeDir, run.checkpointRef)
|
|
11558
11796
|
]);
|
|
11559
11797
|
if (!await exists5(contextJson) || !await exists5(contextMd)) return false;
|
|
11560
|
-
if (context !== await
|
|
11798
|
+
if (context !== await fs19.readFile(contextMd, "utf8")) return false;
|
|
11561
11799
|
if (artifacts.handoff_context !== contextJson || artifacts.handoff_markdown !== contextMd) {
|
|
11562
11800
|
return false;
|
|
11563
11801
|
}
|
|
@@ -11680,7 +11918,7 @@ var classicHandoffCommand = async (args) => {
|
|
|
11680
11918
|
run: pendingRun,
|
|
11681
11919
|
unknownKeys: (await readClassicState(changeDir)).unknownKeys
|
|
11682
11920
|
});
|
|
11683
|
-
await
|
|
11921
|
+
await fs19.mkdir(handoffDir, { recursive: true });
|
|
11684
11922
|
if (handoffMode === "beta") {
|
|
11685
11923
|
await writeSpecMarkdownContext(changeDir, change, contextHash, contextMd);
|
|
11686
11924
|
await writeSpecJsonContext(changeDir, change, contextHash, contextJson);
|
|
@@ -11688,7 +11926,7 @@ var classicHandoffCommand = async (args) => {
|
|
|
11688
11926
|
await writeMarkdownContext(changeDir, change, handoffMode, contextHash, contextMd);
|
|
11689
11927
|
await writeJsonContext(changeDir, change, handoffMode, contextHash, contextJson);
|
|
11690
11928
|
}
|
|
11691
|
-
const context = await
|
|
11929
|
+
const context = await fs19.readFile(contextMd, "utf8");
|
|
11692
11930
|
await writeContext(changeDir, pendingRun.contextRef, context);
|
|
11693
11931
|
const artifacts = {
|
|
11694
11932
|
...await readArtifacts(changeDir, pendingRun.artifactsRef),
|
|
@@ -11745,152 +11983,8 @@ var classicHandoffCommand = async (args) => {
|
|
|
11745
11983
|
};
|
|
11746
11984
|
|
|
11747
11985
|
// domains/comet-classic/classic-hook-guard.ts
|
|
11748
|
-
import { existsSync as existsSync2, promises as
|
|
11749
|
-
import
|
|
11750
|
-
|
|
11751
|
-
// domains/comet-classic/classic-current-change.ts
|
|
11752
|
-
import { randomUUID as randomUUID7 } from "crypto";
|
|
11753
|
-
import { promises as fs18 } from "fs";
|
|
11754
|
-
import path19 from "path";
|
|
11755
|
-
function currentChangeFile(projectRoot2) {
|
|
11756
|
-
return path19.join(projectRoot2, ".comet", "current-change.json");
|
|
11757
|
-
}
|
|
11758
|
-
function changeDirectory(projectRoot2, changeName) {
|
|
11759
|
-
return path19.join(projectRoot2, "openspec", "changes", changeName);
|
|
11760
|
-
}
|
|
11761
|
-
async function validateActiveChange(projectRoot2, changeName) {
|
|
11762
|
-
assertOpenSpecChangeName(changeName);
|
|
11763
|
-
const changeDir = changeDirectory(projectRoot2, changeName);
|
|
11764
|
-
try {
|
|
11765
|
-
await fs18.access(path19.join(changeDir, ".comet.yaml"));
|
|
11766
|
-
} catch (error) {
|
|
11767
|
-
if (error.code === "ENOENT") {
|
|
11768
|
-
throw new Error(
|
|
11769
|
-
`Cannot select current change '${changeName}': active change state not found`,
|
|
11770
|
-
{
|
|
11771
|
-
cause: error
|
|
11772
|
-
}
|
|
11773
|
-
);
|
|
11774
|
-
}
|
|
11775
|
-
throw error;
|
|
11776
|
-
}
|
|
11777
|
-
const projection = await readClassicState(changeDir, { migrate: false });
|
|
11778
|
-
if (!projection.classic) {
|
|
11779
|
-
throw new Error(`Cannot select current change '${changeName}': Classic state is incomplete`);
|
|
11780
|
-
}
|
|
11781
|
-
if (projection.classic.archived) {
|
|
11782
|
-
throw new Error(`Cannot select current change '${changeName}': change is archived`);
|
|
11783
|
-
}
|
|
11784
|
-
}
|
|
11785
|
-
function parseSelection(source) {
|
|
11786
|
-
let value;
|
|
11787
|
-
try {
|
|
11788
|
-
value = JSON.parse(source);
|
|
11789
|
-
} catch (error) {
|
|
11790
|
-
throw new Error(
|
|
11791
|
-
`current change selection contains invalid JSON: ${error instanceof Error ? error.message : String(error)}`,
|
|
11792
|
-
{ cause: error }
|
|
11793
|
-
);
|
|
11794
|
-
}
|
|
11795
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
11796
|
-
throw new Error("current change selection must be a JSON object");
|
|
11797
|
-
}
|
|
11798
|
-
const record = value;
|
|
11799
|
-
if (record.version !== 1) {
|
|
11800
|
-
throw new Error("current change selection version must be 1");
|
|
11801
|
-
}
|
|
11802
|
-
if (typeof record.change !== "string") {
|
|
11803
|
-
throw new Error("current change selection change must be a string");
|
|
11804
|
-
}
|
|
11805
|
-
assertOpenSpecChangeName(record.change);
|
|
11806
|
-
if (record.branch !== void 0 && record.branch !== null && typeof record.branch !== "string") {
|
|
11807
|
-
throw new Error("current change selection branch must be a string or null");
|
|
11808
|
-
}
|
|
11809
|
-
return {
|
|
11810
|
-
version: 1,
|
|
11811
|
-
change: record.change,
|
|
11812
|
-
branch: record.branch ?? null
|
|
11813
|
-
};
|
|
11814
|
-
}
|
|
11815
|
-
async function selectCurrentChange(projectRoot2, changeName) {
|
|
11816
|
-
await validateActiveChange(projectRoot2, changeName);
|
|
11817
|
-
const outcome = await resolveBranchBinding(changeDirectory(projectRoot2, changeName), {
|
|
11818
|
-
heal: true,
|
|
11819
|
-
cwd: projectRoot2
|
|
11820
|
-
});
|
|
11821
|
-
if (outcome.status === "drift") {
|
|
11822
|
-
throw new Error(driftStaleReason(changeName, outcome.boundBranch, outcome.currentBranch));
|
|
11823
|
-
}
|
|
11824
|
-
if (outcome.status === "unbound-detached") {
|
|
11825
|
-
throw new Error(unboundDetachedMessage(changeName));
|
|
11826
|
-
}
|
|
11827
|
-
const selection = {
|
|
11828
|
-
version: 1,
|
|
11829
|
-
change: changeName,
|
|
11830
|
-
branch: outcome.currentBranch
|
|
11831
|
-
};
|
|
11832
|
-
const file = currentChangeFile(projectRoot2);
|
|
11833
|
-
const temporary = `${file}.${randomUUID7()}.tmp`;
|
|
11834
|
-
await fs18.mkdir(path19.dirname(file), { recursive: true });
|
|
11835
|
-
try {
|
|
11836
|
-
await fs18.writeFile(temporary, JSON.stringify(selection, null, 2) + "\n", "utf8");
|
|
11837
|
-
await fs18.rename(temporary, file);
|
|
11838
|
-
} catch (error) {
|
|
11839
|
-
await fs18.rm(temporary, { force: true });
|
|
11840
|
-
throw error;
|
|
11841
|
-
}
|
|
11842
|
-
return selection;
|
|
11843
|
-
}
|
|
11844
|
-
async function resolveCurrentChange(projectRoot2) {
|
|
11845
|
-
let source;
|
|
11846
|
-
try {
|
|
11847
|
-
source = await fs18.readFile(currentChangeFile(projectRoot2), "utf8");
|
|
11848
|
-
} catch (error) {
|
|
11849
|
-
if (error.code === "ENOENT") return { status: "missing" };
|
|
11850
|
-
return {
|
|
11851
|
-
status: "stale",
|
|
11852
|
-
reason: `cannot read current change selection: ${error instanceof Error ? error.message : String(error)}`
|
|
11853
|
-
};
|
|
11854
|
-
}
|
|
11855
|
-
let selection;
|
|
11856
|
-
try {
|
|
11857
|
-
selection = parseSelection(source);
|
|
11858
|
-
await validateActiveChange(projectRoot2, selection.change);
|
|
11859
|
-
} catch (error) {
|
|
11860
|
-
return {
|
|
11861
|
-
status: "stale",
|
|
11862
|
-
reason: error instanceof Error ? error.message : String(error)
|
|
11863
|
-
};
|
|
11864
|
-
}
|
|
11865
|
-
const outcome = await resolveBranchBinding(changeDirectory(projectRoot2, selection.change), {
|
|
11866
|
-
heal: false,
|
|
11867
|
-
cwd: projectRoot2
|
|
11868
|
-
});
|
|
11869
|
-
if (outcome.status === "drift") {
|
|
11870
|
-
return {
|
|
11871
|
-
status: "stale",
|
|
11872
|
-
reason: driftStaleReason(selection.change, outcome.boundBranch, outcome.currentBranch)
|
|
11873
|
-
};
|
|
11874
|
-
}
|
|
11875
|
-
if (outcome.status === "unbound-detached") {
|
|
11876
|
-
return { status: "stale", reason: unboundDetachedMessage(selection.change) };
|
|
11877
|
-
}
|
|
11878
|
-
if (outcome.status === "ok") {
|
|
11879
|
-
return { status: "selected", selection };
|
|
11880
|
-
}
|
|
11881
|
-
if (selection.branch !== null && outcome.currentBranch !== selection.branch) {
|
|
11882
|
-
return {
|
|
11883
|
-
status: "stale",
|
|
11884
|
-
reason: `current change '${selection.change}' was selected on branch '${selection.branch}', current branch is '${outcome.currentBranch ?? "detached HEAD"}'`
|
|
11885
|
-
};
|
|
11886
|
-
}
|
|
11887
|
-
return { status: "selected", selection };
|
|
11888
|
-
}
|
|
11889
|
-
async function clearCurrentChange(projectRoot2) {
|
|
11890
|
-
await fs18.rm(currentChangeFile(projectRoot2), { force: true });
|
|
11891
|
-
}
|
|
11892
|
-
|
|
11893
|
-
// domains/comet-classic/classic-hook-guard.ts
|
|
11986
|
+
import { existsSync as existsSync2, promises as fs20, readFileSync as readFileSync3 } from "fs";
|
|
11987
|
+
import path21 from "path";
|
|
11894
11988
|
function result(exitCode, message) {
|
|
11895
11989
|
return { exitCode, stderr: message + "\n" };
|
|
11896
11990
|
}
|
|
@@ -11919,52 +12013,52 @@ function comparisonKey(value) {
|
|
|
11919
12013
|
function parseProjectRoot(args) {
|
|
11920
12014
|
const index = args.indexOf("--project-root");
|
|
11921
12015
|
const value = index >= 0 ? args[index + 1] : void 0;
|
|
11922
|
-
return
|
|
12016
|
+
return path21.resolve(value && !value.startsWith("--") ? value : process.cwd());
|
|
11923
12017
|
}
|
|
11924
12018
|
function relativeToProjectRoot(target, projectRoot2) {
|
|
11925
|
-
const relative = normalized(
|
|
12019
|
+
const relative = normalized(path21.relative(projectRoot2, target));
|
|
11926
12020
|
if (relative === "") return "";
|
|
11927
|
-
if (relative.startsWith("../") || relative === ".." ||
|
|
12021
|
+
if (relative.startsWith("../") || relative === ".." || path21.isAbsolute(relative)) return null;
|
|
11928
12022
|
return relative;
|
|
11929
12023
|
}
|
|
11930
12024
|
async function physicalPathForPossiblyMissingTarget(target) {
|
|
11931
|
-
const resolved =
|
|
11932
|
-
const root =
|
|
12025
|
+
const resolved = path21.resolve(target);
|
|
12026
|
+
const root = path21.parse(resolved).root;
|
|
11933
12027
|
const missingSegments = [];
|
|
11934
12028
|
let cursor = resolved;
|
|
11935
12029
|
while (cursor && cursor !== root) {
|
|
11936
12030
|
try {
|
|
11937
|
-
const physicalBase = await
|
|
11938
|
-
return
|
|
12031
|
+
const physicalBase = await fs20.realpath(cursor);
|
|
12032
|
+
return path21.join(physicalBase, ...missingSegments.reverse());
|
|
11939
12033
|
} catch (error) {
|
|
11940
12034
|
const code = error.code;
|
|
11941
12035
|
if (code !== "ENOENT" && code !== "ENOTDIR") throw error;
|
|
11942
|
-
missingSegments.push(
|
|
11943
|
-
cursor =
|
|
12036
|
+
missingSegments.push(path21.basename(cursor));
|
|
12037
|
+
cursor = path21.dirname(cursor);
|
|
11944
12038
|
}
|
|
11945
12039
|
}
|
|
11946
12040
|
try {
|
|
11947
|
-
const physicalRoot = await
|
|
11948
|
-
return
|
|
12041
|
+
const physicalRoot = await fs20.realpath(root);
|
|
12042
|
+
return path21.join(physicalRoot, ...missingSegments.reverse());
|
|
11949
12043
|
} catch {
|
|
11950
12044
|
return null;
|
|
11951
12045
|
}
|
|
11952
12046
|
}
|
|
11953
12047
|
async function projectRelative(target, projectRoot2) {
|
|
11954
|
-
const rawCandidate =
|
|
12048
|
+
const rawCandidate = path21.isAbsolute(target) ? target : path21.resolve(process.cwd(), target);
|
|
11955
12049
|
let candidate = normalized(rawCandidate);
|
|
11956
12050
|
const rootRelative = relativeToProjectRoot(rawCandidate, projectRoot2);
|
|
11957
12051
|
if (rootRelative !== null) return rootRelative;
|
|
11958
12052
|
try {
|
|
11959
12053
|
const physicalCandidate = await physicalPathForPossiblyMissingTarget(rawCandidate);
|
|
11960
|
-
const physicalRoot = await
|
|
12054
|
+
const physicalRoot = await fs20.realpath(projectRoot2);
|
|
11961
12055
|
if (physicalCandidate) {
|
|
11962
12056
|
const physicalRootRelative = relativeToProjectRoot(physicalCandidate, physicalRoot);
|
|
11963
12057
|
if (physicalRootRelative !== null) return physicalRootRelative;
|
|
11964
12058
|
candidate = normalized(physicalCandidate);
|
|
11965
12059
|
}
|
|
11966
12060
|
} catch {
|
|
11967
|
-
if (!
|
|
12061
|
+
if (!path21.isAbsolute(target)) return normalized(target).replace(/^\.\//u, "");
|
|
11968
12062
|
}
|
|
11969
12063
|
return candidate.replace(/^\.\//u, "");
|
|
11970
12064
|
}
|
|
@@ -11994,15 +12088,15 @@ async function loadGoverningChange(changeDir) {
|
|
|
11994
12088
|
}
|
|
11995
12089
|
}
|
|
11996
12090
|
async function activeChanges(projectRoot2) {
|
|
11997
|
-
const changesDir =
|
|
12091
|
+
const changesDir = path21.join(projectRoot2, "openspec", "changes");
|
|
11998
12092
|
const governingChanges = [];
|
|
11999
12093
|
if (!existsSync2(changesDir)) return governingChanges;
|
|
12000
|
-
for (const entry2 of (await
|
|
12094
|
+
for (const entry2 of (await fs20.readdir(changesDir, { withFileTypes: true })).sort(
|
|
12001
12095
|
(left, right) => left.name.localeCompare(right.name)
|
|
12002
12096
|
)) {
|
|
12003
12097
|
if (!entry2.isDirectory() || entry2.name === "archive") continue;
|
|
12004
|
-
const changeDir =
|
|
12005
|
-
if (!existsSync2(
|
|
12098
|
+
const changeDir = path21.join(changesDir, entry2.name);
|
|
12099
|
+
if (!existsSync2(path21.join(changeDir, ".comet.yaml"))) continue;
|
|
12006
12100
|
const governing = await loadGoverningChange(changeDir);
|
|
12007
12101
|
if (!governing || governing.archived) continue;
|
|
12008
12102
|
governingChanges.push(governing);
|
|
@@ -12050,7 +12144,7 @@ function allowsSuperpowersArtifacts(governing) {
|
|
|
12050
12144
|
return governing.phase === "design" || governing.phase === "build" || governing.phase === "verify";
|
|
12051
12145
|
}
|
|
12052
12146
|
function governingChangeName(governing) {
|
|
12053
|
-
return governing.changeDir ?
|
|
12147
|
+
return governing.changeDir ? path21.basename(governing.changeDir) : null;
|
|
12054
12148
|
}
|
|
12055
12149
|
var SUPERPOWERS_ARTIFACT_SUFFIXES = /* @__PURE__ */ new Set([
|
|
12056
12150
|
"design",
|
|
@@ -12097,9 +12191,20 @@ async function superpowersArtifactGoverningChange(relativePath2, projectRoot2) {
|
|
|
12097
12191
|
if (named) return { governing: named, match: "named" };
|
|
12098
12192
|
return null;
|
|
12099
12193
|
}
|
|
12100
|
-
async function repoSourceGoverningChange(projectRoot2, relativePath2) {
|
|
12194
|
+
async function repoSourceGoverningChange(projectRoot2, relativePath2, selectedChangeName) {
|
|
12101
12195
|
const active = await activeChanges(projectRoot2);
|
|
12102
12196
|
if (active.length === 0) return null;
|
|
12197
|
+
if (selectedChangeName) {
|
|
12198
|
+
const selected = active.find(
|
|
12199
|
+
(governing) => governingChangeName(governing) === selectedChangeName
|
|
12200
|
+
);
|
|
12201
|
+
return selected ?? {
|
|
12202
|
+
blockedResult: blockedStaleSelection(
|
|
12203
|
+
relativePath2,
|
|
12204
|
+
`selected change '${selectedChangeName}' is no longer active`
|
|
12205
|
+
)
|
|
12206
|
+
};
|
|
12207
|
+
}
|
|
12103
12208
|
const current = await resolveCurrentChange(projectRoot2);
|
|
12104
12209
|
if (current.status === "stale") {
|
|
12105
12210
|
return { blockedResult: blockedStaleSelection(relativePath2, current.reason) };
|
|
@@ -12147,14 +12252,14 @@ async function repoSourceGoverningChange(projectRoot2, relativePath2) {
|
|
|
12147
12252
|
)
|
|
12148
12253
|
};
|
|
12149
12254
|
}
|
|
12150
|
-
async function governingChange(relativePath2, projectRoot2) {
|
|
12255
|
+
async function governingChange(relativePath2, projectRoot2, selectedChangeName) {
|
|
12151
12256
|
const prefix = "openspec/changes/";
|
|
12152
12257
|
if (relativePath2.startsWith(prefix)) {
|
|
12153
12258
|
const rest = relativePath2.slice(prefix.length);
|
|
12154
12259
|
const [name] = rest.split("/");
|
|
12155
12260
|
if (name && name !== "archive") {
|
|
12156
|
-
const changeDir =
|
|
12157
|
-
const stateFile2 =
|
|
12261
|
+
const changeDir = path21.join(projectRoot2, "openspec", "changes", name);
|
|
12262
|
+
const stateFile2 = path21.join(changeDir, ".comet.yaml");
|
|
12158
12263
|
if (existsSync2(stateFile2)) {
|
|
12159
12264
|
const governing = await loadGoverningChange(changeDir);
|
|
12160
12265
|
if (governing) return governing;
|
|
@@ -12177,7 +12282,11 @@ async function governingChange(relativePath2, projectRoot2) {
|
|
|
12177
12282
|
} : { ...superpowers.governing, superpowersArtifact: "matched" };
|
|
12178
12283
|
}
|
|
12179
12284
|
if (slot) {
|
|
12180
|
-
const candidate = await repoSourceGoverningChange(
|
|
12285
|
+
const candidate = await repoSourceGoverningChange(
|
|
12286
|
+
projectRoot2,
|
|
12287
|
+
relativePath2,
|
|
12288
|
+
selectedChangeName
|
|
12289
|
+
);
|
|
12181
12290
|
if (!candidate || "blockedResult" in candidate) return candidate;
|
|
12182
12291
|
return {
|
|
12183
12292
|
...candidate,
|
|
@@ -12185,10 +12294,11 @@ async function governingChange(relativePath2, projectRoot2) {
|
|
|
12185
12294
|
superpowersSlot: slot
|
|
12186
12295
|
};
|
|
12187
12296
|
}
|
|
12188
|
-
const
|
|
12297
|
+
const active = await activeChanges(projectRoot2);
|
|
12298
|
+
const fallback = selectedChangeName ? active.find((candidate) => governingChangeName(candidate) === selectedChangeName) ?? null : active[0] ?? null;
|
|
12189
12299
|
return fallback ? { ...fallback, superpowersArtifact: "unmatched" } : null;
|
|
12190
12300
|
}
|
|
12191
|
-
return repoSourceGoverningChange(projectRoot2, relativePath2);
|
|
12301
|
+
return repoSourceGoverningChange(projectRoot2, relativePath2, selectedChangeName);
|
|
12192
12302
|
}
|
|
12193
12303
|
function isRootMarkdown(relativePath2) {
|
|
12194
12304
|
return !relativePath2.includes("/") && relativePath2.endsWith(".md");
|
|
@@ -12344,10 +12454,7 @@ function blockedStaleSelection(relativePath2, reason) {
|
|
|
12344
12454
|
].join("\n")
|
|
12345
12455
|
);
|
|
12346
12456
|
}
|
|
12347
|
-
|
|
12348
|
-
const projectRoot2 = parseProjectRoot(args);
|
|
12349
|
-
const target = inputTarget();
|
|
12350
|
-
if (!target) return allowed("no file path in tool input");
|
|
12457
|
+
async function inspectClassicHookTarget(projectRoot2, target, selectedChangeName) {
|
|
12351
12458
|
const relativePath2 = await projectRelative(target, projectRoot2);
|
|
12352
12459
|
if (isCometConfig(relativePath2)) {
|
|
12353
12460
|
return allowed(`${relativePath2} (whitelist: comet config)`);
|
|
@@ -12363,7 +12470,7 @@ var classicHookGuardCommand = async (args) => {
|
|
|
12363
12470
|
}
|
|
12364
12471
|
let governing;
|
|
12365
12472
|
try {
|
|
12366
|
-
governing = await governingChange(relativePath2, projectRoot2);
|
|
12473
|
+
governing = await governingChange(relativePath2, projectRoot2, selectedChangeName);
|
|
12367
12474
|
} catch (error) {
|
|
12368
12475
|
return result(
|
|
12369
12476
|
2,
|
|
@@ -12391,6 +12498,12 @@ var classicHookGuardCommand = async (args) => {
|
|
|
12391
12498
|
return allowed(`${relativePath2} (phase: ${phase})`);
|
|
12392
12499
|
}
|
|
12393
12500
|
return blocked(relativePath2, phase);
|
|
12501
|
+
}
|
|
12502
|
+
var classicHookGuardCommand = async (args) => {
|
|
12503
|
+
const projectRoot2 = parseProjectRoot(args);
|
|
12504
|
+
const target = inputTarget();
|
|
12505
|
+
if (!target) return allowed("no file path in tool input");
|
|
12506
|
+
return inspectClassicHookTarget(projectRoot2, target);
|
|
12394
12507
|
};
|
|
12395
12508
|
|
|
12396
12509
|
// domains/comet-classic/classic-intent.ts
|
|
@@ -12446,7 +12559,7 @@ ${issues.map((issue) => `- ${issue}`).join("\n")}`);
|
|
|
12446
12559
|
}
|
|
12447
12560
|
issues;
|
|
12448
12561
|
};
|
|
12449
|
-
function
|
|
12562
|
+
function isRecord2(value) {
|
|
12450
12563
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12451
12564
|
}
|
|
12452
12565
|
function enumValue2(value, allowed2, field2, issues) {
|
|
@@ -12499,15 +12612,15 @@ function nonNegativeIntegerValue(value, field2, issues) {
|
|
|
12499
12612
|
}
|
|
12500
12613
|
function validateFrame(input) {
|
|
12501
12614
|
const issues = [];
|
|
12502
|
-
if (!
|
|
12503
|
-
const intent =
|
|
12504
|
-
if (!
|
|
12505
|
-
const slots =
|
|
12506
|
-
if (!
|
|
12507
|
-
const context =
|
|
12508
|
-
if (!
|
|
12509
|
-
const proposedRouteInput =
|
|
12510
|
-
if (!
|
|
12615
|
+
if (!isRecord2(input)) throw new CometIntentValidationError(["frame must be an object"]);
|
|
12616
|
+
const intent = isRecord2(input.intent) ? input.intent : {};
|
|
12617
|
+
if (!isRecord2(input.intent)) issues.push("intent must be an object");
|
|
12618
|
+
const slots = isRecord2(input.slots) ? input.slots : {};
|
|
12619
|
+
if (!isRecord2(input.slots)) issues.push("slots must be an object");
|
|
12620
|
+
const context = isRecord2(input.context) ? input.context : {};
|
|
12621
|
+
if (!isRecord2(input.context)) issues.push("context must be an object");
|
|
12622
|
+
const proposedRouteInput = isRecord2(input.proposed_route) ? input.proposed_route : {};
|
|
12623
|
+
if (!isRecord2(input.proposed_route)) issues.push("proposed_route must be an object");
|
|
12511
12624
|
const entities = input.entities === void 0 ? [] : Array.isArray(input.entities) ? input.entities : [];
|
|
12512
12625
|
if (input.entities !== void 0 && !Array.isArray(input.entities)) {
|
|
12513
12626
|
issues.push("entities must be an array");
|
|
@@ -12528,8 +12641,8 @@ function validateFrame(input) {
|
|
|
12528
12641
|
confidence: confidenceValue(intent.confidence, "intent.confidence", issues)
|
|
12529
12642
|
},
|
|
12530
12643
|
entities: entities.map((entity, index) => {
|
|
12531
|
-
const record =
|
|
12532
|
-
if (!
|
|
12644
|
+
const record = isRecord2(entity) ? entity : {};
|
|
12645
|
+
if (!isRecord2(entity)) issues.push(`entities[${index}] must be an object`);
|
|
12533
12646
|
return {
|
|
12534
12647
|
type: enumValue2(record.type, ENTITY_TYPES, `entities[${index}].type`, issues) ?? "risk_signal",
|
|
12535
12648
|
value: stringValue(record.value, `entities[${index}].value`, issues),
|
|
@@ -12577,7 +12690,7 @@ function validateFrame(input) {
|
|
|
12577
12690
|
"context.active_changes_count",
|
|
12578
12691
|
issues
|
|
12579
12692
|
),
|
|
12580
|
-
active_change_names:
|
|
12693
|
+
active_change_names: isRecord2(context) ? (() => {
|
|
12581
12694
|
if (!Array.isArray(context.active_change_names)) {
|
|
12582
12695
|
issues.push("context.active_change_names must be an array");
|
|
12583
12696
|
return [];
|
|
@@ -12595,8 +12708,8 @@ function validateFrame(input) {
|
|
|
12595
12708
|
)
|
|
12596
12709
|
},
|
|
12597
12710
|
evidence: evidence.map((item, index) => {
|
|
12598
|
-
const record =
|
|
12599
|
-
if (!
|
|
12711
|
+
const record = isRecord2(item) ? item : {};
|
|
12712
|
+
if (!isRecord2(item)) issues.push(`evidence[${index}] must be an object`);
|
|
12600
12713
|
return {
|
|
12601
12714
|
field: stringValue(record.field, `evidence[${index}].field`, issues),
|
|
12602
12715
|
quote: stringValue(record.quote, `evidence[${index}].quote`, issues),
|
|
@@ -12762,15 +12875,15 @@ var classicIntentCommand = async (args, _options) => {
|
|
|
12762
12875
|
};
|
|
12763
12876
|
|
|
12764
12877
|
// domains/comet-classic/classic-resume-probe.ts
|
|
12765
|
-
import
|
|
12766
|
-
import { promises as
|
|
12878
|
+
import path22 from "path";
|
|
12879
|
+
import { promises as fs21 } from "fs";
|
|
12767
12880
|
import { spawn } from "child_process";
|
|
12768
12881
|
var COMET_RESUME_PROBE_SCHEMA_VERSION = "comet.resume_probe.v1";
|
|
12769
|
-
function
|
|
12882
|
+
function isRecord3(value) {
|
|
12770
12883
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12771
12884
|
}
|
|
12772
12885
|
function normalizeInput(input) {
|
|
12773
|
-
if (!
|
|
12886
|
+
if (!isRecord3(input)) {
|
|
12774
12887
|
throw new Error("Invalid CometResumeProbeInput: input must be an object");
|
|
12775
12888
|
}
|
|
12776
12889
|
if (input.schema_version !== COMET_RESUME_PROBE_SCHEMA_VERSION) {
|
|
@@ -12781,7 +12894,7 @@ function normalizeInput(input) {
|
|
|
12781
12894
|
if (typeof input.utterance !== "string") {
|
|
12782
12895
|
throw new Error("Invalid CometResumeProbeInput: utterance must be a string");
|
|
12783
12896
|
}
|
|
12784
|
-
const context =
|
|
12897
|
+
const context = isRecord3(input.agent_context) ? input.agent_context : {};
|
|
12785
12898
|
return {
|
|
12786
12899
|
schema_version: COMET_RESUME_PROBE_SCHEMA_VERSION,
|
|
12787
12900
|
utterance: input.utterance,
|
|
@@ -12806,13 +12919,13 @@ function result3(action, change, confidence, reason, evidence = []) {
|
|
|
12806
12919
|
}
|
|
12807
12920
|
async function readIfExists(filePath) {
|
|
12808
12921
|
if (!await fileExists3(filePath)) return "";
|
|
12809
|
-
return
|
|
12922
|
+
return fs21.readFile(filePath, "utf8");
|
|
12810
12923
|
}
|
|
12811
12924
|
async function changeSearchText(changeDir, classic) {
|
|
12812
12925
|
const files = ["proposal.md", "design.md", "tasks.md"];
|
|
12813
12926
|
const parts = [classic.name, classic.workflow, classic.phase];
|
|
12814
12927
|
for (const file of files) {
|
|
12815
|
-
parts.push(await readIfExists(
|
|
12928
|
+
parts.push(await readIfExists(path22.join(changeDir, file)));
|
|
12816
12929
|
}
|
|
12817
12930
|
return parts.join("\n").toLowerCase();
|
|
12818
12931
|
}
|
|
@@ -12876,19 +12989,19 @@ function diagnosticFromProjection(changeDir, name, projection) {
|
|
|
12876
12989
|
};
|
|
12877
12990
|
}
|
|
12878
12991
|
async function hasOpenSpecChangeFiles(changeDir) {
|
|
12879
|
-
return await fileExists3(
|
|
12992
|
+
return await fileExists3(path22.join(changeDir, "proposal.md")) || await fileExists3(path22.join(changeDir, "design.md")) || await fileExists3(path22.join(changeDir, "tasks.md"));
|
|
12880
12993
|
}
|
|
12881
12994
|
async function discoverActiveChanges(projectRoot2) {
|
|
12882
|
-
const changesDir =
|
|
12995
|
+
const changesDir = path22.join(projectRoot2, "openspec", "changes");
|
|
12883
12996
|
if (!await fileExists3(changesDir)) return [];
|
|
12884
12997
|
const entries = await readDir(changesDir);
|
|
12885
12998
|
const changes = [];
|
|
12886
12999
|
for (const entry2 of entries) {
|
|
12887
13000
|
if (entry2 === "archive") continue;
|
|
12888
|
-
const changeDir =
|
|
12889
|
-
const stat = await
|
|
13001
|
+
const changeDir = path22.join(changesDir, entry2);
|
|
13002
|
+
const stat = await fs21.stat(changeDir).catch(() => null);
|
|
12890
13003
|
if (!stat?.isDirectory()) continue;
|
|
12891
|
-
const hasCometState = await fileExists3(
|
|
13004
|
+
const hasCometState = await fileExists3(path22.join(changeDir, ".comet.yaml"));
|
|
12892
13005
|
if (!hasCometState) {
|
|
12893
13006
|
if (!await hasOpenSpecChangeFiles(changeDir)) continue;
|
|
12894
13007
|
const missingStateChange = {
|
|
@@ -13191,8 +13304,8 @@ var classicResumeProbeCommand = async (args) => {
|
|
|
13191
13304
|
var import_yaml8 = __toESM(require_dist(), 1);
|
|
13192
13305
|
import { spawnSync as spawnSync3 } from "child_process";
|
|
13193
13306
|
import { randomUUID as randomUUID8 } from "crypto";
|
|
13194
|
-
import { existsSync as existsSync3, promises as
|
|
13195
|
-
import
|
|
13307
|
+
import { existsSync as existsSync3, promises as fs22 } from "fs";
|
|
13308
|
+
import path23 from "path";
|
|
13196
13309
|
init_state();
|
|
13197
13310
|
var GREEN5 = "\x1B[32m";
|
|
13198
13311
|
var RED5 = "\x1B[31m";
|
|
@@ -13306,7 +13419,7 @@ function validateRelativePath(value, field2) {
|
|
|
13306
13419
|
}
|
|
13307
13420
|
async function exists6(file) {
|
|
13308
13421
|
try {
|
|
13309
|
-
await
|
|
13422
|
+
await fs22.access(file);
|
|
13310
13423
|
return true;
|
|
13311
13424
|
} catch (error) {
|
|
13312
13425
|
if (error.code === "ENOENT") return false;
|
|
@@ -13315,7 +13428,7 @@ async function exists6(file) {
|
|
|
13315
13428
|
}
|
|
13316
13429
|
async function nonempty3(file) {
|
|
13317
13430
|
try {
|
|
13318
|
-
return (await
|
|
13431
|
+
return (await fs22.stat(file)).size > 0;
|
|
13319
13432
|
} catch (error) {
|
|
13320
13433
|
if (error.code === "ENOENT") return false;
|
|
13321
13434
|
throw error;
|
|
@@ -13327,11 +13440,11 @@ async function changeDirectory2(name) {
|
|
|
13327
13440
|
async function readDocument2(file) {
|
|
13328
13441
|
let source;
|
|
13329
13442
|
try {
|
|
13330
|
-
source = await
|
|
13443
|
+
source = await fs22.readFile(file, "utf8");
|
|
13331
13444
|
} catch (error) {
|
|
13332
13445
|
if (error.code === "ENOENT") {
|
|
13333
13446
|
fail2(
|
|
13334
|
-
`ERROR: .comet.yaml not found at ${
|
|
13447
|
+
`ERROR: .comet.yaml not found at ${path23.relative(process.cwd(), file).replaceAll("\\", "/")}`
|
|
13335
13448
|
);
|
|
13336
13449
|
}
|
|
13337
13450
|
throw error;
|
|
@@ -13341,13 +13454,13 @@ async function readDocument2(file) {
|
|
|
13341
13454
|
return document;
|
|
13342
13455
|
}
|
|
13343
13456
|
async function atomicWrite2(file, content) {
|
|
13344
|
-
await
|
|
13457
|
+
await fs22.mkdir(path23.dirname(file), { recursive: true });
|
|
13345
13458
|
const temporary = `${file}.${randomUUID8()}.tmp`;
|
|
13346
13459
|
try {
|
|
13347
|
-
await
|
|
13348
|
-
await
|
|
13460
|
+
await fs22.writeFile(temporary, content, "utf8");
|
|
13461
|
+
await fs22.rename(temporary, file);
|
|
13349
13462
|
} catch (error) {
|
|
13350
|
-
await
|
|
13463
|
+
await fs22.rm(temporary, { force: true });
|
|
13351
13464
|
throw error;
|
|
13352
13465
|
}
|
|
13353
13466
|
}
|
|
@@ -13490,7 +13603,7 @@ async function stateFile(name) {
|
|
|
13490
13603
|
const change = await changeDirectory2(name);
|
|
13491
13604
|
return {
|
|
13492
13605
|
...change,
|
|
13493
|
-
file:
|
|
13606
|
+
file: path23.join(change.directory, ".comet.yaml")
|
|
13494
13607
|
};
|
|
13495
13608
|
}
|
|
13496
13609
|
async function readField3(name, field2) {
|
|
@@ -13621,7 +13734,7 @@ async function init(output, name, workflow) {
|
|
|
13621
13734
|
validateEnum(workflow, PROFILES);
|
|
13622
13735
|
const { file, label, directory } = await stateFile(name);
|
|
13623
13736
|
if (await exists6(file)) fail2(`ERROR: .comet.yaml already exists at ${label}/.comet.yaml`);
|
|
13624
|
-
await
|
|
13737
|
+
await fs22.mkdir(directory, { recursive: true });
|
|
13625
13738
|
const preset = workflow !== "full";
|
|
13626
13739
|
const reviewMode = preset ? "off" : await reviewModeDefault();
|
|
13627
13740
|
const document = new import_yaml8.Document({
|
|
@@ -13702,13 +13815,13 @@ async function requireOpenArtifacts(name) {
|
|
|
13702
13815
|
const { directory } = await stateFile(name);
|
|
13703
13816
|
const workflow = await readField3(name, "workflow");
|
|
13704
13817
|
for (const artifact of ["proposal.md", "tasks.md"]) {
|
|
13705
|
-
if (!await nonempty3(
|
|
13818
|
+
if (!await nonempty3(path23.join(directory, artifact))) {
|
|
13706
13819
|
fail2(
|
|
13707
13820
|
`ERROR: Cannot transition '${name}': ${artifact} must exist and be non-empty before leaving open`
|
|
13708
13821
|
);
|
|
13709
13822
|
}
|
|
13710
13823
|
}
|
|
13711
|
-
if (workflow === "full" && !await nonempty3(
|
|
13824
|
+
if (workflow === "full" && !await nonempty3(path23.join(directory, "design.md"))) {
|
|
13712
13825
|
fail2(
|
|
13713
13826
|
`ERROR: Cannot transition '${name}': design.md must exist and be non-empty before leaving open`
|
|
13714
13827
|
);
|
|
@@ -13716,14 +13829,14 @@ async function requireOpenArtifacts(name) {
|
|
|
13716
13829
|
}
|
|
13717
13830
|
async function requireDesignEvidence(name) {
|
|
13718
13831
|
const designDoc = await readField3(name, "design_doc");
|
|
13719
|
-
if (!designDoc || designDoc === "null" || !await nonempty3(
|
|
13832
|
+
if (!designDoc || designDoc === "null" || !await nonempty3(path23.resolve(designDoc))) {
|
|
13720
13833
|
fail2(
|
|
13721
13834
|
`ERROR: Cannot transition '${name}': design_doc must point to an existing Design Doc before leaving design`
|
|
13722
13835
|
);
|
|
13723
13836
|
}
|
|
13724
13837
|
}
|
|
13725
13838
|
async function writeSparseTransitionEffects(directory, effects) {
|
|
13726
|
-
const file =
|
|
13839
|
+
const file = path23.join(directory, ".comet.yaml");
|
|
13727
13840
|
const document = await readDocument2(file);
|
|
13728
13841
|
for (const effect of effects) {
|
|
13729
13842
|
const field2 = wireField2(effect.field);
|
|
@@ -13738,7 +13851,7 @@ async function applyTransitionEvent(output, name, event) {
|
|
|
13738
13851
|
let sparse = false;
|
|
13739
13852
|
if (!classic) {
|
|
13740
13853
|
if (projection.run) fail2("ERROR: Classic state projection is missing");
|
|
13741
|
-
const document = await readDocument2(
|
|
13854
|
+
const document = await readDocument2(path23.join(directory, ".comet.yaml"));
|
|
13742
13855
|
classic = sparseClassicState(document.toJS());
|
|
13743
13856
|
sparse = true;
|
|
13744
13857
|
}
|
|
@@ -13785,7 +13898,7 @@ async function transition(output, name, event) {
|
|
|
13785
13898
|
} else if (event === "verify-pass") {
|
|
13786
13899
|
await requirePhase(name, "verify");
|
|
13787
13900
|
const report = await readField3(name, "verification_report");
|
|
13788
|
-
if (!report || !await exists6(
|
|
13901
|
+
if (!report || !await exists6(path23.resolve(report))) {
|
|
13789
13902
|
fail2(
|
|
13790
13903
|
`ERROR: Cannot transition '${name}': verification_report must point to an existing report file`
|
|
13791
13904
|
);
|
|
@@ -13849,9 +13962,9 @@ async function next(output, name) {
|
|
|
13849
13962
|
async function taskCheckoff(output, taskFile, taskText) {
|
|
13850
13963
|
validateRelativePath(taskFile, "task file");
|
|
13851
13964
|
if (!taskText) fail2("ERROR: Task text cannot be empty");
|
|
13852
|
-
const file =
|
|
13965
|
+
const file = path23.resolve(taskFile);
|
|
13853
13966
|
if (!await exists6(file)) fail2(`ERROR: Task file not found: ${taskFile}`);
|
|
13854
|
-
const lines = (await
|
|
13967
|
+
const lines = (await fs22.readFile(file, "utf8")).split(/\r?\n/u);
|
|
13855
13968
|
const matches = lines.filter(
|
|
13856
13969
|
(line) => [`- [ ] ${taskText}`, `- [x] ${taskText}`, `- [X] ${taskText}`].includes(line)
|
|
13857
13970
|
);
|
|
@@ -13889,21 +14002,21 @@ async function check2(output, name, phase) {
|
|
|
13889
14002
|
designDoc ? `design_doc=${designDoc} (expected: empty/null)` : "design_doc is empty/null"
|
|
13890
14003
|
);
|
|
13891
14004
|
for (const artifact of ["proposal.md", "design.md", "tasks.md"]) {
|
|
13892
|
-
(await nonempty3(
|
|
13893
|
-
`${artifact} ${await nonempty3(
|
|
14005
|
+
(await nonempty3(path23.join(directory, artifact)) ? pass2 : reject)(
|
|
14006
|
+
`${artifact} ${await nonempty3(path23.join(directory, artifact)) ? "non-empty" : "missing or empty"}`
|
|
13894
14007
|
);
|
|
13895
14008
|
}
|
|
13896
14009
|
} else if (phase === "build") {
|
|
13897
14010
|
const workflow = await readField3(name, "workflow");
|
|
13898
14011
|
const designDoc = await readField3(name, "design_doc");
|
|
13899
14012
|
if (workflow === "full") {
|
|
13900
|
-
(designDoc && designDoc !== "null" && await exists6(
|
|
14013
|
+
(designDoc && designDoc !== "null" && await exists6(path23.resolve(designDoc)) ? pass2 : reject)(`design_doc=${designDoc} (expected: non-null and file exists)`);
|
|
13901
14014
|
} else {
|
|
13902
14015
|
pass2(`workflow=${workflow} (design_doc not required)`);
|
|
13903
14016
|
}
|
|
13904
14017
|
for (const artifact of ["proposal.md", "tasks.md"]) {
|
|
13905
|
-
(await nonempty3(
|
|
13906
|
-
`${artifact} ${await nonempty3(
|
|
14018
|
+
(await nonempty3(path23.join(directory, artifact)) ? pass2 : reject)(
|
|
14019
|
+
`${artifact} ${await nonempty3(path23.join(directory, artifact)) ? "non-empty" : "missing or empty"}`
|
|
13907
14020
|
);
|
|
13908
14021
|
}
|
|
13909
14022
|
} else if (phase === "verify") {
|
|
@@ -13948,7 +14061,7 @@ async function check2(output, name, phase) {
|
|
|
13948
14061
|
}
|
|
13949
14062
|
function fieldStatus(field2, value, file) {
|
|
13950
14063
|
if (!value || value === "null") return ` - ${field2}: PENDING`;
|
|
13951
|
-
if (file && !existsSync3(
|
|
14064
|
+
if (file && !existsSync3(path23.resolve(file))) {
|
|
13952
14065
|
return ` - ${field2}: BROKEN (path ${value} does not exist)`;
|
|
13953
14066
|
}
|
|
13954
14067
|
return ` - ${field2}: DONE (${value})`;
|
|
@@ -13957,7 +14070,7 @@ async function recoverOpen(output, directory) {
|
|
|
13957
14070
|
output.stdout.push(" Artifacts:");
|
|
13958
14071
|
let complete = 0;
|
|
13959
14072
|
for (const artifact of ["proposal.md", "design.md", "tasks.md"]) {
|
|
13960
|
-
const done = await nonempty3(
|
|
14073
|
+
const done = await nonempty3(path23.join(directory, artifact));
|
|
13961
14074
|
if (done) complete += 1;
|
|
13962
14075
|
output.stdout.push(` - ${artifact}: ${done ? "DONE" : "PENDING"}`);
|
|
13963
14076
|
}
|
|
@@ -13970,7 +14083,7 @@ async function recoverDesign(output, name, directory) {
|
|
|
13970
14083
|
output.stdout.push(" Artifacts:");
|
|
13971
14084
|
for (const artifact of ["proposal.md", "design.md", "tasks.md"]) {
|
|
13972
14085
|
output.stdout.push(
|
|
13973
|
-
` - ${artifact}: ${await nonempty3(
|
|
14086
|
+
` - ${artifact}: ${await nonempty3(path23.join(directory, artifact)) ? "DONE" : "MISSING (unexpected in design phase)"}`
|
|
13974
14087
|
);
|
|
13975
14088
|
}
|
|
13976
14089
|
const handoff = await readField3(name, "handoff_context");
|
|
@@ -13984,11 +14097,11 @@ async function recoverDesign(output, name, directory) {
|
|
|
13984
14097
|
fieldStatus("design_doc", design, design),
|
|
13985
14098
|
""
|
|
13986
14099
|
);
|
|
13987
|
-
if (design && design !== "null" && await exists6(
|
|
14100
|
+
if (design && design !== "null" && await exists6(path23.resolve(design))) {
|
|
13988
14101
|
output.stdout.push(
|
|
13989
14102
|
"Recovery action: Design Doc already created and linked. Run guard to transition to build."
|
|
13990
14103
|
);
|
|
13991
|
-
} else if (handoff && handoff !== "null" && await exists6(
|
|
14104
|
+
} else if (handoff && handoff !== "null" && await exists6(path23.resolve(handoff))) {
|
|
13992
14105
|
output.stdout.push(
|
|
13993
14106
|
"Recovery action: Handoff generated but Design Doc not yet created. Resume from brainstorming confirmation (Step 1c)."
|
|
13994
14107
|
);
|
|
@@ -14018,7 +14131,7 @@ async function recoverBuild(output, name, directory, workflow) {
|
|
|
14018
14131
|
decisions.push(fieldStatus("subagent_dispatch", subagentDispatch));
|
|
14019
14132
|
}
|
|
14020
14133
|
output.stdout.push(...decisions, "", " Plan:", fieldStatus("plan", plan, plan), "");
|
|
14021
|
-
const tasks =
|
|
14134
|
+
const tasks = path23.join(directory, "tasks.md");
|
|
14022
14135
|
if (!await exists6(tasks)) {
|
|
14023
14136
|
output.stdout.push(
|
|
14024
14137
|
" Tasks: tasks.md MISSING",
|
|
@@ -14027,14 +14140,14 @@ async function recoverBuild(output, name, directory, workflow) {
|
|
|
14027
14140
|
);
|
|
14028
14141
|
return;
|
|
14029
14142
|
}
|
|
14030
|
-
const lines = (await
|
|
14143
|
+
const lines = (await fs22.readFile(tasks, "utf8")).split(/\r?\n/u);
|
|
14031
14144
|
const total = lines.filter((line) => /^\s*- \[[ xX]\] /u.test(line)).length;
|
|
14032
14145
|
const done = lines.filter((line) => /^\s*- \[[xX]\] /u.test(line)).length;
|
|
14033
14146
|
const pending = total - done;
|
|
14034
14147
|
let planTotal = 0;
|
|
14035
14148
|
let planDone = 0;
|
|
14036
|
-
if (plan && plan !== "null" && await exists6(
|
|
14037
|
-
const planLines = (await
|
|
14149
|
+
if (plan && plan !== "null" && await exists6(path23.resolve(plan))) {
|
|
14150
|
+
const planLines = (await fs22.readFile(path23.resolve(plan), "utf8")).split(/\r?\n/u);
|
|
14038
14151
|
planTotal = planLines.filter((line) => /^\s*- \[[ xX]\] /u.test(line)).length;
|
|
14039
14152
|
planDone = planLines.filter((line) => /^\s*- \[[xX]\] /u.test(line)).length;
|
|
14040
14153
|
}
|
|
@@ -14165,19 +14278,19 @@ async function scale(output, name) {
|
|
|
14165
14278
|
validateChangeName4(name);
|
|
14166
14279
|
const { file, directory, label } = await stateFile(name);
|
|
14167
14280
|
if (!await exists6(file)) fail2(`ERROR: .comet.yaml not found at ${label}/.comet.yaml`);
|
|
14168
|
-
const tasksFile =
|
|
14169
|
-
const taskCount = await exists6(tasksFile) ? (await
|
|
14170
|
-
const specs =
|
|
14281
|
+
const tasksFile = path23.join(directory, "tasks.md");
|
|
14282
|
+
const taskCount = await exists6(tasksFile) ? (await fs22.readFile(tasksFile, "utf8")).split(/\r?\n/u).filter((line) => /^- \[/u.test(line)).length : 0;
|
|
14283
|
+
const specs = path23.join(directory, "specs");
|
|
14171
14284
|
let deltaSpecs = 0;
|
|
14172
14285
|
if (await exists6(specs)) {
|
|
14173
|
-
for (const entry2 of await
|
|
14174
|
-
if (await exists6(
|
|
14286
|
+
for (const entry2 of await fs22.readdir(specs)) {
|
|
14287
|
+
if (await exists6(path23.join(specs, entry2, "spec.md"))) deltaSpecs += 1;
|
|
14175
14288
|
}
|
|
14176
14289
|
}
|
|
14177
14290
|
const plan = await readField3(name, "plan");
|
|
14178
14291
|
let baseRef = "";
|
|
14179
|
-
if (plan && plan !== "null" && await exists6(
|
|
14180
|
-
const match = (await
|
|
14292
|
+
if (plan && plan !== "null" && await exists6(path23.resolve(plan))) {
|
|
14293
|
+
const match = (await fs22.readFile(path23.resolve(plan), "utf8")).match(/^base-ref:\s*(.+)$/mu);
|
|
14181
14294
|
baseRef = match?.[1].trim() ?? "";
|
|
14182
14295
|
}
|
|
14183
14296
|
if (!baseRef) baseRef = await readField3(name, "base_ref");
|