Skip to content

Normalize CI log excerpts when check details arrive - #28694

Merged
AmethystLiang merged 30 commits into
mainfrom
ci-log-ingestion
Oct 16, 2026
Merged

AmethystLiang merged 30 commits into
mainfrom
ci-log-ingestion

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1648 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1640
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​487 $\color{#cf222e}{\Huge{\mathbf{−}}}$​60 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​427

Ingestion implementation and two independent reviews are complete. Final dependency integration, typecheck, changed-code quality, and affected tests pass.

ELI5

Check details from an older Orca host can contain terminal formatting and unsafe control characters. Normalize those excerpts when details arrive so the text people read, copy, and send to AI is readable and bounded.

What Changed

The store/sidebar, PR dialog, and PR page loaders each normalize one response after either IPC or RPC finishes. One reusable details normalizer calls the shared sanitizer once per string excerpt: cap the raw excerpt to 16 KiB before stripping controls, normalize line breaks, and retain independent text storage. Job metadata, supplied outcomes, and omitted legacy outcomes remain intact.

Load failures use fixed localized text without carrying captured error output. AI context describes bounded excerpts and excludes explicit log-download errors from log evidence. Copy and details-editor AI use loaded details without another request; sidebar AI keeps its existing fetch. Existing request ownership, deadlines, routing, and AI line budgets stay intact.

Why

These three loaders issue independent requests. Normalizing at each response boundary covers their existing consumers with the shared text policy, without adding downloads or sanitation during rendering and actions.

Linked Issue

No new issue created; this is part of the coordinated CI failure-output fix.

Dependencies and Merge Order

Retrieval recovery #29180 is merged into main as 0d4eb242d7864221296b426552abbb08c9d4f9a4. This PR now targets main directly and contains only its original 18-file ingestion scope. Its original three patches are preserved; the test fixture import and benchmark input names are repaired for current main.

UI PR #28702 remains a draft on this branch. After this PR lands, retarget #28702 to main, refresh its head against main, and verify the full PR workflow before merging. Never merge it into this branch after this branch has landed.

Visual Proof

Legacy check excerpt: before and staged after

Before: legacy controls reach display and Copy After: normalized excerpt
ci-details-ingestion-legacy-before.png ci-details-ingestion-legacy-staged-after.png

Saved uncropped hidden-renderer BEFORE at 20d82e7 and staged AFTER at 949e5b7 use the same generated legacy fixture through the actual store/preload IPC/full-details/Copy path. AFTER shows the diagnostic and stack on readable separate lines, with no unsafe controls in DOM or either Copy value. One cold details request; Copy adds zero. This is a synthetic compatibility proof, not a provider download or final layout/retry proof.

Owned production blobs are unchanged after dependency integration; the completed green rendered proof is retained. The uploaded before/after images are stored outside this PR diff.

Testing

  • Automated tests added/updated.
  • Staged targeted tests: 330 tests/18 files in the package runner; 175 focused tests/6 files under Node, independently rerun by the reviewer.
  • All six loader/transport paths use the real sanitizer; fixtures cover legacy omission, outcomes, metadata, ANSI/control bytes, carriage returns, oversized multibyte text, malformed sequences, cancellation, deadlines, late responses, and stale ownership.
  • Display/Copy/editor-AI reuse and no added consumer requests; paired RPC failure/disconnect paths make zero local preload/runtime calls. Physical host execution counters belong to retrieval.
  • Isolated bounded CPU/retention test, cumulative changed-file quality, and formatting passed.
  • Staged hidden Electron/CDP AFTER: one test passed, exact build/worktree identity, hidden/unfocused window, owned process/profile/port cleanup verified.
  • Exact staged retrieval integration, ORCA_BACKGROUND_LAUNCH=1 pnpm tc, changed-code quality against the exact base, and 175 affected tests/6 files pass at the tested head.
  • Final independent ingestion review accepted with no findings.
  • Final shared-text affected run and combined stack checks passed; shared-text review outcome is recorded in Keep CI failure excerpts bounded and strip malformed ANSI controls linearly #28671.

Actually tested on macOS 26.5.1 arm64, Node 26.8.1 and the package runner. Routing/cancellation coverage uses deterministic renderer fixtures; native Windows/Linux and real SSH/paired hosts were not exercised here. The earlier staged shared-test TS6307 import errors are resolved by the integrated dependency; full typecheck now passes. Final synchronized stack checks are recorded below.

Review

Real Orca workers used requested and effective codex gpt-6.1-sol, effort xhigh, verified in launch receipts. Design converged after two independent reviews and one fix. Both independent application reviews accepted with no findings, including the final integrated 18-file diff after dependency integration. No application fix was required; two rounds were used within the five-round limit.

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer source is copied or translated.

Notes

Excerpts and the unchanged AI line budget can omit diagnostics. Omitted legacy outcomes remain unknown. Renderer request counters do not measure physical host CLI attempts. Isolated no-Buffer retention checks retained about 266 KiB for sixteen normalized excerpts versus 32 MiB for raw slices; this is Node/V8 ownership evidence, not a total renderer/transport heap guarantee or full-app performance claim.

Checklist

  • This PR is focused on renderer ingress and its existing consumers.
  • User-facing before/after, mechanism, and approach explained.
  • Before/after attachments included, with staged proof limits stated.
  • Final independent review and required ingestion checks complete.
  • Cross-platform, folder-workspace, remote routing, and mixed-version compatibility considered with deterministic fixtures and explicit limits.

Final dependency verification

Before the latest dependency restack, the synchronized stack passed 205 affected tests in nine suites, full ORCA_BACKGROUND_LAUNCH=1 pnpm tc, and the changed-code quality gate with zero new findings across 106 files. The final shared-text affected run passed all 332 selected cases; the earlier failed 1,004-case run remains separately recorded. Large synthetic logs still have a material processing cost: about 84 ms at 8 MiB and 579 ms at 63 MiB versus 39 ms and 293 ms before. The actual captured job measured about 4 ms. This is a disclosed correctness tradeoff, not a large-log stall fix or a zero-regression claim.

Merge recovery validation

The integrated recovery on current main passed full typecheck, changed-code quality, and 622 affected tests in 40 files. The exact reported job was downloaded through the real hidden Electron app and rendered with its timeout diagnostic. Fresh ingestion-only tests and full CI run on this restacked head. Uncommitted local work is excluded and preserved.

Ingestion-only package-runner validation: 217 tests passed in nine files.

The latest merge recovery incorporates the landed retrieval cleanup-test correction and current main. Fresh CI runs on the updated head.

Final restacked application validation against landed main: 402 tests passed in 18 affected files, full pnpm tc, and changed-code quality with zero new findings. Fresh PR CI is running on the updated heads.

The wall-clock performance suites run about 1k child workloads up to 63 MiB, so they were sharing runners with unit tests and could fail on noise. They now run only in their own `check_log_performance` job, opted in with `ORCA_CHECK_LOG_PERF=1`.

- Remove the pinned-baseline checkout and `ORCA_CHECK_LOG_BASELINE_DIR`. The baseline comparison is now a manual step that reads the pinned ref from local Git history.
- Run the current-implementation checks with `compareBaseline: false`, which skips baseline builds and audits.
- Replace the captured failure-log JSON with a synthetic log built by `createCheckLogFixture()`, so no scraped job output or provenance metadata is kept in the repo.
- Remove the `check_log_performance` CI job. The log performance suites now run only when `ORCA_CHECK_LOG_PERF=1` is set, as a manual benchmark.
- Update the benchmark scripts and tests to use the new fixture helper and drop the `fixturePath` parameter.
@AmethystLiang
AmethystLiang changed the base branch from ci-log-retrieval to ci-merge-repair October 15, 2026 16:54
@AmethystLiang
AmethystLiang marked this pull request as draft October 15, 2026 16:56
@AmethystLiang
AmethystLiang changed the base branch from ci-merge-repair to main October 15, 2026 17:36
# Conflicts:
#	src/main/runtime/github-check-details-paired-cleanup.test-fixture.ts
#	src/main/runtime/github-check-details-paired.integration.test.ts
@AmethystLiang
AmethystLiang marked this pull request as ready for review October 15, 2026 17:37
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a4f9c0e9-f218-499f-9085-1ce318039677
📥 Commits

Reviewing files that changed from the base of the PR and between 0d4eb24 and c4bce34.

📒 Files selected for processing: 18
  • src/renderer/src/components/editor/CheckRunDetailsPanel.copy.test.tsx
  • src/renderer/src/components/editor/check-run-clipboard-text.test.ts
  • src/renderer/src/components/editor/check-run-details-fix-with-ai.test.ts
  • src/renderer/src/components/github-item-dialog/inspect-pull-request/checks-tab-request-details.ts
  • src/renderer/src/components/pr-checks-fix-prompt.test.ts
  • src/renderer/src/components/pull-request-page/checks/details-request.ts
  • src/renderer/src/components/right-sidebar/checks-panel/use-checks-panel-check-and-review-actions.test.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/use-checks-panel-check-and-review-actions.tsx
  • src/renderer/src/lib/check-run-details-log-normalization-measurement-test-fixture.ts
  • src/renderer/src/lib/check-run-details-log-normalization-performance.test.ts
  • src/renderer/src/lib/check-run-details-log-normalization-test-fixture.ts
  • src/renderer/src/lib/check-run-details-log-normalization.test.ts
  • src/renderer/src/lib/check-run-details-log-normalization.ts
  • src/renderer/src/store/github/check-actions.ts
  • src/renderer/src/store/github/check-details-failure-mapping.test.ts
  • src/renderer/src/store/github/check-details-ingestion.test.ts
  • src/renderer/src/store/github/check-details-loader-test-fixture.ts
  • src/shared/pr-checks-fix-prompt.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📝 Walkthrough

The change adds shared normalization for check-run log tails and applies it to successful detail responses. Request handlers map timeout and abort failures. Prompt generation excludes failed-job tails and adds missing-context information. Tests cover transport behavior, excerpt limits, and use of loaded logs in editor and AI-fix actions.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to c4bce

Check-detail failures show fixed messages, and no merge-blocking issue was identified. Merge after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 18 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the primary change: normalizing CI log excerpts when check details arrive.
Description check Passed The description is detailed and covers the change, rationale, testing, visual proof, limitations, review status, and checklist. The Linked Issue section does not provide an issue link and should be co…
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@AmethystLiang
AmethystLiang merged commit a0a98a4 into main Oct 16, 2026
44 of 56 checks passed
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