mirror of
https://github.com/wassname/pi-plan.git
synced 2026-09-26 14:10:23 +08:00
Integrate package-based supervision with explicit recovery and visible workers
Retain planning guidance and upkeep; use stock edxeth, Intercom and scheduled prompts. Verify with 162 tests and isolated Fireworks trials. Document unresolved upstream reload and scheduler limitations. Co-Authored-By: Pi/OpenAI <288921227+claudypoo@users.noreply.github.com>
This commit is contained in:
+30
-33
@@ -1,46 +1,43 @@
|
||||
# Main-chat supervisor prototype
|
||||
# Main-chat supervision
|
||||
|
||||
Prepared by Pi/OpenAI. Not installed in the normal checkout.
|
||||
Planning and supervision stay in the main Pi session. `goals-worker` runs in a visible Herdr pane with normal tools. It reports through pi-intercom and stays open, so completion does not discard an unsent editor draft. The supervisor reads actual artifacts before `CompleteGoal`; solo mode records self-verification instead.
|
||||
|
||||
This branch changes the package entrypoint to `src/prototype.ts`. Planning and supervision stay in the original chat and model. Ready asks that agent to delegate implementation through **edxeth/pi-subagents**, using its real interactive Herdr worker, automatic report and session resume. The parent keeps its normal inspection tools. There is no second supervisor, startup compaction, Intercom pairing, VCC polling or context-array mutation.
|
||||
## Packages
|
||||
|
||||
## Runtime
|
||||
- This branch loads `src/prototype.ts`; model-facing text is in `src/prompts.ts`, in conversation order.
|
||||
- Unmodified [edxeth/pi-subagents v2.9.0](https://github.com/edxeth/pi-subagents/tree/953c6f6d2fc7d8a5c956c30cd77c51bad697c2a4), not the conflicting nicobailon npm package `pi-subagents`. Never load both implementations.
|
||||
- Installed pi-intercom handles live messages. The worker receives the supervisor's session ID in its task; record the worker's saved-session path and actual Intercom ID in plan preferences. Runtime IDs are not Intercom IDs.
|
||||
- Installed pi-schedule-prompt owns hourly check-ins. No additional recurring timer or message transport is implemented here.
|
||||
- `prototype/agents/goals-worker.md` uses `auto-exit: false`, `parent-close-policy: continue`, lineage-only context, and normal extensions/tools. Do not enable edxeth's restricted orchestrator mode.
|
||||
|
||||
Pinned source: [edxeth/pi-subagents v2.9.0](https://github.com/edxeth/pi-subagents/tree/953c6f6d2fc7d8a5c956c30cd77c51bad697c2a4).
|
||||
This is **not** the npm package `pi-subagents` from nicobailon. They register overlapping tools and commands; do not load both.
|
||||
## Use
|
||||
|
||||
`prototype/agents/goals-worker.md` selects:
|
||||
1. `/goals <objective>` drafts a plan and asks material unresolved questions. `/goals review` opens Ready / Discuss / Edit / Cancel; `/goals ready` approves directly.
|
||||
2. Ready delegates the first unfinished goal. Include the requested worker model in plan preferences or use `/goals model <provider/model>`; verify the actual selected model.
|
||||
3. The worker calls `AttachGoalPlan` with the supplied absolute path for its widget/context. It sends evidence and progress through Intercom, not an exit-only completion tool.
|
||||
4. Inspect and message a live worker using its listed Intercom ID. Use `subagent_resume` with its saved-session path only after it has stopped; never start another writer just because a report is late.
|
||||
|
||||
- Interactive, asynchronous Pi in Herdr; normal tools, extensions and skills.
|
||||
- Trusted project resources and APPEND_SYSTEM inheritance, explicitly enabled.
|
||||
- A clean model context linked to the parent (`lineage-only`), not a large inherited transcript. The parent supplies the approved plan/task. No compulsory compaction.
|
||||
- Automatic report and exit after a goal. The worker is interactive while running; an operator can take over. Follow-up resumes the same saved session with edxeth's `subagent_resume`.
|
||||
- `parent-close-policy: continue`. Closing the parent must not silently kill the worker. This is a requested launch policy, not a claim of lossless crash/reload recovery.
|
||||
## Controls and recovery
|
||||
|
||||
We deliberately do not enable edxeth's restricted orchestrator mode: our parent must inspect actual files and results.
|
||||
- `/goals status`: mode, plan path, model preference, saved worker session and scheduler-job name. A recorded handle does not prove liveness.
|
||||
- `/goals stop` or `/goals exit`: pause/leave goal mode, retain the plan, and request actual worker stop plus removal of the owned check-in job. Remote termination is not assumed.
|
||||
- `/goals resume`: explicitly continue a paused plan after checking existing workers.
|
||||
- `/goals solo`: confirm all other writers stopped, then let this main session implement and edit. Completion is labelled self-verification. The saved worker reference is retained.
|
||||
- `/goals attach <plan.md> [solo]`: reconnect an existing plan without rewriting its evidence. Confirm the previous supervisor stopped, or all other writers stopped for solo. A `- worker session:` note supplies a resume reference.
|
||||
- `/goals exit` during planning preserves the draft without approving implementation. Reattach it later rather than starting over.
|
||||
- `/schedule-prompt`: view, add, toggle or remove scheduled jobs. Edit prompt/interval through `schedule_prompt update`. Binding is visible in `.pi/schedule-prompts.json`; tool text alone does not expose it.
|
||||
- Plan requirements/manual ticks trigger review through a directory event hook. Task/evidence/Log maintenance does not. Eight unchanged working turns trigger a context-only upkeep reminder, not another timer.
|
||||
|
||||
## Isolated trial setup
|
||||
## Known dependency limits
|
||||
|
||||
Do not change existing panes, installed package paths or user settings.
|
||||
- **Stop workers before reloading the parent.** With stock edxeth, a worker can remain usable after parent `/reload`, then crash the parent when it later exits through a stale widget callback. This is reproduced, not fixed here. Recover with `pi --session <saved-parent.jsonl>`; retain the plan, inspect workers and explicitly reattach or choose solo. Saved-session restart followed by solo completion was tested.
|
||||
- The installed scheduler deletes disabled jobs on shutdown/reload. Do not promise a disabled job will remain available to re-enable. Never run broad `cleanup` for goal housekeeping; remove only the owned job by ID. Existing job edits are otherwise retained by the prompts.
|
||||
- Worker stop confirmation and scheduler actions use human judgment/model tools, not a cross-process locking framework. No automatic crash restart or exactly-once execution is claimed.
|
||||
|
||||
1. Obtain and inspect the pinned edxeth checkout. It needs the peer dependencies listed in its package.json, compatible with installed Pi 0.85.1. For the local trial we used a read-only dependency symlink to the already installed compatible dependencies; no install scripts were run.
|
||||
2. Run `node prototype/prepare.mjs /path/to/edxeth-checkout /path/to/installed/pi-package`. It creates a private temporary agent directory and Git project, copies auth/model/settings files, retains installed normal packages except the two conflicting packages, and adds this worktree plus edxeth. It prints the isolated paths. It does not launch Pi.
|
||||
For this user's authorized sandbox-off trial, append `--no-sandbox` to the preparation command. It applies the startup flag to both isolated roles, including after reload. Without that explicit flag, sandbox policy remains unchanged.
|
||||
3. Create a new no-focus Herdr test pane at the printed project path. Run the printed `start.zsh` there. Do not use an existing research pane. Extension-specific sidecar configuration may need explicit trial configuration; the copied top-level settings are not a complete copy of every extension's state.
|
||||
4. Use `/goals <objective>`, inspect the draft, and choose `/goals review` → Ready. `/goals ready` is explicit approval without opening the menu.
|
||||
5. Observe the actual worker pane and parent report. Inspect the files and saved verification. Repeat through a second goal, using the same saved worker session. Record any intervention.
|
||||
## Isolated validation
|
||||
|
||||
Auth copies and raw sessions are private trial files, not repository artifacts. Never commit them.
|
||||
Run `node prototype/prepare.mjs <clean-pinned-edxeth-checkout> <installed-pi-package-root>`. It creates a temporary Git project and private profile, retains unrelated packages and substitutes only goals/subagent implementations. Start its printed script in a new no-focus Herdr pane. Do not operate user panes. Auth copies and raw profiles are private; never commit them.
|
||||
|
||||
## Commands and limits
|
||||
[Current functional evidence](../slop/reviews/20260910_package-supervision-herdr.md) includes model/byte checks, Intercom draft tests, timer updates, the delayed reload crash and saved-session solo recovery. Automated tests do not replace these checks.
|
||||
|
||||
- `/goals status`: local phase, plan path and last worker session. Inspect `/subagents` for runtime liveness; we do not invent it from a stale local flag.
|
||||
- `/goals stop`: persist a local pause, then ask the parent to stop the recorded worker through `subagent_kill`. The message explicitly says remote stop is not yet confirmed. New launch/resume calls are blocked while planning or paused.
|
||||
- `/goals resume`: explicit authorization to continue a paused plan through the existing edxeth session. A draft still requires Ready.
|
||||
- `/goals exit`: return to ordinary chat without approving a draft. The plan is retained. A recorded worker still needs confirmed termination.
|
||||
- `/goals solo`: explicitly authorize direct work when no worker was recorded. It does not silently take over from a potentially live worker.
|
||||
- `CompleteGoal`: records **the parent's evidence judgment**, not an independent model judge. Evidence files must exist and be nonempty; the parent must inspect what they show. Git cleanliness/tracking is not required. Manual checkbox edits remain unsigned claims. Deleted/reopened/ambiguous subjects lose their recorded sign-off.
|
||||
|
||||
The [functional report](../docs/slop/reviews/edxeth-prototype/README.md) records a real two-goal completion after Ready, worker-pane evidence, parent reload, and the copy-only native replay check, including failed attempts and interventions.
|
||||
|
||||
This is a prototype, not a replacement release. It does not have automatic active-worker rediscovery after a lost launch result, automatic parent crash recovery, or guaranteed stop acknowledgement. Reports are goal/task-boundary handoffs, not periodic VCC overviews. A fresh worker defaults to the parent's model; configure a concrete worker model in its definition if desired. Existing long-history encrypted replay still needs a copy-only compatibility check with the entire configured extension set.
|
||||
— Pi/OpenAI
|
||||
|
||||
@@ -9,7 +9,7 @@ tools: all
|
||||
skills: all
|
||||
trust-project: true
|
||||
inherit-append-system: true
|
||||
auto-exit: true
|
||||
auto-exit: false
|
||||
parent-close-policy: continue
|
||||
spawning: false
|
||||
---
|
||||
@@ -18,8 +18,8 @@ Implement only the goal delegated by the parent. Read the supplied plan and appl
|
||||
|
||||
Save the actual deliverable and verification output. Verify the outcome, not merely that a command ran. Ignored and uncommitted files are valid evidence. Do not clean or commit unrelated files to satisfy a Git-state gate.
|
||||
|
||||
Report the artifact paths, verification performed, observed result, remaining uncertainty and any blocker. Investigate failures before declaring yourself blocked. Respect explicit user pauses. Do not approve your own goal or launch another writer. Completion approval belongs to the parent.
|
||||
Call AttachGoalPlan with the supplied absolute plan path. Send the supervisor an Intercom report with the artifact paths, verification performed, observed result, remaining uncertainty and any blocker. Use the exact supervisor session ID supplied in the task; confirm it in Intercom's session list. Investigate failures before declaring yourself blocked. Respect explicit user pauses. Do not approve your own goal or launch another writer. Completion approval belongs to the parent.
|
||||
|
||||
This worker uses a clean model context linked to the parent, not a full transcript fork. The parent supplies the approved plan and task. Normal completion returns your report and closes this pane; the parent can resume this saved Pi session for follow-up. If the user takes over interactively, follow their direction.
|
||||
This worker uses a clean model context linked to the parent, not a full transcript fork. The parent supplies the approved plan and task. Send completion through Intercom and leave this pane open for follow-up messages. Do not call caller_ping, exit or shutdown: an unsent editor draft may exist even though it is absent from model context. Saved-session resume applies only after this session has stopped. If the user takes over interactively, follow their direction.
|
||||
|
||||
Prepared by Pi/OpenAI for the isolated edxeth prototype.
|
||||
|
||||
Reference in New Issue
Block a user