Ground Modeling in canonical RepoModel shape
This commit is contained in:
parent
d53f61193d
commit
2f1b8ae4c2
7 changed files with 58 additions and 2 deletions
|
|
@ -950,6 +950,8 @@ fn launch_role(
|
|||
)
|
||||
.map_err(anyhow::Error::msg)?;
|
||||
} else if role == epiphany_core::EpiphanyRoleResultRoleId::Modeling {
|
||||
context = epiphany_core::append_modeling_repo_model_shape_context(context, runtime_store)
|
||||
.map_err(anyhow::Error::msg)?;
|
||||
context = epiphany_core::append_modeling_work_loop_telemetry_context(
|
||||
context,
|
||||
runtime_store,
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ use crate::ensure_runtime_repo_model;
|
|||
use crate::load_epiphany_cultmesh_cluster_topology;
|
||||
use crate::load_epiphany_cultmesh_status;
|
||||
use crate::load_latest_epiphany_cultmesh_work_loop_telemetry;
|
||||
use crate::load_memory_graph_snapshot;
|
||||
use crate::memory_graph_from_epiphany_graphs;
|
||||
use crate::plan_memory_graph_context_cut;
|
||||
use crate::query_epiphany_local_verse_context;
|
||||
|
|
@ -249,6 +250,40 @@ pub fn append_verification_hands_receipt_context(
|
|||
Ok(context)
|
||||
}
|
||||
|
||||
pub fn append_modeling_repo_model_shape_context(
|
||||
mut context: String,
|
||||
runtime_store_path: &Path,
|
||||
) -> Result<String, String> {
|
||||
let graph_store = memory_graph_store_path(runtime_store_path);
|
||||
let snapshot = load_memory_graph_snapshot(&graph_store)
|
||||
.map_err(|error| format!("failed to load canonical RepoModel shape: {error}"))?
|
||||
.ok_or_else(|| {
|
||||
format!(
|
||||
"canonical RepoModel is missing from {} after launch-context assembly",
|
||||
graph_store.display()
|
||||
)
|
||||
})?;
|
||||
context.push_str("\n\n<canonical_repo_model_shape>\n");
|
||||
context.push_str(&format!(
|
||||
"modelRevision: {}\nmodelHash: {}\n",
|
||||
snapshot.model_revision, snapshot.model_hash
|
||||
));
|
||||
context.push_str("existingDomains:\n");
|
||||
for domain in &snapshot.domains {
|
||||
let profile = serde_json::to_string(&domain.profile)
|
||||
.map_err(|error| format!("failed to encode RepoModel domain profile: {error}"))?;
|
||||
let lifecycle = serde_json::to_string(&domain.lifecycle)
|
||||
.map_err(|error| format!("failed to encode RepoModel domain lifecycle: {error}"))?;
|
||||
context.push_str(&format!(
|
||||
"- id={} profile={} lifecycle={} title={}\n",
|
||||
domain.id, profile, lifecycle, domain.title
|
||||
));
|
||||
}
|
||||
context.push_str("New nodes must reference one exact existing domain id; RepoArchitecture and RepoDataflow nodes/edges may use only observed, proposed, accepted, stale, or retired lifecycle. Prefer accepted for a source-grounded current claim. Do not invent a domain because RepoModel patches have no domain mutation operation.\n");
|
||||
context.push_str("</canonical_repo_model_shape>");
|
||||
Ok(context)
|
||||
}
|
||||
|
||||
pub fn append_modeling_work_loop_telemetry_context(
|
||||
mut context: String,
|
||||
runtime_store_path: &Path,
|
||||
|
|
@ -1107,6 +1142,11 @@ mod tests {
|
|||
let preserved = load_memory_graph_snapshot(&graph_store)?.expect("canonical model");
|
||||
assert_eq!(preserved.model_revision, 4);
|
||||
assert_eq!(preserved.frontier, snapshot.frontier);
|
||||
let shape = append_modeling_repo_model_shape_context("base".to_string(), &runtime_store)
|
||||
.map_err(anyhow::Error::msg)?;
|
||||
assert!(shape.contains("<canonical_repo_model_shape>"));
|
||||
assert!(shape.contains("id=repo"));
|
||||
assert!(shape.contains("Prefer accepted"));
|
||||
fs::remove_dir_all(&temp)?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,6 +182,7 @@ pub use coordinator_launch::EpiphanyCoordinatorJobLaunchPlan;
|
|||
pub use coordinator_launch::commit_coordinator_job_launch;
|
||||
pub use coordinator_launch::plan_coordinator_job_launch;
|
||||
pub use coordinator_launch_context::EPIPHANY_LOCAL_VERSE_RUNTIME_ID;
|
||||
pub use coordinator_launch_context::append_modeling_repo_model_shape_context;
|
||||
pub use coordinator_launch_context::append_modeling_work_loop_telemetry_context;
|
||||
pub use coordinator_launch_context::append_verification_hands_receipt_context;
|
||||
pub use coordinator_launch_context::local_verse_store_path;
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ Return a compact structured result that says whether the checkpoint or map shoul
|
|||
RepoModel node `kind` is a closed vocabulary: `domain`, `module`, `crate`, `binary`, `schema`, `runtime_contract`, `adapter`, `test_seam`, `state_store`, `role_memory`, `short_term_thought`, `incubation_thread`, `agency_pressure`, `candidate_intervention`, `identity`, `evidence`, `summary`, or `other`. A node's factual statement belongs in its `claim` field; do not invent kind names such as `claim` or `anatomy`. Use `other` only when no specific canonical kind fits. Edge kinds and memory profiles are likewise closed vocabularies supplied by the output schema.
|
||||
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.
|
||||
The launch context includes `<canonical_repo_model_shape>`. Every new node must use one exact `existingDomains` id from that packet, and repo architecture/dataflow nodes and edges must use one of the listed legal lifecycles. Never derive a domain id from the workspace path; patches cannot create domains.
|
||||
When `<repo_frontier_modeling_request>` 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.
|
||||
|
|
|
|||
|
|
@ -26,7 +26,11 @@
|
|||
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.
|
||||
mutation remains request-bound. A second proposal correctly removed frontier
|
||||
operations but invented a domain id and illegal lifecycle because launch
|
||||
context exposed semantic nodes without the canonical aggregate shape.
|
||||
Modeling launch context now includes current model revision/hash, exact
|
||||
existing domains, and legal repo lifecycles. A fresh admission is pending.
|
||||
|
||||
## Observation and bootstrap authority correction (2026-07-12)
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,14 @@ 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.
|
||||
|
||||
The next nodes/edges-only proposal reached Mind and exposed one further missing
|
||||
launch input: the worker invented a workspace-derived domain id and used
|
||||
`active` lifecycle, while the canonical revision-0 RepoModel has domain `repo`
|
||||
and permits only observed/proposed/accepted/stale/retired for repo profiles.
|
||||
`<canonical_repo_model_shape>` now carries exact current revision/hash, existing
|
||||
domains, and lifecycle law into every Modeling launch. The rejected result is
|
||||
already superseded. Rebuild/commit this context change, then relaunch once.
|
||||
|
||||
Exact remaining sequence:
|
||||
|
||||
1. finish tests/format/docs and commit so the Body is stable;
|
||||
|
|
|
|||
|
|
@ -6,7 +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."
|
||||
modeling_admission_dogfood: "Source-grounded Modeling now completes with typed Body-basis ingress and substantial RepoModel node/edge proposals, proving the source/tool/output path. Mind first refused an ordinary Evolution patch that attempted unrequested frontier mutation, then refused a nodes/edges-only patch whose invented workspace-derived domain and Active lifecycle violated the canonical aggregate. Both were superseded through typed admission-rejection review. Modeling launch context now carries the current model revision/hash and exact existing domain ids plus legal repo lifecycles; Evolution mutates nodes/edges only and frontier mutation remains request-bound. A fresh run against the post-fix Body is still required before repository readiness can join."
|
||||
status: active
|
||||
phase: phase_6_reflection_boundary
|
||||
premise: >
|
||||
|
|
|
|||
Reference in a new issue