cli: check inferred array elements before AIR

This commit is contained in:
dev committed 2026-10-08 09:26:33 +03:00
1 parent cfbe01a16f
commit 1bbfed24a8
40 files changed
+337 -9

No files matched your search

+8
View File
@@ -253,3 +253,11 @@ Q-043/spec 15 §10 enforces the existing Copy-content requirement for source `ow
The preserved invariant is that repeated dynamic heap arrays contain Copy values, so bulk release cannot destroy nested resources. AIR independently retains the same type/operation checks; allocation budgets, initialization, owner transfer, explicit release and deterministic interpreter behavior are unchanged. Valid Copy allocations run with explicit release; rejected annotations and repeated linear values report E7005 with `constraint` and `type_constructor`. Existing invalid-source codes/priority may change, including Copy violations preceding simultaneous layout errors. No syntax, code, feature, verifier/runtime state or evaluation input changes. Source bundle growth is recorded in docs/agent/README.md; P6-2 remains open.
Validation: full conformance 1,335/1,335; all 32 new fixtures also pass with per-instruction collection. Unit tests pass 128/128, including counted acyclic/cyclic diamond queries; the cyclic case failed before the cache correction. CLI integration passes 119 checks with exact annotations/value positions, nested package imports and source/AIR/hosted parity. Formatter passes 4,563 checks over 1,047 public files (1,039 parsed, eight existing syntax errors, 638 identical AIR outputs); source coverage remains 121/121. Comparison of all 1,017 preceding public sources preserves every check/lower result and all 631 successful canonical lowerings. No AIR verifier/runtime files change. Independent Claude review passes after checking shadowing, generic rotations, cache invalidation and the complete declaration snapshot used by the shared Copy predicate.
## P6-2 inferred array literals (2026-10-08)
Q-045/spec 15 §5/§10 applies the existing member-position rule to each inferred array element before construction and the exact verifier Copy predicate to repetitions. Borrow elements reject E7006 invalid_literal; forbidden constructors and non-Copy repeats reject E7005 at the value with structured fields. Element validity precedes expected-type agreement; annotation errors still reject first. Existing linear lists preserve explicit moves and complete-value transfer, including missing-move and duplicate-owner diagnostics.
The invariants are that second-class borrows cannot become stored members and repetition cannot duplicate a linear value. AIR still independently checks the same rules. No allocation, lifetime, task transfer, cleanup, deterministic interpreter behavior, syntax, code/reason, feature, verifier/runtime state or evaluation input changes. Valid linear lists explicitly unpack/release their owners; Copy and temporary-slice programs run unchanged. Invalid-source errors formerly reaching E1001/E0006/E7900 now stop earlier; the preceding own.array borrow-array fixture now rejects at its literal. New source tests and CLI/package/profile checks cover the changes. Source bundle growth is recorded in docs/agent/README.md; Q-046 records the separate inferred-wrapper audit, and P6-2 remains open.
Validation: full conformance 1,364/1,364; all 29 new fixtures pass with per-instruction collection. Unit tests pass 128/128. CLI integration passes 152 checks covering exact positions/fields, all diagnostic commands, never-valued calls, generic package provenance, source/AIR/hosted parity and formatter idempotence; the preceding own.array suite remains 119/119. Formatter passes 4,664 checks over 1,078 public files (1,070 parsed, eight existing syntax errors, 642 identical AIR outputs); source coverage remains 121/121. Comparison of 1,049 preceding public sources finds only two expected invalid-program diagnostic changes, with unchanged acceptance and every other canonical lowering identical. No AIR verifier/runtime files change. Independent Claude review passes.