Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo check --workspace --all-targets
Expand All @@ -25,6 +27,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --workspace --all-targets
Expand Down Expand Up @@ -122,3 +126,29 @@ jobs:
test "$("$WASMTIME" run --invoke 'int-clamp(15, 0, 10)' "$LIB")" = "10"
"$WASM_TOOLS" component wit "$CB" | grep -q 'import map-apply: func(x: s64) -> s64;'
"$WASM_TOOLS" component wit "$LIB" | grep -q 'export morphic:library/functions'

# The 1.8 Solidity + EVM harness (IKONIK_18_SCOPE §7,
# wired at Phase 171): runs explicitly against `-p morphic`
# (outside the workspace test build's wasm-playground
# feature unification) with Node 24 and pinned solc-js +
# @ethereumjs/evm + ethers installed only in scratch
# target/solidity-harness/. Asserts 0-warning solc
# compilation, 100% real EVM battery execution, runtime
# require(...) / Panic(0x11) reverts, and the full
# 5-clause 1.8 gate.
- uses: actions/setup-node@v4
with:
node-version: 24

- name: Solidity compile + EVM execution (1.8)
run: |
set -euo pipefail
cargo build -p morphic --bin morphic
BIN="$PWD/target/debug/morphic"
WORK="$RUNNER_TEMP/morphic-solidity-18"
rm -rf "$WORK"
"$BIN" build --contract-from examples/contracts/defi_math.morph --out "$WORK/defi"
for b in "$WORK/defi"/*.bundle.json; do
"$BIN" verify-bundle "$b"
done
cargo test -p morphic --test phase170_evm_harness --test phase171_gate -- --nocapture
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.8.0] — 2026-11-26

The v1.8.0 release — **1.8, the smart-contract target (`--target solidity`): the first milestone on the Ikonik rung, ships at the frozen gate**. Everything merged to master since v1.7.0 ships in this release (Phases 167–171), tagged `v1.8.0`. Phase 171 ran the frozen 5-clause 1.8 gate ([`IKONIK_18_SCOPE.md`](IKONIK_18_SCOPE.md) §8) clause by clause on the gate tree with fresh instruments (`tests/phase171_gate.rs`) and it **passes in full** — the frozen gate text was never amended. What ships: **core Solidity `^0.8.24` pure-contract codegen** (`src/codegen/solidity.rs`, wired into `codegen::generate` for `"solidity" | "sol"`, `api::render`, and CLI `morphic build --target solidity` writing `<stem>.sol`) supporting the direct-ABI type subset (`Int`→`int256`, `Bool`, `I8..I64`, `U8..U64`, `String`→`string memory`, `List<scalar>`→`<scalar>[] memory`, `Unit` return-only), always-on runtime `require(...)` guards via a dedicated precondition walker (hard-refusing `Forall`/`Exists` and unrenderable forms — never emitting `require(true)`), `public pure` entrypoints + deduplicated `internal pure` transitive prelude helpers, on-demand `_morphic_append_*`/`_morphic_clone_*` memory-array helpers, `keccak256(bytes(...))` string equality, explicit D8a NatSpec proof-boundary disclosure, and hard `CodegenError` refusals on all unsupported types/IR; **checked multi-spec contract + PCC bundle assembly** (`morphic build --contract-from <file.morph>`, sharing `admit_user_specs`, producing companion `bundleVersion: 1` PCC bundles with SHA-256 digests embedded in per-function NatSpec, plus the committed 6-spec `DeFiMath` exhibit at `examples/contracts/defi_math.morph`); and a **pinned `solc@0.8.28` + `@ethereumjs/evm@3.1.1` + `ethers@6.13.4` Node EVM harness** in scratch `target/solidity-harness/` (zero new Cargo dependencies — standing-13 unchanged; `WinnerReport.renders` unchanged at 6 targets; wired into CI). All version-bearing surfaces move in lockstep to **1.8.0**: crate + `Cargo.lock` (1 line), `@thvtzy/morphic` (77 files, 71,873 B ≤ 76,800 B), Rust facade `morphic` (7 files, 57,613 B), PCC bundles byte-identical (267,156 B), both WASM components rebuilt at `morphic:library@1.8.0` (`morphic-library.wasm` 80,558 B ≤ 106,496 B; `morphic-callbacks.wasm` 66,011 B ≤ 90,112 B), and **`morphic-1.8.0.vsix`** (324 files, 486,881 B). Both npm and crates.io `--dry-run` checks are clean; live publishes remain the owner's release acts. Suites at the stamp, solo, three frozen configurations: **1010/0/29 default · 1010/0/29 bootstrap-codegen · 865/0/22 no-Z3** (zero failures, zero flakes).

- **The 1.8 gate run, CI Solidity wiring, and v1.8.0 stamp (Phase 171)** — [`IKONIK_18_SCOPE.md`](IKONIK_18_SCOPE.md) §8 run clause by clause with fresh instruments (`tests/phase171_gate.rs`, 5 teeth): (1) **core emitter & honesty refusals** — all 18 direct-ABI stdlib entries and all 6 `DeFiMath` exhibits render cleanly (`"solidity"` == `"sol"` == `api::render`, D8a proof-boundary NatSpec, zero `require(true)`); all 17 non-direct-ABI stdlib entries, 9 unsupported types (`Float`, `Char`, `Option`, `Result`, `Function`, `Map`, `Set`, `Generic`, unknown `Named`), and both quantifiers (`Forall`, `Exists`) refuse by name; `WinnerReport.renders` stands at 6; (2) **real `solc` 0 warnings** — 19 contracts (`DeFiMath` assembled via shipped CLI + all 18 direct-ABI stdlib entries) compile under `solc@0.8.28` with **0 errors and 0 warnings**; (3) **real EVM execution + reverts** — **150/150** real Shanghai EVM calls (`DeFiMath` 28 + 18 stdlib entries 122 cross-checked against `eval::eval`) and **13/13** reverts (including gate-named `fee_bps(100, 10001)`, `debit_balance(100, 200)`, `int_clamp(5, 10, 0)`, `linear_vested(1000, 50, 0)`, `int_abs(i64::MIN)`, and `Panic(0x11)`); (4) **proof-carrying contract loop** — shipped CLI `build --contract-from examples/contracts/defi_math.morph` writes `DeFiMath.sol` + 6 SHA-256-matched `bundleVersion: 1` bundles, all 6 independently re-verified via `morphic verify-bundle` (Tier-1 under Z3; honest Tier-2 + Tier-1 `unexamined` refusal without Z3), tampered bundle refused by name and hash-mismatched; (5) **footprint, CI, and lockstep** — zero new Cargo dependencies since `v1.7.0` (standing-13 unchanged, `Cargo.lock` package set identical), standing budgets unmoved (`771,072 B` playground, `76,800 B` npm, `106,496 B` / `90,112 B` components, `12,288 B` / `295,000 B` registry), CI wired with `Solidity compile + EVM execution (1.8)` step in `.github/workflows/ci.yml`, and all surfaces in lockstep at `1.8.0`. **The closing line is ticked: the 1.8 gate passes in full.** Suites solo: **1010/0/29 default · 1010/0/29 bootstrap-codegen · 865/0/22 no-Z3**.
- **Pinned `solc-js` + Node EVM execution harness (Phase 170)** — [`IKONIK_18_SCOPE.md`](IKONIK_18_SCOPE.md) §6 built: reusable Node runner `tests/solidity_evm_runner.cjs` (pinned `solc@0.8.28`, `@ethereumjs/evm@3.1.1`, `ethers@6.13.4` cached in gitignored `target/solidity-harness/`, zero Cargo deps) compiles emitted Solidity with `evmVersion: "shanghai"` asserting **0 errors and 0 warnings**, deploys bytecode into a real in-process EVM, runs ABI-encoded battery calls, and verifies runtime `Error(string)` / `Panic(uint256)` reverts. Caught and fixed a real `solc@0.8.28` `Error 1080` ternary literal-typing defect in `src/codegen/solidity.rs` (explicitly casting constant integer ternary branches to the sibling branch's scalar type). Pinned by 3 teeth in `tests/phase170_evm_harness.rs`: **22 contracts, 0 errors, 0 warnings, 157/157 real EVM calls, 16/16 real EVM reverts** (`DeFiMath` 28/28 calls + 11/11 reverts; all 18 direct-ABI stdlib entries 122/122 calls + 2/2 spec-silent `require:` reverts; transitive `require:` + `keccak256` string eq + `uint64` overflow 7/7 calls + 3/3 reverts). Suites solo: bootstrap-codegen 1005/0/29, no-Z3 860/0/22, default 1003 + 2 proven Z3 load flakes (`phase84_symbolic_state_encodability` green solo `--exact` 1.35s and `cargo test --lib` 407/0/12; `phase143_the_rest_stand` green solo `phase143_uf_composition` 8/0/0).
- **Multi-spec Solidity contract assembly + PCC coupling (Phase 169)** — [`IKONIK_18_SCOPE.md`](IKONIK_18_SCOPE.md) §5.2 built: `morphic build --contract-from <file.morph> [--out <dir>] [--seed <u64>]` (`codegen::solidity::assemble_user_contract`, native-only) shares `admit_user_specs`, produces one `bundleVersion: 1` PCC bundle per admitted spec via `pcc::produce_bundle`, hashes each via `registry::sha256_hex`, and emits one `<Module>.sol` contract with per-function NatSpec provenance (`tier`, `verdictBasis`, `battery`, `bundle`, `bundleSha256`) and deduplicated transitive `internal pure` helpers alongside the `<entry>.bundle.json` files. Refuses flag combinations, positional inputs, admission failures, and non-direct-ABI/quantified-`require:` specs by name with nothing written. Ships committed exhibit `examples/contracts/defi_math.morph` (6 pure/view DeFi specs, pinned in `tests/phase129_checker.rs` corpus). Pinned by 5 teeth in `tests/phase169_contract_pcc.rs`. Suites solo: 1001/1/29 · 1001/1/29 · 856/1/22 (zero Z3 flips; sole failure was `phase129_corpus_check_outcomes` before recording `defi_math.morph`, after which `phase129_checker` passed 7/0/0 solo in all three configurations).
- **1.8 freeze + core Solidity emitter (`--target solidity`) (Phase 168)** — [`IKONIK_18_SCOPE.md`](IKONIK_18_SCOPE.md) frozen with owner-ratified D1a–D9a and core emitter built in `src/codegen/solidity.rs`, wired into `codegen::generate` (`"solidity" | "sol"`), `api::render`, and CLI `morphic build --target solidity` (mapping default output extension to `.sol`). Supports the direct-ABI type subset (`Int`→`int256`, `Bool`, `I8..I64`, `U8..U64`, `String`→`string memory`, `List<scalar>`→`<scalar>[] memory`, `Unit` return-only), always-on runtime `require(...)` guards via a dedicated precondition walker (hard-refusing `Forall`/`Exists` and unrenderable forms — never emitting `require(true)`), `pragma solidity ^0.8.24` `contract` containers with `public pure` entrypoints + deduplicated `internal pure` transitive prelude helpers, on-demand `_morphic_append_*`/`_morphic_clone_*` memory-array helpers, `keccak256(bytes(...))` string equality, Solidity keyword sanitization, explicit NatSpec proof-boundary disclosure, and hard `CodegenError` refusals on all unsupported types/IR. `WinnerReport.renders` stays at 6 targets (D6a); zero new Cargo dependencies. Pinned by 8 teeth in `tests/phase168_solidity_emitter.rs` (Phase 167 dispatch refusal probe retired in place). Suites solo: bootstrap-codegen 997/0/29, no-Z3 852/0/22, default 996 + 1 proven `list_fold` Z3-timeout load flip in `phase163_registry_seed` (2/0/0 solo).
- **1.8 Smart-Contract Target (`--target solidity`) scope audit (Phase 167)** — [`IKONIK_18_AUDIT.md`](IKONIK_18_AUDIT.md): first milestone on the Ikonik rung, audited against v1.7.0 (`80c10a2`) with zero product code and 8 executable probes (`tests/phase167_solidity_probes.rs`). Measured real gaps across codegen (`--target solidity` / `sol` currently refused; CLI `with_extension(target)` writes `.solidity` instead of `.sol`; `bootstrap-codegen` isolates `"rust"` so zero M3/M5 cascade; `WinnerReport.renders` pinned at 6 with 18,868 B WASM headroom), types (7 scalar / 18 direct-ABI of 35 stdlib entries across 13 IR nodes incl. `IRBinOp::Append` on fixed-length Solidity `memory` arrays; `Int` must map to `int256` not `uint256`; `U64` has no Z3 `>= 0` bound; `U256`/`Address` bind `Sym::Opaque`; `Expr::IntLit(i64)` caps literals at `i64::MAX`; Z3 Euclidean vs EVM truncating negative division, agreeing identically on non-negative domains), preconditions (`constraint_to_rust` degrades `len`/`Index`/`Forall`, so Solidity needs a dedicated `require(...)` walker with hard refusal on quantifiers/unrenderable forms), toolchain (`solc`/`forge` absent locally; `node` v24 + `npm` present → pinned `solc-js` + Node EVM harness in scratch `target/`), and 6 pure/view DeFi exhibits (`fee_bps`, `debit_balance`, `bounded_payout`, `linear_vested`, `can_withdraw`, `non_empty_batch`) all crowning Tier-1 / Z3-Verified and re-verifying as PCC bundles today. D1–D9 recommended (a) and ratified by the owner on 2026-11-26. Suites solo: bootstrap-codegen 989/0/29, no-Z3 844/0/22, default 988 + 1 proven `list_sum` Z3-timeout load flip (probe binary green 8/0/0 solo).
- **Windows test-harness portability + `.gitattributes`** — added `.gitattributes` (`* text=auto eol=lf`; `*.wasm`, `*.vsix`, `*.bin` marked `binary`) so clones on Windows preserve checked-in LF byte masses (`packages/bundles/` 267,156 B, `registry/index.json` 10,927 B, `packages/npm/` 71,873 B) and SHA-256 catalog digests without manual `core.autocrlf` tweaks; fixed test-only Unix assumptions across 10 integration test files (`npm.cmd`/`tsc.cmd` in Phase 121, `/` path normalization in Phases 129 & 158, built-in `tar` fallback for `.vsix` inspection in Phases 156–157, `HOME` → `USERPROFILE` + `EXE_SUFFIX` fallback in Phases 158–161, `sha256sum` → `registry::sha256_hex` fallback in Phase 166, and explicit `stream.set_nonblocking(false)` + `shutdown(Write)` on accepted localhost test sockets in Phases 164 & 166 to fix Winsock2 nonblocking inheritance). Zero product logic, dependencies, or frozen scope documents touched. Suites verified solo on Windows without manual `HOME`: **981/0/29 · 981/0/29 · 837/0/22**.
- **v1.7.0 released (Phase 166 closing)** — the 1.7 gate passed in full (§10, five clauses, fresh instrument; the gate text was never amended); PR #18 merged (`be7bf03`) with CI inspected before merging (run 1 red at the new catalog step — the workspace test build's feature unification left a wasm-playground-featured binary at the step's path; fixed CI-infrastructure-only, run 2 green in full); annotated tag `v1.7.0`; GitHub Release Latest with four assets (linux tar.gz, windows zip, `morphic-library.wasm` 96,100 B, `morphic-callbacks.wasm` 81,840 B); Pages deployed on the merge push; post-merge master suites 981/981/837 fully green. The canonical registry index URL is live with the merge, and the closing stranger verification installed both exhibits from it into a scratch dir — hash-bound, re-verified at install, receipts recording the URL, a caller checking against that state. npm + crates.io 1.7.0 publishes are the owner's acts (both dry-runs clean from the tagged tree); the `.vsix` remains a sideload artifact. **The Disebar rung is complete** (1.4 MCP + PCC · 1.5 edge + LSP/VS Code · 1.6 Component Model · 1.7 registry).
- **Discovery at the prelude funnel (Phase 165)** — [`DISEBAR_17_SCOPE.md`](DISEBAR_17_SCOPE.md) §7 built: registry-installed bundles now join the prelude as a layer behind `stdlib::{prelude_specs, shipped_body}` — the two functions the typechecker, the SpecIndex merge, codegen, the API, and through it the MCP tools and the LSP all read — so an installed entry is callable, judged, and generated in every shell with no per-shell wiring. The layer reads the install directory once per process, native-only (the browser build's prelude is its runtime asset; the layer is compiled out there). Precedence **user > stdlib > installed** is enforced at the funnel itself: an installed name the stdlib holds is never yielded (a hand-planted stdlib-named bundle with a forged receipt is inert, and named as inert), and a user's own definition shadows an installed entry at the standing merges. **Discovery does not re-verify** — install ran the proof and the receipt records what it measured; discovery trusts the receipt + the file's presence, checking only identity (the file's sha256 against the receipt, the bundle and spec naming the receipt's entry, the IR text reading) — `registry verify` remains the re-check verb. Degradation is named, never silent and never breakage: a corrupt ledger empties the layer with its reason stated (the CLI's check/build/synthesize shells print it on stderr), one damaged bundle degrades that entry only, receipt-less files are named as not-installs, and an absent directory is byte-identical to today's prelude (the frozen 35, in order, no diagnostic). The asset and the collision check now enumerate the stdlib layer alone (`stdlib_specs()`), so a machine's installs never enter the playground's checked-in asset and the install refusals stay distinct. Pinned by 8 teeth across four binaries (funnel shape + inertness; a caller typechecking, judging executed-exact, and rendering through the installed body; user shadowing; Tier-2 callability by the executed route; both degradation shapes; absent-directory byte-identity). Suites 973/973/829 — fully green in the three frozen configurations.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "morphic"
version = "1.7.0"
version = "1.8.0"
edition = "2021"
description = "Self-Synthesizing Programming Language — write specs, not implementations"
license = "MIT OR Apache-2.0"
Expand Down
Loading
Loading