This commit is contained in:
Nilton Constantino
2026-01-31 18:48:22 +00:00
parent be1c244b5a
commit 83e24920b4
9 changed files with 707 additions and 311 deletions
-67
View File
@@ -1,70 +1,3 @@
## PR-10 — Program image + linker: imports/exports resolved before VM run
**Why:** Imports are compile-time, but we need an industrial linking model for multi-module PBS.
### Scope
* Define in bytecode:
* `exports`: symbol -> func_id/service entry (as needed)
* `imports`: symbol refs -> relocation slots
* Implement a **linker** that:
* builds a `ProgramImage` from N modules
* resolves imports to exports
* produces a single final `FunctionTable` and code blob
### Notes
* VM **does not** do name lookup at runtime.
* Linking errors are deterministic: `LINK_UNRESOLVED_SYMBOL`, `LINK_DUP_EXPORT`, etc.
### Tests
* two-module link success
* unresolved import fails
* duplicate export fails
### Acceptance
* Multi-module PBS works; “import” is operationalized correctly.
---
## PR-11 — Canonical integration cartridge + golden bytecode snapshots
**Why:** One cartridge must be the unbreakable reference.
### Scope
* Create `CartridgeCanonical.pbs` that covers:
* locals
* arithmetic
* if
* function call
* syscall clear
* input snapshot
* Add `golden` artifacts:
* canonical AST JSON (frontend)
* IR Core (optional)
* IR VM / bytecode dump
* expected VM trace (optional)
### Tests
* CI runs cartridge and checks:
* no traps
* deterministic output state
### Acceptance
* This cartridge is the “VM heartbeat test”.
---
## PR-12 — VM test harness: stepper, trace, and property tests
**Why:** Industrial quality means test tooling, not just “it runs”.