refactor: accept the ecosystem stdlib Bundle and remove the in-repo sources
ci/woodpecker/push/main Pipeline failed
ci/woodpecker/pr/main Pipeline failed

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:
cflmy committed 2026-11-27 01:04:01 +08:00
1 parent f8b82d4143
commit 72f57beee0
85 files changed
+796 -5939

No files matched your search

+20 -3
View File
@@ -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)