8.7 KiB
Independent text-producer fixture oracle
Source basis8d52dab97c92cc31baae9f20d8c324b55818aa5d and accepted text-producer contract. Expectations below are authored from literal grammar/ownership, not new implementation outputs. No Cargo or parser execution. A small standalone data calculation checked only UTF-8 lengths and literal substring offsets.
Notation: id1, id2, id3 are 00000000-0000-0000-0000-000000000001 etc. doc(body,name) is exactly arcadia 8;\nproject p "NAME" id "ID1" {\nBODY\n}\n. Default name is Project. Single-file entry/key is main.arcadia, adding24 owned path/entry bytes. Every cap below uses generous other limits unless stated. No numeric-zero mode shortcut is permitted.
Reused controls
The independently reviewed empty E has source78,Ctext102,T8, scanner peak36 and grammar peak44 (alias1+name7+UUID36). Owned complete text146/145 isolates the grammar UUID reservation; entries17 suffice through resolver. Existing phase-only cap112 remains unchanged.
Pre-execution offset correction: the earlier PRODUCER-CRITIQUE originally stated UUID33..71/diagnostic33..34. That was a literal source-counting typo, not runtime evidence. The actual78-byte E has the quoted UUID at 34..72, yielding ordinary diagnostic 34..35; the new test correctly uses34. The critique now carries an annotated correction. E storage counts/peaks were unaffected. Escaped-description quoted start200 remains correct.
Final independent byte readback confirms this erratum directly from the test's doc format literal with empty body and name Project, without invoking Rust or the parser. The resulting 78 bytes have SHA256 48fe360b7b5f57867086e7f6fa47c2913765c1261e558e7ebec688a1f842a65e: byte33 is the space after id, byte34 the opening quote, and byte71 the closing quote. The half-open token is therefore34..72. Existing ordinary diagnostic transport keeps start34 and extends through its one-byte quote to35. The historical33..71/33..34 statement remains recorded above as superseded evidence.
The escaped project-only fixture has twenty source \u0061 escapes in both project display name and description. Source326,Ctext350,T41, scanner120, grammar name121/UUID57/description141. Complete owned text491/490, entries21. These retain the prior independently authored source and arithmetic; do not rederive them from parser return values.
Multi-file retained text overlapping scanner validation
Exact bundle:
entry = main.arcadia
main.arcadia = doc("include \"part.arcadia\";", "aaaaaaaaaaaaaaaaaaaa")
part.arcadia = "include \"\u006c\u0061\u0073\u0074\u002e\u0061\u0072\u0063\u0061\u0064\u0069\u0061\";\r\n"
last.arcadia = "//é\r\n"
In part, the twelve backslash-u sequences are literal source escape bytes, not already decoded characters. They decode to last.arcadia. In last, é is actual U+00E9. Source lengths114,85,6 total205; map-key bytes36 plus entry12 give C=(3,0,253).
Entry grammar retains project alias1 + display name20 + include path12 =T33. Its highest temporary overlap is project UUID:1+20+36=57; entry scanner peak36. When part is scanned, T33 from main remains live and P72 for the escaped include requires 105. Part grammar then requires the same105, and transfers only D12, leaving T45. The final comment-only file adds no T/W. No declarations or projected values exist.
Therefore complete owned bytes358/357, entries29, is a real cap pair. Cap357 refuses at part scanner validation before grammar; cap358 clears all text phases, including later catalog maximum C+T+2=300. Scanner observer/phase evidence is needed to distinguish scanner rejection from the later identical grammar threshold: the public error alone has the same quoted-token location. Part quoted token is8..82; ordinary parser-style transport from offset8 is8..9. Pin whichever documented shared scanner transport the implementation uses, but require source path part.arcadia and start8; do not relabel a grammar refusal as scanner admission proof.
U3/M19 and original scanner events31 are unchanged from the simple include-chain structure: main13 significant/24raw, part3significant/5raw, last0significant/2raw. Owned final syntax entries25, resolver entry peak29. Final resolved text 298, zero lower occurrences, expected Project name20 a, description empty, all model maps empty; canonical files last/main/part, traversal main/part/last. C is retained once, scanner temporary does not accumulate, and scanning part must not discard prior T33.
Projection-copy-dominant activity
Exact body: oa_activity a "A" id "ID2" { description "dddddddddddddddddddddddddddddddddddddddd"; } with40 ASCII d characters; use default doc and main.arcadia.
Source197,C=(1,0,221). Final T is header8 + activity alias/name2 + field_spans key11 + AST key11 + literal40 + projected key11 = 83. Before projection the final retained subtotal is72. Earlier maximums: scanner40; project UUID44; activity UUID46; field parse alias/name/header10+initial key11+literal40=61; retaining the second field key gives72. Last projected key adds11 and reaches83. No Atom literal text is copied by projection.
Thus owned bytes304/303 is a syntax-positive/negative pair that reaches the intended later producer instead of UUID. With cap303 the final key reservation must fail at main description field start137; its full authored field span is137..192. A diagnostic transported through ordinary Error offset has137..138; the prior resolver text walk restores137..192. Do not equate those two transport APIs without an explicit implementation decision. Use roomy entry limits so projection slot accounting cannot preempt it.
At304 syntax succeeds with T83/W0. Do not assert complete resolution at304: catalogs introduce further live text and validation may add warnings. Use a separately generous complete-resolution control if needed. The original two-byte-é description has finalT45 but activity UUID peak46, so C+44 is not a valid new-mode projected-copy oracle.
Small inventory fixture for all three UUID consumers, nested-key overlap and references
Use default doc of these two lines:
oa_activity a "A" id "ID2" { payload { ref @p; old uuid "ID1"; }; }
calculation c "C" id "ID3" { input x id "ID1" : Number; result Number; body $x; }
This is deliberately syntax-only: payload is an arbitrary parsed ordinary field, not asserted to be a valid final activity field. Do not unwrap full Project admission or cite it as accepted model evidence. It exercises real parser/projection storage; use the independent syntax text reconciliation seam, or distinguish the later model rejection from text accounting.
Exact source359,C=(1,0,383). Independent final inventory:
| Retained family | Bytes |
|---|---|
| Project alias/name | 8 |
| Activity alias/name | 2 |
| Two top-level payload keys | 14 |
| AST nested keys ref/old | 6 |
| AST reference p | 1 |
| Projected payload/ref/old keys | 13 |
| Projected reference p | 1 |
| Typed c/C, input x, expression reference x | 4 |
| Total T | 49 |
All five consumed36-byte UUID spellings contribute zero to finalT: project/activity optional IDs, historical UUID, calculation identity and parameter identity. Static Number spellings do not allocate reference text. Excluded typed duplicate-name set clones must not appear in T. Final owned text432, W0.
Assuming the accepted borrowed declaration-kind word option, grammar peaks follow these literal steps: projectT8; activity names→10; payload local key→17; ref local3 and reference1→21; nested-key clone adds3→24 then local-key drop returns21; old key3→24; historical UUID adds36→60 then drops; old-key clone→27 then refund→24; top-level payload second key→31. Calculation alias/name→33, identity UUID peak69, input name→34, parameter UUID peak70, body reference→35. Projection adds payload7→42 then BTree old3→45/ref3→48/reference1→49. Scanner maximum36 is earlier and lower.
Hence syntax-only bytes453/452 is an additional real peak pair;452 reaches the parameter UUID reservation, whose quote begins282. If the implementation selects a separately charged owned declaration-kind temporary, revise that explicitly selected W term before using these peaks; finalT49 is unchanged. This is not permission to copy production tallies into the oracle.
Test review boundary
These fixtures separate scanner overlap, transient consumption, final inventory and projection timing rather than assuming one count proves all phases. Full-path positives are provided by E, escaped project and the include chain; the two syntax-only fixtures make their boundary explicit. Tests should compare exact C/T/W/Usage and original source bytes while preserving legacy and phase-only diagnostic timing. Fault-injection overflow/refund tests remain separate from real provenance. Later actual tests still need independent review once the implementer freezes them.