Skip to content

fix(assess): dashboard silently replaced by prose, and every table example is misaligned — render via CLI subcommand instead of hand-drawn ASCII #823

Closed

Description

@admarble

Summary

/assess output fails in two ways, both recurring:

  1. The formatted output block is silently replaced by a prose summary — no table, no Commands: block, no annotations, no HTML markers.
  2. When the table is rendered, columns and label gutters are misaligned — because the skill's own examples are misaligned and every rendering copies the drift.

Both defects share one root cause: the model is asked to do deterministic formatting work by hand. The fix is to move rendering into code and leave the model doing judgment (triage verdicts) only.

The template is not damaged. skills/assess/SKILL.md, .claude/skills/assess/SKILL.md, and templates/skills/assess/SKILL.md are md5-identical and still carry the full ## Output Format spec plus a 17-item verification checklist. Nothing was deleted — nothing forces the block to be emitted, and the geometry it should be emitted at is never actually specified.


Evidence

Defect 1 — the output block is skipped

A five-issue batch (assess 804 817 818 819 820) produced:

Steps 1-5 analysis (tool calls)
  → AskUserQuestion "Post these assessments as comments?"
  → "Assessment complete — nothing posted."
  → "TLDR: all five issues are PROCEED ..."   (prose paragraph)

No table, no Commands: block, no Order: / ⚠ / Flags:, no <!-- assess:action=... --> markers. All specified; all omitted. Note the question came first — that inversion is the detectable symptom.

Why nothing caught it:

  • The Assessment Process is imperative from ### Step 1 (skills/assess/SKILL.md:56) through ### Step 5 (:209), then stops at :234. Rendering lives in ## Output Format (:238) — a descriptive section, not a step. Completing Step 5 completes the documented procedure.
  • The only ordering statement is a subordinate clause 435 lines later, at ## Persist Analysis (:673): "After displaying output, prompt the user to save..." — the weakest possible placement for a mandatory step.
  • ## Output Verification (:776) verifies properties of a table ("Every issue has exactly one action in the table", "Run column uses correct symbol"). All 17 items pass vacuously when no table exists. None assert that it exists.

Defect 2 — misalignment

skills/assess/SKILL.md:244 currently instructs:

"Column widths should adapt to content — do not force a fixed table width."

That requires measuring the longest cell and padding every row to match — the same arithmetic that got box-drawing removed in #494. The prohibition survived for borders; the identical requirement was left in place for columns.

Measured start column of the Run field across every dashboard example (east-asian-width aware):

Block Header Data rows Distinct offsets
:246 (normative template) 60 61, 61 2
:344 (main batch example) 53 54, 55×6, 56 4
:394 (ACs-column example) 54 55, 55 2
:423 53 55, 55, 55 2
:444 (13-issue example) 58 60×13 2
:710 (dashboard-vs-comment) 53 55 2

Every block has its header offset from its own data rows. The normative template at :246 — the one that must be exact — is off by one. From :345-347, three lines with three different Run columns:

 #    Action     Reason                              Run
 462  PARK       Manual measurement task              ‖
 461  PROCEED    Exact label matching                  spec → exec → qa

Label gutters drift too: the Flags: value column sits at 24 (:264), 34 (:369-371), 24 (:412), and 9 (:720) — four different offsets. Commands: inline comments at 45 (:254) vs 46 (:359-360). Cleanup: is consistent at 39.

Separators are not part of this defect — all 45 are exactly 64 characters.

Examples are the strongest signal in a prompt. Fixing the render gate without fixing geometry yields a dashboard that reliably appears and reliably looks ragged.


Why prompt-level enforcement is the wrong lever

#22 already tried it, and this is its recurrence. "Skill output reliability: validation layers, schemas, and structured logging" (closed COMPLETED 2026-01-08) opens with: "Skills like /solve don't consistently follow their instructions. For example, /solve 12 sometimes omits the sequant run CLI command even though it's specified in the skill." Same failure, same skill lineage (/solve → /assess).

#22 proposed four layers and its validation matrix assigns /assess: Checklist ✓ · Hook ✓ · Schema ✓. Only Layer 1 shipped — the "Output Verification / DO NOT respond until verified" checklist, which is verbatim what sits at :776 today and which did not fire. The hook and schema layers were specified for /assess and never built.

Hardening the checklist again would be applying more Layer 1 to a Layer 1 failure.

Deterministic formatting is a solved problem in this repo — just not with the helpers that look closest. src/lib/cli-ui.ts exposes table(), box(), divider(), and sectionHeader(), but none are usable here (see "Why not the existing terminal UI" below). The reusable piece is the string-width dependency and the precedent set by src/lib/cli-ui/format.ts — a zero-import module of pure deterministic string formatting. The alignment defect persists because the skill hand-draws ASCII rather than calling code of that kind.

