Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: match README bullet format and hoist test import for manuscriptLocate (#13163)

Adam Eivycd3047824084
diff --git a/client/src/lib/manuscriptAnchors.test.js b/client/src/lib/manuscriptAnchors.test.js
index 6c6654eaf7..0b9b192e94 100644
--- a/client/src/lib/manuscriptAnchors.test.js
+++ b/client/src/lib/manuscriptAnchors.test.js
@@ -1,5 +1,7 @@
+// @vitest-environment node
import { describe, it, expect } from 'vitest';
import { locateFind, locateFindSpan, locateAnchors, buildHighlightSegments } from './manuscriptAnchors.js';
+import { locateFind as sharedLocateFind, locateFindSpan as sharedLocateFindSpan } from '../../../server/lib/manuscriptLocate.js';
describe('locateFind', () => {
it('returns the only occurrence when unique', () => {
@@ -96,9 +98,6 @@ describe('buildHighlightSegments', () => {
expect(segs[0]).toEqual({ text: 'ab', commentIds: ['x'], topSeverity: 'low' });
});
});
-// @vitest-environment node
-
-import { locateFind as sharedLocateFind, locateFindSpan as sharedLocateFindSpan } from '../../../server/lib/manuscriptLocate.js';
describe('locator parity with the server accept path', () => {
it('client preview re-exports the shared server locator', () => {
diff --git a/server/lib/README.md b/server/lib/README.md
index bb561502ab..497e54e0db 100644
--- a/server/lib/README.md
+++ b/server/lib/README.md
@@ -968,4 +968,4 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub
- `eventLoopLagProbe.js`: `createEventLoopLagProbe({ clock, intervalMs, toleranceMs, resources, attributeAboveMs })` opens phase-tracking spans that charge overdue time of one shared, span-scoped tick to the current phase, so a slow-operation diagnostic splits each phase into event-loop/host scheduling lag and asynchronous wait (#12329), and a span charged more than `attributeAboveMs` of lag carries `load` (process `cpuMs`, `gcMs`, `invCtx`, host `load1`/`cpus`) to tell a busy process from a starved one (#12852); `beginLoadSample(resources)`, `formatLoadAttribution(load)` and `systemResources` (the same counters for a caller without a span); `systemClock` (globals resolved at call time), `__createManualClock()` (deterministic `advance` = on-time timers vs `stall` = blocked loop, for tests), `roundMs`, and `phaseGroup(summary, name)` (a phase plus its `name.` sub-phases).
- `pgJson.js`: text repair for values bound to PostgreSQL, which refuses a lone UTF-16 surrogate in `jsonb` and NUL in `jsonb`/`text` where every file store accepted both. `normalizePgString(s)` → `toWellFormed()` with NUL → U+FFFD (the same lossy repair a UTF-8 file write applied). `toPgJson(value)` → `JSON.stringify` that repairs string values and object keys; **use it, never bare `JSON.stringify`, for a parameter bound to a `json`/`jsonb` column or `::jsonb` cast** (`pgJsonConventions.test.js` enforces this). `normalizePgParams(params)` is applied by `db.js` `query()` and the `withTransaction` client: repairs string and array-element params (never unescapes `\^@`) and serializes plain-object params via `toPgJson`.
- `errorLogFingerprint.js`: stderr-log triage primitives for `error-log-triage` (#12851). `groupStderrEntries(text)` strips the PM2 date prefix and folds stack/continuation lines under their head line; `fingerprintEntry(entry, { extraTerms })` redacts the entry (home paths, hosts, IPs, UUIDs, credentials, quoted record names, plus install literals such as the hostname and OS user) and reduces the head to a template (timestamps, ids, SHAs, filesystem paths and numbers become placeholders; API routes stay distinct) with a stable 16-hex fingerprint; `templateSearchExcerpt(template)` picks a tracker search phrase, or null when too generic. Pure; the collector and tracker dedupe live in `services/errorLogTriage.js`.
-| `manuscriptLocate.js` | `locateFind` / `locateFindSpan` — the manuscript `find` locator (nearest-to-`anchorQuote` occurrence, then whitespace-tolerant regex fallback). The one implementation behind both the server accept path (`services/pipeline/manuscriptFix.js`) and the client highlight/impact preview (`client/src/lib/manuscriptAnchors.js` re-exports it), so the preview selects the span an accept replaces. Pure / browser-safe. |
+- `manuscriptLocate.js`: `locateFind` / `locateFindSpan` — the manuscript `find` locator (nearest-to-`anchorQuote` occurrence, then whitespace-tolerant regex fallback). The one implementation behind both the server accept path (`services/pipeline/manuscriptFix.js`) and the client highlight/impact preview (`client/src/lib/manuscriptAnchors.js` re-exports it), so the preview selects the span an accept replaces. Pure / browser-safe.