Repository navigation
Conversation
Run source-compatible suites without a build and retain compiled exports for legacy mutation fixtures. Preserve Mocha selection, completion and database isolation across both lanes, and cover native execution without dist in CI. Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Resolve worker helpers absolutely, classify built artifacts and cache mutation precisely, and bind result reporting to the owning run after teardown and reporter completion. Preserve ordinary parallel workers and add regression coverage for unfinished completion and physical database removal. Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Co-Authored-By: GPT-6.1 Codex <noreply@openai.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request establishes a dual-lane unit testing architecture that separates native source-compatible tests (utilizing Node.js native type stripping via the typestrip condition) from legacy compiled tests. It introduces a custom test launcher (runTypeStripTests.mts) to partition suites, updates package.json imports and scripts, and implements a nativeCoreGuard to prevent source processes from loading the compiled core. Additionally, the database teardown and Mocha initialization processes are refactored to support ESM-only environments. No review comments were provided, so there is no further feedback to address.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
⊙ Problem
Ordinary tests need build-free source execution; export-rewriting fixtures need mutable compiled modules.
Stacked on #562; merge that foundation first.
🤔 Retain legacy mutation fixtures?
Keep legacy mutation coverage compiled;
#jsdeclares it.💡 Solution
package.json makes
#srcselect source undertypestrip, including JavaScript, and denies#jsthere. Both aliases selectdistunder ordinary Mocha. The launcher partitions Mocha's selection into separate processes.⚖️ Alternatives
Automatic helper selection favors the launcher over fixed lists.
🔧 Changes
Product and architecture tour
Choose the runtime
npm run test:unit:typestripnpm run test:unit:typestrip:resourcesnpm run test:unit:typestrip:maintypeStripSuites.mts recognizes
#js, local helpers and static child fixtures. runTypeStripTests.mts keeps Mocha's options, rejects ambient native conditions for mixed runs, and preserves compiled global--filesetup in one process. Source-only refuses to omit compiled setup. Watch and parallel mode use project Mocha; file and external reporters run per lane.Exports stay compiled; speed is unmeasured.
Completion and storage
mocha.init.js records completion, totals and files; missing completion and signals fail.
--fail-zerochecks the combined total.perFileDatabaseTeardown.js observes cached ESM databases, preserving initial directories and removing reopened residue. nativeModules.mts rejects compiled cache entries at file boundaries and completion. Utility-only suites leave storage unloaded. packageBindings.mts preserves core's blob extensions and addon identity. rocksdbBindings.mts delegates to it. testUtils.js uses real native initialization; compiled keeps its stub.
.mtsavoids rewire's.tshook.Additional changes
alasqlFunctionImporter.ts default-imports the CommonJS date-helper object; a native namespace import did not expose its date functions. DESIGN.md records that boundary. unit-test.yml adds Node 22.18.0/24.0.0 and current 22/24/26 source CI with no build or Harper install and type-checks the harness. tsconfig.harness.json scopes that check.
AGENTS.md maps the source subset and built complete selection; CONTRIBUTING.md documents commands and limits; DESIGN.md records the lane contract; DESIGN.md indexes both notes. hnsw-real-store.cjs uses its existing source family consistently; no benchmark was run.
✅ Verification
Build, types, lint, formatting and 28 harness tests pass. Mixed core: 3,829 source + 3,207 compiled, 207 pending. Windows selection on Linux: 5,008 passed. All five hosted native jobs passed.
Broad validation and CI limits
Without dist, core 3,829/26 pending, resources 3,234/36 and indexes 645/7 pass on Node 22.18/24.0/26. Compiled core 7,036/207 passed before the final backup fixture fix; all 78 backup tests pass with a relative root. Compiled resources: RocksDB 4,283/54; LMDB 3,255/722. Integration: 2,389 passed, 18 skipped, one TODO before later harness-only fixes. Deployment timing assertion passed the repeat.
CI Bun shard 6, Next.js adapters (20/22/24) and Windows runtime/admission failures match #562's logs. Windows passes on current main; these are parent-branch failures. Other jobs are still running.
Focused regression evidence
typeStripSuites covers selection/completion, inheritance, reporters, workers, late storage and interrupts. preTestPrepNative checks real initialization/isolation. perFileDatabaseTeardown tests guarded completion, both engines, closed residue and prior data. branchDatabase and closeLoadedDatabases use the shared named schema handler. longLivedTransactions resolves its worker helper absolutely.
schema.test.js scopes its PID stub; declaration-time mutation split database roots. pidInvariant.cjs fails without the PID fix.
gitSSHMaterialization restores its root and retains compiled logger mutation. storageExhaustion drains loader warnings before its fatal-console oracle. rocksdbBackup.test.js pins its child's canonical backup key and absolute parent path. logConfigFixture.js rewrites the compiled logger.
🤔 Local command deadlines
CI bounds steps. Local per-test timeouts are disabled; use
--timeoutor interrupt.🤔 Final review tradeoffs
Source-only covers compatible suites. Use project Mocha; separate file reporters. Five helpers are pinned native; other marker changes appear in skip counts.
Review limits
Optional Composer output failed format repair; prompt truncation carries. Native coverage remains an accepted policy nit.
PR QA: Do legacy SQL date functions agree across cold HTTP and export workers in both runtimes? — queued @ 357adfb, qa-pr-harper-3199-357adfb
Developer docs are included; public API and storage format are unchanged.
Remaining test and fixture files
Import groups: source=#src; compiled=#js; bindings match core; JS is retained. Paths: unitTests; bridge=dataLayer/harperBridge.
🤖 Generated by OpenAI Codex; posted via @kriszyp.
Release target: v5.4 — stacked on #562.
Related PRs: #562 overlaps (stacked foundation), #1835 overlaps (blob bindings), #2155 overlaps (eviction bindings), #3121 overlaps (backup fixtures), #3137 overlaps (subscription logger), #3187 overlaps (handler aliases)
Complexity: complicated — worker completion and module identity.
Deferred findings
1eada620d2e4e40dminor unclassified —.github/workflows/unit-test.yml— Native timeout caps lack hosted native measurements — filed Measure hosted native unit CI deadlines #319619f8b08d43209eaeminor performance —unitTests/typeStripSuites.mts— Shared helpers are reparsed separately for every suite — filed Measure repeated parsing in unit runtime selection #3197c163b5329a470bd8minor correctness —unitTests/mocha.init.js— Completion interception patches only project-installed Mocha — filed Track completion when a distinct Mocha installation runs units #3198Review-Coverage: authored=codex; ran=gemini,claude; adjudicated=domain; blocked=cursor-composer(failed); declined=cursor-grok,cursor-kimi,cursor-muse,muse; rounds=9; full=1 @ 357adfb
Review-Attention: study ~14m (sensitive: unit-test.yml; decisions: do-less-alternative, mutable-export-fixtures, completion-interception) @ 357adfb