mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-16 20:45:33 -08:00
Keep Pathfinder from ending a session while its research subagents are still running: wait for every one, show a running count in the web console, mark finished research with a completion line, and re-run interrupted research on resume
AI Assisted
This commit is contained in:
1 parent
bfb47f3a8e
commit
d49f2d5792
21 files changed
+229
-12
No files matched your search
@@ -349,12 +349,13 @@ Then one line under the map's `## Out of scope`, giving the name as a link plus
|
||||
|
||||
## Reconcile (Work Step 2)
|
||||
|
||||
Much shorter here — the tracker holds the state, so there is no checklist to rebuild. Three checks:
|
||||
Much shorter here — the tracker holds the state, so there is no checklist to rebuild. Four checks:
|
||||
|
||||
| Check | Symptom | Repair |
|
||||
|---|---|---|
|
||||
| Crashed mid-answer | Open, assigned, and an `## Answer` comment already exists | The comment wins. Close as completed, add the gist to Decisions so far, say so. |
|
||||
| Stale claim | Open, assigned, no `## Answer`, and the assignee is you from a dead session | Unassign, say so, put it back on the frontier. **If it is someone else's login, leave it** — that is a live session, not a crash. |
|
||||
| Interrupted research | An open `research` question with no `## Evidence` comment ending in `**Research complete:**` | Re-fire its subagent (`resolve.md` → Interrupted research), say so in one line. |
|
||||
| Index drift | A closed, completed question with no line under `## Decisions so far` | Read its `## Answer` comment, append the gist. |
|
||||
|
||||
Then re-read `## Not yet specified` in full — that part is identical to local mode, and the bullet left behind after its question exists is just as corrosive here.
|
||||
@@ -375,7 +376,7 @@ Three things never move to the tracker, whatever the backend:
|
||||
|
||||
Sketch directories are named for the issue number rather than a local `NN`, so `sketch-42` belongs to the question at `#42`. Same rules otherwise: throwaway, one command to run, never merged.
|
||||
|
||||
Research subagents work the same way with one substitution: the brief carries the **issue URL** instead of a file path, and the instruction is to post findings as a comment opening `## Evidence` via `gh issue comment` — and to decide nothing. `## Answer` and the close are still written by the session that fired it.
|
||||
Research subagents work the same way with one substitution: the brief carries the **issue URL** instead of a file path, and the instruction is to post findings as a comment opening `## Evidence` via `gh issue comment` — and to decide nothing. The comment ends with the `**Research complete:** <YYYY-MM-DD>` line, and the firing session waits for every subagent before Session End, exactly as on local disk. `## Answer` and the close are still written by the session that fired it.
|
||||
|
||||
---
|
||||
|
||||
@@ -409,7 +410,7 @@ The report is identical either way, and the file still lands on **local disk** a
|
||||
| `brief.md` says | Here |
|
||||
|---|---|
|
||||
| Filter resolved questions by `Resolved:` in range | Filter the map's sub-issues closed as completed by `closedAt` in range |
|
||||
| Reconcile backfills absent `Resolved:` dates | Nothing to backfill; run the three reconcile checks above instead |
|
||||
| Reconcile backfills absent `Resolved:` dates | Nothing to backfill; run the four reconcile checks above instead |
|
||||
| Open / blocked / out-of-scope sections read the checklist | They read the frontier query — unassigned-unblocked, `blocked_by > 0`, and `pathfinder:out-of-scope` respectively |
|
||||
|
||||
`## Not yet specified`, `## Destination`, and `**Confidence:**` come from the map issue body, same as always. The no-machinery rule tightens rather than relaxes: no `#numbers`, no label names, no `gh` commands in the file. The reader may never have opened the tracker either.
|
||||
|
||||
@@ -65,6 +65,20 @@ The subagent's brief must carry, verbatim:
|
||||
3. The instruction to write into `## Evidence` of THAT file and nothing else — `## Answer` and `State:` are written by the session that fired it, at Work Step 7.
|
||||
4. The primary-source rule below.
|
||||
5. The no-deciding rule below.
|
||||
6. The instruction to end `## Evidence` with `**Research complete:** <YYYY-MM-DD>` as its last line, written only once every claim is in. Without that line, the next session cannot tell finished research from research that was cut off.
|
||||
|
||||
### Wait for every subagent
|
||||
|
||||
Subagents run inside this session's process, even when the harness runs them in the background. Close the terminal, or end the session, and they die mid-write, leaving `## Evidence` half-filled. So:
|
||||
|
||||
- **Do not reach Session End, or post a web console `finish`, while any research subagent is still running.** Wait for each one to report back. The main session does not read the sources while it waits; it only collects completions.
|
||||
- While waiting in the web console, post `{"agent":{"status":"working","activity":"Researching 3 questions (1 of 3 back)"}}` and update the count as each returns, so the page never says "done" while work is still in flight.
|
||||
- Never tell the human the research "will finish on its own" or is "running in the background, ready for next time". It is not: it lives in this terminal.
|
||||
- Once all are back, Session End reports each research question with a one-line summary of what was found (not decided).
|
||||
|
||||
### Interrupted research
|
||||
|
||||
At Work Step 2 (Reconcile), any research question that is not resolved and whose `## Evidence` lacks the `**Research complete:**` line was never finished: a closed terminal, a crash, a rate limit. Re-fire its subagent with the same brief, plus one instruction: keep what is already in `## Evidence`, verify it, fill the gaps, then write the line. Say so in one line to the human. A map written before this line existed shows the same symptom; re-firing it costs a little time and nothing else.
|
||||
|
||||
### Primary sources only
|
||||
|
||||
@@ -165,9 +179,11 @@ bypassable — and Object Lock cannot be added to the existing bucket.
|
||||
- UNVERIFIED: whether our compliance counsel treats GOVERNANCE as sufficient
|
||||
for the SEC 17a-4 attestation. No primary source exists for this — it is a
|
||||
human judgment, not a fact. Belongs in a grill.
|
||||
|
||||
**Research complete:** 2026-08-03
|
||||
```
|
||||
|
||||
Note what the example does: every claim carries its own citation, a live command counts as a primary source, and the one thing that cannot be sourced is flagged rather than smoothed over.
|
||||
Note what the example does: every claim carries its own citation, a live command counts as a primary source, the one thing that cannot be sourced is flagged rather than smoothed over, and the closing `**Research complete:**` line marks the subagent's work as whole.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in new issue
Block a user