Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,15 @@ jobs:
- name: Lint
run: npm run lint

- name: Run tests
- name: Run routine tests
run: npm test

- name: Run slow security and performance tests
run: npm run test:slow

- name: Run test coverage
- name: Run complete test coverage
if: matrix.node-version == '20.x'
run: npm run test:coverage
run: npm run test:coverage:all

- name: Build library
run: npm run build
Expand Down Expand Up @@ -153,9 +156,12 @@ jobs:
- name: Lint
run: bun run lint

- name: Run Bun tests
- name: Run Bun routine tests
run: bun run test:bun

- name: Run Bun slow security and performance tests
run: bun run test:bun:slow

- name: Build library
run: bun run build

Expand Down
7 changes: 4 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
- `npm ci` — install the canonical dependency graph from `package-lock.json`.
- `npm run package-manager:verify` — verify npm/Bun metadata, lockfiles, and CI policy.
- `npm run build` — clean and compile TypeScript to `dist/`.
- `npm test` | `npm run test:watch` | `npm run test:coverage` — run Jest, watch mode, or coverage (reports in `coverage/`).
- `npm test` | `npm run test:watch` | `npm run test:coverage` — run the routine Jest lane, routine watch mode, or routine coverage.
- `npm run test:slow` | `npm run test:all` | `npm run test:coverage:all` — run the named security/performance lane or the complete test/coverage inventory.
- `npm run lint` — ESLint (`@typescript-eslint`) over `.ts` sources.
- `npm run format` — Prettier 3 for `src/`, `tests/`, `examples/`.
- `npm run example` (or `example:*`) | `npm start` — run examples; default is the NIP‑07 example.
Expand All @@ -31,14 +32,14 @@

- Framework: Jest with `ts-jest`, Node environment.
- Naming: `*.test.ts` or `*.spec.ts`; mirror the `src/` layout.
- Coverage: keep or improve; use `npm run test:coverage`.
- Coverage: keep or improve; use `npm run test:coverage:all` before review so slow-lane files remain covered.
- Use test vectors and the ephemeral relay; never include real credentials.

## Commit & Pull Request Guidelines

- Commits: Conventional Commits (`feat:`, `fix:`, `refactor:`, `docs:`, `test:`, `chore:`), imperative and concise.
- Branches: create from `staging` using `feature/<name>` or `fix/<name>`; PRs target `staging`.
- PR checklist: clear what/why, linked issues (e.g., `#123`), tests and examples updated if behavior changes. Run `npm run lint && npm test && npm run build` before opening.
- PR checklist: clear what/why, linked issues (e.g., `#123`), tests and examples updated if behavior changes. Run `npm run lint && npm run test:all && npm run build` before opening.

## Security & Configuration Tips

Expand Down
9 changes: 6 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ npm run format # Format code with Prettier

