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,14 +2,14 @@
|
||||
"schema": "marqdo.stdlib-bundle-pin",
|
||||
"schema_version": 1,
|
||||
"name": "marqdo-stdlib",
|
||||
"version": "0.1.0",
|
||||
"version": "0.2.0",
|
||||
"source": {
|
||||
"kind": "in-repo",
|
||||
"repository": "cflmy/marqdo-cli",
|
||||
"commit": "2cbde54602c07f62a62f341400bc9cb4764a93f8",
|
||||
"path": "stdlib",
|
||||
"note": "Phase A (ADR-0070): the pinned Bundle is the checkout tree at this commit. Phase B replaces this record with the accepted ecosystem Bundle commit and digest; do not change it in the same commit as test fixtures."
|
||||
"kind": "ecosystem",
|
||||
"repository": "cflmy/marqdo",
|
||||
"commit": "48189243f747d5f73d5a38a565010e64e2db74e7",
|
||||
"producer": "scripts/build-stdlib.py",
|
||||
"note": "Phase B (ADR-0070): the accepted Bundle is assembled by the ecosystem root commit that pins the component gitlinks. No stdlib source tree exists in this repository."
|
||||
},
|
||||
"tree_digest": "sha256:5407d3665ba2fe105820d0f1af5efaafa10c277a69eb819c3225719813c8c713",
|
||||
"tree_digest": "sha256:db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7",
|
||||
"aliases_digest": "sha256:5f513c0fdbb3c1e9829be3c9fa23a2d1e89cb8510073fb5eb1e8e2f5265a83bb"
|
||||
}
|
||||
+20
-3
@@ -217,8 +217,18 @@ def load_pin(path: Path = PIN_PATH) -> dict:
|
||||
f"Bundle pin {path} must be {PIN_SCHEMA} schema_version {PIN_SCHEMA_VERSION}"
|
||||
)
|
||||
source = pin.get("source")
|
||||
if not isinstance(source, dict) or not isinstance(source.get("path"), str):
|
||||
raise BundleError(f"Bundle pin {path} has no source.path")
|
||||
if not isinstance(source, dict):
|
||||
raise BundleError(f"Bundle pin {path} has no source object")
|
||||
kind = source.get("kind")
|
||||
if kind in ("in-repo", "test"):
|
||||
if not isinstance(source.get("path"), str) or not source["path"]:
|
||||
raise BundleError(f"Bundle pin {path} has no source.path")
|
||||
elif kind == "ecosystem":
|
||||
for field in ("repository", "commit"):
|
||||
if not isinstance(source.get(field), str) or not source[field]:
|
||||
raise BundleError(f"Bundle pin {path} has no source.{field}")
|
||||
else:
|
||||
raise BundleError(f"Bundle pin {path} has unknown source.kind: {kind!r}")
|
||||
for field in ("name", "version", "tree_digest", "aliases_digest"):
|
||||
if not isinstance(pin.get(field), str) or not pin[field]:
|
||||
raise BundleError(f"Bundle pin {path} has no non-empty `{field}`")
|
||||
@@ -248,8 +258,15 @@ def resolve(
|
||||
default location is valid; there is no fallback.
|
||||
"""
|
||||
pin = load_pin(pin_path)
|
||||
source = pin["source"]
|
||||
if explicit is None:
|
||||
root = ROOT / pin["source"]["path"]
|
||||
if source.get("kind") not in ("in-repo", "test") or "path" not in source:
|
||||
raise BundleError(
|
||||
"the accepted Bundle is not vendored in this repository; pass an "
|
||||
"explicit --stdlib-dir or MARQDO_TEST_STDLIB_BUNDLE produced from "
|
||||
f"{source.get('repository')}@{source.get('commit')}"
|
||||
)
|
||||
root = ROOT / source["path"]
|
||||
else:
|
||||
root = Path(explicit)
|
||||
record = verify(root)
|
||||
|
||||
Reference in new issue
Block a user