diff --git a/native/aetherlight/src/lens.rs b/native/aetherlight/src/lens.rs index c14de9d8e..ae3f39a8a 100644 --- a/native/aetherlight/src/lens.rs +++ b/native/aetherlight/src/lens.rs @@ -65,7 +65,7 @@ impl Lens { } } - /// Existing `PATCH_TOOLS` names in emphasis order. Emphasis is prompt text + /// Existing patch tool names in emphasis order. Emphasis is prompt text /// only: the catalog, its order, and its schemas are the same for every lens. pub(crate) fn leads_with(self) -> &'static [&'static str] { match self { @@ -225,7 +225,6 @@ pub(crate) fn draw( #[cfg(test)] mod tests { use super::*; - use crate::patch::PATCH_TOOLS; use crate::tests::stock_weights; use std::collections::BTreeSet; @@ -244,23 +243,6 @@ mod tests { counts } - #[test] - fn every_lead_names_a_patch_tool() { - let catalog: BTreeSet<&str> = PATCH_TOOLS.iter().map(|entry| entry.name).collect(); - for lens in Lens::ALL { - let leads = lens.leads_with(); - assert!(!leads.is_empty(), "{lens:?} leads with nothing"); - let distinct: BTreeSet<&str> = leads.iter().copied().collect(); - assert_eq!(distinct.len(), leads.len(), "{lens:?} repeats a lead"); - for name in leads { - assert!( - catalog.contains(name), - "{lens:?} leads with unknown tool {name}" - ); - } - } - } - #[test] fn the_draw_is_a_function_of_world_and_session() { let weights = stock_weights(); diff --git a/native/aetherlight/src/lib.rs b/native/aetherlight/src/lib.rs index 3f64965c6..ca84c51a4 100644 --- a/native/aetherlight/src/lib.rs +++ b/native/aetherlight/src/lib.rs @@ -1,4 +1,4 @@ -//! The Ghostlight world library. +//! The Aetherlight world library, a fork of Ghostlight c43eb54 (see `PROVENANCE.md`). //! //! The world owner is one deterministic authority: authenticated commands enter, //! one reducer decides, and one journal atomically commits the resulting state. @@ -16,118 +16,84 @@ //! stand exactly where a consumer stands. //! //! ```compile_fail,E0603 -//! use ghostlight::WorldKernel; +//! use aetherlight::WorldKernel; //! ``` //! //! ```compile_fail,E0603 -//! use ghostlight::reduce; +//! use aetherlight::reduce; //! ``` //! //! ```compile_fail,E0603 -//! use ghostlight::WorldState; +//! use aetherlight::WorldState; //! ``` //! //! ```compile_fail,E0603 -//! use ghostlight::CommandEnvelope; +//! use aetherlight::CommandEnvelope; //! ``` //! //! ```compile_fail,E0603 -//! use ghostlight::AuthenticatedCaller; +//! use aetherlight::AuthenticatedCaller; //! ``` //! //! ```compile_fail,E0603 -//! use ghostlight::journal::WorldJournal; +//! use aetherlight::journal::WorldJournal; //! ``` //! //! ```compile_fail,E0599 -//! let _ = ghostlight::SubjectId::issue(); +//! let _ = aetherlight::SubjectId::issue(); //! ``` //! //! ```compile_fail,E0603 -//! let _ = ghostlight::ScopeDigest::fixture("x"); +//! let _ = aetherlight::ScopeDigest::fixture("x"); //! ``` //! //! ```compile_fail,E0425 -//! let _ = ghostlight::fixture_controller_opportunities(&[]); +//! let _ = aetherlight::fixture_controller_opportunities(&[]); //! ``` //! //! ```compile_fail,E0425 -//! let _ = ghostlight::fixture_inference_output("prose", "receipt"); +//! let _ = aetherlight::fixture_inference_output("prose", "receipt"); //! ``` +// The kernel has no entry point until AL4 adds the ABI, so most of it is unreachable +// from the public surface. AL4 removes this attribute. +#![allow(dead_code)] + mod action; -mod aetheria; mod clock; -mod consumer; -mod controllers; mod cover; -mod elaboration; mod grammar; #[cfg(test)] mod import_key_tests; mod journal; mod lens; -mod local_inference; -mod mailbox; mod patch; -mod sdk_inference; -mod table; -mod tool_schema; -mod vault; -mod verse; pub(crate) use action::ActionMismatch; pub(crate) use clock::Motion; pub use clock::{FictionalMinutes, TickMinutes}; -pub use consumer::{ - CONSUMER_BODY_LIMIT, CONSUMER_CREDENTIALS_ENVIRONMENT, CONSUMER_PATCH_SCHEMA, - CONSUMER_RECEIPT_SCHEMA, ConsumerRegistry, admit_document, encode_receipt, -}; -pub use controllers::{ - CONTROLLER_WORK_SCHEMA, CellRun, ConnectorBinding, ControllerError, ControllerModels, - ControllerOpenError, - ControllerNeed, ControllerPendingReason, ControllerRunner, ControllerWork, - ControllerWorkCustody, ControllerWorkLookup, ControllerWorkStore, ControllerWorkStoreError, - ControllerWorkWrite, - GroupedCheckpoint, InferenceEvent, InferenceFault, InferenceFaultClass, InferenceFaultDisposition, InferenceOutput, - InferencePort, - InferencePurpose, InferenceRequest, NarrativeCheckpoint, NarrativeRun, OperationalCheckpoint, - OperationalRun, PersonaLane, PreparedInference, SubmissionDisposition, TokenUsage, ToolResultOracle, - TracingInferencePort, open_controller_work, open_inference, -}; -pub(crate) use cover::{CellId, Constituent, Resolution}; -pub use aetheria::{ - AetheriaCatalog, AetheriaFaction, CatalogReadError, VerbRule, read_aetheria_catalog, -}; pub use cover::{AgencyGraph, Cell, Cover, CoverBudget, CoverBudgetError, TickIndex, derive_cover}; -pub use elaboration::{ - ElaborationCheckpoint, ElaborationRunner, ElaboratorSession, EvidenceError, EvidenceQuery, - EvidenceReceipt, EvidenceSource, SeedCheckpoint, SeedOutcome, SeedRunner, select_row, -}; pub use grammar::{ GrammarBinding, GrammarError, GrammarIdentity, GrammarReferentKind, GrammarRole, GrammarVerb, RenderPath, }; pub use lens::{Lens, LensWeights}; -pub use local_inference::{DEFAULT_HOSTED_MODEL_PREFIX, DEFAULT_LOCAL_MODEL_PREFIX, HostedBinding, LocalBinding}; -#[cfg(feature = "test-support")] -pub use local_inference::open_local_port_with_timeout; -pub(crate) use mailbox::ElaborationPort; -pub use mailbox::{ConsumerPort, ControllerPort, MailboxError, PlayPort, SeedPort, WorldMailbox}; pub use patch::{ CommitmentKey, DraftHandle, JurisdictionKey, Mismatch, PatchAnswer, Ref, RefKind, RefName, Role, Site, Statement, WorldPatch, }; pub(crate) use patch::{ AccessKind, Affordance, Audience, AuthoredSource, AuthorityGrant, AuthorityTarget, - BoundPrecondition, Bounds, ChannelRecord, Commitment, CommitmentKind, Confidence, Cost, - Declaration, DependencyTarget, EntityDeclaration, EntityKind, EvidenceRef, FactRecord, + BoundPrecondition, ChannelRecord, Commitment, CommitmentKind, Confidence, Cost, + DependencyTarget, EntityKind, EvidenceRef, FactRecord, FactStanding, Forum, GrievanceKindName, Knowledge, KnowledgeSource, Office, OfficeName, PersonaMaterial, Position, PressureMagnitude, PressureSource, Quantity, Reach, - SubjectDeclaration, WorldScaleIntent, WorldScaleIntentRef, + WorldScaleIntent, WorldScaleIntentRef, }; pub use patch::ImportKey; #[cfg(test)] +pub(crate) use patch::{Bounds, Declaration, EntityDeclaration, SubjectDeclaration}; +#[cfg(test)] use patch::{ AffordanceDeclaration, AudienceRef, AudienceSpec, ChannelDeclaration, ComponentOp, DependencyRef, FactDeclaration, FactStandingRef, ReachRef, RouteDeclaration, @@ -137,20 +103,6 @@ pub(crate) use patch::{ AffordanceKindName, AuthorityGrantRef, AuthorityKindName, AuthorityTargetRef, ComponentOpKind, EffectSlot, OutcomeBand, Precondition, RoleSpec, }; -pub use sdk_inference::{DEFAULT_SDK_MODEL_PREFIX, SdkBinding}; -pub use table::{ - DecodedBatch, PatchSite, TableError, actor_tools, authoring_tools, decode_actor_call, - decode_authoring_call, decode_authoring_calls, describe_refusal, describe_refusal_to_actor, - id_text, id_text_matches, table_view, -}; -pub use vault::{VaultError, VaultEvidenceSource}; -pub use verse::{ - CALL_RECORD_SCHEMA, CallRecordError, CallRecordStore, CreateVerseWorldIntent, ProviderCallRecord, - RUN_RECORD_SCHEMA, RecordedCoverBudget, RecordingInferencePort, Refusal, RefusalReason, RunClaim, - ReplayInferencePort, RunField, RunId, RunOutcome, RunStart, RunStatus, TickCheckpoint, - TickReport, UnattributedCall, VerseGenesisError, VerseRunConfig, VerseRunError, VerseRunRecord, VerseRunStore, - call_run_id, run_manual, -}; use patch::{EdgeRecord, EntityRecord, LedgerDelta, ResolvedOp, ResolvedPatch}; use chrono::{DateTime, Utc}; @@ -4956,7 +4908,7 @@ fn confine_to_ground( } let mut mismatches = Vec::new(); - let mut confine_subject = |site: &Site, subject: SubjectId, mismatches: &mut Vec| { + let confine_subject = |site: &Site, subject: SubjectId, mismatches: &mut Vec| { let admitted = match held { PatchGround::Jurisdiction(jurisdiction) => { match positions.get(&subject).copied().flatten() { @@ -4974,7 +4926,7 @@ fn confine_to_ground( mismatches.push(Mismatch::OutsideJurisdiction { site: site.clone() }); } }; - let mut confine_place = |site: &Site, place: EntityId, mismatches: &mut Vec| { + let confine_place = |site: &Site, place: EntityId, mismatches: &mut Vec| { if !inside(place) { mismatches.push(Mismatch::OutsideJurisdiction { site: site.clone() }); } diff --git a/native/aetherlight/src/patch.rs b/native/aetherlight/src/patch.rs index 31485e2d6..06f4dd936 100644 --- a/native/aetherlight/src/patch.rs +++ b/native/aetherlight/src/patch.rs @@ -12,15 +12,12 @@ //! after that set is empty, so a rejected patch never mints an ID. use super::clock::{FictionalMinutes, TickMinutes}; -use super::tool_schema; use super::grammar::GrammarRefusal; use super::{ AffordanceId, CommandId, ControllerAssignment, ControllerId, EdgeId, EntityId, LensWeights, NewController, SubjectId, SubjectKind, SubjectState, WorldId, }; -use codex_connector::CodexToolDefinition; use serde::{Deserialize, Serialize}; -use serde_json::{Value, json}; use sha2::{Digest, Sha256}; use std::collections::{BTreeMap, BTreeSet, btree_map::Entry}; use unicode_properties::{GeneralCategory, UnicodeGeneralCategory}; @@ -5374,7 +5371,7 @@ pub(super) fn resolve_patch( }); } allocated_subjects.insert(input.handle.clone(), subject_id); - let mut controller_id = || { + let controller_id = || { ControllerId(derive_id( CONTROLLER_NAMESPACE, world_id,