Files
marqdo-cli/docs/architecture
cflmy a67f344b6b ext(00-08): RFC-EXT-0003 core/extension boundary, math detach and release stdlib
Implements issue #3 (RFC-EXT-0003) slices on the post-3.0.0-beta.1 tree.

PR-00/01/H-06: reproduce and fix sibling heading mode inheritance.
build_units now pops the current and same-or-higher-level headings from the
ancestor stack before deriving the inherited mode, so an unmarked heading can never
inherit the previous sibling. Covered by the units matrix, conformance fixtures
22/23, and black-box heading_inheritance through check --emit/run/call.

PR-02/H-08: the deterministic release archive now ships the complete verified
stdlib/ tree. package.py and smoke.py recompute the runtime tree/alias digests,
record them in RELEASE_INFO.json.stdlib, and fail on mismatch; smoke removes the
bundle and requires a fail-closed run. Release discovery no longer falls back to the
compile-time source tree (debug builds keep that development convenience).

PR-03/H-04: one marqdo_host::CORE_RESOURCE_KINDS registry is used by both the CLI
provider-manifest validator and every trusted host registration path; all six core
kinds are rejected as provider name or declared kind before registration.
H-03: docs/architecture/resource-operations.md records every reviewed
resource_request operation and architecture_boundaries pins the exact allowlist; new
domain operations are forbidden in core (ADR-0062).

PR-04/H-01: remove math.parse/eval/substitute/simplify/differentiate from
BUILTINS, HostOp, the runtime, the host kernel and the workspace
(crates/marqdo-math deleted). Formula stays inert; Int/Float arithmetic stays.
Math algorithms are a pure examples/math-library package plus an optional
examples/math-backend ABI plugin that requests the math.compute capability
(ADR-0061). Removed calls are static symbol.unknown; the math import namespace is
released again. Tests/examples/specs migrated; new math_library black-box test.

PR-05/06 Step A: ADR-0060 classifies @exec/@knowledge as the closed Core Modes
and specifies the Proposed metadata-only Heading Annotations v1 (target 3.1,
sem.invalid_mode_marker unchanged, Analysis v2 unchanged). ADR-0063 records the
foreign F-A retention and deferred F-B removal.

Docs/status/compatibility/changelog and the RFC-EXT-0003 evidence file are updated.
Full local gate: cargo fmt PASS, clippy -D warnings PASS, workspace tests 586
passed/0 failed/2 ignored, python tools/ci 28 passed.
2026-11-22 18:57:33 +08:00
..

Architecture RFCs: current state, decisions and design input

Status: index. The single current architecture overview is CURRENT.md. This page only indexes frozen decisions, design input and evidence. It is not a second running-status page.

Design input and implemented contracts

