opencode-usage-coach 0.7.1 → 0.8.1
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/agents/usage-coach-harness.md +11 -2
- package/dist/index.js +942 -17
- package/dist/tui.js +135 -139
- package/package.json +1 -1
|
@@ -19,6 +19,7 @@ permission:
|
|
|
19
19
|
generalize: allow
|
|
20
20
|
record_failure: allow
|
|
21
21
|
harness_start: allow
|
|
22
|
+
unknown_scan: allow
|
|
22
23
|
task_update: allow
|
|
23
24
|
harness_done: allow
|
|
24
25
|
steps: 200
|
|
@@ -49,7 +50,15 @@ The user's message is the task source. If it has multiple distinct parts, decomp
|
|
|
49
50
|
DEPENDENT tasks (B needs A) → always sequential `generate` calls, regardless of quota.
|
|
50
51
|
|
|
51
52
|
1. Call `harness_start(name, N)` to register the run on the panel.
|
|
52
|
-
2.
|
|
53
|
+
2. **PRE-FLIGHT — unknown_scan:** Call `unknown_scan({prompt, tasks: [{id, title}, ...]})`.
|
|
54
|
+
Review the report:
|
|
55
|
+
- If QUESTIONS are flagged → ask the user concisely, then adjust tasks.
|
|
56
|
+
- If TASK REFINEMENTS are suggested → apply via `task_update` (split/add/remove).
|
|
57
|
+
- If UNKNOWN UNKNOWNS with high impact are found → acknowledge them in the
|
|
58
|
+
generate prompts (the domain DB injection will help, but explicitly call them out).
|
|
59
|
+
This step prevents wasted steps from wrong assumptions. Skip only if the
|
|
60
|
+
task is trivially clear.
|
|
61
|
+
3. For each task i (1..N):
|
|
53
62
|
a. `task_update(i, title, "generating")`.
|
|
54
63
|
b. **Generate** — call `generate({ prompt: "Task: {title}. Perform it for real in the current directory (write/edit files)." })`. The generator model runs in a sub-session and writes files directly — its return value is a summary, NOT the work itself.
|
|
55
64
|
c. **Verify the work** — after generate returns, read the files it should have produced (use `read`/`glob`) to confirm the work actually exists and is non-trivial. Do not trust the summary alone.
|
|
@@ -60,7 +69,7 @@ DEPENDENT tasks (B needs A) → always sequential `generate` calls, regardless o
|
|
|
60
69
|
- `FAIL` and revisions < 2 → `task_update(i, title, "revising", revisions:k)` → `generate({ prompt: "Apply the grading feedback and improve:\\n{grade result}\\nTask: {title}" })` → back to (d) re-grade.
|
|
61
70
|
- `FAIL` and revisions exhausted → `task_update(i, title, "failed", score:"FAIL")` → next.
|
|
62
71
|
g. **Error handling:** if `generate` returns text starting with `ERROR:` or `[runModel TIMEOUT`, the sub-session failed. Log it via `task_update(i, title, "failed")` and continue to the next task — do not loop forever on a broken task.
|
|
63
|
-
|
|
72
|
+
4. When all tasks are done → `harness_done()`.
|
|
64
73
|
|
|
65
74
|
## Rules
|
|
66
75
|
- **Follow the [usage-coach NEXT] directive each tool returns.** `harness_start`, `generate`, and `grade` all append a `NEXT` line telling you exactly what to call next. This makes the loop deterministic — do not improvise the sequence, follow `NEXT`.
|