Skip to content

Rebuild fork/dev from upstream main with only the kept fork features - #641

Draft
patroza wants to merge 262 commits into
fork/devfrom
rebuild/fork-dev-from-upstream
Draft

patroza wants to merge 262 commits into
fork/devfrom
rebuild/fork-dev-from-upstream

Conversation

@patroza

@patroza patroza commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Replaces the fork/dev tree with a rebuild from upstream main f10e1eb3825a that keeps only the fork features we use:

  • identity (people map, session identity claims, source attribution, ownership filter, participants, attribution repair)
  • MCP client token runtime-mode ceiling, plus a seam for fork-registered MCP tools
  • Discord / Teams bot (apps/discord-bot) and its Discord MCP tools
  • Jira, as an upstream issue-tracker driver plus the webhook bridge; thread↔issue links now use upstream's issue links
  • VS Code extension (apps/vscode)
  • direnv for provider processes
  • fork CI/CD and agent tooling (Fork CI, Fork Release, lineage guard, ship gate, gh shim, fork mobile release overlay)

Why. The old fork/dev edited 692 upstream files. Every upstream merge re-conflicted the same ~15 files and broke fork tests that pinned upstream shapes (migration lists, settings catalogs, source text). 5 of the last 8 upstream merges landed with fork/dev red.

What changes for future upstream merges.

  • Fork logic lives in fork-only files. An upstream file gets at most a hook.
  • Every upstream file the fork still changes is listed in fork-seams.txt with its reason. The new Fork Seams job fails any unlisted change.
  • AGENTS.md gets one line pointing to AGENTS.fork.md.
  • .agents/skills/update-upstream now drops fork changes that upstream covers before merging, then re-applies hooks and never lands red.
  • The fork/dev ruleset no longer requires linear history and has no user bypass, so required checks gate every merge.

Dropped from the old fork (kept on backup/fork-dev-20261122-before-rebuild and tag fork-dev-before-rebuild-20261122):

  • Kimi provider (upstream ships Kimi through the ACP registry) and the fork's Grok changes (upstream Grok as-is)
  • PR-stack, PR watch and git-actions changes
  • VCS status cache/freeze changes
  • sidebar, composer and timeline tweaks
  • usage and host-resources panels
  • mobile queue/home/navigation tweaks
  • desktop deep links, preview browser and WebAuthn changes
  • SSH/Tailscale/devstacks
  • apps/server/src/ntbs (unwired)
  • fork migration 037

User-visible effects of dropping these:

  • The bot loses its in-process browser host.
  • PR badges in Discord titles no longer appear right after a bot restart.
  • VS Code loses the provider usage ring.
  • The host gauge no longer shows load average or hostname.

Data compatibility. A consistent copy of a live old-fork database (9.5 GB, quick_check ok) opens on this tree:

  • upstream migrations 104–107 apply
  • the fork ledger (ids 1–3) is left alone
  • the identity columns are intact

Fork migration ids 2 and 3 are unchanged.

History. This is a merge commit with fork/dev as its first parent and the rebuilt branch (on upstream f10e1eb3825a) as its second. No force-push is needed, and the lineage guard sees upstream main as an ancestor. Land with gh pr merge --merge, not squash.

Upstream has moved to 9de4ec1bfa since this base. That batch is the next, small, upstream merge.

🤖 Generated with Claude Code

juliusmarminge and others added 30 commits November 20, 2026 22:41
…ly (pingdotgg#36939)

Co-authored-by: chief-archivist <thecradlearchives@gmail.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…40149)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
pingdotgg#40069)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ffort summaries (pingdotgg#40136)

Co-authored-by: thecsguy <344173356+itsthecsguy@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…CODE_TANSTACK_SOURCE (pingdotgg#40207)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit b32f90b)
…rt grow-in

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 4ce558b)
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit cbc50d8)
github-actions Bot and others added 25 commits November 22, 2026 17:23
…path

knip flagged exports nothing uses after the port (GitHub/agent attribution helpers
and internal helpers), and nothing calls the claim gate's force-open path, so its
loading/error panels were unreachable.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
knip flags it as an unused export, which fails every pre-commit on fork-next/base.

