This repository has been archived on 2026-10-29. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Epiphany/epiphany-core/src/lib.rs
Meta Vens 7ab838f167 Extract epiphany-pipeline, and add the three kinds a mind is keyed by
Ruling 1 keeps schema ownership in Epiphany; ruling 17 puts admission in
Huginn. Huginn must not take on epiphany-core -- about 41,000 lines and 295
lock packages -- to use about 1,000 lines of document types. So the documents
leave as a leaf library, and epiphany-core keeps no pipeline surface at all:
its consumption is campaign two.

`epiphany-core/src/pipeline_documents.rs` moves whole to
`epiphany-pipeline/src/lib.rs`, with its nine tests. Only three things changed
in the move: the module doc now describes a package rather than a cut map
section; `anyhow` joins `rmp-serde` behind `cfg(test)`, because the write path
has been test-only since 186dbc62 and the live library's errors are all
`PipelineRefusal`; and the decode refusal, which was pinned against
epiphany-core's Mind commit receipt, is pinned against a local `ForeignDocument`
carrying that receipt's type id, since the receipt belongs to the harness.

The package declares four dependencies. chrono parses a Date, cultcache-rs
supplies DatabaseEntry, schemars derives the published schemas (Q5), and serde
is the document format. anyhow, rmp-serde and serde_json are dev-dependencies:
every use of them is `cfg(test)`. `autobins = false`, as a leaf library must.
The workspace lock grows by exactly one entry, the member itself; no new
third-party package.

Deleted rather than re-exported: epiphany-core's `mod pipeline_documents;` and
`pub use pipeline_documents::*;`, and `schemars` from its manifest, whose only
user was this module. No shim, no duplicate type.

`runtime_spine_cache_refuses_a_pipeline_store` stays in epiphany-core, because
the rule is the spine registry's: it registers its own types and nothing else.
It now builds its foreign envelope from a `cfg(test)` stand-in carrying
`epiphany.pipeline.campaign.v1` rather than from the moved documents, so the
rule keeps its test without the package keeping a dependency.

D2's three new kinds arrive with the move, each with a live consumer in the
organ: `instance` is a mind's identity document, `stewardship` records the
repos an instance is assigned, and `hand_off` records a reassignment in both
minds. All three hang off an instance rather than a campaign, so they compose
their own keys instead of borrowing the `<campaign>:<kind>:<local>` tail. A
repo inside a key is escaped to `Org_Repo`, because `/` is not a Label byte.

Thirteen schemas now derive. The five that embed `PipelineKind` gained three
enum variants, which is additive, so Q2 keeps `epiphany.pipeline.epoch.v1`.

epiphany-pipeline: 12 tests, 0 warnings. epiphany-core: 163 tests -- 172 minus
the nine that moved -- 0 warnings. epiphany-state.exe is byte-identical.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 11:40:12 +02:00

312 lines
16 KiB
Rust

