Commit Graph
35 Commits
Author SHA1 Message Date
cflmy 74e34c668b fix(ci): remove empty-directory dependency from prose property test (B-01)
The property test builds all fixtures in code but asserted that
tests/properties/ existed. Git does not track empty directories, so a fresh
clone failed before exercising the invariance checks. Drop the assertion and
the now-unused repo_root helper; keep every prose-invariance assertion intact.

Record the S0/H0 local gate and the pending CI URL in STATUS.
2026-11-20 12:47:38 +08:00
cflmy c779f6c24e fix(m0.6): worker manifest independence and status reconciliation
- pass workers an explicit temporary manifest so plugin.yaml naming is not a
  hidden constraint
- remove temporary manifests after handshake
- reconcile STATUS with implemented multi-export, broker, worker, handle,
  Git/env and CI behavior; document strict isolation as the remaining blocker
2026-11-20 11:53:07 +08:00
cflmy 44c2df2361 feat(m0.6-r2): isolated plugin worker transport
- add a hidden __plugin-worker mode that loads one native library in a child
  process and serves length-prefixed JSON invoke frames
- add host WorkerPlugin with ready handshake, export cross-check, per-call
  timeout and crash/EOF propagation
- route kind: worker without in-process trust; native still requires explicit
  trust; wasm is rejected explicitly
- report worker_processes=true while keeping strict OS isolation unavailable
- test successful worker calls and worker crash isolation
- update plugin ABI spec and R2 status
2026-11-20 11:52:26 +08:00
cflmy 4ce37afb39 feat(m0.6-r6): release examples, public schemas and cross-platform CI
- add runnable examples for an unknown-name Tool, multi-export plugin,
  external kernel provider and same-name multi-version packages
- add JSON Schemas for Analysis v1, Trace v1 and Tool v1 and validate them in CI
- extend CI with protocol/consumer smoke tests and a Windows/macOS cargo check
- add --kernel provider descriptors and R6 example integration tests
- document the examples and update M0.6 status
2026-11-20 11:50:27 +08:00
cflmy 54c7b43d15 feat(m0.6-r5): pinned Git packages and materialized environments
- add content-addressed Git checkout cache for exact revisions; no hooks,
  submodules or floating branches
- resolve transitive @alias imports from each package's own manifest
- materialize locked path/Git packages into .marqdo/env atomically and prefer
  a matching env copy in the resolver
- make sync a real environment sync while keeping lock immutable
- kill Unix foreign-kernel process groups so grandchildren do not survive
- add Git/env/transitive integration tests and update package/security specs
2026-11-20 11:49:05 +08:00
cflmy b5a28a9825 feat(m0.6-r4): public Analysis v1 and Trace v1
- add check --emit with a deterministic, read-only semantic projection:
  package-aware modules, signatures, normalized bodies, refs, calls,
  diagnostics and source digests
- remove stale analysis artifacts on compile errors; atomic writes
- add run/call --trace-file with interpreter call/branch/loop/return events
  and host effect events under one sequence; redact values and record error
  status
- add Analysis/Trace v1 specs, ADR-0015 and an independent Python consumer
- add contract tests for determinism, stale artifacts, trace ordering/status
  and secret redaction
2026-11-20 11:46:37 +08:00
cflmy 25a1faa6ef feat(m0.6-r3): generic external CLI Tool Protocol v1
- add tool install/list/remove and unknown-command dispatch without hardcoded
  tool names or clap variants
- validate and copy local tool packages atomically, reject entrypoint escapes
  and symlinks, record and re-verify SHA-256
- forward OsString args, stdio, cwd and exit status without a shell; never
  execute PATH programs implicitly
- add black-box tests for arbitrary names, Unicode args, built-in conflicts,
  traversal, version mismatch, tampering and PATH hijacking
