feat(registry): schema-capture freshness, honest drift basis, and the parity ledger - #11217
Closed
JSONbored wants to merge 1 commit into
Closed
feat(registry): schema-capture freshness, honest drift basis, and the parity ledger#11217JSONbored wants to merge 1 commit into
JSONbored wants to merge 1 commit into
Conversation
… parity ledger (#11146) Three mechanisms broke "every subnet's API, exactly like using it directly", each silently. This closes the epic: 1. FRESHNESS IS VISIBLE. The capture lane's cadence is declared (SCHEMA_CAPTURE_CADENCE_HOURS), and every captured index entry carries capture_age_hours + capture_stale. The lane stays manual by ADR 0006 -- declaring the cadence does not run it, it makes its silence VISIBLE, which is the difference between an unpublished gap and a published one. An unusable build clock yields null, never zero: buildTimestamp() is the 1970 placeholder in every local build, and clamping would have republished a twelve-day-old capture as fresh. 2. DRIFT SAYS WHAT IT MEASURES. Entries carry drift_basis: "previous-capture". drift_status compares our snapshot to OUR previous snapshot, never upstream -- which is why 23 of 24 measurably-drifted subnets reported "unchanged". The payload now says so instead of implying the opposite. 3. THE PARITY LEDGER. Each gaps row gains schema_parity: captured paths and declared mutations against registered route surfaces and registered mutations, flagged when the catalogue registers fewer routes than the subnet declares. Derived from schema INDEX entries only -- captured documents exist solely in credentialed builds -- with the capture lane now stamping non_get_operation_count so both sides are measured. First build measures 53 subnets and flags 27. Closes #11146
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
metagraphed-registry-sync-api | 81d1ec0 | Aug 14 2026, 12:54 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
metagraphed-data-api | 81d1ec0 | Aug 14 2026, 12:54 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
metagraphed-wss-lb | 81d1ec0 | Aug 14 2026, 12:54 PM |
Owner
Author
|
Closing on red CI rather than pushing over it. Two real defects, both mine:
Rebuilding as one PR that closes #11146. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #11146.
The epic measured three mechanisms that each silently broke "every subnet's API, exactly like using it directly". Phase 3 (the surface
methoddimension) landed in #11210 and the first declared mutation in #11212; this completes the remaining three in one change.1. Freshness is visible
The capture lane's cadence is declared once (
SCHEMA_CAPTURE_CADENCE_HOURS = 48) and every captured index entry carriescapture_age_hours+capture_stale; the artifact carriescapture_cadence_hoursso a consumer can compute staleness itself.The lane stays manual by ADR 0006 — declaring a cadence does not run it, it makes its silence visible, which is the difference between an unpublished gap and a published one.
An unusable clock is null, never zero.
buildTimestamp()returns the 1970 epoch placeholder in every local and determinism build; an earlyMath.max(0, …)in this branch published a twelve-day-old capture as fresh — the exact dishonesty this phase removes. Caught in a built artifact, fixed, and pinned by a test.2. Drift says what it measures
Entries carry
drift_basis: "previous-capture".drift_statuscompares our snapshot to our previous snapshot, never upstream — which is why 23 of 24 measurably-drifted subnets reportedunchanged. The payload now says so rather than implying the opposite, andcapture_staletells a reader the comparison is old.3. The parity ledger
Each gaps row gains
schema_parity: captured paths and declared mutations against registered route surfaces and registered mutations,flaggedwhen the catalogue registers fewer routes than the subnet declares,captured_stalewhen the measurement rests on an old capture.Derived from schema index entries only — captured documents exist solely in credentialed builds, so a rollup reading them would not be reproducible — with the capture lane now stamping
non_get_operation_countso both sides of the mutation ledger are measured. Counts absent on pre-stamp entries report null, never zero.First measurement: 53 subnets measured, 27 flagged — sn-3 registers 8 routes against 208 declared paths, sn-105 28 against 53, matching the epic's fleet numbers.
Validation
typecheck,lint,format:checkvalidate,validate:api(215 routes),validate:openapi,validate:contract-drift,validate:published-names,validate:schema-enums,validate:schema-vocabularies,validate:mcp(240 tools),validate:schemas,validate:module-state-resets,validate:no-hand-written-mjs— all greencaptured_stale: null; real stamp → all 53true(captures are 12 days old against a 48h cadence)