Skip to content

Add Agentic-Datacenter benchmark result references (TRACE external evidence source) - #438

Open
darklordVirtual wants to merge 6 commits into
agentrust-io:mainfrom
darklordVirtual:agentic-datacenter-benchmark-reference
Open

darklordVirtual wants to merge 6 commits into
agentrust-io:mainfrom
darklordVirtual:agentic-datacenter-benchmark-reference

Conversation

@darklordVirtual

Copy link
Copy Markdown

Adds integrations/agentic-datacenter-benchmark/: a TRACE Trust Record of an agent-governance gate can cite the gate's published Agentic-Datacenter benchmark result through one references entry.

What the referenced object is. An Agentic-Datacenter benchmark run writes, beside its result card, a record of the code commit and of the SHA-256 of every file it made (provenance.json). The workflow that ran it attests that record with a GitHub artifact attestation. The entry uses rel: "benchmark-result", id = the raw URL of that record at a fixed commit, resolver = the Agentic-Datacenter repository and digest = the record's SHA-256.

What is in the directory

  • adc_reference.py:
    • make builds the entry. It refuses a URL on a branch or tag, and bytes that are not an Agentic-Datacenter record listing a result card.
    • check resolves an entry and checks digest match. Optionally it checks any file the record lists against its hash, and whether GitHub holds an attestation of the record.
  • examples/: two Trust Records signed by a demo key derived from a published seed, one whose reference resolves to the cited bytes and one whose digest does not match. The record they cite, source/provenance.json, is synthetic: made for the example in the schema a run writes (adc-provenance/v1), with plainly fake values, and not the record of any run. All of it regenerates with examples/make_examples.py; nothing is copied from the Agentic-Datacenter repository.
  • tests/: both records verify with released agentrust-trace 0.11.0, the entry validates against Reference, and each case is checked offline against the synthetic record. With --online, one test makes an entry for a real published Agentic-Datacenter record at a fixed commit and resolves it, a file it lists and its attestation.
  • .github/workflows/agentic-datacenter-benchmark-conformance.yml: floating and fixed agentrust-trace, Python 3.11–3.13, with --online.
  • The generated index row and Marketplace catalog entry.

Role and claims. trace_roles: [external-evidence-source], so no Trust Record of its own is issued and no conformance level is claimed.

A resolved entry establishes only that the bytes are the cited bytes and are the record of a benchmark result. It does not establish that the gate behaved as the result says: the result is a simulation, and an attestation shows which workflow made the files. --attestations checks only that an attestation exists. gh attestation verify verifies its signature. The benchmark-result value of rel is not registered.

Run it

pip install -e "integrations/agentic-datacenter-benchmark[test]"
python -m pytest integrations/agentic-datacenter-benchmark/tests --online

Local results:

  • integration tests: 6 passed and 1 skipped offline, 7 passed with --online;
  • scripts/validate_integrations.py: 52 integrations, 0 failures;
  • index and catalog --check: current;
  • validate_compatibility.py: 0 failures;
  • tests/: 75 passed.

Disclosure: I maintain Agentic-Datacenter. The real record the online test resolves is of a gate whose maintainer is also an author of Agentic-Datacenter, as its participant entry states.

