Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,32 @@ describe('Claude transcript formatter', () => {
expect(lines.map((line) => line.text).join('')).toBe(`⏺ Bash ${command.slice(0, 80)}`);
expect(lines.every((line) => line.dim)).toBe(true);
});

it('wraps ordinary transcript text at word boundaries while preserving exact content', () => {
const text = 'The pane alerts were benign and completed cleanly.';
const lines = formatTranscriptEntries(
[{ type: 'assistant', message: { role: 'assistant', content: text } }],
18
);

expect(lines).toEqual([
{ text: 'The pane alerts ', dim: false },
{ text: 'were benign and ', dim: false },
{ text: 'completed cleanly.', dim: false },
]);
expect(lines.map((line) => line.text).join('')).toBe(text);
});

it('keeps the next word whole when the previous word exactly fills the width', () => {
const lines = formatTranscriptEntries(
[{ type: 'assistant', message: { role: 'assistant', content: 'word word' } }],
4
);

expect(lines).toEqual([
{ text: 'word ', dim: false },
{ text: 'word', dim: false },
]);
expect(lines.map((line) => line.text).join('')).toBe('word word');
});
});
18 changes: 16 additions & 2 deletions apps/dashboard/src/components/terminal/transcriptFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,22 @@ function wrapDisplayLine(line: TranscriptDisplayLine, maxColumns: number): Trans
const characters = Array.from(line.text);
if (characters.length <= width) return [line];
const wrapped: TranscriptDisplayLine[] = [];
for (let start = 0; start < characters.length; start += width) {
wrapped.push({ text: characters.slice(start, start + width).join(''), dim: line.dim });
for (let start = 0; start < characters.length;) {
let end = Math.min(characters.length, start + width);
if (end < characters.length) {
if (/\s/u.test(characters[end] || '')) {
while (end < characters.length && /\s/u.test(characters[end] || '')) end += 1;
} else {
for (let candidate = end - 1; candidate > start; candidate -= 1) {
if (/\s/u.test(characters[candidate] || '')) {
end = candidate + 1;
break;
}
}
}
}
wrapped.push({ text: characters.slice(start, end).join(''), dim: line.dim });
start = end;
}
return wrapped;
}
Expand Down
2 changes: 2 additions & 0 deletions tasks/2026-07-22-android-terminal-daily-driver-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@
- 2026-07-22T15:01:57-04:00 — Fresh re-review passed with no remaining medium-or-higher findings. PR #101 passed dependency review, Go build/vet/test, Node lint/typecheck/build/workspace tests, the full dashboard smoke suite, and both Docker builds, then merged as `5664469`. Automatic Coolify deployment `q128diofv1kzrfntjn0ic38p` finished at that exact source; dashboard and control-plane containers run the same full SHA, the dashboard auth route responds, and public `/health` returned `ok` with two connected agents. Agentd did not change.
- 2026-07-22T15:14:27-04:00 — Chris's W1-R4 live check found one remaining unselected visual character only at left-side wrap boundaries. The existing 160-column mobile letterbox journey reproduced the underlying geometry exactly: `.xterm-screen` extended 7 px past `.xterm` because FitAddon measures the parent but only subtracts padding from the generated xterm child. W1-R5 `ff3c640` moves padding onto `.xterm` and replaces the sizing border with an inset shadow. The journey failed before and passes at ≤0.5 px after; the 120-line scrollback path, 1280×720 cold-open, dashboard typecheck, and fresh review also pass with no medium-or-higher finding.
- 2026-07-22T15:26:45-04:00 — CodeRabbit's one valid minor comment expanded the same containment assertion to cover both left and right boundaries; focused rerun passed at `8d20fe7`. PR #102 then passed dependency review, Go build/vet/test, Node lint/typecheck/build/workspace tests, the full dashboard smoke suite, and both Docker builds before merging as `997e522`. Automatic Coolify deployment `ludwiflmkh107wcs5917e4uw` finished at that exact source; both containers run the full SHA, the dashboard auth route responds, and public `/health` returned `ok` after both agents reconnected. Agentd did not change.
- 2026-07-22T15:31:00-04:00 — Chris corrected the W1-R5 finding: the visual artifact is still two characters, changes unpredictably while scrolling, and remains absent from selected text. That evidence rejected the deterministic 7 px boundary overflow as the remaining root cause. Official xterm.js PR #5998 described a plausible DOM stale-row mechanism during scroll/trim/resize, so W1-R6 tested that hypothesis by backporting the upstream fix onto stable `@xterm/xterm` 6.0.0 through pnpm's native patch mechanism; the broader 6.1 beta was tested and rejected because it includes an unrelated custom-scroll rewrite.
- 2026-07-22T16:05:56-04:00 — The existing wrapped-scrollback journey now forces changing DOM rows and verifies exact restoration across three up/down cycles at 412×915 and 1280×720; both viewports pass, as do the dashboard production build and a real control-plane Docker build. Fresh adversarial review found no warning-or-higher issue. PR #103's first CI run exposed the patch file missing from Docker build contexts, the direct `COPY patches/` correction closed it, and the complete second CI run passed. PR #103 merged as `bfbb454`; automatic Coolify deployment `g9auuz7uywqmfpnzzq6j8pqa` finished at that exact source. Both production containers run the full SHA, the dashboard auth route responds, and public `/health` reports `ok` with two agents. Painted-surface acceptance remained pending; agentd did not change.
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@
{"ts":"2026-07-22T15:14:27-04:00","project":"android-terminal-daily-driver","event":"lane_completed","lane":"W1-R5","role":"AI Lead + Fresh Reviewer","model":"gpt-5.6-sol/xhigh","elapsed_minutes":12,"input_tokens":0,"output_tokens":0,"cost_usd":0,"ref":"ff3c640a804743eb5cfed79a45ecdabc09afba22","detail":{"result":"ready_for_pr","measured_overflow_before_px":7,"allowed_overflow_after_px":0.5,"letterbox_journey":"pass","scrollback_journey":"pass","desktop_cold_open":"pass","dashboard_typecheck":"pass","review_critical_high_medium":0,"agentd_changed":false}}
{"ts":"2026-07-22T15:26:45-04:00","project":"android-terminal-daily-driver","event":"gate_result","lane":"W1-R5","role":"AI Lead + CodeRabbit","model":"gpt-5.6-sol/xhigh","elapsed_minutes":12,"input_tokens":0,"output_tokens":0,"cost_usd":0,"ref":"8d20fe7b7a97406ec7265ba8c6e95c80a2c9fa58","detail":{"result":"corrected","finding_severity":"minor","finding":"containment assertion covered right boundary only","focused_letterbox_journey":"pass"}}
{"ts":"2026-07-22T15:26:45-04:00","project":"android-terminal-daily-driver","event":"production_rollout","lane":"W1-R5","role":"AI Lead","model":"gpt-5.6-sol/xhigh","elapsed_minutes":12,"input_tokens":0,"output_tokens":0,"cost_usd":0,"ref":"ludwiflmkh107wcs5917e4uw","detail":{"result":"pass","pr":102,"merge_commit":"997e522d71eef5dadd85a20139377f8848fb9a45","ci":"pass","dashboard_source":"997e522d71eef5dadd85a20139377f8848fb9a45","control_plane_source":"997e522d71eef5dadd85a20139377f8848fb9a45","dashboard_http":307,"health":"ok","agents":2,"agentd_changed":false}}
{"ts":"2026-07-22T15:31:00-04:00","project":"android-terminal-daily-driver","event":"human_feedback","lane":"W1-live","role":"Human Owner","model":"n/a","elapsed_minutes":0,"input_tokens":0,"output_tokens":0,"cost_usd":0,"ref":"production-laptop","detail":{"result":"correct","renderer_artifacts":"two_characters_dynamic_during_scroll","location":"left_wrap_region","buffer_text":"correct","prior_geometry_root_cause":"rejected_for_remaining_artifact"}}
{"ts":"2026-07-22T16:05:56-04:00","project":"android-terminal-daily-driver","event":"lane_completed","lane":"W1-R6","role":"AI Lead + Fresh Reviewer","model":"gpt-5.6-sol/xhigh","elapsed_minutes":34,"input_tokens":0,"output_tokens":0,"cost_usd":0,"ref":"b78650f4473dddfb43f033f9bf8ed7714cd5d9bb","detail":{"result":"implementation_pass","root_cause_hypothesis":"xterm_dom_renderer_stale_rows","upstream_pr":5998,"base_package":"@xterm/xterm@6.0.0","mobile_scrollback_journey":"pass","desktop_scrollback_journey":"pass","dashboard_build":"pass","control_plane_docker_build":"pass","review_critical_warning":0,"painted_surface_verification":"pending","agentd_changed":false}}
{"ts":"2026-07-22T16:05:56-04:00","project":"android-terminal-daily-driver","event":"production_rollout","lane":"W1-R6","role":"AI Lead","model":"gpt-5.6-sol/xhigh","elapsed_minutes":34,"input_tokens":0,"output_tokens":0,"cost_usd":0,"ref":"g9auuz7uywqmfpnzzq6j8pqa","detail":{"result":"deployment_pass","pr":103,"merge_commit":"bfbb454253ff3eb04248b19541f966370ed642e8","ci":"pass","fresh_review":"pass","dashboard_source":"bfbb454253ff3eb04248b19541f966370ed642e8","control_plane_source":"bfbb454253ff3eb04248b19541f966370ed642e8","dashboard_http":307,"health":"ok","agents":2,"live_visual_verification":"pending","agentd_changed":false}}
17 changes: 9 additions & 8 deletions tasks/2026-07-22-android-terminal-daily-driver-status.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Android Terminal Daily Driver — Status

