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:
parent
f90d408466
commit
4741d50898
3 changed files with 9 additions and 5 deletions
|
|
@ -253,7 +253,7 @@ pub(crate) fn authenticated_surface(
|
||||||
"stateBindings":[local_draft("subject_label", "string")],
|
"stateBindings":[local_draft("subject_label", "string")],
|
||||||
"children":[]
|
"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
|
// an authored `value`, because the lowering captures only a
|
||||||
// `value`, so a form left untouched here still submits.
|
// `value`, so a form left untouched here still submits.
|
||||||
json!({
|
json!({
|
||||||
|
|
|
||||||
|
|
@ -4048,7 +4048,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// PA.f164: `targets`, `jurisdictions`, and `brief` are all documented
|
/// 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`
|
/// choice, not a value nobody supplied. Before this fix, only `lens_weights`
|
||||||
/// carried an authored `value` the real lowering's own
|
/// carried an authored `value` the real lowering's own
|
||||||
/// `findAuthoredBindingValue` could capture without the field being typed
|
/// `findAuthoredBindingValue` could capture without the field being typed
|
||||||
|
|
@ -5480,6 +5480,7 @@ mod tests {
|
||||||
|
|
||||||
let world = current_world(&fixture.state).await.unwrap().unwrap();
|
let world = current_world(&fixture.state).await.unwrap().unwrap();
|
||||||
assert_eq!(world.phase, WorldPhase::Active);
|
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");
|
assert_eq!(world.revision, 2, "genesis, approval and activation are three commits");
|
||||||
|
|
||||||
let principal = owner_principal(&fixture).await;
|
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
|
/// differ only late in the string, or one key's two steps, never share an
|
||||||
/// id.
|
/// 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]
|
#[test]
|
||||||
fn begin_step_ids_depend_on_the_whole_key_and_the_step() {
|
fn begin_step_ids_depend_on_the_whole_key_and_the_step() {
|
||||||
let key = "123e4567-e89b-12d3-a456-426614174000";
|
let key = "123e4567-e89b-12d3-a456-426614174000";
|
||||||
let late = "123e4567-e89b-12d3-a456-426614174001";
|
let late = "123e4567-e89b-12d3-a456-426614174001";
|
||||||
assert_ne!(begin_step_id(key, BeginStep::Approve).unwrap(), begin_step_id(late, BeginStep::Approve).unwrap());
|
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_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_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());
|
assert_ne!(begin_step_id(key, BeginStep::Approve).unwrap(), CommandId::parse_uuid(key).unwrap());
|
||||||
|
|
|
||||||
|
|
@ -414,8 +414,8 @@ async fn genesis_under_another_command_id_finds_the_world_occupied() {
|
||||||
assert_eq!(after.state_digest, before.state_digest);
|
assert_eq!(after.state_digest, before.state_digest);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Evidence for the open question `ship-acts-are-not-speech`, pinning what the
|
/// Pins the standing phase A behaviour (ruling `ship-acts-speech-shaped-phase-a`):
|
||||||
/// phase A lowering does today: a ship verb is only admissible as an utterance,
|
/// the lowering admits a ship verb only as an utterance,
|
||||||
/// and committing it asserts a claim fact the room hears.
|
/// and committing it asserts a claim fact the room hears.
|
||||||
#[test]
|
#[test]
|
||||||
fn phase_a_ship_verbs_are_spoken_acts_in_the_room() {
|
fn phase_a_ship_verbs_are_spoken_acts_in_the_room() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue