Skip to content

ci: replay RFC 8785 byte vectors and canonicalize the shared fixtures - #264

Open
astrogilda wants to merge 2 commits into
NOSAI-Federation:mainfrom
astrogilda-forks:ci/agent-evidence-vectors-replay
Open

astrogilda wants to merge 2 commits into
NOSAI-Federation:mainfrom
astrogilda-forks:ci/agent-evidence-vectors-replay

Conversation

@astrogilda

Copy link
Copy Markdown

@aeoess, the jcs-vectors job replays the RFC 8785 byte vectors from the published agent-evidence-vectors package, pinned at 0.36.3, then canonicalizes the JSON files under fixtures/. A duplicate key, NaN, Infinity or an unstable canonical form fails the job. A pip entry in dependabot.yml opens a bump pull request for each package release, so each release is tested against those files before it lands.

This adds the CI job described in #244. The job exits 0 on the current fixtures and is ready to merge. To run it locally, install .github/ci/requirements-aev.txt in a venv and run python -I scripts/ci/check-fixtures-jcs.py.

Add a jcs-vectors job that installs a pinned agent-evidence-vectors
release, replays its RFC 8785 byte vectors against the reference
canonicalizer, and canonicalizes every JSON file under fixtures/. A
fixture with a duplicate key, NaN or Infinity, or no stable canonical
form fails the job; each fixture's canonical SHA-256 goes to the job
summary. A pip entry in dependabot.yml opens the bump pull request
when a new release ships.

Signed-off-by: Sankalp Gilda <23521054+astrogilda@users.noreply.github.com>

@aeoess aeoess left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reran the script at e6cf986 with agent-evidence-vectors 0.36.3. All 19 fixtures canonicalize. Adding a fixture with a duplicate key or NaN makes it exit 1.

One change before merge. The byte-vector step counts failures but does not check how many cases ran. The pinned package supplies 53 RFC 8785 vectors. When I forced its vector iterator to return no cases, the script still exited 0 with the same success summary.

Please report the number of byte vectors replayed and fail when it is zero. The count should come from the cases actually checked, so it can grow with later releases.

The replay now counts the byte vectors it walks from the package's own
vectors() iterator, prints the count, writes it to the job summary and
exits 1 when it is zero. A test forces the empty iterator and a second
step in the job runs it.

Signed-off-by: Sankalp Gilda <23521054+astrogilda@users.noreply.github.com>
@astrogilda

Copy link
Copy Markdown
Author

@aeoess thank you for catching that an empty vectors iterator passed silently. astrogilda-forks@2a89512 counts the RFC 8785 byte vectors the replay job runs, prints the count, writes it to the job summary and exits 1 when it is zero.

A new test forces the empty iterator, and the jcs-vectors workflow runs that test as its last step.

@aeoess aeoess left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2a89512 addresses my review. The JCS job replays 53 byte vectors, passes all 19 fixtures and now fails when no vectors run.

The remaining Validate failure comes from nine expired review_by dates on main, not this PR. Nothing further needed from you. Thanks for fixing this.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants