From 16be92f430417d28ab430810c5f83107dc4f4de3 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 8 Aug 2026 01:58:24 +0100 Subject: [PATCH] Queue selected proposal Modeling work --- epiphany-core/src/runtime_spine.rs | 59 ++++++++++++++++++---- notes/epiphany-current-algorithmic-map.md | 9 ++++ notes/fresh-workspace-handoff.md | 26 ++++++++-- state/ledgers.msgpack | Bin 563657 -> 564214 bytes state/map.yaml | 8 +-- 5 files changed, 84 insertions(+), 18 deletions(-) diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index c77628e9..0ce8874d 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -6214,9 +6214,11 @@ pub fn runtime_repo_frontier_planning_eligibility( }) } -/// Returns the single selected user proposal that has not yet been claimed by -/// a Modeling launch. Selection is already an explicit Self authority; this -/// projection prevents the CLI from becoming a second routing owner. +/// Returns the oldest selected proposal that has not yet been claimed by a +/// Modeling launch. Selection is already explicit Self authority; several +/// Imagination options may therefore form a queue without asking this +/// projection to prefer one proposal over another. Stable request order owns +/// scheduling only and prevents the CLI from becoming a second routing owner. pub fn runtime_pending_repo_frontier_proposal_modeling_request( runtime_store: impl AsRef, ) -> Result> { @@ -6245,12 +6247,7 @@ pub fn runtime_pending_repo_frontier_proposal_modeling_request( .cmp(&b.selected_at) .then_with(|| a.request_id.cmp(&b.request_id)) }); - if pending.len() > 1 { - return Err(anyhow!( - "Self found multiple unclaimed proposal Modeling requests" - )); - } - Ok(pending.pop()) + Ok(pending.into_iter().next()) } /// Read-only Self projection over the existing typed frontier-planning chain. @@ -10847,6 +10844,50 @@ pub(crate) mod tests { Ok(()) } + #[test] + fn pending_proposal_modeling_requests_are_a_stable_execution_queue() -> Result<()> { + let root = tempdir()?; + let (store, proposal_id) = proposal_selection_fixture(root.path(), "queued")?; + let first = select_repo_frontier_work_proposal_for_modeling( + &store, + &proposal_id, + "2026-07-13T02:02:00Z", + )?; + let mut second = first.clone(); + second.request_id = "repo-frontier-proposal-modeling-queued-second".into(); + second.proposal_id = "queued-second-proposal".into(); + second.proposal_payload_sha256 = "22".repeat(32); + second.selected_at = "2026-07-13T02:03:00Z".into(); + validate_repo_frontier_proposal_modeling_request(&second)?; + overwrite_test_entry(&store, &second.request_id, &second)?; + + assert_eq!( + runtime_pending_repo_frontier_proposal_modeling_request(&store)?, + Some(first.clone()) + ); + + let first_launch = RepoFrontierProposalModelingLaunchBinding { + schema_version: REPO_FRONTIER_PROPOSAL_MODELING_LAUNCH_BINDING_SCHEMA_VERSION.into(), + binding_record_id: "queued-first-launch".into(), + proposal_modeling_request_id: first.request_id, + proposal_id: first.proposal_id, + proposal_payload_sha256: first.proposal_payload_sha256, + job_id: "queued-first-job".into(), + binding_id: "modeling-checkpoint-worker".into(), + runtime_id: first.runtime_id, + thread_id: first.thread_id, + launched_at: "2026-07-13T02:04:00Z".into(), + worker_launch_document_sha256: "33".repeat(32), + contract: REPO_FRONTIER_PROPOSAL_MODELING_LAUNCH_BINDING_CONTRACT.into(), + }; + overwrite_test_entry(&store, &first_launch.binding_record_id, &first_launch)?; + assert_eq!( + runtime_pending_repo_frontier_proposal_modeling_request(&store)?, + Some(second) + ); + Ok(()) + } + #[test] fn corrupted_proposal_or_selection_is_fail_closed_without_authority_mutation() -> Result<()> { let root = tempdir()?; diff --git a/notes/epiphany-current-algorithmic-map.md b/notes/epiphany-current-algorithmic-map.md index 6cbc990e..f5c0c854 100644 --- a/notes/epiphany-current-algorithmic-map.md +++ b/notes/epiphany-current-algorithmic-map.md @@ -1266,6 +1266,15 @@ The prepared argv is then the single source for child launch and lease thread identity. Only plain operator objectives use the resident runtime thread. `epiphany-swarm` no longer reconstructs a fixed thread after preparation. +An Imagination direction result may contain several option drafts. Autonomous +promotion gives every option its own proposal, provenance binding, and explicit +proposal-Modeling request. These are selected work items, not candidates still +awaiting preference. `runtime_pending_repo_frontier_proposal_modeling_request` +therefore schedules the oldest unclaimed request by `selected_at`, then stable +request ID. A launch binding removes only its exact request from the pending +queue, exposing the next. Self owns queue order; it does not silently discard +or rank Imagination's already-selected options. + ## Exact release build cache ownership Release construction has two serialized cache authorities. The graph cache is diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index fb014597..1f71e5e3 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -14,6 +14,21 @@ source plus a commit-local target was terminated after 12.8 minutes. Rebuild the publisher itself after changing release-cache machinery; otherwise the benchmark measures an obsolete body. +Fresh runtime `live-20260808-v35-request-thread` published that release and ran +under persistent swarm supervision. The resident child completed on exact +thread `shakedown-v31-rupture-closure-implementation-r1`, proving the typed +request owns the launch and lease across the real process boundary. The +accepted Imagination direction result contained several options. Autonomous +promotion correctly persisted each option and its exact provenance as selected +proposal-Modeling work, but status then failed because the pending projection +required exactly one unclaimed request. + +The current worktree treats selected proposal-Modeling requests as an +oldest-first execution queue. A launch binding consumes only its exact request +and exposes the next. The focused queue test proves both ordering and +single-request consumption; both native status tests also pass. v35 is sealed +at the cardinality failure boundary. + Fresh runtime `F:\Projects\.epiphany-runtime\shakedown\live-20260808-v31` accepted initial and proposal-bound Modeling for thread `shakedown-v31-rupture-closure-implementation-r1`. The generic user proposal @@ -83,11 +98,12 @@ thread. ## Next action -1. Commit and push this build-evidence/Mind refresh. -2. Preserve v31 through v34 as failure evidence; clone the recovered boundary - into a new replay runtime using an approved `.epiphany-dogfood` artifact root. -3. Publish exact `8a9439ca`, re-run heartbeat selection and resident launch, - including exact retry after one deliberate failed launch. +1. Commit, push, package, and authenticate the proposal-Modeling queue repair. +2. Preserve v31 through v35 as failure evidence; clone v35 into v36 and publish + the exact successor release. +3. Run persistent resident supervision from an approved `.epiphany-dogfood` + root and prove the selected Imagination options launch Modeling one at a + time in stable request order. 4. In a fresh runtime, re-run pressure ingestion twice and resident launch. Prove autonomous direction consideration, proposal-bound Modeling, canonical Imagination, dedicated Mind adoption, and exact Hands authority. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 2d02d7ccb96d48868f8c194bfb03f96b348e2f14..d11a72f10f0b3cfdb334d1868ffde3140928339e 100644 GIT binary patch delta 569 zcmYLFu}&N@5Y1j7IVl|#NtzLqWRK;Ji;nvMIyxjI8f5GtYw+5}V=r8Fic;hUaylsu zd;$^$@B@)j=U>vo7;=iVZ*7mq@6CI^Z`c0bt=+5^?}npszdHQ&s{8ZL?Rs%u6oYTG z&i7fTVC3~RV~MfMc*A&mH|un_=PN%R`c?mPS&jJHud4BIG{3rE`Y^~C|Hzi_Tv~VJ{VJ((#l8Ks|Az5jJ zZn)}$^Nxfm_nbnb?U%(&G=6C>ozHT)v2o8k$+JczAZ#%R!^XYQQb#j^bwYzO{&z;7 z;G$;vJV~ZFMLEAd?XFJQEQ=*0f{v3O9Jp{610t(?p#zYtQ6