Initial Commit

This commit is contained in:
2026-05-27 23:29:53 +01:00
commit fbc70f96e6
10000 changed files with 1102152 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
# OpenSpec Change: crypto-curve-spec-conformance
- **Change ID**: crypto-curve-spec-conformance
- **Package**: `@suaveplan/crypto-curve`
- **Status**: PROPOSED
- **Date**: 2026-04-26
## Summary
Add `**Verified by:**` lines to every requirement in `openspec/specs/crypto-curve/spec.md` and pin previously-unverified structural scenarios (per-primitive replaceability, GENERATED-banner check, Phase-0.5 consistency gate, dangerous-tier flip-gate runtime reflection, native-stub state) with `tests/spec-conformance.test.ts`. No public-API or behavioural changes.
## Current state
`@suaveplan/crypto-curve` ships secp256k1, ed25519, x25519, p256 with the per-primitive replaceability layout. Each primitive has a `noble.ts` (active) and a `native.ts` stub that throws `PrimitiveNotImplemented`. Per-feature unit tests cover sign/verify, ECDH, RFC vectors, malformed-input rejection, and `verify` boolean contract. The structural scenarios (impl-file presence, GENERATED banner, vendored noble Phase-0.5 gate, dangerous-tier flip gate, constant-time stub state) were not pinned, and no requirement carried a `**Verified by:**` annotation.
## What changes
1. Annotate every requirement in the folded `openspec/specs/crypto-curve/spec.md` with a `**Verified by:**` line.
2. Add `tests/spec-conformance.test.ts` covering layout, banner, Phase-0.5 consistency, native-stub state, and the dangerous-tier runtime reflection.
3. `bun scripts/openspec-conformance.ts @suaveplan/crypto-curve` exits 0.
## Impact
- Public API unchanged.
- One new test file (~120 lines).
- `openspec/specs/crypto-curve/spec.md` gains 5 `**Verified by:**` blocks.
- Coverage stays 100/100/100/100.

View File

@@ -0,0 +1,20 @@
# Capability Spec Delta: crypto-curve (spec-conformance)
**Package**: `@suaveplan/crypto-curve`
**Status**: PROPOSED
This delta annotates each existing requirement in `openspec/specs/crypto-curve/spec.md` with a `**Verified by:**` line. No requirement semantics change.
## MODIFIED Requirements
| Requirement | Verified by |
|---|---|
| Universal curve primitive surface | `tests/spec-conformance.test.ts` AND `src/primitives/{secp256k1,ed25519,x25519,p256}/*.test.ts` |
| Per-primitive replaceability | `tests/spec-conformance.test.ts` (every-curve `noble.ts`+`native.ts`+banner) AND per-primitive `every operation throws PrimitiveNotImplemented` |
| Vendored noble source (Phase 0.5) | `tests/spec-conformance.test.ts::"is a Phase-0.5 forward gate; current state is pre-0.5 (noble dep + no vendored/)"` |
| Dangerous-tier CI gate | `tests/spec-conformance.test.ts::"every native is a stub today, so no curve has been flipped without an audit"` |
| Constant-time curve math | `tests/spec-conformance.test.ts` (every native still a `PrimitiveNotImplemented` stub) |
## Newly added tests in this change
- `tests/spec-conformance.test.ts` — pins layout, GENERATED banner, Phase-0.5 consistency, dangerous-tier runtime reflection, and constant-time-stub state.

View File

@@ -0,0 +1,7 @@
# Tasks — crypto-curve-spec-conformance
- [x] Add `**Verified by:**` line to every `### Requirement:` block in `openspec/specs/crypto-curve/spec.md`.
- [x] Add `tests/spec-conformance.test.ts` pinning replaceability layout, banner, Phase-0.5 consistency, native-stub state, and dangerous-tier flip gate runtime reflection.
- [x] Confirm `bun scripts/openspec-conformance.ts @suaveplan/crypto-curve` exits 0.
- [x] Confirm `bunx turbo lint typecheck test --filter=@suaveplan/crypto-curve` is green.
- [x] Confirm `bunx turbo test:coverage --filter=@suaveplan/crypto-curve` reports 100/100/100/100.