@siuver/omp-debug-mode 0.1.4 → 0.1.5
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/CHANGELOG.md +13 -0
- package/README.md +31 -10
- package/package.json +1 -1
- package/src/debug-mode.ts +281 -375
- package/src/evidence.ts +9 -36
- package/src/gate.ts +59 -30
- package/src/machine.ts +334 -0
- package/src/methodology.ts +34 -8
- package/src/probes.ts +9 -9
- package/src/state.ts +233 -74
- package/src/tools.ts +39 -23
- package/src/ui.ts +43 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.1.5 - 2026-08-25
|
|
6
|
+
|
|
7
|
+
- Tightened the injected methodology, start prompt, and proceed prompt so a `runtime_probe` round must write `@omp-probe` instrumentation in the same turn before emitting closing tags, and `<reproduction_steps>` lists only user actions.
|
|
8
|
+
- Replaced the `idle`/`round`/`waiting`/`cleanup` phases plus the redundant `active` flag with a discriminated union over four stages named after whose turn it is: `investigating`, `open`, `awaiting_evidence`, and `cleaning_up`. A round that settles without closing is now the explicit `open` stage with its own status label, widget, and explanation instead of a silent stop that looked like the reproduction gate.
|
|
9
|
+
- Moved every transition into one pure reducer (`src/machine.ts`) that returns declarative effects (notify, prompt, continue, teardown) for the runtime shell to apply, so state changes no longer hand-reset a different subset of fields per call site and the run-creation failure path no longer needs a manual rollback.
|
|
10
|
+
- Made round-scoped data structural: each round record owns its run id, evidence plan, reproduction steps, probe ids, and per-reason nudge budgets, instead of being filtered out of session-wide arrays by a mutable round counter. Probe nudges and closing-tag nudges now have independent budgets.
|
|
11
|
+
- Closing a `runtime_probe` round now requires probes the ledger actually finds on disk, not just a plan that names the method; the ledger is reconciled before every settle, so instrumentation that was written and then deleted no longer reaches the gate.
|
|
12
|
+
- `/debug-proceed`, `/debug-done`, and `/debug-evidence` now work from an `open` round after a confirmation instead of failing with "not waiting for reproduction"; they only refuse while an agent turn is actually running.
|
|
13
|
+
- Cleanup that leaves markers behind is sent back once with the remaining probes listed before teardown gives up and warns, instead of tearing down on the first attempt regardless.
|
|
14
|
+
- Session restore now migrates the pre-`rounds` persisted layout, and an unknown or `investigating` stage resolves to `open` rather than dropping the user into a reproduction gate that was never opened.
|
|
15
|
+
|
|
3
16
|
## 0.1.4 - 2026-08-21
|
|
4
17
|
|
|
5
18
|
- Added least-user-intervention evidence planning: the agent chooses `agent_inspection`, `runtime_probe`, `user_report`, or `user_artifact` per hypothesis, must justify user-assisted methods, and batches compatible hypotheses into the fewest reproductions or captures.
|
package/README.md
CHANGED
|
@@ -10,11 +10,26 @@ The plugin makes the agent form 3-5 hypotheses, choose the cheapest reliable evi
|
|
|
10
10
|
| --- | --- |
|
|
11
11
|
| `/debug-mode <problem>` | Starts a debugging session from a symptom, expected result, actual result, and reproduction description. |
|
|
12
12
|
| `/debug-proceed [details]` | Continues with captured evidence: optional details are recorded as a user-report observation, then the agent evaluates hypotheses and may fix only with evidence before asking for verification. |
|
|
13
|
-
| `/debug-evidence [<request-id>] <path>` | Attaches one user-provided evidence file to the current
|
|
13
|
+
| `/debug-evidence [<request-id>] <path>` | Attaches one user-provided evidence file to the current round. If the first token matches a pending current-round request ID, the file is linked to that request; otherwise the whole argument is treated as the path (spaces allowed). Without an argument it opens an input dialog (interactive UI only). Files are referenced in place and never copied or deleted. |
|
|
14
14
|
| `/debug-done` | Marks the problem as fixed: the agent removes every probe and summarizes the result. |
|
|
15
|
-
| `/debug-status` | Shows the current
|
|
15
|
+
| `/debug-status` | Shows the current stage, round, run, live probes, captured log counts, pending evidence requests, and attached/unavailable artifacts. |
|
|
16
16
|
| `/debug-abort` | Stops debug mode and removes its logs after confirmation while leaving code changes in the working tree. |
|
|
17
17
|
|
|
18
|
+
## Stages
|
|
19
|
+
|
|
20
|
+
The workflow tracks one thing: whose move it is. Every stage other than `investigating` belongs to you, and each has its own status label and widget so a stopped agent never looks like a stopped workflow.
|
|
21
|
+
|
|
22
|
+
| Stage | Meaning | What you do |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| `investigating` | An agent turn is in flight. | Wait. |
|
|
25
|
+
| `open` | The round settled without closing — a clarifying question, or declared instrumentation that never reached the code. | Reply normally. `/debug-proceed` closes the round anyway after a confirmation. |
|
|
26
|
+
| `awaiting_evidence` | The round closed properly and is at the reproduction gate. | Reproduce, capture, then `/debug-proceed`. |
|
|
27
|
+
| `cleaning_up` | `/debug-done` was accepted; probes are being removed. | Wait. |
|
|
28
|
+
|
|
29
|
+
Transitions live in one pure reducer (`src/machine.ts`), which returns declarative effects — notify, inject prompt, continue the turn, tear down — that the runtime shell applies. Every round is a record holding its own run id, evidence plan, reproduction steps, probe ids, and nudge budgets, so round-scoped data is never derived by filtering a session-wide array on a mutable counter.
|
|
30
|
+
|
|
31
|
+
A resumed session never lands in `investigating`, because no agent turn survives a restart; an unrecognised persisted stage resolves to `open`, on the conservative reading that the agent owes you something rather than the reverse.
|
|
32
|
+
|
|
18
33
|
## Evidence Methods
|
|
19
34
|
|
|
20
35
|
For every hypothesis, the agent must pick one of four methods, in least-user-intervention order:
|
|
@@ -40,15 +55,21 @@ Each round closes with an exact machine-readable block that covers every hypothe
|
|
|
40
55
|
</evidence_plan>
|
|
41
56
|
```
|
|
42
57
|
|
|
43
|
-
Every field is validated: `id` must be unique and non-empty, `hypothesisIds` must reference one or more real hypotheses, `method` must be one of the four literals above, `rationale`/`title` must be non-empty, and `instructions` must contain actionable steps (`artifactHint` describes the expected file kind for `user_artifact`). A malformed plan is rejected entirely — no hypothesis is ever silently dropped. Plans are capped at 12 entries per round. The plan is combined with the existing `<reproduction_steps>` block, which describes the single combined reproduction/capture sequence.
|
|
58
|
+
Every field is validated: `id` must be unique and non-empty, `hypothesisIds` must reference one or more real hypotheses, `method` must be one of the four literals above, `rationale`/`title` must be non-empty, and `instructions` must contain actionable steps (`artifactHint` describes the expected file kind for `user_artifact`). A malformed plan is rejected entirely — no hypothesis is ever silently dropped. Plans are capped at 12 entries per round. The plan is combined with the existing `<reproduction_steps>` block, which describes the single combined reproduction/capture sequence the user performs now. The injected methodology forbids emitting those closing tags for a `runtime_probe` round until `@omp-probe` markers are already in the working tree, and forbids listing planned agent work (installing probes, reading logs, analyzing) as reproduction steps.
|
|
44
59
|
|
|
45
60
|
## The Reproduction Gate
|
|
46
61
|
|
|
47
|
-
A round
|
|
62
|
+
A round may only close when its declarations are backed by observable facts. Emitting the tags is the declaration; the probe ledger is the proof:
|
|
63
|
+
|
|
64
|
+
- Both `<evidence_plan>` and `<reproduction_steps>` must be present.
|
|
65
|
+
- A plan selecting `runtime_probe` additionally needs at least one `@omp-probe` marker that the ledger actually finds on disk for this round. A probe that was written and then deleted counts as missing.
|
|
66
|
+
- `agent_inspection`, `user_report`, and `user_artifact` plans need no markers at all, and expect no JSONL logs.
|
|
67
|
+
|
|
68
|
+
Anything short of that is one automatic nudge — and the two nudge budgets are separate, so being sent back for missing probes never consumes the budget for missing closing tags. When a budget is spent the round becomes `open` rather than being gated on evidence that does not exist. A clarifying question mid-round is `open` too, which is the ordinary case: reply and the agent picks the round back up.
|
|
48
69
|
|
|
49
|
-
|
|
70
|
+
A round with reproduction steps but no plan at all still gates (older sessions closed this way) and gets the "no runtime evidence" warning.
|
|
50
71
|
|
|
51
|
-
At the gate a widget shows the reproduction steps, any pending user requests (title, instructions, artifact hint), a live counter of captured observations, an `evidence: <pending> pending, <attached> attached` counter, and the list of commands you can use, so you can tell what evidence the round is waiting on and how to act. The widget always ends with the live log counter. Every round stops at
|
|
72
|
+
At the gate a widget shows the reproduction steps, any pending user requests (title, instructions, artifact hint), a live counter of captured observations, an `evidence: <pending> pending, <attached> attached` counter, and the list of commands you can use, so you can tell what evidence the round is waiting on and how to act. The widget always ends with the live log counter. An `open` round gets its own, smaller widget naming why it is open and stating that a reply is the way forward. Every round stops at a widget and you interact through commands only.
|
|
52
73
|
|
|
53
74
|
Pending requests resolve like this:
|
|
54
75
|
|
|
@@ -56,7 +77,7 @@ Pending requests resolve like this:
|
|
|
56
77
|
- A `user_report` request is pending until `/debug-proceed <details>` records an observation for the current round; one details submission can satisfy several report requests at once.
|
|
57
78
|
- `agent_inspection` and `runtime_probe` requests never create user work.
|
|
58
79
|
|
|
59
|
-
If user requests are still pending when you run `/debug-proceed`, the plugin asks "Proceed without all requested evidence?" — confirming is allowed so an unavailable external capture can never deadlock the session; cancelling keeps you at the gate. `/debug-proceed` and `/debug-done` ask for confirmation when the round captured no runtime logs and has no valid non-probe evidence plan.
|
|
80
|
+
If user requests are still pending when you run `/debug-proceed`, the plugin asks "Proceed without all requested evidence?" — confirming is allowed so an unavailable external capture can never deadlock the session; cancelling keeps you at the gate. `/debug-proceed` and `/debug-done` ask for confirmation when the round captured no runtime logs and has no valid non-probe evidence plan, and again when the round is `open` rather than gated. They only refuse outright while an agent turn is actually running.
|
|
60
81
|
|
|
61
82
|
## Attaching Evidence Files
|
|
62
83
|
|
|
@@ -75,13 +96,13 @@ Example: for a GPU-rendering symptom whose disputed state only exists inside a f
|
|
|
75
96
|
|
|
76
97
|
## Workflow
|
|
77
98
|
1. Run `/debug-mode <problem description>`.
|
|
78
|
-
2. The Agent records 3-5 hypotheses and picks an evidence method for each under the least-user-intervention priority. If the route is `runtime_probe`, it inserts minimal probes marked with `@omp-probe <id>` inside `#region agent log` blocks; round 1 does not apply a product fix. The start prompt and a per-turn `debug-mode-context` message name the exact JSONL path and require every probe to append to it, including `hypothesisId`; console output (including Unity `Debug.Log`) is supplemental only. The context filter keeps the newest of those messages so the model sees the contract instead of dropping it.
|
|
99
|
+
2. The Agent records 3-5 hypotheses and picks an evidence method for each under the least-user-intervention priority. If the route is `runtime_probe`, it inserts minimal probes marked with `@omp-probe <id>` inside `#region agent log` blocks in the same turn, before emitting the closing tags; round 1 does not apply a product fix (probe edits are not a product fix). The start prompt and a per-turn `debug-mode-context` message name the exact JSONL path and require every probe to append to it, including `hypothesisId`; console output (including Unity `Debug.Log`) is supplemental only. The context filter keeps the newest of those messages so the model sees the contract instead of dropping it. `<reproduction_steps>` are user actions only (reproduce, capture, restart).
|
|
79
100
|
|
|
80
101
|
3. When the Agent reaches the gate, follow the `<reproduction_steps>` in the real application so the instrumented code writes its observations, watching the widget counter climb — or supply the requested evidence with `/debug-evidence` or `/debug-proceed <details>`. Restart the app or service if the instrumented build would otherwise be stale.
|
|
81
102
|
|
|
82
103
|
4. Continue with `/debug-proceed [details]` (optionally record a user observation, then evaluate evidence), `/debug-done` (clean up and summarize), `/debug-evidence` (attach a file), or `/debug-status` (inspect the current round state). Each round stops at the widget; all interaction is command-driven.
|
|
83
104
|
5. On Proceed, the Agent reads the evidence (logs, your observations, attached artifacts), cites the evidence method plus log-line numbers or artifact/report paths for each hypothesis, and only then may apply a fix. Probes stay in place. Reproduce again to verify. If verification fails, rejected-hypothesis code changes are reverted before the next round.
|
|
84
|
-
6. On `/debug-done`, the Agent removes every probe and summarizes the root cause and fix in 1-2 lines.
|
|
105
|
+
6. On `/debug-done`, the Agent removes every probe and summarizes the root cause and fix in 1-2 lines. If the ledger is still not empty when that turn settles, cleanup is sent back once with the remaining markers listed; a second incomplete attempt tears down anyway and warns you which probes are still in your source.
|
|
85
106
|
|
|
86
107
|
The extension also provides the read-only `get_debug_logs`, `list_debug_probes`, and `list_debug_evidence` tools so the Agent can inspect runtime evidence, review pending/satisfied requests with their methods and rationales, and verify cleanup.
|
|
87
108
|
|
|
@@ -107,7 +128,7 @@ When you run `/debug-proceed [details]`, the plugin records non-empty details as
|
|
|
107
128
|
|
|
108
129
|
## Probe Ledger
|
|
109
130
|
|
|
110
|
-
The plugin tracks every `@omp-probe <id>` marker the Agent writes, resolving each file against the session working directory. Before each round and on every `list_debug_probes` call it rescans those files so the ledger matches the code on disk: markers the Agent has since deleted drop out, and a file that exists but cannot be read is reported as *unverified* rather than assumed clean. That way a failed read can never make teardown claim the probes are gone while they are still in your source. Rounds that choose non-probe evidence methods simply add no markers, and cleanup still verifies that no leftover markers remain before finishing.
|
|
131
|
+
The plugin tracks every `@omp-probe <id>` marker the Agent writes, resolving each file against the session working directory, and attributes it to the round that introduced it. Before each turn, before a round is allowed to close, and on every `list_debug_probes` call it rescans those files so the ledger matches the code on disk: markers the Agent has since deleted drop out, and a file that exists but cannot be read is reported as *unverified* rather than assumed clean. That way a failed read can never make teardown claim the probes are gone while they are still in your source, and a `runtime_probe` round cannot reach the gate on a promise. Rounds that choose non-probe evidence methods simply add no markers, and cleanup still verifies that no leftover markers remain before finishing.
|
|
111
132
|
|
|
112
133
|
## Install
|
|
113
134
|
|
package/package.json
CHANGED