Skip to content

Commit d48c938

Browse files
committed
Merge rich patch ledger from cl-5697 into cl-5698
2 parents e1ea87a + 661abd6 commit d48c938

1 file changed

Lines changed: 97 additions & 10 deletions

File tree

vendor/intx-inference/PATCHES.md

Lines changed: 97 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ confirm every hunk still maps to an entry here (or, if upstream has since
2020
absorbed the same fix, drop the entry and its markers — verify by reading
2121
the new upstream code, not by assuming).
2222

23+
**Vocabulary:** the disposition labels map onto the three-way review
24+
taxonomy as follows — "Promotion candidate" = Upstreamable, "Long-lived" =
25+
Re-carryable, "Kill candidate" = Droppable, and "Companion" entries are
26+
Re-carryable but ride their primary patch's disposition (they ship out or
27+
die with it).
28+
2329
### 2026-09-07 re-sync (upstream `0205b07b`)
2430

25-
Every entry above was re-carried against the new pin; none was dropped as
31+
Every entry below was re-carried against the new pin; none was dropped as
2632
upstream-absorbed. The sync also dropped one divergence that was **not**
2733
ledgered at the time: `claude-fable-5-1` in `providers/anthropic.ts`'s
2834
`ADAPTIVE_THINKING_MODELS` and its "adaptive thinking request shape" suite in
@@ -39,7 +45,9 @@ and the `resolvedContextTransforms` resolution all sit alongside the new
3945
upstream code unchanged. New upstream code paths added inside the
4046
`tryCorrelate` critical section (none in this range) or after
4147
`executeTools`' history append (the doom-loop check) compose correctly with
42-
the carried patches. No entry's disposition changed.
48+
the carried patches. No entry's disposition changed. Every entry below
49+
carries a **Re-carry:** note recording the merge cost and the survivability
50+
risk going into the next sync.
4351

4452
## adapter-ts-stream-terminal-detector
4553

@@ -55,6 +63,8 @@ SSE loop.
5563
date until upstream adopts; downstream users not using OpenAI Responses
5664
protocol can ignore. **Removal path:** Upstream PR to
5765
`@intx/inference` adding `isStreamTerminal` to `ProviderAdapter`.
66+
**Re-carry:** clean three-way at `0205b07b`, zero conflicts. Low risk —
67+
`adapter.ts` is stable upstream and untouched by the doom-loop work.
5868

5969
## assembly-ts-deps-context-transforms
6070

@@ -70,6 +80,13 @@ a change to the published package.
7080
vendored package directly). **Removal path:** Upstream PR to `@intx/agent` to
7181
forward `contextTransforms` explicitly; then delete both this patch and
7282
`harness-ts-context-transforms`.
83+
**Obligation:** both `contextTransforms` patches have live consumers today —
84+
`src/session/assemble-runtime.ts:423` and `src/subagent/run.ts:880` — so they
85+
must be re-carried on every sync until upstream exposes the field; only then
86+
can they be killed.
87+
**Re-carry:** clean three-way at `0205b07b`, zero conflicts (upstream touched
88+
`assembly.ts` with a passthrough change; the hunk applied cleanly). Low
89+
risk, but the consumer obligation above keeps this on the sync checklist.
7390

7491
## errors-ts-classify-abort-reason
7592

@@ -84,6 +101,8 @@ four abort-check sites in `harness.ts`.
84101
optional `reason` param to `classifyAbortError` and enriching `raw`. **Removal
85102
path:** Upstream PR adding the optional `reason` parameter and `ClassifiedAbortRaw`
86103
type. No kill date until upstream ships it.
104+
**Re-carry:** clean three-way at `0205b07b`, zero conflicts. Low risk —
105+
`errors.ts` sees little upstream churn.
87106

88107
## harness-ts-context-transforms
89108

@@ -93,6 +112,10 @@ type. No kill date until upstream ships it.
93112
**Disposition:** Kill candidate — pair with `assembly-ts-deps-context-transforms`.
94113
**Removal path:** Upstream PR to `@intx/agent` exposing `contextTransforms`
95114
explicitly. Ships out together with the assembly patch.
115+
**Obligation:** live consumers at `src/session/assemble-runtime.ts:423` and
116+
`src/subagent/run.ts:880` — re-carry until upstream exposes the field, then
117+
kill.
118+
**Re-carry:** clean three-way at `0205b07b`, zero conflicts. Low risk.
96119