@rajnisht7 rajnisht7 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The approach (external-evidence-source, synthetic examples, honest “what it does NOT claim”, fixed-commit URLs, online test) looks good and the tests pass. A few validation and robustness points:

  • Schema not checked - record_problems() never validates schema == "adc-provenance/v1". A minimal JSON with only product, a 40-char commit, and a result_card.json hash currently passes. Same for a development-run label with benchmark_version.frozen = false. Kindly enforce the real schema + required fields.
  • resolver ignored - check() never looks at entry["resolver"]. An entry with a completely wrong resolver still succeeds if the other checks pass. TRACE treats resolver as the party responsible for retention; it should be validated.
  • Path traversal - The URL regex accepts ../ segments, and file names from the record (e.g. ../secret.txt) are used directly in URL construction. Reject . / .. and constrain relative paths.
  • MAX_BYTES not enforced - read(MAX_BYTES + 1) is returned with no length check. An oversized JSON + trailing whitespace can be truncated, still parse, and produce a wrong digest. Reject anything larger than the limit.
  • Fetch before validation - CLI does make(args.url, fetch(args.url)), so the request happens before the URL is checked. urllib also accepts file://. Validate the URL (HTTPS + pattern) first.
  • Attestation errors uncaught - The attestation branch has no try/except. Network/API/JSON failures escape instead of becoming a controlled problem string (unlike the record and file paths).
  • Any repo accepted + weak schema - Combined with (1), an unrelated repository can host a fabricated record that make() will turn into a reference whose resolver still points at the official Agentic-Datacenter repo.
  • Docs gap - The linked participant workflow attests and uploads the artifact but does not commit provenance.json into the repo. Following the README alone does not produce the raw commit URL that make() requires. Kindly document the extra “download + commit” step (and how to preserve the attested bytes).
  • Packaging - license = "Apache-2.0" needs setuptools ≥ 77; the build-system currently declares >=68.

…solver, safe paths and the byte limit; check URLs before fetching; report attestation lookups that fail; document committing the attested record
@darklordVirtual

Copy link
Copy Markdown
Author

Thank you for the careful review, @rajnisht7. Each point is fixed in 58e0c1d, with a test that fails on the previous commit (24 of them did) and passes now:

  1. Schema. make accepts only what a benchmark result writes: schema adc-provenance/v1, product Agentic-Datacenter, a label that is not a development run, benchmark_version with frozen: true, a 40-character code_commit, and files naming result_card.json with a SHA-256 each. The minimal record you describe and a development run with frozen: false are refused. Test: test_a_record_must_be_the_schema_a_benchmark_result_writes.
  2. Resolver. The entry's resolver is now the repository the record is kept in, the one its URL names, and check refuses any other. Test: test_the_resolver_is_the_repository_the_record_is_kept_in.
  3. Path traversal. ., .. and empty segments are refused in the URL, and file names from the record must be plain relative paths (no .., no leading /, no backslash) before they are used to build a URL. Tests: test_a_url_with_a_dot_segment_is_refused, test_a_file_name_in_the_record_that_could_leave_its_folder_is_refused.
  4. MAX_BYTES. fetch reads limit + 1 and refuses anything longer, instead of truncating. Test: test_more_than_the_limit_is_refused_not_cut.
  5. Fetch before validation. The command line checks the URL before any request, and fetch itself only opens https://raw.githubusercontent.com/ and https://api.github.com/, so never file://. Test: test_the_url_is_checked_before_anything_is_fetched.
  6. Attestation errors. Network, API and JSON failures of the attestation lookup are now problem strings, like the record and file paths. Test: test_an_attestation_lookup_that_fails_is_a_problem_not_a_crash.
  7. Any repository. With (1) and (2), a record fabricated in an unrelated repository yields an entry whose resolver names that repository, not Agentic-Datacenter. --attestations asks whether that repository holds an attestation of it, and the README points to gh attestation verify for the signature and the run.
  8. Docs gap. The README has a new section, "From the attested run to a URL at a commit": gh run download, gh attestation verify, committing the files byte for byte (with a note on line endings), and citing the record at that commit. Test: test_the_readme_says_how_to_commit_the_attested_record.
  9. Packaging. setuptools>=77. Test: test_the_package_needs_a_setuptools_that_reads_its_licence.

Results:

  • The integration tests: 32 passed, 1 skipped offline, and 33 passed with --online against the real published record.
  • validate_integrations.py: 52 integrations, 0 failures.
  • Index and catalog --check: current.
  • validate_compatibility.py: 0 failures.
  • tests/: 75 passed.
  • The lint gate's ruff rules: clean.

…irect only within GitHub; report http.client errors; hold an attestation only of the record by a workflow of its repository
@darklordVirtual

Copy link
Copy Markdown
Author

@rajnisht7, a follow-up to my comment above. Checking each point again with both arms, I found that two things I wrote there were not quite true, and that three points were only partly fixed. All of it is fixed in 730123a, each with a test that fails on 58e0c1d (11 of the 15 new cases do; the other 4 are the control arms) and passes now.

