elaboration focus: one owner of a subject's place; pin it and standing_place

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-12-03 11:22:14 +01:00
commit b423a334fc
2 changed files with 25 additions and 14 deletions

View file

@ -14954,6 +14954,29 @@ assert!(projector_text.contains("I ask about the hinge."), "the player's own tur
task.await.unwrap();
}
/// A subject's place is the position it stands in, by its own id: the one
/// owner the claim order, the jurisdiction cover and the Dungeon's focus
/// read.
#[tokio::test]
async fn a_subjects_place_is_where_it_stands() {
let (_directory, mailbox, task, commons, _roads) = dead_end_world(
crate::tests::stock_weights(),
&["The Unwalked Road"],
Roots::None,
0,
)
.await;
let snapshot = mailbox.snapshot().await.unwrap();
let subject = snapshot.subjects.first().expect("the fixture's subject").id;
assert_eq!(snapshot.place_of(subject), Some(commons));
assert_eq!(snapshot.standing_place(subject), Some("The Commons"));
let stranger = SubjectId::issue();
assert_eq!(snapshot.place_of(stranger), None);
assert_eq!(snapshot.standing_place(stranger), None);
drop(mailbox);
task.await.unwrap();
}
/// With one session allowed, the sweep spends it on the dead end the focus
/// names, not the first the kernel lists.
#[tokio::test]

View file

@ -1020,13 +1020,7 @@ pub(super) fn claim_order(snapshot: &WorldSnapshot, focus: &Focus) -> Vec<PatchA
/// jurisdiction root. Demand with no place, the uncovered residual, sits
/// nowhere and is never in focus.
fn answer_place(snapshot: &WorldSnapshot, answer: &PatchAnswer) -> Option<EntityId> {
let subject_place = |subject: SubjectId| {
snapshot
.subjects
.iter()
.find(|row| row.id == subject)
.and_then(|row| row.position)
};
let subject_place = |subject: SubjectId| snapshot.place_of(subject);
match answer {
PatchAnswer::Deficit(JurisdictionKey::PlaceSubtree(root)) => Some(*root),
PatchAnswer::Deficit(JurisdictionKey::Uncovered) => None,
@ -1147,13 +1141,7 @@ fn boundary_in(
jurisdiction: JurisdictionKey,
boundary: &CausalBoundary,
) -> bool {
let subject_place = |subject: SubjectId| {
snapshot
.subjects
.iter()
.find(|row| row.id == subject)
.and_then(|row| row.position)
};
let subject_place = |subject: SubjectId| snapshot.place_of(subject);
match jurisdiction {
JurisdictionKey::Uncovered => match boundary {
CausalBoundary::UnelaboratedDestination { .. } => false,