97120
## harness-ts-inactivity-on-semantic-progress
98121

@@ -105,6 +128,9 @@ produces events from a chunk.
105128
**Disposition:** Promotion candidate. Clear upstream bug fix — the inactivity
106129
timer should not re-arm on raw bytes. **Removal path:** Upstream PR to
107130
`@intx/inference` gating re-arm on parsed-event output.
131+
**Re-carry:** clean three-way at `0205b07b`, zero conflicts. Moderate risk —
132+
upstream reworked retry/failover inside `harness.ts`'s `runInference` wrapper;
133+
re-verify the SSE-loop arming site on the next sync.
108134

109135
## harness-ts-is-stream-terminal
110136

@@ -114,6 +140,8 @@ end-of-turn is a semantic event rather than `[DONE]` or socket close.
114140

115141
**Disposition:** Companion to `adapter-ts-stream-terminal-detector`. Ships
116142
out together when upstream adopts the `isStreamTerminal` hook.
143+
**Re-carry:** clean three-way at `0205b07b`, zero conflicts. Low risk;
144+
same sync-checklist caveat as the inactivity patch above.
117145

118146
## harness-ts-commitment-boundary-streaming
119147

@@ -135,6 +163,10 @@ that upstream would need to adopt wholesale, not a simple param fix.
135163
**Removal path:** Upstream redesigns `runInference` with commitment-boundary
136164
streaming built in. No kill date — this is the core streaming architecture
137165
for Corbits and likely to remain a fork patch for the foreseeable future.
166+
**Re-carry:** clean three-way at `0205b07b`, zero conflicts. Priority risk —
167+
upstream moved retry emission into `harness.ts`'s `runInference` wrapper,
168+
which is exactly the function this patch redesigns; re-verify the
169+
retry-suppression-after-commitment interaction on every sync.
138170

139171
## harness-ts-is-committing
140172

@@ -144,6 +176,8 @@ pre-commit metadata).
144176

145177
**Disposition:** Companion to `harness-ts-commitment-boundary-streaming`.
146178
Ships out together.
179+
**Re-carry:** clean three-way at `0205b07b`, zero conflicts. Priority risk —
180+
tracks the commitment-boundary patch.
147181

148182
## reactor-ts-ephemeral-turns
149183

@@ -153,10 +187,15 @@ history, so transient director guidance does not touch the cached transcript
153187
prefix. No native equivalent exists upstream. `index.ts` re-exports the type
154188
(mechanical; no separate marker).
155189

156-
**Disposition:** Long-lived. No upstream equivalent exists and is not planned.
157-
Ephemeral turns are a Corbits-specific mechanism for injecting transient
158-
director guidance. **Removal path:** Only if Corbits adopts an alternative
159-
mechanism for transient prompt injection. No kill date.
190+
**Disposition:** Long-lived. Upstream carries no transient-turn or
191+
prompt-injection mechanism as of `0205b07b` (verified by reading the
192+
upstream reactor at that SHA); no upstream issue or PR toward one exists in
193+
the clone. **Removal path:** Only if Corbits adopts an alternative mechanism
194+
for transient prompt injection. No kill date.
195+
**Re-carry:** clean three-way at `0205b07b`, zero conflicts. Priority risk —
196+
upstream's new doom-loop detection added run-scoped accounting and a fatal
197+
break path in `reactor.ts`; re-verify that ephemeral turns do not interact
198+
badly with doom-loop signatures or the run accounting on the next sync.
160199

161200
## reactor-ts-correlating-ids-leak
162201

@@ -170,6 +209,10 @@ exit clears it.
170209
**Disposition:** Promotion candidate. Clear upstream bug fix. **Removal
171210
path:** Upstream PR wrapping `tryCorrelate` in try/finally to clear
172211
`correlatingIds` on all exit paths.
212+
**Re-carry:** clean three-way at `0205b07b`, zero conflicts. Moderate risk —
213+
`tryCorrelate` sits adjacent to upstream's new signal-driven resume dispatch
214+
in `reactor.ts`; re-verify exit paths after upstream changes to gate
215+
clearing.
173216