Existing anti-pattern to correct. src/lib/assess-collision-detect.ts is cited in the skill (:219) as "the detector lives at… and exposes three pure functions", but the skill never executes it — the model reimplements the logic in-context from prose. (The module is imported by src/lib/workflow/chain-preflight.ts:33, so it is not dead code — it is simply never reached from the skill.) TS-module-as-documentation rather than implementation is the pattern this issue corrects.


Design

Make rendering a tool call rather than text the model writes. A tool call either happened or it did not — observable, and it removes all arithmetic from the model.

Delivery: a CLI subcommand, not a scripts/ shell-out

This distinction determines whether end users get the fix. skills/spec/SKILL.md:78 establishes the constraint:

"Guard: Only run npx tsx blocks if ./src/lib/ac-parser.ts exists (sequant repo). Otherwise, perform all analysis inline by reading the issue text directly."

A scripts/ shell-out therefore works only in this repo — end users fall back to inline and stay broken. A subcommand ships via package.json bin (sequant → dist/bin/cli.js, files: ["dist", ...]) and is present for every sequant user by definition. Assess Step 1 already probes CMD_PREFIX (global sequant vs npx sequant), so this introduces no new user-facing concept.

Flow

Steps 1-5 (unchanged)  →  build AssessResult JSON
                             ↓
                       sequant <render-subcommand> <file>
                             ↓  (padding computed, not counted)
                       aligned dashboard + markers, pasted verbatim
                             ↓
                       Persist Analysis (unchanged)

Expected output

Produced by a prototype renderer against the five-issue batch that failed, so the alignment below is machine-generated rather than hand-drawn. The Run column start offset is identical across the header and all five rows; long workflow values print in full rather than clipping.

 #    Action     Reason                        Run
 820  PROCEED    CI billing-lockout misclassi… spec → exec → qa
 819  PROCEED    Shared trust-model block      spec → security-review → exec → qa
 818  PROCEED    merge --watch, kills polling… spec → exec → qa
 817  PROCEED    run --ready-gate              spec → exec → qa
 804  PROCEED    Unblocked — #782 closed       spec → exec → qa
──────────────────────────────────────────────────────────────────────────────
Commands:
  sequant run 820 819 818 817 804 -Q
──────────────────────────────────────────────────────────────────────────────
Order: 820 → 819 (both edit qa/loop skill files)
Order: 820 → 817 (ready-gate would auto-loop on the CI
                  misclassification 820 fixes)

⚠ #804  "Blocked by #782" is stale — #782 closed completed

Flags:
  -Q                          9+ ACs or multi-file scope
  --security-review           #819 prompt-injection hardening
──────────────────────────────────────────────────────────────────────────────
Cleanup:
  gh issue edit 804 --add-label enhancement,cli   # no labels
──────────────────────────────────────────────────────────────────────────────

The ACs-column variant renders with the same Run offset, so the two table forms stay visually interchangeable.

Why not the existing terminal UI

sequant run already has a renderer, so reusing it is the obvious first instinct. It is the wrong tool, for reasons worth recording so this is not re-litigated:

Different medium. The run TUI owns a live TTY, repaints in place, and is ephemeral. Assess output is a static artifact: it lands in the chat transcript and is posted to GitHub by the Persist step via gh issue comment, then re-parsed later by src/lib/assess-comment-parser.ts. It must be byte-stable, ANSI-free, and copy-pasteable. log-update repaint is meaningless against captured stdout, and ANSI escapes in a GitHub comment are corruption.

The helpers self-disable off a TTY. From src/lib/cli-ui.ts:

export function box(content, style) {
  if (config.jsonMode) return "";
  if (!shouldShowDecorative()) return content;   // returns UNBOXED content
}
// shouldShowDecorative() === !config.jsonMode && !config.minimal && config.isTTY

The renderer is invoked from a Bash call, so stdout is a pipe and config.isTTY is false. box() would silently return unboxed content and jsonMode would return an empty string — output whose shape depends on invocation context, which is the exact non-determinism this issue removes.

table() is doubly wrong. It injects chalk.cyan.bold() headers and gray borders (ANSI), and delegates to cli-table3, which draws its own | + - bordered grid — not the separator format this issue targets.

The run renderer carries the wrong baggage. src/lib/cli-ui/run-renderer.ts imports chalk and log-update, backed by scrollback-harness.ts and dedicated regression suites for frame stability (run-renderer-624.test.ts) and the in-place phase matrix (run-renderer-672.test.ts). Its corruption history — #624, #647, #655, #672 — is in the same bug class this issue is trying to eliminate.

Conclusion: share the string-width dependency and nothing else. Model the new module on src/lib/cli-ui/format.ts, which has zero imports and is pure deterministic string formatting.

Measured cost

