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-hash-spec-conformance
- **Change ID**: crypto-hash-spec-conformance
- **Package**: `@suaveplan/crypto-hash`
- **Status**: PROPOSED
- **Date**: 2026-04-26
## Summary
Add `**Verified by:**` lines to every requirement in `openspec/specs/crypto-hash/spec.md` and pin previously-unverified structural scenarios (package identity, per-primitive replaceability layout, generated `*.select.ts` banner) with `tests/spec-conformance.test.ts`. No public-API or behavioural changes.
## Current state
`@suaveplan/crypto-hash` ships SHA-256/384/512, HMAC, HKDF, PBKDF2, Argon2id with the per-primitive replaceability layout (`src/primitives/<id>/impl/<id>.{noble,native}.ts` plus a generated `<id>.select.ts`). `native-stubs.test.ts`, `tree-shake.test.ts`, and the per-feature unit tests cover behaviour, but the structural scenarios — package name, every primitive having both impl files, generated banner on selectors — were not pinned at runtime, and no requirement carried a `**Verified by:**` annotation.
## What changes
1. Annotate every requirement in the folded `openspec/specs/crypto-hash/spec.md` with a `**Verified by:**` line citing concrete tests.
2. Add `tests/spec-conformance.test.ts` covering the package-identity and per-primitive layout scenarios.
3. `bun scripts/openspec-conformance.ts @suaveplan/crypto-hash` exits 0.
## Impact
- Public API unchanged.
- One new test file (~85 lines).
- `openspec/specs/crypto-hash/spec.md` gains 5 `**Verified by:**` blocks.
- Coverage stays 100/100/100/100.

View File

@@ -0,0 +1,20 @@
# Capability Spec Delta: crypto-hash (spec-conformance)
**Package**: `@suaveplan/crypto-hash`
**Status**: PROPOSED
This delta annotates each existing requirement in `openspec/specs/crypto-hash/spec.md` with a `**Verified by:**` line. No requirement semantics change.
## MODIFIED Requirements
| Requirement | Verified by |
|---|---|
| Package identity | `tests/spec-conformance.test.ts::"package.json name is @suaveplan/crypto-hash"` |
| Per-primitive replaceability layout | `tests/spec-conformance.test.ts` (every-primitive `noble.ts`+`native.ts` and `*.select.ts` banner) AND `tests/native-stubs.test.ts` |
| Shared test vectors and differential equivalence | `src/hash/sha2.test.ts` AND `src/mac/hmac.test.ts` AND `src/kdf/hkdf.test.ts` AND `src/kdf/pbkdf2.test.ts` AND `src/kdf/argon2id.test.ts` AND `tests/native-stubs.test.ts` |
| Public API stability | `tests/tree-shake.test.ts` |
| CI gate for flipping default to native | `tests/native-stubs.test.ts` AND `tests/spec-conformance.test.ts` (banner check) |
## Newly added tests in this change
- `tests/spec-conformance.test.ts` — pins package-name identity, per-primitive layout (`noble.ts` + `native.ts`), and `*.select.ts` GENERATED banner.

View File

@@ -0,0 +1,7 @@
# Tasks — crypto-hash-spec-conformance
- [x] Add `**Verified by:**` line to every `### Requirement:` block in `openspec/specs/crypto-hash/spec.md`.
- [x] Add `tests/spec-conformance.test.ts` pinning package-identity and per-primitive replaceability layout scenarios.
- [x] Confirm `bun scripts/openspec-conformance.ts @suaveplan/crypto-hash` exits 0.
- [x] Confirm `bunx turbo lint typecheck test --filter=@suaveplan/crypto-hash` is green.
- [x] Confirm `bunx turbo test:coverage --filter=@suaveplan/crypto-hash` reports 100/100/100/100.