- Plan status/version: approved `1719c8c` scope, approval recorded 2026-07-22T12:04:25-04:00
- Current phase: W1-R5 live laptop acceptance
- Current phase: W1-R6 live laptop acceptance
- Overall state: running
- Last updated: 2026-07-22T15:26:45-04:00
- Current accepted baseline: production `997e522d71eef5dadd85a20139377f8848fb9a45`
- Current candidate: W1-R5 deployed at `997e522d71eef5dadd85a20139377f8848fb9a45`; both hosts remain on agentd `9e8eaf3` with SHA-256 `d6e4273af70136fe98f678bc4b1efad5d7cee86e6e738dbf8ae172106621dc7b`
- Last updated: 2026-07-22T16:05:56-04:00
- Current accepted baseline: production functionality through `997e522d71eef5dadd85a20139377f8848fb9a45`, with the remaining renderer artifact rejected
- Current candidate: W1-R6 deployed at `bfbb454253ff3eb04248b19541f966370ed642e8`; both hosts remain on agentd `9e8eaf3` with SHA-256 `d6e4273af70136fe98f678bc4b1efad5d7cee86e6e738dbf8ae172106621dc7b`
- Budget used/remaining: setup complete; 7-day project ceiling remains
- Next Human Owner checkpoint: production laptop terminal-use verdict

## Lane Status

| Lane | Current role | State | Deliverable/ref | Last proof | Blocked on | Next action |
|---|---|---|---|---|---|---|
| W1 — Shared terminal repair | Human Owner check | deployed | PR #102 merge `997e522`; Coolify `ludwiflmkh107wcs5917e4uw`; agentd `9e8eaf3` | Full CI green; fresh review and CodeRabbit correction closed; exact-source containers running; public health `ok` with two agents | Live laptop interaction | Chris hard-refreshes and rechecks wrapped scrollback |
| W1 — Shared terminal repair | Human Owner check | deployed | PR #103 merge `bfbb454`; Coolify `g9auuz7uywqmfpnzzq6j8pqa`; agentd `9e8eaf3` | Upstream xterm DOM stale-row fix backported to stable; mobile/desktop cyclic scrollback proof, full CI, and fresh review pass; exact-source containers running; public health `ok` with two agents | Live laptop interaction | Chris hard-refreshes and rechecks wrapped scrollback |
| W2 — Android vertical slice | Unassigned until W1 contract freeze | held | Native app plus authenticated web/PWA APK delivery | Health repo distribution pattern inspected; AND-11 approved | W1 production rollout and live laptop acceptance | Remain held |
| W3 — Integration and rollout | AI Lead | running | W1 web/control-plane and both agentd hosts deployed | Coolify `ludwiflmkh107wcs5917e4uw`; public health `ok`; explicit binary backups on both hosts | W1 live verdict, then W2 | Maintain recovery receipts |
| W3 — Integration and rollout | AI Lead | running | W1 web/control-plane and both agentd hosts deployed | Coolify `g9auuz7uywqmfpnzzq6j8pqa`; public health `ok`; explicit binary backups on both hosts | W1 live verdict, then W2 | Maintain recovery receipts |

