@rpamis/comet 0.4.0-beta.6 → 0.4.0-beta.8
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/LICENSE +21 -21
- 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 +7855 -0
- package/assets/skills/comet/scripts/comet-hook-router.mjs +10336 -0
- package/assets/skills/comet/scripts/comet-runtime.mjs +615 -501
- 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 +28969 -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/bundle/bundle-platform.d.ts.map +1 -1
- package/dist/domains/bundle/bundle-platform.js +1 -1
- package/dist/domains/bundle/bundle-platform.js.map +1 -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-guard.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-guard.js +3 -2
- package/dist/domains/comet-classic/classic-guard.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 +1180 -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 +179 -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 +184 -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 +200 -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 +449 -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 +887 -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 +355 -0
- package/dist/domains/comet-native/native-evidence-storage.js.map +1 -0
- package/dist/domains/comet-native/native-file-identity.d.ts +9 -0
- package/dist/domains/comet-native/native-file-identity.d.ts.map +1 -0
- package/dist/domains/comet-native/native-file-identity.js +21 -0
- package/dist/domains/comet-native/native-file-identity.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 +398 -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 +510 -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 +452 -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 +2312 -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 +16 -16
- 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/pyproject.toml +4 -4
- 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 +26 -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,8 @@ 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");
|
|
11187
|
+
const lines = new Set(source.split(/\r?\n/u));
|
|
10949
11188
|
const problems = [];
|
|
10950
11189
|
if (!/^Generated-by: comet-handoff\.sh$/mu.test(source)) {
|
|
10951
11190
|
problems.push("handoff markdown is missing Generated-by marker");
|
|
@@ -10955,10 +11194,10 @@ async function designHandoffMarkdownTraceable(changeDir) {
|
|
|
10955
11194
|
}
|
|
10956
11195
|
for (const file of await handoffSourceFiles(changeDir)) {
|
|
10957
11196
|
if (!await exists4(file)) continue;
|
|
10958
|
-
if (!
|
|
11197
|
+
if (!lines.has(`- Source: ${file}`)) {
|
|
10959
11198
|
problems.push(`handoff markdown is missing source reference: ${file}`);
|
|
10960
11199
|
}
|
|
10961
|
-
if (!
|
|
11200
|
+
if (!lines.has(`- SHA256: ${hashFile(file)}`)) {
|
|
10962
11201
|
problems.push(`handoff markdown is missing current sha256 for: ${file}`);
|
|
10963
11202
|
}
|
|
10964
11203
|
}
|
|
@@ -10972,7 +11211,7 @@ async function betaSpecJsonStructurallyValid(changeDir) {
|
|
|
10972
11211
|
const context = await readField(changeDir, "handoff_context");
|
|
10973
11212
|
if (!context || context === "null") return fail("handoff_context is missing from .comet.yaml");
|
|
10974
11213
|
if (!await nonempty(context)) return fail(`spec-context.json is missing or empty: ${context}`);
|
|
10975
|
-
const source = await
|
|
11214
|
+
const source = await fs18.readFile(context, "utf8");
|
|
10976
11215
|
const problems = [];
|
|
10977
11216
|
let parsed;
|
|
10978
11217
|
try {
|
|
@@ -11009,19 +11248,19 @@ async function guardOpenChecks(output, changeDir) {
|
|
|
11009
11248
|
const checks = [
|
|
11010
11249
|
check(
|
|
11011
11250
|
"proposal.md exists and non-empty",
|
|
11012
|
-
async () => await nonempty(
|
|
11251
|
+
async () => await nonempty(path19.join(changeDir, "proposal.md")) ? pass() : fail("")
|
|
11013
11252
|
),
|
|
11014
11253
|
check(
|
|
11015
11254
|
"proposal.md matches configured language",
|
|
11016
|
-
() => documentLanguageMatchesConfigured(changeDir,
|
|
11255
|
+
() => documentLanguageMatchesConfigured(changeDir, path19.join(changeDir, "proposal.md"))
|
|
11017
11256
|
),
|
|
11018
11257
|
check(
|
|
11019
11258
|
"tasks.md exists and non-empty",
|
|
11020
|
-
async () => await nonempty(
|
|
11259
|
+
async () => await nonempty(path19.join(changeDir, "tasks.md")) ? pass() : fail("")
|
|
11021
11260
|
),
|
|
11022
11261
|
check(
|
|
11023
11262
|
"tasks.md matches configured language",
|
|
11024
|
-
() => documentLanguageMatchesConfigured(changeDir,
|
|
11263
|
+
() => documentLanguageMatchesConfigured(changeDir, path19.join(changeDir, "tasks.md"))
|
|
11025
11264
|
),
|
|
11026
11265
|
check(
|
|
11027
11266
|
"tasks.md has at least one task",
|
|
@@ -11034,11 +11273,11 @@ async function guardOpenChecks(output, changeDir) {
|
|
|
11034
11273
|
0,
|
|
11035
11274
|
check(
|
|
11036
11275
|
"design.md exists and non-empty",
|
|
11037
|
-
async () => await nonempty(
|
|
11276
|
+
async () => await nonempty(path19.join(changeDir, "design.md")) ? pass() : fail("")
|
|
11038
11277
|
),
|
|
11039
11278
|
check(
|
|
11040
11279
|
"design.md matches configured language",
|
|
11041
|
-
() => documentLanguageMatchesConfigured(changeDir,
|
|
11280
|
+
() => documentLanguageMatchesConfigured(changeDir, path19.join(changeDir, "design.md"))
|
|
11042
11281
|
)
|
|
11043
11282
|
);
|
|
11044
11283
|
}
|
|
@@ -11050,27 +11289,27 @@ async function guardDesignChecks(output, changeDir, change) {
|
|
|
11050
11289
|
const builders = [
|
|
11051
11290
|
check(
|
|
11052
11291
|
"proposal.md exists",
|
|
11053
|
-
async () => await nonempty(
|
|
11292
|
+
async () => await nonempty(path19.join(changeDir, "proposal.md")) ? pass() : fail("")
|
|
11054
11293
|
),
|
|
11055
11294
|
check(
|
|
11056
11295
|
"proposal.md matches configured language",
|
|
11057
|
-
() => documentLanguageMatchesConfigured(changeDir,
|
|
11296
|
+
() => documentLanguageMatchesConfigured(changeDir, path19.join(changeDir, "proposal.md"))
|
|
11058
11297
|
),
|
|
11059
11298
|
check(
|
|
11060
11299
|
"design.md exists",
|
|
11061
|
-
async () => await nonempty(
|
|
11300
|
+
async () => await nonempty(path19.join(changeDir, "design.md")) ? pass() : fail("")
|
|
11062
11301
|
),
|
|
11063
11302
|
check(
|
|
11064
11303
|
"design.md matches configured language",
|
|
11065
|
-
() => documentLanguageMatchesConfigured(changeDir,
|
|
11304
|
+
() => documentLanguageMatchesConfigured(changeDir, path19.join(changeDir, "design.md"))
|
|
11066
11305
|
),
|
|
11067
11306
|
check(
|
|
11068
11307
|
"tasks.md exists",
|
|
11069
|
-
async () => await nonempty(
|
|
11308
|
+
async () => await nonempty(path19.join(changeDir, "tasks.md")) ? pass() : fail("")
|
|
11070
11309
|
),
|
|
11071
11310
|
check(
|
|
11072
11311
|
"tasks.md matches configured language",
|
|
11073
|
-
() => documentLanguageMatchesConfigured(changeDir,
|
|
11312
|
+
() => documentLanguageMatchesConfigured(changeDir, path19.join(changeDir, "tasks.md"))
|
|
11074
11313
|
),
|
|
11075
11314
|
check("design handoff context exists", () => designHandoffContextValid(changeDir, change)),
|
|
11076
11315
|
check("design handoff markdown is traceable", () => designHandoffMarkdownTraceable(changeDir))
|
|
@@ -11132,11 +11371,11 @@ async function guardBuildChecks(output, changeDir, change, run) {
|
|
|
11132
11371
|
check("Superpowers plan all tasks checked", () => planTasksAllDone(changeDir)),
|
|
11133
11372
|
check(
|
|
11134
11373
|
"proposal.md exists",
|
|
11135
|
-
async () => await nonempty(
|
|
11374
|
+
async () => await nonempty(path19.join(changeDir, "proposal.md")) ? pass() : fail("")
|
|
11136
11375
|
),
|
|
11137
11376
|
check(
|
|
11138
11377
|
"proposal.md matches configured language",
|
|
11139
|
-
() => documentLanguageMatchesConfigured(changeDir,
|
|
11378
|
+
() => documentLanguageMatchesConfigured(changeDir, path19.join(changeDir, "proposal.md"))
|
|
11140
11379
|
),
|
|
11141
11380
|
check("Superpowers plan matches configured language", async () => {
|
|
11142
11381
|
const plan = await readField(changeDir, "plan");
|
|
@@ -11178,11 +11417,11 @@ async function guardArchiveChecks(output, changeDir, change) {
|
|
|
11178
11417
|
check("archived is true", async () => await archivedIsTrue(changeDir) ? pass() : fail("")),
|
|
11179
11418
|
check(
|
|
11180
11419
|
"proposal.md exists",
|
|
11181
|
-
async () => await nonempty(
|
|
11420
|
+
async () => await nonempty(path19.join(changeDir, "proposal.md")) ? pass() : fail("")
|
|
11182
11421
|
),
|
|
11183
11422
|
check(
|
|
11184
11423
|
"design.md exists",
|
|
11185
|
-
async () => await nonempty(
|
|
11424
|
+
async () => await nonempty(path19.join(changeDir, "design.md")) ? pass() : fail("")
|
|
11186
11425
|
),
|
|
11187
11426
|
check("tasks.md all tasks checked", () => tasksAllDone(changeDir)),
|
|
11188
11427
|
check(
|
|
@@ -11272,8 +11511,8 @@ Valid phases: open, design, build, verify, archive`
|
|
|
11272
11511
|
// domains/comet-classic/classic-handoff.ts
|
|
11273
11512
|
var import_yaml7 = __toESM(require_dist(), 1);
|
|
11274
11513
|
import { createHash as createHash5 } from "crypto";
|
|
11275
|
-
import { promises as
|
|
11276
|
-
import
|
|
11514
|
+
import { promises as fs19, readFileSync as readFileSync2 } from "fs";
|
|
11515
|
+
import path20 from "path";
|
|
11277
11516
|
var GREEN4 = "\x1B[32m";
|
|
11278
11517
|
var RED4 = "\x1B[31m";
|
|
11279
11518
|
var YELLOW4 = "\x1B[33m";
|
|
@@ -11307,7 +11546,7 @@ var HandoffOutput = class {
|
|
|
11307
11546
|
};
|
|
11308
11547
|
async function exists5(file) {
|
|
11309
11548
|
try {
|
|
11310
|
-
await
|
|
11549
|
+
await fs19.access(file);
|
|
11311
11550
|
return true;
|
|
11312
11551
|
} catch (error) {
|
|
11313
11552
|
if (error.code === "ENOENT") return false;
|
|
@@ -11316,7 +11555,7 @@ async function exists5(file) {
|
|
|
11316
11555
|
}
|
|
11317
11556
|
async function nonempty2(file) {
|
|
11318
11557
|
try {
|
|
11319
|
-
return (await
|
|
11558
|
+
return (await fs19.stat(file)).size > 0;
|
|
11320
11559
|
} catch (error) {
|
|
11321
11560
|
if (error.code === "ENOENT") return false;
|
|
11322
11561
|
throw error;
|
|
@@ -11345,7 +11584,7 @@ async function handoffSourceFiles2(changeDir) {
|
|
|
11345
11584
|
const files = [`${changeDir}/proposal.md`, `${changeDir}/design.md`, `${changeDir}/tasks.md`];
|
|
11346
11585
|
const specs = `${changeDir}/specs`;
|
|
11347
11586
|
if (await exists5(specs)) {
|
|
11348
|
-
for (const entry2 of (await
|
|
11587
|
+
for (const entry2 of (await fs19.readdir(specs)).sort()) {
|
|
11349
11588
|
const spec = `${specs}/${entry2}/spec.md`;
|
|
11350
11589
|
if (await exists5(spec)) files.push(spec);
|
|
11351
11590
|
}
|
|
@@ -11393,7 +11632,7 @@ async function writeMarkdownContext(changeDir, change, mode, contextHash, output
|
|
|
11393
11632
|
];
|
|
11394
11633
|
for (const file of await handoffSourceFiles2(changeDir)) {
|
|
11395
11634
|
if (!await exists5(file)) continue;
|
|
11396
|
-
const content = await
|
|
11635
|
+
const content = await fs19.readFile(file, "utf8");
|
|
11397
11636
|
const total = lineCount(content);
|
|
11398
11637
|
lines.push(
|
|
11399
11638
|
`## ${file}`,
|
|
@@ -11418,7 +11657,7 @@ async function writeMarkdownContext(changeDir, change, mode, contextHash, output
|
|
|
11418
11657
|
}
|
|
11419
11658
|
lines.push("");
|
|
11420
11659
|
}
|
|
11421
|
-
await
|
|
11660
|
+
await fs19.writeFile(output, lines.join("\n"));
|
|
11422
11661
|
}
|
|
11423
11662
|
async function writeJsonContext(changeDir, change, mode, contextHash, output) {
|
|
11424
11663
|
const entries = [];
|
|
@@ -11441,7 +11680,7 @@ async function writeJsonContext(changeDir, change, mode, contextHash, output) {
|
|
|
11441
11680
|
"}",
|
|
11442
11681
|
""
|
|
11443
11682
|
].join("\n");
|
|
11444
|
-
await
|
|
11683
|
+
await fs19.writeFile(output, document);
|
|
11445
11684
|
}
|
|
11446
11685
|
async function writeSpecProjectionForFile(file, content) {
|
|
11447
11686
|
return [
|
|
@@ -11481,11 +11720,11 @@ async function writeSpecMarkdownContext(changeDir, change, contextHash, output)
|
|
|
11481
11720
|
const specs = `${changeDir}/specs`;
|
|
11482
11721
|
let projected = false;
|
|
11483
11722
|
if (await exists5(specs)) {
|
|
11484
|
-
for (const entry2 of (await
|
|
11723
|
+
for (const entry2 of (await fs19.readdir(specs)).sort()) {
|
|
11485
11724
|
const spec = `${specs}/${entry2}/spec.md`;
|
|
11486
11725
|
if (!await exists5(spec)) continue;
|
|
11487
11726
|
projected = true;
|
|
11488
|
-
lines.push(...await writeSpecProjectionForFile(spec, await
|
|
11727
|
+
lines.push(...await writeSpecProjectionForFile(spec, await fs19.readFile(spec, "utf8")));
|
|
11489
11728
|
}
|
|
11490
11729
|
}
|
|
11491
11730
|
if (!projected) {
|
|
@@ -11494,7 +11733,7 @@ async function writeSpecMarkdownContext(changeDir, change, contextHash, output)
|
|
|
11494
11733
|
lines.push(
|
|
11495
11734
|
"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
11735
|
);
|
|
11497
|
-
await
|
|
11736
|
+
await fs19.writeFile(output, lines.join("\n"));
|
|
11498
11737
|
}
|
|
11499
11738
|
async function writeSpecJsonContext(changeDir, change, contextHash, output) {
|
|
11500
11739
|
const entries = [];
|
|
@@ -11503,7 +11742,7 @@ async function writeSpecJsonContext(changeDir, change, contextHash, output) {
|
|
|
11503
11742
|
const role = /\/specs\/[^/]+\/spec\.md$/u.test(file) ? "spec" : "supporting";
|
|
11504
11743
|
entries.push({ path: file, sha256: hashFile2(file), role });
|
|
11505
11744
|
}
|
|
11506
|
-
await
|
|
11745
|
+
await fs19.writeFile(
|
|
11507
11746
|
output,
|
|
11508
11747
|
`${JSON.stringify(
|
|
11509
11748
|
{
|
|
@@ -11522,8 +11761,8 @@ async function writeSpecJsonContext(changeDir, change, contextHash, output) {
|
|
|
11522
11761
|
);
|
|
11523
11762
|
}
|
|
11524
11763
|
async function readField2(changeDir, field2) {
|
|
11525
|
-
const file =
|
|
11526
|
-
const document = (0, import_yaml7.parseDocument)(await
|
|
11764
|
+
const file = path20.join(changeDir, ".comet.yaml");
|
|
11765
|
+
const document = (0, import_yaml7.parseDocument)(await fs19.readFile(file, "utf8"), { uniqueKeys: false });
|
|
11527
11766
|
if (document.errors.length > 0) {
|
|
11528
11767
|
throw new HandoffFailure(`ERROR: Invalid .comet.yaml: ${document.errors[0].message}`);
|
|
11529
11768
|
}
|
|
@@ -11557,7 +11796,7 @@ async function completedHandoffIsCurrent(changeDir, run, contextHash, contextJso
|
|
|
11557
11796
|
readCheckpoint(changeDir, run.checkpointRef)
|
|
11558
11797
|
]);
|
|
11559
11798
|
if (!await exists5(contextJson) || !await exists5(contextMd)) return false;
|
|
11560
|
-
if (context !== await
|
|
11799
|
+
if (context !== await fs19.readFile(contextMd, "utf8")) return false;
|
|
11561
11800
|
if (artifacts.handoff_context !== contextJson || artifacts.handoff_markdown !== contextMd) {
|
|
11562
11801
|
return false;
|
|
11563
11802
|
}
|
|
@@ -11680,7 +11919,7 @@ var classicHandoffCommand = async (args) => {
|
|
|
11680
11919
|
run: pendingRun,
|
|
11681
11920
|
unknownKeys: (await readClassicState(changeDir)).unknownKeys
|
|
11682
11921
|
});
|
|
11683
|
-
await
|
|
11922
|
+
await fs19.mkdir(handoffDir, { recursive: true });
|
|
11684
11923
|
if (handoffMode === "beta") {
|
|
11685
11924
|
await writeSpecMarkdownContext(changeDir, change, contextHash, contextMd);
|
|
11686
11925
|
await writeSpecJsonContext(changeDir, change, contextHash, contextJson);
|
|
@@ -11688,7 +11927,7 @@ var classicHandoffCommand = async (args) => {
|
|
|
11688
11927
|
await writeMarkdownContext(changeDir, change, handoffMode, contextHash, contextMd);
|
|
11689
11928
|
await writeJsonContext(changeDir, change, handoffMode, contextHash, contextJson);
|
|
11690
11929
|
}
|
|
11691
|
-
const context = await
|
|
11930
|
+
const context = await fs19.readFile(contextMd, "utf8");
|
|
11692
11931
|
await writeContext(changeDir, pendingRun.contextRef, context);
|
|
11693
11932
|
const artifacts = {
|
|
11694
11933
|
...await readArtifacts(changeDir, pendingRun.artifactsRef),
|
|
@@ -11745,152 +11984,8 @@ var classicHandoffCommand = async (args) => {
|
|
|
11745
11984
|
};
|
|
11746
11985
|
|
|
11747
11986
|
// 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
|
|
11987
|
+
import { existsSync as existsSync2, promises as fs20, readFileSync as readFileSync3 } from "fs";
|
|
11988
|
+
import path21 from "path";
|
|
11894
11989
|
function result(exitCode, message) {
|
|
11895
11990
|
return { exitCode, stderr: message + "\n" };
|
|
11896
11991
|
}
|
|
@@ -11919,52 +12014,52 @@ function comparisonKey(value) {
|
|
|
11919
12014
|
function parseProjectRoot(args) {
|
|
11920
12015
|
const index = args.indexOf("--project-root");
|
|
11921
12016
|
const value = index >= 0 ? args[index + 1] : void 0;
|
|
11922
|
-
return
|
|
12017
|
+
return path21.resolve(value && !value.startsWith("--") ? value : process.cwd());
|
|
11923
12018
|
}
|
|
11924
12019
|
function relativeToProjectRoot(target, projectRoot2) {
|
|
11925
|
-
const relative = normalized(
|
|
12020
|
+
const relative = normalized(path21.relative(projectRoot2, target));
|
|
11926
12021
|
if (relative === "") return "";
|
|
11927
|
-
if (relative.startsWith("../") || relative === ".." ||
|
|
12022
|
+
if (relative.startsWith("../") || relative === ".." || path21.isAbsolute(relative)) return null;
|
|
11928
12023
|
return relative;
|
|
11929
12024
|
}
|
|
11930
12025
|
async function physicalPathForPossiblyMissingTarget(target) {
|
|
11931
|
-
const resolved =
|
|
11932
|
-
const root =
|
|
12026
|
+
const resolved = path21.resolve(target);
|
|
12027
|
+
const root = path21.parse(resolved).root;
|
|
11933
12028
|
const missingSegments = [];
|
|
11934
12029
|
let cursor = resolved;
|
|
11935
12030
|
while (cursor && cursor !== root) {
|
|
11936
12031
|
try {
|
|
11937
|
-
const physicalBase = await
|
|
11938
|
-
return
|
|
12032
|
+
const physicalBase = await fs20.realpath(cursor);
|
|
12033
|
+
return path21.join(physicalBase, ...missingSegments.reverse());
|
|
11939
12034
|
} catch (error) {
|
|
11940
12035
|
const code = error.code;
|
|
11941
12036
|
if (code !== "ENOENT" && code !== "ENOTDIR") throw error;
|
|
11942
|
-
missingSegments.push(
|
|
11943
|
-
cursor =
|
|
12037
|
+
missingSegments.push(path21.basename(cursor));
|
|
12038
|
+
cursor = path21.dirname(cursor);
|
|
11944
12039
|
}
|
|
11945
12040
|
}
|
|
11946
12041
|
try {
|
|
11947
|
-
const physicalRoot = await
|
|
11948
|
-
return
|
|
12042
|
+
const physicalRoot = await fs20.realpath(root);
|
|
12043
|
+
return path21.join(physicalRoot, ...missingSegments.reverse());
|
|
11949
12044
|
} catch {
|
|
11950
12045
|
return null;
|
|
11951
12046
|
}
|
|
11952
12047
|
}
|
|
11953
12048
|
async function projectRelative(target, projectRoot2) {
|
|
11954
|
-
const rawCandidate =
|
|
12049
|
+
const rawCandidate = path21.isAbsolute(target) ? target : path21.resolve(process.cwd(), target);
|
|
11955
12050
|
let candidate = normalized(rawCandidate);
|
|
11956
12051
|
const rootRelative = relativeToProjectRoot(rawCandidate, projectRoot2);
|
|
11957
12052
|
if (rootRelative !== null) return rootRelative;
|
|
11958
12053
|
try {
|
|
11959
12054
|
const physicalCandidate = await physicalPathForPossiblyMissingTarget(rawCandidate);
|
|
11960
|
-
const physicalRoot = await
|
|
12055
|
+
const physicalRoot = await fs20.realpath(projectRoot2);
|
|
11961
12056
|
if (physicalCandidate) {
|
|
11962
12057
|
const physicalRootRelative = relativeToProjectRoot(physicalCandidate, physicalRoot);
|
|
11963
12058
|
if (physicalRootRelative !== null) return physicalRootRelative;
|
|
11964
12059
|
candidate = normalized(physicalCandidate);
|
|
11965
12060
|
}
|
|
11966
12061
|
} catch {
|
|
11967
|
-
if (!
|
|
12062
|
+
if (!path21.isAbsolute(target)) return normalized(target).replace(/^\.\//u, "");
|
|
11968
12063
|
}
|
|
11969
12064
|
return candidate.replace(/^\.\//u, "");
|
|
11970
12065
|
}
|
|
@@ -11994,15 +12089,15 @@ async function loadGoverningChange(changeDir) {
|
|
|
11994
12089
|
}
|
|
11995
12090
|
}
|
|
11996
12091
|
async function activeChanges(projectRoot2) {
|
|
11997
|
-
const changesDir =
|
|
12092
|
+
const changesDir = path21.join(projectRoot2, "openspec", "changes");
|
|
11998
12093
|
const governingChanges = [];
|
|
11999
12094
|
if (!existsSync2(changesDir)) return governingChanges;
|
|
12000
|
-
for (const entry2 of (await
|
|
12095
|
+
for (const entry2 of (await fs20.readdir(changesDir, { withFileTypes: true })).sort(
|
|
12001
12096
|
(left, right) => left.name.localeCompare(right.name)
|
|
12002
12097
|
)) {
|
|
12003
12098
|
if (!entry2.isDirectory() || entry2.name === "archive") continue;
|
|
12004
|
-
const changeDir =
|
|
12005
|
-
if (!existsSync2(
|
|
12099
|
+
const changeDir = path21.join(changesDir, entry2.name);
|
|
12100
|
+
if (!existsSync2(path21.join(changeDir, ".comet.yaml"))) continue;
|
|
12006
12101
|
const governing = await loadGoverningChange(changeDir);
|
|
12007
12102
|
if (!governing || governing.archived) continue;
|
|
12008
12103
|
governingChanges.push(governing);
|
|
@@ -12050,7 +12145,7 @@ function allowsSuperpowersArtifacts(governing) {
|
|
|
12050
12145
|
return governing.phase === "design" || governing.phase === "build" || governing.phase === "verify";
|
|
12051
12146
|
}
|
|
12052
12147
|
function governingChangeName(governing) {
|
|
12053
|
-
return governing.changeDir ?
|
|
12148
|
+
return governing.changeDir ? path21.basename(governing.changeDir) : null;
|
|
12054
12149
|
}
|
|
12055
12150
|
var SUPERPOWERS_ARTIFACT_SUFFIXES = /* @__PURE__ */ new Set([
|
|
12056
12151
|
"design",
|
|
@@ -12097,9 +12192,20 @@ async function superpowersArtifactGoverningChange(relativePath2, projectRoot2) {
|
|
|
12097
12192
|
if (named) return { governing: named, match: "named" };
|
|
12098
12193
|
return null;
|
|
12099
12194
|
}
|
|
12100
|
-
async function repoSourceGoverningChange(projectRoot2, relativePath2) {
|
|
12195
|
+
async function repoSourceGoverningChange(projectRoot2, relativePath2, selectedChangeName) {
|
|
12101
12196
|
const active = await activeChanges(projectRoot2);
|
|
12102
12197
|
if (active.length === 0) return null;
|
|
12198
|
+
if (selectedChangeName) {
|
|
12199
|
+
const selected = active.find(
|
|
12200
|
+
(governing) => governingChangeName(governing) === selectedChangeName
|
|
12201
|
+
);
|
|
12202
|
+
return selected ?? {
|
|
12203
|
+
blockedResult: blockedStaleSelection(
|
|
12204
|
+
relativePath2,
|
|
12205
|
+
`selected change '${selectedChangeName}' is no longer active`
|
|
12206
|
+
)
|
|
12207
|
+
};
|
|
12208
|
+
}
|
|
12103
12209
|
const current = await resolveCurrentChange(projectRoot2);
|
|
12104
12210
|
if (current.status === "stale") {
|
|
12105
12211
|
return { blockedResult: blockedStaleSelection(relativePath2, current.reason) };
|
|
@@ -12147,14 +12253,14 @@ async function repoSourceGoverningChange(projectRoot2, relativePath2) {
|
|
|
12147
12253
|
)
|
|
12148
12254
|
};
|
|
12149
12255
|
}
|
|
12150
|
-
async function governingChange(relativePath2, projectRoot2) {
|
|
12256
|
+
async function governingChange(relativePath2, projectRoot2, selectedChangeName) {
|
|
12151
12257
|
const prefix = "openspec/changes/";
|
|
12152
12258
|
if (relativePath2.startsWith(prefix)) {
|
|
12153
12259
|
const rest = relativePath2.slice(prefix.length);
|
|
12154
12260
|
const [name] = rest.split("/");
|
|
12155
12261
|
if (name && name !== "archive") {
|
|
12156
|
-
const changeDir =
|
|
12157
|
-
const stateFile2 =
|
|
12262
|
+
const changeDir = path21.join(projectRoot2, "openspec", "changes", name);
|
|
12263
|
+
const stateFile2 = path21.join(changeDir, ".comet.yaml");
|
|
12158
12264
|
if (existsSync2(stateFile2)) {
|
|
12159
12265
|
const governing = await loadGoverningChange(changeDir);
|
|
12160
12266
|
if (governing) return governing;
|
|
@@ -12177,7 +12283,11 @@ async function governingChange(relativePath2, projectRoot2) {
|
|
|
12177
12283
|
} : { ...superpowers.governing, superpowersArtifact: "matched" };
|
|
12178
12284
|
}
|
|
12179
12285
|
if (slot) {
|
|
12180
|
-
const candidate = await repoSourceGoverningChange(
|
|
12286
|
+
const candidate = await repoSourceGoverningChange(
|
|
12287
|
+
projectRoot2,
|
|
12288
|
+
relativePath2,
|
|
12289
|
+
selectedChangeName
|
|
12290
|
+
);
|
|
12181
12291
|
if (!candidate || "blockedResult" in candidate) return candidate;
|
|
12182
12292
|
return {
|
|
12183
12293
|
...candidate,
|
|
@@ -12185,10 +12295,11 @@ async function governingChange(relativePath2, projectRoot2) {
|
|
|
12185
12295
|
superpowersSlot: slot
|
|
12186
12296
|
};
|
|
12187
12297
|
}
|
|
12188
|
-
const
|
|
12298
|
+
const active = await activeChanges(projectRoot2);
|
|
12299
|
+
const fallback = selectedChangeName ? active.find((candidate) => governingChangeName(candidate) === selectedChangeName) ?? null : active[0] ?? null;
|
|
12189
12300
|
return fallback ? { ...fallback, superpowersArtifact: "unmatched" } : null;
|
|
12190
12301
|
}
|
|
12191
|
-
return repoSourceGoverningChange(projectRoot2, relativePath2);
|
|
12302
|
+
return repoSourceGoverningChange(projectRoot2, relativePath2, selectedChangeName);
|
|
12192
12303
|
}
|
|
12193
12304
|
function isRootMarkdown(relativePath2) {
|
|
12194
12305
|
return !relativePath2.includes("/") && relativePath2.endsWith(".md");
|
|
@@ -12344,10 +12455,7 @@ function blockedStaleSelection(relativePath2, reason) {
|
|
|
12344
12455
|
].join("\n")
|
|
12345
12456
|
);
|
|
12346
12457
|
}
|
|
12347
|
-
|
|
12348
|
-
const projectRoot2 = parseProjectRoot(args);
|
|
12349
|
-
const target = inputTarget();
|
|
12350
|
-
if (!target) return allowed("no file path in tool input");
|
|
12458
|
+
async function inspectClassicHookTarget(projectRoot2, target, selectedChangeName) {
|
|
12351
12459
|
const relativePath2 = await projectRelative(target, projectRoot2);
|
|
12352
12460
|
if (isCometConfig(relativePath2)) {
|
|
12353
12461
|
return allowed(`${relativePath2} (whitelist: comet config)`);
|
|
@@ -12363,7 +12471,7 @@ var classicHookGuardCommand = async (args) => {
|
|
|
12363
12471
|
}
|
|
12364
12472
|
let governing;
|
|
12365
12473
|
try {
|
|
12366
|
-
governing = await governingChange(relativePath2, projectRoot2);
|
|
12474
|
+
governing = await governingChange(relativePath2, projectRoot2, selectedChangeName);
|
|
12367
12475
|
} catch (error) {
|
|
12368
12476
|
return result(
|
|
12369
12477
|
2,
|
|
@@ -12391,6 +12499,12 @@ var classicHookGuardCommand = async (args) => {
|
|
|
12391
12499
|
return allowed(`${relativePath2} (phase: ${phase})`);
|
|
12392
12500
|
}
|
|
12393
12501
|
return blocked(relativePath2, phase);
|
|
12502
|
+
}
|
|
12503
|
+
var classicHookGuardCommand = async (args) => {
|
|
12504
|
+
const projectRoot2 = parseProjectRoot(args);
|
|
12505
|
+
const target = inputTarget();
|
|
12506
|
+
if (!target) return allowed("no file path in tool input");
|
|
12507
|
+
return inspectClassicHookTarget(projectRoot2, target);
|
|
12394
12508
|
};
|
|
12395
12509
|
|
|
12396
12510
|
// domains/comet-classic/classic-intent.ts
|
|
@@ -12446,7 +12560,7 @@ ${issues.map((issue) => `- ${issue}`).join("\n")}`);
|
|
|
12446
12560
|
}
|
|
12447
12561
|
issues;
|
|
12448
12562
|
};
|
|
12449
|
-
function
|
|
12563
|
+
function isRecord2(value) {
|
|
12450
12564
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12451
12565
|
}
|
|
12452
12566
|
function enumValue2(value, allowed2, field2, issues) {
|
|
@@ -12499,15 +12613,15 @@ function nonNegativeIntegerValue(value, field2, issues) {
|
|
|
12499
12613
|
}
|
|
12500
12614
|
function validateFrame(input) {
|
|
12501
12615
|
const issues = [];
|
|
12502
|
-
if (!
|
|
12503
|
-
const intent =
|
|
12504
|
-
if (!
|
|
12505
|
-
const slots =
|
|
12506
|
-
if (!
|
|
12507
|
-
const context =
|
|
12508
|
-
if (!
|
|
12509
|
-
const proposedRouteInput =
|
|
12510
|
-
if (!
|
|
12616
|
+
if (!isRecord2(input)) throw new CometIntentValidationError(["frame must be an object"]);
|
|
12617
|
+
const intent = isRecord2(input.intent) ? input.intent : {};
|
|
12618
|
+
if (!isRecord2(input.intent)) issues.push("intent must be an object");
|
|
12619
|
+
const slots = isRecord2(input.slots) ? input.slots : {};
|
|
12620
|
+
if (!isRecord2(input.slots)) issues.push("slots must be an object");
|
|
12621
|
+
const context = isRecord2(input.context) ? input.context : {};
|
|
12622
|
+
if (!isRecord2(input.context)) issues.push("context must be an object");
|
|
12623
|
+
const proposedRouteInput = isRecord2(input.proposed_route) ? input.proposed_route : {};
|
|
12624
|
+
if (!isRecord2(input.proposed_route)) issues.push("proposed_route must be an object");
|
|
12511
12625
|
const entities = input.entities === void 0 ? [] : Array.isArray(input.entities) ? input.entities : [];
|
|
12512
12626
|
if (input.entities !== void 0 && !Array.isArray(input.entities)) {
|
|
12513
12627
|
issues.push("entities must be an array");
|
|
@@ -12528,8 +12642,8 @@ function validateFrame(input) {
|
|
|
12528
12642
|
confidence: confidenceValue(intent.confidence, "intent.confidence", issues)
|
|
12529
12643
|
},
|
|
12530
12644
|
entities: entities.map((entity, index) => {
|
|
12531
|
-
const record =
|
|
12532
|
-
if (!
|
|
12645
|
+
const record = isRecord2(entity) ? entity : {};
|
|
12646
|
+
if (!isRecord2(entity)) issues.push(`entities[${index}] must be an object`);
|
|
12533
12647
|
return {
|
|
12534
12648
|
type: enumValue2(record.type, ENTITY_TYPES, `entities[${index}].type`, issues) ?? "risk_signal",
|
|
12535
12649
|
value: stringValue(record.value, `entities[${index}].value`, issues),
|
|
@@ -12577,7 +12691,7 @@ function validateFrame(input) {
|
|
|
12577
12691
|
"context.active_changes_count",
|
|
12578
12692
|
issues
|
|
12579
12693
|
),
|
|
12580
|
-
active_change_names:
|
|
12694
|
+
active_change_names: isRecord2(context) ? (() => {
|
|
12581
12695
|
if (!Array.isArray(context.active_change_names)) {
|
|
12582
12696
|
issues.push("context.active_change_names must be an array");
|
|
12583
12697
|
return [];
|
|
@@ -12595,8 +12709,8 @@ function validateFrame(input) {
|
|
|
12595
12709
|
)
|
|
12596
12710
|
},
|
|
12597
12711
|
evidence: evidence.map((item, index) => {
|
|
12598
|
-
const record =
|
|
12599
|
-
if (!
|
|
12712
|
+
const record = isRecord2(item) ? item : {};
|
|
12713
|
+
if (!isRecord2(item)) issues.push(`evidence[${index}] must be an object`);
|
|
12600
12714
|
return {
|
|
12601
12715
|
field: stringValue(record.field, `evidence[${index}].field`, issues),
|
|
12602
12716
|
quote: stringValue(record.quote, `evidence[${index}].quote`, issues),
|
|
@@ -12762,15 +12876,15 @@ var classicIntentCommand = async (args, _options) => {
|
|
|
12762
12876
|
};
|
|
12763
12877
|
|
|
12764
12878
|
// domains/comet-classic/classic-resume-probe.ts
|
|
12765
|
-
import
|
|
12766
|
-
import { promises as
|
|
12879
|
+
import path22 from "path";
|
|
12880
|
+
import { promises as fs21 } from "fs";
|
|
12767
12881
|
import { spawn } from "child_process";
|
|
12768
12882
|
var COMET_RESUME_PROBE_SCHEMA_VERSION = "comet.resume_probe.v1";
|
|
12769
|
-
function
|
|
12883
|
+
function isRecord3(value) {
|
|
12770
12884
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12771
12885
|
}
|
|
12772
12886
|
function normalizeInput(input) {
|
|
12773
|
-
if (!
|
|
12887
|
+
if (!isRecord3(input)) {
|
|
12774
12888
|
throw new Error("Invalid CometResumeProbeInput: input must be an object");
|
|
12775
12889
|
}
|
|
12776
12890
|
if (input.schema_version !== COMET_RESUME_PROBE_SCHEMA_VERSION) {
|
|
@@ -12781,7 +12895,7 @@ function normalizeInput(input) {
|
|
|
12781
12895
|
if (typeof input.utterance !== "string") {
|
|
12782
12896
|
throw new Error("Invalid CometResumeProbeInput: utterance must be a string");
|
|
12783
12897
|
}
|
|
12784
|
-
const context =
|
|
12898
|
+
const context = isRecord3(input.agent_context) ? input.agent_context : {};
|
|
12785
12899
|
return {
|
|
12786
12900
|
schema_version: COMET_RESUME_PROBE_SCHEMA_VERSION,
|
|
12787
12901
|
utterance: input.utterance,
|
|
@@ -12806,13 +12920,13 @@ function result3(action, change, confidence, reason, evidence = []) {
|
|
|
12806
12920
|
}
|
|
12807
12921
|
async function readIfExists(filePath) {
|
|
12808
12922
|
if (!await fileExists3(filePath)) return "";
|
|
12809
|
-
return
|
|
12923
|
+
return fs21.readFile(filePath, "utf8");
|
|
12810
12924
|
}
|
|
12811
12925
|
async function changeSearchText(changeDir, classic) {
|
|
12812
12926
|
const files = ["proposal.md", "design.md", "tasks.md"];
|
|
12813
12927
|
const parts = [classic.name, classic.workflow, classic.phase];
|
|
12814
12928
|
for (const file of files) {
|
|
12815
|
-
parts.push(await readIfExists(
|
|
12929
|
+
parts.push(await readIfExists(path22.join(changeDir, file)));
|
|
12816
12930
|
}
|
|
12817
12931
|
return parts.join("\n").toLowerCase();
|
|
12818
12932
|
}
|
|
@@ -12876,19 +12990,19 @@ function diagnosticFromProjection(changeDir, name, projection) {
|
|
|
12876
12990
|
};
|
|
12877
12991
|
}
|
|
12878
12992
|
async function hasOpenSpecChangeFiles(changeDir) {
|
|
12879
|
-
return await fileExists3(
|
|
12993
|
+
return await fileExists3(path22.join(changeDir, "proposal.md")) || await fileExists3(path22.join(changeDir, "design.md")) || await fileExists3(path22.join(changeDir, "tasks.md"));
|
|
12880
12994
|
}
|
|
12881
12995
|
async function discoverActiveChanges(projectRoot2) {
|
|
12882
|
-
const changesDir =
|
|
12996
|
+
const changesDir = path22.join(projectRoot2, "openspec", "changes");
|
|
12883
12997
|
if (!await fileExists3(changesDir)) return [];
|
|
12884
12998
|
const entries = await readDir(changesDir);
|
|
12885
12999
|
const changes = [];
|
|
12886
13000
|
for (const entry2 of entries) {
|
|
12887
13001
|
if (entry2 === "archive") continue;
|
|
12888
|
-
const changeDir =
|
|
12889
|
-
const stat = await
|
|
13002
|
+
const changeDir = path22.join(changesDir, entry2);
|
|
13003
|
+
const stat = await fs21.stat(changeDir).catch(() => null);
|
|
12890
13004
|
if (!stat?.isDirectory()) continue;
|
|
12891
|
-
const hasCometState = await fileExists3(
|
|
13005
|
+
const hasCometState = await fileExists3(path22.join(changeDir, ".comet.yaml"));
|
|
12892
13006
|
if (!hasCometState) {
|
|
12893
13007
|
if (!await hasOpenSpecChangeFiles(changeDir)) continue;
|
|
12894
13008
|
const missingStateChange = {
|
|
@@ -13191,8 +13305,8 @@ var classicResumeProbeCommand = async (args) => {
|
|
|
13191
13305
|
var import_yaml8 = __toESM(require_dist(), 1);
|
|
13192
13306
|
import { spawnSync as spawnSync3 } from "child_process";
|
|
13193
13307
|
import { randomUUID as randomUUID8 } from "crypto";
|
|
13194
|
-
import { existsSync as existsSync3, promises as
|
|
13195
|
-
import
|
|
13308
|
+
import { existsSync as existsSync3, promises as fs22 } from "fs";
|
|
13309
|
+
import path23 from "path";
|
|
13196
13310
|
init_state();
|
|
13197
13311
|
var GREEN5 = "\x1B[32m";
|
|
13198
13312
|
var RED5 = "\x1B[31m";
|
|
@@ -13306,7 +13420,7 @@ function validateRelativePath(value, field2) {
|
|
|
13306
13420
|
}
|
|
13307
13421
|
async function exists6(file) {
|
|
13308
13422
|
try {
|
|
13309
|
-
await
|
|
13423
|
+
await fs22.access(file);
|
|
13310
13424
|
return true;
|
|
13311
13425
|
} catch (error) {
|
|
13312
13426
|
if (error.code === "ENOENT") return false;
|
|
@@ -13315,7 +13429,7 @@ async function exists6(file) {
|
|
|
13315
13429
|
}
|
|
13316
13430
|
async function nonempty3(file) {
|
|
13317
13431
|
try {
|
|
13318
|
-
return (await
|
|
13432
|
+
return (await fs22.stat(file)).size > 0;
|
|
13319
13433
|
} catch (error) {
|
|
13320
13434
|
if (error.code === "ENOENT") return false;
|
|
13321
13435
|
throw error;
|
|
@@ -13327,11 +13441,11 @@ async function changeDirectory2(name) {
|
|
|
13327
13441
|
async function readDocument2(file) {
|
|
13328
13442
|
let source;
|
|
13329
13443
|
try {
|
|
13330
|
-
source = await
|
|
13444
|
+
source = await fs22.readFile(file, "utf8");
|
|
13331
13445
|
} catch (error) {
|
|
13332
13446
|
if (error.code === "ENOENT") {
|
|
13333
13447
|
fail2(
|
|
13334
|
-
`ERROR: .comet.yaml not found at ${
|
|
13448
|
+
`ERROR: .comet.yaml not found at ${path23.relative(process.cwd(), file).replaceAll("\\", "/")}`
|
|
13335
13449
|
);
|
|
13336
13450
|
}
|
|
13337
13451
|
throw error;
|
|
@@ -13341,13 +13455,13 @@ async function readDocument2(file) {
|
|
|
13341
13455
|
return document;
|
|
13342
13456
|
}
|
|
13343
13457
|
async function atomicWrite2(file, content) {
|
|
13344
|
-
await
|
|
13458
|
+
await fs22.mkdir(path23.dirname(file), { recursive: true });
|
|
13345
13459
|
const temporary = `${file}.${randomUUID8()}.tmp`;
|
|
13346
13460
|
try {
|
|
13347
|
-
await
|
|
13348
|
-
await
|
|
13461
|
+
await fs22.writeFile(temporary, content, "utf8");
|
|
13462
|
+
await fs22.rename(temporary, file);
|
|
13349
13463
|
} catch (error) {
|
|
13350
|
-
await
|
|
13464
|
+
await fs22.rm(temporary, { force: true });
|
|
13351
13465
|
throw error;
|
|
13352
13466
|
}
|
|
13353
13467
|
}
|
|
@@ -13490,7 +13604,7 @@ async function stateFile(name) {
|
|
|
13490
13604
|
const change = await changeDirectory2(name);
|
|
13491
13605
|
return {
|
|
13492
13606
|
...change,
|
|
13493
|
-
file:
|
|
13607
|
+
file: path23.join(change.directory, ".comet.yaml")
|
|
13494
13608
|
};
|
|
13495
13609
|
}
|
|
13496
13610
|
async function readField3(name, field2) {
|
|
@@ -13621,7 +13735,7 @@ async function init(output, name, workflow) {
|
|
|
13621
13735
|
validateEnum(workflow, PROFILES);
|
|
13622
13736
|
const { file, label, directory } = await stateFile(name);
|
|
13623
13737
|
if (await exists6(file)) fail2(`ERROR: .comet.yaml already exists at ${label}/.comet.yaml`);
|
|
13624
|
-
await
|
|
13738
|
+
await fs22.mkdir(directory, { recursive: true });
|
|
13625
13739
|
const preset = workflow !== "full";
|
|
13626
13740
|
const reviewMode = preset ? "off" : await reviewModeDefault();
|
|
13627
13741
|
const document = new import_yaml8.Document({
|
|
@@ -13702,13 +13816,13 @@ async function requireOpenArtifacts(name) {
|
|
|
13702
13816
|
const { directory } = await stateFile(name);
|
|
13703
13817
|
const workflow = await readField3(name, "workflow");
|
|
13704
13818
|
for (const artifact of ["proposal.md", "tasks.md"]) {
|
|
13705
|
-
if (!await nonempty3(
|
|
13819
|
+
if (!await nonempty3(path23.join(directory, artifact))) {
|
|
13706
13820
|
fail2(
|
|
13707
13821
|
`ERROR: Cannot transition '${name}': ${artifact} must exist and be non-empty before leaving open`
|
|
13708
13822
|
);
|
|
13709
13823
|
}
|
|
13710
13824
|
}
|
|
13711
|
-
if (workflow === "full" && !await nonempty3(
|
|
13825
|
+
if (workflow === "full" && !await nonempty3(path23.join(directory, "design.md"))) {
|
|
13712
13826
|
fail2(
|
|
13713
13827
|
`ERROR: Cannot transition '${name}': design.md must exist and be non-empty before leaving open`
|
|
13714
13828
|
);
|
|
@@ -13716,14 +13830,14 @@ async function requireOpenArtifacts(name) {
|
|
|
13716
13830
|
}
|
|
13717
13831
|
async function requireDesignEvidence(name) {
|
|
13718
13832
|
const designDoc = await readField3(name, "design_doc");
|
|
13719
|
-
if (!designDoc || designDoc === "null" || !await nonempty3(
|
|
13833
|
+
if (!designDoc || designDoc === "null" || !await nonempty3(path23.resolve(designDoc))) {
|
|
13720
13834
|
fail2(
|
|
13721
13835
|
`ERROR: Cannot transition '${name}': design_doc must point to an existing Design Doc before leaving design`
|
|
13722
13836
|
);
|
|
13723
13837
|
}
|
|
13724
13838
|
}
|
|
13725
13839
|
async function writeSparseTransitionEffects(directory, effects) {
|
|
13726
|
-
const file =
|
|
13840
|
+
const file = path23.join(directory, ".comet.yaml");
|
|
13727
13841
|
const document = await readDocument2(file);
|
|
13728
13842
|
for (const effect of effects) {
|
|
13729
13843
|
const field2 = wireField2(effect.field);
|
|
@@ -13738,7 +13852,7 @@ async function applyTransitionEvent(output, name, event) {
|
|
|
13738
13852
|
let sparse = false;
|
|
13739
13853
|
if (!classic) {
|
|
13740
13854
|
if (projection.run) fail2("ERROR: Classic state projection is missing");
|
|
13741
|
-
const document = await readDocument2(
|
|
13855
|
+
const document = await readDocument2(path23.join(directory, ".comet.yaml"));
|
|
13742
13856
|
classic = sparseClassicState(document.toJS());
|
|
13743
13857
|
sparse = true;
|
|
13744
13858
|
}
|
|
@@ -13785,7 +13899,7 @@ async function transition(output, name, event) {
|
|
|
13785
13899
|
} else if (event === "verify-pass") {
|
|
13786
13900
|
await requirePhase(name, "verify");
|
|
13787
13901
|
const report = await readField3(name, "verification_report");
|
|
13788
|
-
if (!report || !await exists6(
|
|
13902
|
+
if (!report || !await exists6(path23.resolve(report))) {
|
|
13789
13903
|
fail2(
|
|
13790
13904
|
`ERROR: Cannot transition '${name}': verification_report must point to an existing report file`
|
|
13791
13905
|
);
|
|
@@ -13849,9 +13963,9 @@ async function next(output, name) {
|
|
|
13849
13963
|
async function taskCheckoff(output, taskFile, taskText) {
|
|
13850
13964
|
validateRelativePath(taskFile, "task file");
|
|
13851
13965
|
if (!taskText) fail2("ERROR: Task text cannot be empty");
|
|
13852
|
-
const file =
|
|
13966
|
+
const file = path23.resolve(taskFile);
|
|
13853
13967
|
if (!await exists6(file)) fail2(`ERROR: Task file not found: ${taskFile}`);
|
|
13854
|
-
const lines = (await
|
|
13968
|
+
const lines = (await fs22.readFile(file, "utf8")).split(/\r?\n/u);
|
|
13855
13969
|
const matches = lines.filter(
|
|
13856
13970
|
(line) => [`- [ ] ${taskText}`, `- [x] ${taskText}`, `- [X] ${taskText}`].includes(line)
|
|
13857
13971
|
);
|
|
@@ -13889,21 +14003,21 @@ async function check2(output, name, phase) {
|
|
|
13889
14003
|
designDoc ? `design_doc=${designDoc} (expected: empty/null)` : "design_doc is empty/null"
|
|
13890
14004
|
);
|
|
13891
14005
|
for (const artifact of ["proposal.md", "design.md", "tasks.md"]) {
|
|
13892
|
-
(await nonempty3(
|
|
13893
|
-
`${artifact} ${await nonempty3(
|
|
14006
|
+
(await nonempty3(path23.join(directory, artifact)) ? pass2 : reject)(
|
|
14007
|
+
`${artifact} ${await nonempty3(path23.join(directory, artifact)) ? "non-empty" : "missing or empty"}`
|
|
13894
14008
|
);
|
|
13895
14009
|
}
|
|
13896
14010
|
} else if (phase === "build") {
|
|
13897
14011
|
const workflow = await readField3(name, "workflow");
|
|
13898
14012
|
const designDoc = await readField3(name, "design_doc");
|
|
13899
14013
|
if (workflow === "full") {
|
|
13900
|
-
(designDoc && designDoc !== "null" && await exists6(
|
|
14014
|
+
(designDoc && designDoc !== "null" && await exists6(path23.resolve(designDoc)) ? pass2 : reject)(`design_doc=${designDoc} (expected: non-null and file exists)`);
|
|
13901
14015
|
} else {
|
|
13902
14016
|
pass2(`workflow=${workflow} (design_doc not required)`);
|
|
13903
14017
|
}
|
|
13904
14018
|
for (const artifact of ["proposal.md", "tasks.md"]) {
|
|
13905
|
-
(await nonempty3(
|
|
13906
|
-
`${artifact} ${await nonempty3(
|
|
14019
|
+
(await nonempty3(path23.join(directory, artifact)) ? pass2 : reject)(
|
|
14020
|
+
`${artifact} ${await nonempty3(path23.join(directory, artifact)) ? "non-empty" : "missing or empty"}`
|
|
13907
14021
|
);
|
|
13908
14022
|
}
|
|
13909
14023
|
} else if (phase === "verify") {
|
|
@@ -13948,7 +14062,7 @@ async function check2(output, name, phase) {
|
|
|
13948
14062
|
}
|
|
13949
14063
|
function fieldStatus(field2, value, file) {
|
|
13950
14064
|
if (!value || value === "null") return ` - ${field2}: PENDING`;
|
|
13951
|
-
if (file && !existsSync3(
|
|
14065
|
+
if (file && !existsSync3(path23.resolve(file))) {
|
|
13952
14066
|
return ` - ${field2}: BROKEN (path ${value} does not exist)`;
|
|
13953
14067
|
}
|
|
13954
14068
|
return ` - ${field2}: DONE (${value})`;
|
|
@@ -13957,7 +14071,7 @@ async function recoverOpen(output, directory) {
|
|
|
13957
14071
|
output.stdout.push(" Artifacts:");
|
|
13958
14072
|
let complete = 0;
|
|
13959
14073
|
for (const artifact of ["proposal.md", "design.md", "tasks.md"]) {
|
|
13960
|
-
const done = await nonempty3(
|
|
14074
|
+
const done = await nonempty3(path23.join(directory, artifact));
|
|
13961
14075
|
if (done) complete += 1;
|
|
13962
14076
|
output.stdout.push(` - ${artifact}: ${done ? "DONE" : "PENDING"}`);
|
|
13963
14077
|
}
|
|
@@ -13970,7 +14084,7 @@ async function recoverDesign(output, name, directory) {
|
|
|
13970
14084
|
output.stdout.push(" Artifacts:");
|
|
13971
14085
|
for (const artifact of ["proposal.md", "design.md", "tasks.md"]) {
|
|
13972
14086
|
output.stdout.push(
|
|
13973
|
-
` - ${artifact}: ${await nonempty3(
|
|
14087
|
+
` - ${artifact}: ${await nonempty3(path23.join(directory, artifact)) ? "DONE" : "MISSING (unexpected in design phase)"}`
|
|
13974
14088
|
);
|
|
13975
14089
|
}
|
|
13976
14090
|
const handoff = await readField3(name, "handoff_context");
|
|
@@ -13984,11 +14098,11 @@ async function recoverDesign(output, name, directory) {
|
|
|
13984
14098
|
fieldStatus("design_doc", design, design),
|
|
13985
14099
|
""
|
|
13986
14100
|
);
|
|
13987
|
-
if (design && design !== "null" && await exists6(
|
|
14101
|
+
if (design && design !== "null" && await exists6(path23.resolve(design))) {
|
|
13988
14102
|
output.stdout.push(
|
|
13989
14103
|
"Recovery action: Design Doc already created and linked. Run guard to transition to build."
|
|
13990
14104
|
);
|
|
13991
|
-
} else if (handoff && handoff !== "null" && await exists6(
|
|
14105
|
+
} else if (handoff && handoff !== "null" && await exists6(path23.resolve(handoff))) {
|
|
13992
14106
|
output.stdout.push(
|
|
13993
14107
|
"Recovery action: Handoff generated but Design Doc not yet created. Resume from brainstorming confirmation (Step 1c)."
|
|
13994
14108
|
);
|
|
@@ -14018,7 +14132,7 @@ async function recoverBuild(output, name, directory, workflow) {
|
|
|
14018
14132
|
decisions.push(fieldStatus("subagent_dispatch", subagentDispatch));
|
|
14019
14133
|
}
|
|
14020
14134
|
output.stdout.push(...decisions, "", " Plan:", fieldStatus("plan", plan, plan), "");
|
|
14021
|
-
const tasks =
|
|
14135
|
+
const tasks = path23.join(directory, "tasks.md");
|
|
14022
14136
|
if (!await exists6(tasks)) {
|
|
14023
14137
|
output.stdout.push(
|
|
14024
14138
|
" Tasks: tasks.md MISSING",
|
|
@@ -14027,14 +14141,14 @@ async function recoverBuild(output, name, directory, workflow) {
|
|
|
14027
14141
|
);
|
|
14028
14142
|
return;
|
|
14029
14143
|
}
|
|
14030
|
-
const lines = (await
|
|
14144
|
+
const lines = (await fs22.readFile(tasks, "utf8")).split(/\r?\n/u);
|
|
14031
14145
|
const total = lines.filter((line) => /^\s*- \[[ xX]\] /u.test(line)).length;
|
|
14032
14146
|
const done = lines.filter((line) => /^\s*- \[[xX]\] /u.test(line)).length;
|
|
14033
14147
|
const pending = total - done;
|
|
14034
14148
|
let planTotal = 0;
|
|
14035
14149
|
let planDone = 0;
|
|
14036
|
-
if (plan && plan !== "null" && await exists6(
|
|
14037
|
-
const planLines = (await
|
|
14150
|
+
if (plan && plan !== "null" && await exists6(path23.resolve(plan))) {
|
|
14151
|
+
const planLines = (await fs22.readFile(path23.resolve(plan), "utf8")).split(/\r?\n/u);
|
|
14038
14152
|
planTotal = planLines.filter((line) => /^\s*- \[[ xX]\] /u.test(line)).length;
|
|
14039
14153
|
planDone = planLines.filter((line) => /^\s*- \[[xX]\] /u.test(line)).length;
|
|
14040
14154
|
}
|
|
@@ -14165,19 +14279,19 @@ async function scale(output, name) {
|
|
|
14165
14279
|
validateChangeName4(name);
|
|
14166
14280
|
const { file, directory, label } = await stateFile(name);
|
|
14167
14281
|
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 =
|
|
14282
|
+
const tasksFile = path23.join(directory, "tasks.md");
|
|
14283
|
+
const taskCount = await exists6(tasksFile) ? (await fs22.readFile(tasksFile, "utf8")).split(/\r?\n/u).filter((line) => /^- \[/u.test(line)).length : 0;
|
|
14284
|
+
const specs = path23.join(directory, "specs");
|
|
14171
14285
|
let deltaSpecs = 0;
|
|
14172
14286
|
if (await exists6(specs)) {
|
|
14173
|
-
for (const entry2 of await
|
|
14174
|
-
if (await exists6(
|
|
14287
|
+
for (const entry2 of await fs22.readdir(specs)) {
|
|
14288
|
+
if (await exists6(path23.join(specs, entry2, "spec.md"))) deltaSpecs += 1;
|
|
14175
14289
|
}
|
|
14176
14290
|
}
|
|
14177
14291
|
const plan = await readField3(name, "plan");
|
|
14178
14292
|
let baseRef = "";
|
|
14179
|
-
if (plan && plan !== "null" && await exists6(
|
|
14180
|
-
const match = (await
|
|
14293
|
+
if (plan && plan !== "null" && await exists6(path23.resolve(plan))) {
|
|
14294
|
+
const match = (await fs22.readFile(path23.resolve(plan), "utf8")).match(/^base-ref:\s*(.+)$/mu);
|
|
14181
14295
|
baseRef = match?.[1].trim() ?? "";
|
|
14182
14296
|
}
|
|
14183
14297
|
if (!baseRef) baseRef = await readField3(name, "base_ref");
|