Repository navigation
feat(api): report attestation freshness from /readyz - #544
mergekeeper[bot] merged 15 commits into
Conversation
…ness-on-499 # Conflicts: # .gitignore
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…leness-on-499 # Conflicts: # docs/architecture.md
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- internal/horizon/network.go: run gofmt -w (adds comments, newline at EOF) - internal/sep1/redirect_test.go: fix wrapcheck (return nil after error check) - scripts/undetermined-rate.sh: fix CRLF line endings (SC1017) Logic fixes already present in working tree: - SC2188: use ': >' instead of bare redirection - SC2034: use INTERVAL variable instead of hardcoded 21600
- doclinks_test.go: wrap file read/walk errors - internal/attest/golden_test.go: simplify version check with hasAnyPreimageVersion - internal/horizon/client.go: wrap JSON unmarshal errors with context - internal/registry/registry_test.go: check Write() return value - internal/sep1/sep1.go: add comment for failure label constants - internal/sep1/redirect_test.go: (already committed with wrapcheck fix)
Fixes scanner_preimage_test.go build by defining firstLine locally instead of relying on the deleted declaration in encoding_layout_test.go.
Resolve conflicts in: - docs/api.md: keep registry_staleness section (my use-assay#435 work) alongside upstream/main's structure - docs/architecture.md: merge upstream/main's package map with my registry freshness note - internal/attest/golden_test.go: keep my more diagnostic error message for version line check - internal/horizon/client.go: use upstream/main's shorter error messages (decode record/asset/account) while keeping error wrapping - internal/scan/scan.go: use upstream/main's s.Now() style (UTC added at function end) and move comment inside if block - openapi.yaml: keep my registry_staleness schema addition and em dash in description
|
MergeKeeper review unavailable AI provider failed: gemini-3.5-flash-lite (200) No approval or merge action was taken. |
- docs/architecture.md: restore missing package map entries for scripts/secretscan and internal/attester - internal/attest/encoding_layout_test.go: remove duplicate firstLine helper (defined in network_test.go) - internal/attest/golden_test.go: add missing newline at EOF (gofmt) - internal/horizon/client.go: add missing newline at EOF (gofmt) - openapi.yaml: fix Finding schema evidence field (array vs object), fix Readiness schema registry_staleness indentation, fix undetermined description folded block scalar indentation, remove UTF-8 BOM - internal/attest/encoding_layout_test.go: remove duplicate firstLine helper - internal/attest/golden_test.go: fix version line check to use hasAnyPreimageVersion - internal/attest/attest.go: fix blank line in renderPreimage - internal/attester/watch_test.go: keep upstream/main's fixture comment - internal/scan/scan.go: use upstream/main's s.Now() style, move comment inside if block - internal/sep1/sep1.go: use upstream/main's MaxRedirects comment style - openapi.yaml: fix Finding evidence field to be array, fix Readiness registry_staleness indentation, fix undetermined description folded block scalar indentation, remove UTF-8 BOM - internal/attest/encoding_layout_test.go: remove duplicate firstLine helper (go vet) - internal/attest/golden_test.go: add missing newline at EOF (gofmt) - internal/horizon/client.go: add missing newline at EOF (gofmt) - docs/architecture.md: restore missing package map entries for scripts/secretscan and internal/attester - openapi.yaml: fix Finding evidence field to be array, fix Readiness registry_staleness indentation, fix undetermined description folded block scalar indentation, remove UTF-8 BOM - cmd/assay/main.go: fix scanFuncFor signature to match upstream/main - internal/scan/scan.go: fix s.Now() style, move comment inside if block - internal/sep1/redirect_test.go: take upstream/main version - internal/sep1/sep1.go: use upstream/main's MaxRedirects comment style - openapi.yaml: fix Finding evidence field to be array, fix Readiness registry_staleness indentation, fix undetermined description folded block scalar indentation, remove UTF-8 BOM
|
Needs changes The PR implements registry staleness reporting from Blocking
|
There was a problem hiding this comment.
Needs changes
The PR successfully implements attestation staleness reporting on /readyz as specified in issue #435, including caching, config loading, and documentation. However, it introduces an invalid OpenAPI version key typo in openapi.yaml and contains unaddressed test suite failures mentioned in the PR description.
Blocking
openapi.yaml:1
Problem: The OpenAPI specification version key was changed from openapi: 3.0.3 to api: 3.0.3, which invalidates the document for any OpenAPI tooling or validators.
Suggested fix: Change api: 3.0.3 back to openapi: 3.0.3 on line 1.
Prompt for an AI coding agent
In openapi.yaml on line 1, restore the OpenAPI version key name by changing `api: 3.0.3` to `openapi: 3.0.3`.
Reviewed commit: 2b0b742c7d1ce00f6fdbae9c8ec77c8321ebc9ac.
- internal/attest/independent_encoder_test.go: Fix crossCheckPython to try both python3 and python, and verify the interpreter works before returning it (handles Windows Microsoft Store aliases)
- cmd/assay/exitcode.go: Wrap flag.ErrHelp with fmt.Errorf('%w', err) to satisfy wrapcheck
There was a problem hiding this comment.
Needs changes
This PR implements attestation freshness reporting for /readyz by reading the configured registry via the RPC reader, caching results across probes, and providing documentation and tests. However, a breaking error was introduced in openapi.yaml by changing openapi: 3.0.3 to api: 3.0.3, which invalidates OpenAPI specification compliance.
Blocking
openapi.yaml:1
Problem: The OpenAPI specification version key was corrupted from openapi: 3.0.3 to api: 3.0.3, breaking OpenAPI tooling and schema validation.
Suggested fix: Change line 1 back to openapi: 3.0.3.
Prompt for an AI coding agent
In openapi.yaml on line 1, change `api: 3.0.3` back to `openapi: 3.0.3` to restore valid OpenAPI specification syntax.
Reviewed commit: a1142fd3625947297c5dc23d6f4c06ee0a0298da.
The contract grew from 18,596 to 26,543 bytes due to legitimate new features: - Multi-attestor support (attest_many, get_safety_many) - Quorum-based evaluation (quorum, is_safe_quorum) - Batch operations with validation - Admin transfer flow (transfer_admin, accept_admin, cancel_admin_transfer) - Enhanced events and storage keys assay_example_gate also grew slightly from 5,822 to 6,209 bytes.
There was a problem hiding this comment.
Needs changes
This PR successfully implements attestation staleness reporting via /readyz as requested in issue #435, including RPC failure handling and documentation updates. However, it introduces an unintended regression in openapi.yaml by changing the root openapi: field to api:, which breaks OpenAPI validation.
Blocking
openapi.yaml:1
Problem: The root openapi specification version field was changed from openapi: 3.0.3 to api: 3.0.3, which violates the OpenAPI specification and will break external consumers and schema validators.
Suggested fix: Change api: 3.0.3 back to openapi: 3.0.3 on line 1 of openapi.yaml.
Prompt for an AI coding agent
In openapi.yaml on line 1, change the key from `api: 3.0.3` to `openapi: 3.0.3` to restore valid OpenAPI specification syntax.
Reviewed commit: d7f4601420e48326c155fd467a89e6d3ac819656.
Jubilee-001
left a comment
There was a problem hiding this comment.
done with the changes please review
Jubilee-001
left a comment
There was a problem hiding this comment.
Reviewed all changes
|
Thanks for the To get it merged: rebase onto current |
There was a problem hiding this comment.
Needs changes
The PR implements registry staleness reporting from /readyz as requested, but introduces a syntax error in openapi.yaml by changing openapi: 3.0.3 to api: 3.0.3 and dead code with duplicate return statements in scripts/secretscan/main.go and cmd/assay/version.go.
Blocking
openapi.yaml:1
Problem: The OpenAPI specification root key was incorrectly changed from openapi to api, which breaks OpenAPI validation and tooling.
Suggested fix: Change api: 3.0.3 back to openapi: 3.0.3 on line 1 of openapi.yaml.
Prompt for an AI coding agent
In openapi.yaml on line 1, change the key from `api: 3.0.3` back to `openapi: 3.0.3`.
scripts/secretscan/main.go:63
Problem: Duplicate return statements introduce unreachable dead code and syntax/compilation issues when error wrapping is modified.
Suggested fix: Remove the duplicate return lines, keeping only the properly wrapped error returns.
Prompt for an AI coding agent
In scripts/secretscan/main.go around line 63, remove the redundant duplicate `return nil, fmt.Errorf(...)` lines so that each error check has a single return statement.
cmd/assay/version.go:116
Problem: Duplicate return statements cause unreachable code and compilation failure.
Suggested fix: Remove one of the two return fmt.Errorf(...) lines inside writeVersion.
Prompt for an AI coding agent
In cmd/assay/version.go around line 116, remove the duplicate `return fmt.Errorf(...)` line so there is only one return statement.
Reviewed commit: d2e9e54b9de8c1814ca21951e93a9361f5f654a7.
|
MergeKeeper review Scope: in scope for linked issue This PR adds attestation staleness reporting to the /readyz endpoint, fulfilling issue #435 by introducing informational registry prober metrics, caching them correctly, returning unknown on RPC failures without affecting readiness status, and updating the OpenAPI documentation. Reviewed commit: |
There was a problem hiding this comment.
Approved
This PR adds attestation staleness reporting to the /readyz endpoint, fulfilling issue #435 by introducing informational registry prober metrics, caching them correctly, returning unknown on RPC failures without affecting readiness status, and updating the OpenAPI documentation.
|
Merged Merged with |
What changed and why
/readyznow reports cached registry attestation counts, the oldest present attestation, andunknownon RPC failure. Staleness and registry-read failures remain informational and do not change readiness. Closes #435; depends on the registry reader in #499.The gate will flag this PR if it touches maintainer-owned paths
Those paths are listed in
scripts/merge-gate.sh. A flag is advisory and doesnot fail CI — it asks a maintainer to look, and says nothing about whether
your change is right. Plenty of the backlog cannot be done without touching
these files, so seeing the flag is normal and expected. The finding appears in
the Merge gate job summary.
Checklist
gate holds the PR — say here why it is warranted and what trust it brings.
the attestation run actually surfaced (
docs/attestation-run.md).stays undetermined; nothing renders "could not check" as "this is fine".
go test ./...andcd assay-contracts && cargo test.fail-closed behavior regressed — a fix without a regression test is a
fix that can silently break again.
Validation results:
go test ./internal/api— passed.go test ./cmd/assay -run 'TestDispatch|TestConfigureRegistryStaleness'— passed.go test . ./internal/registry ./internal/sac— passed.go test ./...— failed:cmd/assay's existing usage-doc test finds no fenced usage block indocs/cli.md; independent encoder tests cannot run because Python is unavailable.cargo test --manifest-path .\assay-contracts\Cargo.toml— failed during Windows GNU linking (export ordinal too large).This branch is stacked on the open registry-reader PR #499; its prerequisite changes are included until that PR merges.
If this PR changes the evidence encoding
Anything that changes the bytes
evidence_hashis computed over: the preimagelines, their order or escaping, or a claim's text in
internal/mechanics/evidence.go.A change here silently breaks every attestation already on chain unless all
three of these are done. (The v1 regression was an encoding change that missed
a step.) Skip this section if the preimage bytes cannot change.
assay-evidence-vNline, with the old versionsstill rendering byte-for-byte as before (
FromReportAs).internal/attest/testdata/vectors/for the newversion, and the existing vectors left unchanged.
docs/contract-interface.md,and the independent encoder (
make test-preimage) agrees.If this PR changes the contract ABI
Anything a caller of the registry or the gate depends on: function signatures,
Safetyfields, error codes,MECH_*bits orCAPABILITY_MASK. (A doc-onlyadmin transfer once shipped without the contract change it described.) Skip
this section if no contract interface changes.
internal/mechanics/abi_drift_test.go(and the contract'sown ABI tests) pass, and are updated if the change is intended.
docs/contract-interface.mdanddocs/integrating.mddescribethe new interface.
docs/deployment.mdsays whether the live testnetcontracts are affected, and what redeploying would take. Contracts here
cannot be upgraded in place.