Repository navigation
feat(scripts): clause summary, merkle progress and snapshot provenance (#652, #653, #654) - #666
Open
Justice989810 wants to merge 3 commits into
Conversation
A passing run printed "all mapped to existing tests" with no count, so a green result read the same whether it had verified ninety clauses or zero — an empty or mis-pathed mapping file would have looked like success. The summary now gives the number of clauses and the documents they came from, SPEC.md and the clause mapping, both as repository-relative paths. Failure behaviour is unchanged. Closes Refract-Protocol#652
`build` hashed every leaf, built the tree and wrote every proof before printing anything, so a large batch looked indistinguishable from a hang. It now reports every `--progress-every` leaves (1000 by default, 0 to stay silent), and again when the tree is built and when proofs are being written — the two phases after hashing that also take time on a big batch. Progress goes to stderr, so stdout stays the single machine-readable summary line it already was and anything parsing it is unaffected. Closes Refract-Protocol#653
A snapshot recorded the network but not the node. Two fixtures of the same network can disagree because they came from different RPC nodes with different retention or lag, and nothing in the file said so. `rpc_endpoint` now sits beside `network`. It is redacted before it is written: userinfo, query string and fragment are dropped, leaving scheme, host, port and path. A snapshot is committed to the repository, so the endpoint of a private RPC must not carry its API key in with it — that is the difference between recording provenance and leaking a credential. Closes Refract-Protocol#654
|
@Justice989810 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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 #652
Closes #653
Closes #654
Closes #651
Three of the four were real. #651 describes behaviour the script already has — evidence at the bottom.
#652 — a passing run says what it checked
check_clauses.pyprinted "all mapped to existing tests" with no count, so a green result read the same whether it had verified ninety clauses or zero. An empty or mis-pathed mapping file would have looked like success.The summary now names the number of clauses and the documents they came from (
SPEC.mdand the clause mapping, as repository-relative paths). Failure behaviour is untouched.#653 — progress while building a batch
merkle_batch.py buildhashed every leaf, built the tree and wrote every proof before printing anything, so a large batch was indistinguishable from a hang.It now reports every
--progress-everyleaves (1000 by default,0to stay silent), and again when the tree is built and when proofs are being written — the two phases after hashing that also take real time on a big batch.Progress goes to stderr, so stdout stays the single machine-readable summary line it already was and anything parsing it is unaffected.
#654 — which node the snapshot came from
A snapshot recorded
networkbut not the endpoint. Two fixtures of the same network can disagree because they were read from different RPC nodes with different retention or lag, and nothing in the file said so.rpc_endpointnow sits besidenetwork.It is redacted before it is written. Userinfo, query string and fragment are dropped, leaving scheme, host, port and path:
These snapshots are committed as fixtures, so a private RPC's API key must not travel with one. That is the difference between recording provenance and leaking a credential.
Not solved — #651 already exits non-zero
scripts/check_links.pyalready fails the run on a broken link. At the end ofmain():A clean run exits 0 and a broken link exits 1, which is exactly what the issue asks for.
There is a related real problem, though, and it may be what was actually seen.
check_external_linktreats a DNS failure as success:In a network-isolated CI runner every external link is "Skipped", nothing lands in
broken_links, and the job passes green while printing a wall of[URL] ... Skippedlines — "the report scrolls past unnoticed", precisely. That is a deliberate offline affordance rather than a bug in the exit code, so I have not changed it here. If you want it surfaced, the fix is to count the skips and either summarise them at the end or fail under a--require-networkflag. Say the word and I will open that as its own issue.A note on the batch
mainwas last committed on 24 October; these four issues were drafted on 24 November, and #651 describes work that was already in the tree when it was written.Not run here: written without a build environment.
python3 -m astparses all three changed scripts, and the redaction helper was executed against the examples above, but the repo's own checks are what to apply.