developer-experience: fix verdictColor() ANSI leak through --no-color (issue #102) - #103
Draft
ruvnet wants to merge 2 commits into
Draft
developer-experience: fix verdictColor() ANSI leak through --no-color (issue #102)#103ruvnet wants to merge 2 commits into
ruvnet wants to merge 2 commits into
Conversation
renderDashboard(ledgerMd, { noColor: true }) still emitted a raw ANSI
color escape in the verdict column — verdictColor() closed over the
always-colored module constant C instead of the noColor-aware color
map every other cell already goes through. Flagged unfixed in PR #21
(2026-08-19); reproduced live tonight against main before the fix.
Parameter-thread the resolved color map into verdictColor() instead
of adding a second no-color check. npm test 697->699 (+2), 0
regressions. Independent critic: CLEAR.
Dream Cycle 2026-09-09. Issue #102.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D5ee4aky1TGGQqfYpoouad
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D5ee4aky1TGGQqfYpoouad
This was referenced Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nightly Dream Cycle, 2026-09-09. DEEP=developer-experience, SCAN=cli,tui. Full report:
docs/dream-cycle/2026-09-09-developer-experience-report.md. Issue: #102.Hypothesis
Given
renderDashboard(ledgerMd, { noColor: true }), whenverdictColor()is changed to resolve its return value through the same no-color-aware color map (c) that every other cell in the same row already uses — instead of closing over the raw, always-coloredCconstant — thennoColor: trueoutput should contain zero ANSI escape sequences for any verdict value (ACCEPT,REJECT,INCONCLUSIVE, or any other string, including aHALT: budgetrow), whilenoColor: falseoutput stays byte-identical to today. Subject to: 0 regressions, change confined toverdictColor's color-source dispatch. Frozen before implementation. Confirmed.Candidate
packages/cli/src/tui.ts—verdictColor(v: string): string→verdictColor(v: string, c: typeof C): string, body changed fromC.green/C.red/C.yellow/C.graytoc.green/c.red/c.yellow/c.gray; its one call site now passesc. +2 regression tests inpackages/cli/src/index.test.ts. One conceptual change, 4-line function + 1-line call site, 16 lines of tests.This exact defect was flagged as a known, unfixed follow-up in PR #21 (2026-08-19, merged) — "
verdictColor()bypasses the no-color proxy, leaking a raw ANSI escape into--no-coloroutput." Reproduced live tonight againstmain @ 3edd426before writing the fix:Evaluation Receipt
Real evaluator:
npm test(vitest run && npm run test:governance).3edd426)Live: post-fix
noColor: trueoutput contains zero ANSI escapes; colored (noColor: false) output unchanged. Self-hosteddream.config.jsoncompile output byte-identical before/after (out of scope for thistui-only change, verified anyway).Baseline
Parent commit
3edd426f6c9c4b1e80235f7447dc863e749345cc(main). 697/697 tests green (616 vitest + 81 governance), clean build, clean lint.Darwin Lineage
Not run —
DARWIN=not-applicable. Single deterministic color-dispatch parameterization, no evolvable population — same judgment as every prior single-functiondeveloper-experience/compiler-parityfix in this ledger (#11, #21, #29, #33, #46).Evidence
OBSERVATION (grade A, live, pre-fix code read + reproduction) → OBSERVATION (grade A, PR #21's own body names this exact defect "not fixed") → MEASUREMENT (grade A, live noColor leak before/after) → MEASUREMENT (grade A, 697→699 tests, 0 regressions) → DECISION (parameter-thread
crather than add a second no-color check insideverdictColor, avoiding a second place the no-color decision could drift).Reward-Hack Check
Independent critic (fresh subagent, no shared authoring context, given only
git diff+ full repo read access): CLEAR.tui.tspost-fix for any remaining directC.xxxreference insiderenderDashboardor its helpers — zero found..onlytests, no gold-data edits, no threshold changes, no evaluator exploitation.c === CwhennoColoris false, so behavior is identical to the oldverdictColor(v).Security Review
No security-sensitive surface: no prompt-injection vector (no LLM calls in this path), no MCP/tool-authority change, no credential exposure, no filesystem/network scope change, no evaluator/gate/safety-constant touched. Pure ANSI-escape string-formatting logic.
Regression Analysis
0 pre-existing tests modified or removed. All 697 baseline tests pass unchanged; 2 new vitest tests added.
npm run lintclean.npm run buildclean (7 packages, no wasm/NAPI degradation to record tonight).ledger verifyon the ledger with tonight's new row appended reports the same 40 pre-existing structural errors as before (already tracked by open issues #48/#58, PRs #49/#59) — tonight's row is not among them.ADR
None — this is a bug fix to existing rendering behavior (a helper bypassing an already-established no-color chokepoint), not a new architectural decision. Same precedent as PR #21 itself.
Gist
No
ghCLI or gist-creation MCP tool available this session (consistent with every prior night).GIST=LOCAL. Full report committed atdocs/dream-cycle/2026-09-09-developer-experience-report.md.Issue
#102
Witness
Verify:
sha256sumthe committed report's content before its Witness section, thenprintf '%s%s' "<that hash>" "3edd426f6c9c4b1e80235f7447dc863e749345cc" | sha256summust equal the witness above.Merge Policy
Draft — human review required. This PR does not carry the
automerge-safelabel. The session never merges and never self-promotes.🤖 Generated with Claude Code
https://claude.ai/code/session_01D5ee4aky1TGGQqfYpoouad
Generated by Claude Code