Two corrections to my earlier comment

  • Point 5. I wrote that fetch "only opens https://raw.githubusercontent.com/ and https://api.github.com/". That held for the first URL only: a redirect from GitHub to another host was followed. Now a redirect is followed only to a URL that fetch would have opened itself. Test: test_a_redirect_to_another_host_is_not_followed (a local server that redirects to a second one; the second one receives nothing).
  • Point 6. I wrote that network, API and JSON failures "are now problem strings". http.client.IncompleteRead and BadStatusLine are not OSErrors and still escaped as exceptions, from the record and file fetches as well as the attestation lookup. They are reported now, and make exits 2 on them. Test: test_an_http_client_error_is_a_problem_not_a_crash, nine cases.

Points that were only partly fixed

  • Point 1. code_commit given as a JSON number of 40 digits was accepted through str(). It must now be a string. Test: test_a_code_commit_must_be_a_string.
  • Point 7. --attestations only asked whether an attestation existed. Now it holds only an attestation whose statement names the record's digest as its subject and a workflow of the resolver's repository as the one that made it. For agentic-datacenter/agentic-datacenter that workflow must be .github/workflows/bench-runner.yml. Otherwise it reports which workflows made the attestations it found. It reads the statement as the GitHub API returns it and does not verify the signature or the certificate. The README says so and gives the gh attestation verify ... --signer-workflow command that verifies both. Tests: test_an_attestation_must_be_of_the_record_by_a_workflow_of_its_repository and test_agentic_datacenter_s_own_results_must_be_attested_by_its_bench_workflow.

Results at 730123a

  • Integration tests: 47 passed and 1 skipped offline; 48 passed with --online. The online run includes the attestation of the real published record, made by bench-runner.yml.
  • validate_integrations.py: 52 integrations, 0 failures. validate_compatibility.py: 0 failures. Index and catalog --check: current.
  • tests/ (with PYTHONPATH=.): 75 passed.
  • The lint gate's ruff rules (E4,E7,E9,F, py39): clean.

Sorry for the extra round, and thank you again for a review that made the integration much better.

@rajnisht7 rajnisht7 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for the update, a few things still remain:

  • README artifact paths are still wrong-bench-runner.yml uploads the contents of build/bench-<run_id> directly (artifact name bench-<run_id>). After gh run download ... --dir result-artifact the files sit at the root of that directory, not under */bench/. The current gh attestation verify and cp commands therefore point at paths that don’t exist. kindly fix the documented paths (and preferably select the artifact by name).

  • Provenance validation is still minimal-record_problems() still accepts a record that only has benchmark_version: { "frozen": true } (no card_schema_version, no agents/contract_library/oracle/profile/scenario_library digests). The real published record and the upstream producer both carry the fuller shape. Worth tightening so we only accept what a real benchmark result actually writes, plus negative tests for the missing fields.

…ths the README uses; accept only the full record a benchmark result writes
@darklordVirtual

Copy link
Copy Markdown
Author

Thank you, @rajnisht7. You were right on both points. Both are fixed in 2a6284e, each with tests that fail on 730123a (12 of them do) and pass now.

README paths. bench-runner.yml uploads the files of the run as the artifact bench-<run-id>, at its top level. Downloaded without a name, they land in result-artifact/bench-<run-id>/; there was never a bench/ folder. I checked both on a real run. The README now downloads the artifact by name, so the paths it uses exist:

