diag: guide parameter mutability and explicit array slice arguments

This commit is contained in:
dev committed 2026-10-09 21:12:26 +03:00
1 parent 6a02659f31
commit 9549a3dec6
22 files changed
+197 -4

No files matched your search

+10
View File
@@ -394,3 +394,13 @@ The [source rejection/compatibility audit](../design/contract-source-errors-and-
Public development feedback identifies u8 → usize and usize → u64 casts rejected without explaining the target-independent rule. Spec 02 §2 already excludes usize/isize from widen, including conversions that fit under every current target. The registered numeric_cast_modes hint now states that rule, keeping the original E7005 message/fields and checked/wrapping alternatives. Source/Quick Reference cast tables explain it too; no semantic widening extension is adopted. Pointer identity as casts now follow the same source rejection instead of leaking AIR E1002 without advice. Six rejection fixtures and an explicit checked/wrapping runtime case cover the rule; hosted advice tests pass 208 checks including source API parity and fixed-width identities. Bundle growth is measured in agent/README.md. Parameter-mutability and array-to-slice advice from the same feedback remain open work; no new dev/model experiment or repair-round benefit is claimed.
Validation of cast guidance: units/format checks and all 1,776 conformance cases pass. Comparison of 1,403 pre-existing source files changes only the registered hint; all 500 accepted lowerings remain byte-identical.
## P6-12 parameter and array-call advice (2026-10-09)
Public development feedback now has two narrowly registered candidates. E7001 at `mut name:` in a function parameter distinguishes value/local storage from an exclusive `mut<T>` contract, without choosing for the agent. An ordinary-call E7005 for a bare named, non-linear array with matching slice elements suggests the explicit `ref` or `mut` prefix required by the known parameter. Array expressions/projections, unlike elements, intrinsic/task operands and earlier name/move/arity failures are excluded. Generic/static specializations and imported calls retain the same rule and source provenance. Existing messages, payloads, code/location, accepted syntax/inference and loan lifetime remain unchanged. Prefix advice is not a verification claim: by-value parameter arrays still require an addressable local place.
The exclusivity/lifetime invariants, verifier transfer rules, explicit borrow creation/end and deterministic runtime are unchanged (spec 03; spec 15 §5). A positive source run covers mutable local copies, exclusive parameters and shared/exclusive slices; six rejection cases cover the triggers and nearby exclusions. Hosted advice tests pass 299 checks, including source API/package parity and generic/static repaired programs; whole-array integration passes 85 checks. Bundle growth is measured in agent/README.md. No language synonym, automatic conversion, semantic adoption or new dev/model experiment is introduced; the external repair-round measurement remains pending.
Validation: units/format checks and all 1,783 conformance cases pass; independent source-error collection passes 234 CLI checks. The six original trigger/exclusion diagnostics retain their complete envelopes after removing only the new candidate field.
Old/new comparison of 1,410 pre-existing source files preserves every diagnostic envelope after removing only the two new registered candidates, and all 501 accepted lowerings remain byte-identical. Advice is additionally emitted for the existing std/implicit_borrow rejection; its E7005 facts are unchanged. No fresh Claude review was available. P6-12 still awaits external development-run measurements.