Value
CLI startup, warm (sequant --version ×5) 0.23–0.24s
Typical assess batch run ~1m45s
Renderer overhead ~0.2% of one run
## Output Format prompt cost today (:238-653) 416 lines / 24KB — 48% of the 797-line skill

Net effect is cheaper per invocation: ~250ms added, most of a 24KB formatting spec removed from every assess prompt.


Acceptance Criteria

Schema and renderer

  • A schema module defines the AssessResult shape covering issues, actions, ACs count, reasons, run symbols, order annotations, warnings, chain suggestion, flags, cleanup commands, and resolved command prefix.
  • The schema validates input and fails with an actionable error message naming the offending field when given malformed data.
  • A renderer module converts a validated AssessResult into the batch dashboard, computing all column padding programmatically with no hand-authored offsets.
  • The renderer is a pure module with no dependency on chalk, boxen, cli-table3, log-update, or any TTY-detection state, so its output is byte-identical whether stdout is a terminal or a pipe.
  • The renderer does not reuse cli-ui.ts's table() / box() / divider() / sectionHeader() helpers, which emit ANSI via chalk, gate on config.isTTY / config.jsonMode, and in table()'s case draw a cli-table3 bordered grid — all wrong for output destined for a GitHub comment.
  • The renderer reuses the existing string-width dependency for width calculation rather than hand-rolling east-asian width handling.
  • The rendered output contains no ANSI escape sequences, verified by a test asserting the output matches a plain-text-only pattern.
  • Column width calculation is east-asian-width aware so wide characters in reasons or titles do not shift the Run column.
  • The Run column value is never truncated; rows may overflow past the separator width so long workflows such as spec → security-review → exec → qa print in full.
  • Only the Reason column truncates, with a trailing ellipsis at a word boundary where possible.
  • The target layout keeps typical rows within roughly 80 columns, with the Run column start offset documented in the renderer as the single source of truth.
  • The renderer emits both table variants (with and without the ACs column) with the Run column starting at the same offset in each.
  • The renderer honours the existing Section Visibility Rules, omitting Order: / ⚠ / Chain: / Flags: / Cleanup: sections and their adjacent separators when empty.
  • The renderer emits the HTML marker block for every assessed issue.
  • The renderer supports single-mode output, emitting the correct verdict template for PROCEED, CLOSE, CLARIFY, PARK, MERGE, and REWRITE.
  • All separator lines emitted by the renderer are exactly 64 characters and no box-drawing border characters are introduced.

CLI surface

  • A sequant subcommand accepts a path to an AssessResult JSON file and prints the rendered output to stdout.
  • The subcommand is registered in bin/cli.ts via .command() and appears in help output only if intended as user-facing, otherwise is documented as internal.
  • The subcommand exits non-zero with a readable error when the input file is missing, unreadable, or fails schema validation.
  • The subcommand is verified to work from an installed package (via the dist build) and not only from the development repo.

Skill integration

  • skills/assess/SKILL.md gains a ### Step 6: Render Output at the end of the Assessment Process instructing the model to build the JSON, invoke the renderer, and paste its stdout verbatim.
  • Step 6 states that the rendered block is emitted before any prose, preamble, or AskUserQuestion, and that a narrative or TLDR summary never satisfies the step.
  • Step 6 uses the Step-1 CMD_PREFIX for the renderer invocation, consistent with how sequant run commands are emitted.
  • Step 6 defines a degraded fallback: if the renderer invocation fails, the model emits the dashboard by hand from the documented format and reports the failure, never substituting prose.
  • ## Persist Analysis opens with an explicit precondition that Step 6 has already emitted the output block, replacing the "After displaying output," subordinate clause at line 673.
  • ## Output Verification gains as its first item a check that the response opens with the rendered output block rather than a summary, preamble, or question.
  • The ## Output Format section is reduced to the schema, one worked example, and the semantic rules (run symbols, action vocabulary, visibility rules), with hand-drawn geometry guidance removed.
  • The "Column widths should adapt to content — do not force a fixed table width" instruction at line 244 is removed, since width is no longer the model's concern.
  • The reduction in ## Output Format is measured and reported in the PR, with the before figure being 416 lines / 24KB.

Tests

  • Snapshot tests cover the batch dashboard with and without the ACs column, and every single-mode verdict template.
  • A test asserts the alignment invariant directly: for any rendered table, the Run column start offset is identical across the header and all data rows.
  • A test covers a reason string long enough to require truncation and asserts the Run column does not shift.
  • A test covers wide/east-asian characters in a reason field and asserts alignment holds.
  • Tests cover section omission so that absent warnings, chain, flags, and cleanup produce no orphaned separators.
  • Schema validation tests cover a valid payload, a missing required field, and a malformed action value.
  • Any dashboard examples remaining in SKILL.md are generated from renderer output rather than hand-edited, so they cannot drift from the implementation.

