Skip to content

fix: land four audited fork fixes (#253, #157, #345, #255) - #417

Merged
lukemaj merged 6 commits into
mainfrom
integrate/issue-audit-fixes
Oct 18, 2026
Merged

lukemaj merged 6 commits into
mainfrom
integrate/issue-audit-fixes

Conversation

@lukemaj

@lukemaj lukemaj commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What changed: Four reviewed fork fixes land on main: ContextMD startup hooks no longer lose context when they beat run registration (#253), launcher test fixtures can no longer outlive a killed runner (#157), legacy terminal labels survive supplementary Unicode letters on Node 26 (#345), and stopped runs explain a restart cut in the timeline (#255).
Why: Each one was a confirmed defect from the open-issue audit, and the issue-audit handoff (#406) authorized fixing them in parallel.
So what: Each component already passed two independent reviews (GPT-6.1 Sol medium and Grok 4.7 medium) at its exact head. This combined candidate needs its own two independent reviews, and then the maintainer's approval to merge into main.

Rebased onto post-#419 origin/main f27d8ee146295ed2b76d8d15d415dd7cff574df5. Previous head 0fec590ad25dc9d4069e2f144d5ed3e3324079a4 was based on dfb9235. New head 61df489e4126410661643c0ecbe44192e879877b.

Components (merged into integrate/issue-audit-fixes; originally linear on main dfb9235, now on main f27d8ee146)

Issue PR Original squash Rebased commit Review
#345 legacy terminal labels #412 9f4bb04 78c85fed6e 2 rounds; both approved at a1a46fe
#255 restart explanation beside stopped runs #413 eca9650 ae22a5f687 2 rounds; Sol r1 blocking (truncated summary) fixed; both approved at beee2a1
#157 launcher fixture lifetime #414 40f4b47 00fb6d42b3 2 rounds; both approved at 2f28364
#253 ContextMD startup join #415 e1121d4 3f437d35a7 4 rounds; 10 blocking findings fixed; both approved at 7409b7a

Map citations rebased as 3de36c853d (cite PR #417) and 61df489e41 (parser-readable spacing). The map line is %% RS: #264 PR #417. Main's other map refs stayed.

Each component's evidence is in its PR's review comment and its Issue handoff.

Conflicts on the rebase

None of the four fixes was already present on post-#419 main. Restart-cut fields and restartCutView are still on main, and the client notice is still the missing piece. The Unicode boundary is still the character class this fix replaces. ContextMD still had no startup-registration join.

Proof

./node_modules/.bin/vp test run \
  packages/shared/src/composerContextLegacy.test.ts \
  packages/client-runtime/src/state/restartCutPresentation.test.ts \
  apps/server/src/serviceLauncher.test.ts \
  apps/server/src/contextmd/ContextmdServing.test.ts \
  apps/server/src/contextmd/ServingState.test.ts \
  apps/server/src/orchestration-v2/ProviderTurnStartService.bare.test.ts \
  apps/server/src/orchestration-v2/ProviderTurnStartService.test.ts

Test Files 7 passed (7). Tests 286 passed (286). Duration 16.89s.

./node_modules/.bin/vp run --filter t3 --filter @t3tools/shared --filter @t3tools/client-runtime typecheck

Exit 0. No error TS. Effect suggestions only, including files this rebase did not change.

./node_modules/.bin/vp lint --report-unused-disable-directives <the 14 touched ts/mjs files>

0 errors, 3 warnings. The warnings are unused HostProcess, serverConfig, and serverSettings in ProviderTurnStartService.ts, already present on f27d8ee146.

bash scripts/fork-check.sh

fork-check: OK. fork-features: OK (49 features). Default base is the merge-base with upstream/main (d0918f1659), 143 commits, which includes this rebase.

Unverified

No version bump, per project policy.

Elon record

Requirements and who asked: The user asked for one GPT-6.1 Sol medium author per issue (#253, #157, #345, #255) and Sol medium and Grok 4.7 medium reviews of every final candidate, run in parallel as fast as possible (#406 handoff).
Deleted: Polling and timeout increases for #253, a duplicate cancelReason contract for #255, pattern-based process cleanup for #157, and any broader parser change for #345.
Bottleneck: Review convergence on #253's late-registration recovery path.
Checked myself: Each PR's exact head, base and CI before posting review/independent and merging; the Fork Stack Model failure cause; the orphaned fixture PID's identity; and integration linearity against main.

Closes #253
Closes #157
Closes #345
Closes #255

Implemented by GPT-6.1 Sol (Codex) and reviewed by GPT-6.1 Sol (Codex) and Grok 4.7 (Grok), coordinated by Claude Opus 5.5 (Claude Code in T3 Code). Rebased onto post-#419 main by Grok 4.7 (Grok in T3 Code).

🤖 Generated with Claude Code

@github-actions github-actions Bot added the vouch:trusted Author is trusted by repo permissions or the VOUCHED list. label Oct 18, 2026
lukemaj added a commit that referenced this pull request Oct 18, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅
Codex Live turn messages 2 2 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅
Claude Live turn messages 2 2 0 (0.0%) 8 ✅

Baseline: f27d8ee · PR result: 61df489 · Source CI: success

Scenario and decoded snapshot size

10 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.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@lukemaj

lukemaj commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

Independent review: passed at 0fec590ad25dc9d4069e2f144d5ed3e3324079a4 (final candidate, round 2).

Unverified (unchanged): real-client rendering for #255, live Claude/Grok processes for #253, and #157 forced termination beyond the fixture/IPC boundary.

🤖 Generated with Claude Code

@lukemaj

lukemaj commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

Agent cost: not published. agent-observer sync (1.1.5) failed with database is locked twice, so the ledger is stale. A dry run showed only 10 Grok responses out of the whole Codex, Grok and Claude task tree, and publishing that would understate the cost. Rerun agent-observer publish --task toolboxmd/chromeria#417 --repo toolboxmd/chromeria --pr 417 once the ledger lock clears.

🤖 Generated with Claude Code

@lukemaj

lukemaj commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

Real-client verification of candidate 0fec590 (isolated dev server from this branch, its own .t3 state, Claude Haiku 5.5):

  • Show the restart explanation beside stopped runs #255 on web (desktop wraps the same UI): started a turn running a 240-second foreground command, then restarted the dev server mid-turn. The timeline showed "Stopped by restart" beside the cut run and then "T3 Code restarted and resumed this turn". Expanding the row showed: "Stopped because Chromeria restarted. Continuation started (run 4, running)."
  • Show the restart explanation beside stopped runs #255 on iOS (iPhone 17 Pro Max simulator, native dev client built from this branch): the same thread shows the "Stopped by restart" row. Tapping it expands to: "Stopped because Chromeria restarted. Continuation started (run 4, completed)."
  • ContextMD startup events can arrive before their run is registered #253 live Claude session: with ContextMD hooks pointed at the dev server, a new Claude thread recorded session_start as ok, joined to its run (run:thread:985f776a…), followed by user_message ok and before_done ok. The first prompt's delivery returned 200 with the Great Library context, and it was settled. This proves startup joining and delivery on a real session. Whether this particular start hit the late-registration race is timing-dependent and wasn't forced. That ordering is covered by the deterministic regressions.

Not covered: the Electron desktop shell (same web UI) and Android (no emulator installed).

🤖 Generated with Claude Code

lukemaj and others added 6 commits October 18, 2026 23:01
…ters (#412)

* fix(shared): preserve terminal labels after supplementary Unicode letters

* fix(fork): register legacy terminal label repair
* fix(clients): explain restart cuts beside stopped runs

* fix(clients): make restart explanations expandable
* fix(server): stop launcher test fixtures when their runner exits

* chore(fork): register launcher test fixture ownership
* fix(contextmd): retry early startup joins during registration

* fix(contextmd): retain startup events until native session registration

* fix(contextmd): close startup registration review races

* fix(contextmd): preserve startup budgets and prompt outside hooks

* fix(contextmd): exempt fresh startup files that replace carries

* fix(contextmd): preserve recovered startup delivery limits

* test(contextmd): cover retained Grok Cue rules

* fix(contextmd): retain startup carries deferred by pointer output
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lukemaj
lukemaj force-pushed the integrate/issue-audit-fixes branch from 0fec590 to 61df489 Compare October 18, 2026 21:07
@lukemaj

lukemaj commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

What: Independent review of head 61df489e4126410661643c0ecbe44192e879877b found no actionable defects.
Why: The rebased registration hook runs after the running attempt commits, and startup recovery rechecks run identity before carrying context.
So what: No blocking change is needed for this candidate.

Reviewed the rebase-sensitive ContextMD registration/recovery path, restart-cut presentation through the shared web/mobile atom, Unicode label boundary, launcher fixture teardown, and added synchronization tests. I found no concrete failure scenario to report.

Verdict: SUCCESS (no blocking finding).

@lukemaj

lukemaj commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

What: Final independent review of head 61df489e4126410661643c0ecbe44192e879877b (base f27d8ee146) found no blocking defect. There are two non-blocking notes.
Why: All four fixes still meet their Issues' acceptance on post-#419 main. The rebase changed only the three declared conflict regions, and the #253 hook is still the only place that commits a starting → running attempt.
So what: The parent posts review/independent. Merging still needs maintainer approval.

Reviewer: Claude Opus 5.5 (Claude Code in T3 Code), read-only, no worktree.

What I checked

Findings

  1. Non-blocking (performance). packages/client-runtime/src/state/restartCutPresentation.ts:16-21 builds lastRowByRun with a flatMap over every visible row before it checks whether any run has restartCut or a continuation link. The projector runs whenever visibleTurnItems or runs changes identity, which includes every streaming update. So threads that have never been cut by a restart pay one O(rows) allocation pass per delta. A long thread streaming a reply does this work on every token batch, even though the result is always rows. Fix: return rows early when no run has restartCut and none has restartContinuationOfRunId, before building the map. This does not affect correctness.
  2. Non-blocking (map). docs/map.md:67 reads %% RS: #264 PR #417. fix(clients): explain restart cuts beside stopped runs #413's handoff asked to add Show the restart explanation beside stopped runs #255 beside Restart continuation silently skips some cut turns; Codex threads were never continued #264 ("Add Show the restart explanation beside stopped runs #255 to the existing RS … part's refs"), as SN lists its several Issues. Without it, the Map tab does not connect this part to Show the restart explanation beside stopped runs #255 when Show the restart explanation beside stopped runs #255 closes. Suggested line: %% RS: #264 #255 PR #417.

Unverified (unchanged from the PR)

Verdict: SUCCESS (no blocking finding).

@lukemaj
lukemaj merged commit bdb8d01 into main Oct 18, 2026
29 checks passed
@lukemaj
lukemaj deleted the integrate/issue-audit-fixes branch October 18, 2026 21:41
lukemaj added a commit that referenced this pull request Oct 29, 2026
* fix(shared): preserve terminal labels after supplementary Unicode letters (#412)

* fix(shared): preserve terminal labels after supplementary Unicode letters

* fix(fork): register legacy terminal label repair

* fix(clients): explain restart cuts beside stopped runs (#413)

* fix(clients): explain restart cuts beside stopped runs

* fix(clients): make restart explanations expandable

* fix(server): stop launcher test fixtures when their runner exits (#414)

* fix(server): stop launcher test fixtures when their runner exits

* chore(fork): register launcher test fixture ownership

* fix(contextmd): join startup events when native sessions register (#415)

* fix(contextmd): retry early startup joins during registration

* fix(contextmd): retain startup events until native session registration

* fix(contextmd): close startup registration review races

* fix(contextmd): preserve startup budgets and prompt outside hooks

* fix(contextmd): exempt fresh startup files that replace carries

* fix(contextmd): preserve recovered startup delivery limits

* test(contextmd): cover retained Grok Cue rules

* fix(contextmd): retain startup carries deferred by pointer output

* docs(map): cite PR #417 for restart-cut explanation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(map): use parser-readable ref spacing for RS

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

1 participant