mod agent_launch;
pub mod atlas;
mod causal_work_identity;
mod coordinator_objective_intake;
mod coordinator_results;
pub mod coordinator_status;
mod cultmesh_integration;
mod current_work;
mod hands_gateway;
mod imagination_consideration;
mod memory_graph;
mod mind_documents;
mod packaged_release;
mod persona_conversation;
mod persona_discord_crossing;
mod persona_discord_permit;
mod persona_feedback_admission;
mod persona_social_state;
mod persona_turn;
mod process_observation;
mod public_source_identity;
mod reasoning_context;
mod reorientation_work;
mod repo_model_documents;
mod repo_model_gateway;
mod repository_body_observer;
mod resident_readiness;
mod resident_self;
mod runtime_spine;
mod runtime_store_backend;
mod runtime_worker_attempt;
mod soul_gateway;
mod state_ledger;
mod state_model;
mod substrate_gate;
mod surfaces;
pub use admitted_model_direction_consideration::{
AdmittedModelDirectionConsiderationRequest, AdmittedModelDirectionConsiderationResult,
AdmittedModelDirectionDisposition,
REQUEST_CONTRACT as ADMITTED_MODEL_DIRECTION_CONSIDERATION_REQUEST_CONTRACT,
REQUEST_SCHEMA as ADMITTED_MODEL_DIRECTION_CONSIDERATION_REQUEST_SCHEMA_VERSION,
RESULT_CONTRACT as ADMITTED_MODEL_DIRECTION_CONSIDERATION_RESULT_CONTRACT,
RESULT_SCHEMA as ADMITTED_MODEL_DIRECTION_CONSIDERATION_RESULT_SCHEMA_VERSION,
commit_request as commit_admitted_model_direction_consideration_request,
result_id_for_launch as admitted_model_direction_consideration_result_id_for_launch,
validate_current_request as validate_current_admitted_model_direction_consideration_request,
validate_request as validate_admitted_model_direction_consideration_request,
validate_result as validate_admitted_model_direction_consideration_result,
};
pub use agent_launch::EPIPHANY_IMAGINATION_OWNER_ROLE;
pub use agent_launch::EPIPHANY_IMAGINATION_ROLE_BINDING_ID;
pub use agent_launch::EPIPHANY_MIND_OWNER_ROLE;
pub use agent_launch::EPIPHANY_MIND_ROLE_BINDING_ID;
pub use agent_launch::EPIPHANY_MODELING_OWNER_ROLE;
pub use agent_launch::EPIPHANY_MODELING_ROLE_BINDING_ID;
pub use agent_launch::EPIPHANY_REORIENT_LAUNCH_BINDING_ID;
pub use agent_launch::EPIPHANY_REORIENT_OWNER_ROLE;
pub use agent_launch::EPIPHANY_RESEARCH_OWNER_ROLE;
pub use agent_launch::EPIPHANY_RESEARCH_ROLE_BINDING_ID;
pub use agent_launch::EPIPHANY_VERIFICATION_OWNER_ROLE;
pub use agent_launch::EPIPHANY_VERIFICATION_ROLE_BINDING_ID;
pub use agent_launch::epiphany_admitted_model_direction_consideration_output_schema;
pub use agent_launch::epiphany_frontier_plan_mind_output_schema;
pub use agent_launch::epiphany_frontier_planning_output_schema;
pub use agent_launch::epiphany_frontier_verdict_modeling_output_schema;
pub use agent_launch::epiphany_imagination_consideration_output_schema;
pub use agent_launch::epiphany_proposal_modeling_output_schema;
pub use agent_launch::epiphany_reorient_launch_output_schema;
pub use agent_launch::epiphany_role_label;
pub use agent_launch::epiphany_role_launch_output_schema;
pub use atlas::*;
pub(crate) use causal_work_identity::*;
pub use coordinator_objective_intake::UserObjectiveIntake;
pub use coordinator_objective_intake::UserObjectiveIntakeApplied;
pub use coordinator_objective_intake::UserObjectiveIntakeInput;
pub use coordinator_objective_intake::intake_user_objective;
pub use coordinator_results::EpiphanyCoordinatorReorientResultSnapshot;
pub use coordinator_results::EpiphanyReorientResultStatus;
pub use coordinator_results::read_runtime_reorient_result;
pub use cultcache_rs::CacheBackingStore;
pub use cultcache_rs::CultCache;
pub use cultcache_rs::CultCacheEnvelope;
pub use cultcache_rs::DatabaseEntry;
pub use cultcache_rs::OwnedRedbMessagePackBackingStore;
pub use cultcache_rs::PushAllOptions;
pub use cultcache_rs::RedbMessagePackBackingStore;
pub use cultcache_rs::SingleFileMessagePackBackingStore;
pub use cultmesh_integration::EPIPHANY_CANONICAL_SWARM_BRAKE_ID;
pub use cultmesh_integration::EPIPHANY_CANONICAL_SWARM_BRAKE_OWNER;
pub use cultmesh_integration::{
EPIPHANY_CULTMESH_SWARM_BRAKE_KEY, EPIPHANY_CULTMESH_SWARM_BRAKE_SCHEMA_VERSION,
EPIPHANY_CULTMESH_SWARM_BRAKE_TYPE, EpiphanyCultMeshDocuments, EpiphanyCultMeshSwarmBrakeEntry,
default_epiphany_cultmesh_swarm_brake, engage_epiphany_cultmesh_swarm_brake,
load_epiphany_cultmesh_swarm_brake, open_epiphany_cultmesh_node,
release_epiphany_cultmesh_swarm_brake, write_epiphany_cultmesh_swarm_brake,
};
pub use current_work::*;
pub use hands_gateway::*;
pub use imagination_consideration::{
CANDIDATE_CONTRACT as IMAGINATION_CONSIDERATION_CANDIDATE_CONTRACT,
CANDIDATE_SCHEMA as IMAGINATION_CONSIDERATION_CANDIDATE_SCHEMA_VERSION,
ImaginationConsiderationCandidate, ImaginationConsiderationDisposition,
ImaginationConsiderationQuestion, ImaginationConsiderationRequest,
ImaginationConsiderationReviewRoute, ImaginationOptionDraft, QuotedPersonaFeedbackEvidence,
REQUEST_CONTRACT as IMAGINATION_CONSIDERATION_REQUEST_CONTRACT,
REQUEST_SCHEMA as IMAGINATION_CONSIDERATION_REQUEST_SCHEMA_VERSION,
candidate_id_for_launch as imagination_consideration_candidate_id_for_launch,
commit_request as commit_imagination_consideration_request,
render_consideration_prompt as render_imagination_consideration_prompt,
validate_candidate as validate_imagination_consideration_candidate,
validate_current_request as validate_current_imagination_consideration_request,
};
pub use memory_graph::EpiphanyMemoryGraphValidationError;
pub use memory_graph::validate_memory_graph_snapshot;
pub use mind_documents::*;
pub use packaged_release::{
EPIPHANY_PACKAGED_RELEASE_HEAD_SCHEMA_VERSION, EPIPHANY_PACKAGED_RELEASE_SCHEMA_VERSION,
EPIPHANY_PACKAGED_RELEASE_WITNESS_FILE, EpiphanyPackagedReleaseBinary,
EpiphanyPackagedReleaseEntry, EpiphanyPackagedReleaseHead, PackageReleaseRequest,
authenticate_epiphany_packaged_release, epiphany_packaged_release_binary_path,
epiphany_packaged_release_witness_sha256, inspect_epiphany_packaged_release_witness,
package_epiphany_release, publish_epiphany_packaged_release,
};
pub use persona_conversation::*;
pub use persona_discord_crossing::*;
pub use persona_discord_permit::*;
pub use persona_feedback_admission::{
BIFROST_PERSONA_FEEDBACK_ADMISSION_SCHEMA_VERSION, BIFROST_PERSONA_FEEDBACK_DELIVERY_TYPE,
BifrostPersonaFeedbackAdmission, LOCAL_PERSONA_FEEDBACK_SCHEMA_VERSION,
LocalAdmittedPersonaFeedback, PERSONA_FEEDBACK_SOCIAL_ADMISSION_SCHEMA_VERSION,
PersonaFeedbackPacket, PersonaFeedbackSocialAdmissionReceipt, admit_persona_feedback_to_social,
admitted_persona_feedback, import_bifrost_persona_feedback_deliveries,
persona_feedback_ready_for_cognition, validate_persona_feedback_store_separation,
};
pub use persona_social_state::*;
pub use persona_turn::PERSONA_INTERPRETER_EFFECT_DOCUMENT_SCHEMA_VERSION;
pub use persona_turn::PERSONA_INTERPRETER_EFFECT_SET_SCHEMA_VERSION;
pub use persona_turn::PERSONA_INTERPRETER_PROMPT_SCHEMA_VERSION;
pub use persona_turn::PERSONA_MODEL_STAGE_RECEIPT_SCHEMA_VERSION;
pub use persona_turn::PERSONA_MODEL_TERMINAL_RECEIPT_SCHEMA_VERSION;
pub use persona_turn::PERSONA_PROJECTOR_PROMPT_SCHEMA_VERSION;
pub use persona_turn::PERSONA_TURN_PROMPT_SCHEMA_VERSION;
pub use persona_turn::PersonaIdentity;
pub use persona_turn::PersonaInterpreterEffect;
pub use persona_turn::PersonaInterpreterEffectDocument;
pub use persona_turn::PersonaInterpreterEffectSet;
pub use persona_turn::PersonaInterpreterInput;
pub use persona_turn::PersonaModelStageReceipt;
pub use persona_turn::PersonaModelTerminalReceipt;
pub use persona_turn::PersonaProjectorInput;
pub use persona_turn::PersonaRepoActivity;
pub use persona_turn::PersonaSocialAffordance;
pub use persona_turn::PersonaTranscriptMessage;
pub use persona_turn::PersonaTurnInput;
pub use persona_turn::build_persona_interpreter_prompt;
pub use persona_turn::build_persona_projector_prompt_with_transcript;
pub use persona_turn::build_persona_turn_prompt;
pub use persona_turn::parse_and_validate_persona_interpreter_effect_set;
pub use persona_turn::persona_interpreter_effect_set_json_schema;
pub use persona_turn::put_persona_terminal_decision;
pub use process_observation::ProcessInstanceIdentity;
pub use process_observation::ProcessInstanceObservation;
pub use process_observation::capture_process_instance;
pub use process_observation::native_boot_identity;
pub use process_observation::observe_process_instance;
pub use process_observation::reap_exited_child_process;
pub use process_observation::terminate_process_instance;
pub use public_source_identity::ImmutableGithubSource;
pub use reasoning_context::*;
pub use reorientation_work::*;
pub use repo_model_documents::*;
pub use repo_model_gateway::*;
pub use repository_body_observer::*;
pub use resident_readiness::*;
pub use resident_self::*;
pub use runtime_spine::COORDINATOR_RUN_RECEIPT_TYPE;
pub use runtime_spine::EPIPHANY_RUNTIME_ROOT_SESSION_ID;
pub use runtime_spine::EpiphanyArchivedRuntimeWorkerAttempt;
pub use runtime_spine::EpiphanyArchivedRuntimeWorkerDecision;
pub use runtime_spine::EpiphanyCoordinatorDeathRecovery;
pub use runtime_spine::EpiphanyCoordinatorRunBasis;
pub use runtime_spine::EpiphanyCoordinatorRunReceipt;
pub use runtime_spine::EpiphanyCoordinatorRunTerminality;
pub use runtime_spine::EpiphanyRuntimeIdentity;
pub use runtime_spine::EpiphanyRuntimeJob;
pub use runtime_spine::EpiphanyRuntimeJobStatus;
pub use runtime_spine::EpiphanyRuntimeModelExecutionBinding;
pub use runtime_spine::EpiphanyRuntimeReorientWorkerResult;
pub use runtime_spine::EpiphanyRuntimeRoleWorkerResult;
pub use runtime_spine::EpiphanyRuntimeSession;
pub use runtime_spine::EpiphanyRuntimeSessionStatus;
pub use runtime_spine::EpiphanyRuntimeSwarmBinding;
pub use runtime_spine::EpiphanyRuntimeToolExecutionBinding;
pub use runtime_spine::EpiphanyRuntimeWorkerLaunchRequest;
pub use runtime_spine::EpiphanyRuntimeWorkerProcessClaim;
pub use runtime_spine::ModelPassFailureTerminalOptions;
pub use runtime_spine::RUNTIME_IDENTITY_KEY;
pub use runtime_spine::RUNTIME_IDENTITY_TYPE;
pub use runtime_spine::RUNTIME_SPINE_SCHEMA_VERSION;
pub use runtime_spine::RUNTIME_SWARM_BINDING_KEY;
pub use runtime_spine::RUNTIME_SWARM_BINDING_SCHEMA_VERSION;
pub use runtime_spine::RepoFrontierResearchContinuationAction;
pub use runtime_spine::RepoFrontierResearchLifecycle;
pub use runtime_spine::RepoFrontierResearchLifecycleStage;
pub use runtime_spine::RepoFrontierVerdictModelingLaunchAuthority;
pub use runtime_spine::RuntimeSpineHeartbeatJobOptions;
pub use runtime_spine::RuntimeSpineInitOptions;
pub use runtime_spine::RuntimeSpineJobOptions;
pub use runtime_spine::abandon_unactivated_runtime_worker_process;
pub use runtime_spine::activate_runtime_worker_process;
pub use runtime_spine::bind_runtime_repository_domain;
pub use runtime_spine::bind_runtime_to_swarm;
pub use runtime_spine::canonical_repo_frontier_plan_candidate_id;
pub use runtime_spine::claim_runtime_worker_process;
pub use runtime_spine::close_runtime_session;
pub use runtime_spine::commit_repo_frontier_plan_decision;
pub use runtime_spine::commit_repo_frontier_plan_mind_request;
pub use runtime_spine::coordinator_run_receipts;
pub use runtime_spine::coordinator_run_session_id;
pub use runtime_spine::finalize_coordinator_run;
pub use runtime_spine::initialize_runtime_spine;
pub use runtime_spine::model_pass_failure_for_request;
pub use runtime_spine::open_coordinator_run;
pub use runtime_spine::open_runtime_model_execution;
pub use runtime_spine::prepare_runtime_spine_heartbeat_job;
pub(crate) use runtime_spine::promote_autonomous_direction_options_for_modeling;
pub use runtime_spine::put_hands_action_intent;
pub use runtime_spine::put_hands_command_receipt;
pub use runtime_spine::put_hands_commit_receipt;
pub use runtime_spine::put_hands_patch_receipt;
pub use runtime_spine::put_repo_frontier_hands_authority;
pub use runtime_spine::put_runtime_reorient_worker_result;
pub use runtime_spine::put_runtime_requested_public_source_intents;
pub use runtime_spine::put_runtime_role_worker_result;
pub use runtime_spine::put_runtime_tool_execution_intent;
pub use runtime_spine::put_runtime_tool_execution_receipt;
pub use runtime_spine::put_substrate_gate_repo_access_grant_receipt;
pub use runtime_spine::require_runtime_tool_execution_binding;
pub use runtime_spine::retain_completed_runtime_sessions;
pub use runtime_spine::retain_failed_runtime_worker_attempts;
pub use runtime_spine::retain_fulfilled_runtime_worker_attempts;
pub use runtime_spine::review_repo_frontier_planning_failure;
pub use runtime_spine::runtime_identity;
pub use runtime_spine::runtime_job;
pub use runtime_spine::runtime_reorient_worker_result;
pub use runtime_spine::runtime_repo_frontier_planning_lifecycle;
pub use runtime_spine::runtime_requested_public_source_refs_for_worker;
pub use runtime_spine::runtime_role_worker_result;
pub use runtime_spine::runtime_spine_cache;
pub(crate) use runtime_spine::runtime_typed_request_attempt_exists;
pub use runtime_spine::runtime_worker_launch_request;
pub use runtime_spine::runtime_worker_process_claim;
pub use runtime_spine::runtime_worker_process_claims;
pub use runtime_spine::select_and_commit_repo_frontier_planning_request;
pub(crate) use runtime_spine::select_and_commit_repo_frontier_research_request;
pub use runtime_spine::select_and_commit_repo_frontier_route;
pub use runtime_spine::terminalize_model_pass_failure_session;
pub use runtime_spine::terminalize_runtime_job;
pub(crate) use runtime_worker_attempt::{RuntimeTypedRequestRef, WorkerProcessStatus};
pub use soul_gateway::*;
pub use state_ledger::EpiphanyBranchRecord;
pub use state_ledger::EpiphanyLedgerEvidenceRecord;
pub use state_ledger::EpiphanyStateLedgerEntry;
pub use state_ledger::add_state_branch;
pub use state_ledger::append_state_evidence;
pub use state_ledger::close_state_branch;
pub use state_ledger::load_state_ledger;
pub use state_model::*;
pub use substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_SCHEMA_VERSION;
pub use substrate_gate::SubstrateGateRepoAccessGrantReceipt;
pub use substrate_gate::substrate_gate_coordinator_implementation_grant;
pub use substrate_gate::substrate_gate_operation_for_governed_tool;
pub use substrate_gate::substrate_gate_repo_access_grant_for_worker;
pub use surfaces::AdmittedModelDirectionConsiderationContextProjection;
pub use surfaces::EpiphanyCoordinatorAction;
pub use surfaces::EpiphanyCoordinatorDecision;
pub use surfaces::EpiphanyCoordinatorInput;
pub use surfaces::EpiphanyCoordinatorRoleStatus;
pub use surfaces::EpiphanyReorientFindingInterpretation;
pub use surfaces::EpiphanyReorientWorkerLaunchDocument;
pub use surfaces::EpiphanyResearchDecision;
pub use surfaces::EpiphanyRoleBoardInput;
pub use surfaces::EpiphanyRoleBoardLane;
pub use surfaces::EpiphanyRoleFindingInterpretation;
pub use surfaces::EpiphanyRoleResultRoleId;
pub use surfaces::EpiphanyRoleWorkerLaunchDocument;
pub use surfaces::EpiphanyWorkerLaunchDocument;
pub use surfaces::ImaginationConsiderationContextProjection;
pub use surfaces::REORIENT_WORKER_OUTPUT_CONTRACT_ID;
pub use surfaces::REPO_FRONTIER_PLAN_MIND_CONTEXT_CONTRACT;
pub use surfaces::REPO_FRONTIER_PLAN_MIND_CONTEXT_SCHEMA_VERSION;
pub use surfaces::REPO_FRONTIER_PLANNING_CONTEXT_CONTRACT;
pub use surfaces::REPO_FRONTIER_PLANNING_CONTEXT_SCHEMA_VERSION;
pub use surfaces::REPO_FRONTIER_PROPOSAL_MODELING_CONTEXT_CONTRACT;
pub use surfaces::REPO_FRONTIER_PROPOSAL_MODELING_CONTEXT_SCHEMA_VERSION;
pub use surfaces::REPO_FRONTIER_RESEARCH_CONTEXT_CONTRACT;
pub use surfaces::REPO_FRONTIER_RESEARCH_CONTEXT_SCHEMA_VERSION;
pub use surfaces::REPO_FRONTIER_VERIFICATION_CONTEXT_CONTRACT;
pub use surfaces::REPO_FRONTIER_VERIFICATION_CONTEXT_SCHEMA_VERSION;
pub use surfaces::ROLE_WORKER_OUTPUT_CONTRACT_ID;
pub use surfaces::RepoFrontierPlanMindContextProjection;
pub use surfaces::RepoFrontierPlanningContextProjection;
pub use surfaces::RepoFrontierProposalModelingContextProjection;
pub use surfaces::RepoFrontierResearchContextProjection;
pub use surfaces::RepoFrontierVerificationContextProjection;
pub use surfaces::derive_role_board;
pub use surfaces::interpret_runtime_reorient_worker_result;
pub use surfaces::interpret_runtime_role_worker_result;
pub use surfaces::recommend_coordinator_action;
mod admitted_model_direction_consideration;