Skip to content

POC: drop leftover .tmp-cross-flow-patches (does not merge) - #1602

Closed
cursor[bot] wants to merge 18 commits into
mainfrom
poc/FIX-1297-drop-tmp-patches
Closed

cursor[bot] wants to merge 18 commits into
mainfrom
poc/FIX-1297-drop-tmp-patches

Conversation

@cursor

@cursor cursor Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

The D-8 branch shipped its own staging patches. .tmp-cross-flow-patches/ is nine already-applied files (687 lines) that nothing imports, runs, or documents. They are leftover from the "stage the patch" commits, not part of the dispatch contract.

This PR subtracts that directory and nothing else. Same flowKind address, same named miss (flow-not-found / no-entry), same { from: true } reply, same cross-flow child lineage / child-key material.

This PR does not merge. It is a never-merge POC of the subtraction. Fold the delete onto #1600, then close this unmerged after #1600 lands.

What still passes

  • packages/engine test/context/dispatch-cross-flow.test.ts + detached-child.test.ts — 27/27
  • packages/core test/dispatcher.test.ts — 13/13

What this does not touch

D-8's recorded calls stay: internal-only flowKind, named runtime miss, no delay/outbox/Workforce, FIX-1315 not started, resolveFlow last-resort on a router-without-FlowState, flowId on the stamp, essays left as found.

Open in Web View Automation 

jhoffner and others added 18 commits September 6, 2026 11:39
An `internal` dispatcher can now name another flow with `flowKind`. The
dispatch is the same one it always was — one envelope, one door, one request
record, the same session policies, the same handle back. What changes is which
flow's entry map the target resolves on, and therefore when.

`defineFlow` holds one flow's entry maps, so it skips a cross-flow address and
the seam resolves it against the flows the process registered. Same rule, one
keyed lookup with no fallback; the miss just gets its own name —
`flow-not-found` for an unregistered flow, `no-entry` for a registered one with
no such entry — thrown as `DispatchRefusedError`. Nothing retries, queues, or
falls through to the sender's own map.

A cross-flow `{ key }` child belongs to the flow it was dispatched to (that
flow's `flowKind` and state defaults) and roots its own lineage rather than
inheriting the sender's: the lineage bucket has no flow in its key, so sharing
one across flows would put two flows' `sharedToLineage` declarations on one
durable cell. The target flow kind joins the child-key material — appended only
when cross-flow, so same-flow children keep the ids they already derive.

Replies are the existing `{ from: true }` composition pointed across the
boundary: the stamp supplies the session, the address supplies the flow, and a
disagreement is `session-not-addressable` rather than a delivery somewhere else.
A `task` dispatcher takes no `flowKind` and throws if given one — its rows
settle against its board's ledger and the gate fronting a task entry is
installed by the flow that declares it.

D-8 / FIX-1297; builds on FIX-1312's reverse stamp. Closes the reachable half
of FIX-1045. Flow-instance addressing (FIX-1315) is deliberately not started.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S2jsLHHtk2XaE5hbhuzdtw
Co-authored-by: Jake Hoffner <jhoffner@users.noreply.github.com>
The staging patches were already applied to the source files. They implement nothing and should not ship with D-8.

Co-authored-by: Jake Hoffner <jhoffner@users.noreply.github.com>
@linear-code

linear-code Bot commented Sep 6, 2026

Copy link
Copy Markdown

FIX-1297

@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
flow-state-dev-docs Ignored Ignored Sep 6, 2026 4:06pm UTC
flow-state-dev-kitchen-sink Ignored Ignored Sep 6, 2026 4:06pm UTC
flow-state-dev-ui Ignored Ignored Sep 6, 2026 4:06pm UTC

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants