cv-server-unit zero-budget semantic-index
CV server unit
Pin the @cv/server library surface: the actor-id round-trip used by every op envelope, the changes-stream broker that fans out SSE, the compression helper for sub-doc snapshots, the dispatch-fallback adapter shell, job records + jobcache commands and lookup, key entitlements, LLM error classification, the mirror writer, the process-request claim and lease flow, score recompute, stage attempts ledger, workspace ops, and the workspace sub-doc split commit path.
Behaviours 0 Tests 133 Graph 134 nodes · 135 edges Runner - CircleCI - Source qa/suites/cv-server-unit.yaml
Test witnesses
These tests belong to the suite. Missing implementation links stay visible until a code-backed graph claim records them.
| Test | Status | Implementation | Open |
|---|---|---|---|
null agentId falls back to the per-class legacy sentinel @cv/server · vitest · src/actor-id-roundtrip.test.ts | catalog | missing implementation link | Test |
pipeline + human + agent ops land for the same workspace and the audit query distinguishes them @cv/server · vitest · src/actor-id-roundtrip.test.ts | catalog | missing implementation link | Test |
protects human-owned job fields from later system job.update writes @cv/server · vitest · src/actor-id-roundtrip.test.ts | catalog | missing implementation link | Test |
accepts canonical formats matching the class @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
accepts legacy bare-token system ids for backwards compatibility @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
accepts the legacy sentinel for the matching class @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
accepts the three canonical classes @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
accepts vendor-namespaced detail strings with one slash @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
actorIdSchemaFor returns matching schemas @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
discriminated envelope rejects class/id mismatches @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
formats agent actor_id as <agent>:<provider>:<model> @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
formats human actor_id as device:<deviceId> @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
formats non-LLM system actor_id with structured provider @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
formats system actor_id as <provider>:<details> @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
keeps vendor-namespaced details intact when parsing @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
legacy token cannot collide with a real provider @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
parses each canonical class round-trip @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
parses legacy sentinels per class @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
rejects bare-token system ids (canonical form is <provider>:<details>) @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
rejects empty / non-string values @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
rejects empty parts @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
rejects malformed agent actor_id @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
rejects malformed human actor_id @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
rejects malformed system actor_id (schema-level enforces <provider>:<details>) @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
rejects mismatched class/id pairs @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
rejects the legacy sentinel for the wrong class @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
rejects values outside the union @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
returns valid:false for malformed strings @cv/schemas · vitest · src/actor.schema.test.ts | catalog | missing implementation link | Test |
accepts a bare numeric ?since= value @cv/server · vitest · src/changes-stream.test.ts | catalog | missing implementation link | Test |
degrades gracefully when one table is missing @cv/server · vitest · src/changes-stream.test.ts | catalog | missing implementation link | Test |
does not return events from other workspaces @cv/server · vitest · src/changes-stream.test.ts | catalog | missing implementation link | Test |
emits an SSE comment with the current timestamp @cv/server · vitest · src/changes-stream.test.ts | catalog | missing implementation link | Test |
emits an empty result on an empty db @cv/server · vitest · src/changes-stream.test.ts | catalog | missing implementation link | Test |
emits the SSE wire format with id, event, data, and a blank-line terminator @cv/server · vitest · src/changes-stream.test.ts | catalog | missing implementation link | Test |
emits the retry directive in ms @cv/server · vitest · src/changes-stream.test.ts | catalog | missing implementation link | Test |
extracts the numeric prefix from a Last-Event-ID frame @cv/server · vitest · src/changes-stream.test.ts | catalog | missing implementation link | Test |
floors fractional cursors @cv/server · vitest · src/changes-stream.test.ts | catalog | missing implementation link | Test |
interleaves the three feeds by ts_ms ascending @cv/server · vitest · src/changes-stream.test.ts | catalog | missing implementation link | Test |
only emits events strictly after the cursor @cv/server · vitest · src/changes-stream.test.ts | catalog | missing implementation link | Test |
rejects garbage to 0 rather than NaN @cv/server · vitest · src/changes-stream.test.ts | catalog | missing implementation link | Test |
respects the per-table row limit @cv/server · vitest · src/changes-stream.test.ts | catalog | missing implementation link | Test |
returns 0 when no header or query is provided @cv/server · vitest · src/changes-stream.test.ts | catalog | missing implementation link | Test |
shapes a process-request event correctly @cv/server · vitest · src/changes-stream.test.ts | catalog | missing implementation link | Test |
shapes a sub-doc event correctly @cv/server · vitest · src/changes-stream.test.ts | catalog | missing implementation link | Test |
shapes an agent-presence event correctly @cv/server · vitest · src/changes-stream.test.ts | catalog | missing implementation link | Test |
accepts ArrayBuffer input @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
achieves ≥ 10× compression on a 50 KB cv_profile JSON @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
compresses application/json @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
compresses application/octet-stream @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
compresses text/* with params @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
compresses text/markdown @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
compresses text/plain @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
compresses text/plain and sets contentEncoding @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
does NOT compress application/pdf @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
does NOT compress image/png @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
falls back to br when zstd absent @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
falls back to gzip when only gzip offered @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
ignores quality values (q=...) @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
is case-insensitive @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
prefers zstd when present @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
returns identity for null header @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
returns identity when no preferred encoding matches @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
returns null for null/undefined input @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
round-trips a 50 KB cv_profile @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
round-trips a JSON-serialisable value @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
round-trips an ArrayBuffer input for decompressBlob @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
round-trips arbitrary bytes identically @cv/server · vitest · src/compression.test.ts | catalog | missing implementation link | Test |
caps maxRequests at 4 to keep server-side dispatch bounded @cv/server · vitest · src/dispatch-fallback.test.ts | catalog | missing implementation link | Test |
logs but resolves cleanly when the fallback executor returns non-200 @cv/server · vitest · src/dispatch-fallback.test.ts | catalog | missing implementation link | Test |
omits requestIds and bypassStaleAge for sweep-style recovery dispatches @cv/server · vitest · src/dispatch-fallback.test.ts | catalog | missing implementation link | Test |
posts to the per-workspace fallback executor with explicit requestIds + bypassStaleAge @cv/server · vitest · src/dispatch-fallback.test.ts | catalog | missing implementation link | Test |
still runs the dispatch when ctx.waitUntil is unavailable (e.g. local dev) @cv/server · vitest · src/dispatch-fallback.test.ts | catalog | missing implementation link | Test |
swallows fetch errors so the originating request is unaffected @cv/server · vitest · src/dispatch-fallback.test.ts | catalog | missing implementation link | Test |
chunks workspace job link reads before D1 numbered placeholders exceed ?100 @cv/server · vitest · src/job-records.test.ts | catalog | missing implementation link | Test |
degrades to workspace-only when a visible job has no D1 link @cv/server · vitest · src/job-records.test.ts | catalog | missing implementation link | Test |
does not expose hidden ad or role ids from workspace or jobcache records @cv/server · vitest · src/job-records.test.ts | catalog | missing implementation link | Test |
resolves workspace overrides above ad facts above role facts @cv/server · vitest · src/job-records.test.ts | catalog | missing implementation link | Test |
claims pending commands with a lease and parsed payload @cv/server · vitest · src/jobcache-commands.test.ts | catalog | missing implementation link | Test |
finishes a claimed command as done @cv/server · vitest · src/jobcache-commands.test.ts | catalog | missing implementation link | Test |
reclaims expired running commands and skips live leases @cv/server · vitest · src/jobcache-commands.test.ts | catalog | missing implementation link | Test |
rejects finish attempts with the wrong claim token @cv/server · vitest · src/jobcache-commands.test.ts | catalog | missing implementation link | Test |
returns failed commands to pending when retry delay is provided @cv/server · vitest · src/jobcache-commands.test.ts | catalog | missing implementation link | Test |
builds a server-side reader from resolved ad and role facts @cv/server · vitest · src/jobcache-lookup.test.ts | catalog | missing implementation link | Test |
fetches a workspace-safe shared ad projection @cv/server · vitest · src/jobcache-lookup.test.ts | catalog | missing implementation link | Test |
merges only missing workspace fields and records jobcache origins @cv/server · vitest · src/jobcache-lookup.test.ts | catalog | missing implementation link | Test |
returns null from fact resolve when jobcache is unavailable @cv/server · vitest · src/jobcache-lookup.test.ts | catalog | missing implementation link | Test |
does not split credentials that contain colons @cv/server · vitest · src/key-entitlements.test.ts | catalog | missing implementation link | Test |
fails closed when the settings sub-doc cannot be read @cv/server · vitest · src/key-entitlements.test.ts | catalog | missing implementation link | Test |
grants shared scrape providers to green workspaces @cv/server · vitest · src/key-entitlements.test.ts | catalog | missing implementation link | Test |
returns null for invalid tier values @cv/server · vitest · src/key-entitlements.test.ts | catalog | missing implementation link | Test |
splits comma-separated server key rotation lists @cv/server · vitest · src/key-entitlements.test.ts | catalog | missing implementation link | Test |
splits newline-separated server key rotation lists @cv/server · vitest · src/key-entitlements.test.ts | catalog | missing implementation link | Test |
uses the canonical settings sub-doc only @cv/server · vitest · src/key-entitlements.test.ts | catalog | missing implementation link | Test |
returns 429 with retry metadata for exhausted rate-limit chains @cv/server · vitest · src/llm-errors.test.ts | catalog | missing implementation link | Test |
returns 503 for mixed provider chain exhaustion instead of an opaque 500 @cv/server · vitest · src/llm-errors.test.ts | catalog | missing implementation link | Test |
returns null for an unknown ID @cv/server · vitest · src/mirror.test.ts | catalog | missing implementation link | Test |
returns null for unknown IDs @cv/server · vitest · src/mirror.test.ts | catalog | missing implementation link | Test |
returns null when the mirror source no longer exists (orphaned mirror) @cv/server · vitest · src/mirror.test.ts | catalog | missing implementation link | Test |
returns readOnly=false for a real source_id @cv/server · vitest · src/mirror.test.ts | catalog | missing implementation link | Test |
returns readOnly=true for a frozen mirror @cv/server · vitest · src/mirror.test.ts | catalog | missing implementation link | Test |
returns readOnly=true with mirror info for a live mirror_id @cv/server · vitest · src/mirror.test.ts | catalog | missing implementation link | Test |
returns the source_id (not mirror_id) for a mirror @cv/server · vitest · src/mirror.test.ts | catalog | missing implementation link | Test |
returns the source_id for a direct workspace @cv/server · vitest · src/mirror.test.ts | catalog | missing implementation link | Test |
can claim an exact request id after inspecting queue eligibility @cv/server · vitest · src/process-requests.test.ts | catalog | missing implementation link | Test |
claims only eligible queued requests and hides tokens from normal reads @cv/server · vitest · src/process-requests.test.ts | catalog | missing implementation link | Test |
creates and lists process requests without leaking claim tokens @cv/server · vitest · src/process-requests.test.ts | catalog | missing implementation link | Test |
defaults the requester class to system @cv/server · vitest · src/process-requests.test.ts | catalog | missing implementation link | Test |
does not store shared ad or role ids in request payloads @cv/server · vitest · src/process-requests.test.ts | catalog | missing implementation link | Test |
enforces the server fallback queued-age floor even when callers ask for fresh work @cv/server · vitest · src/process-requests.test.ts | catalog | missing implementation link | Test |
keeps terminal process requests immutable after completion @cv/server · vitest · src/process-requests.test.ts | catalog | missing implementation link | Test |
lets fallback workers claim only queued requests old enough for fallback @cv/server · vitest · src/process-requests.test.ts | catalog | missing implementation link | Test |
lets workerClass=server bypass the staleness floor when bypassStaleFloor is set @cv/server · vitest · src/process-requests.test.ts | catalog | missing implementation link | Test |
prevents duplicate claims until the lease expires @cv/server · vitest · src/process-requests.test.ts | catalog | missing implementation link | Test |
renews non-terminal leases from owner lifecycle updates @cv/server · vitest · src/process-requests.test.ts | catalog | missing implementation link | Test |
requires the claim token for terminal updates @cv/server · vitest · src/process-requests.test.ts | catalog | missing implementation link | Test |
only reacts to settings scoring inputs @cv/server · vitest · src/score-recompute.test.ts | catalog | missing implementation link | Test |
persists score patches through the shared jobs batch commit path @cv/server · vitest · src/score-recompute.test.ts | catalog | missing implementation link | Test |
classifies critic rejection as retryable quality work @cv/server · vitest · src/stage-attempts.test.ts | catalog | missing implementation link | Test |
classifies invalid keys as non-retryable auth issues @cv/server · vitest · src/stage-attempts.test.ts | catalog | missing implementation link | Test |
classifies rate limits as retryable quota issues @cv/server · vitest · src/stage-attempts.test.ts | catalog | missing implementation link | Test |
does not suggest repair for selected attempts @cv/server · vitest · src/stage-attempts.test.ts | catalog | missing implementation link | Test |
deletes jobs through the workspace sub-doc without touching D1 job rows @cv/server · vitest · src/workspace-ops.test.ts | catalog | missing implementation link | Test |
does not re-mirror the relational projection when the workspace commit succeeds @cv/server · vitest · src/workspace-ops.test.ts | catalog | missing implementation link | Test |
keeps raw_scrape out of job.update workspace ops @cv/server · vitest · src/workspace-ops.test.ts | catalog | missing implementation link | Test |
returns unchanged non-job ops by reference @cv/server · vitest · src/workspace-ops.test.ts | catalog | missing implementation link | Test |
throws WorkspaceCommitAfterRelationalWriteError when workspace state is unavailable @cv/server · vitest · src/workspace-ops.test.ts | catalog | missing implementation link | Test |
throws when the workspace commit fails after a relational side-effect batch @cv/server · vitest · src/workspace-ops.test.ts | catalog | missing implementation link | Test |
treats a missing jobs sub-doc as storage corruption @cv/server · vitest · src/workspace-ops.test.ts | catalog | missing implementation link | Test |
validates job ops against the workspace sub-doc before side effects @cv/server · vitest · src/workspace-ops.test.ts | catalog | missing implementation link | Test |
build*DocFromProjection produces a single-root Y.Doc per sub-doc @cv/server · vitest · src/workspace-subdoc.split.test.ts | catalog | missing implementation link | Test |
decomposes a legacy multi-root settings Y.Doc into three single-root docs @cv/server · vitest · src/workspace-subdoc.split.test.ts | catalog | missing implementation link | Test |
handles a legacy doc with empty layout / order_state roots @cv/server · vitest · src/workspace-subdoc.split.test.ts | catalog | missing implementation link | Test |
jsonProjectionFor returns the single relevant root per sub-doc @cv/server · vitest · src/workspace-subdoc.split.test.ts | catalog | missing implementation link | Test |