Skip to content

feat(attest): pluggable attester seam with a deterministic sample implementation - #9220

Merged
JSONbored merged 2 commits into
mainfrom
feat/attester-seam
Jul 27, 2026
Merged

feat(attest): pluggable attester seam with a deterministic sample implementation#9220
JSONbored merged 2 commits into
mainfrom
feat/attester-seam

Conversation

@JSONbored

@JSONbored JSONbored commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

The first slice of #9211: the pluggable boundary between collecting an attestation report and assembling the evidence envelope — so the attested-evaluation epic (#8534) can be built and CI-tested before any SEV-SNP-capable hardware exists.

Confidential Containers ships a no-TEE sample-attester path for exactly this reason. Mirroring it here means real hardware arrives as a config change (swap the Attester implementation) rather than as new code on the critical path — which is what turns the current blocker into "hardware-blocked, not code-blocked".

What lands:

  • Attester — the swappable interface (kind + async collect), async because every real implementation performs IO.
  • createSampleAttester() — deterministic and hardware-free: every field is derived from the request by SHA-256, so the same request yields byte-identical output and an attested-run E2E can assert exact bytes rather than "something was produced".
  • assembleAttestationEnvelope() — computes reportData from the binding itself rather than trusting a caller- or attester-supplied value, so the envelope's commitment and the bytes the attester signed over cannot drift apart. Returns { ok: false } (never throws) when collection fails or the result doesn't validate, so a runner can record attestation_failed instead of crashing a completed evaluation.
  • SAMPLE_ATTESTATION_MAGIC / isSampleAttestationReport() — a sample-attested envelope stays identifiable as a dev artifact.

Safety posture (the point of the magic prefix): a sample envelope must never be presentable as real evidence. Two independent things stop that — the report carries the magic as its leading plaintext bytes so the verifier (#9212) can name it precisely, and a sample report has no AMD signature chain so cryptographic verification fails regardless. The magic is the honest error message; the missing chain is the actual guarantee.

Pure and infrastructure-free, matching the module family's contract: no IO, no randomness, no wall-clock reads. A real SEV-SNP attester talks to /dev/sev-guest or a CoCo attestation agent and therefore lives in the IO layer that supplies it — that's the follow-up slice, along with the runner and envelope persistence.

Part of #9211 · epic #8534

Retargeted to main now that #9219 has merged.

Validation

  • npx vitest run test/unit/attester-engine.test.ts — 13/13 pass
  • Coverage on the new module: 100% statements (17/17), 100% branches (11/11) — every arm exercised: the teeTechnology ?? "sev-snp" fallback both ways, all four isSampleAttestationReport rejection paths (non-string, empty, malformed, valid-but-not-sample), invalid-collection, and both the Error and non-Error throw arms.
  • npm run test --workspace @loopover/engine — 737/737 (includes the 3 new barrel tests)

Safety

  • No secrets, wallets, hotkeys, trust scores, or reward values.
  • No new dependencies; node:crypto only, matching the sibling modules.
  • No public-surface or behavior change — additive module plus one barrel export line.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
loopover-ui 70180d9 Commit Preview URL

Branch Preview URL
Jul 27 2026, 07:24 AM

@JSONbored
JSONbored changed the base branch from fix/duplicate-hold-warning-dedup to main July 27, 2026 07:21
@JSONbored JSONbored self-assigned this Jul 27, 2026
@JSONbored
JSONbored force-pushed the feat/attester-seam branch from c401ae5 to 70180d9 Compare July 27, 2026 07:22
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored
JSONbored merged commit 980c653 into main Jul 27, 2026
3 of 4 checks passed
@JSONbored
JSONbored deleted the feat/attester-seam branch July 27, 2026 07:32
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 27, 2026
@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

❌ 4 Tests Failed:

Tests completed Failed Passed Skipped
22661 4 22657 21
View the top 3 failed test(s) by shortest run time
test/integration/orb-relay.test.ts > POST /v1/orb/relay/pull > REGRESSION (#4995): a DB error inside validateOrbRelayEnrollment's own lookup ALSO returns a clean 503 broker_error, not a framework 500 (the earlier of the two DB-touching calls in this handler)
Stack Traces | 0.00867s run time
AssertionError: expected 500 to be 503 // Object.is equality

- Expected
+ Received

- 503
+ 500

 ❯ test/integration/orb-relay.test.ts:1160:24
test/integration/orb-onboarding.test.ts > Central Orb installation registry routes (/v1/internal/orb/installations) > tolerates a list query that omits results (rows.results ?? [])
Stack Traces | 0.0337s run time
SyntaxError: Unexpected token 'I', "Internal S"... is not valid JSON
 ❯ test/integration/orb-onboarding.test.ts:57:14
test/integration/orb-ingest.test.ts > Orb instance registry routes (/v1/internal/orb/instances) > tolerates a list query that omits results (rows.results ?? [])
Stack Traces | 0.0391s run time
SyntaxError: Unexpected token 'I', "Internal S"... is not valid JSON
 ❯ test/integration/orb-ingest.test.ts:427:14
test/integration/orb-relay.test.ts > POST /v1/orb/relay/register > REGRESSION (#4995): a DB error inside validateOrbRelayEnrollment's own lookup ALSO returns a clean 503 broker_error, not a framework 500 (the earlier of the two DB-touching calls in this handler)
Stack Traces | 0.091s run time
AssertionError: expected 500 to be 503 // Object.is equality

- Expected
+ Received

- 503
+ 500

 ❯ test/integration/orb-relay.test.ts:155:24

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

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

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

orb(attest): attested-run harness with pluggable attester — sample now, SNP by config

1 participant