- add ADR-0013 and mark R3 complete
2026-11-20 11:44:20 +08:00
cflmy 7797d78d86 feat(m0.6-r2): host-owned plugin handle authority
- add PluginHandleTable with owner, run id and generation scoping
- reject forged, cross-owner, cross-run and post-unload handles
- reject any plugin_handle returned by plugin or foreign-kernel output,
  including nested values
- add ADR-0014 and update value-wire/security specs
2026-11-20 11:43:21 +08:00
cflmy d940013f35 feat(m0.6-r2): complete-name plugin exports and capability broker
- register every plugin export by its complete dotted name; reject conflicting
  loads atomically instead of overwriting the first namespace
- route plugin calls by full export name and expose loaded descriptors to the
  runtime
- add CapabilityBroker for core grants and vendor policy, with audit records
- accept syntactically valid vendor capability requests in manifests while
  still denying them until a trusted policy exists
- add check --plugin static signature validation without dlopen
- test multi-export C plugin routing, conflict rollback, broker decisions and
  static arity rejection
2026-11-20 11:42:33 +08:00
cflmy 21c1e50617 feat(m0.6-r2): explicit foreign kernel provider registry
- add KernelDescriptor/KernelRegistry with built-in Python/Node providers
- route run/call through the registry; external providers need an explicit
  executable and wire version
- expose provider registration on StdHost and use it in the foreign adapter
- add mocklang registration/call, duplicate-label, wire-version and timeout tests
- update spec/foreign.md and M0.6 progress
2026-11-20 11:39:14 +08:00
cflmy 4ecf537141 feat(m0.6-r1): unified callable registry
- add CallableId/Descriptor/Origin and CallableRegistry in marqdo-ir
- include builtins, Marqdo functions and declared ABI exports in one static
  lookup model with deterministic conflict rules
- validate declared plugin export signatures in the frontend without loading
  any shared library
- add registry and frontend static-plugin-signature tests
2026-11-20 11:38:04 +08:00
cflmy 5877d9aa5e feat(m0.6-r1): package-aware module identity and resolver
- replace path-only ModuleId with {instance, relative_path} and canonical
  <instance>::<path> encoding
- add PackageResolver/ResolvedPackage in marqdo-package for path sources;
  hash package trees deterministically for content-addressed instance ids
- move import resolution out of the CLI loader; reject package escapes
- emit lock_version 2 with instance ids and migrate v1 lockfiles
- update references/package-format specs and the function-ref golden
- add package resolver tests for stable identity across path moves
2026-11-20 11:37:16 +08:00
cflmy fae0cd4b18 fix(host,cli): enforce console capability and label call --json output
- host: `打印` checks the console capability at the execution point (pure and
  project modes grant it, but the boundary is now real instead of decorative).
- cli: `marqdo call --json` reports "command":"call" instead of "run".
2026-11-20 10:56:26 +08:00
cflmy 2f1b10d0ee feat(cli): surface compile warnings on run/call
Non-error diagnostics (for example `markdown.inert_executable` for a would-be
execution node outside any function body) are now printed to stderr before
execution and included in `--json` run output, instead of being silently
hidden on a successful run.
2026-11-20 10:54:27 +08:00
cflmy 847c2c1580 fix: float wire precision, native stack safety, refs diagnostics and fixtures
Findings from the conformance corpus workstream, all fixed at the source:

- value/wire: enable serde_json's float_roundtrip so typed wire floats keep
  their exact digits across foreign/plugin boundaries (Python pi*9 now stays
  28.274333882308138).
- host: default interpreter stack budget lowered to 128 frames so deeply
  recursive documents hit a structured resource.exhausted instead of exhausting
  the native debug-build Rust stack; --stack remains available.
- frontend/map: calling an external HTTP(S) link is reported as ref.unresolved
  (consistent with other unresolvable call targets) instead of math.unsupported.
- frontend/analyze: invalid front matter emits a single frontmatter.invalid
  diagnostic (the YAML error is not repeated by the imports pass).
