@1aboveio/skills 1.0.10 → 1.0.11

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 (213) hide show
  1. package/.codex-plugin/plugin.json +1 -1
  2. package/.codex-plugin/resources.json +297 -216
  3. package/README.md +3 -3
  4. package/package.json +10 -8
  5. package/skills/app-dev/airflow/SKILL.md +1 -1
  6. package/skills/app-dev/android-foundation/SKILL.md +35 -37
  7. package/skills/app-dev/android-foundation/references/delivery-focus.md +4 -2
  8. package/skills/app-dev/android-foundation/references/feature-work.md +50 -0
  9. package/skills/app-dev/android-foundation/references/setup.md +24 -9
  10. package/skills/app-dev/android-foundation/references/workspace.md +81 -0
  11. package/skills/app-dev/android-foundation/scripts/workspace-runtime/bin/workspaces.mjs +52 -0
  12. package/skills/app-dev/android-foundation/scripts/workspace-runtime/native-workspace.mjs +239 -0
  13. package/skills/app-dev/android-foundation/scripts/workspace-runtime/workspace-lifecycle.mjs +2154 -0
  14. package/skills/app-dev/app-debug/SKILL.md +1 -1
  15. package/skills/app-dev/better-auth/SKILL.md +1 -1
  16. package/skills/app-dev/data-catalog/SKILL.md +1 -1
  17. package/skills/app-dev/data-quality/SKILL.md +1 -1
  18. package/skills/app-dev/ios-foundation/SKILL.md +15 -10
  19. package/skills/app-dev/ios-foundation/references/setup.md +25 -9
  20. package/skills/app-dev/ios-foundation/references/workspace.md +82 -0
  21. package/skills/app-dev/ios-foundation/scripts/workspace-runtime/bin/workspaces.mjs +52 -0
  22. package/skills/app-dev/ios-foundation/scripts/workspace-runtime/native-workspace.mjs +239 -0
  23. package/skills/app-dev/ios-foundation/scripts/workspace-runtime/workspace-lifecycle.mjs +2154 -0
  24. package/skills/app-dev/monorepo/SKILL.md +1 -1
  25. package/skills/app-dev/nextjs-fullstack/SKILL.md +1 -1
  26. package/skills/app-dev/prisma-setup/SKILL.md +1 -1
  27. package/skills/app-dev/pyspark/SKILL.md +1 -1
  28. package/skills/app-dev/python-backend/SKILL.md +1 -1
  29. package/skills/app-dev/shadcn/SKILL.md +1 -1
  30. package/skills/app-dev/zod-v4/SKILL.md +1 -1
  31. package/skills/cicd/cloud-build/SKILL.md +1 -1
  32. package/skills/cicd/cloud-debug/SKILL.md +1 -1
  33. package/skills/cicd/cloud-deploy/SKILL.md +1 -1
  34. package/skills/cicd/docker/SKILL.md +1 -1
  35. package/skills/cicd/github-actions/SKILL.md +1 -1
  36. package/skills/cicd/github-flow/SKILL.md +1 -1
  37. package/skills/cicd/google-cloud/SKILL.md +1 -1
  38. package/skills/cicd/mergify/SKILL.md +1 -1
  39. package/skills/cicd/podman/SKILL.md +1 -1
  40. package/skills/content/article-review/SKILL.md +1 -1
  41. package/skills/content/article-to-image/SKILL.md +1 -1
  42. package/skills/content/flowchart-svg/SKILL.md +1 -1
  43. package/skills/content/image-gen/SKILL.md +1 -1
  44. package/skills/content/mermaid/SKILL.md +1 -1
  45. package/skills/content/wechat-article-writer/SKILL.md +1 -1
  46. package/skills/content/wechat-publisher/SKILL.md +1 -1
  47. package/skills/content/wechat-search/SKILL.md +1 -1
  48. package/skills/content/xai-search/SKILL.md +1 -1
  49. package/skills/core/distill-writing/SKILL.md +3 -3
  50. package/skills/core/distill-writing/references/extraction.md +1 -1
  51. package/skills/core/doc-to-md/SKILL.md +1 -1
  52. package/skills/core/editorial-review/SKILL.md +82 -12
  53. package/skills/core/editorial-review/references/checklist.md +26 -1
  54. package/skills/core/house-style/SKILL.md +8 -3
  55. package/skills/core/house-style/references/analytical-reporting.md +123 -0
  56. package/skills/core/house-style/references/analytical-writing-patterns.md +79 -0
  57. package/skills/core/house-style/references/analytical-writing-research.md +129 -0
  58. package/skills/core/{write-doc → house-style}/references/bilingual.md +7 -5
  59. package/skills/core/house-style/references/definitions-and-metrics.md +86 -0
  60. package/skills/core/house-style/references/document-workflow.md +193 -0
  61. package/skills/core/house-style/references/initialization.md +66 -0
  62. package/skills/core/house-style/references/persistence.md +9 -4
  63. package/skills/core/house-style/references/rules.md +11 -4
  64. package/skills/core/house-style/scripts/init-guidance.mjs +213 -0
  65. package/skills/core/house-style/templates/analytical-report.md +54 -0
  66. package/skills/core/house-style/templates/gap-analysis.md +1 -1
  67. package/skills/core/plain-language/SKILL.md +2 -2
  68. package/skills/core/polish-cn/SKILL.md +9 -2
  69. package/skills/core/reg-parser/SKILL.md +3 -3
  70. package/skills/core/terminology/SKILL.md +8 -4
  71. package/skills/core/write-doc/SKILL.md +40 -151
  72. package/skills/core/write-report/SKILL.md +129 -0
  73. package/skills/core/{write-doc → write-report}/references/compliance-reports.md +4 -4
  74. package/skills/engineering/better-review/SKILL.md +37 -37
  75. package/skills/engineering/better-review/references/passes.md +35 -41
  76. package/skills/engineering/better-review/references/result.md +10 -9
  77. package/skills/engineering/e2e-test/SKILL.md +17 -17
  78. package/skills/engineering/e2e-test/references/authoring/playwright-config.md +11 -13
  79. package/skills/engineering/e2e-test/references/presentation-sweep.md +7 -7
  80. package/skills/engineering/e2e-test/references/reviewing.md +9 -11
  81. package/skills/engineering/e2e-test/references/route-manifest.md +1 -1
  82. package/skills/engineering/engineering/SKILL.md +124 -0
  83. package/skills/engineering/engineering/references/engineering-conventions.md +32 -0
  84. package/skills/engineering/engineering/references/feature-delivery.md +8 -0
  85. package/skills/engineering/engineering/references/init-scope.md +37 -0
  86. package/skills/engineering/engineering/scripts/init.mjs +160 -0
  87. package/skills/engineering/{contributing → engineering}/scripts/persist-conventions.mjs +1 -1
  88. package/skills/engineering/engineering-runtime/SKILL.md +1 -1
  89. package/skills/engineering/engineering-runtime/coherence/workflow.json +19 -19
  90. package/skills/engineering/engineering-runtime/scripts/workflow-policy.mjs +1 -1
  91. package/skills/engineering/ensure-coverage/SKILL.md +22 -109
  92. package/skills/engineering/ensure-coverage/references/breadth/coverage-ledger.md +7 -5
  93. package/skills/engineering/ensure-coverage/references/breadth/surface-baseline.md +4 -4
  94. package/skills/engineering/ensure-coverage/references/breadth/surface-discovery.md +3 -3
  95. package/skills/engineering/ensure-coverage/references/depth/characterization.md +4 -65
  96. package/skills/engineering/ensure-coverage/references/depth/grading.md +5 -7
  97. package/skills/engineering/ensure-coverage/references/depth/mock-policy.md +6 -12
  98. package/skills/engineering/ensure-coverage/references/enforcement/ci-contract.md +1 -1
  99. package/skills/engineering/ensure-coverage/references/presentation/axis.md +6 -6
  100. package/skills/engineering/ensure-coverage/references/process/audit-mode.md +7 -23
  101. package/skills/engineering/ensure-coverage/references/process/output-template.md +18 -133
  102. package/skills/engineering/ensure-coverage/references/process/test-strategy.md +7 -12
  103. package/skills/engineering/ensure-coverage/scripts/README.md +12 -4
  104. package/skills/engineering/golden-path/SKILL.md +1 -1
  105. package/skills/engineering/harness-runtime/SKILL.md +3 -1
  106. package/skills/engineering/harness-runtime/bin/workspaces.mjs +52 -0
  107. package/skills/engineering/harness-runtime/native-workspace.mjs +239 -0
  108. package/skills/engineering/harness-runtime/references/workspaces.md +78 -0
  109. package/skills/engineering/harness-runtime/workspace-lifecycle.mjs +2154 -0
  110. package/skills/engineering/resolve-issues/SKILL.md +40 -61
  111. package/skills/engineering/resolve-issues/references/ci.md +13 -3
  112. package/skills/engineering/resolve-issues/references/delivery-progress.md +4 -3
  113. package/skills/engineering/resolve-issues/references/done.md +11 -2
  114. package/skills/engineering/resolve-issues/references/expire.md +9 -2
  115. package/skills/engineering/resolve-issues/references/implementation.md +33 -17
  116. package/skills/engineering/resolve-issues/references/preflight.md +3 -1
  117. package/skills/engineering/resolve-issues/references/principles.md +52 -0
  118. package/skills/engineering/resolve-issues/references/review.md +25 -15
  119. package/skills/engineering/resolve-issues/references/task-plan.md +64 -27
  120. package/skills/engineering/resolve-issues/references/workspaces.md +164 -0
  121. package/skills/engineering/resolve-issues/scripts/cleanup-runs.mjs +185 -317
  122. package/skills/engineering/resolve-issues/scripts/next-actions.mjs +44 -7
  123. package/skills/engineering/resolve-issues/scripts/rehydrate.mjs +36 -2
  124. package/skills/engineering/resolve-issues/scripts/review-verdict.mjs +9 -8
  125. package/skills/engineering/resolve-issues/scripts/workspace-lifecycle.mjs +1 -0
  126. package/skills/engineering/resolve-release/SKILL.md +1 -1
  127. package/skills/engineering/rush-issues/SKILL.md +7 -5
  128. package/skills/engineering/rush-release/SKILL.md +1 -1
  129. package/skills/engineering/test-quality/SKILL.md +19 -4
  130. package/skills/engineering/test-quality/references/lint.md +1 -1
  131. package/skills/engineering/test-quality/references/principles.md +2 -2
  132. package/skills/engineering/test-quality/references/testing-conventions.md +1 -1
  133. package/skills/risk-compliance/compliance-audit/SKILL.md +4 -8
  134. package/skills/risk-compliance/compliance-audit/references/audience-and-reports.md +12 -0
  135. package/skills/risk-compliance/contract-compare/SKILL.md +17 -1
  136. package/skills/risk-compliance/contract-review/SKILL.md +6 -1
  137. package/skills/risk-compliance/contract-review/references/report-stage.md +17 -0
  138. package/skills/risk-compliance/doc-authenticity/SKILL.md +11 -1
  139. package/skills/risk-compliance/fraud-detection/LICENSE +3 -0
  140. package/skills/risk-compliance/fraud-detection/SKILL.md +148 -0
  141. package/skills/risk-compliance/{fraud-analysis → fraud-detection}/references/archetypes/first-party-fraud.md +3 -2
  142. package/skills/risk-compliance/fraud-detection/references/archetypes/third-party-fraud.md +47 -0
  143. package/skills/risk-compliance/fraud-detection/references/collection-payout-features.md +151 -0
  144. package/skills/risk-compliance/{fraud-analysis → fraud-detection}/references/contexts/bank-transfer.md +4 -3
  145. package/skills/risk-compliance/fraud-detection/references/contexts/card-payment.md +70 -0
  146. package/skills/risk-compliance/fraud-detection/references/contexts/payment-collection.md +34 -0
  147. package/skills/risk-compliance/fraud-detection/references/contexts/payout.md +34 -0
  148. package/skills/risk-compliance/fraud-detection/references/enrichment.md +74 -0
  149. package/skills/risk-compliance/fraud-detection/references/entities.md +48 -0
  150. package/skills/risk-compliance/{fraud-analysis → fraud-detection}/references/feature-engineering.md +69 -33
  151. package/skills/risk-compliance/fraud-detection/references/feature-sql.md +150 -0
  152. package/skills/risk-compliance/{fraud-analysis → fraud-detection}/references/report-rationale.md +4 -2
  153. package/skills/risk-compliance/{fraud-analysis → fraud-detection}/references/report-template.md +45 -23
  154. package/skills/risk-compliance/{fraud-analysis → fraud-detection}/references/review-checklist.md +60 -20
  155. package/skills/risk-compliance/fraud-detection/references/workflow.md +216 -0
  156. package/skills/risk-compliance/fraud-detection/release-check.mjs +95 -0
  157. package/skills/risk-compliance/payment-analysis/SKILL.md +36 -17
  158. package/skills/risk-compliance/payment-analysis/references/auth-rate-actions.md +2 -2
  159. package/skills/risk-compliance/payment-analysis/references/report-template.md +10 -2
  160. package/skills/risk-compliance/payment-analysis/references/visualization.md +11 -1
  161. package/skills/risk-compliance/portfolio-payment-analysis/LICENSE +3 -0
  162. package/skills/risk-compliance/portfolio-payment-analysis/SKILL.md +170 -0
  163. package/skills/risk-compliance/portfolio-payment-analysis/references/identity-and-reconciliation.md +46 -0
  164. package/skills/risk-compliance/portfolio-payment-analysis/references/metrics-and-reporting.md +170 -0
  165. package/skills/risk-compliance/portfolio-payment-analysis/references/risk-history.md +89 -0
  166. package/skills/risk-compliance/portfolio-payment-analysis/release-check.mjs +95 -0
  167. package/skills/risk-compliance/portfolio-payment-analysis/scripts/analyze.py +636 -0
  168. package/skills/risk-compliance/portfolio-payment-analysis/scripts/build_report.py +386 -0
  169. package/skills/risk-compliance/portfolio-payment-analysis/scripts/comparison_charts.py +425 -0
  170. package/skills/risk-compliance/portfolio-payment-analysis/scripts/csv_export.py +52 -0
  171. package/skills/risk-compliance/portfolio-payment-analysis/scripts/render.py +160 -0
  172. package/skills/risk-compliance/portfolio-payment-analysis/scripts/risk_history.py +435 -0
  173. package/skills/risk-compliance/similar-domain/SKILL.md +9 -4
  174. package/skills/risk-compliance/tld-detection/SKILL.md +124 -239
  175. package/skills/risk-compliance/tld-detection/agents/openai.yaml +1 -1
  176. package/skills/risk-compliance/tld-detection/references/clean.md +18 -51
  177. package/skills/risk-compliance/tld-detection/references/fx-conversion.md +56 -219
  178. package/skills/risk-compliance/tld-detection/references/metric-contract.md +109 -0
  179. package/skills/risk-compliance/tld-detection/references/pattern.md +99 -0
  180. package/skills/risk-compliance/tld-detection/references/report-template.md +49 -272
  181. package/skills/risk-compliance/tld-detection/scripts/detect_ladders.py +46 -13
  182. package/skills/risk-compliance/tld-detection/scripts/detect_patterns.py +346 -0
  183. package/skills/risk-compliance/tld-detection/scripts/detect_streams.py +51 -19
  184. package/skills/risk-compliance/tld-detection/scripts/profile_groups.py +109 -0
  185. package/skills/risk-compliance/tld-detection/scripts/render_charts.py +218 -0
  186. package/skills/risk-compliance/tld-detection/scripts/tld_common.py +243 -0
  187. package/skills/engineering/contributing/SKILL.md +0 -70
  188. package/skills/risk-compliance/fraud-analysis/SKILL.md +0 -114
  189. package/skills/risk-compliance/fraud-analysis/references/archetypes/third-party-fraud.md +0 -27
  190. package/skills/risk-compliance/fraud-analysis/references/contexts/card-payment.md +0 -30
  191. package/skills/risk-compliance/fraud-analysis/references/contexts/payment-collection.md +0 -20
  192. package/skills/risk-compliance/fraud-analysis/references/contexts/payout.md +0 -20
  193. package/skills/risk-compliance/fraud-analysis/references/workflow.md +0 -175
  194. package/skills/risk-compliance/tld-detection/references/chinese-polish.md +0 -55
  195. package/skills/risk-compliance/tld-detection/references/clustering.md +0 -235
  196. package/skills/risk-compliance/tld-detection/references/decision.md +0 -189
  197. package/skills/risk-compliance/tld-detection/references/streams.md +0 -141
  198. package/skills/risk-compliance/tld-detection/references/terminology.md +0 -95
  199. package/skills/risk-compliance/tld-detection/references/workflow.md +0 -95
  200. /package/skills/{engineering/contributing → core/write-report}/LICENSE +0 -0
  201. /package/skills/core/{write-doc → write-report}/references/reports/audit-report-template.md +0 -0
  202. /package/skills/core/{write-doc → write-report}/references/reports/external-assessment-template.md +0 -0
  203. /package/skills/core/{write-doc → write-report}/references/reports/management-report-template.md +0 -0
  204. /package/skills/core/{write-doc → write-report}/references/reports/vars-report-template.md +0 -0
  205. /package/skills/{engineering/contributing → core/write-report}/release-check.mjs +0 -0
  206. /package/skills/{risk-compliance/fraud-analysis → engineering/engineering}/LICENSE +0 -0
  207. /package/skills/engineering/{contributing → engineering}/references/tracker-conventions.md +0 -0
  208. /package/skills/{risk-compliance/fraud-analysis → engineering/engineering}/release-check.mjs +0 -0
  209. /package/skills/engineering/{contributing → engineering}/scripts/persist-conventions-core.mjs +0 -0
  210. /package/skills/risk-compliance/{fraud-analysis → fraud-detection}/references/archetypes/authorized-payment-scam.md +0 -0
  211. /package/skills/risk-compliance/{fraud-analysis → fraud-detection}/references/mechanisms/account-takeover.md +0 -0
  212. /package/skills/risk-compliance/{fraud-analysis → fraud-detection}/references/taxonomy.md +0 -0
  213. /package/skills/risk-compliance/{fraud-analysis → fraud-detection}/references/terminology.md +0 -0
