@dsmm/dsmm 0.2.0 → 0.2.2

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 (291) hide show
  1. package/README.md +38 -66
  2. package/agent-presets/dsmm-builder/agent.cordis.yml +10 -2015
  3. package/agent-presets/dsmm-clarifier/agent.cordis.yml +24 -343
  4. package/agent-presets/dsmm-code-search/agent.cordis.yml +19 -6
  5. package/agent-presets/dsmm-coding/agent.cordis.yml +19 -438
  6. package/agent-presets/dsmm-complex/agent.cordis.yml +23 -1009
  7. package/agent-presets/dsmm-creative/agent.cordis.yml +25 -442
  8. package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +29 -1013
  9. package/agent-presets/dsmm-deep/agent.cordis.yml +24 -1008
  10. package/agent-presets/dsmm-doc-search/agent.cordis.yml +19 -6
  11. package/agent-presets/dsmm-documenting/agent.cordis.yml +26 -439
  12. package/agent-presets/dsmm-frontend/agent.cordis.yml +21 -440
  13. package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +22 -441
  14. package/agent-presets/dsmm-media-reader/agent.cordis.yml +19 -6
  15. package/agent-presets/dsmm-normal-task/agent.cordis.yml +19 -438
  16. package/agent-presets/dsmm-oracle/agent.cordis.yml +25 -340
  17. package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +25 -340
  18. package/agent-presets/dsmm-orchestrator/agent.cordis.yml +29 -2025
  19. package/agent-presets/dsmm-plan-critic/agent.cordis.yml +24 -341
  20. package/agent-presets/dsmm-planner/agent.cordis.yml +14 -344
  21. package/agent-presets/dsmm-quick/agent.cordis.yml +19 -6
  22. package/agent-presets/dsmm-research/agent.cordis.yml +23 -8
  23. package/agent-presets/dsmm-reviewer/agent.cordis.yml +25 -340
  24. package/docs/agent-presets.md +36 -52
  25. package/docs/compatibility.md +50 -108
  26. package/docs/deferred-native-approval-risk.md +19 -0
  27. package/docs/design.md +2 -2
  28. package/docs/lsp.md +11 -21
  29. package/docs/migration-from-ocmm.md +2 -2
  30. package/docs/model-routing.md +84 -59
  31. package/docs/native-permissions.md +35 -0
  32. package/docs/profiles.md +40 -87
  33. package/docs/releasing.md +83 -2
  34. package/docs/roadmap.md +71 -17
  35. package/docs/settings-status.md +34 -169
  36. package/docs/skill-sync.md +52 -15
  37. package/lib/child-admission-contract.d.ts +37 -0
  38. package/lib/child-admission-contract.js +2 -0
  39. package/lib/child-admission.d.ts +42 -0
  40. package/lib/child-admission.js +162 -0
  41. package/lib/child-capture.d.ts +81 -0
  42. package/lib/child-capture.js +203 -0
  43. package/lib/child-evidence.d.ts +17 -0
  44. package/lib/child-evidence.js +43 -0
  45. package/lib/client/ChildrenPanel.d.ts +43 -0
  46. package/lib/client/ChildrenPanel.js +82 -0
  47. package/lib/client/DeploymentPage.js +15 -8
  48. package/lib/client/EditableChoice.d.ts +17 -0
  49. package/lib/client/EditableChoice.js +49 -0
  50. package/lib/client/PermissionsPanel.d.ts +14 -0
  51. package/lib/client/PermissionsPanel.js +46 -0
  52. package/lib/client/ProfilesSection.js +30 -15
  53. package/lib/client/RoleAvailability.d.ts +7 -0
  54. package/lib/client/RoleAvailability.js +19 -0
  55. package/lib/client/SessionProfiles.js +27 -9
  56. package/lib/client/StructuredEditor.js +15 -7
  57. package/lib/client/children-controller.d.ts +98 -0
  58. package/lib/client/children-controller.js +296 -0
  59. package/lib/client/children-locales.d.ts +367 -0
  60. package/lib/client/children-locales.js +69 -0
  61. package/lib/client/controller.d.ts +6 -1
  62. package/lib/client/controller.js +14 -8
  63. package/lib/client/deployment-data.d.ts +2 -1
  64. package/lib/client/deployment-data.js +34 -5
  65. package/lib/client/deployment-locales.d.ts +4 -0
  66. package/lib/client/deployment-locales.js +11 -2
  67. package/lib/client/diagnostics.d.ts +14 -0
  68. package/lib/client/diagnostics.js +53 -0
  69. package/lib/client/index.d.ts +4 -0
  70. package/lib/client/index.js +96 -2
  71. package/lib/client/locales.d.ts +54 -0
  72. package/lib/client/locales.js +34 -16
  73. package/lib/client/permission-client.d.ts +16 -0
  74. package/lib/client/permission-client.js +38 -0
  75. package/lib/client/permission-controller.d.ts +62 -0
  76. package/lib/client/permission-controller.js +149 -0
  77. package/lib/client/permission-locales.d.ts +114 -0
  78. package/lib/client/permission-locales.js +75 -0
  79. package/lib/client/session-labels.js +4 -4
  80. package/lib/client/structured.js +19 -5
  81. package/lib/client/styles.d.ts +1 -1
  82. package/lib/client/styles.js +20 -0
  83. package/lib/client.js +5780 -1679
  84. package/lib/core-permission-authority.d.ts +18 -0
  85. package/lib/core-permission-authority.js +255 -0
  86. package/lib/core-permissions.d.ts +8 -0
  87. package/lib/core-permissions.js +33 -0
  88. package/lib/delivery-authority.d.ts +68 -0
  89. package/lib/delivery-authority.js +260 -0
  90. package/lib/deployment-config.d.ts +23 -0
  91. package/lib/deployment-config.js +61 -40
  92. package/lib/deployment-permission-rules.d.ts +55 -0
  93. package/lib/deployment-permission-rules.js +306 -0
  94. package/lib/dsh-types.d.ts +10 -4
  95. package/lib/guards.d.ts +1 -1
  96. package/lib/guards.js +29 -8
  97. package/lib/host-llm-startup.d.ts +41 -0
  98. package/lib/host-llm-startup.js +65 -0
  99. package/lib/host-llm.d.ts +92 -0
  100. package/lib/host-llm.js +325 -0
  101. package/lib/index.d.ts +15 -4
  102. package/lib/index.js +300 -47
  103. package/lib/legacy-child-policy.d.ts +51 -0
  104. package/lib/legacy-child-policy.js +123 -0
  105. package/lib/legacy-read-composition.d.ts +20 -0
  106. package/lib/legacy-read-composition.js +144 -0
  107. package/lib/legacy-read-contracts.d.ts +157 -0
  108. package/lib/legacy-read-contracts.js +39 -0
  109. package/lib/legacy-read-host.d.ts +19 -0
  110. package/lib/legacy-read-host.js +67 -0
  111. package/lib/legacy-read-integration.d.ts +121 -0
  112. package/lib/legacy-read-integration.js +522 -0
  113. package/lib/legacy-read-proxy.d.ts +26 -0
  114. package/lib/legacy-read-proxy.js +237 -0
  115. package/lib/live-pi-ai-owner.d.ts +18 -0
  116. package/lib/live-pi-ai-owner.js +144 -0
  117. package/lib/llm-runtime.d.ts +11 -0
  118. package/lib/llm-runtime.js +21 -0
  119. package/lib/managed-settings.d.ts +5 -0
  120. package/lib/managed-settings.js +14 -0
  121. package/lib/model-parameter-policy.d.ts +11 -0
  122. package/lib/model-parameter-policy.js +27 -0
  123. package/lib/model-routing.js +28 -17
  124. package/lib/modules.d.ts +13 -5
  125. package/lib/modules.js +17 -1
  126. package/lib/native-child-evidence.d.ts +42 -0
  127. package/lib/native-child-evidence.js +133 -0
  128. package/lib/native-pi-ai-wire.d.ts +37 -0
  129. package/lib/native-pi-ai-wire.js +261 -0
  130. package/lib/native-scope.js +1 -1
  131. package/lib/permission-bash.d.ts +6 -0
  132. package/lib/permission-bash.js +7 -0
  133. package/lib/permission-control.d.ts +73 -0
  134. package/lib/permission-control.js +205 -0
  135. package/lib/permission-controller.d.ts +68 -0
  136. package/lib/permission-controller.js +317 -0
  137. package/lib/permission-errors.d.ts +7 -0
  138. package/lib/permission-errors.js +21 -0
  139. package/lib/permission-fs-search.d.ts +5 -0
  140. package/lib/permission-fs-search.js +7 -0
  141. package/lib/permission-fs.d.ts +5 -0
  142. package/lib/permission-fs.js +7 -0
  143. package/lib/permission-native-access.d.ts +11 -0
  144. package/lib/permission-native-access.js +6 -0
  145. package/lib/permission-native-command.d.ts +10 -0
  146. package/lib/permission-native-command.js +93 -0
  147. package/lib/permission-native-rules.d.ts +75 -0
  148. package/lib/permission-native-rules.js +278 -0
  149. package/lib/permission-pwsh.d.ts +6 -0
  150. package/lib/permission-pwsh.js +7 -0
  151. package/lib/permission-remote.d.ts +26 -0
  152. package/lib/permission-remote.js +53 -0
  153. package/lib/permission-rpc.d.ts +29 -0
  154. package/lib/permission-rpc.js +152 -0
  155. package/lib/permission-rules.d.ts +115 -0
  156. package/lib/permission-rules.js +256 -0
  157. package/lib/permission-settings.d.ts +45 -0
  158. package/lib/permission-settings.js +48 -0
  159. package/lib/permission-shell.d.ts +38 -0
  160. package/lib/permission-shell.js +150 -0
  161. package/lib/permission-web.d.ts +5 -0
  162. package/lib/permission-web.js +7 -0
  163. package/lib/preset-registry.js +36 -25
  164. package/lib/profile-diagnostics.d.ts +45 -0
  165. package/lib/profile-diagnostics.js +148 -0
  166. package/lib/profile-locale.d.ts +3 -0
  167. package/lib/profile-locale.js +2 -0
  168. package/lib/profile-remote.d.ts +8 -0
  169. package/lib/profile-remote.js +163 -39
  170. package/lib/profile-rpc.d.ts +4 -3
  171. package/lib/profile-rpc.js +14 -12
  172. package/lib/profile-runtime.d.ts +40 -1
  173. package/lib/profile-runtime.js +368 -93
  174. package/lib/profile-store.d.ts +11 -0
  175. package/lib/profile-store.js +143 -11
  176. package/lib/profile-types.d.ts +70 -1
  177. package/lib/profile-types.js +1 -0
  178. package/lib/profiles.d.ts +16 -2
  179. package/lib/profiles.js +156 -79
  180. package/lib/prompt-content.js +1 -1
  181. package/lib/prompts.d.ts +37 -2
  182. package/lib/prompts.js +111 -9
  183. package/lib/recovery-policy.js +20 -7
  184. package/lib/role-control-remote.d.ts +38 -0
  185. package/lib/role-control-remote.js +211 -0
  186. package/lib/role-control-rpc.d.ts +51 -0
  187. package/lib/role-control-rpc.js +377 -0
  188. package/lib/role-control-types.d.ts +92 -0
  189. package/lib/role-control-types.js +8 -0
  190. package/lib/role-invocation.d.ts +47 -0
  191. package/lib/role-invocation.js +135 -0
  192. package/lib/role-llm-runtime.d.ts +17 -0
  193. package/lib/role-llm-runtime.js +62 -0
  194. package/lib/role-llm.d.ts +31 -0
  195. package/lib/role-llm.js +66 -0
  196. package/lib/role-policy.d.ts +49 -8
  197. package/lib/role-policy.js +437 -60
  198. package/lib/role-providers.d.ts +1 -1
  199. package/lib/role-providers.js +30 -35
  200. package/lib/role-routing.d.ts +11 -2
  201. package/lib/role-routing.js +42 -25
  202. package/lib/role-runs.d.ts +135 -0
  203. package/lib/role-runs.js +304 -0
  204. package/lib/role-subagents.d.ts +58 -3
  205. package/lib/role-subagents.js +169 -56
  206. package/lib/roles.d.ts +5 -6
  207. package/lib/roles.js +10 -39
  208. package/lib/route-json.d.ts +19 -0
  209. package/lib/route-json.js +129 -0
  210. package/lib/routing-policy.d.ts +2 -0
  211. package/lib/routing-policy.js +12 -2
  212. package/lib/runtime-integration.d.ts +112 -0
  213. package/lib/runtime-integration.js +784 -0
  214. package/lib/runtime-recovery.js +18 -8
  215. package/lib/settings.d.ts +47 -13
  216. package/lib/settings.js +217 -82
  217. package/lib/skills.js +2 -2
  218. package/lib/status.d.ts +10 -1
  219. package/lib/status.js +11 -8
  220. package/lib/subagent-runtime.d.ts +45 -0
  221. package/lib/subagent-runtime.js +131 -0
  222. package/package.json +106 -56
  223. package/patches/subagent-runtime.yml +15 -0
  224. package/prompts/deepseek-flash.md +1 -1
  225. package/prompts/deepseek-v4-pro.md +2 -2
  226. package/prompts/deepwork.md +27 -18
  227. package/prompts/source/agents/clarifier.md +5 -3
  228. package/prompts/source/agents/orchestrator.md +18 -9
  229. package/prompts/source/agents/plan-critic.md +5 -1
  230. package/prompts/source/agents/planner.md +4 -2
  231. package/prompts/source/agents/reviewer.md +6 -0
  232. package/prompts/source/category/complex.md +4 -4
  233. package/prompts/source/category/creative.md +6 -4
  234. package/prompts/source/category/cross-cutting.md +10 -8
  235. package/prompts/source/category/deep.md +5 -3
  236. package/prompts/source/category/documenting.md +7 -1
  237. package/prompts/source/category/frontend.md +2 -2
  238. package/prompts/source/category/hard-reasoning.md +3 -3
  239. package/prompts/source/category/research.md +4 -2
  240. package/prompts/source/deepwork/claude-opus-5.md +2 -2
  241. package/prompts/source/deepwork/codex.md +1 -1
  242. package/prompts/source/deepwork/default.md +22 -15
  243. package/prompts/source/deepwork/gemini.md +23 -16
  244. package/prompts/source/deepwork/glm.md +21 -14
  245. package/prompts/source/deepwork/gpt.md +12 -6
  246. package/prompts/source/deepwork/planner.md +8 -5
  247. package/prompts/source/manifest.json +178 -63
  248. package/prompts/source/shared/dsh-host-contract.md +5 -3
  249. package/prompts/source/shared/locale.md +2 -2
  250. package/prompts/source/terminal/orchestrator.md +1 -1
  251. package/scripts/cold-profile-composition.mjs +329 -0
  252. package/scripts/cold-profile-sources.mjs +238 -0
  253. package/scripts/migrate-cold-profile.mjs +315 -0
  254. package/skills/ast-grep/SKILL.md +7 -4
  255. package/skills/brainstorming/SKILL.md +43 -22
  256. package/skills/coding-agent-sessions/SKILL.md +7 -4
  257. package/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +46 -46
  258. package/skills/coding-agent-sessions/scripts/tests/test_pi_family_scanners.py +130 -130
  259. package/skills/debugging/SKILL.md +14 -9
  260. package/skills/debugging/references/methodology/00-setup.md +14 -62
  261. package/skills/debugging/references/methodology/02-investigate.md +4 -4
  262. package/skills/debugging/references/methodology/03-flaky-triage.md +3 -3
  263. package/skills/debugging/references/methodology/04-hard-reasoning-escalation.md +2 -14
  264. package/skills/debugging/references/methodology/06-fix.md +6 -6
  265. package/skills/debugging/references/methodology/08-qa.md +5 -5
  266. package/skills/debugging/references/methodology/09-cleanup.md +15 -153
  267. package/skills/debugging/references/methodology/partial-runtime-evidence.md +3 -16
  268. package/skills/debugging/references/runtimes/bundled-js-binary.md +1 -16
  269. package/skills/debugging/references/runtimes/native-binary.md +9 -54
  270. package/skills/debugging/references/runtimes/node.md +4 -15
  271. package/skills/debugging/references/runtimes/python.md +3 -15
  272. package/skills/debugging/references/runtimes/rust.md +2 -18
  273. package/skills/debugging/references/tools/dap.md +1 -1
  274. package/skills/debugging/references/tools/ghidra.md +4 -15
  275. package/skills/debugging/references/tools/playwright-cli.md +3 -15
  276. package/skills/debugging/references/tools/pwntools.md +4 -16
  277. package/skills/dispatching-parallel-agents/SKILL.md +18 -16
  278. package/skills/frontend/SKILL.md +7 -4
  279. package/skills/frontend/references/design/react-dev-tooling-skill.md +1 -1
  280. package/skills/git-master/SKILL.md +7 -4
  281. package/skills/init-deep/SKILL.md +7 -4
  282. package/skills/receiving-code-review/SKILL.md +17 -12
  283. package/skills/remove-ai-slops/SKILL.md +39 -38
  284. package/skills/requesting-code-review/SKILL.md +19 -17
  285. package/skills/requesting-code-review/code-reviewer.md +13 -1
  286. package/skills/subagent-driven-development/SKILL.md +29 -26
  287. package/skills/subagent-driven-development/implementer-prompt.md +29 -11
  288. package/skills/subagent-driven-development/spec-reviewer-prompt.md +6 -1
  289. package/skills/using-git-worktrees/SKILL.md +7 -4
  290. package/skills/writing-plans/SKILL.md +29 -24
  291. package/skills/writing-plans/plan-document-reviewer-prompt.md +10 -1
