Correct accepted-output warning oracles

This commit is contained in:
2026-09-24 20:04:15 -07:00
parent 4872141c03
commit edf096cd33
2 changed files with 74 additions and 8 deletions
@@ -509,16 +509,36 @@ fn rich_oa_sa_swaps_unicode_crlf_complete_actual_bytes_and_models() {
.unwrap();
assert_eq!(accepted.bundle(), &expected);
assert_eq!(accepted.project(), &rich_desired(layer));
assert!(accepted.warnings().is_empty());
let (span, line) = if unicode {
(
Span {
start: 351,
end: 416,
},
7,
)
} else {
(
Span {
start: 338,
end: 403,
},
6,
)
};
assert_eq!(
accepted.warnings(),
leaf_work_warnings("main.arcadia", span, line)
);
assert_eq!(
accepted.retained(),
Slots {
entries: 3,
entries: 5,
occurrences: 0,
text: if unicode {
unicode_bytes + 42
unicode_bytes + 42 + 227
} else {
bytes + 42
bytes + 42 + 227
}
}
);
@@ -527,6 +547,21 @@ fn rich_oa_sa_swaps_unicode_crlf_complete_actual_bytes_and_models() {
}
}
}
fn leaf_work_warnings(path: &str, span: Span, line: usize) -> [SourceDiagnostic; 2] {
// Allocation validation precedes advisory coverage. Both locate the complete
// ordinary Work declaration; neither fixture supplies allocation or context.
[
("unallocated_leaf", Some("allocation"), "Allocate leaf 'Work' to a performer."),
("work_without_behavior_context", None, "Include this leaf activity/function in a process/chain or scenario through a work action or exchange occurrence."),
].map(|(code, field, message)| SourceDiagnostic {
path: path.into(), related: Vec::new(),
diagnostic: language::Diagnostic {
severity: validation::Severity::Warning, code: code.into(),
object_id: Some(id(2)), field: field.map(str::to_owned),
message: message.into(), span, line, column: 1,
},
})
}
fn calculation(p: &mut Project) -> &mut a::CalculationDefinition {
let a::DefinitionBody::Calculation(c) = &mut p.definitions.get_mut(&id(2)).unwrap().body else {
panic!("calculation")
@@ -794,14 +829,17 @@ fn four_file_cross_family_swap_preserves_entire_untouched_file_and_comments() {
.unwrap();
let pending = pending.verify().unwrap();
assert_eq!(pending.project(), &desired);
assert!(pending.warnings().is_empty());
assert_eq!(
pending.warnings(),
leaf_work_warnings("b.arcadia", Span { start: 25, end: 90 }, 2)
);
assert_eq!(pending.bundle, expected);
assert_eq!(
pending.retained,
Slots {
entries: 4,
entries: 6,
occurrences: 0,
text: 526
text: 526 + 221
}
);
}
@@ -52,7 +52,7 @@ geometry bit assertion. These are pre-execution authoring corrections, not
runtime failures. No prior tests or stack sizes are edited. Only touched Rust
files were directly formatted with skip_children; compiler, full prior outcome
comparison, Clippy, format and measured prologue/stack gates belong to the parent.
No runtime result is claimed in this implementation note.
No runtime result was claimed at that initial handoff; see the correction below.
The selected retained/decode/equality domain remains logical, not universal heap
or before-every-allocation accounting. Existing traversal/path-copy, delimiter,
@@ -60,3 +60,31 @@ ordinary-open, Pratt and duplicate-name scratch keep their independent controls
and stated exclusions; model/validator/numeric/decoder internals and native stack
remain separate domains. File counts do not tightly bound traversal path bytes.
Actual lifetime coercion and stack headroom still require the parent gates.
## Initial focused failure and test-oracle correction
Parent's initial focused run of `4872141c036c16825f1c098bd7cf44709897e814`
compiled successfully and completed 9 passes / 2 failures. The failing assertions
incorrectly required empty warnings in the rich OA/SA and four-file fixtures.
The original run, log and artifact remain preserved under the parent's
`analysis-output-acceptance-gates-20260925/acceptance-focused-4872141-1` records;
artifact cba18de5 prefix, 43,060,224 bytes. Those failures are not erased or called
production failures. The other nine controls, including both late byte caps and
scoped 128 KiB verification/drop, passed in that run.
Source-derived correction: validation.rs emits unallocated_leaf first, with
field allocation and message "Allocate leaf 'Work' to a performer."; its later
coverage.validate call emits work_without_behavior_context, field None, message
"Include this leaf activity/function in a process/chain or scenario through a
work action or exchange occurrence." Both are Warning, object ID2, empty related,
and map to the full Work declaration. The first local derivation missed the
coverage advisory; independent review caught it before the correction commit.
The pre-existing project expected_leaf_work_warnings oracle confirms both/order.
New tests now require both complete mapped diagnostics, with independent literal
spans: rich OA/SA main338..403 line6 column1, or Unicode/CRLF351..416 line7 column1;
four-file b.arcadia25..90 line2 column1. Warning storage is (2,0,227) for main,
(2,0,221) for b.arcadia. Final rich entries5/text1169,1212,1243,1286 for OA LF,
OA transformed, SA LF, SA transformed; four-file entries6/text747. Production
acceptance and all original test bodies remain unchanged. This is a test-only
oracle repair plus this note; corrected runtime acceptance awaits parent gates.