Skip to content

[finding] rowColor.colors is optional in the schema but required by the only renderer — rowColor: { field } alone is a parse-clean no-op #14111

Description

@os-warren

Noticed while deciding how to colour list rows consistently with a status field (objectstack-ai/duly #12). Not blocking anything — we chose not to author rowColor at all — but it is an ADR-0078 functional-completeness shape that the existing rule family does not cover.

The shape

RowColorConfigSchema (spec/src/ui/view.zod.ts):

field:  z.string().describe('Field to derive color from (typically a select/status field)'),
colors: z.record(z.string(), z.string()).optional().describe('Map of field value to color (hex/token)'),

field required, colors optional. The .describe() on field — "derive color from" — reads as though the derivation happens without a map, which is what a select field's own options[].color would let it do.

The grid renderer disagrees (plugin-grid, 17.2.0):

function qt(e){ return useCallback(t => {
  if (!e?.field || !e.colors) return;        // ← both, or nothing
  let n = String(t[e.field] ?? ``), r = e.colors[n];
  if (r) return Kt(r);
}, [e?.field, e?.colors]) }

So rowColor: { field: 'status' } parses, publishes, and colours nothing. No error, no warning, no console message.

Why it belongs with the existing rules

This is the same family validateFunctionalCompleteness already gates: a summary with no summaryOperations, a lookup with no reference, a select with no options, a calendar with no calendar block. Every key is known, so #4001's unknown-key rejection cannot see it and the liveness ledger cannot either — which is precisely the gap that rule exists to fill.

Two ways to close it, and they are not equivalent

  • A — gate it. Add view/row-color-without-colors (warning) to checkViewCompleteness: a rowColor with a field and no colors never colours a row. Cheap, matches the existing rules exactly.
  • B — make the description true. Let the renderer fall back to the bound field's options[].color when colors is absent, the way plugin-timeline already resolves its colorField. This is the better outcome for the case the key is obviously for — colouring by a status select — because it removes the need to hand-copy the option colours into a second map that then drifts from the object. An author who copies them has two sources of truth for one palette.

If B, A is still worth keeping for the non-select case (a text or number field with no options has nothing to derive from).

Activity

  1. added
    finding
    on Sep 1, 2026
  2. huangyiirene commented on Sep 2, 2026

    @huangyiirene
    Collaborator

    Triage (R+89, triage seat, session session_019kDRpB7D2XzVzkaLp57T5D): graded → pm:queue · priority:p3 · domain:spec · type Task. finding removed.

    Ruled route: A only. Add view/row-color-without-colors (warning) to checkViewCompleteness — the functional-completeness family in packages/spec/src/kernel/functional-completeness.ts, which is why this lands in the spec lane (same landing as #14106) — and tighten the .describe() on RowColorConfigSchema.field so it no longer reads as if derivation happens without a map. Rationale: this is exactly the ADR-0078 shape the rule family exists for (every key known, so neither #4001 nor the liveness ledger can see it), and a rowColor: { field } that parses, publishes and colours nothing is the silent half.

    ⛔ B (renderer falls back to the bound select's options[].color) is not in scope and is not filed: it is a renderer feature in objectui with one non-blocking mention as its pull (the reporter chose not to author rowColor at all), so it stays un-declared until a consumer asks; if one does, that is an objectui card, and A remains correct for every non-select field regardless. Not clause ② (author-time diagnostic; the schema's accept set does not move).

    Size/model suggestion: S mechanical, sonnet; one positive fixture (field only ⇒ warning) and one negative (field + colors ⇒ silent).


    Generated by Claude Code

  3. added
    pm:queue
    domain:spec
    and removed
    finding
    on Sep 2, 2026
  4. added theissue type on Sep 2, 2026
  5. added
    pm:dispatched
    and removed
    pm:queue
    on Sep 3, 2026
  6. zhuangjianguo commented on Sep 3, 2026

    @zhuangjianguo
    Collaborator

    Claim: PM loop, domain:spec seat (seat post #6017), R3 of this shift
    Session: session_0174WZTU6XcFcS7g2kykC53i (GitHub zhuangjianguo)
    Branch: claude/issue-14111-row-color-without-colors
    Worktree: objectstack-issue-14111
    Domain: domain:spec
    File surface: packages/spec/src/kernel/functional-completeness.ts — checkViewCompleteness (:347) gains view/row-color-without-colors (warning): a list view's rowColor with field and no colors never colours a row (the only renderer, plugin-grid, requires both), message naming the view and the remedy (a colors map), exported rule id beside the family's others · packages/spec/src/kernel/functional-completeness.test.ts — one positive fixture (field only ⇒ warning at the rowColor path) and one negative (field + colors ⇒ silent), plus the family's rule-id pin if one enumerates the ids · packages/spec/src/ui/view.zod.ts — the RowColorConfigSchema.field describe (:877) tightened so it no longer reads as if derivation happens without a map (⛔ colors stays optional; no accept-set change) · generated artifacts via check:generated --fix (references/ui/view.mdx, JSON schema) · .changeset/*.md @objectstack/spec patch (a new author-time warning + describe text; no accept-set movement) · check-system-context-census.mjs --fix if a view.zod.ts anchor rots. ⛔ Untouched: objectui (route B not filed), the existing rules in functional-completeness.ts, content/docs/releases, skills.
    Container & model: S, mode:subagent, model: opus (the os-dev floor; triage suggested sonnet for an S mechanical card — the floor wins). node scripts/pm/dispatch-gates.mjs --tier on the two files (explicit paths, 21:18Z): "no path-derived mandate" + "Clause ② SUSPECT surface" (both ⇢ packages/spec/src/**); tier from content — an author-time diagnostic and describe text, no accept/reject movement.
    Clause-②: no — the schema's accept set does not move (colors stays optional); a warning is a diagnostic, not a refusal. The dev's own claim comment carries the same line.
    Serial constraints cleared: open-PR file scan — 25 open PRs at 21:18Z (the 209-file inventory of 20:38Z plus the files of the five PRs opened since, read individually): none touches view.zod.ts or functional-completeness.ts; lane siblings in flight (#14104: filter.zod.ts + driver-sql + formula; PR #15084: security/sharing.*; PR #15089: packages/lint) file-disjoint; ⚠️ PR #15085 (#14878, another lane) touches packages/spec/src/stack.zod.ts — not this card's surface, recorded for the seat post; no remote branch exists for this card (21:18Z).
    H17 on-hold trigger-file index (#9857 body, read 20:38Z): packages/spec/src/ui/view.zod.ts is declared by #8346 (Restart-touch) — notice posted on #8346 in this stroke.
    Decision re-read (1 comment): triage 5502967476 (2026-09-02): route A only — the warning rule in checkViewCompleteness + the describe tightening; ⛔ B (renderer fallback to the bound select's options[].color) not in scope, not filed; not Clause ②; Task, p3, S. Premise re-read on origin/main 6665c5c9 (21:18Z): RowColorConfigSchema at view.zod.ts:873-880 — field required with the "Field to derive color from" describe, colors optional; checkViewCompleteness at functional-completeness.ts:347; no row-color rule id exists in the family. Premise holds.


    Generated by Claude Code

  7. zhuangjianguo commented on Sep 3, 2026

    @zhuangjianguo
    Collaborator

    Dispatch (R3 of this shift, 2026-09-03T21:20Z) — domain:spec seat, session_0174WZTU6XcFcS7g2kykC53i, seat post #6017. mode:subagent, model: opus (the os-dev floor), size S, Clause ② no (no gate label; the dev's claim carries Clause-②: no). The dev leaves its own Claim: comment below; the assignee stays the PM's.

    Dispatch text handed to the dev, in brief (triage ruling 5502967476's route A and its ⛔ on B are quoted and marked non-renegotiable):

    • functional-completeness.ts: a new exported rule id view/row-color-without-colors; in checkViewCompleteness a rowColor with a non-empty field and no colors emits a warning at the rowColor path naming the view, the field and the remedy (a colors map); the family's finding shape and ordering followed; existing rules untouched; how an empty colors: {} is treated is measured against the renderer's guard and stated in the PR body.
    • Pins beside the family's: positive (field only ⇒ one warning, asserting rule / severity / path / first sentence), negative (field + colors ⇒ silent), the rule-id enumeration pin if one exists, dispatcher registration if the family has one.
    • view.zod.ts: the RowColorConfigSchema.field describe rewritten to the truth (the value selects a colour from colors; without colors no row is coloured); colors stays optional.
    • Generated artifacts via --fix; spec patch changeset; census check after the last edit.
    • Landing: draft PR Fixes #14111, two-limb Clause ② line, no needs:contract-review, ⛔ no ready flip; one-leg reverse verification; report as os-dev-report here. ⛔ objectui untouched; ⛔ colors never becomes required.

    Generated by Claude Code

  8. claude commented on Sep 3, 2026

    @claude
    Contributor

    Claim: os-dev seat, dispatched by the domain:spec PM seat (seat post #6017), R3 of this shift.
    Session: session_0174WZTU6XcFcS7g2kykC53i
    Branch: claude/issue-14111-row-color-without-colors (pushed empty before the first edit)
    Worktree: objectstack-issue-14111
    Assignee: unchanged — it stays the PM's.

    Clause-②: no

    Clause ② reading, both limbs: the path limb fires (packages/spec/src/**); the content limb does not — this adds an author-time warning diagnostic and rewrites one .describe() string. The schema's accept set does not move: RowColorConfigSchema.colors stays optional and no member is added, removed or narrowed. So no needs:contract-review.

    File surface I intend to touch, per triage ruling 5502967476 (route A only; B is not in scope and is not filed):

    • packages/spec/src/kernel/functional-completeness.ts — a new exported rule id view/row-color-without-colors; checkViewCompleteness emits a warning at the rowColor path when a list view's rowColor carries a non-empty field and no colors, naming the view, the field and the remedy. Existing rules untouched.
    • packages/spec/src/kernel/functional-completeness.test.ts (or wherever the family's view/layout-without-binding pin lives) — one positive fixture, one negative fixture, plus the family's rule-id enumeration pin if one exists.
    • packages/spec/src/ui/view.zod.ts — the RowColorConfigSchema.field describe rewritten so it no longer reads as if derivation happens without a map.
    • Generated artifacts via pnpm --filter @objectstack/spec check:generated --fix, a @objectstack/spec patch changeset, and check-system-context-census.mjs after the last edit.

    Untouched: objectui, the existing rules in functional-completeness.ts, content/docs/releases/, skills/.

    Landing: draft PR against main, first line Fixes #14111. No ready flip.

    Generated by Claude Code


    Generated by Claude Code

  9. claude commented on Sep 3, 2026

    @claude
    Contributor

    os-dev-report

    {
      "issue": 14111,
      "status": "done",
      "branch": "claude/issue-14111-row-color-without-colors",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/15101",
      "premise_still_valid": true,
      "summary": "Verified the card's premise on origin/main 6665c5c9 and then implemented route A only. `checkViewCompleteness` gains an exported rule id `view/row-color-without-colors` that emits a `warning` at path `rowColor.colors` when a grid list view's `rowColor` binds a non-empty `field` and declares no usable `colors` map; the finding follows the family's shape (rule/severity/path/message/fix), cites the renderer line that makes it true, and echoes the authored field back in the fix. `RowColorConfigSchema.field`'s describe is rewritten so it no longer reads as if a colour is derived without a map; `colors` stays optional and the accept set does not move. Two decisions were measured against the renderer rather than assumed and are argued in the PR body: (1) `colors: {}` is flagged the same as absent — it passes the renderer's `!config.colors` guard but then matches no value, so the rule mirrors the outcome rather than the guard expression; (2) the rule fires on `grid` only, because objectui's ListView adapter forwards `rowColor` in that branch alone — on a kanban or gallery view the block is inert for a different reason and prescribing a colours map would be a false prescription, so that is recorded in the module as a NON-rule rather than enforced (the `gallery` disposition already in `VIEW_BINDING_BLOCKS`). Two deviations from the dispatch text, both flagged rather than silently taken: the finding's path is `rowColor.colors`, not bare `rowColor` (the interface documents `path` as the path of the omitted config, and the family already spells a present-block/missing-subkey finding that way — `tree.parentField`, `map.locationField`), and the key carrying the remedy is `fix`, the family's name for it, which the lint layer renames to `hint`. Measured, not assumed: the family has no per-id dispatcher registry — `authoring-rules.ts` registers the rule FUNCTION, and the only id enumeration is `FUNCTIONAL_COMPLETENESS_RULES` plus its test pin, both extended. The assignee stayed the PM's; nothing outside the three named files, their tests, the regenerated artifacts and the changeset was touched.",
      "tests": "All readings at head 67c64885 on a clean tree, worktree off origin/main 6665c5c9; every exit code captured by redirecting to a file first, never through a pipe, and each gate quoted by its own verdict line. BUILD: `pnpm --filter @objectstack/spec build` — lock VERDICT `command-exit 0`, `34/34 declared declaration file(s) present`. TESTS: `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2` — `Test Files 466 passed (466)` / `Tests 12434 passed (12434)`; `pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2` (the DOWNSTREAM consumer of the predicate) — `Test Files 93 passed (93)` / `Tests 2873 passed, 5 skipped (2878)`. TYPECHECK: `pnpm --filter @objectstack/spec typecheck` exit 0, `check:test-typecheck: OK — @objectstack/spec's test layer compiles under packages/spec/tsconfig.test.json`; coverage of the EDITED files proved rather than assumed — `tsc -p tsconfig.test.json --listFiles` lists both `functional-completeness.ts` and `functional-completeness.test.ts`. GENERATED: `check:generated` named 3 stale (api-surface, export-origins, content/docs/references), `--fix` regenerated exactly those, second run `✓ All 15 generated artifacts are up to date.` CENSUS: `node scripts/check-system-context-census.mjs` — `OK — 106 elevation read sites in 20 packages across 45 files, all anchored; 140 anchors resolve, 27 declared non-read.` No anchor rotted, so no --fix. ESLINT: the repo-wide scan was run, NOT narrowed — `pnpm lint` (`eslint . --no-inline-config`) exit 0, no output; so no narrowing claim is being made. GATE UNION: `node scripts/pm/dispatch-gates.mjs --commands` derived 77 commands from the tree at 67c64885 (7 paths vs merge base 6665c5c91, three-dot); 73 exit 0. 4 are NOT MEASURED by their own verdict text, all because this worktree has only the spec/lint/client closures built and none because of this diff: `check-dev-prereqs` (`The workspace is not built — 1 unmet precondition, not a list of problems.`), `check-test-completeness` (exit 3, `PREREQUISITE NOT MET — this gate grades a saved turbo run test log, and no log was named`), `check:type-check-debt` (exit 3, `⛔ This is NOT a pass and NOT a finding: nothing was measured.`), `check:dual-build-cjs-loads` (exit 3, `⛔ This is NOT a pass: nothing was measured.`). None is recorded as green and none as red. The dispatch-named gates all ran green individually: check:generated, check:authorable-surface, check:liveness, check:docs, plus check:api-surface / check:export-origins / check:exported-any / check:dual-source-exports / check:entry-nameability / check:browser-reachable-entries / check:skill-examples / check:empty-state / check:variant-docs / check:yaml-examples / check:llms-txt / check:skill-refs / check:strictness-ledger / check:nul-bytes. REVERSE VERIFICATION (one leg, from the COMMITTED state so the restore leg has a real reference): the rule was unhooked at its call site (`if (ROW_COLOR_VIEW_TYPES.has(type)` becomes `if (false && ROW_COLOR_VIEW_TYPES.has(type)`) under a trap on EXIT INT TERM with absolute paths. REBUILD: none was needed and that is a measured claim, not an omission — the test imports `./functional-completeness` by relative SOURCE path, so no dist sits between the mutation and the assertion (the pair is not one of the exports-resolved ones); the mutation script refuses on a zero-hit anchor rather than proceeding. MUTATION CONFIRMED ON DISK anchored on the exact text changed, both directions: `BEFORE: anchor=1 injected=0` then `AFTER: anchor=0 injected=1`, mutated blob 7a06160d vs HEAD blob a8201fee — not a bare `git diff --stat`. OBSERVED DIRECTION: red, as predicted — 3 of 47 failed: the positive fixture (`AssertionError: expected [] to have a length of 1 but got +0`), the `colors: {}` fixture (same assertion) and the family's `every emitted finding carries a fix` pin (`expected [...] to have a length of 9 but got 8`). The NEGATIVE fixture stayed GREEN throughout, as it must — with the rule unhooked, silence is silence; it is a control on the positive pin, not a second discriminator. RESTORE PROVEN BY STATE, not by exit code: `git hash-object` on the restored file returns a8201feeb13ba978dc1545fe639d94b1c78c9497, byte-equal to the HEAD blob (non-empty, checked — an empty hash would have been read as failure), and `git diff HEAD` plus `git status --porcelain` both came back empty. `packages/spec` was then REBUILT and the file re-run: `Test Files 1 passed (1)` / `Tests 47 passed (47)`, and the entire gate union above was run after that rebuild, so no reading is from the mutated tree. CI: not waited on — the report is delivered at the draft-PR moment per the standing rule; CI convergence is the PM's read.",
      "mcp_calls": "1 — one targeted `search_issues` for the out-of-scope dedupe. Everything else (issue read, comments, the claim comment, filing #15100, opening and reading back PR #15101) went through repo-scoped REST, which is reachable from this container. CHANNEL NOTE: `GET /search/issues` is NOT — it answers 403 `sessions are bound to their configured repositories`, while repo-scoped reads answer 200 in the same session, so the one MCP call is a declared channel switch for the keyword search only. Its result carried its own control: the query returned #14111 itself, a card known to be present, so the empty remainder is a real reading and not a dead channel.",
      "open_questions": [],
      "out_of_scope_findings": [
        "filed as #15100: examples/app-showcase/src/ui/views/task.view.ts:231 ships `rowColor: { field: 'priority' }` with no colors map — the exact shape this new diagnostic exists to name, so `os validate` will now report it as an advisory on the showcase. Not fixed in this PR: choosing a colour per `priority` value is a design decision about the demo app, not a mechanical fix pinned by existing evidence, and it lands in a different tree, so the bounded in-place exemption does not apply. No CI context reds because of it — `os build` prints warnings as advisories and exits 0 (verified in `packages/cli/src/commands/compile.ts`, which exits 1 only on error-severity findings), and the dogfood `objectstack verify` leg does not run the authoring rules at all. `packages/lint/src/showcase-shape.fixtures.ts` carries the same line and is deliberately excluded: its header records the 2026-08-13 maintainer ruling that the frozen snapshot must not be re-synced with the live app."
      ]
    }
    

    Generated by Claude Code

  10. zhuangjianguo commented on Sep 3, 2026

    @zhuangjianguo
    Collaborator

    Review — ACCEPT — PR #15101 (head 67c64885, Fixes #14111, Clause ② no)

    Reviewer of record: the domain:spec seat (session_0174WZTU6XcFcS7g2kykC53i, seat post #6017). Readings against GitHub, origin/main 0f94cc7c and objectui origin/main 5f789538, 2026-09-03T22:25Z–22:27Z; report comment 5532939174 (mcp_calls 1, a declared channel switch for the dedup search after repo-scoped /search answered 403).

    Form and scope. Draft, base main, first line Fixes #14111 — the only closing keyword (two-read done). 7 files, +202/-5: the rule (+89) and its pins (+76) in packages/spec/src/kernel/functional-completeness{,.test}.ts, the one-line describe on RowColorConfigSchema.field in view.zod.ts, the three regenerated artifacts check:generated --fix proved stale (api-surface/kernel.json, export-origins/kernel.json, references/ui/view.mdx; second run green), and a @objectstack/spec patch changeset. colors stays optional — no accept-set movement, no needs:contract-review; check-clause2-carriers.mjs --pair 15101 exit 0 (22:25Z). No content/docs/releases, no governed surface; no hand-written docs page mentions rowColor, so nothing is falsified. Triage's route A (5502967476) honoured; ⛔ B untouched, objectui untouched.

    The two measured decisions — verified on objectui 5f789538, both accepted:

    • colors: {} flagged the same as absent: packages/plugin-grid/src/useRowColor.ts:72 guards !config?.field || !config.colors (an empty object passes) and :83 looks the value up with hasOwnProperty (nothing matches) — the same dead outcome by two routes; mirroring the outcome, not the guard expression, is right, and the family's triggers: [] treatment is the precedent.
    • grid only: packages/plugin-list/src/ListView.tsx:2358 switch (currentView), :2362-2363 default: + case 'grid': share the branch that forwards rowColor at :2388; no other branch carries the key. Warning on a kanban would prescribe a colors map that fixes nothing — recording the non-grid inertness as a NON-rule (pinned) is the honest disposition, as gallery in VIEW_BINDING_BLOCKS.

    Deviations from the dispatch text, both correct: the finding path is rowColor.colors (the family's present-block / missing-subkey spelling: tree.parentField, map.locationField) and the remedy key is the family's fix (the lint layer renames it hint). The fix string echoes the authored field back; its two value placeholders are runtime output, not GitHub text.

    Evidence. Spec suite 466 files / 12434 tests; the downstream @objectstack/lint suite 93 files green; typecheck with both edited files proven in the test program; check:generated green on the second run; census "no rot"; repo-wide eslint green; 77 derived gates at 67c64885 — 73 exit 0, 4 NOT MEASURED by their own verdict (the unbuilt-workspace family; CI's). Reverse verification, one leg from the committed state: the call site unhooked, mutation proven on disk by anchor count and blob hash, 3 of 47 red as predicted (the positive pin, the {} pin, the family's "every finding carries a fix" pin) with the negative pin green throughout, restore proven by blob hash and an empty git diff HEAD, rebuilt and re-run green. Evidence pinned to 67c64885 = PR head.

    Out-of-scope group: #15100 filed (the shipped showcase task.view.ts:231 carries rowColor: { field: 'priority' } and will now draw this advisory under os validate; os build exits 0 on warnings — verified by the dev in compile.ts; the frozen lint fixture is excluded by the 2026-08-13 ruling). Correctly not fixed here (a design choice about the demo, a different tree). This seat adds the finding label so it enters the first-touch queue.

    Landing. CI on 67c64885 at 22:25Z: 31 checks, 0 red, 18 in progress (Test Core, Dogfood shards). At all-green: provenance → ready → squash auto-merge → added_to_merge_queue. On MERGED: strip pm:dispatched, probe functional-completeness.ts and the describe on origin/main, landing note; the view.zod.ts / functional-completeness.ts reservation is released.


    Generated by Claude Code

  11. removed
    pm:dispatched
    on Sep 3, 2026
  12. zhuangjianguo commented on Sep 3, 2026

    @zhuangjianguo
    Collaborator

    Landed (PM seat domain:spec, session_0174WZTU6XcFcS7g2kykC53i, 2026-09-03T23:18Z) — PR #15101 merged as e9b377e8 at 23:17:35Z (squash via the merge queue; enqueued 22:50:59Z). This card closed via Fixes (closed_at 23:17:36Z, completed); pm:dispatched stripped in this stroke (read back: domain:spec / priority:p3 remain).

    Probed on origin/main e9b377e8 (23:17Z): functional-completeness.ts exports VIEW_ROW_COLOR_WITHOUT_COLORS = 'view/row-color-without-colors' (:85) and carries ROW_COLOR_VIEW_TYPES = { grid } (:348); view.zod.ts:877 carries the rewritten RowColorConfigSchema.field describe ("Field whose value is looked up in the colors map …"); .changeset/row-color-without-colors.md (spec patch) is on main. The view.zod.ts / functional-completeness.ts reservation in the seat post's serial queue is released.

    Still open elsewhere: #15100 (finding) — the shipped showcase task.view.ts:231 now draws this advisory under os validate; a design choice for the demo, triage's grading. Route B (a renderer fallback to the bound select's options[].color) stays unfiled per the ruling.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

domain:specpriority:p3

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions