Join live repository readiness in Mind

This commit is contained in:
Meta Vens 2026-07-16 12:54:41 +01:00
commit 360dcb433d
9 changed files with 1552 additions and 17 deletions

View file

@ -27,6 +27,7 @@ mod prompt_context;
mod proposal;
mod repo_model_gateway;
mod repository_body_observer;
mod repository_readiness;
mod runtime_spine;
mod semantic_backend;
mod semantic_projector_service;
@ -839,6 +840,7 @@ pub use proposal::EpiphanyMapProposalInput;
pub use proposal::propose_map_update;
pub use repo_model_gateway::*;
pub use repository_body_observer::*;
pub use repository_readiness::*;
pub use runtime_spine::COORDINATOR_RUN_RECEIPT_SCHEMA_VERSION;
pub use runtime_spine::COORDINATOR_RUN_RECEIPT_TYPE;
pub use runtime_spine::EpiphanyCoordinatorRunReceipt;

View file

@ -2,7 +2,7 @@ use super::{
MEMORY_SEMANTIC_PROJECTION_ATTEMPT_SCHEMA_VERSION, MemorySemanticIndexReceipt,
MemorySemanticProjectionAttempt, MemorySemanticProjectionObligation,
MemorySemanticProjectionSourceHead, bind_memory_semantic_index_receipt,
memory_semantic_projection_query_eligible, memory_semantic_projection_terminal_success,
memory_semantic_projection_terminal_success,
validate_memory_semantic_projection_attempt, validate_memory_semantic_projection_obligation,
};
use anyhow::{Result, anyhow};
@ -406,7 +406,7 @@ mod authority_tests {
)?;
let readiness = load_memory_semantic_projection_readiness(&store, &input)?
.expect("terminal empty receipt remains authenticated");
assert!(!memory_semantic_projection_query_eligible(
assert!(!super::super::memory_semantic_projection_query_eligible(
&obligation,
&input.authority.head,
&readiness.receipt

File diff suppressed because it is too large Load diff

View file

@ -833,6 +833,7 @@ pub fn runtime_spine_cache(store_path: impl AsRef<Path>) -> Result<CultCache> {
cache.register_entry_type::<crate::EpiphanyMemoryGraphEntry>()?;
cache.register_entry_type::<RepoModelAdmissionReview>()?;
cache.register_entry_type::<RepoModelAdmissionReceipt>()?;
cache.register_entry_type::<crate::RepositoryReadinessProjection>()?;
cache.register_entry_type::<RepoModelMigrationReceipt>()?;
cache.register_entry_type::<crate::RuntimeRepositoryBodyStoreBinding>()?;
cache.register_entry_type::<RepoModelClaimChallenge>()?;

View file

@ -79,11 +79,13 @@ it no longer owns Epiphany routes, prompts, scheduling, or state mutation.
- Mind and Modeling semantic query admission reauthenticate canonical CultCache
authority at query time against the Yggdrasil-hosted Qdrant/Ollama substrate.
The installed host is operational after login, but its mutable release directory
does not yet prove that supervisor, projectors, and query gate are one source
generation. Whole-repository readiness also lacks its Mind-owned race-bounded
join. Those are the remaining non-permission architecture gates. A real reboot/
logon survival proof remains a separate operator-authorized boundary.
The installed host is operational after login through one witnessed immutable
release generation. Mind now owns the race-bounded whole-repository readiness
join in source: fresh Body R1/R2, exact admitted RepoModel, live Modeling
semantic vectors, live workspace coverage, complete authority snapshots, and an
atomic historical projection append. A real reboot/logon survival proof remains
the separate operator-authorized host boundary. The new join still needs to be
included in the next witnessed release before it can produce live host evidence.
## Invariants
@ -117,7 +119,7 @@ not permission for another row to borrow the result.
| Branch-local autonomous action | Substrate Gate + Hands + Soul + Mind | scoped grants and patch/command/commit/verdict/admission chains | closed |
| Semantic projection/query recovery | canonical admission + projector + query gate + Idunn | live Mind/Modeling semantic ranking and GUID-scoped exact process-recovery smokes | closed |
| Atomic installed sibling generation | release packager + Idunn | release `sha256-c94109f94ee42c1257089830f399cb87cd5ad672772c274194371995ce4df923` binds commit `dd80f4a5`, four exact binaries, task args, policy role paths, and recurrence receipts | closed |
| Whole-repository observed readiness | Mind | required Body R1/R2 + admitted model + live semantic + live workspace-coverage join does not yet exist | open |
| Whole-repository observed readiness | Mind | typed source join, hostile raw-orchestration tests, live semantic/coverage rereaders, and full-snapshot CultCache append fence | closed in source; not yet witnessed/deployed |
| Current host package | release deployment | witnessed supervisor PID 21228 and direct-child projector PID 19748; Mind/Modeling semantic query admission passed | closed for current boot |
| After-login recurrence | Task Scheduler + Idunn + ops tunnel | task recurrence and exact child recovery observed on current boot | closed for current boot |
| Reboot/logon survival | Task Scheduler + Idunn + ops tunnel | requires fresh post-boot lineage and query proof | permission-bound |
@ -164,12 +166,12 @@ Rebuild:
## Immediate Work Queue
1. Build and authenticate one immutable, commit-addressed sibling release. Task
installation and Idunn must consume that witness and reject mixed binaries.
2. Implement Mind's race-bounded `RepositoryReadinessProjection`, including a
live workspace-coverage Qdrant evidence reader; stored `Current` is not enough.
3. Deploy the witnessed release, replace the stale running reconciler/projector,
and repeat exact recurrence plus Mind/Modeling query admission proofs.
1. Package the current source, including semantic receipt v2 and Mind's
`RepositoryReadinessProjection`, into a new immutable witnessed release.
2. Deploy that witness and derive one live whole-repository observation through
the production join; a prior stored projection must not substitute.
3. Repeat exact current-boot recurrence plus Mind/Modeling query admission and
whole-repository observation proofs from the new release.
4. With explicit live operator approval, reboot and prove the fresh Task
Scheduler -> Idunn -> exactly-one-projector lineage plus tunnel and query
admission. Do not silently widen after-login authority into boot service

View file

@ -2026,3 +2026,37 @@ IgnoreNew recurrence refusal while the foreground task is running.
The installed sibling-generation gate is closed for the current boot. Next:
build Mind's whole-repository observed-readiness join. Reboot/logon remains
permission-bound.
## Mind whole-repository readiness join (2026-07-16)
The missing join now exists in source. `repository_readiness.rs` is Mind's sole
owner for a historical `gamecult.epiphany.repository_readiness_projection.v0`.
It derives every authority decision from raw snapshots and observations: fresh
Body R1, one canonical RepoModel, exactly one current v5 admission whose
historical Body basis is authenticated, the exact succeeded Modeling semantic
chain, live semantic vectors, live workspace coverage bound to R1, fresh Body
R2 with equal content identity, repeated live observations, and one complete
closing runtime-store snapshot. The final projection append uses CultCache's
new full-snapshot conditional append, so a concurrent unknown receipt or
obligation defeats the write. Stored readiness is historical evidence only and
cannot admit a later query or readiness answer.
Semantic receipts are now v2 and seal the deterministic post-scroll vector
binding root. Old, malformed, substituted, or stale receipts cannot grant query
eligibility. Exact empty projections may terminal-succeed once while remaining
non-queryable, avoiding a retry wound. Both semantic and workspace live readers
revalidate their persisted authority after Qdrant observation.
CultCache envelope identity is now the tuple `(type, key)`, not delimiter
concatenation, and `append_if_snapshot_unchanged` compares the complete
canonical snapshot beneath the single-file exclusive lock. Soul approved the
join after hostile passes for alien keys, duplicate grounded/ungrounded
admissions, forged raw semantic heads, receipt cross-field substitution,
historical Body failure, Body/authority drift, R1-bound coverage ordering, CAS
refusal, and exact concurrent idempotence.
Verification: 21/21 CultCache tests and 465/465 Epiphany library tests passed;
two existing live tests remain intentionally ignored. Next: commit/push the
CultCache submodule and parent changes, package a new witnessed release, deploy
it, then derive the first live whole-repository projection. Reboot/logon remains
permission-bound and requires explicit live operator approval.

Binary file not shown.

View file

@ -2,9 +2,9 @@ experiment:
name: EpiphanyAgent
repository_body_observer: "Native Rust explicitly binds caller workspace ID to an existing validated runtime/swarm/source identity plus canonical Git root/object format/scope/policy. Bind also installs one immutable runtime-side RuntimeRepositoryBodyStoreBinding naming the canonical external Body-store locator and exact Body-binding hash; every read revalidates runtime/swarm/workspace/path/body identity and refuses a second store. Two equal sanitized temporary-index scans enumerate ignore-aware UTF-8 paths, Git modes, and nonrecursive gitlinks with global excludes disabled; raw regular bytes/lengths and non-followed symlink-target bytes are SHA-256 hashed. The domain-separated ordered raw manifest root, not the clean-filtered auxiliary tree OID, is authoritative Body identity. Every Git subprocess strips ambient repository/worktree/object/ref/index/namespace/replacement/graft/shallow and config-injection authority. Observe cannot mint identity. CultCache MessagePack atomically commits immutable manifest+observation and a manifest-root head by exact CAS. Canonical store-path checks precede writes; corrupt HEAD, sparse checkout, unsafe/unrepresentable paths, racing reads, and repo/runtime substitution fail closed. Only accepted stable observations persist; errors advance no head. Unchanged raw manifest preserves generation; status is read-pure. The observer owns bounded current-state identity, makes no historical continuity claim, and has no Ready field. The runtime route is locator authority only, not proof of model grounding."
modeling_body_grounding: "Every coordinator-owned Modeling launch observes and carries one typed RepositoryBodyObservationBasis before worker thought. The immutable launch binds runtime/swarm/workspace/scope, Body-binding hash, observation generation/id/root, and scan interval. Modeling output contract v3 requires the exact worker-authored echo; ingress reloads the immutable launch and rejects missing/swapped basis, while non-Modeling cargo is forbidden. Mind admission review v1 and receipt v5 preserve that basis; admission validates exact launch/result/review equality plus the immutable historical Body artifacts, then copies it into the CAS receipt. Admission never samples current Body as a substitute. Direct Mind plan adoption and legacy migration remain explicitly ungrounded."
workspace_retrieval_coverage: "The production-unwired retrieval.rs oracle is deleted. Legacy EpiphanyRetrievalState is presentation-only: clean Ready projects Missing and its indexing job is unavailable/unowned. Native coverage now binds an authenticated Repository Body manifest, exhaustive versioned inclusion policy, deterministic chunks/point payloads, immutable Ollama tag+artifact digest identity, vector dimensions, exact Qdrant point/payload/vector observations, and one terminal-CAS receipt/head. Query admission and the race-bounded repository readiness join remain absent; coverage success proves only this exact Body projection."
workspace_retrieval_coverage: "The production-unwired retrieval.rs oracle is deleted. Legacy EpiphanyRetrievalState is presentation-only: clean Ready projects Missing and its indexing job is unavailable/unowned. Native coverage binds an authenticated Repository Body manifest, exhaustive versioned inclusion policy, deterministic chunks/point payloads, immutable Ollama tag+artifact digest identity, vector dimensions, exact Qdrant point/payload/vector observations, and one terminal-CAS receipt/head. A read-only live evidence reader now re-scrolls the exact compatible collection, recomputes payload/vector bindings, and byte-revalidates the entire authority chain after the external read. Coverage success proves only this exact Body projection; Mind alone may join it with the other repository authorities."
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 must own one race-bounded derived repository-readiness operation from exact authenticated authorities: freshly observe Body root R1, validate canonical RepoModel plus exact Mind admission and Body-grounding receipt, authenticated semantic projection eligibility for that admitted model, and workspace retrieval coverage bound to R1 and a named scope policy, then freshly observe R2 and require R2=R1. Its output is observed-ready-at with a truth interval ending at the second scan, not timeless Ready; later reads revalidate. A→B→A is harmless for content-addressed artifacts. Watcher/journal continuity and Hands receipts are invalidation triggers only. Legacy retrieval Ready/empty dirty paths, timestamps, watcher silence, Git OIDs, Qdrant existence, counts, and unrelated generations are forbidden substitutes."
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."
status: active
phase: phase_6_reflection_boundary
premise: >

2
vendor/cultcache-rs vendored

@ -1 +1 @@
Subproject commit deec76be73548867f9276e9c3a4bdcfa265f90e0
Subproject commit 94e47054f45902a9b27296e2ec893b04dc895d06