Skip to content

Fix starship rendering regressions with clean diff and PTY debug runbook#225

Merged
RtlZeroMemory merged 5 commits intomainfrom
fix/starship-render-regression-clean
Feb 27, 2026
Merged

Fix starship rendering regressions with clean diff and PTY debug runbook#225
RtlZeroMemory merged 5 commits intomainfrom
fix/starship-render-regression-clean

Conversation

@RtlZeroMemory
Copy link
Owner

@RtlZeroMemory RtlZeroMemory commented Feb 27, 2026

Summary

  • fixes remaining Starship rendering regressions after the refactor cycle:
    • Crew route manifest/detail no longer collapses or renders as empty panes
    • Engineering route reactor/deck panes stretch correctly across viewport ranges
    • route screen roots use full-height containers consistently to prevent compression
  • fixes Starship theme spec to packed Rgb24 values so app startup/tests are valid on current main
  • fixes pagination composition to keep controls horizontal inside focus zone (prevents vertical pager consuming table body height)
  • adds additional frame-audit telemetry for table layout (table.layout) to accelerate regression triage
  • adds a comprehensive autonomous PTY + frame-audit runbook and references it from AGENTS.md, CLAUDE.md, and developer testing docs

Validation

  • npx tsc -b packages/core packages/create-rezi packages/node
  • npx tsx --test packages/core/src/widgets/__tests__/pagination.test.ts
  • npx tsx --test packages/create-rezi/templates/starship/src/__tests__/render.test.ts packages/create-rezi/templates/starship/src/__tests__/reducer.test.ts packages/create-rezi/templates/starship/src/__tests__/keybindings.test.ts
  • live PTY worker-mode verification + frame-audit analysis (documented in docs/dev/live-pty-debugging.md)

Notes

Summary by CodeRabbit

  • New Features

    • Live PTY debugging and frame-audit instrumentation for richer UI regression validation; expanded frame/perf telemetry and native audit reporting.
  • Bug Fixes

    • Fixed pagination control structure.
    • Ensured consistent full-height behavior across template screens; improved responsive two‑pane layouts for crew and engineering screens.
  • Documentation

    • Added comprehensive Live PTY debugging runbook and testing guidance; added navigation entry.
  • Refactor

    • Unified theme color representation for consistent color handling.
  • Tests / Chores

    • Updated tests to use new color helpers and added robustness for vendor/gitlink checks.

@coderabbitai
Copy link

coderabbitai bot commented Feb 27, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6cf158f and 9cebb4f.

📒 Files selected for processing (3)
  • packages/ink-compat/src/__tests__/translation/colorMap.test.ts
  • packages/ink-compat/src/__tests__/translation/propsToVNode.test.ts
  • packages/node/src/worker/engineWorker.ts

📝 Walkthrough

Walkthrough

Adds Live PTY debugging documentation and runbooks; emits frame-audit events from table rendering; extends native frame/perf audit codes and worker parsing/emit paths; updates pagination vnode structure and tests; applies layout height/flex changes across several Starship screens; refactors theme color helpers and updates tests; guards native vendor gitlink reading and adds related tests.

Changes

