diff --git a/epiphany-core/src/bin/epiphany-mvp-coordinator.rs b/epiphany-core/src/bin/epiphany-mvp-coordinator.rs index 1f12fd72..89e1c43b 100644 --- a/epiphany-core/src/bin/epiphany-mvp-coordinator.rs +++ b/epiphany-core/src/bin/epiphany-mvp-coordinator.rs @@ -1097,7 +1097,8 @@ fn role_result_auto_acceptable(role_id: &str, result: &Value) -> bool { } match role_id { "verification" => true, - "research" | "modeling" | "imagination" => finding["statePatch"].is_object(), + "research" | "imagination" => finding["statePatch"].is_object(), + "modeling" => finding["repoModelPatch"].is_object(), _ => false, } } @@ -1713,6 +1714,29 @@ mod tests { assert!(!role_result_auto_acceptable("modeling", &errored)); } + #[test] + fn auto_review_accepts_modeling_repo_patch_without_generic_state_patch() { + let result = json!({ + "status": "completed", + "finding": { + "runtimeResultId": "result-modeling-typed", + "runtimeJobId": "job-modeling-typed", + "repoModelPatch": { + "patch_id": "patch-typed", + "base_revision": 0, + "base_hash": "base", + "applied_at": "2026-07-16T00:00:00Z", + "purpose": {"kind": "evolution"}, + "operations": [{"operation": "retire_node", "node_id": "old"}] + }, + "statePatch": null + } + }); + + assert!(role_result_auto_acceptable("modeling", &result)); + assert!(!role_result_needs_supersession("modeling", &result)); + } + #[test] fn supersession_includes_unreviewable_modeling_results() { let unreviewable = json!({ @@ -1732,6 +1756,14 @@ mod tests { "summary": "Mapped with state.", "runtimeResultId": "result-modeling-2", "runtimeJobId": "job-modeling-2", + "repoModelPatch": { + "patch_id": "patch-modeling-2", + "base_revision": 0, + "base_hash": "base", + "applied_at": "2026-07-16T00:00:00Z", + "purpose": {"kind": "evolution"}, + "operations": [{"operation": "retire_node", "node_id": "old"}] + }, "statePatch": {"scratch": {"summary": "mapped"}} } }); diff --git a/epiphany-core/src/prompts/epiphany_specialists.toml b/epiphany-core/src/prompts/epiphany_specialists.toml index f79d7843..98ef943d 100644 --- a/epiphany-core/src/prompts/epiphany_specialists.toml +++ b/epiphany-core/src/prompts/epiphany_specialists.toml @@ -99,6 +99,7 @@ RepoModel node `kind` is a closed vocabulary: `domain`, `module`, `crate`, `bina Every upserted or revised node must include all canonical identity and judgment fields: `id`, `domain_id`, `profile`, `kind`, `title`, `claim`, `question`, `tension`, and `action_implication`. Every upserted or revised edge must include `id`, `source_id`, `target_id`, `kind`, `profile`, and `claim`. Do not emit shorthand nodes or edges; omitted empty judgment fields are still contract violations. `profile` is exactly one of `repo_architecture`, `repo_dataflow`, `role_self`, `short_term`, `incubation`, `agency_pressure`, `candidate_intervention`, `identity`, or `evidence`; there is no `repo` shorthand. Edge `kind` is exactly one of `owns`, `reads`, `writes`, `derives`, `adapts`, `persists`, `launches`, `verifies`, `supports`, `contradicts`, `distills`, `revises`, `retires`, `grounds`, `triggers`, `spoken_as`, `cools`, `clusters_with`, `resonates_with`, `depends_on`, or `other`. If you emit an `anchor`, it must include its own stable `id`, `kind`, and `target`; a nested `code_ref` must include `path`. Do not use a bare path-shaped object as an anchor. Omitting anchors is safer than inventing malformed provenance. When `` is present, echo its exact `modelingRequestId` as `repoFrontierModelingRequestId`, use `purpose.kind=incorporate_frontier_verdict` with its exact `frontierRouteId` and `soulVerdictReceiptId`, and revise only its routed frontier item to its allowed disposition. The typed request is authority; nearby telemetry, timestamps, and prose are not substitutes. When that request is absent, use `purpose.kind=evolution` and do not invent verdict-incorporation authority. +An ordinary `purpose.kind=evolution` patch may mutate nodes and edges only. It must not upsert, revise, retire, or adopt frontier items. Frontier mutation requires an explicit typed frontier request and its corresponding non-evolution purpose; describe an observed frontier wound in `summary`, `evidenceGaps`, or `nextSafeMove` when no such request exists. When the typed launch document contains `proposalModelingContext`, echo its exact `requestId` as `proposalModelingRequestId`. Read only that immutable typed projection against its exact canonical `modelRevision` and `modelHash`. The proposal is evidence, not campaign truth: contribute one source-grounded interpretation to shared typed state, where another organ may later challenge or revise it through another typed artifact. Do not substitute adjacent proposals, infer service intake, parse proposal authority from prose, manufacture Hands work, or claim admission or execution authority. Generic `statePatch` is optional and has been stripped of repository-anatomy authority. If present, it may contain only coherent `observations` and `evidence`. Never put graphs, graph frontier, graph checkpoint, scratch, investigation checkpoint, planning, objectives, jobs, or other anatomy in `statePatch`; those old paths are demoted and will be rejected. Do not edit files, do not implement product code, do not verify as if you were the reviewer, do not change jobs/subgoals/objective/invariants/churn/mode, and do not promote or accept your own output. diff --git a/epiphany-core/src/surfaces/coordinator.rs b/epiphany-core/src/surfaces/coordinator.rs index a67cc8a0..28efd20c 100644 --- a/epiphany-core/src/surfaces/coordinator.rs +++ b/epiphany-core/src/surfaces/coordinator.rs @@ -323,7 +323,7 @@ pub fn derive_coordinator_finding_signals( }) }); let modeling_result_reviewable = - modeling_finding.is_some_and(modeling_finding_has_reviewable_state_patch); + modeling_finding.is_some_and(modeling_finding_has_reviewable_repo_model_patch); let modeling_result_requests_regather = modeling_finding.is_some_and(modeling_finding_requests_regather); let modeling_result_failure_reviewed = modeling_finding.as_ref().is_some_and(|finding| { @@ -418,13 +418,16 @@ pub fn reorient_finding_already_accepted( false } -fn modeling_finding_has_reviewable_state_patch( +fn modeling_finding_has_reviewable_repo_model_patch( finding: &EpiphanyRoleFindingInterpretation, ) -> bool { - finding - .state_patch - .as_ref() - .is_some_and(|patch| super::modeling_role_state_patch_policy_errors(patch).is_empty()) + finding.item_error.is_none() + && finding.job_error.is_none() + && finding.repo_model_patch.is_some() + && finding + .state_patch + .as_ref() + .is_none_or(|patch| super::modeling_role_state_patch_policy_errors(patch).is_empty()) } fn research_finding_has_reviewable_state_patch( diff --git a/notes/epiphany-current-algorithmic-map.md b/notes/epiphany-current-algorithmic-map.md index ae6b7350..881db5d8 100644 --- a/notes/epiphany-current-algorithmic-map.md +++ b/notes/epiphany-current-algorithmic-map.md @@ -23,8 +23,10 @@ explicit supersession receipt before relaunch. Exact repeat is idempotent; conflicting acceptance authority is refused. - Current live evidence: Eyes produced and Mind accepted a code-grounded result. - Modeling has not yet produced a current admissible Body-grounded result; its - latest eleven-tool run ended at the provider request boundary. + Modeling subsequently produced a source-grounded Body-bound RepoModel + proposal, but Mind refused it because `Evolution` attempted an unrequested + frontier upsert. Ordinary evolution owns nodes and edges only; frontier + mutation remains request-bound. A fresh post-correction admission is pending. ## Observation and bootstrap authority correction (2026-07-12) diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 16f7e3a0..a7dc0900 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -16,14 +16,16 @@ output is terminally sealed with a bounded diagnostic rather than marked complete. The stale OpenAI-runtime Modeling fixture now carries and echoes a Body basis and passes again. -No current Modeling admission exists yet. The most recent worker inspected -source through eleven tool rounds, then the provider request failed before a -typed result was published. Do not inspect its sealed transcript. Rebuild the -coordinator after any final edits, supersede that failed result with -`--supersede-failed-results`, and relaunch in `--mode run` with the existing -accepted Eyes basis. Make no source edits between the final Body observation -and Mind admission. Only after Mind accepts an exact Body-basis RepoModel patch -should `epiphany-memory-semantic repository-readiness` be run with local Ollama +No current Modeling admission exists yet. After the Body was committed at +`f574a194`, Modeling completed a source-grounded typed proposal over the +repository Body. Mind correctly refused it because ordinary `Evolution` also +carried `upsert_frontier`, which requires an explicit frontier request. The +prompt now makes the invariant explicit: ordinary Evolution changes nodes and +edges only. Commit this small correction, rebuild the coordinator, supersede +the refused result, and relaunch in `--mode run` with the accepted Eyes basis. +Make no source edits between the final Body observation and Mind admission. +Only after Mind accepts an exact Body-basis RepoModel patch should +`epiphany-memory-semantic repository-readiness` be run with local Ollama `qwen3-embedding:0.6b`, 1024 dimensions, and the runtime spine. Exact remaining sequence: diff --git a/state/map.yaml b/state/map.yaml index 3426853b..e51ed2e4 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -6,6 +6,7 @@ experiment: workspace_coverage_projector: "The dedicated workspace-coverage projector is the only coverage writer. Its reserved supervisor/CultMesh policy fixes the packaged sibling binary and exact runtime/Verse/Qdrant/Ollama args; generic policy, arbitrary command, workspace, Body-store, collection, and dimension inputs are forbidden. The binary authenticates current policy-bound launch receipt, PID, executable hash, runtime id, and host singleton before the service derives the immutable Body route. One persisted Body basis plus one authenticated read session prepares verified UTF-8 chunks; an exact Current fast path reads no worktree files. Claims/attempts bind exact managed-process launch and executor incarnation. Every pulse re-resolves the mutable Ollama tag to its installed artifact digest, probes dimensions, embeds only after claim acquisition, writes an epoch-fenced managed Qdrant collection, whole-scrolls typed payloads and unnamed vectors, rejects cyclic offsets and duplicate/extra/missing/substituted/nonfinite/wrong-dimension/wrong-vector points, then terminal-CASes receipt/head against exact Body/plan/claim/prior-head authority. Body history owns bounded retirement of terminal non-current collections; running/current collections are preserved and deletion requires exact managed metadata. Idunn recovery uses specialized process authority only: immutable exact predecessor termination must exist before a host-signed replacement launch can claim the one replacement slot; the replacement's latest signed heartbeat must be ready; one Body CAS then terminalizes the abandoned claim/attempt, advances the fencing epoch, and persists an immutable recovery receipt binding old claim, termination, replacement launch, ready heartbeat, and successor claim. Query admission remains absent." repository_readiness_join: "Mind owns the implemented race-bounded RepositoryReadinessProjection operation. It freshly observes Body R1; derives canonical RepoModel, the unique current v5 Body-grounded admission, and the complete succeeded Modeling semantic chain from one raw opening CultCache snapshot; authenticates live semantic vectors and live workspace coverage bound to R1; observes Body R2 and requires the same content identity/root; repeats both live reads; derives the closing authority from one raw full snapshot; and atomically appends a historical observed-ready-at projection only if that complete snapshot is unchanged. Stored projections never grant current readiness. A→B→A is acceptable only as equal content-addressed endpoints. CultCache now fences full-snapshot cardinality with tuple (type,key) identity. Legacy retrieval Ready, timestamps, watcher silence, Git OIDs, collection existence/counts, Hands receipts, Eve/Gjallar, and prior readiness projections are forbidden substitutes." coordinator_grounding_loop: "Cold start is owned by one typed UserObjectiveIntake that atomically seeds thread state and refuses objective replacement; a missing checkpoint routes to Modeling rather than a fictional prepareCheckpoint actuator. Explicit local-Verse path authority flows into launch context without sibling-path inference. Eyes and Modeling receive bounded source tools. Accepted CRRC regather findings hand source gathering to Eyes instead of recursively relaunching the continuity judge. Runtime/display/coordinator reads share the canonical typed role and reorient result readers. Failed or completed-unreviewable role outputs may be explicitly superseded by a typed review receipt; JSON null is not a state patch. Provider output schema is formatting guidance only, while canonical typed ingress and Mind remain admission authority. Modeling's provider schema now describes tagged patch operations, closed node/edge/profile vocabularies, canonical node/edge fields, anchors, code refs, observations, evidence, frontier items, and Body-basis echo. Live dogfood has accepted one code-grounded Eyes result, but no current Body-grounded Modeling admission yet: the latest Modeling run used eleven source-tool rounds then failed at the provider request boundary before publishing typed output." + modeling_admission_dogfood: "A source-grounded Modeling result now completes with typed Body-basis ingress and a substantial RepoModel node/edge proposal, proving the source/tool/output path. Mind still refused admission because the ordinary Evolution patch also attempted upsert_frontier without an explicit frontier request. The Modeling prompt now states the canonical invariant: Evolution mutates nodes/edges only; frontier mutation requires its typed request and non-evolution purpose. A fresh run against the post-fix Body is still required before repository readiness can join." status: active phase: phase_6_reflection_boundary premise: >