refactor: accept the ecosystem stdlib Bundle and remove the in-repo sources
Phase B of ADR-0070 (issue #11): the CLI no longer owns standard-library sources. The pin names the accepted ecosystem Bundle (marqdo-stdlib@0.2.0, root commit + tree/alias digests); tools/ci/fetch_ecosystem_bundle.py materializes it from the pinned root commit and stdlib gitlinks and verifies the digests. bundle.py and the test harness require an explicit verified Bundle for the accepted identity, and runtime discovery has no compile-time source fallback in any profile. Delete stdlib/ (modules, self-tests, aliases manifest). Module and domain tests stay with their component owners; the CLI product lane now verifies the external Bundle's public surface, std: resolution and official print/打印 alias routing (tests/product-stdlib). Composition assertions whose owner is the ecosystem (Table split, print-format equivalence) moved to the root Bundle acceptance; the generic TCP round-trip stays a CLI test. Spawned-CLI tests name the verified Bundle explicitly. CI (Woodpecker + GitHub) materializes the pinned Bundle before product tests, packaging and performance lanes; packaging and release take --stdlib-dir from that artifact. Docs, STATUS, ADR-0070 and a Phase B evidence record updated. Refs cflmy/marqdo#9, cflmy/marqdo-cli#11
This commit is contained in:
1 parent
f8b82d4143
commit
72f57beee0
85 files changed
+796
-5939
No files matched your search
@@ -2,12 +2,12 @@
|
||||
//!
|
||||
//! These checks pin the documented layering: the engine depends on the neutral
|
||||
//! Host contract (never the native host), the plugin ABI contract carries no
|
||||
//! loader/worker execution side, the bundled stdlib stays in this repository,
|
||||
//! `std:` import targets resolve only inside the bundle, and the host keeps the
|
||||
//! loader/worker execution side, the stdlib Bundle is an explicit ecosystem
|
||||
//! input rather than an in-repo source tree, `std:` import targets resolve only
|
||||
//! inside the bundle, and the host keeps the
|
||||
//! documented stdio/file/TCP resource endpoints. They are source and digest
|
||||
//! checks, not an OS-sandbox proof; `tools/ci/check_dependency_boundaries.py`
|
||||
//! adds the Cargo-metadata graph gate.
|
||||
|
||||
#[path = "support/stdlib.rs"]
|
||||
pub mod stdlib_support;
|
||||
|
||||
@@ -140,24 +140,36 @@ fn engine_depends_on_the_neutral_host_contract_only() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bundled_stdlib_stays_in_this_repository_and_matches_its_digest() {
|
||||
let root = stdlib_support::bundle_dir();
|
||||
// Phase A (ADR-0070): the pinned Bundle is still the checkout tree. Phase B
|
||||
// replaces this assertion when the ecosystem Bundle becomes the input.
|
||||
assert_eq!(
|
||||
root,
|
||||
repo_root().join("stdlib").canonicalize().unwrap(),
|
||||
"the Phase A stdlib pin must resolve to the in-repo stdlib tree"
|
||||
fn stdlib_sources_live_in_the_ecosystem_not_in_this_repository() {
|
||||
// Phase B (ADR-0070): the in-repo source tree is gone. The accepted Bundle
|
||||
// identity is the ecosystem pin; product tests consume an explicit, verified
|
||||
// Bundle (CI materializes it with tools/ci/fetch_ecosystem_bundle.py).
|
||||
assert!(
|
||||
!repo_root().join("stdlib").exists(),
|
||||
"Phase B must not carry an in-repo stdlib source tree"
|
||||
);
|
||||
let pin = stdlib_support::BundlePin::committed();
|
||||
assert!(
|
||||
pin.source_path.is_none(),
|
||||
"the accepted Bundle pin must name the ecosystem source, not a vendored path"
|
||||
);
|
||||
assert_eq!(pin.name, "marqdo-stdlib");
|
||||
assert_eq!(pin.version, "0.2.0");
|
||||
assert_eq!(pin.source_commit.len(), 40);
|
||||
let root = stdlib_support::bundle_dir();
|
||||
let manifest: serde_json::Value =
|
||||
serde_json::from_slice(&std::fs::read(root.join("stdlib.json")).unwrap()).unwrap();
|
||||
assert_eq!(manifest["name"], "marqdo-stdlib");
|
||||
assert_eq!(manifest["version"], "0.1.0");
|
||||
assert_eq!(manifest["name"], pin.name);
|
||||
assert_eq!(manifest["version"], pin.version);
|
||||
let declared = manifest["digest"].as_str().expect("digest string");
|
||||
assert_eq!(
|
||||
declared, pin.tree_digest,
|
||||
"the resolved Bundle must match the pin"
|
||||
);
|
||||
let actual = format!("sha256:{}", tree_digest(&root).unwrap());
|
||||
assert_eq!(
|
||||
actual, declared,
|
||||
"stdlib digest mismatch; regenerate it with tools/pack-stdlib.py and commit the digest"
|
||||
"stdlib digest mismatch; rebuild the Bundle from the pinned ecosystem gitlinks"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user