174217
## reactor-ts-checkpoint-after-tool-cycle
175218

@@ -183,19 +226,26 @@ committed only at cycle terminals).
183226
interrupting after a tool cycle must not lose committed tool turns.
184227
**Removal path:** Upstream PR adding `commitCycle()` call in
185228
`executeTools` when `addToHistory` is true.
229+
**Re-carry:** clean three-way at `0205b07b`, zero conflicts. Moderate risk —
230+
upstream's doom-loop fatal break fires from inside the tool cycle; re-verify
231+
that a doom-loop break still commits (or intentionally does not commit) the
232+
in-flight cycle.
186233

187234
## reactor-ts-skip-unchanged-history
188235

189236
`reactor.ts` — Skip re-serializing unchanged history on checkpoint.
190237
`commitCycle` now compares `stateManager.getTurnsRevision()` against the
191238
revision most recently written and skips `contextStore.writeTurns` when
192239
nothing changed, avoiding an O(history) re-serialize (including historical
193-
tool-output blobs) on every checkpoint.
240+
tool-output blobs) on no-op checkpoints.
194241

195242
**Disposition:** Promotion candidate. Performance optimization with no
196243
behavioral change — reduces checkpoint cost from O(history) to O(1) when
197244
no turns were added. **Removal path:** Upstream PR adding revision check
198245
in `commitCycle`.
246+
**Re-carry:** clean three-way at `0205b07b`, zero conflicts. Low risk;
247+
depends on the `turnsRevision` plumbing in `state.ts`, which is itself a
248+
patch (below).
199249

200250
## reactor-ts-after-checkpoint-director-only
201251

@@ -210,6 +260,7 @@ its perspective, a single checkpoint.
210260
spurious double `afterCheckpoint` events that confuse directors.
211261
**Removal path:** Upstream PR gating `afterCheckpoint` on
212262
`hasOverride`/`pendingMessage !== null`.
263+
**Re-carry:** clean three-way at `0205b07b`, zero conflicts. Low risk.
213264

214265
## reactor-ts-last-written-turns-revision
215266

@@ -219,6 +270,8 @@ most recently serialized to the context store.
219270

220271
**Disposition:** Companion to `reactor-ts-skip-unchanged-history`. Ships out
221272
together.
273+
**Re-carry:** clean three-way at `0205b07b`, zero conflicts. Low risk;
274+
tracks the skip-unchanged-history patch.
222275

223276
## sse-ts-max-line-length
224277

@@ -230,6 +283,8 @@ otherwise OOM the process.
230283
**Disposition:** Promotion candidate. Security/correctness fix — prevents
231284
OOM from a stuck or malicious stream. **Removal path:** Upstream PR adding
232285
`MAX_LINE_LENGTH` cap to SSE line parsing.
286+
**Re-carry:** clean three-way at `0205b07b`, zero conflicts. Low risk —
287+
`sse.ts` has a single upstream commit and is effectively frozen.
233288

234289
## state-ts-deep-freeze-turns-revision
235290

@@ -245,6 +300,8 @@ scale with session length. `getTurnsRevision()` also backs
245300
O(n) structuredClone on every event for directors that don't inspect turns.
246301
**Removal path:** Upstream PR lazy-ifying `ReactorState.snapshot().turns`
247302
with revision tracking.
303+
**Re-carry:** clean three-way at `0205b07b`, zero conflicts. Low risk —
304+
`state.ts` sees little upstream churn.
248305

249306
## google-genai-files-ts-body-init-cast
250307

@@ -254,9 +311,39 @@ with revision tracking.
254311
gap rather than carrying indefinitely.
255312

