contig 0.1.0__tar.gz

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.
Files changed (313) hide show
  1. contig-0.1.0/.claude/skills/contig-begin/SKILL.md +77 -0
  2. contig-0.1.0/.claude/skills/contig-begin/references/proposals.md +94 -0
  3. contig-0.1.0/.claude/skills/contig-begin-fast/SKILL.md +132 -0
  4. contig-0.1.0/.claude/skills/contig-begin-fast/references/gather-context.md +94 -0
  5. contig-0.1.0/.claude/skills/contig-end/SKILL.md +54 -0
  6. contig-0.1.0/.claude/skills/contig-end-fast/SKILL.md +101 -0
  7. contig-0.1.0/.claude/skills/contig-report/SKILL.md +104 -0
  8. contig-0.1.0/.claude/skills/contig-worktrees/SKILL.md +124 -0
  9. contig-0.1.0/.claude/skills/prd-generator/SKILL.md +154 -0
  10. contig-0.1.0/.claude/skills/prd-interview/SKILL.md +129 -0
  11. contig-0.1.0/.claude/skills/tech-plan/SKILL.md +108 -0
  12. contig-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
  13. contig-0.1.0/.github/ISSUE_TEMPLATE/failure_case.md +33 -0
  14. contig-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +25 -0
  15. contig-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +20 -0
  16. contig-0.1.0/.github/workflows/ci.yml +39 -0
  17. contig-0.1.0/.github/workflows/release.yml +121 -0
  18. contig-0.1.0/.gitignore +11 -0
  19. contig-0.1.0/.python-version +1 -0
  20. contig-0.1.0/CHANGELOG.md +57 -0
  21. contig-0.1.0/CLAUDE.md +80 -0
  22. contig-0.1.0/CODE_OF_CONDUCT.md +37 -0
  23. contig-0.1.0/CONTRIBUTING.md +169 -0
  24. contig-0.1.0/Dockerfile +28 -0
  25. contig-0.1.0/FEATURES.md +297 -0
  26. contig-0.1.0/PKG-INFO +8 -0
  27. contig-0.1.0/README.md +166 -0
  28. contig-0.1.0/RELEASING.md +77 -0
  29. contig-0.1.0/SECURITY.md +39 -0
  30. contig-0.1.0/VISION.md +87 -0
  31. contig-0.1.0/assets/contig-demo.svg +42 -0
  32. contig-0.1.0/assets/contig-logo.svg +1 -0
  33. contig-0.1.0/dashboard/.dockerignore +10 -0
  34. contig-0.1.0/dashboard/.gitignore +47 -0
  35. contig-0.1.0/dashboard/AGENTS.md +5 -0
  36. contig-0.1.0/dashboard/CLAUDE.md +1 -0
  37. contig-0.1.0/dashboard/Dockerfile +45 -0
  38. contig-0.1.0/dashboard/README.md +232 -0
  39. contig-0.1.0/dashboard/app/api/corpus/promote/route.ts +42 -0
  40. contig-0.1.0/dashboard/app/api/eval/clusters/route.ts +29 -0
  41. contig-0.1.0/dashboard/app/api/eval/coverage/route.ts +29 -0
  42. contig-0.1.0/dashboard/app/api/runs/[id]/approve/route.ts +67 -0
  43. contig-0.1.0/dashboard/app/api/runs/[id]/benchmark/route.ts +59 -0
  44. contig-0.1.0/dashboard/app/api/runs/[id]/cancel/route.ts +33 -0
  45. contig-0.1.0/dashboard/app/api/runs/[id]/cost/route.ts +40 -0
  46. contig-0.1.0/dashboard/app/api/runs/[id]/export/route.ts +48 -0
  47. contig-0.1.0/dashboard/app/api/runs/[id]/manifest/route.ts +24 -0
  48. contig-0.1.0/dashboard/app/api/runs/[id]/methods/route.ts +46 -0
  49. contig-0.1.0/dashboard/app/api/runs/[id]/progress/route.ts +23 -0
  50. contig-0.1.0/dashboard/app/api/runs/[id]/report/route.ts +49 -0
  51. contig-0.1.0/dashboard/app/api/runs/[id]/reproduce/route.ts +49 -0
  52. contig-0.1.0/dashboard/app/api/runs/[id]/resume/route.ts +33 -0
  53. contig-0.1.0/dashboard/app/api/runs/[id]/verify/route.ts +39 -0
  54. contig-0.1.0/dashboard/app/api/runs/dispatch/route.ts +36 -0
  55. contig-0.1.0/dashboard/app/api/runs/estimate/route.ts +41 -0
  56. contig-0.1.0/dashboard/app/api/runs/launch/route.ts +53 -0
  57. contig-0.1.0/dashboard/app/api/runs/plan/route.ts +21 -0
  58. contig-0.1.0/dashboard/app/eval/page.tsx +113 -0
  59. contig-0.1.0/dashboard/app/globals.css +139 -0
  60. contig-0.1.0/dashboard/app/icon.svg +1 -0
  61. contig-0.1.0/dashboard/app/layout.tsx +51 -0
  62. contig-0.1.0/dashboard/app/page.tsx +6 -0
  63. contig-0.1.0/dashboard/app/pending/page.tsx +15 -0
  64. contig-0.1.0/dashboard/app/pending/pending-view.tsx +175 -0
  65. contig-0.1.0/dashboard/app/runs/[id]/page.tsx +167 -0
  66. contig-0.1.0/dashboard/app/runs/compare/page.tsx +527 -0
  67. contig-0.1.0/dashboard/app/runs/compare/run-picker.tsx +100 -0
  68. contig-0.1.0/dashboard/app/runs/new/launch-form.tsx +745 -0
  69. contig-0.1.0/dashboard/app/runs/new/page.tsx +37 -0
  70. contig-0.1.0/dashboard/app/runs/page.tsx +100 -0
  71. contig-0.1.0/dashboard/app/runs/runs-table.tsx +214 -0
  72. contig-0.1.0/dashboard/components/auth/user-menu-server.tsx +36 -0
  73. contig-0.1.0/dashboard/components/auth/user-menu.tsx +106 -0
  74. contig-0.1.0/dashboard/components/eval/clusters-view.tsx +139 -0
  75. contig-0.1.0/dashboard/components/eval/coverage-panel.tsx +166 -0
  76. contig-0.1.0/dashboard/components/eval/detector-compare.tsx +211 -0
  77. contig-0.1.0/dashboard/components/eval/detector-selector.tsx +66 -0
  78. contig-0.1.0/dashboard/components/eval/eval-history.tsx +340 -0
  79. contig-0.1.0/dashboard/components/eval/eval-view.tsx +214 -0
  80. contig-0.1.0/dashboard/components/notifications/notification-bell-server.tsx +11 -0
  81. contig-0.1.0/dashboard/components/notifications/notification-bell.tsx +151 -0
  82. contig-0.1.0/dashboard/components/page-header.tsx +54 -0
  83. contig-0.1.0/dashboard/components/pending/pending-case-actions.tsx +88 -0
  84. contig-0.1.0/dashboard/components/run/approval-gate.tsx +323 -0
  85. contig-0.1.0/dashboard/components/run/benchmark-card.tsx +208 -0
  86. contig-0.1.0/dashboard/components/run/cancel-button.tsx +61 -0
  87. contig-0.1.0/dashboard/components/run/cancelled-view.tsx +30 -0
  88. contig-0.1.0/dashboard/components/run/interrupted-view.tsx +36 -0
  89. contig-0.1.0/dashboard/components/run/output-integrity-card.tsx +250 -0
  90. contig-0.1.0/dashboard/components/run/provenance-panel.tsx +219 -0
  91. contig-0.1.0/dashboard/components/run/qc-panel.tsx +219 -0
  92. contig-0.1.0/dashboard/components/run/repair-timeline.tsx +189 -0
  93. contig-0.1.0/dashboard/components/run/reproduce-actions.tsx +80 -0
  94. contig-0.1.0/dashboard/components/run/resource-cost-card.tsx +213 -0
  95. contig-0.1.0/dashboard/components/run/resume-button.tsx +67 -0
  96. contig-0.1.0/dashboard/components/run/run-export-actions.tsx +64 -0
  97. contig-0.1.0/dashboard/components/run/running-view.tsx +268 -0
  98. contig-0.1.0/dashboard/components/run/verdict-card.tsx +139 -0
  99. contig-0.1.0/dashboard/components/run-test-profile-button.tsx +52 -0
  100. contig-0.1.0/dashboard/components/site-nav.tsx +45 -0
  101. contig-0.1.0/dashboard/components/status-badge.tsx +66 -0
  102. contig-0.1.0/dashboard/components/ui/badge.tsx +52 -0
  103. contig-0.1.0/dashboard/components/ui/button.tsx +78 -0
  104. contig-0.1.0/dashboard/components/ui/card.tsx +103 -0
  105. contig-0.1.0/dashboard/components/ui/collapsible.tsx +37 -0
  106. contig-0.1.0/dashboard/components/ui/dropdown-menu.tsx +268 -0
  107. contig-0.1.0/dashboard/components/ui/input.tsx +20 -0
  108. contig-0.1.0/dashboard/components/ui/select.tsx +201 -0
  109. contig-0.1.0/dashboard/components/ui/separator.tsx +25 -0
  110. contig-0.1.0/dashboard/components/ui/table.tsx +124 -0
  111. contig-0.1.0/dashboard/components/ui/tabs.tsx +82 -0
  112. contig-0.1.0/dashboard/components/ui/tooltip.tsx +66 -0
  113. contig-0.1.0/dashboard/components.json +25 -0
  114. contig-0.1.0/dashboard/docker-compose.yml +86 -0
  115. contig-0.1.0/dashboard/e2e/approval-gate.spec.ts +100 -0
  116. contig-0.1.0/dashboard/e2e/auth-gate.spec.ts +46 -0
  117. contig-0.1.0/dashboard/e2e/benchmark.spec.ts +87 -0
  118. contig-0.1.0/dashboard/e2e/choice-gate.spec.ts +105 -0
  119. contig-0.1.0/dashboard/e2e/compare.spec.ts +60 -0
  120. contig-0.1.0/dashboard/e2e/corpus-insights.spec.ts +102 -0
  121. contig-0.1.0/dashboard/e2e/detector-compare.spec.ts +45 -0
  122. contig-0.1.0/dashboard/e2e/detector-selector.spec.ts +39 -0
  123. contig-0.1.0/dashboard/e2e/dispatch.spec.ts +37 -0
  124. contig-0.1.0/dashboard/e2e/estimate.spec.ts +117 -0
  125. contig-0.1.0/dashboard/e2e/eval-history.spec.ts +46 -0
  126. contig-0.1.0/dashboard/e2e/explain.spec.ts +64 -0
  127. contig-0.1.0/dashboard/e2e/export-provenance.spec.ts +29 -0
  128. contig-0.1.0/dashboard/e2e/fixtures/_eval_history/eval_history.jsonl +3 -0
  129. contig-0.1.0/dashboard/e2e/fixtures/_notifications/notifications.jsonl +4 -0
  130. contig-0.1.0/dashboard/e2e/fixtures/awaiting-approval-fixture/pending_approval.json +1 -0
  131. contig-0.1.0/dashboard/e2e/fixtures/awaiting-approval-fixture/status.json +1 -0
  132. contig-0.1.0/dashboard/e2e/fixtures/awaiting-confirm-fixture/pending_approval.json +1 -0
  133. contig-0.1.0/dashboard/e2e/fixtures/awaiting-confirm-fixture/status.json +1 -0
  134. contig-0.1.0/dashboard/e2e/fixtures/benchmark-fixture/run_record.json +52 -0
  135. contig-0.1.0/dashboard/e2e/fixtures/cancelled-fixture/status.json +1 -0
  136. contig-0.1.0/dashboard/e2e/fixtures/choice-fixture/pending_approval.json +1 -0
  137. contig-0.1.0/dashboard/e2e/fixtures/choice-fixture/status.json +1 -0
  138. contig-0.1.0/dashboard/e2e/fixtures/export-fixture/run_record.json +49 -0
  139. contig-0.1.0/dashboard/e2e/fixtures/live-fixture/repair_progress.jsonl +1 -0
  140. contig-0.1.0/dashboard/e2e/fixtures/live-fixture/run.log +4 -0
  141. contig-0.1.0/dashboard/e2e/fixtures/live-fixture/status.json +1 -0
  142. contig-0.1.0/dashboard/e2e/fixtures/live-fixture/trace.txt +3 -0
  143. contig-0.1.0/dashboard/e2e/fixtures/reproduce-fixture/launch.json +19 -0
  144. contig-0.1.0/dashboard/e2e/fixtures/reproduce-fixture/run_record.json +47 -0
  145. contig-0.1.0/dashboard/e2e/fixtures/reproduce-fixture/samplesheet.csv +1 -0
  146. contig-0.1.0/dashboard/e2e/fixtures/resource-fixture/run_record.json +67 -0
  147. contig-0.1.0/dashboard/e2e/fixtures/scrnaseq-fixture/run_record.json +58 -0
  148. contig-0.1.0/dashboard/e2e/fixtures/signed-fixture/run_record.json +48 -0
  149. contig-0.1.0/dashboard/e2e/fixtures/signed-fixture/signature.json +6 -0
  150. contig-0.1.0/dashboard/e2e/fixtures/structural-fixture/run_record.json +62 -0
  151. contig-0.1.0/dashboard/e2e/fixtures/taskfail-fixture/run_record.json +34 -0
  152. contig-0.1.0/dashboard/e2e/fixtures/verify-fixture/results/multiqc_report.html +1 -0
  153. contig-0.1.0/dashboard/e2e/fixtures/verify-fixture/run_record.json +46 -0
  154. contig-0.1.0/dashboard/e2e/fixtures/warn-fixture/run_record.json +65 -0
  155. contig-0.1.0/dashboard/e2e/fixtures/workspace-fixture/owner.json +5 -0
  156. contig-0.1.0/dashboard/e2e/fixtures/workspace-fixture/run_record.json +49 -0
  157. contig-0.1.0/dashboard/e2e/fixtures.ts +151 -0
  158. contig-0.1.0/dashboard/e2e/global-setup.ts +8 -0
  159. contig-0.1.0/dashboard/e2e/global-teardown.ts +7 -0
  160. contig-0.1.0/dashboard/e2e/in-run-controls.spec.ts +61 -0
  161. contig-0.1.0/dashboard/e2e/launch-selectors.spec.ts +65 -0
  162. contig-0.1.0/dashboard/e2e/launch.spec.ts +25 -0
  163. contig-0.1.0/dashboard/e2e/live-progress.spec.ts +52 -0
  164. contig-0.1.0/dashboard/e2e/llm-detector.spec.ts +36 -0
  165. contig-0.1.0/dashboard/e2e/notifications.spec.ts +64 -0
  166. contig-0.1.0/dashboard/e2e/ownership-filter.spec.ts +92 -0
  167. contig-0.1.0/dashboard/e2e/ownership.spec.ts +45 -0
  168. contig-0.1.0/dashboard/e2e/pending.spec.ts +49 -0
  169. contig-0.1.0/dashboard/e2e/report-download.spec.ts +23 -0
  170. contig-0.1.0/dashboard/e2e/reproduce.spec.ts +54 -0
  171. contig-0.1.0/dashboard/e2e/resource-cost.spec.ts +58 -0
  172. contig-0.1.0/dashboard/e2e/signature-badge.spec.ts +61 -0
  173. contig-0.1.0/dashboard/e2e/smoke.spec.ts +41 -0
  174. contig-0.1.0/dashboard/e2e/structural-qc.spec.ts +31 -0
  175. contig-0.1.0/dashboard/e2e/verify-outputs.spec.ts +60 -0
  176. contig-0.1.0/dashboard/eslint.config.mjs +18 -0
  177. contig-0.1.0/dashboard/lib/auth0.ts +225 -0
  178. contig-0.1.0/dashboard/lib/derive.ts +150 -0
  179. contig-0.1.0/dashboard/lib/diff.ts +205 -0
  180. contig-0.1.0/dashboard/lib/ownership.ts +43 -0
  181. contig-0.1.0/dashboard/lib/runs.ts +1488 -0
  182. contig-0.1.0/dashboard/lib/types.ts +409 -0
  183. contig-0.1.0/dashboard/lib/utils.ts +6 -0
  184. contig-0.1.0/dashboard/next.config.ts +10 -0
  185. contig-0.1.0/dashboard/package-lock.json +9853 -0
  186. contig-0.1.0/dashboard/package.json +37 -0
  187. contig-0.1.0/dashboard/playwright.config.ts +34 -0
  188. contig-0.1.0/dashboard/postcss.config.mjs +7 -0
  189. contig-0.1.0/dashboard/proxy.ts +81 -0
  190. contig-0.1.0/dashboard/public/file.svg +1 -0
  191. contig-0.1.0/dashboard/public/globe.svg +1 -0
  192. contig-0.1.0/dashboard/public/logo.svg +1 -0
  193. contig-0.1.0/dashboard/public/next.svg +1 -0
  194. contig-0.1.0/dashboard/public/vercel.svg +1 -0
  195. contig-0.1.0/dashboard/public/window.svg +1 -0
  196. contig-0.1.0/dashboard/tsconfig.json +34 -0
  197. contig-0.1.0/demo/DEMO.md +190 -0
  198. contig-0.1.0/demo/OUTREACH.md +103 -0
  199. contig-0.1.0/demo/WHAT_THIS_PROVES.md +51 -0
  200. contig-0.1.0/demo/make_sample_run.py +191 -0
  201. contig-0.1.0/demo/sample-report.html +49 -0
  202. contig-0.1.0/demo/sample-run/PUBLIC_KEY.txt +6 -0
  203. contig-0.1.0/demo/sample-run/results/multiqc/multiqc_data.json +1 -0
  204. contig-0.1.0/demo/sample-run/results/star_salmon/salmon.merged.gene_counts.tsv +2 -0
  205. contig-0.1.0/demo/sample-run/run_record.json +122 -0
  206. contig-0.1.0/demo/sample-run/signature.json +6 -0
  207. contig-0.1.0/deploy/Caddyfile +55 -0
  208. contig-0.1.0/deploy/ENV.md +146 -0
  209. contig-0.1.0/deploy/nginx.conf +49 -0
  210. contig-0.1.0/docs/RESEARCH_FINDINGS.md +200 -0
  211. contig-0.1.0/docs/ROADMAP.md +195 -0
  212. contig-0.1.0/docs/USAGE.md +279 -0
  213. contig-0.1.0/docs/business/BUSINESS_MODEL.md +233 -0
  214. contig-0.1.0/docs/business/GTM.md +153 -0
  215. contig-0.1.0/docs/business/MARKET_ANALYSIS.md +160 -0
  216. contig-0.1.0/docs/product/PRODUCT_SPEC.md +182 -0
  217. contig-0.1.0/docs/superpowers/specs/2026-06-19-verification-qc-layer-design.md +70 -0
  218. contig-0.1.0/docs/technical/ADD_AN_ASSAY.md +162 -0
  219. contig-0.1.0/docs/technical/ARCHITECTURE.md +432 -0
  220. contig-0.1.0/docs/technical/AWS_BATCH_RUNBOOK.md +161 -0
  221. contig-0.1.0/docs/technical/PRD_BREADTH_BATCH.md +128 -0
  222. contig-0.1.0/docs/technical/PRD_DISPATCH_V2.md +165 -0
  223. contig-0.1.0/docs/technical/PRD_FINISH_BATCH.md +109 -0
  224. contig-0.1.0/docs/technical/PRD_INRUN_CONTROLS.md +157 -0
  225. contig-0.1.0/docs/technical/PRD_MOAT_BATCH.md +125 -0
  226. contig-0.1.0/docs/technical/PRD_PRODUCTIZE_BATCH.md +121 -0
  227. contig-0.1.0/docs/technical/PRD_ROADMAP_BATCH.md +126 -0
  228. contig-0.1.0/docs/technical/PRD_VALIDATION_PREP.md +99 -0
  229. contig-0.1.0/docs/technical/RUN_DISPATCH.md +129 -0
  230. contig-0.1.0/docs/technical/SLURM_RUNBOOK.md +92 -0
  231. contig-0.1.0/homebrew/contig.rb +37 -0
  232. contig-0.1.0/packaging/contig_main.py +11 -0
  233. contig-0.1.0/pyproject.toml +29 -0
  234. contig-0.1.0/src/contig/__init__.py +0 -0
  235. contig-0.1.0/src/contig/benchmark.py +204 -0
  236. contig-0.1.0/src/contig/bundle.py +91 -0
  237. contig-0.1.0/src/contig/cli.py +1270 -0
  238. contig-0.1.0/src/contig/corpus.py +320 -0
  239. contig-0.1.0/src/contig/cost.py +61 -0
  240. contig-0.1.0/src/contig/data/detector_corpus.jsonl +15 -0
  241. contig-0.1.0/src/contig/data/eval_history.jsonl +2 -0
  242. contig-0.1.0/src/contig/data/reference_runs.jsonl +0 -0
  243. contig-0.1.0/src/contig/datashape.py +62 -0
  244. contig-0.1.0/src/contig/detect.py +528 -0
  245. contig-0.1.0/src/contig/estimate.py +165 -0
  246. contig-0.1.0/src/contig/eval_history.py +66 -0
  247. contig-0.1.0/src/contig/events.py +147 -0
  248. contig-0.1.0/src/contig/lifecycle.py +156 -0
  249. contig-0.1.0/src/contig/methods.py +95 -0
  250. contig-0.1.0/src/contig/models.py +359 -0
  251. contig-0.1.0/src/contig/nfconfig.py +149 -0
  252. contig-0.1.0/src/contig/notify.py +131 -0
  253. contig-0.1.0/src/contig/planner.py +63 -0
  254. contig-0.1.0/src/contig/progress.py +163 -0
  255. contig-0.1.0/src/contig/provenance.py +81 -0
  256. contig-0.1.0/src/contig/reference.py +41 -0
  257. contig-0.1.0/src/contig/registry.py +161 -0
  258. contig-0.1.0/src/contig/repair.py +159 -0
  259. contig-0.1.0/src/contig/report.py +323 -0
  260. contig-0.1.0/src/contig/runner.py +267 -0
  261. contig-0.1.0/src/contig/samplesheet.py +78 -0
  262. contig-0.1.0/src/contig/self_heal.py +559 -0
  263. contig-0.1.0/src/contig/signing.py +129 -0
  264. contig-0.1.0/src/contig/snakemake.py +80 -0
  265. contig-0.1.0/src/contig/verification/__init__.py +0 -0
  266. contig-0.1.0/src/contig/verification/cross_sample.py +118 -0
  267. contig-0.1.0/src/contig/verification/qc_ingest.py +30 -0
  268. contig-0.1.0/src/contig/verification/rule_pack.py +301 -0
  269. contig-0.1.0/src/contig/verification/run_qc.py +70 -0
  270. contig-0.1.0/src/contig/verification/structural.py +347 -0
  271. contig-0.1.0/src/contig/workspace.py +51 -0
  272. contig-0.1.0/tests/__init__.py +0 -0
  273. contig-0.1.0/tests/fixtures/example.smk +23 -0
  274. contig-0.1.0/tests/test_benchmark.py +194 -0
  275. contig-0.1.0/tests/test_bundle.py +206 -0
  276. contig-0.1.0/tests/test_cli.py +1435 -0
  277. contig-0.1.0/tests/test_cli_benchmark.py +146 -0
  278. contig-0.1.0/tests/test_cli_insight.py +80 -0
  279. contig-0.1.0/tests/test_corpus.py +263 -0
  280. contig-0.1.0/tests/test_corpus_insight.py +145 -0
  281. contig-0.1.0/tests/test_cost.py +64 -0
  282. contig-0.1.0/tests/test_datashape.py +95 -0
  283. contig-0.1.0/tests/test_detect.py +297 -0
  284. contig-0.1.0/tests/test_detect_llm.py +251 -0
  285. contig-0.1.0/tests/test_estimate.py +179 -0
  286. contig-0.1.0/tests/test_eval_history.py +130 -0
  287. contig-0.1.0/tests/test_events.py +90 -0
  288. contig-0.1.0/tests/test_lifecycle.py +214 -0
  289. contig-0.1.0/tests/test_methods.py +95 -0
  290. contig-0.1.0/tests/test_models.py +306 -0
  291. contig-0.1.0/tests/test_nfconfig.py +301 -0
  292. contig-0.1.0/tests/test_notify.py +169 -0
  293. contig-0.1.0/tests/test_planner.py +50 -0
  294. contig-0.1.0/tests/test_progress.py +90 -0
  295. contig-0.1.0/tests/test_provenance.py +120 -0
  296. contig-0.1.0/tests/test_reference.py +77 -0
  297. contig-0.1.0/tests/test_registry.py +251 -0
  298. contig-0.1.0/tests/test_repair.py +145 -0
  299. contig-0.1.0/tests/test_report.py +422 -0
  300. contig-0.1.0/tests/test_resource.py +102 -0
  301. contig-0.1.0/tests/test_runner.py +530 -0
  302. contig-0.1.0/tests/test_samplesheet.py +150 -0
  303. contig-0.1.0/tests/test_self_heal.py +727 -0
  304. contig-0.1.0/tests/test_signing.py +98 -0
  305. contig-0.1.0/tests/test_snakemake.py +138 -0
  306. contig-0.1.0/tests/test_workspace.py +65 -0
  307. contig-0.1.0/tests/verification/__init__.py +0 -0
  308. contig-0.1.0/tests/verification/test_cross_sample.py +146 -0
  309. contig-0.1.0/tests/verification/test_qc_ingest.py +141 -0
  310. contig-0.1.0/tests/verification/test_rule_pack.py +475 -0
  311. contig-0.1.0/tests/verification/test_run_qc.py +110 -0
  312. contig-0.1.0/tests/verification/test_structural.py +280 -0
  313. contig-0.1.0/uv.lock +392 -0
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: contig-begin
3
+ description: Use when starting work on a Contig unit of work (a GitHub issue id or an inline brief) and you need stakeholder proposals (technical + non-technical PDFs with diagrams) before planning. Triggers on "contig-begin", "cb", "cb bug 12", "cb feat verify-layer", "begin full".
4
+ arguments: "type id"
5
+ ---
6
+
7
+ # Contig Begin (Full Track)
8
+
9
+ ## Overview
10
+
11
+ Same pipeline as `contig-begin-fast`, plus a **proposal phase**: after the PRD is approved, produce diagrams and two review PDFs (technical + non-technical) for stakeholders, get approval, then plan.
12
+
13
+ **Invocation:** `cb <type> <id>` — e.g. `cb bug 12`, `cb feat verify-layer`.
14
+ Arguments and conventions (type set, `<type>/<id>/aliz` branch, descriptive slug, worktree, GitHub-issue-or-inline-brief source) are identical to `contig-begin-fast`.
15
+
16
+ The two non-negotiables carry over from `contig-begin-fast`: **always work through the agents team** (every phase, including diagrams and the two proposals), and **implementation is test-first** via `superpowers:test-driven-development`, executed by the agents team.
17
+
18
+ ## Pipeline
19
+
20
+ **REQUIRED SUB-SKILL:** Use `contig-begin-fast` for the base pipeline.
21
+
22
+ Run its **Phase 0 → Phase 4 and the ⛔ PRD review gate exactly as written** (worktree → gather context → deep dig → `prd-interview` → `prd-generator` → stop for PRD approval).
23
+
24
+ **Then, instead of going straight to tech-plan, insert Phase A below. Only after Phase A's approval gate do you run `contig-begin-fast`'s Phase 5 (tech-plan) and Phase 6 (implement — TDD via the agents team).**
25
+
26
+ ### Phase A — Proposals (diagrams → PDFs)
27
+
28
+ Detailed steps, proposal structure, and `md-to-pdf` invocation: see `references/proposals.md`.
29
+
30
+ 1. **Diagram** — Use `excalidraw`. From the approved PRD, draw as many diagrams as the work needs (system/architecture, data flow, sequence, before/after, etc.). Save to `docs/planning/{slug}/diagrams/*.excalidraw`.
31
+ 2. **Export** — Use `excalidraw-to-svg` to render every diagram to `.svg` alongside the source.
32
+ 3. **Write two proposals** (markdown, in `docs/planning/{slug}/proposals/`), embedding the SVGs. Both filenames are prefixed with the type and id so stakeholders can identify the source at a glance:
33
+ - `<type>-<id>-technical-proposal.md` (e.g. `feat-verify-layer-technical-proposal.md`) — for engineers: architecture, components, data flow, risks, effort.
34
+ - `<type>-<id>-non-technical-proposal.md` — for stakeholders: problem, value, what changes for users, timeline, plain language.
35
+ Generate the two in parallel (see Agents team).
36
+ 4. **PDF** — Use `md-to-pdf` to produce `<type>-<id>-technical-proposal.pdf` and `<type>-<id>-non-technical-proposal.pdf`.
37
+
38
+ ### ⛔ Approval gate — STOP
39
+
40
+ Present both PDFs. **Wait for the user's explicit approval** of the proposals before planning. Do not auto-advance.
41
+
42
+ ### Final phases — Plan & implement
43
+
44
+ Run `contig-begin-fast`'s **Phase 5 (tech-plan)** → `docs/planning/{slug}/{aspect}/plan_YYYYMMDD.md`, then its **Phase 6 (implement)** — strict TDD (`superpowers:test-driven-development`) executed through the agents team (`superpowers:subagent-driven-development`), one agent per plan task, branch kept green (`uv run pytest`).
45
+
46
+ ## Artifact layout (inside the worktree)
47
+
48
+ ```
49
+ docs/planning/
50
+ ├── _card/issue.md ← gh dump or inline brief
51
+ ├── {slug}/prd.md ← PRD (approved at the first gate)
52
+ ├── {slug}/diagrams/*.excalidraw|.svg ← Phase A
53
+ ├── {slug}/proposals/<type>-<id>-technical-proposal.{md,pdf}
54
+ ├── {slug}/proposals/<type>-<id>-non-technical-proposal.{md,pdf}
55
+ └── {slug}/{aspect}/plan_*.md ← tech-plan
56
+ ```
57
+
58
+ ## Agents team (mandatory)
59
+
60
+ Run **every** phase through the agents team — never serially in the main thread.
61
+
62
+ **REQUIRED SUB-SKILL:** Use `superpowers:dispatching-parallel-agents`; use `superpowers:subagent-driven-development` for Phase 6.
63
+
64
+ - Base pipeline: fan out context-gathering across related issues/PRs (as in `contig-begin-fast`).
65
+ - Phase A: generate independent diagrams with parallel agents; write the technical and non-technical proposals concurrently (two agents, same PRD + SVGs).
66
+ - Phase 6: one agent per independent plan task, each in strict TDD.
67
+
68
+ ## Common mistakes
69
+
70
+ | Mistake | Fix |
71
+ |---|---|
72
+ | Writing proposals before the PRD is approved | Phase A starts only after the first ⛔ gate |
73
+ | One proposal for both audiences | Always two: technical and non-technical |
74
+ | Embedding `.excalidraw` instead of `.svg` | PDFs embed the exported SVGs |
75
+ | Skipping the proposal approval gate | Proposals must be approved before tech-plan |
76
+ | Diagrams/PDFs outside the worktree | Everything lives under the worktree's `docs/planning/{slug}/` |
77
+ | Implementing serially or test-after | Phase 6 is agents-team + strict TDD (RED before GREEN) |
@@ -0,0 +1,94 @@
1
+ # Phase A — Diagrams & proposal PDFs
2
+
3
+ Runs after the PRD approval gate. Everything is written inside the worktree under
4
+ `docs/planning/{slug}/`.
5
+
6
+ ## 1. Diagrams (`excalidraw`)
7
+
8
+ Use the `excalidraw` skill. Decide how many diagrams the work actually needs —
9
+ don't pad. Typical set for Contig:
10
+
11
+ | Diagram | When to include |
12
+ |---|---|
13
+ | System / architecture | Almost always — where the change lives in the orchestrate→run→verify stack |
14
+ | Data flow | Data moves across steps (ingest → pipeline → artifacts → verification) |
15
+ | Sequence | A multi-step run/self-heal/verify interaction matters |
16
+ | Before / after | Behavior or structure changes visibly |
17
+ | State machine | A run/step lifecycle or failure-recovery flow changes |
18
+
19
+ Save sources to `docs/planning/{slug}/diagrams/`, descriptive names
20
+ (e.g. `architecture.excalidraw`, `verify-flow.excalidraw`).
21
+
22
+ **Every text element must set `fontFamily: 2` (Helvetica)** — the excalidraw default is hand-drawn (Virgil/Excalifont) and unreadable in stakeholder PDFs. See the excalidraw skill's Rule 5.
23
+
24
+ ## 2. Export to SVG (`excalidraw-to-svg`)
25
+
26
+ Use the `excalidraw-to-svg` skill to render every `.excalidraw` to a sibling `.svg`.
27
+ Batch-export the whole `diagrams/` directory. SVG (not PNG) keeps text crisp in the PDF.
28
+
29
+ ## 3. Write the two proposals
30
+
31
+ Markdown, in `docs/planning/{slug}/proposals/`. Embed the SVGs with **relative** paths
32
+ (`../diagrams/architecture.svg`) so `md-to-pdf` inlines them. Generate the two
33
+ concurrently — same PRD + diagrams, different audience.
34
+
35
+ ### `<type>-<id>-technical-proposal.md` (engineers)
36
+
37
+ Filename is prefixed with the type and id (e.g. `feat-verify-layer-technical-proposal.md`) so stakeholders can identify which unit of work a proposal belongs to at a glance.
38
+
39
+ - **Summary** — one paragraph: what we're building and why.
40
+ - **Current state** — how it works today (link before/after diagram).
41
+ - **Proposed design** — architecture + components (embed architecture/data-flow/sequence SVGs).
42
+ - **Data & interface changes** — artifacts, CLI surface, run/verification contracts.
43
+ - **Risks & trade-offs** — failure modes, reproducibility impact, alternatives considered.
44
+ - **Effort & sequencing** — rough phases, dependencies.
45
+ - **Open questions** — carried from the PRD.
46
+
47
+ ### `<type>-<id>-non-technical-proposal.md` (stakeholders)
48
+
49
+ Same naming convention (e.g. `feat-verify-layer-non-technical-proposal.md`).
50
+
51
+ - **The problem** — in plain language, no jargon.
52
+ - **What we'll do** — the solution at a high level (embed a simplified diagram).
53
+ - **Why it matters** — value to researchers / the business.
54
+ - **What changes for users** — visible impact.
55
+ - **Timeline** — rough, in weeks, not story points.
56
+ - **Risks** — stated honestly, in plain terms.
57
+
58
+ Keep the non-technical version free of stack names, code, and acronyms unless defined.
59
+
60
+ ## 4. Convert to PDF (`md-to-pdf`)
61
+
62
+ Use the `md-to-pdf` skill. On macOS, point Puppeteer at system Chrome. Output lands
63
+ next to the input as `<name>.pdf`.
64
+
65
+ ⚠️ **The proposals embed `../diagrams/*.svg`, which sits ABOVE the `proposals/` folder.**
66
+ md-to-pdf's file server is rooted at the markdown's own directory by default, so `../` paths
67
+ **silently render as broken images**. You MUST pass `--basedir ..` (the `{slug}` dir, which
68
+ contains both `proposals/` and `diagrams/`):
69
+
70
+ ```bash
71
+ cd docs/planning/{slug}/proposals
72
+ PUPPETEER_EXECUTABLE_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
73
+ md-to-pdf <type>-<id>-technical-proposal.md --basedir ..
74
+ PUPPETEER_EXECUTABLE_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
75
+ md-to-pdf <type>-<id>-non-technical-proposal.md --basedir ..
76
+ ```
77
+
78
+ Result: `<type>-<id>-technical-proposal.pdf` and `<type>-<id>-non-technical-proposal.pdf`.
79
+
80
+ **Verify before the approval gate (do not skip):** a missing image does NOT fail the command,
81
+ so you must *look* at the output. Render a page to an image and inspect it:
82
+
83
+ ```bash
84
+ pdftoppm -png -r 70 -f 1 -l 1 <type>-<id>-technical-proposal.pdf /tmp/check # then Read /tmp/check-1.png
85
+ ```
86
+
87
+ Both PDFs must exist, be non-trivial in size, and show the diagrams (not broken-image icons).
88
+ If an image is broken, the path escaped the basedir — fix `--basedir`/filenames (URL-encode
89
+ spaces as `%20`) and re-run.
90
+
91
+ ## 5. Approval gate
92
+
93
+ Present both PDFs to the user and **stop**. Only after explicit approval continue to the
94
+ `tech-plan` phase.
@@ -0,0 +1,132 @@
1
+ ---
2
+ name: contig-begin-fast
3
+ description: Use when starting work on a Contig unit of work (a GitHub issue id or an inline brief) and you want the fast path straight to an implementation plan. Triggers on "contig-begin-fast", "cbf", "cbf bug 12", "cbf feat verify-layer", "begin fast".
4
+ arguments: "type id"
5
+ ---
6
+
7
+ # Contig Begin (Fast Track)
8
+
9
+ ## Overview
10
+
11
+ Turn a single unit of work into shipped, test-driven code. The fast track is: **isolate → gather → dig → PRD → plan → implement (TDD).** No proposal/diagram deliverables (use `contig-begin` / `cb` when you need those).
12
+
13
+ **Two non-negotiables for this whole pipeline:**
14
+ - **Always work through the agents team.** Every phase with independent units of work is dispatched to agents and synthesized — never done serially in the main thread. See *Agents team (mandatory)*.
15
+ - **Implementation is always test-first**, via `superpowers:test-driven-development`, and is itself executed by the agents team. See Phase 6.
16
+
17
+ **Invocation:** `cbf <type> <id>` — e.g. `cbf bug 12`, `cbf feat verify-layer`, `cbf chore pin-nextflow`.
18
+
19
+ - `type` ∈ `bug | feat | feature | task | chore` (normalize `feature` → `feat`).
20
+ - `id` = a **GitHub issue number** when one exists, otherwise a short descriptive **slug** for the work.
21
+ - Owner is `aliz`.
22
+
23
+ ## Task source: GitHub issue, tolerate absence
24
+
25
+ Contig's tracker is GitHub Issues, but the repo/issues may not be reachable (`gh` unauthenticated, Issues disabled, or the work was never filed). The pipeline degrades gracefully:
26
+
27
+ - If `id` is numeric and `gh issue view <id>` succeeds → use it as the source (Phase 1).
28
+ - Otherwise → ask the user for a one-paragraph **inline brief** and treat that as the source. Skip the `gh` fetch; everything else is identical.
29
+
30
+ ## Pipeline
31
+
32
+ Run phases in order. **Do not skip the review gate.** Every phase runs through the agents team, and Phase 6 is strict TDD — never do parallelizable work or implementation serially in the main thread.
33
+
34
+ ### Phase 0 — Isolate in a worktree
35
+
36
+ **REQUIRED SUB-SKILL:** Use `contig-worktrees`.
37
+
38
+ - Branch name: `<type>/<id>/aliz` (e.g. `bug/12/aliz`, `feat/verify-layer/aliz`).
39
+ - Worktree dir: `.claude/worktrees/<type>-<id>` (e.g. `.claude/worktrees/bug-12`).
40
+ - Create from `origin/master`. Contig has no `.worktreeinclude` files to copy today; run `uv sync` in the worktree before working.
41
+ - All subsequent work (context dump, PRD, plan) happens **inside this worktree.**
42
+
43
+ ### Phase 1 — Gather context (`gh`, or inline brief)
44
+
45
+ Pull what's available and save a raw dump to `docs/planning/_card/issue.md` in the worktree so later phases (and the PRD) have a single source. (Filename is id-free on purpose — the id lives in the branch/PR; the worktree is already dedicated to one unit of work.)
46
+
47
+ Gather: the issue body, labels, linked/related issues and PRs, and **comments**. If there's no reachable issue, write the user's inline brief into the same file under a "Brief" heading.
48
+
49
+ **Commands and parsing:** see `references/gather-context.md`.
50
+
51
+ ### Phase 2 — Deep dig
52
+
53
+ Before any PRD work, understand the real problem and the code it touches.
54
+
55
+ - Read the saved dump.
56
+ - Map the relevant code paths. **Contig has a `graphify-out/` graph — query it first** (`graphify query "..."`, `graphify explain "X"`) per CLAUDE.md, then read the files it points to. Relevant areas usually live under `src/contig/` (CLI in `contig.cli`, the orchestrator/agent layer, detector, verification) and `dashboard/` for UI work.
57
+ - Produce a short written "understanding" note: what the work is really asking, affected areas, ambiguities, and open questions.
58
+ - Surface contradictions between the issue/brief and the code — flag them, don't paper over them.
59
+ - Honor the strategic constraints in `CLAUDE.md` (the moat is the run/verify/reproduce layer, **not** Layer 1 workflow generation). If the work drifts into building Layer 1 as the product, flag it before planning.
60
+
61
+ ### Phase 3 — Requirements interview
62
+
63
+ **REQUIRED SUB-SKILL:** Use `prd-interview`.
64
+
65
+ - Feed it the Phase 1 dump + Phase 2 understanding as the product brief.
66
+ - Answer from the gathered context where you can; ask the user only what the context can't resolve.
67
+ - Confirm a **descriptive** feature slug (kebab-case, e.g. `verify-layer`) for `docs/planning/{slug}/`. Do **not** name the slug `<type>-<id>` — the id lives in the branch and PR, not in committed doc paths.
68
+ - Output: `docs/planning/{slug}/prd.md` (+ aspect `spec.md` files if decomposed).
69
+
70
+ ### Phase 4 — Generate & self-critique the PRD
71
+
72
+ **REQUIRED SUB-SKILL:** Use `prd-generator`.
73
+
74
+ - Refine `prd.md`, run its self-critique, and surface the 🔴/🟡 gaps.
75
+
76
+ ### ⛔ Review gate — STOP
77
+
78
+ Present the PRD and its flagged gaps. **Wait for the user's explicit approval** before planning. Do not auto-advance to tech-plan.
79
+
80
+ ### Phase 5 — Implementation plan
81
+
82
+ **REQUIRED SUB-SKILL:** Use `tech-plan`.
83
+
84
+ - Plan one aspect at a time from `prd.md` (+ `spec.md`).
85
+ - Output: `docs/planning/{slug}/{aspect}/plan_YYYYMMDD.md`.
86
+
87
+ ### Phase 6 — Implement (TDD, agents team)
88
+
89
+ Start only after the plan is approved. Implementation is **always test-first** and **always run through the agents team** — never hand-written serially in the main thread.
90
+
91
+ **REQUIRED SUB-SKILL:** Use `superpowers:test-driven-development` — strict RED → GREEN → REFACTOR; no production code before a failing test.
92
+ **REQUIRED SUB-SKILL:** Use `superpowers:subagent-driven-development` to execute the plan — dispatch one agent per independent task from `plan_YYYYMMDD.md`; parallelize independent tasks with `superpowers:dispatching-parallel-agents`.
93
+
94
+ - Each dispatched agent owns one task and follows the TDD cycle inside it: write the failing test, make it pass, refactor.
95
+ - Run the suite after each task and keep the branch green: `uv run pytest` for the Python core; `npm test` / `npm run build` in `dashboard/` for UI work.
96
+ - Commit per task on the `<type>/<id>/aliz` branch (id lives in the commit/PR, never in code).
97
+ - You stay the integrator: sequence dependent tasks, synthesize agent results, and surface blockers at each checkpoint.
98
+
99
+ ## Artifact layout (inside the worktree)
100
+
101
+ ```
102
+ docs/planning/
103
+ ├── _card/issue.md ← gh dump or inline brief (Phase 1)
104
+ ├── {slug}/prd.md ← prd-interview / prd-generator
105
+ └── {slug}/{aspect}/plan_*.md ← tech-plan
106
+ ```
107
+
108
+ Phase 6 produces **code commits** on the `<type>/<id>/aliz` branch — not documents.
109
+
110
+ ## Agents team (mandatory)
111
+
112
+ This pipeline is **always** run through a team of agents, never serially in the main thread. For each phase, dispatch agents for the independent units of work and synthesize their results yourself.
113
+
114
+ **REQUIRED SUB-SKILL:** Use `superpowers:dispatching-parallel-agents` for independent work, and `superpowers:subagent-driven-development` for executing plan tasks in Phase 6.
115
+
116
+ - **Phase 1–2:** one agent per related issue/PR (5-line summary + relevance) + one agent to map the affected code area (graphify-first). Keep the `gh` calls themselves batched in a single message.
117
+ - **Phase 6:** one agent per independent plan task; each agent works in strict TDD.
118
+
119
+ Gates, user-facing summaries, and integration stay with you — the agents do the fan-out work.
120
+
121
+ ## Common mistakes
122
+
123
+ | Mistake | Fix |
124
+ |---|---|
125
+ | Working in the primary checkout | Always create the Phase 0 worktree first |
126
+ | Slug = `bug-12` | Use a descriptive slug; the id stays in branch/PR |
127
+ | Treating a `gh` failure as fatal | Fall back to an inline brief, keep going |
128
+ | Skipping the review gate | PRD must be approved before tech-plan |
129
+ | Building Layer 1 (NL → workflow) as the product | Stop and flag — that's a dependency we consume, not the moat |
130
+ | Inventing requirements the issue doesn't support | Flag as open question in the PRD instead |
131
+ | Implementing serially in the main thread | Execute the plan through the agents team (subagent-driven-development) |
132
+ | Writing code before a failing test | Implementation is strict TDD — RED before GREEN, always |
@@ -0,0 +1,94 @@
1
+ # Gathering context with `gh` (tolerate absence)
2
+
3
+ Goal: dump the issue, its linked issues/PRs, and comments into
4
+ `docs/planning/_card/issue.md` inside the worktree. If nothing is reachable,
5
+ fall back to an inline brief from the user.
6
+
7
+ ## Prerequisites
8
+
9
+ - GitHub CLI authenticated: `gh auth status`. If it errors, you're not logged in.
10
+ - Repo: `haqaliz/contig`. The current checkout's `origin` is this repo, so `gh`
11
+ commands run from the worktree pick it up automatically.
12
+
13
+ ## 0. Reachability probe
14
+
15
+ ```bash
16
+ gh issue view "$ID" --json number,title >/dev/null 2>&1 && echo OK || echo FALLBACK
17
+ ```
18
+
19
+ - `OK` → continue with the `gh` path below.
20
+ - `FALLBACK` (issue missing, Issues disabled, repo unresolved, or `ID` is a slug)
21
+ → ask the user for a one-paragraph brief and write it to the dump under a
22
+ **Brief** heading. Skip the rest of this file.
23
+
24
+ ## 1. The issue itself
25
+
26
+ ```bash
27
+ gh issue view "$ID" --json number,title,state,labels,author,body,url,assignees,milestone
28
+ ```
29
+
30
+ `body` is Markdown already — no tag-stripping needed (unlike the old Azure HTML).
31
+
32
+ ## 2. Linked / related issues and PRs
33
+
34
+ Cross-references and the timeline expose linked items:
35
+
36
+ ```bash
37
+ # Comments + events, including cross-references to other issues/PRs
38
+ gh issue view "$ID" --json number,title -q .number >/dev/null
39
+ gh api "repos/haqaliz/contig/issues/$ID/timeline" \
40
+ --jq '.[] | select(.event=="cross-referenced" or .event=="connected") | .source.issue.number' \
41
+ 2>/dev/null | sort -u
42
+ ```
43
+
44
+ Fetch each referenced item (parallelize across agents when there are several):
45
+
46
+ ```bash
47
+ gh issue view "$RELATED_ID" --json number,title,state,url 2>/dev/null \
48
+ || gh pr view "$RELATED_ID" --json number,title,state,url
49
+ ```
50
+
51
+ ## 3. Comments
52
+
53
+ ```bash
54
+ gh issue view "$ID" --comments
55
+ ```
56
+
57
+ Or structured, for clean attribution:
58
+
59
+ ```bash
60
+ gh api "repos/haqaliz/contig/issues/$ID/comments" \
61
+ --jq '.[] | "[" + .user.login + " @ " + .created_at + "]\n" + .body'
62
+ ```
63
+
64
+ ## 4. Attachments
65
+
66
+ GitHub issue attachments are inline Markdown image/file links in the body and
67
+ comments (`![](https://github.com/.../assets/...)`). Leave images for the user
68
+ to attach separately (same convention as before). If a non-image file link is
69
+ relevant (a log, a `.txt`), download it:
70
+
71
+ ```bash
72
+ curl -sSL "$URL" -o "docs/planning/_card/attachments/$NAME" # mkdir -p first
73
+ ```
74
+
75
+ ## 5. Write the dump
76
+
77
+ Assemble into `docs/planning/_card/issue.md`:
78
+
79
+ - Header: number, type, title, state, author, labels, link to the issue.
80
+ - Body (verbatim Markdown).
81
+ - Linked issues/PRs: number, title, state, one-line relevance.
82
+ - Comments: chronological, attributed.
83
+ - Attachments: list of any downloaded files (note images deferred to the user).
84
+
85
+ If you took the FALLBACK path, the file is just:
86
+
87
+ ```markdown
88
+ # {type} {id} — {short title}
89
+
90
+ ## Brief
91
+ {the user's pasted paragraph, verbatim}
92
+ ```
93
+
94
+ Either way, this file is the single source the rest of the pipeline reads from.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: contig-end
3
+ description: Use when finishing local work on a Contig unit of work after the PR is merged and you also need a completion report on Desktop. Triggers on "contig-end", "ce", "ce bug 12", "ce feat verify-layer", "end full".
4
+ arguments: "type id"
5
+ ---
6
+
7
+ # Contig End (Full Track)
8
+
9
+ ## Overview
10
+
11
+ Same cleanup as `contig-end-fast`, **plus** a completion report at the end via `contig-report`.
12
+
13
+ **Invocation:** `ce <type> <id>` — e.g. `ce bug 12`, `ce feat verify-layer`.
14
+ Arguments and conventions are identical to `contig-end-fast`.
15
+
16
+ ## Pipeline
17
+
18
+ **REQUIRED SUB-SKILL:** Use `contig-end-fast` for the cleanup pipeline.
19
+
20
+ Run its **Phase 0 → Phase 2 exactly as written** (safety check → master + pull → remove worktree → delete branch). Only proceed to Phase 3 once cleanup verification passes.
21
+
22
+ ### Phase 3 — Completion report
23
+
24
+ **REQUIRED SUB-SKILL:** Use `contig-report` with the unit-of-work id and the corresponding type.
25
+
26
+ The two skills use slightly different type vocabularies — map before invoking:
27
+
28
+ | `ce` arg | `contig-report` arg |
29
+ |---|---|
30
+ | `bug` | `bug` |
31
+ | `task` | `task` |
32
+ | `chore` | `task` |
33
+ | `feat` | `feature` |
34
+ | `feature` | `feature` |
35
+
36
+ Example: `ce bug 12` → invoke `contig-report` with `bug` + `12` → writes `/Users/aliz/Desktop/bug-12-completion.md`.
37
+
38
+ `contig-report` fetches the issue via `gh` when reachable (otherwise works from the merged PR / what we just did) and produces the standard template. If it asks for a screenshot/video, provide one (or hand it to the user to attach), then confirm the file landed on Desktop.
39
+
40
+ ### Phase 4 — Comment on the issue (optional)
41
+
42
+ Same approach as `contig-end-fast` Phase 3 — ask the user, draft (using the issue + the just-generated report as source material), confirm, then `gh issue comment <id>`. Skip if there's no reachable issue.
43
+
44
+ The comment can mirror the report's plain-English summary in a sentence or two. Same tone rules: no em dashes, no jargon, no commit hashes. Skip entirely if the user declines.
45
+
46
+ ## Common mistakes
47
+
48
+ | Mistake | Fix |
49
+ |---|---|
50
+ | Running the report before cleanup | Phases 0–2 first; the report is last |
51
+ | Skipping the report on purpose | Use `contig-end-fast` / `cef` instead |
52
+ | Passing the wrong type to `contig-report` | Apply the mapping table (`feat`/`feature` → `feature`, `chore` → `task`) |
53
+ | Posting the issue comment before the report | Phase 4 comes after Phase 3; the report's plain-English summary is good source material |
54
+ | Posting the comment without confirmation | Draft first, confirm with the user, then post |
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: contig-end-fast
3
+ description: Use when finishing local work on a Contig unit of work after the PR is merged and you want to clean up without generating a completion report. Triggers on "contig-end-fast", "cef", "cef bug 12", "cef feat verify-layer", "end fast".
4
+ arguments: "type id"
5
+ ---
6
+
7
+ # Contig End (Fast Track)
8
+
9
+ ## Overview
10
+
11
+ Closes out a unit of work's local state after the PR has merged: **master → pull → remove worktree → delete branch.** No report (use `contig-end` / `ce` for that).
12
+
13
+ **Invocation:** `cef <type> <id>` — e.g. `cef bug 12`, `cef feat verify-layer`.
14
+
15
+ - `type` ∈ `bug | feat | feature | task | chore` (normalize `feature` → `feat`)
16
+ - `id` = the GitHub issue number, or the slug used at begin time
17
+ - Owner is `aliz`
18
+ - Branch: `<type>/<id>/aliz`; worktree dir: `.claude/worktrees/<type>-<id>`
19
+
20
+ Contig is a single repo, so this runs once.
21
+
22
+ ## Pipeline
23
+
24
+ ### Phase 0 — Safety check
25
+
26
+ Before removing anything:
27
+
28
+ - **Worktree clean?** `git -C <worktree> status --porcelain` must be empty. If not, stop — commit or stash first.
29
+ - **Branch merged?** Confirm the PR is merged (`gh pr view <PR> --json state,mergedAt` if reachable). `git branch -d` will refuse an unmerged branch on purpose; do not bypass with `-D` without explicit user OK.
30
+ - **You may be inside the worktree being removed.** Resolve the primary checkout first (Phase 1) and run all commands from there.
31
+
32
+ ### Phase 1 — Master, pulled
33
+
34
+ Resolve the **primary** checkout (not the worktree). The first line of `git worktree list` is the primary:
35
+
36
+ ```bash
37
+ PRIMARY=$(git worktree list | head -1 | awk '{print $1}')
38
+ ```
39
+
40
+ Switch and pull, fast-forward only:
41
+
42
+ ```bash
43
+ git -C "$PRIMARY" checkout master
44
+ git -C "$PRIMARY" pull --ff-only origin master
45
+ ```
46
+
47
+ ### Phase 2 — Remove worktree, delete branch
48
+
49
+ ```bash
50
+ WORKTREE_NAME="<type>-<id>" # e.g. bug-12, feat-verify-layer
51
+ BRANCH="<type>/<id>/aliz" # e.g. bug/12/aliz, feat/verify-layer/aliz
52
+
53
+ git -C "$PRIMARY" worktree remove ".claude/worktrees/$WORKTREE_NAME"
54
+ git -C "$PRIMARY" branch -d "$BRANCH"
55
+ ```
56
+
57
+ If `worktree remove` refuses due to uncommitted/untracked files, go back to Phase 0 — don't pass `--force` silently.
58
+
59
+ If `branch -d` refuses because the branch isn't merged into master, surface the message — the PR may not be merged, or there are unpushed commits. Don't use `-D` silently.
60
+
61
+ After both succeed, verify:
62
+
63
+ ```bash
64
+ git -C "$PRIMARY" worktree list # the worktree should be gone
65
+ git -C "$PRIMARY" branch --list "$BRANCH" # should print nothing
66
+ ```
67
+
68
+ ### Phase 3 — Comment on the issue (optional)
69
+
70
+ Optional, and only if there's a reachable GitHub issue. Ask first: *"Want me to post a short comment on the issue explaining what we did?"* If the user declines, there's nothing meaningful to say, or there's no issue (the work came from an inline brief), skip.
71
+
72
+ Otherwise:
73
+
74
+ 1. **Draft a short note** (2–4 sentences). Sources, in order of preference:
75
+ - What the user tells you to say.
76
+ - The merged PR's title + description (`gh pr view <PR>`), if accessible.
77
+ - A best-effort summary from the issue title and the change verb.
78
+
79
+ Keep it friendly, light on jargon, no em dashes, no commit hashes, no file paths. The change verb matches the type: `bug → fixed`, `task → done`, `feat`/`feature → shipped`, `chore → done`. Example: *"Shipped the verification layer. Runs now self-check their outputs and flag mismatches before returning a result. Let me know if anything looks off."*
80
+
81
+ 2. **Confirm the draft** with the user before posting.
82
+
83
+ 3. **Post it** via `gh`:
84
+
85
+ ```bash
86
+ gh issue comment "$ID" --body "<confirmed comment text>"
87
+ ```
88
+
89
+ On success `gh` prints the comment URL. Tell the user it landed. If `gh` errors (not authenticated, Issues disabled), surface it and stop — don't retry blindly.
90
+
91
+ ## Common mistakes
92
+
93
+ | Mistake | Fix |
94
+ |---|---|
95
+ | Running from inside the worktree being removed | Resolve `PRIMARY` first, run commands from there |
96
+ | Using `git pull` (allowing merge) | Use `--ff-only` |
97
+ | Forcing branch delete with `-D` | Only after explicit user OK — `-d` refuses unmerged for a reason |
98
+ | Forcing worktree remove with `--force` | Same — never silently discard uncommitted work |
99
+ | Worktree dir vs branch confusion | Worktree dir is `<type>-<id>` (e.g. `bug-12`); branch is `<type>/<id>/aliz` |
100
+ | Posting the issue comment without confirmation | Draft first, show the user, only post after explicit OK |
101
+ | Trying to comment when the work has no issue | Skip Phase 3 — it came from an inline brief |
@@ -0,0 +1,104 @@
1
+ ---
2
+ name: contig-report
3
+ description: Use when a Contig unit of work (bug, task, feature) is done and you want a brief, friendly, non-technical completion note saved on Desktop to share with the team.
4
+ allowed-tools: Read, Grep, Glob, Bash, Write
5
+ arguments: "type id"
6
+ ---
7
+
8
+ # Contig Completion Note
9
+
10
+ A short, friendly, non-technical heads-up that a unit of work is done. Written like a teammate would write it — no jargon, no commit hashes, no checklists. Just one plain-English sentence about what changed, plus a link and a screenshot.
11
+
12
+ ## Arguments
13
+
14
+ - `type` ∈ `bug | task | feature`
15
+ - `id` = the GitHub issue number, or the slug used at begin time
16
+
17
+ Usage: `/contig-report bug 12` or `/contig-report feature verify-layer`.
18
+
19
+ ## When to use
20
+
21
+ - A unit of work is finished and you want to let the team know in a human way.
22
+ - You've closed (or are about to close) a GitHub issue, or merged its PR.
23
+
24
+ ## Output
25
+
26
+ Markdown file saved to `/Users/aliz/Desktop/{type}-{id}-completion.md`.
27
+
28
+ Examples:
29
+ - `/Users/aliz/Desktop/bug-12-completion.md`
30
+ - `/Users/aliz/Desktop/task-pin-nextflow-completion.md`
31
+ - `/Users/aliz/Desktop/feature-verify-layer-completion.md`
32
+
33
+ ## The template
34
+
35
+ One template, three small verb tweaks. Keep it warm, short, and free of technical detail.
36
+
37
+ ```markdown
38
+ ## #{id} - {Feature or area} - {Short Title}
39
+
40
+ Hey! Quick note that this one's {verb}.
41
+
42
+ **What changed (in plain words):**
43
+ {One or two friendly sentences. What's different for the user now. No jargon. No em dashes.}
44
+
45
+ **See it live:** {link to the PR, the dashboard area, or the CLI command}
46
+ **Screenshot/video:** {attached, or link}
47
+
48
+ If anything looks off or you'd like a tweak, just say the word.
49
+ ```
50
+
51
+ Verb per type:
52
+
53
+ | Type | Verb |
54
+ |---|---|
55
+ | `bug` | fixed |
56
+ | `task` | done |
57
+ | `feature` | shipped |
58
+
59
+ ## Tone rules
60
+
61
+ - Write like you're messaging a teammate, not filing a ticket.
62
+ - Plain English only. Swap out words like *deduplicated, refactored, idempotent, artifact, schema, pipeline DAG, contig, orchestrator* for everyday phrasing.
63
+ - No checklists, no testing matrices, no commit hashes, no branch names, no file paths — those live in the PR, not in this note.
64
+ - Two or three short paragraphs max. If it reads like docs, trim again.
65
+ - **Never use the em dash character `—` in the note.** It's a tell that an AI wrote it. Use a comma, a period, or a regular hyphen with spaces (`-`) instead.
66
+ - A friendly closer is welcome ("Let me know what you think.", "Happy to revisit if needed.").
67
+
68
+ ## Workflow
69
+
70
+ 1. **Get the context.** Prefer the GitHub issue if reachable; otherwise use the merged PR or what we just did:
71
+ ```bash
72
+ gh issue view "$ID" 2>/dev/null || gh pr view "$PR" 2>/dev/null
73
+ ```
74
+ If neither resolves, write the note from the work you just completed in this session.
75
+ 2. **Distill** the change into one or two plain sentences. Resist the urge to add detail.
76
+ 3. **Pick the "See it live" target** that fits the work: the merged PR link, the dashboard page (e.g. `http://localhost:3000/...` or the deployed URL), or the exact CLI command a teammate would run (`uv run contig ...`).
77
+ 4. **Ask the user for a screenshot or short video** if one isn't already on hand.
78
+ 5. **Write** the note to `/Users/aliz/Desktop/{type}-{id}-completion.md` and tell the user it's ready.
79
+
80
+ ## Optional: cross-check
81
+
82
+ Only include if the user explicitly asks for it. Append one short, friendly line:
83
+
84
+ ```markdown
85
+ **Also checked:** {a couple of related areas you peeked at, in plain words}
86
+ ```
87
+
88
+ Don't add this by default — it makes the note look like an audit.
89
+
90
+ ## Example (feature)
91
+
92
+ ```markdown
93
+ ## #34 - Verification - Output self-check
94
+
95
+ Hey! Quick note that this one's shipped.
96
+
97
+ **What changed (in plain words):**
98
+ Runs now double-check their own results before handing them back, so if something looks off it gets flagged instead of slipping through.
99
+
100
+ **See it live:** run `uv run contig run sample.fastq` and watch the verify step at the end
101
+ **Screenshot/video:** attached
102
+
103
+ If anything looks off or you'd like a tweak, just say the word.
104
+ ```