Cohort / File(s) Summary
Documentation & Navigation
AGENTS.md, CLAUDE.md, docs/dev/live-pty-debugging.md, docs/dev/testing.md, mkdocs.yml
Adds Live PTY runbooks, deterministic-viewport guidance, frame-audit analysis/playbook, and a mkdocs nav entry. Note: CLAUDE.md contains duplicated runbook blocks.
Frame Audit & Worker
packages/node/src/frameAudit.ts, packages/node/src/worker/engineWorker.ts, packages/core/src/renderer/renderToDrawlist/widgets/collections.ts
Introduces FRAME and PERF debug categories/codes; extends worker to read/process frame/perf native records and emit native.frame/native.perf events; emits frame-audit from table visible-range with table/layout metadata.
Pagination VNode & Test
packages/core/src/widgets/pagination.ts, packages/core/src/widgets/__tests__/pagination.test.ts
Wraps controls in a new controlsRow VNode (row layout) and updates test traversal to match the new vnode hierarchy.
Starship Screen Layouts (height/flex)
packages/create-rezi/templates/starship/src/screens/bridge.ts, .../cargo.ts, .../comms.ts, .../settings.ts
Adds height: "100%" (and some flex/minHeight) to main column containers to enforce full-height layout.
Crew Screen Refactor
packages/create-rezi/templates/starship/src/screens/crew.ts
Large layout rewrite: boxed wrappers, two-pane split vs stacked layout, explicit width/height constraints, scrollable operations panel, debug snapshots, and reorganized UI composition.
Engineering Deck Refactor
packages/create-rezi/templates/starship/src/screens/engineering.ts
Replaces fixed heights with flex/minHeight, introduces responsiveDeckMinHeight, conditional two-column panes, and propagates height constraints.
Theme Color API & Helpers
packages/create-rezi/templates/starship/src/theme.ts
Converts RGB object literals to rgb(...) usage, narrows color input types to Rgb24, and simplifies pack/unpack color helpers; updates tests to use rgb.
Native-vendor & Tests
scripts/check-native-vendor-integrity.mjs, scripts/__tests__/check-native-vendor-integrity.test.mjs
Guards readSubmoduleHead to ignore uninitialized gitlink (no .git) and adds a test covering uninitialized gitlink behavior.
Misc Tests & Small Layout Edits
packages/create-rezi/templates/starship/src/screens/*.ts (other screens), packages/core/src/... tests, packages/ink-compat/src/__tests__/*
Minor layout additions (height: "100%") across several screens and test updates to use rgb(...) in color assertions.

Sequence Diagram(s)

sequenceDiagram
    participant UI as Renderer / UI
    participant Node as Node (frameAudit)
    participant Worker as Engine Worker
    participant Native as Native Audit Source

    UI->>Node: emitFrameAudit(table layout & metrics)
    Node->>Worker: enqueue/read native audit queue (FRAME/PERF mask)
    Worker->>Native: request per-record payloads (frame / perf records)
    Native-->>Worker: payload bytes (frame summary / perf timing / diffPath)
    Worker->>Node: emit native.frame.summary / native.perf.timing / native.perf.diffPath
    Node-->>UI: frame-audit events surfaced for diagnostics
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • PR #193: Touches table rendering/visible-range logic in collections.ts—overlaps the frame-audit emission changes.
  • PR #223: Overlaps drawlist and frame-audit instrumentation, debug codes, and related worker/renderer paths.
  • PR #194: Modifies Starship templates and layout/debug snapshots that overlap the screen layout refactors.

Poem

🐰 Hopping through terminal light, I spy each frame with curious sight,

Rows align and colors glow, logs whisper what the pixels show,
Pane by pane the layout sings—audits logged on tiny wings 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly describes the main focus of the PR: fixing Starship rendering regressions and adding PTY debug documentation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/starship-render-regression-clean

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e0292100eb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
packages/node/src/worker/engineWorker.ts (1)

435-442: Scope native debug capture to the intended categories.

You query using NATIVE_FRAME_AUDIT_CATEGORY_MASK, but enable currently captures all categories. Using the same mask at enable-time will reduce ring pressure and dropped relevant records.

♻️ Suggested change
-      categoryMask: 0xffff_ffff,
+      categoryMask: NATIVE_FRAME_AUDIT_CATEGORY_MASK,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/node/src/worker/engineWorker.ts` around lines 435 - 442, The
engineDebugEnable call is enabling capture for all native categories
(categoryMask: 0xffff_ffff) which increases ring pressure; change it to use the
intended NATIVE_FRAME_AUDIT_CATEGORY_MASK constant so only desired categories
are captured. Update the categoryMask parameter in the native.engineDebugEnable
call (the block initializing debug via engineDebugEnable(engineId, {...})) to
NATIVE_FRAME_AUDIT_CATEGORY_MASK while leaving other params
(ringCapacity/FRAME_AUDIT_NATIVE_RING_BYTES, captureDrawlistBytes, etc.)
unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/dev/live-pty-debugging.md`:
- Around line 23-26: Replace the hard-coded path "/home/k3nig/Rezi" used before
the "npx tsc -b packages/core packages/node packages/create-rezi" command in
docs/dev/live-pty-debugging.md with a generic repo-root placeholder (e.g.
"<repo-root>" or "$REPO_ROOT"); update the other occurrence of the same pattern
later in the file so all "cd /home/k3nig/Rezi" run commands are portable and
reference the repository root generically.

In `@packages/core/src/renderer/renderToDrawlist/widgets/collections.ts`:
- Line 31: The import ordering in
packages/core/src/renderer/renderToDrawlist/widgets/collections.ts is incorrect
and causing organizeImports to fail; run the repository's import
organizer/formatter (or your editor's "Organize Imports" action) on this file
and commit the reordered imports so the import list (including symbols like
emitFrameAudit and FRAME_AUDIT_ENABLED) follows the project's configured
ordering and lint rules.

In `@packages/node/src/worker/engineWorker.ts`:
- Around line 12-25: The import/formatting in this file is out of sync; run the
project's formatter and lint auto-fixers (e.g., npm/yarn script for format and
eslint --fix) and commit the resulting changes so imports and spacing match the
repo style; focus on normalizing the import block that includes symbols like
FRAME_AUDIT_NATIVE_ENABLED, FRAME_AUDIT_NATIVE_RING_BYTES, ZR_DEBUG_CAT_FRAME,
ZR_DEBUG_CAT_DRAWLIST, ZR_DEBUG_CAT_PERF and the ZR_DEBUG_CODE_* constants (also
check the similar region around the 604-651 change) to ensure sorted/organized
imports and consistent formatting before pushing.

---

Nitpick comments:
In `@packages/node/src/worker/engineWorker.ts`:
- Around line 435-442: The engineDebugEnable call is enabling capture for all
native categories (categoryMask: 0xffff_ffff) which increases ring pressure;
change it to use the intended NATIVE_FRAME_AUDIT_CATEGORY_MASK constant so only
desired categories are captured. Update the categoryMask parameter in the
native.engineDebugEnable call (the block initializing debug via
engineDebugEnable(engineId, {...})) to NATIVE_FRAME_AUDIT_CATEGORY_MASK while
leaving other params (ringCapacity/FRAME_AUDIT_NATIVE_RING_BYTES,
captureDrawlistBytes, etc.) unchanged.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 115410b and e029210.

📒 Files selected for processing (17)
  • AGENTS.md
  • CLAUDE.md
  • docs/dev/live-pty-debugging.md
  • docs/dev/testing.md
  • mkdocs.yml
  • packages/core/src/renderer/renderToDrawlist/widgets/collections.ts
  • packages/core/src/widgets/__tests__/pagination.test.ts
  • packages/core/src/widgets/pagination.ts
  • packages/create-rezi/templates/starship/src/screens/bridge.ts
  • packages/create-rezi/templates/starship/src/screens/cargo.ts
  • packages/create-rezi/templates/starship/src/screens/comms.ts
  • packages/create-rezi/templates/starship/src/screens/crew.ts
  • packages/create-rezi/templates/starship/src/screens/engineering.ts
  • packages/create-rezi/templates/starship/src/screens/settings.ts
  • packages/create-rezi/templates/starship/src/theme.ts
  • packages/node/src/frameAudit.ts
  • packages/node/src/worker/engineWorker.ts

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
docs/dev/live-pty-debugging.md (1)

38-39: Optional: Add comment to clarify file truncation idiom.

The : > syntax is valid bash for creating/truncating files, but a brief comment would help developers less familiar with this idiom.

📝 Optional clarity improvement
+# Truncate/create empty log files before run
 : > /tmp/rezi-frame-audit.ndjson
 : > /tmp/starship.log
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/dev/live-pty-debugging.md` around lines 38 - 39, Add a short explanatory
comment above the two truncation lines that use the bash idiom ": >
/tmp/rezi-frame-audit.ndjson" and ": > /tmp/starship.log" to clarify they create
or truncate the files; update the docs/dev/live-pty-debugging.md snippet by
inserting one brief sentence like "Use ': > <file>' to create or truncate a
file" immediately before those two lines so readers unfamiliar with the ": >"
idiom understand its purpose.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/node/src/worker/engineWorker.ts`:
- Around line 606-631: Create a shared helper (e.g., tryReadDebugPayload) used
by engineDebugGetPayload calls to centralize payload reads and error handling:
have it attempt the existing read, catch exceptions and emit the same
native.debug.payload_error via frameAudit.emit (or the appropriate audit
emitter) and additionally detect short reads (0 < wrote < expected) and emit
native.debug.payload_error with context (reason, recordId.toString(), expected
bytes, wrote bytes) instead of silently dropping; then replace the five inline
payload-read branches (the calls around engineDebugGetPayload) to call this
helper and, on success, proceed to the existing summary emit (using
DEBUG_FRAME_RECORD_BYTES, frameAudit.emit, nativeFrameCodeName, u64FromView,
etc.).

---

Nitpick comments:
In `@docs/dev/live-pty-debugging.md`:
- Around line 38-39: Add a short explanatory comment above the two truncation
lines that use the bash idiom ": > /tmp/rezi-frame-audit.ndjson" and ": >
/tmp/starship.log" to clarify they create or truncate the files; update the
docs/dev/live-pty-debugging.md snippet by inserting one brief sentence like "Use
': > <file>' to create or truncate a file" immediately before those two lines so
readers unfamiliar with the ": >" idiom understand its purpose.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e029210 and 56868eb.

📒 Files selected for processing (3)
  • docs/dev/live-pty-debugging.md
  • packages/core/src/renderer/renderToDrawlist/widgets/collections.ts
  • packages/node/src/worker/engineWorker.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/core/src/renderer/renderToDrawlist/widgets/collections.ts

@RtlZeroMemory RtlZeroMemory merged commit 1887f84 into main Feb 27, 2026
12 of 14 checks passed
@RtlZeroMemory RtlZeroMemory deleted the fix/starship-render-regression-clean branch February 28, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant