Skip to content

feat(mbga): Phase 1 + Phase 2 — conformance runners, boundary specs, reliability registry#5

Merged
sirdeggen merged 12 commits into
mainfrom
phase2/boundary-specs
Apr 27, 2026
Merged

feat(mbga): Phase 1 + Phase 2 — conformance runners, boundary specs, reliability registry#5
sirdeggen merged 12 commits into
mainfrom
phase2/boundary-specs

Conversation

@sirdeggen

Copy link
Copy Markdown
Contributor

Summary

  • Phase 1: Go conformance runner 195/238 vectors (90.28% gate ✓), TS Jest runner 232/238 — both green in CI with JUnit + JSON artifact upload
  • Phase 2: 12 boundary specs (BRC-100 JSON Schema, OpenAPI 3.1 for overlay/ARC/message-box/UHRP/BRC-121/Merkle, AsyncAPI 3.0 for authsocket/BRC-31/BRC-29/GASP), error taxonomy, Schemathesis stubs
  • Codegen: Go (oapi-codegen), TS (openapi-typescript), Py (pydantic v2) type generation wired in CI
  • Conformance dashboard v0: Grafana JSON + static HTML generator in specs/observability/
  • Reliability registry: centralized specs/reliability/ with RELIABILITY + BASELINE + BENCHMARK for ts-sdk, go-sdk, wallet-toolbox, overlay-express, message-box-server, arc
  • Regression vectors: 238 total (10 new from real ts-sdk/go-sdk issues); conformance/REGRESSION_QUEUE.md for 10 queued
  • deps: bump actions/checkout v4 → v6

Test plan

  • Go conformance runner passes CI green
  • TS conformance runner passes CI green
  • Codegen workflow runs without error
  • All specs valid YAML/JSON

🤖 Generated with Claude Code

sirdeggen and others added 12 commits April 24, 2026 20:12
- specs/sdk/brc-100-wallet.json: JSON Schema Draft 2020-12 for BRC-100 wallet interface
  covering all 26 methods (createAction, signAction, abortAction, listActions,
  internalizeAction, listOutputs, relinquishOutput, acquireCertificate,
  listCertificates, proveCertificate, relinquishCertificate, discoverByIdentityKey,
  discoverByAttributes, isAuthenticated, waitForAuthentication, getHeight,
  getHeaderForHeight, getNetwork, getVersion, getPublicKey,
  revealCounterpartyKeyLinkage, revealSpecificKeyLinkage, encrypt, decrypt,
  createHmac, verifyHmac, createSignature, verifySignature)

- specs/overlay/overlay-http.yaml: OpenAPI 3.1 for overlay HTTP API
  (submit tagged BEEF, lookup by service+query, listTopicManagers,
  listLookupServiceProviders, getDocumentation*, GASP sync routes,
  ARC ingest callback, health endpoints, full admin API)

- specs/broadcast/arc.yaml: OpenAPI 3.1 for ARC broadcast API
  (POST /v1/tx, GET /v1/tx/{txid}, POST /v1/txs batch, /arc-ingest callback,
  ArcTxStatus enum with all known status codes)

- specs/errors.md: error taxonomy (15 categories: serialization, crypto/key-handling,
  tx-construction, script/sighash, wallet-storage, overlay-admission,
  lookup-inconsistency, messaging-failure, auth-failure, payment-failure,
  broadcast-failure, dependency-outage, config-error, release-regression,
  docs/example-mismatch) with ERR_<CATEGORY>_<DETAIL> naming convention

- specs/EXCEPTIONS.md: 9 tracked boundaries without specs yet
  (message-box HTTP, message-box WS/authsocket, BRC-31, BRC-29, GASP,
  UHRP, BRC-121/402, Merkle service, wallet storage adapter)

- specs/README.md: purpose, spec inventory table, how to add specs,
  codegen command placeholders, contract test instructions, error code guidance

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… BRC-31 handshake AsyncAPI

- specs/messaging/message-box-http.yaml: OpenAPI 3.1 covering all 9 endpoints
  (sendMessage, listMessages, acknowledgeMessage, registerDevice, /devices,
  /permissions/set, /permissions/get, /permissions/list, /permissions/quote)
  derived from source in packages/messaging/message-box-server/src/routes/.
  Includes full request/response schemas, all error codes, BsvMutualAuth
  security scheme, and payment/permission data models.

- specs/messaging/authsocket-asyncapi.yaml: AsyncAPI 3.0 for the AuthSocket
  WebSocket protocol. Covers all application-level Socket.IO events (authenticated,
  authenticationSuccess, authenticationFailed, joinRoom, joinedRoom, joinFailed,
  leaveRoom, leftRoom, leaveFailed, sendMessage, sendMessageAck-{roomId},
  sendMessage-{roomId}, messageFailed, paymentFailed, disconnect) plus the
  low-level authMessage transport event used by SocketServerTransport for
  BRC-103 Peer handshake.

