@@ -349,6 +349,15 @@ type `GbaEmulator`; scripts never retain or attach the emulator themselves.
349349 represented in the catalog. Begin with memory reading, formatting/
350350 interpolation, equality, and numeric operations; decide separately whether
351351 user code can declare or implement traits.
352+ - [x] Make nominal standard-library ` Display ` implementations source-driven.
353+ A type declaring ` Display ` can tag one parameterless ` String ` -returning method
354+ with ` @display ` ; generated catalog metadata owns the implementation identity,
355+ validates the contract, retains the ordinary hidden function through
356+ reachability, and dispatches ` as String ` , interpolation, ` print ` , and
357+ ` setVariable ` through the same body. ` FileVersion.toString() ` now renders the
358+ dotted four-part version without any type-specific formatting branch in
359+ codegen. Primitive formatting remains the built-in fallback; user-defined
360+ trait implementations remain part of the broader trait design.
352361- [x] Add source-defined standard-library capability inheritance. Declarations
353362 such as ` Numeric<T: Equatable> ` and ` Integer<T: Numeric + Display> ` now drive transitive
354363 satisfaction, method availability, inference, and minimal rendered bounds;
@@ -389,23 +398,33 @@ executable name.
389398 address global, while a single ordinary state expression reads it. Both
390399 supported builds and the never-ready unsupported-build path have runtime
391400 coverage; no layout DSL improves this shape.
392- - [ ] Separate named memory layouts from layout detection. Layout declarations
393- should co-locate concise ` at ` fields, documentation, and a stable source
394- identity; a distinct implicitly-suspending attachment selector should use
395- ordinary typed SplitScript expressions, ` await ` /` retry ` , matches, process
396- metadata, module sizes, signatures, and reads to select exactly one layout.
397- Do not encode ` when module(...).size == ... ` as the only probe grammar.
398- - [ ] Generate a typed layout enum/value rather than exposing ASL's mutable
399- string ` version ` . Lifecycle code must be able to compare and exhaustively
400- match the selected layout without stringly-typed names. Decide the final
401- selector syntax together with its error policy: unsupported and ambiguous
402- builds must stay visibly unattached or fail with one useful diagnostic,
403- never silently fall back to the first declaration.
404- - [ ] Implement the first vertical slice for layouts with an identical field
405- name/type interface. Validate every layout against one canonical snapshot
406- shape and select its pointer sources before ` onAttach ` completes. This
407- covers roughly four fifths of the surveyed versioned scripts while keeping
408- ` current.field ` and ` old.field ` unchanged.
401+ - [x] Separate named memory layouts from layout detection. ` layout Name { ... } `
402+ declarations co-locate concise ` at ` fields, documentation, and stable enum
403+ variant identities. The existing implicitly-suspending ` onAttach ` block is
404+ the selector: it uses ordinary typed SplitScript expressions, ` await ` /` retry ` ,
405+ matches, process metadata, module sizes, signatures, and reads, then returns
406+ exactly one generated layout variant. This keeps one attachment lifecycle
407+ phase instead of adding a separate ` selectLayout ` action and does not encode
408+ ` when module(...).size == ... ` as a privileged probe grammar.
409+ - [x] Generate a typed ` StateLayout ` enum and read-only ` layout ` value rather
410+ than exposing ASL's mutable string ` version ` . Lifecycle code can compare and
411+ exhaustively match it. Named layouts require ` onAttach ` to return a variant
412+ on every completing path; ` await process.closed() ` is recognized as the
413+ explicit non-completing unsupported-build path, so there is no silent first-
414+ layout fallback. ` layout ` is rejected inside ` onAttach ` before it exists.
415+ - [x] Implement the first vertical slice for layouts with an identical field
416+ name/type interface. Every layout is validated order-independently against
417+ one canonical snapshot shape, and the selected variant dispatches each
418+ transactional field read to the correct pointer source after ` onAttach `
419+ completes. ` current.field ` and ` old.field ` remain unchanged. Parser,
420+ formatter, completion, hover, semantic highlighting, Wasm validation, and a
421+ Steam/GOG/unsupported runtime fixture cover the complete feature.
422+ The corpus-derived Martha Is Dead port additionally validates three real
423+ legacy-ASL layouts, module-size selection, module-relative pointer paths,
424+ load removal, and the unsupported-build lifecycle end to end.
425+ The Borderlands port validates typed ` FileVersion ` selection and a shared
426+ interface whose old build uses direct module offsets while its patched
427+ build uses expression-backed PE32 pointer paths.
409428 - [ ] Design non-uniform layouts separately. The survey found 61 differing
410429 interfaces with stable field types and 28 with at least one same-named type
411430 conflict. Evaluate common-field projection plus typed variant payloads;
@@ -451,16 +470,39 @@ executable name.
451470 - [x] Expose ` await process.mainModule() ` using that matched candidate, so
452471 common ` modules.First().ModuleMemorySize ` selectors do not repeat executable
453472 strings or need a special module-size grammar.
454- - [ ] Add module enumeration/search, path or host-supplied file/product-version
455- identity, and a deterministic executable fingerprint as corpus ports require
456- them. Prefer host-provided metadata/fingerprinting over unrestricted
457- filesystem access or reading and hashing an entire module from Wasm.
473+ - [ ] Add module enumeration/search, product-version identity, and a
474+ deterministic executable fingerprint as corpus ports require them. Prefer
475+ host-provided metadata/fingerprinting over unrestricted filesystem access
476+ or reading and hashing an entire module from Wasm.
477+ - [x] Preserve the queried module name privately in each ` Module ` value and
478+ expose fallible ` Module.path() ` . It uses ASR's host-provided portable path
479+ ABI, bounds the returned UTF-8 payload, and does not grant general file
480+ access. Main-module values retain the actual matched process candidate;
481+ named-module values retain their requested module identity.
482+ - [x] Add source-defined ` Module.fileVersion() -> FileVersion! ` by porting
483+ ASR's bounded PE-resource traversal into ` standard.split ` . The typed
484+ ` FileVersion ` record exposes ` major ` , ` minor ` , ` build ` , and ` privatePart `
485+ components and is equatable, avoiding legacy ` FileVersionInfo ` strings
486+ whose punctuation differs between games and APIs. Only typed process
487+ reads remain intrinsic; DOS/PE validation, resource-directory loops,
488+ ` Result ` propagation, and record construction are ordinary library code.
489+ The checked ` v"major.minor.build.private" ` literal produces the same
490+ typed value, validates exactly four decimal ` u16 ` components at parse
491+ time, and keeps version comparisons concise without exposing record
492+ construction. The compiler lowers it through source-defined
493+ ` FileVersion.fromParts ` rather than a second backend implementation.
458494- [ ] Make the existing attach-time-discovered state-source pattern a documented
459495 first-class contract. Scripts can already scan/follow/resolve into globals in
460496 ` onAttach ` and use expression-backed state fields; add a canonical recipe,
461497 clearer typing/tooling, and specified behavior for temporarily unreadable and
462498 optional fields so authors do not recreate ` MemoryWatcher ` manually. Keep
463499 process-close cancellation and transactional snapshot rotation automatic.
500+ The Borderlands port is a focused syntax-pressure case: its PE32 layout must
501+ currently spell source-defined ` MemoryPath ` expressions because declarative
502+ pointer paths have one implicit pointer width. Use it to decide whether
503+ pointer width belongs on an individual path, a named layout, retained module
504+ metadata, or a more general discovered state-source value; do not add an
505+ ` at32 ` pseudo-keyword.
464506- [ ] Extend the existing signature APIs only where the corpus proves a gap:
465507 reusable scan targets, multiple/fallback signatures, range and memory-page
466508 selection, capture/offset transforms, relative-address decoding, and concise
0 commit comments