Skip to content

Commit ba65b24

Browse files
authored
Merge pull request #63 from git-stunts/fixups
fix(deps): upgrade vitest 2→4, resolve all npm audit findings
2 parents f33569a + 21dae78 commit ba65b24

30 files changed

Lines changed: 1995 additions & 502 deletions

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
### Added
11+
12+
- **5 new graph algorithms in `GraphTraversal`**`levels()` (longest-path level assignment for DAGs), `transitiveReduction()` (minimal edge set preserving reachability), `transitiveClosure()` (all implied reachability edges with `maxEdges` safety), `rootAncestors()` (find all in-degree-0 ancestors via backward BFS). All methods respect `NeighborProviderPort` abstraction, support `AbortSignal` cancellation, and produce deterministic output. Corresponding `LogicalTraversal` facade methods added. New error code: `E_MAX_EDGES_EXCEEDED`.
13+
- **4 new test fixtures**`F15_WIDE_DAG_FOR_LEVELS`, `F16_TRANSITIVE_REDUCTION`, `F17_MULTI_ROOT_DAG`, `F18_TRANSITIVE_CLOSURE_CHAIN` in the canonical fixture DSL.
14+
- **BFS reverse reachability verification tests** — confirms `bfs(node, { direction: 'in' })` correctly discovers all backward-reachable ancestors.
15+
- **`roaring-wasm` WASM fallback for Bun/Deno bitmap indexes**`initRoaring()` now has a three-tier fallback chain: (1) ESM `import('roaring')`, (2) CJS `createRequire('roaring')`, (3) `import('roaring-wasm')` with WASM initialization. The WASM tier activates automatically when native V8 bindings are unavailable (Bun's JSC, Deno). Bitmap index tests (`materializedView`, `materialize.checkpointIndex.notStale`) are no longer excluded from the Bun test suite. Serialization formats are wire-compatible — portable bitmaps produced by native and WASM are byte-identical.
16+
17+
### Fixed
18+
19+
- **Roaring native module loading under Bun**`initRoaring()` now catches dynamic `import('roaring')` failures and falls back to `createRequire()` for direct `.node` binary loading.
20+
- **Stale `nativeAvailability` cache on `initRoaring()` reinit**`getNativeRoaringAvailable()` now returns the correct value after swapping roaring implementations via `initRoaring(mod)`. Previously, the cached availability from the old module was returned.
21+
- **Lost root causes on roaring load failure** — when all three tiers (native ESM, CJS require, WASM) fail, `initRoaring()` now throws `AggregateError` with per-tier errors instead of a plain `Error`, preserving diagnostic detail.
22+
23+
### Changed
24+
25+
- **ROADMAP priority triage** — 45 standalone items sorted into 6 priority tiers (P0–P6) with wave-based execution order and dependency chain mapping. Replaced flat Near-Term table with priority-grouped sub-tables. All milestones (M10–M14) marked complete. Inventory corrected to 133 total tracked items.
26+
- **Vitest 2.1.9 → 4.0.18** — major test framework upgrade. Migrated deprecated `test(name, fn, { timeout })` signatures to `test(name, { timeout }, fn)` across 7 test files (40 call sites). Fixed `vi.fn().mockImplementation()` constructor mocks to use `function` expressions per Vitest 4 requirements. Resolves 5 remaining moderate-severity npm audit advisories (`esbuild` [GHSA-67mh-4wv8-2f99](https://github.com/advisories/GHSA-67mh-4wv8-2f99), `vite`, `@vitest/mocker`, `vite-node`, `vitest`). **`npm audit` now reports 0 vulnerabilities.**
27+
828
## [13.0.1] — 2026-03-03
929

1030
### Fixed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
<img src="docs/images/hero.gif" alt="git-warp CLI demo" width="600">
99
</p>
1010

11-
## What's New in v13.0.1
11+
## What's New (Unreleased)
1212

13+
- **5 new graph algorithms**`levels()`, `transitiveReduction()`, `transitiveClosure()`, `rootAncestors()` in `GraphTraversal`, plus BFS reverse reachability verification. All use `NeighborProviderPort` and support cancellation.
14+
- **`roaring-wasm` WASM fallback for Bun/Deno bitmap indexes** — bitmap indexes now work on Bun (JSC) and Deno via a three-tier fallback: native V8 bindings → CJS require → WASM. Wire-compatible, byte-identical serialization.
1315
- **Dev dependency security updates** — resolved 4 high-severity advisories (`tar`, `rollup`, `minimatch`, `@isaacs/brace-expansion`). No runtime dependencies affected.
1416

1517
See the [full changelog](CHANGELOG.md) for details.
@@ -642,6 +644,7 @@ The codebase follows hexagonal architecture with ports and adapters:
642644
| `@git-stunts/trailer-codec` | Git trailer encoding |
643645
| `cbor-x` | CBOR binary serialization |
644646
| `roaring` | Roaring bitmap indexes (native C++ bindings) |
647+
| `roaring-wasm` | Roaring bitmap WASM fallback (Bun/Deno) |
645648
| `zod` | Schema validation |
646649
647650
## Testing

ROADMAP.md

Lines changed: 166 additions & 108 deletions
Large diffs are not rendered by default.

docker-compose.test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ services:
3232
command: ["sh", "-c", "npx vitest run test/unit test/integration && bats test/bats/"]
3333
profiles: [node22, full]
3434

35-
# Bun: API integration tests only (CLI is Node-only)
35+
# Bun: API integration tests only (CLI is Node-only).
36+
# Bitmap index tests pass via roaring-wasm WASM fallback (native roaring uses
37+
# V8 C++ API, incompatible with Bun's JSC runtime).
3638
test-bun:
3739
build:
3840
context: ..
3941
dockerfile: git-warp/docker/Dockerfile.bun
4042
environment:
4143
- GIT_STUNTS_DOCKER=1
42-
command: ["bunx", "vitest", "run", "test/integration/api/"]
44+
command: bunx vitest run test/integration/api/
4345
profiles: [bun, full]
4446

4547
# Deno: API integration tests via Deno.test() wrappers

docker/Dockerfile.bun

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33
# CLI tests are excluded — the CLI uses node: built-ins.
44
# Build context is the parent monorepo directory (context: ..).
55
FROM oven/bun:1.2-slim
6-
# make/g++: native module compilation (roaring bitmaps).
7-
# No bats/python3 — BATS CLI tests are Node-only.
86
RUN apt-get update && apt-get install -y --no-install-recommends \
97
git \
10-
make \
11-
g++ \
128
&& rm -rf /var/lib/apt/lists/*
139
WORKDIR /app
1410
COPY git-warp/package*.json ./
@@ -26,4 +22,7 @@ RUN git init -q \
2622
RUN useradd -m warp && chown -R warp:warp /app
2723
USER warp
2824
ENV GIT_STUNTS_DOCKER=1
25+
# Bitmap index tests now pass under Bun via the roaring-wasm WASM fallback.
26+
# The native roaring package (V8 C++ API) is incompatible with Bun's JSC runtime,
27+
# but initRoaring() falls through to roaring-wasm automatically.
2928
CMD ["bunx", "vitest", "run", "test/integration/api/"]

docs/ROADMAP/COMPLETED.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,3 +368,13 @@ Investigation revealed the correct approach is a two-phase split:
368368
| B92 | ~~**SURFACE VALIDATOR UNIT TESTS**~~**DONE.** 34 tests for `parseExportBlock`, `extractJsExports`, `extractDtsExports`. |
369369
| B93 | ~~**DEDUP EXPORT PARSING LOGIC**~~**DONE.** `parseExportBlock()` extracted as shared helper; `collectExportBlocks()` internal. |
370370
| B94 | ~~**STANDALONE EXPORT DECLARATIONS**~~**DONE.** `extractJsExports` now handles `export const/function/class`. |
371+
372+
### v13.0.0 Standalone Items (completed)
373+
374+
| ID | Item |
375+
|----|------|
376+
| B44 | ~~**SUBSCRIBER UNSUBSCRIBE-DURING-CALLBACK E2E**~~**DONE (v13.0.0).** 3 edge-case tests (cross-unsubscribe, subscribe-during-callback, unsubscribe-in-onError). |
377+
| B124 | ~~**TRUST PAYLOAD PARITY TESTS**~~**DONE (v13.0.0).** 22 tests verifying CLI vs service shape parity. |
378+
| B125 | ~~**`CachedValue` NULL-PAYLOAD SEMANTIC TESTS**~~**DONE (v13.0.0).** 3 tests documenting null = "no value" sentinel. |
379+
| B146 | ~~**UNIFY `CorePersistence` / `FullPersistence` TYPEDEFS**~~**DONE (v13.0.0).** Replaced `FullPersistence` with imported `CorePersistence`. |
380+
| B148 | ~~**REVIEW NITS + INVENTORY RECONCILIATION**~~**DONE (v13.0.0).** Fix inventory counts, COMPLETED.md ordering, stale Deno test name, BisectService invariant comment. |

index.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,27 @@ export interface LogicalTraversal {
295295
labelFilter?: string | string[];
296296
signal?: AbortSignal;
297297
}): Promise<{ path: string[]; totalCost: number }>;
298+
levels(start: string | string[], options?: {
299+
dir?: 'out' | 'in' | 'both';
300+
labelFilter?: string | string[];
301+
signal?: AbortSignal;
302+
}): Promise<{ levels: Map<string, number>; maxLevel: number }>;
303+
transitiveReduction(start: string | string[], options?: {
304+
dir?: 'out' | 'in' | 'both';
305+
labelFilter?: string | string[];
306+
signal?: AbortSignal;
307+
}): Promise<{ edges: Array<{ from: string; to: string; label: string }>; removed: number }>;
308+
transitiveClosure(start: string | string[], options?: {
309+
dir?: 'out' | 'in' | 'both';
310+
labelFilter?: string | string[];
311+
maxEdges?: number;
312+
signal?: AbortSignal;
313+
}): Promise<{ edges: Array<{ from: string; to: string }> }>;
314+
rootAncestors(start: string, options?: {
315+
labelFilter?: string | string[];
316+
maxDepth?: number;
317+
signal?: AbortSignal;
318+
}): Promise<{ roots: string[] }>;
298319
}
299320

300321
/**

0 commit comments

Comments
 (0)