Read an instance key back as an instance id

Soul F3. `pipeline_key` made the instance a root and `pipeline_id` was left
behind: it special-cased `campaign` alone and demanded three `:` segments of
everything else, so `PipelineRef { kind: Instance, id: "yggdrasil" }` was
refused as `InvalidFormat` and no resolution could ever take an instance as its
subject. The reader now knows both roots.

Nothing caught it because the key tests assert strings and never read one back.
`keys_read_back_as_ids_of_their_kind` walks every sample, keys it, and parses
the key back as an id of its kind; a resolution is the one kind whose key is
not an id of itself, so its subject is what reads back.

That test also carries Soul F2, which was Soul's surviving mutation: the
instance root's slug was validated nowhere the key could see, so an instance
named `thought cage` keyed to `thought cage` -- a store key holding a byte no
`Label` may carry. Stewardship and hand-off validate every slug they key by;
the instance now does too, and M14 is Soul's survivor turned into an entry.
M15 puts the shipped reader back.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-16 12:16:50 +02:00
commit b6f6e8023c
2 changed files with 73 additions and 5 deletions

View file

@ -189,6 +189,30 @@ fn runtime_spine_schema_cache() -> Result<CultCache> {
Test = 'tests::stewardship_key_escapes_the_repo_slash'
Old = ' Ok(repo.0.replace(''_'', "__").replace(''/'', "_-"))'
New = ' Ok(repo.0.replace(''/'', "_"))'
},
# Soul F2, which is Soul's own survivor. Stewardship and hand-off validate
# every slug they key by; the instance root did not, so a `Slug` reached the
# key unchecked and `thought cage` composed a store key carrying a space.
@{
Id = 'M14'
Package = $pipeline
File = $documents
Rule = 'An instance''s slug is validated where its key is composed.'
Test = 'tests::keys_read_back_as_ids_of_their_kind'
Old = ' dotted_text("instance.instance", &value.instance.0)?;'
New = ' let _ = &value.instance.0;'
},
# Soul F3. The key writer made the instance a root and the id reader was
# left behind, so an instance key would not read back as an instance id and
# no `PipelineRef` could name one. This is the reader as the cut shipped it.
@{
Id = 'M15'
Package = $pipeline
File = $documents
Rule = 'The id reader knows the same roots the key writer does.'
Test = 'tests::keys_read_back_as_ids_of_their_kind'
Old = ' if matches!(kind, PipelineKind::Campaign | PipelineKind::Instance) {'
New = ' if kind == PipelineKind::Campaign {'
}
)