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.
This commit is contained in:
cflmy committed 2026-11-20 10:44:03 +08:00
1 parent 2e49c7b855
commit e1ba630068
18 files changed
+1803 -28

No files matched your search

+1 -2
View File
@@ -36,7 +36,6 @@ marqdo-frontend = { path = "crates/marqdo-frontend" }
marqdo-math = { path = "crates/marqdo-math" }
marqdo-foreign = { path = "crates/marqdo-foreign" }
marqdo-plugin-abi = { path = "crates/marqdo-plugin-abi" }
marqdo-plugin-sdk = { path = "crates/marqdo-plugin-sdk" }
marqdo-host = { path = "crates/marqdo-host" }
marqdo-runtime = { path = "crates/marqdo-runtime" }
marqdo-package = { path = "crates/marqdo-package" }
@@ -45,7 +44,7 @@ comrak = { version = "=1.0.0", default-features = false }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yaml = "0.9"
num-bigint = { version = "0.5", features = ["serde"] }
num-bigint = { version = "0.4", features = ["serde"] }
num-rational = { version = "0.4", features = ["serde"] }
num-traits = "0.2"
sha2 = "0.10"