Aetherlight AL2a.4: delete the genesis brief
Remove the brief string (prompt guidance for model lanes) from CreateWorld, CreateWorldIntent, WorldState, WorldEffect::WorldCreated, the snapshot and the journal's state-shape checks, with its replay test. The grammar test's absent-grammar-key control now reads the title key. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
58493253b6
commit
f17a8147f8
3 changed files with 1 additions and 51 deletions
|
|
@ -311,7 +311,7 @@ fn unbound_world_keeps_the_open_catalog() {
|
|||
let keys: std::collections::BTreeMap<String, serde::de::IgnoredAny> =
|
||||
rmp_serde::from_slice(&encoded).unwrap();
|
||||
assert!(!keys.contains_key("grammar"));
|
||||
assert!(keys.contains_key("brief"));
|
||||
assert!(keys.contains_key("title"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -496,12 +496,6 @@ pub(super) fn verify_state_shape(state: &WorldState) -> Result<(), JournalError>
|
|||
"world title is empty or noncanonical".into(),
|
||||
));
|
||||
}
|
||||
if state.brief.trim() != state.brief {
|
||||
return Err(JournalError::Corrupt("world brief is noncanonical".into()));
|
||||
}
|
||||
if state.brief.trim() != state.brief {
|
||||
return Err(JournalError::Corrupt("world brief is noncanonical".into()));
|
||||
}
|
||||
super::validate_principal(&state.owner).map_err(kernel_error)?;
|
||||
if state.subjects.is_empty()
|
||||
|| state.controller_assignments.len() != state.subjects.len()
|
||||
|
|
@ -1107,7 +1101,6 @@ mod tests {
|
|||
id: CommandId::new(),
|
||||
owner: owner.clone(),
|
||||
title: "Before".into(),
|
||||
brief: String::new(),
|
||||
patch: owner_patch(SubjectDeclaration {
|
||||
handle: DraftHandle::new("owner"),
|
||||
label: "Owner".into(),
|
||||
|
|
@ -1191,7 +1184,6 @@ mod tests {
|
|||
id: CommandId::new(),
|
||||
owner: owner.clone(),
|
||||
title: "Kharad".into(),
|
||||
brief: String::new(),
|
||||
patch: owner_patch(SubjectDeclaration {
|
||||
handle: DraftHandle::new("owner"),
|
||||
label: "Owner".into(),
|
||||
|
|
@ -1671,7 +1663,6 @@ mod tests {
|
|||
id: creation_id,
|
||||
owner: owner.clone(),
|
||||
title: "Admitted".into(),
|
||||
brief: String::new(),
|
||||
patch: owner_patch(SubjectDeclaration {
|
||||
handle: DraftHandle::new("owner"),
|
||||
label: "Owner".into(),
|
||||
|
|
|
|||
|
|
@ -359,9 +359,6 @@ struct CreateWorld {
|
|||
id: CommandId,
|
||||
owner: PrincipalId,
|
||||
title: String,
|
||||
/// The world's authored premise, in the owner's words. Every lane reads it
|
||||
/// as its guidance; nothing derives it and nothing writes it later.
|
||||
brief: String,
|
||||
patch: WorldPatch,
|
||||
/// Authored once, here, and never mutated: `CommandBody::AdmitPatch` carries
|
||||
/// no intent, so write-once is the command shape rather than a check.
|
||||
|
|
@ -378,9 +375,6 @@ struct CreateWorld {
|
|||
pub struct CreateWorldIntent {
|
||||
pub id: CommandId,
|
||||
pub title: String,
|
||||
/// The premise, verbatim from the owner. May be empty: a world with no
|
||||
/// brief is a deliberate choice, and its lanes then get no guidance.
|
||||
pub brief: String,
|
||||
pub human_subject_label: String,
|
||||
pub narrative_persona_label: Option<String>,
|
||||
pub operational_agent_label: Option<String>,
|
||||
|
|
@ -762,9 +756,6 @@ struct WorldState {
|
|||
phase: WorldPhase,
|
||||
owner: PrincipalId,
|
||||
title: String,
|
||||
/// Authored at creation and never mutated; the one prose the world says
|
||||
/// about itself, projected as guidance to every lane.
|
||||
brief: String,
|
||||
/// Bound by genesis and never written again; absent from a world with no
|
||||
/// grammar, so such a world's state and digests are what they were before
|
||||
/// grammars existed.
|
||||
|
|
@ -843,7 +834,6 @@ enum WorldEffect {
|
|||
WorldCreated {
|
||||
owner: PrincipalId,
|
||||
title: String,
|
||||
brief: String,
|
||||
resolved: ResolvedPatch,
|
||||
},
|
||||
PatchAdmitted {
|
||||
|
|
@ -1131,7 +1121,6 @@ pub struct WorldSnapshot {
|
|||
pub phase: WorldPhase,
|
||||
pub owner: PrincipalId,
|
||||
pub title: String,
|
||||
pub brief: String,
|
||||
/// The bound grammar's identity; none for a world with an open catalog.
|
||||
pub grammar: Option<GrammarIdentity>,
|
||||
pub draft_approvals: BTreeSet<PrincipalId>,
|
||||
|
|
@ -1355,7 +1344,6 @@ struct PreparedCreation {
|
|||
world_id: WorldId,
|
||||
owner: PrincipalId,
|
||||
title: String,
|
||||
brief: String,
|
||||
resolved: ResolvedPatch,
|
||||
}
|
||||
|
||||
|
|
@ -1371,7 +1359,6 @@ fn prepare_creation(
|
|||
return Err(KernelError::AuthenticationMismatch);
|
||||
}
|
||||
let title = normalize_title(&input.title)?;
|
||||
let brief = input.brief.trim().to_owned();
|
||||
// The world's own identity is not world structure, and it feeds every
|
||||
// derived ID, so it is minted before resolution rather than by it.
|
||||
let world_id = WorldId::issue();
|
||||
|
|
@ -1393,7 +1380,6 @@ fn prepare_creation(
|
|||
world_id,
|
||||
owner: input.owner.clone(),
|
||||
title,
|
||||
brief,
|
||||
resolved,
|
||||
command: input,
|
||||
})
|
||||
|
|
@ -1408,7 +1394,6 @@ impl WorldKernel {
|
|||
let effect = WorldEffect::WorldCreated {
|
||||
owner: prepared.owner,
|
||||
title: prepared.title,
|
||||
brief: prepared.brief,
|
||||
resolved: prepared.resolved,
|
||||
};
|
||||
let mut state = WorldState::genesis(world_id, &prepared.command, &effect)?;
|
||||
|
|
@ -1871,7 +1856,6 @@ impl WorldState {
|
|||
phase: WorldPhase::Draft,
|
||||
owner,
|
||||
title,
|
||||
brief: String::new(),
|
||||
grammar,
|
||||
draft_approvals: BTreeSet::new(),
|
||||
subjects: BTreeMap::new(),
|
||||
|
|
@ -1908,7 +1892,6 @@ impl WorldState {
|
|||
let WorldEffect::WorldCreated {
|
||||
owner,
|
||||
title,
|
||||
brief,
|
||||
resolved,
|
||||
} = effect
|
||||
else {
|
||||
|
|
@ -1927,7 +1910,6 @@ impl WorldState {
|
|||
// every other command. Deterministic allocation is what lets one
|
||||
// equality replace a field-by-field binding zip.
|
||||
let mut state = Self::empty(world_id, owner.clone(), title.clone(), command.grammar.clone());
|
||||
state.brief = brief.clone();
|
||||
let expected = patch::resolve_patch(
|
||||
&state,
|
||||
command.id,
|
||||
|
|
@ -3928,7 +3910,6 @@ fn snapshot(state: &WorldState) -> Result<WorldSnapshot, KernelError> {
|
|||
phase: state.phase,
|
||||
owner: state.owner.clone(),
|
||||
title: state.title.clone(),
|
||||
brief: state.brief.clone(),
|
||||
grammar: state.grammar.as_ref().map(GrammarBinding::identity),
|
||||
draft_approvals: state.draft_approvals.clone(),
|
||||
required_approvers: required_approvers(state),
|
||||
|
|
@ -5322,7 +5303,6 @@ mod tests {
|
|||
id,
|
||||
owner: owner(),
|
||||
title: title.into(),
|
||||
brief: String::new(),
|
||||
patch: WorldPatch {
|
||||
operations: Vec::new(),
|
||||
evidence: Vec::new(),
|
||||
|
|
@ -12626,25 +12606,6 @@ mod witness_tests {
|
|||
);
|
||||
}
|
||||
|
||||
/// The brief is the world's authored premise: trimmed at ingress, carried
|
||||
/// on the state and its snapshot, and identical after replay.
|
||||
#[test]
|
||||
fn the_world_brief_is_authored_once_trimmed_and_replayed() {
|
||||
let directory = tempfile::tempdir().unwrap();
|
||||
let path = directory.path().join("world.cc");
|
||||
let mut creation = creation(CommandId::new(), "Low Sere");
|
||||
creation.brief = " A dry basin town that owes its water to the gate above it. ".into();
|
||||
let (kernel, _) = WorldKernel::create(&path, creation, &auth_principal(owner())).unwrap();
|
||||
let created = kernel.snapshot().unwrap();
|
||||
assert_eq!(
|
||||
created.brief,
|
||||
"A dry basin town that owes its water to the gate above it."
|
||||
);
|
||||
drop(kernel);
|
||||
let reopened = WorldKernel::open(&path, created.world_id).unwrap();
|
||||
assert_eq!(reopened.snapshot().unwrap(), created);
|
||||
}
|
||||
|
||||
/// What a witness hands the narrative lane's interruption renderer. The
|
||||
/// renderer takes a subject's own `ScopeComponents` and its own knowledge
|
||||
/// rows and nothing else, so both of its inputs are pinned here rather than
|
||||
|
|
@ -14972,7 +14933,6 @@ mod clock_tests {
|
|||
let effect = WorldEffect::WorldCreated {
|
||||
owner: input.owner.clone(),
|
||||
title,
|
||||
brief: input.brief.clone(),
|
||||
resolved,
|
||||
};
|
||||
let error = WorldState::genesis(world_id, &input, &effect).unwrap_err();
|
||||
|
|
@ -15000,7 +14960,6 @@ mod clock_tests {
|
|||
let effect = WorldEffect::WorldCreated {
|
||||
owner: input.owner.clone(),
|
||||
title,
|
||||
brief: input.brief.clone(),
|
||||
resolved,
|
||||
};
|
||||
let error = WorldState::genesis(world_id, &input, &effect).unwrap_err();
|
||||
|
|
|
|||
Loading…
Reference in a new issue