project-tiny-context-harness 0.2.85 → 0.6.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.
Files changed (361) hide show
  1. package/README.md +163 -428
  2. package/assets/README.md +283 -455
  3. package/assets/README.zh-CN.md +199 -123
  4. package/assets/agents/AGENTS_CORE.md +54 -67
  5. package/assets/context_templates/context.toml +3 -0
  6. package/assets/context_templates/global.md +6 -6
  7. package/assets/github/harness.yml +2 -2
  8. package/assets/skills/context_development_engineer/SKILL.md +91 -107
  9. package/assets/skills/context_product_plan/SKILL.md +18 -28
  10. package/assets/skills/context_surface_contract/SKILL.md +35 -38
  11. package/assets/skills/context_uiux_design/SKILL.md +31 -30
  12. package/assets/skills/long-task-workflow/SKILL.md +76 -0
  13. package/assets/skills/long-task-workflow/agents/openai.yaml +4 -0
  14. package/assets/skills/long-task-workflow/references/authority-lifecycle.md +41 -0
  15. package/assets/skills/long-task-workflow/references/contract-authoring.md +62 -0
  16. package/assets/skills/long-task-workflow/references/evidence-design.md +45 -0
  17. package/assets/skills/normal-long-task/SKILL.md +12 -489
  18. package/assets/skills/source-plan-authoring/SKILL.md +379 -0
  19. package/assets/tools/validate_context.py +293 -127
  20. package/dist/cli.js +3 -1
  21. package/dist/commands/check-modularity.js +33 -10
  22. package/dist/commands/composite-campaign.d.ts +1 -0
  23. package/dist/commands/composite-campaign.js +8 -0
  24. package/dist/commands/composite-long-task.d.ts +1 -6
  25. package/dist/commands/composite-long-task.js +7 -163
  26. package/dist/commands/delivery-set.d.ts +1 -0
  27. package/dist/commands/delivery-set.js +8 -0
  28. package/dist/commands/disable.d.ts +1 -0
  29. package/dist/commands/disable.js +15 -0
  30. package/dist/commands/enable.d.ts +1 -0
  31. package/dist/commands/enable.js +14 -0
  32. package/dist/commands/export-context-args.js +13 -4
  33. package/dist/commands/export-context.js +18 -7
  34. package/dist/commands/index.js +42 -30
  35. package/dist/commands/init.js +12 -6
  36. package/dist/commands/long-task-authoring.d.ts +3 -0
  37. package/dist/commands/long-task-authoring.js +92 -0
  38. package/dist/commands/long-task-explain.d.ts +1 -0
  39. package/dist/commands/long-task-explain.js +52 -0
  40. package/dist/commands/long-task.d.ts +1 -0
  41. package/dist/commands/long-task.js +226 -0
  42. package/dist/commands/package-source.js +2 -2
  43. package/dist/commands/upgrade.js +10 -10
  44. package/dist/index.d.ts +11 -1
  45. package/dist/index.js +8 -0
  46. package/dist/lib/config.js +34 -8
  47. package/dist/lib/context-default-footprint.d.ts +16 -0
  48. package/dist/lib/context-default-footprint.js +107 -0
  49. package/dist/lib/context-export.js +105 -41
  50. package/dist/lib/context-graph-snapshot.d.ts +18 -0
  51. package/dist/lib/context-graph-snapshot.js +171 -0
  52. package/dist/lib/context-manifest-schema.d.ts +28 -0
  53. package/dist/lib/context-manifest-schema.js +150 -0
  54. package/dist/lib/context-manifest.js +28 -20
  55. package/dist/lib/context-templates.js +5 -5
  56. package/dist/lib/design-md.js +1 -1
  57. package/dist/lib/doctor.js +54 -1
  58. package/dist/lib/harness-root.js +25 -8
  59. package/dist/lib/init.js +6 -3
  60. package/dist/lib/legacy-managed-scan.js +23 -7
  61. package/dist/lib/legacy-sdlc-migration.js +21 -11
  62. package/dist/lib/long-task-acceptance-reference.d.ts +22 -0
  63. package/dist/lib/long-task-acceptance-reference.js +46 -0
  64. package/dist/lib/long-task-acceptance-shape.d.ts +5 -0
  65. package/dist/lib/long-task-acceptance-shape.js +131 -0
  66. package/dist/lib/long-task-activation-validation.d.ts +21 -0
  67. package/dist/lib/long-task-activation-validation.js +136 -0
  68. package/dist/lib/long-task-artifacts.d.ts +5 -0
  69. package/dist/lib/long-task-artifacts.js +34 -0
  70. package/dist/lib/long-task-assertions-v2.d.ts +22 -0
  71. package/dist/lib/long-task-assertions-v2.js +212 -0
  72. package/dist/lib/long-task-authoring-authority-preview.d.ts +5 -0
  73. package/dist/lib/long-task-authoring-authority-preview.js +85 -0
  74. package/dist/lib/long-task-authoring-preflight-diagnostics.d.ts +8 -0
  75. package/dist/lib/long-task-authoring-preflight-diagnostics.js +179 -0
  76. package/dist/lib/long-task-authoring-preflight-repair-order.d.ts +8 -0
  77. package/dist/lib/long-task-authoring-preflight-repair-order.js +95 -0
  78. package/dist/lib/long-task-authoring-preflight-types.d.ts +46 -0
  79. package/dist/lib/long-task-authoring-preflight-types.js +38 -0
  80. package/dist/lib/long-task-authoring-preflight.d.ts +3 -0
  81. package/dist/lib/long-task-authoring-preflight.js +44 -0
  82. package/dist/lib/long-task-authority-material-diff.d.ts +17 -0
  83. package/dist/lib/long-task-authority-material-diff.js +152 -0
  84. package/dist/lib/long-task-authority-materials.d.ts +7 -0
  85. package/dist/lib/long-task-authority-materials.js +83 -0
  86. package/dist/lib/long-task-authority-policy.d.ts +168 -0
  87. package/dist/lib/long-task-authority-policy.js +181 -0
  88. package/dist/lib/long-task-authority-revision-details.d.ts +19 -0
  89. package/dist/lib/long-task-authority-revision-details.js +192 -0
  90. package/dist/lib/long-task-authority-revision-enforcement.d.ts +3 -0
  91. package/dist/lib/long-task-authority-revision-enforcement.js +41 -0
  92. package/dist/lib/long-task-authority-revision-types.d.ts +50 -0
  93. package/dist/lib/long-task-authority-revision-types.js +1 -0
  94. package/dist/lib/long-task-authority-revision.d.ts +4 -0
  95. package/dist/lib/long-task-authority-revision.js +188 -0
  96. package/dist/lib/long-task-authority-transition-policy.d.ts +62 -0
  97. package/dist/lib/long-task-authority-transition-policy.js +62 -0
  98. package/dist/lib/long-task-authority-types.d.ts +96 -0
  99. package/dist/lib/long-task-authority-types.js +1 -0
  100. package/dist/lib/long-task-authority.d.ts +7 -0
  101. package/dist/lib/long-task-authority.js +142 -0
  102. package/dist/lib/long-task-boundary-check.d.ts +15 -0
  103. package/dist/lib/long-task-boundary-check.js +9 -0
  104. package/dist/lib/long-task-check-evidence-decoder.d.ts +3 -0
  105. package/dist/lib/long-task-check-evidence-decoder.js +74 -0
  106. package/dist/lib/long-task-check-execution-policy.d.ts +18 -0
  107. package/dist/lib/long-task-check-execution-policy.js +36 -0
  108. package/dist/lib/long-task-check-runner.d.ts +2 -0
  109. package/dist/lib/long-task-check-runner.js +181 -0
  110. package/dist/lib/long-task-check-shape.d.ts +2 -0
  111. package/dist/lib/long-task-check-shape.js +136 -0
  112. package/dist/lib/long-task-claim-definitions.d.ts +7 -0
  113. package/dist/lib/long-task-claim-definitions.js +78 -0
  114. package/dist/lib/long-task-claim-proof-policy.d.ts +4 -0
  115. package/dist/lib/long-task-claim-proof-policy.js +57 -0
  116. package/dist/lib/long-task-claims.d.ts +10 -0
  117. package/dist/lib/long-task-claims.js +187 -0
  118. package/dist/lib/long-task-context-authority-topology.d.ts +7 -0
  119. package/dist/lib/long-task-context-authority-topology.js +37 -0
  120. package/dist/lib/long-task-context-authority.d.ts +14 -0
  121. package/dist/lib/long-task-context-authority.js +66 -0
  122. package/dist/lib/long-task-contract-types.d.ts +203 -0
  123. package/dist/lib/long-task-contract-types.js +1 -0
  124. package/dist/lib/long-task-counterfactual-claim-policy.d.ts +10 -0
  125. package/dist/lib/long-task-counterfactual-claim-policy.js +57 -0
  126. package/dist/lib/long-task-counterfactual-sandbox.d.ts +6 -0
  127. package/dist/lib/long-task-counterfactual-sandbox.js +87 -0
  128. package/dist/lib/long-task-counterfactual-types.d.ts +24 -0
  129. package/dist/lib/long-task-counterfactual-types.js +1 -0
  130. package/dist/lib/long-task-delivery-compiler.d.ts +10 -0
  131. package/dist/lib/long-task-delivery-compiler.js +129 -0
  132. package/dist/lib/long-task-delivery-parser.d.ts +13 -0
  133. package/dist/lib/long-task-delivery-parser.js +90 -0
  134. package/dist/lib/long-task-delivery-preflight.d.ts +5 -0
  135. package/dist/lib/long-task-delivery-preflight.js +151 -0
  136. package/dist/lib/long-task-delivery-shape.d.ts +5 -0
  137. package/dist/lib/long-task-delivery-shape.js +5 -0
  138. package/dist/lib/long-task-delivery-types.d.ts +8 -0
  139. package/dist/lib/long-task-delivery-types.js +8 -0
  140. package/dist/lib/long-task-delivery-validation.d.ts +3 -0
  141. package/dist/lib/long-task-delivery-validation.js +175 -0
  142. package/dist/lib/long-task-evidence-adapter-policy.d.ts +4 -0
  143. package/dist/lib/long-task-evidence-adapter-policy.js +15 -0
  144. package/dist/lib/long-task-evidence-adapter-types.d.ts +1 -0
  145. package/dist/lib/long-task-evidence-adapter-types.js +1 -0
  146. package/dist/lib/long-task-evidence-findings.d.ts +5 -0
  147. package/dist/lib/long-task-evidence-findings.js +113 -0
  148. package/dist/lib/long-task-evidence-sensitivity-policy.d.ts +4 -0
  149. package/dist/lib/long-task-evidence-sensitivity-policy.js +98 -0
  150. package/dist/lib/long-task-evidence-v2.d.ts +5 -0
  151. package/dist/lib/long-task-evidence-v2.js +226 -0
  152. package/dist/lib/long-task-explain-acceptance-link.d.ts +46 -0
  153. package/dist/lib/long-task-explain-acceptance-link.js +96 -0
  154. package/dist/lib/long-task-explain-claim-links.d.ts +45 -0
  155. package/dist/lib/long-task-explain-claim-links.js +88 -0
  156. package/dist/lib/long-task-explain-source-links.d.ts +93 -0
  157. package/dist/lib/long-task-explain-source-links.js +51 -0
  158. package/dist/lib/long-task-final-v2.d.ts +2 -0
  159. package/dist/lib/long-task-final-v2.js +124 -0
  160. package/dist/lib/long-task-finding-context.d.ts +3 -0
  161. package/dist/lib/long-task-finding-context.js +63 -0
  162. package/dist/lib/long-task-freshness.d.ts +3 -0
  163. package/dist/lib/long-task-freshness.js +80 -0
  164. package/dist/lib/long-task-hook-install.d.ts +9 -0
  165. package/dist/lib/long-task-hook-install.js +184 -0
  166. package/dist/lib/long-task-hook-preflight.d.ts +7 -0
  167. package/dist/lib/long-task-hook-preflight.js +58 -0
  168. package/dist/lib/long-task-observation-ownership.d.ts +2 -0
  169. package/dist/lib/long-task-observation-ownership.js +22 -0
  170. package/dist/lib/long-task-outcome-parser.d.ts +4 -0
  171. package/dist/lib/long-task-outcome-parser.js +100 -0
  172. package/dist/lib/long-task-paths.d.ts +49 -0
  173. package/dist/lib/long-task-paths.js +418 -0
  174. package/dist/lib/long-task-playwright-counterfactual-policy.d.ts +7 -0
  175. package/dist/lib/long-task-playwright-counterfactual-policy.js +125 -0
  176. package/dist/lib/long-task-playwright-evidence.d.ts +6 -0
  177. package/dist/lib/long-task-playwright-evidence.js +244 -0
  178. package/dist/lib/long-task-product-shape.d.ts +6 -0
  179. package/dist/lib/long-task-product-shape.js +73 -0
  180. package/dist/lib/long-task-progress.d.ts +4 -0
  181. package/dist/lib/long-task-progress.js +114 -0
  182. package/dist/lib/long-task-protected-files.d.ts +1 -0
  183. package/dist/lib/long-task-protected-files.js +30 -0
  184. package/dist/lib/long-task-required-proof-surfaces.d.ts +2 -0
  185. package/dist/lib/long-task-required-proof-surfaces.js +13 -0
  186. package/dist/lib/long-task-requirement-shape.d.ts +2 -0
  187. package/dist/lib/long-task-requirement-shape.js +18 -0
  188. package/dist/lib/long-task-risk-surfaces.d.ts +2 -0
  189. package/dist/lib/long-task-risk-surfaces.js +60 -0
  190. package/dist/lib/long-task-risk-types.d.ts +5 -0
  191. package/dist/lib/long-task-risk-types.js +12 -0
  192. package/dist/lib/long-task-risk.d.ts +9 -0
  193. package/dist/lib/long-task-risk.js +132 -0
  194. package/dist/lib/long-task-root-shape.d.ts +4 -0
  195. package/dist/lib/long-task-root-shape.js +86 -0
  196. package/dist/lib/long-task-runner-environment.d.ts +7 -0
  197. package/dist/lib/long-task-runner-environment.js +57 -0
  198. package/dist/lib/long-task-runner-files.d.ts +3 -0
  199. package/dist/lib/long-task-runner-files.js +39 -0
  200. package/dist/lib/long-task-runner-freeze.d.ts +2 -0
  201. package/dist/lib/long-task-runner-freeze.js +168 -0
  202. package/dist/lib/long-task-runtime-types.d.ts +214 -0
  203. package/dist/lib/long-task-runtime-types.js +1 -0
  204. package/dist/lib/long-task-shape-primitives.d.ts +17 -0
  205. package/dist/lib/long-task-shape-primitives.js +81 -0
  206. package/dist/lib/long-task-source-authority-types.d.ts +13 -0
  207. package/dist/lib/long-task-source-authority-types.js +1 -0
  208. package/dist/lib/long-task-source-claim-validation.d.ts +5 -0
  209. package/dist/lib/long-task-source-claim-validation.js +96 -0
  210. package/dist/lib/long-task-source-continuity.d.ts +4 -0
  211. package/dist/lib/long-task-source-continuity.js +57 -0
  212. package/dist/lib/long-task-source-inventory.d.ts +2 -0
  213. package/dist/lib/long-task-source-inventory.js +21 -0
  214. package/dist/lib/long-task-source-item-parser.d.ts +3 -0
  215. package/dist/lib/long-task-source-item-parser.js +112 -0
  216. package/dist/lib/long-task-source-shape.d.ts +2 -0
  217. package/dist/lib/long-task-source-shape.js +56 -0
  218. package/dist/lib/long-task-source-target-continuity.d.ts +4 -0
  219. package/dist/lib/long-task-source-target-continuity.js +80 -0
  220. package/dist/lib/long-task-source-target-index.d.ts +12 -0
  221. package/dist/lib/long-task-source-target-index.js +76 -0
  222. package/dist/lib/long-task-source-validation.d.ts +3 -0
  223. package/dist/lib/long-task-source-validation.js +46 -0
  224. package/dist/lib/long-task-state.d.ts +91 -0
  225. package/dist/lib/long-task-state.js +611 -0
  226. package/dist/lib/long-task-status-projection.d.ts +21 -0
  227. package/dist/lib/long-task-status-projection.js +116 -0
  228. package/dist/lib/long-task-status-v2.d.ts +37 -0
  229. package/dist/lib/long-task-status-v2.js +306 -0
  230. package/dist/lib/long-task-technical-shape.d.ts +3 -0
  231. package/dist/lib/long-task-technical-shape.js +44 -0
  232. package/dist/lib/long-task-verifier-authority.d.ts +12 -0
  233. package/dist/lib/long-task-verifier-authority.js +47 -0
  234. package/dist/lib/long-task-verifier-identity.d.ts +2 -0
  235. package/dist/lib/long-task-verifier-identity.js +55 -0
  236. package/dist/lib/long-task-verifier-v2.d.ts +13 -0
  237. package/dist/lib/long-task-verifier-v2.js +266 -0
  238. package/dist/lib/long-task-workspace-runtime-types.d.ts +23 -0
  239. package/dist/lib/long-task-workspace-runtime-types.js +1 -0
  240. package/dist/lib/long-task-workspace.d.ts +25 -0
  241. package/dist/lib/long-task-workspace.js +366 -0
  242. package/dist/lib/managed-file.js +20 -5
  243. package/dist/lib/migrations.js +156 -32
  244. package/dist/lib/modularity.d.ts +27 -1
  245. package/dist/lib/modularity.js +499 -23
  246. package/dist/lib/package-json-config.js +14 -5
  247. package/dist/lib/package-source.js +4 -2
  248. package/dist/lib/profiles.d.ts +13 -0
  249. package/dist/lib/profiles.js +66 -0
  250. package/dist/lib/schema-guard.js +4 -2
  251. package/dist/lib/source-files.js +14 -7
  252. package/dist/lib/source-pack-classify.js +91 -19
  253. package/dist/lib/source-pack-config.js +25 -8
  254. package/dist/lib/source-pack-export.js +84 -25
  255. package/dist/lib/source-pack-manifest.js +18 -6
  256. package/dist/lib/source-pack-records.js +35 -11
  257. package/dist/lib/source-pack-render.js +47 -18
  258. package/dist/lib/stable-json.d.ts +2 -0
  259. package/dist/lib/stable-json.js +21 -0
  260. package/dist/lib/strict-codec.d.ts +4 -0
  261. package/dist/lib/strict-codec.js +65 -0
  262. package/dist/lib/sync-engine.js +76 -24
  263. package/dist/lib/types.d.ts +8 -1
  264. package/dist/lib/upgrade.js +4 -3
  265. package/dist/lib/validators.js +218 -191
  266. package/dist/long-task-hook.d.ts +2 -0
  267. package/dist/long-task-hook.js +55 -0
  268. package/dist/schemas/long-task-delivery-v2/long-task-delivery-v2.schema.json +340 -0
  269. package/dist/schemas/long-task-delivery-v2/long-task-outcomes-v2.schema.json +18 -0
  270. package/migrations/README.md +8 -3
  271. package/package.json +17 -6
  272. package/source-mappings.yaml +0 -3
  273. package/assets/protected-harness-baseline.json +0 -20
  274. package/assets/skills/composite-long-task-workflow/SKILL.md +0 -245
  275. package/assets/skills/composite-long-task-workflow/assets/execution-binding.template.md +0 -62
  276. package/assets/skills/composite-long-task-workflow/assets/goal-objective.template.md +0 -17
  277. package/assets/skills/composite-long-task-workflow/references/composite-long-task-workflow-protocol.md +0 -682
  278. package/dist/commands/superpowers.d.ts +0 -1
  279. package/dist/commands/superpowers.js +0 -8
  280. package/dist/lib/composite-long-task-renderer.d.ts +0 -12
  281. package/dist/lib/composite-long-task-renderer.js +0 -109
  282. package/dist/lib/plan-acceptance-artifacts.d.ts +0 -1
  283. package/dist/lib/plan-acceptance-artifacts.js +0 -220
  284. package/dist/lib/plan-acceptance-evidence.d.ts +0 -2
  285. package/dist/lib/plan-acceptance-evidence.js +0 -108
  286. package/dist/lib/plan-acceptance-json.d.ts +0 -15
  287. package/dist/lib/plan-acceptance-json.js +0 -133
  288. package/dist/lib/plan-acceptance-validator.d.ts +0 -2
  289. package/dist/lib/plan-acceptance-validator.js +0 -209
  290. package/dist/lib/plan-contract-validator.d.ts +0 -2
  291. package/dist/lib/plan-contract-validator.js +0 -127
  292. package/dist/lib/plan-validator-common.d.ts +0 -24
  293. package/dist/lib/plan-validator-common.js +0 -196
  294. package/dist/lib/superpowers-task-ac010.d.ts +0 -6
  295. package/dist/lib/superpowers-task-ac010.js +0 -26
  296. package/dist/lib/superpowers-task-assertion-normalizers.d.ts +0 -3
  297. package/dist/lib/superpowers-task-assertion-normalizers.js +0 -74
  298. package/dist/lib/superpowers-task-assertions.d.ts +0 -20
  299. package/dist/lib/superpowers-task-assertions.js +0 -257
  300. package/dist/lib/superpowers-task-attempt.d.ts +0 -4
  301. package/dist/lib/superpowers-task-attempt.js +0 -102
  302. package/dist/lib/superpowers-task-command-run-correlation.d.ts +0 -8
  303. package/dist/lib/superpowers-task-command-run-correlation.js +0 -103
  304. package/dist/lib/superpowers-task-command-specs.d.ts +0 -3
  305. package/dist/lib/superpowers-task-command-specs.js +0 -52
  306. package/dist/lib/superpowers-task-compile-diagnostics.d.ts +0 -5
  307. package/dist/lib/superpowers-task-compile-diagnostics.js +0 -20
  308. package/dist/lib/superpowers-task-compile-guards.d.ts +0 -2
  309. package/dist/lib/superpowers-task-compile-guards.js +0 -66
  310. package/dist/lib/superpowers-task-compile.d.ts +0 -6
  311. package/dist/lib/superpowers-task-compile.js +0 -133
  312. package/dist/lib/superpowers-task-completion-output.d.ts +0 -91
  313. package/dist/lib/superpowers-task-completion-output.js +0 -374
  314. package/dist/lib/superpowers-task-conformance.d.ts +0 -2
  315. package/dist/lib/superpowers-task-conformance.js +0 -24
  316. package/dist/lib/superpowers-task-contradictions.d.ts +0 -6
  317. package/dist/lib/superpowers-task-contradictions.js +0 -126
  318. package/dist/lib/superpowers-task-current-evidence.d.ts +0 -3
  319. package/dist/lib/superpowers-task-current-evidence.js +0 -176
  320. package/dist/lib/superpowers-task-delivery.d.ts +0 -4
  321. package/dist/lib/superpowers-task-delivery.js +0 -96
  322. package/dist/lib/superpowers-task-derive.d.ts +0 -14
  323. package/dist/lib/superpowers-task-derive.js +0 -393
  324. package/dist/lib/superpowers-task-events.d.ts +0 -1
  325. package/dist/lib/superpowers-task-events.js +0 -13
  326. package/dist/lib/superpowers-task-evidence-kernel.d.ts +0 -19
  327. package/dist/lib/superpowers-task-evidence-kernel.js +0 -347
  328. package/dist/lib/superpowers-task-evidence-records.d.ts +0 -2
  329. package/dist/lib/superpowers-task-evidence-records.js +0 -55
  330. package/dist/lib/superpowers-task-evidence.d.ts +0 -10
  331. package/dist/lib/superpowers-task-evidence.js +0 -147
  332. package/dist/lib/superpowers-task-fields.d.ts +0 -22
  333. package/dist/lib/superpowers-task-fields.js +0 -276
  334. package/dist/lib/superpowers-task-final-card.d.ts +0 -3
  335. package/dist/lib/superpowers-task-final-card.js +0 -35
  336. package/dist/lib/superpowers-task-gates.d.ts +0 -12
  337. package/dist/lib/superpowers-task-gates.js +0 -267
  338. package/dist/lib/superpowers-task-harness-drift.d.ts +0 -11
  339. package/dist/lib/superpowers-task-harness-drift.js +0 -90
  340. package/dist/lib/superpowers-task-next-slices.d.ts +0 -1
  341. package/dist/lib/superpowers-task-next-slices.js +0 -12
  342. package/dist/lib/superpowers-task-protected-baseline.d.ts +0 -10
  343. package/dist/lib/superpowers-task-protected-baseline.js +0 -66
  344. package/dist/lib/superpowers-task-source-compile.d.ts +0 -5
  345. package/dist/lib/superpowers-task-source-compile.js +0 -226
  346. package/dist/lib/superpowers-task-source-parser.d.ts +0 -23
  347. package/dist/lib/superpowers-task-source-parser.js +0 -218
  348. package/dist/lib/superpowers-task-state-schema.d.ts +0 -460
  349. package/dist/lib/superpowers-task-state-schema.js +0 -66
  350. package/dist/lib/superpowers-task-state-shape.d.ts +0 -3
  351. package/dist/lib/superpowers-task-state-shape.js +0 -50
  352. package/dist/lib/superpowers-task-state.d.ts +0 -16
  353. package/dist/lib/superpowers-task-state.js +0 -246
  354. package/dist/lib/superpowers-task-status.d.ts +0 -2
  355. package/dist/lib/superpowers-task-status.js +0 -24
  356. package/dist/lib/superpowers-task-under-specified.d.ts +0 -7
  357. package/dist/lib/superpowers-task-under-specified.js +0 -61
  358. package/dist/lib/superpowers-task-unregistered-evidence.d.ts +0 -11
  359. package/dist/lib/superpowers-task-unregistered-evidence.js +0 -72
  360. package/dist/lib/superpowers-task-validator.d.ts +0 -5
  361. package/dist/lib/superpowers-task-validator.js +0 -293