@@ -1,166 +1,28 @@
1
1
  > DSH adapter boundary: resolve this resource from the loaded skill's directory resourceBase. Examples are not authority: installation/download/login, private state, Git writes and destructive operations need exact explicit authorization. Use only tools and native roles actually exposed in the current catalog and allowed by the caller; otherwise use a real direct fallback or report the limitation. Translate shell examples to the active runtime.
2
2
 
3
- # Phase 9 + 10 — Cleanup & Final Verification
3
+ # Phase 9 + 10: Cleanup and Final Verification
4
4
 
5
- The working tree after the session must differ from before only by the real fix and any retained reproduction evidence. Anything else is a process failure.
5
+ The working tree must retain its initial user changes plus only the authorized fix and valid regression evidence. Cleanup doesn't authorize Git writes or changes to other tasks' files.
6
6
 
7
- ---
7
+ ## Phase 9: Clean Task-Owned Resources
8
8
 
9
- ## Phase 9 — Cleanup & Revert
9
+ Use the session-level or optional temporary resource ownership checklist from Phase 1 to clean only owned resources. Check cleanup success, but don't write completed status before deleting a disposable checklist or resource journal. No per-update persistence, repeated stability/hash check, repository debug journal, or extra ledger is needed. Never read, edit, adopt, or delete an existing `.debug-journal.md` or modify `.git/info/exclude`.
10
10
 
11
- ### The walk
11
+ Remove temporary source instrumentation with a patch limited to this task's exact hunks. Don't restore a whole file from Git: that could discard user edits or the real fix. Close only owned debugger/browser contexts and task-owned sessions. Terminate a process only after verifying its recorded PID and start identity; don't use broad process-name kills. Restore environment overrides to their captured prior state, rather than blindly unsetting them.
12
12
 
13
- Open the journal's "Artifacts to revert" list. Walk it top to bottom. Check each box only after the revert command succeeds and produces no error.
13
+ Delete only exact paths created by this task, after resolving and checking each target and its ownership. Don't use wildcard cleanup for fixtures, core dumps, libraries, browser reports, or scratch projects. Browser cleanup also follows its profile-marker and process-identity checks. Existing files, processes, configuration, and other tasks' resources aren't cleanup targets.
14
14
 
15
- ### Standard revert operations
15
+ Inspect `git status --short`, the relevant diff, and new files against the initial working-tree state. Check this task's edits for leftover debug statements, temporary logs, commented-out trial code, and unrelated formatting. Report existing unrelated changes without cleaning them.
16
16
 
17
- Most sessions create some combination of these artifacts. The commands below are the defaults — your journal should have the exact commands for this session.
17
+ Once owned resources are clean, remove any task-owned temporary checklist and raw debug material no longer needed, without a final status-write ceremony. Retained product tests must protect final valid functional or external-interface requirements, not decision counterexamples, descriptive-text locks, or the absence of removed components.
18
18
 
19
- ```bash
20
- # --- Temporary source edits (instrumentation statements, debug prints) ---
21
- git checkout <file> # reverts only that file
22
- git diff <file> # verify clean
19
+ ## Phase 10: Final Verification
23
20
 
24
- # --- tmux sessions ---
25
- tmux kill-session -t <session-name>
26
- tmux ls # confirm gone
21
+ Report evidence for each required claim:
27
22
 
28
- # --- Temp fixtures / scratch scripts ---
29
- rm -f /tmp/debug-*.*
30
- ls /tmp/debug-*.* 2>/dev/null # confirm gone (ls returns non-zero when no match)
23
+ 1. **Reproduction:** The captured failing case before the fix and the same case passing after it, with command/scenario and relevant observed output.
24
+ 2. **Regression:** Results of the affected package's required tests, or the explicit absence of a suite or inability to run it.
25
+ 3. **Real-surface QA:** The original scenario's correct observed result. State any inaccessible or authentication-gated coverage honestly.
26
+ 4. **Ownership cleanup:** Confirmation that task-owned artifacts were removed and initial unrelated work remains untouched.
31
27
 
32
- # --- Background processes (debugger-attached runtimes) ---
33
- pkill -f 'node --inspect' || true
34
- pkill -f 'python -m pdb' || true
35
- pkill -f 'debugpy' || true
36
- pkill -f 'dlv' || true
37
- pkill -f 'gdb' || true
38
- pkill -f 'lldb' || true
39
-
40
- # --- Debug-relevant ports confirmed free ---
41
- lsof -iTCP:9229 -sTCP:LISTEN -nP 2>/dev/null # Node inspector default
42
- lsof -iTCP:5678 -sTCP:LISTEN -nP 2>/dev/null # debugpy default
43
- lsof -iTCP:2345 -sTCP:LISTEN -nP 2>/dev/null # dlv default
44
- lsof -iTCP:9999 -sTCP:LISTEN -nP 2>/dev/null # pwndbg/gdb-server default
45
-
46
- # --- Env var overrides in current shell ---
47
- unset DEBUG_OVERRIDE_FOO
48
- unset PYTHONBREAKPOINT
49
- unset RUST_LOG
50
- unset DEBUG
51
-
52
- # --- Ghidra scratch projects (if created just for this session) ---
53
- # rm -rf ~/ghidra-projects/debug-scratch
54
-
55
- # --- Core dumps from debugging (if any) ---
56
- rm -f ./core ./core.* ~/core.*
57
-
58
- # --- Playwright trace files ---
59
- rm -rf playwright-report/ test-results/
60
- ```
61
-
62
- ### The verify command
63
-
64
- This is the single most important check of the whole skill:
65
-
66
- ```bash
67
- git status
68
- git diff --stat
69
- ```
70
-
71
- The diff must contain **only**:
72
-
73
- 1. The real fix.
74
- 2. Any retained regression test or reproduction evidence, if tracked.
75
- 3. Nothing else.
76
-
77
- ### Detector checklist — scan the diff for these
78
-
79
- If `git status` shows any untracked debug file, or `git diff` shows any of the patterns below, **you are not done**. Clean it.
80
-
81
- | Pattern | Usually means |
82
- |---|---|
83
- | `debugger;` | Node debug statement left behind |
84
- | `breakpoint()` | Python debug statement left behind |
85
- | `dbg!(...)` | Rust debug macro left behind |
86
- | `fmt.Println("DEBUG: ...")` | Go ad-hoc print |
87
- | `console.log("[DEBUG]` | Node ad-hoc log |
88
- | `print(f"DEBUG: ` | Python ad-hoc print |
89
- | `// TODO DEBUG`, `// HACK`, `// XXX` | Stale debug marker |
90
- | `// <PROJECT>-DEBUG` | Session-specific marker from this skill's edits |
91
- | Commented-out code blocks near the fix | Dead code from trial fixes |
92
- | Reordered imports or formatting in unrelated files | Drift from your editor's autoformat during the session |
93
-
94
- ### Remove the journal
95
-
96
- Only once the git check is clean:
97
-
98
- ```bash
99
- rm .debug-journal.md
100
- sed -i.bak '/^\.debug-journal\.md$/d' .git/info/exclude && rm -f .git/info/exclude.bak
101
- ```
102
-
103
- The journal is not part of the fix; it doesn't belong in the commit or in the git exclude list.
104
-
105
- ---
106
-
107
- ## Phase 10 — Final Verification
108
-
109
- Last gate before reporting done. All four gates must be true, and all four must have **evidence in your final message** to the user. Passing a gate without evidence is the same as failing it.
110
-
111
- ### The four gates
112
-
113
- 1. **Red→green reproduction confirmed** — show the failing case's output from before the fix and the same case's passing output after. Both outputs visible in the reply (and journaled during work).
114
-
115
- 2. **Existing test suite green** — show the suite's final pass line when one exists (e.g. `42 passed in 3.14s`); otherwise state that no suite exists. Not just the targeted test, if any.
116
-
117
- 3. **Manual QA reproduced the fix** — show the command or scenario that originally failed and its now-correct output. Verbatim, not paraphrased.
118
-
119
- 4. **Working tree clean of debug artifacts** — show `git diff --stat` output containing only the fix and any retained reproduction evidence, plus `git status` clean of untracked debug files.
120
-
121
- If any of the four lacks evidence, you have not finished — return to the appropriate phase.
122
-
123
- ### Final message template
124
-
125
- Keep it short. Evidence-dense. The user should be able to skim it in 30 seconds.
126
-
127
- ```markdown
128
- Fixed.
129
-
130
- **Root cause**: <one sentence — the mechanism, not the symptom>
131
- **Fix**: `<file:line>` — <two words>
132
- **Reproduction**: `<test file>::<test name>` or <scenario> — failure before fix, same case passing after
133
- **QA**: <one line describing what you ran and what you saw>
134
-
135
- Diff:
136
- ```
137
- <git diff --stat output — should be tiny>
138
- ```
139
-
140
- **Next steps I didn't take** (awaiting your decision):
141
- - <follow-up 1, if any — from QA silent-failure scan or refactor opportunities noted during Phase 7>
142
- - <follow-up 2 — or "none" if nothing else surfaced>
143
- ```
144
-
145
- ### Example (from a real session)
146
-
147
- ```markdown
148
- Fixed.
149
-
150
- **Root cause**: pi-mono Agent's `model.baseUrl` was hardcoded to `api.anthropic.com`, so the `ANTHROPIC_BASE_URL` env var was silently ignored. The proxy API key was rejected by the real Anthropic API with 401, but pi-mono packaged the error into the assistant message's `errorMessage` field instead of throwing, so the route's try/catch never fired and the client received HTTP 200 with empty content.
151
-
152
- **Fix**: `core/pi-bridge/modelResolver.ts:117` — override baseUrl
153
- **Test**: `__tests__/core/modelResolver.test.ts::resolves_env_override` — red without fix, green with fix
154
- **QA**: `curl -X POST /api/refinement/chat` with proxy env set, observed non-zero usage and non-empty content
155
-
156
- Diff:
157
- ```
158
- core/pi-bridge/modelResolver.ts | 3 +++
159
- __tests__/core/modelResolver.test.ts | 42 ++++++++++++++++++++++
160
- 2 files changed, 45 insertions(+)
161
- ```
162
-
163
- **Next steps I didn't take** (awaiting your decision):
164
- - pi-mono itself silently swallows LLM errors into `errorMessage`; adding a throw-on-error wrapper at our orchestrator layer would surface these upstream
165
- - Same silent-failure pattern exists in the planning route — likely the same fix applies
166
- ```
28
+ Don't claim completion when a required check is missing or a substantive risk remains unresolved. Keep the final report concise: current root-cause mechanism, fix location, verification results, and remaining risks or unverified items. Don't append a hypothesis, trial, or decision history to product docs or the final report.
@@ -99,7 +99,7 @@ If the operation succeeded earlier (before quota ran out, before access was revo
99
99
 
100
100
  ### Tier 6 — Pure code reading with independent research verification
101
101
 
102
- If literally none of the above is available, read the code carefully and use one bounded `research` pass to verify cited claims against the available source. This is the weakest tier and you must explicitly mark conclusions as "unverified" in the journal.
102
+ If none of the above is available, read the code carefully and use one bounded `research` pass to verify cited claims against the available source. This is the weakest tier: explicitly mark the claim as unverified in the deliverable, without creating a repository journal.
103
103
 
104
104
  ---
105
105
 
@@ -116,7 +116,7 @@ A defensible conclusion **prefers two independent signals from different tiers**
116
116
  | Tier 3 + Tier 4 (cross-check + contrastive run) | medium — both partial |
117
117
  | Tier 6 alone (code reading only) | **insufficient** — escalate or mark unverified |
118
118
 
119
- Record in the journal:
119
+ State the current evidence and verification limit in conversation or the deliverable, not a repository journal:
120
120
 
121
121
  ```markdown
122
122
  ## Partial runtime evidence
@@ -203,17 +203,4 @@ Use `research` to verify factual artifact claims. Use the Phase 4 hard-reasoning
203
203
 
204
204
  ## Cleanup additions for partial-evidence work
205
205
 
206
- ```bash
207
- # Proxy artifacts
208
- pkill -f mitmproxy 2>/dev/null
209
- rm -f ~/.mitmproxy/cache_* 2>/dev/null
210
-
211
- # Debug log files
212
- rm -f /tmp/trace.log /tmp/*-debug-trace.log
213
-
214
- # DYLD_INSERT / LD_PRELOAD shim libraries
215
- rm -f /tmp/*.dylib /tmp/*.so
216
-
217
- # Verify env vars set in your shell are not persisted
218
- unset HTTPS_PROXY APP_DEBUG APP_LOG_LEVEL APP_LOG_FILE 2>/dev/null
219
- ```
206
+ Put proxy processes, logs, shim libraries, and environment overrides in the temporary resource ownership checklist before creation. Follow Phase 9: stop only identity-verified owned processes, delete exact owned paths, and restore captured prior environment values. Never remove shared proxy caches or use wildcard cleanup.
@@ -393,22 +393,7 @@ If reverse-engineering proprietary software, the extracted source is the vendor'
393
393
 
394
394
  ## Phase 9 cleanup specifics for bundled-JS work
395
395
 
396
- ```bash
397
- # Remove extracted bundles — they may contain proprietary source
398
- rm -f /tmp/extracted-bundle.js /tmp/extracted-*.js
399
- rm -rf /tmp/asar-extracted/
400
- rm -rf /tmp/_MEI*
401
-
402
- # Remove strings dumps
403
- rm -f /tmp/*-strings.txt /tmp/*-strings-v*.txt
404
-
405
- # Remove Python helper scripts created for parsing
406
- rm -f /tmp/extract_bundled_js.py /tmp/parse_template.py
407
-
408
- # Verify the extraction directory is gone (if you used a workspace dir)
409
- ls /Users/$USER/local-workspaces/*-extracted/ 2>/dev/null
410
- # rm -rf only after journal review confirms nothing important is there
411
- ```
396
+ Follow [central cleanup rules](../methodology/09-cleanup.md). Register exact task-owned paths for extracted bundles, ASAR or `_MEI` extraction directories, strings dumps, and parsing helpers in the temporary resource checklist. Resolve and verify each path and its ownership before deletion, then verify cleanup. Don't infer ownership from a filename, directory prefix, or location under `/tmp`; extracted proprietary source must stay out of commits and public reports.
412
397
 
413
398
  ---
414
399
 
@@ -109,7 +109,7 @@ print(repr(data[max(0,pos-100):pos+200]))
109
109
 
110
110
  If you must keep using `strings`, lower the threshold: `strings -n 1 -t x ./target | rg ...`. The signal-to-noise drops sharply but short content is preserved.
111
111
 
112
- Write the triage summary to the journal:
112
+ Keep current triage facts in conversation or task-owned temporary evidence:
113
113
 
114
114
  ```markdown
115
115
  ## Binary triage
@@ -189,7 +189,7 @@ spctl --assess --type execute -vv ./target # Gatekeeper assessment
189
189
  tmp=$(mktemp -d)
190
190
  codesign -dvv --extract-certificates="$tmp/cert" ./target 2>&1
191
191
  ls -la "$tmp"
192
- # rm -rf "$tmp" # journal first, clean up later
192
+ # Clean only this exact owned directory after checking the resource checklist.
193
193
 
194
194
  # Strings inside specific segments only (less noise than full-binary strings)
195
195
  otool -s __TEXT __cstring ./target # C string section
@@ -297,8 +297,8 @@ else
297
297
  echo "Using service: $SERVICE"
298
298
  fi
299
299
 
300
- # 2. JOURNAL the original proxy state before changing it (REQUIRED for safe rollback):
301
- networksetup -getwebproxy "$SERVICE" # save this output to journal
300
+ # 2. Capture original state in the temporary resource checklist before an authorized change:
301
+ networksetup -getwebproxy "$SERVICE" # capture exact prior state temporarily
302
302
  networksetup -getsecurewebproxy "$SERVICE" # save this too
303
303
 
304
304
  # 3. Start mitmproxy with persistent CA at ~/.mitmproxy/
@@ -316,13 +316,10 @@ HTTPS_PROXY=http://127.0.0.1:8888 SSL_CERT_FILE=~/.mitmproxy/mitmproxy-ca-cert.p
316
316
  networksetup -setwebproxy "$SERVICE" 127.0.0.1 8888
317
317
  networksetup -setsecurewebproxy "$SERVICE" 127.0.0.1 8888
318
318
 
319
- # 6. Cleanup — RESTORE original state from journal, untrust CA:
320
- networksetup -setwebproxystate "$SERVICE" off
321
- networksetup -setsecurewebproxystate "$SERVICE" off
322
- sudo security delete-certificate -c "mitmproxy" /Library/Keychains/System.keychain
319
+ # 6. Cleanup follows ../methodology/09-cleanup.md using captured service and certificate identities.
323
320
  ```
324
321
 
325
- **Critical**: forgetting step 6 leaves all your subsequent traffic mis-routed and silently MITM-able. Journal every step.
322
+ System proxy and trust changes require specific authorization. Follow [central cleanup rules](../methodology/09-cleanup.md). Before any authorized change, capture the service's exact proxy configuration, certificate fingerprint and keychain, and prior certificate/trust state in the temporary resource checklist. Restore that state, including any prior trust settings; remove a certificate only if this task introduced it and its exact identity is verified. Don't assume proxies were disabled or delete a certificate by name. The checklist records temporary resource ownership and restoration data, not repository development history.
326
323
 
327
324
  ### What to look for
328
325
 
@@ -407,7 +404,7 @@ For tiny fixes (one byte, one branch inversion):
407
404
  printf '\x90\x90' | dd of=./target bs=1 seek=$((0x1234)) conv=notrunc
408
405
  ```
409
406
 
410
- Journal the exact `dd` command and the original bytes so you can revert.
407
+ Before an authorized binary patch, capture the exact target identity, offset, original bytes, and restoration action in the temporary resource checklist. Never adopt another task's patch as an owned cleanup target.
411
408
 
412
409
  ### Option C: Wrap / shim
413
410
 
@@ -439,48 +436,6 @@ If it's a third-party binary and none of the above are feasible, the "fix" is a
439
436
 
440
437
  ## Phase 9 cleanup specifics
441
438
 
442
- ```bash
443
- # Kill debugger sessions
444
- pkill -f 'gdb' || true
445
- pkill -f 'lldb' || true
446
-
447
- # Ghidra scratch projects (if made just for this session)
448
- # Named something like ~/ghidra-projects/debug-<timestamp>:
449
- ls -la ~/ghidra-projects/ 2>/dev/null
450
- # rm -rf ~/ghidra-projects/debug-scratch # only if the journal says to
451
-
452
- # Core dumps left from crashes
453
- rm -f ./core ./core.* ~/core.*
454
-
455
- # strace/ltrace output files
456
- rm -f trace.out ltrace.out
457
-
458
- # If you made a binary patch (Option B above), confirm revert
459
- # The journal should have the original bytes — restore them:
460
- # printf '<original-bytes>' | dd of=./target bs=1 seek=<offset> conv=notrunc
461
-
462
- # Trace-output files
463
- rm -f /tmp/debug-*.bin /tmp/debug-*.strace /tmp/debug-*.ltrace
439
+ Follow [central cleanup rules](../methodology/09-cleanup.md). Register exact owned scratch projects, core dumps, traces, shim libraries, and extracted data, plus debugger and proxy PIDs and start identities. Restore only this task's temporary binary patch at its recorded target identity and offsets using captured original bytes, preserving the authorized final fix.
464
440
 
465
- # macOS-specific:
466
- # Restore proxy settings if you set them (CRITICAL — leaves system traffic mis-routed otherwise)
467
- # Use the SAME $SERVICE you used when enabling the proxy (read it from the journal).
468
- # Do NOT hardcode "Wi-Fi" — many machines route traffic over Ethernet, USB tether, or a VPN service.
469
- [ -n "$SERVICE" ] && {
470
- networksetup -setwebproxystate "$SERVICE" off 2>/dev/null
471
- networksetup -setsecurewebproxystate "$SERVICE" off 2>/dev/null
472
- }
473
- # Or restore explicitly from the journaled original state — see the proxy section above.
474
-
475
- # Stop mitmproxy
476
- pkill -f 'mitmproxy' 2>/dev/null
477
-
478
- # Remove DYLD shim libraries you built
479
- rm -f /tmp/*-shim.dylib
480
-
481
- # Clear extracted strings dumps (these can be huge and may contain secrets)
482
- rm -f /tmp/*-strings*.txt
483
-
484
- # Verify hostname resolution returns to normal (mitmproxy can leave entries)
485
- scutil --dns | head -20
486
- ```
441
+ For authorized macOS proxy/trust changes, restore the exact captured prior state for the same service and certificate identity. Don't assume the prior proxy was disabled, delete certificates by a shared name, or clean another task's files. Report any restoration that can't be verified.
@@ -44,7 +44,7 @@ The breakpoint list will happily display it, so you think it's set. It isn't.
44
44
  | **Chrome DevTools GUI** (`chrome://inspect`) | CLI not required, faster iteration | Not usable if user specifically asked for CLI |
45
45
  | **Debug the built `dist/` JS** | Source maps are working end-to-end | Requires `npm run build` on every source change |
46
46
 
47
- The `debugger;` statement is the most reliable. Journal the edit — revert at Phase 9.
47
+ The `debugger;` statement is the most reliable. List the exact temporary hunk in the resource checklist and remove only that hunk at Phase 9.
48
48
 
49
49
  ---
50
50
 
@@ -206,7 +206,7 @@ These are the patterns that most commonly look like success but aren't. Always c
206
206
  | Callback-style API where callback never fires | Error happened before callback scheduled |
207
207
  | Handler returns `res.json(...)` twice | Second call is silent on some Express versions |
208
208
 
209
- When you find one, add a temporary `console.error('[DEBUG]', ...)` to make it loud — journal it, revert at Phase 9.
209
+ When you find one, use temporary instrumentation to expose it. List the exact owned hunk in the resource checklist and remove it at Phase 9 without discarding existing edits.
210
210
 
211
211
  ---
212
212
 
@@ -225,7 +225,7 @@ tmux send-keys -t debug-client 'node inspect 127.0.0.1:9229' Enter
225
225
  tmux capture-pane -p -t debug-server -S -50
226
226
  ```
227
227
 
228
- Journal both session names. Kill both at Phase 9:
228
+ List both task-owned session identities in the temporary resource checklist. Close only those owned sessions at Phase 9:
229
229
 
230
230
  ```bash
231
231
  tmux kill-session -t debug-server
@@ -248,15 +248,4 @@ Phrase as a note, not a request: "I can push through with `debugger;` statements
248
248
 
249
249
  ## Phase 9 cleanup specifics
250
250
 
251
- ```bash
252
- # Revert source-level debug statements
253
- git diff | grep -E '(debugger;|console\.log\(.*DEBUG|\[ARBITER-DEBUG|\[DEBUG)'
254
- # Revert any matching files:
255
- git checkout <file>
256
-
257
- # Kill inspector-attached processes
258
- pkill -f 'node --inspect' || true
259
- pkill -f 'bun --inspect' || true
260
- pkill -f 'deno.*--inspect' || true
261
- lsof -iTCP:9229 -sTCP:LISTEN -nP 2>/dev/null
262
- ```
251
+ Follow [central cleanup rules](../methodology/09-cleanup.md). Register this task's temporary `debugger;` and logging hunks, inspector process PIDs and start identities, listener ports, and debugger/tmux session identities in the temporary resource checklist. Remove only those source hunks, never restore whole files. Close only owned sessions; verify the recorded PID and start identity before terminating a process. A listener on port 9229 isn't ownership evidence.
@@ -58,7 +58,7 @@ export PYTHONBREAKPOINT=ipdb.set_trace
58
58
  export PYTHONBREAKPOINT=0
59
59
  ```
60
60
 
61
- **Journal this env var** — unset at Phase 9.
61
+ Capture this environment variable's prior value in the temporary resource checklist and restore it at Phase 9.
62
62
 
63
63
  ---
64
64
 
@@ -192,7 +192,7 @@ debugpy.wait_for_client() # blocks until attached
192
192
  debugpy.breakpoint() # programmatic breakpoint
193
193
  ```
194
194
 
195
- **Journal**: the port (5678) and the listener file — unset at Phase 9.
195
+ List the owned listener/process identity, port, and temporary source hunk in the resource checklist; close the owned listener and remove only that hunk at Phase 9.
196
196
 
197
197
  ---
198
198
 
@@ -235,16 +235,4 @@ Add these to Phase 8's silent-failure check:
235
235
 
236
236
  ## Phase 9 cleanup specifics
237
237
 
238
- ```bash
239
- # Remove breakpoint() / ipdb / pudb lines from source
240
- git diff | grep -E '(breakpoint\(\)|import ipdb|import pudb|import pdb; pdb\.set_trace)'
241
- # If the above has output, revert those files:
242
- git checkout <file>
243
-
244
- # Unset the global breakpoint override
245
- unset PYTHONBREAKPOINT
246
-
247
- # Kill any leftover debugpy listeners
248
- pkill -f 'debugpy' || true
249
- lsof -iTCP:5678 -sTCP:LISTEN -nP 2>/dev/null # confirm free
250
- ```
238
+ Follow [central cleanup rules](../methodology/09-cleanup.md). Register this task's temporary breakpoint/import hunks, debugpy listener ports, process PIDs and start identities, and the exact prior `PYTHONBREAKPOINT` state (including whether it was unset). Remove only owned source hunks, never restore whole files. Restore the captured environment state and close only owned listeners after verifying PID and start identity; port 5678 alone doesn't establish ownership.
@@ -62,7 +62,7 @@ Multiple values at once:
62
62
  dbg!(&user, &request, elapsed.as_millis());
63
63
  ```
64
64
 
65
- `dbg!` writes to stderr, so it won't corrupt stdout-based pipelines. **Journal each `dbg!` you add**; revert at Phase 9.
65
+ `dbg!` writes to stderr, so it won't corrupt stdout-based pipelines. List each temporary owned hunk in the resource checklist and remove only those hunks at Phase 9.
66
66
 
67
67
  ---
68
68
 
@@ -217,20 +217,4 @@ Now `rust-gdb ./target/release/my_binary` works on release builds. This is requi
217
217
 
218
218
  ## Phase 9 cleanup specifics
219
219
 
220
- ```bash
221
- # Revert dbg! macro additions
222
- git diff | grep -E 'dbg!\('
223
- # For any file with dbg! additions:
224
- git checkout <file>
225
-
226
- # Unset env vars
227
- unset RUST_LOG RUST_BACKTRACE
228
-
229
- # Kill any rust-gdb/lldb sessions
230
- pkill -f 'rust-gdb' || true
231
- pkill -f 'rust-lldb' || true
232
- pkill -f '^lldb ' || true
233
-
234
- # tokio-console binds 6669 by default
235
- lsof -iTCP:6669 -sTCP:LISTEN -nP 2>/dev/null
236
- ```
220
+ Follow [central cleanup rules](../methodology/09-cleanup.md). Register this task's temporary `dbg!` hunks, debugger and tokio-console process PIDs and start identities, listener ports, and exact prior `RUST_LOG`/`RUST_BACKTRACE` states (including whether each was unset). Remove only owned source hunks, never restore whole files. Restore the captured environment states and close only owned sessions after verifying process identity; port 6669 alone doesn't establish ownership.
@@ -88,4 +88,4 @@ terminate
88
88
  quit
89
89
  ```
90
90
 
91
- Cleanup is part of the session: terminate the debuggee, then quit the REPL. `quit` destroys a socket transport or kills an adapter process started by this client; journal any wrapper scripts you created according to the skill's cleanup phase.
91
+ Cleanup is part of the session: terminate the owned debuggee, then quit the REPL. `quit` destroys a socket transport or kills an adapter process started by this client. List wrapper scripts in the task-owned temporary resource checklist and remove only exact owned paths according to Phase 9.
@@ -33,7 +33,7 @@ Ghidra is a Java Swing app. Looks dated, works well.
33
33
  ## First-time workflow (memorize this — it's not obvious)
34
34
 
35
35
  1. **Start Ghidra**: `ghidraRun`
36
- 2. **Create a project**: File → New Project → Non-Shared → name it `debug-<binary-name>` (journal this path so you can rm it at Phase 9 if disposable).
36
+ 2. **Create a project**: File → New Project → Non-Shared → create it in the task-owned temporary root and put its exact path in the resource checklist for Phase 9.
37
37
  3. **Import the binary**: File → Import File → pick your target. Accept default format detection.
38
38
  4. **Double-click the imported binary** in the project listing. Ghidra asks to analyze it — say **yes**, accept defaults for the first pass. This takes anywhere from seconds (small binary) to tens of minutes (large binary).
39
39
  5. **Once analysis completes**, you're in the CodeBrowser view.
@@ -168,12 +168,12 @@ The community has a large collection: https://github.com/NationalSecurityAgency/
168
168
 
169
169
  ## Bookmarks + Notes
170
170
 
171
- Ghidra has built-in bookmarks and comments. Use them as your journal inside the project:
171
+ Ghidra has built-in bookmarks and comments. Use them for current analysis facts in a task-owned scratch project:
172
172
 
173
173
  - Right-click an address → `Set Bookmark` → tag as `Note`. Attach a description.
174
174
  - Right-click → `Comments → Set EOL Comment` (shows up inline in decompiler).
175
175
 
176
- Treat these as part of the journal. If you end up promoting this Ghidra project (keeping it after the debug session), the comments become durable documentation.
176
+ Don't preserve hypothesis trials or decision history in a retained project. If retention is authorized, keep only final findings, current mechanism, and supporting evidence; otherwise remove the task-owned scratch project during cleanup.
177
177
 
178
178
  ---
179
179
 
@@ -200,15 +200,4 @@ Ghidra is the right tool when you need to **read the logic** of a binary you don
200
200
 
201
201
  ## Phase 9 cleanup specifics
202
202
 
203
- ```bash
204
- # If you created a scratch project just for this debug session, journal path and remove:
205
- # (the journal should have the exact path)
206
- # Example:
207
- ls ~/ghidra-projects/ 2>/dev/null
208
- # rm -rf ~/ghidra-projects/debug-<binary-name>
209
-
210
- # If you promoted the project (kept it), it's not cleanup — note it in the final summary to the user
211
-
212
- # Kill any running Ghidra headless processes
213
- pkill -f 'analyzeHeadless' || true
214
- ```
203
+ Follow Phase 9 using the temporary resource checklist: remove only the exact owned scratch project and terminate only an identity-verified task-owned headless process. Never delete another project or use process-name-wide kills. Report any authorized retained analysis artifact with final findings only.
@@ -60,11 +60,11 @@ npx playwright codegen --viewport-size=375,667 https://your-app.local # iPhon
60
60
  npx playwright codegen --device="iPhone 14" https://your-app.local
61
61
  ```
62
62
 
63
- Click / type / navigate in the browser; watch the script build in the side panel. Copy the generated script into your journal as the repro for Phase 8.
63
+ Use the run-owned empty browser context and save the reproduction script in the task-owned temporary root for Phase 8. Put its exact path in the resource checklist, not a repository journal.
64
64
 
65
65
  ### 2. A one-shot Playwright script — reproduce + capture
66
66
 
67
- Usually the Phase 8 QA artifact. Save to `/tmp/debug-repro.spec.ts` (journal it):
67
+ Usually the Phase 8 QA artifact. Save under the task-owned temporary root and list its exact path for cleanup (replace illustrative `/tmp/` paths below):
68
68
 
69
69
  ```ts
70
70
  // /tmp/debug-repro.spec.ts
@@ -303,16 +303,4 @@ Remove-Item -LiteralPath $resolvedRunRoot -Recurse -Force
303
303
 
304
304
  ## Phase 9 cleanup specifics
305
305
 
306
- ```bash
307
- # Remove trace files from debug runs
308
- rm -rf playwright-report/ test-results/ trace.zip
309
-
310
- # Remove debug spec files from /tmp
311
- rm -f /tmp/debug-*.spec.ts
312
-
313
- # Remove screenshot captures
314
- rm -f /tmp/debug-*.png
315
-
316
- # If you installed browsers just for this session (rare):
317
- # Don't remove them — they're useful for future sessions. They live in ~/Library/Caches/ms-playwright (macOS) or ~/.cache/ms-playwright (Linux).
318
- ```
306
+ Follow [central cleanup rules](../methodology/09-cleanup.md) and the profile-marker and process-identity checks above. Register exact paths under the task-owned temporary root for reports, test results, traces, debug specs, and screenshots, plus owned browser/context identities and process PIDs and start identities. Delete only resolved, verified owned paths, not shared relative directories or `/tmp` filename patterns. Existing browser caches and profiles aren't cleanup targets; any authorized task-created browser installation needs its exact owned path recorded before cleanup.
@@ -161,7 +161,7 @@ assert p.poll() is not None and p.poll() != 0, 'expected crash, got clean exit'
161
161
  log.success(f'confirmed crash (exit {p.poll()})')
162
162
  ```
163
163
 
164
- Journal this script path. Run it as your "red test":
164
+ Put this script's exact owned path in the temporary resource checklist. Run it as your failing reproduction:
165
165
 
166
166
  ```bash
167
167
  python /tmp/debug-repro.py
@@ -244,24 +244,12 @@ This is the best way to debug a specific crash repeatably — pwntools drives in
244
244
 
245
245
  - **Python version**: pwntools supports Python 3.8+. Very old distros may not have it.
246
246
  - **`p.interactive()` blocks.** It's for manual exploration; remove it from automated scripts.
247
- - **ASLR on local runs**: turn off for reproducibility during debugging: `echo 0 | sudo tee /proc/sys/kernel/randomize_va_space` (remember to revert — journal this!).
247
+ - **ASLR on local runs**: changing system ASLR needs specific authorization. If authorized, capture its prior state and exact restoration action in the temporary resource checklist before changing it; restore that state at cleanup.
248
248
  - **`gdb.debug()` requires `gdb-multiarch`** for cross-arch binaries.
249
- - **Subprocess cleanup**: if your script crashes, orphan `./target` processes may linger. Kill them at Phase 9 or add `atexit` cleanup.
249
+ - **Subprocess cleanup**: if your script crashes, task-owned target processes may linger. Phase 9 or `atexit` cleanup must verify each recorded PID and start identity before terminating it; a binary name alone doesn't establish ownership.
250
250
 
251
251
  ---
252
252
 
253
253
  ## Phase 9 cleanup specifics
254
254
 
255
- ```bash
256
- # Remove pwntools debug scripts
257
- rm -f /tmp/debug-*.py
258
- rm -f /tmp/debug-crashes.txt
259
-
260
- # Kill orphan target processes from failed runs
261
- pkill -f './target' || true # adjust to actual binary name
262
-
263
- # Restore ASLR if disabled
264
- # echo 2 | sudo tee /proc/sys/kernel/randomize_va_space # Linux default
265
-
266
- # Revert any binary patches applied for testing (see native-binary.md for details)
267
- ```
255
+ Follow [central cleanup rules](../methodology/09-cleanup.md). Register exact owned script/crash-output paths, target and debugger process PIDs and start identities, and any specifically authorized ASLR change's captured prior value and restoration action. Verify process identity before terminating an orphan; a binary name isn't ownership evidence. Restore ASLR to its captured value, not an assumed default. Restore only this task's temporary binary patches using the recorded target identity, offsets, and original bytes, preserving the authorized final fix.