Skip to content

feat(verifier): §10 verify + schema + did + fixtures (VOKF-3/4/5/6 / S3) - #3

Merged
aggre merged 1 commit into
mainfrom
s3/verifier
Jun 15, 2026
Merged

feat(verifier): §10 verify + schema + did + fixtures (VOKF-3/4/5/6 / S3)#3
aggre merged 1 commit into
mainfrom
s3/verifier

Conversation

@yumemayu

Copy link
Copy Markdown
Member

S3 — @verifiable-okf/verifier + conformance + publish-prep

Completes M0 (the launch-gating MVP): the full sign → verify loop with conformance fixtures.

Implements

  • §10 algorithm (verify.ts): trust status + reason codes, in spec order — schema → content_hash → resolve issuer → signature → validity (≤60s skew) → policy attestations. unverified and unknown extra keys always pass through (base-OKF compatible).
  • §11 schema (schema.ts): Ajv 2020 (draft 2020-12) → schema_invalid. Schema embedded in the package with a drift test vs schemas/provenance.schema.json.
  • DID (did.ts): did:key offline + did:web over HTTPS (TLS required, injectable fetch) → Ed25519 key, else issuer_unresolved.
  • vokf-verify CLI → machine-readable JSON, exit 0/1/2.
  • Fixtures: fixtures/tampered/{body-modified,bad-signature,schema-invalid,unresolvable-issuer}.md; signed/with-attestation.md for unsupported_scheme / attestation_failed.
  • README: real < 5-min sign → verify quickstart.

DoD(VOKF-3/4/5/6)

  • fixtures/signed全件 verified
  • fixtures/tampered の各ケース → 期待 reason code 一致(integrity_mismatch / signature_invalid / schema_invalid / issuer_unresolved / expired / not_yet_valid / unsupported_scheme / attestation_failed)
  • unverified(provenance 不在)・不明キーは通す
  • 出力は機械可読 JSON
  • §11 スキーマ配線・schema_invalid パステスト・drift ガード
  • did:web(TLS)/did:key 解決、解決失敗で issuer_unresolved
  • クリーンチェックアウトから build/test green(57 tests)。CLI quickstart が golden を再現し改ざんを検出

M0 完了 → 公開

S1〜S3 で M0 完了です。public 化は mayumi さんの明示 GO で実施します(現状 private)。次は M1(attestation 1本 e2e / visualizer / 実バンドル例)。

🤖 Generated with Claude Code

…/4/5/6)

`@verifiable-okf/verifier` implements the SPEC §10 algorithm and completes
the M0 sign→verify loop.

- verify.ts: status {unverified|verified|failed} + reason codes, in §10
  order (schema → content_hash → resolve issuer → signature → validity
  → policy attestations). unverified and unknown keys always pass through.
- schema.ts: §11 JSON Schema validation via Ajv 2020 (draft 2020-12) →
  schema_invalid; schema embedded with a drift test vs the repo file.
- did.ts: did:key (offline) + did:web (HTTPS, TLS required, injectable
  fetch) → Ed25519 public key, else issuer_unresolved.
- cli.ts: `vokf-verify` → machine-readable JSON; exit 0/1/2.
- fixtures/tampered/{body-modified,bad-signature,schema-invalid,
  unresolvable-issuer}.md each map to the exact reason code; signed/
  with-attestation.md drives unsupported_scheme / attestation_failed
  via policy. expired / not_yet_valid covered with a fixed `now`.
- README: real < 5-minute sign → verify quickstart.

Tests (22): signed → verified; each tampered → exact reason; validity
window + 60s skew; attestation policy paths; did:key round-trip; did:web
via stub fetch; schema drift + accept/reject. Full suite green
(canon 28 + signer 7 + verifier 22 = 57). Clean build orders all three
packages; CLI quickstart reproduces the golden and flags tampering.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@aggre
aggre merged commit f381bda into main Jun 15, 2026
1 check passed
@aggre
aggre deleted the s3/verifier branch June 15, 2026 22:33
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