prometeu-runtime/docs/specs/pbs/files/PRs para Junie.md
Nilton Constantino d216918c79
pr 23
2026-01-29 17:47:01 +00:00

1.1 KiB

PR-24 — Validate Contract Calls in Frontend (Arity + Types)

Goal

Move contract validation to compile time.

Required Changes

  • During PBS type checking:

    • Validate argument count against contract signature
    • Validate argument types
  • Lower only validated calls to HostCall

Tests

  • Wrong arity → E_TYPE_MISMATCH
  • Correct call lowers to Core IR HostCall

PR-25 — Core IR Invariants Test Suite

Goal

Lock in correct semantics before touching the VM.

Required Invariants

  • Every Begin* has a matching End*
  • Gate passed to Begin* is available at End*
  • No storage writes without BeginMutate
  • No silent fallbacks

Tests

  • Property-style tests or golden IR assertions

STOP POINT

After PR-25:

  • Core IR correctly represents PBS HIP semantics
  • Lowering is deterministic and safe
  • VM is still unchanged

Only after this point may VM PRs begin.

Any VM work before this is a hard rejection.


Instruction to Junie

If any rule in this document is unclear:

  • Stop
  • Add a failing test
  • Document the ambiguity

Do not invent behavior.

This document is binding.