### Testing
```bash
npm test # Run all tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Generate coverage report
npm test # Run the routine feedback lane
npm run test:slow # Run security/performance load tests
npm run test:all # Run the complete routine + slow inventory
npm run test:watch # Run routine tests in watch mode
npm run test:coverage # Generate routine coverage
npm run test:coverage:all # Generate complete coverage for review/CI
npm run test:nip01 # Test core NIP-01 functionality
npm run test:nip04 # Test specific NIP (replace 04 with any NIP number)
npm run test:crypto # Test all crypto functionality
Expand Down
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ Runnable examples cover core usage, NIP-specific flows, and curated groups. See

## Testing

The Jest suite uses an ephemeral relay where possible so normal test runs avoid external services. See the [testing guide](./tests/README.md) for organization and methodology, and use the [Command Reference](#command-reference) for every supported test command.
The Jest suite uses an ephemeral relay where possible so normal test runs avoid external services. `npm test` is the fast routine lane; `npm run test:slow` contains the explicitly named security/performance load suites, and `npm run test:all` runs the complete assurance set. CI always runs both lanes for Node and Bun. See the [testing guide](./tests/README.md) for organization and methodology, and use the [Command Reference](#command-reference) for every supported test command.

## Command Reference

Expand Down Expand Up @@ -470,19 +470,23 @@ The `scripts` object in [package.json](./package.json) is the executable source

### Primary Tests

| Command | Definition |
| -------------------------- | -------------------------------- |
| `npm run test` | `jest` |
| `npm run test:watch` | `jest --watch` |
| `npm run test:coverage` | `jest --coverage` |
| `npm run test:integration` | `jest tests/integration.test.ts` |
| Command | Definition |
| ------------------------------ | -------------------------------------------------------------- |
| `npm run test` | `node scripts/run-test-lane.js jest routine` |
| `npm run test:watch` | `node scripts/run-test-lane.js jest routine --watch` |
| `npm run test:coverage` | `node scripts/run-test-lane.js jest routine --coverage` |
| `npm run test:coverage:all` | `node scripts/run-test-lane.js jest all --coverage` |
| `npm run test:slow` | `node scripts/run-test-lane.js jest slow` |
| `npm run test:integration` | `jest tests/integration.test.ts` |

### Bun Tests

| Command | Definition |
| ------------------------ | -------------------------------------------------------------- |
| `npm run test:bun` | `bun test ./tests --max-concurrency 1 --timeout 30000` |
| `npm run test:bun:watch` | `bun test ./tests --watch --max-concurrency 1 --timeout 30000` |
| Command | Definition |
| ------------------------ | ------------------------------------------------------ |
| `npm run test:bun` | `node scripts/run-test-lane.js bun routine` |
| `npm run test:bun:watch` | `node scripts/run-test-lane.js bun routine --watch` |
| `npm run test:bun:slow` | `node scripts/run-test-lane.js bun slow` |
| `npm run test:bun:all` | `bun run test:bun && bun run test:bun:slow` |

### NIP-01 and Core Tests

Expand Down Expand Up @@ -534,7 +538,7 @@ The `scripts` object in [package.json](./package.json) is the executable source

| Command | Definition |
| ------------------------ | --------------------------------------------------------- |
| `npm run test:all` | `npm test` |
| `npm run test:all` | `npm test && npm run test:slow` |
| `npm run test:crypto` | `jest tests/utils/crypto.test.ts tests/nip04 tests/nip44` |
| `npm run test:identity` | `jest tests/nip05 tests/nip07 tests/nip19` |
| `npm run test:protocols` | `jest tests/nip46 tests/nip47 tests/nip57` |
Expand Down
13 changes: 7 additions & 6 deletions docs/agents/runs/cleanup-1-9-ledger.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- Feature branches: one branch per approved ticket, created from the latest integrated `staging`
- Human owner: plebdev
- Started: 2026-07-18
- Current status: items 1–5 / issues #131–#135 merged into `staging`; item 6 / issue #136 is fully green locally and awaits the final hosted rerun on PR #145
- Current status: items 1–6 / issues #131–#136 merged into `staging`; item 7 / issue #137 is implemented with PR #146 pending on `feature/fast-default-test-loop`
- Skill setup status: present and verified (`AGENTS.md`, GitHub issue tracker, triage labels, domain docs, ADRs, CI, CodeRabbit)

## Goal
Expand All @@ -25,9 +25,9 @@ Complete cleanup items 1–9 from the staging audit end to end, branch by branch
- Tickets: #131–#139
- Ticket sessions: created as each ticket starts
- Agent briefs: Grok 4.5 is the exclusive delegated sidecar; Cursor exposes the highest available tier as `cursor-grok-4.5-high`, which is used for all standards/spec passes
- Review packets: `issue-131-review-packet.md` through `issue-136-review-packet.md`; created per later ticket
- Review packets: `issue-131-review-packet.md` through `issue-137-review-packet.md`; created per later ticket
- Local CodeRabbit report: `issue-131-coderabbit-local.md` through `issue-136-coderabbit-local.md`; created per later ticket
- PR URL: #140 merged for issue #131; #141 merged for issue #132; #142 merged for issue #133; #143 merged for issue #134; #144 merged for issue #135; #145 open for issue #136; always non-draft and targeting `staging`
- PR URL: #140 merged for issue #131; #141 merged for issue #132; #142 merged for issue #133; #143 merged for issue #134; #144 merged for issue #135; #145 merged for issue #136; issue #137 PR pending; always non-draft and targeting `staging`

## Commands

Expand All @@ -46,8 +46,8 @@ Complete cleanup items 1–9 from the staging audit end to end, branch by branch
| #133 shared diagnostic seam | AFK | merged | `feature/shared-diagnostics-completion` | Grok standards/spec pass; local and hosted clean | Jest/Bun 1067/1067; hosted CI green |
| #134 NIP-47 service lifecycle | AFK | merged | `feature/nip47-service-lifecycle` | Grok pass; CodeRabbit local/hosted clean | Jest/Bun 1073/1073; hosted CI green |
| #135 NIP-57 consolidation | AFK | merged | `feature/nip57-client-consolidation` | Grok pass; CodeRabbit local/hosted clean after fixes | Jest/Bun 1082/1082; hosted CI green |
| #136 NIP-46 protocol core | AFK | hosted rerun | `feature/nip46-protocol-core` | Grok/local clean; hosted findings fixed; rerun pending | Jest/Bun 1096/1096; prior CI green |
| #137 default test feedback loop | AFK | blocked by #136 | `feature/fast-default-test-loop` | pending | pending |
| #136 NIP-46 protocol core | AFK | merged | `feature/nip46-protocol-core` | Grok and CodeRabbit local/hosted clean after fixes | Jest/Bun 1096/1096; hosted CI green |
| #137 default test feedback loop | AFK | review cooldown | `feature/fast-default-test-loop` | Grok pass; final CodeRabbit retry pending after cooldown | routine 1063; slow 40; coverage 1103 |
| #138 public behavior test seams | AFK | blocked by #137 | `feature/public-behavior-test-seams` | pending | pending |
| #139 ephemeral Relay internals | AFK | blocked by #138 | `feature/ephemeral-relay-internals` | pending | pending |

Expand All @@ -66,7 +66,8 @@ Complete cleanup items 1–9 from the staging audit end to end, branch by branch
| #133 | `46d7289` | current Codex orchestrator; Grok 4.5 High reviewers | `b238461`, `6dd75c3`, `ae15ace` | Grok standards/spec passed; CodeRabbit local/hosted clean | focused 204/204; Jest/Bun 1067/1067; all local gates and four hosted lanes green |
| #134 | `2a3556d` | current Codex orchestrator; Grok 4.5 High reviewers | `569b266` plus review artifacts | Grok standards/spec passed; CodeRabbit local/hosted clean | focused 6/6; Jest/Bun 1073/1073; all local gates and four hosted lanes green |
| #135 | `25e055d` | current Codex orchestrator; Grok 4.5 High reviewers | `0909227`, `1b12872`, `b66d483` | Grok passes; CodeRabbit local/hosted clean after fixes | focused 23/23; NIP-57 41/41; Jest/Bun 1082/1082; all local gates and four hosted lanes green |
| #136 | `ed9fa4a` | current Codex orchestrator; Grok 4.5 High reviewers | `cf3819b`, `baa2bf2`, `03a6652`, `7b5a7d0`, `2d4fc6f`, `d983bae`, `bc342cd`, `9e029be`, `1c38f2c` | Grok/local clean; hosted findings fixed; rerun pending | NIP-46 185/185; Jest/Bun 1096/1096; all local gates and prior hosted CI green |
| #136 | `ed9fa4a` | current Codex orchestrator; Grok 4.5 High reviewers | PR #145 through merge `8b970e4` | Grok and CodeRabbit local/hosted clean after fixes | NIP-46 185/185; Jest/Bun 1096/1096; all local and hosted gates green |
| #137 | `8b970e4` | current Codex orchestrator; Grok 4.5 High reviewers | implementation `0de11d9`, `91ffafa`, `295d114`, `d8de419`; review records through HEAD | Grok standards/spec passed after Bun 1.3.9 fix; clean CodeRabbit retry pending | baseline 85/1096/58.793s; routine 84/1063/32.356s; slow 2/40/43.154s; coverage 86/1103 |

## Alignment Decisions

Expand Down
52 changes: 52 additions & 0 deletions docs/agents/runs/issue-137-review-packet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Review Packet: #137 Default Test Feedback Loop

## Issue

- Issue: #137
- Slice type: AFK test-infrastructure cleanup
- Acceptance criteria: reproducible timing evidence; deterministic removal of avoidable waits; materially faster routine lane; explicit slow security/performance lane; complete Node and Bun CI assurance
- Baseline: `8b970e4`
- Current diff: working branch against `8b970e4`

## Implementation Summary

The default Jest and Bun commands now run a canonical routine inventory, while two explicitly named security/performance load suites run in a slow lane. A small CommonJS lane module owns discovery and membership for Node 16 compatibility. CI runs routine and slow steps on Node 16, 18, 20, and Bun; Node 20 coverage uses the complete inventory. Parser-only NIP-46 validation cases no longer pay public-client teardown delays, cutting the hosted-fix default Jest wall time from 58.793s to 32.356s (45.0%).

## Implementation Evidence

- `implement` session: `issue-137-session.md`
- `tdd` used: lane-contract test failed before the module and wiring existed
- Routine Jest: 84 suites / 1063 tests / 32.356s
- Slow Jest: 2 suites / 40 tests / 43.154s
- Routine Bun: 84 files / 1063 tests / 190.68s
- Slow Bun: 2 files / 40 tests / 40.42s
- Full union: 86 suites/files / 1103 tests in each runtime
- Complete Jest coverage command: 86 suites / 1103 tests / 49.078s; 80.51% statement coverage

## Review Instructions

Review only issue #137 unless a severe cross-slice regression appears. Verify that the lane inventory is canonical and complete; routine and slow sets are disjoint; targeted Jest paths still work; command forwarding and exit codes are preserved; CI runs both sets for every supported runtime; coverage includes all tests; input-validation changes retain public integration coverage while parser-only cases remain direct; and the before/after evidence is reproducible.

## Reviewer Output

```text
STANDARDS_STATUS: pass
STANDARDS_FINDINGS:
- P2 documentation command mismatch corrected in AGENTS.md and CLAUDE.md

SPEC_STATUS: pass
SPEC_FINDINGS:
- none; final pinned-Bun Grok follow-up passed standards and spec

CODERABBIT_STATUS: compatibility implementation clean; final wording fix committed, zero-finding retry pending after CLI cooldown
CODERABBIT_FINDINGS:
- major: include Jest-compatible .spec.* files in canonical discovery — fixed with a red/green regression test
- minor: assert routine and complete coverage wiring — fixed
- minor: replace the ledger baseline hash with the implementation commit — fixed
- hosted minor: synchronize the top-level run status — fixed
- hosted minor: dynamically discover new routine tests during Bun watch without admitting slow paths — fixed with a red/green pure argument-builder test
- hosted minor: document standalone Jest and Bun slow commands — fixed
- hosted major: directly cover spawned Bun argument construction for dynamic watch and fixed non-watch modes — fixed
- Grok P1: replace Bun 1.3.11-only path ignores with pinned-1.3.9-compatible `[slow]` name filtering — fixed and exercised with the Bun 1.3.9 binary
- Grok P2: record hosted-fix commit `295d114` in the ledger — fixed
```
Loading
Loading