Two rename anchors nothing checks: the :global mark tints, and the vocabularies vs their migration CHECKs #186

Open
opened 2026-09-21 18:00:13 +02:00 by lz · 0 comments
Owner

Found by the review agents on #180, and deliberately left out of it to keep that diff to the duplication it was about. Both are the same shape — a place a vocabulary is written down that no compiler and no test reaches — and one issue because a single test pass would close both.

1. Two :global mark tints outside app.css

#180 closes the app.css half: attention.test.ts now checks both directions, every SESSION_MARK has a rule that paints, and a stale .status-dot.<mark> for a mark that no longer exists fails. Two component stylesheets style a mark name and are reached by neither:

  • nexus/src/lib/components/SessionRow.svelte:143 — .shell-row :global(.shell-icon.needs-you) { color: var(--warn); }, fed by class={'shell-icon ' + dotClass} at :66
  • nexus/src/lib/components/main-page/WorkspaceRail.svelte:313 — .seg :global(.needs-you) { color: var(--warn); }, fed by shellMark() at :56

Rename needs-you and both tints go dead with every gate green. The other hardcoded 'needs-you' literals (WorkspaceRail.svelte:56, workspaces.svelte.ts:466, RailHoverCard.svelte:168) are comparisons against SessionMark-typed values, so the compiler already catches those — these two are strings inside a <style> block, which it never sees.

Scanning component <style> blocks needs care in one direction only: a mark that appears in NO component is normal, so only the reverse check applies — a :global(...) rule naming something that is not a SESSION_MARK.

2. Nothing pins a vocabulary against the migration CHECK that backs it

Every vocabulary #180 collapsed has a database constraint behind it, which is the real backstop against a silent widening:

array constraint
SESSION_KINDS migrations/0006_workspace_shell_session.ts:8 — kind in ('session','workspace_shell')
PREVIEW_SCHEMES migrations/0008_previews_scheme.ts:8 — scheme in ('http','https')
PROVIDER_KINDS migrations/0001_init.ts:15 — kind in ('forgejo','github')

Adding a member to any array now compiles, ships, reaches the wire, and fails at the INSERT. That is loud, but it is loud at runtime on the operator's instance rather than at the gate. A parity test shaped like bind-host.test.ts — read the migration source, assert the array and the constraint name the same set — turns it into a red test.

Worth stating so nobody "fixes" it the other way: the constraint is not redundant with the array, and neither should be deleted. The array is what the TypeScript and the request schemas read; the constraint is what the database enforces on rows written before or outside them.

Not in scope

WORKER_STATUSES has no constraint to pin against — workers.status is text with none (migration 0001), which AGENTS.md already notes. SESSION_STATUSES does have one, so it can join the same test.

Found by the review agents on #180, and deliberately left out of it to keep that diff to the duplication it was about. Both are the same shape — a place a vocabulary is written down that no compiler and no test reaches — and one issue because a single test pass would close both. ## 1. Two `:global` mark tints outside `app.css` #180 closes the `app.css` half: `attention.test.ts` now checks both directions, every `SESSION_MARK` has a rule that paints, and a stale `.status-dot.<mark>` for a mark that no longer exists fails. Two component stylesheets style a mark name and are reached by neither: - `nexus/src/lib/components/SessionRow.svelte:143` — `.shell-row :global(.shell-icon.needs-you) { color: var(--warn); }`, fed by `class={'shell-icon ' + dotClass}` at `:66` - `nexus/src/lib/components/main-page/WorkspaceRail.svelte:313` — `.seg :global(.needs-you) { color: var(--warn); }`, fed by `shellMark()` at `:56` Rename `needs-you` and both tints go dead with every gate green. The other hardcoded `'needs-you'` literals (`WorkspaceRail.svelte:56`, `workspaces.svelte.ts:466`, `RailHoverCard.svelte:168`) are comparisons against `SessionMark`-typed values, so the compiler already catches those — these two are strings inside a `<style>` block, which it never sees. Scanning component `<style>` blocks needs care in one direction only: a mark that appears in NO component is normal, so only the reverse check applies — a `:global(...)` rule naming something that is not a `SESSION_MARK`. ## 2. Nothing pins a vocabulary against the migration `CHECK` that backs it Every vocabulary #180 collapsed has a database constraint behind it, which is the real backstop against a silent widening: | array | constraint | |---|---| | `SESSION_KINDS` | `migrations/0006_workspace_shell_session.ts:8` — `kind in ('session','workspace_shell')` | | `PREVIEW_SCHEMES` | `migrations/0008_previews_scheme.ts:8` — `scheme in ('http','https')` | | `PROVIDER_KINDS` | `migrations/0001_init.ts:15` — `kind in ('forgejo','github')` | Adding a member to any array now compiles, ships, reaches the wire, and fails at the INSERT. That is loud, but it is loud at runtime on the operator's instance rather than at the gate. A parity test shaped like `bind-host.test.ts` — read the migration source, assert the array and the constraint name the same set — turns it into a red test. Worth stating so nobody "fixes" it the other way: the constraint is not redundant with the array, and neither should be deleted. The array is what the TypeScript and the request schemas read; the constraint is what the database enforces on rows written before or outside them. ## Not in scope `WORKER_STATUSES` has no constraint to pin against — `workers.status` is `text` with none (migration 0001), which AGENTS.md already notes. `SESSION_STATUSES` does have one, so it can join the same test.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lz/agent-nexus#186
No description provided.