@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
|
@@ -0,0 +1,1889 @@
|
|
|
1
|
+
"""Unit contracts for the Native wave B-F evaluation tasks and validators."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import importlib.util
|
|
6
|
+
import hashlib
|
|
7
|
+
import json
|
|
8
|
+
import sys
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
import yaml
|
|
12
|
+
import pytest
|
|
13
|
+
|
|
14
|
+
from scaffold.python.tasks import load_task
|
|
15
|
+
from scaffold.python.validation.native_wave import (
|
|
16
|
+
build_contract_from_change,
|
|
17
|
+
canonical_hash,
|
|
18
|
+
check_archive_transaction,
|
|
19
|
+
check_checkpoint_cas_envelopes,
|
|
20
|
+
check_dashboard_projection,
|
|
21
|
+
check_json_state,
|
|
22
|
+
check_runtime_envelopes,
|
|
23
|
+
parse_scope_bundle,
|
|
24
|
+
parse_verification_bundle,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
EVAL_ROOT = Path(__file__).resolve().parents[3]
|
|
29
|
+
TASKS_ROOT = EVAL_ROOT / "local" / "tasks"
|
|
30
|
+
WAVE_TASKS = {
|
|
31
|
+
"comet-native-wave-b-decision-resume": "auto_user",
|
|
32
|
+
"comet-native-wave-c-verification-integrity": "none",
|
|
33
|
+
"comet-native-wave-d-stagnation-stop": "none",
|
|
34
|
+
"comet-native-wave-e-parallel-safety": "none",
|
|
35
|
+
"comet-native-wave-f-dashboard-readonly": "none",
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def load_validator(task_name: str, filename: str):
|
|
40
|
+
path = TASKS_ROOT / task_name / "validation" / filename
|
|
41
|
+
spec = importlib.util.spec_from_file_location(f"validator_{task_name}", path)
|
|
42
|
+
assert spec and spec.loader
|
|
43
|
+
module = importlib.util.module_from_spec(spec)
|
|
44
|
+
spec.loader.exec_module(module)
|
|
45
|
+
return module
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def write_json(path: Path, value) -> None:
|
|
49
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
50
|
+
path.write_text(json.dumps(value, indent=2), encoding="utf-8")
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
SNAPSHOT_LIMITS = {
|
|
54
|
+
"maxFiles": 10000,
|
|
55
|
+
"maxFileBytes": 5 * 1024 * 1024,
|
|
56
|
+
"maxTotalBytes": 64 * 1024 * 1024,
|
|
57
|
+
"maxManifestBytes": 1024 * 1024,
|
|
58
|
+
}
|
|
59
|
+
CHECK_LIMITS = {
|
|
60
|
+
"maxFiles": 256,
|
|
61
|
+
"maxFileBytes": 1024 * 1024,
|
|
62
|
+
"maxTotalBytes": 8 * 1024 * 1024,
|
|
63
|
+
"maxIssues": 128,
|
|
64
|
+
}
|
|
65
|
+
CHECKER_HASH = "0b8e0e9570269a64123ba2794f1f5125cf454695e1d7fda8f0acddf87ec4912f"
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _file_identity(path: Path) -> dict:
|
|
69
|
+
payload = path.read_bytes()
|
|
70
|
+
return {"hash": hashlib.sha256(payload).hexdigest(), "size": len(payload)}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _projection(entries: list[dict]) -> tuple[dict, str]:
|
|
74
|
+
value = {
|
|
75
|
+
"schema": "comet.native.content-snapshot-projection.v1",
|
|
76
|
+
"origin": "explicit",
|
|
77
|
+
"complete": True,
|
|
78
|
+
"limits": SNAPSHOT_LIMITS,
|
|
79
|
+
"entries": sorted(entries, key=lambda item: item["path"]),
|
|
80
|
+
"omitted": [],
|
|
81
|
+
"omittedCount": 0,
|
|
82
|
+
}
|
|
83
|
+
return value, canonical_hash("comet.native.content-snapshot-projection.v1", value)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def _unattributed_scope(change: dict) -> dict:
|
|
87
|
+
identity = {
|
|
88
|
+
"kind": "unattributed-change",
|
|
89
|
+
"source": "implementation-scope",
|
|
90
|
+
"path": change["path"],
|
|
91
|
+
"evidence": {
|
|
92
|
+
"after": change["after"],
|
|
93
|
+
"before": change["before"],
|
|
94
|
+
"changeKind": change["kind"],
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
"id": f"scope:{canonical_hash('comet.native.unresolved-scope-id.v1', identity)}",
|
|
99
|
+
"kind": identity["kind"],
|
|
100
|
+
"source": identity["source"],
|
|
101
|
+
"path": identity["path"],
|
|
102
|
+
"reason": f"Changed path is not covered by a declared artifact: {change['path']}",
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def write_scope(
|
|
107
|
+
workspace: Path,
|
|
108
|
+
change_root: Path,
|
|
109
|
+
contract_hash: str,
|
|
110
|
+
*,
|
|
111
|
+
partial: bool = False,
|
|
112
|
+
) -> tuple[str, dict]:
|
|
113
|
+
project_entries = []
|
|
114
|
+
for name in ("wordcount.py", "test_wordcount.py"):
|
|
115
|
+
path = workspace / name
|
|
116
|
+
if path.is_file():
|
|
117
|
+
identity = _file_identity(path)
|
|
118
|
+
project_entries.append({"path": name, **identity, "type": "file"})
|
|
119
|
+
baseline, baseline_hash = _projection(project_entries)
|
|
120
|
+
current_entries = list(project_entries)
|
|
121
|
+
if partial:
|
|
122
|
+
current_entries.append(
|
|
123
|
+
{"path": "unrelated.txt", "hash": "9" * 64, "size": 1, "type": "file"}
|
|
124
|
+
)
|
|
125
|
+
current, current_hash = _projection(current_entries)
|
|
126
|
+
change = {
|
|
127
|
+
"path": "unrelated.txt",
|
|
128
|
+
"kind": "added",
|
|
129
|
+
"before": None,
|
|
130
|
+
"after": {"hash": "9" * 64, "size": 1},
|
|
131
|
+
"attributedTo": [],
|
|
132
|
+
}
|
|
133
|
+
unresolved = _unattributed_scope(change)
|
|
134
|
+
content = {
|
|
135
|
+
"schema": "comet.native.implementation-scope.v2",
|
|
136
|
+
"contractHash": contract_hash,
|
|
137
|
+
"baselineProjectionRef": f"runtime/evidence/snapshots/{baseline_hash}.json",
|
|
138
|
+
"baselineProjectionHash": baseline_hash,
|
|
139
|
+
"currentProjectionRef": f"runtime/evidence/snapshots/{current_hash}.json",
|
|
140
|
+
"currentProjectionHash": current_hash,
|
|
141
|
+
"complete": not partial,
|
|
142
|
+
"declaredArtifacts": [],
|
|
143
|
+
"changes": [change] if partial else [],
|
|
144
|
+
"unattributed": [change] if partial else [],
|
|
145
|
+
"unresolvedScopes": [unresolved] if partial else [],
|
|
146
|
+
"noCodeReason": None if partial else "No project content changed during this verification.",
|
|
147
|
+
}
|
|
148
|
+
scope_hash = canonical_hash("comet.native.implementation-scope.v2", content)
|
|
149
|
+
scope = {**content, "scopeHash": scope_hash}
|
|
150
|
+
for kind, digest, value in (
|
|
151
|
+
("snapshots", baseline_hash, baseline),
|
|
152
|
+
("snapshots", current_hash, current),
|
|
153
|
+
("scopes", scope_hash, scope),
|
|
154
|
+
):
|
|
155
|
+
write_json(change_root / f"runtime/evidence/{kind}/{digest}.json", value)
|
|
156
|
+
return f"runtime/evidence/scopes/{scope_hash}.json", scope
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def write_contract_artifacts(
|
|
160
|
+
change_root: Path,
|
|
161
|
+
state: dict,
|
|
162
|
+
capability: str,
|
|
163
|
+
) -> dict:
|
|
164
|
+
brief = (
|
|
165
|
+
"# Goal\nExercise the Native workflow.\n\n"
|
|
166
|
+
"# Acceptance examples\n- The focused CLI behavior is verified by a project artifact.\n"
|
|
167
|
+
)
|
|
168
|
+
spec = (
|
|
169
|
+
f"# {capability}\n\n## Requirement: Focused behavior\n\n"
|
|
170
|
+
"### Scenario: Focused CLI result\nGiven representative input, the requested output is produced.\n"
|
|
171
|
+
)
|
|
172
|
+
(change_root / f"specs/{capability}").mkdir(parents=True, exist_ok=True)
|
|
173
|
+
(change_root / "brief.md").write_text(brief, encoding="utf-8")
|
|
174
|
+
(change_root / f"specs/{capability}/spec.md").write_text(spec, encoding="utf-8")
|
|
175
|
+
state.update(
|
|
176
|
+
{
|
|
177
|
+
"brief": "brief.md",
|
|
178
|
+
"spec_changes": [
|
|
179
|
+
{
|
|
180
|
+
"capability": capability,
|
|
181
|
+
"operation": "create",
|
|
182
|
+
"source": f"specs/{capability}/spec.md",
|
|
183
|
+
"base_hash": None,
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
return build_contract_from_change(change_root, state)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def write_check_receipt(
|
|
192
|
+
change_root: Path,
|
|
193
|
+
*,
|
|
194
|
+
change: str,
|
|
195
|
+
source_revision: int,
|
|
196
|
+
contract_hash: str,
|
|
197
|
+
scope: dict,
|
|
198
|
+
) -> str:
|
|
199
|
+
selected = [item for item in scope["changes"] if item["after"] is not None]
|
|
200
|
+
checker = {
|
|
201
|
+
"policy": "scoped-text-safety",
|
|
202
|
+
"version": 1,
|
|
203
|
+
"hash": CHECKER_HASH,
|
|
204
|
+
"limits": CHECK_LIMITS,
|
|
205
|
+
}
|
|
206
|
+
input_hash = canonical_hash(
|
|
207
|
+
"comet.native.check-input.v1",
|
|
208
|
+
{
|
|
209
|
+
"change": change,
|
|
210
|
+
"sourceRevision": source_revision,
|
|
211
|
+
"checkerHash": checker["hash"],
|
|
212
|
+
"contractHash": contract_hash,
|
|
213
|
+
"scopeHash": scope["scopeHash"],
|
|
214
|
+
"snapshotHash": scope["currentProjectionHash"],
|
|
215
|
+
},
|
|
216
|
+
)
|
|
217
|
+
content = {
|
|
218
|
+
"schema": "comet.native.check-receipt.v1",
|
|
219
|
+
"change": change,
|
|
220
|
+
"sourceRevision": source_revision,
|
|
221
|
+
"checker": checker,
|
|
222
|
+
"inputHash": input_hash,
|
|
223
|
+
"status": "passed",
|
|
224
|
+
"startedAt": "2026-07-17T00:00:00.000Z",
|
|
225
|
+
"endedAt": "2026-07-17T00:00:01.000Z",
|
|
226
|
+
"contract": {
|
|
227
|
+
"expectedHash": contract_hash,
|
|
228
|
+
"beforeHash": contract_hash,
|
|
229
|
+
"afterHash": contract_hash,
|
|
230
|
+
},
|
|
231
|
+
"implementation": {
|
|
232
|
+
"scopeHash": scope["scopeHash"],
|
|
233
|
+
"expectedSnapshotHash": scope["currentProjectionHash"],
|
|
234
|
+
"beforeSnapshotHash": scope["currentProjectionHash"],
|
|
235
|
+
"afterSnapshotHash": scope["currentProjectionHash"],
|
|
236
|
+
},
|
|
237
|
+
"counts": {
|
|
238
|
+
"filesSelected": len(selected),
|
|
239
|
+
"filesScanned": len(selected),
|
|
240
|
+
"binaryFilesSkipped": 0,
|
|
241
|
+
"bytesScanned": sum(item["after"]["size"] for item in selected),
|
|
242
|
+
"issueCount": 0,
|
|
243
|
+
"recordedIssueCount": 0,
|
|
244
|
+
},
|
|
245
|
+
"issues": [],
|
|
246
|
+
"issuesTruncated": False,
|
|
247
|
+
"stale": False,
|
|
248
|
+
"staleReasons": [],
|
|
249
|
+
}
|
|
250
|
+
receipt_hash = canonical_hash("comet.native.check-receipt.v1", content)
|
|
251
|
+
receipt_ref = f"runtime/evidence/check-receipts/{receipt_hash}.json"
|
|
252
|
+
write_json(change_root / receipt_ref, {**content, "receiptHash": receipt_hash})
|
|
253
|
+
return receipt_ref
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
def write_verification_bundle(
|
|
257
|
+
workspace: Path,
|
|
258
|
+
change_root: Path,
|
|
259
|
+
state: dict,
|
|
260
|
+
contract: dict,
|
|
261
|
+
*,
|
|
262
|
+
result: str,
|
|
263
|
+
source_revision: int,
|
|
264
|
+
created_at: str,
|
|
265
|
+
partial: bool = False,
|
|
266
|
+
include_receipt: bool = False,
|
|
267
|
+
) -> str:
|
|
268
|
+
scope_ref, scope = write_scope(
|
|
269
|
+
workspace, change_root, contract["contractHash"], partial=partial
|
|
270
|
+
)
|
|
271
|
+
allowance_ref = None
|
|
272
|
+
allowance_hash = None
|
|
273
|
+
if partial:
|
|
274
|
+
allowance_content = {
|
|
275
|
+
"schema": "comet.native.partial-allowance.v1",
|
|
276
|
+
"change": state["name"],
|
|
277
|
+
"scopeHash": scope["scopeHash"],
|
|
278
|
+
"scopeIds": [item["id"] for item in scope["unresolvedScopes"]],
|
|
279
|
+
"reason": "The unrelated fixture file is intentionally outside this change.",
|
|
280
|
+
"confirmedSummary": "Confirmed the exact partial scope for this eval.",
|
|
281
|
+
"sourceRevision": source_revision - 1,
|
|
282
|
+
"confirmedAt": "2026-07-17T00:00:00.000Z",
|
|
283
|
+
}
|
|
284
|
+
allowance_hash = canonical_hash("comet.native.partial-allowance.v1", allowance_content)
|
|
285
|
+
allowance = {**allowance_content, "allowanceHash": allowance_hash}
|
|
286
|
+
allowance_ref = f"runtime/evidence/allowances/{allowance_hash}.json"
|
|
287
|
+
write_json(change_root / allowance_ref, allowance)
|
|
288
|
+
report_ref = f"verification-{source_revision}.md"
|
|
289
|
+
report_text = (
|
|
290
|
+
"\n".join(
|
|
291
|
+
f"acceptance_id: {criterion['id']}\nevidence: project file"
|
|
292
|
+
for criterion in contract["acceptance"]
|
|
293
|
+
)
|
|
294
|
+
+ "\n"
|
|
295
|
+
)
|
|
296
|
+
(change_root / report_ref).write_text(report_text, encoding="utf-8")
|
|
297
|
+
report_bytes = (change_root / report_ref).read_bytes()
|
|
298
|
+
report_hash = hashlib.sha256(report_bytes).hexdigest()
|
|
299
|
+
write_json(
|
|
300
|
+
change_root / f"runtime/evidence/reports/{report_hash}.json",
|
|
301
|
+
{
|
|
302
|
+
"schema": "comet.native.verification-report.v1",
|
|
303
|
+
"reportHash": report_hash,
|
|
304
|
+
"content": report_bytes.decode("utf-8"),
|
|
305
|
+
},
|
|
306
|
+
)
|
|
307
|
+
entries = []
|
|
308
|
+
evidence_files = ["test_wordcount.py", "wordcount.py"]
|
|
309
|
+
for index, criterion in enumerate(contract["acceptance"]):
|
|
310
|
+
entries.append(
|
|
311
|
+
{
|
|
312
|
+
"acceptanceId": criterion["id"],
|
|
313
|
+
"kind": criterion["kind"],
|
|
314
|
+
"source": criterion["source"],
|
|
315
|
+
"evidenceRefs": [evidence_files[index % len(evidence_files)]],
|
|
316
|
+
"skippedReason": None,
|
|
317
|
+
}
|
|
318
|
+
)
|
|
319
|
+
entries.sort(key=lambda item: item["acceptanceId"])
|
|
320
|
+
trace_content = {
|
|
321
|
+
"schema": "comet.native.acceptance-trace.v1",
|
|
322
|
+
"nativeRootRef": "docs/comet",
|
|
323
|
+
"criteriaHash": contract["acceptanceHash"],
|
|
324
|
+
"total": len(entries),
|
|
325
|
+
"evidenced": len(entries),
|
|
326
|
+
"skipped": 0,
|
|
327
|
+
"entries": entries,
|
|
328
|
+
}
|
|
329
|
+
trace = {
|
|
330
|
+
**trace_content,
|
|
331
|
+
"traceHash": canonical_hash("comet.native.acceptance-trace.v1", trace_content),
|
|
332
|
+
}
|
|
333
|
+
receipt_ref = (
|
|
334
|
+
write_check_receipt(
|
|
335
|
+
change_root,
|
|
336
|
+
change=state["name"],
|
|
337
|
+
source_revision=source_revision,
|
|
338
|
+
contract_hash=contract["contractHash"],
|
|
339
|
+
scope=scope,
|
|
340
|
+
)
|
|
341
|
+
if include_receipt
|
|
342
|
+
else None
|
|
343
|
+
)
|
|
344
|
+
envelope_content = {
|
|
345
|
+
"schema": "comet.native.verification-evidence.v1",
|
|
346
|
+
"change": state["name"],
|
|
347
|
+
"sourceRevision": source_revision,
|
|
348
|
+
"result": result,
|
|
349
|
+
"freshness": "partial" if partial else "complete",
|
|
350
|
+
"contractHash": contract["contractHash"],
|
|
351
|
+
"acceptanceCriteriaHash": contract["acceptanceHash"],
|
|
352
|
+
"implementationScopeRef": scope_ref,
|
|
353
|
+
"implementationScopeHash": scope["scopeHash"],
|
|
354
|
+
"reportRef": report_ref,
|
|
355
|
+
"reportHash": report_hash,
|
|
356
|
+
"acceptanceTrace": trace,
|
|
357
|
+
"partialAllowanceRef": allowance_ref,
|
|
358
|
+
"partialAllowanceHash": allowance_hash,
|
|
359
|
+
"receiptRef": receipt_ref,
|
|
360
|
+
"createdAt": created_at,
|
|
361
|
+
}
|
|
362
|
+
envelope_hash = canonical_hash("comet.native.verification-evidence.v1", envelope_content)
|
|
363
|
+
ref = f"runtime/evidence/verifications/{envelope_hash}.json"
|
|
364
|
+
write_json(change_root / ref, {**envelope_content, "envelopeHash": envelope_hash})
|
|
365
|
+
return ref
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
def write_archive_transaction(
|
|
369
|
+
workspace: Path,
|
|
370
|
+
transaction_id: str,
|
|
371
|
+
change: str,
|
|
372
|
+
preflight_hash: str,
|
|
373
|
+
) -> None:
|
|
374
|
+
target = f"archive/2026-07-17-{change}"
|
|
375
|
+
write_json(
|
|
376
|
+
workspace / "docs/comet/runtime/transactions" / transaction_id / "transaction.json",
|
|
377
|
+
{
|
|
378
|
+
"schema": "comet.native.transaction.v2",
|
|
379
|
+
"id": transaction_id,
|
|
380
|
+
"kind": "archive",
|
|
381
|
+
"status": "committed",
|
|
382
|
+
"change": change,
|
|
383
|
+
"createdAt": "2026-07-17T00:00:00.000Z",
|
|
384
|
+
"preflightHash": preflight_hash,
|
|
385
|
+
"operations": [
|
|
386
|
+
{
|
|
387
|
+
"id": "archive-change",
|
|
388
|
+
"type": "move",
|
|
389
|
+
"source": f"changes/{change}",
|
|
390
|
+
"target": target,
|
|
391
|
+
"expectedSourceHash": "d" * 64,
|
|
392
|
+
"expectedTargetHash": None,
|
|
393
|
+
}
|
|
394
|
+
],
|
|
395
|
+
},
|
|
396
|
+
)
|
|
397
|
+
events = [
|
|
398
|
+
("prepared", None),
|
|
399
|
+
("operation-started", "archive-change"),
|
|
400
|
+
("operation-completed", "archive-change"),
|
|
401
|
+
("archive-finalization-started", None),
|
|
402
|
+
("archive-finalized", None),
|
|
403
|
+
("commit", None),
|
|
404
|
+
]
|
|
405
|
+
event_file = workspace / "docs/comet/runtime/transactions" / transaction_id / "events.jsonl"
|
|
406
|
+
event_file.write_text(
|
|
407
|
+
"\n".join(
|
|
408
|
+
json.dumps(
|
|
409
|
+
{
|
|
410
|
+
"sequence": index,
|
|
411
|
+
"timestamp": "2026-07-17T00:00:00.000Z",
|
|
412
|
+
"type": event_type,
|
|
413
|
+
**({"operationId": operation_id} if operation_id else {}),
|
|
414
|
+
}
|
|
415
|
+
)
|
|
416
|
+
for index, (event_type, operation_id) in enumerate(events, 1)
|
|
417
|
+
)
|
|
418
|
+
+ "\n",
|
|
419
|
+
encoding="utf-8",
|
|
420
|
+
)
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
def test_wave_tasks_use_the_native_skill_contract_and_executable_validators():
|
|
424
|
+
runtime = EVAL_ROOT.parent / "assets/skills/comet-native/scripts/comet-native-runtime.mjs"
|
|
425
|
+
assert runtime.is_file()
|
|
426
|
+
for name, interaction_mode in WAVE_TASKS.items():
|
|
427
|
+
task = load_task(name)
|
|
428
|
+
assert task.default_treatments == ["COMET_NATIVE_PHASE1"]
|
|
429
|
+
assert (task.environment_dir / "Dockerfile").is_file()
|
|
430
|
+
assert (task.environment_dir / "wordcount.py").is_file()
|
|
431
|
+
assert (task.environment_dir / "test_wordcount.py").is_file()
|
|
432
|
+
assert task.config.evaluation.profile == "generic"
|
|
433
|
+
assert task.config.evaluation.required_skills == ["comet-native"]
|
|
434
|
+
assert task.config.evaluation.require_skill_invocation is True
|
|
435
|
+
assert task.config.interaction.mode == interaction_mode
|
|
436
|
+
assert task.load_validators()
|
|
437
|
+
prompt = task.render_prompt()
|
|
438
|
+
assert "`/comet-native` Skill" in prompt
|
|
439
|
+
assert "Do not fabricate" in prompt
|
|
440
|
+
assert ".cache/comet-native-eval" in prompt
|
|
441
|
+
assert "eval-evidence" not in prompt
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
def test_wave_tasks_are_registered_in_the_local_index():
|
|
445
|
+
index = yaml.safe_load((TASKS_ROOT / "index.yaml").read_text(encoding="utf-8"))
|
|
446
|
+
indexed = {entry["name"] for entry in index["tasks"]}
|
|
447
|
+
assert set(WAVE_TASKS).issubset(indexed)
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
def test_wave_f_requests_a_current_checkout_cli_snapshot():
|
|
451
|
+
environment = TASKS_ROOT / "comet-native-wave-f-dashboard-readonly/environment"
|
|
452
|
+
assert (environment / ".include-current-comet-cli").is_file()
|
|
453
|
+
dockerfile = (environment / "Dockerfile").read_text(encoding="utf-8")
|
|
454
|
+
wrapper = (environment / "current-comet.sh").read_text(encoding="utf-8")
|
|
455
|
+
prompt = load_task("comet-native-wave-f-dashboard-readonly").render_prompt()
|
|
456
|
+
|
|
457
|
+
assert "FROM node:22" in dockerfile
|
|
458
|
+
assert "npm install --prefix /opt/comet-cli" in dockerfile
|
|
459
|
+
assert "/workspace/_eval_current_comet" in wrapper
|
|
460
|
+
assert 'runtime="$(mktemp -d)"' in wrapper
|
|
461
|
+
assert '"$snapshot/node_modules"' not in wrapper
|
|
462
|
+
docker_harness = (EVAL_ROOT / "scaffold/shell/docker.sh").read_text(encoding="utf-8")
|
|
463
|
+
assert "_eval_current_comet:ro" in docker_harness
|
|
464
|
+
assert "current-comet.sh dashboard . --json" in prompt
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
def test_wave_f_current_checkout_dependency_snapshot_matches_package_runtime_dependencies():
|
|
468
|
+
"""Keep the eval image's installed runtime dependencies in lockstep with Comet."""
|
|
469
|
+
package = json.loads((EVAL_ROOT.parent / "package.json").read_text(encoding="utf-8"))
|
|
470
|
+
snapshot = json.loads(
|
|
471
|
+
(
|
|
472
|
+
TASKS_ROOT
|
|
473
|
+
/ "comet-native-wave-f-dashboard-readonly/environment/current-comet-package.json"
|
|
474
|
+
).read_text(encoding="utf-8")
|
|
475
|
+
)
|
|
476
|
+
|
|
477
|
+
assert snapshot.get("private") is True
|
|
478
|
+
assert snapshot.get("type") == package.get("type")
|
|
479
|
+
assert snapshot.get("dependencies") == package.get("dependencies")
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
def test_current_cli_snapshot_helper_source_builds_checkout(monkeypatch, tmp_path: Path):
|
|
483
|
+
eval_conftest = sys.modules["conftest"]
|
|
484
|
+
checkout = tmp_path / "checkout"
|
|
485
|
+
(checkout / "bin").mkdir(parents=True)
|
|
486
|
+
(checkout / "bin/comet.js").write_text("import '../dist/index.js';\n", encoding="utf-8")
|
|
487
|
+
(checkout / "package.json").write_text('{"type":"module"}\n', encoding="utf-8")
|
|
488
|
+
environment = tmp_path / "environment"
|
|
489
|
+
environment.mkdir()
|
|
490
|
+
(environment / ".include-current-comet-cli").write_text("include\n", encoding="utf-8")
|
|
491
|
+
workspace = tmp_path / "workspace"
|
|
492
|
+
workspace.mkdir()
|
|
493
|
+
monkeypatch.setattr(eval_conftest, "REPOSITORY_ROOT", checkout)
|
|
494
|
+
|
|
495
|
+
def fake_source_build(_checkout: Path, output: Path) -> str:
|
|
496
|
+
(output / "app/cli").mkdir(parents=True)
|
|
497
|
+
(output / "domains/dashboard").mkdir(parents=True)
|
|
498
|
+
(output / "app/cli/index.js").write_text("export {};\n", encoding="utf-8")
|
|
499
|
+
(output / "domains/dashboard/native-adapter.js").write_text(
|
|
500
|
+
"export const schema = 'native';\n", encoding="utf-8"
|
|
501
|
+
)
|
|
502
|
+
return "5.9.3"
|
|
503
|
+
|
|
504
|
+
monkeypatch.setattr(eval_conftest, "_build_current_comet_dist", fake_source_build)
|
|
505
|
+
|
|
506
|
+
eval_conftest._copy_current_comet_cli_snapshot(environment, workspace)
|
|
507
|
+
|
|
508
|
+
snapshot = workspace / "_eval_current_comet"
|
|
509
|
+
assert (snapshot / "bin/comet.js").is_file()
|
|
510
|
+
assert (snapshot / "dist/app/cli/index.js").is_file()
|
|
511
|
+
assert (snapshot / "dist/domains/dashboard/native-adapter.js").is_file()
|
|
512
|
+
assert (snapshot / "package.json").is_file()
|
|
513
|
+
identity = json.loads((snapshot / "build-identity.json").read_text(encoding="utf-8"))
|
|
514
|
+
assert identity["schema"] == "comet.eval.current-comet-build.v1"
|
|
515
|
+
assert identity["sourceFileCount"] >= 2
|
|
516
|
+
assert identity["snapshotFileCount"] >= 4
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
def test_controller_snapshots_native_runtime_for_readonly_oracle(tmp_path: Path):
|
|
520
|
+
eval_conftest = sys.modules["conftest"]
|
|
521
|
+
environment = tmp_path / "environment"
|
|
522
|
+
environment.mkdir()
|
|
523
|
+
(environment / ".include-trusted-native-runtime").write_text("include\n", encoding="utf-8")
|
|
524
|
+
skill_source = tmp_path / "skill/comet-native"
|
|
525
|
+
runtime = skill_source / "scripts/comet-native-runtime.mjs"
|
|
526
|
+
runtime.parent.mkdir(parents=True)
|
|
527
|
+
runtime.write_text("export const trusted = true;\n", encoding="utf-8")
|
|
528
|
+
workspace = tmp_path / "workspace"
|
|
529
|
+
workspace.mkdir()
|
|
530
|
+
|
|
531
|
+
eval_conftest._copy_trusted_native_runtime_snapshot(
|
|
532
|
+
environment,
|
|
533
|
+
workspace,
|
|
534
|
+
{"comet-native": {"source_dir": skill_source}},
|
|
535
|
+
)
|
|
536
|
+
|
|
537
|
+
oracle = workspace / "_eval_trusted_oracles/comet-native-runtime.mjs"
|
|
538
|
+
identity = json.loads(
|
|
539
|
+
(workspace / "_eval_trusted_oracles/native-runtime-identity.json").read_text(
|
|
540
|
+
encoding="utf-8"
|
|
541
|
+
)
|
|
542
|
+
)
|
|
543
|
+
assert oracle.read_bytes() == runtime.read_bytes()
|
|
544
|
+
assert identity == {
|
|
545
|
+
"schema": "comet.eval.trusted-native-runtime.v1",
|
|
546
|
+
"runtimeFile": oracle.name,
|
|
547
|
+
"runtimeHash": hashlib.sha256(oracle.read_bytes()).hexdigest(),
|
|
548
|
+
}
|
|
549
|
+
docker_harness = (EVAL_ROOT / "scaffold/shell/docker.sh").read_text(encoding="utf-8")
|
|
550
|
+
assert "_eval_trusted_oracles:ro" in docker_harness
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
def test_controller_source_build_contains_current_native_dashboard_adapter(tmp_path: Path):
|
|
554
|
+
eval_conftest = sys.modules["conftest"]
|
|
555
|
+
output = tmp_path / "dist"
|
|
556
|
+
|
|
557
|
+
version = eval_conftest._build_current_comet_dist(EVAL_ROOT.parent, output)
|
|
558
|
+
|
|
559
|
+
assert version
|
|
560
|
+
assert (output / "app/cli/index.js").is_file()
|
|
561
|
+
assert (output / "domains/dashboard/native-adapter.js").is_file()
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
def test_wave_b_prompt_hides_the_normalization_decision_and_requires_disk_resume():
|
|
565
|
+
task = load_task("comet-native-wave-b-decision-resume")
|
|
566
|
+
prompt = task.render_prompt()
|
|
567
|
+
|
|
568
|
+
assert "case-insensitive" not in prompt.lower()
|
|
569
|
+
assert "strip surrounding punctuation" not in prompt.lower()
|
|
570
|
+
assert "distinct normalized word values" in prompt.lower()
|
|
571
|
+
assert "words that occur exactly once" in prompt.lower()
|
|
572
|
+
assert task.config.interaction.decision_reply == (
|
|
573
|
+
"Treat words case-insensitively, strip surrounding punctuation, and preserve internal apostrophes."
|
|
574
|
+
)
|
|
575
|
+
continuation = task.config.interaction.continue_prompt.lower()
|
|
576
|
+
assert "context-cleared continuation" in continuation
|
|
577
|
+
assert "invoke `/comet-native`" in continuation
|
|
578
|
+
assert "first bash command" in continuation
|
|
579
|
+
assert "before any read, edit, test, or transition" in continuation
|
|
580
|
+
assert "status add-unique-counting --json" in continuation
|
|
581
|
+
assert "archive-preview.json" in continuation
|
|
582
|
+
assert "archive-commit.json" in continuation
|
|
583
|
+
assert "--dry-run --json" in continuation
|
|
584
|
+
assert "--expect-preflight" in continuation
|
|
585
|
+
assert "redirect stdout directly" in continuation
|
|
586
|
+
assert "exactly once" in continuation
|
|
587
|
+
assert "never overwrite" in continuation
|
|
588
|
+
assert "do not reconstruct" in continuation
|
|
589
|
+
assert task.config.interaction.fresh_resume_marker == "COMET_NATIVE_COLD_RESUME_READY"
|
|
590
|
+
assert "deliberately omits" not in prompt.lower()
|
|
591
|
+
assert "redirect stdout directly" in prompt.lower()
|
|
592
|
+
assert "verify all three files exist" in prompt.lower()
|
|
593
|
+
assert "do not rely on terminal output" in prompt.lower()
|
|
594
|
+
assert "before invoking either archive command" in prompt.lower()
|
|
595
|
+
assert "must itself redirect stdout" in prompt.lower()
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
def test_shared_wave_helpers_recognize_state_cas_and_readonly_projection(tmp_path: Path):
|
|
599
|
+
status_file = tmp_path / "status.json"
|
|
600
|
+
write_json(
|
|
601
|
+
status_file,
|
|
602
|
+
{"command": "status", "exitCode": 0, "data": {"freshness": "stale"}},
|
|
603
|
+
)
|
|
604
|
+
assert check_json_state(status_file, "stale")["status"] == "passed"
|
|
605
|
+
assert check_json_state(status_file, "partial")["status"] == "failed"
|
|
606
|
+
assert check_runtime_envelopes([status_file])["status"] == "passed"
|
|
607
|
+
|
|
608
|
+
attempt_a = tmp_path / "checkpoint-attempt-a.json"
|
|
609
|
+
write_json(
|
|
610
|
+
attempt_a,
|
|
611
|
+
{
|
|
612
|
+
"command": "checkpoint",
|
|
613
|
+
"exitCode": 0,
|
|
614
|
+
"data": {
|
|
615
|
+
"change": {"name": "normalize-case", "revision": 8},
|
|
616
|
+
"expectedRevision": 7,
|
|
617
|
+
"previousRevision": 7,
|
|
618
|
+
"revision": 8,
|
|
619
|
+
"outcome": "recorded",
|
|
620
|
+
},
|
|
621
|
+
},
|
|
622
|
+
)
|
|
623
|
+
attempt_b = tmp_path / "checkpoint-attempt-b.json"
|
|
624
|
+
write_json(
|
|
625
|
+
attempt_b,
|
|
626
|
+
{
|
|
627
|
+
"command": "checkpoint",
|
|
628
|
+
"exitCode": 73,
|
|
629
|
+
"data": {
|
|
630
|
+
"change": "normalize-case",
|
|
631
|
+
"expectedRevision": 7,
|
|
632
|
+
"actualRevision": 8,
|
|
633
|
+
"outcome": "revision-conflict",
|
|
634
|
+
},
|
|
635
|
+
},
|
|
636
|
+
)
|
|
637
|
+
assert check_checkpoint_cas_envelopes([attempt_a, attempt_b])["status"] == "passed"
|
|
638
|
+
write_json(
|
|
639
|
+
attempt_b,
|
|
640
|
+
{
|
|
641
|
+
"command": "checkpoint",
|
|
642
|
+
"exitCode": 73,
|
|
643
|
+
"data": {
|
|
644
|
+
"change": "normalize-case",
|
|
645
|
+
"expectedRevision": 7,
|
|
646
|
+
"actualRevision": 9,
|
|
647
|
+
"outcome": "revision-conflict",
|
|
648
|
+
},
|
|
649
|
+
},
|
|
650
|
+
)
|
|
651
|
+
assert check_checkpoint_cas_envelopes([attempt_a, attempt_b])["status"] == "failed"
|
|
652
|
+
|
|
653
|
+
cli_file = tmp_path / "cli.json"
|
|
654
|
+
dashboard_file = tmp_path / "dashboard.json"
|
|
655
|
+
projection = {
|
|
656
|
+
"name": "add-unique-counting",
|
|
657
|
+
"phase": "build",
|
|
658
|
+
"nextAction": "continue",
|
|
659
|
+
"verificationResult": "pending",
|
|
660
|
+
}
|
|
661
|
+
write_json(cli_file, {"data": projection})
|
|
662
|
+
write_json(dashboard_file, {"snapshot": {"changes": [projection]}})
|
|
663
|
+
assert check_dashboard_projection(cli_file, dashboard_file)["status"] == "passed"
|
|
664
|
+
|
|
665
|
+
dashboard_projection = {
|
|
666
|
+
**projection,
|
|
667
|
+
"selected": True,
|
|
668
|
+
"findings": {
|
|
669
|
+
"total": 1,
|
|
670
|
+
"errors": 0,
|
|
671
|
+
"warnings": 1,
|
|
672
|
+
"info": 0,
|
|
673
|
+
"requiresUserDecision": False,
|
|
674
|
+
"codes": ["workspace-root-changed"],
|
|
675
|
+
"truncated": False,
|
|
676
|
+
},
|
|
677
|
+
"continuation": {
|
|
678
|
+
"disposition": "continue",
|
|
679
|
+
"action": "work-phase",
|
|
680
|
+
"command": 'comet native next add-unique-counting --summary "<summary>"',
|
|
681
|
+
"requiresUserDecision": False,
|
|
682
|
+
"requiredInputs": ["summary"],
|
|
683
|
+
"requiredInputsTruncated": False,
|
|
684
|
+
},
|
|
685
|
+
}
|
|
686
|
+
cli_projection = {**dashboard_projection}
|
|
687
|
+
cli_projection["findingSummary"] = cli_projection.pop("findings")
|
|
688
|
+
write_json(cli_file, {"data": cli_projection})
|
|
689
|
+
write_json(dashboard_file, {"snapshot": {"changes": [dashboard_projection]}})
|
|
690
|
+
assert check_dashboard_projection(cli_file, dashboard_file)["status"] == "passed"
|
|
691
|
+
|
|
692
|
+
dashboard_projection["selected"] = False
|
|
693
|
+
write_json(dashboard_file, {"snapshot": {"changes": [dashboard_projection]}})
|
|
694
|
+
assert check_dashboard_projection(cli_file, dashboard_file)["status"] == "failed"
|
|
695
|
+
dashboard_projection["selected"] = True
|
|
696
|
+
dashboard_projection["findings"] = {
|
|
697
|
+
**cli_projection["findingSummary"],
|
|
698
|
+
"warnings": 0,
|
|
699
|
+
}
|
|
700
|
+
write_json(dashboard_file, {"snapshot": {"changes": [dashboard_projection]}})
|
|
701
|
+
assert check_dashboard_projection(cli_file, dashboard_file)["status"] == "failed"
|
|
702
|
+
dashboard_projection["findings"] = cli_projection["findingSummary"]
|
|
703
|
+
write_json(
|
|
704
|
+
dashboard_file,
|
|
705
|
+
{"snapshot": {"changes": [dashboard_projection, {**projection, "name": "extra"}]}},
|
|
706
|
+
)
|
|
707
|
+
assert check_dashboard_projection(cli_file, dashboard_file)["status"] == "failed"
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
def test_wave_b_validator_accepts_one_confirmed_archive_and_resume_snapshot(tmp_path: Path):
|
|
711
|
+
validator = load_validator(
|
|
712
|
+
"comet-native-wave-b-decision-resume", "test_native_wave_b_decision_resume.py"
|
|
713
|
+
)
|
|
714
|
+
validator.WORKSPACE = tmp_path
|
|
715
|
+
archived = tmp_path / "docs/comet/archive/2026-07-17-add-unique-counting"
|
|
716
|
+
(archived / "runtime").mkdir(parents=True)
|
|
717
|
+
(archived / "specs/unique-word-counting").mkdir(parents=True)
|
|
718
|
+
(tmp_path / "docs/comet/changes").mkdir(parents=True)
|
|
719
|
+
canonical = tmp_path / "docs/comet/specs/unique-word-counting/spec.md"
|
|
720
|
+
canonical.parent.mkdir(parents=True)
|
|
721
|
+
state = {
|
|
722
|
+
"name": "add-unique-counting",
|
|
723
|
+
"phase": "archive",
|
|
724
|
+
"approval": "confirmed",
|
|
725
|
+
"archived": True,
|
|
726
|
+
"verification_result": "pass",
|
|
727
|
+
}
|
|
728
|
+
(archived / "comet-state.yaml").write_text(yaml.safe_dump(state), encoding="utf-8")
|
|
729
|
+
decision = (
|
|
730
|
+
"Case-fold tokens with str.lower(), strip punctuation from the start and end of each "
|
|
731
|
+
"token. Internal punctuation is preserved; apostrophes are not removed."
|
|
732
|
+
)
|
|
733
|
+
(archived / "brief.md").write_text(f"# Decisions\n{decision}\n", encoding="utf-8")
|
|
734
|
+
(archived / "specs/unique-word-counting/spec.md").write_text(decision, encoding="utf-8")
|
|
735
|
+
canonical.write_text(decision, encoding="utf-8")
|
|
736
|
+
write_json(
|
|
737
|
+
tmp_path / ".cache/comet-native-eval/resume-status.json",
|
|
738
|
+
{
|
|
739
|
+
"command": "status",
|
|
740
|
+
"exitCode": 0,
|
|
741
|
+
"data": {"name": "add-unique-counting", "phase": "build"},
|
|
742
|
+
},
|
|
743
|
+
)
|
|
744
|
+
preflight_hash = "a" * 64
|
|
745
|
+
transaction_id = "aaaaaaaa-1111-2222-3333-bbbbbbbbbbbb"
|
|
746
|
+
write_json(
|
|
747
|
+
tmp_path / ".cache/comet-native-eval/archive-preview.json",
|
|
748
|
+
{
|
|
749
|
+
"command": "archive --dry-run",
|
|
750
|
+
"exitCode": 0,
|
|
751
|
+
"data": {
|
|
752
|
+
"ready": True,
|
|
753
|
+
"evidenceFreshness": "complete",
|
|
754
|
+
"findingCodes": [],
|
|
755
|
+
"preflightHash": preflight_hash,
|
|
756
|
+
},
|
|
757
|
+
},
|
|
758
|
+
)
|
|
759
|
+
write_json(
|
|
760
|
+
tmp_path / ".cache/comet-native-eval/archive-commit.json",
|
|
761
|
+
{
|
|
762
|
+
"command": "archive",
|
|
763
|
+
"exitCode": 0,
|
|
764
|
+
"data": {
|
|
765
|
+
"preflightHash": preflight_hash,
|
|
766
|
+
"transactionId": transaction_id,
|
|
767
|
+
},
|
|
768
|
+
},
|
|
769
|
+
)
|
|
770
|
+
write_archive_transaction(
|
|
771
|
+
tmp_path,
|
|
772
|
+
transaction_id,
|
|
773
|
+
"add-unique-counting",
|
|
774
|
+
preflight_hash,
|
|
775
|
+
)
|
|
776
|
+
write_json(
|
|
777
|
+
tmp_path / "_test_context.json",
|
|
778
|
+
{
|
|
779
|
+
"interaction": {
|
|
780
|
+
"mode": "auto_user",
|
|
781
|
+
"decision_points": 1,
|
|
782
|
+
"deterministic_replies": 1,
|
|
783
|
+
"fresh_resume_boundaries": 1,
|
|
784
|
+
"actual_turns": 2,
|
|
785
|
+
"max_turns": 4,
|
|
786
|
+
}
|
|
787
|
+
},
|
|
788
|
+
)
|
|
789
|
+
|
|
790
|
+
assert validator.check_decision_and_resume()["status"] == "passed"
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
def test_wave_c_validator_requires_bound_partial_stale_and_complete_archive(tmp_path: Path):
|
|
794
|
+
validator = load_validator(
|
|
795
|
+
"comet-native-wave-c-verification-integrity",
|
|
796
|
+
"test_native_wave_c_verification_integrity.py",
|
|
797
|
+
)
|
|
798
|
+
validator.WORKSPACE = tmp_path
|
|
799
|
+
for name in ("wordcount.py", "test_wordcount.py"):
|
|
800
|
+
source = TASKS_ROOT / "comet-native-wave-c-verification-integrity/environment" / name
|
|
801
|
+
(tmp_path / name).write_bytes(source.read_bytes())
|
|
802
|
+
evidence = tmp_path / ".cache/comet-native-eval"
|
|
803
|
+
archive = tmp_path / "docs/comet/archive/2026-07-17-add-longest-word"
|
|
804
|
+
archive.mkdir(parents=True)
|
|
805
|
+
state = {
|
|
806
|
+
"name": "add-longest-word",
|
|
807
|
+
"phase": "archive",
|
|
808
|
+
"archived": True,
|
|
809
|
+
"verification_result": "pass",
|
|
810
|
+
}
|
|
811
|
+
contract = write_contract_artifacts(archive, state, "longest-word")
|
|
812
|
+
partial_ref = write_verification_bundle(
|
|
813
|
+
tmp_path,
|
|
814
|
+
archive,
|
|
815
|
+
state,
|
|
816
|
+
contract,
|
|
817
|
+
result="pass",
|
|
818
|
+
source_revision=5,
|
|
819
|
+
created_at="2026-07-17T00:00:05.000Z",
|
|
820
|
+
partial=True,
|
|
821
|
+
)
|
|
822
|
+
partial_envelope = json.loads((archive / partial_ref).read_text(encoding="utf-8"))
|
|
823
|
+
partial_hash = partial_envelope["implementationScopeHash"]
|
|
824
|
+
final_ref = write_verification_bundle(
|
|
825
|
+
tmp_path,
|
|
826
|
+
archive,
|
|
827
|
+
state,
|
|
828
|
+
contract,
|
|
829
|
+
result="pass",
|
|
830
|
+
source_revision=9,
|
|
831
|
+
created_at="2026-07-17T00:00:09.000Z",
|
|
832
|
+
include_receipt=True,
|
|
833
|
+
)
|
|
834
|
+
state["verification_evidence"] = final_ref
|
|
835
|
+
(archive / "comet-state.yaml").write_text(yaml.safe_dump(state), encoding="utf-8")
|
|
836
|
+
stale_hash = "b" * 64
|
|
837
|
+
final_hash = "c" * 64
|
|
838
|
+
transaction_id = "cccccccc-1111-2222-3333-dddddddddddd"
|
|
839
|
+
write_json(
|
|
840
|
+
evidence / "partial-scope.json",
|
|
841
|
+
{
|
|
842
|
+
"command": "next",
|
|
843
|
+
"exitCode": 65,
|
|
844
|
+
"data": {
|
|
845
|
+
"next": "manual",
|
|
846
|
+
"preparedScope": {
|
|
847
|
+
"complete": False,
|
|
848
|
+
"unresolvedScopeCount": 1,
|
|
849
|
+
"scopeHash": partial_hash,
|
|
850
|
+
},
|
|
851
|
+
"findings": [{"code": "verification-scope-partial"}],
|
|
852
|
+
},
|
|
853
|
+
},
|
|
854
|
+
)
|
|
855
|
+
write_json(
|
|
856
|
+
evidence / "partial-archive-preview.json",
|
|
857
|
+
{
|
|
858
|
+
"command": "archive --dry-run",
|
|
859
|
+
"exitCode": 0,
|
|
860
|
+
"data": {
|
|
861
|
+
"ready": True,
|
|
862
|
+
"evidenceFreshness": "partial",
|
|
863
|
+
"findingCodes": [],
|
|
864
|
+
"preflightHash": partial_hash,
|
|
865
|
+
},
|
|
866
|
+
},
|
|
867
|
+
)
|
|
868
|
+
write_json(
|
|
869
|
+
evidence / "stale-status.json",
|
|
870
|
+
{
|
|
871
|
+
"command": "status",
|
|
872
|
+
"exitCode": 0,
|
|
873
|
+
"data": {
|
|
874
|
+
"phase": "archive",
|
|
875
|
+
"archiveReady": False,
|
|
876
|
+
"findingSummary": {"codes": ["verification-evidence-stale"]},
|
|
877
|
+
},
|
|
878
|
+
},
|
|
879
|
+
)
|
|
880
|
+
stale_preview = {
|
|
881
|
+
"ready": False,
|
|
882
|
+
"evidenceFreshness": "stale",
|
|
883
|
+
"findingCodes": ["verification-evidence-stale"],
|
|
884
|
+
"preflightHash": stale_hash,
|
|
885
|
+
}
|
|
886
|
+
write_json(
|
|
887
|
+
evidence / "stale-archive-preview.json",
|
|
888
|
+
{"command": "archive --dry-run", "exitCode": 0, "data": stale_preview},
|
|
889
|
+
)
|
|
890
|
+
write_json(
|
|
891
|
+
evidence / "stale-archive-commit.json",
|
|
892
|
+
{
|
|
893
|
+
"command": "archive",
|
|
894
|
+
"exitCode": 73,
|
|
895
|
+
"data": stale_preview,
|
|
896
|
+
"error": {"code": "conflict", "message": "Archive preflight changed"},
|
|
897
|
+
},
|
|
898
|
+
)
|
|
899
|
+
final_preview = {
|
|
900
|
+
"ready": True,
|
|
901
|
+
"evidenceFreshness": "complete",
|
|
902
|
+
"findingCodes": [],
|
|
903
|
+
"preflightHash": final_hash,
|
|
904
|
+
}
|
|
905
|
+
write_json(
|
|
906
|
+
evidence / "final-archive-preview.json",
|
|
907
|
+
{"command": "archive --dry-run", "exitCode": 0, "data": final_preview},
|
|
908
|
+
)
|
|
909
|
+
write_json(
|
|
910
|
+
evidence / "archive-commit.json",
|
|
911
|
+
{
|
|
912
|
+
"command": "archive",
|
|
913
|
+
"exitCode": 0,
|
|
914
|
+
"data": {
|
|
915
|
+
"preflightHash": final_hash,
|
|
916
|
+
"transactionId": transaction_id,
|
|
917
|
+
},
|
|
918
|
+
},
|
|
919
|
+
)
|
|
920
|
+
write_archive_transaction(tmp_path, transaction_id, "add-longest-word", final_hash)
|
|
921
|
+
(archive / "runtime/trajectory.jsonl").write_text(
|
|
922
|
+
"\n".join(
|
|
923
|
+
json.dumps(
|
|
924
|
+
{
|
|
925
|
+
"sequence": index,
|
|
926
|
+
"timestamp": "2026-07-17T00:00:00.000Z",
|
|
927
|
+
"runId": "verification-run",
|
|
928
|
+
"type": "state_transitioned",
|
|
929
|
+
"data": {
|
|
930
|
+
"previousPhase": previous,
|
|
931
|
+
"nextPhase": next_phase,
|
|
932
|
+
},
|
|
933
|
+
}
|
|
934
|
+
)
|
|
935
|
+
for index, (previous, next_phase) in enumerate(
|
|
936
|
+
[
|
|
937
|
+
("shape", "build"),
|
|
938
|
+
("build", "verify"),
|
|
939
|
+
("verify", "archive"),
|
|
940
|
+
("archive", "build"),
|
|
941
|
+
("build", "verify"),
|
|
942
|
+
("verify", "archive"),
|
|
943
|
+
("archive", None),
|
|
944
|
+
],
|
|
945
|
+
1,
|
|
946
|
+
)
|
|
947
|
+
)
|
|
948
|
+
+ "\n",
|
|
949
|
+
encoding="utf-8",
|
|
950
|
+
)
|
|
951
|
+
(tmp_path / "docs/comet/changes").mkdir(parents=True)
|
|
952
|
+
|
|
953
|
+
result = validator.check_verification_integrity()
|
|
954
|
+
assert result["status"] == "passed", result
|
|
955
|
+
|
|
956
|
+
partial_scope_path = evidence / "partial-scope.json"
|
|
957
|
+
partial_scope = json.loads(partial_scope_path.read_text(encoding="utf-8"))
|
|
958
|
+
partial_scope["data"]["preparedScope"]["unresolvedScopeCount"] = 2
|
|
959
|
+
write_json(partial_scope_path, partial_scope)
|
|
960
|
+
result = validator.check_verification_integrity()
|
|
961
|
+
assert result["status"] == "failed", result
|
|
962
|
+
assert "count" in result["reason"].lower()
|
|
963
|
+
|
|
964
|
+
|
|
965
|
+
def test_verification_parser_rejects_forged_acceptance_ids_and_hash_corruption(tmp_path: Path):
|
|
966
|
+
for name in ("wordcount.py", "test_wordcount.py"):
|
|
967
|
+
source = TASKS_ROOT / "comet-native-wave-c-verification-integrity/environment" / name
|
|
968
|
+
(tmp_path / name).write_bytes(source.read_bytes())
|
|
969
|
+
root = tmp_path / "docs/comet/changes/strict-evidence"
|
|
970
|
+
root.mkdir(parents=True)
|
|
971
|
+
state = {"name": "strict-evidence", "phase": "archive", "verification_result": "pass"}
|
|
972
|
+
contract = write_contract_artifacts(root, state, "strict-evidence")
|
|
973
|
+
ref = write_verification_bundle(
|
|
974
|
+
tmp_path,
|
|
975
|
+
root,
|
|
976
|
+
state,
|
|
977
|
+
contract,
|
|
978
|
+
result="pass",
|
|
979
|
+
source_revision=3,
|
|
980
|
+
created_at="2026-07-17T00:00:03.000Z",
|
|
981
|
+
)
|
|
982
|
+
parse_verification_bundle(
|
|
983
|
+
project_root=tmp_path,
|
|
984
|
+
change_root=root,
|
|
985
|
+
evidence_ref=ref,
|
|
986
|
+
state=state,
|
|
987
|
+
verify_current_files=True,
|
|
988
|
+
)
|
|
989
|
+
|
|
990
|
+
envelope = json.loads((root / ref).read_text(encoding="utf-8"))
|
|
991
|
+
envelope["acceptanceTrace"]["entries"][0]["acceptanceId"] = f"acceptance-{'0' * 64}"
|
|
992
|
+
trace_content = {
|
|
993
|
+
key: value for key, value in envelope["acceptanceTrace"].items() if key != "traceHash"
|
|
994
|
+
}
|
|
995
|
+
envelope["acceptanceTrace"]["traceHash"] = canonical_hash(
|
|
996
|
+
"comet.native.acceptance-trace.v1", trace_content
|
|
997
|
+
)
|
|
998
|
+
content = {key: value for key, value in envelope.items() if key != "envelopeHash"}
|
|
999
|
+
forged_hash = canonical_hash("comet.native.verification-evidence.v1", content)
|
|
1000
|
+
envelope["envelopeHash"] = forged_hash
|
|
1001
|
+
forged_ref = f"runtime/evidence/verifications/{forged_hash}.json"
|
|
1002
|
+
write_json(root / forged_ref, envelope)
|
|
1003
|
+
with pytest.raises(ValueError, match="contract|forged"):
|
|
1004
|
+
parse_verification_bundle(
|
|
1005
|
+
project_root=tmp_path,
|
|
1006
|
+
change_root=root,
|
|
1007
|
+
evidence_ref=forged_ref,
|
|
1008
|
+
state=state,
|
|
1009
|
+
)
|
|
1010
|
+
|
|
1011
|
+
original = json.loads((root / ref).read_text(encoding="utf-8"))
|
|
1012
|
+
(root / original["reportRef"]).write_text("tampered report\n", encoding="utf-8")
|
|
1013
|
+
with pytest.raises(ValueError, match="report content hash"):
|
|
1014
|
+
parse_verification_bundle(
|
|
1015
|
+
project_root=tmp_path,
|
|
1016
|
+
change_root=root,
|
|
1017
|
+
evidence_ref=ref,
|
|
1018
|
+
state=state,
|
|
1019
|
+
verify_current_files=True,
|
|
1020
|
+
)
|
|
1021
|
+
|
|
1022
|
+
|
|
1023
|
+
def test_scope_parser_rejects_runtime_impossible_self_consistent_unresolved_scope(
|
|
1024
|
+
tmp_path: Path,
|
|
1025
|
+
):
|
|
1026
|
+
for name in ("wordcount.py", "test_wordcount.py"):
|
|
1027
|
+
source = TASKS_ROOT / "comet-native-wave-c-verification-integrity/environment" / name
|
|
1028
|
+
(tmp_path / name).write_bytes(source.read_bytes())
|
|
1029
|
+
root = tmp_path / "docs/comet/changes/forged-scope"
|
|
1030
|
+
root.mkdir(parents=True)
|
|
1031
|
+
scope_ref, _ = write_scope(tmp_path, root, "1" * 64, partial=True)
|
|
1032
|
+
parse_scope_bundle(root, scope_ref)
|
|
1033
|
+
|
|
1034
|
+
scope = json.loads((root / scope_ref).read_text(encoding="utf-8"))
|
|
1035
|
+
forged_identity = {
|
|
1036
|
+
"kind": "snapshot-omission",
|
|
1037
|
+
"source": "baseline",
|
|
1038
|
+
"path": "unrelated.txt",
|
|
1039
|
+
"evidence": {"reason": "unreadable", "size": 1, "type": "file"},
|
|
1040
|
+
}
|
|
1041
|
+
scope["unresolvedScopes"] = [
|
|
1042
|
+
{
|
|
1043
|
+
"id": (
|
|
1044
|
+
"scope:" + canonical_hash("comet.native.unresolved-scope-id.v1", forged_identity)
|
|
1045
|
+
),
|
|
1046
|
+
"kind": forged_identity["kind"],
|
|
1047
|
+
"source": forged_identity["source"],
|
|
1048
|
+
"path": forged_identity["path"],
|
|
1049
|
+
"reason": "baseline snapshot omitted unrelated.txt: unreadable",
|
|
1050
|
+
}
|
|
1051
|
+
]
|
|
1052
|
+
content = {key: value for key, value in scope.items() if key != "scopeHash"}
|
|
1053
|
+
scope_hash = canonical_hash("comet.native.implementation-scope.v2", content)
|
|
1054
|
+
scope["scopeHash"] = scope_hash
|
|
1055
|
+
forged_ref = f"runtime/evidence/scopes/{scope_hash}.json"
|
|
1056
|
+
write_json(root / forged_ref, scope)
|
|
1057
|
+
|
|
1058
|
+
with pytest.raises(ValueError, match="unresolved|scope"):
|
|
1059
|
+
parse_scope_bundle(root, forged_ref)
|
|
1060
|
+
|
|
1061
|
+
|
|
1062
|
+
def test_scope_parser_derives_omission_scopes_from_snapshot_facts(tmp_path: Path):
|
|
1063
|
+
for name in ("wordcount.py", "test_wordcount.py"):
|
|
1064
|
+
source = TASKS_ROOT / "comet-native-wave-c-verification-integrity/environment" / name
|
|
1065
|
+
(tmp_path / name).write_bytes(source.read_bytes())
|
|
1066
|
+
root = tmp_path / "docs/comet/changes/omitted-scope"
|
|
1067
|
+
root.mkdir(parents=True)
|
|
1068
|
+
scope_ref, _ = write_scope(tmp_path, root, "2" * 64, partial=True)
|
|
1069
|
+
|
|
1070
|
+
scope = json.loads((root / scope_ref).read_text(encoding="utf-8"))
|
|
1071
|
+
baseline_ref = scope["baselineProjectionRef"]
|
|
1072
|
+
baseline = json.loads((root / baseline_ref).read_text(encoding="utf-8"))
|
|
1073
|
+
baseline.update(
|
|
1074
|
+
{
|
|
1075
|
+
"complete": False,
|
|
1076
|
+
"omitted": [
|
|
1077
|
+
{
|
|
1078
|
+
"path": "too-large.bin",
|
|
1079
|
+
"size": 10,
|
|
1080
|
+
"type": "file",
|
|
1081
|
+
"reason": "file-size",
|
|
1082
|
+
}
|
|
1083
|
+
],
|
|
1084
|
+
"omittedCount": 1,
|
|
1085
|
+
}
|
|
1086
|
+
)
|
|
1087
|
+
baseline_hash = canonical_hash("comet.native.content-snapshot-projection.v1", baseline)
|
|
1088
|
+
baseline_ref = f"runtime/evidence/snapshots/{baseline_hash}.json"
|
|
1089
|
+
write_json(root / baseline_ref, baseline)
|
|
1090
|
+
scope["baselineProjectionHash"] = baseline_hash
|
|
1091
|
+
scope["baselineProjectionRef"] = baseline_ref
|
|
1092
|
+
omission_identity = {
|
|
1093
|
+
"kind": "snapshot-omission",
|
|
1094
|
+
"source": "baseline",
|
|
1095
|
+
"path": "too-large.bin",
|
|
1096
|
+
"evidence": {"reason": "file-size", "size": 10, "type": "file"},
|
|
1097
|
+
}
|
|
1098
|
+
incomplete_identity = {
|
|
1099
|
+
"kind": "snapshot-incomplete",
|
|
1100
|
+
"source": "baseline",
|
|
1101
|
+
"path": None,
|
|
1102
|
+
"evidence": {"omittedCount": 1},
|
|
1103
|
+
}
|
|
1104
|
+
derived = [
|
|
1105
|
+
{
|
|
1106
|
+
"id": (
|
|
1107
|
+
"scope:" + canonical_hash("comet.native.unresolved-scope-id.v1", omission_identity)
|
|
1108
|
+
),
|
|
1109
|
+
"kind": "snapshot-omission",
|
|
1110
|
+
"source": "baseline",
|
|
1111
|
+
"path": "too-large.bin",
|
|
1112
|
+
"reason": "baseline snapshot omitted too-large.bin: file-size",
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
"id": (
|
|
1116
|
+
"scope:"
|
|
1117
|
+
+ canonical_hash("comet.native.unresolved-scope-id.v1", incomplete_identity)
|
|
1118
|
+
),
|
|
1119
|
+
"kind": "snapshot-incomplete",
|
|
1120
|
+
"source": "baseline",
|
|
1121
|
+
"path": None,
|
|
1122
|
+
"reason": "baseline snapshot is incomplete",
|
|
1123
|
+
},
|
|
1124
|
+
]
|
|
1125
|
+
original_unresolved = scope["unresolvedScopes"]
|
|
1126
|
+
scope["unresolvedScopes"] = sorted(
|
|
1127
|
+
[*original_unresolved, *derived],
|
|
1128
|
+
key=lambda item: (
|
|
1129
|
+
item["kind"],
|
|
1130
|
+
item["source"],
|
|
1131
|
+
(0, "") if item["path"] is None else (1, item["path"]),
|
|
1132
|
+
item["id"],
|
|
1133
|
+
),
|
|
1134
|
+
)
|
|
1135
|
+
content = {key: value for key, value in scope.items() if key != "scopeHash"}
|
|
1136
|
+
scope_hash = canonical_hash("comet.native.implementation-scope.v2", content)
|
|
1137
|
+
scope["scopeHash"] = scope_hash
|
|
1138
|
+
valid_ref = f"runtime/evidence/scopes/{scope_hash}.json"
|
|
1139
|
+
write_json(root / valid_ref, scope)
|
|
1140
|
+
parse_scope_bundle(root, valid_ref)
|
|
1141
|
+
|
|
1142
|
+
scope["unresolvedScopes"] = original_unresolved
|
|
1143
|
+
content = {key: value for key, value in scope.items() if key != "scopeHash"}
|
|
1144
|
+
scope_hash = canonical_hash("comet.native.implementation-scope.v2", content)
|
|
1145
|
+
scope["scopeHash"] = scope_hash
|
|
1146
|
+
forged_ref = f"runtime/evidence/scopes/{scope_hash}.json"
|
|
1147
|
+
write_json(root / forged_ref, scope)
|
|
1148
|
+
|
|
1149
|
+
with pytest.raises(ValueError, match="omission|unresolved|scope"):
|
|
1150
|
+
parse_scope_bundle(root, forged_ref)
|
|
1151
|
+
|
|
1152
|
+
|
|
1153
|
+
@pytest.mark.parametrize(
|
|
1154
|
+
"forgery",
|
|
1155
|
+
[
|
|
1156
|
+
"change",
|
|
1157
|
+
"revision",
|
|
1158
|
+
"checker",
|
|
1159
|
+
"contract",
|
|
1160
|
+
"implementation",
|
|
1161
|
+
"coverage",
|
|
1162
|
+
"issue-counts",
|
|
1163
|
+
"issue-order",
|
|
1164
|
+
],
|
|
1165
|
+
)
|
|
1166
|
+
def test_verification_parser_rejects_self_consistent_forged_check_receipts(
|
|
1167
|
+
tmp_path: Path,
|
|
1168
|
+
forgery: str,
|
|
1169
|
+
):
|
|
1170
|
+
for name in ("wordcount.py", "test_wordcount.py"):
|
|
1171
|
+
source = TASKS_ROOT / "comet-native-wave-c-verification-integrity/environment" / name
|
|
1172
|
+
(tmp_path / name).write_bytes(source.read_bytes())
|
|
1173
|
+
root = tmp_path / "docs/comet/changes/receipt-bound"
|
|
1174
|
+
root.mkdir(parents=True)
|
|
1175
|
+
state = {"name": "receipt-bound", "phase": "archive", "verification_result": "pass"}
|
|
1176
|
+
contract = write_contract_artifacts(root, state, "receipt-bound")
|
|
1177
|
+
ref = write_verification_bundle(
|
|
1178
|
+
tmp_path,
|
|
1179
|
+
root,
|
|
1180
|
+
state,
|
|
1181
|
+
contract,
|
|
1182
|
+
result="pass",
|
|
1183
|
+
source_revision=3,
|
|
1184
|
+
created_at="2026-07-17T00:00:03.000Z",
|
|
1185
|
+
include_receipt=True,
|
|
1186
|
+
)
|
|
1187
|
+
parse_verification_bundle(
|
|
1188
|
+
project_root=tmp_path,
|
|
1189
|
+
change_root=root,
|
|
1190
|
+
evidence_ref=ref,
|
|
1191
|
+
state=state,
|
|
1192
|
+
verify_current_files=True,
|
|
1193
|
+
)
|
|
1194
|
+
|
|
1195
|
+
envelope = json.loads((root / ref).read_text(encoding="utf-8"))
|
|
1196
|
+
receipt = json.loads((root / envelope["receiptRef"]).read_text(encoding="utf-8"))
|
|
1197
|
+
if forgery == "change":
|
|
1198
|
+
receipt["change"] = "other-change"
|
|
1199
|
+
elif forgery == "revision":
|
|
1200
|
+
receipt["sourceRevision"] += 1
|
|
1201
|
+
elif forgery == "checker":
|
|
1202
|
+
receipt["checker"] = {
|
|
1203
|
+
"policy": "forged-policy",
|
|
1204
|
+
"version": 2,
|
|
1205
|
+
"hash": "f" * 64,
|
|
1206
|
+
"limits": CHECK_LIMITS,
|
|
1207
|
+
}
|
|
1208
|
+
elif forgery == "contract":
|
|
1209
|
+
receipt["contract"] = {
|
|
1210
|
+
"expectedHash": "a" * 64,
|
|
1211
|
+
"beforeHash": "a" * 64,
|
|
1212
|
+
"afterHash": "a" * 64,
|
|
1213
|
+
}
|
|
1214
|
+
elif forgery == "implementation":
|
|
1215
|
+
receipt["implementation"] = {
|
|
1216
|
+
"scopeHash": "b" * 64,
|
|
1217
|
+
"expectedSnapshotHash": "c" * 64,
|
|
1218
|
+
"beforeSnapshotHash": "c" * 64,
|
|
1219
|
+
"afterSnapshotHash": "c" * 64,
|
|
1220
|
+
}
|
|
1221
|
+
elif forgery == "coverage":
|
|
1222
|
+
receipt["counts"].update({"filesSelected": 1, "filesScanned": 1})
|
|
1223
|
+
elif forgery == "issue-counts":
|
|
1224
|
+
receipt["status"] = "failed"
|
|
1225
|
+
receipt["counts"].update({"issueCount": 1, "recordedIssueCount": 1})
|
|
1226
|
+
receipt["issuesTruncated"] = True
|
|
1227
|
+
elif forgery == "issue-order":
|
|
1228
|
+
receipt["status"] = "failed"
|
|
1229
|
+
receipt["counts"].update({"issueCount": 2, "recordedIssueCount": 2})
|
|
1230
|
+
receipt["issues"] = [
|
|
1231
|
+
{"path": "z.py", "line": 2, "kind": "trailing-whitespace"},
|
|
1232
|
+
{"path": "a.py", "line": 1, "kind": "conflict-marker"},
|
|
1233
|
+
]
|
|
1234
|
+
|
|
1235
|
+
receipt["inputHash"] = canonical_hash(
|
|
1236
|
+
"comet.native.check-input.v1",
|
|
1237
|
+
{
|
|
1238
|
+
"change": receipt["change"],
|
|
1239
|
+
"sourceRevision": receipt["sourceRevision"],
|
|
1240
|
+
"checkerHash": receipt["checker"]["hash"],
|
|
1241
|
+
"contractHash": receipt["contract"]["expectedHash"],
|
|
1242
|
+
"scopeHash": receipt["implementation"]["scopeHash"],
|
|
1243
|
+
"snapshotHash": receipt["implementation"]["expectedSnapshotHash"],
|
|
1244
|
+
},
|
|
1245
|
+
)
|
|
1246
|
+
receipt_content = {key: value for key, value in receipt.items() if key != "receiptHash"}
|
|
1247
|
+
receipt_hash = canonical_hash("comet.native.check-receipt.v1", receipt_content)
|
|
1248
|
+
receipt["receiptHash"] = receipt_hash
|
|
1249
|
+
receipt_ref = f"runtime/evidence/check-receipts/{receipt_hash}.json"
|
|
1250
|
+
write_json(root / receipt_ref, receipt)
|
|
1251
|
+
envelope["receiptRef"] = receipt_ref
|
|
1252
|
+
envelope_content = {key: value for key, value in envelope.items() if key != "envelopeHash"}
|
|
1253
|
+
envelope_hash = canonical_hash("comet.native.verification-evidence.v1", envelope_content)
|
|
1254
|
+
envelope["envelopeHash"] = envelope_hash
|
|
1255
|
+
forged_ref = f"runtime/evidence/verifications/{envelope_hash}.json"
|
|
1256
|
+
write_json(root / forged_ref, envelope)
|
|
1257
|
+
|
|
1258
|
+
with pytest.raises(ValueError, match="receipt|checker|coverage|issue"):
|
|
1259
|
+
parse_verification_bundle(
|
|
1260
|
+
project_root=tmp_path,
|
|
1261
|
+
change_root=root,
|
|
1262
|
+
evidence_ref=forged_ref,
|
|
1263
|
+
state=state,
|
|
1264
|
+
verify_current_files=True,
|
|
1265
|
+
)
|
|
1266
|
+
|
|
1267
|
+
|
|
1268
|
+
def test_verification_parser_rejects_receipt_content_hash_corruption(tmp_path: Path):
|
|
1269
|
+
for name in ("wordcount.py", "test_wordcount.py"):
|
|
1270
|
+
source = TASKS_ROOT / "comet-native-wave-c-verification-integrity/environment" / name
|
|
1271
|
+
(tmp_path / name).write_bytes(source.read_bytes())
|
|
1272
|
+
root = tmp_path / "docs/comet/changes/receipt-hash"
|
|
1273
|
+
root.mkdir(parents=True)
|
|
1274
|
+
state = {"name": "receipt-hash", "phase": "archive", "verification_result": "pass"}
|
|
1275
|
+
contract = write_contract_artifacts(root, state, "receipt-hash")
|
|
1276
|
+
ref = write_verification_bundle(
|
|
1277
|
+
tmp_path,
|
|
1278
|
+
root,
|
|
1279
|
+
state,
|
|
1280
|
+
contract,
|
|
1281
|
+
result="pass",
|
|
1282
|
+
source_revision=4,
|
|
1283
|
+
created_at="2026-07-17T00:00:04.000Z",
|
|
1284
|
+
include_receipt=True,
|
|
1285
|
+
)
|
|
1286
|
+
envelope = json.loads((root / ref).read_text(encoding="utf-8"))
|
|
1287
|
+
receipt_path = root / envelope["receiptRef"]
|
|
1288
|
+
receipt = json.loads(receipt_path.read_text(encoding="utf-8"))
|
|
1289
|
+
receipt["endedAt"] = "2026-07-17T00:00:02.000Z"
|
|
1290
|
+
write_json(receipt_path, receipt)
|
|
1291
|
+
|
|
1292
|
+
with pytest.raises(ValueError, match="receipt|content hash"):
|
|
1293
|
+
parse_verification_bundle(
|
|
1294
|
+
project_root=tmp_path,
|
|
1295
|
+
change_root=root,
|
|
1296
|
+
evidence_ref=ref,
|
|
1297
|
+
state=state,
|
|
1298
|
+
verify_current_files=True,
|
|
1299
|
+
)
|
|
1300
|
+
|
|
1301
|
+
|
|
1302
|
+
def test_archive_transaction_rejects_reordered_durable_events(tmp_path: Path):
|
|
1303
|
+
archive = tmp_path / "docs/comet/archive/2026-07-17-transaction-check"
|
|
1304
|
+
archive.mkdir(parents=True)
|
|
1305
|
+
transaction_id = "dddddddd-1111-2222-3333-eeeeeeeeeeee"
|
|
1306
|
+
preflight = "f" * 64
|
|
1307
|
+
write_archive_transaction(tmp_path, transaction_id, "transaction-check", preflight)
|
|
1308
|
+
commit = {"transactionId": transaction_id, "preflightHash": preflight}
|
|
1309
|
+
assert (
|
|
1310
|
+
check_archive_transaction(tmp_path, commit, "transaction-check", preflight)["status"]
|
|
1311
|
+
== "passed"
|
|
1312
|
+
)
|
|
1313
|
+
events = tmp_path / f"docs/comet/runtime/transactions/{transaction_id}/events.jsonl"
|
|
1314
|
+
lines = events.read_text(encoding="utf-8").splitlines()
|
|
1315
|
+
lines[1], lines[2] = lines[2], lines[1]
|
|
1316
|
+
events.write_text("\n".join(lines) + "\n", encoding="utf-8")
|
|
1317
|
+
assert (
|
|
1318
|
+
check_archive_transaction(tmp_path, commit, "transaction-check", preflight)["status"]
|
|
1319
|
+
== "failed"
|
|
1320
|
+
)
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
def test_verification_parser_rejects_symlinked_evidence_documents(tmp_path: Path):
|
|
1324
|
+
for name in ("wordcount.py", "test_wordcount.py"):
|
|
1325
|
+
source = TASKS_ROOT / "comet-native-wave-c-verification-integrity/environment" / name
|
|
1326
|
+
(tmp_path / name).write_bytes(source.read_bytes())
|
|
1327
|
+
root = tmp_path / "docs/comet/changes/symlink-evidence"
|
|
1328
|
+
root.mkdir(parents=True)
|
|
1329
|
+
state = {"name": "symlink-evidence", "phase": "archive", "verification_result": "pass"}
|
|
1330
|
+
contract = write_contract_artifacts(root, state, "symlink-evidence")
|
|
1331
|
+
ref = write_verification_bundle(
|
|
1332
|
+
tmp_path,
|
|
1333
|
+
root,
|
|
1334
|
+
state,
|
|
1335
|
+
contract,
|
|
1336
|
+
result="pass",
|
|
1337
|
+
source_revision=3,
|
|
1338
|
+
created_at="2026-07-17T00:00:03.000Z",
|
|
1339
|
+
)
|
|
1340
|
+
envelope = json.loads((root / ref).read_text(encoding="utf-8"))
|
|
1341
|
+
report = root / envelope["reportRef"]
|
|
1342
|
+
outside = tmp_path / "outside-report.md"
|
|
1343
|
+
outside.write_bytes(report.read_bytes())
|
|
1344
|
+
report.unlink()
|
|
1345
|
+
try:
|
|
1346
|
+
report.symlink_to(outside)
|
|
1347
|
+
except OSError as error:
|
|
1348
|
+
pytest.skip(f"Symbolic links are unavailable: {error}")
|
|
1349
|
+
|
|
1350
|
+
with pytest.raises(ValueError, match="regular file|symbolic link"):
|
|
1351
|
+
parse_verification_bundle(
|
|
1352
|
+
project_root=tmp_path,
|
|
1353
|
+
change_root=root,
|
|
1354
|
+
evidence_ref=ref,
|
|
1355
|
+
state=state,
|
|
1356
|
+
verify_current_files=True,
|
|
1357
|
+
)
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
def test_wave_d_validator_requires_third_stop_one_override_and_twelfth_hard_stop(tmp_path: Path):
|
|
1361
|
+
validator = load_validator(
|
|
1362
|
+
"comet-native-wave-d-stagnation-stop", "test_native_wave_d_stagnation_stop.py"
|
|
1363
|
+
)
|
|
1364
|
+
validator.WORKSPACE = tmp_path
|
|
1365
|
+
root = tmp_path / "docs/comet/changes/stalled-average"
|
|
1366
|
+
(root / "runtime/evidence/verifications").mkdir(parents=True)
|
|
1367
|
+
(root / "specs/average-word-length").mkdir(parents=True)
|
|
1368
|
+
(tmp_path / "docs/comet/archive").mkdir(parents=True)
|
|
1369
|
+
for name in ("wordcount.py", "test_wordcount.py"):
|
|
1370
|
+
source = TASKS_ROOT / "comet-native-wave-d-stagnation-stop/environment" / name
|
|
1371
|
+
(tmp_path / name).write_bytes(source.read_bytes().replace(b"\r\n", b"\n"))
|
|
1372
|
+
state = {
|
|
1373
|
+
"name": "stalled-average",
|
|
1374
|
+
"phase": "build",
|
|
1375
|
+
"verification_result": "fail",
|
|
1376
|
+
}
|
|
1377
|
+
contract = write_contract_artifacts(root, state, "average-word-length")
|
|
1378
|
+
envelope_refs = [
|
|
1379
|
+
write_verification_bundle(
|
|
1380
|
+
tmp_path,
|
|
1381
|
+
root,
|
|
1382
|
+
state,
|
|
1383
|
+
contract,
|
|
1384
|
+
result="fail",
|
|
1385
|
+
source_revision=index + 1,
|
|
1386
|
+
created_at=f"2026-07-17T00:00:{index:02}.000Z",
|
|
1387
|
+
)
|
|
1388
|
+
for index in range(1, 13)
|
|
1389
|
+
]
|
|
1390
|
+
state["verification_evidence"] = envelope_refs[-1]
|
|
1391
|
+
(root / "comet-state.yaml").write_text(yaml.safe_dump(state), encoding="utf-8")
|
|
1392
|
+
first_signature = "a" * 64
|
|
1393
|
+
later_signatures = ["b" * 64, "c" * 64]
|
|
1394
|
+
repair_events = [
|
|
1395
|
+
{
|
|
1396
|
+
"signatureHash": first_signature,
|
|
1397
|
+
"disposition": disposition,
|
|
1398
|
+
"overrideSummaryHash": None,
|
|
1399
|
+
}
|
|
1400
|
+
for disposition in ("continue", "warn", "manual-stop")
|
|
1401
|
+
]
|
|
1402
|
+
repair_events.append(
|
|
1403
|
+
{
|
|
1404
|
+
"signatureHash": first_signature,
|
|
1405
|
+
"disposition": "continue",
|
|
1406
|
+
"overrideSummaryHash": "d" * 64,
|
|
1407
|
+
}
|
|
1408
|
+
)
|
|
1409
|
+
for attempt in range(4, 13):
|
|
1410
|
+
signature = later_signatures[(attempt - 4) % 2]
|
|
1411
|
+
repair_events.append(
|
|
1412
|
+
{
|
|
1413
|
+
"signatureHash": signature,
|
|
1414
|
+
"disposition": "hard-stop" if attempt == 12 else "continue",
|
|
1415
|
+
"overrideSummaryHash": None,
|
|
1416
|
+
}
|
|
1417
|
+
)
|
|
1418
|
+
(root / "runtime/trajectory.jsonl").write_text(
|
|
1419
|
+
"\n".join(
|
|
1420
|
+
json.dumps(
|
|
1421
|
+
{
|
|
1422
|
+
"sequence": index,
|
|
1423
|
+
"timestamp": "2026-07-17T00:00:00.000Z",
|
|
1424
|
+
"runId": "repair-run",
|
|
1425
|
+
"type": "state_transitioned",
|
|
1426
|
+
"data": {
|
|
1427
|
+
"previousPhase": (
|
|
1428
|
+
"build" if projection["overrideSummaryHash"] is not None else "verify"
|
|
1429
|
+
),
|
|
1430
|
+
"nextPhase": (
|
|
1431
|
+
"verify" if projection["overrideSummaryHash"] is not None else "build"
|
|
1432
|
+
),
|
|
1433
|
+
"repairStagnation": projection,
|
|
1434
|
+
},
|
|
1435
|
+
}
|
|
1436
|
+
)
|
|
1437
|
+
for index, projection in enumerate(repair_events, 1)
|
|
1438
|
+
)
|
|
1439
|
+
+ "\n",
|
|
1440
|
+
encoding="utf-8",
|
|
1441
|
+
)
|
|
1442
|
+
manual_repair = {
|
|
1443
|
+
"disposition": "manual-stop",
|
|
1444
|
+
"reasonCode": "repeated-failure-stop",
|
|
1445
|
+
"signatureHash": first_signature,
|
|
1446
|
+
"consecutiveFailures": 3,
|
|
1447
|
+
"totalRepairFailures": 3,
|
|
1448
|
+
"remainingIterations": 9,
|
|
1449
|
+
"overrideAccepted": False,
|
|
1450
|
+
}
|
|
1451
|
+
write_json(
|
|
1452
|
+
tmp_path / ".cache/comet-native-eval/manual-stop.json",
|
|
1453
|
+
{
|
|
1454
|
+
"command": "next",
|
|
1455
|
+
"exitCode": 75,
|
|
1456
|
+
"data": {
|
|
1457
|
+
"repair": manual_repair,
|
|
1458
|
+
"findings": [{"code": "repair-stagnation-stop"}],
|
|
1459
|
+
},
|
|
1460
|
+
"error": {"code": "blocked", "message": "Repeated failure requires manual review"},
|
|
1461
|
+
},
|
|
1462
|
+
)
|
|
1463
|
+
write_json(
|
|
1464
|
+
tmp_path / ".cache/comet-native-eval/override.json",
|
|
1465
|
+
{
|
|
1466
|
+
"command": "next",
|
|
1467
|
+
"exitCode": 0,
|
|
1468
|
+
"data": {
|
|
1469
|
+
"previousPhase": "build",
|
|
1470
|
+
"change": {"phase": "verify", "verification_result": "pending"},
|
|
1471
|
+
},
|
|
1472
|
+
},
|
|
1473
|
+
)
|
|
1474
|
+
hard_repair = {
|
|
1475
|
+
"disposition": "hard-stop",
|
|
1476
|
+
"reasonCode": "repair-iteration-limit",
|
|
1477
|
+
"signatureHash": later_signatures[0],
|
|
1478
|
+
"consecutiveFailures": 1,
|
|
1479
|
+
"totalRepairFailures": 12,
|
|
1480
|
+
"remainingIterations": 0,
|
|
1481
|
+
"overrideAccepted": False,
|
|
1482
|
+
}
|
|
1483
|
+
write_json(
|
|
1484
|
+
tmp_path / ".cache/comet-native-eval/hard-stop.json",
|
|
1485
|
+
{
|
|
1486
|
+
"command": "next",
|
|
1487
|
+
"exitCode": 75,
|
|
1488
|
+
"data": {
|
|
1489
|
+
"repair": hard_repair,
|
|
1490
|
+
"findings": [{"code": "repair-iteration-limit"}],
|
|
1491
|
+
},
|
|
1492
|
+
"error": {"code": "blocked", "message": "Repair iteration limit reached"},
|
|
1493
|
+
},
|
|
1494
|
+
)
|
|
1495
|
+
write_json(
|
|
1496
|
+
tmp_path / ".cache/comet-native-eval/hard-stop-status.json",
|
|
1497
|
+
{
|
|
1498
|
+
"command": "status",
|
|
1499
|
+
"exitCode": 0,
|
|
1500
|
+
"data": {
|
|
1501
|
+
"name": "stalled-average",
|
|
1502
|
+
"phase": "build",
|
|
1503
|
+
"verificationResult": "fail",
|
|
1504
|
+
"nextCommand": None,
|
|
1505
|
+
"repair": {
|
|
1506
|
+
"disposition": "hard-stop",
|
|
1507
|
+
"signatureHash": later_signatures[0],
|
|
1508
|
+
"overrideRecorded": False,
|
|
1509
|
+
},
|
|
1510
|
+
"findingSummary": {"codes": ["repair-iteration-limit"]},
|
|
1511
|
+
},
|
|
1512
|
+
},
|
|
1513
|
+
)
|
|
1514
|
+
|
|
1515
|
+
result = validator.check_stagnation_stop()
|
|
1516
|
+
assert result["status"] == "passed", result
|
|
1517
|
+
|
|
1518
|
+
|
|
1519
|
+
def test_wave_e_validator_requires_early_conflict_workspace_and_single_cas_winner(tmp_path: Path):
|
|
1520
|
+
validator = load_validator(
|
|
1521
|
+
"comet-native-wave-e-parallel-safety", "test_native_wave_e_parallel_safety.py"
|
|
1522
|
+
)
|
|
1523
|
+
validator.WORKSPACE = tmp_path
|
|
1524
|
+
for name in ("normalize-case", "preserve-acronyms"):
|
|
1525
|
+
(tmp_path / "docs/comet/changes" / name).mkdir(parents=True)
|
|
1526
|
+
(tmp_path / "docs/comet/archive").mkdir(parents=True)
|
|
1527
|
+
write_json(
|
|
1528
|
+
tmp_path / ".cache/comet-native-eval/conflict-status.json",
|
|
1529
|
+
{
|
|
1530
|
+
"command": "status",
|
|
1531
|
+
"exitCode": 0,
|
|
1532
|
+
"data": {
|
|
1533
|
+
"name": "normalize-case",
|
|
1534
|
+
"phase": "shape",
|
|
1535
|
+
"revision": 1,
|
|
1536
|
+
"findingSummary": {
|
|
1537
|
+
"codes": ["native-change-conflict", "workspace-unattributed-changes"]
|
|
1538
|
+
},
|
|
1539
|
+
},
|
|
1540
|
+
},
|
|
1541
|
+
)
|
|
1542
|
+
write_json(
|
|
1543
|
+
tmp_path / ".cache/comet-native-eval/checkpoint-attempt-a.json",
|
|
1544
|
+
{
|
|
1545
|
+
"command": "checkpoint",
|
|
1546
|
+
"exitCode": 0,
|
|
1547
|
+
"data": {
|
|
1548
|
+
"change": {"name": "normalize-case", "revision": 2},
|
|
1549
|
+
"expectedRevision": 1,
|
|
1550
|
+
"previousRevision": 1,
|
|
1551
|
+
"revision": 2,
|
|
1552
|
+
"outcome": "recorded",
|
|
1553
|
+
},
|
|
1554
|
+
},
|
|
1555
|
+
)
|
|
1556
|
+
write_json(
|
|
1557
|
+
tmp_path / ".cache/comet-native-eval/checkpoint-attempt-b.json",
|
|
1558
|
+
{
|
|
1559
|
+
"command": "checkpoint",
|
|
1560
|
+
"exitCode": 73,
|
|
1561
|
+
"data": {
|
|
1562
|
+
"change": "normalize-case",
|
|
1563
|
+
"expectedRevision": 1,
|
|
1564
|
+
"actualRevision": 2,
|
|
1565
|
+
"outcome": "revision-conflict",
|
|
1566
|
+
},
|
|
1567
|
+
},
|
|
1568
|
+
)
|
|
1569
|
+
|
|
1570
|
+
assert validator.check_parallel_safety()["status"] == "passed"
|
|
1571
|
+
assert validator.check_live_concurrent_cas()["status"] == "failed"
|
|
1572
|
+
|
|
1573
|
+
|
|
1574
|
+
def test_wave_e_barrier_launches_two_independent_cas_processes(tmp_path: Path):
|
|
1575
|
+
validator = load_validator(
|
|
1576
|
+
"comet-native-wave-e-parallel-safety", "test_native_wave_e_parallel_safety.py"
|
|
1577
|
+
)
|
|
1578
|
+
validator.WORKSPACE = tmp_path
|
|
1579
|
+
barrier_root = tmp_path / ".cache/comet-native-eval"
|
|
1580
|
+
barrier_root.mkdir(parents=True)
|
|
1581
|
+
lock = tmp_path / "cas.lock"
|
|
1582
|
+
script = r"""
|
|
1583
|
+
import json, os, pathlib, sys
|
|
1584
|
+
lock = pathlib.Path(sys.argv[1])
|
|
1585
|
+
try:
|
|
1586
|
+
descriptor = os.open(lock, os.O_CREAT | os.O_EXCL | os.O_WRONLY)
|
|
1587
|
+
os.write(descriptor, b"2")
|
|
1588
|
+
os.close(descriptor)
|
|
1589
|
+
code = 0
|
|
1590
|
+
data = {"change": {"name": "normalize-case", "revision": 2}, "expectedRevision": 1, "previousRevision": 1, "revision": 2, "outcome": "recorded", "pid": os.getpid()}
|
|
1591
|
+
except FileExistsError:
|
|
1592
|
+
code = 73
|
|
1593
|
+
data = {"change": "normalize-case", "expectedRevision": 1, "actualRevision": 2, "outcome": "revision-conflict", "pid": os.getpid()}
|
|
1594
|
+
payload = {"command": "checkpoint", "exitCode": code, "data": data}
|
|
1595
|
+
if code:
|
|
1596
|
+
payload["error"] = {"code": "conflict", "message": "revision conflict"}
|
|
1597
|
+
print(json.dumps(payload))
|
|
1598
|
+
raise SystemExit(code)
|
|
1599
|
+
"""
|
|
1600
|
+
commands = [[sys.executable, "-c", script, str(lock), label] for label in ("A", "B")]
|
|
1601
|
+
results = validator.run_barrier_commands(commands, barrier_root)
|
|
1602
|
+
assert all(result.stdout for result in results), [
|
|
1603
|
+
(result.returncode, result.stderr) for result in results
|
|
1604
|
+
]
|
|
1605
|
+
payloads = [json.loads(result.stdout) for result in results]
|
|
1606
|
+
|
|
1607
|
+
assert sorted(result.returncode for result in results) == [0, 73]
|
|
1608
|
+
assert len({payload["data"]["pid"] for payload in payloads}) == 2
|
|
1609
|
+
paths = []
|
|
1610
|
+
for index, payload in enumerate(payloads):
|
|
1611
|
+
path = tmp_path / f"attempt-{index}.json"
|
|
1612
|
+
write_json(path, payload)
|
|
1613
|
+
paths.append(path)
|
|
1614
|
+
assert check_checkpoint_cas_envelopes(paths)["status"] == "passed"
|
|
1615
|
+
|
|
1616
|
+
|
|
1617
|
+
def test_wave_e_live_cas_never_executes_agent_mutable_runtime(tmp_path: Path):
|
|
1618
|
+
validator = load_validator(
|
|
1619
|
+
"comet-native-wave-e-parallel-safety", "test_native_wave_e_parallel_safety.py"
|
|
1620
|
+
)
|
|
1621
|
+
validator.WORKSPACE = tmp_path
|
|
1622
|
+
state_file = tmp_path / "docs/comet/changes/normalize-case/comet-state.yaml"
|
|
1623
|
+
state_file.parent.mkdir(parents=True)
|
|
1624
|
+
state_file.write_text("name: normalize-case\nrevision: 1\n", encoding="utf-8")
|
|
1625
|
+
(tmp_path / ".cache/comet-native-eval").mkdir(parents=True)
|
|
1626
|
+
|
|
1627
|
+
trusted_marker = tmp_path / "trusted-runtime-ran"
|
|
1628
|
+
trusted_root = tmp_path / "_eval_trusted_oracles"
|
|
1629
|
+
trusted_root.mkdir()
|
|
1630
|
+
trusted_runtime = trusted_root / "comet-native-runtime.mjs"
|
|
1631
|
+
trusted_runtime.write_text(
|
|
1632
|
+
"import fs from 'node:fs';\n"
|
|
1633
|
+
f"fs.writeFileSync({json.dumps(str(trusted_marker))}, 'trusted');\n"
|
|
1634
|
+
"console.log(JSON.stringify({command:'checkpoint',exitCode:2,data:{}}));\n"
|
|
1635
|
+
"process.exit(2);\n",
|
|
1636
|
+
encoding="utf-8",
|
|
1637
|
+
)
|
|
1638
|
+
write_json(
|
|
1639
|
+
trusted_root / "native-runtime-identity.json",
|
|
1640
|
+
{
|
|
1641
|
+
"schema": "comet.eval.trusted-native-runtime.v1",
|
|
1642
|
+
"runtimeFile": trusted_runtime.name,
|
|
1643
|
+
"runtimeHash": hashlib.sha256(trusted_runtime.read_bytes()).hexdigest(),
|
|
1644
|
+
},
|
|
1645
|
+
)
|
|
1646
|
+
|
|
1647
|
+
mutable_marker = tmp_path / "agent-runtime-ran"
|
|
1648
|
+
mutable_runtime = tmp_path / ".claude/skills/comet-native/scripts/comet-native-runtime.mjs"
|
|
1649
|
+
mutable_runtime.parent.mkdir(parents=True)
|
|
1650
|
+
mutable_runtime.write_text(
|
|
1651
|
+
"import fs from 'node:fs';\n"
|
|
1652
|
+
f"fs.writeFileSync({json.dumps(str(mutable_marker))}, 'agent');\n"
|
|
1653
|
+
"console.log(JSON.stringify({command:'checkpoint',exitCode:2,data:{}}));\n"
|
|
1654
|
+
"process.exit(2);\n",
|
|
1655
|
+
encoding="utf-8",
|
|
1656
|
+
)
|
|
1657
|
+
|
|
1658
|
+
result = validator.check_live_concurrent_cas()
|
|
1659
|
+
|
|
1660
|
+
assert result["status"] == "failed"
|
|
1661
|
+
assert trusted_marker.is_file()
|
|
1662
|
+
assert not mutable_marker.exists()
|
|
1663
|
+
|
|
1664
|
+
|
|
1665
|
+
def test_wave_f_validator_requires_matching_projection_and_unchanged_tree(tmp_path: Path):
|
|
1666
|
+
validator = load_validator(
|
|
1667
|
+
"comet-native-wave-f-dashboard-readonly", "test_native_wave_f_dashboard_readonly.py"
|
|
1668
|
+
)
|
|
1669
|
+
validator.WORKSPACE = tmp_path
|
|
1670
|
+
projection = {
|
|
1671
|
+
"workflow": "native",
|
|
1672
|
+
"name": "dashboard-visible-change",
|
|
1673
|
+
"phase": "shape",
|
|
1674
|
+
"revision": 1,
|
|
1675
|
+
"selected": True,
|
|
1676
|
+
"nextCommand": 'comet native next dashboard-visible-change --summary "<summary>"',
|
|
1677
|
+
"verificationResult": "pending",
|
|
1678
|
+
"verificationFreshness": "missing",
|
|
1679
|
+
"archiveReady": False,
|
|
1680
|
+
"continuation": {
|
|
1681
|
+
"disposition": "continue",
|
|
1682
|
+
"action": "work-phase",
|
|
1683
|
+
"command": 'comet native next dashboard-visible-change --summary "<summary>"',
|
|
1684
|
+
"requiresUserDecision": False,
|
|
1685
|
+
"requiredInputs": [],
|
|
1686
|
+
"requiredInputsTruncated": False,
|
|
1687
|
+
},
|
|
1688
|
+
"findings": {
|
|
1689
|
+
"total": 0,
|
|
1690
|
+
"errors": 0,
|
|
1691
|
+
"warnings": 0,
|
|
1692
|
+
"info": 0,
|
|
1693
|
+
"requiresUserDecision": False,
|
|
1694
|
+
"codes": [],
|
|
1695
|
+
"truncated": False,
|
|
1696
|
+
},
|
|
1697
|
+
"archive": {
|
|
1698
|
+
"ready": False,
|
|
1699
|
+
"evidenceFreshness": "missing",
|
|
1700
|
+
"operationCount": 1,
|
|
1701
|
+
"findingCodes": ["archive-phase-required", "verification-evidence-missing"],
|
|
1702
|
+
"findingCodesTruncated": False,
|
|
1703
|
+
"preflightHash": "a" * 64,
|
|
1704
|
+
},
|
|
1705
|
+
"conflicts": {
|
|
1706
|
+
"visibleDefiniteConflict": 0,
|
|
1707
|
+
"visiblePossibleOverlap": 0,
|
|
1708
|
+
"peers": [],
|
|
1709
|
+
"peersTruncated": False,
|
|
1710
|
+
},
|
|
1711
|
+
}
|
|
1712
|
+
cli_projection = {
|
|
1713
|
+
"name": projection["name"],
|
|
1714
|
+
"phase": projection["phase"],
|
|
1715
|
+
"revision": projection["revision"],
|
|
1716
|
+
"selected": projection["selected"],
|
|
1717
|
+
"nextCommand": projection["nextCommand"],
|
|
1718
|
+
"verificationResult": projection["verificationResult"],
|
|
1719
|
+
"archiveReady": projection["archiveReady"],
|
|
1720
|
+
"continuation": projection["continuation"],
|
|
1721
|
+
"findingSummary": projection["findings"],
|
|
1722
|
+
}
|
|
1723
|
+
write_json(
|
|
1724
|
+
tmp_path / ".cache/comet-native-eval/cli-before.json",
|
|
1725
|
+
{"command": "status", "exitCode": 0, "data": cli_projection},
|
|
1726
|
+
)
|
|
1727
|
+
write_json(
|
|
1728
|
+
tmp_path / ".cache/comet-native-eval/cli-after.json",
|
|
1729
|
+
{"command": "status", "exitCode": 0, "data": cli_projection},
|
|
1730
|
+
)
|
|
1731
|
+
write_json(
|
|
1732
|
+
tmp_path / ".cache/comet-native-eval/dashboard.json",
|
|
1733
|
+
{
|
|
1734
|
+
"native": {
|
|
1735
|
+
"schema": "comet.dashboard.native.v1",
|
|
1736
|
+
"generatedAt": "2026-07-17T00:00:00.000Z",
|
|
1737
|
+
"totalChangeCount": 1,
|
|
1738
|
+
"visibleChangeCount": 1,
|
|
1739
|
+
"omittedChangeCount": 0,
|
|
1740
|
+
"changesTruncated": False,
|
|
1741
|
+
"changes": [projection],
|
|
1742
|
+
"conflicts": {
|
|
1743
|
+
"available": True,
|
|
1744
|
+
"definiteConflict": 0,
|
|
1745
|
+
"possibleOverlap": 0,
|
|
1746
|
+
"disjoint": 0,
|
|
1747
|
+
"relationshipCount": 0,
|
|
1748
|
+
"visibleRelationshipCount": 0,
|
|
1749
|
+
"omittedRelationshipCount": 0,
|
|
1750
|
+
"relationshipsTruncated": False,
|
|
1751
|
+
},
|
|
1752
|
+
}
|
|
1753
|
+
},
|
|
1754
|
+
)
|
|
1755
|
+
native_change = tmp_path / "docs/comet/changes/dashboard-visible-change"
|
|
1756
|
+
native_change.mkdir(parents=True)
|
|
1757
|
+
(native_change / "comet-state.yaml").write_text(
|
|
1758
|
+
"name: dashboard-visible-change\n", encoding="utf-8"
|
|
1759
|
+
)
|
|
1760
|
+
manifest = {"files": validator._current_native_manifest()}
|
|
1761
|
+
write_json(tmp_path / ".cache/comet-native-eval/native-tree-before.json", manifest)
|
|
1762
|
+
write_json(tmp_path / ".cache/comet-native-eval/native-tree-after.json", manifest)
|
|
1763
|
+
|
|
1764
|
+
readonly = validator.check_dashboard_readonly()
|
|
1765
|
+
assert readonly["status"] == "passed", readonly
|
|
1766
|
+
assert validator.check_public_native_projection()["status"] == "passed"
|
|
1767
|
+
|
|
1768
|
+
|
|
1769
|
+
def test_wave_f_rejects_tampered_controller_source_build(monkeypatch, tmp_path: Path):
|
|
1770
|
+
eval_conftest = sys.modules["conftest"]
|
|
1771
|
+
checkout = tmp_path / "checkout"
|
|
1772
|
+
(checkout / "bin").mkdir(parents=True)
|
|
1773
|
+
(checkout / "bin/comet.js").write_text("import '../dist/app/cli/index.js';\n", encoding="utf-8")
|
|
1774
|
+
(checkout / "package.json").write_text('{"type":"module"}\n', encoding="utf-8")
|
|
1775
|
+
environment = tmp_path / "environment"
|
|
1776
|
+
environment.mkdir()
|
|
1777
|
+
(environment / ".include-current-comet-cli").write_text("include\n", encoding="utf-8")
|
|
1778
|
+
workspace = tmp_path / "workspace"
|
|
1779
|
+
workspace.mkdir()
|
|
1780
|
+
|
|
1781
|
+
def fake_source_build(_checkout: Path, output: Path) -> str:
|
|
1782
|
+
(output / "app/cli").mkdir(parents=True)
|
|
1783
|
+
(output / "domains/dashboard").mkdir(parents=True)
|
|
1784
|
+
(output / "app/cli/index.js").write_text("export {};\n", encoding="utf-8")
|
|
1785
|
+
(output / "domains/dashboard/native-adapter.js").write_text(
|
|
1786
|
+
"export const schema = 'native';\n", encoding="utf-8"
|
|
1787
|
+
)
|
|
1788
|
+
return "5.9.3"
|
|
1789
|
+
|
|
1790
|
+
monkeypatch.setattr(eval_conftest, "REPOSITORY_ROOT", checkout)
|
|
1791
|
+
monkeypatch.setattr(eval_conftest, "_build_current_comet_dist", fake_source_build)
|
|
1792
|
+
eval_conftest._copy_current_comet_cli_snapshot(environment, workspace)
|
|
1793
|
+
validator = load_validator(
|
|
1794
|
+
"comet-native-wave-f-dashboard-readonly", "test_native_wave_f_dashboard_readonly.py"
|
|
1795
|
+
)
|
|
1796
|
+
validator.WORKSPACE = workspace
|
|
1797
|
+
|
|
1798
|
+
assert validator.check_current_cli_build_identity()["status"] == "passed"
|
|
1799
|
+
adapter = workspace / "_eval_current_comet/dist/domains/dashboard/native-adapter.js"
|
|
1800
|
+
adapter.write_text("export const schema = 'forged';\n", encoding="utf-8")
|
|
1801
|
+
assert validator.check_current_cli_build_identity()["status"] == "failed"
|
|
1802
|
+
|
|
1803
|
+
|
|
1804
|
+
def test_wave_f_live_check_rejects_a_single_dashboard_write(monkeypatch, tmp_path: Path):
|
|
1805
|
+
validator = load_validator(
|
|
1806
|
+
"comet-native-wave-f-dashboard-readonly", "test_native_wave_f_dashboard_readonly.py"
|
|
1807
|
+
)
|
|
1808
|
+
validator.WORKSPACE = tmp_path
|
|
1809
|
+
(tmp_path / "_eval_current_comet/bin").mkdir(parents=True)
|
|
1810
|
+
(tmp_path / "_eval_current_comet/bin/comet.js").write_text("// fixture\n", encoding="utf-8")
|
|
1811
|
+
(tmp_path / "current-comet.sh").write_text("#!/usr/bin/env bash\n", encoding="utf-8")
|
|
1812
|
+
native = tmp_path / "docs/comet/changes/dashboard-visible-change"
|
|
1813
|
+
native.mkdir(parents=True)
|
|
1814
|
+
(native / "comet-state.yaml").write_text(
|
|
1815
|
+
"name: dashboard-visible-change\n", encoding="utf-8"
|
|
1816
|
+
)
|
|
1817
|
+
(tmp_path / ".cache/comet-native-eval").mkdir(parents=True)
|
|
1818
|
+
calls = 0
|
|
1819
|
+
|
|
1820
|
+
def write_once(_wrapper: Path, project_root: Path):
|
|
1821
|
+
nonlocal calls
|
|
1822
|
+
calls += 1
|
|
1823
|
+
if calls == 1:
|
|
1824
|
+
target = project_root / "docs/comet/runtime/one-time-write.json"
|
|
1825
|
+
target.parent.mkdir(parents=True, exist_ok=True)
|
|
1826
|
+
target.write_text("{}\n", encoding="utf-8")
|
|
1827
|
+
return {"native": {"changes": []}}
|
|
1828
|
+
|
|
1829
|
+
monkeypatch.setattr(validator, "_run_live_dashboard", write_once)
|
|
1830
|
+
result = validator.check_live_dashboard_and_tree()
|
|
1831
|
+
|
|
1832
|
+
assert result["status"] == "failed"
|
|
1833
|
+
assert "modified the live Native tree" in result["reason"]
|
|
1834
|
+
|
|
1835
|
+
|
|
1836
|
+
def test_wave_f_live_check_never_executes_agent_mutable_wrapper(monkeypatch, tmp_path: Path):
|
|
1837
|
+
validator = load_validator(
|
|
1838
|
+
"comet-native-wave-f-dashboard-readonly", "test_native_wave_f_dashboard_readonly.py"
|
|
1839
|
+
)
|
|
1840
|
+
validator.WORKSPACE = tmp_path
|
|
1841
|
+
projection = {"name": "dashboard-visible-change", "phase": "shape"}
|
|
1842
|
+
dashboard = {"native": {"changes": [projection]}}
|
|
1843
|
+
|
|
1844
|
+
snapshot = tmp_path / "_eval_current_comet"
|
|
1845
|
+
(snapshot / "bin").mkdir(parents=True)
|
|
1846
|
+
(snapshot / "package.json").write_text('{"type":"module"}\n', encoding="utf-8")
|
|
1847
|
+
(snapshot / "bin/comet.js").write_text(
|
|
1848
|
+
f"console.log(JSON.stringify({json.dumps(dashboard)}));\n",
|
|
1849
|
+
encoding="utf-8",
|
|
1850
|
+
)
|
|
1851
|
+
|
|
1852
|
+
mutable_marker = tmp_path / "agent-wrapper-ran"
|
|
1853
|
+
mutable_wrapper = tmp_path / "current-comet.sh"
|
|
1854
|
+
mutable_wrapper.write_text("#!/usr/bin/env bash\nexit 99\n", encoding="utf-8")
|
|
1855
|
+
|
|
1856
|
+
native_change = tmp_path / "docs/comet/changes/dashboard-visible-change"
|
|
1857
|
+
native_change.mkdir(parents=True)
|
|
1858
|
+
(native_change / "comet-state.yaml").write_text(
|
|
1859
|
+
"name: dashboard-visible-change\nphase: shape\n", encoding="utf-8"
|
|
1860
|
+
)
|
|
1861
|
+
(tmp_path / ".comet").mkdir()
|
|
1862
|
+
(tmp_path / ".comet" / "config.yaml").write_text(
|
|
1863
|
+
"schema: comet.project.v1\ndefault_workflow: native\nworkflows:\n - native\nnative:\n artifact_root: docs\n",
|
|
1864
|
+
encoding="utf-8",
|
|
1865
|
+
)
|
|
1866
|
+
evidence = tmp_path / ".cache/comet-native-eval"
|
|
1867
|
+
write_json(
|
|
1868
|
+
evidence / "cli-after.json",
|
|
1869
|
+
{"command": "status", "exitCode": 0, "data": projection},
|
|
1870
|
+
)
|
|
1871
|
+
write_json(
|
|
1872
|
+
evidence / "native-tree-after.json",
|
|
1873
|
+
{"files": validator._current_native_manifest()},
|
|
1874
|
+
)
|
|
1875
|
+
|
|
1876
|
+
real_run = validator.subprocess.run
|
|
1877
|
+
|
|
1878
|
+
def run_process(command, *args, **kwargs):
|
|
1879
|
+
if command[0] == "bash":
|
|
1880
|
+
mutable_marker.write_text("agent", encoding="utf-8")
|
|
1881
|
+
return validator.subprocess.CompletedProcess(command, 0, json.dumps(dashboard), "")
|
|
1882
|
+
return real_run(command, *args, **kwargs)
|
|
1883
|
+
|
|
1884
|
+
monkeypatch.setattr(validator.subprocess, "run", run_process)
|
|
1885
|
+
|
|
1886
|
+
result = validator.check_live_dashboard_and_tree()
|
|
1887
|
+
|
|
1888
|
+
assert result["status"] == "passed", result
|
|
1889
|
+
assert not mutable_marker.exists()
|