Model: claude-opus-5-5; harness: Claude Code.

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

The VS Code extension (and the Discord bot) open a raw RPC session against one server
without the connection registry. Re-export RpcSessionFactory and its layer from the rpc
entry point as a single-line seam.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bring apps/vscode over from the old fork. The fork-only shared helpers it used
(integration thread view, proposed plan, user-input transcript, session wake, composer
input history, change-request indicator, steering-queue check, cold-snapshot VCS merge)
now live in apps/vscode/src/lib so no upstream shared file changes. The host gauge reads
upstream server.getHostResources. The provider usage ring is dropped with the fork
usage RPC, and the omegent product handshake is dropped with its server check.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
knip's export check fails on it, which blocks any commit that stages a
package.json.

Model: claude-opus-5-5; harness: Claude Code.

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

The Jira bridge (and the Discord and VS Code ports) read a thread as a flat
integration view and append a turn-stats footer to posted answers. Ported
from the old fork; formatElapsed now lives inside turnResponseStats instead
of patching upstream orchestrationTiming, and helpers nothing imports are
no longer exported.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
knip:check runs in pre-commit and flagged DirenvEnvironment.make, which only
its own layer uses, so no commit could land on fork-next/base.

Model: claude-opus-5-5; harness: Claude Code.

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

A repository names the Jira project keys whose bare PROJ-123 tokens count for
it. The schema lives in t3ProjectFileJira.ts and the upstream struct spreads
it in; shared readJiraBareKeyProjects reads the key from a workspace root.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bot is a client of the T3 server and lived only in the old fork. It now
compiles and its suite passes against current upstream contracts and
client-runtime.

Copied apps/discord-bot from the old fork and adapted it: fork-only shared
helpers it alone uses now live in the bot (src/shared), the RPC session
factory comes through a fork subpath of client-runtime, and the dfx patch
plus catalog entry return. The bot runs on Node's native TypeScript support
instead of tsx. Dropped what needs server features the base lacks: the
browser automation host (previewAutomation RPCs), the cold-start branch PR
lookup (vcs.resolveBranchChangeRequest), the omegent product handshake, and
matching channels against non-origin repository remotes.

Model: claude-opus-5-5; harness: Claude Code.

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

Jira comment mentions, assignments and bug reports reach /api/jira/webhook and
run in a T3 thread, with answers posted back as Jira comments. The bridge,
delivery store, debug log and app client live in apps/server/src/jira; server.ts
only adds JiraServerLayers.layer to the routes.

Issue to thread resolution now uses upstream's thread issue links
(ThreadIssueService) instead of the fork's thread-work-items.json store: the
bridge links the issue when it creates or joins a thread and looks up threads
linked to it, so the link also shows on the thread and can be unlinked.
Dropped with the GitHub PR bridge: GitHub PR refs in the store and the
Discord links.json import into it. T3CODE_JIRA_SITE_URL names the site for
links when T3CODE_JIRA_URL is a gateway.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agents in Discord-linked threads rename their thread with
discord_rename_thread and post into the linked Discord thread with
discord_post_to_linked_channel. Both lived inline in McpHttpServer.

discord_rename_thread is now a Toolkit tool whose actsAsCaller handler
refuses read-only clients and ended runs, and the linked-channel tool is
copied unchanged. forkMcpTools registers both. The seam now merges fork
tools beside layerTools in the served layer, so upstream tests that build
layerTools (the agent context budget, its service mocks) never see them.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When T3CODE_JIRA_URL is set, IssueTrackerRegistry also registers a standalone
Jira tracker: connect it in Settings with an email:token API token (or a bare
PAT), bind a project to a Jira project, and its issues list and open in T3
Code and through the issue MCP tools. Without a saved token it uses the
server's Jira app account. Writing stays with the webhook bridge.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Startup holds every HTTP route until provider recovery finishes, so the
bot's /oauth/token exchange and /.well-known/t3/environment discovery hung
behind a stuck recovery and stalled every reconnect.

