Fourth fix batch: fill N1 in its owner, and correct two ledger claims
N1 (medium-low). Moves the epiphany-pipeline pin to the leaf's new commit (9d3a3efd), which opens Slug::validate_slug. Huginn's own cultcache-rs pin is untouched; cargo tree -d still carries exactly one cultcache-rs. Mind::require_instance now validates the declared name's grammar before comparing identity, so admission's A1 and every read refuse a bad name identically, through one door. Mind::open and open_with validate the declared instance before path_for ever runs, so a Slug carrying `..` and a path separator (Soul's outer/inner probe) is refused before any store is created, not after it has already escaped the state root. require_grammatical_instance and its daemon-side branch in daemon.rs are deleted: the throwaway PipelineInstance wrapper it built is no longer the only door onto the leaf's grammar. The refusal now names the field a caller actually held the declared name under (declared, or instance) and the whole declared name, not the old wrapper's instance.instance field or a single failing label. Adds a leaf-escape regression test pinning Soul's probe and asserting no store is created, and a fullwidth-instance test showing Admit and Query refuse identically. Updates the cut10 grammar-fold mutant (S3wide) to the new function shape and the affected daemon test to the new field name. N5 and N6, prose only. The cut10 entries gain a note by S1 and S1d: neither mutant "dies on all three" faults its shared fixture carries, contrary to an earlier claim; S1d exempts the orphan fault by construction and is killed by the undecodable-document block instead, the next one the test body reaches. The cut9 header's self-contradiction at lines 18-25 is resolved (nothing in the suite exercises the door, not "nothing reaches it"), its self-reference now points at store.rs:18-19, and its line-1 range is corrected to V1-V24L. All three suites rerun clean after the pin move: cut8 67/67, cut9 38/38, cut10 65/65, every M0 green, restores hash-verified. cargo test --workspace: huginn-mind 61/61 (was 60), huginn-daemon 18/18 (was 17). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
7fc8ed3610
commit
cc71a569dc
7 changed files with 134 additions and 73 deletions
|
|
@ -163,38 +163,38 @@
|
|||
}
|
||||
@{
|
||||
Id = 'S3wide'
|
||||
Rule = 'The grammar check runs on the declared bytes as given: nothing folds a fullwidth character to its plain ASCII form before asking the leaf whether the name is grammatical.'
|
||||
Rule = 'The grammar check runs on the declared bytes as given: nothing folds a fullwidth character to its plain ASCII form before asking the leaf''s Slug::validate_slug whether the name is grammatical.'
|
||||
Test = 'daemon::tests::a_declared_instance_outside_the_grammar_is_refused_by_name_before_the_identity_check'
|
||||
Command = 'cargo test -p huginn-daemon --lib'
|
||||
File = 'crates/huginn-mind/src/mind.rs'
|
||||
Old = @'
|
||||
pub fn require_grammatical_instance(declared: &Slug) -> Result<(), MindRefusal> {
|
||||
let probe = PipelineDocument::Instance(PipelineInstance {
|
||||
instance: declared.clone(),
|
||||
display_name: Short("grammar-probe".into()),
|
||||
created_at: Date("2026-01-01".into()),
|
||||
host: Short("grammar-probe".into()),
|
||||
});
|
||||
probe.validate().map_err(MindRefusal::Document)
|
||||
fn require_grammatical_slug(field: &str, declared: &Slug) -> Result<(), MindRefusal> {
|
||||
declared.validate_slug().map_err(|_| {
|
||||
MindRefusal::Document(epiphany_pipeline::PipelineRefusal::InvalidFormat {
|
||||
field: field.into(),
|
||||
value: declared.0.clone(),
|
||||
})
|
||||
})
|
||||
}
|
||||
'@
|
||||
New = @'
|
||||
pub fn require_grammatical_instance(declared: &Slug) -> Result<(), MindRefusal> {
|
||||
let folded: String = declared
|
||||
.0
|
||||
.chars()
|
||||
.map(|c| match c as u32 {
|
||||
0xFF01..=0xFF5E => char::from_u32(c as u32 - 0xFEE0).unwrap_or(c),
|
||||
_ => c,
|
||||
fn require_grammatical_slug(field: &str, declared: &Slug) -> Result<(), MindRefusal> {
|
||||
let folded = Slug(
|
||||
declared
|
||||
.0
|
||||
.chars()
|
||||
.map(|c| match c as u32 {
|
||||
0xFF01..=0xFF5E => char::from_u32(c as u32 - 0xFEE0).unwrap_or(c),
|
||||
_ => c,
|
||||
})
|
||||
.collect(),
|
||||
);
|
||||
folded.validate_slug().map_err(|_| {
|
||||
MindRefusal::Document(epiphany_pipeline::PipelineRefusal::InvalidFormat {
|
||||
field: field.into(),
|
||||
value: declared.0.clone(),
|
||||
})
|
||||
.collect();
|
||||
let probe = PipelineDocument::Instance(PipelineInstance {
|
||||
instance: Slug(folded),
|
||||
display_name: Short("grammar-probe".into()),
|
||||
created_at: Date("2026-01-01".into()),
|
||||
host: Short("grammar-probe".into()),
|
||||
});
|
||||
probe.validate().map_err(MindRefusal::Document)
|
||||
})
|
||||
}
|
||||
'@
|
||||
}
|
||||
|
|
@ -577,6 +577,17 @@ pub fn require_grammatical_instance(declared: &Slug) -> Result<(), MindRefusal>
|
|||
}),
|
||||
'@
|
||||
}
|
||||
# S1 and S1d's fixture, `open_items_refuses_on_a_fault_inside_the_requested_campaign`,
|
||||
# runs three faults in one test body: an orphan receipt, an undecodable
|
||||
# document, and a document two receipts claim. N5, correcting an
|
||||
# earlier claim here: neither mutant "dies on all three". S1d's own
|
||||
# `New` exempts any detail containing "has no commit receipt" by
|
||||
# construction, so the orphan block never fails under it; the test
|
||||
# panics at the very next block, the undecodable document, and never
|
||||
# reaches the third. S1 has no such exemption and is killed by the
|
||||
# same first block its own widened check reaches, the orphan. Each
|
||||
# mutant dies on the fault its own body actually mangles, not on all
|
||||
# three the fixture happens to carry.
|
||||
@{
|
||||
Id = 'S1'
|
||||
Rule = 'open_items refuses on a fault anywhere in the image it must read, not only on one outside the requested campaign.'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Cut 9 mutations, V1-V23: the read side's rules, each entry restoring one
|
||||
# Cut 9 mutations, V1-V24L: the read side's rules, each entry restoring one
|
||||
# permissiveness the cut closed and naming the test that must fail while it is
|
||||
# applied. A rule with two weakenings has two entries: `Vn` is the revert, the
|
||||
# rule simply absent, and `VnL` is the loosening, the rule weakened rather than
|
||||
|
|
@ -16,14 +16,12 @@
|
|||
# `eureka-cut8-mutations.psd1` -- one mutant, two suites, one owner.
|
||||
#
|
||||
# Two weakenings the spec names have no entry, not because they are
|
||||
# unreachable but because nothing on this Body's own public surface reaches
|
||||
# them today, which is a narrower claim than the one this header used to make.
|
||||
# "No behaviour this Body can reach" rested on admission being the only write
|
||||
# path, and that premise is false: `MindStore::compare_and_swap_batch` is
|
||||
# `pub`, and `store.rs`'s own re-export of `CacheBackingStore` already lets
|
||||
# code outside this crate push a row that skips A5 (and every other admission
|
||||
# rule) entirely, the same door the cut9 header's line 18-24 claim rested on.
|
||||
# Recorded as not yet reached, not as unreachable:
|
||||
# unreachable but because nothing in this suite exercises the path that would
|
||||
# reach them. `MindStore::compare_and_swap_batch` is `pub`, and `store.rs`'s
|
||||
# own re-export of `CacheBackingStore` already lets code outside this crate
|
||||
# push a row that skips A5 (and every other admission rule) entirely -- the
|
||||
# door named at `store.rs:18-19`. Recorded as not yet reached, not as
|
||||
# unreachable:
|
||||
#
|
||||
# - `assignments_of` comparing the repo and ignoring the instance. A5 refuses
|
||||
# a stewardship naming another instance for every row admission writes, so
|
||||
|
|
|
|||
Loading…
Reference in a new issue