From 7a93fe8e7b5a035643b408ec03a7585aeb49975b Mon Sep 17 00:00:00 2001 From: Marqdo Agent Date: Sat, 21 Nov 2026 01:54:20 +0800 Subject: [PATCH] docs(evidence): record the doc and stdlib test migration gate --- docs/STATUS.md | 10 +++ docs/architecture/CURRENT.md | 12 +-- .../2026-11-21-docs-and-test-migration.md | 81 +++++++++++++++++++ 3 files changed, 97 insertions(+), 6 deletions(-) create mode 100644 docs/evidence/2026-11-21-docs-and-test-migration.md diff --git a/docs/STATUS.md b/docs/STATUS.md index 17eb570..b4994e2 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -219,6 +219,16 @@ This is still a **local VM lane**, not a self-hosted GitHub Actions security URL Rust `copy_file`; strict permits only the stdio stdout console channel and refuses stdin/stderr/file/TCP/provider resources (CM-A11 lane PASS). Semantic fixture 66 and CLI/host tests. +- Test and documentation migration (review RFC-CM P0/P2): + `crates/cli/tests/docs_consistency.rs` pins one current overview, the + status/index links and SHA-pinned evidence; `crates/cli/tests/architecture_boundaries.rs` + pins the workspace graph, `marqdo-runtime -> marqdo-host`, the bundled stdlib + digest and the stdio/file/TCP endpoints; `crates/cli/tests/stdlib_product.rs` + runs every public stdlib module (`console/format/http/io/stream/table/text/utf8`) + through `std:` imports over `stdlib/tests/*.mq.md`. `tools/pack-stdlib.py` + now sorts `.mq.md` by the same relative path key as the CLI. Source baseline + `04eae87`; later docs-only commits keep the code byte-identical. Evidence: + [`docs-and-test-migration`](evidence/2026-11-21-docs-and-test-migration.md). - Minimal structure observation/construction (RFC-CM CM-A04, ADR-0023): value-semantics `list.append/concat`, `map.keys/has/get/set/remove`, Unicode scalar `text.codepoints`/`text.from_codepoint`, and non-negative diff --git a/docs/architecture/CURRENT.md b/docs/architecture/CURRENT.md index 9a91307..fb61513 100644 --- a/docs/architecture/CURRENT.md +++ b/docs/architecture/CURRENT.md @@ -83,14 +83,14 @@ review RFC, not a new crate per provider. |---|---|---|---| | stdio stdin | `resource.open("stdio","stdin",["read"])`, `resource.read`, `resource.close`; one run-scoped cursor | implemented, read-only | `resource_streams`, `p2_closure`, `tests/conformance` | | stdio stdout | `resource.open("stdio","stdout",["write"])`, `resource.write`, `resource.close`; separate output budget | implemented | `stdlib_bundle`, `print_routing`, `resource_streams` | -| stdio stderr | `resource.open("stdio","stderr",["write"])`; separate from stdout and CLI diagnostics | implemented | `resource_streams`, `stdlib_bundle` | -| project file read | `resource.open("file", path, ["read"])`; path/grant checked; bounded | implemented, project mode | `resource_streams`, `tests/e2e` | -| project file write | `resource.open("file", path, ["write"])`; buffers until `close`, never flush-on-drop | implemented, project mode | `resource_streams`, `resource_file_write` evidence | +| stdio stderr | `resource.open("stdio","stderr",["write"])`; separate from stdout and CLI diagnostics | implemented | `resource_streams`, `stdlib_product` | +| project file read | `resource.open("file", path, ["read"])`; path/grant checked; bounded | implemented, project mode | `resource_streams`, `stdlib_product` | +| project file write | `resource.open("file", path, ["write"])`; buffers until `close`, never flush-on-drop | implemented, project mode | `resource_streams`, `stdlib_product` | | file metadata / directory / rename / remove / mkdir | not part of the current Resource contract | **not implemented**; needs a separate Resource Operation ADR | — | | TCP | `resource.open("tcp", ip:port, ["read","write"])`; exact IP grant, 5 s timeout | implemented; no DNS/TLS/server socket/UDP | `tcp_endpoint`, `http_over_tcp` | -| HTTP/1.1 | `stdlib/net/http.mq.md`: status/header/chunked-byte parse, request build | implemented over an already-authorized TCP stream; not a DNS/TLS client | `stdlib_http`, `http_over_tcp` | -| print | bundled `io.mq.md`/`console.mq.md` through `resource.write`; legacy `HostOp::Print` removed | implemented (Compat-C) | `print_routing`, `stdlib_bundle` | -| strict mode | only the pure/Math execution path and the built-in stdout console channel; project/foreign/plugin/tool/trace/file/network grants are rejected | implemented L1; L2 not implemented | `tests/security`, `resource_streams` | +| HTTP/1.1 | `stdlib/net/http.mq.md`: status/header/chunked-byte parse, request build | implemented over an already-authorized TCP stream; not a DNS/TLS client | `stdlib_http`, `http_over_tcp`, `stdlib_product` | +| print | bundled `io.mq.md`/`console.mq.md` through `resource.write`; legacy `HostOp::Print` removed | implemented (Compat-C) | `print_routing`, `stdlib_product` | +| strict mode | only the pure/Math execution path and the built-in stdout console channel; project/foreign/plugin/tool/trace/file/network grants are rejected | implemented L1; L2 not implemented | `tests/security`, `resource_streams`, `stdlib_product` | ## 4. Extension path classification diff --git a/docs/evidence/2026-11-21-docs-and-test-migration.md b/docs/evidence/2026-11-21-docs-and-test-migration.md new file mode 100644 index 0000000..ad7c62d --- /dev/null +++ b/docs/evidence/2026-11-21-docs-and-test-migration.md @@ -0,0 +1,81 @@ +# Evidence: documentation and test-case migration + +Date: 2026-11-21 (Asia/Shanghai) +Source baseline: `04eae8746e9b6e33bf872429a1d66327ea6df4b2` (docs/test migration; +later docs-only commits keep the source byte-identical) +Repository: `marqdo-cli` +Decision input: architecture audit and refactor RFC, P0/P1/P2 + +## Commands + +```text +cargo fmt --all -- --check PASS +cargo clippy --workspace --all-targets -- -D warnings PASS +cargo test --workspace PASS + 463 passed, 0 failed, 2 ignored +cargo test -p marqdo-cli --test docs_consistency 4 passed +cargo test -p marqdo-cli --test architecture_boundaries 5 passed +cargo test -p marqdo-cli --test stdlib_product 5 passed +python3 tools/pack-stdlib.py PASS +``` + +`04eae87` is the source commit before this evidence file; the later commit only +adds this evidence and the status text. The source tree is unchanged. + +## Doc gate + +`crates/cli/tests/docs_consistency.rs` checks: + +* `docs/architecture/CURRENT.md` has one current overview, the four state + dimensions (implemented / tested locally / bundled stdlib released / + multi-platform verified) and a 40-hex baseline SHA; +* `docs/architecture/README.md` is an index that links `CURRENT.md`, + `STATUS.md` and `history/README.md`, without a second running P5 status; +* `docs/STATUS.md` links `CURRENT.md` and no longer claims the stale + `c9f01aa8` remote baseline as current; +* relative Markdown links in those files resolve; +* every `docs/evidence/*.md` file contains a 7–40 hex commit/security SHA. + +## Architecture gate + +`crates/cli/tests/architecture_boundaries.rs` checks: + +* the workspace members are the documented 15 members, with no + `marqdo-stdlib` crate; +* `marqdo-runtime` depends on `marqdo-host` and `marqdo-host` does not depend + back on `marqdo-runtime`; +* `stdlib.json` is version `0.1.0` and its SHA-256 digest matches the sorted + `.mq.md` tree; +* `std:`/relative imports stay inside `stdlib/` and resolve; +* `marqdo-host/src/resource.rs` still exposes `stdio/stderr/file/tcp`. + +`tools/pack-stdlib.py` used `Path` order while the CLI used relative-path +order, so the two digest definitions disagreed on `io.mq.md` vs `io/console.mq.md`. +The tool now sorts by the same relative key; it verifies the manifest again. + +## Product test gate + +`crates/cli/tests/stdlib_product.rs` requires one `stdlib/tests/*.mq.md` for +every public module and runs all of them through the real `std:` import path with +the verified bundle: + +| Test | Public module | +|---|---| +| `console.mq.md` | `std:io/console` | +| `format.mq.md` | `std:format` | +| `http.mq.md` | `std:net/http` | +| `io.mq.md` | `std:io` | +| `stream.mq.md` | `std:io/stream` | +| `table.mq.md` | `std:data/table` | +| `text.mq.md` | `std:text` | +| `utf8.mq.md` | `std:text/utf8` | + +The tests assert the value report, `success`, exact stdout, and a resource +endpoint in the trace for console/stream. + +## Not covered + +A conformance fixture is not a product test. No `std:fs/file`, JSON/CSV, +directory/stat/rename/remove, DNS/TLS/UDP/listener, `std:path/regex/datetime/ +env/process`, secure random, compression, Windows/macOS native lane, or GitHub +security URL is added here. Those remain open in `../STATUS.md` §4.