@@ -5,16 +5,17 @@ worker and stage transition.
5
5
 
6
6
  ## Initialize the run
7
7
 
8
- 1. Reclaim disk from idle runs, then create a run directory:
9
-
10
- ```bash
11
- node <skill-base-dir>/scripts/cleanup-runs.mjs --repo <repo-root> --apply
12
- ```
13
-
14
- It deletes downloads from runs idle 3+ days and keeps their records and
15
- logs; logs go after 30 days. Report its last line; never block on it. After the approval, give each unit a branch and
16
- workspace on the target, or on its blocking parent's branch in `stack`
17
- or `chain` mode. Never reuse a dirty, unrelated checkout.
8
+ 1. Create the run directory, and reclaim nothing by age: a tree is removed only
9
+ by its own unit's proven cleanup ([workspaces.md](workspaces.md#cleanup-after-delivery-before-finish)).
10
+ Record `workspaceLifecycle: 1`, `repoRoot` (the canonical absolute main
11
+ checkout) and `targetBranch`. After the approval, plan each unit a branch and
12
+ workspace on the target, or on its blocking parent's branch in `stack` or
13
+ `chain` mode, and prepare it when its first worker is admitted
14
+ ([workspaces.md](workspaces.md#prepare-at-admission-once)). Never reuse a
15
+ dirty, unrelated checkout. On start and on resume, first run
16
+ `cleanup-runs.mjs recover --repo <repo-root> --json`: read-only, it reports
17
+ unfinished prepare and cleanup operations of any age, and hands the plan back
18
+ ([workspaces.md](workspaces.md#resume-recover-inventory)).
18
19
  2. Make each issue one unit: every open issue in the spec's tree with no
19
20
  open sub-issue (a plain issue, an epic's open leaf, or a rollup whose
20
21
  sub-issues all closed); a spec without issues is one unit.
@@ -50,9 +51,10 @@ worker and stage transition.
50
51
  task-plan.json
51
52
  issue-tree.json # spec's GitHub issue tree, saved by each sync
52
53
  exploration/findings.json
53
- units/<unit>/ # unit workspace; cleanup-runs.mjs strips it after merge, keeping logs
54
+ units/<unit>/ # the unit's workspace; removed by its cleanup after the merge
55
+ resources/<unit>/<role>/ # scratch or tool cache, only when the unit needs one
54
56
  splits/<unit>.md # drafted sub-issues for a held unit
55
- reviews/<unit>/ # review clone, reused every round
57
+ reviews/<unit>/clone/ # the unit's one review clone, reused every round
56
58
  reviews/<unit>-r<N>.json # one per round
57
59
  reviews/<unit>-r<N>.fix.json # fixBrief from review-verdict.mjs
58
60
  reviews/<unit>-r<N>.decide.json # question from review-verdict.mjs verdict decide
@@ -63,6 +65,12 @@ worker and stage transition.
63
65
 
64
66
  ## Shape
65
67
 
68
+ Write each unit's `title` as a short action in plain language, usually 3-7 words:
69
+ "Fix checkout errors" or "Add the Todo toggle". Keep implementation details and
70
+ acceptance criteria in the source and findings, not the Todo label. A long GitHub
71
+ issue heading need not be copied verbatim; preserve its issue reference and full
72
+ source requirements.
73
+
66
74
  Fleet rows: `explore`, then per unit `implement`, `review`, `ci`, `canary`.
67
75
  Fleet `status`: `pending`, `in-flight`, `succeeded`, `failed`,
68
76
  `blocked`, `cancelled`, `not-applicable`, or `merged` (`ci` only). Set
@@ -72,6 +80,7 @@ Fleet `status`: `pending`, `in-flight`, `succeeded`, `failed`,
72
80
  |---|---|
73
81
  | `id`, `title`, `issue`, `source` | Identity and locator |
74
82
  | `workspace`, `branch`, `base` | Absolute workspace, branch, and base |
83
+ | `lifecycle` | The owned workspace and resources with their kind, base SHA, identity, and cleanup state, as `cleanup-runs.mjs` returns them ([workspaces.md](workspaces.md)) |
75
84
  | `dependsOn`, `stacksOn` | Blocking and shared-surface parent ids (in `stack` and `chain` mode, `stacksOn` is the parent `next-actions.mjs` names at open) |
76
85
  | `files` | The unit's own changed files, recorded when its code is done (`stack` and `chain` mode pick the parent from them) |
77
86
  | `parentHead` | `stack` and `chain` mode: the parent's HEAD this branch is rebased on; a line ships only when every link matches |
@@ -100,7 +109,8 @@ and nothing earlier. Until the merge it stays
100
109
  Example: #1201's code is done and its PR is in review, so it is
101
110
  `stage: done`, `status: in-flight`, `delivery: review`. In `supervised` mode, a
102
111
  merge-ready PR handed back stays `in-flight` with the note "merge-ready,
103
- handed back"; it is never `succeeded` until the human merges it.
112
+ handed back"; it is never `succeeded` until the human merges it. Its
113
+ `lifecycle.cleanup` follows that merge and never changes `status`.
104
114
 
105
115
  Run fields: optional `installation` holds the explicit native installation descriptor
106
116
  (one absolute root, layout, resource metadata path/digest, release identity, and
@@ -108,6 +118,7 @@ pinned external root mappings). Capture from the selected bundle and preserve it
108
118
  through workers and recovery; never replace it with a newer cache or shared copy.
109
119
  Other run fields: `skill` (`resolve-issues` or `rush-issues`; the scheduler and
110
120
  rehydrate read it, and `next-actions.mjs` exits 2 without it), `planRevision`, models and efforts, `targetBranch`,
121
+ `workspaceLifecycle: 1` and `repoRoot` ([workspaces.md](workspaces.md)),
111
122
  `deliveryMode` and its check, `mergeMode`, run directory, `specLocator`
112
123
  (`owner/name#N` or an issue URL; any other name turns off the issue-tree sync),
113
124
  exploration path, `decisions`, `standingOrders`, `schedulerMode` (`full`, `narrow`, or `off`), timestamps, and `excluded` (issues in the
@@ -152,8 +163,8 @@ run state.** Every open issue in the tree with no open sub-issue is a unit,
152
163
  ordered by `blocked_by` links. On every call with
153
164
  [live capacity arguments](implementation.md#live-capacity), `next-actions.mjs` diffs the plan against
154
165
  the tree and prints `add-unit`, `drop-unit`, `set-deps`,
155
- `move-link`, and `blocked-outside` first; apply each through `update_plan` (or,
156
- for `move-link`, on GitHub) before anything else. A unit waits only on its own
166
+ `move-link`, and `blocked-outside` first; apply each through the available
167
+ checkpoint mechanism below (or, for `move-link`, on GitHub) before anything else. A unit waits only on its own
157
168
  issue's `blocked_by` links, never on a link on its parent issue.
158
169
  Example: someone files #61 under epic #12 mid-run; the next resume prints
159
170
  `add-unit 61`, so explore it, rerun the size check, and schedule it.
@@ -192,10 +203,28 @@ normally.
192
203
 
193
204
  ## Checkpoints
194
205
 
195
- ### Pi: bind or reload with update_plan
206
+ ### Optional Harness Outcome & Todo
207
+
208
+ Use only tools advertised in the current turn. Pi's `/harness-settings` Outcome & Todo
209
+ feature defaults to off; never enable it or make it a precondition. When `update_todo`
210
+ is available, capture the known objective before substantive work with
211
+ `update_todo({outcome:{objective:<objective>}})`. An outcome alone is valid; a checklist
212
+ is not required. Include known criteria, boundaries or source only when useful; do not
213
+ invent criteria or duplicate a large canonical requirement. The source requirements and
214
+ criteria remain authoritative. The latest user correction takes precedence, and a reminder
215
+ does not authorize continuing work. Merely discovering or reading this skill never
216
+ initializes an outcome; capture it only for the accepted task being executed.
217
+ There is no separate setup step. Goal controls triggering and continuation, not
218
+ the business outcome.
219
+
220
+ When the workflow plan exists, read its `planRevision`, then bind it using `update_todo`
221
+ with the absolute path and that revision, optionally including the known outcome:
222
+
223
+ ```text
224
+ update_todo({workflow:{path:<absolute-plan-path>,revision:<persisted-planRevision>}, outcome:{objective:<objective>}})
225
+ ```
196
226
 
197
- `update_plan` is the universal plan entrypoint. Read the saved plan's
198
- `planRevision`, then bind it with the absolute path and that revision:
227
+ For example, the workflow payload is:
199
228
 
200
229
  ```json
201
230
  {"workflow":{"path":"/absolute/project/.resolve-issues/rush/<run-id>/task-plan.json","revision":12}}
@@ -207,11 +236,11 @@ With no `event`, this is a read-only binding: it does not mutate the plan or
207
236
  bump its revision. Do not invent a transition just to display or reload the
208
237
  board.
209
238
 
210
- After binding, save each transition through `update_plan`, using the current
239
+ After binding, save each transition through `update_todo`, using the current
211
240
  persisted revision and the tool's supported change entries:
212
241
 
213
242
  ```text
214
- update_plan({workflow:{event:"unit-validated",revision:12,changes:[...],decision?}})
243
+ update_todo({workflow:{event:"unit-validated",revision:12,changes:[...],decision?}})
215
244
  ```
216
245
 
217
246
  `decision?` denotes an optional field, not a literal key; supply it when the
@@ -222,20 +251,28 @@ transition. Binding and the first transition may be one call with
222
251
  `path`, `revision`, `event`, and `changes` inside the same `workflow` object
223
252
  (and `decision` when needed).
224
253
 
225
- Never edit `task-plan.json` directly after binding. On rejection, reread the
254
+ While the interface is enabled and bound, never edit `task-plan.json` directly. On rejection, reread the
226
255
  saved plan, reconcile the intended changes, and retry with its persisted revision; use a path-and-revision
227
256
  call with no event when only reloading. Never force a stale revision or
228
257
  display rejected changes as saved.
229
258
 
230
- Generic checklists still use `update_plan({plan:[...]})` unchanged. They are
231
- not a workflow binding or transition: never copy this run's units into a
232
- generic editable checklist.
259
+ `get_todo`, when advertised, reads the outcome, checklist and workflow. Generic work
260
+ may use `update_todo({todo:[...]})` with the tool's `id`, `step`, `status` and
261
+ `dependsOn` fields. It is not a workflow binding or transition: never copy this
262
+ run's units into a generic editable checklist. Todo is an interface label, not a
263
+ rename of `task-plan.json`, `planRevision`, profiling or their schemas.
233
264
 
234
265
  ### Other harnesses and display
235
266
 
236
- Use a workflow-capable plan tool when available. Only when none can write
237
- the workflow and the plan is not bound, edit run state directly and bump
238
- `planRevision`. This fallback is not a way around a rejected bound update.
267
+ With `update_todo` absent or disabled, including on Codex and other harnesses,
268
+ the skill still owns its canonical run records. Use the existing file transition:
269
+ edit run state, preserve the schema and existing records, bump `planRevision`, and
270
+ record any profiling entry the workflow requires. A binding retained after the
271
+ human disables the interface is history, not an active exclusive writer. Reload
272
+ the actual persisted revision if the interface is later enabled again.
273
+ `plan-sync.mjs` only reports scope differences; it is not a transition API. Never
274
+ use this fallback to bypass a rejected update from an available tool: reconcile
275
+ and retry through that tool. A validation error is not tool absence.
239
276
 
240
277
  Render the board from the saved plan only. Without a harness view, show the
241
278
  text board. Keep the board and file in agreement. Never show an unsaved transition or reuse an old board.
@@ -0,0 +1,164 @@
1
+ # Workspaces
2
+
3
+ One rule set for the trees a run creates. A unit's workspace and resources are
4
+ owned by the plan, never by a path pattern or a timestamp: nothing is created
5
+ before the plan records it, and nothing is removed without proof of ownership
6
+ and delivery.
7
+
8
+ ## What the plan records
9
+
10
+ Run fields: `workspaceLifecycle: 1`, `repoRoot` (the canonical absolute main
11
+ checkout) and `targetBranch`. A unit already records `workspace`, `branch` and
12
+ `base`; with `workspaceLifecycle` it also records `lifecycle`:
13
+
14
+ ```json
15
+ { "version": 1,
16
+ "workspace": { "kind": "worktree|clone", "state": "preparing|ready",
17
+ "baseSha": "<exact SHA>", "identity": "<returned by the helper>" },
18
+ "resources": [ { "role": "review|scratch|tools", "kind": "directory|clone|worktree",
19
+ "path": "<absolute>", "disposable": true,
20
+ "state": "preparing|ready", "identity": "<returned by the helper>" } ],
21
+ "cleanup": { "state": "pending|applying|complete|retained",
22
+ "headSha": "<the unit's headSha>", "reason": "<retained only>" } }
23
+ ```
24
+
25
+ | Tree | Path |
26
+ |---|---|
27
+ | Workspace | `<run>/units/<unit>` |
28
+ | Review clone | `<run>/reviews/<unit>/clone`, the resource with `role: review` |
29
+ | Scratch, tool cache | `<run>/resources/<unit>/<role>` |
30
+
31
+ A resource is a path strictly inside one of those three roots (the workspace's
32
+ children, `<run>/resources/<unit>/`, `<run>/reviews/<unit>/`), and it is planned
33
+ before it exists. Nothing else in the run is an owned tree. Record every path in
34
+ the canonical form the helper resolves (a `/var` path and its `/private/var`
35
+ realpath are different strings): `repoRoot`, the run directory, the workspace and
36
+ every resource.
37
+
38
+ `identity` is the helper's own observation (real path, device, inode, Git
39
+ common dir, head): persist what it returns, never compose or edit it. You are
40
+ the plan's only writer ([task-plan.md](task-plan.md)); the helper returns
41
+ observations and the next lifecycle value, and writes no plan.
42
+ Persist every lifecycle transition using the canonical
43
+ [checkpoint mechanism](task-plan.md#checkpoints): the optional bound harness
44
+ interface when enabled, otherwise the revisioned file transition. The optional
45
+ interface's absence never blocks workspace preparation or cleanup.
46
+
47
+ Prepare materializes each resource according to its recorded kind: a review clone
48
+ must be a real independent Git tree before it becomes ready. Its empty
49
+ `<run>/reviews/<unit>` parent is a run container, not a second clone.
50
+
51
+ ## Prepare: at admission, once
52
+
53
+ Prepare a unit's workspace when its **first worker is admitted**, not for every
54
+ planned unit up front and not at the approval. Disk then tracks live workers,
55
+ not plan size. Prepare the review resource when its reviewer is admitted.
56
+ Do not admit another worker while that owner's cleanup is `applying`; the
57
+ `recover-workspace` action resolves the existing operation and its postconditions first.
58
+
59
+ 1. Before `--apply`, record through the checkpoint mechanism: the unit's workspace, branch,
60
+ base SHA, `lifecycle.workspace` intent (`state: preparing`, chosen `kind`)
61
+ and each resource you will use (`state: preparing`). The helper refuses a
62
+ workspace or resource path the plan does not own, and creates only the
63
+ resources the plan lists.
64
+ 2. Run it. Without `--apply` it creates nothing and names the action
65
+ (`create` or `verify`):
66
+
67
+ ```bash
68
+ node <skill-base-dir>/scripts/cleanup-runs.mjs prepare --run <run> --unit <unit> \
69
+ --revision <saved planRevision> [--kind worktree|clone] --apply --json
70
+ ```
71
+
72
+ Exit 0 is a create or a verification; exit 2 is a refusal with a code
73
+ (`workspace-layout`, `revision-mismatch`, `unowned-tree`, `locked`, ...): fix
74
+ the plan or the call, never the tree.
75
+ 3. Persist the returned `nextLifecycle` on the unit **before** spawning the
76
+ worker, and give the worker that workspace path and only the resources it
77
+ needs. Resources are recorded before they are used.
78
+ 4. Reuse it. Retries, fix rounds, and every review round run in the same
79
+ workspace and the same review clone; a later prepare verifies identity,
80
+ branch, and base instead of recreating. Never reset, replace, or allocate a
81
+ second tree for one attempt, and plan a private tool cache or scratch copy
82
+ only when the work needs one.
83
+
84
+ `kind`: a linked `worktree` where a plain checkout is enough; an independent
85
+ `clone` when the first Git-mutating worker runs in a sandbox that cannot write a
86
+ linked worktree's `.git` file. Prepare falls back to a clone only when it
87
+ created nothing it can identify. Once the clone exists, do not pass the
88
+ harness's `git_clone_workspace` again, and never turn the sandbox off to work
89
+ around it: the prepared tree already isolates the unit.
90
+
91
+ ## Cleanup: after delivery, before finish
92
+
93
+ Clean a unit when it is `status: succeeded` with `delivery: merged`, and in
94
+ `supervised` mode once the human has merged the handed-back PR. Cleanup runs
95
+ alongside every independent unit and in every scheduler mode (`full`, `narrow`,
96
+ `off`), and settles before the run's handoff.
97
+
98
+ 1. Record the intent first, so a crash cannot hide it: `lifecycle.cleanup`
99
+ `{state: "applying", headSha: <the unit's headSha>}` through the checkpoint mechanism.
100
+ 2. Run:
101
+
102
+ ```bash
103
+ node <skill-base-dir>/scripts/cleanup-runs.mjs cleanup --run <run> --unit <unit> \
104
+ --revision <saved planRevision> --apply --json
105
+ ```
106
+
107
+ 3. Persist the returned `nextLifecycle`: `complete` with its receipt, or
108
+ `retained` with the current head and the helper's reason. Exit 0 is a removal
109
+ or an `already-complete` postcondition, 1 is a retention (read `action` and
110
+ `reason`; do not retry the same removal to make it pass), and 2 is a refusal
111
+ or a bad call that must be fixed. A refusal is never recorded as complete.
112
+
113
+ The helper removes exactly the recorded workspace and its declared disposable
114
+ resources, and only after it proved: the unit is completed and its delivery
115
+ merged; its owner has no recorded running worker and no process uses any removal
116
+ path (unrelated workers continue); the tree matches its recorded
117
+ identity, kind, branch, and head; no process uses it; no stash, interrupted Git
118
+ operation, nested repository, uncommitted or untracked path, undeclared ignored
119
+ path, local ref, or reflog commit is unpublished; and the head is on a freshly
120
+ fetched target. A squash merge instead needs the provider's PR identity (repo,
121
+ number, head repo/branch/SHA, destination) with a merge commit on that fresh
122
+ target.
123
+
124
+ It removes nothing else: no ignored-file stripping, no pruning, and no
125
+ `--merged <path>` on its own, because a path proves no owner. Every unknown
126
+ answer retains everything, whole. Keep, never clean: a blocked, cancelled,
127
+ pending, or supervised merge-ready unit's environment, whatever its timestamp; a
128
+ tree a worker may still use; a tree whose ownership or delivery cannot be proved.
129
+ No cleanup runs by age, idle time, or a name pattern, and a legacy
130
+ `*-workspaces` directory is never adopted or deleted.
131
+
132
+ ## Evidence and handoff
133
+
134
+ Record required evidence while the unit runs as
135
+ `lifecycle.evidence: [{path, required: true}]`, each path outside every
136
+ disposable path. The helper retains an environment whose required evidence still
137
+ lives inside it. Copy no logs, transcripts, or screenshots just to free a tree.
138
+
139
+ `retained` is an honest handback: report the environment as **not cleaned** with
140
+ the helper's reason, and name it in the run record. `pending` and `applying`
141
+ cleanup block `finish`; settle each delivered unit's cleanup first
142
+ ([done.md](done.md#clean-before-handoff)).
143
+
144
+ ## Resume, recover, inventory
145
+
146
+ On startup, before scheduling, read only:
147
+
148
+ ```bash
149
+ node <skill-base-dir>/scripts/cleanup-runs.mjs recover --repo <repo-root> --json
150
+ ```
151
+
152
+ It lists unfinished recorded operations — a `preparing` workspace, an `applying`
153
+ cleanup, a lock, an orphaned worktree — in every run regardless of age. It
154
+ activates no workflow and cleans nothing by itself: continue the plan, then
155
+ prepare or clean what it names and persist the result.
156
+
157
+ ```bash
158
+ node <skill-base-dir>/scripts/cleanup-runs.mjs inventory --repo <repo-root> [--root <explicit root>] --json
159
+ ```
160
+
161
+ is read-only and bounded: it lists the managed root (`<repo>/.resolve-issues/rush`)
162
+ with each tree's owning unit, and marks unowned entries. Use it to answer what is
163
+ on disk, never as authority to delete. Legacy `*-workspaces` directories and
164
+ unrecorded trees appear there as inventory only.