create-flow: pin the begun receipt's worldId and step-id key sensitivity; stale comments

Test-only plus comment text. The receipt's worldId is asserted against the
world Begin made; step ids are asserted to differ for keys differing only in
their first byte. Two comments cite BeginPayload, not the deleted
CreatePayload; the ship-verb test comment cites the standing ruling.
Trim mutants of the title, brief and name are equivalent: the kernel trims
title (normalize_title), brief (prepare_creation) and the subject label
(mailbox declare) itself.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-16 18:28:09 +02:00
commit 4741d50898
3 changed files with 9 additions and 5 deletions

View file

@ -253,7 +253,7 @@ pub(crate) fn authenticated_surface(
"stateBindings":[local_draft("subject_label", "string")],
"children":[]
}),
// `brief` is "required, may be empty" (`CreatePayload::brief`):
// `brief` is "required, may be empty" (`BeginPayload::brief`):
// an authored `value`, because the lowering captures only a
// `value`, so a form left untouched here still submits.
json!({

View file

@ -4048,7 +4048,7 @@ mod tests {
}
/// PA.f164: `targets`, `jurisdictions`, and `brief` are all documented
/// "required, may be empty" (`CreatePayload`) — a legitimate deliberate
/// "required, may be empty" (`BeginPayload`) — a legitimate deliberate
/// choice, not a value nobody supplied. Before this fix, only `lens_weights`
/// carried an authored `value` the real lowering's own
/// `findAuthoredBindingValue` could capture without the field being typed
@ -5480,6 +5480,7 @@ mod tests {
let world = current_world(&fixture.state).await.unwrap().unwrap();
assert_eq!(world.phase, WorldPhase::Active);
assert_eq!(begun["receipt"]["worldId"], serde_json::to_value(world.world_id).unwrap(), "the receipt names the world it made");
assert_eq!(world.revision, 2, "genesis, approval and activation are three commits");
let principal = owner_principal(&fixture).await;
@ -5521,12 +5522,15 @@ mod tests {
/// differ only late in the string, or one key's two steps, never share an
/// id.
///
/// Mutations: hash only a prefix of the key; hash no step name.
/// Mutations: hash only a prefix of the key; hash no step name; drop the key's first byte.
#[test]
fn begin_step_ids_depend_on_the_whole_key_and_the_step() {
let key = "123e4567-e89b-12d3-a456-426614174000";
let late = "123e4567-e89b-12d3-a456-426614174001";
assert_ne!(begin_step_id(key, BeginStep::Approve).unwrap(), begin_step_id(late, BeginStep::Approve).unwrap());
let early = "023e4567-e89b-12d3-a456-426614174000";
assert_ne!(begin_step_id(key, BeginStep::Approve).unwrap(), begin_step_id(early, BeginStep::Approve).unwrap());
assert_ne!(begin_step_id(key, BeginStep::Activate).unwrap(), begin_step_id(early, BeginStep::Activate).unwrap());
assert_ne!(begin_step_id(key, BeginStep::Approve).unwrap(), begin_step_id(key, BeginStep::Activate).unwrap());
assert_eq!(begin_step_id(key, BeginStep::Approve).unwrap(), begin_step_id(key, BeginStep::Approve).unwrap());
assert_ne!(begin_step_id(key, BeginStep::Approve).unwrap(), CommandId::parse_uuid(key).unwrap());

View file

@ -414,8 +414,8 @@ async fn genesis_under_another_command_id_finds_the_world_occupied() {
assert_eq!(after.state_digest, before.state_digest);
}
/// Evidence for the open question `ship-acts-are-not-speech`, pinning what the
/// phase A lowering does today: a ship verb is only admissible as an utterance,
/// Pins the standing phase A behaviour (ruling `ship-acts-speech-shaped-phase-a`):
/// the lowering admits a ship verb only as an utterance,
/// and committing it asserts a claim fact the room hears.
#[test]
fn phase_a_ship_verbs_are_spoken_acts_in_the_room() {