@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,130 +1,130 @@
|
|
|
1
|
-
# /// script
|
|
2
|
-
# requires-python = ">=3.11"
|
|
3
|
-
# dependencies = ["pytest"]
|
|
4
|
-
# ///
|
|
5
|
-
# --- How to run ---
|
|
6
|
-
# uv run --with pytest pytest scripts/tests/test_pi_family_scanners.py -v
|
|
7
|
-
# pyright: reportImplicitRelativeImport=false, reportMissingImports=false
|
|
8
|
-
from __future__ import annotations
|
|
9
|
-
|
|
10
|
-
import json
|
|
11
|
-
import sys
|
|
12
|
-
from pathlib import Path
|
|
13
|
-
|
|
14
|
-
import pytest
|
|
15
|
-
|
|
16
|
-
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
|
17
|
-
|
|
18
|
-
from agent_sessions import scanners
|
|
19
|
-
from agent_sessions.types import JsonMap, Session
|
|
20
|
-
|
|
21
|
-
PI_FAMILY = frozenset({"senpi", "oh-my-pi", "gajae-code"})
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def _write_session(path: Path, session_id: str, cwd: str, prompt: str) -> None:
|
|
25
|
-
rows: list[JsonMap] = [
|
|
26
|
-
{"type": "session", "version": 3, "id": session_id, "timestamp": "2026-07-20T00:00:00.000Z", "cwd": cwd},
|
|
27
|
-
{"type": "model_change", "id": "m1", "timestamp": "2026-07-20T00:00:00.100Z", "model": "anthropic/claude-fable-5"},
|
|
28
|
-
{
|
|
29
|
-
"type": "message",
|
|
30
|
-
"id": "e1",
|
|
31
|
-
"timestamp": "2026-07-20T00:00:01.000Z",
|
|
32
|
-
"message": {"role": "user", "content": [{"type": "text", "text": prompt}]},
|
|
33
|
-
},
|
|
34
|
-
]
|
|
35
|
-
path.parent.mkdir(parents=True, exist_ok=True)
|
|
36
|
-
_ = path.write_text("\n".join(json.dumps(row) for row in rows) + "\n")
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def _by_platform(items: list[Session]) -> dict[str, Session]:
|
|
40
|
-
return {item.platform: item for item in items}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def test_pi_family_platforms_and_aliases_are_registered() -> None:
|
|
44
|
-
assert PI_FAMILY <= scanners.DEFAULT_PLATFORMS
|
|
45
|
-
assert scanners.PLATFORM_ALIASES["omp"] == "oh-my-pi"
|
|
46
|
-
assert scanners.PLATFORM_ALIASES["ohmypi"] == "oh-my-pi"
|
|
47
|
-
assert scanners.PLATFORM_ALIASES["gjc"] == "gajae-code"
|
|
48
|
-
assert scanners.PLATFORM_ALIASES["gajae"] == "gajae-code"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def test_pi_family_scanners_read_each_product_home_store(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
|
52
|
-
monkeypatch.setattr(Path, "home", lambda: tmp_path)
|
|
53
|
-
monkeypatch.delenv("XDG_DATA_HOME", raising=False)
|
|
54
|
-
|
|
55
|
-
_write_session(
|
|
56
|
-
tmp_path / ".senpi" / "agent" / "sessions" / "-tmp-senpi" / "2026-07-20T00-00-00-000Z_senpi-1.jsonl",
|
|
57
|
-
"senpi-1",
|
|
58
|
-
"/tmp/senpi",
|
|
59
|
-
"senpi prompt",
|
|
60
|
-
)
|
|
61
|
-
_write_session(
|
|
62
|
-
tmp_path / ".omp" / "agent" / "sessions" / "-tmp-omp" / "2026-07-20T00-00-00-000Z_omp-1.jsonl",
|
|
63
|
-
"omp-1",
|
|
64
|
-
"/tmp/omp",
|
|
65
|
-
"oh-my-pi prompt",
|
|
66
|
-
)
|
|
67
|
-
_write_session(
|
|
68
|
-
tmp_path / ".gjc" / "agent" / "sessions" / "-tmp-gjc" / "2026-07-20T00-00-00-000Z_gjc-1.jsonl",
|
|
69
|
-
"gjc-1",
|
|
70
|
-
"/tmp/gjc",
|
|
71
|
-
"gajae-code prompt",
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
sessions = _by_platform(scanners.scan(PI_FAMILY, (), 4))
|
|
75
|
-
|
|
76
|
-
assert sessions["senpi"].first_user_message == "senpi prompt"
|
|
77
|
-
assert sessions["oh-my-pi"].id == "omp-1"
|
|
78
|
-
assert sessions["oh-my-pi"].first_user_message == "oh-my-pi prompt"
|
|
79
|
-
assert sessions["oh-my-pi"].cwd == "/tmp/omp"
|
|
80
|
-
assert sessions["oh-my-pi"].model == "anthropic/claude-fable-5"
|
|
81
|
-
assert sessions["gajae-code"].id == "gjc-1"
|
|
82
|
-
assert sessions["gajae-code"].first_user_message == "gajae-code prompt"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
def test_pi_family_scanners_cover_profile_and_xdg_roots(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
|
86
|
-
monkeypatch.setattr(Path, "home", lambda: tmp_path)
|
|
87
|
-
monkeypatch.setenv("XDG_DATA_HOME", str(tmp_path / "xdg-data"))
|
|
88
|
-
|
|
89
|
-
_write_session(
|
|
90
|
-
tmp_path / ".omp" / "profiles" / "work" / "agent" / "sessions" / "-repo" / "2026-07-20T00-00-00-000Z_omp-work.jsonl",
|
|
91
|
-
"omp-work",
|
|
92
|
-
"/repo",
|
|
93
|
-
"omp profile prompt",
|
|
94
|
-
)
|
|
95
|
-
_write_session(
|
|
96
|
-
tmp_path / "xdg-data" / "gjc" / "sessions" / "-repo" / "2026-07-20T00-00-00-000Z_gjc-xdg.jsonl",
|
|
97
|
-
"gjc-xdg",
|
|
98
|
-
"/repo",
|
|
99
|
-
"gjc xdg prompt",
|
|
100
|
-
)
|
|
101
|
-
_write_session(
|
|
102
|
-
tmp_path / "xdg-data" / "omp" / "profiles" / "work" / "sessions" / "-repo" / "2026-07-20T00-00-00-000Z_omp-xdg.jsonl",
|
|
103
|
-
"omp-xdg",
|
|
104
|
-
"/repo",
|
|
105
|
-
"omp xdg profile prompt",
|
|
106
|
-
)
|
|
107
|
-
|
|
108
|
-
found = {(item.platform, item.id) for item in scanners.scan(PI_FAMILY, (), 4)}
|
|
109
|
-
|
|
110
|
-
assert ("oh-my-pi", "omp-work") in found
|
|
111
|
-
assert ("gajae-code", "gjc-xdg") in found
|
|
112
|
-
assert ("oh-my-pi", "omp-xdg") in found
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
def test_pi_family_stores_do_not_leak_across_platform_keys(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
|
116
|
-
monkeypatch.setattr(Path, "home", lambda: tmp_path)
|
|
117
|
-
monkeypatch.delenv("XDG_DATA_HOME", raising=False)
|
|
118
|
-
|
|
119
|
-
_write_session(
|
|
120
|
-
tmp_path / ".omp" / "agent" / "sessions" / "-tmp-omp" / "2026-07-20T00-00-00-000Z_omp-only.jsonl",
|
|
121
|
-
"omp-only",
|
|
122
|
-
"/tmp/omp",
|
|
123
|
-
"oh-my-pi prompt",
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
senpi_sessions = scanners.scan(frozenset({"senpi"}), (), 4)
|
|
127
|
-
omp_sessions = scanners.scan(frozenset({"omp"}), (), 4)
|
|
128
|
-
|
|
129
|
-
assert senpi_sessions == []
|
|
130
|
-
assert [(item.platform, item.id) for item in omp_sessions] == [("oh-my-pi", "omp-only")]
|
|
1
|
+
# /// script
|
|
2
|
+
# requires-python = ">=3.11"
|
|
3
|
+
# dependencies = ["pytest"]
|
|
4
|
+
# ///
|
|
5
|
+
# --- How to run ---
|
|
6
|
+
# uv run --with pytest pytest scripts/tests/test_pi_family_scanners.py -v
|
|
7
|
+
# pyright: reportImplicitRelativeImport=false, reportMissingImports=false
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import json
|
|
11
|
+
import sys
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
|
|
14
|
+
import pytest
|
|
15
|
+
|
|
16
|
+
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
|
17
|
+
|
|
18
|
+
from agent_sessions import scanners
|
|
19
|
+
from agent_sessions.types import JsonMap, Session
|
|
20
|
+
|
|
21
|
+
PI_FAMILY = frozenset({"senpi", "oh-my-pi", "gajae-code"})
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _write_session(path: Path, session_id: str, cwd: str, prompt: str) -> None:
|
|
25
|
+
rows: list[JsonMap] = [
|
|
26
|
+
{"type": "session", "version": 3, "id": session_id, "timestamp": "2026-07-20T00:00:00.000Z", "cwd": cwd},
|
|
27
|
+
{"type": "model_change", "id": "m1", "timestamp": "2026-07-20T00:00:00.100Z", "model": "anthropic/claude-fable-5"},
|
|
28
|
+
{
|
|
29
|
+
"type": "message",
|
|
30
|
+
"id": "e1",
|
|
31
|
+
"timestamp": "2026-07-20T00:00:01.000Z",
|
|
32
|
+
"message": {"role": "user", "content": [{"type": "text", "text": prompt}]},
|
|
33
|
+
},
|
|
34
|
+
]
|
|
35
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
36
|
+
_ = path.write_text("\n".join(json.dumps(row) for row in rows) + "\n")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _by_platform(items: list[Session]) -> dict[str, Session]:
|
|
40
|
+
return {item.platform: item for item in items}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def test_pi_family_platforms_and_aliases_are_registered() -> None:
|
|
44
|
+
assert PI_FAMILY <= scanners.DEFAULT_PLATFORMS
|
|
45
|
+
assert scanners.PLATFORM_ALIASES["omp"] == "oh-my-pi"
|
|
46
|
+
assert scanners.PLATFORM_ALIASES["ohmypi"] == "oh-my-pi"
|
|
47
|
+
assert scanners.PLATFORM_ALIASES["gjc"] == "gajae-code"
|
|
48
|
+
assert scanners.PLATFORM_ALIASES["gajae"] == "gajae-code"
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def test_pi_family_scanners_read_each_product_home_store(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
|
52
|
+
monkeypatch.setattr(Path, "home", lambda: tmp_path)
|
|
53
|
+
monkeypatch.delenv("XDG_DATA_HOME", raising=False)
|
|
54
|
+
|
|
55
|
+
_write_session(
|
|
56
|
+
tmp_path / ".senpi" / "agent" / "sessions" / "-tmp-senpi" / "2026-07-20T00-00-00-000Z_senpi-1.jsonl",
|
|
57
|
+
"senpi-1",
|
|
58
|
+
"/tmp/senpi",
|
|
59
|
+
"senpi prompt",
|
|
60
|
+
)
|
|
61
|
+
_write_session(
|
|
62
|
+
tmp_path / ".omp" / "agent" / "sessions" / "-tmp-omp" / "2026-07-20T00-00-00-000Z_omp-1.jsonl",
|
|
63
|
+
"omp-1",
|
|
64
|
+
"/tmp/omp",
|
|
65
|
+
"oh-my-pi prompt",
|
|
66
|
+
)
|
|
67
|
+
_write_session(
|
|
68
|
+
tmp_path / ".gjc" / "agent" / "sessions" / "-tmp-gjc" / "2026-07-20T00-00-00-000Z_gjc-1.jsonl",
|
|
69
|
+
"gjc-1",
|
|
70
|
+
"/tmp/gjc",
|
|
71
|
+
"gajae-code prompt",
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
sessions = _by_platform(scanners.scan(PI_FAMILY, (), 4))
|
|
75
|
+
|
|
76
|
+
assert sessions["senpi"].first_user_message == "senpi prompt"
|
|
77
|
+
assert sessions["oh-my-pi"].id == "omp-1"
|
|
78
|
+
assert sessions["oh-my-pi"].first_user_message == "oh-my-pi prompt"
|
|
79
|
+
assert sessions["oh-my-pi"].cwd == "/tmp/omp"
|
|
80
|
+
assert sessions["oh-my-pi"].model == "anthropic/claude-fable-5"
|
|
81
|
+
assert sessions["gajae-code"].id == "gjc-1"
|
|
82
|
+
assert sessions["gajae-code"].first_user_message == "gajae-code prompt"
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def test_pi_family_scanners_cover_profile_and_xdg_roots(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
|
86
|
+
monkeypatch.setattr(Path, "home", lambda: tmp_path)
|
|
87
|
+
monkeypatch.setenv("XDG_DATA_HOME", str(tmp_path / "xdg-data"))
|
|
88
|
+
|
|
89
|
+
_write_session(
|
|
90
|
+
tmp_path / ".omp" / "profiles" / "work" / "agent" / "sessions" / "-repo" / "2026-07-20T00-00-00-000Z_omp-work.jsonl",
|
|
91
|
+
"omp-work",
|
|
92
|
+
"/repo",
|
|
93
|
+
"omp profile prompt",
|
|
94
|
+
)
|
|
95
|
+
_write_session(
|
|
96
|
+
tmp_path / "xdg-data" / "gjc" / "sessions" / "-repo" / "2026-07-20T00-00-00-000Z_gjc-xdg.jsonl",
|
|
97
|
+
"gjc-xdg",
|
|
98
|
+
"/repo",
|
|
99
|
+
"gjc xdg prompt",
|
|
100
|
+
)
|
|
101
|
+
_write_session(
|
|
102
|
+
tmp_path / "xdg-data" / "omp" / "profiles" / "work" / "sessions" / "-repo" / "2026-07-20T00-00-00-000Z_omp-xdg.jsonl",
|
|
103
|
+
"omp-xdg",
|
|
104
|
+
"/repo",
|
|
105
|
+
"omp xdg profile prompt",
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
found = {(item.platform, item.id) for item in scanners.scan(PI_FAMILY, (), 4)}
|
|
109
|
+
|
|
110
|
+
assert ("oh-my-pi", "omp-work") in found
|
|
111
|
+
assert ("gajae-code", "gjc-xdg") in found
|
|
112
|
+
assert ("oh-my-pi", "omp-xdg") in found
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def test_pi_family_stores_do_not_leak_across_platform_keys(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
|
116
|
+
monkeypatch.setattr(Path, "home", lambda: tmp_path)
|
|
117
|
+
monkeypatch.delenv("XDG_DATA_HOME", raising=False)
|
|
118
|
+
|
|
119
|
+
_write_session(
|
|
120
|
+
tmp_path / ".omp" / "agent" / "sessions" / "-tmp-omp" / "2026-07-20T00-00-00-000Z_omp-only.jsonl",
|
|
121
|
+
"omp-only",
|
|
122
|
+
"/tmp/omp",
|
|
123
|
+
"oh-my-pi prompt",
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
senpi_sessions = scanners.scan(frozenset({"senpi"}), (), 4)
|
|
127
|
+
omp_sessions = scanners.scan(frozenset({"omp"}), (), 4)
|
|
128
|
+
|
|
129
|
+
assert senpi_sessions == []
|
|
130
|
+
assert [(item.platform, item.id) for item in omp_sessions] == [("oh-my-pi", "omp-only")]
|
|
@@ -8,10 +8,13 @@ description: "MUST USE for any real runtime debugging across ANY language or bin
|
|
|
8
8
|
This is a full OCMM source adaptation for DSH 0.2.0-rc.2, not an OpenCode or Codex runtime. Source product names in transcript formats, examples, paths and attribution remain descriptive; they are not a host switch.
|
|
9
9
|
|
|
10
10
|
- Load this skill through the native skill tool only when its trigger matches. Resolve every relative reference/script/asset from the directory resourceBase returned with this skill, not from the project cwd or an OCMM checkout. Use available read/glob/grep to inspect resources; use write/edit and the active bash or pwsh only within the actual role and host permissions.
|
|
11
|
-
- External documentation uses actual web_search/web_fetch or an available documentation service. Context7, GitHub MCP, browser, image and LSP tools are optional catalog capabilities, not bundled calls. Use a real available equivalent or report unavailable evidence; never invent an MCP, Task, todo or compression API.
|
|
12
|
-
- Source role names are logical assignments: code-search/explore maps to dsmm-code-search, and other canonical roles/categories map to dsmm-<name>.
|
|
13
|
-
- Templates describe assignment content, not
|
|
14
|
-
-
|
|
11
|
+
- External documentation uses actual web_search/web_fetch or an available documentation service. Context7, GitHub MCP, browser, image and LSP tools are optional catalog capabilities, not bundled calls. Use a real available equivalent or report unavailable evidence; never invent an MCP, Task, todo or compression API. Native read uses file_path, not OpenCode filePath; inspect every actual schema before calling it. Use read_image only when exposed and the actual route supports its image result.
|
|
12
|
+
- Source role names are logical assignments: code-search/explore maps to role ID dsmm-code-search, and other canonical roles/categories map to dsmm-<name>. Use this Agent's observed admitted inventory: per-role topology has individual role tools (for example dsmm_plan_critic) plus dsmm_category; parameterized topology has dsmm_role and dsmm_category with their actual role/category enums. Never derive callability from generated files, names or templates. Both layouts preserve target, caller, read-only, inherited tool and depth ceilings; a missing required formal role returns to the stage owner, not a planning bypass.
|
|
13
|
+
- Templates describe assignment content, not callable schemas. Actual delegation takes description/prompt, an exposed level, a deployment-authorized exposed route, and an exposed run_in_background only. Omitted/normal retains the default; low/high/max must be configured at roleRouting.<id>.levels as a complete route or exact supported effort, never synthetic suffix roles or fixed max effort. A complete invocation route needs paired provider/model and cannot silently fall back; effort-only needs exact native preflight. Level/layout never change permissions or verification rigor. Reviewer/Oracle independence requires different observed native routes, not names.
|
|
14
|
+
- One-shot defaults foreground; permitted one-shot background is native-job-owned. A managed admitted continuable configuration defaults background; explicit run_in_background:false creates a non-reusable one-shot. Use only exposed job_output/job_list/job_kill or send_message/interrupt_agent and returned identities. Existing continuable children can receive nearest-step running messages, idle next turns or same-ID cold continuation; receipts mean inbox acceptance, not completion. Exposed native child-to-parent reporting retains exact-sender/adjacency semantics, not new parent-to-child authority. Settled one-shots never revive; reuse never reselects role/level/route or copies a parent's newer policy into the original child capture. Do not send OpenCode task_id/subagent_type/background/resume/retry or guessed control fields.
|
|
15
|
+
- Host observations alone establish lifecycle controls. Managed delivery requires explicit startup composition: disable the stock subagents row, bind the unique PUBLIC DSMM SubagentRuntime subclass and restart; never hot-replace/drain stock or add a shadow runtime. When actually wired and authorized, a user foreground handoff transfers the existing same run to native jobs without a second start; native user queue/steer follows its operator/connection/session/epoch gate. Do not announce unconnected tools/RPCs. Background enablement, capacity, ownership, depth, cancellation and provider support always gate execution. Legacy conservative evidence may permit useful proven capabilities under the same durable child ID; missing evidence denies that capability with a reason, not all legacy children and not an inheritance of current parent policy.
|
|
16
|
+
- When exposed, native todo_write replaces the owning Agent's whole list of content/status items; its schema and allowParallelInProgress policy govern updates. Otherwise use concise session coordination or an authorized plan. ask_user_question is conditional on exposure; otherwise ask in conversation. Native host compaction is not OCMM compress, and no model-facing compression call is assumed. A read-only planner returns complete Markdown; an authorized coordinator persists it, never the planner through shell or a proxy. Role responsibilities, explicit-off common/skill visibility, and the terminal delegation contract override broader examples in a resource.
|
|
17
|
+
- Follow the current user's explicit output-language request, otherwise this Agent's immutable captured DSMM locale when supplied, then applicable host/user language guidance or the current request/context. Supported configured locales are en/zh-Hans/zh-Hant/ja/ko/de/fr/es/pt-BR/ru; omission inherits, not an English default. Preserve code, identifiers, paths, commands, protocol fields and exact quotes, and pass explicit language instructions in child assignments. This resource imports no Root session preference, promises neither internal reasoning language nor UI translation, and never changes host/project locale. A later parent Apply does not rewrite a child's captured locale.
|
|
15
18
|
- Installation, package-manager bootstrap, downloads, authentication/login, credential/profile access, Git writes and destructive actions require explicit authorization for the exact action. Reference commands are not automatic operations. Worktree consent does not authorize dependency installation or later branch deletion. Read before changing an existing file; preserve unrelated user work. Never silently restore/reset a working tree to repair a failed cleanup.
|
|
16
19
|
- Browser/debug QA uses run-owned isolated state, no imported credentials or browser profile, and only already available software unless separately authorized. Keep commands in the active shell dialect. Report unverified surfaces honestly.
|
|
17
20
|
|
|
@@ -20,7 +23,9 @@ This is a full OCMM source adaptation for DSH 0.2.0-rc.2, not an OpenCode or Cod
|
|
|
20
23
|
You are a hypothesis-driven debugger. Two disciplines apply regardless of language, runtime, or whether you have source:
|
|
21
24
|
|
|
22
25
|
1. **Runtime truth beats code reading.** Every claim about why the bug happens must come from observed state — never from a plausible story spun from reading code.
|
|
23
|
-
2. **
|
|
26
|
+
2. **Clean only owned resources.** Before creating a debug artifact, retain its exact identity and cleanup action in the session's resource checklist; no checklist file is required. Remove temporary artifacts before calling the task done, preserving existing user work and retained valid regression evidence.
|
|
27
|
+
|
|
28
|
+
Keep investigation state and raw evidence in conversation or task-owned temporary storage, not a repository journal. Don't read, modify, delete, or adopt any existing `.debug-journal.md`, and don't edit Git exclude files for debugging notes. Reference instructions to record resources mean this temporary ownership checklist, not a development history. Durable code, comments, docs, and tests express only the final valid requirements, mechanism, and behavior. Tests protect functional and external-interface regressions, not descriptive wording, decision counterexamples, or removed-component absence; update tests with requirements and delete tests dedicated to removed components. Uncommitted intermediate behavior needn't be preserved, but committed contracts and API/security/data/permission authorization remain binding.
|
|
24
29
|
|
|
25
30
|
The rest of this file is a map. **The knowledge is in `references/`.** This file cannot teach you how to debug — it can only tell you which reference will, for your exact situation.
|
|
26
31
|
|
|
@@ -80,7 +85,7 @@ Each phase has exactly one reference. Read it as you enter the phase — not in
|
|
|
80
85
|
| # | Phase | 📖 Open this when entering |
|
|
81
86
|
|---|---|---|
|
|
82
87
|
| 0 | **Environment assessment** — know the runtime, ports, symbols, env vars, watchers before attaching | [references/methodology/00-setup.md](references/methodology/00-setup.md) |
|
|
83
|
-
| 1 | **
|
|
88
|
+
| 1 | **Temporary resource ownership**: exact task-owned artifacts and safe cleanup actions | [references/methodology/00-setup.md](references/methodology/00-setup.md) |
|
|
84
89
|
| 2 | **Hypothesis formation** — minimum three, across orthogonal axes, each with distinguishing evidence | [references/methodology/02-investigate.md](references/methodology/02-investigate.md) |
|
|
85
90
|
| 3 | **Parallel investigation** — independent direct probes or permitted callable native roles | [references/methodology/02-investigate.md](references/methodology/02-investigate.md) |
|
|
86
91
|
| 4 | **Hard-reasoning escalation** — only after 2 consecutive failed evidence rounds make the task genuinely difficult; consult one hard-reasoning agent with orthogonal framings | [references/methodology/04-hard-reasoning-escalation.md](references/methodology/04-hard-reasoning-escalation.md) |
|
|
@@ -88,7 +93,7 @@ Each phase has exactly one reference. Read it as you enter the phase — not in
|
|
|
88
93
|
| 6 | **Root cause confirmation** — confirmed only when toggling the suspected cause toggles the bug | [references/methodology/06-fix.md](references/methodology/06-fix.md) |
|
|
89
94
|
| 7 | **Reproduction-first fix** — capture failure first, minimal change, same case passes, no scope expansion | [references/methodology/06-fix.md](references/methodology/06-fix.md) |
|
|
90
95
|
| 8 | **Manual QA** — actually use the system (tmux for CLI, Playwright for browser, real curl for API, real repro for binary) | [references/methodology/08-qa.md](references/methodology/08-qa.md) |
|
|
91
|
-
| 9 | **Cleanup
|
|
96
|
+
| 9 | **Cleanup**: walk the temporary resource checklist, remove owned artifacts, verify only the fix and valid regression evidence were added to the initial working tree | [references/methodology/09-cleanup.md](references/methodology/09-cleanup.md) |
|
|
92
97
|
| 10 | **Final verification** — four evidence gates before declaring done | [references/methodology/09-cleanup.md](references/methodology/09-cleanup.md) |
|
|
93
98
|
|
|
94
99
|
**Phase references are short by design.** Reading one takes a minute. Skipping one costs an hour.
|
|
@@ -109,12 +114,12 @@ These are not phases — read them when the situation calls for them:
|
|
|
109
114
|
|
|
110
115
|
<safety>
|
|
111
116
|
1. **Runtime state is the only source of truth.** A hypothesis without an observed value is a guess. Do not fix guesses.
|
|
112
|
-
2. **Every debug artifact
|
|
117
|
+
2. **Every debug artifact has known ownership and a safe cleanup action before creation.** Session-level tracking is sufficient; never introduce a repository journal, extra ledger, or adopt another task's resources.
|
|
113
118
|
3. **Never ship a fix without its reproduction.** The failing case captured BEFORE the fix, the same case passing after it, or the fix is unverified. Where the repository keeps tests for this behavior, that case is the regression test.
|
|
114
119
|
4. **Never declare done on type-check/compile alone.** Types catch declaration bugs. Only running the actual user scenario catches the actual user bug.
|
|
115
120
|
5. **Never ask the user a question that runtime evidence can already answer.** Escalation is for genuine ambiguity.
|
|
116
121
|
6. **Never silently swallow errors while debugging.** If the system swallows errors, that is often the bug itself. Make them loud temporarily; restore at cleanup.
|
|
117
|
-
7. **Never `git commit` from inside this skill.**
|
|
122
|
+
7. **Never `git commit` from inside this skill.** Load the native git-master skill only for an exact user-authorized Git operation that the current role policy permits; confirming a fix is not commit authorization.
|
|
118
123
|
8. **Never attach without having read the runtime reference.** The gate rule.
|
|
119
124
|
</safety>
|
|
120
125
|
|
|
@@ -1,8 +1,8 @@
|
|
|
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 0 + 1
|
|
3
|
+
# Phase 0 + 1: Environment Assessment and Resource Ownership
|
|
4
4
|
|
|
5
|
-
Before
|
|
5
|
+
Before attaching, identify what's running and which resources this task will own. Keep current investigation evidence in conversation or task-owned temporary storage, not product process documents.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -43,68 +43,20 @@ If any answer is "I'm not sure", you are not ready for Phase 1. Investigate unti
|
|
|
43
43
|
|
|
44
44
|
---
|
|
45
45
|
|
|
46
|
-
## Phase 1
|
|
46
|
+
## Phase 1: Temporary Resource Ownership
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
If file-backed debug material is needed, use a unique task-owned directory under the approved OS temporary root and verify its parent before creation. Session-only investigation needs no directory or checklist file. Don't read, modify, delete, or adopt any existing `.debug-journal.md`, and don't change `.git/info/exclude`. No repository hypothesis or experiment journal is required or permitted.
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
Before creating each artifact or changing temporary state, capture only what's needed for safe cleanup:
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
| Resource | Ownership and restoration information |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| Temporary file or directory | Exact path, task ownership, and exact cleanup target |
|
|
55
|
+
| Source instrumentation | Initial relevant hunk and task-owned patch to remove it without discarding other edits |
|
|
56
|
+
| Process or debugger session | PID plus start identity, owned session/context, and targeted shutdown action |
|
|
57
|
+
| Environment or configuration override | Scope and previous value/state to restore |
|
|
58
|
+
| Fixture, port, proxy, or browser profile | Unique identity, ownership check, and safe release action |
|
|
55
59
|
|
|
56
|
-
|
|
60
|
+
Keep this ownership checklist and short-lived hypothesis/evidence state in the agent session; temporary storage is optional when resumption needs it. Synchronize useful findings at delivery or major phase boundaries, not every checklist update. Temporary or disposable artifacts need no repeated stability/hash checks or correct status record at every instant. Store raw reproduction evidence temporarily only as needed; durable tests and docs describe final valid requirements and the current mechanism only. Exact cleanup identities and restoration data must remain available until cleanup succeeds.
|
|
57
61
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
```markdown
|
|
61
|
-
# Debug Journal — <short bug name>
|
|
62
|
-
Started: <ISO timestamp>
|
|
63
|
-
Goal: <one-sentence user request>
|
|
64
|
-
|
|
65
|
-
## Environment snapshot (Phase 0)
|
|
66
|
-
- Runtime: <language + version + launcher>
|
|
67
|
-
- Entry: <command that starts the process>
|
|
68
|
-
- Ports / sockets: <app=..., debugger=..., etc>
|
|
69
|
-
- Git HEAD: <sha>, working tree clean? <yes/no>
|
|
70
|
-
- References read: <list the files from references/ you loaded — proves you did the gate>
|
|
71
|
-
|
|
72
|
-
## Hypotheses
|
|
73
|
-
1. [STATUS] <hypothesis> — distinguishing evidence: <what would confirm/refute> — if true, fix is: <two words>
|
|
74
|
-
2. ...
|
|
75
|
-
|
|
76
|
-
## Failed hypothesis round counter
|
|
77
|
-
- Round 1: <result>
|
|
78
|
-
- Round 2: <result>
|
|
79
|
-
<!-- At 2 consecutive evidence-backed failures, the task qualifies for one hard-reasoning escalation (see 04-hard-reasoning-escalation.md). -->
|
|
80
|
-
|
|
81
|
-
## Artifacts to revert
|
|
82
|
-
<!-- Every temp edit, tmux session, fixture, env override, saved debugger session goes here
|
|
83
|
-
BEFORE it is created. The rule is journal-then-modify. -->
|
|
84
|
-
- [ ] `src/foo.py` — added `breakpoint()` on 2 lines. Revert: `git checkout src/foo.py`
|
|
85
|
-
- [ ] tmux session `debug-server`. Kill: `tmux kill-session -t debug-server`
|
|
86
|
-
- [ ] `/tmp/debug-payload.json`. Remove: `rm /tmp/debug-payload.json`
|
|
87
|
-
- [ ] env var in current shell: `FOO_BASE_URL=...`. Unset when done.
|
|
88
|
-
- [ ] GDB session save: `~/ghidra-projects/scratch.gzf`. Remove if not promoting.
|
|
89
|
-
|
|
90
|
-
## Findings
|
|
91
|
-
<!-- Append observed values here with timestamp. Verbatim only, no paraphrasing. -->
|
|
92
|
-
|
|
93
|
-
## Hard-Reasoning Escalation (if invoked)
|
|
94
|
-
<!-- Record why the difficulty threshold was met and the resulting hypothesis set. -->
|
|
95
|
-
|
|
96
|
-
## Final fix
|
|
97
|
-
<!-- File paths + test path. Filled during Phase 7. -->
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### The journal-then-modify rule
|
|
101
|
-
|
|
102
|
-
Before any modification to the repo, shell, or system state, append to "Artifacts to revert" first. This one discipline is what prevents debug sessions from becoming git cleanup sessions.
|
|
103
|
-
|
|
104
|
-
If you catch yourself about to run a command that creates a file, opens a port, or modifies source — stop, journal the intended artifact with its revert command, then run the command. Not the other way around.
|
|
105
|
-
|
|
106
|
-
### Why a single journal (not scattered TODO comments)
|
|
107
|
-
|
|
108
|
-
- One `git checkout`, one `rm`, one `tmux kill-session` list — simple Phase 9 walk.
|
|
109
|
-
- Survives interruptions. If you get pulled away mid-session, the next agent (or you later) can continue or revert without guessing.
|
|
110
|
-
- Prevents the most common failure: leaving `console.log`/`print()`/`dbg!` scattered across the tree.
|
|
62
|
+
Inspect the initial working-tree state so cleanup can distinguish this task's edits from existing user work. Resource ownership doesn't confer permission to kill another process, alter system configuration, or discard a file. Escalate when safe restoration or required authorization is uncertain.
|
|
@@ -27,7 +27,7 @@ If your three hypotheses are all variations of "the handler has a bug", you don'
|
|
|
27
27
|
| **Binary-level** (when applicable) | "The function we think is running is actually jumped over by a patched thunk / a different version loaded" |
|
|
28
28
|
| **Build-vs-runtime** | "The code we're reading is not the code that's running — stale build, wrong symlink, cached wheel, or dist/ ahead of src/" |
|
|
29
29
|
|
|
30
|
-
###
|
|
30
|
+
### Keep the active hypothesis set in conversation or disposable investigation state
|
|
31
31
|
|
|
32
32
|
1. **Claim** — one sentence.
|
|
33
33
|
2. **Distinguishing evidence** — the exact value or state that confirms or refutes it, AND where to read it (file:line, log source, breakpoint location, memory address).
|
|
@@ -43,13 +43,13 @@ If two hypotheses have identical distinguishing evidence, they aren't actually d
|
|
|
43
43
|
|
|
44
44
|
Use independent direct probes first. If the current role policy and actual DSH catalog permit delegation, assign distinct bounded evidence to available roles; otherwise investigate sequentially. DSH does not provide the OpenCode team registry or debug-squad configuration. Do not write host-private team configuration or invent task calls.
|
|
45
45
|
|
|
46
|
-
Retain the source responsibilities: inspect observed runtime state; correlate logs/timing; minimize a reproducible input; cross-link observations into a causal chain and identify the next falsifying query. Read-only lookup roles may inspect evidence but cannot create instrumentation/reproduction files by proxy. The lead
|
|
46
|
+
Retain the source responsibilities: inspect observed runtime state; correlate logs/timing; minimize a reproducible input; cross-link observations into a causal chain and identify the next falsifying query. Read-only lookup roles may inspect evidence but cannot create instrumentation/reproduction files by proxy. The lead keeps exact task-owned resource/cleanup identities in session or disposable investigation state before creation, approves authorized edits, integrates evidence, and owns cancellation/cleanup via actual host controls; no repository journal or per-file ledger is created. Reviewer/Oracle remain implementation-acceptance roles, not debugging consultants. After two failed evidence rounds, return a genuinely difficult decision to the stage owner for optional hard-reasoning, subject to the caller's permitted targets.
|
|
47
47
|
|
|
48
48
|
---
|
|
49
49
|
|
|
50
50
|
## Evidence capture discipline (both paths)
|
|
51
51
|
|
|
52
|
-
For
|
|
52
|
+
For relevant runtime state, capture evidence in conversation or task-owned temporary storage, not a repository journal:
|
|
53
53
|
|
|
54
54
|
```markdown
|
|
55
55
|
### <ISO timestamp> — <what you looked at>
|
|
@@ -70,4 +70,4 @@ If you find yourself about to paraphrase, stop, go back, and copy the raw value.
|
|
|
70
70
|
|
|
71
71
|
## Round completion
|
|
72
72
|
|
|
73
|
-
A "round" is complete when every hypothesis has
|
|
73
|
+
A "round" is complete when every hypothesis has confirming or refuting evidence, or available evidence sources are exhausted without a decisive result. An inconclusive round increments the current failed-round count in disposable investigation state. Don't retain a round history in product artifacts. See `04-hard-reasoning-escalation.md` for the two-consecutive-failure threshold.
|
|
@@ -7,7 +7,7 @@ Use this reference when a test is intermittent, passes in isolation, changes its
|
|
|
7
7
|
## Safety boundary
|
|
8
8
|
|
|
9
9
|
- Start with an unchanged rerun. Do not install tools, terminate another user's process, overwrite user configuration, or use a shared temp root.
|
|
10
|
-
-
|
|
10
|
+
- Capture relevant run evidence temporarily; list exact run-owned artifacts and cleanup actions in the temporary resource checklist. Clean only resources this run owns.
|
|
11
11
|
- Retry wrappers, arbitrary sleeps, quarantine, deletion, and assertion weakening are not fixes. They hide evidence and must not be used to claim resolution.
|
|
12
12
|
- Keep test commands and environment changes scoped to the affected test or suite. Do not turn a flaky-test investigation into a full-suite mutation.
|
|
13
13
|
|
|
@@ -57,7 +57,7 @@ pnpm test -- --test-name-pattern "affected test"
|
|
|
57
57
|
Get-NetTCPConnection -LocalPort 3000
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
Do not install a port inspector and never kill a port owner. If a listener is relevant,
|
|
60
|
+
Do not install a port inspector and never kill a port owner. If a listener is relevant, capture its identity and namespace the port for the run instead. Use the temporary resource checklist and remove only the unique root created by the current investigation.
|
|
61
61
|
|
|
62
62
|
## Cause-oriented repair
|
|
63
63
|
|
|
@@ -68,4 +68,4 @@ Do not install a port inspector and never kill a port owner. If a listener is re
|
|
|
68
68
|
|
|
69
69
|
After two failed evidence rounds, the local workflow permits one `hard-reasoning` escalation only when the root cause is genuinely difficult. Reviewer and Oracle profiles are not debugging agents and must not be used for this triage.
|
|
70
70
|
|
|
71
|
-
If the evidence remains unresolved,
|
|
71
|
+
If the evidence remains unresolved, report the current classification, decisive shared-state evidence, remaining evidence gaps, owned-resource cleanup, and the explicit statement that no fix is claimed. Don't require a receipt or experiment history.
|
|
@@ -58,19 +58,7 @@ Treat the response as hypotheses, not proof. Pull the ranked candidates and fals
|
|
|
58
58
|
|
|
59
59
|
Minimum 3, same rules as Phase 2. Aim to have hypotheses drawn from the agreement scan (likely cause) AND from the disagreement scan (so one round's evidence resolves the disagreement).
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
```markdown
|
|
64
|
-
## Hard-Reasoning Escalation — Round <N>
|
|
65
|
-
- Invoked at: <ISO timestamp>
|
|
66
|
-
- Reason escalation was permitted: <two failed evidence rounds or equivalent strict difficulty evidence>
|
|
67
|
-
- Ranked candidates: <one line each>
|
|
68
|
-
- Decisive runtime queries: <one line each>
|
|
69
|
-
|
|
70
|
-
### New hypothesis set
|
|
71
|
-
1. <hypothesis> — evidence to gather: <one-liner>
|
|
72
|
-
2. ...
|
|
73
|
-
```
|
|
61
|
+
Keep the currently permitted escalation, next hypothesis set, decisive queries, and evidence gaps in conversation or disposable investigation state. Don't create a repository escalation or hypothesis history.
|
|
74
62
|
|
|
75
63
|
### Reset the counter
|
|
76
64
|
|
|
@@ -82,4 +70,4 @@ Reset the "consecutive failed rounds" counter to 0. Return to Phase 3 (parallel
|
|
|
82
70
|
|
|
83
71
|
You are genuinely stuck. This is the escalation threshold.
|
|
84
72
|
|
|
85
|
-
Escalate to the user (see `05-escalate.md`) with the
|
|
73
|
+
Escalate to the user (see `05-escalate.md`) with the unresolved question, decisive observed evidence, current constraints, and missing authorization or evidence. Don't guess a fix or require a full investigation transcript.
|
|
@@ -35,7 +35,7 @@ Examples of a valid toggle proof:
|
|
|
35
35
|
|
|
36
36
|
If you can't construct a toggle proof, you haven't confirmed the cause. Run one more round.
|
|
37
37
|
|
|
38
|
-
###
|
|
38
|
+
### Capture current mechanism and proof in temporary evidence
|
|
39
39
|
|
|
40
40
|
```markdown
|
|
41
41
|
## Root cause (confirmed <ISO timestamp>)
|
|
@@ -61,7 +61,7 @@ Capture a case that fails *specifically because of this bug*. Where the reposito
|
|
|
61
61
|
- **Failure output clearly shows what the bug looks like.** If someone reads only the failure output, they understand what's broken.
|
|
62
62
|
- **Minimum infrastructure.** Don't spin up the whole server if a smaller reproducible run captures the mechanism.
|
|
63
63
|
|
|
64
|
-
Run the test or scenario. Confirm it fails before the fix.
|
|
64
|
+
Run the test or scenario. Confirm it fails before the fix. Capture the failure output in conversation or task-owned temporary evidence:
|
|
65
65
|
|
|
66
66
|
```markdown
|
|
67
67
|
### Red phase (<ISO timestamp>)
|
|
@@ -92,7 +92,7 @@ Resist all of these. Fix the bug. Note the surrounding issues for follow-up. Mov
|
|
|
92
92
|
|
|
93
93
|
Only cleanup directly related to the fix. Do not re-architect.
|
|
94
94
|
|
|
95
|
-
If the code around the fix
|
|
95
|
+
If the code around the fix has an unresolved concern, report its current impact to the user; don't expand scope or create a repository follow-up journal.
|
|
96
96
|
|
|
97
97
|
### 4. Regression — full suite green
|
|
98
98
|
|
|
@@ -104,9 +104,9 @@ If they don't, your "fix" broke something else. Back to Phase 6 with the new fai
|
|
|
104
104
|
|
|
105
105
|
If diagnosis burned extra rounds *because state was invisible* — no log line told you which branch ran, what the value was, whether the fallback engaged — that invisibility is a defect adjacent to the bug, and this is the one moment where adding a log line is NOT "just in case": this session is the evidence that the line earns its place. Ship the fix WITH that line, written to the standard of `references/logging.md` — level chosen by consumer, placed at the decision point, data in fields not interpolation, through the project's designated logger. If the project deliberately does not log, respect that and skip this step.
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
Every temporary `print` / `dbg!` / `console.log` added during diagnosis belongs in the task-owned resource checklist and is removed in Phase 9. A line with a current ongoing consumer may be part of the authorized fix; a line used only for diagnosis is temporary instrumentation.
|
|
108
108
|
|
|
109
|
-
###
|
|
109
|
+
### Capture current verification evidence
|
|
110
110
|
|
|
111
111
|
```markdown
|
|
112
112
|
### Green phase (<ISO timestamp>)
|
|
@@ -122,4 +122,4 @@ Full suite: <N tests, <M failures — should be 0> (or <none exists>)
|
|
|
122
122
|
|
|
123
123
|
No captured failure → no proof the fix addresses the reported bug. Only proof it doesn't break tests that already existed. Keep the reproduction as a test where the repository keeps tests for this behavior; otherwise the captured before/after run is the proof.
|
|
124
124
|
|
|
125
|
-
Where tests are kept,
|
|
125
|
+
Where tests are kept, verify that the same valid regression case fails without the fix and passes with it. Keep before/after outputs in task-owned temporary evidence or conversation, not a repository journal. Tests protect final valid functionality and external interfaces, not descriptive wording, decision counterexamples, or removed-component absence. Update tests for changed requirements and delete tests dedicated to removed components; committed contracts and authorization remain binding.
|
|
@@ -14,7 +14,7 @@ Pick the row that matches the product. Do what it says. Do not substitute.
|
|
|
14
14
|
|
|
15
15
|
| Product type | QA means… |
|
|
16
16
|
|---|---|
|
|
17
|
-
| **CLI tool** |
|
|
17
|
+
| **CLI tool** | Run the actual command end-to-end with available tools. Capture relevant output, exit code, and side-effect checks in task-owned temporary evidence or conversation. |
|
|
18
18
|
| **HTTP API** | Start the real server, hit endpoints with `curl` or `httpie`, inspect response status + body + headers. Hit the specific endpoint that reproduced the bug. If there's auth, use real auth. |
|
|
19
19
|
| **Browser-served web app** | **Drive a real browser via Playwright CLI.** See [tools/playwright-cli.md](../tools/playwright-cli.md). Navigate the exact page/flow that reproduced the bug. Capture screenshot + DOM + network evidence. **Do not substitute with curl** — browsers have state (cookies, localStorage, service workers, client-side JS, viewport-dependent CSS) that curl does not have. |
|
|
20
20
|
| **Agent / LLM pipeline** | Run the same user prompt that originally failed. Capture the full turn — tool calls, messages, usage counters. **Confirm non-zero usage** (zero usage = still failing silently, see silent-failure check below). |
|
|
@@ -26,9 +26,9 @@ Pick the row that matches the product. Do what it says. Do not substitute.
|
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## Current QA evidence
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Capture relevant QA evidence in conversation or task-owned temporary storage, not a repository run history:
|
|
32
32
|
|
|
33
33
|
```markdown
|
|
34
34
|
### Manual QA — <product type> (<ISO timestamp>)
|
|
@@ -79,7 +79,7 @@ Check the runtime reference for additional patterns:
|
|
|
79
79
|
|
|
80
80
|
Don't fix it. This is out of scope for the current bug.
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
Report the current unresolved concern with:
|
|
83
83
|
- File:line
|
|
84
84
|
- Pattern matched
|
|
85
85
|
- Proposed fix sketch (one line)
|
|
@@ -93,4 +93,4 @@ Surface these to the user in the final message under "Next steps I didn't take".
|
|
|
93
93
|
|
|
94
94
|
"Fix verified" means: the exact original failing scenario, re-run, now produces the correct output. Not a similar scenario. Not a unit test of the fix. The original scenario.
|
|
95
95
|
|
|
96
|
-
If you can't
|
|
96
|
+
If you can't rerun the original scenario, state the current verification limitation and the evidence from the closest valid equivalent. Escalate if the equivalent is materially different. Don't create a repository QA journal.
|