cli: print source types iteratively and propagate allocation errors

This commit is contained in:
dev committed 2026-10-10 14:31:50 +03:00
1 parent 4aad95c4a8
commit f18b41dd3d
4 files changed
+308 -89

No files matched your search

+8
View File
@@ -156,3 +156,11 @@ The independently reproduced 8,192-declaration linear/declaration failure is rep
The old recursive nominal declaration algorithm is now copied into the shallow oracle as well, removing the shared-nominal limitation of the preceding tests. Tests compare 4,613 roots over 128 generated six-declaration graphs and targeted nested-argument/parameter states, each queried three times with retained caches: results, lookup counts, complete entry order/keys/values/generations and final generation all agree. The existing 2,160 shallow syntax comparisons now use this independent nominal derivation too. Three 16,384-declaration mixed struct/enum queries cover negative content, positive leaves and a deep cyclic back-edge with a later positive witness. Six argument/cycle/result shapes fail every underlying arena allocation request in turn, checking OOM and full arena cleanup. Units/format checks, nominal/Copy-content/static-function CLI integration (110/119/25) and all 1,791 conformance cases pass with exact corpus coverage; all 1,421 source checks and 506 accepted lowerings preserve exact old/new exit/stdout/stderr.
The complete formerly failing Copy chain accepts with no output. Replacing its final field with own<u8> returns exactly one E7005 at 8194:19, with constraint Copy and type_constructor own_array. No timeout ends these probes; only child core capture is disabled. A separate 65,536-array invalid-atomic source now confirms source typeText native-stack exhaustion (10,001 frames, exit -6, no JSON), before any diagnostic is emitted. Source Ty equality/text/AIR conversion and closing query paths keep Q-059 open; Q-060 validation and Phase 6/contract gates remain separate. No syntax/feature/code/bundle growth, runtime/effect/ownership rule, generic traversal guard or accepted-depth limit changes. No fresh Claude review is claimed.
## Source type text repair
The 65,536-array invalid-atomic source's confirmed typeText abort is repaired by an iterative prefix/leaf/suffix writer. One growing byte buffer replaces recursively copied ancestor strings; temporary parent storage and failed output buffers are released. Canonical spelling, array decimal lengths/spaces, source-versus-AIR nominal names and the resources feature side effect are preserved. The internal typeText/tyText/diagnosticTyText APIs now propagate host OutOfMemory at every caller, replacing the old array/borrow/cap fallback strings. Failed metadata allocation must not fabricate a found type or generated AIR; ordinary diagnostics, syntax, effects, ownership/runtime/fuel and acceptance rules are unchanged.
Independent shallow tests compare 3,696 canonical/diagnostic outputs and feature states against the old printer, covering every wrapper/leaf, nominal display-name fallbacks and zero/max-u64 array lengths. A 65,536-level mixed chain has independently assembled exact text in both modes. Allocation failures cover direct printing, diagnostics and local AIR emission, with arena cleanup and no fabricated diagnostic/partial instruction; constant leaves retain the allocation-free path. Units and format checks pass. Repair-advice/nonvalue/static-function CLI integration passes 299/635/25 checks; all 1,421 public source checks and 506 accepted lowerings preserve exact old/new exit/stdout/stderr. All 1,791 conformance cases pass with exact corpus coverage.
The formerly aborting invalid-atomic check now returns exactly one E7005 at 2:9 without stderr; its complete found type is byte-identical to the independent 655,362-byte expectation. A separate correct 65,536-array parameter check accepts without output. A struct field containing 16,384 arrays then confirms remaining native recursion in source-to-AIR type conversion: 4,425 airType frames, exit -6, no JSON. Only child core capture is disabled, and no timeout ends a probe. Source-to-AIR repair, Ty equality and closing query paths keep Q-059 open; Q-060 validation and Phase 6 gates remain separate. No syntax/feature/code/bundle growth, runtime/effect/ownership rule, generic guard or accepted-depth limit is introduced. No fresh Claude review is claimed.
+2
View File
@@ -485,6 +485,8 @@ The [source anonymous property increment](air-type-depth-audit.md#source-anonymo
The [source nominal property increment](air-type-depth-audit.md#source-nominal-property-continuations) repairs the confirmed linear/declaration failure with explicit argument/member continuations, retaining cache generations and known-parameter cycle states. An independent recursive nominal oracle checks ordered cache records; complete checking accepts the 8,192-Copy chain and rejects linear content with E7005. A separate 65,536-array invalid-atomic source confirms typeText native-stack exhaustion. Source Ty text/equality/AIR conversion and closing call-path work keep Q-059 open; no semantic limit or rule changes.
The [source type text increment](air-type-depth-audit.md#source-type-text-repair) repairs the confirmed diagnostic printing failure with iterative prefix/suffix output and exact canonical/source naming. Host OOM propagates instead of supplying fabricated type strings. The deep invalid atomic now returns E7005 with its complete found type, and a correct 65,536-array parameter accepts. A 16,384-array struct member independently confirms the remaining airType native-stack failure. Source-to-AIR repair, Ty equality and closing query audits still keep Q-059 open. No semantic limit or rule changes.
## Q-060 — Native recursion while materializing runtime values
The [executed runtime audit](runtime-value-depth-audit.md) confirms that a verified one-byte value with 32,768 length-one nested arrays aborts inside zeroValue under `aji run --fuel 8`, rather than producing a run record. The instruction has not exhausted fuel. Iterative runtime traversal must preserve initialization, value shape, allocator/root lifetimes, collection safety and instruction accounting; adding a depth trap/acceptance limit needs a normative decision. At that baseline, recursive copying, value sizing, collection and serialization were additional audit candidates with unverified failure paths; the increment below records subsequent executed failures. Compiler type repairs in Q-059 do not resolve Q-060.