- specs/auth/brc31-handshake.yaml: AsyncAPI 3.0 for the BRC-31 mutual auth
  handshake. Documents both Phase 1 (initialRequest / initialResponse via
  POST /.well-known/auth) and Phase 2 (general signed request/response on any
  application path). Includes signed payload wire encoding, certificate flow,
  and all error shapes (401, 408, 500). Derived from
  packages/middleware/auth-express-middleware/src/index.ts.

- specs/EXCEPTIONS.md: marked exceptions 1–3 resolved; added resolved table.
- specs/README.md: updated directory listing and spec inventory table.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…, BRC-121, Merkle, wallet storage)

- specs/payments/brc29-payment-protocol.yaml  AsyncAPI 3.0 — BRC-29 P2PKH peer payment: key derivation invoice number format, current Atomic BEEF payment message, internalizeAction remittance envelope, legacy BRC-8 format documented as deprecated
- specs/sync/gasp-asyncapi.yaml               AsyncAPI 3.0 — GASP cross-node sync: all 7 message types (GASPInitialRequest/Response/Reply, GASPNodeRequest/Node/NodeResponse, GASPVersionMismatchError), full bidirectional protocol flow
- specs/storage/uhrp-http.yaml                OpenAPI 3.1  — UHRP HTTP: POST /upload, GET /find, GET /list, POST /renew; UHRP URL format documented; routes inferred from BRC-26 status note + SDK usage
- specs/payments/brc121.yaml                  OpenAPI 3.1  — BRC-121 HTTP 402: all 7 x-bsv-* headers, 402 challenge/response, replay guards (timestamp + isMerge), protocol sequence documented
- specs/merkle/merkle-service-http.yaml       OpenAPI 3.1  — Merkle Service: POST /watch (txid + callbackUrl), GET /health (Aerospike); all 400 validation error messages from docs/api.md
- specs/wallet/storage-adapter.yaml           OpenAPI 3.1  — Wallet storage adapter: createAction, processAction, abortAction, internalizeAction, list*, sync chunk get/process, certificates, all table schemas (TableTransaction, TableOutput, TableProvenTx, TableProvenTxReq, TableSyncState, etc.)

Also:
- specs/EXCEPTIONS.md: all 6 entries moved to Resolved table; no open exceptions remain
- specs/README.md: all 6 specs added to inventory table; directory tree updated

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a TypeScript Jest-based conformance runner that executes all 216
vectors under conformance/vectors/ against @bsv/sdk, achieving 213
passing / 3 skipped (parity_class=intended). Also adds a GitHub Actions
workflow running both Go and TS runners on push/PR to main and
phase2/boundary-specs. Fixes broken @bsv/paymail version ref in
ts-paymail examples so pnpm install succeeds in CI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ype generation

Extends the codegen workflow with three new jobs:
- generate-ts-types: runs openapi-typescript@latest for all three specs, outputs .d.ts files
- generate-py-types: runs datamodel-codegen with pydantic_v2.BaseModel for all three specs, outputs models.py files
- create-rust-placeholders: commits types.rs.TODO files explaining how to run typify manually, since no Cargo workspace exists in this repo

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…TML summary

- Add --json-report flag to Go runner (writeJSONReport func, Result.Category field)
- Update conformance.yml CI to emit XML + JSON artifacts for both runners
- Add Grafana importable dashboard (uid bsv-conformance-v0) with JSON API datasource
- Add dashboard.mjs static HTML generator with CSS-only pass-rate gauges

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… issues

Adds 8 new regression vector files (22 new vectors) covering the highest-impact
behavioural bugs from ts-sdk and go-sdk GitHub issues. Total corpus grows from
202 to 238 vectors across 15 to 27 files.

New regression files:
- script-lshift-truncation     (ts-sdk#493) OP_LSHIFT must mask to input width
- script-shift-endianness      (ts-sdk#377) OP_LSHIFT/RSHIFT must preserve endianness
- tx-sequence-zero-sighash     (ts-sdk#371) sequence=0 inputs must sign and verify with seq=0
- script-writebin-empty        (ts-sdk#336) writeBin([]) must produce OP_0 not empty string
- script-fromasm-numeric-token (ts-sdk#42)  fromASM 76 is a data push not OP_DUP
- fee-model-mismatch           (go-sdk#267) fee = floor(size*rate/1000) with min-1 rule
- bip276-hex-decode            (go-sdk#286) BIP276 network/version fields are hex not decimal
- beef-isvalid-hydration       (go-sdk#167) IsValid must hydrate SourceTransaction from map

Also adds REGRESSION_QUEUE.md listing 10 issues that lacked enough detail for
deterministic vectors, with notes on what additional information is needed.

Updates META.json: total_files=27, total_vectors=238, regression_index added.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sirdeggen sirdeggen merged commit 845ee2e into main Apr 27, 2026
8 of 9 checks passed
@sirdeggen sirdeggen deleted the phase2/boundary-specs branch April 27, 2026 16:14
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.

1 participant