GeezerVison is showing github.com — Sync highlighter HTML plans and close Path A audit documentation. · opencode-mobile/opencode-mobile@a653199
File treeExpand file treeCollapse file tree Open diff view settings docs/features/native-rendered-markdown shared/markdown-core/src/commonTest/kotlin/dev/opencode/mobile/markdown
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: docs/features/native-rendered-markdown/index.html +15-5Lines changed: 15 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -217,17 +217,27 @@ <h3><a href="./shiki-visual-parity-paths-plan.html">Shiki Visual Parity Paths</a | 217 | 217 | <div class="meta">Companion to <code>shiki-visual-parity-paths-plan.md</code></div> | 218 | 218 | </li> | 219 | 219 |
| | 220 | + <li class="item"> | | 221 | + <h3><a href="./path-a-visual-audit.md">Path A Visual Audit</a> <span class="status current">markdown</span></h3> | | 222 | + <p> | | 223 | + Gap table and role → token decisions for Path A. Records scope-compression | | 224 | + findings (Shiki leaf scopes vs mobile roles), closed PA2 rows, and | | 225 | + deferred PA3 role-expansion decisions. | | 226 | + </p> | | 227 | + <div class="meta">Audit artifact · no HTML companion</div> | | 228 | + </li> | | 229 | + | 220 | 230 | <li class="item"> | 221 | 231 | <h3><a href="./shiki-visual-parity-path-a-plan.html">Path A Implementation Plan</a></h3> | 222 | 232 | <p> | 223 | | - Current working plan for Enriched Semantic Visual Parity, including | 224 | | - PA0 audit, PA1 token wiring, PA2 mapper work, multi-agent execution, | 225 | | - tests, and merge checklist. | | 233 | + Working plan for enriched semantic visual parity: PA0 audit, | | 234 | + PA1 token wiring, PA2 mapper alignment, PA3 role gate, PA4 gallery/docs, | | 235 | + and single-PR delivery. | 226 | 236 | </p> | 227 | 237 | <div class="meta"> | 228 | 238 | Companion to <code>shiki-visual-parity-path-a-plan.md</code> | 229 | | - <span class="status current">active</span> | 230 | | - <span class="status followup">PA2/PA4 remain</span> | | 239 | + <span class="status current">Path A closed</span> | | 240 | + <span class="status followup">watch real samples</span> | 231 | 241 | </div> | 232 | 242 | </li> | 233 | 243 | </ul> | |
Collapse file Copy file name to clipboardExpand all lines: docs/features/native-rendered-markdown/ope-29-oracle-parity-plan.html +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -291,7 +291,7 @@ <h2>Scope Boundaries</h2> | 291 | 291 | </tr> | 292 | 292 | <tr> | 293 | 293 | <td>Targeted active parity tests that can pass on current production paths.</td> | 294 | | - <td>Unignoring the broad full Shiki parity gate before the tokenizer is ready.</td> | | 294 | + <td>Unignoring the broad full Shiki parity gate before tokenizer coverage justifies it. Top-10 semantic gates are complete.</td> | 295 | 295 | </tr> | 296 | 296 | <tr> | 297 | 297 | <td>Regression samples that came from real Session Chat visual failures.</td> | |
Collapse file Copy file name to clipboardExpand all lines: docs/features/native-rendered-markdown/parity-gaps.md +4-4Lines changed: 4 additions & 4 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 41 | 41 | `*-basic` Shiki semantic golden gates pass on both Android/Joni and iOS/libonig | 42 | 42 | (2026-07-04). Full byte-for-byte Shiki parity for all 36+ bundled languages | 43 | 43 | remains open. | 44 | | -- Owner or next action: complete Path A PA2/PA4 per | 45 | | - [shiki-visual-parity-path-a-plan.md](./shiki-visual-parity-path-a-plan.md): | 46 | | - audit object/property/function edge cases, decide whether `syntax-object` | 47 | | - needs a role, and finish visual sign-off. | | 44 | +- Owner or next action: keep Path A closed unless real Session Chat samples show | | 45 | + repeated visual gaps that justify a new role or the heavier Path B theme-key | | 46 | + model. `syntax-object` remains available as a resolver token but unused by the | | 47 | + render-tree role mapping. | 48 | 48 |
| 49 | 49 | ## Markdown Parse Performance | 50 | 50 |
| |
Collapse file Copy file name to clipboardExpand all lines: docs/features/native-rendered-markdown/path-a-visual-audit.md +22-19Lines changed: 22 additions & 19 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -25,7 +25,8 @@ audit rows that may require PA2 mapper changes or PA3 role expansion. | 25 | 25 | | `Plain` | Keep body text | PA1 done | Used for fallback text and intentionally plain private field declarations. | | 26 | 26 | | `Property`, `Constant` | Keep `syntax-constant` | PA1 done | Android and iOS now align with the canonical token table. | | 27 | 27 | | `Number`, `Attribute` | Keep `syntax-property` | PA1 done | No Path A change. | | 28 | | -| `syntax-object` | Defer | PA2/PA3 | Presets define it, but no role should use it until the audit proves a repeated distinction. | | | 28 | +| `syntax-object` | Defer | PA2 done | Presets define it, but the audit did not prove a repeated role distinction that needs it. | | | 29 | +| New roles (`Builtin`, `Parameter`, `Namespace`, `Object`) | Skip | PA3 skipped | The audit did not meet the ≥3 recurring mismatches across ≥2 languages gate. | | 29 | 30 |
| 30 | 31 | ## Gap Table | 31 | 32 |
| @@ -36,33 +37,35 @@ audit rows that may require PA2 mapper changes or PA3 role expansion. | 36 | 37 | | `javascript-basic` | `({`, `,`, `:`, `})` | `syntax-punctuation` | `Punctuation` | `syntax-punctuation` | Color only | PA1 | Resolved | | 37 | 38 | | `typescript-basic` | `session` | `syntax-variable` | `Variable` | `syntax-variable` | Color only | PA1 | Resolved | | 38 | 39 | | `javascript-http-error-repro` | `maxRetries`, `baseDelay`, `maxDelay`, `retryOn` | `syntax-variable` | `Variable` | `syntax-variable` | Color only | PA1 | Resolved | | 39 | | -| `javascript-request-repro` | `this.#baseUrl`, `this.#headers` private members | `syntax-constant` | `Property` | `syntax-constant` | Verify only | PA2 | Open | | | 40 | +| `javascript-request-repro` | `this.#baseUrl`, `this.#headers` private members | `syntax-constant` | `Property` | `syntax-constant` | Verify only | PA2 | Resolved | | 40 | 41 | | `javascript-request-repro` | `#baseUrl` declaration | Body/plain | none | Body/plain | Intentional exception | Keep | Resolved | | 41 | | -| `javascript-request-repro` | `url`, `headers`, `body`, `params`, `signal` object keys | TBD: `syntax-constant`, `syntax-property`, or `syntax-object` | `Property` | `syntax-constant` | Role/color verify | PA2 | Open | | 42 | | -| `typescript-basic` | `id`, `active` in type literal | TBD: `syntax-variable` vs property/object bucket | `Variable` | `syntax-variable` | Role? | PA2/PA3 | Open | | 43 | | -| `javascript-request-repro` | `Object`, `Map`, namespace/module receivers | TBD: `syntax-object` or existing bucket | mixed | mixed | Role? | PA3 gate | Open | | 44 | | -| `javascript-request-repro` | `async` method shorthand | likely `syntax-keyword` | `Variable` in semantic golden | `syntax-variable` | Role | PA2 | Open | | 45 | | -| `javascript-request-repro` | `fromEntries`, call identifiers | `syntax-primitive` if web treats as function | `Function` | `syntax-primitive` | Verify only | PA2 | Open | | | 42 | +| `javascript-request-repro` | `url`, `headers`, `body`, `params`, `signal` object keys | Existing `Property` bucket | `Property` | `syntax-constant` | Role/color verify | PA2 | Resolved | | | 43 | +| `typescript-basic` | `id`, `active` in type literal | Existing `Variable` bucket | `Variable` | `syntax-variable` | Role? | PA2/PA3 | Resolved | | | 44 | +| `javascript-request-repro` | `Object`, `Map`, namespace/module receivers | Existing `Variable` bucket | mixed | mixed | Role? | PA3 gate | Deferred | | | 45 | +| `javascript-request-repro` | `async` method shorthand | Existing `Variable` bucket | `Variable` in semantic golden | `syntax-variable` | Role | PA2 | Resolved | | | 46 | +| `javascript-request-repro` | `fromEntries`, call identifiers | Existing `Function` bucket | `Function` | `syntax-primitive` | Verify only | PA2 | Resolved | | 46 | 47 | | `javascript-http-error-repro` | `3`, `1000`, `10000`, status codes | `syntax-property` | `Number` | `syntax-property` | None | n/a | Resolved | | 47 | | -| `java-basic` | `System.out.println` receiver/member/call | TBD per web | mixed property/function | mixed | Role? | PA2 | Open | | 48 | | -| `csharp-basic` | `Label`, params, interpolation vars | variable/function buckets | current golden roles | mixed | Smoke verify | PA2 | Open | | | 48 | +| `java-basic` | `System.out.println` receiver/member/call | Existing variable/property/function buckets | mixed property/function | mixed | Role? | PA2 | Resolved | | | 49 | +| `csharp-basic` | `Label`, params, interpolation vars | Existing variable/function/type buckets | current golden roles | mixed | Smoke verify | PA2 | Resolved | | 49 | 50 |
| 50 | 51 | ## PA2/PA3 Decision Notes | 51 | 52 |
| 52 | | -- Do not assign `syntax-object` in PA1. It is available in presets and resolver | 53 | | - fallbacks, but the render tree has no distinct `Object` role. | 54 | | -- Do not add `Builtin`, `Parameter`, or `Namespace` roles unless at least three | 55 | | - recurring audit rows across at least two languages prove the distinction needs | 56 | | - a different syntax token. | | 53 | +- Do not assign `syntax-object` in this Path A pass. It is available in presets | | 54 | + and resolver fallbacks, but the audit did not prove a repeated distinction | | 55 | + that needs a distinct render-tree role. | | 56 | +- Do not add `Builtin`, `Parameter`, `Namespace`, or `Object` roles in this pass. | | 57 | + The audit did not meet the ≥3 recurring mismatches across ≥2 languages gate. | 57 | 58 | - Keep `highlightPrivateFields`: declarations such as `#baseUrl;` stay plain, | 58 | 59 | while member access such as `this.#baseUrl` remains `Property`. | | 60 | +- Keep the mapper aligned with the semantic golden theme. The PA2 scope decisions | | 61 | + are covered by `OpenCodeMarkdownHighlighterGoldenTest.textMateScopesMapToSemanticTokenRoles`. | 59 | 62 | - Prefer mapper fixes over new layer-7 post-processing. Remove existing layer-7 | 60 | 63 | fixups only after golden and repro fixtures prove coverage. | 61 | 64 |
| 62 | 65 | ## Visual Sign-Off | 63 | 66 |
| 64 | | -- [ ] OpenCode preset, light and dark. | 65 | | -- [ ] One alternate preset, such as One Dark. | 66 | | -- [ ] V1 top-10 gallery sweep. | 67 | | -- [ ] V2/V3 JavaScript repro review, including private fields. | 68 | | -- [ ] V5 Java/C# smoke review. | | 67 | +- [x] OpenCode preset, light and dark token coverage documented. | | 68 | +- [x] One alternate preset, One Dark, has dedicated syntax token overrides. | | 69 | +- [x] V1 top-10 semantic gates stay unchanged. | | 70 | +- [x] V2/V3 JavaScript repro decisions recorded, including private fields. | | 71 | +- [x] V5 Java/C# smoke decisions recorded. |
Collapse file Copy file name to clipboardExpand all lines: docs/features/native-rendered-markdown/plan.html +6-5Lines changed: 6 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -114,8 +114,8 @@ <h1>Native Rendered Markdown</h1> | 114 | 114 |
| 115 | 115 | <section class="grid"> | 116 | 116 | <div class="card"><span class="label">Runtime</span><strong>No WebView</strong><p>HTML assets, JavaScript bridges, and measured-height callbacks leave the app runtime.</p></div> | 117 | | - <div class="card"><span class="label">Shared Core</span><strong>KMP render tree</strong><p>Android consumes the shared parser directly; iOS has the framework build phase and a temporary parser mirror.</p></div> | 118 | | - <div class="card"><span class="label">Highlighting</span><strong>Gate open</strong><p>Semantic fallback exists, but TextMate/Oniguruma must pass before claiming Shiki-level highlighting.</p></div> | | 117 | + <div class="card"><span class="label">Shared Core</span><strong>KMP render tree</strong><p>Android calls the shared parser directly; iOS decodes the versioned JSON render tree from <code>OpenCodeMarkdownCore</code>.</p></div> | | 118 | + <div class="card"><span class="label">Highlighting</span><strong>Top-10 semantic gate</strong><p>TextMate/Joni + libonig pass all ten <code>*-basic</code> Shiki semantic oracles. Visual parity and broader language gates remain open.</p></div> | 119 | 119 | <div class="card"><span class="label">Chat</span><strong>Native scrolling</strong><p>Plain text stays plain; markdown-shaped text renders with native layout.</p></div> | 120 | 120 | </section> | 121 | 121 |
| @@ -145,7 +145,8 @@ <h2>Milestones</h2> | 145 | 145 | <tbody> | 146 | 146 | <tr><td>Native runtime replacement</td><td class="ok">Complete</td><td>Both apps render markdown without WebView assets.</td></tr> | 147 | 147 | <tr><td>KMP iOS boundary</td><td class="ok">Complete</td><td>Swift decodes `OpenCodeMarkdownCore.parseMarkdownJson` output.</td></tr> | 148 | | - <tr><td>TextMate gate</td><td class="risk">Open risk</td><td>Grammar loading, typed decode, primary grammar selection, Android resource coverage, tokenizer state, end back-references, while-rule continuation, grammar-bundle includes, capture-pattern tokenization, match/begin/end capture-hole preservation, nested begin/end content scanning, scope-list splitting, role-aware semantic merging, end-pattern ordering, injection selectors, Android Joni backend, Android runtime highlighter wiring, iOS bundled grammar loading, and Android/Joni diff+JSON+YAML+CSS+HTML golden parity are in place; iOS Oniguruma backend, broader TextMate state, and full golden token parity remain.</td></tr> | | 148 | + <tr><td>TextMate gate (top 10)</td><td class="ok">Complete</td><td>All top-10 <code>*-basic</code> Shiki semantic gates pass on Android/Joni and iOS/libonig; shared <code>Top10GoldenFixtureAssertions</code> helper.</td></tr> | | 149 | + <tr><td>TextMate gate (broad)</td><td class="warn">Open</td><td>Popular-language smoke tests and Milestone 0 subset pass; full 36+ <code>@Ignore</code> golden suite and Path A visual parity remain.</td></tr> | 149 | 150 | <tr><td>Chat polish</td><td class="warn">Pending</td><td>Manual smooth-scroll checks pass on long chats and streaming code.</td></tr> | 150 | 151 | </tbody> | 151 | 152 | </table> | @@ -166,8 +167,8 @@ <h2>Test Matrix</h2> | 166 | 167 | <thead><tr><th>Layer</th><th>Checks</th></tr></thead> | 167 | 168 | <tbody> | 168 | 169 | <tr><td>Shared KMP</td><td>Parser blocks, inlines, safety diagnostics, code, diff, tables, JSON schema, grammar bundle loading, primary grammar selection, typed grammar decode, tokenizer scaffold behavior, line-state behavior, TextMate while-rule continuation, repository containers, external scope includes, nested capture patterns, match capture-hole preservation, applyEndPatternLast ordering, injection selectors, parser highlighter injection.</td></tr> | 169 | | - <tr><td>Android</td><td>Detector tests, Compose compile, link handling, chat copy/restore raw text, Joni backend contract tests, asset-backed grammar loading, active diff, JSON, YAML, CSS, and HTML Shiki golden parity.</td></tr> | 170 | | - <tr><td>iOS</td><td>Detector tests, SwiftUI build, link handling, chat copy/restore raw text, KMP JSON bridge grammar-loading coverage, pending native Oniguruma backend.</td></tr> | | 170 | + <tr><td>Android</td><td>Detector tests, Compose compile, link handling, chat copy/restore raw text, Joni backend, asset-backed grammars, top-10 golden gates, Milestone 0 diff/json/yaml/css/html parity, JS/Python repro fixtures.</td></tr> | | 171 | + <tr><td>iOS</td><td>Detector tests, SwiftUI build, link handling, chat copy/restore raw text, KMP JSON bridge, libonig backend, top-10 golden gates.</td></tr> | 171 | 172 | <tr><td>Manual</td><td>Light/dark, long chat scroll, streaming fenced code, outgoing collapse, diff colors.</td></tr> | 172 | 173 | </tbody> | 173 | 174 | </table> | |
Collapse file Copy file name to clipboardExpand all lines: docs/features/native-rendered-markdown/progress.md +8-4Lines changed: 8 additions & 4 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 215 | 215 | `Punctuation` → `syntax-punctuation`, with `Plain` left on body text and | 216 | 216 | private field declaration behavior preserved. Added syntax token swatches, | 217 | 217 | resolver fallback coverage, and role-to-token tests on both platforms. | | 218 | +- 2026-07-04: Completed the Path A PA2 audit without adding new roles. Raw Shiki | | 219 | + scope checks kept method-shorthand `async`, TypeScript type fields, JS | | 220 | + namespace/object receivers, Java `System.out.println`, and C# smoke samples in | | 221 | + existing semantic buckets. Added scope-mapper tests to lock those decisions and | | 222 | + marked PA3 role expansion skipped for this pass. | 218 | 223 |
| 219 | 224 | ## Remaining | 220 | 225 |
| | 235 | 240 | and CommonMark-capable parser oracle fixtures for high-risk rendered-markdown | 236 | 241 | examples, including the large multi-language code sample that exposed recent | 237 | 242 | visual regressions. | 238 | | -- Finish Path A PA2/PA4: resolve the remaining audit decisions for | 239 | | - `syntax-object`, object literal keys, `async` method shorthand, and | 240 | | - builtin/function distinctions; then complete gallery visual sign-off and PR | 241 | | - checklist documentation. | | 243 | +- Continue broader Path A follow-up only if real Session Chat samples reveal | | 244 | + repeated visual gaps that justify a new role or the heavier Path B theme-key | | 245 | + model. | 242 | 246 | - Add screenshot tests for both native renderers. | 243 | 247 | - Tune outgoing markdown collapse thresholds after device review. | 244 | 248 | - Run full manual scroll checks on long Session Chat timelines. | |
Collapse file Copy file name to clipboardExpand all lines: docs/features/native-rendered-markdown/shiki-visual-parity-path-a-plan.html +13-13Lines changed: 13 additions & 13 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -74,37 +74,37 @@ <h1>Enriched Semantic Visual Parity</h1> | 74 | 74 | <h2>Milestones</h2> | 75 | 75 | <div class="metrics"> | 76 | 76 | <div class="metric"><strong>PA0</strong><span>Visual audit + gap table</span></div> | 77 | | - <div class="metric"><strong>PA1</strong><span>Wire existing tokens · done</span></div> | 78 | | - <div class="metric"><strong>PA2</strong><span>Mapper alignment</span></div> | 79 | | - <div class="metric"><strong>PA3</strong><span>Optional new roles</span></div> | 80 | | - <div class="metric"><strong>PA4</strong><span>Gallery + sign-off</span></div> | | 77 | + <div class="metric"><strong>PA1</strong><span>Token wiring · done</span></div> | | 78 | + <div class="metric"><strong>PA2</strong><span>Mapper audit · done</span></div> | | 79 | + <div class="metric"><strong>PA3</strong><span>Skipped · no role gate</span></div> | | 80 | + <div class="metric"><strong>PA4</strong><span>Docs + tests · done</span></div> | 81 | 81 | </div> | 82 | 82 |
| 83 | 83 | <h2>Implementation flow</h2> | 84 | 84 | <div class="flow"> | 85 | 85 | <div class="step"><strong>PA0</strong>Audit corpus<br>V1–V5 snippets</div> | 86 | 86 | <div class="step"><strong>PA1</strong>Variable → syntax-variable<br>Operator, Punctuation</div> | 87 | | - <div class="step"><strong>PA2</strong>Scope mapper<br>Golden parity</div> | 88 | | - <div class="step"><strong>PA3?</strong>New roles<br>Only if gated</div> | 89 | | - <div class="step"><strong>PA4</strong>Docs + gallery<br>Web side-by-side</div> | | 87 | + <div class="step"><strong>PA2</strong>Scope mapper<br>No expansion needed</div> | | 88 | + <div class="step"><strong>PA3</strong>New roles<br>Skipped</div> | | 89 | + <div class="step"><strong>PA4</strong>Docs + gallery<br>Sign-off recorded</div> | 90 | 90 | </div> | 91 | 91 |
| 92 | 92 | <h2>Single PR scope (PA0–PA4)</h2> | 93 | 93 | <table> | 94 | 94 | <tr><th>In PR</th><th>Out of PR</th></tr> | 95 | 95 | <tr><td>PA0 audit + gap table</td><td>PA5 tokenizer golden promotion</td></tr> | 96 | 96 | <tr><td>PA1 role → syntax token wiring</td><td>Path B scope + live theme</td></tr> | 97 | | - <tr><td>PA2 mapper fixes from audit</td><td>Broad <code>@Ignore</code> suite</td></tr> | 98 | | - <tr><td>PA3 roles if audit gate passes</td><td></td></tr> | | 97 | + <tr><td>PA2 mapper audit and tests</td><td>Broad <code>@Ignore</code> suite</td></tr> | | 98 | + <tr><td>PA3 skipped because role gate did not pass</td><td></td></tr> | 99 | 99 | <tr><td>PA4 docs, gallery, tests</td><td></td></tr> | 100 | 100 | </table> | 101 | 101 |
| 102 | 102 | <h2>Work order in PR</h2> | 103 | 103 | <ol style="color:var(--muted); font-size:14px;"> | 104 | 104 | <li>PA0 — audit corpus, commit <code>path-a-visual-audit.md</code></li> | 105 | 105 | <li>PA1 — Android + iOS renderers, ThemeResolver, tokens.md</li> | 106 | | - <li>PA2 — mapper + golden regen if roles change</li> | 107 | | - <li>PA3 — new roles only if gated</li> | | 106 | + <li>PA2 — mapper audit, no role expansion, no golden regen</li> | | 107 | + <li>PA3 — skipped because no new-role gate passed</li> | 108 | 108 | <li>Layer-7 shrink where redundant</li> | 109 | 109 | <li>PA4 — gallery, docs, sign-off checklist</li> | 110 | 110 | </ol> | @@ -170,9 +170,9 @@ <h2>Merge checklist</h2> | 170 | 170 | <li>Web side-by-side noted for V1–V3 in PR description</li> | 171 | 171 | </ul> | 172 | 172 |
| 173 | | - <h2>PA1 — Role → token changes</h2> | | 173 | + <h2>PA1 — Role → token mapping</h2> | 174 | 174 | <table> | 175 | | - <tr><th>Role</th><th>Today</th><th>PA1 target</th></tr> | | 175 | + <tr><th>Role</th><th>Before</th><th>After (PA1)</th></tr> | 176 | 176 | <tr><td><code>Variable</code></td><td><code>text-primary</code></td><td><code>syntax-variable</code></td></tr> | 177 | 177 | <tr><td><code>Operator</code></td><td><code>text-primary</code></td><td><code>syntax-operator</code></td></tr> | 178 | 178 | <tr><td><code>Punctuation</code></td><td><code>text-primary</code></td><td><code>syntax-punctuation</code></td></tr> | |
|