From a9ccb3a6dad1754bc908de99054b3dde9f9f1e2f Mon Sep 17 00:00:00 2001 From: cflmy Date: Mon, 30 Nov 2026 11:41:37 +0800 Subject: [PATCH] docs: record environment-report and document-contract evidence Add the reproducible evidence record for candidate 0f87f856: pinned ecosystem Bundle identity, the full source gate list (fmt/clippy/638 workspace tests/boundaries/independent-build), the environment-report probes, the release archive built with the embedded source SHA (package identity check + smoke PASS) and the Woodpecker push/PR lanes. Windows/macOS native lanes and the strict VM lane stay UNVERIFIED. Links the record from docs/STATUS.md. --- docs/STATUS.md | 2 + ...0-cli-environment-and-document-contract.md | 141 ++++++++++++++++++ 2 files changed, 143 insertions(+) create mode 100644 docs/evidence/2026-11-30-cli-environment-and-document-contract.md diff --git a/docs/STATUS.md b/docs/STATUS.md index a17551c..1fb3ddb 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -113,6 +113,8 @@ a module, start a provider session, open a plugin or print a path/credential. `build` lane exports the variable before `cargo build --release`. * Window/macOS native lanes are **UNVERIFIED**; the report is Linux-verified only. This work is not part of the tagged rc.6 release record. +* Evidence: [`evidence/2026-11-30-cli-environment-and-document-contract.md`](evidence/2026-11-30-cli-environment-and-document-contract.md) + (source gates, workspace tests, archive identity binding and smoke PASS). ## 0.11 Explicit stdlib Bundle input — issue #11 Phase A (unreleased) diff --git a/docs/evidence/2026-11-30-cli-environment-and-document-contract.md b/docs/evidence/2026-11-30-cli-environment-and-document-contract.md new file mode 100644 index 0000000..f223dcd --- /dev/null +++ b/docs/evidence/2026-11-30-cli-environment-and-document-contract.md @@ -0,0 +1,141 @@ +# CLI 0f87f85 — offline environment report, release identity binding and document-structure contract + +Date: 2026-11-30. +Repository: `cflmy/marqdo-cli`. +Candidate commit: `0f87f856dba28e34bbd2743d23b8f9b1fe96424a` +(branch `codex/issue-25-26-environment-document-contract`, PR +[#27](https://git.cflmy.cn/cflmy/marqdo-cli/pulls/27)). +Issues: [marqdo-cli#26](https://git.cflmy.cn/cflmy/marqdo-cli/issues/26) §9.2 +(P1), [marqdo-cli#25](https://git.cflmy.cn/cflmy/marqdo-cli/issues/25), +[marqdo-cli#20](https://git.cflmy.cn/cflmy/marqdo-cli/issues/20) binding. +Parent tickets: `marqdo#55`, `marqdo#56`. + +Executed host: Linux x86_64, glibc 2.43 +(`rustc 1.100.0 (0ef1bc386 2026-11-09)`, `cargo 1.100.0 (3acc79c0c 2026-11-05)`, +Python 3.14.4). Windows/macOS native lanes were **not** run (no runner in this +environment) and remain `UNVERIFIED`. + +## 1. Bundle input + +`python3 tools/ci/fetch_ecosystem_bundle.py --out target/ecosystem-stdlib` +materialized the pinned ecosystem Bundle (pin commit +`48189243f747d5f73d5a38a565010e64e2db74e7`, components +`stdlib/{collections,data,fs,io,system,text}` at their pinned gitlinks): + +```text +name: marqdo-stdlib +version: 0.2.0 +tree_digest: sha256:db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7 +aliases_digest: sha256:5f513c0fdbb3c1e9829be3c9fa23a2d1e89cb8510073fb5eb1e8e2f5265a83bb +files: 18 +``` + +All workspace tests below ran with +`MARQDO_TEST_STDLIB_BUNDLE="$PWD/target/ecosystem-stdlib"`. + +## 2. Source-level gates + +| Command | Result | +|---|---| +| `cargo fmt --all -- --check` | PASS | +| `cargo clippy --workspace --all-targets -- -D warnings` | PASS | +| `cargo test --workspace --locked` | PASS: 638 passed, 0 failed, 2 ignored (74 suites) | +| `cargo test -p marqdo-cli --test docs_consistency` | PASS: 9 passed | +| `cargo test -p marqdo-cli --test environment_report` | PASS: 5 passed | +| `cargo test -p marqdo-cli --test document_structure` | PASS: 6 passed | +| `python3 tools/ci/check_dependency_boundaries.py` | PASS | +| `python3 tools/ci/check_engine_boundary.py` | PASS | +| `python3 tools/ci/check_plugin_sdk.py` | PASS | +| `python3 tools/ci/independent_build.py` | PASS (PASS payload, clean target dir) | +| `python3 -m unittest discover -s tools/ci -p 'test_*.py'` | PASS: 80 tests | +| `python3 -m unittest discover -s tools/ci -p 'test_release*.py'` | PASS: 29 tests (10 skipped by platform guards) | + +Note: `cargo clippy` must be invoked as +`cargo clippy --workspace --all-targets -- -D warnings` (one `--`). A doubled +separator makes clippy-driver treat `-D` as a second input file; that failure +was a local invocation error, not a code failure. + +## 3. `inspect --environment` probes + +```console +$ marqdo inspect --environment --json +{"schema":"marqdo.environment","schema_version":1, + "producer":{"name":"marqdo","version":"3.0.0-rc.6", + "source":{"sha":null,"origin":"unavailable"}}, # dev binary + "platform":{"os":"linux","arch":"x86_64","family":"unix", + "libc":{"family":"glibc","version":"2.43"}, + "strict":{"state":"unavailable","reason":"..."},"worker_processes":true}, + "worker":{"name":"marqdo-provider-worker","status":"present", + "version":"3.0.0-rc.6","source_sha":null}, + "bundle":{"status":"absent", ...}, + "protocols":{"analysis":3,"observation":1,"cli_tool":{"version":1,"api_revision":1}, + "plugin_abi":{"version":"1.0","major":1,"minor":0}, + "provider_manifest":2,"package_lock":4,"markdown_profile":"marqdo.md.v1"}, + "diagnostics":[]} + +$ marqdo inspect --environment --platform # argument boundary +error: the argument '--environment' cannot be used with '--platform' # exit 2 +``` + +The integration test also builds a valid synthetic Bundle and an invalid one: +`verified` identity is reported for the valid tree, and a digest mismatch is +reported as `status: invalid` + `env.stdlib_digest_mismatch` without printing +the Bundle path. Two consecutive invocations are byte-identical. + +## 4. Release archive (identity binding, #20/#26) + +Release build and archive were produced from the candidate commit with +`MARQDO_BUILD_SOURCE_SHA=0f87f856dba28e34bbd2743d23b8f9b1fe96424a`: + +```console +$ cargo build --release --locked -p marqdo-cli -p marqdo-provider-worker +Finished `release` profile in 51.40s + +$ python3 tools/release/package.py --source-sha 0f87f856... --version 3.0.0-rc.6 \ + --stdlib-dir target/ecosystem-stdlib --bundle-pin tools/stdlib/bundle-pin.json +{"archive":"dist/marqdo-3.0.0-rc.6-x86_64-unknown-linux-gnu.tar.gz", + "sha256":"58f4ea3a317ac2cf311804f94462d49699b7f159d6ef308a60f2728dad707a9a", + "size":4928069,"source_sha":"0f87f856...","version":"3.0.0-rc.6", + "target":"x86_64-unknown-linux-gnu"} + +$ python3 tools/release/smoke.py --archive dist/marqdo-3.0.0-rc.6-x86_64-unknown-linux-gnu.tar.gz --skip-strict +smoke: verified stdlib 0.2.0 tree=sha256:db905508... files=18 +smoke: archive version 3.0.0-rc.6, source 0f87f856dba28e34bbd2743d23b8f9b1fe96424a +smoke: bundled stdlib missing -> fail-closed OK +smoke: language-only program runs without the bundled stdlib +smoke: PASS +``` + +`package.py` now runs the staged binary's `inspect --environment --json` and +refuses to stage when `producer.source.sha`/`worker.source_sha` differ from +`--source-sha`, when the Bundle is not `verified`, or when its tree digest +differs from the archived Bundle. `smoke.py` repeats the check from the +extracted archive. The PASS above therefore proves the archive carries the +exact release commit in both binaries and the exact shipped Bundle. + +Strict mode is `UNVERIFIED` on this shared host (`bwrap` cannot create the +required namespaces); `smoke.py --skip-strict` records that honestly rather +than turning a refusal into a PASS. + +## 5. CI + +| Pipeline | Result | +|---|---| +| Woodpecker push [#155](https://ci.cflmy.cn/repos/1/pipeline/155) (candidate `0f87f856`) | PASS: clone, contract, test, independent-build, minimum-rust, build all success | +| Woodpecker pull_request [#156](https://ci.cflmy.cn/repos/1/pipeline/156) (PR #27) | PASS: same six steps success on the candidate tree | +| Woodpecker push (docs evidence commit, branch head) | re-runs the same six steps; result recorded in the PR once complete | + +Steps `contract`/`test`/`independent-build`/`minimum-rust`/`build` are the +release-relevant lanes; the Windows `cargo check` cross gate runs inside +`test`, but native Windows/macOS runs remain out of scope here. + +## 6. Not verified / limits + +- Native macOS and Windows build/run lanes (§3 target matrix): no runner in + this environment; `UNVERIFIED`. Only the Linux cross-compile check runs. +- Strict VM lane (`bwrap` namespaces): `UNVERIFIED`; strict stays fail-closed. +- MQDH/consumer acceptance of the release archive: consumer repositories own + their own acceptance; this record proves the CLI-side archive identity only. +- A formal tagged Release is not created by this change: publication remains a + reviewed owner step (`docs/releasing.md` §6). The archive above is a local + candidate, not a published asset.