Document Status What it is
Unified semantics RFC-LANG-0002 Adopted and implemented Single syntax: heading modes, unified payloads, keyword control flow, breaking migration and acceptance gates.
Architecture audit and refactor RFC Review input (historical) Responsibility convergence, stdio/file/stream correctness, CLI/Host split and the migration order at the time. Its language examples predate RFC-LANG-0002.
Runtime observability RFC-OBS-0001 Adopted and implemented (P0/P1) Typed host observation, Execution Events v1 NDJSON, frame identity, selected bounded values; P2 memory metadata remains deferred.
Compute machine RFC-0001 Proposed Opaque Memory, addressable regions, wire/host rejection. Compute semantics are unchanged by the syntax rewrite; its .mq.md examples are historical spelling.
Core and stdlib migration RFC-0002 Proposed Minimum core, .mq.md stdlib and system-capability migration. The stdlib source migration is complete; current status is recorded in ../STATUS.md.
RFC-EXT-0003 core/extension boundary (issue #3) Adopted slices in ADR-0060–0063 H-01/H-03/H-04/H-05/H-06/H-07/H-08/H-02 decisions; heading annotations are Step A (Proposed), foreign F-B deferred. See resource-operations.md and spec/heading-annotations-v1.md.

The implemented first slices of these RFCs are recorded in CURRENT.md and ../STATUS.md; the RFC text itself never proves that code exists.

Decisions already frozen

RFC item ADR State
Unified Markdown semantics, heading modes, payload carriers, keyword control 0052 Accepted and implemented (ffd1cc9)
Execution scope (H2 functions only; carrier roles superseded) 0002 Accepted in part; mapping superseded by ADR-0052
CM-A01 Memory identity/lifetime 0022 Accepted
CM-A02 page size, growth, budgets 0022 Accepted
CM-A03 place assignment and evaluation order 0022 Accepted
CM-A04 minimal structure observation/construction 0023 Accepted
CM-A05 recoverable Result convention 0024 Accepted
CM-A06 minimal Resource/Stream ABI 0025 Accepted (first slice)
CM-A06 buffered project-file write 0026 Accepted
CM-A07 print migration staging / Compat-A 0027 Accepted (Compat-A only)
CM-A10 bundled stdlib / std: imports / digest 0028 Accepted (first slice)
Full-value stdlib formatting / FunctionRef+PluginHandle observation 0029 Accepted
CM-A07 Compat-B print routing 0030 Accepted
CM-A07 Compat-C remove legacy print formatting 0031 Accepted
CM-A08 table logical value / stdlib algorithms / T0 storage 0032 Accepted
CM-A09 in-process ResourceProvider v1 0033 Accepted (trusted in-process slice)
P5 blocking TCP resource endpoint v1 0034 Accepted (IP-literal, no DNS/TLS)
CM-A09 worker resource-provider transport v1 0035 Accepted (trusted helper)
CM-A09 C ABI ResourceProvider v1 0036 Accepted (trusted native adapter)
CM-A09 provider package manifest v1 0037 Accepted (host-side install)
CM-A09 C ABI provider worker binding v1 0038 Accepted (trusted helper)
Stdlib extraction deferral 0039 Accepted (in-repo for now)
Stdio stdin/stderr plus stdlib stream/console APIs 0040 Accepted (stdin read, separate stdout/stderr, product stdlib)
Non-streaming resource.request fs.* operations 0041 Accepted (project mode, grant-checked, recoverable fs Result)
clock.now resource operation 0042 Accepted (project mode, Unix millis)
env.get resource operation 0043 Accepted (exact-name project grant)
process.run resource operation 0044 Accepted (exact program grant, project only, not a sandbox)
fs.append/fs.read_at/fs.walk 0045 Accepted (bounded content, directory walk)
random.bytes resource operation 0046 Accepted (explicit --allow-random, project only)
DNS/UDP/TCP-listener endpoints 0047 Accepted (project only, exact host grant, no TLS)
TLS client endpoint 0048 Accepted (rustls, validated, project only)
gzip compression operations 0049 Accepted (bounded byte-list gzip)
Host regex extension 0050 Accepted (project-mode groups/alternation/captures)
Byte-exact HTTP framing 0051 Accepted (byte-list HTTP/1.1)
Runtime observability / Execution Events v1 0059 Accepted and implemented (P0/P1); memory metadata P2 deferred
Core modes and heading annotations 0060 Core modes implemented; Heading Annotations v1 Proposed/not implemented (target 3.1)
Detach domain math kernel 0061 Accepted and implemented; math.* removed, pure package + ABI backend
Resource operations and core kinds 0062 Accepted and implemented; architecture gate pins the reviewed lists
Foreign F-A transition 0063 Accepted: retained F-A primitive; F-B deferred
Table physical storage (T1/T2/T3), strict stdin/stderr/file/network resources — Not decided; do not implement by implication

Evidence and status

  • Executed test counts, platform lanes and release blockers live in ../STATUS.md. Do not repeat them here.
  • SHA-pinned fact snapshots live in ../evidence/.
  • Superseded planning input lives in ../history/, and its remaining files carry a Historical banner.

What a future phase must not do

  • add a top-level CLI command or Markdown keyword for memory, allocation or I/O;
  • add a HostOp for every new stdlib function;
  • turn managed List/Map/Table into aliased mutable storage;
  • expose a host pointer, let a handle cross the wire, or claim block-level safety for user allocators;
  • make strict accept an unverified provider by default;
  • claim an RFC phase is complete without the closure and negative evidence its phase gate requires;
  • edit a gate result in ../STATUS.md without an executed log or a source path.