@@ -1,682 +0,0 @@
1
- # Composite Long-Task Workflow Protocol
2
-
3
- ## Expected Runtime Effect / 预期实现效果
4
-
5
- `composite-long-task-workflow` is Tiny Context's Superpowers-backed composite long-task workflow Skill. It is not the Tiny Context Workflow Contract itself and is not an ordinary target-mode prompt generator. Its job is to combine three upstream authority inputs, Tiny Context workflow rules, project Context, official Superpowers execution methods, canonical task state and acceptance evidence into a recoverable, auditable Codex Goal workflow whose completion can be computed.
6
-
7
- The workflow prevents long-running implementation drift across many turns, agents, slices, validators and context compactions: product-intent drift, missing Context updates, scope shrinkage, plan/implementation mismatch, incomplete AC evidence, sampled proof pretending to be full population, passing tests pretending to be acceptance, and audit completion pretending to be product completion.
8
-
9
- ## Execution Order
10
-
11
- The fusion order is fixed:
12
-
13
- ```text
14
- Tiny Context Workflow Contract
15
- -> confirm three-input source authority
16
- -> compile task-state.json
17
- -> enter Superpowers implementation slices
18
- -> each slice updates canonical state and evidence
19
- -> derive local audit / matrix / verdict / progress / evidence views
20
- -> run gates
21
- -> final-gate computes product_goal_complete and blocker triage
22
- ```
23
-
24
- ## Workflow Identity
25
-
26
- This protocol is the detailed execution contract for `composite-long-task-workflow`: a Tiny Context-owned composite workflow adapter for Superpowers-backed long-task execution. It is not the Tiny Context Workflow Contract itself, not a durable project Context file, not a business fact source, not a normal target-mode prompt generator and not an official Superpowers fork.
27
-
28
- ## Authority Model
29
-
30
- Authority is fixed before implementation starts: Product / Architecture Source owns intent, scope and boundaries; Technical Realization Plan owns PI implementation and plan conformance; Acceptance Checklist owns AC completion semantics and proof layers; `task-state.json` is the only execution state source; `events.ndjson` is append-only; `derived/**` is generated reading output only.
31
-
32
- ## Slice Protocol
33
-
34
- Implementation advances through coherent slices. Each slice selects related PI / AC / proof-layer gaps, performs implementation and verification work, records canonical evidence, writes and applies `slice-delta.json`, derives views and runs slice-gate. Shared provider/browser/runtime/security proof environments use epoch-gate instead of repeating the full final gate after every slice.
35
-
36
- ## Evidence Protocol
37
-
38
- Evidence is canonical state, not prose. Every proof record enters `task-state.evidence[]` with evidence id, slice id, type, command or artifact paths, command exit code when applicable, `proves`, `does_not_prove`, freshness, redaction, reviewability / reproduction data and, for machine-verifiable layers, an `assertion_result`. Strict final completion uses EvidenceRecordV2 records bound to the current attempt, source bundle, product source hash, technical plan hash, acceptance checklist hash, git head, worktree fingerprint, command spec/run id, command line/exit code, artifact path/SHA/mtime, target AC ids, target PI ids, target proof layers, assertion status/exit code, positive assertions, negative assertions, invalid completion signals, negative evidence scan and required test ids. Evidence must be fresh, reviewable and free of secrets, raw credentials, tokens, cookies and long raw payloads.
39
-
40
- Canonical proof layers are `code`, `api_schema`, `worker_runtime`, `data_artifact`, `integration`, `ui_browser`, `security_redaction`, `all_provider_all_runner`, `cleanup_stale_scan` and `test`; legacy aliases map `runtime -> worker_runtime`, `browser -> ui_browser`, `api -> api_schema`, `data -> data_artifact` and `security -> security_redaction`. `code` cannot complete a machine-backed AC by itself. Machine-verifiable layers are not complete from descriptions, screenshots, final cards, validator passes, matrix rows, verdict rows, evidence-index rows, final-summary text, historical `events.ndjson` complete events, auditor prose, summary-only AC proof or unregistered temporary JSON. They require current-attempt EvidenceRecordV2 plus `assertion_result.schema_version=assertion-result-v2`, `assertion_result.status=passed`, assertion exit code `0`, command exit code `0`, target AC/PI/layer coverage, passed positive and negative assertions, no invalid completion signal and reviewable artifacts. UI/browser layers also require owner surface, route/path, user action, browser/playwright/UI assertion evidence and a passed `negative_evidence_scan` with matching target proof layers and checked invalid completion signals.
41
-
42
- The Trusted Evidence Kernel marks a machine-blocking AC `under_specified` when it lacks an assertion command, assertion artifacts, positive assertions, negative assertions, invalid completion signals, required UI/browser proof, concrete assertion result production or any non-generated final evidence path. Under-specified ACs block related PIs and force `product_goal_complete=false`. AC-010 / final-gate summary proof only summarizes fresh current EvidenceRecordV2 proof for the other ACs; it cannot bootstrap missing, failed, stale or under-specified ACs and is invalidated with `final_gate_cannot_bootstrap_from_summary_only` when it tries.
43
-
44
- Strict V2 source fields are canonical. Product Source must carry Scope Fit, owner, primary capability and assertion policy fields. PI items must carry owner boundary, primary capability path, trigger/state/observable contracts, assertion support, required assertion commands and invalid implementation shortcuts. ACs must carry assertion command, artifacts, positive/negative assertions, machine-blocking flag, invalid completion signals and assertion-result requirement. Unknown, duplicate, table or missing canonical fields block compile; the workflow must not generate, infer, rewrite or repair the Technical Realization Plan or Acceptance Checklist.
45
-
46
- ## Derived Views
47
-
48
- `derived/**` contains generated reading views only: local audit, plan-conformance matrix, final acceptance verdict, progress ledger, evidence index (`md` and `json`), context alignment and final summary. Matrix, verdict and evidence-index views may summarize `assertion_status`, blocking assertion failures and negative evidence findings, but they never replace assertion execution and never rewrite Product / Architecture Source, Technical Realization Plan, Acceptance Checklist or `task-state.json`.
49
-
50
- ## Gates
51
-
52
- The runtime gate sequence is slice-gate for one slice, epoch-gate for shared proof environments and final-gate for product completion. Plan conformance is judged against the Technical Realization Plan, acceptance evidence is judged against the Acceptance Checklist, and final-gate is the only path that computes `product_goal_complete`.
53
-
54
- ## Required Bootstrap
55
-
56
- Every executor first reads `execution-binding.md`, `workflow-protocol.md`, the three input files, `task-state.json` and current `derived/**` views. If state is missing or stale, initialize or compile through `ty-context composite-long-task init <workdir>` and `ty-context composite-long-task compile <workdir>` before choosing the next implementation slice.
57
-
58
- ## Tiny Context Contract Layer
59
-
60
- The workflow uses Context Priority Ladder, Context Delta, Source-to-Context Coverage, Context-to-Implementation Binding, Contract Conformance and Context drift check as the durable-fact and implementation-binding layer. These rules constrain the composite workflow, but the composite workflow does not replace or register itself as the Tiny Context Workflow Contract.
61
-
62
- ## Superpowers Execution Binding
63
-
64
- Superpowers remains the execution layer: prefer `superpowers:subagent-driven-development` when subagents are available, use `superpowers:executing-plans` otherwise, use `superpowers:test-driven-development` for behavior gaps and run `superpowers:verification-before-completion` before completion claims. Tiny Context may wrap Superpowers with authority, conformance and acceptance gates, but must not redefine, duplicate or fork official Superpowers mechanics.
65
-
66
- ## Final Gate Protocol
67
-
68
- Final completion always runs through the Trusted Evidence Kernel, then through the completion-output resolver and blocker triage. Final gate, `validate-superpowers-state`, state-backed `validate-plan-acceptance` and derived completion views use the same kernel and resolver result. Superpowers verification, validators, auditor checks and generated views are useful execution checks, but they are not proof authority or completion-output authority. The AC Evidence Assertion Gate and Negative Evidence Scan Gate are enforced inside the kernel, not by trusting generated matrix or verdict text. The final gate itself runs in fixed order: load the three inputs, recompute source hashes, load task state, snapshot previous final/gates/meta transient bookkeeping as audit-only, resolve the current attempt, load required command specs, load command-run records, load registered EvidenceRecords, discard stale evidence, scan unregistered assertion JSON, run contradiction scan, run AC-010 bootstrap prevention, run under-specified AC checks, run Harness Drift Lock, run protected baseline guard, validate scope conflicts, recompute every AC, recompute every PI, recompute `acceptance_target_status`, recompute `product_goal_complete`, build the current candidate state, resolve candidate `completion_output_status`, regenerate current `derived/**`, scan generated output in the current candidate mode, classify blockers with `blocker_triage`, perform at most one self-recovery pass for transient bookkeeping or regenerable generated-output mismatch, write current final state and append an event.
69
-
70
- The final gate recomputes from current source hashes, current attempt, required command specs/runs, registered EvidenceRecordV2 records, contradiction scan, Harness Drift Lock and protected baseline state. It ignores stale passed artifacts, historical complete events, stale derived complete views, old final/gates/meta transient findings, matrix/verdict/evidence-index/final-summary rows, validator passes, final cards, auditor prose, AC summary-only proof, unregistered temporary JSON and hand-written status files as proof. The completion-output resolver ignores those same surfaces as authority and emits only `accept`, `reject` or `blocked`. Generated-output scanning is current-candidate-driven: old `completion_output_status=blocked` or old `generated_output_mismatch=true` cannot drag a current kernel accept back to blocked, but current user-visible false completion claims still block. Newer failed commands, Playwright `.last-run.json`, `test-results/**/error-context.md`, JUnit/JSON reporter failures, negative evidence artifacts, owner DOM forbidden states, task-state false/partial values and derived/state mismatch block completion for the affected AC/layer. If historical completion conflicts with current recompute, report `Historical stale completion event detected and ignored.` and `Current recomputed product_goal_complete=false.`
71
-
72
- Harness Drift Lock: `product_task` is blocked when the current attempt changed Playwright specs, tests, assertion generators, AC010 helpers, evidence writers, final-gate, validator, derive, task-state reducer, this workflow Skill/protocol or related Makefile/package test targets. The output must include `harness_drift_detected`, `acceptance_target_status=blocked`, `product_goal_complete=false` and `本轮修改了验收工具链或测试本身,不能用被修改后的验收证明同一轮产品完成。请拆成独立 harness_task。` A `harness_task` must include adversarial fixtures with expected final-gate outcomes for stale evidence, historical complete, derived contradiction, AC010 summary-only, target mismatch, API-only-for-UI, negative evidence after pass, source hash mismatch, dirty worktree mismatch, missing assertion_result, test weakening, scope leakage, missing UI/browser owner-surface proof, missing negative semantic proof and one happy path; it never proves product completion. HFC-003 is the durable false-completion regression suite; HFC-004 is the durable final-gate blocker-triage suite for old transient self-lock, candidate-driven scanner mode, blocker categories, next actions and one-pass self-recovery. `protected-harness-baseline.json` blocks product-task changes to protected harness surfaces and requires a baseline reason plus fixtures for harness-task changes.
73
-
74
- ## Completion State Machine
75
-
76
- `audit_task_complete` means the workflow or audit pass finished. `acceptance_target_status` is the acceptance verdict. `product_goal_complete` is computed only by final-gate. `completion_output_status` is computed only by the final-gate completion-output resolver and is the only official generated final-answer status. Implementation/execution Goal completion requires both `product_goal_complete=true` and `completion_output_status=accept`. A read-only audit goal may finish at audit completion only while saying `Audit workflow completed; acceptance target not complete.` for non-accepted targets.
77
-
78
- ## Forbidden Shortcuts
79
-
80
- Tests alone do not prove plan conformance. Superpowers review does not prove AC acceptance. Sample evidence does not prove full population unless the AC allows it. Browser screenshots, final cards, validator passes, matrix/verdict rows, evidence-index/final-summary rows, unregistered JSON and prose evidence are auxiliary only for machine-verifiable ACs unless a passed assertion report is bound to the target AC/layer. Derived files, local audit, validator output and auditor reports cannot rewrite Product / Plan / Checklist. Local audit cannot mark product completion. Agents must not handwrite `product_goal_complete`.
81
-
82
- ## Hallucination Guard
83
-
84
- The protocol must prevent false fusion: do not interpret the composite workflow as the Tiny Context Workflow Contract itself; do not register `workflow-protocol.md` in `project_context/context.toml`; do not treat it as a business fact source; do not use local audit, tests, Superpowers review, sampled evidence, screenshots, final cards, matrix/verdict rows, validator passes, stale generated output or final-gate failure as product completion; do not let those surfaces promote `completion_output_status` to `accept`; do not claim full alignment with unresolved Source-to-Context Coverage or Context-to-Implementation Binding gaps; and do not call a Codex implementation Goal complete before final-gate passes and resolver status is `accept`.
85
-
86
- ## Blocker Protocol
87
-
88
- Maximize autonomous progress with repository tools, local app/browser sessions, CLI auth, credential helpers and authorized elevation. Stop only for locally unsatisfiable blockers such as MFA, missing permission, unavailable credentials, external approval or legal/system limits, and return the minimal user action list plus the next agent step.
89
-
90
- ## 1. Materials Entering Agent Context
91
-
92
- The executor must see and fuse these materials together:
93
-
94
- ```text
95
- 1. Tiny Context Workflow Contract
96
- - Context Priority Ladder
97
- - Context Delta
98
- - Source-to-Context Coverage
99
- - Context-to-Implementation Binding
100
- - Contract Conformance
101
- - Context drift check
102
-
103
- 2. Project durable Context
104
- - project_context/global.md
105
- - project_context/architecture.md
106
- - project_context/context.toml
107
- - matching project_context/areas/**/*
108
- - DESIGN.md when applicable
109
-
110
- 3. Three long-task authority inputs
111
- - Product / Architecture Source
112
- - Technical Realization Plan
113
- - Acceptance Checklist
114
-
115
- 4. Composite workflow protocol artifacts
116
- - workflow-protocol.md
117
- - execution-binding.md
118
- - goal-objective.txt
119
-
120
- 5. Official Superpowers execution layer
121
- - superpowers:subagent-driven-development
122
- - superpowers:executing-plans
123
- - superpowers:test-driven-development
124
- - superpowers:verification-before-completion
125
-
126
- 6. State and audit kernel
127
- - task-state.json
128
- - events.ndjson
129
- - derived/**
130
- - task-state.evidence[]
131
- - slice / epoch / final gates
132
- ```
133
-
134
- The fusion order is not free-form. The executor first applies the Tiny Context Workflow Contract, then confirms the three-input source authority, then compiles state, then uses Superpowers implementation slices, then updates canonical state/evidence, derives reading views, runs gates and lets final-gate compute completion.
135
-
136
- ## 2. Phase One: Workflow Contract First
137
-
138
- After receiving a Goal, the executor must not start with code. It first applies Tiny Context workflow rules:
139
-
140
- ```text
141
- 1. Read project_context/global.md, architecture.md, context.toml and relevant area/role Context.
142
- 2. Decide Product Context Delta and Technical Context Delta.
143
- 3. If either is required, update the smallest owning Context before implementation.
144
- 4. Build Source-to-Context Coverage for the three inputs:
145
- - whether each source item is covered by existing Context;
146
- - whether Context must be added or updated;
147
- - whether it is task-local only;
148
- - whether it is explicitly out of scope;
149
- - whether a user decision is needed.
150
- 5. For high-risk implementation, build Context-to-Implementation Binding:
151
- - which surfaces each Context fact must reach;
152
- - expected implementation paths;
153
- - forbidden shortcuts;
154
- - verification paths.
155
- ```
156
-
157
- This phase answers whether the task changes durable facts, whether Context supports implementation, which product/architecture/API/schema/state/surface/verification facts must be written first, and which concrete paths and verification entries the implementation must bind to.
158
-
159
- If Source-to-Context Coverage still has `new_context_required`, `under_scoped` or `needs_user_decision`, do not claim the plan was fully implemented. If Context-to-Implementation Binding still has `missing`, `partial`, `blocked` or `contradicted_by_current_state`, do not claim Context-to-code alignment.
160
-
161
- ## 3. Phase Two: Three Inputs Lock Task Authority
162
-
163
- The authority relationship is fixed:
164
-
165
- ```text
166
- Product / Architecture Source
167
- = intent, scope, boundaries, owner surface, delivery scope, full population / sample semantics.
168
-
169
- Technical Realization Plan
170
- = PI items, implementation paths, API/schema, state machine, worker/runtime, UI/IA, required tests, plan conformance.
171
-
172
- Acceptance Checklist
173
- = AC items, completion semantics, required proof layers, invalid evidence, fail conditions, acceptance verdict.
174
- ```
175
-
176
- `task-state.json` is compiled from these inputs. `derived/**`, local audit, matrix, verdict, validator output and auditor reports cannot rewrite them. Project Context also preserves this authority model: source owns intent/scope/boundaries, plan owns executable blueprint and plan conformance, checklist owns AC completion semantics and proof layers.
177
-
178
- ## 4. Phase Three: Compile The State Kernel
179
-
180
- When initializing or resuming a task, the executor confirms this workdir shape:
181
-
182
- ```text
183
- tmp/ty-context/plan-acceptance/<plan-slug>/
184
- product-architecture-source.md
185
- technical-realization-plan.md
186
- acceptance-checklist.md
187
- workflow-protocol.md
188
- execution-binding.md
189
- task-state.json
190
- events.ndjson
191
- derived/**
192
- ```
193
-
194
- If `task-state.json` is absent or uncompiled, use the public command path:
195
-
196
- ```bash
197
- ty-context composite-long-task init <workdir>
198
- ty-context composite-long-task compile <workdir>
199
- ```
200
-
201
- Legacy/internal compatibility may exist as an equivalent implementation namespace only:
202
-
203
- ```bash
204
- ty-context superpowers init <workdir>
205
- ty-context superpowers compile <workdir>
206
- ```
207
-
208
- The compiled state forms:
209
-
210
- ```text
211
- Plan graph:
212
- PI -> AC
213
- AC -> required proof layers
214
- delivery scope
215
- sample / full population boundary
216
- owner surfaces
217
- forbidden shortcuts
218
-
219
- State kernel:
220
- task-state.json = only execution state source
221
- events.ndjson = append-only event log
222
- derived/** = generated reading views only
223
- ```
224
-
225
- The goal of this phase is to turn natural-language plans into a state-machine-traceable task graph.
226
-
227
- ## 5. Phase Four: Superpowers Enters Implementation
228
-
229
- Superpowers organizes implementation execution:
230
-
231
- ```text
232
- - Prefer superpowers:subagent-driven-development when subagents are available.
233
- - Use superpowers:executing-plans when subagents are unavailable or insufficient.
234
- - Use superpowers:test-driven-development for behavior changes.
235
- - Use superpowers:verification-before-completion before any completion claim.
236
- ```
237
-
238
- Tiny Context does not copy, fork or override official Superpowers execution mechanics. It wraps them with:
239
-
240
- ```text
241
- source authority gate
242
- plan conformance gate
243
- acceptance evidence gate
244
- state consistency gate
245
- final completion gate
246
- ```
247
-
248
- Superpowers manages how to move implementation forward efficiently. Tiny Context checks whether implementation drifted from the source, plan and ACs.
249
-
250
- ## 6. Phase Five: What An Implementation Slice Is
251
-
252
- An implementation slice is not an arbitrary file chunk, page chunk or API chunk. It is the smallest coherent execution unit that closes related gaps.
253
-
254
- A slice should:
255
-
256
- ```text
257
- 1. Bind 2-4 strongly related missing layers.
258
- 2. Usually share one or more of:
259
- - same AC;
260
- - same PI;
261
- - same runtime scenario;
262
- - same owner surface;
263
- - same proof environment;
264
- - same verification path group.
265
- 3. Advance both implementation and evidence.
266
- 4. End by updating task-state and reducing explicit plan/AC/proof gaps.
267
- ```
268
-
269
- A slice usually:
270
-
271
- ```text
272
- - modifies implementation code;
273
- - modifies API/schema/state/worker/runtime/UI/IA when required;
274
- - runs required tests or smoke checks;
275
- - captures evidence;
276
- - writes slice-delta.json;
277
- - applies the slice delta;
278
- - derives views;
279
- - runs slice-gate.
280
- ```
281
-
282
- A slice cannot only say "some work was done." Its `progress_value` must explain which gap it closed and why that reduces later rework.
283
-
284
- ## 7. Phase Six: Slice Delta Updates State
285
-
286
- After every slice, progress must enter `task-state.json` through structured state update. Do not handwrite derived results and do not report progress only in chat.
287
-
288
- `slice-delta.json` must express at least:
289
-
290
- ```text
291
- slice_id
292
- slice_goal
293
- touched_plan_items
294
- touched_acs
295
- code_changes
296
- evidence_records
297
- closed_layers
298
- remaining_layers
299
- blockers
300
- cleanup_assertions
301
- progress_value
302
- ```
303
-
304
- Each evidence record enters `task-state.evidence[]` and includes:
305
-
306
- ```text
307
- evidence_id
308
- slice_id
309
- type
310
- command
311
- artifact_paths
312
- proves
313
- does_not_prove
314
- freshness
315
- redaction
316
- reviewability / reproduction_steps
317
- assertion_result for machine-verifiable layers
318
- negative_evidence_scan with target_proof_layers where invalid completion signals must be ruled out
319
- ```
320
-
321
- `proves` and `does_not_prove` are both required because evidence must say what it proves and what it does not prove. This prevents samples, passing tests, screenshots, mocks or local audit text from being reused as full acceptance.
322
-
323
- ## 8. Phase Seven: Local Audit And Derived Views
324
-
325
- After state changes, run:
326
-
327
- ```bash
328
- ty-context composite-long-task derive <workdir>
329
- ```
330
-
331
- Legacy/internal compatibility may exist as:
332
-
333
- ```bash
334
- ty-context superpowers derive <workdir>
335
- ```
336
-
337
- The generated views are:
338
-
339
- ```text
340
- derived/local-audit.md
341
- derived/plan-conformance-matrix.md
342
- derived/final-acceptance-verdict.md
343
- derived/progress-ledger.md
344
- derived/evidence-index.json
345
- derived/evidence-index.md
346
- derived/context-alignment.md
347
- derived/final-summary.md
348
- ```
349
-
350
- Their roles:
351
-
352
- ```text
353
- local-audit.md
354
- = recovery view for future sessions or subagents.
355
-
356
- plan-conformance-matrix.md
357
- = whether PIs were implemented, whether evidence maps correctly, and whether implementation drifted from the Technical Plan.
358
-
359
- final-acceptance-verdict.md
360
- = whether ACs satisfy required proof layers, what is missing, and what cannot be accepted.
361
-
362
- progress-ledger.md
363
- = separate progress for AC acceptance, engineering implementation, runtime/proof, system capability, sample, real object, full population and workflow overhead.
364
-
365
- evidence-index.md
366
- = index from evidence_id to proved object, artifact, command and does_not_prove boundary.
367
-
368
- context-alignment.md
369
- = alignment state for Context Delta, Source-to-Context Coverage and Context-to-Implementation Binding.
370
-
371
- final-summary.md
372
- = whether completion is currently possible, why not, and what comes next.
373
- ```
374
-
375
- All `derived/**` files are generated views, not authority. They must not be hand-edited as completion evidence. Local audit is not Context, not quality proof and not a global task manager; it is only a recovery and audit view.
376
-
377
- ## 9. Phase Eight: Slice Gate And Epoch Gate
378
-
379
- After each slice, run:
380
-
381
- ```bash
382
- ty-context composite-long-task slice-gate <workdir> --slice <slice-id>
383
- ```
384
-
385
- Slice gate checks:
386
-
387
- ```text
388
- - whether the slice closed a real PI/AC/proof-layer gap;
389
- - whether fresh reviewable evidence exists;
390
- - whether required machine-verifiable proof layers have passed assertion results;
391
- - whether negative evidence findings invalidate the layer or AC;
392
- - whether evidence entered task-state.evidence[];
393
- - whether closed_layers are actually proved;
394
- - whether remaining_layers were not falsely closed;
395
- - whether blockers are recorded truthfully;
396
- - whether derived views match task-state.
397
- ```
398
-
399
- When multiple slices reuse one provider/browser/runtime/security proof environment, run:
400
-
401
- ```bash
402
- ty-context composite-long-task epoch-gate <workdir> --epoch <epoch-id>
403
- ```
404
-
405
- Epoch gate validates the shared proof environment in batch, avoids running full final gate after every slice, and prevents shared runtime/browser/provider evidence from being reused after contamination or staleness.
406
-
407
- ## 10. Phase Nine: Plan Conformance Gate
408
-
409
- Plan conformance is judged by the Technical Realization Plan, not by the executor's summary.
410
-
411
- Each PI answers:
412
-
413
- ```text
414
- - Was the PI actually implemented?
415
- - Do implementation paths match implementation_paths?
416
- - Are owner_surfaces correct?
417
- - Were forbidden_surfaces avoided?
418
- - Did API/schema/state/runtime/data/UI/IA land according to the Plan?
419
- - Were required_tests executed or blocked with reason?
420
- - Can related_acs be traced through evidence?
421
- ```
422
-
423
- `derived/plan-conformance-matrix.md` is only a view. The authoritative state is `task-state.json` plus evidence records.
424
-
425
- Forbidden substitutions:
426
-
427
- ```text
428
- - "code changed" does not prove plan conformance;
429
- - "tests passed" does not prove PI completion;
430
- - "Superpowers review passed" does not prove Plan Conformance Gate;
431
- - convenient current-code paths do not override the Technical Realization Plan.
432
- ```
433
-
434
- ## 11. Phase Ten: Acceptance Evidence Gate
435
-
436
- AC completion is decided by the Acceptance Checklist. Every AC must satisfy its declared `required_proof_layers`.
437
-
438
- Proof layers may include:
439
-
440
- ```text
441
- code
442
- api_schema
443
- worker_runtime
444
- data_artifact
445
- ui_browser
446
- security_redaction
447
- all_provider_all_runner
448
- cleanup_stale_scan
449
- test
450
- ```
451
-
452
- AC completion requires:
453
-
454
- ```text
455
- 1. Every required proof layer has fresh reviewable evidence.
456
- 2. evidence.proves explicitly covers that layer.
457
- 3. evidence.does_not_prove does not expose a scope substitution problem.
458
- 4. Machine-verifiable required layers have assertion_result.status=passed and exit code 0.
459
- 5. Positive and negative assertions passed for the target AC/layer.
460
- 6. Negative evidence scan has no forbidden owner-surface state.
461
- 7. No missing required layers.
462
- 8. No material drift.
463
- 9. No stale artifact.
464
- 10. No raw secret/token/cookie/payload leak.
465
- 11. No sibling surface / sample object / mock substitution for owner surface or full population.
466
- 12. When full_population_required=true, sample evidence cannot replace full-population evidence.
467
- ```
468
-
469
- This gate enables an external reviewer to follow the evidence chain. Auditor subagents may find gaps but are not proof sources.
470
-
471
- Invalid evidence for UI/browser AC completion includes screenshot-only proof, component screenshots, storybook pages, viewmodels, mocks, unit-only proof, API-only proof, diagnostic pages, final cards, matrix/verdict rows, validator passes and prose summaries. Forbidden final owner-surface states such as `未验证`, `不可用`, `暂不可用` or `页面无明显变化` invalidate the relevant AC/layer.
472
-
473
- ## 12. Phase Eleven: Delivery Scope And Full Population Stay Separate
474
-
475
- The workflow always distinguishes:
476
-
477
- ```text
478
- system_capability_build
479
- representative_sample_validation
480
- full_population_operation
481
- mixed_scope_requires_boundary
482
- out_of_scope_backlog
483
- ```
484
-
485
- Typical forbidden claims:
486
-
487
- ```text
488
- - framework complete does not mean all real objects complete;
489
- - several objects succeeded does not mean automation capability complete;
490
- - sample provider succeeded does not mean all-provider complete;
491
- - UI screenshot exists does not mean owner surface primary path is closed;
492
- - final card, matrix, verdict or validator pass does not mean a machine-verifiable AC has assertion-backed evidence;
493
- - tests passed does not mean AC accepted;
494
- - local audit passed does not mean product_goal_complete.
495
- ```
496
-
497
- If Product / Plan / Checklist disagree on delivery scope, state records:
498
-
499
- ```text
500
- scope_conflict_requires_decision
501
- ```
502
-
503
- Completion is blocked until the source conflict is resolved. Validators inspect explicit fields; they do not infer business scope from prose.
504
-
505
- ## 13. Phase Twelve: Fixed Final Gate Order
506
-
507
- Before final completion, the kernel order is fixed:
508
-
509
- ```text
510
- 1. load product-architecture-source.md, technical-realization-plan.md, acceptance-checklist.md
511
- 2. recompute source hashes
512
- 3. load task-state.json
513
- 4. snapshot previous final/gates/meta transient bookkeeping as audit-only
514
- 5. resolve current_attempt
515
- 6. load required command specs
516
- 7. load command-run records
517
- 8. load registered EvidenceRecordV2 records
518
- 9. discard stale evidence
519
- 10. scan unregistered assertion JSON
520
- 11. contradiction scan
521
- 12. run AC-010 bootstrap prevention
522
- 13. run under-specified AC checks
523
- 14. run Harness Drift Lock
524
- 15. run protected baseline guard
525
- 16. recompute every AC
526
- 17. recompute every PI
527
- 18. recompute acceptance_target_status
528
- 19. recompute product_goal_complete
529
- 20. build current candidate state
530
- 21. resolve candidate completion_output_status
531
- 22. regenerate current derived/**
532
- 23. scan generated output in current candidate mode
533
- 24. classify blocker_triage and self-recover once when allowed
534
- 25. append event
535
- ```
536
-
537
- Legacy/internal compatibility may exist as:
538
-
539
- ```text
540
- ty-context superpowers final-gate <workdir>
541
- ```
542
-
543
- Only final-gate computes:
544
-
545
- ```text
546
- product_goal_complete=true
547
- completion_output_status=accept
548
- ```
549
-
550
- Implementation / execution Goals complete only after both computed values are present.
551
-
552
- ## 14. Completion Semantics
553
-
554
- The workflow distinguishes:
555
-
556
- ```text
557
- audit_task_complete
558
- = whether the audit/reporting task finished.
559
-
560
- acceptance_target_status
561
- = AC acceptance target state.
562
-
563
- product_goal_complete
564
- = whether implementation/execution is truly complete.
565
-
566
- completion_output_status
567
- = official generated final-answer status: accept, reject or blocked.
568
- ```
569
-
570
- Rules:
571
-
572
- ```text
573
- 1. Do not handwrite product_goal_complete.
574
- 2. product_goal_complete is computed only by final-gate.
575
- 3. Do not handwrite completion_output_status.
576
- 4. completion_output_status=accept requires product_goal_complete=true and accepted target status.
577
- 5. audit_task_complete=true is not product completion.
578
- 6. If completion_output_status is reject or blocked, do not say Goal achieved, completed, accepted or done.
579
- 7. A read-only audit task may end, but must say:
580
- Audit workflow completed; acceptance target not complete.
581
- 8. Failed final-gate output includes blocker_triage category and next action.
582
- 9. Implementation / execution Goal mode can call update_goal complete only when product_goal_complete=true and completion_output_status=accept.
583
- ```
584
-
585
- This must stay visible in Skill and Goal objective because Codex Goal mode can otherwise confuse "audit workflow ended" with "product target accepted."
586
-
587
- When final-gate does not accept, output must include `blocker_triage.category`, `blocker_triage.next_action`, whether it was self-recoverable and whether recovery was attempted. Categories distinguish product evidence failure, missing current evidence, stale or contradictory evidence, generated-output mismatch, self-recoverable generated-output mismatch, transient state bookkeeping, environment blocked, contract blocked and harness drift blocked.
588
-
589
- ## 15. Blocker Strategy
590
-
591
- The executor maximizes autonomous progress:
592
-
593
- ```text
594
- - reuse local app login sessions;
595
- - reuse browser sessions;
596
- - reuse CLI auth;
597
- - reuse OS credential helpers;
598
- - try authorized sudo / gsudo / administrator elevation first;
599
- - solve locally discoverable command/page/script/config/test/log issues before pausing.
600
- ```
601
-
602
- Only these are user blockers:
603
-
604
- ```text
605
- - MFA;
606
- - account not logged in and cannot self-service login;
607
- - insufficient permissions;
608
- - external approval;
609
- - payment or paid-source authorization;
610
- - platform policy or legal restriction;
611
- - credentials or decisions that only the user can supply.
612
- ```
613
-
614
- When reporting a blocker, include the minimal user action:
615
-
616
- ```text
617
- - exact page/system/command to open;
618
- - exact field or value location;
619
- - sensitive values not to send;
620
- - what the agent will do next;
621
- - why completion is currently impossible.
622
- ```
623
-
624
- ## 16. Final Expected Effect
625
-
626
- The result is a recoverable long-running loop:
627
-
628
- ```text
629
- Tiny Context Workflow Contract
630
- -> Context Delta
631
- -> Context update or confirmation
632
- -> Source-to-Context Coverage
633
- -> Context-to-Implementation Binding
634
-
635
- Three inputs
636
- -> lock product intent, technical plan and acceptance semantics
637
- -> compile PI/AC/proof graph
638
-
639
- Superpowers
640
- -> implementation slices
641
- -> multi-agent / TDD / executing-plans implementation
642
-
643
- Each slice
644
- -> code/API/runtime/UI changes
645
- -> evidence capture
646
- -> slice-delta update
647
- -> apply-slice-delta
648
- -> derive audit / matrix / verdict / progress / evidence views
649
- -> slice-gate / epoch-gate
650
-
651
- Final
652
- -> Plan Conformance Gate
653
- -> Acceptance Evidence Gate
654
- -> External Reviewer / stale-overclaim scan
655
- -> final-gate
656
- -> product_goal_complete=true and completion_output_status=accept before Codex Goal completion
657
- ```
658
-
659
- One-sentence definition:
660
-
661
- ```text
662
- The expected runtime effect of the composite long-task workflow is to make a Codex agent fuse Tiny Context fact/process constraints, three upstream task authorities, Superpowers long-task execution and a task-state evidence state machine in one context; execution goes Context first, then Plan, then Superpowers slices, and completion is judged by state-backed gates for plan conformance, AC evidence, product_goal_complete and completion_output_status so long tasks do not drift in implementation, acceptance or completion claims.
663
- ```
664
-
665
- ## 17. Forbidden Wrong Fusion / 不允许的错误融合
666
-
667
- The workflow must explicitly prevent these interpretations:
668
-
669
- ```text
670
- Do not interpret the composite long-task workflow as the Tiny Context Workflow Contract itself.
671
- Do not register workflow-protocol.md in project_context/context.toml.
672
- Do not treat workflow-protocol.md as a business fact source.
673
- Do not let derived/** rewrite Product / Plan / Checklist.
674
- Do not treat local audit as quality proof.
675
- Do not treat Superpowers review as plan conformance or AC acceptance.
676
- Do not treat sample evidence as full-population proof.
677
- Do not claim full implementation when Context Delta is required but Context is not updated.
678
- Do not claim full alignment while Source-to-Context Coverage / Context-to-Implementation Binding has unresolved gaps.
679
- Do not handwrite product_goal_complete.
680
- Do not handwrite completion_output_status.
681
- Do not call update_goal complete before final-gate passes and completion_output_status=accept.
682
- ```