- spec/mapping: clarify that would-be execution nodes outside any function body
  are inert with a markdown.inert_executable warning (no "return outside a
  function" hard-error claim).
- tests: add the conformance corpus and harness (150 AST goldens, 36 semantic
  goldens, 48 hard-error + 6 warning + 10 runtime-error negatives, CLI/module/
  plugin integration tests, prose-invariance properties) and update the
  three reported observations to the fixed behaviour.
2026-11-20 10:54:16 +08:00
cflmy 33341a0e92 feat(cli): check --refs validates Markdown reference targets
Blueprint section 4.2: reference edges are static, never execution.

- For every loaded document, resolve same-document anchors, relative file
  links and target anchors (analysing referenced files statically without
  executing them); unresolved targets produce `ref.unresolved` errors with
  source spans.
- External HTTP(S) links are treated as external references, not errors.
- `inspect --refs` continues to print the resolved edge graph as JSON.
2026-11-20 10:51:54 +08:00
cflmy 7fbd5e9ec1 feat(host,runtime,cli): explicit plugin invocation from documents
Blueprint section 10 / P6: exports of an explicitly trusted plugin are callable
from a `.mq.md` file through a bound namespace.

- host: StdHost::load_plugin requires an explicit trust decision and a granted
  plugin capability, loads the native artifact through the ABI v1 loader with
  no capability handler (all plugin host-capability requests denied), and
  dispatches HostOp::PluginInvoke through the typed wire request/response.
  In-process native code is documented as sharing the host address space; no
  isolated worker transport exists in this build.
- runtime: a qualified call whose base is not a local value, import alias or
  builtin namespace is routed to the plugin namespace; plugin calls take named
  arguments only and plugin values become Marqdo values (Unit when absent).
- cli: run/call gain `--plugin <path>`, `--trust-native-plugin` and reuse
  `--allow-plugin <package>`; missing trust/grant/loaded namespace surface as
  structured errors.
- frontend: member-call bases are namespaces (builtin/import/plugin), never
  inferred parameters, so `solver.add(...)` does not invent a parameter.
2026-11-20 10:46:23 +08:00
cflmy 6f04c17f7a feat(cli,package): add/remove dependencies and cleaner manifest serialization
- `marqdo add <name> --path <dir>` / `--git URL --rev SHA` and
  `marqdo remove <name>` edit marqdo.yaml only after validating the dependency
  source (path-relative, git pinned by exact rev, no duplicate entry).
  Removing a dependency also drops its stale lock entry; locking stays an
  explicit step so no version changes happen silently.
- Manifest serialization omits empty dependency/plugin maps and empty
  capability requests, keeping generated manifests readable and stable.
2026-11-20 10:45:07 +08:00
cflmy 3d1c37d217 fix(markdown): flatten AST kind into node JSON objects
`inspect --ast` and AST goldens now show `{"kind":"heading","level":2,...}`
instead of a nested `{"kind":{"kind":"heading",...}}` object, matching
spec/markdown-profile.md section 5 and the shape new contributors expect.
2026-11-20 10:44:14 +08:00
cflmy e1ba630068 feat(cli): marqdo init/run/call/check/inspect/fmt/plugin/lock/sync
Composition root wiring the frontend, runtime, host and package layers:

- Project loader: deterministic project-root discovery, explicit front-matter
  imports only (`@dependency` or relative `.mq.md`), recursive module loading
  with cycle diagnostics, resolved import edges and cross-module call checks.
  Loading never executes anything.
- run/call: sandbox mode enforcement (strict refuses when unavailable),
  explicit capability grants, fuel/stack/output/timeout overrides, typed
  `--arg name=value` constants, program stdout separated from diagnostics, and
  machine-readable JSON output that embeds program output without mixing.
- check: static diagnostics only, human-readable locations with source lines
  and stable machine codes in JSON.
- inspect: canonical AST, heading units, signatures (explicit/inferred),
  executable IR, static reference edges (including cross-file links analysed
  without execution) and platform capability report.
- fmt: conservative, AST-preserving normalisation of line endings and trailing
  newlines; --check mode.
- plugin inspect: manifest/ABI/artifact validation and hash verification,
  never loading plugin code.
- init: minimal project (manifest, entry document, .gitignore).
- lock/sync --locked: deterministic path-dependency lockfile, stale lock or
  changed dependency content is an error (no silent upgrades).
- examples: hello, factorial, math formula, Python foreign call, static
  references and a two-module project with an explicit import.
2026-11-20 10:44:03 +08:00
cflmy 2e49c7b855 feat(runtime): tree-walk interpreter for Marqdo IR
Blueprint sections 7.2 and 3: Marqdo executes with its own Rust interpreter.

- Frames with isolated scopes, named/positional argument binding, explicit
  signature rules, compile-time constant defaults evaluated in an empty frame.
- Statements: assignment, expression statements, link-form calls, branch
  (first true arm), loop (condition re-evaluated, return propagates), return.
- Expressions: exact Int arithmetic, `/` always Float, mixed arithmetic Float,
  exact Int/Float comparisons via rationals, Text concatenation, short-circuit
  and/or, Bool-only conditions, indexes with negative positions, map/Formula/
  Code member access, calls (same module, imports, FunctionRef values).
- Builtins: print/len/type/str/int/float/table/ref plus capability-host
  dispatch for math.*, foreign.*, fs.*; `ref` resolves functions or exactly one
  inert resource and errors on ambiguity instead of picking the first.
- Fuel, stack-depth and wall-clock budgets are enforced; call errors carry a
  structured stack of frames.
- End-to-end tests: recursion, loops, explicit positional signatures, builtins,
  function references, non-Bool conditions, fuel/stack exhaustion, ambiguous
  references.
2026-11-20 10:43:59 +08:00
cflmy d54fda9e78 feat(frontend): cross-module call validation and builtin namespace inference
- calls: validate_program runs after a whole project is loaded and checks
  qualified calls through explicit import aliases against the imported module's
  signatures (missing function, missing/unknown arguments), plus qualified
  builtin calls such as math.eval; local calls stay checked by
  validate_module so diagnostics are not duplicated.
- infer: `math.eval(...)` / `foreign.call(...)` callee namespaces are builtin
  namespaces, not free variable reads, so they no longer become inferred
  parameters or unknown-variable errors. Explicit signatures behave likewise.
2026-11-20 10:43:59 +08:00
cflmy 3f8dce013b feat(package): project manifest, deterministic lockfile and root discovery
Blueprint section 8, minimum viable P3:

- marqdo.yaml parsing/validation: project identity, dependency sources (path or
  git with mandatory exact rev), plugin requirements, capability requests;
  absolute dependency paths, ambiguous sources and unpinned git are errors.
- marqdo.lock: lock_version, sorted packages, canonical YAML with no
  timestamps or machine paths so repeated locking is byte-identical.
- discover_root walks up to the nearest marqdo.yaml.
- Manifest::template for `marqdo init`.
2026-11-20 10:43:59 +08:00
cflmy 6da206a906 feat(plugin-abi,sdk): versioned C ABI v1, host bindings, Rust SDK and C example
Blueprint section 10: a first-class plugin ABI independent of the legacy
MARQDO_ABI_VERSION=2, with a C ABI that is explicitly not a sandbox.

- include/marqdo_plugin_abi_v1.h: frozen stable-layout C contract with
  documented buffer ownership/lifetimes, size limits, NULL/zero-length
  semantics, single-threaded invocation, no hot-unload policy, version
  negotiation and target-triple requirements.
- marqdo-plugin-abi (host side): repr(C) mirrors with compile-time layout
  assertions, major/minor negotiation (wrong major fails, minor clamps),
  plugin.yaml parsing/validation, target selection and sha256 artifact
  verification, wire_version 1 typed JSON request/response envelopes,
  structured PluginError, and a libloading-based loader with host alloc/free,
  export registration and runtime ABI re-negotiation.
- marqdo-plugin-sdk (plugin side): mq_plugin_entry! macro, panic containment,
  safe byte-buffer wrappers, capability/logging context and JSON helpers; it
  depends only on the shared ABI crate.
- examples/plugin-demo: dependency-free C plugin (solver.add), manifest,
  build.sh that refreshes the artifact hash, README explaining that install,
  inspect and load are three different trust decisions.
- Tests: C plugin cross-compiled with cc and loaded, plus wrong ABI major,
  missing symbol/artifact, hash mismatch and malformed manifest cases.
2026-11-20 10:43:59 +08:00
cflmy f6c3efa849 feat(math,foreign): native formula kernel and isolated Python/Node kernels
Marqdo-math: limited, documented LaTeX-subset kernel (blueprint section 5).
- Exact BigRational arithmetic, structured Float only for irrational results;
  Int result when exact; bounds on exponents, source size, AST nodes and result
  bits so hostile input cannot hang or exhaust memory.
- Supports numbers, Unicode identifiers, \pi/\e, + - * / ^, \frac, \sqrt,
  \cdot/\times, braces, parentheses, one '=' equation, and linear solving for a
  target variable (F=ma solved for F/m/a).
- Unsupported constructs are structured errors; the kernel never claims any
  mathematical proof.

Marqdo-foreign: explicit kernels (blueprint section 6).
- run/call/detect only; reading a document never spawns a process.
- Direct exec of python3/python/node with a temp program file, clear env,
  private cwd, JSON request envelope on stdin, captured bounded stdout/stderr,
  wall-clock timeout with kill, typed wire decoding for call, structured
  ForeignError for spawn/protocol/timeout/oversized output.
- Process isolation only: crate docs state this is not a strict OS sandbox.
2026-11-20 10:43:50 +08:00
cflmy 17b68da7f9 feat(host): capability host, budgets, effect tracing and kernel adapters
Implements the single side-effect boundary from blueprint sections 7.3 and 9:

- Capabilities: console/math, project-relative fs globs, net hosts, process,
  foreign, plugins; pure/project defaults deny external I/O and grants are
  explicit, checked at execution time (never at parse time).
- Budget: evaluation fuel, call-stack depth, program output bytes and a
  wall-clock deadline, all reported as resource.exhausted.
- EffectTrace: op/module/span/duration/result entries with no secret data.
- StdHost: canonical Host implementation dispatching print, fs read/write and
  the math/foreign kernels; all errors are structured RuntimeErrors, including
  a permission.denied path with a grant hint.
- ProjectFs: project-rooted, rejects absolute paths, `..` traversal and symlink
  escapes outside the root; bounded UTF-8 reads and safe writes.
- Math adapter: parse/eval/substitute through marqdo-math with exact rational
  binding conversion and explicit unsupported-operation errors.
- Foreign adapter: capability-gated one-shot run/call through marqdo-foreign,
  typed wire input, structured result map, timeout/output limits mapped to
  budget errors.
2026-11-20 10:43:50 +08:00
cflmy d799617076 feat(sandbox): sandbox modes and honest strict-mode refusal
Blueprint section 9: advertise a security guarantee only when it can be
enforced.

- SandboxMode pure/project/strict with stable names.
- PlatformCapabilities detection reports strict isolation as unavailable in
  this build with an explicit reason; worker processes are reported false.
- enforce() refuses strict mode when OS-level isolation is not implemented,
  instead of pretending a cooperative in-process check is a sandbox.
- Pure/project modes remain available.
2026-11-20 10:43:50 +08:00
cflmy 46c9ca2fd3 feat(value,ir): ref.ambiguous error, exact conversion helpers and mixed builtin calls
- value: add ErrorCategory::RefAmbiguous (code ref.ambiguous) for the S-07 rule
  that a reference matching several resources must never silently pick the
  first one; re-export float/integer conversion helpers at the crate root.
- ir/builtins: math/foreign calls accept positional arguments followed by named
  ones (matching the documented examples) instead of being named-only; arity
  and unknown-name validation still apply.
- tests updated for the new builtin call shape.
2026-11-20 10:43:50 +08:00
cflmy 8003907f4e feat(frontend): heading scopes, semantic mapping, inference and call validation
Implement the P0/P1 frontend from spec/mapping.md, spec/evaluation.md:

- units: heading scope index (level-1 namespace, level-2 function, level>=3
  section), range computation, duplicate/empty-name diagnostics, GitHub anchor
  table kept separate from canonical ids, and warnings for would-be execution
  nodes outside function bodies.
- map: AST-to-IR mapping where role comes from node kind + position. Strong is
  an execution statement, Emph a return, ordered list a branch, bullet list a
  loop sequence, block quote a call; invalid shapes are hard
  markdown.invalid_construct errors, never prose fallback. Payload parsing
  errors are mapped from payload-relative to file-relative spans.
- payload: strict text/code payload concatenation with exact span mapping
  (including code-span delimiter handling) used to rewrite expression spans
  onto the source file.
- signature: optional `(name: Type = const)` paragraph declaration; defaults
  must be compile-time constants; duplicates and malformed declarations are
  errors.
- infer: definite-assignment data-flow parameter inference (must/may/ambiguous
  states, loop first-iteration handling, branch joins) per blueprint S-04.
- calls: static call validation of arity/named arguments/builtin signatures
  after all signatures are known; inferred signatures accept named args only.
- resources: inert Formula/Code resources with owning units and SHA-256
  content hashes.
- analyze: pipeline (parse -> units -> frontmatter imports -> map -> signature/
  inference -> module -> call checks) that never executes anything.

Tests include factorial recursion, loop counter, prose-invariance (IR equal
modulo spans), and hard-error cases.
2026-11-20 10:36:12 +08:00
cflmy 62a9af05fd feat(markdown,value): record code span delimiters, inert-executable code and profile refinements
- md code nodes now carry `ticks` (delimiter length) so executable payload
  offsets inside code spans map back to exact source bytes instead of pointing
  at backticks; this keeps diagnostics precise for mixed text/code payloads.
- value: add the markdown.inert_executable warning code and a small clippy fix,
  without changing the wire format.
- spec: document the code-span tick metadata, declare strikethrough lazy, and
  make the inert-execution warning explicit for nodes outside any function.
- workspace dependencies: add unicode-ident (grammar) and glob (capability
  path patterns) for the frontend/host layers.

Tests: 15 markdown + 10 value + 2 span tests pass; fmt/clippy clean.
2026-11-20 10:36:07 +08:00
cflmy 4db6e6afd6 feat(ir): executable IR, module/unit identities and builtin metadata
Add the independent program IR from blueprint sections 7.1 and 11:

- ModuleId, FunctionId and UnitId canonical identities; UnitInfo/UnitKind for
  heading scopes (root, namespace, function, section).
- Function with explicit or inferred signature metadata, params and defaults;
  assignments, expression statements, link-form calls, branches, loops and
  returns, all carrying source spans.
- CallTarget distinguishes same-module, import-alias-qualified and
  link-resolved calls.
- ImportDecl from explicit front-matter imports; Resource records inert
  Formula/Code artifacts with SHA-256 content hashes and owning units.
- Module anchors, resolved import edges and Program lookup helpers used by the
  runtime and CLI.
- Builtin registry (names, aliases, arity, named-only/effect flags) shared by
  static validation and runtime dispatch; adding a builtin is a spec change.

Prose is absent from the IR by construction, so narrative edits cannot change
the executable projection.
2026-11-20 10:35:54 +08:00
cflmy 9897ecc37f feat(expression): strict expression and statement grammar for executable payloads
Implement the independent expression parser frozen in spec/expression.ebnf:

- Unicode XID identifiers (Chinese names supported), reserved keywords
  true/false/None/and/or/not.
- Arbitrary-precision Int literals, binary64 Float literals (digits required on
  both sides, overflow rejected), double-quoted Text with \u{...} escapes.
- List and record literals, calls with positional-then-named arguments and
  trailing commas, member access, indexing, chained postfix operators.
- Precedence exactly as specified: right-associative ** with unary minus
  binding outside, multiplicative/additive, single non-associative comparison,
  short-circuit and/or.
- Assignment only as `identifier = expression` at statement start; no comments,
  no second Markdown parser, max nesting depth 128 with structured errors.
- parse_expression/parse_statement/parse_arguments never panic; ParseError has
  stable code expr.parse, payload-relative byte spans and Display/Error.

50 unit tests + 2 doctests, cargo fmt/clippy clean.
2026-11-20 10:35:49 +08:00
cflmy 10c0c0a013 feat(markdown): freeze the Markdown profile and canonical AST view
P0 baseline: one Markdown parser, one frozen option set, no silent upgrades.

- profile: CommonMark 0.31.2 core + GFM tables/strikethrough/task lists +
  dollar math + YAML front matter at byte 0, with every other extension
  disabled and asserted by tests. comrak is pinned to exactly 1.0.0.
- ast::MdNode: owned, serializable node tree carrying kind, byte Span and
  literal payloads. Nodes outside the profile are preserved as MdKind::Other
  instead of being dropped; task list items keep their checkbox state.
- frontmatter: extracts the YAML body from the parser node, parses it once,
  and exposes only the explicit `import` alias mapping; invalid YAML is
  reported, never guessed.
- text: strict executable payload extraction (Text/Code only, everything else
  is a hard error) and inert plain-text extraction for heading names.
- UTF-8 BOM is tolerated; all spans are re-based onto the original file.

No semantic mapping or execution exists in this crate by design.
2026-11-20 10:25:02 +08:00
cflmy 1520244923 feat(value): value model, structured diagnostics and wire format
Implements the shared data contract from blueprint sections 3.4, 7.2 and 10.3:

- Value: Unit/None/Bool/Int(BigInt)/Float/Text/List/Map/Table/Formula/Code/
  FunctionRef/PluginHandle; Unit and None stay distinct and there is no
  implicit string/number coercion.
- Diagnostic with stable machine-readable codes (markdown.invalid_construct,
  expr.parse, symbol.unknown, permission.denied, ...) and span/related/hints.
- RuntimeError with category codes and call frames; renders to a Diagnostic.
- Versioned, type-tagged JSON wire format (wire_version = 1) that keeps
  arbitrary-precision integers as decimal strings, tags NaN/Infinity, enforces
  depth/size limits on untrusted input and never trusts JSON numbers for Int.
- Byte spans and line/column mapping live in the new marqdo-span crate.
2026-11-20 10:24:13 +08:00
cflmy df878b434a chore(workspace): scaffold Rust workspace and crate graph
Create the Marqdo CLI Rust workspace with the module boundaries from the
development blueprint (section 11):

- marqdo-span: byte spans and line/column mapping shared by every layer
- marqdo-value, marqdo-expression, marqdo-markdown, marqdo-ir
- marqdo-frontend, marqdo-runtime, marqdo-host, marqdo-sandbox
- marqdo-math, marqdo-foreign, marqdo-package
- marqdo-plugin-abi, marqdo-plugin-sdk
- marqdo-cli (binary `marqdo`)

Pin the Markdown parser exactly (comrak =1.0.0, no default features) so the
frozen profile can never drift silently. Dependencies are centralized in
workspace.dependencies; no crate is allowed to add its own version of a shared
dependency.
2026-11-20 10:23:39 +08:00