Skip to content

Have replan requests report findings, not plans - #107

Merged
Epsirom merged 1 commit into
mainfrom
chrok/replan-findings
Oct 20, 2026
Merged

Epsirom merged 1 commit into
mainfrom
chrok/replan-findings

Conversation

@Epsirom

@Epsirom Epsirom commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Change

Follow-up to #106 (#105).

A node sees only the goal, its own prompt, and its direct predecessors' results. It does not see its successors, siblings, or the rest of the graph. The request_replan wording from #106 still asked it to judge the plan, for example to call it when "substantial work outside your prompt is needed", which it cannot tell: that work may already be planned for another node. The result would be requests about work that is already covered.

A node can reliably tell when what it found differs from what its own prompt assumed. This PR makes the tool about reporting that finding, and leaves mapping it to the plan to the parent agent.

Worker side (src/replan-tools.ts, shared by Pi and DSH)

  • The tool description and system prompt line say that the node sees only the goal, its prompt, and its direct inputs, and should report what it found, not a new plan.
  • Triggers are things a node can observe: what it found contradicts its prompt's assumptions, makes its task unnecessary, or affects more than its task in a way the goal depends on (for example a root cause that also explains other problems). The "work outside your prompt" trigger is gone.
  • reason asks for what was found, how it differs from what the prompt assumed, and what it affects.
  • The high bar, early call, decide note, and suggestion limits from Let a running node ask the parent agent to replan #106 are unchanged.

Parent side (Pi and DSH guidance and replan reminders)

  • The reminder says the worker did not see the rest of the graph, and that the parent decides which planned work a finding affects.
  • The guidance suggests naming related work in a node's prompt ("other nodes handle Y and Z") when its findings could affect other branches, so its request can say what is affected. This costs the parent a sentence, not every node's context.

Docs: docs/execution-control.md and the Pi and DSH READMEs now use examples a node can observe. The previous example ("fix-b is unnecessary", with removeNodeIds: ["fix-b"]) assumed the node knew about a sibling. The new example suggests adding a node after the caller. The CHANGELOG entry for this unreleased feature still holds, so it is unchanged.

A read-only graph view for nodes is not part of this PR. I added the reasoning to #66, where editing a node's own downstream needs such a view anyway: #66 (comment)

Validation

  • npm run verify: 269 core, 178 Pi, and 61 DSH tests passed, with all type checks. Its package smoke step hung once (a tsc child sleeping with no CPU); run again on its own, npm run test:package passed in about 30 seconds.

  • Updated assertions: the tool description says "report what you found, not a new plan" and no longer mentions work outside the prompt; the worker prompt line says the node cannot see the rest of the graph; the Pi and DSH reminders tell the parent to decide which planned work a finding affects.

  • Relevant tests and type checks pass.

  • User-facing docs and changelog are updated where needed.

  • Breaking changes, if any, include migration guidance. (None.)

A node sees only the goal, its prompt, and its direct predecessors, so it
cannot judge which planned work its finding affects. request_replan now
asks for the finding and how it differs from what the prompt assumed,
drops the trigger that needed knowledge of other nodes ("work outside
your prompt"), and tells the node that the parent maps findings to the
plan. Parent guidance says the same and suggests naming related work in
a node's prompt when its findings could affect other branches. Docs use
examples a node can actually observe.
@Epsirom
Epsirom enabled auto-merge (squash) October 20, 2026 15:24
@Epsirom
Epsirom merged commit b3987b4 into main Oct 20, 2026
11 checks passed
@Epsirom
Epsirom deleted the chrok/replan-findings branch October 20, 2026 15:32
Epsirom added a commit that referenced this pull request Oct 20, 2026
## Change

Prepare the coordinated Braid 0.5.1 release for core, Pi, and DSH.

- Running execute and decision nodes can report findings and ask the
parent agent to replan through `request.requestReplan` / the
`request_replan` tool
([#106](#106),
[#107](#107), closes
[#105](#105)).
- Core exports `BRAID_VERSION`; Pi and DSH fail fast with
upgrade/restart guidance on a mismatched core
([#103](#103), closes
[#102](#102)).
- Pi/DSH guidance leaves time and tool budgets unset unless the user
asks ([#104](#104)).

This is a **patch** release: the new `replan_requested` event and
optional `replan`/`requestReplan` fields are additions covered by the
versioning policy ("New optional fields … may ship in a patch";
consumers provide a fallback for new event types). No migration from
0.5.0 is required.

Updates in this PR:
- All three package versions, both integrations' exact core
dependencies, `BRAID_VERSION`, both `REQUIRED_CORE_VERSION` constants,
and the workspace lockfile.
- CHANGELOG: dated 0.5.1 entry with PR links and author credit.
- README / Pi / DSH README: migration links pinned to v0.5.1;
previous-release links now point to v0.5.0.
- ROADMAP: release status and 0.5 implemented changes.

#103, #104, #106, and #107 are the only PRs since v0.5.0, all by
@Epsirom, who contributed long before v0.5.0. There are no first-time
human contributors. Pi 1.2.0 and DSH 0.2.0-rc.2 remain the tested hosts.

## Validation

- `npm ci` on Node 25.9: passed.
- `npm run audit:dependencies`: no known vulnerabilities, including
development dependencies.
- `RELEASE_TAG=v0.5.1 node scripts/check-release.mjs`: passed.
- `git diff --check`: passed.
- Full `npm run verify`: 269 core, 178 Pi, and 61 DSH tests passed (508
total), all type checks, offline examples, and isolated package
installation checks passed (47 core, 19 Pi, 38 DSH packed files).
@Epsirom Epsirom added the enhancement New feature or request label Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant