7.9 KiB
Independent retained-entry oracle
Basis: source97a8703adc75467a7f8e75f5c6cb00ca542b707c and accepted harness/analysis-entry-producer-contract-20260925.md. Counts are authored from literal grammar, not parser output. Only standalone literal string lengths/substrings were calculated; no compiler or parser executed. All sources below use UTF-8 and LF except the explicitly marked chain suffixes. Entry is main.arcadia.
Define ID1 through ID4 as36-character UUIDs 00000000-0000-0000-0000-000000000001 through ...0004. doc(body) is exactly arcadia 8;\nproject p "Project" id "ID1" {\nBODY\n}\n, replacing ID1 with its UUID and BODY with the literal body. Source spans are half-open UTF-8 byte offsets. Use generous unchanged byte/token/reference/model policies for entry controls; bytes4096 suffices for these small fixtures and avoids previously established UUID/text preemption.
Empty and three-file controls
E is doc(""),78 bytes, SHA256 48fe360b7b5f57867086e7f6fa47c2913765c1261e558e7ebec688a1f842a65e. Its significant tokens are exactly arcadia, 8, ;, project, p, quoted Project, id, quoted ID1, {, }: ten. U1 is the project event; there are no ordinary values, fields, lexical owners or projected declarations. C.entries1; M=F1+tokens10=11. New entry-mode syntax cap13 succeeds;12 refuses the complete projection/token-end reservation in main at raw default span0..0, ordinary diagnostic0..1, line1 column1. Complete resolver17/16 is a separate boundary; failure there uses project-header span11..73, pathmain, not the syntax0..1 location. Its peak is syntax13 plus four catalog slots; the final retained total returns to13. These are complete-project positives, with empty maps and description, aliasp/nameProject/schema8/ID1.
H is exactly:
main.arcadia = doc("include \"part.arcadia\";")
part.arcadia = "include \"last.arcadia\";\r\n"
last.arcadia = "//é\r\n"
Source lengths101,25,6, total132. C.entries3, C.text180 (source132 + three12-byte keys +12-byte entry). Significant token counts13,3,0; raw scanner work24,5,2 is separate. U3 is project plus two includes; value maps, owners and projection are zero. M=F3+tokens16=19; combined syntax25. Main boundary reaches C3+U2+M16=21. Part adds U1 and three token-end slots, reaching25; last adds nothing. Syntax25 succeeds,24 refuses at part default span0..0 transported to0..1 (line1 column1). Full resolver29/28 remains separate and fails at main project-header11..73. Traversal is main/part/last; canonical output order last/main/part. Use roomy text4096; do not reuse the old phase-only byte214 cap with newly enabled text producers.
With an actual explicitly borrowed C0 guard, the corresponding syntax totals are E12 and H22. This is the explicit combined mode, not permission to reuse legacy separated checks. No extra field/file count is added at resolver transfer.
Prefix producer refusals
Owner fixture body is exactly oa_activity a "A" id "ID2" { }, source141 bytes. Declaration start75. Immediately before its owner push: C1+F1+U2=4. Cap4 rejects that owner reservation before Vec mutation; raw attribution starts75, ordinary diagnostic75..76, line3 column1. Cap5 merely clears this prefix. A complete syntax needs29: tokens17, U2, owners1, values0, projection7, M26 plus C1.
Value fixture body is exactly oa_activity a "A" id "ID2" { description ""; }, source157 bytes. Description key begins137; empty quoted value149..151. Immediately before its first value-end insertion: C1+F1+U4+owner1=7. Cap7 rejects with raw value span149..151, ordinary diagnostic149..150, line3 column75. Cap8 merely clears this prefix. Full syntax needs37: tokens20, U4, owner1, value1, projection9=7+field1+value1; M32 and C1. A roomy complete syntax positive is required separately from the refused prefix.
Both aggregate messages are exactly Source8 lowering entry limit exceeded. with codeinvalid_source, no related diagnostics. These tests must check unchanged map/Vec on refusal through a finite observer or directly reviewed helper. A final error/count alone does not establish the before-mutation order.
Combined syntax-only nested inventory
Exact complete source:
arcadia 8;
project p "Project" id "00000000-0000-0000-0000-000000000001" {
oa_activity a "A" id "00000000-0000-0000-0000-000000000002" { payload { items [@p, uuid "00000000-0000-0000-0000-000000000001", { flag true; }]; };
oa_activity b "B" id "00000000-0000-0000-0000-000000000003" { }
}
node n id "00000000-0000-0000-0000-000000000004" { }
}
Include the final LF. Source344 bytes, SHA256 83c53d51c2ebca01d5771a3d66cf57037b808f43f4c113daf3404736cdc1d69c; actual one-file C=(entries1, occurrences0, text368). This is syntax-only: arbitrary payload and top-level node are not claimed semantically admissible. Do not unwrap full Project resolution as this fixture's positive control.
Declarations in ordinary preorder: a at75, b at223 nested inside a, n at289 at project level. Lexical owner occurrence indices are [None, Some(0), None]; count3 regardless of UUID uniqueness. Each declaration contributes seven projected envelope slots, including its synthetic body. The node's four-role header still contributes the same conservative seven, not six. The open-declaration coordination stack contributes no additional U/M.
| Actual Ast value | Start | End | Map insertion order |
|---|---|---|---|
| payload Record | 145 | 221 | 6 |
| items Array | 153 | 218 | 5 |
| @p Reference | 154 | 156 | 1 |
| historical UUID | 158 | 201 | 2 |
| array member Record | 203 | 217 | 4 |
| true Atom | 210 | 214 | 3 |
All six keys are distinct. Three actual fields are payload, items, flag. Their keys begin137,147,205 respectively. Synthetic declaration bodies are not Ast values and add no seventh value/map entry. Ordinary reference @p contributes one value event, not a typed-reference work charge.
Significant-token inventory is ten project tokens plus seven a-envelope tokens, nineteen payload tokens, seven b-envelope tokens and six n-envelope tokens =49. The nineteen payload tokens, in order, are: payload { items [ @ p , uuid "ID1" , { flag true ; } ] ; } ;. Quoted UUID is one token. Nested declaration closure belongs to its own envelope; a's closure is already in its seven. No comments or EOF token are included.
U=project1+declarations3+fields3+values6=13. Projection P=declaration envelopes21+fields3+values6=30. M=F1+tokens49+value ends6+owners3+P30=89. Final combined C+U+M=103. Before the complete projection reservation, combined live total24=C1+F1+U13+values6+owners3; tokens49+P30 reserve79 atomically. Consequently syntax103 succeeds and102 refuses in main at default span0..0, transported0..1, before ends/header/field/value projection. Every earlier entry prefix is below102. Use byte4096 and roomy other policies.
Projected quota consumes7 at a, then payload field1, its Record value1, items field1, Array value1, Reference1, HistoricalUuid1, nested Record1, flag field1, Atom1; then7 at b and7 at n: total30, zero remaining. Quota subtraction does not change M. Map/owner counts are retained conservatively even when their temporary containers drop. No model admission or resolved-entry peak is asserted for this fixture.
Internal and compatibility controls
Repeated value-map key replacement must reserve zero new M and preserve length; label it injected helper behavior, not a source occurrence. Too-small quota, leftover quota, checked arithmetic overflow and latched refusal are also explicit internal controls. Duplicate real fields fail the whole grammar parse, so no successful final BTree inventory discards a counted field. Do not salvage such a failure by refunding to manufacture a successful witness.
Use existing complete OA/SA fixtures for roomy whole-Project/Usage/numeric parity against the text-only route; the combined fixture above covers the specific retained inventory only. Preserve legacy/carried/text-only timings and policies, source bytes, actual guard lifetime, and all existing small-stack cases. These literals are independent expectations to guide tests, not runtime acceptance evidence.