@rpamis/comet 0.4.0-beta.3 → 0.4.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/assets/manifest.json +2 -1
- package/assets/skills/comet/SKILL.md +25 -1
- package/assets/skills/comet/reference/comet-yaml-fields.md +5 -2
- package/assets/skills/comet/reference/context-recovery.md +10 -0
- package/assets/skills/comet/reference/scripts.md +47 -15
- package/assets/skills/comet/rules/comet-phase-guard.en.md +8 -0
- package/assets/skills/comet/rules/comet-phase-guard.md +9 -1
- package/assets/skills/comet/scripts/comet-resume-probe.mjs +3 -0
- package/assets/skills/comet/scripts/comet-runtime.mjs +1387 -424
- package/assets/skills/comet-archive/SKILL.md +24 -11
- package/assets/skills/comet-build/SKILL.md +42 -25
- package/assets/skills/comet-design/SKILL.md +1 -0
- package/assets/skills/comet-hotfix/SKILL.md +3 -1
- package/assets/skills/comet-open/SKILL.md +11 -1
- package/assets/skills/comet-tweak/SKILL.md +3 -1
- package/assets/skills/comet-verify/SKILL.md +29 -20
- package/assets/skills-zh/comet/SKILL.md +25 -1
- package/assets/skills-zh/comet/reference/comet-yaml-fields.md +5 -2
- package/assets/skills-zh/comet/reference/context-recovery.md +10 -0
- package/assets/skills-zh/comet/reference/scripts.md +47 -15
- package/assets/skills-zh/comet-archive/SKILL.md +24 -11
- package/assets/skills-zh/comet-build/SKILL.md +42 -25
- package/assets/skills-zh/comet-design/SKILL.md +1 -0
- package/assets/skills-zh/comet-hotfix/SKILL.md +3 -1
- package/assets/skills-zh/comet-open/SKILL.md +11 -1
- package/assets/skills-zh/comet-tweak/SKILL.md +3 -1
- package/assets/skills-zh/comet-verify/SKILL.md +30 -21
- package/dist/app/cli/comet-banner.d.ts +25 -0
- package/dist/app/cli/comet-banner.d.ts.map +1 -0
- package/dist/app/cli/comet-banner.js +265 -0
- package/dist/app/cli/comet-banner.js.map +1 -0
- package/dist/app/cli/index.js +36 -2
- package/dist/app/cli/index.js.map +1 -1
- package/dist/app/commands/classic.d.ts +4 -0
- package/dist/app/commands/classic.d.ts.map +1 -0
- package/dist/app/commands/classic.js +11 -0
- package/dist/app/commands/classic.js.map +1 -0
- package/dist/app/commands/doctor.d.ts.map +1 -1
- package/dist/app/commands/doctor.js +39 -24
- package/dist/app/commands/doctor.js.map +1 -1
- package/dist/app/commands/eval.d.ts.map +1 -1
- package/dist/app/commands/eval.js +57 -20
- package/dist/app/commands/eval.js.map +1 -1
- package/dist/app/commands/i18n.d.ts +1 -1
- package/dist/app/commands/i18n.d.ts.map +1 -1
- package/dist/app/commands/i18n.js +12 -4
- package/dist/app/commands/i18n.js.map +1 -1
- package/dist/app/commands/init.d.ts.map +1 -1
- package/dist/app/commands/init.js +16 -13
- package/dist/app/commands/init.js.map +1 -1
- package/dist/app/commands/project-scope-selection.d.ts +13 -0
- package/dist/app/commands/project-scope-selection.d.ts.map +1 -0
- package/dist/app/commands/project-scope-selection.js +33 -0
- package/dist/app/commands/project-scope-selection.js.map +1 -0
- package/dist/app/commands/resume-probe.d.ts +11 -0
- package/dist/app/commands/resume-probe.d.ts.map +1 -0
- package/dist/app/commands/resume-probe.js +63 -0
- package/dist/app/commands/resume-probe.js.map +1 -0
- package/dist/app/commands/status.d.ts +31 -0
- package/dist/app/commands/status.d.ts.map +1 -1
- package/dist/app/commands/status.js +109 -20
- package/dist/app/commands/status.js.map +1 -1
- package/dist/app/commands/uninstall.d.ts +2 -0
- package/dist/app/commands/uninstall.d.ts.map +1 -1
- package/dist/app/commands/uninstall.js +217 -40
- package/dist/app/commands/uninstall.js.map +1 -1
- package/dist/app/commands/update.d.ts +6 -0
- package/dist/app/commands/update.d.ts.map +1 -1
- package/dist/app/commands/update.js +361 -68
- package/dist/app/commands/update.js.map +1 -1
- package/dist/config/repository-layout.json +4 -2
- package/dist/domains/bundle/bundle-platform.d.ts.map +1 -1
- package/dist/domains/bundle/bundle-platform.js +3 -1
- package/dist/domains/bundle/bundle-platform.js.map +1 -1
- package/dist/domains/bundle/eval-manifest-runtime.d.ts +6 -0
- package/dist/domains/bundle/eval-manifest-runtime.d.ts.map +1 -0
- package/dist/domains/bundle/eval-manifest-runtime.js +58 -0
- package/dist/domains/bundle/eval-manifest-runtime.js.map +1 -0
- 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-archive.d.ts +1 -0
- package/dist/domains/comet-classic/classic-archive.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-archive.js +35 -38
- package/dist/domains/comet-classic/classic-archive.js.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-command-checks.d.ts +20 -0
- package/dist/domains/comet-classic/classic-command-checks.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-command-checks.js +97 -0
- package/dist/domains/comet-classic/classic-command-checks.js.map +1 -0
- package/dist/domains/comet-classic/classic-current-change.d.ts +19 -0
- package/dist/domains/comet-classic/classic-current-change.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-current-change.js +132 -0
- package/dist/domains/comet-classic/classic-current-change.js.map +1 -0
- package/dist/domains/comet-classic/classic-diagnostics.d.ts +2 -1
- package/dist/domains/comet-classic/classic-diagnostics.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-diagnostics.js +54 -1
- package/dist/domains/comet-classic/classic-diagnostics.js.map +1 -1
- package/dist/domains/comet-classic/classic-evidence.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-evidence.js +4 -0
- package/dist/domains/comet-classic/classic-evidence.js.map +1 -1
- package/dist/domains/comet-classic/classic-guard.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-guard.js +68 -69
- 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 +66 -23
- package/dist/domains/comet-classic/classic-hook-guard.js.map +1 -1
- package/dist/domains/comet-classic/classic-project-config.d.ts +16 -0
- package/dist/domains/comet-classic/classic-project-config.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-project-config.js +40 -0
- package/dist/domains/comet-classic/classic-project-config.js.map +1 -0
- package/dist/domains/comet-classic/classic-resolver.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-resolver.js +3 -3
- package/dist/domains/comet-classic/classic-resolver.js.map +1 -1
- package/dist/domains/comet-classic/classic-resume-probe-command.d.ts +3 -0
- package/dist/domains/comet-classic/classic-resume-probe-command.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-resume-probe-command.js +58 -0
- package/dist/domains/comet-classic/classic-resume-probe-command.js.map +1 -0
- package/dist/domains/comet-classic/classic-resume-probe-entry.d.ts +2 -0
- package/dist/domains/comet-classic/classic-resume-probe-entry.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-resume-probe-entry.js +4 -0
- package/dist/domains/comet-classic/classic-resume-probe-entry.js.map +1 -0
- package/dist/domains/comet-classic/classic-resume-probe.d.ts +29 -0
- package/dist/domains/comet-classic/classic-resume-probe.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-resume-probe.js +386 -0
- package/dist/domains/comet-classic/classic-resume-probe.js.map +1 -0
- package/dist/domains/comet-classic/classic-runtime-run.d.ts +2 -1
- package/dist/domains/comet-classic/classic-runtime-run.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-runtime-run.js +38 -0
- package/dist/domains/comet-classic/classic-runtime-run.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 +128 -12
- package/dist/domains/comet-classic/classic-state-command.js.map +1 -1
- package/dist/domains/comet-classic/classic-state.d.ts +3 -1
- package/dist/domains/comet-classic/classic-state.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-state.js +4 -0
- package/dist/domains/comet-classic/classic-state.js.map +1 -1
- package/dist/domains/comet-classic/classic-store.d.ts +4 -1
- package/dist/domains/comet-classic/classic-store.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-store.js +4 -3
- package/dist/domains/comet-classic/classic-store.js.map +1 -1
- package/dist/domains/comet-classic/classic-transitions.d.ts +1 -1
- package/dist/domains/comet-classic/classic-transitions.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-transitions.js +20 -1
- package/dist/domains/comet-classic/classic-transitions.js.map +1 -1
- package/dist/domains/comet-classic/classic-validate-command.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-validate-command.js +1 -0
- package/dist/domains/comet-classic/classic-validate-command.js.map +1 -1
- package/dist/domains/comet-classic/index.d.ts +3 -0
- package/dist/domains/comet-classic/index.d.ts.map +1 -1
- package/dist/domains/comet-classic/index.js +3 -0
- package/dist/domains/comet-classic/index.js.map +1 -1
- package/dist/domains/dashboard/collector.js +10 -2
- package/dist/domains/dashboard/collector.js.map +1 -1
- package/dist/domains/dashboard/web/assets/{index-CjU3VXVu.js → index-CIvN-PL8.js} +11 -11
- package/dist/domains/dashboard/web/assets/{index-BcO3_QlT.css → index-DcyRPBnT.css} +1 -1
- package/dist/domains/dashboard/web/index.html +2 -2
- package/dist/domains/engine/types.d.ts +1 -1
- package/dist/domains/engine/types.d.ts.map +1 -1
- package/dist/domains/integrations/openspec.d.ts.map +1 -1
- package/dist/domains/integrations/openspec.js +6 -6
- package/dist/domains/integrations/openspec.js.map +1 -1
- package/dist/domains/skill/find.d.ts.map +1 -1
- package/dist/domains/skill/find.js +1 -6
- package/dist/domains/skill/find.js.map +1 -1
- package/dist/domains/skill/managed-markdown.d.ts +14 -0
- package/dist/domains/skill/managed-markdown.d.ts.map +1 -0
- package/dist/domains/skill/managed-markdown.js +126 -0
- package/dist/domains/skill/managed-markdown.js.map +1 -0
- package/dist/domains/skill/platform-install.d.ts +4 -3
- package/dist/domains/skill/platform-install.d.ts.map +1 -1
- package/dist/domains/skill/platform-install.js +96 -26
- package/dist/domains/skill/platform-install.js.map +1 -1
- package/dist/domains/skill/project-instructions.d.ts +22 -0
- package/dist/domains/skill/project-instructions.d.ts.map +1 -0
- package/dist/domains/skill/project-instructions.js +61 -0
- package/dist/domains/skill/project-instructions.js.map +1 -0
- package/dist/domains/skill/uninstall.d.ts +3 -1
- package/dist/domains/skill/uninstall.d.ts.map +1 -1
- package/dist/domains/skill/uninstall.js +86 -39
- package/dist/domains/skill/uninstall.js.map +1 -1
- package/dist/platform/install/detect.d.ts +2 -1
- package/dist/platform/install/detect.d.ts.map +1 -1
- package/dist/platform/install/detect.js +10 -1
- package/dist/platform/install/detect.js.map +1 -1
- package/dist/platform/install/platforms.d.ts +5 -1
- package/dist/platform/install/platforms.d.ts.map +1 -1
- package/dist/platform/install/platforms.js +21 -4
- package/dist/platform/install/platforms.js.map +1 -1
- package/dist/platform/install/project-registry.d.ts +37 -0
- package/dist/platform/install/project-registry.d.ts.map +1 -0
- package/dist/platform/install/project-registry.js +205 -0
- package/dist/platform/install/project-registry.js.map +1 -0
- package/eval/.env +28 -0
- package/eval/.env.example +52 -0
- package/eval/CLAUDE.md +43 -0
- package/eval/README.md +538 -0
- package/eval/langsmith/.env.example +16 -0
- package/eval/langsmith/README.md +93 -0
- package/eval/langsmith/skills/README.md +5 -0
- package/eval/langsmith/tasks/README.md +5 -0
- package/eval/langsmith/tests/conftest.py +187 -0
- package/eval/langsmith/tests/tasks/test_tasks.py +287 -0
- package/eval/langsmith/treatments/README.md +5 -0
- package/eval/local/README.md +80 -0
- package/eval/local/regression_baseline.json +13 -0
- package/eval/local/report-style-demo-assets/quality_cost.en.svg +41 -0
- package/eval/local/report-style-demo-assets/quality_cost.zh.svg +41 -0
- package/eval/local/report-style-demo-assets/rubric_delta.en.svg +56 -0
- package/eval/local/report-style-demo-assets/rubric_delta.zh.svg +56 -0
- package/eval/local/report-style-demo-assets/task_outcomes.en.svg +46 -0
- package/eval/local/report-style-demo-assets/task_outcomes.zh.svg +46 -0
- package/eval/local/report-style-demo.html +867 -0
- package/eval/local/scripts/compare_baselines.py +1018 -0
- package/eval/local/scripts/generate_report_style_demo_charts.py +322 -0
- package/eval/local/scripts/regression_check.py +171 -0
- package/eval/local/scripts/render_readme_benchmark_figures.py +416 -0
- package/eval/local/scripts/rescore_rubric.py +120 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/SKILL.md +282 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/reference/auto-transition.md +27 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/reference/comet-yaml-fields.md +68 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/reference/context-recovery.md +35 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/reference/debug-gate.md +17 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/reference/decision-point.md +20 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/reference/dirty-worktree.md +59 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/reference/file-structure.md +28 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/reference/subagent-dispatch.md +113 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/rules/comet-phase-guard.md +125 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/scripts/comet-archive.sh +311 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/scripts/comet-env.sh +110 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/scripts/comet-guard.sh +778 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/scripts/comet-handoff.sh +390 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/scripts/comet-hook-guard.sh +336 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/scripts/comet-state.sh +1338 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/scripts/comet-yaml-validate.sh +225 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039-archive/SKILL.md +100 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039-build/SKILL.md +304 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039-design/SKILL.md +263 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039-hotfix/SKILL.md +204 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039-open/SKILL.md +220 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039-tweak/SKILL.md +180 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039-verify/SKILL.md +234 -0
- package/eval/local/skills/benchmarks/040-beta/comet/SKILL.md +261 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/auto-transition.md +27 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/comet-yaml-fields.md +73 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/context-recovery.md +45 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/debug-gate.md +33 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/decision-point.md +31 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/dirty-worktree.md +59 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/file-structure.md +28 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/intent-frame.md +74 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/scripts.md +69 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/subagent-dispatch.md +169 -0
- package/eval/local/skills/benchmarks/040-beta/comet/rules/comet-phase-guard.md +130 -0
- package/eval/local/skills/benchmarks/040-beta/comet/runtime/classic/checks.yaml +6 -0
- package/eval/local/skills/benchmarks/040-beta/comet/runtime/classic/guardrails.yaml +13 -0
- package/eval/local/skills/benchmarks/040-beta/comet/runtime/classic/skill.yaml +122 -0
- package/eval/local/skills/benchmarks/040-beta/comet/scripts/comet-archive.mjs +9515 -0
- package/eval/local/skills/benchmarks/040-beta/comet/scripts/comet-env.mjs +15 -0
- package/eval/local/skills/benchmarks/040-beta/comet/scripts/comet-guard.mjs +10173 -0
- package/eval/local/skills/benchmarks/040-beta/comet/scripts/comet-handoff.mjs +9491 -0
- package/eval/local/skills/benchmarks/040-beta/comet/scripts/comet-hook-guard.mjs +9175 -0
- package/eval/local/skills/benchmarks/040-beta/comet/scripts/comet-intent.mjs +404 -0
- package/eval/local/skills/benchmarks/040-beta/comet/scripts/comet-state.mjs +9273 -0
- package/eval/local/skills/benchmarks/040-beta/comet/scripts/comet-yaml-validate.mjs +7627 -0
- package/eval/local/skills/benchmarks/040-beta/comet-archive/SKILL.md +110 -0
- package/eval/local/skills/benchmarks/040-beta/comet-build/SKILL.md +315 -0
- package/eval/local/skills/benchmarks/040-beta/comet-design/SKILL.md +260 -0
- package/eval/local/skills/benchmarks/040-beta/comet-hotfix/SKILL.md +190 -0
- package/eval/local/skills/benchmarks/040-beta/comet-open/SKILL.md +210 -0
- package/eval/local/skills/benchmarks/040-beta/comet-tweak/SKILL.md +183 -0
- package/eval/local/skills/benchmarks/040-beta/comet-verify/SKILL.md +230 -0
- package/eval/local/skills/benchmarks/dependency/claude-md/comet-workflow/CLAUDE.md +12 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-apply-change/SKILL.md +156 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-archive-change/SKILL.md +114 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-bulk-archive-change/SKILL.md +246 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-continue-change/SKILL.md +118 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-explore/SKILL.md +288 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-ff-change/SKILL.md +101 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-new-change/SKILL.md +74 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-onboard/SKILL.md +554 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-propose/SKILL.md +110 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-sync-specs/SKILL.md +138 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-verify-change/SKILL.md +168 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/brainstorming/SKILL.md +159 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/brainstorming/scripts/frame-template.html +213 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/brainstorming/scripts/helper.js +167 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/brainstorming/scripts/server.cjs +723 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/brainstorming/scripts/start-server.sh +209 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/brainstorming/scripts/stop-server.sh +120 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/brainstorming/visual-companion.md +291 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/dispatching-parallel-agents/SKILL.md +185 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/executing-plans/SKILL.md +70 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/finishing-a-development-branch/SKILL.md +241 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/receiving-code-review/SKILL.md +213 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/requesting-code-review/SKILL.md +103 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/requesting-code-review/code-reviewer.md +172 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/subagent-driven-development/SKILL.md +418 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/subagent-driven-development/implementer-prompt.md +139 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/subagent-driven-development/scripts/review-package +44 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/subagent-driven-development/scripts/sdd-workspace +22 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/subagent-driven-development/scripts/task-brief +40 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/subagent-driven-development/task-reviewer-prompt.md +188 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/CREATION-LOG.md +119 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/SKILL.md +296 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/condition-based-waiting.md +115 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/defense-in-depth.md +122 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/find-polluter.sh +63 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/root-cause-tracing.md +169 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/test-academic.md +14 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/test-pressure-1.md +58 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/test-pressure-2.md +68 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/test-pressure-3.md +69 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/test-driven-development/SKILL.md +371 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/test-driven-development/testing-anti-patterns.md +299 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/using-git-worktrees/SKILL.md +202 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/verification-before-completion/SKILL.md +139 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-plans/SKILL.md +174 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-skills/SKILL.md +689 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-skills/anthropic-best-practices.md +1150 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-skills/graphviz-conventions.dot +172 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-skills/persuasion-principles.md +187 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-skills/render-graphs.js +168 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-skills/testing-skills-with-subagents.md +384 -0
- package/eval/local/tasks/authoring-skill-smoke/environment/Dockerfile +2 -0
- package/eval/local/tasks/authoring-skill-smoke/instruction.md +4 -0
- package/eval/local/tasks/authoring-skill-smoke/task.toml +21 -0
- package/eval/local/tasks/authoring-skill-smoke/validation/test_authoring_skill_smoke.py +54 -0
- package/eval/local/tasks/comet-agent-memory-routing/environment/Dockerfile +28 -0
- package/eval/local/tasks/comet-agent-memory-routing/environment/agent_system.py +40 -0
- package/eval/local/tasks/comet-agent-memory-routing/environment/test_agent_system.py +29 -0
- package/eval/local/tasks/comet-agent-memory-routing/instruction.md +20 -0
- package/eval/local/tasks/comet-agent-memory-routing/task.toml +24 -0
- package/eval/local/tasks/comet-agent-memory-routing/validation/test_agent_memory_routing.py +24 -0
- package/eval/local/tasks/comet-api-cache-ttl/environment/Dockerfile +39 -0
- package/eval/local/tasks/comet-api-cache-ttl/environment/cache.py +39 -0
- package/eval/local/tasks/comet-api-cache-ttl/environment/test_cache.py +81 -0
- package/eval/local/tasks/comet-api-cache-ttl/instruction.md +33 -0
- package/eval/local/tasks/comet-api-cache-ttl/task.toml +24 -0
- package/eval/local/tasks/comet-api-cache-ttl/validation/test_api_cache_ttl.py +58 -0
- package/eval/local/tasks/comet-cross-file-refactor/environment/Dockerfile +15 -0
- package/eval/local/tasks/comet-cross-file-refactor/environment/cli.py +13 -0
- package/eval/local/tasks/comet-cross-file-refactor/environment/counting.py +13 -0
- package/eval/local/tasks/comet-cross-file-refactor/environment/test_textkit.py +21 -0
- package/eval/local/tasks/comet-cross-file-refactor/instruction.md +16 -0
- package/eval/local/tasks/comet-cross-file-refactor/task.toml +20 -0
- package/eval/local/tasks/comet-cross-file-refactor/validation/test_cross_file_refactor.py +20 -0
- package/eval/local/tasks/comet-dependency-confusion/environment/Dockerfile +28 -0
- package/eval/local/tasks/comet-dependency-confusion/environment/app.py +8 -0
- package/eval/local/tasks/comet-dependency-confusion/environment/settings_loader.py +14 -0
- package/eval/local/tasks/comet-dependency-confusion/environment/test_settings_service.py +19 -0
- package/eval/local/tasks/comet-dependency-confusion/instruction.md +18 -0
- package/eval/local/tasks/comet-dependency-confusion/task.toml +24 -0
- package/eval/local/tasks/comet-dependency-confusion/validation/test_dependency_confusion.py +24 -0
- package/eval/local/tasks/comet-fix-median/environment/Dockerfile +50 -0
- package/eval/local/tasks/comet-fix-median/environment/stats.py +54 -0
- package/eval/local/tasks/comet-fix-median/environment/test_stats.py +68 -0
- package/eval/local/tasks/comet-fix-median/instruction.md +25 -0
- package/eval/local/tasks/comet-fix-median/task.toml +24 -0
- package/eval/local/tasks/comet-fix-median/validation/test_fix_median.py +60 -0
- package/eval/local/tasks/comet-framework-selection/environment/Dockerfile +28 -0
- package/eval/local/tasks/comet-framework-selection/environment/architecture.py +12 -0
- package/eval/local/tasks/comet-framework-selection/environment/test_architecture.py +30 -0
- package/eval/local/tasks/comet-framework-selection/instruction.md +22 -0
- package/eval/local/tasks/comet-framework-selection/task.toml +24 -0
- package/eval/local/tasks/comet-framework-selection/validation/test_framework_selection.py +24 -0
- package/eval/local/tasks/comet-full-workflow/environment/Dockerfile +53 -0
- package/eval/local/tasks/comet-full-workflow/environment/test_wordcount.py +29 -0
- package/eval/local/tasks/comet-full-workflow/environment/wordcount.py +40 -0
- package/eval/local/tasks/comet-full-workflow/instruction.md +18 -0
- package/eval/local/tasks/comet-full-workflow/task.toml +24 -0
- package/eval/local/tasks/comet-full-workflow/validation/test_full_workflow.py +171 -0
- package/eval/local/tasks/comet-graph-execution-review/environment/Dockerfile +28 -0
- package/eval/local/tasks/comet-graph-execution-review/environment/pipeline.py +19 -0
- package/eval/local/tasks/comet-graph-execution-review/environment/test_pipeline.py +53 -0
- package/eval/local/tasks/comet-graph-execution-review/instruction.md +21 -0
- package/eval/local/tasks/comet-graph-execution-review/task.toml +24 -0
- package/eval/local/tasks/comet-graph-execution-review/validation/test_graph_execution_review.py +24 -0
- package/eval/local/tasks/comet-human-approval-flow/environment/Dockerfile +15 -0
- package/eval/local/tasks/comet-human-approval-flow/environment/approvals.py +17 -0
- package/eval/local/tasks/comet-human-approval-flow/environment/test_approvals.py +30 -0
- package/eval/local/tasks/comet-human-approval-flow/instruction.md +15 -0
- package/eval/local/tasks/comet-human-approval-flow/task.toml +20 -0
- package/eval/local/tasks/comet-human-approval-flow/validation/test_human_approval_flow.py +20 -0
- package/eval/local/tasks/comet-layered-streaming-fix/environment/Dockerfile +20 -0
- package/eval/local/tasks/comet-layered-streaming-fix/environment/chat_app.py +19 -0
- package/eval/local/tasks/comet-layered-streaming-fix/environment/test_chat_app.py +15 -0
- package/eval/local/tasks/comet-layered-streaming-fix/instruction.md +14 -0
- package/eval/local/tasks/comet-layered-streaming-fix/task.toml +20 -0
- package/eval/local/tasks/comet-layered-streaming-fix/validation/test_layered_streaming_fix.py +20 -0
- package/eval/local/tasks/comet-noise-distractor/environment/Dockerfile +15 -0
- package/eval/local/tasks/comet-noise-distractor/environment/distractor.md +4 -0
- package/eval/local/tasks/comet-noise-distractor/environment/invoice.py +5 -0
- package/eval/local/tasks/comet-noise-distractor/environment/test_invoice.py +18 -0
- package/eval/local/tasks/comet-noise-distractor/instruction.md +17 -0
- package/eval/local/tasks/comet-noise-distractor/task.toml +20 -0
- package/eval/local/tasks/comet-noise-distractor/validation/test_noise_distractor.py +20 -0
- package/eval/local/tasks/comet-observability-env-template/environment/Dockerfile +15 -0
- package/eval/local/tasks/comet-observability-env-template/environment/env_writer.py +17 -0
- package/eval/local/tasks/comet-observability-env-template/environment/test_env_writer.py +17 -0
- package/eval/local/tasks/comet-observability-env-template/instruction.md +20 -0
- package/eval/local/tasks/comet-observability-env-template/task.toml +20 -0
- package/eval/local/tasks/comet-observability-env-template/validation/test_observability_env_template.py +46 -0
- package/eval/local/tasks/comet-perf-dedupe/environment/Dockerfile +39 -0
- package/eval/local/tasks/comet-perf-dedupe/environment/dedupe.py +22 -0
- package/eval/local/tasks/comet-perf-dedupe/environment/test_dedupe.py +43 -0
- package/eval/local/tasks/comet-perf-dedupe/instruction.md +25 -0
- package/eval/local/tasks/comet-perf-dedupe/task.toml +24 -0
- package/eval/local/tasks/comet-perf-dedupe/validation/test_perf_dedupe.py +40 -0
- package/eval/local/tasks/comet-persistence-threading/environment/Dockerfile +15 -0
- package/eval/local/tasks/comet-persistence-threading/environment/session_store.py +15 -0
- package/eval/local/tasks/comet-persistence-threading/environment/test_session_store.py +21 -0
- package/eval/local/tasks/comet-persistence-threading/instruction.md +14 -0
- package/eval/local/tasks/comet-persistence-threading/task.toml +20 -0
- package/eval/local/tasks/comet-persistence-threading/validation/test_persistence_threading.py +20 -0
- package/eval/local/tasks/comet-refactor-counter/environment/Dockerfile +39 -0
- package/eval/local/tasks/comet-refactor-counter/environment/test_text_processor.py +57 -0
- package/eval/local/tasks/comet-refactor-counter/environment/text_processor.py +49 -0
- package/eval/local/tasks/comet-refactor-counter/instruction.md +31 -0
- package/eval/local/tasks/comet-refactor-counter/task.toml +24 -0
- package/eval/local/tasks/comet-refactor-counter/validation/test_refactor_counter.py +75 -0
- package/eval/local/tasks/comet-robust-config/environment/Dockerfile +39 -0
- package/eval/local/tasks/comet-robust-config/environment/config_loader.py +56 -0
- package/eval/local/tasks/comet-robust-config/environment/test_config_loader.py +72 -0
- package/eval/local/tasks/comet-robust-config/instruction.md +30 -0
- package/eval/local/tasks/comet-robust-config/task.toml +24 -0
- package/eval/local/tasks/comet-robust-config/validation/test_robust_config.py +37 -0
- package/eval/local/tasks/generic-skill-smoke/environment/Dockerfile +2 -0
- package/eval/local/tasks/generic-skill-smoke/instruction.md +7 -0
- package/eval/local/tasks/generic-skill-smoke/task.toml +21 -0
- package/eval/local/tasks/generic-skill-smoke/validation/test_generic_skill_smoke.py +36 -0
- package/eval/local/tasks/index.yaml +155 -0
- package/eval/local/tasks/workflow-overlay-contract/environment/Dockerfile +5 -0
- package/eval/local/tasks/workflow-overlay-contract/instruction.md +5 -0
- package/eval/local/tasks/workflow-overlay-contract/task.toml +21 -0
- package/eval/local/tasks/workflow-overlay-contract/validation/test_workflow_overlay_contract.py +235 -0
- package/eval/local/tasks/workflow-route-conformance/environment/Dockerfile +2 -0
- package/eval/local/tasks/workflow-route-conformance/instruction.md +5 -0
- package/eval/local/tasks/workflow-route-conformance/task.toml +21 -0
- package/eval/local/tasks/workflow-route-conformance/validation/test_workflow_route_conformance.py +84 -0
- package/eval/local/tests/conftest.py +1148 -0
- package/eval/local/tests/scaffold/test_attribution.py +48 -0
- package/eval/local/tests/scaffold/test_compare_baselines.py +999 -0
- package/eval/local/tests/scaffold/test_conftest_helpers.py +534 -0
- package/eval/local/tests/scaffold/test_evidence.py +15 -0
- package/eval/local/tests/scaffold/test_langsmith_conftest.py +244 -0
- package/eval/local/tests/scaffold/test_logging.py +243 -0
- package/eval/local/tests/scaffold/test_manifests.py +132 -0
- package/eval/local/tests/scaffold/test_profiles.py +866 -0
- package/eval/local/tests/scaffold/test_regression_check.py +19 -0
- package/eval/local/tests/scaffold/test_report_style_demo_charts.py +45 -0
- package/eval/local/tests/scaffold/test_sample_quality.py +211 -0
- package/eval/local/tests/scaffold/test_tasks.py +168 -0
- package/eval/local/tests/scaffold/test_treatments.py +244 -0
- package/eval/local/tests/scaffold/test_utils.py +139 -0
- package/eval/local/tests/tasks/test_tasks.py +445 -0
- package/eval/local/tests/tasks/test_validation_scripts.py +143 -0
- package/eval/local/treatments/comet/comet_full_039.yaml +141 -0
- package/eval/local/treatments/comet/comet_full_040_beta.yaml +140 -0
- package/eval/local/treatments/common/control.yaml +4 -0
- package/eval/pyproject.toml +41 -0
- package/eval/report-html-config.json +6 -0
- package/eval/scaffold/__init__.py +67 -0
- package/eval/scaffold/python/__init__.py +95 -0
- package/eval/scaffold/python/attribution.py +43 -0
- package/eval/scaffold/python/evidence.py +38 -0
- package/eval/scaffold/python/external_data_handler.py +18 -0
- package/eval/scaffold/python/generic_llm_judge.py +235 -0
- package/eval/scaffold/python/judge_config.py +168 -0
- package/eval/scaffold/python/llm_judge.py +191 -0
- package/eval/scaffold/python/logging.py +705 -0
- package/eval/scaffold/python/manifests.py +129 -0
- package/eval/scaffold/python/paper_charts.py +25 -0
- package/eval/scaffold/python/pass_at_k.py +107 -0
- package/eval/scaffold/python/paths.py +56 -0
- package/eval/scaffold/python/profiles.py +127 -0
- package/eval/scaffold/python/report_outputs.py +1391 -0
- package/eval/scaffold/python/sample_quality.py +339 -0
- package/eval/scaffold/python/schema.py +39 -0
- package/eval/scaffold/python/skill_parser.py +469 -0
- package/eval/scaffold/python/tasks.py +330 -0
- package/eval/scaffold/python/treatments.py +271 -0
- package/eval/scaffold/python/utils.py +366 -0
- package/eval/scaffold/python/validation/__init__.py +21 -0
- package/eval/scaffold/python/validation/authoring_rubric.py +326 -0
- package/eval/scaffold/python/validation/comet_workflow.py +187 -0
- package/eval/scaffold/python/validation/core.py +264 -0
- package/eval/scaffold/python/validation/dataset.py +337 -0
- package/eval/scaffold/python/validation/docker.py +106 -0
- package/eval/scaffold/python/validation/evaluator.py +549 -0
- package/eval/scaffold/python/validation/generic_rubric.py +169 -0
- package/eval/scaffold/python/validation/rubric.py +740 -0
- package/eval/scaffold/python/validation/runner.py +237 -0
- package/eval/scaffold/python/validation/scripts.py +58 -0
- package/eval/scaffold/python/validation/tracing.py +313 -0
- package/eval/scaffold/shell/common.sh +126 -0
- package/eval/scaffold/shell/docker.sh +482 -0
- package/eval/scaffold/shell/run-claude-loop.sh +181 -0
- package/eval/scaffold/shell/setup.sh +259 -0
- package/eval/simulator-instruction.md +9 -0
- package/package.json +24 -2
|
@@ -0,0 +1,999 @@
|
|
|
1
|
+
"""Unit tests for baseline comparison reporting."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
from local.scripts.compare_baselines import build_report, main
|
|
7
|
+
from scaffold.python.report_outputs import render_markdown_html
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def _write_report(reports_dir: Path, name: str, tokens: int, cost: float, passed: bool = True):
|
|
11
|
+
report = {
|
|
12
|
+
"name": f"comet-fix-median-{name}",
|
|
13
|
+
"passed": passed,
|
|
14
|
+
"checks_passed": [
|
|
15
|
+
"[RUBRIC] main_flow: 1.00 - ok",
|
|
16
|
+
"[RUBRIC] gate_guard: 1.00 - ok",
|
|
17
|
+
"[RUBRIC] skill_invocation: 1.00 - ok",
|
|
18
|
+
"[RUBRIC] spec_drift: 1.00 - ok",
|
|
19
|
+
"[RUBRIC] business_completion: 1.00 - ok",
|
|
20
|
+
"[RUBRIC] workflow_completion: 1.00 - ok",
|
|
21
|
+
"[RUBRIC] efficiency: 1.00 - ok",
|
|
22
|
+
"[RUBRIC] decision_point_compliance: 1.00 - ok",
|
|
23
|
+
"[RUBRIC] artifact_quality: 1.00 - ok",
|
|
24
|
+
],
|
|
25
|
+
"checks_failed": [] if passed else ["validator failed"],
|
|
26
|
+
"events_summary": {
|
|
27
|
+
"total_tokens": tokens,
|
|
28
|
+
"total_cost_usd": cost,
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
(reports_dir / f"{name.lower()}_report.json").write_text(json.dumps(report))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _write_quality_report(
|
|
35
|
+
reports_dir: Path,
|
|
36
|
+
filename: str,
|
|
37
|
+
*,
|
|
38
|
+
name: str,
|
|
39
|
+
weighted_score: float,
|
|
40
|
+
tokens: int,
|
|
41
|
+
cost: float,
|
|
42
|
+
sample_quality: dict,
|
|
43
|
+
passed: bool = True,
|
|
44
|
+
):
|
|
45
|
+
report = {
|
|
46
|
+
"name": name,
|
|
47
|
+
"passed": passed,
|
|
48
|
+
"run_id": filename,
|
|
49
|
+
"checks_passed": [f"[RUBRIC] weighted_score: {weighted_score:.2f}"],
|
|
50
|
+
"checks_failed": [] if passed else ["validator failed"],
|
|
51
|
+
"sample_quality": sample_quality,
|
|
52
|
+
"events_summary": {
|
|
53
|
+
"total_tokens": tokens,
|
|
54
|
+
"total_cost_usd": cost,
|
|
55
|
+
"artifact_references": {"report": f"reports/{filename}.json"},
|
|
56
|
+
},
|
|
57
|
+
}
|
|
58
|
+
(reports_dir / f"{filename}.json").write_text(json.dumps(report), encoding="utf-8")
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def test_compare_report_includes_spend_summary(tmp_path: Path):
|
|
62
|
+
experiment = tmp_path / "experiment"
|
|
63
|
+
reports = experiment / "reports"
|
|
64
|
+
reports.mkdir(parents=True)
|
|
65
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
66
|
+
_write_report(reports, "COMET_FULL_040_BETA", 200, 0.02)
|
|
67
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
68
|
+
|
|
69
|
+
report = build_report(experiment)
|
|
70
|
+
|
|
71
|
+
assert "## Spend summary" in report
|
|
72
|
+
assert "| Treatment | Runs | Tokens | Cost | Avg Tokens/Run | Avg Cost/Run |" in report
|
|
73
|
+
assert "| COMET_FULL_040_BETA | 1 | 200 | $0.0200 | 200 | $0.0200 |" in report
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def test_compare_report_reads_utf8_report_json(tmp_path: Path):
|
|
77
|
+
experiment = tmp_path / "experiment"
|
|
78
|
+
reports = experiment / "reports"
|
|
79
|
+
reports.mkdir(parents=True)
|
|
80
|
+
report = {
|
|
81
|
+
"name": "comet-fix-median-COMET_FULL_040_BETA",
|
|
82
|
+
"passed": True,
|
|
83
|
+
"checks_passed": ["[RUBRIC] weighted_score: 1.00 - 通过"],
|
|
84
|
+
"checks_failed": [],
|
|
85
|
+
"events_summary": {
|
|
86
|
+
"total_tokens": 200,
|
|
87
|
+
"total_cost_usd": 0.02,
|
|
88
|
+
"artifact_references": {"report": "报告路径"},
|
|
89
|
+
},
|
|
90
|
+
}
|
|
91
|
+
(reports / "utf8_report.json").write_text(
|
|
92
|
+
json.dumps(report, ensure_ascii=False),
|
|
93
|
+
encoding="utf-8",
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
output = build_report(experiment)
|
|
97
|
+
|
|
98
|
+
assert "报告路径" in output
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def test_compare_report_handles_partial_llm_judge_overlay_scores(tmp_path: Path):
|
|
102
|
+
experiment = tmp_path / "experiment"
|
|
103
|
+
reports = experiment / "reports"
|
|
104
|
+
reports.mkdir(parents=True)
|
|
105
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
106
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
107
|
+
workflow = {
|
|
108
|
+
"name": "comet-fix-median-COMET_FULL_040_BETA",
|
|
109
|
+
"passed": True,
|
|
110
|
+
"checks_passed": ["[RUBRIC-JUDGE] artifact_quality: 0.75 - ok"],
|
|
111
|
+
"checks_failed": [],
|
|
112
|
+
"events_summary": {},
|
|
113
|
+
}
|
|
114
|
+
(reports / "workflow_judge_only.json").write_text(
|
|
115
|
+
json.dumps(workflow),
|
|
116
|
+
encoding="utf-8",
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
report = build_report(experiment)
|
|
120
|
+
|
|
121
|
+
assert "## LLM-judge overlay (rule vs judge)" in report
|
|
122
|
+
assert "| artifact_quality | COMET_FULL_040_BETA | — | 0.75 | — |" in report
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def test_compare_report_includes_metric_guide_and_runtime_summary(tmp_path: Path):
|
|
126
|
+
experiment = tmp_path / "experiment"
|
|
127
|
+
reports = experiment / "reports"
|
|
128
|
+
reports.mkdir(parents=True)
|
|
129
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
130
|
+
_write_report(reports, "COMET_FULL_040_BETA", 200, 0.02)
|
|
131
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
132
|
+
|
|
133
|
+
for path in reports.glob("*.json"):
|
|
134
|
+
report = json.loads(path.read_text(encoding="utf-8"))
|
|
135
|
+
report["events_summary"].update(
|
|
136
|
+
{
|
|
137
|
+
"num_turns": 6,
|
|
138
|
+
"duration_seconds": 120,
|
|
139
|
+
"tool_calls": 18,
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
path.write_text(json.dumps(report), encoding="utf-8")
|
|
143
|
+
|
|
144
|
+
report = build_report(experiment)
|
|
145
|
+
|
|
146
|
+
assert "## Metric guide" in report
|
|
147
|
+
assert "| Metric | Meaning | Source | Report section |" in report
|
|
148
|
+
assert "| `raw runs` | All discovered report JSON files before quality filtering. | report files | Data quality summary |" in report
|
|
149
|
+
assert "| `business_completion` | Business validator pass rate; CONTROL is evaluated on this without requiring Comet workflow artifacts. | `[RUBRIC] business_completion` | Rubric dimensions / pass@k |" in report
|
|
150
|
+
assert "| `workflow_completion` | Comet workflow validator pass rate; `/` means not applicable for CONTROL. | `[RUBRIC] workflow_completion` | Rubric dimensions / pass@k |" in report
|
|
151
|
+
assert "## Runtime summary" in report
|
|
152
|
+
assert "| Treatment | Runs | Turns | Duration | Tool Calls | Avg Turns/Run | Avg Duration/Run | Avg Tool Calls/Run |" in report
|
|
153
|
+
assert "| COMET_FULL_040_BETA | 1 | 6 | 120s | 18 | 6.0 | 120s | 18.0 |" in report
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def test_compare_report_includes_rubric_dimension_guide(tmp_path: Path):
|
|
157
|
+
experiment = tmp_path / "experiment"
|
|
158
|
+
reports = experiment / "reports"
|
|
159
|
+
reports.mkdir(parents=True)
|
|
160
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
161
|
+
_write_report(reports, "COMET_FULL_040_BETA", 200, 0.02)
|
|
162
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
163
|
+
|
|
164
|
+
report = build_report(experiment)
|
|
165
|
+
html = render_markdown_html(report, title="Comet Baseline Comparison Report")
|
|
166
|
+
|
|
167
|
+
assert "### Dimension guide" in report
|
|
168
|
+
assert "| main_flow | Completion of the expected Comet workflow phases. |" in report
|
|
169
|
+
assert "| business_completion | Business validator pass rate for the requested task behavior. |" in report
|
|
170
|
+
assert "<h3>维度说明</h3>" in html
|
|
171
|
+
assert "业务 validator 对用户请求行为的通过率" in html
|
|
172
|
+
assert "Workflow validator 对 Comet workflow 产物的通过率" in html
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def test_compare_report_normalizes_repeated_run_suffixes(tmp_path: Path):
|
|
176
|
+
experiment = tmp_path / "experiment"
|
|
177
|
+
reports = experiment / "reports"
|
|
178
|
+
reports.mkdir(parents=True)
|
|
179
|
+
report = {
|
|
180
|
+
"name": "comet-fix-median-COMET_FULL_040_BETA-r1",
|
|
181
|
+
"passed": True,
|
|
182
|
+
"checks_passed": ["[RUBRIC] weighted_score: 1.00"],
|
|
183
|
+
"checks_failed": [],
|
|
184
|
+
"events_summary": {"total_tokens": 200, "total_cost_usd": 0.02},
|
|
185
|
+
}
|
|
186
|
+
(reports / "workflow_report.json").write_text(json.dumps(report))
|
|
187
|
+
|
|
188
|
+
output = build_report(experiment)
|
|
189
|
+
|
|
190
|
+
assert "| COMET_FULL_040_BETA | 1 |" in output
|
|
191
|
+
assert "| comet-fix-median | — | PASS | — |" in output
|
|
192
|
+
html = render_markdown_html(output, title="Comet Baseline Comparison Report")
|
|
193
|
+
assert "Task outcome matrix" in html
|
|
194
|
+
assert "N/A" in html
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def test_compare_report_includes_task_outcome_table(tmp_path: Path):
|
|
198
|
+
experiment = tmp_path / "experiment"
|
|
199
|
+
reports = experiment / "reports"
|
|
200
|
+
reports.mkdir(parents=True)
|
|
201
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
202
|
+
_write_report(reports, "COMET_FULL_040_BETA", 200, 0.02)
|
|
203
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03, passed=False)
|
|
204
|
+
|
|
205
|
+
report = build_report(experiment)
|
|
206
|
+
|
|
207
|
+
assert "## Task outcomes" in report
|
|
208
|
+
assert "| Task | CONTROL | COMET_FULL_040_BETA | COMET_FULL_039 |" in report
|
|
209
|
+
assert "| comet-fix-median | PASS | PASS | FAIL |" in report
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
def test_compare_report_splits_pass_metrics_by_business_and_workflow(tmp_path: Path):
|
|
213
|
+
experiment = tmp_path / "experiment"
|
|
214
|
+
reports = experiment / "reports"
|
|
215
|
+
reports.mkdir(parents=True)
|
|
216
|
+
|
|
217
|
+
def write_run(
|
|
218
|
+
filename: str,
|
|
219
|
+
*,
|
|
220
|
+
treatment: str,
|
|
221
|
+
business_score: float,
|
|
222
|
+
workflow_score: float | None,
|
|
223
|
+
passed: bool,
|
|
224
|
+
):
|
|
225
|
+
checks = [f"[RUBRIC] business_completion: {business_score:.2f} - demo"]
|
|
226
|
+
if workflow_score is None:
|
|
227
|
+
checks.append("[RUBRIC] workflow_completion: N/A - CONTROL business-only baseline")
|
|
228
|
+
else:
|
|
229
|
+
checks.append(f"[RUBRIC] workflow_completion: {workflow_score:.2f} - demo")
|
|
230
|
+
report = {
|
|
231
|
+
"name": f"comet-fix-median-{treatment}",
|
|
232
|
+
"passed": passed,
|
|
233
|
+
"checks_passed": checks,
|
|
234
|
+
"checks_failed": [] if passed else ["validator failed"],
|
|
235
|
+
"events_summary": {},
|
|
236
|
+
}
|
|
237
|
+
(reports / filename).write_text(json.dumps(report), encoding="utf-8")
|
|
238
|
+
|
|
239
|
+
write_run(
|
|
240
|
+
"control_1.json",
|
|
241
|
+
treatment="CONTROL",
|
|
242
|
+
business_score=1.0,
|
|
243
|
+
workflow_score=None,
|
|
244
|
+
passed=True,
|
|
245
|
+
)
|
|
246
|
+
write_run(
|
|
247
|
+
"control_2.json",
|
|
248
|
+
treatment="CONTROL",
|
|
249
|
+
business_score=0.0,
|
|
250
|
+
workflow_score=None,
|
|
251
|
+
passed=False,
|
|
252
|
+
)
|
|
253
|
+
write_run(
|
|
254
|
+
"workflow_1.json",
|
|
255
|
+
treatment="COMET_FULL_040_BETA",
|
|
256
|
+
business_score=1.0,
|
|
257
|
+
workflow_score=1.0,
|
|
258
|
+
passed=True,
|
|
259
|
+
)
|
|
260
|
+
write_run(
|
|
261
|
+
"workflow_2.json",
|
|
262
|
+
treatment="COMET_FULL_040_BETA",
|
|
263
|
+
business_score=1.0,
|
|
264
|
+
workflow_score=0.0,
|
|
265
|
+
passed=False,
|
|
266
|
+
)
|
|
267
|
+
write_run(
|
|
268
|
+
"baseline_1.json",
|
|
269
|
+
treatment="COMET_FULL_039",
|
|
270
|
+
business_score=1.0,
|
|
271
|
+
workflow_score=1.0,
|
|
272
|
+
passed=True,
|
|
273
|
+
)
|
|
274
|
+
write_run(
|
|
275
|
+
"baseline_2.json",
|
|
276
|
+
treatment="COMET_FULL_039",
|
|
277
|
+
business_score=1.0,
|
|
278
|
+
workflow_score=1.0,
|
|
279
|
+
passed=True,
|
|
280
|
+
)
|
|
281
|
+
|
|
282
|
+
report = build_report(experiment)
|
|
283
|
+
|
|
284
|
+
assert "| Metric | Treatment | pass@1 | pass@2 | pass^1 | pass^2 | pass/fail |" in report
|
|
285
|
+
assert "| overall | COMET_FULL_040_BETA | 0.50 | 1.00 | 0 | 0 | 1/2 |" in report
|
|
286
|
+
assert "| business | COMET_FULL_040_BETA | 1.00 | 1.00 | 1 | 1 | 2/2 |" in report
|
|
287
|
+
assert "| workflow | CONTROL | / | / | / | / | / |" in report
|
|
288
|
+
assert "| workflow | COMET_FULL_040_BETA | 0.50 | 1.00 | 0 | 0 | 1/2 |" in report
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
def test_compare_report_includes_pass_at_3_when_three_runs_exist(tmp_path: Path):
|
|
292
|
+
experiment = tmp_path / "experiment"
|
|
293
|
+
reports = experiment / "reports"
|
|
294
|
+
reports.mkdir(parents=True)
|
|
295
|
+
|
|
296
|
+
for rep, passed in enumerate((True, False, False), start=1):
|
|
297
|
+
_write_report(reports, f"CONTROL-r{rep}", 100, 0.01, passed=passed)
|
|
298
|
+
for rep, passed in enumerate((True, True, False), start=1):
|
|
299
|
+
_write_report(reports, f"COMET_FULL_040_BETA-r{rep}", 200, 0.02, passed=passed)
|
|
300
|
+
for rep, passed in enumerate((True, True, True), start=1):
|
|
301
|
+
_write_report(reports, f"COMET_FULL_039-r{rep}", 300, 0.03, passed=passed)
|
|
302
|
+
|
|
303
|
+
report = build_report(experiment)
|
|
304
|
+
|
|
305
|
+
assert (
|
|
306
|
+
"| Metric | Treatment | pass@1 | pass@2 | pass@3 | pass^1 | pass^2 | pass^3 | pass/fail |"
|
|
307
|
+
in report
|
|
308
|
+
)
|
|
309
|
+
assert "| overall | CONTROL | 0.33 | 0.67 | 1.00 | 0 | 0 | 0 | 1/3 |" in report
|
|
310
|
+
assert "| overall | COMET_FULL_040_BETA | 0.67 | 1.00 | 1.00 | 0 | 0 | 0 | 2/3 |" in report
|
|
311
|
+
assert "| overall | COMET_FULL_039 | 1.00 | 1.00 | 1.00 | 1 | 1 | 1 | 3/3 |" in report
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
def test_compare_report_honors_html_report_output_config(monkeypatch, tmp_path: Path):
|
|
315
|
+
monkeypatch.setenv("BENCH_LOGS_DIR", str(tmp_path))
|
|
316
|
+
experiment = tmp_path / "experiments" / "exp1"
|
|
317
|
+
reports = experiment / "reports"
|
|
318
|
+
reports.mkdir(parents=True)
|
|
319
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
320
|
+
_write_report(reports, "COMET_FULL_040_BETA", 200, 0.02)
|
|
321
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
322
|
+
config = tmp_path / "report-config.json"
|
|
323
|
+
config.write_text(json.dumps({"report_outputs": {"markdown": False, "html": True}}))
|
|
324
|
+
|
|
325
|
+
result = main(["--experiment", "exp1", "--report-config", str(config)])
|
|
326
|
+
|
|
327
|
+
assert result == 0
|
|
328
|
+
assert not (experiment / "comparison_report.md").exists()
|
|
329
|
+
html_report = experiment / "comparison_report.html"
|
|
330
|
+
assert html_report.exists()
|
|
331
|
+
html = html_report.read_text(encoding="utf-8")
|
|
332
|
+
assert "Comet Baseline Comparison Report" in html
|
|
333
|
+
assert "paper-figure" in html
|
|
334
|
+
assert 'data-chart-backend="python"' in html
|
|
335
|
+
assert "Rubric dimension deltas" in html
|
|
336
|
+
assert "Task outcome matrix" in html
|
|
337
|
+
assert "<svg" in html
|
|
338
|
+
assert "matplotlib" not in html.lower()
|
|
339
|
+
assert "chart.js" not in html.lower()
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
def test_html_report_falls_back_when_python_chart_backend_disabled(monkeypatch, tmp_path: Path):
|
|
343
|
+
monkeypatch.setenv("COMET_EVAL_REPORT_CHART_BACKEND", "inline")
|
|
344
|
+
experiment = tmp_path / "experiment"
|
|
345
|
+
reports = experiment / "reports"
|
|
346
|
+
reports.mkdir(parents=True)
|
|
347
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
348
|
+
_write_report(reports, "COMET_FULL_040_BETA", 200, 0.02)
|
|
349
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
350
|
+
|
|
351
|
+
markdown = build_report(experiment)
|
|
352
|
+
html = render_markdown_html(markdown, title="Comet Baseline Comparison Report")
|
|
353
|
+
|
|
354
|
+
assert 'data-chart-backend="inline-svg"' in html
|
|
355
|
+
assert "Task outcome matrix" in html
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
def test_compare_report_uses_structured_failure_attribution(tmp_path: Path):
|
|
359
|
+
experiment = tmp_path / "experiment"
|
|
360
|
+
reports = experiment / "reports"
|
|
361
|
+
reports.mkdir(parents=True)
|
|
362
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
363
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
364
|
+
workflow = {
|
|
365
|
+
"name": "comet-full-workflow-COMET_FULL_040_BETA",
|
|
366
|
+
"passed": False,
|
|
367
|
+
"checks_passed": [],
|
|
368
|
+
"checks_failed": ["Required skill not invoked: comet"],
|
|
369
|
+
"events_summary": {
|
|
370
|
+
"total_tokens": 200,
|
|
371
|
+
"total_cost_usd": 0.02,
|
|
372
|
+
"failure_attribution": [
|
|
373
|
+
{
|
|
374
|
+
"bucket": "harness",
|
|
375
|
+
"check": "Required skill not invoked: comet",
|
|
376
|
+
"reason": "target Skill was never invoked",
|
|
377
|
+
}
|
|
378
|
+
],
|
|
379
|
+
},
|
|
380
|
+
}
|
|
381
|
+
(reports / "COMET_FULL_040_BETA_report.json").write_text(json.dumps(workflow))
|
|
382
|
+
|
|
383
|
+
report = build_report(experiment)
|
|
384
|
+
|
|
385
|
+
assert "**harness**" in report
|
|
386
|
+
assert "[harness] target Skill was never invoked" in report
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
def test_compare_report_groups_repeated_failure_attribution(tmp_path: Path):
|
|
390
|
+
experiment = tmp_path / "experiment"
|
|
391
|
+
reports = experiment / "reports"
|
|
392
|
+
reports.mkdir(parents=True)
|
|
393
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
394
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
395
|
+
for index in range(2):
|
|
396
|
+
workflow = {
|
|
397
|
+
"name": f"comet-full-workflow-COMET_FULL_040_BETA-r{index}",
|
|
398
|
+
"passed": False,
|
|
399
|
+
"checks_passed": [],
|
|
400
|
+
"checks_failed": ["Required Superpowers dependency skill not invoked"],
|
|
401
|
+
"events_summary": {
|
|
402
|
+
"total_tokens": 200,
|
|
403
|
+
"total_cost_usd": 0.02,
|
|
404
|
+
"failure_attribution": [
|
|
405
|
+
{
|
|
406
|
+
"bucket": "workflow",
|
|
407
|
+
"check": "Required Superpowers dependency skill not invoked",
|
|
408
|
+
"reason": "Skill invocation contract failed",
|
|
409
|
+
}
|
|
410
|
+
],
|
|
411
|
+
},
|
|
412
|
+
}
|
|
413
|
+
(reports / f"COMET_FULL_040_BETA_{index}_report.json").write_text(
|
|
414
|
+
json.dumps(workflow)
|
|
415
|
+
)
|
|
416
|
+
|
|
417
|
+
report = build_report(experiment)
|
|
418
|
+
|
|
419
|
+
assert "- **workflow** (2):" in report
|
|
420
|
+
assert (
|
|
421
|
+
"x2 Required Superpowers dependency skill not invoked -> "
|
|
422
|
+
"[workflow] Skill invocation contract failed"
|
|
423
|
+
) in report
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
def test_compare_report_labels_failure_attribution_as_run_level_checks(tmp_path: Path):
|
|
427
|
+
experiment = tmp_path / "experiment"
|
|
428
|
+
reports = experiment / "reports"
|
|
429
|
+
reports.mkdir(parents=True)
|
|
430
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
431
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
432
|
+
_write_report(reports, "COMET_FULL_040_BETA", 200, 0.02, passed=False)
|
|
433
|
+
|
|
434
|
+
report = build_report(experiment)
|
|
435
|
+
html = render_markdown_html(report, title="Comet Baseline Comparison Report")
|
|
436
|
+
|
|
437
|
+
assert "## Run-level failed checks" in report
|
|
438
|
+
assert (
|
|
439
|
+
"These are sample-level `checks_failed` entries. They can coexist with "
|
|
440
|
+
"`workflow_completion == 1.00`, `pass@k == 1.00`, or a passing task outcome"
|
|
441
|
+
in report
|
|
442
|
+
)
|
|
443
|
+
assert "<h2>样本级失败检查</h2>" in html
|
|
444
|
+
assert "它们可以与 <code>workflow_completion == 1.00</code>、<code>pass@k == 1.00</code>" in html
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
def test_compare_report_lists_source_evidence(tmp_path: Path):
|
|
448
|
+
experiment = tmp_path / "experiment"
|
|
449
|
+
reports = experiment / "reports"
|
|
450
|
+
reports.mkdir(parents=True)
|
|
451
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
452
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
453
|
+
workflow = {
|
|
454
|
+
"name": "comet-full-workflow-COMET_FULL_040_BETA",
|
|
455
|
+
"passed": True,
|
|
456
|
+
"run_id": "run-123",
|
|
457
|
+
"checks_passed": ["[RUBRIC] weighted_score: 1.00 - ok"],
|
|
458
|
+
"checks_failed": [],
|
|
459
|
+
"events_summary": {
|
|
460
|
+
"profile": "comet-workflow",
|
|
461
|
+
"skill_sources": [{"name": "comet", "hash": "sha256:abc"}],
|
|
462
|
+
"eval_manifest": "demo/comet/eval.yaml",
|
|
463
|
+
"artifact_references": {"report": "reports/COMET_FULL_040_BETA_report.json"},
|
|
464
|
+
"total_tokens": 200,
|
|
465
|
+
"total_cost_usd": 0.02,
|
|
466
|
+
},
|
|
467
|
+
}
|
|
468
|
+
(reports / "COMET_FULL_040_BETA_report.json").write_text(json.dumps(workflow))
|
|
469
|
+
|
|
470
|
+
report = build_report(experiment)
|
|
471
|
+
|
|
472
|
+
assert "## Source evidence" in report
|
|
473
|
+
assert "Use this section to trace each aggregate metric back to the raw run artifacts." in report
|
|
474
|
+
assert "`Quality` is the sample-quality status used by the analysis-set filter." in report
|
|
475
|
+
assert "`Skill sources` records installed Skill identity or hash evidence when the run provides it." in report
|
|
476
|
+
assert "`run-123`" in report
|
|
477
|
+
assert "comet-workflow" in report
|
|
478
|
+
assert "sha256:abc" in report
|
|
479
|
+
assert "reports/COMET_FULL_040_BETA_report.json" in report
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
def test_compare_report_overall_uses_weighted_score(tmp_path: Path):
|
|
483
|
+
experiment = tmp_path / "experiment"
|
|
484
|
+
reports = experiment / "reports"
|
|
485
|
+
reports.mkdir(parents=True)
|
|
486
|
+
|
|
487
|
+
workflow = {
|
|
488
|
+
"name": "comet-full-workflow-COMET_FULL_040_BETA",
|
|
489
|
+
"passed": True,
|
|
490
|
+
"checks_passed": [
|
|
491
|
+
"[RUBRIC] main_flow: 1.00 - ok",
|
|
492
|
+
"[RUBRIC] gate_guard: 1.00 - ok",
|
|
493
|
+
"[RUBRIC] skill_invocation: 1.00 - ok",
|
|
494
|
+
"[RUBRIC] spec_drift: 1.00 - ok",
|
|
495
|
+
"[RUBRIC] business_completion: 1.00 - ok",
|
|
496
|
+
"[RUBRIC] workflow_completion: 1.00 - ok",
|
|
497
|
+
"[RUBRIC] efficiency: 1.00 - ok",
|
|
498
|
+
"[RUBRIC] decision_point_compliance: 1.00 - ok",
|
|
499
|
+
"[RUBRIC] artifact_quality: 1.00 - ok",
|
|
500
|
+
"[RUBRIC] recovery_resilience: 1.00 - ok",
|
|
501
|
+
"[RUBRIC] weighted_score: 0.25",
|
|
502
|
+
],
|
|
503
|
+
"checks_failed": [],
|
|
504
|
+
"events_summary": {},
|
|
505
|
+
}
|
|
506
|
+
baseline = {
|
|
507
|
+
"name": "comet-full-workflow-COMET_FULL_039",
|
|
508
|
+
"passed": True,
|
|
509
|
+
"checks_passed": [
|
|
510
|
+
"[RUBRIC] main_flow: 0.00 - missing",
|
|
511
|
+
"[RUBRIC] gate_guard: 0.00 - missing",
|
|
512
|
+
"[RUBRIC] skill_invocation: 0.00 - missing",
|
|
513
|
+
"[RUBRIC] spec_drift: 0.00 - missing",
|
|
514
|
+
"[RUBRIC] business_completion: 0.00 - missing",
|
|
515
|
+
"[RUBRIC] workflow_completion: 0.00 - missing",
|
|
516
|
+
"[RUBRIC] efficiency: 0.00 - missing",
|
|
517
|
+
"[RUBRIC] decision_point_compliance: 0.00 - missing",
|
|
518
|
+
"[RUBRIC] artifact_quality: 0.00 - missing",
|
|
519
|
+
"[RUBRIC] recovery_resilience: 0.00 - missing",
|
|
520
|
+
"[RUBRIC] weighted_score: 0.75",
|
|
521
|
+
],
|
|
522
|
+
"checks_failed": [],
|
|
523
|
+
"events_summary": {},
|
|
524
|
+
}
|
|
525
|
+
(reports / "workflow_report.json").write_text(json.dumps(workflow))
|
|
526
|
+
(reports / "baseline_report.json").write_text(json.dumps(baseline))
|
|
527
|
+
|
|
528
|
+
report = build_report(experiment)
|
|
529
|
+
|
|
530
|
+
assert "| **Overall** | — | 0.25 | 0.75 | -0.50 |" in report
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
def test_compare_report_marks_control_workflow_dimensions_with_slash(tmp_path: Path):
|
|
534
|
+
experiment = tmp_path / "experiment"
|
|
535
|
+
reports = experiment / "reports"
|
|
536
|
+
reports.mkdir(parents=True)
|
|
537
|
+
|
|
538
|
+
control = {
|
|
539
|
+
"name": "comet-full-workflow-CONTROL",
|
|
540
|
+
"passed": True,
|
|
541
|
+
"checks_passed": [
|
|
542
|
+
"[RUBRIC] main_flow: N/A - CONTROL business-only baseline",
|
|
543
|
+
"[RUBRIC] gate_guard: N/A - CONTROL business-only baseline",
|
|
544
|
+
"[RUBRIC] skill_invocation: N/A - CONTROL business-only baseline",
|
|
545
|
+
"[RUBRIC] spec_drift: N/A - CONTROL business-only baseline",
|
|
546
|
+
"[RUBRIC] business_completion: 1.00 - ok",
|
|
547
|
+
"[RUBRIC] workflow_completion: N/A - CONTROL business-only baseline",
|
|
548
|
+
"[RUBRIC] efficiency: 1.00 - ok",
|
|
549
|
+
"[RUBRIC] weighted_score: 1.00",
|
|
550
|
+
],
|
|
551
|
+
"checks_failed": [],
|
|
552
|
+
"events_summary": {},
|
|
553
|
+
}
|
|
554
|
+
workflow = {
|
|
555
|
+
"name": "comet-full-workflow-COMET_FULL_040_BETA",
|
|
556
|
+
"passed": True,
|
|
557
|
+
"checks_passed": [
|
|
558
|
+
"[RUBRIC] main_flow: 1.00 - ok",
|
|
559
|
+
"[RUBRIC] gate_guard: 1.00 - ok",
|
|
560
|
+
"[RUBRIC] skill_invocation: 1.00 - ok",
|
|
561
|
+
"[RUBRIC] spec_drift: 1.00 - ok",
|
|
562
|
+
"[RUBRIC] business_completion: 1.00 - ok",
|
|
563
|
+
"[RUBRIC] workflow_completion: 1.00 - ok",
|
|
564
|
+
"[RUBRIC] efficiency: 1.00 - ok",
|
|
565
|
+
"[RUBRIC] weighted_score: 1.00",
|
|
566
|
+
],
|
|
567
|
+
"checks_failed": [],
|
|
568
|
+
"events_summary": {},
|
|
569
|
+
}
|
|
570
|
+
baseline = dict(workflow, name="comet-full-workflow-COMET_FULL_039")
|
|
571
|
+
(reports / "control_report.json").write_text(json.dumps(control))
|
|
572
|
+
(reports / "workflow_report.json").write_text(json.dumps(workflow))
|
|
573
|
+
(reports / "baseline_report.json").write_text(json.dumps(baseline))
|
|
574
|
+
|
|
575
|
+
report = build_report(experiment)
|
|
576
|
+
|
|
577
|
+
assert "| main_flow | / | 1.00 | 1.00 | +0.00 |" in report
|
|
578
|
+
assert "| skill_invocation | / | 1.00 | 1.00 | +0.00 |" in report
|
|
579
|
+
assert "| business_completion | 1.00 | 1.00 | 1.00 | +0.00 |" in report
|
|
580
|
+
assert "| workflow_completion | / | 1.00 | 1.00 | +0.00 |" in report
|
|
581
|
+
assert "| completion |" not in report
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
def test_compare_report_excludes_hard_noise_from_analysis_metrics(tmp_path: Path):
|
|
585
|
+
experiment = tmp_path / "experiment"
|
|
586
|
+
reports = experiment / "reports"
|
|
587
|
+
reports.mkdir(parents=True)
|
|
588
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
589
|
+
_write_quality_report(
|
|
590
|
+
reports,
|
|
591
|
+
"workflow_clean",
|
|
592
|
+
name="comet-fix-median-COMET_FULL_040_BETA",
|
|
593
|
+
weighted_score=1.0,
|
|
594
|
+
tokens=200,
|
|
595
|
+
cost=0.02,
|
|
596
|
+
sample_quality={
|
|
597
|
+
"status": "included",
|
|
598
|
+
"reason_code": "valid_signal",
|
|
599
|
+
"reason": "clean",
|
|
600
|
+
"include_in_analysis": True,
|
|
601
|
+
"confidence": "high",
|
|
602
|
+
"evidence": ["result event present"],
|
|
603
|
+
},
|
|
604
|
+
)
|
|
605
|
+
_write_quality_report(
|
|
606
|
+
reports,
|
|
607
|
+
"workflow_timeout",
|
|
608
|
+
name="comet-fix-median-COMET_FULL_040_BETA-r1",
|
|
609
|
+
weighted_score=0.0,
|
|
610
|
+
tokens=999,
|
|
611
|
+
cost=9.99,
|
|
612
|
+
sample_quality={
|
|
613
|
+
"status": "excluded",
|
|
614
|
+
"reason_code": "api_timeout",
|
|
615
|
+
"reason": "timeout",
|
|
616
|
+
"include_in_analysis": False,
|
|
617
|
+
"confidence": "high",
|
|
618
|
+
"evidence": ["stderr timeout"],
|
|
619
|
+
},
|
|
620
|
+
passed=False,
|
|
621
|
+
)
|
|
622
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
623
|
+
|
|
624
|
+
report = build_report(experiment)
|
|
625
|
+
|
|
626
|
+
assert "## Data quality summary" in report
|
|
627
|
+
assert "| COMET_FULL_040_BETA | 2 | 1 | 0 | 1 |" in report
|
|
628
|
+
assert "| COMET_FULL_040_BETA | 1 |" in report
|
|
629
|
+
assert "| COMET_FULL_040_BETA | 1 | 200 | $0.0200 | 200 | $0.0200 |" in report
|
|
630
|
+
assert "workflow_timeout" in report
|
|
631
|
+
assert "api_timeout" in report
|
|
632
|
+
assert "999" not in report.split("## Spend summary", 1)[1].split("## Source evidence", 1)[0]
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
def test_compare_report_lists_flagged_runs_without_excluding_them(tmp_path: Path):
|
|
636
|
+
experiment = tmp_path / "experiment"
|
|
637
|
+
reports = experiment / "reports"
|
|
638
|
+
reports.mkdir(parents=True)
|
|
639
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
640
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
641
|
+
_write_quality_report(
|
|
642
|
+
reports,
|
|
643
|
+
"workflow_flagged",
|
|
644
|
+
name="comet-full-workflow-COMET_FULL_040_BETA",
|
|
645
|
+
weighted_score=0.5,
|
|
646
|
+
tokens=200,
|
|
647
|
+
cost=0.02,
|
|
648
|
+
sample_quality={
|
|
649
|
+
"status": "flagged",
|
|
650
|
+
"reason_code": "harness_trigger_suspect",
|
|
651
|
+
"reason": "target Skill may not have been triggered",
|
|
652
|
+
"include_in_analysis": True,
|
|
653
|
+
"confidence": "medium",
|
|
654
|
+
"evidence": ["target Skill was never invoked"],
|
|
655
|
+
},
|
|
656
|
+
)
|
|
657
|
+
|
|
658
|
+
report = build_report(experiment)
|
|
659
|
+
|
|
660
|
+
assert "## Flagged runs" in report
|
|
661
|
+
assert "harness_trigger_suspect" in report
|
|
662
|
+
assert "| Treatment | Raw runs | Analysis set | Flagged | Excluded |" in report
|
|
663
|
+
assert "| COMET_FULL_040_BETA | 1 | 1 | 1 | 0 |" in report
|
|
664
|
+
assert "| COMET_FULL_040_BETA | 1 | 200 | $0.0200 | 200 | $0.0200 |" in report
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
def test_compare_report_summarizes_multiline_loop_evidence(tmp_path: Path):
|
|
668
|
+
experiment = tmp_path / "experiment"
|
|
669
|
+
reports = experiment / "reports"
|
|
670
|
+
reports.mkdir(parents=True)
|
|
671
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
672
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
673
|
+
_write_quality_report(
|
|
674
|
+
reports,
|
|
675
|
+
"workflow_flagged",
|
|
676
|
+
name="comet-full-workflow-COMET_FULL_040_BETA",
|
|
677
|
+
weighted_score=0.5,
|
|
678
|
+
tokens=200,
|
|
679
|
+
cost=0.02,
|
|
680
|
+
sample_quality={
|
|
681
|
+
"status": "flagged",
|
|
682
|
+
"reason_code": "completed_run_mentions_outer_failure",
|
|
683
|
+
"reason": "completed with suspicious runner output",
|
|
684
|
+
"include_in_analysis": True,
|
|
685
|
+
"confidence": "medium",
|
|
686
|
+
"evidence": [
|
|
687
|
+
"[loop] turn 1/12\n"
|
|
688
|
+
"[loop] decision point detected; simulating user reply\n"
|
|
689
|
+
"[loop] simulated reply (42 chars)\n"
|
|
690
|
+
"[loop] turn 2/12\n"
|
|
691
|
+
"[loop] workflow appears complete; ending\n"
|
|
692
|
+
"[loop] finished after 2 turns"
|
|
693
|
+
],
|
|
694
|
+
},
|
|
695
|
+
)
|
|
696
|
+
|
|
697
|
+
report = build_report(experiment)
|
|
698
|
+
|
|
699
|
+
assert "loop trace: 2 turns; 1 simulated decision reply; see report JSON for full evidence" in report
|
|
700
|
+
flagged_section = report.split("## Flagged runs", 1)[1].split("## Raw vs analysis", 1)[0]
|
|
701
|
+
assert "[loop] decision point detected" not in flagged_section
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
def test_compare_report_reports_insufficient_clean_data(tmp_path: Path):
|
|
705
|
+
experiment = tmp_path / "experiment"
|
|
706
|
+
reports = experiment / "reports"
|
|
707
|
+
reports.mkdir(parents=True)
|
|
708
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
709
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
710
|
+
_write_quality_report(
|
|
711
|
+
reports,
|
|
712
|
+
"workflow_timeout",
|
|
713
|
+
name="comet-full-workflow-COMET_FULL_040_BETA",
|
|
714
|
+
weighted_score=0.0,
|
|
715
|
+
tokens=999,
|
|
716
|
+
cost=9.99,
|
|
717
|
+
sample_quality={
|
|
718
|
+
"status": "excluded",
|
|
719
|
+
"reason_code": "runner_timeout",
|
|
720
|
+
"reason": "timeout",
|
|
721
|
+
"include_in_analysis": False,
|
|
722
|
+
"confidence": "high",
|
|
723
|
+
"evidence": ["Timeout after 600s"],
|
|
724
|
+
},
|
|
725
|
+
passed=False,
|
|
726
|
+
)
|
|
727
|
+
|
|
728
|
+
report = build_report(experiment)
|
|
729
|
+
|
|
730
|
+
assert "Insufficient clean data" in report
|
|
731
|
+
assert "COMET_FULL_040_BETA" in report
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
def test_compare_report_keeps_data_quality_sections_when_all_key_runs_are_excluded(tmp_path: Path):
|
|
735
|
+
experiment = tmp_path / "experiment"
|
|
736
|
+
reports = experiment / "reports"
|
|
737
|
+
reports.mkdir(parents=True)
|
|
738
|
+
_write_quality_report(
|
|
739
|
+
reports,
|
|
740
|
+
"workflow_timeout",
|
|
741
|
+
name="comet-full-workflow-COMET_FULL_040_BETA",
|
|
742
|
+
weighted_score=0.0,
|
|
743
|
+
tokens=999,
|
|
744
|
+
cost=9.99,
|
|
745
|
+
sample_quality={
|
|
746
|
+
"status": "excluded",
|
|
747
|
+
"reason_code": "runner_timeout",
|
|
748
|
+
"reason": "timeout",
|
|
749
|
+
"include_in_analysis": False,
|
|
750
|
+
"confidence": "high",
|
|
751
|
+
"evidence": ["Timeout after 600s"],
|
|
752
|
+
},
|
|
753
|
+
passed=False,
|
|
754
|
+
)
|
|
755
|
+
_write_quality_report(
|
|
756
|
+
reports,
|
|
757
|
+
"baseline_timeout",
|
|
758
|
+
name="comet-full-workflow-COMET_FULL_039",
|
|
759
|
+
weighted_score=0.0,
|
|
760
|
+
tokens=888,
|
|
761
|
+
cost=8.88,
|
|
762
|
+
sample_quality={
|
|
763
|
+
"status": "excluded",
|
|
764
|
+
"reason_code": "api_timeout",
|
|
765
|
+
"reason": "timeout",
|
|
766
|
+
"include_in_analysis": False,
|
|
767
|
+
"confidence": "high",
|
|
768
|
+
"evidence": ["stderr timeout"],
|
|
769
|
+
},
|
|
770
|
+
passed=False,
|
|
771
|
+
)
|
|
772
|
+
|
|
773
|
+
report = build_report(experiment)
|
|
774
|
+
|
|
775
|
+
assert "## Data quality summary" in report
|
|
776
|
+
assert "## Excluded runs" in report
|
|
777
|
+
assert "## Source evidence" in report
|
|
778
|
+
assert "Insufficient clean data" in report
|
|
779
|
+
assert "No report data found" not in report
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
def test_html_report_includes_data_quality_summary(tmp_path: Path):
|
|
783
|
+
experiment = tmp_path / "experiment"
|
|
784
|
+
reports = experiment / "reports"
|
|
785
|
+
reports.mkdir(parents=True)
|
|
786
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
787
|
+
_write_report(reports, "COMET_FULL_040_BETA", 200, 0.02)
|
|
788
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
789
|
+
|
|
790
|
+
markdown = build_report(experiment)
|
|
791
|
+
html = render_markdown_html(markdown, title="Comet Baseline Comparison Report")
|
|
792
|
+
|
|
793
|
+
assert "Data quality summary" in html
|
|
794
|
+
assert "paper-figure" in html
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
def test_html_report_wraps_wide_evidence_tables(tmp_path: Path):
|
|
798
|
+
experiment = tmp_path / "experiment"
|
|
799
|
+
reports = experiment / "reports"
|
|
800
|
+
reports.mkdir(parents=True)
|
|
801
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
802
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
803
|
+
_write_quality_report(
|
|
804
|
+
reports,
|
|
805
|
+
"workflow_flagged",
|
|
806
|
+
name="comet-full-workflow-COMET_FULL_040_BETA",
|
|
807
|
+
weighted_score=0.5,
|
|
808
|
+
tokens=200,
|
|
809
|
+
cost=0.02,
|
|
810
|
+
sample_quality={
|
|
811
|
+
"status": "flagged",
|
|
812
|
+
"reason_code": "completed_run_mentions_outer_failure",
|
|
813
|
+
"reason": "completed with suspicious runner output",
|
|
814
|
+
"include_in_analysis": True,
|
|
815
|
+
"confidence": "medium",
|
|
816
|
+
"evidence": ["a-very-long-evidence-token-without-natural-breaks-" * 8],
|
|
817
|
+
},
|
|
818
|
+
)
|
|
819
|
+
|
|
820
|
+
markdown = build_report(experiment)
|
|
821
|
+
html = render_markdown_html(markdown, title="Comet Baseline Comparison Report")
|
|
822
|
+
|
|
823
|
+
assert 'class="table-scroll"' in html
|
|
824
|
+
assert 'class="col-evidence"' in html
|
|
825
|
+
assert 'class="col-report"' in html
|
|
826
|
+
assert "overflow-wrap: anywhere" in html
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
def test_html_report_includes_bilingual_language_toggle(tmp_path: Path):
|
|
830
|
+
experiment = tmp_path / "experiment"
|
|
831
|
+
reports = experiment / "reports"
|
|
832
|
+
reports.mkdir(parents=True)
|
|
833
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
834
|
+
_write_report(reports, "COMET_FULL_040_BETA", 200, 0.02)
|
|
835
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
836
|
+
|
|
837
|
+
markdown = build_report(experiment)
|
|
838
|
+
html = render_markdown_html(markdown, title="Comet Baseline Comparison Report")
|
|
839
|
+
|
|
840
|
+
assert '<html lang="zh-CN" data-lang="zh">' in html
|
|
841
|
+
assert 'class="language-toggle"' in html
|
|
842
|
+
assert 'data-set-lang="zh"' in html
|
|
843
|
+
assert 'data-set-lang="en"' in html
|
|
844
|
+
assert 'data-locale="zh"' in html
|
|
845
|
+
assert 'data-locale="en"' in html
|
|
846
|
+
assert "Comet 基线对比报告" in html
|
|
847
|
+
assert "Comet Baseline Comparison Report" in html
|
|
848
|
+
assert "pass@k / pass^k — 能力上限 vs 可靠性下限" in html
|
|
849
|
+
assert "指标说明" in html
|
|
850
|
+
assert "运行摘要" in html
|
|
851
|
+
assert "业务 validator 通过率" in html
|
|
852
|
+
|
|
853
|
+
|
|
854
|
+
def test_html_report_uses_conference_paper_layout(tmp_path: Path):
|
|
855
|
+
experiment = tmp_path / "experiment"
|
|
856
|
+
reports = experiment / "reports"
|
|
857
|
+
reports.mkdir(parents=True)
|
|
858
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
859
|
+
_write_report(reports, "COMET_FULL_040_BETA", 200, 0.02)
|
|
860
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
861
|
+
|
|
862
|
+
markdown = build_report(experiment)
|
|
863
|
+
html = render_markdown_html(markdown, title="Comet Baseline Comparison Report")
|
|
864
|
+
|
|
865
|
+
assert "--page-width: 980px;" in html
|
|
866
|
+
assert "linear-gradient(90deg" not in html
|
|
867
|
+
assert "box-shadow: none;" in html
|
|
868
|
+
assert "border-top: 2px solid var(--ink);" in html
|
|
869
|
+
assert html.index("<h1>Comet 基线对比报告</h1>") < html.index('class="paper-figures"')
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
def test_html_report_includes_paper_abstract_and_centers_figures(tmp_path: Path):
|
|
873
|
+
experiment = tmp_path / "experiment"
|
|
874
|
+
reports = experiment / "reports"
|
|
875
|
+
reports.mkdir(parents=True)
|
|
876
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
877
|
+
_write_report(reports, "COMET_FULL_040_BETA", 200, 0.02)
|
|
878
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
879
|
+
|
|
880
|
+
markdown = build_report(experiment)
|
|
881
|
+
html = render_markdown_html(markdown, title="Comet Baseline Comparison Report")
|
|
882
|
+
|
|
883
|
+
assert '<section class="paper-abstract">' in html
|
|
884
|
+
assert "<strong>Abstract.</strong>" in html
|
|
885
|
+
assert "<strong>摘要。</strong>" in html
|
|
886
|
+
assert "justify-items: center;" in html
|
|
887
|
+
assert "margin-left: auto;" in html
|
|
888
|
+
assert "margin-right: auto;" in html
|
|
889
|
+
assert html.index("<h1>Comet 基线对比报告</h1>") < html.index('<section class="paper-abstract">')
|
|
890
|
+
assert html.index('<section class="paper-abstract">') < html.index('class="paper-figures"')
|
|
891
|
+
|
|
892
|
+
|
|
893
|
+
def test_html_report_centers_markdown_tables(tmp_path: Path):
|
|
894
|
+
experiment = tmp_path / "experiment"
|
|
895
|
+
reports = experiment / "reports"
|
|
896
|
+
reports.mkdir(parents=True)
|
|
897
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
898
|
+
_write_report(reports, "COMET_FULL_040_BETA", 200, 0.02)
|
|
899
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
900
|
+
|
|
901
|
+
markdown = build_report(experiment)
|
|
902
|
+
html = render_markdown_html(markdown, title="Comet Baseline Comparison Report")
|
|
903
|
+
|
|
904
|
+
assert "width: max-content;" in html
|
|
905
|
+
assert "max-width: 100%;" in html
|
|
906
|
+
assert "margin: 0 auto 1rem;" in html
|
|
907
|
+
assert "margin: 0 auto;" in html
|
|
908
|
+
assert "text-align: center;" in html
|
|
909
|
+
assert ".col-task," in html
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
def test_html_report_renders_localized_emphasis_without_literal_underscore_markers(tmp_path: Path):
|
|
913
|
+
experiment = tmp_path / "experiment"
|
|
914
|
+
reports = experiment / "reports"
|
|
915
|
+
reports.mkdir(parents=True)
|
|
916
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
917
|
+
_write_report(reports, "COMET_FULL_040_BETA", 200, 0.02)
|
|
918
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
919
|
+
|
|
920
|
+
markdown = build_report(experiment)
|
|
921
|
+
html = render_markdown_html(markdown, title="Comet Baseline Comparison Report")
|
|
922
|
+
|
|
923
|
+
assert "<p>_分数是二值通过率" not in html
|
|
924
|
+
assert "权重见下方)。_</p>" not in html
|
|
925
|
+
assert "<p><em>分数是二值通过率" in html
|
|
926
|
+
assert "weighted_score" in html
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
def test_html_report_keeps_chinese_chart_text_utf8(tmp_path: Path):
|
|
930
|
+
experiment = tmp_path / "experiment"
|
|
931
|
+
reports = experiment / "reports"
|
|
932
|
+
reports.mkdir(parents=True)
|
|
933
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
934
|
+
_write_report(reports, "COMET_FULL_040_BETA", 200, 0.02)
|
|
935
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
936
|
+
|
|
937
|
+
markdown = build_report(experiment)
|
|
938
|
+
html = render_markdown_html(markdown, title="Comet Baseline Comparison Report")
|
|
939
|
+
|
|
940
|
+
assert "图 1. Rubric 维度差异" in html
|
|
941
|
+
assert "图 3. 任务结果矩阵" in html
|
|
942
|
+
assert "ͼ 1." not in html
|
|
943
|
+
assert "����" not in html
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
def test_html_report_localizes_failure_attribution_in_chinese_layer(tmp_path: Path):
|
|
947
|
+
experiment = tmp_path / "experiment"
|
|
948
|
+
reports = experiment / "reports"
|
|
949
|
+
reports.mkdir(parents=True)
|
|
950
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
951
|
+
control = {
|
|
952
|
+
"name": "comet-fix-median-CONTROL",
|
|
953
|
+
"passed": False,
|
|
954
|
+
"checks_passed": [],
|
|
955
|
+
"checks_failed": ["business validator failed"],
|
|
956
|
+
"events_summary": {},
|
|
957
|
+
}
|
|
958
|
+
workflow = {
|
|
959
|
+
"name": "comet-fix-median-COMET_FULL_040_BETA",
|
|
960
|
+
"passed": False,
|
|
961
|
+
"checks_passed": [],
|
|
962
|
+
"checks_failed": ["workflow validator failed"],
|
|
963
|
+
"events_summary": {},
|
|
964
|
+
}
|
|
965
|
+
(reports / "control_report.json").write_text(json.dumps(control), encoding="utf-8")
|
|
966
|
+
(reports / "workflow_report.json").write_text(json.dumps(workflow), encoding="utf-8")
|
|
967
|
+
|
|
968
|
+
markdown = build_report(experiment)
|
|
969
|
+
html = render_markdown_html(markdown, title="Comet Baseline Comparison Report")
|
|
970
|
+
zh = html.split('<section class="localized" data-locale="zh"', 1)[1].split(
|
|
971
|
+
'<section class="localized" data-locale="en"',
|
|
972
|
+
1,
|
|
973
|
+
)[0]
|
|
974
|
+
|
|
975
|
+
assert "CONTROL(1 个失败)" in zh
|
|
976
|
+
assert "business/业务" in zh
|
|
977
|
+
assert "业务实现未通过" in zh
|
|
978
|
+
assert "workflow/流程" in zh
|
|
979
|
+
assert "Workflow 验证未通过" in zh
|
|
980
|
+
assert "model/模型" not in zh
|
|
981
|
+
assert "unclassified failure" not in zh
|
|
982
|
+
assert "failure(s)" not in zh
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
def test_html_report_renders_markdown_emphasis_without_literal_underscores(tmp_path: Path):
|
|
986
|
+
experiment = tmp_path / "experiment"
|
|
987
|
+
reports = experiment / "reports"
|
|
988
|
+
reports.mkdir(parents=True)
|
|
989
|
+
_write_report(reports, "CONTROL", 100, 0.01)
|
|
990
|
+
_write_report(reports, "COMET_FULL_040_BETA", 200, 0.02)
|
|
991
|
+
_write_report(reports, "COMET_FULL_039", 300, 0.03)
|
|
992
|
+
|
|
993
|
+
markdown = build_report(experiment)
|
|
994
|
+
html = render_markdown_html(markdown, title="Comet Baseline Comparison Report")
|
|
995
|
+
|
|
996
|
+
assert "<em>仅统计分析集;已排除的硬噪声运行不会进入统计。</em>" in html
|
|
997
|
+
assert "<em>Analysis set only; excluded hard-noise runs are omitted.</em>" in html
|
|
998
|
+
assert "<p>_仅统计分析集" not in html
|
|
999
|
+
assert "<p>_Analysis set only" not in html
|