@rpamis/comet 0.4.0-beta.16 → 0.4.0-beta.18
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 +85 -56
- package/assets/eval-reports/comet-native-vs-beta16-beta17-20260810/native-benchmark-report.html +8 -0
- package/assets/eval-reports/comet-native-vs-beta16-beta17-20260810/native-benchmark-report.json +286 -0
- package/assets/manifest.json +26 -17
- package/assets/skills/comet/SKILL.md +1 -1
- package/assets/skills/comet/agents/openai.yaml +3 -0
- package/assets/skills/comet/rules/comet-phase-guard.en.md +1 -1
- package/assets/skills/comet/rules/comet-phase-guard.md +1 -1
- package/assets/skills/comet/rules/comet-workflow-guard.en.md +2 -2
- package/assets/skills/comet/rules/comet-workflow-guard.md +2 -2
- package/assets/skills/comet/scripts/comet-archive.mjs +128 -128
- package/assets/skills/comet/scripts/comet-entry-runtime.mjs +77 -77
- package/assets/skills/comet/scripts/comet-guard.mjs +144 -144
- package/assets/skills/comet/scripts/comet-handoff.mjs +107 -107
- package/assets/skills/comet/scripts/comet-hook-guard.mjs +128 -128
- package/assets/skills/comet/scripts/comet-hook-router.mjs +143 -141
- package/assets/skills/comet/scripts/comet-resume-probe.mjs +100 -100
- package/assets/skills/comet/scripts/comet-runtime.mjs +194 -193
- package/assets/skills/comet/scripts/comet-state.mjs +118 -118
- package/assets/skills/comet/scripts/comet-yaml-validate.mjs +95 -95
- package/assets/skills/comet-any/SKILL.md +2 -1
- package/assets/skills/comet-any/agents/openai.yaml +5 -0
- package/assets/skills/comet-archive/SKILL.md +7 -6
- package/assets/skills/comet-archive/agents/openai.yaml +5 -0
- package/assets/skills/comet-build/SKILL.md +28 -68
- package/assets/skills/comet-build/agents/openai.yaml +5 -0
- package/assets/skills/comet-classic/SKILL.md +28 -22
- package/assets/skills/comet-classic/agents/openai.yaml +3 -0
- package/assets/skills/{comet → comet-classic}/reference/auto-transition.md +1 -1
- package/assets/skills/{comet → comet-classic}/reference/comet-yaml-fields.md +3 -3
- package/assets/skills/{comet → comet-classic}/reference/context-recovery.md +5 -5
- package/assets/skills/{comet → comet-classic}/reference/debug-gate.md +2 -2
- package/assets/skills/{comet → comet-classic}/reference/decision-point.md +1 -1
- package/assets/skills/{comet → comet-classic}/reference/dirty-worktree.md +1 -1
- package/assets/skills/{comet → comet-classic}/reference/file-structure.md +1 -1
- package/assets/skills/{comet → comet-classic}/reference/intent-frame.md +1 -1
- package/assets/skills/{comet → comet-classic}/reference/scripts.md +4 -2
- package/assets/skills/{comet → comet-classic}/reference/subagent-dispatch.md +1 -1
- package/assets/skills/comet-classic/reference/workspace.md +23 -0
- package/assets/skills/comet-design/SKILL.md +7 -6
- package/assets/skills/comet-design/agents/openai.yaml +5 -0
- package/assets/skills/comet-hotfix/SKILL.md +10 -9
- package/assets/skills/comet-hotfix/agents/openai.yaml +5 -0
- package/assets/skills/comet-native/SKILL.md +60 -171
- package/assets/skills/comet-native/agents/openai.yaml +3 -0
- package/assets/skills/comet-native/reference/artifacts.md +24 -89
- package/assets/skills/comet-native/reference/clarification.md +54 -29
- package/assets/skills/comet-native/reference/commands.md +30 -173
- package/assets/skills/comet-native/reference/recovery.md +38 -88
- package/assets/skills/comet-native/reference/workspace.md +23 -0
- package/assets/skills/comet-native/scripts/comet-native-archive.mjs +184 -152
- package/assets/skills/comet-native/scripts/comet-native-doctor.mjs +214 -158
- package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +132 -123
- package/assets/skills/comet-native/scripts/comet-native-init.mjs +134 -124
- package/assets/skills/comet-native/scripts/comet-native-new.mjs +165 -158
- package/assets/skills/comet-native/scripts/comet-native-next.mjs +183 -152
- package/assets/skills/comet-native/scripts/comet-native-root.mjs +152 -147
- package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +247 -202
- package/assets/skills/comet-native/scripts/comet-native-select.mjs +150 -143
- package/assets/skills/comet-native/scripts/comet-native-show.mjs +128 -121
- package/assets/skills/comet-native/scripts/comet-native-spec.mjs +133 -151
- package/assets/skills/comet-native/scripts/comet-native-status.mjs +147 -140
- package/assets/skills/comet-open/SKILL.md +31 -11
- package/assets/skills/comet-open/agents/openai.yaml +5 -0
- package/assets/skills/comet-tweak/SKILL.md +11 -10
- package/assets/skills/comet-tweak/agents/openai.yaml +5 -0
- package/assets/skills/comet-verify/SKILL.md +9 -8
- package/assets/skills/comet-verify/agents/openai.yaml +5 -0
- package/assets/skills-zh/comet/SKILL.md +1 -1
- package/assets/skills-zh/comet/agents/openai.yaml +3 -0
- package/assets/skills-zh/comet-any/SKILL.md +2 -1
- package/assets/skills-zh/comet-any/agents/openai.yaml +5 -0
- package/assets/skills-zh/comet-archive/SKILL.md +7 -6
- package/assets/skills-zh/comet-archive/agents/openai.yaml +5 -0
- package/assets/skills-zh/comet-build/SKILL.md +28 -68
- package/assets/skills-zh/comet-build/agents/openai.yaml +5 -0
- package/assets/skills-zh/comet-classic/SKILL.md +29 -23
- package/assets/skills-zh/comet-classic/agents/openai.yaml +3 -0
- package/assets/skills-zh/{comet → comet-classic}/reference/auto-transition.md +1 -1
- package/assets/skills-zh/{comet → comet-classic}/reference/comet-yaml-fields.md +3 -3
- package/assets/skills-zh/{comet → comet-classic}/reference/context-recovery.md +5 -5
- package/assets/skills-zh/{comet → comet-classic}/reference/debug-gate.md +2 -2
- package/assets/skills-zh/{comet → comet-classic}/reference/decision-point.md +1 -1
- package/assets/skills-zh/{comet → comet-classic}/reference/dirty-worktree.md +1 -1
- package/assets/skills-zh/{comet → comet-classic}/reference/file-structure.md +1 -1
- package/assets/skills-zh/{comet → comet-classic}/reference/intent-frame.md +1 -1
- package/assets/skills-zh/{comet → comet-classic}/reference/scripts.md +4 -2
- package/assets/skills-zh/{comet → comet-classic}/reference/subagent-dispatch.md +1 -1
- package/assets/skills-zh/comet-classic/reference/workspace.md +23 -0
- package/assets/skills-zh/comet-design/SKILL.md +7 -6
- package/assets/skills-zh/comet-design/agents/openai.yaml +5 -0
- package/assets/skills-zh/comet-hotfix/SKILL.md +10 -9
- package/assets/skills-zh/comet-hotfix/agents/openai.yaml +5 -0
- package/assets/skills-zh/comet-native/SKILL.md +60 -171
- package/assets/skills-zh/comet-native/agents/openai.yaml +3 -0
- package/assets/skills-zh/comet-native/reference/artifacts.md +24 -89
- package/assets/skills-zh/comet-native/reference/clarification.md +40 -15
- package/assets/skills-zh/comet-native/reference/commands.md +30 -173
- package/assets/skills-zh/comet-native/reference/recovery.md +36 -86
- package/assets/skills-zh/comet-native/reference/workspace.md +23 -0
- package/assets/skills-zh/comet-open/SKILL.md +31 -11
- package/assets/skills-zh/comet-open/agents/openai.yaml +5 -0
- package/assets/skills-zh/comet-tweak/SKILL.md +11 -10
- package/assets/skills-zh/comet-tweak/agents/openai.yaml +5 -0
- package/assets/skills-zh/comet-verify/SKILL.md +9 -8
- package/assets/skills-zh/comet-verify/agents/openai.yaml +5 -0
- package/bin/fast-runtime-router.js +0 -4
- package/dist/app/cli/index.js +20 -1
- package/dist/app/cli/index.js.map +1 -1
- package/dist/app/commands/classic.d.ts.map +1 -1
- package/dist/app/commands/classic.js +2 -0
- package/dist/app/commands/classic.js.map +1 -1
- package/dist/app/commands/doctor.d.ts.map +1 -1
- package/dist/app/commands/doctor.js +8 -0
- package/dist/app/commands/doctor.js.map +1 -1
- package/dist/app/commands/eval.d.ts +9 -2
- package/dist/app/commands/eval.d.ts.map +1 -1
- package/dist/app/commands/eval.js +293 -48
- package/dist/app/commands/eval.js.map +1 -1
- package/dist/app/commands/init.d.ts.map +1 -1
- package/dist/app/commands/init.js +11 -2
- package/dist/app/commands/init.js.map +1 -1
- package/dist/app/commands/update.d.ts.map +1 -1
- package/dist/app/commands/update.js +13 -3
- package/dist/app/commands/update.js.map +1 -1
- package/dist/config/repository-layout.json +0 -8
- package/dist/domains/bundle/bundle-platform.d.ts.map +1 -1
- package/dist/domains/bundle/bundle-platform.js +8 -0
- package/dist/domains/bundle/bundle-platform.js.map +1 -1
- package/dist/domains/bundle/types.d.ts +1 -1
- package/dist/domains/bundle/types.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-cli.d.ts +1 -1
- package/dist/domains/comet-classic/classic-cli.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-cli.js +3 -0
- package/dist/domains/comet-classic/classic-cli.js.map +1 -1
- package/dist/domains/comet-classic/classic-current-change.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-current-change.js +29 -3
- package/dist/domains/comet-classic/classic-current-change.js.map +1 -1
- package/dist/domains/comet-classic/classic-guard.js +2 -2
- package/dist/domains/comet-classic/classic-guard.js.map +1 -1
- package/dist/domains/comet-classic/classic-hook-guard.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-hook-guard.js +14 -1
- package/dist/domains/comet-classic/classic-hook-guard.js.map +1 -1
- package/dist/domains/comet-classic/classic-state-command.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-state-command.js +31 -8
- package/dist/domains/comet-classic/classic-state-command.js.map +1 -1
- package/dist/domains/comet-classic/classic-workspace-command.d.ts +3 -0
- package/dist/domains/comet-classic/classic-workspace-command.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-workspace-command.js +45 -0
- package/dist/domains/comet-classic/classic-workspace-command.js.map +1 -0
- package/dist/domains/comet-classic/classic-workspace.d.ts +38 -0
- package/dist/domains/comet-classic/classic-workspace.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-workspace.js +315 -0
- package/dist/domains/comet-classic/classic-workspace.js.map +1 -0
- package/dist/domains/comet-entry/hook-adapter.d.ts.map +1 -1
- package/dist/domains/comet-entry/hook-adapter.js +3 -0
- package/dist/domains/comet-entry/hook-adapter.js.map +1 -1
- package/dist/domains/comet-entry/hook-router-entry.d.ts +2 -0
- package/dist/domains/comet-entry/hook-router-entry.d.ts.map +1 -1
- package/dist/domains/comet-entry/hook-router-entry.js +32 -3
- package/dist/domains/comet-entry/hook-router-entry.js.map +1 -1
- package/dist/domains/comet-entry/init-workflow.d.ts.map +1 -1
- package/dist/domains/comet-entry/init-workflow.js +13 -5
- package/dist/domains/comet-entry/init-workflow.js.map +1 -1
- package/dist/domains/comet-entry/project-activation.d.ts.map +1 -1
- package/dist/domains/comet-entry/project-activation.js +2 -1
- package/dist/domains/comet-entry/project-activation.js.map +1 -1
- package/dist/domains/comet-entry/resume-probe.d.ts.map +1 -1
- package/dist/domains/comet-entry/resume-probe.js +48 -4
- package/dist/domains/comet-entry/resume-probe.js.map +1 -1
- package/dist/domains/comet-native/index.d.ts +1 -0
- package/dist/domains/comet-native/index.d.ts.map +1 -1
- package/dist/domains/comet-native/index.js +1 -0
- package/dist/domains/comet-native/index.js.map +1 -1
- package/dist/domains/comet-native/native-acceptance.d.ts +4 -3
- package/dist/domains/comet-native/native-acceptance.d.ts.map +1 -1
- package/dist/domains/comet-native/native-acceptance.js +23 -18
- package/dist/domains/comet-native/native-acceptance.js.map +1 -1
- package/dist/domains/comet-native/native-archive-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-archive-command.js +204 -61
- package/dist/domains/comet-native/native-archive-command.js.map +1 -1
- package/dist/domains/comet-native/native-archive-transaction.d.ts.map +1 -1
- package/dist/domains/comet-native/native-archive-transaction.js +28 -23
- package/dist/domains/comet-native/native-archive-transaction.js.map +1 -1
- package/dist/domains/comet-native/native-archive.d.ts +1 -0
- package/dist/domains/comet-native/native-archive.d.ts.map +1 -1
- package/dist/domains/comet-native/native-archive.js +56 -12
- package/dist/domains/comet-native/native-archive.js.map +1 -1
- package/dist/domains/comet-native/native-bounded-file.d.ts +32 -2
- package/dist/domains/comet-native/native-bounded-file.d.ts.map +1 -1
- package/dist/domains/comet-native/native-bounded-file.js +87 -6
- package/dist/domains/comet-native/native-bounded-file.js.map +1 -1
- package/dist/domains/comet-native/native-build-evidence.d.ts.map +1 -1
- package/dist/domains/comet-native/native-build-evidence.js +23 -1
- package/dist/domains/comet-native/native-build-evidence.js.map +1 -1
- package/dist/domains/comet-native/native-change.d.ts +1 -0
- package/dist/domains/comet-native/native-change.d.ts.map +1 -1
- package/dist/domains/comet-native/native-change.js +96 -8
- package/dist/domains/comet-native/native-change.js.map +1 -1
- package/dist/domains/comet-native/native-check-executor.d.ts +36 -0
- package/dist/domains/comet-native/native-check-executor.d.ts.map +1 -0
- package/dist/domains/comet-native/native-check-executor.js +132 -0
- package/dist/domains/comet-native/native-check-executor.js.map +1 -0
- package/dist/domains/comet-native/native-check-receipt-model.d.ts +9 -0
- package/dist/domains/comet-native/native-check-receipt-model.d.ts.map +1 -1
- package/dist/domains/comet-native/native-check-receipt-model.js +70 -8
- package/dist/domains/comet-native/native-check-receipt-model.js.map +1 -1
- package/dist/domains/comet-native/native-check-receipt-storage.d.ts.map +1 -1
- package/dist/domains/comet-native/native-check-receipt-storage.js +9 -8
- package/dist/domains/comet-native/native-check-receipt-storage.js.map +1 -1
- package/dist/domains/comet-native/native-check-receipt.d.ts.map +1 -1
- package/dist/domains/comet-native/native-check-receipt.js +123 -60
- package/dist/domains/comet-native/native-check-receipt.js.map +1 -1
- package/dist/domains/comet-native/native-checkpoint-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-checkpoint-command.js +0 -6
- package/dist/domains/comet-native/native-checkpoint-command.js.map +1 -1
- package/dist/domains/comet-native/native-checkpoint-storage.d.ts.map +1 -1
- package/dist/domains/comet-native/native-checkpoint-storage.js +27 -19
- package/dist/domains/comet-native/native-checkpoint-storage.js.map +1 -1
- package/dist/domains/comet-native/native-children.d.ts +49 -0
- package/dist/domains/comet-native/native-children.d.ts.map +1 -0
- package/dist/domains/comet-native/native-children.js +388 -0
- package/dist/domains/comet-native/native-children.js.map +1 -0
- package/dist/domains/comet-native/native-cli-help.d.ts +6 -0
- package/dist/domains/comet-native/native-cli-help.d.ts.map +1 -0
- package/dist/domains/comet-native/native-cli-help.js +192 -0
- package/dist/domains/comet-native/native-cli-help.js.map +1 -0
- package/dist/domains/comet-native/native-cli-shared.d.ts +2 -2
- package/dist/domains/comet-native/native-cli-shared.d.ts.map +1 -1
- package/dist/domains/comet-native/native-cli-shared.js +46 -24
- package/dist/domains/comet-native/native-cli-shared.js.map +1 -1
- package/dist/domains/comet-native/native-cli.d.ts.map +1 -1
- package/dist/domains/comet-native/native-cli.js +18 -11
- package/dist/domains/comet-native/native-cli.js.map +1 -1
- package/dist/domains/comet-native/native-config.d.ts +2 -1
- package/dist/domains/comet-native/native-config.d.ts.map +1 -1
- package/dist/domains/comet-native/native-config.js +2 -1
- package/dist/domains/comet-native/native-config.js.map +1 -1
- package/dist/domains/comet-native/native-continuation.d.ts.map +1 -1
- package/dist/domains/comet-native/native-continuation.js +175 -147
- package/dist/domains/comet-native/native-continuation.js.map +1 -1
- package/dist/domains/comet-native/native-diagnostics.d.ts.map +1 -1
- package/dist/domains/comet-native/native-diagnostics.js +96 -13
- package/dist/domains/comet-native/native-diagnostics.js.map +1 -1
- package/dist/domains/comet-native/native-doctor-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-doctor-command.js +332 -0
- package/dist/domains/comet-native/native-doctor-command.js.map +1 -1
- package/dist/domains/comet-native/native-doctor.d.ts +1 -0
- package/dist/domains/comet-native/native-doctor.d.ts.map +1 -1
- package/dist/domains/comet-native/native-doctor.js +116 -22
- package/dist/domains/comet-native/native-doctor.js.map +1 -1
- package/dist/domains/comet-native/native-evidence-projection.d.ts +50 -0
- package/dist/domains/comet-native/native-evidence-projection.d.ts.map +1 -0
- package/dist/domains/comet-native/native-evidence-projection.js +284 -0
- package/dist/domains/comet-native/native-evidence-projection.js.map +1 -0
- package/dist/domains/comet-native/native-evidence-retention.d.ts.map +1 -1
- package/dist/domains/comet-native/native-evidence-retention.js +14 -12
- package/dist/domains/comet-native/native-evidence-retention.js.map +1 -1
- package/dist/domains/comet-native/native-evidence-storage.d.ts.map +1 -1
- package/dist/domains/comet-native/native-evidence-storage.js +14 -11
- package/dist/domains/comet-native/native-evidence-storage.js.map +1 -1
- package/dist/domains/comet-native/native-findings.d.ts.map +1 -1
- package/dist/domains/comet-native/native-findings.js +18 -0
- package/dist/domains/comet-native/native-findings.js.map +1 -1
- package/dist/domains/comet-native/native-git-provenance.d.ts +16 -0
- package/dist/domains/comet-native/native-git-provenance.d.ts.map +1 -0
- package/dist/domains/comet-native/native-git-provenance.js +171 -0
- package/dist/domains/comet-native/native-git-provenance.js.map +1 -0
- package/dist/domains/comet-native/native-hook-guard.d.ts.map +1 -1
- package/dist/domains/comet-native/native-hook-guard.js +199 -19
- package/dist/domains/comet-native/native-hook-guard.js.map +1 -1
- package/dist/domains/comet-native/native-init-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-init-command.js +14 -2
- package/dist/domains/comet-native/native-init-command.js.map +1 -1
- package/dist/domains/comet-native/native-local-execution.d.ts +25 -0
- package/dist/domains/comet-native/native-local-execution.d.ts.map +1 -0
- package/dist/domains/comet-native/native-local-execution.js +241 -0
- package/dist/domains/comet-native/native-local-execution.js.map +1 -0
- package/dist/domains/comet-native/native-lock.d.ts +1 -1
- package/dist/domains/comet-native/native-lock.d.ts.map +1 -1
- package/dist/domains/comet-native/native-lock.js +9 -9
- package/dist/domains/comet-native/native-lock.js.map +1 -1
- package/dist/domains/comet-native/native-loop-runtime.d.ts +63 -0
- package/dist/domains/comet-native/native-loop-runtime.d.ts.map +1 -0
- package/dist/domains/comet-native/native-loop-runtime.js +580 -0
- package/dist/domains/comet-native/native-loop-runtime.js.map +1 -0
- package/dist/domains/comet-native/native-mutation-lock.d.ts +2 -0
- package/dist/domains/comet-native/native-mutation-lock.d.ts.map +1 -1
- package/dist/domains/comet-native/native-mutation-lock.js +23 -2
- package/dist/domains/comet-native/native-mutation-lock.js.map +1 -1
- package/dist/domains/comet-native/native-new-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-new-command.js +27 -20
- package/dist/domains/comet-native/native-new-command.js.map +1 -1
- package/dist/domains/comet-native/native-next-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-next-command.js +193 -62
- package/dist/domains/comet-native/native-next-command.js.map +1 -1
- package/dist/domains/comet-native/native-paths.d.ts +18 -0
- package/dist/domains/comet-native/native-paths.d.ts.map +1 -1
- package/dist/domains/comet-native/native-paths.js +125 -13
- package/dist/domains/comet-native/native-paths.js.map +1 -1
- package/dist/domains/comet-native/native-portable-acceptance.d.ts +28 -0
- package/dist/domains/comet-native/native-portable-acceptance.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-acceptance.js +73 -0
- package/dist/domains/comet-native/native-portable-acceptance.js.map +1 -0
- package/dist/domains/comet-native/native-portable-archive.d.ts +37 -0
- package/dist/domains/comet-native/native-portable-archive.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-archive.js +492 -0
- package/dist/domains/comet-native/native-portable-archive.js.map +1 -0
- package/dist/domains/comet-native/native-portable-continuation.d.ts +30 -0
- package/dist/domains/comet-native/native-portable-continuation.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-continuation.js +403 -0
- package/dist/domains/comet-native/native-portable-continuation.js.map +1 -0
- package/dist/domains/comet-native/native-portable-migration-runtime.d.ts +9 -0
- package/dist/domains/comet-native/native-portable-migration-runtime.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-migration-runtime.js +213 -0
- package/dist/domains/comet-native/native-portable-migration-runtime.js.map +1 -0
- package/dist/domains/comet-native/native-portable-migration.d.ts +42 -0
- package/dist/domains/comet-native/native-portable-migration.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-migration.js +212 -0
- package/dist/domains/comet-native/native-portable-migration.js.map +1 -0
- package/dist/domains/comet-native/native-portable-recovery.d.ts +15 -0
- package/dist/domains/comet-native/native-portable-recovery.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-recovery.js +203 -0
- package/dist/domains/comet-native/native-portable-recovery.js.map +1 -0
- package/dist/domains/comet-native/native-portable-runtime.d.ts +155 -0
- package/dist/domains/comet-native/native-portable-runtime.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-runtime.js +1550 -0
- package/dist/domains/comet-native/native-portable-runtime.js.map +1 -0
- package/dist/domains/comet-native/native-portable-state.d.ts +30 -0
- package/dist/domains/comet-native/native-portable-state.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-state.js +701 -0
- package/dist/domains/comet-native/native-portable-state.js.map +1 -0
- package/dist/domains/comet-native/native-portable-status.d.ts +65 -0
- package/dist/domains/comet-native/native-portable-status.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-status.js +133 -0
- package/dist/domains/comet-native/native-portable-status.js.map +1 -0
- package/dist/domains/comet-native/native-portable-text.d.ts +8 -0
- package/dist/domains/comet-native/native-portable-text.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-text.js +28 -0
- package/dist/domains/comet-native/native-portable-text.js.map +1 -0
- package/dist/domains/comet-native/native-portable-transactions.d.ts +41 -0
- package/dist/domains/comet-native/native-portable-transactions.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-transactions.js +204 -0
- package/dist/domains/comet-native/native-portable-transactions.js.map +1 -0
- package/dist/domains/comet-native/native-portable-types.d.ts +166 -0
- package/dist/domains/comet-native/native-portable-types.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-types.js +18 -0
- package/dist/domains/comet-native/native-portable-types.js.map +1 -0
- package/dist/domains/comet-native/native-repair-integration.js +5 -5
- package/dist/domains/comet-native/native-repair-integration.js.map +1 -1
- package/dist/domains/comet-native/native-resume-view.d.ts.map +1 -1
- package/dist/domains/comet-native/native-resume-view.js +1 -5
- package/dist/domains/comet-native/native-resume-view.js.map +1 -1
- package/dist/domains/comet-native/native-root-move.d.ts.map +1 -1
- package/dist/domains/comet-native/native-root-move.js +4 -20
- package/dist/domains/comet-native/native-root-move.js.map +1 -1
- package/dist/domains/comet-native/native-run-consistency.d.ts.map +1 -1
- package/dist/domains/comet-native/native-run-consistency.js +8 -12
- package/dist/domains/comet-native/native-run-consistency.js.map +1 -1
- package/dist/domains/comet-native/native-run-store.js +4 -4
- package/dist/domains/comet-native/native-run-store.js.map +1 -1
- package/dist/domains/comet-native/native-runner-input.d.ts +160 -0
- package/dist/domains/comet-native/native-runner-input.d.ts.map +1 -0
- package/dist/domains/comet-native/native-runner-input.js +347 -0
- package/dist/domains/comet-native/native-runner-input.js.map +1 -0
- package/dist/domains/comet-native/native-runner-protocol.d.ts +40 -0
- package/dist/domains/comet-native/native-runner-protocol.d.ts.map +1 -0
- package/dist/domains/comet-native/native-runner-protocol.js +55 -0
- package/dist/domains/comet-native/native-runner-protocol.js.map +1 -0
- package/dist/domains/comet-native/native-runtime-package.d.ts +3 -0
- package/dist/domains/comet-native/native-runtime-package.d.ts.map +1 -1
- package/dist/domains/comet-native/native-runtime-package.js +5 -1
- package/dist/domains/comet-native/native-runtime-package.js.map +1 -1
- package/dist/domains/comet-native/native-schema-migration.d.ts.map +1 -1
- package/dist/domains/comet-native/native-schema-migration.js +30 -27
- package/dist/domains/comet-native/native-schema-migration.js.map +1 -1
- package/dist/domains/comet-native/native-select-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-select-command.js +8 -4
- package/dist/domains/comet-native/native-select-command.js.map +1 -1
- package/dist/domains/comet-native/native-selection.d.ts.map +1 -1
- package/dist/domains/comet-native/native-selection.js +11 -2
- package/dist/domains/comet-native/native-selection.js.map +1 -1
- package/dist/domains/comet-native/native-show-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-show-command.js +37 -0
- package/dist/domains/comet-native/native-show-command.js.map +1 -1
- package/dist/domains/comet-native/native-snapshot.d.ts.map +1 -1
- package/dist/domains/comet-native/native-snapshot.js +13 -10
- package/dist/domains/comet-native/native-snapshot.js.map +1 -1
- package/dist/domains/comet-native/native-spec-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-spec-command.js +14 -28
- package/dist/domains/comet-native/native-spec-command.js.map +1 -1
- package/dist/domains/comet-native/native-specs.js +3 -3
- package/dist/domains/comet-native/native-specs.js.map +1 -1
- package/dist/domains/comet-native/native-status-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-status-command.js +7 -17
- package/dist/domains/comet-native/native-status-command.js.map +1 -1
- package/dist/domains/comet-native/native-status-discovery.d.ts +51 -0
- package/dist/domains/comet-native/native-status-discovery.d.ts.map +1 -0
- package/dist/domains/comet-native/native-status-discovery.js +299 -0
- package/dist/domains/comet-native/native-status-discovery.js.map +1 -0
- package/dist/domains/comet-native/native-trajectory-recovery.d.ts.map +1 -1
- package/dist/domains/comet-native/native-trajectory-recovery.js +6 -9
- package/dist/domains/comet-native/native-trajectory-recovery.js.map +1 -1
- package/dist/domains/comet-native/native-transaction.d.ts.map +1 -1
- package/dist/domains/comet-native/native-transaction.js +31 -20
- package/dist/domains/comet-native/native-transaction.js.map +1 -1
- package/dist/domains/comet-native/native-transition-evidence.d.ts.map +1 -1
- package/dist/domains/comet-native/native-transition-evidence.js +1 -0
- package/dist/domains/comet-native/native-transition-evidence.js.map +1 -1
- package/dist/domains/comet-native/native-transition-journal.d.ts.map +1 -1
- package/dist/domains/comet-native/native-transition-journal.js +71 -22
- package/dist/domains/comet-native/native-transition-journal.js.map +1 -1
- package/dist/domains/comet-native/native-transitions.d.ts.map +1 -1
- package/dist/domains/comet-native/native-transitions.js +167 -15
- package/dist/domains/comet-native/native-transitions.js.map +1 -1
- package/dist/domains/comet-native/native-types.d.ts +36 -1
- package/dist/domains/comet-native/native-types.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-receipt-runtime.js +18 -100
- package/dist/domains/comet-native/native-verification-receipt-runtime.js.map +1 -1
- package/dist/domains/comet-native/native-verification-report-v2.d.ts +12 -0
- package/dist/domains/comet-native/native-verification-report-v2.d.ts.map +1 -0
- package/dist/domains/comet-native/native-verification-report-v2.js +141 -0
- package/dist/domains/comet-native/native-verification-report-v2.js.map +1 -0
- package/dist/domains/comet-native/native-verification-runtime.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-runtime.js +7 -2
- package/dist/domains/comet-native/native-verification-runtime.js.map +1 -1
- package/dist/domains/comet-native/native-verification-scope.d.ts +23 -0
- package/dist/domains/comet-native/native-verification-scope.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-scope.js +106 -19
- package/dist/domains/comet-native/native-verification-scope.js.map +1 -1
- package/dist/domains/comet-native/native-verifier-protocol.d.ts +49 -0
- package/dist/domains/comet-native/native-verifier-protocol.d.ts.map +1 -0
- package/dist/domains/comet-native/native-verifier-protocol.js +157 -0
- package/dist/domains/comet-native/native-verifier-protocol.js.map +1 -0
- package/dist/domains/comet-native/native-workspace-finish.d.ts +61 -0
- package/dist/domains/comet-native/native-workspace-finish.d.ts.map +1 -0
- package/dist/domains/comet-native/native-workspace-finish.js +332 -0
- package/dist/domains/comet-native/native-workspace-finish.js.map +1 -0
- package/dist/domains/comet-native/native-workspace-preparation.d.ts +32 -0
- package/dist/domains/comet-native/native-workspace-preparation.d.ts.map +1 -0
- package/dist/domains/comet-native/native-workspace-preparation.js +324 -0
- package/dist/domains/comet-native/native-workspace-preparation.js.map +1 -0
- package/dist/domains/comet-native/native-workspace.d.ts +9 -1
- package/dist/domains/comet-native/native-workspace.d.ts.map +1 -1
- package/dist/domains/comet-native/native-workspace.js +109 -11
- package/dist/domains/comet-native/native-workspace.js.map +1 -1
- package/dist/domains/dashboard/collector.d.ts +1 -1
- package/dist/domains/dashboard/collector.d.ts.map +1 -1
- package/dist/domains/dashboard/collector.js +102 -87
- package/dist/domains/dashboard/collector.js.map +1 -1
- package/dist/domains/dashboard/native-adapter.d.ts +155 -126
- package/dist/domains/dashboard/native-adapter.d.ts.map +1 -1
- package/dist/domains/dashboard/native-adapter.js +165 -268
- package/dist/domains/dashboard/native-adapter.js.map +1 -1
- package/dist/domains/dashboard/native-collector.d.ts +5 -4
- package/dist/domains/dashboard/native-collector.d.ts.map +1 -1
- package/dist/domains/dashboard/native-collector.js +506 -439
- package/dist/domains/dashboard/native-collector.js.map +1 -1
- package/dist/domains/dashboard/native-legacy-adapter.d.ts +37 -0
- package/dist/domains/dashboard/native-legacy-adapter.d.ts.map +1 -0
- package/dist/domains/dashboard/native-legacy-adapter.js +127 -0
- package/dist/domains/dashboard/native-legacy-adapter.js.map +1 -0
- package/dist/domains/dashboard/server.d.ts.map +1 -1
- package/dist/domains/dashboard/server.js +5 -3
- package/dist/domains/dashboard/server.js.map +1 -1
- 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/abnfDiagram-N423BO3Z-B5cFR6hS.js +1 -0
- package/dist/domains/dashboard/web/assets/arc-CVQDtMsu.js +1 -0
- package/dist/domains/dashboard/web/assets/architectureDiagram-T3A2C74G-C0v0kULK.js +36 -0
- package/dist/domains/dashboard/web/assets/blockDiagram-VBNYF7ZC-DpHLuxu4.js +132 -0
- package/dist/domains/dashboard/web/assets/{c4Diagram-AAUBKEIU-Ca5zba3N.js → c4Diagram-5PPSVZJV-BHnFxUs1.js} +1 -1
- package/dist/domains/dashboard/web/assets/channel-eM0x3m1G.js +1 -0
- package/dist/domains/dashboard/web/assets/{chunk-ND2GUHAM-Bj6HWRwi.js → chunk-2GRJ4B5K-CGC9gh5n.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-QZHKN3VN-B1kXfg5N.js → chunk-2Q5K7J3B-l4puLU_O.js} +1 -1
- package/dist/domains/dashboard/web/assets/chunk-5RXB4S5H-ls9jQHZc.js +231 -0
- package/dist/domains/dashboard/web/assets/{chunk-FMBD7UC4-BAJLB5V6.js → chunk-5VM5RSS4-BVavmTEq.js} +1 -1
- package/dist/domains/dashboard/web/assets/chunk-6Q2QTUOP-Dungt2g9.js +88 -0
- package/dist/domains/dashboard/web/assets/{chunk-727SXJPM-CwghIMO9.js → chunk-GF5L2VYU-BidXO_ZP.js} +5 -5
- package/dist/domains/dashboard/web/assets/{chunk-4BX2VUAB-JYluRsP-.js → chunk-JWPE2WC7-57L5Up5X.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-2J33WTMH-CCVPBm0J.js → chunk-KBJHAD2P-C5u5vbwr.js} +1 -1
- package/dist/domains/dashboard/web/assets/chunk-RYQCIY6F-CvLz21I2.js +1 -0
- package/dist/domains/dashboard/web/assets/{chunk-55IACEB6-DfYm7pN7.js → chunk-XXDRQBXY-D5nJpckG.js} +1 -1
- package/dist/domains/dashboard/web/assets/classDiagram-JCYQIIEL-CEFhao2K.js +1 -0
- package/dist/domains/dashboard/web/assets/classDiagram-v2-OCEON4UE-CEFhao2K.js +1 -0
- package/dist/domains/dashboard/web/assets/{cose-bilkent-S5V4N54A-BBrkuiAU.js → cose-bilkent-JH36ORCC-Dp0JAGyE.js} +1 -1
- package/dist/domains/dashboard/web/assets/{cynefin-VYW2F7L2-DlFhgQHt.js → cynefin-VYW2F7L2-EjC54l1g.js} +2 -2
- package/dist/domains/dashboard/web/assets/cynefinDiagram-MW4NZA55-CpYrW3w3.js +62 -0
- package/dist/domains/dashboard/web/assets/dagre-VZM6K2ZE-h5K39rCk.js +4 -0
- package/dist/domains/dashboard/web/assets/demo-BfLsKrIL.js +45 -0
- package/dist/domains/dashboard/web/assets/diagram-7IWD3JNH-CKQj9O4H.js +30 -0
- package/dist/domains/dashboard/web/assets/{diagram-KO2AKTUF-BQahyP-C.js → diagram-B4RE2ZJO-DXRIYcnW.js} +3 -3
- package/dist/domains/dashboard/web/assets/diagram-LBJQPF4R-wWutQYmv.js +24 -0
- package/dist/domains/dashboard/web/assets/diagram-Q27KOJAE-EgXLJQYi.js +24 -0
- package/dist/domains/dashboard/web/assets/diagram-UB23O5K3-CsQRXDQZ.js +41 -0
- package/dist/domains/dashboard/web/assets/ebnfDiagram-BXEA7PRR-gm328Eho.js +1 -0
- package/dist/domains/dashboard/web/assets/erDiagram-JOGREHBK-BbbMVUx_.js +85 -0
- package/dist/domains/dashboard/web/assets/flowDiagram-UKHOOZJN-1Y7scCns.js +156 -0
- package/dist/domains/dashboard/web/assets/ganttDiagram-PKOTCBZU-BAoBqczv.js +292 -0
- package/dist/domains/dashboard/web/assets/{gitGraphDiagram-PVQCEYII-DCxvMAUJ.js → gitGraphDiagram-DS77QQ5N-CMUAyEzl.js} +3 -3
- package/dist/domains/dashboard/web/assets/{graph--OzhPTMs.js → graph-DOmOIIwC.js} +1 -1
- package/dist/domains/dashboard/web/assets/{index-Blit0P5Z.js → index-CCApJ0Yr.js} +1 -1
- package/dist/domains/dashboard/web/assets/index-DWdm_XBi.js +257 -0
- package/dist/domains/dashboard/web/assets/index-DhhbseFJ.css +1 -0
- package/dist/domains/dashboard/web/assets/{infoDiagram-5YYISTIA-9qXEkzDe.js → infoDiagram-6WML65LV-BaCdtYYC.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ishikawaDiagram-YF4QCWOH-Dkf5othW.js → ishikawaDiagram-WSZJBQD7-DQQlNnjU.js} +4 -4
- package/dist/domains/dashboard/web/assets/{journeyDiagram-JHISSGLW-C2_IkO4s.js → journeyDiagram-NVQOT4AX-DW9wUMqn.js} +1 -1
- package/dist/domains/dashboard/web/assets/{kanban-definition-UN3LZRKU-BxWgu4DL.js → kanban-definition-27J2QSJJ-C_ITaZ0q.js} +7 -7
- package/dist/domains/dashboard/web/assets/layout-D-LzfAck.js +1 -0
- package/dist/domains/dashboard/web/assets/{linear-Dkr6p-Ro.js → linear-DXOo6ZRT.js} +1 -1
- package/dist/domains/dashboard/web/assets/map-DxJ2ADlA.js +1 -0
- package/dist/domains/dashboard/web/assets/mermaid.core-ol-0NI97.js +306 -0
- package/dist/domains/dashboard/web/assets/{mindmap-definition-RKZ34NQL-C9xyxGfa.js → mindmap-definition-FAOFIHXS-CHF_HOLV.js} +1 -1
- package/dist/domains/dashboard/web/assets/pegDiagram-VL7TDLO6-wQEvkNF8.js +1 -0
- package/dist/domains/dashboard/web/assets/pieDiagram-7S7Q4E2Y-C3H3kiIP.js +39 -0
- package/dist/domains/dashboard/web/assets/purify.es-Cz4mVeUR.js +3 -0
- package/dist/domains/dashboard/web/assets/{quadrantDiagram-W4KKPZXB-Cy6iOcxc.js → quadrantDiagram-CIZ2JOQS-S0FdVzJb.js} +4 -4
- package/dist/domains/dashboard/web/assets/railroadDiagram-AXF67PYL-DCDXDaVg.js +1 -0
- package/dist/domains/dashboard/web/assets/{requirementDiagram-4Y6WPE33-B_gZONhx.js → requirementDiagram-LRYGKXZP-BW8J4gO_.js} +1 -1
- package/dist/domains/dashboard/web/assets/sankeyDiagram-W5VNT64P-DQQBmLoy.js +40 -0
- package/dist/domains/dashboard/web/assets/sequenceDiagram-SI44F4Z6-2tDcli0Y.js +162 -0
- package/dist/domains/dashboard/web/assets/sizeCapture-X5ZJPWSS-4sEZLBKb.js +1 -0
- package/dist/domains/dashboard/web/assets/stateDiagram-OKZ733FA-OgPb8pyR.js +1 -0
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-UEYNNEHI-CiDNPr4P.js +1 -0
- package/dist/domains/dashboard/web/assets/swimlanes-SLNWSIFB-DR7lwtxd.js +2 -0
- package/dist/domains/dashboard/web/assets/swimlanesDiagram-ULZ7WXOC-DggHFP9q.js +8 -0
- package/dist/domains/dashboard/web/assets/{timeline-definition-PNZ67QCA-DvONX2YQ.js → timeline-definition-Z64GVDOM-DNIJVlQV.js} +4 -4
- package/dist/domains/dashboard/web/assets/vennDiagram-T6HMQDX7-CClhw4QZ.js +34 -0
- package/dist/domains/dashboard/web/assets/{wardleyDiagram-YWT4CUSO-cf39WX2o.js → wardleyDiagram-T6FBY63Y-DzR3aFPS.js} +3 -3
- package/dist/domains/dashboard/web/assets/xychartDiagram-ELKLHX3M-DZhq0ZRj.js +7 -0
- package/dist/domains/dashboard/web/index.html +16 -16
- package/dist/domains/dashboard/workspace.d.ts +24 -0
- package/dist/domains/dashboard/workspace.d.ts.map +1 -0
- package/dist/domains/dashboard/workspace.js +87 -0
- package/dist/domains/dashboard/workspace.js.map +1 -0
- package/dist/domains/eval/index.d.ts +3 -0
- package/dist/domains/eval/index.d.ts.map +1 -1
- package/dist/domains/eval/index.js +3 -0
- package/dist/domains/eval/index.js.map +1 -1
- package/dist/domains/eval/standalone-context.d.ts +19 -0
- package/dist/domains/eval/standalone-context.d.ts.map +1 -0
- package/dist/domains/eval/standalone-context.js +107 -0
- package/dist/domains/eval/standalone-context.js.map +1 -0
- package/dist/domains/eval/standalone-static-collect.d.ts +22 -0
- package/dist/domains/eval/standalone-static-collect.d.ts.map +1 -0
- package/dist/domains/eval/standalone-static-collect.js +779 -0
- package/dist/domains/eval/standalone-static-collect.js.map +1 -0
- package/dist/domains/eval/user-environment.d.ts +6 -0
- package/dist/domains/eval/user-environment.d.ts.map +1 -0
- package/dist/domains/eval/user-environment.js +73 -0
- package/dist/domains/eval/user-environment.js.map +1 -0
- package/dist/domains/integrations/openspec.d.ts +1 -1
- package/dist/domains/integrations/openspec.d.ts.map +1 -1
- package/dist/domains/integrations/openspec.js +110 -26
- package/dist/domains/integrations/openspec.js.map +1 -1
- package/dist/domains/integrations/superpowers.d.ts +5 -1
- package/dist/domains/integrations/superpowers.d.ts.map +1 -1
- package/dist/domains/integrations/superpowers.js +21 -2
- package/dist/domains/integrations/superpowers.js.map +1 -1
- package/dist/domains/skill/platform-inspect.d.ts.map +1 -1
- package/dist/domains/skill/platform-inspect.js +11 -3
- package/dist/domains/skill/platform-inspect.js.map +1 -1
- package/dist/domains/skill/platform-install.d.ts +8 -2
- package/dist/domains/skill/platform-install.d.ts.map +1 -1
- package/dist/domains/skill/platform-install.js +115 -34
- 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 +5 -3
- 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 +69 -15
- package/dist/domains/skill/uninstall.js.map +1 -1
- package/dist/domains/workflow-contract/hook-write-policy.d.ts +9 -0
- package/dist/domains/workflow-contract/hook-write-policy.d.ts.map +1 -0
- package/dist/domains/workflow-contract/hook-write-policy.js +52 -0
- package/dist/domains/workflow-contract/hook-write-policy.js.map +1 -0
- package/dist/domains/workflow-contract/index.d.ts +3 -0
- package/dist/domains/workflow-contract/index.d.ts.map +1 -1
- package/dist/domains/workflow-contract/index.js +2 -0
- package/dist/domains/workflow-contract/index.js.map +1 -1
- package/dist/domains/workflow-contract/project-config.d.ts +3 -1
- package/dist/domains/workflow-contract/project-config.d.ts.map +1 -1
- package/dist/domains/workflow-contract/project-config.js +119 -19
- package/dist/domains/workflow-contract/project-config.js.map +1 -1
- package/dist/domains/workflow-contract/project-gitignore.d.ts +9 -0
- package/dist/domains/workflow-contract/project-gitignore.d.ts.map +1 -0
- package/dist/domains/workflow-contract/project-gitignore.js +108 -0
- package/dist/domains/workflow-contract/project-gitignore.js.map +1 -0
- package/dist/domains/workflow-contract/protected-project-path.d.ts +13 -0
- package/dist/domains/workflow-contract/protected-project-path.d.ts.map +1 -1
- package/dist/domains/workflow-contract/protected-project-path.js +83 -0
- package/dist/domains/workflow-contract/protected-project-path.js.map +1 -1
- package/dist/domains/workflow-contract/types.d.ts +4 -0
- package/dist/domains/workflow-contract/types.d.ts.map +1 -1
- package/dist/platform/install/platforms.d.ts +3 -1
- package/dist/platform/install/platforms.d.ts.map +1 -1
- package/dist/platform/install/platforms.js +22 -2
- package/dist/platform/install/platforms.js.map +1 -1
- package/dist/platform/paths/git-worktree.d.ts +8 -1
- package/dist/platform/paths/git-worktree.d.ts.map +1 -1
- package/dist/platform/paths/git-worktree.js +41 -7
- package/dist/platform/paths/git-worktree.js.map +1 -1
- package/dist/platform/process/external-command.d.ts +13 -0
- package/dist/platform/process/external-command.d.ts.map +1 -0
- package/dist/platform/process/external-command.js +45 -0
- package/dist/platform/process/external-command.js.map +1 -0
- package/dist/platform/process/git.d.ts +12 -0
- package/dist/platform/process/git.d.ts.map +1 -0
- package/dist/platform/process/git.js +86 -0
- package/dist/platform/process/git.js.map +1 -0
- package/dist/platform/process/spawn-command.d.ts +8 -0
- package/dist/platform/process/spawn-command.d.ts.map +1 -0
- package/dist/platform/process/spawn-command.js +113 -0
- package/dist/platform/process/spawn-command.js.map +1 -0
- package/eval/.env.example +115 -0
- package/eval/README.md +237 -14
- package/eval/langfuse/.env.example +9 -0
- package/eval/langfuse/tests/conftest.py +146 -0
- package/eval/langfuse/tests/tasks/test_tasks.py +109 -0
- package/eval/langfuse/tests/test_adapter.py +272 -0
- package/eval/langsmith/.env.example +16 -0
- package/eval/langsmith/tests/conftest.py +10 -1
- package/eval/local/tasks/comet-classic-layout-lifecycle/environment/current-comet-package.json +4 -2
- package/eval/local/tasks/comet-native-clarification/validation/test_native_clarification.py +9 -21
- package/eval/local/tasks/comet-native-clarification-depth/validation/test_native_clarification_depth.py +4 -7
- package/eval/local/tasks/comet-native-clarification-modes/validation/test_native_clarification_modes.py +4 -10
- package/eval/local/tasks/comet-native-interrupted-transition/instruction.md +1 -1
- package/eval/local/tasks/comet-native-interrupted-transition/validation/test_native_interrupted_transition.py +15 -16
- package/eval/local/tasks/comet-native-repository-fact/instruction.md +2 -2
- package/eval/local/tasks/comet-native-repository-fact/validation/test_native_repository_fact.py +8 -2
- package/eval/local/tasks/comet-native-wave-b-decision-resume/instruction.md +8 -4
- package/eval/local/tasks/comet-native-wave-b-decision-resume/task.toml +6 -6
- package/eval/local/tasks/comet-native-wave-b-decision-resume/validation/test_native_wave_b_decision_resume.py +126 -135
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/instruction.md +6 -6
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/task.toml +8 -8
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/validation/test_native_wave_c_verification_integrity.py +97 -317
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/instruction.md +7 -7
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/task.toml +4 -4
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/validation/test_native_wave_d_stagnation_stop.py +130 -199
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/instruction.md +5 -5
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/task.toml +8 -8
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/validation/test_native_wave_e_parallel_safety.py +135 -239
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/current-comet-package.json +2 -2
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/instruction.md +3 -3
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/task.toml +6 -6
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/validation/test_native_wave_f_dashboard_readonly.py +81 -439
- package/eval/local/tasks/comet-native-workflow/instruction.md +5 -4
- package/eval/local/tasks/comet-native-workflow/validation/test_native_workflow.py +145 -502
- package/eval/local/tasks/index.yaml +5 -5
- package/eval/local/tests/conftest.py +701 -80
- package/eval/local/tests/scaffold/fixtures/custom-agent/adapter.yaml +19 -0
- package/eval/local/tests/scaffold/test_agents.py +76 -0
- package/eval/local/tests/scaffold/test_aligned_comparison.py +70 -0
- package/eval/local/tests/scaffold/test_auto_tasks.py +350 -0
- package/eval/local/tests/scaffold/test_conftest_helpers.py +267 -18
- package/eval/local/tests/scaffold/test_custom_agents.py +174 -0
- package/eval/local/tests/scaffold/test_eval_context.py +217 -0
- package/eval/local/tests/scaffold/test_execution.py +364 -0
- package/eval/local/tests/scaffold/test_inline_tasks.py +56 -0
- package/eval/local/tests/scaffold/test_langfuse_trajectory.py +263 -0
- package/eval/local/tests/scaffold/test_langsmith_conftest.py +63 -0
- package/eval/local/tests/scaffold/test_logging.py +162 -0
- package/eval/local/tests/scaffold/test_manifest_tasks.py +76 -0
- package/eval/local/tests/scaffold/test_manifests.py +396 -0
- package/eval/local/tests/scaffold/test_native_aligned_eval.py +163 -35
- package/eval/local/tests/scaffold/test_native_wave_evaluations.py +75 -2054
- package/eval/local/tests/scaffold/test_profiles.py +64 -6
- package/eval/local/tests/scaffold/test_task_resolution.py +212 -0
- package/eval/local/tests/scaffold/test_tasks.py +38 -52
- package/eval/local/tests/scaffold/test_utils.py +480 -4
- package/eval/local/tests/tasks/test_tasks.py +219 -17
- package/eval/local/treatments/comet/comet_native_phase1.yaml +7 -4
- package/eval/pyproject.toml +9 -4
- package/eval/scaffold/__init__.py +6 -0
- package/eval/scaffold/docker/agent-overlay.Dockerfile +41 -0
- package/eval/scaffold/python/__init__.py +128 -20
- package/eval/scaffold/python/agents.py +239 -0
- package/eval/scaffold/python/aligned_comparison.py +156 -27
- package/eval/scaffold/python/auto_tasks.py +700 -0
- package/eval/scaffold/python/custom_agents.py +172 -0
- package/eval/scaffold/python/eval_context.py +236 -0
- package/eval/scaffold/python/eval_schema.py +135 -0
- package/eval/scaffold/python/execution.py +544 -0
- package/eval/scaffold/python/generated_task_cache.py +230 -0
- package/eval/scaffold/python/generic_llm_judge.py +41 -14
- package/eval/scaffold/python/inline_tasks.py +118 -0
- package/eval/scaffold/python/judge_config.py +158 -37
- package/eval/scaffold/python/langfuse_adapter.py +1023 -0
- package/eval/scaffold/python/llm_judge.py +68 -11
- package/eval/scaffold/python/logging.py +157 -17
- package/eval/scaffold/python/manifest_tasks.py +69 -0
- package/eval/scaffold/python/manifests.py +443 -22
- package/eval/scaffold/python/native_eval.py +10 -5
- package/eval/scaffold/python/paths.py +11 -1
- package/eval/scaffold/python/task_resolution.py +176 -0
- package/eval/scaffold/python/tasks.py +17 -4
- package/eval/scaffold/python/utils.py +167 -11
- package/eval/scaffold/python/validation/core.py +48 -2
- package/eval/scaffold/python/validation/generic_rubric.py +9 -0
- package/eval/scaffold/python/validation/native_v4.py +249 -0
- package/eval/scaffold/python/validation/native_wave.py +4 -5
- package/eval/scaffold/python/validation/native_workflow.py +199 -98
- package/eval/scaffold/python/validation/rubric.py +130 -2
- package/eval/scaffold/shell/agent-runtime-config.sh +88 -0
- package/eval/scaffold/shell/docker.sh +534 -33
- package/eval/scaffold/shell/run-agent-runtime.sh +49 -0
- package/eval/scaffold/shell/run-claude-loop.sh +153 -14
- package/eval/schemas/comet.eval/v1alpha1.schema.json +244 -0
- package/package.json +9 -3
- package/assets/skills/comet-native/scripts/comet-native-check.mjs +0 -179
- package/assets/skills/comet-native/scripts/comet-native-checkpoint.mjs +0 -179
- package/assets/skills/comet-native/scripts/comet-native-evidence.mjs +0 -151
- package/assets/skills/comet-native/scripts/comet-native-receipt.mjs +0 -187
- package/dist/domains/comet-native/native-check-entry.d.ts +0 -2
- package/dist/domains/comet-native/native-check-entry.d.ts.map +0 -1
- package/dist/domains/comet-native/native-check-entry.js +0 -4
- package/dist/domains/comet-native/native-check-entry.js.map +0 -1
- package/dist/domains/comet-native/native-checkpoint-entry.d.ts +0 -2
- package/dist/domains/comet-native/native-checkpoint-entry.d.ts.map +0 -1
- package/dist/domains/comet-native/native-checkpoint-entry.js +0 -4
- package/dist/domains/comet-native/native-checkpoint-entry.js.map +0 -1
- package/dist/domains/comet-native/native-evidence-entry.d.ts +0 -2
- package/dist/domains/comet-native/native-evidence-entry.d.ts.map +0 -1
- package/dist/domains/comet-native/native-evidence-entry.js +0 -4
- package/dist/domains/comet-native/native-evidence-entry.js.map +0 -1
- package/dist/domains/comet-native/native-receipt-entry.d.ts +0 -2
- package/dist/domains/comet-native/native-receipt-entry.d.ts.map +0 -1
- package/dist/domains/comet-native/native-receipt-entry.js +0 -4
- package/dist/domains/comet-native/native-receipt-entry.js.map +0 -1
- package/dist/domains/dashboard/web/assets/arc-ClrSujVb.js +0 -1
- package/dist/domains/dashboard/web/assets/architectureDiagram-3BPJPVTR-B4A_t84A.js +0 -36
- package/dist/domains/dashboard/web/assets/blockDiagram-GPEHLZMM-D72u2953.js +0 -132
- package/dist/domains/dashboard/web/assets/channel-B_u-_i2t.js +0 -1
- package/dist/domains/dashboard/web/assets/chunk-AQP2D5EJ-BA_zgMXZ.js +0 -231
- package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-BpA7BPgX.js +0 -1
- package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-BpA7BPgX.js +0 -1
- package/dist/domains/dashboard/web/assets/dagre-BM42HDAG-B0Bk5oiP.js +0 -4
- package/dist/domains/dashboard/web/assets/demo-DZYPLZpF.js +0 -25
- package/dist/domains/dashboard/web/assets/diagram-2AECGRRQ-tvTUiBA2.js +0 -43
- package/dist/domains/dashboard/web/assets/diagram-5GNKFQAL-BZfcK29q.js +0 -10
- package/dist/domains/dashboard/web/assets/diagram-LMA3HP47-D5bJnW2C.js +0 -24
- package/dist/domains/dashboard/web/assets/diagram-OG6HWLK6-DTwWdzWJ.js +0 -24
- package/dist/domains/dashboard/web/assets/erDiagram-TEJ5UH35-BbvrdCp9.js +0 -85
- package/dist/domains/dashboard/web/assets/flowDiagram-I6XJVG4X-DgbR7Tcc.js +0 -162
- package/dist/domains/dashboard/web/assets/ganttDiagram-6RSMTGT7-wWMOA7F4.js +0 -292
- package/dist/domains/dashboard/web/assets/index-Bk1o-4VO.css +0 -1
- package/dist/domains/dashboard/web/assets/index-g8vyW0R_.js +0 -257
- package/dist/domains/dashboard/web/assets/layout-SsrduOYp.js +0 -1
- package/dist/domains/dashboard/web/assets/mermaid.core-DZUcsoG4.js +0 -301
- package/dist/domains/dashboard/web/assets/pieDiagram-4H26LBE5-Dn67tdOF.js +0 -30
- package/dist/domains/dashboard/web/assets/purify.es-VaSPOPhr.js +0 -3
- package/dist/domains/dashboard/web/assets/sankeyDiagram-5OEKKPKP-C3u-4dOk.js +0 -40
- package/dist/domains/dashboard/web/assets/sequenceDiagram-3UESZ5HK-Xd3ByTVF.js +0 -162
- package/dist/domains/dashboard/web/assets/stateDiagram-AJRCARHV-CJGHL7Up.js +0 -1
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-rKvBgr6I.js +0 -1
- package/dist/domains/dashboard/web/assets/vennDiagram-CIIHVFJN-B-L4qWy4.js +0 -34
- package/dist/domains/dashboard/web/assets/xychartDiagram-2RQKCTM6-Dk1vcm3u.js +0 -7
- /package/assets/skills/{comet → comet-classic}/reference/classic-layout.md +0 -0
- /package/assets/skills-zh/{comet → comet-classic}/reference/classic-layout.md +0 -0
|
@@ -1,2095 +1,116 @@
|
|
|
1
|
-
"""Unit
|
|
1
|
+
"""Unit tests for the beta17 Native Eval protocol.
|
|
2
|
+
|
|
3
|
+
These tests intentionally exercise portable v4 state and Dashboard v2. Legacy
|
|
4
|
+
receipt/snapshot/checkpoint fixtures belong to a separate legacy test suite.
|
|
5
|
+
"""
|
|
2
6
|
|
|
3
7
|
from __future__ import annotations
|
|
4
8
|
|
|
5
9
|
import importlib.util
|
|
6
|
-
import hashlib
|
|
7
|
-
import json
|
|
8
|
-
import subprocess
|
|
9
|
-
import sys
|
|
10
10
|
from pathlib import Path
|
|
11
11
|
|
|
12
|
-
import
|
|
13
|
-
import pytest
|
|
14
|
-
|
|
15
|
-
from scaffold.python.tasks import load_task
|
|
16
|
-
from scaffold.python.validation.native_wave import (
|
|
17
|
-
build_contract_from_change,
|
|
18
|
-
canonical_hash,
|
|
19
|
-
check_archive_transaction,
|
|
20
|
-
check_checkpoint_cas_envelopes,
|
|
12
|
+
from scaffold.python.validation.native_v4 import (
|
|
21
13
|
check_dashboard_projection,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
parse_verification_bundle,
|
|
14
|
+
check_native_isolation,
|
|
15
|
+
validate_active_state,
|
|
16
|
+
validate_terminal_state,
|
|
26
17
|
)
|
|
27
18
|
|
|
28
19
|
|
|
29
|
-
|
|
30
|
-
TASKS_ROOT = EVAL_ROOT / "local" / "tasks"
|
|
31
|
-
WAVE_TASKS = {
|
|
32
|
-
"comet-native-wave-b-decision-resume": "auto_user",
|
|
33
|
-
"comet-native-wave-c-verification-integrity": "none",
|
|
34
|
-
"comet-native-wave-d-stagnation-stop": "none",
|
|
35
|
-
"comet-native-wave-e-parallel-safety": "none",
|
|
36
|
-
"comet-native-wave-f-dashboard-readonly": "none",
|
|
37
|
-
}
|
|
20
|
+
ROOT = Path(__file__).resolve().parents[3]
|
|
38
21
|
|
|
39
22
|
|
|
40
|
-
def
|
|
41
|
-
path =
|
|
42
|
-
spec = importlib.util.spec_from_file_location(
|
|
43
|
-
assert spec and spec.loader
|
|
23
|
+
def _load_workflow_validator():
|
|
24
|
+
path = ROOT / "local" / "tasks" / "comet-native-workflow" / "validation" / "test_native_workflow.py"
|
|
25
|
+
spec = importlib.util.spec_from_file_location("native_workflow_validator", path)
|
|
44
26
|
module = importlib.util.module_from_spec(spec)
|
|
27
|
+
assert spec and spec.loader
|
|
45
28
|
spec.loader.exec_module(module)
|
|
46
29
|
return module
|
|
47
30
|
|
|
48
31
|
|
|
49
|
-
def
|
|
50
|
-
path.parent.mkdir(parents=True, exist_ok=True)
|
|
51
|
-
path.write_text(json.dumps(value, indent=2), encoding="utf-8")
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
SNAPSHOT_LIMITS = {
|
|
55
|
-
"maxFiles": 10000,
|
|
56
|
-
"maxFileBytes": 5 * 1024 * 1024,
|
|
57
|
-
"maxTotalBytes": 64 * 1024 * 1024,
|
|
58
|
-
"maxManifestBytes": 1024 * 1024,
|
|
59
|
-
}
|
|
60
|
-
CHECK_LIMITS = {
|
|
61
|
-
"maxFiles": 256,
|
|
62
|
-
"maxFileBytes": 1024 * 1024,
|
|
63
|
-
"maxTotalBytes": 8 * 1024 * 1024,
|
|
64
|
-
"maxIssues": 128,
|
|
65
|
-
}
|
|
66
|
-
CHECKER_HASH = "0b8e0e9570269a64123ba2794f1f5125cf454695e1d7fda8f0acddf87ec4912f"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
def _file_identity(path: Path) -> dict:
|
|
70
|
-
payload = path.read_bytes()
|
|
71
|
-
return {"hash": hashlib.sha256(payload).hexdigest(), "size": len(payload)}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
def _projection(entries: list[dict]) -> tuple[dict, str]:
|
|
75
|
-
value = {
|
|
76
|
-
"schema": "comet.native.content-snapshot-projection.v1",
|
|
77
|
-
"origin": "explicit",
|
|
78
|
-
"complete": True,
|
|
79
|
-
"limits": SNAPSHOT_LIMITS,
|
|
80
|
-
"entries": sorted(entries, key=lambda item: item["path"]),
|
|
81
|
-
"omitted": [],
|
|
82
|
-
"omittedCount": 0,
|
|
83
|
-
}
|
|
84
|
-
return value, canonical_hash("comet.native.content-snapshot-projection.v1", value)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
def _unattributed_scope(change: dict) -> dict:
|
|
88
|
-
identity = {
|
|
89
|
-
"kind": "unattributed-change",
|
|
90
|
-
"source": "implementation-scope",
|
|
91
|
-
"path": change["path"],
|
|
92
|
-
"evidence": {
|
|
93
|
-
"after": change["after"],
|
|
94
|
-
"before": change["before"],
|
|
95
|
-
"changeKind": change["kind"],
|
|
96
|
-
},
|
|
97
|
-
}
|
|
98
|
-
return {
|
|
99
|
-
"id": f"scope:{canonical_hash('comet.native.unresolved-scope-id.v1', identity)}",
|
|
100
|
-
"kind": identity["kind"],
|
|
101
|
-
"source": identity["source"],
|
|
102
|
-
"path": identity["path"],
|
|
103
|
-
"reason": f"Changed path is not covered by a declared artifact: {change['path']}",
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
def write_scope(
|
|
108
|
-
workspace: Path,
|
|
109
|
-
change_root: Path,
|
|
110
|
-
contract_hash: str,
|
|
111
|
-
*,
|
|
112
|
-
partial: bool = False,
|
|
113
|
-
) -> tuple[str, dict]:
|
|
114
|
-
project_entries = []
|
|
115
|
-
for name in ("wordcount.py", "test_wordcount.py"):
|
|
116
|
-
path = workspace / name
|
|
117
|
-
if path.is_file():
|
|
118
|
-
identity = _file_identity(path)
|
|
119
|
-
project_entries.append({"path": name, **identity, "type": "file"})
|
|
120
|
-
baseline, baseline_hash = _projection(project_entries)
|
|
121
|
-
current_entries = list(project_entries)
|
|
122
|
-
if partial:
|
|
123
|
-
current_entries.append(
|
|
124
|
-
{"path": "unrelated.txt", "hash": "9" * 64, "size": 1, "type": "file"}
|
|
125
|
-
)
|
|
126
|
-
current, current_hash = _projection(current_entries)
|
|
127
|
-
change = {
|
|
128
|
-
"path": "unrelated.txt",
|
|
129
|
-
"kind": "added",
|
|
130
|
-
"before": None,
|
|
131
|
-
"after": {"hash": "9" * 64, "size": 1},
|
|
132
|
-
"attributedTo": [],
|
|
133
|
-
}
|
|
134
|
-
unresolved = _unattributed_scope(change)
|
|
135
|
-
content = {
|
|
136
|
-
"schema": "comet.native.implementation-scope.v2",
|
|
137
|
-
"contractHash": contract_hash,
|
|
138
|
-
"baselineProjectionRef": f"runtime/evidence/snapshots/{baseline_hash}.json",
|
|
139
|
-
"baselineProjectionHash": baseline_hash,
|
|
140
|
-
"currentProjectionRef": f"runtime/evidence/snapshots/{current_hash}.json",
|
|
141
|
-
"currentProjectionHash": current_hash,
|
|
142
|
-
"complete": not partial,
|
|
143
|
-
"declaredArtifacts": [],
|
|
144
|
-
"changes": [change] if partial else [],
|
|
145
|
-
"unattributed": [change] if partial else [],
|
|
146
|
-
"unresolvedScopes": [unresolved] if partial else [],
|
|
147
|
-
"noCodeReason": None if partial else "No project content changed during this verification.",
|
|
148
|
-
}
|
|
149
|
-
scope_hash = canonical_hash("comet.native.implementation-scope.v2", content)
|
|
150
|
-
scope = {**content, "scopeHash": scope_hash}
|
|
151
|
-
for kind, digest, value in (
|
|
152
|
-
("snapshots", baseline_hash, baseline),
|
|
153
|
-
("snapshots", current_hash, current),
|
|
154
|
-
("scopes", scope_hash, scope),
|
|
155
|
-
):
|
|
156
|
-
write_json(change_root / f"runtime/evidence/{kind}/{digest}.json", value)
|
|
157
|
-
return f"runtime/evidence/scopes/{scope_hash}.json", scope
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
def write_contract_artifacts(
|
|
161
|
-
change_root: Path,
|
|
162
|
-
state: dict,
|
|
163
|
-
capability: str,
|
|
164
|
-
) -> dict:
|
|
165
|
-
brief = (
|
|
166
|
-
"# Goal\nExercise the Native workflow.\n\n"
|
|
167
|
-
"# Acceptance examples\n- The focused CLI behavior is verified by a project artifact.\n"
|
|
168
|
-
)
|
|
169
|
-
spec = (
|
|
170
|
-
f"# {capability}\n\n## Requirement: Focused behavior\n\n"
|
|
171
|
-
"### Scenario: Focused CLI result\nGiven representative input, the requested output is produced.\n"
|
|
172
|
-
)
|
|
173
|
-
(change_root / f"specs/{capability}").mkdir(parents=True, exist_ok=True)
|
|
174
|
-
(change_root / "brief.md").write_text(brief, encoding="utf-8")
|
|
175
|
-
(change_root / f"specs/{capability}/spec.md").write_text(spec, encoding="utf-8")
|
|
176
|
-
state.update(
|
|
177
|
-
{
|
|
178
|
-
"brief": "brief.md",
|
|
179
|
-
"spec_changes": [
|
|
180
|
-
{
|
|
181
|
-
"capability": capability,
|
|
182
|
-
"operation": "create",
|
|
183
|
-
"source": f"specs/{capability}/spec.md",
|
|
184
|
-
"base_hash": None,
|
|
185
|
-
}
|
|
186
|
-
],
|
|
187
|
-
}
|
|
188
|
-
)
|
|
189
|
-
return build_contract_from_change(change_root, state)
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
def write_check_receipt(
|
|
193
|
-
change_root: Path,
|
|
194
|
-
*,
|
|
195
|
-
change: str,
|
|
196
|
-
source_revision: int,
|
|
197
|
-
contract_hash: str,
|
|
198
|
-
scope: dict,
|
|
199
|
-
) -> str:
|
|
200
|
-
selected = [item for item in scope["changes"] if item["after"] is not None]
|
|
201
|
-
checker = {
|
|
202
|
-
"policy": "scoped-text-safety",
|
|
203
|
-
"version": 1,
|
|
204
|
-
"hash": CHECKER_HASH,
|
|
205
|
-
"limits": CHECK_LIMITS,
|
|
206
|
-
}
|
|
207
|
-
input_hash = canonical_hash(
|
|
208
|
-
"comet.native.check-input.v1",
|
|
209
|
-
{
|
|
210
|
-
"change": change,
|
|
211
|
-
"sourceRevision": source_revision,
|
|
212
|
-
"checkerHash": checker["hash"],
|
|
213
|
-
"contractHash": contract_hash,
|
|
214
|
-
"scopeHash": scope["scopeHash"],
|
|
215
|
-
"snapshotHash": scope["currentProjectionHash"],
|
|
216
|
-
},
|
|
217
|
-
)
|
|
218
|
-
content = {
|
|
219
|
-
"schema": "comet.native.check-receipt.v1",
|
|
220
|
-
"change": change,
|
|
221
|
-
"sourceRevision": source_revision,
|
|
222
|
-
"checker": checker,
|
|
223
|
-
"inputHash": input_hash,
|
|
224
|
-
"status": "passed",
|
|
225
|
-
"startedAt": "2026-07-17T00:00:00.000Z",
|
|
226
|
-
"endedAt": "2026-07-17T00:00:01.000Z",
|
|
227
|
-
"contract": {
|
|
228
|
-
"expectedHash": contract_hash,
|
|
229
|
-
"beforeHash": contract_hash,
|
|
230
|
-
"afterHash": contract_hash,
|
|
231
|
-
},
|
|
232
|
-
"implementation": {
|
|
233
|
-
"scopeHash": scope["scopeHash"],
|
|
234
|
-
"expectedSnapshotHash": scope["currentProjectionHash"],
|
|
235
|
-
"beforeSnapshotHash": scope["currentProjectionHash"],
|
|
236
|
-
"afterSnapshotHash": scope["currentProjectionHash"],
|
|
237
|
-
},
|
|
238
|
-
"counts": {
|
|
239
|
-
"filesSelected": len(selected),
|
|
240
|
-
"filesScanned": len(selected),
|
|
241
|
-
"binaryFilesSkipped": 0,
|
|
242
|
-
"bytesScanned": sum(item["after"]["size"] for item in selected),
|
|
243
|
-
"issueCount": 0,
|
|
244
|
-
"recordedIssueCount": 0,
|
|
245
|
-
},
|
|
246
|
-
"issues": [],
|
|
247
|
-
"issuesTruncated": False,
|
|
248
|
-
"stale": False,
|
|
249
|
-
"staleReasons": [],
|
|
250
|
-
}
|
|
251
|
-
receipt_hash = canonical_hash("comet.native.check-receipt.v1", content)
|
|
252
|
-
receipt_ref = f"runtime/evidence/check-receipts/{receipt_hash}.json"
|
|
253
|
-
write_json(change_root / receipt_ref, {**content, "receiptHash": receipt_hash})
|
|
254
|
-
return receipt_ref
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
def write_verification_bundle(
|
|
258
|
-
workspace: Path,
|
|
259
|
-
change_root: Path,
|
|
260
|
-
state: dict,
|
|
261
|
-
contract: dict,
|
|
262
|
-
*,
|
|
263
|
-
result: str,
|
|
264
|
-
source_revision: int,
|
|
265
|
-
created_at: str,
|
|
266
|
-
partial: bool = False,
|
|
267
|
-
include_receipt: bool = False,
|
|
268
|
-
) -> str:
|
|
269
|
-
scope_ref, scope = write_scope(
|
|
270
|
-
workspace, change_root, contract["contractHash"], partial=partial
|
|
271
|
-
)
|
|
272
|
-
allowance_ref = None
|
|
273
|
-
allowance_hash = None
|
|
274
|
-
if partial:
|
|
275
|
-
allowance_content = {
|
|
276
|
-
"schema": "comet.native.partial-allowance.v1",
|
|
277
|
-
"change": state["name"],
|
|
278
|
-
"scopeHash": scope["scopeHash"],
|
|
279
|
-
"scopeIds": [item["id"] for item in scope["unresolvedScopes"]],
|
|
280
|
-
"reason": "The unrelated fixture file is intentionally outside this change.",
|
|
281
|
-
"confirmedSummary": "Confirmed the exact partial scope for this eval.",
|
|
282
|
-
"sourceRevision": source_revision - 1,
|
|
283
|
-
"confirmedAt": "2026-07-17T00:00:00.000Z",
|
|
284
|
-
}
|
|
285
|
-
allowance_hash = canonical_hash("comet.native.partial-allowance.v1", allowance_content)
|
|
286
|
-
allowance = {**allowance_content, "allowanceHash": allowance_hash}
|
|
287
|
-
allowance_ref = f"runtime/evidence/allowances/{allowance_hash}.json"
|
|
288
|
-
write_json(change_root / allowance_ref, allowance)
|
|
289
|
-
report_ref = f"verification-{source_revision}.md"
|
|
290
|
-
report_text = (
|
|
291
|
-
"\n".join(
|
|
292
|
-
f"acceptance_id: {criterion['id']}\nevidence: project file"
|
|
293
|
-
for criterion in contract["acceptance"]
|
|
294
|
-
)
|
|
295
|
-
+ "\n"
|
|
296
|
-
)
|
|
297
|
-
(change_root / report_ref).write_text(report_text, encoding="utf-8")
|
|
298
|
-
report_bytes = (change_root / report_ref).read_bytes()
|
|
299
|
-
report_hash = hashlib.sha256(report_bytes).hexdigest()
|
|
300
|
-
write_json(
|
|
301
|
-
change_root / f"runtime/evidence/reports/{report_hash}.json",
|
|
302
|
-
{
|
|
303
|
-
"schema": "comet.native.verification-report.v1",
|
|
304
|
-
"reportHash": report_hash,
|
|
305
|
-
"content": report_bytes.decode("utf-8"),
|
|
306
|
-
},
|
|
307
|
-
)
|
|
308
|
-
entries = []
|
|
309
|
-
evidence_files = ["test_wordcount.py", "wordcount.py"]
|
|
310
|
-
for index, criterion in enumerate(contract["acceptance"]):
|
|
311
|
-
entries.append(
|
|
312
|
-
{
|
|
313
|
-
"acceptanceId": criterion["id"],
|
|
314
|
-
"kind": criterion["kind"],
|
|
315
|
-
"source": criterion["source"],
|
|
316
|
-
"evidenceRefs": [evidence_files[index % len(evidence_files)]],
|
|
317
|
-
"skippedReason": None,
|
|
318
|
-
}
|
|
319
|
-
)
|
|
320
|
-
entries.sort(key=lambda item: item["acceptanceId"])
|
|
321
|
-
trace_content = {
|
|
322
|
-
"schema": "comet.native.acceptance-trace.v1",
|
|
323
|
-
"nativeRootRef": "docs/comet",
|
|
324
|
-
"criteriaHash": contract["acceptanceHash"],
|
|
325
|
-
"total": len(entries),
|
|
326
|
-
"evidenced": len(entries),
|
|
327
|
-
"skipped": 0,
|
|
328
|
-
"entries": entries,
|
|
329
|
-
}
|
|
330
|
-
trace = {
|
|
331
|
-
**trace_content,
|
|
332
|
-
"traceHash": canonical_hash("comet.native.acceptance-trace.v1", trace_content),
|
|
333
|
-
}
|
|
334
|
-
receipt_ref = (
|
|
335
|
-
write_check_receipt(
|
|
336
|
-
change_root,
|
|
337
|
-
change=state["name"],
|
|
338
|
-
source_revision=source_revision,
|
|
339
|
-
contract_hash=contract["contractHash"],
|
|
340
|
-
scope=scope,
|
|
341
|
-
)
|
|
342
|
-
if include_receipt
|
|
343
|
-
else None
|
|
344
|
-
)
|
|
345
|
-
envelope_content = {
|
|
346
|
-
"schema": "comet.native.verification-evidence.v1",
|
|
347
|
-
"change": state["name"],
|
|
348
|
-
"sourceRevision": source_revision,
|
|
349
|
-
"result": result,
|
|
350
|
-
"freshness": "partial" if partial else "complete",
|
|
351
|
-
"contractHash": contract["contractHash"],
|
|
352
|
-
"acceptanceCriteriaHash": contract["acceptanceHash"],
|
|
353
|
-
"implementationScopeRef": scope_ref,
|
|
354
|
-
"implementationScopeHash": scope["scopeHash"],
|
|
355
|
-
"reportRef": report_ref,
|
|
356
|
-
"reportHash": report_hash,
|
|
357
|
-
"acceptanceTrace": trace,
|
|
358
|
-
"partialAllowanceRef": allowance_ref,
|
|
359
|
-
"partialAllowanceHash": allowance_hash,
|
|
360
|
-
"receiptRef": receipt_ref,
|
|
361
|
-
"createdAt": created_at,
|
|
362
|
-
}
|
|
363
|
-
envelope_hash = canonical_hash("comet.native.verification-evidence.v1", envelope_content)
|
|
364
|
-
ref = f"runtime/evidence/verifications/{envelope_hash}.json"
|
|
365
|
-
write_json(change_root / ref, {**envelope_content, "envelopeHash": envelope_hash})
|
|
366
|
-
return ref
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
def write_archive_transaction(
|
|
370
|
-
workspace: Path,
|
|
371
|
-
transaction_id: str,
|
|
372
|
-
change: str,
|
|
373
|
-
preflight_hash: str,
|
|
374
|
-
) -> None:
|
|
375
|
-
target = f"archive/2026-07-17-{change}"
|
|
376
|
-
write_json(
|
|
377
|
-
workspace / "docs/comet/runtime/transactions" / transaction_id / "transaction.json",
|
|
378
|
-
{
|
|
379
|
-
"schema": "comet.native.transaction.v2",
|
|
380
|
-
"id": transaction_id,
|
|
381
|
-
"kind": "archive",
|
|
382
|
-
"status": "committed",
|
|
383
|
-
"change": change,
|
|
384
|
-
"createdAt": "2026-07-17T00:00:00.000Z",
|
|
385
|
-
"preflightHash": preflight_hash,
|
|
386
|
-
"operations": [
|
|
387
|
-
{
|
|
388
|
-
"id": "archive-change",
|
|
389
|
-
"type": "move",
|
|
390
|
-
"source": f"changes/{change}",
|
|
391
|
-
"target": target,
|
|
392
|
-
"expectedSourceHash": "d" * 64,
|
|
393
|
-
"expectedTargetHash": None,
|
|
394
|
-
}
|
|
395
|
-
],
|
|
396
|
-
},
|
|
397
|
-
)
|
|
398
|
-
events = [
|
|
399
|
-
("prepared", None),
|
|
400
|
-
("operation-started", "archive-change"),
|
|
401
|
-
("operation-completed", "archive-change"),
|
|
402
|
-
("archive-finalization-started", None),
|
|
403
|
-
("archive-finalized", None),
|
|
404
|
-
("commit", None),
|
|
405
|
-
]
|
|
406
|
-
event_file = workspace / "docs/comet/runtime/transactions" / transaction_id / "events.jsonl"
|
|
407
|
-
event_file.write_text(
|
|
408
|
-
"\n".join(
|
|
409
|
-
json.dumps(
|
|
410
|
-
{
|
|
411
|
-
"sequence": index,
|
|
412
|
-
"timestamp": "2026-07-17T00:00:00.000Z",
|
|
413
|
-
"type": event_type,
|
|
414
|
-
**({"operationId": operation_id} if operation_id else {}),
|
|
415
|
-
}
|
|
416
|
-
)
|
|
417
|
-
for index, (event_type, operation_id) in enumerate(events, 1)
|
|
418
|
-
)
|
|
419
|
-
+ "\n",
|
|
420
|
-
encoding="utf-8",
|
|
421
|
-
)
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
def test_wave_tasks_use_the_native_skill_contract_and_executable_validators():
|
|
425
|
-
runtime = EVAL_ROOT.parent / "assets/skills/comet-native/scripts/comet-native-runtime.mjs"
|
|
426
|
-
assert runtime.is_file()
|
|
427
|
-
for name, interaction_mode in WAVE_TASKS.items():
|
|
428
|
-
task = load_task(name)
|
|
429
|
-
assert task.default_treatments == ["COMET_NATIVE_PHASE1"]
|
|
430
|
-
assert (task.environment_dir / "Dockerfile").is_file()
|
|
431
|
-
assert (task.environment_dir / "wordcount.py").is_file()
|
|
432
|
-
assert (task.environment_dir / "test_wordcount.py").is_file()
|
|
433
|
-
assert task.config.evaluation.profile == "generic"
|
|
434
|
-
assert task.config.evaluation.required_skills == ["comet-native"]
|
|
435
|
-
assert task.config.evaluation.require_skill_invocation is True
|
|
436
|
-
assert task.config.interaction.mode == interaction_mode
|
|
437
|
-
assert task.load_validators()
|
|
438
|
-
prompt = task.render_prompt()
|
|
439
|
-
assert "`/comet-native` Skill" in prompt
|
|
440
|
-
assert "Do not fabricate" in prompt
|
|
441
|
-
assert ".cache/comet-native-eval" in prompt
|
|
442
|
-
assert "eval-evidence" not in prompt
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
def test_wave_tasks_are_registered_in_the_local_index():
|
|
446
|
-
index = yaml.safe_load((TASKS_ROOT / "index.yaml").read_text(encoding="utf-8"))
|
|
447
|
-
indexed = {entry["name"] for entry in index["tasks"]}
|
|
448
|
-
assert set(WAVE_TASKS).issubset(indexed)
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
def test_wave_f_requests_a_current_checkout_cli_snapshot():
|
|
452
|
-
environment = TASKS_ROOT / "comet-native-wave-f-dashboard-readonly/environment"
|
|
453
|
-
assert (environment / ".include-current-comet-cli").is_file()
|
|
454
|
-
dockerfile = (environment / "Dockerfile").read_text(encoding="utf-8")
|
|
455
|
-
wrapper = (environment / "current-comet.sh").read_text(encoding="utf-8")
|
|
456
|
-
prompt = load_task("comet-native-wave-f-dashboard-readonly").render_prompt()
|
|
457
|
-
|
|
458
|
-
assert "FROM node:22" in dockerfile
|
|
459
|
-
assert "npm install --prefix /opt/comet-cli" in dockerfile
|
|
460
|
-
assert "/workspace/_eval_current_comet" in wrapper
|
|
461
|
-
assert 'runtime="$(mktemp -d)"' in wrapper
|
|
462
|
-
assert '"$snapshot/node_modules"' not in wrapper
|
|
463
|
-
docker_harness = (EVAL_ROOT / "scaffold/shell/docker.sh").read_text(encoding="utf-8")
|
|
464
|
-
assert "_eval_current_comet:ro" in docker_harness
|
|
465
|
-
assert "current-comet.sh dashboard . --json" in prompt
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
def test_wave_f_current_checkout_dependency_snapshot_matches_package_runtime_dependencies():
|
|
469
|
-
"""Keep the eval image's installed runtime dependencies in lockstep with Comet."""
|
|
470
|
-
package = json.loads((EVAL_ROOT.parent / "package.json").read_text(encoding="utf-8"))
|
|
471
|
-
snapshot = json.loads(
|
|
472
|
-
(
|
|
473
|
-
TASKS_ROOT
|
|
474
|
-
/ "comet-native-wave-f-dashboard-readonly/environment/current-comet-package.json"
|
|
475
|
-
).read_text(encoding="utf-8")
|
|
476
|
-
)
|
|
477
|
-
|
|
478
|
-
assert snapshot.get("private") is True
|
|
479
|
-
assert snapshot.get("type") == package.get("type")
|
|
480
|
-
assert snapshot.get("dependencies") == package.get("dependencies")
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
def test_current_cli_snapshot_helper_source_builds_checkout(monkeypatch, tmp_path: Path):
|
|
484
|
-
eval_conftest = sys.modules["conftest"]
|
|
485
|
-
checkout = tmp_path / "checkout"
|
|
486
|
-
(checkout / "bin").mkdir(parents=True)
|
|
487
|
-
(checkout / "bin/comet.js").write_text("import '../dist/index.js';\n", encoding="utf-8")
|
|
488
|
-
(checkout / "package.json").write_text('{"type":"module"}\n', encoding="utf-8")
|
|
489
|
-
(checkout / "assets/skills/comet").mkdir(parents=True)
|
|
490
|
-
(checkout / "assets/manifest.json").write_text(
|
|
491
|
-
'{"skills":["comet/SKILL.md"]}\n', encoding="utf-8"
|
|
492
|
-
)
|
|
493
|
-
(checkout / "assets/skills/comet/SKILL.md").write_text("# Comet\n", encoding="utf-8")
|
|
494
|
-
environment = tmp_path / "environment"
|
|
495
|
-
environment.mkdir()
|
|
496
|
-
(environment / ".include-current-comet-cli").write_text("include\n", encoding="utf-8")
|
|
497
|
-
workspace = tmp_path / "workspace"
|
|
498
|
-
workspace.mkdir()
|
|
499
|
-
monkeypatch.setattr(eval_conftest, "REPOSITORY_ROOT", checkout)
|
|
500
|
-
|
|
501
|
-
def fake_source_build(_checkout: Path, output: Path) -> str:
|
|
502
|
-
(output / "app/cli").mkdir(parents=True)
|
|
503
|
-
(output / "domains/dashboard").mkdir(parents=True)
|
|
504
|
-
(output / "app/cli/index.js").write_text("export {};\n", encoding="utf-8")
|
|
505
|
-
(output / "domains/dashboard/native-adapter.js").write_text(
|
|
506
|
-
"export const schema = 'native';\n", encoding="utf-8"
|
|
507
|
-
)
|
|
508
|
-
return "5.9.3"
|
|
509
|
-
|
|
510
|
-
monkeypatch.setattr(eval_conftest, "_build_current_comet_dist", fake_source_build)
|
|
511
|
-
|
|
512
|
-
eval_conftest._copy_current_comet_cli_snapshot(environment, workspace)
|
|
513
|
-
|
|
514
|
-
snapshot = workspace / "_eval_current_comet"
|
|
515
|
-
assert (snapshot / "bin/comet.js").is_file()
|
|
516
|
-
assert (snapshot / "dist/app/cli/index.js").is_file()
|
|
517
|
-
assert (snapshot / "dist/domains/dashboard/native-adapter.js").is_file()
|
|
518
|
-
assert (snapshot / "assets/manifest.json").is_file()
|
|
519
|
-
assert (snapshot / "assets/skills/comet/SKILL.md").is_file()
|
|
520
|
-
assert (snapshot / "package.json").is_file()
|
|
521
|
-
identity = json.loads((snapshot / "build-identity.json").read_text(encoding="utf-8"))
|
|
522
|
-
assert identity["schema"] == "comet.eval.current-comet-build.v1"
|
|
523
|
-
assert identity["sourceFileCount"] >= 4
|
|
524
|
-
assert identity["snapshotFileCount"] >= 6
|
|
525
|
-
assert identity["assetsFileCount"] == 2
|
|
526
|
-
assert identity["assetsHash"]
|
|
527
|
-
assert identity["manifestHash"]
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
def test_controller_snapshots_native_runtime_for_readonly_oracle(tmp_path: Path):
|
|
531
|
-
eval_conftest = sys.modules["conftest"]
|
|
532
|
-
environment = tmp_path / "environment"
|
|
533
|
-
environment.mkdir()
|
|
534
|
-
(environment / ".include-trusted-native-runtime").write_text("include\n", encoding="utf-8")
|
|
535
|
-
skill_source = tmp_path / "skill/comet-native"
|
|
536
|
-
runtime = skill_source / "scripts/comet-native-runtime.mjs"
|
|
537
|
-
runtime.parent.mkdir(parents=True)
|
|
538
|
-
runtime.write_text("export const trusted = true;\n", encoding="utf-8")
|
|
539
|
-
workspace = tmp_path / "workspace"
|
|
540
|
-
workspace.mkdir()
|
|
541
|
-
|
|
542
|
-
eval_conftest._copy_trusted_native_runtime_snapshot(
|
|
543
|
-
environment,
|
|
544
|
-
workspace,
|
|
545
|
-
{"comet-native": {"source_dir": skill_source}},
|
|
546
|
-
)
|
|
547
|
-
|
|
548
|
-
oracle = workspace / "_eval_trusted_oracles/comet-native-runtime.mjs"
|
|
549
|
-
identity = json.loads(
|
|
550
|
-
(workspace / "_eval_trusted_oracles/native-runtime-identity.json").read_text(
|
|
551
|
-
encoding="utf-8"
|
|
552
|
-
)
|
|
553
|
-
)
|
|
554
|
-
assert oracle.read_bytes() == runtime.read_bytes()
|
|
555
|
-
assert identity == {
|
|
556
|
-
"schema": "comet.eval.trusted-native-runtime.v1",
|
|
557
|
-
"runtimeFile": oracle.name,
|
|
558
|
-
"runtimeHash": hashlib.sha256(oracle.read_bytes()).hexdigest(),
|
|
559
|
-
}
|
|
560
|
-
docker_harness = (EVAL_ROOT / "scaffold/shell/docker.sh").read_text(encoding="utf-8")
|
|
561
|
-
assert "_eval_trusted_oracles:ro" in docker_harness
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
def test_native_workflow_validator_recomputes_typed_receipt_hash(tmp_path: Path):
|
|
565
|
-
validator = load_validator("comet-native-workflow", "test_native_workflow.py")
|
|
566
|
-
archived = tmp_path / "archive"
|
|
567
|
-
content = {
|
|
568
|
-
"schema": "comet.native.verification-receipt.v3",
|
|
569
|
-
"kind": "manual-evidence",
|
|
570
|
-
"role": "acceptance-evidence",
|
|
571
|
-
"status": "passed",
|
|
572
|
-
"bindings": {
|
|
573
|
-
"change": "sentence-counting",
|
|
574
|
-
"sourceRevision": 3,
|
|
575
|
-
"contractHash": "1" * 64,
|
|
576
|
-
"scopeHash": "2" * 64,
|
|
577
|
-
"snapshotHash": "3" * 64,
|
|
578
|
-
"artifactHash": "4" * 64,
|
|
579
|
-
},
|
|
580
|
-
"acceptanceIds": ["acceptance-" + "a" * 64],
|
|
581
|
-
"actor": "eval-manual",
|
|
582
|
-
"issuedAt": "2026-07-28T00:00:00.000Z",
|
|
583
|
-
"evidence": {
|
|
584
|
-
"steps": ["Run the sentence check."],
|
|
585
|
-
"observations": ["The check passed."],
|
|
586
|
-
"responsible": "eval-manual",
|
|
587
|
-
},
|
|
588
|
-
}
|
|
589
|
-
digest = validator._canonical_hash(
|
|
590
|
-
"comet.native.verification-receipt.v3", content
|
|
591
|
-
)
|
|
592
|
-
reference = f"runtime/evidence/receipts/{digest}.json"
|
|
593
|
-
receipt_file = archived / reference
|
|
594
|
-
write_json(receipt_file, {**content, "receiptHash": digest})
|
|
595
|
-
|
|
596
|
-
assert validator._read_typed_receipt(archived, reference)["receiptHash"] == digest
|
|
597
|
-
|
|
598
|
-
forged = json.loads(receipt_file.read_text(encoding="utf-8"))
|
|
599
|
-
forged["evidence"]["observations"] = ["A forged result."]
|
|
600
|
-
write_json(receipt_file, forged)
|
|
601
|
-
with pytest.raises(ValueError, match="schema/hash"):
|
|
602
|
-
validator._read_typed_receipt(archived, reference)
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
def test_native_workflow_validator_accepts_current_acceptance_trace_entries():
|
|
606
|
-
validator = load_validator("comet-native-workflow", "test_native_workflow.py")
|
|
607
|
-
reference = f"runtime/evidence/receipts/{'b' * 64}.json"
|
|
608
|
-
entry = {
|
|
609
|
-
"acceptanceId": f"acceptance-{'a' * 64}",
|
|
610
|
-
"status": "passed",
|
|
611
|
-
"kind": "spec-must",
|
|
612
|
-
"source": "specs/sentence-counting/spec.md",
|
|
613
|
-
"evidenceRefs": [reference],
|
|
614
|
-
"skippedReason": None,
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
assert validator._direct_acceptance_receipt_refs(entry) == [reference]
|
|
618
|
-
|
|
619
|
-
legacy_entry = {key: value for key, value in entry.items() if key not in {"kind", "source"}}
|
|
620
|
-
with pytest.raises(ValueError, match="not a direct pass"):
|
|
621
|
-
validator._direct_acceptance_receipt_refs(legacy_entry)
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
def test_native_workflow_oracle_rejects_forged_runtime_identity(tmp_path: Path):
|
|
625
|
-
validator = load_validator("comet-native-workflow", "test_native_workflow.py")
|
|
626
|
-
validator.WORKSPACE = tmp_path
|
|
627
|
-
oracle = tmp_path / "_eval_trusted_oracles/comet-native-runtime.mjs"
|
|
628
|
-
oracle.parent.mkdir(parents=True)
|
|
629
|
-
oracle.write_text("console.log('{}');\n", encoding="utf-8")
|
|
630
|
-
write_json(
|
|
631
|
-
oracle.parent / "native-runtime-identity.json",
|
|
632
|
-
{
|
|
633
|
-
"schema": "comet.eval.trusted-native-runtime.v1",
|
|
634
|
-
"runtimeFile": oracle.name,
|
|
635
|
-
"runtimeHash": hashlib.sha256(oracle.read_bytes()).hexdigest(),
|
|
636
|
-
},
|
|
637
|
-
)
|
|
638
|
-
assert validator._trusted_native_runtime() == oracle
|
|
639
|
-
|
|
640
|
-
oracle.write_text("console.log('{\"forged\":true}');\n", encoding="utf-8")
|
|
641
|
-
with pytest.raises(ValueError, match="does not match"):
|
|
642
|
-
validator._trusted_native_runtime()
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
def test_native_workflow_validator_rejects_contract_not_recomputed_by_oracle(
|
|
646
|
-
monkeypatch, tmp_path: Path
|
|
647
|
-
):
|
|
648
|
-
validator = load_validator("comet-native-workflow", "test_native_workflow.py")
|
|
649
|
-
validator.WORKSPACE = tmp_path
|
|
650
|
-
oracle = tmp_path / "_eval_trusted_oracles/comet-native-runtime.mjs"
|
|
651
|
-
oracle.parent.mkdir(parents=True)
|
|
652
|
-
oracle.write_text("console.log('{}');\n", encoding="utf-8")
|
|
653
|
-
write_json(
|
|
654
|
-
oracle.parent / "native-runtime-identity.json",
|
|
655
|
-
{
|
|
656
|
-
"schema": "comet.eval.trusted-native-runtime.v1",
|
|
657
|
-
"runtimeFile": oracle.name,
|
|
658
|
-
"runtimeHash": hashlib.sha256(oracle.read_bytes()).hexdigest(),
|
|
659
|
-
},
|
|
660
|
-
)
|
|
661
|
-
archived = tmp_path / "archive"
|
|
662
|
-
(archived / "specs" / "sentence-counting").mkdir(parents=True)
|
|
663
|
-
(archived / "brief.md").write_text(
|
|
664
|
-
"# Acceptance examples\n- The feature works.\n", encoding="utf-8"
|
|
665
|
-
)
|
|
666
|
-
(archived / "specs" / "sentence-counting" / "spec.md").write_text(
|
|
667
|
-
"# Sentence counting\n- Counts sentences.\n", encoding="utf-8"
|
|
668
|
-
)
|
|
669
|
-
(archived / "comet-state.yaml").write_text(
|
|
670
|
-
"schema: comet.native.v1\nname: sentence-counting\n", encoding="utf-8"
|
|
671
|
-
)
|
|
672
|
-
state = {
|
|
673
|
-
"name": "sentence-counting",
|
|
674
|
-
"brief": "brief.md",
|
|
675
|
-
"spec_changes": [
|
|
676
|
-
{
|
|
677
|
-
"capability": "sentence-counting",
|
|
678
|
-
"operation": "create",
|
|
679
|
-
"source": "specs/sentence-counting/spec.md",
|
|
680
|
-
"base_hash": None,
|
|
681
|
-
}
|
|
682
|
-
],
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
def forged_runtime(*args, **kwargs):
|
|
686
|
-
return subprocess.CompletedProcess(
|
|
687
|
-
args=args[0],
|
|
688
|
-
returncode=0,
|
|
689
|
-
stdout=json.dumps(
|
|
690
|
-
{
|
|
691
|
-
"command": "status",
|
|
692
|
-
"exitCode": 0,
|
|
693
|
-
"data": {
|
|
694
|
-
"phase": "build",
|
|
695
|
-
"findingSummary": {
|
|
696
|
-
"errors": 1,
|
|
697
|
-
"codes": ["contract-changed-after-approval"],
|
|
698
|
-
},
|
|
699
|
-
},
|
|
700
|
-
}
|
|
701
|
-
),
|
|
702
|
-
stderr="",
|
|
703
|
-
)
|
|
704
|
-
|
|
705
|
-
monkeypatch.setattr(validator.subprocess, "run", forged_runtime)
|
|
706
|
-
with pytest.raises(ValueError, match="contract"):
|
|
707
|
-
validator._validate_native_contract_with_trusted_runtime(
|
|
708
|
-
archived, state, "a" * 64
|
|
709
|
-
)
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
def test_native_workflow_validator_rejects_scope_snapshot_not_matching_workspace(tmp_path: Path):
|
|
713
|
-
validator = load_validator("comet-native-workflow", "test_native_workflow.py")
|
|
714
|
-
validator.WORKSPACE = tmp_path
|
|
715
|
-
implementation = tmp_path / "wordcount.py"
|
|
716
|
-
implementation.write_text("print('actual')\n", encoding="utf-8")
|
|
717
|
-
archived = tmp_path / "archive"
|
|
718
|
-
archived.mkdir()
|
|
719
|
-
projection = {
|
|
720
|
-
"schema": "comet.native.content-snapshot-projection.v1",
|
|
721
|
-
"entries": [{"path": "wordcount.py", "hash": "0" * 64, "size": 1}],
|
|
722
|
-
}
|
|
723
|
-
projection_hash = validator._canonical_hash(
|
|
724
|
-
"comet.native.content-snapshot-projection.v1", projection
|
|
725
|
-
)
|
|
726
|
-
projection_ref = f"runtime/evidence/snapshots/{projection_hash}.json"
|
|
727
|
-
write_json(archived / projection_ref, projection)
|
|
728
|
-
declared = [{"path": "wordcount.py", "kind": "file"}]
|
|
729
|
-
scope_content = {
|
|
730
|
-
"schema": "comet.native.implementation-scope.v2",
|
|
731
|
-
"contractHash": "1" * 64,
|
|
732
|
-
"currentProjectionRef": projection_ref,
|
|
733
|
-
"currentProjectionHash": projection_hash,
|
|
734
|
-
"declaredArtifacts": declared,
|
|
735
|
-
}
|
|
736
|
-
scope_hash = validator._canonical_hash(
|
|
737
|
-
"comet.native.implementation-scope.v2", scope_content
|
|
738
|
-
)
|
|
739
|
-
write_json(
|
|
740
|
-
archived / f"runtime/evidence/scopes/{scope_hash}.json",
|
|
741
|
-
{**scope_content, "scopeHash": scope_hash},
|
|
742
|
-
)
|
|
743
|
-
bindings = {
|
|
744
|
-
"contractHash": "1" * 64,
|
|
745
|
-
"scopeHash": scope_hash,
|
|
746
|
-
"snapshotHash": projection_hash,
|
|
747
|
-
"artifactHash": validator._canonical_hash(
|
|
748
|
-
"comet.native.declared-artifacts.v1", declared
|
|
749
|
-
),
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
with pytest.raises(ValueError, match="snapshot entry"):
|
|
753
|
-
validator._validate_native_scope_bindings(archived, bindings)
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
def test_controller_source_build_contains_current_native_dashboard_adapter(tmp_path: Path):
|
|
757
|
-
eval_conftest = sys.modules["conftest"]
|
|
758
|
-
output = tmp_path / "dist"
|
|
759
|
-
|
|
760
|
-
version = eval_conftest._build_current_comet_dist(EVAL_ROOT.parent, output)
|
|
761
|
-
|
|
762
|
-
assert version
|
|
763
|
-
assert (output / "app/cli/index.js").is_file()
|
|
764
|
-
assert (output / "domains/dashboard/native-adapter.js").is_file()
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
def test_wave_b_prompt_hides_the_normalization_decision_and_requires_disk_resume():
|
|
768
|
-
task = load_task("comet-native-wave-b-decision-resume")
|
|
769
|
-
prompt = task.render_prompt()
|
|
770
|
-
|
|
771
|
-
assert "case-insensitive" not in prompt.lower()
|
|
772
|
-
assert "strip surrounding punctuation" not in prompt.lower()
|
|
773
|
-
assert "distinct normalized word values" in prompt.lower()
|
|
774
|
-
assert "words that occur exactly once" in prompt.lower()
|
|
775
|
-
assert task.config.interaction.decision_reply == (
|
|
776
|
-
"Treat words case-insensitively, strip surrounding punctuation, and preserve internal apostrophes."
|
|
777
|
-
)
|
|
778
|
-
continuation = task.config.interaction.continue_prompt.lower()
|
|
779
|
-
assert "context-cleared continuation" in continuation
|
|
780
|
-
assert "invoke `/comet-native`" in continuation
|
|
781
|
-
assert "first bash command" in continuation
|
|
782
|
-
assert "before any read, edit, test, or transition" in continuation
|
|
783
|
-
assert "status add-unique-counting --json" in continuation
|
|
784
|
-
assert "archive-preview.json" in continuation
|
|
785
|
-
assert "archive-commit.json" in continuation
|
|
786
|
-
assert "--dry-run --json" in continuation
|
|
787
|
-
assert "--expect-preflight" in continuation
|
|
788
|
-
assert "redirect stdout directly" in continuation
|
|
789
|
-
assert "exactly once" in continuation
|
|
790
|
-
assert "never overwrite" in continuation
|
|
791
|
-
assert "do not reconstruct" in continuation
|
|
792
|
-
assert task.config.interaction.fresh_resume_marker == "COMET_NATIVE_COLD_RESUME_READY"
|
|
793
|
-
assert "deliberately omits" not in prompt.lower()
|
|
794
|
-
assert "redirect stdout directly" in prompt.lower()
|
|
795
|
-
assert "verify all three files exist" in prompt.lower()
|
|
796
|
-
assert "do not rely on terminal output" in prompt.lower()
|
|
797
|
-
assert "before invoking either archive command" in prompt.lower()
|
|
798
|
-
assert "must itself redirect stdout" in prompt.lower()
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
def test_shared_wave_helpers_recognize_state_cas_and_readonly_projection(tmp_path: Path):
|
|
802
|
-
status_file = tmp_path / "status.json"
|
|
803
|
-
write_json(
|
|
804
|
-
status_file,
|
|
805
|
-
{"command": "status", "exitCode": 0, "data": {"freshness": "stale"}},
|
|
806
|
-
)
|
|
807
|
-
assert check_json_state(status_file, "stale")["status"] == "passed"
|
|
808
|
-
assert check_json_state(status_file, "partial")["status"] == "failed"
|
|
809
|
-
assert check_runtime_envelopes([status_file])["status"] == "passed"
|
|
810
|
-
|
|
811
|
-
attempt_a = tmp_path / "checkpoint-attempt-a.json"
|
|
812
|
-
write_json(
|
|
813
|
-
attempt_a,
|
|
814
|
-
{
|
|
815
|
-
"command": "checkpoint",
|
|
816
|
-
"exitCode": 0,
|
|
817
|
-
"data": {
|
|
818
|
-
"change": {"name": "normalize-case", "revision": 8},
|
|
819
|
-
"expectedRevision": 7,
|
|
820
|
-
"previousRevision": 7,
|
|
821
|
-
"revision": 8,
|
|
822
|
-
"outcome": "recorded",
|
|
823
|
-
},
|
|
824
|
-
},
|
|
825
|
-
)
|
|
826
|
-
attempt_b = tmp_path / "checkpoint-attempt-b.json"
|
|
827
|
-
write_json(
|
|
828
|
-
attempt_b,
|
|
829
|
-
{
|
|
830
|
-
"command": "checkpoint",
|
|
831
|
-
"exitCode": 73,
|
|
832
|
-
"data": {
|
|
833
|
-
"change": "normalize-case",
|
|
834
|
-
"expectedRevision": 7,
|
|
835
|
-
"actualRevision": 8,
|
|
836
|
-
"outcome": "revision-conflict",
|
|
837
|
-
},
|
|
838
|
-
},
|
|
839
|
-
)
|
|
840
|
-
assert check_checkpoint_cas_envelopes([attempt_a, attempt_b])["status"] == "passed"
|
|
841
|
-
write_json(
|
|
842
|
-
attempt_b,
|
|
843
|
-
{
|
|
844
|
-
"command": "checkpoint",
|
|
845
|
-
"exitCode": 73,
|
|
846
|
-
"data": {
|
|
847
|
-
"change": "normalize-case",
|
|
848
|
-
"expectedRevision": 7,
|
|
849
|
-
"actualRevision": 9,
|
|
850
|
-
"outcome": "revision-conflict",
|
|
851
|
-
},
|
|
852
|
-
},
|
|
853
|
-
)
|
|
854
|
-
assert check_checkpoint_cas_envelopes([attempt_a, attempt_b])["status"] == "failed"
|
|
855
|
-
|
|
856
|
-
cli_file = tmp_path / "cli.json"
|
|
857
|
-
dashboard_file = tmp_path / "dashboard.json"
|
|
858
|
-
projection = {
|
|
859
|
-
"name": "add-unique-counting",
|
|
860
|
-
"phase": "build",
|
|
861
|
-
"nextAction": "continue",
|
|
862
|
-
"verificationResult": "pending",
|
|
863
|
-
}
|
|
864
|
-
write_json(cli_file, {"data": projection})
|
|
865
|
-
write_json(dashboard_file, {"snapshot": {"changes": [projection]}})
|
|
866
|
-
assert check_dashboard_projection(cli_file, dashboard_file)["status"] == "passed"
|
|
867
|
-
|
|
868
|
-
dashboard_projection = {
|
|
869
|
-
**projection,
|
|
870
|
-
"selected": True,
|
|
871
|
-
"findings": {
|
|
872
|
-
"total": 1,
|
|
873
|
-
"errors": 0,
|
|
874
|
-
"warnings": 1,
|
|
875
|
-
"info": 0,
|
|
876
|
-
"requiresUserDecision": False,
|
|
877
|
-
"codes": ["workspace-root-changed"],
|
|
878
|
-
"truncated": False,
|
|
879
|
-
},
|
|
880
|
-
"continuation": {
|
|
881
|
-
"disposition": "continue",
|
|
882
|
-
"action": "work-phase",
|
|
883
|
-
"command": 'comet native next add-unique-counting --summary "<summary>"',
|
|
884
|
-
"requiresUserDecision": False,
|
|
885
|
-
"requiredInputs": ["summary"],
|
|
886
|
-
"requiredInputsTruncated": False,
|
|
887
|
-
},
|
|
888
|
-
}
|
|
889
|
-
cli_projection = {**dashboard_projection}
|
|
890
|
-
cli_projection["findingSummary"] = cli_projection.pop("findings")
|
|
891
|
-
write_json(cli_file, {"data": cli_projection})
|
|
892
|
-
write_json(dashboard_file, {"snapshot": {"changes": [dashboard_projection]}})
|
|
893
|
-
assert check_dashboard_projection(cli_file, dashboard_file)["status"] == "passed"
|
|
894
|
-
|
|
895
|
-
dashboard_projection["selected"] = False
|
|
896
|
-
write_json(dashboard_file, {"snapshot": {"changes": [dashboard_projection]}})
|
|
897
|
-
assert check_dashboard_projection(cli_file, dashboard_file)["status"] == "failed"
|
|
898
|
-
dashboard_projection["selected"] = True
|
|
899
|
-
dashboard_projection["findings"] = {
|
|
900
|
-
**cli_projection["findingSummary"],
|
|
901
|
-
"warnings": 0,
|
|
902
|
-
}
|
|
903
|
-
write_json(dashboard_file, {"snapshot": {"changes": [dashboard_projection]}})
|
|
904
|
-
assert check_dashboard_projection(cli_file, dashboard_file)["status"] == "failed"
|
|
905
|
-
dashboard_projection["findings"] = cli_projection["findingSummary"]
|
|
906
|
-
write_json(
|
|
907
|
-
dashboard_file,
|
|
908
|
-
{"snapshot": {"changes": [dashboard_projection, {**projection, "name": "extra"}]}},
|
|
909
|
-
)
|
|
910
|
-
assert check_dashboard_projection(cli_file, dashboard_file)["status"] == "failed"
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
def test_wave_b_validator_accepts_one_confirmed_archive_and_resume_snapshot(tmp_path: Path):
|
|
914
|
-
validator = load_validator(
|
|
915
|
-
"comet-native-wave-b-decision-resume", "test_native_wave_b_decision_resume.py"
|
|
916
|
-
)
|
|
917
|
-
validator.WORKSPACE = tmp_path
|
|
918
|
-
archived = tmp_path / "docs/comet/archive/2026-07-17-add-unique-counting"
|
|
919
|
-
(archived / "runtime").mkdir(parents=True)
|
|
920
|
-
(archived / "specs/unique-word-counting").mkdir(parents=True)
|
|
921
|
-
(tmp_path / "docs/comet/changes").mkdir(parents=True)
|
|
922
|
-
canonical = tmp_path / "docs/comet/specs/unique-word-counting/spec.md"
|
|
923
|
-
canonical.parent.mkdir(parents=True)
|
|
32
|
+
def _state(**overrides):
|
|
924
33
|
state = {
|
|
925
|
-
"
|
|
34
|
+
"schema": "comet.native.v4",
|
|
35
|
+
"name": "demo",
|
|
926
36
|
"phase": "archive",
|
|
927
|
-
"
|
|
928
|
-
"
|
|
37
|
+
"status": "done",
|
|
38
|
+
"state_version": 4,
|
|
39
|
+
"loop": {"stage": "done", "iteration": 1, "attempt": 1},
|
|
40
|
+
"acceptance": [{"id": "A1", "result": "passed"}],
|
|
41
|
+
"verification": {"verdict": "pass", "assurance": "host-attested"},
|
|
929
42
|
"verification_result": "pass",
|
|
930
|
-
|
|
931
|
-
(archived / "comet-state.yaml").write_text(yaml.safe_dump(state), encoding="utf-8")
|
|
932
|
-
decision = (
|
|
933
|
-
"Case-fold tokens with str.lower(), strip punctuation from the start and end of each "
|
|
934
|
-
"token. Internal punctuation is preserved; apostrophes are not removed."
|
|
935
|
-
)
|
|
936
|
-
(archived / "brief.md").write_text(f"# Decisions\n{decision}\n", encoding="utf-8")
|
|
937
|
-
(archived / "specs/unique-word-counting/spec.md").write_text(decision, encoding="utf-8")
|
|
938
|
-
canonical.write_text(decision, encoding="utf-8")
|
|
939
|
-
write_json(
|
|
940
|
-
tmp_path / ".cache/comet-native-eval/resume-status.json",
|
|
941
|
-
{
|
|
942
|
-
"command": "status",
|
|
943
|
-
"exitCode": 0,
|
|
944
|
-
"data": {"name": "add-unique-counting", "phase": "build"},
|
|
945
|
-
},
|
|
946
|
-
)
|
|
947
|
-
preflight_hash = "a" * 64
|
|
948
|
-
transaction_id = "aaaaaaaa-1111-2222-3333-bbbbbbbbbbbb"
|
|
949
|
-
write_json(
|
|
950
|
-
tmp_path / ".cache/comet-native-eval/archive-preview.json",
|
|
951
|
-
{
|
|
952
|
-
"command": "archive --dry-run",
|
|
953
|
-
"exitCode": 0,
|
|
954
|
-
"data": {
|
|
955
|
-
"ready": True,
|
|
956
|
-
"evidenceFreshness": "complete",
|
|
957
|
-
"findingCodes": [],
|
|
958
|
-
"preflightHash": preflight_hash,
|
|
959
|
-
},
|
|
960
|
-
},
|
|
961
|
-
)
|
|
962
|
-
write_json(
|
|
963
|
-
tmp_path / ".cache/comet-native-eval/archive-commit.json",
|
|
964
|
-
{
|
|
965
|
-
"command": "archive",
|
|
966
|
-
"exitCode": 0,
|
|
967
|
-
"data": {
|
|
968
|
-
"preflightHash": preflight_hash,
|
|
969
|
-
"transactionId": transaction_id,
|
|
970
|
-
},
|
|
971
|
-
},
|
|
972
|
-
)
|
|
973
|
-
write_archive_transaction(
|
|
974
|
-
tmp_path,
|
|
975
|
-
transaction_id,
|
|
976
|
-
"add-unique-counting",
|
|
977
|
-
preflight_hash,
|
|
978
|
-
)
|
|
979
|
-
write_json(
|
|
980
|
-
tmp_path / "_test_context.json",
|
|
981
|
-
{
|
|
982
|
-
"interaction": {
|
|
983
|
-
"mode": "auto_user",
|
|
984
|
-
"decision_points": 1,
|
|
985
|
-
"deterministic_replies": 1,
|
|
986
|
-
"fresh_resume_boundaries": 1,
|
|
987
|
-
"actual_turns": 2,
|
|
988
|
-
"max_turns": 4,
|
|
989
|
-
}
|
|
990
|
-
},
|
|
991
|
-
)
|
|
992
|
-
|
|
993
|
-
assert validator.check_decision_and_resume()["status"] == "passed"
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
def test_wave_c_validator_requires_bound_partial_stale_and_complete_archive(tmp_path: Path):
|
|
997
|
-
validator = load_validator(
|
|
998
|
-
"comet-native-wave-c-verification-integrity",
|
|
999
|
-
"test_native_wave_c_verification_integrity.py",
|
|
1000
|
-
)
|
|
1001
|
-
validator.WORKSPACE = tmp_path
|
|
1002
|
-
for name in ("wordcount.py", "test_wordcount.py"):
|
|
1003
|
-
source = TASKS_ROOT / "comet-native-wave-c-verification-integrity/environment" / name
|
|
1004
|
-
(tmp_path / name).write_bytes(source.read_bytes())
|
|
1005
|
-
evidence = tmp_path / ".cache/comet-native-eval"
|
|
1006
|
-
archive = tmp_path / "docs/comet/archive/2026-07-17-add-longest-word"
|
|
1007
|
-
archive.mkdir(parents=True)
|
|
1008
|
-
state = {
|
|
1009
|
-
"name": "add-longest-word",
|
|
1010
|
-
"phase": "archive",
|
|
43
|
+
"verification_report": "verification.md",
|
|
1011
44
|
"archived": True,
|
|
1012
|
-
"
|
|
45
|
+
"history": [{"outcome": "pass", "iteration": 1, "attempt": 1}],
|
|
1013
46
|
}
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
tmp_path,
|
|
1017
|
-
archive,
|
|
1018
|
-
state,
|
|
1019
|
-
contract,
|
|
1020
|
-
result="pass",
|
|
1021
|
-
source_revision=5,
|
|
1022
|
-
created_at="2026-07-17T00:00:05.000Z",
|
|
1023
|
-
partial=True,
|
|
1024
|
-
)
|
|
1025
|
-
partial_envelope = json.loads((archive / partial_ref).read_text(encoding="utf-8"))
|
|
1026
|
-
partial_hash = partial_envelope["implementationScopeHash"]
|
|
1027
|
-
final_ref = write_verification_bundle(
|
|
1028
|
-
tmp_path,
|
|
1029
|
-
archive,
|
|
1030
|
-
state,
|
|
1031
|
-
contract,
|
|
1032
|
-
result="pass",
|
|
1033
|
-
source_revision=9,
|
|
1034
|
-
created_at="2026-07-17T00:00:09.000Z",
|
|
1035
|
-
include_receipt=True,
|
|
1036
|
-
)
|
|
1037
|
-
state["verification_evidence"] = final_ref
|
|
1038
|
-
(archive / "comet-state.yaml").write_text(yaml.safe_dump(state), encoding="utf-8")
|
|
1039
|
-
stale_hash = "b" * 64
|
|
1040
|
-
final_hash = "c" * 64
|
|
1041
|
-
transaction_id = "cccccccc-1111-2222-3333-dddddddddddd"
|
|
1042
|
-
write_json(
|
|
1043
|
-
evidence / "partial-scope.json",
|
|
1044
|
-
{
|
|
1045
|
-
"command": "next",
|
|
1046
|
-
"exitCode": 65,
|
|
1047
|
-
"data": {
|
|
1048
|
-
"next": "manual",
|
|
1049
|
-
"preparedScope": {
|
|
1050
|
-
"complete": False,
|
|
1051
|
-
"unresolvedScopeCount": 1,
|
|
1052
|
-
"scopeHash": partial_hash,
|
|
1053
|
-
},
|
|
1054
|
-
"findings": [{"code": "verification-scope-partial"}],
|
|
1055
|
-
},
|
|
1056
|
-
},
|
|
1057
|
-
)
|
|
1058
|
-
write_json(
|
|
1059
|
-
evidence / "partial-archive-preview.json",
|
|
1060
|
-
{
|
|
1061
|
-
"command": "archive --dry-run",
|
|
1062
|
-
"exitCode": 0,
|
|
1063
|
-
"data": {
|
|
1064
|
-
"ready": True,
|
|
1065
|
-
"evidenceFreshness": "partial",
|
|
1066
|
-
"findingCodes": [],
|
|
1067
|
-
"preflightHash": partial_hash,
|
|
1068
|
-
},
|
|
1069
|
-
},
|
|
1070
|
-
)
|
|
1071
|
-
write_json(
|
|
1072
|
-
evidence / "stale-status.json",
|
|
1073
|
-
{
|
|
1074
|
-
"command": "status",
|
|
1075
|
-
"exitCode": 0,
|
|
1076
|
-
"data": {
|
|
1077
|
-
"phase": "archive",
|
|
1078
|
-
"archiveReady": False,
|
|
1079
|
-
"findingSummary": {"codes": ["verification-evidence-stale"]},
|
|
1080
|
-
},
|
|
1081
|
-
},
|
|
1082
|
-
)
|
|
1083
|
-
stale_preview = {
|
|
1084
|
-
"ready": False,
|
|
1085
|
-
"evidenceFreshness": "stale",
|
|
1086
|
-
"findingCodes": ["verification-evidence-stale"],
|
|
1087
|
-
"preflightHash": stale_hash,
|
|
1088
|
-
}
|
|
1089
|
-
write_json(
|
|
1090
|
-
evidence / "stale-archive-preview.json",
|
|
1091
|
-
{"command": "archive --dry-run", "exitCode": 0, "data": stale_preview},
|
|
1092
|
-
)
|
|
1093
|
-
write_json(
|
|
1094
|
-
evidence / "stale-archive-commit.json",
|
|
1095
|
-
{
|
|
1096
|
-
"command": "archive",
|
|
1097
|
-
"exitCode": 73,
|
|
1098
|
-
"data": stale_preview,
|
|
1099
|
-
"error": {"code": "conflict", "message": "Archive preflight changed"},
|
|
1100
|
-
},
|
|
1101
|
-
)
|
|
1102
|
-
final_preview = {
|
|
1103
|
-
"ready": True,
|
|
1104
|
-
"evidenceFreshness": "complete",
|
|
1105
|
-
"findingCodes": [],
|
|
1106
|
-
"preflightHash": final_hash,
|
|
1107
|
-
}
|
|
1108
|
-
write_json(
|
|
1109
|
-
evidence / "final-archive-preview.json",
|
|
1110
|
-
{"command": "archive --dry-run", "exitCode": 0, "data": final_preview},
|
|
1111
|
-
)
|
|
1112
|
-
write_json(
|
|
1113
|
-
evidence / "archive-commit.json",
|
|
1114
|
-
{
|
|
1115
|
-
"command": "archive",
|
|
1116
|
-
"exitCode": 0,
|
|
1117
|
-
"data": {
|
|
1118
|
-
"preflightHash": final_hash,
|
|
1119
|
-
"transactionId": transaction_id,
|
|
1120
|
-
},
|
|
1121
|
-
},
|
|
1122
|
-
)
|
|
1123
|
-
write_archive_transaction(tmp_path, transaction_id, "add-longest-word", final_hash)
|
|
1124
|
-
(archive / "runtime/trajectory.jsonl").write_text(
|
|
1125
|
-
"\n".join(
|
|
1126
|
-
json.dumps(
|
|
1127
|
-
{
|
|
1128
|
-
"sequence": index,
|
|
1129
|
-
"timestamp": "2026-07-17T00:00:00.000Z",
|
|
1130
|
-
"runId": "verification-run",
|
|
1131
|
-
"type": "state_transitioned",
|
|
1132
|
-
"data": {
|
|
1133
|
-
"previousPhase": previous,
|
|
1134
|
-
"nextPhase": next_phase,
|
|
1135
|
-
},
|
|
1136
|
-
}
|
|
1137
|
-
)
|
|
1138
|
-
for index, (previous, next_phase) in enumerate(
|
|
1139
|
-
[
|
|
1140
|
-
("shape", "build"),
|
|
1141
|
-
("build", "verify"),
|
|
1142
|
-
("verify", "archive"),
|
|
1143
|
-
("archive", "build"),
|
|
1144
|
-
("build", "verify"),
|
|
1145
|
-
("verify", "archive"),
|
|
1146
|
-
("archive", None),
|
|
1147
|
-
],
|
|
1148
|
-
1,
|
|
1149
|
-
)
|
|
1150
|
-
)
|
|
1151
|
-
+ "\n",
|
|
1152
|
-
encoding="utf-8",
|
|
1153
|
-
)
|
|
1154
|
-
(tmp_path / "docs/comet/changes").mkdir(parents=True)
|
|
47
|
+
state.update(overrides)
|
|
48
|
+
return state
|
|
1155
49
|
|
|
1156
|
-
result = validator.check_verification_integrity()
|
|
1157
|
-
assert result["status"] == "passed", result
|
|
1158
50
|
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
result = validator.check_verification_integrity()
|
|
1164
|
-
assert result["status"] == "failed", result
|
|
1165
|
-
assert "count" in result["reason"].lower()
|
|
51
|
+
def test_terminal_v4_state_requires_all_acceptance_items():
|
|
52
|
+
assert validate_terminal_state(_state()) == []
|
|
53
|
+
errors = validate_terminal_state(_state(acceptance=[{"id": "A1", "result": "pending"}]))
|
|
54
|
+
assert "acceptance is incomplete" in errors
|
|
1166
55
|
|
|
1167
56
|
|
|
1168
|
-
def
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
state,
|
|
1180
|
-
contract,
|
|
1181
|
-
result="pass",
|
|
1182
|
-
source_revision=3,
|
|
1183
|
-
created_at="2026-07-17T00:00:03.000Z",
|
|
1184
|
-
)
|
|
1185
|
-
parse_verification_bundle(
|
|
1186
|
-
project_root=tmp_path,
|
|
1187
|
-
change_root=root,
|
|
1188
|
-
evidence_ref=ref,
|
|
1189
|
-
state=state,
|
|
1190
|
-
verify_current_files=True,
|
|
1191
|
-
)
|
|
1192
|
-
|
|
1193
|
-
envelope = json.loads((root / ref).read_text(encoding="utf-8"))
|
|
1194
|
-
envelope["acceptanceTrace"]["entries"][0]["acceptanceId"] = f"acceptance-{'0' * 64}"
|
|
1195
|
-
trace_content = {
|
|
1196
|
-
key: value for key, value in envelope["acceptanceTrace"].items() if key != "traceHash"
|
|
1197
|
-
}
|
|
1198
|
-
envelope["acceptanceTrace"]["traceHash"] = canonical_hash(
|
|
1199
|
-
"comet.native.acceptance-trace.v1", trace_content
|
|
1200
|
-
)
|
|
1201
|
-
content = {key: value for key, value in envelope.items() if key != "envelopeHash"}
|
|
1202
|
-
forged_hash = canonical_hash("comet.native.verification-evidence.v1", content)
|
|
1203
|
-
envelope["envelopeHash"] = forged_hash
|
|
1204
|
-
forged_ref = f"runtime/evidence/verifications/{forged_hash}.json"
|
|
1205
|
-
write_json(root / forged_ref, envelope)
|
|
1206
|
-
with pytest.raises(ValueError, match="contract|forged"):
|
|
1207
|
-
parse_verification_bundle(
|
|
1208
|
-
project_root=tmp_path,
|
|
1209
|
-
change_root=root,
|
|
1210
|
-
evidence_ref=forged_ref,
|
|
1211
|
-
state=state,
|
|
57
|
+
def test_active_v4_state_does_not_require_a_failed_loop():
|
|
58
|
+
errors = validate_active_state(
|
|
59
|
+
_state(
|
|
60
|
+
phase="build",
|
|
61
|
+
status="active",
|
|
62
|
+
archived=False,
|
|
63
|
+
loop={"stage": "build", "iteration": 0, "attempt": 0},
|
|
64
|
+
verification=None,
|
|
65
|
+
verification_result="pending",
|
|
66
|
+
verification_report=None,
|
|
67
|
+
history=[],
|
|
1212
68
|
)
|
|
1213
|
-
|
|
1214
|
-
original = json.loads((root / ref).read_text(encoding="utf-8"))
|
|
1215
|
-
(root / original["reportRef"]).write_text("tampered report\n", encoding="utf-8")
|
|
1216
|
-
with pytest.raises(ValueError, match="report content hash"):
|
|
1217
|
-
parse_verification_bundle(
|
|
1218
|
-
project_root=tmp_path,
|
|
1219
|
-
change_root=root,
|
|
1220
|
-
evidence_ref=ref,
|
|
1221
|
-
state=state,
|
|
1222
|
-
verify_current_files=True,
|
|
1223
|
-
)
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
def test_scope_parser_rejects_runtime_impossible_self_consistent_unresolved_scope(
|
|
1227
|
-
tmp_path: Path,
|
|
1228
|
-
):
|
|
1229
|
-
for name in ("wordcount.py", "test_wordcount.py"):
|
|
1230
|
-
source = TASKS_ROOT / "comet-native-wave-c-verification-integrity/environment" / name
|
|
1231
|
-
(tmp_path / name).write_bytes(source.read_bytes())
|
|
1232
|
-
root = tmp_path / "docs/comet/changes/forged-scope"
|
|
1233
|
-
root.mkdir(parents=True)
|
|
1234
|
-
scope_ref, _ = write_scope(tmp_path, root, "1" * 64, partial=True)
|
|
1235
|
-
parse_scope_bundle(root, scope_ref)
|
|
1236
|
-
|
|
1237
|
-
scope = json.loads((root / scope_ref).read_text(encoding="utf-8"))
|
|
1238
|
-
forged_identity = {
|
|
1239
|
-
"kind": "snapshot-omission",
|
|
1240
|
-
"source": "baseline",
|
|
1241
|
-
"path": "unrelated.txt",
|
|
1242
|
-
"evidence": {"reason": "unreadable", "size": 1, "type": "file"},
|
|
1243
|
-
}
|
|
1244
|
-
scope["unresolvedScopes"] = [
|
|
1245
|
-
{
|
|
1246
|
-
"id": (
|
|
1247
|
-
"scope:" + canonical_hash("comet.native.unresolved-scope-id.v1", forged_identity)
|
|
1248
|
-
),
|
|
1249
|
-
"kind": forged_identity["kind"],
|
|
1250
|
-
"source": forged_identity["source"],
|
|
1251
|
-
"path": forged_identity["path"],
|
|
1252
|
-
"reason": "baseline snapshot omitted unrelated.txt: unreadable",
|
|
1253
|
-
}
|
|
1254
|
-
]
|
|
1255
|
-
content = {key: value for key, value in scope.items() if key != "scopeHash"}
|
|
1256
|
-
scope_hash = canonical_hash("comet.native.implementation-scope.v2", content)
|
|
1257
|
-
scope["scopeHash"] = scope_hash
|
|
1258
|
-
forged_ref = f"runtime/evidence/scopes/{scope_hash}.json"
|
|
1259
|
-
write_json(root / forged_ref, scope)
|
|
1260
|
-
|
|
1261
|
-
with pytest.raises(ValueError, match="unresolved|scope"):
|
|
1262
|
-
parse_scope_bundle(root, forged_ref)
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
def test_scope_parser_derives_omission_scopes_from_snapshot_facts(tmp_path: Path):
|
|
1266
|
-
for name in ("wordcount.py", "test_wordcount.py"):
|
|
1267
|
-
source = TASKS_ROOT / "comet-native-wave-c-verification-integrity/environment" / name
|
|
1268
|
-
(tmp_path / name).write_bytes(source.read_bytes())
|
|
1269
|
-
root = tmp_path / "docs/comet/changes/omitted-scope"
|
|
1270
|
-
root.mkdir(parents=True)
|
|
1271
|
-
scope_ref, _ = write_scope(tmp_path, root, "2" * 64, partial=True)
|
|
1272
|
-
|
|
1273
|
-
scope = json.loads((root / scope_ref).read_text(encoding="utf-8"))
|
|
1274
|
-
baseline_ref = scope["baselineProjectionRef"]
|
|
1275
|
-
baseline = json.loads((root / baseline_ref).read_text(encoding="utf-8"))
|
|
1276
|
-
baseline.update(
|
|
1277
|
-
{
|
|
1278
|
-
"complete": False,
|
|
1279
|
-
"omitted": [
|
|
1280
|
-
{
|
|
1281
|
-
"path": "too-large.bin",
|
|
1282
|
-
"size": 10,
|
|
1283
|
-
"type": "file",
|
|
1284
|
-
"reason": "file-size",
|
|
1285
|
-
}
|
|
1286
|
-
],
|
|
1287
|
-
"omittedCount": 1,
|
|
1288
|
-
}
|
|
1289
|
-
)
|
|
1290
|
-
baseline_hash = canonical_hash("comet.native.content-snapshot-projection.v1", baseline)
|
|
1291
|
-
baseline_ref = f"runtime/evidence/snapshots/{baseline_hash}.json"
|
|
1292
|
-
write_json(root / baseline_ref, baseline)
|
|
1293
|
-
scope["baselineProjectionHash"] = baseline_hash
|
|
1294
|
-
scope["baselineProjectionRef"] = baseline_ref
|
|
1295
|
-
omission_identity = {
|
|
1296
|
-
"kind": "snapshot-omission",
|
|
1297
|
-
"source": "baseline",
|
|
1298
|
-
"path": "too-large.bin",
|
|
1299
|
-
"evidence": {"reason": "file-size", "size": 10, "type": "file"},
|
|
1300
|
-
}
|
|
1301
|
-
incomplete_identity = {
|
|
1302
|
-
"kind": "snapshot-incomplete",
|
|
1303
|
-
"source": "baseline",
|
|
1304
|
-
"path": None,
|
|
1305
|
-
"evidence": {"omittedCount": 1},
|
|
1306
|
-
}
|
|
1307
|
-
derived = [
|
|
1308
|
-
{
|
|
1309
|
-
"id": (
|
|
1310
|
-
"scope:" + canonical_hash("comet.native.unresolved-scope-id.v1", omission_identity)
|
|
1311
|
-
),
|
|
1312
|
-
"kind": "snapshot-omission",
|
|
1313
|
-
"source": "baseline",
|
|
1314
|
-
"path": "too-large.bin",
|
|
1315
|
-
"reason": "baseline snapshot omitted too-large.bin: file-size",
|
|
1316
|
-
},
|
|
1317
|
-
{
|
|
1318
|
-
"id": (
|
|
1319
|
-
"scope:"
|
|
1320
|
-
+ canonical_hash("comet.native.unresolved-scope-id.v1", incomplete_identity)
|
|
1321
|
-
),
|
|
1322
|
-
"kind": "snapshot-incomplete",
|
|
1323
|
-
"source": "baseline",
|
|
1324
|
-
"path": None,
|
|
1325
|
-
"reason": "baseline snapshot is incomplete",
|
|
1326
|
-
},
|
|
1327
|
-
]
|
|
1328
|
-
original_unresolved = scope["unresolvedScopes"]
|
|
1329
|
-
scope["unresolvedScopes"] = sorted(
|
|
1330
|
-
[*original_unresolved, *derived],
|
|
1331
|
-
key=lambda item: (
|
|
1332
|
-
item["kind"],
|
|
1333
|
-
item["source"],
|
|
1334
|
-
(0, "") if item["path"] is None else (1, item["path"]),
|
|
1335
|
-
item["id"],
|
|
1336
|
-
),
|
|
1337
|
-
)
|
|
1338
|
-
content = {key: value for key, value in scope.items() if key != "scopeHash"}
|
|
1339
|
-
scope_hash = canonical_hash("comet.native.implementation-scope.v2", content)
|
|
1340
|
-
scope["scopeHash"] = scope_hash
|
|
1341
|
-
valid_ref = f"runtime/evidence/scopes/{scope_hash}.json"
|
|
1342
|
-
write_json(root / valid_ref, scope)
|
|
1343
|
-
parse_scope_bundle(root, valid_ref)
|
|
1344
|
-
|
|
1345
|
-
scope["unresolvedScopes"] = original_unresolved
|
|
1346
|
-
content = {key: value for key, value in scope.items() if key != "scopeHash"}
|
|
1347
|
-
scope_hash = canonical_hash("comet.native.implementation-scope.v2", content)
|
|
1348
|
-
scope["scopeHash"] = scope_hash
|
|
1349
|
-
forged_ref = f"runtime/evidence/scopes/{scope_hash}.json"
|
|
1350
|
-
write_json(root / forged_ref, scope)
|
|
1351
|
-
|
|
1352
|
-
with pytest.raises(ValueError, match="omission|unresolved|scope"):
|
|
1353
|
-
parse_scope_bundle(root, forged_ref)
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
@pytest.mark.parametrize(
|
|
1357
|
-
"forgery",
|
|
1358
|
-
[
|
|
1359
|
-
"change",
|
|
1360
|
-
"revision",
|
|
1361
|
-
"checker",
|
|
1362
|
-
"contract",
|
|
1363
|
-
"implementation",
|
|
1364
|
-
"coverage",
|
|
1365
|
-
"issue-counts",
|
|
1366
|
-
"issue-order",
|
|
1367
|
-
],
|
|
1368
|
-
)
|
|
1369
|
-
def test_verification_parser_rejects_self_consistent_forged_check_receipts(
|
|
1370
|
-
tmp_path: Path,
|
|
1371
|
-
forgery: str,
|
|
1372
|
-
):
|
|
1373
|
-
for name in ("wordcount.py", "test_wordcount.py"):
|
|
1374
|
-
source = TASKS_ROOT / "comet-native-wave-c-verification-integrity/environment" / name
|
|
1375
|
-
(tmp_path / name).write_bytes(source.read_bytes())
|
|
1376
|
-
root = tmp_path / "docs/comet/changes/receipt-bound"
|
|
1377
|
-
root.mkdir(parents=True)
|
|
1378
|
-
state = {"name": "receipt-bound", "phase": "archive", "verification_result": "pass"}
|
|
1379
|
-
contract = write_contract_artifacts(root, state, "receipt-bound")
|
|
1380
|
-
ref = write_verification_bundle(
|
|
1381
|
-
tmp_path,
|
|
1382
|
-
root,
|
|
1383
|
-
state,
|
|
1384
|
-
contract,
|
|
1385
|
-
result="pass",
|
|
1386
|
-
source_revision=3,
|
|
1387
|
-
created_at="2026-07-17T00:00:03.000Z",
|
|
1388
|
-
include_receipt=True,
|
|
1389
|
-
)
|
|
1390
|
-
parse_verification_bundle(
|
|
1391
|
-
project_root=tmp_path,
|
|
1392
|
-
change_root=root,
|
|
1393
|
-
evidence_ref=ref,
|
|
1394
|
-
state=state,
|
|
1395
|
-
verify_current_files=True,
|
|
1396
|
-
)
|
|
1397
|
-
|
|
1398
|
-
envelope = json.loads((root / ref).read_text(encoding="utf-8"))
|
|
1399
|
-
receipt = json.loads((root / envelope["receiptRef"]).read_text(encoding="utf-8"))
|
|
1400
|
-
if forgery == "change":
|
|
1401
|
-
receipt["change"] = "other-change"
|
|
1402
|
-
elif forgery == "revision":
|
|
1403
|
-
receipt["sourceRevision"] += 1
|
|
1404
|
-
elif forgery == "checker":
|
|
1405
|
-
receipt["checker"] = {
|
|
1406
|
-
"policy": "forged-policy",
|
|
1407
|
-
"version": 2,
|
|
1408
|
-
"hash": "f" * 64,
|
|
1409
|
-
"limits": CHECK_LIMITS,
|
|
1410
|
-
}
|
|
1411
|
-
elif forgery == "contract":
|
|
1412
|
-
receipt["contract"] = {
|
|
1413
|
-
"expectedHash": "a" * 64,
|
|
1414
|
-
"beforeHash": "a" * 64,
|
|
1415
|
-
"afterHash": "a" * 64,
|
|
1416
|
-
}
|
|
1417
|
-
elif forgery == "implementation":
|
|
1418
|
-
receipt["implementation"] = {
|
|
1419
|
-
"scopeHash": "b" * 64,
|
|
1420
|
-
"expectedSnapshotHash": "c" * 64,
|
|
1421
|
-
"beforeSnapshotHash": "c" * 64,
|
|
1422
|
-
"afterSnapshotHash": "c" * 64,
|
|
1423
|
-
}
|
|
1424
|
-
elif forgery == "coverage":
|
|
1425
|
-
receipt["counts"].update({"filesSelected": 1, "filesScanned": 1})
|
|
1426
|
-
elif forgery == "issue-counts":
|
|
1427
|
-
receipt["status"] = "failed"
|
|
1428
|
-
receipt["counts"].update({"issueCount": 1, "recordedIssueCount": 1})
|
|
1429
|
-
receipt["issuesTruncated"] = True
|
|
1430
|
-
elif forgery == "issue-order":
|
|
1431
|
-
receipt["status"] = "failed"
|
|
1432
|
-
receipt["counts"].update({"issueCount": 2, "recordedIssueCount": 2})
|
|
1433
|
-
receipt["issues"] = [
|
|
1434
|
-
{"path": "z.py", "line": 2, "kind": "trailing-whitespace"},
|
|
1435
|
-
{"path": "a.py", "line": 1, "kind": "conflict-marker"},
|
|
1436
|
-
]
|
|
1437
|
-
|
|
1438
|
-
receipt["inputHash"] = canonical_hash(
|
|
1439
|
-
"comet.native.check-input.v1",
|
|
1440
|
-
{
|
|
1441
|
-
"change": receipt["change"],
|
|
1442
|
-
"sourceRevision": receipt["sourceRevision"],
|
|
1443
|
-
"checkerHash": receipt["checker"]["hash"],
|
|
1444
|
-
"contractHash": receipt["contract"]["expectedHash"],
|
|
1445
|
-
"scopeHash": receipt["implementation"]["scopeHash"],
|
|
1446
|
-
"snapshotHash": receipt["implementation"]["expectedSnapshotHash"],
|
|
1447
|
-
},
|
|
1448
69
|
)
|
|
1449
|
-
|
|
1450
|
-
receipt_hash = canonical_hash("comet.native.check-receipt.v1", receipt_content)
|
|
1451
|
-
receipt["receiptHash"] = receipt_hash
|
|
1452
|
-
receipt_ref = f"runtime/evidence/check-receipts/{receipt_hash}.json"
|
|
1453
|
-
write_json(root / receipt_ref, receipt)
|
|
1454
|
-
envelope["receiptRef"] = receipt_ref
|
|
1455
|
-
envelope_content = {key: value for key, value in envelope.items() if key != "envelopeHash"}
|
|
1456
|
-
envelope_hash = canonical_hash("comet.native.verification-evidence.v1", envelope_content)
|
|
1457
|
-
envelope["envelopeHash"] = envelope_hash
|
|
1458
|
-
forged_ref = f"runtime/evidence/verifications/{envelope_hash}.json"
|
|
1459
|
-
write_json(root / forged_ref, envelope)
|
|
70
|
+
assert errors == []
|
|
1460
71
|
|
|
1461
|
-
with pytest.raises(ValueError, match="receipt|checker|coverage|issue"):
|
|
1462
|
-
parse_verification_bundle(
|
|
1463
|
-
project_root=tmp_path,
|
|
1464
|
-
change_root=root,
|
|
1465
|
-
evidence_ref=forged_ref,
|
|
1466
|
-
state=state,
|
|
1467
|
-
verify_current_files=True,
|
|
1468
|
-
)
|
|
1469
72
|
|
|
73
|
+
def test_native_isolation_allows_runtime_owned_comet_files(tmp_path: Path):
|
|
74
|
+
(tmp_path / ".comet" / "runtime" / "native").mkdir(parents=True)
|
|
75
|
+
(tmp_path / ".comet" / "config.yaml").write_text("schema: comet.project.v1\n", encoding="utf-8")
|
|
76
|
+
(tmp_path / ".comet" / "current-change.json").write_text("{}", encoding="utf-8")
|
|
77
|
+
assert check_native_isolation(tmp_path)["status"] == "passed"
|
|
1470
78
|
|
|
1471
|
-
def test_verification_parser_rejects_receipt_content_hash_corruption(tmp_path: Path):
|
|
1472
|
-
for name in ("wordcount.py", "test_wordcount.py"):
|
|
1473
|
-
source = TASKS_ROOT / "comet-native-wave-c-verification-integrity/environment" / name
|
|
1474
|
-
(tmp_path / name).write_bytes(source.read_bytes())
|
|
1475
|
-
root = tmp_path / "docs/comet/changes/receipt-hash"
|
|
1476
|
-
root.mkdir(parents=True)
|
|
1477
|
-
state = {"name": "receipt-hash", "phase": "archive", "verification_result": "pass"}
|
|
1478
|
-
contract = write_contract_artifacts(root, state, "receipt-hash")
|
|
1479
|
-
ref = write_verification_bundle(
|
|
1480
|
-
tmp_path,
|
|
1481
|
-
root,
|
|
1482
|
-
state,
|
|
1483
|
-
contract,
|
|
1484
|
-
result="pass",
|
|
1485
|
-
source_revision=4,
|
|
1486
|
-
created_at="2026-07-17T00:00:04.000Z",
|
|
1487
|
-
include_receipt=True,
|
|
1488
|
-
)
|
|
1489
|
-
envelope = json.loads((root / ref).read_text(encoding="utf-8"))
|
|
1490
|
-
receipt_path = root / envelope["receiptRef"]
|
|
1491
|
-
receipt = json.loads(receipt_path.read_text(encoding="utf-8"))
|
|
1492
|
-
receipt["endedAt"] = "2026-07-17T00:00:02.000Z"
|
|
1493
|
-
write_json(receipt_path, receipt)
|
|
1494
|
-
|
|
1495
|
-
with pytest.raises(ValueError, match="receipt|content hash"):
|
|
1496
|
-
parse_verification_bundle(
|
|
1497
|
-
project_root=tmp_path,
|
|
1498
|
-
change_root=root,
|
|
1499
|
-
evidence_ref=ref,
|
|
1500
|
-
state=state,
|
|
1501
|
-
verify_current_files=True,
|
|
1502
|
-
)
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
def test_archive_transaction_rejects_reordered_durable_events(tmp_path: Path):
|
|
1506
|
-
archive = tmp_path / "docs/comet/archive/2026-07-17-transaction-check"
|
|
1507
|
-
archive.mkdir(parents=True)
|
|
1508
|
-
transaction_id = "dddddddd-1111-2222-3333-eeeeeeeeeeee"
|
|
1509
|
-
preflight = "f" * 64
|
|
1510
|
-
write_archive_transaction(tmp_path, transaction_id, "transaction-check", preflight)
|
|
1511
|
-
commit = {"transactionId": transaction_id, "preflightHash": preflight}
|
|
1512
|
-
assert (
|
|
1513
|
-
check_archive_transaction(tmp_path, commit, "transaction-check", preflight)["status"]
|
|
1514
|
-
== "passed"
|
|
1515
|
-
)
|
|
1516
|
-
events = tmp_path / f"docs/comet/runtime/transactions/{transaction_id}/events.jsonl"
|
|
1517
|
-
lines = events.read_text(encoding="utf-8").splitlines()
|
|
1518
|
-
lines[1], lines[2] = lines[2], lines[1]
|
|
1519
|
-
events.write_text("\n".join(lines) + "\n", encoding="utf-8")
|
|
1520
|
-
assert (
|
|
1521
|
-
check_archive_transaction(tmp_path, commit, "transaction-check", preflight)["status"]
|
|
1522
|
-
== "failed"
|
|
1523
|
-
)
|
|
1524
79
|
|
|
80
|
+
def test_native_isolation_rejects_change_local_runtime(tmp_path: Path):
|
|
81
|
+
legacy = tmp_path / "docs" / "comet" / "changes" / "demo" / "runtime"
|
|
82
|
+
legacy.mkdir(parents=True)
|
|
83
|
+
assert check_native_isolation(tmp_path)["status"] == "failed"
|
|
1525
84
|
|
|
1526
|
-
def test_verification_parser_rejects_symlinked_evidence_documents(tmp_path: Path):
|
|
1527
|
-
for name in ("wordcount.py", "test_wordcount.py"):
|
|
1528
|
-
source = TASKS_ROOT / "comet-native-wave-c-verification-integrity/environment" / name
|
|
1529
|
-
(tmp_path / name).write_bytes(source.read_bytes())
|
|
1530
|
-
root = tmp_path / "docs/comet/changes/symlink-evidence"
|
|
1531
|
-
root.mkdir(parents=True)
|
|
1532
|
-
state = {"name": "symlink-evidence", "phase": "archive", "verification_result": "pass"}
|
|
1533
|
-
contract = write_contract_artifacts(root, state, "symlink-evidence")
|
|
1534
|
-
ref = write_verification_bundle(
|
|
1535
|
-
tmp_path,
|
|
1536
|
-
root,
|
|
1537
|
-
state,
|
|
1538
|
-
contract,
|
|
1539
|
-
result="pass",
|
|
1540
|
-
source_revision=3,
|
|
1541
|
-
created_at="2026-07-17T00:00:03.000Z",
|
|
1542
|
-
)
|
|
1543
|
-
envelope = json.loads((root / ref).read_text(encoding="utf-8"))
|
|
1544
|
-
report = root / envelope["reportRef"]
|
|
1545
|
-
outside = tmp_path / "outside-report.md"
|
|
1546
|
-
outside.write_bytes(report.read_bytes())
|
|
1547
|
-
report.unlink()
|
|
1548
|
-
try:
|
|
1549
|
-
report.symlink_to(outside)
|
|
1550
|
-
except OSError as error:
|
|
1551
|
-
pytest.skip(f"Symbolic links are unavailable: {error}")
|
|
1552
85
|
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
project_root=tmp_path,
|
|
1556
|
-
change_root=root,
|
|
1557
|
-
evidence_ref=ref,
|
|
1558
|
-
state=state,
|
|
1559
|
-
verify_current_files=True,
|
|
1560
|
-
)
|
|
86
|
+
def test_dashboard_v2_projection_rejects_old_schema():
|
|
87
|
+
assert check_dashboard_projection({"schema": "comet.dashboard.native.v1"})["status"] == "failed"
|
|
1561
88
|
|
|
1562
89
|
|
|
1563
|
-
def
|
|
1564
|
-
|
|
1565
|
-
"
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
(root / "runtime/evidence/verifications").mkdir(parents=True)
|
|
1570
|
-
(root / "specs/average-word-length").mkdir(parents=True)
|
|
1571
|
-
(tmp_path / "docs/comet/archive").mkdir(parents=True)
|
|
1572
|
-
for name in ("wordcount.py", "test_wordcount.py"):
|
|
1573
|
-
source = TASKS_ROOT / "comet-native-wave-d-stagnation-stop/environment" / name
|
|
1574
|
-
(tmp_path / name).write_bytes(source.read_bytes().replace(b"\r\n", b"\n"))
|
|
1575
|
-
state = {
|
|
1576
|
-
"name": "stalled-average",
|
|
1577
|
-
"phase": "build",
|
|
1578
|
-
"verification_result": "fail",
|
|
1579
|
-
}
|
|
1580
|
-
contract = write_contract_artifacts(root, state, "average-word-length")
|
|
1581
|
-
envelope_refs = [
|
|
1582
|
-
write_verification_bundle(
|
|
1583
|
-
tmp_path,
|
|
1584
|
-
root,
|
|
1585
|
-
state,
|
|
1586
|
-
contract,
|
|
1587
|
-
result="fail",
|
|
1588
|
-
source_revision=index + 1,
|
|
1589
|
-
created_at=f"2026-07-17T00:00:{index:02}.000Z",
|
|
1590
|
-
)
|
|
1591
|
-
for index in range(1, 13)
|
|
1592
|
-
]
|
|
1593
|
-
state["verification_evidence"] = envelope_refs[-1]
|
|
1594
|
-
(root / "comet-state.yaml").write_text(yaml.safe_dump(state), encoding="utf-8")
|
|
1595
|
-
first_signature = "a" * 64
|
|
1596
|
-
later_signatures = ["b" * 64, "c" * 64]
|
|
1597
|
-
repair_events = [
|
|
1598
|
-
{
|
|
1599
|
-
"signatureHash": first_signature,
|
|
1600
|
-
"disposition": disposition,
|
|
1601
|
-
"overrideSummaryHash": None,
|
|
1602
|
-
}
|
|
1603
|
-
for disposition in ("continue", "warn", "manual-stop")
|
|
1604
|
-
]
|
|
1605
|
-
repair_events.append(
|
|
1606
|
-
{
|
|
1607
|
-
"signatureHash": first_signature,
|
|
1608
|
-
"disposition": "continue",
|
|
1609
|
-
"overrideSummaryHash": "d" * 64,
|
|
1610
|
-
}
|
|
1611
|
-
)
|
|
1612
|
-
for attempt in range(4, 13):
|
|
1613
|
-
signature = later_signatures[(attempt - 4) % 2]
|
|
1614
|
-
repair_events.append(
|
|
90
|
+
def test_dashboard_v2_projection_accepts_bounded_change():
|
|
91
|
+
projection = {
|
|
92
|
+
"schema": "comet.dashboard.native.v2",
|
|
93
|
+
"totalChangeCount": 1,
|
|
94
|
+
"visibleChangeCount": 1,
|
|
95
|
+
"changes": [
|
|
1615
96
|
{
|
|
1616
|
-
"
|
|
1617
|
-
"
|
|
1618
|
-
"
|
|
97
|
+
"name": "demo",
|
|
98
|
+
"stateVersion": 2,
|
|
99
|
+
"phase": "verify",
|
|
100
|
+
"loop": {"stage": "verify", "iteration": 1, "attempt": 1},
|
|
101
|
+
"acceptance": {"total": 1, "passed": 1, "failed": 0, "blocked": 0, "pending": 0},
|
|
1619
102
|
}
|
|
1620
|
-
|
|
1621
|
-
(root / "runtime/trajectory.jsonl").write_text(
|
|
1622
|
-
"\n".join(
|
|
1623
|
-
json.dumps(
|
|
1624
|
-
{
|
|
1625
|
-
"sequence": index,
|
|
1626
|
-
"timestamp": "2026-07-17T00:00:00.000Z",
|
|
1627
|
-
"runId": "repair-run",
|
|
1628
|
-
"type": "state_transitioned",
|
|
1629
|
-
"data": {
|
|
1630
|
-
"previousPhase": (
|
|
1631
|
-
"build" if projection["overrideSummaryHash"] is not None else "verify"
|
|
1632
|
-
),
|
|
1633
|
-
"nextPhase": (
|
|
1634
|
-
"verify" if projection["overrideSummaryHash"] is not None else "build"
|
|
1635
|
-
),
|
|
1636
|
-
"repairStagnation": projection,
|
|
1637
|
-
},
|
|
1638
|
-
}
|
|
1639
|
-
)
|
|
1640
|
-
for index, projection in enumerate(repair_events, 1)
|
|
1641
|
-
)
|
|
1642
|
-
+ "\n",
|
|
1643
|
-
encoding="utf-8",
|
|
1644
|
-
)
|
|
1645
|
-
manual_repair = {
|
|
1646
|
-
"disposition": "manual-stop",
|
|
1647
|
-
"reasonCode": "repeated-failure-stop",
|
|
1648
|
-
"signatureHash": first_signature,
|
|
1649
|
-
"consecutiveFailures": 3,
|
|
1650
|
-
"totalRepairFailures": 3,
|
|
1651
|
-
"remainingIterations": 9,
|
|
1652
|
-
"overrideAccepted": False,
|
|
1653
|
-
}
|
|
1654
|
-
write_json(
|
|
1655
|
-
tmp_path / ".cache/comet-native-eval/manual-stop.json",
|
|
1656
|
-
{
|
|
1657
|
-
"command": "next",
|
|
1658
|
-
"exitCode": 75,
|
|
1659
|
-
"data": {
|
|
1660
|
-
"repair": manual_repair,
|
|
1661
|
-
"findings": [{"code": "repair-stagnation-stop"}],
|
|
1662
|
-
},
|
|
1663
|
-
"error": {"code": "blocked", "message": "Repeated failure requires manual review"},
|
|
1664
|
-
},
|
|
1665
|
-
)
|
|
1666
|
-
write_json(
|
|
1667
|
-
tmp_path / ".cache/comet-native-eval/override.json",
|
|
1668
|
-
{
|
|
1669
|
-
"command": "next",
|
|
1670
|
-
"exitCode": 0,
|
|
1671
|
-
"data": {
|
|
1672
|
-
"previousPhase": "build",
|
|
1673
|
-
"change": {"phase": "verify", "verification_result": "pending"},
|
|
1674
|
-
},
|
|
1675
|
-
},
|
|
1676
|
-
)
|
|
1677
|
-
hard_repair = {
|
|
1678
|
-
"disposition": "hard-stop",
|
|
1679
|
-
"reasonCode": "repair-iteration-limit",
|
|
1680
|
-
"signatureHash": later_signatures[0],
|
|
1681
|
-
"consecutiveFailures": 1,
|
|
1682
|
-
"totalRepairFailures": 12,
|
|
1683
|
-
"remainingIterations": 0,
|
|
1684
|
-
"overrideAccepted": False,
|
|
1685
|
-
}
|
|
1686
|
-
write_json(
|
|
1687
|
-
tmp_path / ".cache/comet-native-eval/hard-stop.json",
|
|
1688
|
-
{
|
|
1689
|
-
"command": "next",
|
|
1690
|
-
"exitCode": 75,
|
|
1691
|
-
"data": {
|
|
1692
|
-
"repair": hard_repair,
|
|
1693
|
-
"findings": [{"code": "repair-iteration-limit"}],
|
|
1694
|
-
},
|
|
1695
|
-
"error": {"code": "blocked", "message": "Repair iteration limit reached"},
|
|
1696
|
-
},
|
|
1697
|
-
)
|
|
1698
|
-
write_json(
|
|
1699
|
-
tmp_path / ".cache/comet-native-eval/hard-stop-status.json",
|
|
1700
|
-
{
|
|
1701
|
-
"command": "status",
|
|
1702
|
-
"exitCode": 0,
|
|
1703
|
-
"data": {
|
|
1704
|
-
"name": "stalled-average",
|
|
1705
|
-
"phase": "build",
|
|
1706
|
-
"verificationResult": "fail",
|
|
1707
|
-
"nextCommand": None,
|
|
1708
|
-
"repair": {
|
|
1709
|
-
"disposition": "hard-stop",
|
|
1710
|
-
"signatureHash": later_signatures[0],
|
|
1711
|
-
"overrideRecorded": False,
|
|
1712
|
-
},
|
|
1713
|
-
"findingSummary": {"codes": ["repair-iteration-limit"]},
|
|
1714
|
-
},
|
|
1715
|
-
},
|
|
1716
|
-
)
|
|
1717
|
-
|
|
1718
|
-
result = validator.check_stagnation_stop()
|
|
1719
|
-
assert result["status"] == "passed", result
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
def test_wave_e_validator_requires_early_conflict_workspace_and_single_cas_winner(tmp_path: Path):
|
|
1723
|
-
validator = load_validator(
|
|
1724
|
-
"comet-native-wave-e-parallel-safety", "test_native_wave_e_parallel_safety.py"
|
|
1725
|
-
)
|
|
1726
|
-
validator.WORKSPACE = tmp_path
|
|
1727
|
-
for name in ("normalize-case", "preserve-acronyms"):
|
|
1728
|
-
(tmp_path / "docs/comet/changes" / name).mkdir(parents=True)
|
|
1729
|
-
(tmp_path / "docs/comet/archive").mkdir(parents=True)
|
|
1730
|
-
write_json(
|
|
1731
|
-
tmp_path / ".cache/comet-native-eval/conflict-status.json",
|
|
1732
|
-
{
|
|
1733
|
-
"command": "status",
|
|
1734
|
-
"exitCode": 0,
|
|
1735
|
-
"data": {
|
|
1736
|
-
"name": "normalize-case",
|
|
1737
|
-
"phase": "shape",
|
|
1738
|
-
"revision": 1,
|
|
1739
|
-
"findingSummary": {
|
|
1740
|
-
"codes": ["native-change-conflict", "workspace-unattributed-changes"]
|
|
1741
|
-
},
|
|
1742
|
-
},
|
|
1743
|
-
},
|
|
1744
|
-
)
|
|
1745
|
-
write_json(
|
|
1746
|
-
tmp_path / ".cache/comet-native-eval/checkpoint-attempt-a.json",
|
|
1747
|
-
{
|
|
1748
|
-
"command": "checkpoint",
|
|
1749
|
-
"exitCode": 0,
|
|
1750
|
-
"data": {
|
|
1751
|
-
"change": {"name": "normalize-case", "revision": 2},
|
|
1752
|
-
"expectedRevision": 1,
|
|
1753
|
-
"previousRevision": 1,
|
|
1754
|
-
"revision": 2,
|
|
1755
|
-
"outcome": "recorded",
|
|
1756
|
-
},
|
|
1757
|
-
},
|
|
1758
|
-
)
|
|
1759
|
-
write_json(
|
|
1760
|
-
tmp_path / ".cache/comet-native-eval/checkpoint-attempt-b.json",
|
|
1761
|
-
{
|
|
1762
|
-
"command": "checkpoint",
|
|
1763
|
-
"exitCode": 73,
|
|
1764
|
-
"data": {
|
|
1765
|
-
"change": "normalize-case",
|
|
1766
|
-
"expectedRevision": 1,
|
|
1767
|
-
"actualRevision": 2,
|
|
1768
|
-
"outcome": "revision-conflict",
|
|
1769
|
-
},
|
|
1770
|
-
},
|
|
1771
|
-
)
|
|
1772
|
-
|
|
1773
|
-
assert validator.check_parallel_safety()["status"] == "passed"
|
|
1774
|
-
assert validator.check_live_concurrent_cas()["status"] == "failed"
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
def test_wave_e_barrier_launches_two_independent_cas_processes(tmp_path: Path):
|
|
1778
|
-
validator = load_validator(
|
|
1779
|
-
"comet-native-wave-e-parallel-safety", "test_native_wave_e_parallel_safety.py"
|
|
1780
|
-
)
|
|
1781
|
-
validator.WORKSPACE = tmp_path
|
|
1782
|
-
barrier_root = tmp_path / ".cache/comet-native-eval"
|
|
1783
|
-
barrier_root.mkdir(parents=True)
|
|
1784
|
-
lock = tmp_path / "cas.lock"
|
|
1785
|
-
script = r"""
|
|
1786
|
-
import json, os, pathlib, sys
|
|
1787
|
-
lock = pathlib.Path(sys.argv[1])
|
|
1788
|
-
try:
|
|
1789
|
-
descriptor = os.open(lock, os.O_CREAT | os.O_EXCL | os.O_WRONLY)
|
|
1790
|
-
os.write(descriptor, b"2")
|
|
1791
|
-
os.close(descriptor)
|
|
1792
|
-
code = 0
|
|
1793
|
-
data = {"change": {"name": "normalize-case", "revision": 2}, "expectedRevision": 1, "previousRevision": 1, "revision": 2, "outcome": "recorded", "pid": os.getpid()}
|
|
1794
|
-
except FileExistsError:
|
|
1795
|
-
code = 73
|
|
1796
|
-
data = {"change": "normalize-case", "expectedRevision": 1, "actualRevision": 2, "outcome": "revision-conflict", "pid": os.getpid()}
|
|
1797
|
-
payload = {"command": "checkpoint", "exitCode": code, "data": data}
|
|
1798
|
-
if code:
|
|
1799
|
-
payload["error"] = {"code": "conflict", "message": "revision conflict"}
|
|
1800
|
-
print(json.dumps(payload))
|
|
1801
|
-
raise SystemExit(code)
|
|
1802
|
-
"""
|
|
1803
|
-
commands = [[sys.executable, "-c", script, str(lock), label] for label in ("A", "B")]
|
|
1804
|
-
results = validator.run_barrier_commands(commands, barrier_root)
|
|
1805
|
-
assert all(result.stdout for result in results), [
|
|
1806
|
-
(result.returncode, result.stderr) for result in results
|
|
1807
|
-
]
|
|
1808
|
-
payloads = [json.loads(result.stdout) for result in results]
|
|
1809
|
-
|
|
1810
|
-
assert sorted(result.returncode for result in results) == [0, 73]
|
|
1811
|
-
assert len({payload["data"]["pid"] for payload in payloads}) == 2
|
|
1812
|
-
paths = []
|
|
1813
|
-
for index, payload in enumerate(payloads):
|
|
1814
|
-
path = tmp_path / f"attempt-{index}.json"
|
|
1815
|
-
write_json(path, payload)
|
|
1816
|
-
paths.append(path)
|
|
1817
|
-
assert check_checkpoint_cas_envelopes(paths)["status"] == "passed"
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
def test_wave_e_live_cas_never_executes_agent_mutable_runtime(tmp_path: Path):
|
|
1821
|
-
validator = load_validator(
|
|
1822
|
-
"comet-native-wave-e-parallel-safety", "test_native_wave_e_parallel_safety.py"
|
|
1823
|
-
)
|
|
1824
|
-
validator.WORKSPACE = tmp_path
|
|
1825
|
-
state_file = tmp_path / "docs/comet/changes/normalize-case/comet-state.yaml"
|
|
1826
|
-
state_file.parent.mkdir(parents=True)
|
|
1827
|
-
state_file.write_text("name: normalize-case\nrevision: 1\n", encoding="utf-8")
|
|
1828
|
-
(tmp_path / ".cache/comet-native-eval").mkdir(parents=True)
|
|
1829
|
-
|
|
1830
|
-
trusted_marker = tmp_path / "trusted-runtime-ran"
|
|
1831
|
-
trusted_root = tmp_path / "_eval_trusted_oracles"
|
|
1832
|
-
trusted_root.mkdir()
|
|
1833
|
-
trusted_runtime = trusted_root / "comet-native-runtime.mjs"
|
|
1834
|
-
trusted_runtime.write_text(
|
|
1835
|
-
"import fs from 'node:fs';\n"
|
|
1836
|
-
f"fs.writeFileSync({json.dumps(str(trusted_marker))}, 'trusted');\n"
|
|
1837
|
-
"console.log(JSON.stringify({command:'checkpoint',exitCode:2,data:{}}));\n"
|
|
1838
|
-
"process.exit(2);\n",
|
|
1839
|
-
encoding="utf-8",
|
|
1840
|
-
)
|
|
1841
|
-
write_json(
|
|
1842
|
-
trusted_root / "native-runtime-identity.json",
|
|
1843
|
-
{
|
|
1844
|
-
"schema": "comet.eval.trusted-native-runtime.v1",
|
|
1845
|
-
"runtimeFile": trusted_runtime.name,
|
|
1846
|
-
"runtimeHash": hashlib.sha256(trusted_runtime.read_bytes()).hexdigest(),
|
|
1847
|
-
},
|
|
1848
|
-
)
|
|
1849
|
-
|
|
1850
|
-
mutable_marker = tmp_path / "agent-runtime-ran"
|
|
1851
|
-
mutable_runtime = tmp_path / ".claude/skills/comet-native/scripts/comet-native-runtime.mjs"
|
|
1852
|
-
mutable_runtime.parent.mkdir(parents=True)
|
|
1853
|
-
mutable_runtime.write_text(
|
|
1854
|
-
"import fs from 'node:fs';\n"
|
|
1855
|
-
f"fs.writeFileSync({json.dumps(str(mutable_marker))}, 'agent');\n"
|
|
1856
|
-
"console.log(JSON.stringify({command:'checkpoint',exitCode:2,data:{}}));\n"
|
|
1857
|
-
"process.exit(2);\n",
|
|
1858
|
-
encoding="utf-8",
|
|
1859
|
-
)
|
|
1860
|
-
|
|
1861
|
-
result = validator.check_live_concurrent_cas()
|
|
1862
|
-
|
|
1863
|
-
assert result["status"] == "failed"
|
|
1864
|
-
assert trusted_marker.is_file()
|
|
1865
|
-
assert not mutable_marker.exists()
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
def test_wave_f_validator_requires_matching_projection_and_unchanged_tree(tmp_path: Path):
|
|
1869
|
-
validator = load_validator(
|
|
1870
|
-
"comet-native-wave-f-dashboard-readonly", "test_native_wave_f_dashboard_readonly.py"
|
|
1871
|
-
)
|
|
1872
|
-
validator.WORKSPACE = tmp_path
|
|
1873
|
-
projection = {
|
|
1874
|
-
"workflow": "native",
|
|
1875
|
-
"name": "dashboard-visible-change",
|
|
1876
|
-
"phase": "shape",
|
|
1877
|
-
"revision": 1,
|
|
1878
|
-
"selected": True,
|
|
1879
|
-
"nextCommand": 'comet native next dashboard-visible-change --summary "<summary>"',
|
|
1880
|
-
"verificationResult": "pending",
|
|
1881
|
-
"verificationFreshness": "missing",
|
|
1882
|
-
"archiveReady": False,
|
|
1883
|
-
"continuation": {
|
|
1884
|
-
"disposition": "continue",
|
|
1885
|
-
"action": "work-phase",
|
|
1886
|
-
"command": 'comet native next dashboard-visible-change --summary "<summary>"',
|
|
1887
|
-
"requiresUserDecision": False,
|
|
1888
|
-
"requiredInputs": [],
|
|
1889
|
-
"requiredInputsTruncated": False,
|
|
1890
|
-
},
|
|
1891
|
-
"findings": {
|
|
1892
|
-
"total": 0,
|
|
1893
|
-
"errors": 0,
|
|
1894
|
-
"warnings": 0,
|
|
1895
|
-
"info": 0,
|
|
1896
|
-
"requiresUserDecision": False,
|
|
1897
|
-
"codes": [],
|
|
1898
|
-
"truncated": False,
|
|
1899
|
-
},
|
|
1900
|
-
"archive": {
|
|
1901
|
-
"ready": False,
|
|
1902
|
-
"evidenceFreshness": "missing",
|
|
1903
|
-
"operationCount": 1,
|
|
1904
|
-
"findingCodes": ["archive-phase-required", "verification-evidence-missing"],
|
|
1905
|
-
"findingCodesTruncated": False,
|
|
1906
|
-
"preflightHash": "a" * 64,
|
|
1907
|
-
},
|
|
1908
|
-
"conflicts": {
|
|
1909
|
-
"visibleDefiniteConflict": 0,
|
|
1910
|
-
"visiblePossibleOverlap": 0,
|
|
1911
|
-
"peers": [],
|
|
1912
|
-
"peersTruncated": False,
|
|
1913
|
-
},
|
|
1914
|
-
}
|
|
1915
|
-
cli_projection = {
|
|
1916
|
-
"name": projection["name"],
|
|
1917
|
-
"phase": projection["phase"],
|
|
1918
|
-
"revision": projection["revision"],
|
|
1919
|
-
"selected": projection["selected"],
|
|
1920
|
-
"nextCommand": projection["nextCommand"],
|
|
1921
|
-
"verificationResult": projection["verificationResult"],
|
|
1922
|
-
"archiveReady": projection["archiveReady"],
|
|
1923
|
-
"continuation": projection["continuation"],
|
|
1924
|
-
"findingSummary": projection["findings"],
|
|
103
|
+
],
|
|
1925
104
|
}
|
|
1926
|
-
|
|
1927
|
-
tmp_path / ".cache/comet-native-eval/cli-before.json",
|
|
1928
|
-
{"command": "status", "exitCode": 0, "data": cli_projection},
|
|
1929
|
-
)
|
|
1930
|
-
write_json(
|
|
1931
|
-
tmp_path / ".cache/comet-native-eval/cli-after.json",
|
|
1932
|
-
{"command": "status", "exitCode": 0, "data": cli_projection},
|
|
1933
|
-
)
|
|
1934
|
-
write_json(
|
|
1935
|
-
tmp_path / ".cache/comet-native-eval/dashboard.json",
|
|
1936
|
-
{
|
|
1937
|
-
"native": {
|
|
1938
|
-
"schema": "comet.dashboard.native.v1",
|
|
1939
|
-
"generatedAt": "2026-07-17T00:00:00.000Z",
|
|
1940
|
-
"totalChangeCount": 1,
|
|
1941
|
-
"visibleChangeCount": 1,
|
|
1942
|
-
"omittedChangeCount": 0,
|
|
1943
|
-
"changesTruncated": False,
|
|
1944
|
-
"changes": [projection],
|
|
1945
|
-
"conflicts": {
|
|
1946
|
-
"available": True,
|
|
1947
|
-
"definiteConflict": 0,
|
|
1948
|
-
"possibleOverlap": 0,
|
|
1949
|
-
"disjoint": 0,
|
|
1950
|
-
"relationshipCount": 0,
|
|
1951
|
-
"visibleRelationshipCount": 0,
|
|
1952
|
-
"omittedRelationshipCount": 0,
|
|
1953
|
-
"relationshipsTruncated": False,
|
|
1954
|
-
},
|
|
1955
|
-
}
|
|
1956
|
-
},
|
|
1957
|
-
)
|
|
1958
|
-
native_change = tmp_path / "docs/comet/changes/dashboard-visible-change"
|
|
1959
|
-
native_change.mkdir(parents=True)
|
|
1960
|
-
(native_change / "comet-state.yaml").write_text(
|
|
1961
|
-
"name: dashboard-visible-change\n", encoding="utf-8"
|
|
1962
|
-
)
|
|
1963
|
-
manifest = {"files": validator._current_native_manifest()}
|
|
1964
|
-
write_json(tmp_path / ".cache/comet-native-eval/native-tree-before.json", manifest)
|
|
1965
|
-
write_json(tmp_path / ".cache/comet-native-eval/native-tree-after.json", manifest)
|
|
1966
|
-
|
|
1967
|
-
readonly = validator.check_dashboard_readonly()
|
|
1968
|
-
assert readonly["status"] == "passed", readonly
|
|
1969
|
-
assert validator.check_public_native_projection()["status"] == "passed"
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
def test_wave_f_rejects_tampered_controller_source_build(monkeypatch, tmp_path: Path):
|
|
1973
|
-
eval_conftest = sys.modules["conftest"]
|
|
1974
|
-
checkout = tmp_path / "checkout"
|
|
1975
|
-
(checkout / "bin").mkdir(parents=True)
|
|
1976
|
-
(checkout / "bin/comet.js").write_text("import '../dist/app/cli/index.js';\n", encoding="utf-8")
|
|
1977
|
-
(checkout / "package.json").write_text('{"type":"module"}\n', encoding="utf-8")
|
|
1978
|
-
(checkout / "assets").mkdir()
|
|
1979
|
-
(checkout / "assets/manifest.json").write_text('{"skills": []}\n', encoding="utf-8")
|
|
1980
|
-
environment = tmp_path / "environment"
|
|
1981
|
-
environment.mkdir()
|
|
1982
|
-
(environment / ".include-current-comet-cli").write_text("include\n", encoding="utf-8")
|
|
1983
|
-
workspace = tmp_path / "workspace"
|
|
1984
|
-
workspace.mkdir()
|
|
1985
|
-
|
|
1986
|
-
def fake_source_build(_checkout: Path, output: Path) -> str:
|
|
1987
|
-
(output / "app/cli").mkdir(parents=True)
|
|
1988
|
-
(output / "domains/dashboard").mkdir(parents=True)
|
|
1989
|
-
(output / "app/cli/index.js").write_text("export {};\n", encoding="utf-8")
|
|
1990
|
-
(output / "domains/dashboard/native-adapter.js").write_text(
|
|
1991
|
-
"export const schema = 'native';\n", encoding="utf-8"
|
|
1992
|
-
)
|
|
1993
|
-
return "5.9.3"
|
|
1994
|
-
|
|
1995
|
-
monkeypatch.setattr(eval_conftest, "REPOSITORY_ROOT", checkout)
|
|
1996
|
-
monkeypatch.setattr(eval_conftest, "_build_current_comet_dist", fake_source_build)
|
|
1997
|
-
eval_conftest._copy_current_comet_cli_snapshot(environment, workspace)
|
|
1998
|
-
validator = load_validator(
|
|
1999
|
-
"comet-native-wave-f-dashboard-readonly", "test_native_wave_f_dashboard_readonly.py"
|
|
2000
|
-
)
|
|
2001
|
-
validator.WORKSPACE = workspace
|
|
2002
|
-
|
|
2003
|
-
identity_check = validator.check_current_cli_build_identity()
|
|
2004
|
-
assert identity_check["status"] == "passed", identity_check
|
|
2005
|
-
adapter = workspace / "_eval_current_comet/dist/domains/dashboard/native-adapter.js"
|
|
2006
|
-
adapter.write_text("export const schema = 'forged';\n", encoding="utf-8")
|
|
2007
|
-
assert validator.check_current_cli_build_identity()["status"] == "failed"
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
def test_wave_f_live_check_rejects_a_single_dashboard_write(monkeypatch, tmp_path: Path):
|
|
2011
|
-
validator = load_validator(
|
|
2012
|
-
"comet-native-wave-f-dashboard-readonly", "test_native_wave_f_dashboard_readonly.py"
|
|
2013
|
-
)
|
|
2014
|
-
validator.WORKSPACE = tmp_path
|
|
2015
|
-
(tmp_path / "_eval_current_comet/bin").mkdir(parents=True)
|
|
2016
|
-
(tmp_path / "_eval_current_comet/bin/comet.js").write_text("// fixture\n", encoding="utf-8")
|
|
2017
|
-
(tmp_path / "current-comet.sh").write_text("#!/usr/bin/env bash\n", encoding="utf-8")
|
|
2018
|
-
native = tmp_path / "docs/comet/changes/dashboard-visible-change"
|
|
2019
|
-
native.mkdir(parents=True)
|
|
2020
|
-
(native / "comet-state.yaml").write_text(
|
|
2021
|
-
"name: dashboard-visible-change\n", encoding="utf-8"
|
|
2022
|
-
)
|
|
2023
|
-
(tmp_path / ".cache/comet-native-eval").mkdir(parents=True)
|
|
2024
|
-
calls = 0
|
|
105
|
+
assert check_dashboard_projection(projection)["status"] == "passed"
|
|
2025
106
|
|
|
2026
|
-
def write_once(_wrapper: Path, project_root: Path):
|
|
2027
|
-
nonlocal calls
|
|
2028
|
-
calls += 1
|
|
2029
|
-
if calls == 1:
|
|
2030
|
-
target = project_root / "docs/comet/runtime/one-time-write.json"
|
|
2031
|
-
target.parent.mkdir(parents=True, exist_ok=True)
|
|
2032
|
-
target.write_text("{}\n", encoding="utf-8")
|
|
2033
|
-
return {"native": {"changes": []}}
|
|
2034
107
|
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
"comet-native-wave-f-dashboard-readonly", "test_native_wave_f_dashboard_readonly.py"
|
|
2045
|
-
)
|
|
2046
|
-
validator.WORKSPACE = tmp_path
|
|
2047
|
-
projection = {"name": "dashboard-visible-change", "phase": "shape"}
|
|
2048
|
-
dashboard = {"native": {"changes": [projection]}}
|
|
2049
|
-
|
|
2050
|
-
snapshot = tmp_path / "_eval_current_comet"
|
|
2051
|
-
(snapshot / "bin").mkdir(parents=True)
|
|
2052
|
-
(snapshot / "package.json").write_text('{"type":"module"}\n', encoding="utf-8")
|
|
2053
|
-
(snapshot / "bin/comet.js").write_text(
|
|
2054
|
-
f"console.log(JSON.stringify({json.dumps(dashboard)}));\n",
|
|
2055
|
-
encoding="utf-8",
|
|
2056
|
-
)
|
|
2057
|
-
|
|
2058
|
-
mutable_marker = tmp_path / "agent-wrapper-ran"
|
|
2059
|
-
mutable_wrapper = tmp_path / "current-comet.sh"
|
|
2060
|
-
mutable_wrapper.write_text("#!/usr/bin/env bash\nexit 99\n", encoding="utf-8")
|
|
2061
|
-
|
|
2062
|
-
native_change = tmp_path / "docs/comet/changes/dashboard-visible-change"
|
|
2063
|
-
native_change.mkdir(parents=True)
|
|
2064
|
-
(native_change / "comet-state.yaml").write_text(
|
|
2065
|
-
"name: dashboard-visible-change\nphase: shape\n", encoding="utf-8"
|
|
2066
|
-
)
|
|
2067
|
-
(tmp_path / ".comet").mkdir()
|
|
2068
|
-
(tmp_path / ".comet" / "config.yaml").write_text(
|
|
2069
|
-
"schema: comet.project.v1\ndefault_workflow: native\nworkflows:\n - native\nnative:\n artifact_root: docs\n",
|
|
2070
|
-
encoding="utf-8",
|
|
2071
|
-
)
|
|
2072
|
-
evidence = tmp_path / ".cache/comet-native-eval"
|
|
2073
|
-
write_json(
|
|
2074
|
-
evidence / "cli-after.json",
|
|
2075
|
-
{"command": "status", "exitCode": 0, "data": projection},
|
|
2076
|
-
)
|
|
2077
|
-
write_json(
|
|
2078
|
-
evidence / "native-tree-after.json",
|
|
2079
|
-
{"files": validator._current_native_manifest()},
|
|
2080
|
-
)
|
|
2081
|
-
|
|
2082
|
-
real_run = validator.subprocess.run
|
|
2083
|
-
|
|
2084
|
-
def run_process(command, *args, **kwargs):
|
|
2085
|
-
if command[0] == "bash":
|
|
2086
|
-
mutable_marker.write_text("agent", encoding="utf-8")
|
|
2087
|
-
return validator.subprocess.CompletedProcess(command, 0, json.dumps(dashboard), "")
|
|
2088
|
-
return real_run(command, *args, **kwargs)
|
|
2089
|
-
|
|
2090
|
-
monkeypatch.setattr(validator.subprocess, "run", run_process)
|
|
2091
|
-
|
|
2092
|
-
result = validator.check_live_dashboard_and_tree()
|
|
2093
|
-
|
|
2094
|
-
assert result["status"] == "passed", result
|
|
2095
|
-
assert not mutable_marker.exists()
|
|
108
|
+
def test_workflow_validator_does_not_use_removed_receipt_helpers():
|
|
109
|
+
validator = _load_workflow_validator()
|
|
110
|
+
for name in (
|
|
111
|
+
"_canonical_hash",
|
|
112
|
+
"_direct_acceptance_receipt_refs",
|
|
113
|
+
"_trusted_native_runtime",
|
|
114
|
+
"_validate_native_contract_with_trusted_runtime",
|
|
115
|
+
):
|
|
116
|
+
assert not hasattr(validator, name)
|