Repository navigation
fix(nodes): agree on one node id, with test, README and quality follow-ups - #170
Merged
Merged
Conversation
Two starts at once with no node id: the second read the id file between the first one's exclusive create and its write, found it empty, and ran under an unsaved id of its own. An empty file is now read again, for up to a second, until the id is in.
The twenty helper modules (fakes, stores held in memory, project and network helpers) sat beside the test files. They now live in test/_helpers/, so test/ holds test files, and every import, module path and comment that names one follows it.
The README takes the package name as its title, the four badges, and the sections Why this exists, Status, Install and Usage in order, with the link to docs.cosyte.com/pathways after Usage. Its Status names the release line (**The `0.0` line.**) where it named an exact version, which went stale with every release. test/readme.test.ts holds the README to the shared skeleton check in pnpm test, and check:readme and check:catalog run the same checks from the command line. The release-status test now requires the release line package.json is on and refuses an exact version named as the one on npm, and the version step's README sync rewrites the release line where it rewrote the version.
On a GitHub Actions Windows runner the system temp folder sits on the OS disk. Measured on two runs of the same commit, one per disk, a test that builds SQLite files in its temp project ran 3 to 15 times faster on the work disk (a store migrated from step 0002: 375 ms against 33 ms), and the suite's test time fell by a quarter. Every Windows timeout in the last hundred runs was such a test, not one that starts a process. The tests' TEMP and TMP now point at RUNNER_TEMP on Windows.
…85954cad The new reference changes the shared release workflow only: it tags the version commit after the pre-publish gates, so a gate that refuses leaves no tag on a version that never shipped. The CI, CodeQL, dash, internal-reference, title and Scorecard workflows are the same at both references, so every job runs as before.
quality-floor.json holds the coverage floor, the gate as it was, and vitest.config.ts reads it. @cosyte/vitest-config 0.1.8 measures every source file but barrels. StrykerJS runs on the shared config (stryker.config.mjs, with the suite of vitest.mutation.config.ts), with the quality and mutate scripts. CI turns on the coverage-ratchet and mutation jobs, and weekly-mutation.yml runs a full mutation run twice a week; the floor gets a mutation score from its first run. The testing page and the gate in AGENTS.md say so.
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.
What
One commit per item.
src/engine/nodes.ts).resolveNodeIdcreates.pathways/node-idwith an exclusive create and then writes the id. A second start that read the file between the two found it empty and ran under an unsaved id of its own (EEXIST). An empty file is now read again, 40 times 25 ms apart, until the id is in; a file left empty for good still gives the unsaved id withEEXIST. Changeset and README bullet.test/_helpers/. The twenty helper modules move out of the top oftest/, with every import, module path and comment that names one.**The 0.0 line.**) where it named an exact version.test/readme.test.tsruns the shared README check inpnpm test;check:readmeandcheck:catalogscripts; the release-status test and the version step's README sync now hold and rewrite the release line. Changeset.vitest.config.ts). On a Windows runner, TEMP and TMP point atRUNNER_TEMP.workflows-2026-11-29-8c4385954cadin every caller.quality-floor.jsonholds the coverage floor (99/99/100/99, the gate as it was) andvitest.config.tsreads it.@cosyte/vitest-config0.1.8 (barrels measured), StrykerJS 10.1.1,stryker.config.mjs,vitest.mutation.config.ts, thequality:*andmutate*scripts,run-coverage-ratchetandrun-mutationon, andweekly-mutation.yml(16 shards, twice a week). The testing page and the AGENTS.md gate say so.Why
test/_helpers/, sotest/holds test files.pathways migrate, operator commands, metrics, probes), not a test that starts a process. Measured on two runs of one commit, one per disk, those tests ran 3 to 15 times faster on the work disk (opens a database made at migration 0002: 375 ms on C:, 33 ms on D:;lists messages newest first: 764 ms against 74 ms), and the whole suite's test time fell 23% (plain) and 32% (coverage). No timeout was raised.Proof
Run locally on Linux, Node 26, on the head commit:
pnpm typecheck,pnpm lint,pnpm format:check,pnpm phi-scan,pnpm build,pnpm attw,pnpm check:no-emdash,pnpm check:no-internal-refs,pnpm check:claude-card,pnpm check:docs-reference,pnpm check:readme,pnpm check:catalog: all pass.pnpm test:coverage: 151 files pass, 4 skipped; 3081 tests pass. Lines 99.87, branches 99.13, functions 100, statements 99.82.pnpm quality:check --base origin/main: OK, no uncovered changed line.pnpm mutate changed --base origin/main, thenpnpm quality:mutation --base origin/main: OK. 14 mutants on the changed lines ofsrc/engine/nodes.ts, none surviving. One inline exception, listed by the ratchet:src/engine/nodes.ts:96,Stryker disable next-line ConditionalExpression: text read again later gives the same id(the mutant only re-reads a file that already holds text, which gives the same answer one second later).is the other start's id when that start has made the file and not yet written itfailed on main with{ from: "unsaved", code: "EEXIST" }, the reported symptom, and passes with the fix. The race test passed 30 of 30 runs after it.test/readme.test.tsand the release-line test fail on the old README (cosyte-readmegave 5 findings: title, badges, no Usage, Install before Status, no docs link) and pass on the new one.pnpm test:perfand the database, Docker, SFTP and object-store workflows are left to CI.No second review is needed: nothing here changes the PHI scan, de-identification, or a shared release workflow (item 5 moves this repository's reference to a published one).
Choices
RUNNER_TEMPis set on Windows.vitest.mutation.config.tsleaves outtest/docs-content.test.tsandtest/examples.test.ts, which read the repository around the code (git and the real node_modules) and fail in StrykerJS's sandbox before any mutant runs.disableTypeChecksis limited tosrcandtest, so the starter and the examples, which tests compare byte for byte, are copied as they are.Not in this pull request:
@cosyte/test-utilshas a synchronous runner only.check:docs-contentin the required job: the shared docs-content check takes an example to be one file at the top ofexamples/with a pageexample-<name>.md; ours are project folders, so its 42 findings (35 of them the seven example pages read as tutorials) need either a change to that check or new page ids for published pages.-- reasonform were already done on main (no colon-form hint is left insrc/).