A fork module exempts those two paths; server.ts pipes the readiness wait
through it.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	apps/server/src/server.ts
#	fork-seams.txt
The VS Code extension re-exported the session factory from rpc/index.ts while the
Discord bot used a separate rpc/session-fork subpath. Keep the rpc/index.ts
re-export (that upstream file has not changed since the old merge base), add
applyServerConfigProjection to it for the bot, and drop sessionFork.ts and its
package.json subpath.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Discord bot and the VS Code extension each carried copies of
integrationThreadView, turnResponseStats and jiraBareKeyProjects that the Jira
port had already put in packages/shared, plus identical copies of sessionWake,
pendingInteractions and the task presenter. Import the shared modules, move the
remaining three into packages/shared (the bot's task presenter, which adds a
context key, becomes the shared one), and delete the app copies.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bot looked up the T3 thread for a Jira key or PR in thread-work-items.json,
which nothing writes since the Jira port moved to upstream thread issue links.
Read the links from the shell snapshot instead: Jira links match on key and on
the Jira site host (from T3CODE_JIRA_SITE_URL / T3CODE_JIRA_URL / JIRA_URL, else
the browse base), PR links on host/repository/number. The shared integration
view now carries issues, defaulted for older warm-cache rows. The server's
links.json reader skips Teams rows and drops the unused thread resolver.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
McpHttpServer.ts carried its reason twice after the wave merges, and the
lockfile line did not name the Discord bot importer or the dfx patch.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The union returned from the exemption's flatMap widened the middleware's
requirements to unknown, which broke the CLI runtime's typecheck in binCli.ts
and cli/app.test.ts. Annotate the helper's result so the middleware keeps its
error and requirement types.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n GitHub runners

Restoring upstream workflows byte-identical would bring back pr-size and pr-vouch, which act on every fork PR through pull_request_target, and put the native fingerprint check back on a Blacksmith runner the fork does not have. Keep the two bots deleted, as the old fork did, and change only the fingerprint job's runner.

Model: claude-opus-5-5; harness: Claude Code.

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

fork/dev carried edits to 692 upstream files. Every upstream merge re-conflicted the same files and broke fork tests that pinned upstream shapes. This commit replaces the tree with fork-next/base: upstream main f10e1eb plus the kept fork features (identity, MCP client token ceiling, Discord/Teams bot, Jira, VS Code extension, direnv, fork CI and agent tooling). Fork logic lives in fork-only files. Each upstream file the fork still changes is listed in fork-seams.txt with its reason, and Fork Seams in CI fails on any unlisted change.

The previous tree stays reachable through this commit's first parent, on backup/fork-dev-20261122-before-rebuild, and on tag fork-dev-before-rebuild-20261122.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. label Nov 22, 2026
github-actions Bot and others added 4 commits November 22, 2026 18:15
Release Smoke installs a trimmed workspace, so pnpm saw the dfx patch as unused and failed with ERR_PNPM_UNUSED_PATCH. Add the bot's package.json to the smoke workspace list, as the old fork did.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a developer machine the full gate failed 29 upstream tests that pass in CI. .envrc's GH_REPO pointed the GitHub provider tests at the fork. A TMPDIR under ~/.cache made asar skip every fixture. On Arch, /bin/sh is bash, which refills an unset SHELL from the login shell. The gate now drops GH_REPO and moves a dot-directory TMPDIR to /tmp for its test run. install.test.ts passes SHELL "" instead of unsetting it; that one-line seam is an upstream candidate.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two OpenCode driver tests failed locally, also on clean upstream, because they read the developer's ~/.config/opencode. The gate now runs tests with a fresh, empty XDG_CONFIG_HOME, as CI has.

Model: claude-opus-5-5; harness: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The OpenCode driver tests read ~/.local/share/opencode, so an empty XDG_CONFIG_HOME alone was not enough. The gate now points XDG_CONFIG_HOME and XDG_DATA_HOME at fresh folders for the test run.

Model: claude-opus-5-5; harness: Claude Code.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships.

Projects

None yet

Development

Successfully merging this pull request may close these issues.