You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(hub): let generate_hub_fixture generate and check a fixture for a given object location base #2043
generate_hub_fixture can generate and check the Hub fixture for a given object location base. A Hub preview data plane on its own HTTPS origin can then serve a Rust-generated manifest whose object locations resolve there, so gf clone can be proven end to end against preview before production.
Context
Discovery v1 locations are absolute HTTPS URLs inside the canonical manifest ("Locations are transport"). Changing the origin changes the manifest digest, so the Hub must not rewrite them; Rust has to generate them (ADR 0053 reasoning).
The generate_hub_fixture example and check() hard-code DEFAULT_LOCATION_BASE (https://data.graphforge.sh/objects/sha256/), so only the production fixture can be produced or verified.
gf clone correctly rejects loopback and private hosts, so a fully local clone stays out of scope. This is about public HTTPS preview origins.
Change
Add --location-base <https-url> (and an output directory) to generate_hub_fixture for generation and check modes. Validate the base with the graphforge-discovery location rules: HTTPS, public host, no credentials, ends in /.
Record the location base in the generated fixture metadata so provenance binds it.
The checked-in tests/fixtures/hub/generated/v1 stays on the default base.
Acceptance
Generating twice with the same non-default base is byte-identical.
Against the default output, only objects[].locations, the manifest, refs, and fixture metadata differ.
Check mode with the same base passes; a tampered location or a mismatched base fails closed.
No discovery protocol, schema, or clone-security change.
Merged to main through the squash merge queue in #2100. The example supports --location-base <https-url> and --output-dir <directory> in both --update generation and default check modes. The base is recorded in fixture.json, and check binds every object's location to the requested base.
Acceptance evidence:
CARGO_TARGET_DIR=/home/ubuntu/gf-hub-fixture-target make test-rust ARGS="-p graphforge-cli --lib --test hub_fixture --example generate_hub_fixture": 147 passed; one existing ignored manual performance measurement.
Preview regression generates twice and compares every byte, compares every manifest field and artifact with the production fixture, passes check for the same base, and rejects the wrong base, tampered metadata, and each object's tampered location even after re-sealing the manifest digest.
The compiled example passed default check, preview update/check, repeated replacement with identical bytes, mismatched-base rejection, invalid-base preservation, and tampered-location rejection.
make test-rust ARGS="-p graphforge-cli --example generate_hub_fixture": all 3 example tests passed after the backup-restoration review fix.
CARGO_TARGET_DIR=/home/ubuntu/gf-hub-fixture-target make check: passed after the final edit.
Independent review found no remaining blockers; final CodeRabbit review found zero issues before the independently verified backup fix.
The checked-in production object, summary, module, manifest, and refs bytes are unchanged. Only fixture provenance metadata changes. No discovery schema or clone-security changes.
PR CI run: CI Gate passed at the final PR head. Merge-queue CI run: CI Gate passed; the squash commit is verified on main, and this issue closed automatically.
Activity
fix(hub): preserve fixture backup when output restoration fails (#2043)
DecisionNerd commentedon Oct 14, 2026
Merged to
mainthrough the squash merge queue in #2100. The example supports--location-base <https-url>and--output-dir <directory>in both--updategeneration and default check modes. The base is recorded infixture.json, and check binds every object's location to the requested base.Acceptance evidence:
CARGO_TARGET_DIR=/home/ubuntu/gf-hub-fixture-target make test-rust ARGS="-p graphforge-cli --lib --test hub_fixture --example generate_hub_fixture": 147 passed; one existing ignored manual performance measurement.make test-rust ARGS="-p graphforge-cli --example generate_hub_fixture": all 3 example tests passed after the backup-restoration review fix.CARGO_TARGET_DIR=/home/ubuntu/gf-hub-fixture-target make check: passed after the final edit.The checked-in production object, summary, module, manifest, and refs bytes are unchanged. Only fixture provenance metadata changes. No discovery schema or clone-security changes.
PR CI run: CI Gate passed at the final PR head. Merge-queue CI run: CI Gate passed; the squash commit is verified on
main, and this issue closed automatically.