## Open Gates

Expand All @@ -24,10 +24,11 @@
| Plan validation | pass | Canonical validator | AI Lead | Refresh at wave boundary |
| W1 reproduction | pass | Production commit `7b30df0`: delayed topology cold-open negotiated exactly one row | W1 Builder | Freeze regression proof |
| W1 review | pass | Fresh Reviewer `d64392e`: prior HIGH WEB-4 blocker closed, no new critical/high finding | AI Lead | Live laptop check |
| W1 rollout | pass | PR #102 merge `997e522`; full CI green; Coolify exact-source dashboard/control-plane containers; public health `ok` with two agents; agentd unchanged | AI Lead | Live laptop check |
| W1 rollout | pass | PR #103 merge `bfbb454`; full CI green; Coolify exact-source dashboard/control-plane containers; public health `ok` with two agents; agentd unchanged | AI Lead | Live laptop check |
| W1-R4 focused verification | pass | DOM renderer locked into the existing scrollback journey; passive waiting-input overlays absent; approvals and errors retained; fresh re-review pass | AI Lead | Live laptop check |
| W1-R5 focused verification | pass | Existing letterbox journey failed at 7 px horizontal overflow, passes after moving padding into `.xterm`; scrollback, desktop cold-open, typecheck, and fresh review pass | AI Lead | PR and CI |
| W1 live laptop | waiting | W1-R5 is live with the measured 7 px horizontal overflow removed and both grid boundaries locked | Human Owner | Hard refresh, then repeat wrapped scrollback check |
| W1-R6 focused verification | pass | Stable xterm 6.0 DOM renderer carries upstream PR #5998's missing-row clear-and-continue fix; existing journey changes and restores wrapped rows exactly across three cycles at mobile and desktop viewports; build, Docker build, CI, and fresh review pass | AI Lead | Live laptop check |
| W1 live laptop | waiting | W1-R6 deployed successfully, but the owner rejected the painted surface; W1-R7's word-boundary candidate is under review | Human Owner | Recheck after W1-R7 deploys |
| W2 launch | held | Accepted shared terminal contract on the real production path | AI Lead | W1 production laptop PASS |

## Current Risks and Escalations
Expand Down
6 changes: 5 additions & 1 deletion tasks/lessons.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,8 @@

- Date: 2026-07-22
Correction: The remaining artifact was actually two characters and changed as scrollback moved; the separate 7 px containment defect was real, but a fixed boundary defect could not explain changing, unselectable glyphs.
Rule: Do not equate a nearby deterministic layout defect with a dynamic renderer defect. Reproduce the same viewport across repeated scrolls and compare rendered rows before changing geometry again; changing glyphs with correct copied text points to stale renderer state.
Rule: Do not equate a nearby deterministic layout defect with the remaining dynamic display defect. First identify the actual painted surface; changing display fragments with correct copied text narrows the fault to presentation, but does not by itself prove xterm renderer corruption.

- Date: 2026-07-22
Correction: Backporting an upstream xterm DOM stale-row fix passed repeated `textContent` restoration checks, but the owner still saw the same changing two-character visual artifact in production.
Rule: DOM text equality is not an acceptance signal for an unselectable visual defect. A regression loop for this class of bug must reproduce and inspect the actual painted surface on the real path (or remain explicitly unproven) before a fix is shipped.
Loading