Commit 13ba57f
chore(upstream): three-layer regression backstop for bridge merges
Root cause of the v1.4.0 audit findings (16 regressions across 30 files):
many altimate customizations were never wrapped in `altimate_change`
markers, so the bridge merge tool — working as designed — overwrote
them with upstream's version. The marker discipline relies on humans
remembering to wrap; the tooling didn't catch the gap. This commit
closes that gap with three layers of defense:
1. Broaden the branding scan
`script/upstream/analyze.ts` LEAK_PATTERNS now catches bare
`opencode` strings in user-visible contexts: yargs `describe` text,
console/UI output, MCP `clientInfo.name`, User-Agent headers, OIDC
audiences, GitHub workflow YAML, infrastructure identifiers, spawn
binary names, etc. Reproductive testing: scanning the pre-fix
v1.4.0 state, the broadened patterns flagged 13 of the 16
regressions. Runs in CI on every PR (`Branding leak audit` step).
Also: scanner skips lines inside `altimate_change` blocks (so
intentional explanatory comments don't false-positive).
2. requireMarkers allowlist for behavior-patched files
New `MergeConfig.requireMarkers` field in
`script/upstream/utils/config.ts` lists 38 files known to hold
altimate behavioral patches (UA strings, retry loops, OAuth skew
buffers, hour-aligned cleanup tasks, custom theme tweaks, etc.).
- `analyze.ts --require-markers --strict` verifies each file in
the list has at least one altimate_change block. Runs in CI.
- `bridge-merge.ts` treats them as keepOurs: never overlays
upstream content on these files, even if they have no markers.
Hard-aborts the merge if any file in the list is missing
markers (would mean we lost the patches before the merge ran).
Three new categories now in the merge plan: requireMarkers,
requireMarkersMissing, plus a "must merge upstream changes
manually" line in the report.
3. Retroactive marker sweep
Added altimate_change markers to 14 previously-unmarked files that
held altimate brand strings or behavioral patches:
- `cli/cmd/upgrade.ts`, `tui/attach.ts`, `tui/thread.ts`,
`tui/component/upgrade-indicator.tsx`, `cli/cmd/import.ts`,
`cli/cmd/plug.ts`, `cli/network.ts`, `cli/cmd/pr.ts` (was a
pre-existing regression — `spawn("opencode")` would fail since
the binary is `altimate-code`)
- `mcp/config.ts`, `mcp/oauth-provider.ts`,
`config/migrate-tui-config.ts`, `config/tui-migrate.ts`,
`plugin/copilot.ts`, `plugin/github-copilot/copilot.ts`
Plus `provider/provider.ts` + `session/llm.ts` UA brand fixes that
the broadened scan caught.
Catppuccin theme JSON files (`textMuted` brightness tweak) added
to `keepOurs` glob — JSON can't carry inline markers, so the
bridge merge tool just preserves them wholesale.
Memory tools (`packages/opencode/src/memory/**`) added to
`keepOurs` — they're a net-new altimate feature family
(altimate_memory_* tools) not in upstream.
Internal scripts (`script/beta.ts`, `script/raw-changelog.ts`,
`packages/script/src/index.ts`) — wrapped legitimate references to
upstream's bot identity / model IDs in `altimate_change` markers and
flipped the model spawn command from `opencode run` to
`altimate-code run` (the scripts were broken before — would call a
binary that isn't installed).
CI integration
`.github/workflows/ci.yml` now runs both `--branding` and
`--require-markers --strict` on every PR. Existing `--markers` check
remains.
Verified
- bun turbo typecheck — 5/5 packages clean
- bun test test/upstream test/util/error.test.ts test/permission test/server — 553 pass / 0 fail
- bun run script/upstream/analyze.ts --branding — 0 leaks
- bun run script/upstream/analyze.ts --require-markers --strict — 38/38 files have markers
- 0 unmarked altimate-touched files outside the safety nets (verified by tree sweep)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 3a6b59b commit 13ba57f
24 files changed
Lines changed: 425 additions & 35 deletions
File tree
- .github/workflows
- packages
- opencode
- src
- cli
- cmd
- tui
- component
- config
- mcp
- plugin
- github-copilot
- provider
- session
- test/upstream
- script/src
- script
- upstream
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
90 | | - | |
| 92 | + | |
| 93 | + | |
91 | 94 | | |
92 | 95 | | |
93 | | - | |
| 96 | + | |
| 97 | + | |
94 | 98 | | |
95 | 99 | | |
96 | 100 | | |
| |||
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
112 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
113 | 120 | | |
114 | 121 | | |
115 | 122 | | |
116 | | - | |
| 123 | + | |
117 | 124 | | |
118 | 125 | | |
119 | 126 | | |
120 | 127 | | |
121 | 128 | | |
122 | 129 | | |
123 | | - | |
| 130 | + | |
| 131 | + | |
124 | 132 | | |
125 | 133 | | |
126 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
66 | 71 | | |
| 72 | + | |
67 | 73 | | |
68 | 74 | | |
69 | 75 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| 77 | + | |
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
| |||
189 | 193 | | |
190 | 194 | | |
191 | 195 | | |
| 196 | + | |
192 | 197 | | |
| 198 | + | |
193 | 199 | | |
194 | 200 | | |
195 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| 33 | + | |
31 | 34 | | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| 53 | + | |
49 | 54 | | |
| 55 | + | |
50 | 56 | | |
51 | 57 | | |
52 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | | - | |
23 | | - | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
0 commit comments