256313
**Disposition:** Promotion candidate. Typing gap — should be fixed upstream.
257-
**Removal path:** Upstream PR widening `BodyInit` to accept `Uint8Array`, or
258-
Corbits adds a local type assertion wrapper and removes the cast from the
259-
vendored patch.
314+
**Removal path:** Upstream PR widening `BodyInit` to accept `Uint8Array` so
315+
the cast can be deleted from the vendored file.
316+
**Re-carry:** clean three-way at `0205b07b`, zero conflicts. Low risk.
317+
318+
---
319+
320+
## Upstream promotion ledger
321+
322+
Every Promotion candidate above, as a tracked dependency row per CL-7302.
323+
These are dependencies on upstream maintainers, not work we schedule; the
324+
tracking reference is this ledger until an upstream issue is filed, and the
325+
revisit point is the next vendored sync (see `docs/VENDORING.md`).
326+
327+
| Patch | Upstream ask | Upstream contact | Tracking | Revisit |
328+
| --- | --- | --- | --- | --- |
329+
| adapter-ts-stream-terminal-detector (+ harness-ts-is-stream-terminal) | Add an `isStreamTerminal`/`StreamTerminalDetector` hook to `ProviderAdapter` for semantic end-of-stream protocols | Alexander Guy <alexander.guy@pm.me> | This ledger (vendor/intx-inference/PATCHES.md#adapter-ts-stream-terminal-detector) | Next vendored sync |
330+
| errors-ts-classify-abort-reason | Add optional `reason` param to `classifyAbortError`, carried as `raw: { origin }` | Alexander Guy <alexander.guy@pm.me> | This ledger (#errors-ts-classify-abort-reason) | Next vendored sync |
331+
| harness-ts-inactivity-on-semantic-progress | Gate the inactivity watchdog's re-arm on parsed events, not raw SSE bytes | Alexander Guy <alexander.guy@pm.me> | This ledger (#harness-ts-inactivity-on-semantic-progress) | Next vendored sync |
332+
| reactor-ts-correlating-ids-leak | Wrap `tryCorrelate` in try/finally so `correlatingIds` clears on success dispatch paths | Alexander Guy <alexander.guy@pm.me> | This ledger (#reactor-ts-correlating-ids-leak) | Next vendored sync |
333+
| reactor-ts-checkpoint-after-tool-cycle | Call `commitCycle()` in `executeTools` when `addToHistory` is true | Alexander Guy <alexander.guy@pm.me> | This ledger (#reactor-ts-checkpoint-after-tool-cycle) | Next vendored sync |
334+
| reactor-ts-skip-unchanged-history (+ reactor-ts-last-written-turns-revision) | Skip `contextStore.writeTurns` when `getTurnsRevision()` is unchanged | Alexander Guy <alexander.guy@pm.me> | This ledger (#reactor-ts-skip-unchanged-history) | Next vendored sync |
335+
| reactor-ts-after-checkpoint-director-only | Gate `afterCheckpoint` on `hasOverride` so auto-commits do not emit it | Alexander Guy <alexander.guy@pm.me> | This ledger (#reactor-ts-after-checkpoint-director-only) | Next vendored sync |
336+
| sse-ts-max-line-length | Cap the unterminated SSE line buffer (`MAX_LINE_LENGTH`, 16 MiB) | Alexander Guy <alexander.guy@pm.me> | This ledger (#sse-ts-max-line-length) | Next vendored sync |
337+
| state-ts-deep-freeze-turns-revision | Make `ReactorState.snapshot().turns` a lazy, revision-tracked getter | Alexander Guy <alexander.guy@pm.me> | This ledger (#state-ts-deep-freeze-turns-revision) | Next vendored sync |
338+
| google-genai-files-ts-body-init-cast | Widen `BodyInit` to accept Node's `Uint8Array` typing so the cast can be removed | Alexander Guy <alexander.guy@pm.me> | This ledger (#google-genai-files-ts-body-init-cast) | Next vendored sync |
339+
340+
Contact basis: identified from the read-only upstream clone
341+
(`faremeter/interchange`); Alexander Guy <alexander.guy@pm.me> is the
342+
overwhelmingly dominant author of every upstream file these patches touch
343+
(`packages/inference/src/{reactor,harness,adapter,errors,sse,state}.ts`,
344+
`providers/google-genai-files.ts`, `packages/inference/src/assembly.ts`),
345+
so he is the named contact for every row. Next action per row: file the
346+
upstream issue and replace the ledger tracking reference.
260347

261348
## providers-ts-anthropic-adaptive-fable-5-1
262349

0 commit comments

Comments
 (0)