Distribution

  • All skill changes are mirrored identically across skills/assess/SKILL.md, .claude/skills/assess/SKILL.md, and templates/skills/assess/SKILL.md, verified by matching md5 and by npm run lint:skill-sync.
  • A CHANGELOG entry is added describing the behaviour change.

Deferred follow-up (do not scope into this issue)

Stop-hook enforcement (#22's Layer 3). A Stop hook asserting the marker block is present in the response would close the adherence gap completely, but it is deliberately deferred:

  • Sequant ships no Stop hook today (templates/hooks/ contains only pre-tool.sh, post-tool.sh, relay-check.sh), so this means a new hook type plus a settings.json merge for every user.
  • A blocking hook that false-positives is worse than the defect it prevents.
  • Once rendering is a tool call, a skipped render is already visible in the transcript, so the hook's marginal value drops.

File it only if recurrence is measured after this issue ships — with evidence rather than assumption.

Non-goals

Prior art

Activity

  1. added
    bug
    cli
    complex
    on Jul 27, 2026
  2. admarble commented on Jul 27, 2026

    @admarble
    ContributorAuthor

    Plan (/spec)

    Complexity: Complex — 38 ACs, 7 directories, complex label.

    Scope verdict

    performScopeAssessment returns SCOPE_SPLIT_RECOMMENDED (feature count 4 / AC items 38 / directory spread 7 — all red). Recommending override — proceed as one issue.

    The detector counts facets, not features. Schema → renderer → CLI → skill are sequential layers of one change and none ships alone: the skill edit is inert without the subcommand, the subcommand is inert without the renderer, the renderer is untestable without the schema. 24 of the 38 ACs are single-assertion test/invariant statements. Real surface: 2 new modules + 1 CLI registration + 1 skill file (x3 mirrors) + 2 test files.

    AC quality

    lintAcceptanceCriteria: 1/38 flagged.

    • AC-9 — "long workflows such as ..." reads as an open-ended list. Non-blocking; the invariant ("Run is never truncated") is measurable regardless.

    Note: extractAcceptanceCriteria returned 0 — the ACs are bare - [ ] lines without AC-N: prefixes, so the line-anchored parser cannot see them. Mapped to sequential AC-1..AC-38 in body order for tracking.

    Geometry (measured, not assumed)

    Measured the prototype block in the issue body with string-width: the Run column starts at column 47, uniformly across the header and all five rows. Adopting 47 as the documented single-source-of-truth constant.

    Constant Value Note
    RUN_COL 47 measured from the issue's prototype
    issue field col 1, width 4 -> Action at 6
    Action width 10 -> Reason at 17 (no-ACs variant)
    ACs width 3 @ col 17 -> Reason at 21 (ACs variant)
    Reason width RUN_COL - reasonStart - 1 29 / 25 — absorbs the ACs column so RUN_COL is invariant (AC-12)
    separator 64 AC-16
    label gutter 30 matches prototype Flags: / Commands:

    Implementation plan

    Phase 1 — Schema + renderer (AC-1..AC-16)

    1. src/lib/assess/types.ts — zod AssessResultSchema + parseAssessResult() rethrowing with the offending field path. Mirrors src/lib/scope/types.ts.
    2. src/lib/assess/renderer.ts — pure module, string-width its only import. Modeled on src/lib/cli-ui/format.ts. Exports renderBatch() / renderSingle() / render().
    3. src/lib/assess/index.ts — barrel.

    Phase 2 — CLI surface (AC-17..AC-20)
    4. Register assess-render <file> in bin/cli.ts via .command(), hidden from top-level help, described as internal. Read -> validate -> render -> stdout; non-zero exit with readable stderr on ENOENT / bad JSON / schema failure.
    5. Verify through the built dist bin entry, not only tsx.

    Phase 3 — Skill rewrite (AC-21..AC-29)
    6. Add ### Step 6: Render Output at the end of the Assessment Process (Step 5 currently ends at :234): build JSON -> temp file -> $CMD_PREFIX assess-render <file> -> paste stdout verbatim, before any prose or AskUserQuestion, with a hand-render fallback on failure.
    7. Reduce ## Output Format (currently :238-653, 416 lines / 24KB) to schema + one renderer-generated example + semantic rules (run symbols, action vocabulary, visibility rules). Delete the width instruction at :244.
    8. Rewrite the ## Persist Analysis opener (:673) as an explicit Step-6 precondition; add "response opens with the rendered block" as item 1 of ## Output Verification (:776).
    9. Regenerate remaining SKILL.md examples from renderer output (AC-36) — must run after the renderer is green. Mirror to all 3 dirs; verify md5 + npm run lint:skill-sync.

    Phase 4 — Tests + distribution (AC-30..AC-38)
    10. renderer.test.ts — snapshots (both variants, all 6 verdicts), alignment invariant, truncation, CJK, section omission. types.test.ts — schema validation trio.
    11. CHANGELOG entry; report the ## Output Format before/after delta in the PR.

    Design review

    1. Where it belongs: src/lib/assess/ — a sibling of src/lib/scope/, deliberately not src/lib/cli-ui/. That namespace is TTY-coupled by convention (chalk, log-update, config.isTTY); putting a deliberately TTY-free module there invites someone to later wire it to shouldShowDecorative(). The directory boundary encodes the constraint.
    2. Simplest correct approach: two modules plus one .command(). Rejected: reusing cli-ui.table() (emits ANSI + a cli-table3 grid); a scripts/ shell-out (works only in this repo per the spec/SKILL.md:78 guard, so end users stay broken); a Stop hook (explicitly deferred by the issue).
    3. Pattern followed: src/lib/scope/ for schema-module + barrel; src/lib/cli-ui/format.ts for zero-import pure formatting; assess-collision-detect.ts as the anti-pattern being corrected.
    4. Reviewer pushback anticipated: "Won't the skill just skip Step 6 too?" — weaker but not zero. A missing Bash call is visible in the transcript where a missing paragraph is not, and Step 6 sits inside the imperative Process section rather than a descriptive one, which is the exact structural defect this issue diagnoses. Full closure needs the deferred Stop hook.

    Verified AC-5's premise: cli-ui.ts:390 box() and :461 table() both gate on shouldShowDecorative() (:79), which includes config.isTTY. The AC's reasoning holds.

    Gaps and concerns

    • AC-16 contradicts the issue's own prototype block. AC-16 mandates 64-char separators; the "Expected output" block measures 78. Implementing 64 (AC text is normative; the prototype was throwaway) rather than silently picking one. Cosmetic, one constant, snapshots regenerate. Note 64 < the 81-col widest row, so rows deliberately overflow the separator — which AC-9 explicitly sanctions.
    • AC-27 has a cross-reference hazard. ## Persist Analysis delegates to the #### PROCEED / #### CLOSE / ... anchors ("Reference these templates rather than re-copying their bodies here — they are the single source of truth"). Deleting those ASCII templates breaks that contract. Handled by repointing Persist at the renderer's single-mode output — flagged so it is not read as unplanned scope.
    • AC-36 is self-referential — SKILL.md examples must be generated from renderer output, so step 9 runs after the renderer is green, not alongside step 7.

    Derived ACs

    Source Derived AC Priority
    Regression safety AC-39: a test feeds renderer output back through assess-comment-parser.parseAssessComment and asserts markers round-trip High
    AC-27 fallout AC-40: ## Persist Analysis cross-references still resolve after the Output Format reduction — no dangling anchors Medium

    Open questions

    1. Separator width 64 (AC-16) or 78 (prototype)? — Proceeding with 64. One constant; trivial to flip.
    2. Hide the subcommand from --help? — Proceeding with hidden, since AC-18's phrasing treats visibility as an assertion of user-facing intent and this is a skill-internal surface. assess-render --help still works.
    3. Subcommand name — assess-render. Reads consistently with merge --check / state rebuild.

    Recommended workflow

    Phases: spec -> exec -> qa
    Quality loop: enabled (auto — complex label, AC count red)
    Reasoning: no UI surface, so no /test. testgen is warranted in principle by AC-30..AC-35, but /fullsolve runs spec -> exec -> qa and exec authors those tests directly against ACs it already holds; inserting testgen would generate stubs the same phase then rewrites.

    Labels

    Current bug, cli, complex — unchanged. Accurate, and complex correctly auto-enables the quality loop.

  3. added
    planned
    on Jul 27, 2026
  4. admarble commented on Jul 27, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #823

    Reviewed inline (no sub-agents) — QA agents hallucinate on worktree code, and the substantive half of this diff is prose whose correctness is not mechanically checkable.

    AC Coverage

    Issue ACs are bare - [ ] lines without AC-N: prefixes, so extractAcceptanceCriteria returns 0. Mapped to sequential AC-1..AC-38 in body order.

    Schema and renderer

    AC Status Evidence
    AC-1 schema covers all 11 named elements MET issues/action/acCount/reason/run/orders/warnings/chain/flags/cleanup/commandPrefix — 11/11 present in types.ts
    AC-2 actionable error naming the field MET issues[0].action: Invalid option: expected one of "PROCEED"|...; verified through dist
    AC-3 padding computed, no hand-authored offsets MET one authored constant (RUN_COL), all offsets derived — see divergence note 2
    AC-4 pure, byte-identical TTY vs pipe MET only imports are string-width + local types; test flips process.stdout.isTTY and asserts equality
    AC-5 does not reuse cli-ui.ts helpers MET grep for chalk|boxen|cli-table3|log-update|isTTY|jsonMode|cli-ui across src/lib/assess/ + the command: matches are comments only
    AC-6 reuses string-width MET renderer.ts:31
    AC-7 no ANSI, plain-text pattern test MET asserts !includes(ESC) and a plain-text-only regex
    AC-8 east-asian-width aware MET CJK reason test; mixed-width row test
    AC-9 Run never truncated MET 51-char workflow prints in full; row width 81 > separator 64
    AC-10 only Reason truncates, word boundary where possible MET boundary and mid-word cases both tested
    AC-11 ~80 cols, offset documented MET 8 generated rows: min 48, max 81; one row at 81 is the sanctioned AC-9 overflow
    AC-12 same Run offset in both variants MET asserted as a set equality across both tables
    AC-13 section visibility + adjacent separators MET all-clear renders 2 separators; zero-section case renders 0
    AC-14 marker per assessed issue MET batch emits one compact marker per issue
    AC-15 all six verdict templates MET snapshot per verdict
    AC-16 separators exactly 64, no box-drawing MET set equality on separator widths + negative assertion on box chars

    CLI surface

    AC Status Evidence
    AC-17 subcommand reads JSON file, prints to stdout MET sequant assess-render <file>
    AC-18 registered via .command(), help behavior MET registered in bin/cli.ts; hidden from top-level help (0 matches), documented internal in the description + module header
    AC-19 non-zero on missing/unreadable/invalid MET 5 failure paths each exit 1, happy path exits 0 — measured without a pipe
    AC-20 works from the installed package MET run through node dist/bin/cli.js, not just tsx

    Skill integration

    AC Status Evidence
    AC-21 ### Step 6: Render Output at end of Assessment Process MET line 236, after Step 5, inside the imperative section
    AC-22 block before prose/preamble/AskUserQuestion; TLDR never satisfies MET stated literally in Step 6 ¶1 and again under Ordering
    AC-23 uses Step-1 CMD_PREFIX MET $CMD_PREFIX assess-render "$ASSESS_JSON"
    AC-24 degraded fallback, never prose MET names the ⚠ assess-render failed: line and mandates hand-render
    AC-25 Persist opens with Step-6 precondition MET replaces the "After displaying output," clause
    AC-26 Output Verification first item MET new item 1
    AC-27 reduced to schema + one worked example + semantics MET see "AC-literal correction" below — this initially had two
    AC-28 line-244 width instruction removed MET grep returns nothing
    AC-29 reduction measured and reported in PR MET 416/24,068 → 199/13,670 (−52% lines, −43% bytes); baseline matches the issue's stated figure exactly

    Tests

    AC Status Evidence
    AC-30 snapshots: both variants + all six verdicts MET 8 snapshots
    AC-31 alignment invariant asserted directly MET measures Run offset on header + every row
    AC-32 truncation doesn't shift Run MET
    AC-33 wide/east-asian alignment MET
    AC-34 section omission, no orphaned separators MET includes a 6-combination sweep asserting no consecutive separators
    AC-35 valid / missing field / malformed action MET plus unknown-key and verdict-specific cases
    AC-36 examples generated, cannot drift MET see below — needed more than regeneration

    Distribution

    AC Status Evidence
    AC-37 three mirrors identical MET md5 ce17f8a4... ×3; lint:skill-sync 42/42
    AC-38 CHANGELOG entry MET [Unreleased] → Fixed, includes (#823)

    Derived (from spec)

    AC Status Evidence
    AC-39 markers round-trip through assess-comment-parser MET see boundary note below
    AC-40 no dangling cross-references after the reduction MET grep for #### PROCEED etc. returns nothing; the three remaining anchor links all resolve

    Coverage: 40/40 met.


    AC-literal correction found during review

    AC-27 says Output Format reduces to "the schema, one worked example, and the semantic rules." My first pass left two — the batch dashboard plus a single-mode PROCEED block. The second was also a verbatim duplicate of the posted comment already shown under ## Persist Analysis: two copies to keep in sync, which is the exact drift this issue removes.

    Fixed in 4778732 rather than rationalized as "reasonable." Replaced with a cross-reference. This also improved the reduction from −47% to −52% lines.


    AC-36 needed more than regeneration

    "Generated from renderer output so they cannot drift from the implementation" — regenerating once satisfies the first clause, not the second. Added skill-examples.test.ts:

    • each example with a known payload must appear in SKILL.md byte for byte as the renderer produces it (payloads live in the test, so adding an example means adding its payload);
    • a structural scan across all three mirrors asserting every dashboard row sits at RUN_COL, every separator is 64, and no box-drawing appears — this catches examples added later whose payloads live nowhere.

    Mutation-tested, not assumed. Shifting one data row by a single space — the exact #823 defect — fails 2 tests. Widening one separator to 78 fails 2 tests.

    Regenerating also surfaced live evidence for the issue's premise: 2 of the 3 examples in "dashboard vs posted comment" had already drifted from renderer output.


    CI Status

    Check State
    build (22.x), typecheck, node-floor-guard SUCCESS
    validate-skills, validate-plugin, Plugin Structure Validation SUCCESS
    Hooks Validation, Setup Directory Creation SUCCESS

    8 passed, 0 pending, 0 failed. mergeable: MERGEABLE, 0 commits behind main.

    Quality Metrics

    Metric Value Status
    Type issues (any) added 0 OK
    Deleted tests 0 OK
    Files changed 13 OK
    Lines +2,670 / −1,092 OK (−1,092 is the Output Format reduction ×3 mirrors)
    Full suite 4,188 passed / 0 failed / 201 files OK
    src/lib/assess/ 108 tests OK
    eslint --max-warnings 0 clean OK

    Test Coverage Analysis

    Changed file Tier Has tests
    src/lib/assess/renderer.ts Standard Yes — renderer.test.ts, skill-examples.test.ts
    src/lib/assess/types.ts Standard Yes — types.test.ts
    src/commands/assess-render.ts Standard Covered by dist-level smoke tests (6 exit-code paths), not unit tests
    bin/cli.ts Standard Registration verified via --help on source and dist

    Gap, stated plainly: assess-render.ts has no unit test. It is 60 lines of read → parse → render → print with three catch arms, all six paths exercised against the built artifact. A unit test would mock readFile and assert the same three branches — I judged the dist-level check the stronger evidence, but it is a real coverage gap rather than an absence of risk.

    Smoke Test

    Test Command Result
    Happy path (batch) assess-render <6-issue payload> Aligned dashboard, exit 0
    Happy path (single) assess-render <PROCEED payload> Correct template, exit 0
    Missing file assess-render /nope.json cannot read + ENOENT, exit 1
    Directory assess-render /tmp cannot read + EISDIR, exit 1
    Malformed JSON assess-render bad2.json position-annotated parse error, exit 1
    Schema violation assess-render bad3.json names issues[0].reason and the reasonn typo, exit 1

    Status: Complete.

    Skill Command Verification

    The only new executable command in the skill is $CMD_PREFIX assess-render "$ASSESS_JSON", verified above from both tsx and dist. Other commands in the diff (gh issue close/edit) are illustrative example output with unchanged semantics.

    Status: Passed.

    Detection Pattern Verification

    Omitted — hard precondition false. Zero added skill-markdown lines contain grep/awk/jq/sed literals (checked per-mirror against diff hunks, not file content).

    Adversarial Re-Read

    Five things I went looking for:

    1. alignedBlock returns -Infinity on an empty array (Math.max(...[])). Traced all four call sites — every one is guarded by a .length check or a non-empty literal. Not reachable, but it is a latent footgun for a future caller and I'm recording it rather than calling it clean.
    2. Batch markers do not parse. parseAssessMarkers("<!-- #462 assess:action=PARK -->") returns {}; the single form returns {action:"PARK"}. ASSESS_HTML_MARKER_PATTERN requires assess: immediately after <!--. This is pre-existing and by design — the compact form is chat-only and the skill forbids posting it — but the renderer now generates that form, so anyone who posts a dashboard gets markers invisible to the parser. AC-39's round-trip test is correctly scoped to single mode.
    3. Non-goals audit. Box-drawing: negative assertion in tests. IA redesign: columns, run symbols, action vocabulary, section set all unchanged. Posted-comment format: structure identical to the old template — but the Flags: gutter moved, from a hand-written 5 spaces to a computed one. Calling that out rather than burying it: the issue documents four different Flags: offsets (24/34/24/9) in the old file, so making it deterministic is the intent, not scope creep.
    4. Evidence claims. Every figure here is measured post-fix, not a pre-fix repro. The 416/24,068 baseline was measured against origin/main before patching and matches the issue's stated number exactly.
    5. Process state. Worktree clean, 0 commits behind main, 4 commits, lockfile churn from worktree provisioning reverted before the first commit (per fix(worktree): frozen installs so provisioning cannot dirty the lockfile #816's known behavior).

    Status: Gaps Found — items 1 and 2 are latent/boundary conditions rather than defects, and item 3 is a real if minor format change. None blocks merge; none maps to an unmet AC.

    Risk Assessment

    • Likely failure mode: not the renderer — it's deterministic and directly asserted. The risk is that Step 6 gets skipped the way ## Output Format was. This is weaker than the old failure (a missing Bash call is visible in the transcript where a missing paragraph is not, and Step 6 now sits in the imperative section) but not eliminated; full closure needs the Stop hook the issue explicitly defers.
    • Not tested: assess-render.ts unit coverage (see above). Also untested: whether the model actually follows Step 6 — unfalsifiable in CI by construction, and the honest answer to AC-21..AC-26 is that they verify the prompt says the right thing, not that the model obeys.
    • Sibling sites considered: cross-file — none. The hand-drawn-geometry pattern is unique to assess/SKILL.md; I checked whether other skills embed aligned ASCII tables and they do not. assess-collision-detect.ts remains "cited but never executed" (the anti-pattern this issue names), but converting it is out of scope and not an AC.
    • Sibling-line audit: all 9 remaining table rows in SKILL.md audited and aligned, plus all 16 separators — not just the ones I edited.

    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists Found
    User-facing change (feat:/fix: commits) Yes
    [Unreleased] entry Present, under ### Fixed
    Format Includes (#823)

    Verdict: AC_MET_BUT_NOT_A_PLUS

    All 38 issue ACs plus both derived ACs are met, CI is fully green, and the anti-drift guard is mutation-tested. Not A+ for two reasons I'd rather state than paper over:

    1. src/commands/assess-render.ts has no unit test — only dist-level smoke coverage.
    2. The adversarial re-read surfaced a latent -Infinity edge in alignedBlock and a small unadvertised change to the posted-comment Flags: gutter.

    Both are notes for the reviewer, not blockers. Two deliberate divergences are documented in the PR body: separator width 64 (AC-16) against the issue's own prototype block, which measures 78; and RUN_COL being the one hand-chosen constant, which AC-11 explicitly requires.

    PR: #824

    Next Steps

    1. Confirm the 64-vs-78 separator call — one constant, snapshots regenerate from it.
    2. Optional: add a unit test for assess-render.ts's three catch arms.
    3. Merge; then the next real /assess run is the true end-to-end check.
  5. added
    needs-improvement
    on Jul 27, 2026
  6. added a commit that references this issue on Jul 27, 2026
  7. admarble commented on Jul 27, 2026

    @admarble
    ContributorAuthor

    QA Re-Review for Issue #823 — gap fixes

    All three gaps from the prior review are closed in 984a45a. One of them turned out to be a different (and better) defect than I first reported.

    Gap 1 — assess-render.ts had no unit test

    Closed. 12 tests over real temp files rather than a mocked readFile. The command is 60 lines of read → parse → render → print; mocking the read would have left the test asserting its own branching, and real files exercise the ENOENT vs EISDIR distinction the error messages depend on.

    Covers: both success paths, both unreadable paths (missing file, directory), three schema paths (bad enum, unknown key, missing top-level field), and output hygiene — no ANSI under a simulated TTY, and the block emitted as exactly one console.log so nothing can interleave into the middle of output the caller pastes verbatim.

    Gap 2 — alignedBlock returned -Infinity on an empty array

    Closed, but my first fix was wrong and the mutation test caught it.

    I added a guard to each builder. Then deleted all four guards to confirm the tests failed — they didn't. 35 passed either way. Every call site already guarded on .length, so the builders were unreachable with empty input and my new tests were tautological.

    The real defect underneath: section visibility was decided in two places at once — once at the call site, once (now) in the builder. Restructured so callers ask the builder "did that produce anything?" instead of re-deriving emptiness. The builder is now the single decision point, and the guards are load-bearing — deleting them fails 8 tests. Also removed a duplicated cleanupLines() call and three redundant .length checks.

    Worth recording that the guard-only version would have shipped looking correct.

    Gap 3 — Flags: gutter change was unadvertised

    Closed. Documented in the CHANGELOG, including why there was no single prior spacing to preserve: the old file specified that gutter at four different offsets (24, 34, 24, 9). Structure is unchanged and #785's rule still holds.

    Also locked in

    The batch-vs-single marker asymmetry is now asserted in both directions rather than left as an accident: the compact batch form is chat-only and parseAssessMarkers does not read it, which the skill depends on.

    Verification

    Check Result
    Full suite 4,203 passed / 0 failed across 202 files (was 4,188 / 201)
    src/lib/assess/ + command tests 125
    CI 8/8 SUCCESS
    mergeable MERGEABLE, 0 behind main
    build / eslint --max-warnings 0 clean
    Skill mirrors md5 ce17f8a4... ×3, untouched this round
    dist re-verified happy path exit 0, schema failure exit 1

    Verdict: READY_FOR_MERGE

    40/40 ACs met, all three gaps closed, no new gaps introduced. Both guard sets are mutation-verified rather than assumed.

    Two documented divergences stand and are the reviewer's call, not defects:

    1. Separator width 64 (AC-16, normative) vs the 78 the issue's own prototype block measures. One constant; snapshots regenerate from it.
    2. RUN_COL is the single hand-chosen number — required by AC-11, with everything else derived.

    The remaining honest limit is unchanged: AC-21–26 verify the prompt says the right thing, not that the model obeys it. Full closure needs the Stop hook the issue defers.

    PR: #824

  8. added
    ready-for-review
    and removed
    needs-improvement
    on Jul 27, 2026
  9. added 2 commits that reference this issue on Jul 29, 2026
  10. added 2 commits that reference this issue on Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclicomplexplannedready-for-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions