@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.
- package/README.md +38 -66
- package/agent-presets/dsmm-builder/agent.cordis.yml +10 -2015
- package/agent-presets/dsmm-clarifier/agent.cordis.yml +24 -343
- package/agent-presets/dsmm-code-search/agent.cordis.yml +19 -6
- package/agent-presets/dsmm-coding/agent.cordis.yml +19 -438
- package/agent-presets/dsmm-complex/agent.cordis.yml +23 -1009
- package/agent-presets/dsmm-creative/agent.cordis.yml +25 -442
- package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +29 -1013
- package/agent-presets/dsmm-deep/agent.cordis.yml +24 -1008
- package/agent-presets/dsmm-doc-search/agent.cordis.yml +19 -6
- package/agent-presets/dsmm-documenting/agent.cordis.yml +26 -439
- package/agent-presets/dsmm-frontend/agent.cordis.yml +21 -440
- package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +22 -441
- package/agent-presets/dsmm-media-reader/agent.cordis.yml +19 -6
- package/agent-presets/dsmm-normal-task/agent.cordis.yml +19 -438
- package/agent-presets/dsmm-oracle/agent.cordis.yml +25 -340
- package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +25 -340
- package/agent-presets/dsmm-orchestrator/agent.cordis.yml +29 -2025
- package/agent-presets/dsmm-plan-critic/agent.cordis.yml +24 -341
- package/agent-presets/dsmm-planner/agent.cordis.yml +14 -344
- package/agent-presets/dsmm-quick/agent.cordis.yml +19 -6
- package/agent-presets/dsmm-research/agent.cordis.yml +23 -8
- package/agent-presets/dsmm-reviewer/agent.cordis.yml +25 -340
- package/docs/agent-presets.md +36 -52
- package/docs/compatibility.md +50 -108
- package/docs/deferred-native-approval-risk.md +19 -0
- package/docs/design.md +2 -2
- package/docs/lsp.md +11 -21
- package/docs/migration-from-ocmm.md +2 -2
- package/docs/model-routing.md +84 -59
- package/docs/native-permissions.md +35 -0
- package/docs/profiles.md +40 -87
- package/docs/releasing.md +83 -2
- package/docs/roadmap.md +71 -17
- package/docs/settings-status.md +34 -169
- package/docs/skill-sync.md +52 -15
- package/lib/child-admission-contract.d.ts +37 -0
- package/lib/child-admission-contract.js +2 -0
- package/lib/child-admission.d.ts +42 -0
- package/lib/child-admission.js +162 -0
- package/lib/child-capture.d.ts +81 -0
- package/lib/child-capture.js +203 -0
- package/lib/child-evidence.d.ts +17 -0
- package/lib/child-evidence.js +43 -0
- package/lib/client/ChildrenPanel.d.ts +43 -0
- package/lib/client/ChildrenPanel.js +82 -0
- package/lib/client/DeploymentPage.js +15 -8
- package/lib/client/EditableChoice.d.ts +17 -0
- package/lib/client/EditableChoice.js +49 -0
- package/lib/client/PermissionsPanel.d.ts +14 -0
- package/lib/client/PermissionsPanel.js +46 -0
- package/lib/client/ProfilesSection.js +30 -15
- package/lib/client/RoleAvailability.d.ts +7 -0
- package/lib/client/RoleAvailability.js +19 -0
- package/lib/client/SessionProfiles.js +27 -9
- package/lib/client/StructuredEditor.js +15 -7
- package/lib/client/children-controller.d.ts +98 -0
- package/lib/client/children-controller.js +296 -0
- package/lib/client/children-locales.d.ts +367 -0
- package/lib/client/children-locales.js +69 -0
- package/lib/client/controller.d.ts +6 -1
- package/lib/client/controller.js +14 -8
- package/lib/client/deployment-data.d.ts +2 -1
- package/lib/client/deployment-data.js +34 -5
- package/lib/client/deployment-locales.d.ts +4 -0
- package/lib/client/deployment-locales.js +11 -2
- package/lib/client/diagnostics.d.ts +14 -0
- package/lib/client/diagnostics.js +53 -0
- package/lib/client/index.d.ts +4 -0
- package/lib/client/index.js +96 -2
- package/lib/client/locales.d.ts +54 -0
- package/lib/client/locales.js +34 -16
- package/lib/client/permission-client.d.ts +16 -0
- package/lib/client/permission-client.js +38 -0
- package/lib/client/permission-controller.d.ts +62 -0
- package/lib/client/permission-controller.js +149 -0
- package/lib/client/permission-locales.d.ts +114 -0
- package/lib/client/permission-locales.js +75 -0
- package/lib/client/session-labels.js +4 -4
- package/lib/client/structured.js +19 -5
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +20 -0
- package/lib/client.js +5780 -1679
- package/lib/core-permission-authority.d.ts +18 -0
- package/lib/core-permission-authority.js +255 -0
- package/lib/core-permissions.d.ts +8 -0
- package/lib/core-permissions.js +33 -0
- package/lib/delivery-authority.d.ts +68 -0
- package/lib/delivery-authority.js +260 -0
- package/lib/deployment-config.d.ts +23 -0
- package/lib/deployment-config.js +61 -40
- package/lib/deployment-permission-rules.d.ts +55 -0
- package/lib/deployment-permission-rules.js +306 -0
- package/lib/dsh-types.d.ts +10 -4
- package/lib/guards.d.ts +1 -1
- package/lib/guards.js +29 -8
- package/lib/host-llm-startup.d.ts +41 -0
- package/lib/host-llm-startup.js +65 -0
- package/lib/host-llm.d.ts +92 -0
- package/lib/host-llm.js +325 -0
- package/lib/index.d.ts +15 -4
- package/lib/index.js +300 -47
- package/lib/legacy-child-policy.d.ts +51 -0
- package/lib/legacy-child-policy.js +123 -0
- package/lib/legacy-read-composition.d.ts +20 -0
- package/lib/legacy-read-composition.js +144 -0
- package/lib/legacy-read-contracts.d.ts +157 -0
- package/lib/legacy-read-contracts.js +39 -0
- package/lib/legacy-read-host.d.ts +19 -0
- package/lib/legacy-read-host.js +67 -0
- package/lib/legacy-read-integration.d.ts +121 -0
- package/lib/legacy-read-integration.js +522 -0
- package/lib/legacy-read-proxy.d.ts +26 -0
- package/lib/legacy-read-proxy.js +237 -0
- package/lib/live-pi-ai-owner.d.ts +18 -0
- package/lib/live-pi-ai-owner.js +144 -0
- package/lib/llm-runtime.d.ts +11 -0
- package/lib/llm-runtime.js +21 -0
- package/lib/managed-settings.d.ts +5 -0
- package/lib/managed-settings.js +14 -0
- package/lib/model-parameter-policy.d.ts +11 -0
- package/lib/model-parameter-policy.js +27 -0
- package/lib/model-routing.js +28 -17
- package/lib/modules.d.ts +13 -5
- package/lib/modules.js +17 -1
- package/lib/native-child-evidence.d.ts +42 -0
- package/lib/native-child-evidence.js +133 -0
- package/lib/native-pi-ai-wire.d.ts +37 -0
- package/lib/native-pi-ai-wire.js +261 -0
- package/lib/native-scope.js +1 -1
- package/lib/permission-bash.d.ts +6 -0
- package/lib/permission-bash.js +7 -0
- package/lib/permission-control.d.ts +73 -0
- package/lib/permission-control.js +205 -0
- package/lib/permission-controller.d.ts +68 -0
- package/lib/permission-controller.js +317 -0
- package/lib/permission-errors.d.ts +7 -0
- package/lib/permission-errors.js +21 -0
- package/lib/permission-fs-search.d.ts +5 -0
- package/lib/permission-fs-search.js +7 -0
- package/lib/permission-fs.d.ts +5 -0
- package/lib/permission-fs.js +7 -0
- package/lib/permission-native-access.d.ts +11 -0
- package/lib/permission-native-access.js +6 -0
- package/lib/permission-native-command.d.ts +10 -0
- package/lib/permission-native-command.js +93 -0
- package/lib/permission-native-rules.d.ts +75 -0
- package/lib/permission-native-rules.js +278 -0
- package/lib/permission-pwsh.d.ts +6 -0
- package/lib/permission-pwsh.js +7 -0
- package/lib/permission-remote.d.ts +26 -0
- package/lib/permission-remote.js +53 -0
- package/lib/permission-rpc.d.ts +29 -0
- package/lib/permission-rpc.js +152 -0
- package/lib/permission-rules.d.ts +115 -0
- package/lib/permission-rules.js +256 -0
- package/lib/permission-settings.d.ts +45 -0
- package/lib/permission-settings.js +48 -0
- package/lib/permission-shell.d.ts +38 -0
- package/lib/permission-shell.js +150 -0
- package/lib/permission-web.d.ts +5 -0
- package/lib/permission-web.js +7 -0
- package/lib/preset-registry.js +36 -25
- package/lib/profile-diagnostics.d.ts +45 -0
- package/lib/profile-diagnostics.js +148 -0
- package/lib/profile-locale.d.ts +3 -0
- package/lib/profile-locale.js +2 -0
- package/lib/profile-remote.d.ts +8 -0
- package/lib/profile-remote.js +163 -39
- package/lib/profile-rpc.d.ts +4 -3
- package/lib/profile-rpc.js +14 -12
- package/lib/profile-runtime.d.ts +40 -1
- package/lib/profile-runtime.js +368 -93
- package/lib/profile-store.d.ts +11 -0
- package/lib/profile-store.js +143 -11
- package/lib/profile-types.d.ts +70 -1
- package/lib/profile-types.js +1 -0
- package/lib/profiles.d.ts +16 -2
- package/lib/profiles.js +156 -79
- package/lib/prompt-content.js +1 -1
- package/lib/prompts.d.ts +37 -2
- package/lib/prompts.js +111 -9
- package/lib/recovery-policy.js +20 -7
- package/lib/role-control-remote.d.ts +38 -0
- package/lib/role-control-remote.js +211 -0
- package/lib/role-control-rpc.d.ts +51 -0
- package/lib/role-control-rpc.js +377 -0
- package/lib/role-control-types.d.ts +92 -0
- package/lib/role-control-types.js +8 -0
- package/lib/role-invocation.d.ts +47 -0
- package/lib/role-invocation.js +135 -0
- package/lib/role-llm-runtime.d.ts +17 -0
- package/lib/role-llm-runtime.js +62 -0
- package/lib/role-llm.d.ts +31 -0
- package/lib/role-llm.js +66 -0
- package/lib/role-policy.d.ts +49 -8
- package/lib/role-policy.js +437 -60
- package/lib/role-providers.d.ts +1 -1
- package/lib/role-providers.js +30 -35
- package/lib/role-routing.d.ts +11 -2
- package/lib/role-routing.js +42 -25
- package/lib/role-runs.d.ts +135 -0
- package/lib/role-runs.js +304 -0
- package/lib/role-subagents.d.ts +58 -3
- package/lib/role-subagents.js +169 -56
- package/lib/roles.d.ts +5 -6
- package/lib/roles.js +10 -39
- package/lib/route-json.d.ts +19 -0
- package/lib/route-json.js +129 -0
- package/lib/routing-policy.d.ts +2 -0
- package/lib/routing-policy.js +12 -2
- package/lib/runtime-integration.d.ts +112 -0
- package/lib/runtime-integration.js +784 -0
- package/lib/runtime-recovery.js +18 -8
- package/lib/settings.d.ts +47 -13
- package/lib/settings.js +217 -82
- package/lib/skills.js +2 -2
- package/lib/status.d.ts +10 -1
- package/lib/status.js +11 -8
- package/lib/subagent-runtime.d.ts +45 -0
- package/lib/subagent-runtime.js +131 -0
- package/package.json +106 -56
- package/patches/subagent-runtime.yml +15 -0
- package/prompts/deepseek-flash.md +1 -1
- package/prompts/deepseek-v4-pro.md +2 -2
- package/prompts/deepwork.md +27 -18
- package/prompts/source/agents/clarifier.md +5 -3
- package/prompts/source/agents/orchestrator.md +18 -9
- package/prompts/source/agents/plan-critic.md +5 -1
- package/prompts/source/agents/planner.md +4 -2
- package/prompts/source/agents/reviewer.md +6 -0
- package/prompts/source/category/complex.md +4 -4
- package/prompts/source/category/creative.md +6 -4
- package/prompts/source/category/cross-cutting.md +10 -8
- package/prompts/source/category/deep.md +5 -3
- package/prompts/source/category/documenting.md +7 -1
- package/prompts/source/category/frontend.md +2 -2
- package/prompts/source/category/hard-reasoning.md +3 -3
- package/prompts/source/category/research.md +4 -2
- package/prompts/source/deepwork/claude-opus-5.md +2 -2
- package/prompts/source/deepwork/codex.md +1 -1
- package/prompts/source/deepwork/default.md +22 -15
- package/prompts/source/deepwork/gemini.md +23 -16
- package/prompts/source/deepwork/glm.md +21 -14
- package/prompts/source/deepwork/gpt.md +12 -6
- package/prompts/source/deepwork/planner.md +8 -5
- package/prompts/source/manifest.json +178 -63
- package/prompts/source/shared/dsh-host-contract.md +5 -3
- package/prompts/source/shared/locale.md +2 -2
- package/prompts/source/terminal/orchestrator.md +1 -1
- package/scripts/cold-profile-composition.mjs +329 -0
- package/scripts/cold-profile-sources.mjs +238 -0
- package/scripts/migrate-cold-profile.mjs +315 -0
- package/skills/ast-grep/SKILL.md +7 -4
- package/skills/brainstorming/SKILL.md +43 -22
- package/skills/coding-agent-sessions/SKILL.md +7 -4
- package/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +46 -46
- package/skills/coding-agent-sessions/scripts/tests/test_pi_family_scanners.py +130 -130
- package/skills/debugging/SKILL.md +14 -9
- package/skills/debugging/references/methodology/00-setup.md +14 -62
- package/skills/debugging/references/methodology/02-investigate.md +4 -4
- package/skills/debugging/references/methodology/03-flaky-triage.md +3 -3
- package/skills/debugging/references/methodology/04-hard-reasoning-escalation.md +2 -14
- package/skills/debugging/references/methodology/06-fix.md +6 -6
- package/skills/debugging/references/methodology/08-qa.md +5 -5
- package/skills/debugging/references/methodology/09-cleanup.md +15 -153
- package/skills/debugging/references/methodology/partial-runtime-evidence.md +3 -16
- package/skills/debugging/references/runtimes/bundled-js-binary.md +1 -16
- package/skills/debugging/references/runtimes/native-binary.md +9 -54
- package/skills/debugging/references/runtimes/node.md +4 -15
- package/skills/debugging/references/runtimes/python.md +3 -15
- package/skills/debugging/references/runtimes/rust.md +2 -18
- package/skills/debugging/references/tools/dap.md +1 -1
- package/skills/debugging/references/tools/ghidra.md +4 -15
- package/skills/debugging/references/tools/playwright-cli.md +3 -15
- package/skills/debugging/references/tools/pwntools.md +4 -16
- package/skills/dispatching-parallel-agents/SKILL.md +18 -16
- package/skills/frontend/SKILL.md +7 -4
- package/skills/frontend/references/design/react-dev-tooling-skill.md +1 -1
- package/skills/git-master/SKILL.md +7 -4
- package/skills/init-deep/SKILL.md +7 -4
- package/skills/receiving-code-review/SKILL.md +17 -12
- package/skills/remove-ai-slops/SKILL.md +39 -38
- package/skills/requesting-code-review/SKILL.md +19 -17
- package/skills/requesting-code-review/code-reviewer.md +13 -1
- package/skills/subagent-driven-development/SKILL.md +29 -26
- package/skills/subagent-driven-development/implementer-prompt.md +29 -11
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +6 -1
- package/skills/using-git-worktrees/SKILL.md +7 -4
- package/skills/writing-plans/SKILL.md +29 -24
- 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
|
|
3
|
+
# Phase 9 + 10: Cleanup and Final Verification
|
|
4
4
|
|
|
5
|
-
The working tree
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
25
|
-
tmux kill-session -t <session-name>
|
|
26
|
-
tmux ls # confirm gone
|
|
21
|
+
Report evidence for each required claim:
|
|
27
22
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
#
|
|
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.
|
|
301
|
-
networksetup -getwebproxy "$SERVICE" #
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
|
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 →
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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**:
|
|
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,
|
|
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
|
-
|
|
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.
|