Repository navigation
test(mobile): make diff grammar assertions independent of wall time - #610
Merged
Merged
Conversation
Shiki 4.2 defaults to a 500ms timeout per line. TextMate can stop partway through a line, and Shiki publishes those partial tokens and grammar state. The inline-comment equality test compares separate tokenizations, so runner contention can make only one hit the cutoff. Disable that timeout only in the existing real-Shiki test wrapper. Keep production safeguards and the grammar, batching, and cancellation assertions. Mark the upstream-owned hunk and document the divergence in UPSTREAM.md. No changes to these files follow d8e9fd2 through upstream a71a6c3. Deterministic proof: for the first template tokenization, make Date.now return 0 for seven reads, then 501. The unchanged assertion fails with the exact three-versus-five-token CI diff in 5/5 runs; with this override it passes 5/5. The fault injection is not part of the committed test. Co-Authored-By: Codex <noreply@openai.com>
yaacovcorcos
enabled auto-merge
October 19, 2026 22:24
Contributor
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
yaacovcorcos
pushed a commit
to nattikahana/scient-desktop
that referenced
this pull request
Oct 20, 2026
Bring ScientFactory#353 up to current main, including the T3 alignments ScientFactory#593 and ScientFactory#607 (React Compiler migration, browser test project), ScientFactory#596, ScientFactory#601, ScientFactory#603-ScientFactory#606, ScientFactory#608-ScientFactory#610 and ScientFactory#567. Composition: - Workspace writes: ScientFactory#353's mutation service keeps main's known-workspace boundary and Git-folder write denial. Every write path (write, create, binary write, delete, rename, retained replace/remove, inspect) is authorized first, and the mutation lock re-checks protected paths on each non-history resolution. Test layers provide KnownWorkspaces. - Web: conflicted files follow main's React Compiler patterns (no manual memo, refs synced in layout effects, render-phase resets, effect events, try/finally in module helpers) with ScientFactory#353's behaviour on top, including ScientLatexSurface, the PDF reader, the file preview panel, save coordinator, workspace refresh, Pandoc tool and source PDF preview. - Tests moved to main's browser project are ported (createRoot, async act); ScientFactory#353's deletions of the Markdown rename button and its seam test are kept. - pnpm-lock.yaml regenerated with pnpm install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What Changed
Test-only. In
apps/mobile/src/features/diffs/nativeReviewDiffHighlighter.test.ts, the real-Shiki test wrapper now passestokenizeTimeLimit: 0. The grammar is still the real one; only its wall-clock cutoff is off in these tests. The edit is a marked seam in an upstream-owned test, with anUPSTREAM.mdnote.Why
highlightNativeReviewDiffVisibleRows > keeps grammar state across inline comment rowsdropped #567 from the merge queue. It failed withexpected { 'template-open': [ …(3) ] … } to deeply equal { 'template-open': [ …(5) ] … }.Date.now()so the limit trips mid-test. That reproduced the exact CI diff (3 tokens instead of 5) 5 of 5 times. With this change, it passed 5 of 5.a71a6c37d1, so there was no upstream fix to bring in.Not changed here: production keeps Shiki's time limit. That means a very slow line can still leave later rows miscoloured in the mobile diff view. Fixing that is a separate decision about responsiveness.
Documentation Impact
Documentation impact: Updated —
UPSTREAM.md(test-only override to keep when syncing).Verification
git diff --checkpassed.Checklist
Root cause and fix: Codex
gpt-6.1-sol. Publication: Claude Opus 5.5 in Claude Code (Scient).🤖 Generated with Claude Code