mirror of
https://github.com/ratspeak/rsLXST
synced 2026-11-22 23:10:37 +00:00
api: organize compatibility evidence
This commit is contained in:
1 parent
2e92c69b0e
commit
2e4e4409a3
20 files changed
+185
-187
No files matched your search
@@ -11,7 +11,7 @@ permissions:
|
||||
|
||||
env:
|
||||
RSLXST_RSRETICULUM_VERSION: 1.2.0
|
||||
RSLXST_RSRETICULUM_COMMIT: dc6bc4ee82daf66b3b40386f9777dbe62b08fec2
|
||||
RSLXST_RSRETICULUM_COMMIT: e0889f718894ead2f0deb37ad144d67c24fe6270
|
||||
|
||||
jobs:
|
||||
api-compat:
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
run: python3 tools/check-api-compatibility.py
|
||||
working-directory: rsLXST
|
||||
- name: Check canonical and retained external consumers
|
||||
run: cargo check --manifest-path api-fixtures/Cargo.toml --locked
|
||||
run: cargo check --manifest-path api/fixtures/Cargo.toml --locked
|
||||
working-directory: rsLXST
|
||||
|
||||
lint:
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
.DS_Store
|
||||
target/
|
||||
api-fixtures/target/
|
||||
api/fixtures/target/
|
||||
|
||||
# Runtime data and local identities
|
||||
.reticulum/
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
# API stability
|
||||
|
||||
rsLXST is experimental and remains below 1.0. Its three library packages are
|
||||
source-distributed with `publish = false`; none is currently a stable SemVer
|
||||
promise.
|
||||
|
||||
That does not make accidental breakage acceptable. `api-stability.json` lists
|
||||
every package, and `api-baseline/*.txt` records the complete explicit public
|
||||
surface generated by pinned `cargo-public-api` and rustdoc versions. CI rejects
|
||||
unreviewed drift so an intentional change must arrive with its downstream,
|
||||
version, changelog, and interop reasoning.
|
||||
|
||||
- `lxst-core` contains codec/profile, stream, signalling, and wire concepts.
|
||||
- `lxst-rns` is the Reticulum Link binding and typed packet adapter.
|
||||
- `lxst-telephony` currently exposes both useful service controls and extensive
|
||||
runtime/state-machine machinery.
|
||||
|
||||
[`TelephonyService`](TELEPHONY_API.md), constructed with `registered` or
|
||||
`registered_with_config`, is the selected canonical **experimental** embedding
|
||||
boundary. `TelephonyServiceParts`, `TelephonyControl`, and
|
||||
`TelephonyServiceEvent` retain their exact existing ownership, bounded-channel,
|
||||
backpressure, cancellation, event-order, and shutdown behavior. Manual
|
||||
`TelephonyRnsEndpoint`/`TelephonyRuntimeCore` assembly remains available for
|
||||
compatibility but is experimental SPI, not a second recommended application
|
||||
path.
|
||||
|
||||
All three are classified **experimental**. Future work may promote a small
|
||||
facade while hiding orchestration internals, but this checkpoint does not move,
|
||||
rename, hide, or change anything. Ratspeak voice integration and the Python
|
||||
LXST compatibility suite must be migrated and green before any such boundary
|
||||
change.
|
||||
|
||||
The canonical snapshot uses all features on `aarch64-apple-darwin` and omits
|
||||
auto-derived, auto-trait, and blanket implementations. Android ABI and media
|
||||
behavior remain protected by the existing target, package, and live interop
|
||||
gates rather than treated as stable Rust API by this host snapshot.
|
||||
|
||||
```sh
|
||||
cargo install cargo-public-api --version 0.52.0 --locked
|
||||
rustup toolchain install nightly-2026-08-01 --profile minimal
|
||||
python3 tools/check-api-baseline.py
|
||||
python3 tools/check-api-manifest.py
|
||||
python3 tools/check-api-compatibility.py
|
||||
cargo check --manifest-path api-fixtures/Cargo.toml --locked
|
||||
```
|
||||
|
||||
The immutable compatibility floor is separate from the current reviewed
|
||||
capture. The manifest contract covers features, targets, MSRV, and
|
||||
non-development dependencies that the Apple/all-feature snapshot cannot see.
|
||||
The compatibility check rejects removals from the Wave C floor. Selecting the
|
||||
existing service boundary changes no public API, version, wire, or runtime
|
||||
behavior.
|
||||
|
||||
Use `--update` only after reviewing and recording the compatibility impact.
|
||||
@@ -39,7 +39,7 @@ the reference implementation LXST.
|
||||
- [Test It](#test-it)
|
||||
- [Crate Layout](#crate-layout)
|
||||
- [Using Telephony](#using-telephony)
|
||||
- [Telephony API boundary](TELEPHONY_API.md)
|
||||
- [Rust API](api/README.md)
|
||||
- [Contributing](#contributing)
|
||||
- [License](#license)
|
||||
- [Third-party licenses](#third-party-licenses)
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
# Experimental telephony service API
|
||||
|
||||
The current canonical application boundary is the existing
|
||||
`lxst_telephony::TelephonyService` service seam:
|
||||
|
||||
- construct it with `TelephonyService::registered` or
|
||||
`TelephonyService::registered_with_config`;
|
||||
- retain the `TelephonyServiceParts::control_tx` and `event_rx` handles;
|
||||
- drive the owned service with `TelephonyService::run`;
|
||||
- use `TelephonyControl`, `request_answer`, and `TelephonyServiceEvent` without
|
||||
translating raw Reticulum events in the application.
|
||||
|
||||
This boundary is experimental. Selection does not stabilize the whole package
|
||||
or alter the existing channel capacities, backpressure, event ordering,
|
||||
cancellation, timeout, media, exact-Link, or shutdown behavior.
|
||||
|
||||
`TelephonyRnsEndpoint`, `TelephonyRuntimeCore`, `TelephonyCommand`,
|
||||
`TelephonyDriveStep`, `TelephonyService::new`, and
|
||||
`TelephonyService::with_config` remain public for compatibility and specialist
|
||||
testing. They are experimental implementation SPI and are not the recommended
|
||||
application construction path. No compatibility path is deprecated in this
|
||||
Wave C milestone.
|
||||
|
||||
The compiled `service` example and external fixture exercise the selected and
|
||||
retained paths. API snapshots, manifest/feature contracts, Android/Apple target
|
||||
builds, and Python Telephone interoperability are separate evidence layers;
|
||||
none is replaced by this documentation boundary.
|
||||
@@ -1,13 +0,0 @@
|
||||
[package]
|
||||
name = "lxst-telephony-api-fixture"
|
||||
version = "0.0.0"
|
||||
edition = "2024"
|
||||
publish = false
|
||||
|
||||
[workspace]
|
||||
|
||||
[dependencies]
|
||||
lxst-telephony = { path = "../crates/lxst-telephony" }
|
||||
rns-identity = { path = "../../rsReticulum/crates/rns-identity" }
|
||||
rns-transport = { path = "../../rsReticulum/crates/rns-transport" }
|
||||
tokio = { version = "1", features = ["sync"] }
|
||||
@@ -1,34 +0,0 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"snapshotSourceCommit": "68df3223773a9553ea458fc10b4b939915986aad",
|
||||
"capabilities": ["LXST-01", "LXST-02", "LXST-03", "LXST-04"],
|
||||
"canonicalPath": "lxst_telephony::TelephonyService",
|
||||
"canonicalConstruction": [
|
||||
"TelephonyService::registered",
|
||||
"TelephonyService::registered_with_config",
|
||||
"TelephonyServiceParts"
|
||||
],
|
||||
"retainedPaths": [
|
||||
"TelephonyRuntimeCore",
|
||||
"TelephonyRnsEndpoint",
|
||||
"TelephonyService::new",
|
||||
"TelephonyService::with_config"
|
||||
],
|
||||
"internalSpi": [
|
||||
"TelephonyCommand",
|
||||
"TelephonyDriveStep",
|
||||
"manual runtime and endpoint assembly"
|
||||
],
|
||||
"classification": "existing experimental service boundary",
|
||||
"publicApiDiff": {"added": 0, "removed": 0},
|
||||
"semver": "no version consequence; documentation and consumer migration only",
|
||||
"deprecations": "none",
|
||||
"wirePersistenceRuntimeImpact": "none",
|
||||
"consumerMigration": "Ratspeak uses registered service assembly with identical default 32/128 bounded channels",
|
||||
"platformEvidence": [
|
||||
"host service tests and compiled example",
|
||||
"Rust 1.87 strict Clippy",
|
||||
"Android and Apple compile gates at product handoff",
|
||||
"Python Telephone interoperability at milestone close"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
# Rust API
|
||||
|
||||
rsLXST is experimental and remains below 1.0. Its current application boundary
|
||||
for telephony is the existing `lxst_telephony::TelephonyService` service seam:
|
||||
|
||||
- construct it with `TelephonyService::registered` or
|
||||
`TelephonyService::registered_with_config`;
|
||||
- retain the `TelephonyServiceParts::control_tx` and `event_rx` handles;
|
||||
- drive the owned service with `TelephonyService::run`; and
|
||||
- use `TelephonyControl`, `request_answer`, and `TelephonyServiceEvent` without
|
||||
translating raw Reticulum events in the application.
|
||||
|
||||
The compiled `lxst-telephony` `service` example exercises this path.
|
||||
|
||||
## Stability
|
||||
|
||||
All three packages are experimental:
|
||||
|
||||
- `lxst-core` contains codec, profile, stream, signalling, and wire concepts;
|
||||
- `lxst-rns` binds media packets to Reticulum Links; and
|
||||
- `lxst-telephony` contains the service boundary plus extensive runtime and
|
||||
state-machine machinery.
|
||||
|
||||
Selecting `TelephonyService` does not stabilize the whole package or change
|
||||
channel capacities, backpressure, event ordering, cancellation, timeouts,
|
||||
media, exact-Link, or shutdown behavior. `TelephonyRnsEndpoint`,
|
||||
`TelephonyRuntimeCore`, `TelephonyCommand`, `TelephonyDriveStep`,
|
||||
`TelephonyService::new`, and `TelephonyService::with_config` remain available
|
||||
for compatibility and specialist testing, but are implementation-level APIs
|
||||
rather than the recommended application construction path.
|
||||
|
||||
## Compatibility checks
|
||||
|
||||
The `api/` directory contains the evidence used by CI:
|
||||
|
||||
- `stability.json` records package tiers, source commits, snapshot hashes, and
|
||||
the current review decision;
|
||||
- `snapshots/` records the explicit all-feature Apple ARM64 Rust API and the
|
||||
manifest, feature, dependency, target, and MSRV contract; and
|
||||
- `fixtures/` compiles the recommended and retained paths as an external
|
||||
consumer.
|
||||
|
||||
These checks catch accidental changes, but they do not replace Android and
|
||||
Apple target builds, media tests, Python Telephone interoperability, or manual
|
||||
review. The API snapshot omits auto-derived, auto-trait, and blanket
|
||||
implementations and is not by itself a complete SemVer verdict.
|
||||
|
||||
Run the checks with:
|
||||
|
||||
```sh
|
||||
python3 tools/check-api-baseline.py
|
||||
python3 tools/check-api-manifest.py
|
||||
python3 tools/check-api-compatibility.py
|
||||
cargo check --manifest-path api/fixtures/Cargo.toml --locked
|
||||
```
|
||||
|
||||
Snapshot updates require a clean source commit and an explicit review recorded
|
||||
in `api/stability.json`. Additions, removals, deprecations, platform impact, and
|
||||
version consequences must be reviewed before accepting new evidence.
|
||||
File renamed without changes.
@@ -0,0 +1,13 @@
|
||||
[package]
|
||||
name = "lxst-telephony-api-fixture"
|
||||
version = "0.0.0"
|
||||
edition = "2024"
|
||||
publish = false
|
||||
|
||||
[workspace]
|
||||
|
||||
[dependencies]
|
||||
lxst-telephony = { path = "../../crates/lxst-telephony" }
|
||||
rns-identity = { path = "../../../rsReticulum/crates/rns-identity" }
|
||||
rns-transport = { path = "../../../rsReticulum/crates/rns-transport" }
|
||||
tokio = { version = "1", features = ["sync"] }
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -21,7 +21,40 @@
|
||||
"snapshotSource": {
|
||||
"commit": "68df3223773a9553ea458fc10b4b939915986aad",
|
||||
"capturedOn": "2026-08-17",
|
||||
"changeRecord": "api-reviews/wave-c-telephony-service.json"
|
||||
"review": {
|
||||
"areas": [
|
||||
"LXST codecs, profiles, signalling, and streams",
|
||||
"Reticulum Link media transport",
|
||||
"telephony service ownership and lifecycle",
|
||||
"Opus transmit and receive streams"
|
||||
],
|
||||
"canonicalPath": "lxst_telephony::TelephonyService",
|
||||
"canonicalConstruction": [
|
||||
"TelephonyService::registered",
|
||||
"TelephonyService::registered_with_config",
|
||||
"TelephonyServiceParts"
|
||||
],
|
||||
"retainedImplementationPaths": [
|
||||
"TelephonyRuntimeCore",
|
||||
"TelephonyRnsEndpoint",
|
||||
"TelephonyService::new",
|
||||
"TelephonyService::with_config"
|
||||
],
|
||||
"classification": "existing experimental service boundary",
|
||||
"publicApiDiff": {
|
||||
"added": 0,
|
||||
"removed": 0
|
||||
},
|
||||
"semver": "no version consequence; documentation and consumer migration only",
|
||||
"deprecations": "none",
|
||||
"wirePersistenceRuntimeImpact": "none",
|
||||
"platformEvidence": [
|
||||
"host service tests and compiled example",
|
||||
"stable and Rust 1.87 strict Clippy",
|
||||
"Android and Apple compile gates",
|
||||
"Python Telephone interoperability"
|
||||
]
|
||||
}
|
||||
},
|
||||
"packages": [
|
||||
{
|
||||
@@ -29,7 +62,7 @@
|
||||
"manifestPath": "Cargo.toml",
|
||||
"tier": "experimental",
|
||||
"compatibility": "reviewed-snapshot",
|
||||
"snapshot": "api-baseline/lxst-core.txt",
|
||||
"snapshot": "api/snapshots/lxst-core.txt",
|
||||
"itemCount": 331,
|
||||
"sha256": "87cc451d6da48cc06cd2bae9b26bae523407a20f66e842f04844ceecb8c5867d"
|
||||
},
|
||||
@@ -38,7 +71,7 @@
|
||||
"manifestPath": "Cargo.toml",
|
||||
"tier": "experimental",
|
||||
"compatibility": "reviewed-snapshot",
|
||||
"snapshot": "api-baseline/lxst-rns.txt",
|
||||
"snapshot": "api/snapshots/lxst-rns.txt",
|
||||
"itemCount": 54,
|
||||
"sha256": "6be5ba72d749f51d4f09816dce771540491cc3747bd531b307f94cef3297d463"
|
||||
},
|
||||
@@ -47,7 +80,7 @@
|
||||
"manifestPath": "Cargo.toml",
|
||||
"tier": "experimental",
|
||||
"compatibility": "reviewed-snapshot",
|
||||
"snapshot": "api-baseline/lxst-telephony.txt",
|
||||
"snapshot": "api/snapshots/lxst-telephony.txt",
|
||||
"itemCount": 317,
|
||||
"sha256": "e13c7c17ee723a08ce94651aa8f001f335b5abb5d17aefce5f4db695fb7c8128"
|
||||
}
|
||||
+40
-37
@@ -16,7 +16,7 @@ from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
CONFIG_PATH = ROOT / "api-stability.json"
|
||||
CONFIG_PATH = ROOT / "api" / "stability.json"
|
||||
SHA_PATTERN = re.compile(r"^[0-9a-f]{40}$")
|
||||
HASH_PATTERN = re.compile(r"^[0-9a-f]{64}$")
|
||||
TIERS = {
|
||||
@@ -60,32 +60,41 @@ def load_config() -> dict[str, object]:
|
||||
return config
|
||||
|
||||
|
||||
def validate_change_record(path: str, snapshot_commit: str) -> None:
|
||||
record_path = ROOT / path
|
||||
try:
|
||||
record = json.loads(record_path.read_text(encoding="utf-8"))
|
||||
except (OSError, json.JSONDecodeError) as error:
|
||||
fail(f"cannot read snapshot change record {path}: {error}")
|
||||
def validate_snapshot_review(record: object) -> None:
|
||||
if not isinstance(record, dict):
|
||||
fail("snapshot review is missing")
|
||||
required = {
|
||||
"schemaVersion", "snapshotSourceCommit", "capabilities", "classification",
|
||||
"publicApiDiff", "semver", "deprecations", "platformEvidence",
|
||||
"areas",
|
||||
"canonicalPath",
|
||||
"classification",
|
||||
"publicApiDiff",
|
||||
"semver",
|
||||
"deprecations",
|
||||
"wirePersistenceRuntimeImpact",
|
||||
"platformEvidence",
|
||||
}
|
||||
if not required.issubset(record) or record.get("schemaVersion") != 1:
|
||||
fail("snapshot change record is incomplete")
|
||||
if record.get("snapshotSourceCommit") != snapshot_commit:
|
||||
fail("snapshot change record does not match the snapshot source commit")
|
||||
if not isinstance(record.get("capabilities"), list) or not record["capabilities"]:
|
||||
fail("snapshot change record must name capability IDs")
|
||||
if not required.issubset(record):
|
||||
fail("snapshot review is incomplete")
|
||||
if not isinstance(record.get("areas"), list) or not record["areas"]:
|
||||
fail("snapshot review must name the affected API areas")
|
||||
if not all(isinstance(area, str) and area for area in record["areas"]):
|
||||
fail("snapshot review API areas must be non-empty strings")
|
||||
diff = record.get("publicApiDiff")
|
||||
if not isinstance(diff, dict) or set(diff) != {"added", "removed"}:
|
||||
fail("snapshot change record must classify added and removed API lines")
|
||||
fail("snapshot review must classify added and removed API lines")
|
||||
if not all(isinstance(diff[key], int) and diff[key] >= 0 for key in diff):
|
||||
fail("snapshot change record API counts must be non-negative integers")
|
||||
fail("snapshot review API counts must be non-negative integers")
|
||||
if not isinstance(record.get("platformEvidence"), list) or not record["platformEvidence"]:
|
||||
fail("snapshot change record must name platform evidence")
|
||||
for key in ("classification", "semver", "deprecations"):
|
||||
fail("snapshot review must name platform evidence")
|
||||
for key in (
|
||||
"canonicalPath",
|
||||
"classification",
|
||||
"semver",
|
||||
"deprecations",
|
||||
"wirePersistenceRuntimeImpact",
|
||||
):
|
||||
if not isinstance(record.get(key), str) or not record[key]:
|
||||
fail(f"snapshot change record must name {key}")
|
||||
fail(f"snapshot review must name {key}")
|
||||
|
||||
|
||||
def public_packages(manifest_path: str) -> set[str]:
|
||||
@@ -183,10 +192,7 @@ def validate_metadata(
|
||||
)
|
||||
if snapshot_ancestor.returncode != 0:
|
||||
fail(f"snapshot source commit {snapshot_commit} is not an ancestor of HEAD")
|
||||
change_record = snapshot_source.get("changeRecord")
|
||||
if not isinstance(change_record, str) or not change_record.startswith("api-reviews/"):
|
||||
fail("snapshot source must name a reviewed change record")
|
||||
validate_change_record(change_record, snapshot_commit)
|
||||
validate_snapshot_review(snapshot_source.get("review"))
|
||||
|
||||
packages = config.get("packages")
|
||||
if not isinstance(packages, list) or not packages:
|
||||
@@ -209,7 +215,7 @@ def validate_metadata(
|
||||
fail(f"{name} has an unknown stability tier")
|
||||
if package.get("compatibility") != "reviewed-snapshot":
|
||||
fail(f"{name} must use the reviewed-snapshot compatibility policy")
|
||||
if not isinstance(snapshot, str) or not snapshot.startswith("api-baseline/"):
|
||||
if not isinstance(snapshot, str) or not snapshot.startswith("api/snapshots/"):
|
||||
fail(f"{name} has an invalid snapshot path")
|
||||
snapshot_path = ROOT / snapshot
|
||||
if not snapshot_path.is_file() and not updating:
|
||||
@@ -292,29 +298,26 @@ def main() -> None:
|
||||
parser.add_argument("--metadata-only", action="store_true")
|
||||
parser.add_argument("--update", action="store_true")
|
||||
parser.add_argument("--snapshot-source-commit")
|
||||
parser.add_argument("--change-record")
|
||||
args = parser.parse_args()
|
||||
if args.metadata_only and args.update:
|
||||
fail("--metadata-only and --update are mutually exclusive")
|
||||
|
||||
config = load_config()
|
||||
if args.update:
|
||||
if not args.snapshot_source_commit or not args.change_record:
|
||||
fail("--update requires --snapshot-source-commit and --change-record")
|
||||
if not args.snapshot_source_commit:
|
||||
fail("--update requires --snapshot-source-commit")
|
||||
head = run(["git", "rev-parse", "HEAD"]).strip()
|
||||
if args.snapshot_source_commit != head:
|
||||
fail("snapshot source must be the clean source commit at HEAD")
|
||||
if not args.change_record.startswith("api-reviews/"):
|
||||
fail("change record must be stored below api-reviews/")
|
||||
status = run(["git", "status", "--porcelain=v1", "--untracked-files=all"])
|
||||
dirty_paths = {line[3:] for line in status.splitlines() if len(line) > 3}
|
||||
if dirty_paths - {args.change_record}:
|
||||
fail("snapshot source has uncommitted changes outside the review record")
|
||||
config["snapshotSource"] = {
|
||||
"commit": args.snapshot_source_commit,
|
||||
"capturedOn": date.today().isoformat(),
|
||||
"changeRecord": args.change_record,
|
||||
}
|
||||
if dirty_paths - {"api/stability.json"}:
|
||||
fail("snapshot source has uncommitted changes outside api/stability.json")
|
||||
snapshot_source = config.get("snapshotSource")
|
||||
if not isinstance(snapshot_source, dict):
|
||||
fail("snapshot source identity is missing")
|
||||
snapshot_source["commit"] = args.snapshot_source_commit
|
||||
snapshot_source["capturedOn"] = date.today().isoformat()
|
||||
packages = validate_metadata(config, updating=args.update)
|
||||
if args.metadata_only:
|
||||
print("api baseline metadata: ok")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Reject removals from the immutable Wave C public-API compatibility floor."""
|
||||
"""Reject removals from the reviewed public-API compatibility floor."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -10,7 +10,7 @@ from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
LEDGER_PATH = ROOT / "api-stability.json"
|
||||
LEDGER_PATH = ROOT / "api" / "stability.json"
|
||||
|
||||
|
||||
def fail(message: str) -> None:
|
||||
@@ -32,21 +32,41 @@ def git_show(commit: str, path: str) -> str:
|
||||
return result.stdout
|
||||
|
||||
|
||||
def load_floor_ledger(commit: str) -> dict[str, object]:
|
||||
for path in ("api/stability.json", "api-stability.json"):
|
||||
result = subprocess.run(
|
||||
["git", "show", f"{commit}:{path}"],
|
||||
cwd=ROOT,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
if result.returncode == 0:
|
||||
return json.loads(result.stdout)
|
||||
fail(f"cannot read API ledger at compatibility floor {commit}")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
metadata = subprocess.run(
|
||||
[sys.executable, "tools/check-api-baseline.py", "--metadata-only"], cwd=ROOT
|
||||
)
|
||||
if metadata.returncode != 0:
|
||||
fail("snapshot metadata or reviewed change record is invalid")
|
||||
fail("snapshot metadata or review is invalid")
|
||||
ledger = json.loads(LEDGER_PATH.read_text(encoding="utf-8"))
|
||||
floor = ledger.get("compatibilityFloor", {}).get("evidenceCommit")
|
||||
if not isinstance(floor, str):
|
||||
fail("api-stability.json has no compatibility-floor commit")
|
||||
fail("api/stability.json has no compatibility-floor commit")
|
||||
floor_ledger = load_floor_ledger(floor)
|
||||
floor_snapshots = {
|
||||
package["name"]: package["snapshot"] for package in floor_ledger["packages"]
|
||||
}
|
||||
total_added = 0
|
||||
total_removed = 0
|
||||
for package in ledger["packages"]:
|
||||
path = package["snapshot"]
|
||||
before = set(git_show(floor, path).splitlines())
|
||||
floor_path = floor_snapshots.get(package["name"])
|
||||
if not isinstance(floor_path, str):
|
||||
fail(f"{package['name']} is absent from the compatibility floor")
|
||||
before = set(git_show(floor, floor_path).splitlines())
|
||||
after = set((ROOT / path).read_text(encoding="utf-8").splitlines())
|
||||
added = sorted(after - before)
|
||||
removed = sorted(before - after)
|
||||
@@ -58,17 +78,15 @@ def main() -> None:
|
||||
print(f"- {line}", file=sys.stderr)
|
||||
if total_removed:
|
||||
fail(
|
||||
f"{total_removed} public API lines were removed from the Wave C floor; "
|
||||
f"{total_removed} public API lines were removed from the compatibility floor; "
|
||||
"the current policy permits additions only"
|
||||
)
|
||||
change_record = json.loads(
|
||||
(ROOT / ledger["snapshotSource"]["changeRecord"]).read_text(encoding="utf-8")
|
||||
)
|
||||
if change_record["publicApiDiff"] != {
|
||||
review = ledger["snapshotSource"]["review"]
|
||||
if review["publicApiDiff"] != {
|
||||
"added": total_added,
|
||||
"removed": total_removed,
|
||||
}:
|
||||
fail("reviewed change record does not match the measured API diff")
|
||||
fail("snapshot review does not match the measured API diff")
|
||||
print(f"api compatibility: additive-only (+{total_added}, -0)")
|
||||
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
LEDGER_PATH = ROOT / "api-stability.json"
|
||||
CONTRACT_PATH = ROOT / "api-baseline" / "manifest-contract.json"
|
||||
LEDGER_PATH = ROOT / "api" / "stability.json"
|
||||
CONTRACT_PATH = ROOT / "api" / "snapshots" / "manifest-contract.json"
|
||||
|
||||
|
||||
def fail(message: str) -> None:
|
||||
|
||||
@@ -14,7 +14,7 @@ ROOT = Path(__file__).resolve().parents[1]
|
||||
EXPECTED_PACKAGES = {"lxst-core", "lxst-rns", "lxst-telephony"}
|
||||
EXPECTED_MSRV = "1.87"
|
||||
EXPECTED_RETICULUM_VERSION = "1.2.0"
|
||||
EXPECTED_RETICULUM_COMMIT = "dc6bc4ee82daf66b3b40386f9777dbe62b08fec2"
|
||||
EXPECTED_RETICULUM_COMMIT = "e0889f718894ead2f0deb37ad144d67c24fe6270"
|
||||
EXPECTED_OPUS_DEPENDENCY = (
|
||||
'opus-rs = { version = "=0.1.29", default-features = false, '
|
||||
'features = ["heap"] }'
|
||||
|
||||
Reference in new issue
Block a user