Run DIF did:webvh compliance test vectors; report divergences (#134) - #140
Merged
Conversation
…ces (#134) Adds tools/NetDid.Tools.WebVhVectors, which replays the DIF didwebvh-test-suite's committed vectors through DidWebVhMethod offline via a file-backed IWebVhHttpClient, and writes tasks/webvh-vector-divergence.md. Every did:webvh test in this repo is self-generated — NetDid writes a log, NetDid reads it back — a shape that passes even when the wire format is wrong for everyone else. That is how #95 survived a green suite. This replays logs authored by six independent implementations instead. Reconnaissance only: no src/ changes, no test-count change, no version bump. The suite is cloned on demand to a gitignored path rather than vendored, so its own CLAUDE.md and .claude/settings.json cannot be picked up as repo instructions, and its contents are treated as untrusted data. IsPackable=false, verified absent from dotnet pack output. The report carries no generation timestamp, so re-running produces a byte-identical file. 88 happy-path replays (13 scenarios x 6 impls) and 21 negative vectors. Confirmed positive: 63 foreign logs accepted with zero rejections attributable to a hash or signature mismatch. Resolution recomputes the SCID and every entry hash and verifies eddsa-jcs-2022 proofs, so this is the first independent evidence our wire format interoperates (settles #35, confirms the #95 fix). All 21 negative vectors rejected, including traversal and percent-encoded IP-literal SSRF probes. Filed: #135 (did-witness.json uses `proofs`, spec and all six impls use `proof` — no witnessed DID interoperates either way; the #95 pattern repeating), #136 (implicit #files/#whois services missing), #137 (metadata omits scid/versionNumber), #138 (updated omitted at v1), #139 (malformed identifiers reported as notFound). Evidence added to #35, #123, #131. Notably #131 is NOT covered by the suite: the committed negative-versiontime-future log is also non-monotonic, so our existing monotonicity rule rejects it before any future-skew bound applies. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Reconnaissance pass on #134: replay the DIF
didwebvh-test-suitecommitted vectors through our resolver and report divergences. Building the Docker harness that would register NetDid asimplementations/dotnet/is deliberately deferred until these findings are triaged.Suite pinned at
f792ce4(2026-07-30).Why this was worth doing
Every did:webvh test in this repo is self-generated — NetDid writes a log, NetDid reads it back. That shape passes even when the wire format is wrong for everyone else, which is exactly how #95 survived a fully green suite. This replays logs authored by six independent implementations instead.
It immediately found the same class of bug again (#135).
What's in the PR
tools/NetDid.Tools.WebVhVectors— replays committed vectors offline throughDidWebVhMethodvia a file-backedIWebVhHttpClient, and writestasks/webvh-vector-divergence.md.No
src/changes, no test-count change, no version bump. Findings are filed as issues; fixes are separate work.CLAUDE.mdand.claude/settings.jsoncannot be picked up as this repo's agent instructions, and its contents are treated as untrusted data (read as bytes, fed to the resolver, never executed).IsPackable=false, verified absent fromdotnet packoutput —publish.ymlpacks the whole solution, so this matters.w3c-conformance-report.md.PackageReferences — thescript.yamlscanner is hand-rolled to avoid adding a YAML dependency to solution-wide CPM, and is guarded by a self-check that cross-references every negative scenario's parsedexpectErroragainst the committed result, throwing rather than letting a parser bug masquerade as a conformance finding.Results
88 happy-path replays (13 scenarios × 6 implementations, including historical versions) and 21 negative vectors.
Confirmed positive — our wire format interoperates
63 foreign logs accepted, with zero rejections attributable to a hash or signature mismatch. Resolution recomputes the SCID from the genesis preimage and every entry hash in the chain (
LogChainValidator.cs:136-145,:194) and verifieseddsa-jcs-2022proofs — so accepting a log authored byts/rust/java/java-eecc/dartis direct evidence our encoding matches theirs. First independent confirmation of the #95 fix; settles #35.All 21 negative vectors rejected, including path traversal, percent-encoded traversal, and percent-encoded IP-literal SSRF probes against
127.0.0.1and the169.254.169.254cloud metadata endpoint.Issues filed
did-witness.jsonread/written withproofs; spec and all 6 implementations useproof#files/#whoisservices neither materialized nor resolvabledidDocumentMetadataomitsscid(unanimous) andversionNumberdidDocumentMetadata.updatedomitted at version 1notFoundinstead ofinvalidDid#135 is the #95 pattern repeating.
WitnessValidator.cs:196writes"proofs"and:272reads it, so NetDid witness files round-trip against themselves while no witnessed DID interoperates in either direction. A blanketcatch { return null; }at:263-266swallows theKeyNotFoundException, which is why it stayed hidden. Two negative witness vectors currently pass vacuously — parsing fails before any witness security logic runs.Evidence added to existing issues
invalidDidLogis one bucket for every hash, proof, parameter and timestamp failure.negative-versiontime-futurelog's tail is also non-monotonic, so our existing "strictly later than version N-1" rule rejects it before any future-skew bound applies. It passes for the wrong reason; did:webvh: resolver does not enforce the spec's future-skew bound on versionTime (MUST fail beyond tolerance) #131 stays open and unverified.Not our defect
All 15
pythonlogs are rejected because their verification methods omitcontroller. Our strictness is deliberate (#121) and backed by W3C DID Core §5.3.1, and 5 of 6 implementations emit it —didwebvh-pyis the outlier. Worth reporting upstream; not filed, as that's an outward-facing action on a third-party repo.Verification
dotnet build netdid.sln -c Release→ 0 warnings, 0 errorsdotnet test netdid.sln -c Release→ 1709 passed, 0 failed, 7 skipped (Ethr integration, Docker-gated); counts unchanged frommaindotnet pack→ 6 packages, tool absentw3c-conformance-report.mdunchangedReproduce:
Closes #134.
🤖 Generated with Claude Code