gh run download <run-id> --repo <owner>/<repo> --name bench-<run-id> --dir result-artifact
gh attestation verify result-artifact/provenance.json --repo <owner>/<repo>
mkdir -p results/<name> && cp result-artifact/* results/<name>/

Test: test_the_readme_downloads_the_artifact_by_name_to_the_paths_it_uses.

Provenance validation. record_problems() now accepts only the shape a benchmark result writes, as the published record and the producer do: benchmark_version must carry a SHA-256 (64 lower-case hex) of each of agents, contract_library, oracle, profile and scenario_library, besides frozen: true, and card_schema_version must be a whole number of at least 1. The synthetic example record now has that full shape. New negative cases in test_a_record_must_be_the_schema_a_benchmark_result_writes: {"frozen": true} alone, frozen with only oracle, each of the five parts missing in turn, digests that are not hex, and card_schema_version missing, given as "6", or 0.

Results at 2a6284e

  • Integration tests: 59 passed and 1 skipped offline; 60 passed with --online, which includes the real published record under the stricter check.
  • validate_integrations.py: 52 integrations, 0 failures. validate_compatibility.py: 0 failures. Index and catalog --check: current.
  • tests/ (with PYTHONPATH=.): 75 passed.
  • The lint gate's ruff rules (E4,E7,E9,F, py39): clean.

…rkflow's artifact to its bench/ folder, and says where bench-runner.yml's files are
@darklordVirtual

Copy link
Copy Markdown
Author

One more correction, in c9387f7. The README's download steps now follow the participant workflow, which is what that section is about: it uploads a reportable result as agentic-datacenter-stable-result-<run-id>, with the files in bench/, so the commands are

gh run download <run-id> --repo <owner>/<repo> --name agentic-datacenter-stable-result-<run-id> --dir result-artifact
gh attestation verify result-artifact/bench/provenance.json --repo <owner>/<repo>
mkdir -p results/<name> && cp result-artifact/bench/* results/<name>/

The bench-<run-id> layout I wrote earlier is that of Agentic-Datacenter's own bench-runner.yml; the README now says so in one sentence below the commands. The README test checks both. Integration tests: 59 passed and 1 skipped offline, 60 passed with --online; validate_integrations.py 0 failures; lint clean.

…oken; report the status of a lookup GitHub refuses

The conformance run on c9387f7 failed in one job of six, fixed (py3.11), where the
attestation lookup ended in "attestations unresolved: HTTPError". The same commit
passed all six jobs in the run on the fork, and passes locally with --online, so
the code path is not at fault: the lookup asks api.github.com without a token, and
GitHub limits such requests by address, which a runner shares with other jobs.

- fetch sends a token from GITHUB_TOKEN or GH_TOKEN to api.github.com only, as an
  unredirected header: never with a request for a raw file, never with a redirect.
- The workflow gives the test step the job's read-only token.
- A lookup GitHub refuses is reported with its status ("HTTPError 403"), so the
  next failure says whether it was a rate limit or something else.

The status of the failed request was not in the log, so the rate limit is the
likely cause, not a confirmed one.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019ysZVH8Cpx3dLacE7DqSac

Copy link
Copy Markdown
Contributor

Current-head follow-through: the 14 returned workflows for 252f3b5 are action_required, including benchmark conformance. Please authorize the runs through the maintainer workflow. Earlier-head results do not validate these revisions. The connected integration lacks the Actions write access needed to complete this follow-through.

Prepared with OpenAI Codex.

@darklordVirtual

Copy link
Copy Markdown
Author

Thanks for the follow-up. CI has now run on 252f3b5, and ADC benchmark conformance passed. The two remaining failures are a 404 for the OpenShell link in openshell-bundle-candidate.md and a missing certifi dependency in the weight-custody-manifest demo. Neither area is changed by this PR. Could you confirm whether these also fail on main and whether they block merging #438?

Copy link
Copy Markdown
Contributor

Follow-up on the two failing areas: #434 has now merged as 16556c1 and adds certifi to both the model-signing requirements and its CI install. The old-head missing-certifi result is superseded by that source fix; new-head validation is still needed after main is incorporated. The OpenShell URL remains a separate main-branch issue: #446 changes NVIDIA/OpenShell to ai-openshell/openshell and supplies the Lychee token; its current-head documentation-link workflow passes. These repair PRs touch areas outside #438's contribution. I cannot grant merge clearance for the maintainers or treat an old failed run as a new-head pass. Please refresh after the source repairs land and let the maintainer apply the repository's link/review gate.

Prepared with OpenAI Codex; source/workflow review, not a new reproduction of the original failures.

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.

3 participants