# Final integration evidence: [#24263](https://git.cafe/pingdotgg/t3code/pulls/24263)

**PASS scoped host evidence; MERGE code-review recommendation. No confirmed new blocker. Native execution remains unverified.**

Final head [6fc097e](https://github.com/pingdotgg/t3code/commit/6fc097e420b550849c74c780e746b6c0624b6a56) (`6fc097e420b550849c74c780e746b6c0624b6a56`); current-main merge base [26c3625](https://github.com/pingdotgg/t3code/commit/26c3625f484eadd4d5b6ca5a3dd1f8f8bd5533b4) (`26c3625f484eadd4d5b6ca5a3dd1f8f8bd5533b4`). Clean checkout verified before and after. No source edits, commits, pushes, comments, merges, uploads, subagents, browser, emulator, server, remote-machine or userdata access. Forge CI/review state was not refreshed in this source-only audit; recommendation concerns these local pins.

## Fresh integration review

Read the full nine-file final diff and relevant native callers. Current main's entire HTML implementation (helpers through markdownWithHtml, including its reverse-splice loop) is byte-identical at head: SHA256 `8e8582eff53fcd5eb374fe1b39a905a5921b1034e59393039fc4f089c9c4318a`. HTML anchor support is inherited, with no new HTML/security surface in this PR diff. Production enrichedLinkPresentation module is unchanged: SHA256 `e57935e047bb59cbbdd577438b8f79b974d1f7878447548a9d6054f3ae19dd11`. Both full-source modules, call sites and test sources are pinned in source-manifest.json; verify-integration.py checks them against git objects and the exact merge base.

Baseline renderer order: HTML → inline file links → table breaks. Head: same HTML → combined AST file/table transform. File/table edits are assembled in source order without repeated whole-document splicing. Container-prefix insertion stays disjoint from cell edits. When actual AST file edits rewrite a pipe and table precheck succeeds, only file edits are applied before the original table pass; full fallback fixtures retain 2 → 2 parses. This preserves malformed backtick-prefix cases that a regex-only fallback missed. Existing links/reference links are excluded from file rewriting. Negative lookbehind prevents suffix retries within a backtick run. Native patch wiring and lockfile patch hash match; no web/desktop/server/contract/provider changes. JS applies to both mobile platforms; native patch is iOS-only; Android native code unchanged.

## Fresh JS evidence

**40,225 exact output comparisons; zero differences**: 4,574 capture + 6,176 extended streamed fixtures + 29,475 deterministic generated comparisons. The generated sample uses seed 24263, 1200 documents, 27075 combined prefixes plus 1,200 standalone file and 1,200 standalone table comparisons. Samples are evidence, not a universal equivalence proof. 29 focused tests in 3 files pass, including main's anchor tests; scratch config puts caches outside the source tree. Focused lint exits 0 with one inherited no-array-reverse warning in the unchanged HTML body.

Explicit extended fixtures cover main anchors in table cells with br, href pipe entities, entity-shaped attributes/labels, unsafe href text preservation, linked images, fenced anchors, HTML wrappers, pipe headers/bodies/after-normal spans and malformed delimiter prefixes. Every UTF-16 prefix runs with LF/CRLF/CR. Container/surrogate boundaries and nested fences are also covered. Historical bad revisions are compared only to historical baseline [22dc1da](https://github.com/pingdotgg/t3code/commit/22dc1dabc6d3b1616d0fa5017268c086a77887bc) in audit-check.mjs; they do not use current main as an oracle. Their failure flags remain historical.

Executed actual git-show TypeScript on v26.12.1 / linux x64, CPU `19/01`; dependencies {"unified": "11.0.5", "remark-parse": "11.0.0", "remark-gfm": "4.0.1"}. Actual production regex literal is extracted from each revision and equality checked. Uninstrumented timing modules; separate wrappers count entries into the actual parser.parse method. Full documents: two warmups/eight samples, alternating revision order. Stream: two warmups/five samples per revision, before then after. Final timing capture ran without other audit benchmark processes; host CPU/GC scheduling remains uncontrolled. No performance assertions.

Stream: **27 updates; 81 → 54 parses; 2896.152 → 1632.552 ms median (43.63% lower)**. 1024 UTF-16 units/update; final 27,100 UTF-8 bytes; maximum output 29,100/29,100 bytes. Virtual 50ms cadence means no timers/waits and no real-time/device claim. Raw samples/min/max in results.json.

| Fixture | Input bytes | Output bytes | Parses before → after | Before median ms | After median ms |
|---|---:|---:|---:|---:|---:|
| mixed | 27100 | 29100 | 3 → 2 | 243.511 | 141.214 |
| filesTables | 11500 | 17750 | 2 → 1 | 159.302 | 61.032 |
| plain | 25500 | 25500 | 0 → 0 | 0.053 | 0.053 |
| unmatchedBackticks | 12004 | 12004 | 0 → 0 | 134.935 | 0.084 |
| malformed3000Tokens | 15011 | 15023 | 1 → 1 | 47.843 | 45.085 |
| malformedHtml3000Tokens | 26998 | 26991 | 1 → 1 | 3.610 | 3.547 |
| mainAnchors | 17300 | 17600 | 3 → 2 | 132.381 | 81.861 |
| nestedFences | 69 | 54 | 2 → 2 | 0.336 | 0.308 |

“3000 tokens” means 3,000 malformed lexical fragments, not a model tokenizer count. Input families and actual UTF-8 bytes appear above; malformed3000Tokens is `[x](<` repeated 3,000 times plus a file candidate. HTML variant contains 3,000 varying backtick fragments. Scaling measurements use two warmups/eight samples per side, no timing assertions:

| Family | Fragments | Input bytes | Before median ms | After median ms |
|---|---:|---:|---:|---:|
| backticks | 750 | 754 | 0.551 | 0.007 |
| backticks | 1500 | 1504 | 2.146 | 0.011 |
| backticks | 3000 | 3004 | 8.514 | 0.021 |
| backticks | 6000 | 6004 | 33.831 | 0.040 |
| malformedFragments | 750 | 3761 | 11.289 | 6.731 |
| malformedFragments | 1500 | 7511 | 85.474 | 18.123 |
| malformedFragments | 3000 | 15011 | 56.889 | 39.040 |
| malformedFragments | 6000 | 30011 | 874.291 | 811.889 |

JS storage is logical UTF-8 content, not heap/RSS or simultaneous liveness. Mixed caller input+output is 56,200 bytes on both sides; distinct stage contents 108,200 → 79,200. Trace instrumentation deliberately retains parse input strings. AST/GC/allocator peaks are unmeasured. Splice assembly is O(N+output+E) for ordered disjoint edits; no blanket linear-time guarantee for Remark/GFM/regex/HTML, and growing prefixes still reparse the full input. Inherited HTML reverse splicing remains unchanged.

## Reused narrow native evidence

Native archive matches current base, head and old baseline. Patch, archive and harnesses exactly match premerge [db2b6e1](https://github.com/pingdotgg/t3code/commit/db2b6e143b2ea8b80efe9fea221500d658e500fe); installed cache header and coordinator match extracted archive+patch. verify-integration.py checks source and preserved evidence bytes. No native measurement was rerun or relabeled as newly executed.

- `patches/react-native-enriched-markdown@1.2.0-t3.15.patch`: `08e3061802f5333949ae54dbf0e8dd11d615a67473c7e71417d140b9759d5083`
- `apps/mobile/deps/react-native-enriched-markdown-1.2.0-t3.15-fee84114.tgz`: `21e638ea0323aebc826572aadcfc7aee4154367a1214a406459a1f5133854ee4`
- `apps/mobile/scripts/enriched-markdown-native-tests.mm`: `5f87570e5d43d190cf2840c91c7ad4b4b06297b41d7587f915db253636ad4632`
- `apps/mobile/scripts/test-enriched-markdown-native.mjs`: `6162b048cb7d61a3d7e71eab706647eed364a9a79d8951dca7f118ede4af4f3c`

Actual portable C++ key/hash/cache bodies were extracted, compiled and tested on Linux (CGFloat=double, private state exposed, unrelated React prop helpers omitted). This is **narrow host proof, not iOS cache execution**. Reused 512 growing documents (+1024 ASCII bytes/update): **269,246,464 → 8,388,288 accounted bytes; 512 → 8 retained entries**. Semantic tests cover byte eviction, all six oversized string fields, update/removal reuse, exact boundary/overflow and entry-count LRU. Accounted cap 8,388,608 bytes includes both key copies and struct sizes, excludes allocator/bucket/node overhead, string capacity, caller keys and render state. Reused host medians 313.734/88.677 ms include key introspection after each insertion; no native speed claim.

Pending queue proof is **HOST MODEL ONLY**: synthetic source strings and serial state transitions, no ObjC/ARC/real dispatch/synchronization/layout. Held-worker burst: **134,479,872 → 524,288 unique modeled source bytes; 512 → 1 renders**, both eventually apply revision 512. In-flight renders [1,3], applies [3]; invalidation drops pending work and suppresses stale apply. Model timing measures string construction/accounting, not native render speed. Failed-render, blockAsyncRender and real scheduling/concurrency are omitted.

**Stalled main queue limit:** completed apply captures can accumulate while background drains; model reaches 134,479,872 source bytes. Actual apply blocks capture render results, so this is not native payload accounting. One in-flight plus one pending bounds background work only; no global two-revision or total-memory bound.

## Reproduce and verify

Prerequisites: these git objects, installed mobile dependencies, Node/Vite+, and the preserved sibling historical-db2b6e-evidence directory for exact reused-evidence verification. Run sequentially; source tree remains read-only:

```sh
cd /home/ubuntu/wt/pr-24263
python3 /tmp/takeover-24263/evidence/pin-sources.py
node /tmp/takeover-24263/evidence/capture.mjs > /tmp/takeover-24263/evidence/capture.log
node /tmp/takeover-24263/evidence/extra-equivalence.mjs
node /tmp/takeover-24263/evidence/integration-differential.mjs > /tmp/takeover-24263/evidence/integration-differential.log
node /tmp/takeover-24263/evidence/parse-trace.mjs
node /tmp/takeover-24263/evidence/scaling.mjs
vp test run --config /tmp/takeover-24263/evidence/focused.config.mjs --cache false > /tmp/takeover-24263/evidence/focused-tests.log 2>&1
vp lint apps/mobile/src/lib/markdownDocument.ts apps/mobile/src/lib/markdownInlineFileLinks.test.ts apps/mobile/src/native/EnrichedMarkdownText.tsx apps/mobile/scripts/test-enriched-markdown-native.mjs
python3 /tmp/takeover-24263/evidence/verify-integration.py
node /tmp/takeover-24263/evidence/audit-check.mjs
python3 /tmp/takeover-24263/evidence/write-report.py
cd /tmp/takeover-24263/evidence
sha256sum -c SHA256SUMS
sha256sum -c proof-audit.md.sha256
```

write-report.py regenerates both reports, provenance, fixture matrix JSON/CSV and hashes. SHA256SUMS covers all regular evidence files except itself; node_modules symlink excluded. It also writes a separate proof-audit.md.sha256. Timing reruns replace observational samples. cache-capture.py now pins final head/current main and can independently rebuild host C++ evidence; pending-model.mjs can rerun the model. Those optional remeasurements replace reused artifacts and require updating reuse provenance/verification rather than claiming identical historical measurement bytes.

UNVERIFIED: native iOS cache, ObjC harness/runtime, device rendering/layout/ARC/native memory (Linux lacks macOS Foundation/device); Android rendering (emulator unavailable, execution prohibited). No browser/server/emulator/remote/userdata use. No uploads.

FRICTION: old active evidence used the premerge head/old baseline; preserved intact as historical-db2b6e-evidence and refreshed all affected JS against the final head/current-main merge base. Corrected historical oracle separation and hardcoded report values. An initial timing capture overlapped other audit work and was replaced by the final solo audit capture. git diff --check flags space-only context lines inside the dependency patch; these are required unified-diff context, not executable-source whitespace. Focused lint exits 0 with the inherited no-array-reverse warning in the unchanged HTML body. No unresolved source-freshness or scoped-host evidence discrepancy.
