docs(evidence): record the doc and stdlib test migration gate

This commit is contained in:
Marqdo Agent committed 2026-11-21 01:54:20 +08:00
1 parent f0c25be01d
commit 7a93fe8e7b
3 files changed
+97 -6

No files matched your search

+10
View File
@@ -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
+6 -6
View File
@@ -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
@@ -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.