Skip to content

ci: automate typed-data checks and clarify v1 semantics - #12

Merged
HDauven merged 4 commits into
mainfrom
chore/typed-data-ci-spec
Sep 16, 2026
Merged

HDauven merged 4 commits into
mainfrom
chore/typed-data-ci-spec

Conversation

@HDauven

@HDauven HDauven commented Sep 16, 2026

Copy link
Copy Markdown
Member

Summary

Address #11 and #10 in two scoped commits, preserving their separate history. Reported by @ichbindas. Follow-up commits fix the test timeout and select the shared core runners.

  • The package's guarantees are not checked automatically #11: Add CI on self-hosted core runners for pushes to main and non-draft, same-repository pull requests. Fork/draft PRs are skipped; marking a same-repository draft ready triggers CI. Reuse the existing build, coverage, vector-regeneration guards, approval example and locked Rust BLS comparison. The workflow uses pinned actions, read-only permissions and no persisted checkout credentials.
  • Add a Node-native source/build corpus check to npm run ci: both encoders must match the frozen digests, intermediates and rejection codes through all three hash APIs, without Vitest transforms.
  • Small specification clarifications #10: Require the trusted origin to be at least as prominent as caller-supplied domain.name, recommend impersonation warnings without implying authentication, clarify non-zero expected contracts for contract-scoped applications, and explain why dynamic arrays require a new scheme identifier.

Fixes #11
Fixes #10

Validation

Current-head CI: run 35091509063 passes on 92c87bc, assigned to dusk-runner-10 with label core. All stages actually executed: 191 tests, 14 accept +22 reject source/build vectors, 16 BLS/SQLite example checks, and 5 locked native BLS vectors. The actual PR test-merge tree matches the candidate.

Local checks on the candidate:

  • Fresh locked install and npm run ci: 191 tests / 5 files, 14 accept + 22 reject vectors through source and compiled code, 16 real BLS/SQLite application checks.
  • npm run test:bls-native with stable Rust and an isolated target directory: all 5 frozen BLS vectors match the locked Rust emitter.
  • The new checker rejected four isolated mutations: compiled digest, compiled rejection code, compiled intermediate and source digest. Restored control passed.
  • actionlint, package dry run and committed-range whitespace checks passed.
  • The core-runner gate passes 17 local push/PR event cases; isolated removals of the fork guard, draft guard or ready event are rejected. This is a local condition check, not live fork/draft PR execution. Runner-group access and external-contributor approval settings were inspected, not changed. The workflow guard is not a sandbox; external workflow edits still require review before approval.

Scope

No runtime source, encoding, input-validity, signature/tag/DST, vector, dependency, lock, export or version changes. All 41 fixture files remain byte-identical; the package remains 0.1.0-rc.0 and v1 remains draft, not frozen.

Omitted/all-zero contracts remain valid digest inputs; contract scoping belongs to relying-application policy. The source/build check does not establish published JSR/bridge parity or independent encoder interoperability. Native checks cover BLS, not a separate typed-data encoder. The disclosure additions specify signer-UI obligations; this PR does not change or certify Wallet UI compliance. No release is included.

CI timeout follow-up (prior GitHub-hosted run)

The first hosted run hit the existing 15-second deadline after 16.8 seconds of covered full-budget struct hashing. 13f70b6 raises only the two existing custom test deadlines to 60 seconds (three cases), preserving every workload, assertion and encoder limit. Other test and job deadlines are unchanged.

Hosted CI run 35089918634 passes on 13f70b6: 191 tests, 14 accept + 22 reject source/build vectors, 16 real BLS/SQLite example checks, and 5 locked native BLS vectors. The formerly failing case took 15.9 seconds, still above its old deadline. The actual PR test-merge tree matches the candidate exactly.

Fresh local checks also pass. An isolated wrong-error-code mutation makes all three affected covered cases fail on their assertions, not a timeout; restoring the source passes all three. No runtime code or test assertions were changed.

Run the existing build, coverage, corpus-regeneration guards and approval
example on a hosted runner, followed by the locked native BLS comparison.

Add a Node-native corpus check against both the TypeScript encoder and the
actual compiled package entrypoint. Pin accepted digests/intermediates and
rejected error codes to the frozen vectors without a test-runner transform.
This checks the local build, not the published JSR artifacts.

Fixes #11
Reported-by: ichbindas <54631150+ichbindas@users.noreply.github.com>
Require the trusted origin to be at least as prominent as the caller's
application label, and recommend impersonation warnings without treating
labels or a missing warning as authentication.

Clarify that contract-scoped applications need their expected non-zero
contract, while omitted/all-zero values remain valid digest inputs.
Document dynamic arrays as requiring a new scheme identifier.

No encoding, signature, acceptance, vector or package-version changes.

Fixes #10
Reported-by: ichbindas <54631150+ichbindas@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved issues were identified.

Pull request overview

Automates CI validation and clarifies typed-data v1 semantics without changing runtime encoding or fixtures.

Changes:

  • Adds source/build corpus parity checks.
  • Adds pinned GitHub Actions CI with native BLS validation.
  • Documents origin prominence, contract scoping, and dynamic-array semantics.
File summaries
File Summary
scripts/check-built-vectors.mjs Compares source and compiled corpus behavior.
README.md Documents the validation workflow.
package.json Adds the corpus check to CI.
docs/typed-data-v1.md Clarifies v1 semantics and signer disclosures.
CHANGELOG.md Records the unreleased changes.
.github/workflows/ci.yml Defines automated CI checks.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

The first hosted CI run took 16.8 seconds for the cloned-struct budget
case, exceeding its 15-second deadline. The neighboring empty-struct
boundary case took 13.6 seconds and had the same narrow deadline.

Raise only those two existing custom test deadlines to 60 seconds.
Keep every input, traversal budget, assertion and production byte intact;
these tests enforce structural limits, not a wall-clock performance SLA.

Refs #11
Match Connect's self-hosted runner policy: run main pushes and non-draft,
same-repository pull requests on core. Include ready_for_review so a draft
becoming ready starts the checks without requiring another push.

Document that fork and draft PRs are skipped, and that the workflow guard
is not a sandbox or a substitute for reviewing external workflow changes.
Keep every existing check, action pin, read-only permission and timeout.

Refs #11
@HDauven
HDauven merged commit dcd26c6 into main Sep 16, 2026
1 check passed
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.

The package's guarantees are not checked automatically Small specification clarifications

2 participants