RFC-LANG-0002 allows a mode declaration only as an ATX heading prefix; a
Setext heading merely inherits the nearest ancestor mode. heading_declaration
was applied to every heading, so a Setext 'title' beginning with @exec/
@knowledge silently switched modes and could create a function.
- skip declaration parsing for Setext headings (they keep their literal name
and inherited mode); add a regression test
- remove the dead normalized_heading_name helper and its imports, which only
existed for the removed link-form call resolution
Verified: clippy -D warnings clean; cargo test --workspace --locked green
(505 passed, 0 failed, 2 ignored).
A stray end after an earlier statement was reported with the span of the
previous payload (position-1) and a confusing 'ends outside its owning
function segment' message. Report it on the end payload itself with the
standard sem.unmatched_end wording, and pin the span with a unit test.
Verified: clippy -D warnings clean and cargo test --workspace --locked
green (62 targets).
signature::detect() scanned the function body independently of heading
modes, skipping only level>=3 headings. A 'params(...)' code span in an
### @knowledge section was therefore taken as the function signature
('inspect --signature' reported it as explicit), even though that span is
inert documentation and is never executed.
Unify recognition with the executable traversal:
- MappedBody now reports the params(...) payload the mapper accepted; the
mapper already enforces Exec mode, directness, first-function-wide
position and single declaration
- signature::from_payload validates that text and rewrites default-value
spans; signature::detect is removed along with its mode-blind heuristic
- analyze uses the mapper result, so Knowledge sections cannot declare a
signature and prose/Knowledge subsections may still precede the first
Exec declaration
- tests: Knowledge params ignored; Exec params after prose/Knowledge is the
signature; spec/mapping.md states the recognition rule
Verified: clippy -D warnings clean; cargo test --workspace --locked green
(62 targets).
Follow-up cleanup of text left by the concurrent implementation:
- marqdo-markdown AST, marqdo-ir statements/branch arms, frontend units,
payload and signature module docs now describe RFC-LANG-0002 roles
(payload carriers, heading modes, if/else groups, while/end, params)
- marqdo-expression public docs list parse_payload_statement and stop
describing a Markdown-link call that no longer exists
- retired markdown.invalid_construct/markdown.inert_executable constants
are documented as decode-only history for old Analysis/Trace JSON
- drop the stale 'expected red' comment in the CLI integration test
- the dev-only .mq.md review aid no longer reports semicolons inside
string literals, and skips AST baselines / expected-invalid negatives
Verified: fmt, clippy -D warnings and cargo test --workspace --locked green.
The pre-RFC link-form block-quote call was removed by RFC-LANG-0002, but the
IR still carried Stmt::Call, CallSite and CallTarget with matching branches in
the runtime, infer, call validation, loader, analysis projection and JSON
output. No mapper produces that variant any more, so it was a second call
representation that could never be reached.
- remove Stmt::Call, CallSite and CallTarget from marqdo-ir
- remove the runtime exec_call_site path and every exhaustive match arm
- remove the 'call_site' Analysis node and its JSON helpers
- state in spec/analysis-v2.md that calls are expressions; keep v1 as history
with a note that call_site is not produced by the current language
Verified: cargo clippy --workspace --all-targets -D warnings clean and
cargo test --workspace --locked green (62 targets).
The concurrent mapper tracked the first params declaration in the Mapper (so
duplicates across heading segments were caught) but checked 'first payload'
with a per-segment vector index. A params(...) in a later ### @exec segment
was therefore accepted even after an earlier segment had executed statements,
and a duplicate could even be reported as a position error.
- track whether any statement has been lowered for the function and require
params(...) to come before it, across all heading segments
- check duplicates first, then execution order, then the in-segment index
- add negative fixtures 48 (after an earlier segment) and 49 (duplicate
across segments); update the corpus count and spec wording
Verified: cargo test --workspace --locked green (62 targets).
Update status, compatibility, changelog, README, architecture overview,
ADR status, migration guide, contributor/CI/security/release notes and
the per-file inventory from 'migration pending' to the verified state:
- language SHA ffd1cc9: fmt/clippy clean, workspace 501 passed / 0 failed
/ 2 ignored, stdlib digest regenerated and pack-verified
- green evidence report added; the prior intermediate evidence is marked
superseded
- inventory regenerated: 1015 classified files, 0 pending
- explicit non-claims: Windows/macOS native lanes and the disposable-VM
strict lane were not re-run at this SHA, so the release decision remains
DO NOT RELEASE
Verified: cargo test -p marqdo-cli --test docs_consistency (4/4) and
git diff --check.
Move keyword recognition out of the Markdown mapper and into the single
expression/statement parser:
- add parse_payload_statement + PayloadStatement for if/else/while/end/
return/params/ordinary; keyword matching uses complete tokens, requires
whitespace before a control expression, rejects trailing tokens/colons
and reserves the statement words in expression positions
- keep expression spans payload-relative so the frontend can rewrite them
onto the file; malformed params(...) interiors stay owned by the
signature parser (one sem.syntax diagnostic, not a duplicate)
- simplify the frontend mapper to control-stack lowering and mapped
semantic diagnostics only
- emit sem.no_entry_function from run when no Exec H2 main exists
- add else-under-while, params-in-quote, Knowledge-inertness and
no-entry tests; update the corpus counts
- make the EBNF parameter type annotation optional (params(n) is valid)
Verified: cargo fmt --check, cargo clippy -D warnings and
cargo test --workspace --locked: 501 passed, 0 failed, 2 ignored.
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).
Replace the Strong/Emph/List/Quote mapping in place with the single
@exec/@knowledge heading-mode model, unified payload carriers and keyword
control flow.
- add the authoritative RFC, ADR-0052 and a historical ADR index
- rewrite spec/mapping.md and spec/expression.ebnf as the normative
mapping/statement grammar; update evaluation, references, math,
foreign, package-format, plugin-abi, security and schema notes
- rewrite README, AGENTS, COMPATIBILITY and CHANGELOG for the breaking
language change; update the architecture index/overview and active docs
- mark superseded planning docs, compute RFCs, evidence and syntax-role
ADRs as historical/superseded without rewriting their decisions
- add migration guide, per-file inventory and dev-only audit scripts
The frontend/stdlib migration is completed in the following commits; this
commit contains documentation only.
The workspace test suite includes python/node foreign kernels; the Rust image
has Python but not Node, so marqdo-foreign tests failed with KernelUnavailable.