4 Commits
Author SHA1 Message Date
cflmy e029853e32 feat(lang): implement RFC-LANG-0002 unified semantics (breaking)
One Markdown-to-program mapping, no version selector or legacy mapper.

Frontend/runtime:
- resolve @exec/@knowledge heading declarations with nearest-ancestor
  inheritance; only an Exec H2 is callable; add UnitKind::Knowledge and
  sem.* diagnostics (mode marker, unit name, exec-without-function,
  payload nesting/empty, syntax, control stack, params position,
  version directive, inferred-signature lint)
- extract Strong/Emph/inline Code as one-statement carriers, refuse
  nested carriers, and honour heading segment boundaries so an if/while
  cannot be closed across a heading
- lower if/else/while/end to the existing Branch/Loop/Return IR with a
  compile-time control stack; keep payload-relative source spans through
  expression parsing and rewrite them onto the file
- accept params(...) only as the first direct Exec H2 payload; keep the
  existing free-variable inference and named-only rule for inferred
  signatures; fix duplicate-mode/else/end and Knowledge-body inertness
- reject marqdo_semantics/syntax front matter directives

Data and tests:
- migrate stdlib/**/*.mq.md, regenerate stdlib.json digest
- migrate examples and the full semantics/negative/runtime corpus to
  the only current syntax; expected values/runtime codes preserved
- migrate Rust-embedded .mq.md fixtures, init template, CLI help and
  security-lane fixtures

Verified: cargo fmt --check, cargo clippy -D warnings and
cargo test --workspace --locked (green).
2026-11-21 12:26:46 +08:00
cflmy 313ac035e8 test(p2): prove foreign/plugin shortcuts fail in the pure lane
- Add negative tests: foreign.call -> permission.denied and plugin.invoke ->
  structured failure under --mode pure, complementing the 21-fixture pure lane.
- Update P2 evidence/tests README/changelog.

Gate: fmt, clippy -D warnings, 438 tests passed.
2026-11-20 23:29:14 +08:00
cflmy 8bbed34bd3 test(c12): add sparse-matrix triples and multiply fixture
- Fixture 73 implements triple-list lookup, dense conversion and sparse
  multiply with Int arithmetic and exact indexing.
- Include it in the P2 pure closure lane and update golden count to 73,
  C12 evidence mapping, status/README/changelog.

Gate: fmt, clippy -D warnings, 430 tests passed.
2026-11-20 23:19:45 +08:00
cflmy 0d4dc1da03 test(p2): close C01-C06/C11/C12 in a pure no-Foreign/no-Plugin lane
- Add crates/cli/tests/p2_closure.rs: 20 semantic fixtures run through the real
  CLI in --mode pure (Capabilities::pure), source scan for foreign./plugin./
  import:, and golden value/stdout comparison.
- Run the stdlib table self-test in pure mode; no host shortcut or recompilation
  is needed for the selected algorithms.
- Mark P2 gate PASS locally (external stdlib repo publication and remote CI
  remain outside the C01-C12 gate); add evidence and docs.

Gate: fmt, clippy -D warnings, 428 tests passed.
2026-11-20 23:12:03 +08:00