feat: add guardian-publish-validator — methodology library health-check tool#6069
Open
danielnorkin wants to merge 1 commit into
Open
feat: add guardian-publish-validator — methodology library health-check tool#6069danielnorkin wants to merge 1 commit into
danielnorkin wants to merge 1 commit into
Conversation
Adds tools/guardian-publish-validator/ - a CLI and web UI that scans
the methodology library and reports per-entity health based on Hedera
consensus message + IPFS gateway reachability.
Built around two failure modes observed in production:
- Hedera testnet resets wipe consensus messages periodically, leaving
dangling references in published policies and tools.
- The public IPFS gateway ecosystem is degrading (Cloudflare sunsetted
their gateway in 2024, web3.storage/Storacha is winding down through
2026). Content pinned only to one provider becomes unreachable while
the Hedera anchor still resolves, producing silent null-reference
errors at import time.
Each entity (policy, tool, module, schema) lands in one of four buckets:
Healthy Hedera anchor alive + a local Kubo serves the IPFS bytes
Resilient Hedera anchor alive + at least two independent public
gateways serve it (ideal for upstream library content
where there is no operator-controlled Kubo)
Fragile Reachable from exactly one gateway; single point of failure
Broken No gateway has the bytes, or the Hedera message is missing
Features:
- CLI with --fail-on broken|fragile for CI gating
- --changed-only / --changed-only-from for PR-scoped checks
(pairs with `git diff --name-only` in GitHub Actions)
- Multi-gateway probing with repeatable --local-gateway flag for
operators with their own Kubo node
- Auto-clones the upstream methodology library when no --path is given,
caching in ~/.cache/guardian-publish-validator/
- Web UI for browsing reports (light/dark theme, sortable table,
filter pills, per-entity detail panel with clickable GitHub links,
CSV export, scan-on-demand)
- Example GitHub Actions workflow in examples/
Tests: node:test unit coverage for the README markdown parser, library
walker, and Hedera message decoder. Fixture-based, no external deps
required to run.
License: Apache-2.0, matching the rest of hashgraph/guardian.
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.
Summary
Adds a new tool under
tools/guardian-publish-validator/that scans the methodology library and reports per-entity health for every published artifact (policy, tool, module, schema). CLI for CI/CD integration, web UI for browsing, and an example GitHub Actions workflow.Discovered while supporting a customer hitting
Cannot read properties of null (reading 'type')on a policy import. The Hedera anchor was alive; the IPFS payload referenced inside it was unreachable from every gateway except Pinata. With current Guardian, that's a silent failure with no diagnostic. This tool surfaces both Hedera-side and IPFS-side rot, library-wide, before users hit them.The four buckets
Per discussion on the Resilient framing:
CI/CD integration
examples/github-actions.ymlis a copy-paste workflow. Two flags drive CI behavior:--fail-on broken— fails CI only on Broken entries. Suitable for PR gates that want to block introducing dead refs without rejecting fresh content that has not accumulated multiple pins yet.--fail-on fragile— fails on Fragile or Broken. Requires every entity to be Resilient or Healthy. Useful for scheduled sweeps catching pin-lineage degradation.--changed-only-from <file>scopes the scan to a list of changed file paths (pairs withgit diff --name-onlyin PR runs) so the CI job does not have to walk the entire library on every PR.Findings from running it against upstream develop (testnet)
Of 84 unique entities across 167 archives:
Full report JSON is reproducible via
npm run validate -- --branch develop.What is in this PR
bin/validator.js— CLI entry pointbin/ui.js— Express server for the web dashboardsrc/library.js—.policyand.toolzip walkersrc/manifests.js— README markdown table parsersrc/mirror.js— Hedera mirror node client and message decodesrc/ipfs.js— multi-gateway probing with Healthy / Resilient / Fragile / Broken classificationsrc/repo.js— auto-clonehashgraph/guardianinto the user cache when no--pathis givenui/index.html— single-page dashboard (light and dark, sortable, filterable, CSV export)tests/— 15 unit tests across the parser, walker, and message decoderexamples/github-actions.yml— ready-to-use workflowREADME.md— install, usage, CI/CD integration, output schema, contribution notesLicense
Apache-2.0, matching the rest of the repo. Headers on every source file.
Out of scope (planned follow-ups)
worker-service/src/api/ipfs-client-class.ts— separate PR. The validator diagnoses the gateway-availability problem; the worker-service fix is the root-cause remedy so GuardiangetFile()no longer breaks on degraded gateways.Test plan
npm testpasses (15 tests)--help,--skip-ipfssingle-archive run)--fail-on brokenexits non-zero on a synthetic stale fixture--changed-onlycorrectly scopes the scan to listed pathshashgraph/guardianto local cache on first run)Tracked internally at https://github.com/Climission/Managed-Guardian-Service/issues/1018