dsh-compound-engineering 0.0.0-stage → 0.1.0
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 -0
- package/README.md +160 -2
- package/README.zh.md +161 -0
- package/cordis.patch.yml +6 -0
- package/lib/frontmatter.js +167 -0
- package/lib/index.js +46 -0
- package/lib/provider.js +201 -0
- package/package.json +62 -4
- package/skills/CODING_STANDARDS.md +68 -0
- package/skills/ce-babysit-pr/SKILL.md +59 -0
- package/skills/ce-babysit-pr/references/branch-currency.md +22 -0
- package/skills/ce-babysit-pr/references/envelope.md +44 -0
- package/skills/ce-babysit-pr/references/pipeline.md +15 -0
- package/skills/ce-babysit-pr/references/report.md +20 -0
- package/skills/ce-babysit-pr/references/settle.md +37 -0
- package/skills/ce-babysit-pr/references/setup.md +33 -0
- package/skills/ce-babysit-pr/references/stack-commands.md +39 -0
- package/skills/ce-babysit-pr/references/stack.md +43 -0
- package/skills/ce-babysit-pr/references/tick.md +102 -0
- package/skills/ce-babysit-pr/references/watch-loop.md +222 -0
- package/skills/ce-babysit-pr/scripts/pr-snapshot +3656 -0
- package/skills/ce-bakeoff/SKILL.md +48 -0
- package/skills/ce-bakeoff/references/candidates.md +37 -0
- package/skills/ce-bakeoff/references/judging.md +19 -0
- package/skills/ce-bakeoff/references/output.md +11 -0
- package/skills/ce-bakeoff/references/verification.md +15 -0
- package/skills/ce-brainstorm/SKILL.md +69 -0
- package/skills/ce-brainstorm/references/agents/slack-researcher.md +127 -0
- package/skills/ce-brainstorm/references/approaches.md +57 -0
- package/skills/ce-brainstorm/references/bakeoff.md +9 -0
- package/skills/ce-brainstorm/references/blindspot-pass.md +70 -0
- package/skills/ce-brainstorm/references/brainstorm-sections.md +458 -0
- package/skills/ce-brainstorm/references/dialogue.md +89 -0
- package/skills/ce-brainstorm/references/handoff.md +187 -0
- package/skills/ce-brainstorm/references/html-rendering.md +638 -0
- package/skills/ce-brainstorm/references/interaction-rules.md +33 -0
- package/skills/ce-brainstorm/references/markdown-rendering.md +242 -0
- package/skills/ce-brainstorm/references/model-tiers.md +13 -0
- package/skills/ce-brainstorm/references/output-mode.md +26 -0
- package/skills/ce-brainstorm/references/phase-0.md +104 -0
- package/skills/ce-brainstorm/references/plan-write.md +32 -0
- package/skills/ce-brainstorm/references/product-pressure-test.md +42 -0
- package/skills/ce-brainstorm/references/reasoning-elevation.md +124 -0
- package/skills/ce-brainstorm/references/settled-decisions.md +45 -0
- package/skills/ce-brainstorm/references/synthesis-summary.md +149 -0
- package/skills/ce-brainstorm/references/universal-brainstorming.md +72 -0
- package/skills/ce-brainstorm/references/verdict-routing.md +26 -0
- package/skills/ce-brainstorm/references/visual-probes.md +164 -0
- package/skills/ce-brainstorm/scripts/elevation-dispatch.sh +288 -0
- package/skills/ce-brainstorm/scripts/light-webserver.js +1275 -0
- package/skills/ce-brainstorm/scripts/packs-resolve.py +737 -0
- package/skills/ce-brainstorm/scripts/peer-job-runner.py +2594 -0
- package/skills/ce-code-review/SKILL.md +40 -0
- package/skills/ce-code-review/references/action-class-rubric.md +67 -0
- package/skills/ce-code-review/references/cross-model-recovery.md +38 -0
- package/skills/ce-code-review/references/cross-model-review.md +191 -0
- package/skills/ce-code-review/references/depth-paths.md +32 -0
- package/skills/ce-code-review/references/diff-scope.md +59 -0
- package/skills/ce-code-review/references/dispatch-reviewers.md +135 -0
- package/skills/ce-code-review/references/findings-schema.json +125 -0
- package/skills/ce-code-review/references/finish-input.md +118 -0
- package/skills/ce-code-review/references/finish-review.md +202 -0
- package/skills/ce-code-review/references/intent-and-plan.md +73 -0
- package/skills/ce-code-review/references/modes-and-output.md +156 -0
- package/skills/ce-code-review/references/persona-catalog.md +66 -0
- package/skills/ce-code-review/references/personas/adversarial-reviewer.md +111 -0
- package/skills/ce-code-review/references/personas/agent-native-reviewer.md +173 -0
- package/skills/ce-code-review/references/personas/api-contract-reviewer.md +44 -0
- package/skills/ce-code-review/references/personas/correctness-reviewer.md +48 -0
- package/skills/ce-code-review/references/personas/data-migration-reviewer.md +111 -0
- package/skills/ce-code-review/references/personas/deployment-verification-agent.md +157 -0
- package/skills/ce-code-review/references/personas/julik-frontend-races-reviewer.md +45 -0
- package/skills/ce-code-review/references/personas/learnings-researcher.md +260 -0
- package/skills/ce-code-review/references/personas/maintainability-reviewer.md +85 -0
- package/skills/ce-code-review/references/personas/performance-reviewer.md +45 -0
- package/skills/ce-code-review/references/personas/previous-comments-reviewer.md +59 -0
- package/skills/ce-code-review/references/personas/project-standards-reviewer.md +77 -0
- package/skills/ce-code-review/references/personas/reliability-reviewer.md +49 -0
- package/skills/ce-code-review/references/personas/security-reviewer.md +50 -0
- package/skills/ce-code-review/references/personas/swift-ios-reviewer.md +99 -0
- package/skills/ce-code-review/references/personas/testing-reviewer.md +51 -0
- package/skills/ce-code-review/references/review-output-template.md +172 -0
- package/skills/ce-code-review/references/scope.md +176 -0
- package/skills/ce-code-review/references/select-and-route.md +93 -0
- package/skills/ce-code-review/references/subagent-template.md +206 -0
- package/skills/ce-code-review/references/validator-batch-template.md +67 -0
- package/skills/ce-code-review/scripts/cross-model-adversarial-review.sh +1275 -0
- package/skills/ce-code-review/scripts/findings-mechanics.py +274 -0
- package/skills/ce-code-review/scripts/packs-resolve.py +737 -0
- package/skills/ce-code-review/scripts/peer-job-runner.py +2594 -0
- package/skills/ce-code-review/scripts/review-scope.py +419 -0
- package/skills/ce-code-review/scripts/run-log.py +280 -0
- package/skills/ce-commit/SKILL.md +60 -0
- package/skills/ce-commit-push-pr/SKILL.md +69 -0
- package/skills/ce-commit-push-pr/references/apply-and-handoff.md +79 -0
- package/skills/ce-commit-push-pr/references/branch-creation.md +47 -0
- package/skills/ce-commit-push-pr/references/commit-and-push.md +26 -0
- package/skills/ce-commit-push-pr/references/compose.md +29 -0
- package/skills/ce-commit-push-pr/references/context.md +42 -0
- package/skills/ce-commit-push-pr/references/gh-stack-cli.md +83 -0
- package/skills/ce-commit-push-pr/references/pr-description-writing.md +208 -0
- package/skills/ce-commit-push-pr/references/stack-submit.md +81 -0
- package/skills/ce-compound/SKILL.md +79 -0
- package/skills/ce-compound/assets/resolution-template.md +96 -0
- package/skills/ce-compound/references/agents/best-practices-researcher.md +115 -0
- package/skills/ce-compound/references/agents/data-integrity-guardian.md +68 -0
- package/skills/ce-compound/references/agents/framework-docs-researcher.md +93 -0
- package/skills/ce-compound/references/agents/pattern-recognition-specialist.md +55 -0
- package/skills/ce-compound/references/agents/performance-oracle.md +108 -0
- package/skills/ce-compound/references/agents/security-sentinel.md +91 -0
- package/skills/ce-compound/references/agents/session-historian.md +82 -0
- package/skills/ce-compound/references/assembly.md +127 -0
- package/skills/ce-compound/references/concepts-vocabulary.md +98 -0
- package/skills/ce-compound/references/enhancement.md +42 -0
- package/skills/ce-compound/references/grounding-validation.md +89 -0
- package/skills/ce-compound/references/lightweight.md +56 -0
- package/skills/ce-compound/references/modes.md +13 -0
- package/skills/ce-compound/references/refresh-and-discoverability.md +96 -0
- package/skills/ce-compound/references/report.md +115 -0
- package/skills/ce-compound/references/research.md +144 -0
- package/skills/ce-compound/references/schema.yaml +236 -0
- package/skills/ce-compound/references/session-history.md +73 -0
- package/skills/ce-compound/references/yaml-schema.md +130 -0
- package/skills/ce-compound/scripts/packs-resolve.py +737 -0
- package/skills/ce-compound/scripts/session-history/__pycache__/dsh_session.cpython-314.pyc +0 -0
- package/skills/ce-compound/scripts/session-history/discover-sessions.sh +290 -0
- package/skills/ce-compound/scripts/session-history/discover_dsh.py +123 -0
- package/skills/ce-compound/scripts/session-history/dsh_session.py +225 -0
- package/skills/ce-compound/scripts/session-history/extract-errors.py +178 -0
- package/skills/ce-compound/scripts/session-history/extract-metadata.py +301 -0
- package/skills/ce-compound/scripts/session-history/extract-skeleton.py +346 -0
- package/skills/ce-compound/scripts/validate-doc-claims.py +497 -0
- package/skills/ce-compound/scripts/validate-frontmatter.py +137 -0
- package/skills/ce-compound-refresh/SKILL.md +88 -0
- package/skills/ce-compound-refresh/assets/resolution-template.md +96 -0
- package/skills/ce-compound-refresh/references/classify.md +42 -0
- package/skills/ce-compound-refresh/references/commit.md +7 -0
- package/skills/ce-compound-refresh/references/concepts-vocabulary.md +116 -0
- package/skills/ce-compound-refresh/references/discoverability.md +15 -0
- package/skills/ce-compound-refresh/references/investigate.md +23 -0
- package/skills/ce-compound-refresh/references/modes.md +27 -0
- package/skills/ce-compound-refresh/references/per-action-flows.md +142 -0
- package/skills/ce-compound-refresh/references/report.md +23 -0
- package/skills/ce-compound-refresh/references/schema.yaml +236 -0
- package/skills/ce-compound-refresh/references/scope.md +18 -0
- package/skills/ce-compound-refresh/references/worth-audit.md +35 -0
- package/skills/ce-compound-refresh/references/yaml-schema.md +130 -0
- package/skills/ce-compound-refresh/scripts/validate-doc-claims.py +497 -0
- package/skills/ce-compound-refresh/scripts/validate-frontmatter.py +137 -0
- package/skills/ce-debug/SKILL.md +122 -0
- package/skills/ce-debug/references/anti-patterns.md +91 -0
- package/skills/ce-debug/references/defense-in-depth.md +39 -0
- package/skills/ce-debug/references/fix.md +21 -0
- package/skills/ce-debug/references/investigate.md +114 -0
- package/skills/ce-debug/references/investigation-techniques.md +384 -0
- package/skills/ce-debug/references/pipeline-mode.md +78 -0
- package/skills/ce-debug/references/post-fix-handoff.md +60 -0
- package/skills/ce-debug/references/return-to-caller.md +57 -0
- package/skills/ce-doc-review/SKILL.md +75 -0
- package/skills/ce-doc-review/references/bulk-preview.md +146 -0
- package/skills/ce-doc-review/references/cross-model-review.md +207 -0
- package/skills/ce-doc-review/references/decision-primer.md +47 -0
- package/skills/ce-doc-review/references/dispatch.md +56 -0
- package/skills/ce-doc-review/references/document-intake.md +44 -0
- package/skills/ce-doc-review/references/findings-schema.json +85 -0
- package/skills/ce-doc-review/references/modes.md +20 -0
- package/skills/ce-doc-review/references/open-questions-defer.md +158 -0
- package/skills/ce-doc-review/references/persona-selection.md +41 -0
- package/skills/ce-doc-review/references/personas/adversarial-document-reviewer.md +109 -0
- package/skills/ce-doc-review/references/personas/coherence-reviewer.md +69 -0
- package/skills/ce-doc-review/references/personas/design-lens-reviewer.md +48 -0
- package/skills/ce-doc-review/references/personas/feasibility-reviewer.md +50 -0
- package/skills/ce-doc-review/references/personas/product-lens-reviewer.md +85 -0
- package/skills/ce-doc-review/references/personas/scope-guardian-reviewer.md +83 -0
- package/skills/ce-doc-review/references/personas/security-lens-reviewer.md +41 -0
- package/skills/ce-doc-review/references/personas/whole-doc-reviewer.md +25 -0
- package/skills/ce-doc-review/references/rendering-floor.md +175 -0
- package/skills/ce-doc-review/references/review-output-template.md +123 -0
- package/skills/ce-doc-review/references/subagent-template.md +188 -0
- package/skills/ce-doc-review/references/synthesis-and-presentation.md +350 -0
- package/skills/ce-doc-review/references/walkthrough.md +347 -0
- package/skills/ce-doc-review/scripts/cross-model-doc-review.sh +1270 -0
- package/skills/ce-doc-review/scripts/packs-resolve.py +737 -0
- package/skills/ce-doc-review/scripts/peer-job-runner.py +2594 -0
- package/skills/ce-dogfood/SKILL.md +66 -0
- package/skills/ce-dogfood/agents/openai.yaml +2 -0
- package/skills/ce-dogfood/references/dogfood-report-template.md +97 -0
- package/skills/ce-dogfood/references/phases.md +167 -0
- package/skills/ce-dogfood/references/test-matrix-taxonomy.md +62 -0
- package/skills/ce-dogfood/scripts/packs-resolve.py +737 -0
- package/skills/ce-explain/SKILL.md +81 -0
- package/skills/ce-explain/references/agents/behavior-trace-scout.md +19 -0
- package/skills/ce-explain/references/agents/work-recap-scout.md +23 -0
- package/skills/ce-explain/references/check-in.md +18 -0
- package/skills/ce-explain/references/destinations.md +35 -0
- package/skills/ce-explain/references/explainer-html.md +29 -0
- package/skills/ce-explain/references/explainer-markdown.md +24 -0
- package/skills/ce-explain/references/intake.md +50 -0
- package/skills/ce-explain/references/orchestration.md +46 -0
- package/skills/ce-handoff/SKILL.md +54 -0
- package/skills/ce-handoff/references/create.md +88 -0
- package/skills/ce-handoff/references/resume.md +46 -0
- package/skills/ce-ideate/SKILL.md +75 -0
- package/skills/ce-ideate/references/agents/issue-intelligence-analyst.md +166 -0
- package/skills/ce-ideate/references/agents/learnings-researcher.md +247 -0
- package/skills/ce-ideate/references/agents/slack-researcher.md +127 -0
- package/skills/ce-ideate/references/agents/web-researcher.md +121 -0
- package/skills/ce-ideate/references/decomposition.md +39 -0
- package/skills/ce-ideate/references/divergent-ideation.md +112 -0
- package/skills/ce-ideate/references/grounding.md +138 -0
- package/skills/ce-ideate/references/html-rendering.md +638 -0
- package/skills/ce-ideate/references/ideation-sections.md +191 -0
- package/skills/ce-ideate/references/issue-intelligence.md +44 -0
- package/skills/ce-ideate/references/markdown-rendering.md +242 -0
- package/skills/ce-ideate/references/output-mode.md +34 -0
- package/skills/ce-ideate/references/post-ideation-workflow.md +169 -0
- package/skills/ce-ideate/references/scope-gates.md +148 -0
- package/skills/ce-ideate/references/universal-ideation.md +119 -0
- package/skills/ce-ideate/references/user-research-artifacts.md +28 -0
- package/skills/ce-ideate/references/web-research-cache.md +56 -0
- package/skills/ce-noslop/SKILL.md +45 -0
- package/skills/ce-noslop/references/patterns.md +61 -0
- package/skills/ce-noslop/references/terminology.md +3 -0
- package/skills/ce-optimize/SKILL.md +64 -0
- package/skills/ce-optimize/references/agents/learnings-researcher.md +247 -0
- package/skills/ce-optimize/references/agents/repo-research-analyst.md +258 -0
- package/skills/ce-optimize/references/example-expensive-benchmark-spec.yaml +88 -0
- package/skills/ce-optimize/references/example-hard-spec.yaml +64 -0
- package/skills/ce-optimize/references/example-judge-spec.yaml +83 -0
- package/skills/ce-optimize/references/example-text-target-spec.yaml +80 -0
- package/skills/ce-optimize/references/experiment-log-schema.yaml +563 -0
- package/skills/ce-optimize/references/experiment-prompt-template.md +143 -0
- package/skills/ce-optimize/references/judge-prompt-template.md +117 -0
- package/skills/ce-optimize/references/loop.md +286 -0
- package/skills/ce-optimize/references/measurement.md +168 -0
- package/skills/ce-optimize/references/optimize-spec-schema.yaml +570 -0
- package/skills/ce-optimize/references/persistence.md +93 -0
- package/skills/ce-optimize/references/spec.md +107 -0
- package/skills/ce-optimize/references/text-targets.md +51 -0
- package/skills/ce-optimize/references/usage-guide.md +147 -0
- package/skills/ce-optimize/references/wrap-up.md +54 -0
- package/skills/ce-optimize/scripts/decide.mjs +676 -0
- package/skills/ce-optimize/scripts/experiment-worktree.sh +330 -0
- package/skills/ce-optimize/scripts/measure.sh +140 -0
- package/skills/ce-optimize/scripts/parallel-probe.sh +134 -0
- package/skills/ce-plan/SKILL.md +60 -0
- package/skills/ce-plan/references/agents/agent-native-planning-strategist.md +66 -0
- package/skills/ce-plan/references/agents/architecture-strategist.md +46 -0
- package/skills/ce-plan/references/agents/best-practices-researcher.md +118 -0
- package/skills/ce-plan/references/agents/data-integrity-guardian.md +68 -0
- package/skills/ce-plan/references/agents/framework-docs-researcher.md +97 -0
- package/skills/ce-plan/references/agents/git-history-analyzer.md +40 -0
- package/skills/ce-plan/references/agents/learnings-researcher.md +268 -0
- package/skills/ce-plan/references/agents/pattern-recognition-specialist.md +55 -0
- package/skills/ce-plan/references/agents/performance-oracle.md +108 -0
- package/skills/ce-plan/references/agents/repo-research-analyst.md +262 -0
- package/skills/ce-plan/references/agents/security-sentinel.md +91 -0
- package/skills/ce-plan/references/agents/slack-researcher.md +131 -0
- package/skills/ce-plan/references/agents/spec-flow-analyzer.md +84 -0
- package/skills/ce-plan/references/agents/web-researcher.md +125 -0
- package/skills/ce-plan/references/approach-altitude.md +55 -0
- package/skills/ce-plan/references/bakeoff.md +9 -0
- package/skills/ce-plan/references/deepening-workflow.md +263 -0
- package/skills/ce-plan/references/final-review.md +134 -0
- package/skills/ce-plan/references/html-rendering.md +638 -0
- package/skills/ce-plan/references/intake.md +158 -0
- package/skills/ce-plan/references/markdown-rendering.md +242 -0
- package/skills/ce-plan/references/output-contracts.md +29 -0
- package/skills/ce-plan/references/output-mode.md +45 -0
- package/skills/ce-plan/references/plan-handoff.md +116 -0
- package/skills/ce-plan/references/plan-sections.md +489 -0
- package/skills/ce-plan/references/reasoning-elevation.md +124 -0
- package/skills/ce-plan/references/research.md +211 -0
- package/skills/ce-plan/references/resume.md +61 -0
- package/skills/ce-plan/references/settled-decisions.md +45 -0
- package/skills/ce-plan/references/structure.md +207 -0
- package/skills/ce-plan/references/synthesis-summary.md +260 -0
- package/skills/ce-plan/references/universal-planning.md +170 -0
- package/skills/ce-plan/scripts/elevation-dispatch.sh +288 -0
- package/skills/ce-plan/scripts/packs-resolve.py +737 -0
- package/skills/ce-plan/scripts/peer-job-runner.py +2594 -0
- package/skills/ce-polish/SKILL.md +22 -0
- package/skills/ce-polish/agents/openai.yaml +2 -0
- package/skills/ce-polish/references/dev-server-astro.md +58 -0
- package/skills/ce-polish/references/dev-server-detection.md +40 -0
- package/skills/ce-polish/references/dev-server-next.md +61 -0
- package/skills/ce-polish/references/dev-server-nuxt.md +58 -0
- package/skills/ce-polish/references/dev-server-procfile.md +59 -0
- package/skills/ce-polish/references/dev-server-rails.md +50 -0
- package/skills/ce-polish/references/dev-server-remix.md +58 -0
- package/skills/ce-polish/references/dev-server-sveltekit.md +58 -0
- package/skills/ce-polish/references/dev-server-vite.md +48 -0
- package/skills/ce-polish/references/install-riffrec.md +35 -0
- package/skills/ce-polish/references/launch-json-schema.md +177 -0
- package/skills/ce-polish/references/live-loop.md +98 -0
- package/skills/ce-polish/references/live-remote.md +35 -0
- package/skills/ce-polish/references/live-start.md +93 -0
- package/skills/ce-polish/references/live-stream-contract.md +253 -0
- package/skills/ce-polish/references/run.md +67 -0
- package/skills/ce-polish/scripts/detect-project-type.sh +277 -0
- package/skills/ce-polish/scripts/detect-riffrec.sh +225 -0
- package/skills/ce-polish/scripts/live-endpoint.js +2841 -0
- package/skills/ce-polish/scripts/read-launch-json.sh +117 -0
- package/skills/ce-polish/scripts/resolve-package-manager.sh +95 -0
- package/skills/ce-polish/scripts/resolve-port.sh +307 -0
- package/skills/ce-pov/SKILL.md +64 -0
- package/skills/ce-pov/references/agents/external-evidence-researcher.md +26 -0
- package/skills/ce-pov/references/agents/pov-peer.md +43 -0
- package/skills/ce-pov/references/agents/precedent-activity-scout.md +21 -0
- package/skills/ce-pov/references/agents/project-grounding-scout.md +32 -0
- package/skills/ce-pov/references/boundaries.md +36 -0
- package/skills/ce-pov/references/cross-model-panel.md +596 -0
- package/skills/ce-pov/references/followup.md +9 -0
- package/skills/ce-pov/references/grounding.md +47 -0
- package/skills/ce-pov/references/intake.md +61 -0
- package/skills/ce-pov/references/invocation.md +47 -0
- package/skills/ce-pov/references/method.md +68 -0
- package/skills/ce-pov/references/pov-schema.json +56 -0
- package/skills/ce-pov/references/report.md +7 -0
- package/skills/ce-pov/scripts/cross-model-pov.sh +1110 -0
- package/skills/ce-pov/scripts/peer-job-runner.py +2594 -0
- package/skills/ce-product-pulse/SKILL.md +81 -0
- package/skills/ce-product-pulse/agents/openai.yaml +2 -0
- package/skills/ce-product-pulse/references/config.md +20 -0
- package/skills/ce-product-pulse/references/interview.md +260 -0
- package/skills/ce-product-pulse/references/report-template.md +89 -0
- package/skills/ce-product-pulse/references/run.md +46 -0
- package/skills/ce-product-pulse/references/setup.md +43 -0
- package/skills/ce-promote/SKILL.md +90 -0
- package/skills/ce-promote/agents/openai.yaml +2 -0
- package/skills/ce-promote/references/spiral-cli.md +149 -0
- package/skills/ce-proof/SKILL.md +65 -0
- package/skills/ce-proof/references/api.md +176 -0
- package/skills/ce-proof/references/workflows.md +124 -0
- package/skills/ce-prototype/SKILL.md +59 -0
- package/skills/ce-prototype/assets/annotate.css +206 -0
- package/skills/ce-prototype/assets/annotate.js +837 -0
- package/skills/ce-prototype/references/annotation-loop.md +32 -0
- package/skills/ce-prototype/references/build.md +39 -0
- package/skills/ce-prototype/references/craft-floor.md +43 -0
- package/skills/ce-prototype/references/preview.md +118 -0
- package/skills/ce-prototype/references/scoping.md +38 -0
- package/skills/ce-prototype/references/write-back.md +37 -0
- package/skills/ce-prototype/scripts/light-webserver.js +1275 -0
- package/skills/ce-resolve-pr-feedback/SKILL.md +60 -0
- package/skills/ce-resolve-pr-feedback/references/agents/pr-comment-resolver.md +59 -0
- package/skills/ce-resolve-pr-feedback/references/evaluation-rubric.md +141 -0
- package/skills/ce-resolve-pr-feedback/references/full-mode.md +336 -0
- package/skills/ce-resolve-pr-feedback/references/pipeline-mode.md +23 -0
- package/skills/ce-resolve-pr-feedback/references/resume.md +60 -0
- package/skills/ce-resolve-pr-feedback/references/return-to-caller.md +111 -0
- package/skills/ce-resolve-pr-feedback/references/targeted-mode.md +48 -0
- package/skills/ce-resolve-pr-feedback/scripts/get-pr-comments +176 -0
- package/skills/ce-resolve-pr-feedback/scripts/get-thread-for-comment +84 -0
- package/skills/ce-resolve-pr-feedback/scripts/pending-feedback.py +287 -0
- package/skills/ce-resolve-pr-feedback/scripts/reply-to-pr-thread +57 -0
- package/skills/ce-resolve-pr-feedback/scripts/resolve-pr-thread +23 -0
- package/skills/ce-retune/SKILL.md +42 -0
- package/skills/ce-retune/agents/openai.yaml +2 -0
- package/skills/ce-retune/references/baseline-mining.md +122 -0
- package/skills/ce-retune/references/corpus-audit.md +128 -0
- package/skills/ce-retune/references/cut-passes.md +129 -0
- package/skills/ce-retune/references/halt-taxonomy.md +123 -0
- package/skills/ce-retune/references/noise-floor.md +131 -0
- package/skills/ce-retune/references/workflow-shapes.md +73 -0
- package/skills/ce-riffrec-feedback-analysis/SKILL.md +33 -0
- package/skills/ce-riffrec-feedback-analysis/references/analyzer.md +18 -0
- package/skills/ce-riffrec-feedback-analysis/references/compound-engineering-feedback-format.md +116 -0
- package/skills/ce-riffrec-feedback-analysis/references/extensive-analysis.md +98 -0
- package/skills/ce-riffrec-feedback-analysis/references/install-riffrec.md +27 -0
- package/skills/ce-riffrec-feedback-analysis/references/quick-bug-report.md +38 -0
- package/skills/ce-riffrec-feedback-analysis/scripts/analyze_riffrec_zip.py +1306 -0
- package/skills/ce-setup/SKILL.md +103 -0
- package/skills/ce-setup/agents/openai.yaml +2 -0
- package/skills/ce-setup/assets/compounding-directive.md +11 -0
- package/skills/ce-setup/assets/noslop-directive.md +7 -0
- package/skills/ce-setup/assets/pack-rule-template.md +11 -0
- package/skills/ce-setup/references/acpx-cache-warm.md +14 -0
- package/skills/ce-setup/references/config-template.yaml +210 -0
- package/skills/ce-setup/references/legacy-codex-tool-map.md +15 -0
- package/skills/ce-setup/references/pack-scaffold.md +45 -0
- package/skills/ce-setup/references/repo-fixes.md +121 -0
- package/skills/ce-setup/scripts/check-health +929 -0
- package/skills/ce-setup/scripts/packs-resolve.py +737 -0
- package/skills/ce-simplify-code/SKILL.md +76 -0
- package/skills/ce-simplify-code/references/personas/code-quality-reviewer.md +17 -0
- package/skills/ce-simplify-code/references/personas/code-reuse-reviewer.md +7 -0
- package/skills/ce-simplify-code/references/personas/comment-reviewer.md +24 -0
- package/skills/ce-simplify-code/references/personas/efficiency-reviewer.md +11 -0
- package/skills/ce-simplify-code/references/personas/test-value-reviewer.md +23 -0
- package/skills/ce-simplify-code/references/reviewer-dispatch.md +11 -0
- package/skills/ce-simplify-code/references/standalone-report.md +25 -0
- package/skills/ce-strategy/SKILL.md +61 -0
- package/skills/ce-strategy/references/grounding.md +22 -0
- package/skills/ce-strategy/references/interview.md +179 -0
- package/skills/ce-strategy/references/strategy-template.md +94 -0
- package/skills/ce-strategy/references/update-run.md +33 -0
- package/skills/ce-sweep/SKILL.md +93 -0
- package/skills/ce-sweep/agents/openai.yaml +2 -0
- package/skills/ce-sweep/references/agents/media-analyzer.md +54 -0
- package/skills/ce-sweep/references/interview.md +208 -0
- package/skills/ce-sweep/references/model-tiers.md +13 -0
- package/skills/ce-sweep/references/plan-template.md +62 -0
- package/skills/ce-sweep/references/run.md +126 -0
- package/skills/ce-sweep/references/sources/email.md +57 -0
- package/skills/ce-sweep/references/sources/github-issues.md +59 -0
- package/skills/ce-sweep/references/sources/slack.md +61 -0
- package/skills/ce-sweep/references/state-schema.md +157 -0
- package/skills/ce-sweep/references/subagent-template.md +60 -0
- package/skills/ce-sweep/scripts/analyze_riffrec_zip.py +1306 -0
- package/skills/ce-sweep/scripts/sweep-state.py +793 -0
- package/skills/ce-test-browser/SKILL.md +50 -0
- package/skills/ce-test-browser/references/agent-browser-driver.md +47 -0
- package/skills/ce-test-browser/references/pipeline-orchestration.md +45 -0
- package/skills/ce-test-browser/references/route-and-report.md +129 -0
- package/skills/ce-test-browser/scripts/resolve-port.sh +41 -0
- package/skills/ce-test-xcode/SKILL.md +26 -0
- package/skills/ce-test-xcode/agents/openai.yaml +2 -0
- package/skills/ce-test-xcode/references/setup-and-build.md +32 -0
- package/skills/ce-test-xcode/references/test-and-report.md +64 -0
- package/skills/ce-work/SKILL.md +62 -0
- package/skills/ce-work/references/agents/figma-design-sync.md +27 -0
- package/skills/ce-work/references/agents/implementation-worker.md +17 -0
- package/skills/ce-work/references/cross-model-execution.md +191 -0
- package/skills/ce-work/references/execution-engines.md +64 -0
- package/skills/ce-work/references/execution-strategy.md +73 -0
- package/skills/ce-work/references/implementation-loop.md +107 -0
- package/skills/ce-work/references/implementation-result-schema.json +52 -0
- package/skills/ce-work/references/input-triage.md +50 -0
- package/skills/ce-work/references/non-code-execution.md +23 -0
- package/skills/ce-work/references/return-to-caller.md +33 -0
- package/skills/ce-work/references/review-findings-followup.md +82 -0
- package/skills/ce-work/references/shipping-workflow.md +89 -0
- package/skills/ce-work/references/tracker-defer.md +150 -0
- package/skills/ce-work/references/work-intake.md +51 -0
- package/skills/ce-work/references/workspace-setup.md +27 -0
- package/skills/ce-work/scripts/__pycache__/unit_workspace_jobs.cpython-314.pyc +0 -0
- package/skills/ce-work/scripts/__pycache__/unit_workspace_state.cpython-314.pyc +0 -0
- package/skills/ce-work/scripts/cross-model-work.sh +1385 -0
- package/skills/ce-work/scripts/peer-job-runner.py +2594 -0
- package/skills/ce-work/scripts/unit-workspace.py +215 -0
- package/skills/ce-work/scripts/unit_workspace_ignored.py +93 -0
- package/skills/ce-work/scripts/unit_workspace_integration.py +677 -0
- package/skills/ce-work/scripts/unit_workspace_jobs.py +1216 -0
- package/skills/ce-work/scripts/unit_workspace_lifecycle.py +981 -0
- package/skills/ce-work/scripts/unit_workspace_state.py +1379 -0
- package/skills/ce-work/scripts/unit_workspace_transaction.py +612 -0
- package/skills/ce-worktree/SKILL.md +54 -0
- package/skills/lfg/SKILL.md +59 -0
- package/skills/lfg/references/debug-return.md +25 -0
- package/skills/lfg/references/intake.md +30 -0
- package/skills/lfg/references/next-work-handoff.md +96 -0
- package/skills/lfg/references/plan-brief.md +36 -0
- package/skills/lfg/references/review-followup.md +78 -0
- package/skills/lfg/references/shipping.md +65 -0
- package/skills/lfg/references/stage-routing.md +49 -0
- package/skills/lfg/references/task-visibility.md +11 -0
- package/skills/lfg/references/tracker-defer.md +150 -0
- package/skills/lfg/references/work-return.md +27 -0
- package/skills/wtf/SKILL.md +33 -0
- package/skills/wtf/agents/openai.yaml +2 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
if [ $# -lt 1 ]; then
|
|
6
|
+
echo "Usage: get-pr-comments PR_NUMBER [OWNER/REPO]"
|
|
7
|
+
echo "Example: get-pr-comments 123"
|
|
8
|
+
echo "Example: get-pr-comments 123 EveryInc/cora"
|
|
9
|
+
exit 1
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
PR_NUMBER=$1
|
|
13
|
+
|
|
14
|
+
if [ -n "$2" ]; then
|
|
15
|
+
OWNER=$(echo "$2" | cut -d/ -f1)
|
|
16
|
+
REPO=$(echo "$2" | cut -d/ -f2)
|
|
17
|
+
else
|
|
18
|
+
# `|| true` is load-bearing: under `set -e`, a failed command substitution
|
|
19
|
+
# in an assignment aborts the script immediately. Run outside a git repo,
|
|
20
|
+
# `gh repo view` exits 1, its stderr is swallowed by `2>/dev/null`, and the
|
|
21
|
+
# script would die here with rc=1 and no output -- making the friendly error
|
|
22
|
+
# below unreachable. Keep `|| true` so detection failure falls through to it.
|
|
23
|
+
OWNER=$(gh repo view --json owner -q .owner.login 2>/dev/null || true)
|
|
24
|
+
REPO=$(gh repo view --json name -q .name 2>/dev/null || true)
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
if [ -z "$OWNER" ] || [ -z "$REPO" ]; then
|
|
28
|
+
echo "Error: could not resolve owner/repo. Run get-pr-comments from inside the target git repository, or pass OWNER/REPO as the second argument (e.g., get-pr-comments $PR_NUMBER EveryInc/cora)." >&2
|
|
29
|
+
exit 1
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
# Output is a JSON object with these keys:
|
|
33
|
+
# pending_review - node ID of the viewer's own unsubmitted (PENDING) review
|
|
34
|
+
# on this PR, or null. Replies posted while one exists get
|
|
35
|
+
# silently absorbed into that draft and stay invisible
|
|
36
|
+
# until it is submitted, so the modes must stop before the
|
|
37
|
+
# reply loop when this is non-null. Costs no extra request:
|
|
38
|
+
# the reviews query below already selects `state`, and a
|
|
39
|
+
# PENDING review is only visible to its own author.
|
|
40
|
+
# review_threads - unresolved inline review threads, edge-wrapped with the
|
|
41
|
+
# root numeric REST comment ID used for direct replies:
|
|
42
|
+
# [{ root_comment_id, node: { id, isResolved, ... } }]
|
|
43
|
+
# pr_comments - non-empty top-level PR conversation comments
|
|
44
|
+
# review_bodies - non-empty review submission bodies
|
|
45
|
+
# pr_author - the PR author's login, or null
|
|
46
|
+
# viewer - the acting account's login, or null
|
|
47
|
+
#
|
|
48
|
+
# Pagination (issue #798): each top-level connection -- reviewThreads,
|
|
49
|
+
# comments, reviews -- is fetched in its own paginated query because
|
|
50
|
+
# `gh api graphql --paginate` only follows the outermost pageInfo per
|
|
51
|
+
# response. Combining them into one query (as this script previously did)
|
|
52
|
+
# silently dropped everything past page 1 on long-lived PRs and made the
|
|
53
|
+
# skill report "0 of 0 resolved" while real findings sat unanswered.
|
|
54
|
+
# Per-thread inline `comments` are fetched up to 100 per thread without
|
|
55
|
+
# follow-up pagination; threads that exceed 100 comments are rare and out of
|
|
56
|
+
# scope for this fix.
|
|
57
|
+
#
|
|
58
|
+
# Content, identity, and surface are evidence for the resolver, not deterministic
|
|
59
|
+
# exclusions. CI/status bots can carry actionable setup or posting failures, and
|
|
60
|
+
# automation identities can transport human-authored reviews -- and an author
|
|
61
|
+
# posting on their own PR is the ordinary way a human asks an agent-opened PR
|
|
62
|
+
# for a change (#1435 eval: every run silently dropped "please rename check_id"
|
|
63
|
+
# because this fetch excluded it before the skill could judge it). So the only
|
|
64
|
+
# exclusion here is a blank body; `pr_author` and `viewer` are reported so the
|
|
65
|
+
# resolver can weigh identity as evidence, including recognizing its own prior
|
|
66
|
+
# replies as already-handled.
|
|
67
|
+
|
|
68
|
+
tmp_threads=$(mktemp "${TMPDIR:-/tmp}/ce-pr-threads.XXXXXX")
|
|
69
|
+
tmp_comments=$(mktemp "${TMPDIR:-/tmp}/ce-pr-comments.XXXXXX")
|
|
70
|
+
tmp_reviews=$(mktemp "${TMPDIR:-/tmp}/ce-pr-reviews.XXXXXX")
|
|
71
|
+
trap 'rm -f "$tmp_threads" "$tmp_comments" "$tmp_reviews"' EXIT
|
|
72
|
+
|
|
73
|
+
gh api graphql --paginate --slurp \
|
|
74
|
+
-f owner="$OWNER" -f repo="$REPO" -F pr="$PR_NUMBER" \
|
|
75
|
+
-f query='
|
|
76
|
+
query Threads($owner: String!, $repo: String!, $pr: Int!, $endCursor: String) {
|
|
77
|
+
repository(owner: $owner, name: $repo) {
|
|
78
|
+
pullRequest(number: $pr) {
|
|
79
|
+
author { login }
|
|
80
|
+
reviewThreads(first: 100, after: $endCursor) {
|
|
81
|
+
nodes {
|
|
82
|
+
id
|
|
83
|
+
isResolved
|
|
84
|
+
isOutdated
|
|
85
|
+
path
|
|
86
|
+
line
|
|
87
|
+
originalLine
|
|
88
|
+
startLine
|
|
89
|
+
originalStartLine
|
|
90
|
+
comments(first: 100) {
|
|
91
|
+
nodes {
|
|
92
|
+
id
|
|
93
|
+
author { login }
|
|
94
|
+
body
|
|
95
|
+
createdAt
|
|
96
|
+
url
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
pageInfo { hasNextPage endCursor }
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}' > "$tmp_threads"
|
|
105
|
+
|
|
106
|
+
gh api graphql --paginate --slurp \
|
|
107
|
+
-f owner="$OWNER" -f repo="$REPO" -F pr="$PR_NUMBER" \
|
|
108
|
+
-f query='
|
|
109
|
+
query Comments($owner: String!, $repo: String!, $pr: Int!, $endCursor: String) {
|
|
110
|
+
repository(owner: $owner, name: $repo) {
|
|
111
|
+
pullRequest(number: $pr) {
|
|
112
|
+
comments(first: 100, after: $endCursor) {
|
|
113
|
+
nodes {
|
|
114
|
+
id
|
|
115
|
+
author { login }
|
|
116
|
+
body
|
|
117
|
+
}
|
|
118
|
+
pageInfo { hasNextPage endCursor }
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}' > "$tmp_comments"
|
|
123
|
+
|
|
124
|
+
gh api graphql --paginate --slurp \
|
|
125
|
+
-f owner="$OWNER" -f repo="$REPO" -F pr="$PR_NUMBER" \
|
|
126
|
+
-f query='
|
|
127
|
+
query Reviews($owner: String!, $repo: String!, $pr: Int!, $endCursor: String) {
|
|
128
|
+
viewer { login }
|
|
129
|
+
repository(owner: $owner, name: $repo) {
|
|
130
|
+
pullRequest(number: $pr) {
|
|
131
|
+
reviews(first: 100, after: $endCursor) {
|
|
132
|
+
nodes {
|
|
133
|
+
id
|
|
134
|
+
author { login }
|
|
135
|
+
body
|
|
136
|
+
state
|
|
137
|
+
}
|
|
138
|
+
pageInfo { hasNextPage endCursor }
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}' > "$tmp_reviews"
|
|
143
|
+
|
|
144
|
+
# Resolution semantics: `isOutdated` means the diff hunk around the comment
|
|
145
|
+
# has shifted since the thread was opened -- not that the reviewer concern
|
|
146
|
+
# was addressed. Resolution state is the only authoritative signal; outdated
|
|
147
|
+
# threads are still surfaced (with their isOutdated flag intact) so the
|
|
148
|
+
# resolver can factor in that the referenced line may have moved.
|
|
149
|
+
jq -n \
|
|
150
|
+
--slurpfile threads "$tmp_threads" \
|
|
151
|
+
--slurpfile comments "$tmp_comments" \
|
|
152
|
+
--slurpfile reviews "$tmp_reviews" '
|
|
153
|
+
($threads[0][0].data.repository.pullRequest.author) as $author |
|
|
154
|
+
[$threads[0][].data.repository.pullRequest.reviewThreads.nodes[]] as $all_threads |
|
|
155
|
+
[$comments[0][].data.repository.pullRequest.comments.nodes[]] as $all_comments |
|
|
156
|
+
[$reviews[0][].data.repository.pullRequest.reviews.nodes[]] as $all_reviews |
|
|
157
|
+
[$all_threads[] | select(.isResolved == false)] as $unresolved |
|
|
158
|
+
($reviews[0][0].data.viewer.login) as $viewer |
|
|
159
|
+
{
|
|
160
|
+
pending_review: (first($all_reviews[]
|
|
161
|
+
| select(.state == "PENDING")
|
|
162
|
+
| select(($viewer == null) or (.author.login == $viewer))
|
|
163
|
+
| .id) // null),
|
|
164
|
+
review_threads: [$unresolved[] | {
|
|
165
|
+
node: .,
|
|
166
|
+
root_comment_id: (.comments.nodes[0].url
|
|
167
|
+
| capture("discussion_r(?<id>[0-9]+)").id
|
|
168
|
+
| tonumber)
|
|
169
|
+
}],
|
|
170
|
+
pr_comments: [$all_comments[]
|
|
171
|
+
| select((.body // "") | test("^\\s*$") | not)],
|
|
172
|
+
review_bodies: [$all_reviews[]
|
|
173
|
+
| select((.body // "") | test("^\\s*$") | not)],
|
|
174
|
+
pr_author: ($author.login // null),
|
|
175
|
+
viewer: ($viewer // null)
|
|
176
|
+
}'
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# Maps a PR review comment node ID to its parent thread.
|
|
4
|
+
# Fetches all review threads (paginated) and their comments, then returns the
|
|
5
|
+
# thread whose comments contain the target ID.
|
|
6
|
+
|
|
7
|
+
set -e
|
|
8
|
+
|
|
9
|
+
if [ $# -lt 2 ]; then
|
|
10
|
+
echo "Usage: get-thread-for-comment PR_NUMBER COMMENT_NODE_ID [OWNER/REPO]"
|
|
11
|
+
echo "Example: get-thread-for-comment 378 PRRC_kwDOP_gZVc6ySv89"
|
|
12
|
+
exit 1
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
PR_NUMBER=$1
|
|
16
|
+
COMMENT_NODE_ID=$2
|
|
17
|
+
|
|
18
|
+
if [ -n "$3" ]; then
|
|
19
|
+
OWNER=$(echo "$3" | cut -d/ -f1)
|
|
20
|
+
REPO=$(echo "$3" | cut -d/ -f2)
|
|
21
|
+
else
|
|
22
|
+
# `|| true` is load-bearing: under `set -e`, a failed command substitution
|
|
23
|
+
# in an assignment aborts the script immediately. Run outside a git repo,
|
|
24
|
+
# `gh repo view` exits 1, its stderr is swallowed by `2>/dev/null`, and the
|
|
25
|
+
# script would die here with rc=1 and no output -- making the friendly error
|
|
26
|
+
# below unreachable. Keep `|| true` so detection failure falls through to it.
|
|
27
|
+
OWNER=$(gh repo view --json owner -q .owner.login 2>/dev/null || true)
|
|
28
|
+
REPO=$(gh repo view --json name -q .name 2>/dev/null || true)
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
if [ -z "$OWNER" ] || [ -z "$REPO" ]; then
|
|
32
|
+
echo "Error: could not resolve owner/repo. Run get-thread-for-comment from inside the target git repository, or pass OWNER/REPO as the third argument (e.g., get-thread-for-comment $PR_NUMBER $COMMENT_NODE_ID EveryInc/cora)." >&2
|
|
33
|
+
exit 1
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
# Pagination (issue #798): paginate the reviewThreads connection so PRs with
|
|
37
|
+
# more than one page of threads can still resolve a comment to its parent
|
|
38
|
+
# thread. Per-thread comments are still capped at 100 -- threads exceeding
|
|
39
|
+
# that depth are not paginated here.
|
|
40
|
+
tmp_threads=$(mktemp "${TMPDIR:-/tmp}/ce-pr-threads.XXXXXX")
|
|
41
|
+
trap 'rm -f "$tmp_threads"' EXIT
|
|
42
|
+
|
|
43
|
+
gh api graphql --paginate --slurp \
|
|
44
|
+
-f owner="$OWNER" -f repo="$REPO" -F pr="$PR_NUMBER" \
|
|
45
|
+
-f query='
|
|
46
|
+
query Threads($owner: String!, $repo: String!, $pr: Int!, $endCursor: String) {
|
|
47
|
+
repository(owner: $owner, name: $repo) {
|
|
48
|
+
pullRequest(number: $pr) {
|
|
49
|
+
reviewThreads(first: 100, after: $endCursor) {
|
|
50
|
+
nodes {
|
|
51
|
+
id
|
|
52
|
+
isResolved
|
|
53
|
+
isOutdated
|
|
54
|
+
path
|
|
55
|
+
line
|
|
56
|
+
originalLine
|
|
57
|
+
startLine
|
|
58
|
+
originalStartLine
|
|
59
|
+
comments(first: 100) {
|
|
60
|
+
nodes {
|
|
61
|
+
id
|
|
62
|
+
author { login }
|
|
63
|
+
body
|
|
64
|
+
createdAt
|
|
65
|
+
url
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
pageInfo { hasNextPage endCursor }
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}' > "$tmp_threads"
|
|
74
|
+
|
|
75
|
+
jq -e -n --slurpfile pages "$tmp_threads" --arg cid "$COMMENT_NODE_ID" '
|
|
76
|
+
[$pages[0][].data.repository.pullRequest.reviewThreads.nodes[]
|
|
77
|
+
| select(any(.comments.nodes[]; .id == $cid))]
|
|
78
|
+
| if length == 0 then error("No thread found for comment \($cid)") else .[0] end
|
|
79
|
+
| . + {
|
|
80
|
+
root_comment_id: (.comments.nodes[0].url
|
|
81
|
+
| capture("discussion_r(?<id>[0-9]+)").id
|
|
82
|
+
| tonumber)
|
|
83
|
+
}
|
|
84
|
+
'
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
"""Preserve a judged feedback batch. This helper never mutates GitHub."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import json
|
|
7
|
+
import os
|
|
8
|
+
import re
|
|
9
|
+
import subprocess
|
|
10
|
+
import sys
|
|
11
|
+
import tempfile
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
from urllib.parse import urlsplit
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
SCHEMA_VERSION = 1
|
|
17
|
+
VERDICTS = {"fixed", "fixed-differently", "replied", "not-addressing", "declined", "needs-human"}
|
|
18
|
+
KINDS = {"thread", "comment", "review"}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def require(condition: bool, message: str) -> None:
|
|
22
|
+
if not condition:
|
|
23
|
+
raise ValueError(message)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def string(value: object, name: str, pattern: str | None = None) -> str:
|
|
27
|
+
require(isinstance(value, str) and bool(value), f"{name} must be a nonempty string")
|
|
28
|
+
if pattern:
|
|
29
|
+
require(re.fullmatch(pattern, value) is not None, f"invalid {name}")
|
|
30
|
+
return value
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def positive_int(value: object, name: str) -> None:
|
|
34
|
+
require(type(value) is int and value > 0, f"{name} must be a positive integer")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def object_value(value: object, name: str) -> dict:
|
|
38
|
+
require(isinstance(value, dict), f"{name} must be an object")
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def array(value: object, name: str) -> list:
|
|
43
|
+
require(isinstance(value, list), f"{name} must be an array")
|
|
44
|
+
return value
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def decision(value: object) -> None:
|
|
48
|
+
context = object_value(value, "decision_context")
|
|
49
|
+
for key in ("quoted_feedback", "investigation", "decision_reason"):
|
|
50
|
+
string(context.get(key), key)
|
|
51
|
+
options = array(context.get("options"), "options")
|
|
52
|
+
require(bool(options), "decision options must not be empty")
|
|
53
|
+
for option in options:
|
|
54
|
+
option = object_value(option, "option")
|
|
55
|
+
string(option.get("option"), "option")
|
|
56
|
+
string(option.get("tradeoff"), "tradeoff")
|
|
57
|
+
require("recommendation" in context, "missing recommendation")
|
|
58
|
+
if context["recommendation"] is not None:
|
|
59
|
+
string(context["recommendation"], "recommendation")
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def progress(value: object) -> None:
|
|
63
|
+
value = object_value(value, "progress")
|
|
64
|
+
require(set(value) <= {"reply_id", "reply_url", "resolved", "applied"}, "unknown progress field")
|
|
65
|
+
if "reply_id" in value:
|
|
66
|
+
positive_int(value["reply_id"], "reply_id")
|
|
67
|
+
if "reply_url" in value:
|
|
68
|
+
string(value["reply_url"], "reply_url")
|
|
69
|
+
for key in ("resolved", "applied"):
|
|
70
|
+
if key in value:
|
|
71
|
+
require(type(value[key]) is bool, f"{key} must be boolean")
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def validate(record: object) -> dict:
|
|
75
|
+
record = object_value(record, "record")
|
|
76
|
+
require(type(record.get("schema_version")) is int and record["schema_version"] == SCHEMA_VERSION, "unsupported schema_version")
|
|
77
|
+
require(record.get("status") in {"pending", "completed"}, "invalid status")
|
|
78
|
+
pr = object_value(record.get("pr"), "pr")
|
|
79
|
+
host = string(pr.get("host"), "host", r"[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?(?::[0-9]+)?")
|
|
80
|
+
for key in ("base_repo", "head_repo"):
|
|
81
|
+
string(pr.get(key), key, r"[A-Za-z0-9_-][A-Za-z0-9_.-]*/(?!\.{1,2}$)[A-Za-z0-9_.-]+")
|
|
82
|
+
positive_int(pr.get("number"), "PR number")
|
|
83
|
+
expected_url = f"https://{host}/{pr['base_repo']}/pull/{pr['number']}"
|
|
84
|
+
require(pr.get("url") == expected_url, "PR URL does not match host/base/number")
|
|
85
|
+
ref = string(pr.get("head_ref"), "head_ref")
|
|
86
|
+
require(not re.search(r"[\x00-\x20\x7f~^:?*\[\\]", ref) and not any(token in ref for token in ("..", "@{")), "invalid head_ref")
|
|
87
|
+
require(not ref.startswith(("-", "/", ".")) and not ref.endswith(("/", ".", ".lock")) and "//" not in ref, "invalid head_ref")
|
|
88
|
+
require("fix_commit" in record, "missing fix_commit")
|
|
89
|
+
if record["fix_commit"] is not None:
|
|
90
|
+
string(record["fix_commit"], "fix_commit", r"[0-9a-f]{40}")
|
|
91
|
+
verification = object_value(record.get("verification"), "verification")
|
|
92
|
+
require(verification.get("outcome") in {"passed", "pre-existing-failure", "failed", "not-run"}, "invalid verification outcome")
|
|
93
|
+
for key in ("command", "details"):
|
|
94
|
+
require(isinstance(verification.get(key), str), f"verification.{key} must be a string")
|
|
95
|
+
seen = set()
|
|
96
|
+
for action in array(record.get("actions"), "actions"):
|
|
97
|
+
action = object_value(action, "action")
|
|
98
|
+
source = object_value(action.get("source"), "source")
|
|
99
|
+
require(source.get("kind") in KINDS, "invalid source kind")
|
|
100
|
+
source_id = string(source.get("id"), "source id", r"[A-Za-z0-9_+=:-]+")
|
|
101
|
+
key = (source["kind"], source_id)
|
|
102
|
+
require(key not in seen, "duplicate source identity")
|
|
103
|
+
seen.add(key)
|
|
104
|
+
url = urlsplit(string(source.get("url"), "source URL"))
|
|
105
|
+
require(url.scheme == "https" and url.netloc == host and url.path.rstrip("/") == f"/{pr['base_repo']}/pull/{pr['number']}" and not url.query, "source URL does not belong to PR")
|
|
106
|
+
string(source.get("body_sha256"), "body_sha256", r"[0-9a-f]{64}")
|
|
107
|
+
require(action.get("verdict") in VERDICTS, "invalid verdict")
|
|
108
|
+
string(action.get("reply_body"), "reply_body")
|
|
109
|
+
require(type(action.get("resolve")) is bool, "resolve must be boolean")
|
|
110
|
+
require(action["resolve"] == (source["kind"] == "thread" and action["verdict"] != "needs-human"), "resolve must match the source kind and verdict")
|
|
111
|
+
if source["kind"] == "thread":
|
|
112
|
+
positive_int(action.get("root_comment_id"), "root_comment_id")
|
|
113
|
+
string(action.get("thread_id"), "thread_id", r"[A-Za-z0-9_+=:-]+")
|
|
114
|
+
else:
|
|
115
|
+
require(action.get("root_comment_id") is None and action.get("thread_id") is None and not action["resolve"], "non-thread action cannot resolve")
|
|
116
|
+
if action["verdict"] == "needs-human":
|
|
117
|
+
require(not action["resolve"], "needs-human action cannot resolve")
|
|
118
|
+
decision(action.get("decision_context"))
|
|
119
|
+
else:
|
|
120
|
+
require(action.get("decision_context") is None, "decision_context belongs to needs-human")
|
|
121
|
+
require("invariant_key" in action, "missing invariant_key")
|
|
122
|
+
if action["invariant_key"] is not None:
|
|
123
|
+
string(action["invariant_key"], "invariant_key", r"[A-Za-z0-9._:-]{1,120}")
|
|
124
|
+
if "progress" in action:
|
|
125
|
+
progress(action["progress"])
|
|
126
|
+
if record["status"] == "completed":
|
|
127
|
+
observed = action.get("progress", {})
|
|
128
|
+
positive_int(observed.get("reply_id"), "completed action reply_id")
|
|
129
|
+
require(not action["resolve"] or observed.get("resolved") is True, "completed action must have its required resolution")
|
|
130
|
+
for tick in array(record.get("body_ticks"), "body_ticks"):
|
|
131
|
+
tick = object_value(tick, "body tick")
|
|
132
|
+
original = string(tick.get("original"), "original checklist bullet")
|
|
133
|
+
require(original.startswith("- [ ] ") and "\n" not in original and "\r" not in original, "invalid checklist bullet")
|
|
134
|
+
require(tick.get("checked") == original.replace("- [ ] ", "- [x] ", 1), "body tick must only check the saved bullet")
|
|
135
|
+
if "progress" in tick:
|
|
136
|
+
progress(tick["progress"])
|
|
137
|
+
if record["status"] == "completed":
|
|
138
|
+
require(tick.get("progress", {}).get("applied") is True, "completed body tick must be applied")
|
|
139
|
+
for residual in array(record.get("residuals"), "residuals"):
|
|
140
|
+
residual = object_value(residual, "residual")
|
|
141
|
+
require(residual.get("type") == "needs-human", "invalid residual type")
|
|
142
|
+
sources = array(residual.get("sources"), "residual sources")
|
|
143
|
+
require(bool(sources), "residual sources must not be empty")
|
|
144
|
+
for source in sources:
|
|
145
|
+
source = object_value(source, "residual source")
|
|
146
|
+
require(source.get("kind") in KINDS, "invalid residual source kind")
|
|
147
|
+
string(source.get("id"), "residual source id", r"[A-Za-z0-9_+=:-]+")
|
|
148
|
+
decision(residual.get("decision_context"))
|
|
149
|
+
thread_urls = array(residual.get("thread_urls"), "thread_urls")
|
|
150
|
+
require(not any(source["kind"] == "thread" for source in sources) or bool(thread_urls), "thread residual must carry thread_urls")
|
|
151
|
+
for url in thread_urls:
|
|
152
|
+
string(url, "thread URL")
|
|
153
|
+
return record
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def unique_keys(pairs: list) -> dict:
|
|
157
|
+
result = {}
|
|
158
|
+
for key, value in pairs:
|
|
159
|
+
require(key not in result, f"duplicate JSON key: {key}")
|
|
160
|
+
result[key] = value
|
|
161
|
+
return result
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def reject_constant(value: str) -> None:
|
|
165
|
+
raise ValueError(f"invalid JSON constant: {value}")
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def read_record(path: Path) -> tuple[dict, bytes]:
|
|
169
|
+
raw = path.read_bytes()
|
|
170
|
+
record = json.loads(raw.decode("utf-8"), object_pairs_hook=unique_keys,
|
|
171
|
+
parse_constant=reject_constant)
|
|
172
|
+
return validate(record), raw
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def prepared_content(record: dict) -> dict:
|
|
176
|
+
return {
|
|
177
|
+
"schema_version": record["schema_version"],
|
|
178
|
+
"pr": record["pr"], "fix_commit": record["fix_commit"], "verification": record["verification"],
|
|
179
|
+
"actions": [{key: value for key, value in action.items() if key != "progress"} for action in record["actions"]],
|
|
180
|
+
"body_ticks": [{key: value for key, value in tick.items() if key != "progress"} for tick in record["body_ticks"]],
|
|
181
|
+
"residuals": record["residuals"],
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def write_record(path: Path, raw: bytes, *, checkpoint: bool) -> None:
|
|
186
|
+
if checkpoint:
|
|
187
|
+
temporary = None
|
|
188
|
+
try:
|
|
189
|
+
with tempfile.NamedTemporaryFile(dir=path.parent, prefix=".pending-feedback-", delete=False) as temp:
|
|
190
|
+
temporary = Path(temp.name)
|
|
191
|
+
temp.write(raw)
|
|
192
|
+
temp.flush()
|
|
193
|
+
os.fsync(temp.fileno())
|
|
194
|
+
os.replace(temporary, path)
|
|
195
|
+
finally:
|
|
196
|
+
if temporary is not None:
|
|
197
|
+
temporary.unlink(missing_ok=True)
|
|
198
|
+
else:
|
|
199
|
+
descriptor = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600)
|
|
200
|
+
with os.fdopen(descriptor, "wb") as target:
|
|
201
|
+
target.write(raw)
|
|
202
|
+
target.flush()
|
|
203
|
+
os.fsync(target.fileno())
|
|
204
|
+
read_record(path)
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
def github_json(host: str, endpoint: str) -> dict:
|
|
208
|
+
result = subprocess.run(
|
|
209
|
+
["gh", "api", "--hostname", host, "--method", "GET", endpoint],
|
|
210
|
+
capture_output=True, text=True, check=False,
|
|
211
|
+
)
|
|
212
|
+
require(result.returncode == 0, result.stderr.strip() or f"GitHub GET failed: {endpoint}")
|
|
213
|
+
return object_value(json.loads(result.stdout), "GitHub response")
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
def inspect_publication(record: dict) -> dict:
|
|
217
|
+
proof = {"verified": False, "reason": "", "head_sha": None,
|
|
218
|
+
"head_repo": None, "head_ref": None, "comparison_status": None}
|
|
219
|
+
pr = record["pr"]
|
|
220
|
+
try:
|
|
221
|
+
fresh = github_json(pr["host"], f"repos/{pr['base_repo']}/pulls/{pr['number']}")
|
|
222
|
+
require(fresh.get("number") == pr["number"] and fresh.get("html_url") == pr["url"],
|
|
223
|
+
"fresh PR host/number/URL differs from the saved PR")
|
|
224
|
+
base = object_value(fresh.get("base"), "fresh base")
|
|
225
|
+
require(object_value(base.get("repo"), "fresh base repository").get("full_name") == pr["base_repo"],
|
|
226
|
+
"fresh PR base repository differs from the saved PR")
|
|
227
|
+
head = object_value(fresh.get("head"), "fresh head")
|
|
228
|
+
proof["head_repo"] = object_value(head.get("repo"), "fresh head repository").get("full_name")
|
|
229
|
+
proof["head_ref"] = head.get("ref")
|
|
230
|
+
proof["head_sha"] = string(head.get("sha"), "fresh head SHA", r"[0-9a-f]{40}")
|
|
231
|
+
require(proof["head_repo"] == pr["head_repo"] and proof["head_ref"] == pr["head_ref"],
|
|
232
|
+
"fresh PR head repository/ref differs from the saved PR")
|
|
233
|
+
commit = record["fix_commit"]
|
|
234
|
+
if commit is None:
|
|
235
|
+
proof.update(verified=True, reason="saved batch created no fix commit")
|
|
236
|
+
return proof
|
|
237
|
+
comparison = github_json(pr["host"], f"repos/{proof['head_repo']}/compare/{commit}...{proof['head_sha']}")
|
|
238
|
+
proof["comparison_status"] = comparison.get("status")
|
|
239
|
+
merge_base = object_value(comparison.get("merge_base_commit"), "comparison merge base")
|
|
240
|
+
require(proof["comparison_status"] in {"ahead", "identical"} and merge_base.get("sha") == commit,
|
|
241
|
+
"recorded fix commit is not positively reachable from the fresh PR head")
|
|
242
|
+
proof.update(verified=True, reason="recorded fix commit is reachable from the fresh PR head")
|
|
243
|
+
except (OSError, ValueError, TypeError) as error:
|
|
244
|
+
proof["reason"] = str(error)
|
|
245
|
+
return proof
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def main() -> None:
|
|
249
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
|
250
|
+
subcommands = parser.add_subparsers(dest="command", required=True)
|
|
251
|
+
preflight = subcommands.add_parser("preflight")
|
|
252
|
+
preflight.add_argument("--path")
|
|
253
|
+
for command in ("create", "validate", "checkpoint", "inspect-publication"):
|
|
254
|
+
command_parser = subcommands.add_parser(command)
|
|
255
|
+
command_parser.add_argument("--path", required=True)
|
|
256
|
+
if command in {"create", "checkpoint"}:
|
|
257
|
+
command_parser.add_argument("--input", required=True)
|
|
258
|
+
args = parser.parse_args()
|
|
259
|
+
if args.command == "preflight":
|
|
260
|
+
path = Path(args.path).absolute() if args.path else Path(tempfile.mkdtemp(prefix="ce-pending-feedback-")) / "pending.json"
|
|
261
|
+
require(not os.path.lexists(path), "handoff destination already exists")
|
|
262
|
+
require(path.parent.is_dir(), "handoff parent directory does not exist")
|
|
263
|
+
with tempfile.TemporaryFile(dir=path.parent):
|
|
264
|
+
pass
|
|
265
|
+
print(json.dumps({"handoff": str(path)}))
|
|
266
|
+
return
|
|
267
|
+
path = Path(args.path).absolute()
|
|
268
|
+
if args.command in {"validate", "inspect-publication"}:
|
|
269
|
+
record, _ = read_record(path)
|
|
270
|
+
else:
|
|
271
|
+
record, raw = read_record(Path(args.input))
|
|
272
|
+
if args.command == "checkpoint":
|
|
273
|
+
previous, _ = read_record(path)
|
|
274
|
+
require(prepared_content(previous) == prepared_content(record), "checkpoint cannot replace the prepared batch")
|
|
275
|
+
write_record(path, raw, checkpoint=args.command == "checkpoint")
|
|
276
|
+
output = {"handoff": str(path), "record": record}
|
|
277
|
+
if args.command == "inspect-publication":
|
|
278
|
+
output["publication"] = inspect_publication(record)
|
|
279
|
+
print(json.dumps(output, ensure_ascii=False))
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
if __name__ == "__main__":
|
|
283
|
+
try:
|
|
284
|
+
main()
|
|
285
|
+
except (OSError, ValueError, TypeError) as error:
|
|
286
|
+
print(f"pending feedback: {error}", file=sys.stderr)
|
|
287
|
+
sys.exit(1)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# Replies directly to a PR review thread's root comment. Body is read from
|
|
4
|
+
# stdin to preserve Markdown quotes and newlines. The REST reply endpoint is
|
|
5
|
+
# load-bearing: GraphQL addPullRequestReviewThreadReply can attach the reply to
|
|
6
|
+
# a pending review and return success before the reply is submitted or visible.
|
|
7
|
+
|
|
8
|
+
set -e
|
|
9
|
+
|
|
10
|
+
if [ $# -lt 2 ]; then
|
|
11
|
+
echo "Usage: reply-to-pr-thread PR_NUMBER ROOT_COMMENT_ID [OWNER/REPO] < reply-body.md"
|
|
12
|
+
echo "Example: reply-to-pr-thread 123 456789 EveryInc/cora < reply-body.md"
|
|
13
|
+
exit 1
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
PR_NUMBER=$1
|
|
17
|
+
ROOT_COMMENT_ID=$2
|
|
18
|
+
IFS= read -r -d '' BODY || true
|
|
19
|
+
|
|
20
|
+
if [ -n "$3" ]; then
|
|
21
|
+
OWNER=$(echo "$3" | cut -d/ -f1)
|
|
22
|
+
REPO=$(echo "$3" | cut -d/ -f2)
|
|
23
|
+
else
|
|
24
|
+
OWNER=$(gh repo view --json owner -q .owner.login 2>/dev/null || true)
|
|
25
|
+
REPO=$(gh repo view --json name -q .name 2>/dev/null || true)
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
if [ -z "$OWNER" ] || [ -z "$REPO" ]; then
|
|
29
|
+
echo "Error: could not resolve owner/repo. Pass OWNER/REPO as the third argument." >&2
|
|
30
|
+
exit 1
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
case "$PR_NUMBER" in
|
|
34
|
+
''|*[!0-9]*) echo "Error: PR_NUMBER must be numeric." >&2; exit 1 ;;
|
|
35
|
+
esac
|
|
36
|
+
|
|
37
|
+
case "$ROOT_COMMENT_ID" in
|
|
38
|
+
''|*[!0-9]*) echo "Error: ROOT_COMMENT_ID must be numeric." >&2; exit 1 ;;
|
|
39
|
+
esac
|
|
40
|
+
|
|
41
|
+
if [ -z "$BODY" ]; then
|
|
42
|
+
echo "Error: No body provided on stdin."
|
|
43
|
+
exit 1
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
gh api --method POST \
|
|
47
|
+
"repos/$OWNER/$REPO/pulls/$PR_NUMBER/comments/$ROOT_COMMENT_ID/replies" \
|
|
48
|
+
-f body="$BODY"
|
|
49
|
+
|
|
50
|
+
PENDING_REVIEW=$(gh api --paginate \
|
|
51
|
+
"repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews" \
|
|
52
|
+
--jq '.[] | select(.state == "PENDING") | .id')
|
|
53
|
+
|
|
54
|
+
if [ -n "$PENDING_REVIEW" ]; then
|
|
55
|
+
echo "Error: a pending review appeared after posting. Stop without resolving the thread; do not submit or discard the review." >&2
|
|
56
|
+
exit 2
|
|
57
|
+
fi
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
if [ $# -eq 0 ]; then
|
|
6
|
+
echo "Usage: resolve-pr-thread THREAD_ID"
|
|
7
|
+
echo "Example: resolve-pr-thread PRRT_kwDOABC123"
|
|
8
|
+
exit 1
|
|
9
|
+
fi
|
|
10
|
+
|
|
11
|
+
THREAD_ID=$1
|
|
12
|
+
|
|
13
|
+
gh api graphql -f threadId="$THREAD_ID" -f query='
|
|
14
|
+
mutation ResolveReviewThread($threadId: ID!) {
|
|
15
|
+
resolveReviewThread(input: {threadId: $threadId}) {
|
|
16
|
+
thread {
|
|
17
|
+
id
|
|
18
|
+
isResolved
|
|
19
|
+
path
|
|
20
|
+
line
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}'
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ce-retune
|
|
3
|
+
description: "Retune a skill corpus for a new model, measurement-first: mine the run archive for a baseline, establish a noise floor, audit the corpus adversarially, then cut in measured passes until a pre-registered bar clears. Requires a benchmark harness that can A/B two builds of the corpus; refuses without one."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: "[target model or symptom] [path to the corpus, defaults to ./skills] [bar:<n> consecutive clean runs]"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Retune a Corpus for a New Model
|
|
9
|
+
|
|
10
|
+
A corpus that degrades on a new model is a measurement problem before it is a writing problem: rewriting what looks wrong produces a plausible fix list and no way to know whether any item mattered.
|
|
11
|
+
|
|
12
|
+
**Outcome:** a corpus whose measured behavior on the target model clears a bar registered before any change, with the regression classes removed and each removal attributable.
|
|
13
|
+
|
|
14
|
+
**Done:** the bar is cleared, or the run reports the specific claim it could not support. A green test suite is not done: it proves nothing broke, not that behavior improved.
|
|
15
|
+
|
|
16
|
+
**Non-goal:** word reduction. Leanness and performance are separate programs that share a corpus; only one of them is the result here. Report completion, not word count.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## Phase 0: the measurement gate — check this first
|
|
20
|
+
|
|
21
|
+
This skill cannot run without a way to observe behavior. Check for all three, and name whichever is missing:
|
|
22
|
+
|
|
23
|
+
1. **A run archive or a harness that produces one** — per-run logs carrying the tool-call trace, a terminal marker, token counts, and the final message.
|
|
24
|
+
2. **A build selector** — the harness can point a run at a specific source checkout of the corpus (a `--plugin-dir`-style override, a configurable skills path, an env var), so two builds are comparable under one runner.
|
|
25
|
+
3. **A repeatable task** the corpus actually executes end to end.
|
|
26
|
+
|
|
27
|
+
If any is missing, **stop and say so**, naming what to build. Do not fall back to a static audit and present it as retuning: an audit can say what looks cuttable and never whether cutting helped. An audit-only pass is a legitimate thing to want; it is a different request.
|
|
28
|
+
|
|
29
|
+
State the target model and the harness you found before continuing.
|
|
30
|
+
|
|
31
|
+
## The phases
|
|
32
|
+
|
|
33
|
+
They run in order, and each names the reference it cannot start without. Read `references/workflow-shapes.md` before dispatching any phase: the wrong orchestration shape is the common failure. Fan out by disjoint file ownership, never by item. Items cross files, and agents that share a file lose each other's edits.
|
|
34
|
+
|
|
35
|
+
Before assessing whether the registered bar is met or interpreting its results, read `references/noise-floor.md`.
|
|
36
|
+
|
|
37
|
+
1. **Mine the archive** before spending a run — `references/baseline-mining.md`. Historical runs are a free baseline, usually larger than any experiment affordable now.
|
|
38
|
+
2. **Establish the noise floor** — `references/noise-floor.md`. Run the harness against **two identical copies** of the corpus, same commit on both sides; whatever difference appears is the floor every later claim must clear. **Register the bar now, in writing, before any change exists.** A bar chosen after seeing results is not a bar.
|
|
39
|
+
3. **Audit the corpus adversarially** — `references/corpus-audit.md`. One agent per skill proposes cuts; a second per skill does the opposite and defends the existing prose. **The two passes require independent contexts.** If the host exposes no way to run them as separate agents, report that as a blocker and stop the audit — do not argue both sides in one context and present the result as an audit.
|
|
40
|
+
4. **Cut in surgical passes**, one problem per agent — `references/cut-passes.md`, and `references/halt-taxonomy.md` when the symptom is stalling, halting, or a run that ends while naming work it did not do. Two rules bound every pass, whatever class it is cutting. **Never edit a test to make a suite green**: a removed string a test pins is a finding to report, not a test to weaken. And **not every stop is the enemy.** Some workflows exist to stop and ask; that is the product. Sort every stop by who is actually on the other side before touching it. `references/halt-taxonomy.md` carries the screens that decide, so read them before cutting any stop.
|
|
41
|
+
5. **Measure, then let the failure choose the next fix** — `references/cut-passes.md` again for what each failure site means and for auditing the phases the instrument never enters. Loop 4 and 5 until the registered bar clears. Then stop; a bar cleared is done. Also report what stayed unmeasured: a cleared bar never implies coverage it does not have.
|
|
42
|
+
6. **Ship** — `references/cut-passes.md` carries what the commits and the write-up must preserve.
|