Repository navigation
refactor(a2a): internal names say project - #484
Merged
Merged
Conversation
The welcome wizard loses its Squadron stage and imports into projects as upstream does. Branding and the Providers label stay. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Squadrons are retired (#412). The agent-to-agent ledger is keyed by project id, every thread except a provider Subagent is a participant in its own project, and everything an agent or a person reads says project. Migration 031 re-keys and renames the ledger in place: the Squadron table is never dropped, so nothing cascades, and no row is added, removed or renumbered. It refuses by name a project that several Squadrons share, keeps a record of the old ids and names, leaves a peer server's ids alone, and aborts if any table's row count changes or any row is left without a project. Registration moves off the launch path to the stored thread.created event, which every creation writes, including the two importers that bypass the thread.create command. A server that upgrades registers the threads it already has, and a caller without a home registers on its first agent-to-agent call. list_squadrons, join_squadron and the Squadron routes are removed. Tools, routes and contracts carry project ids and titles. A client refuses a server whose ledger is not keyed by project. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…n-start Implementing a proposed plan in a new thread used J5's single launch so the new thread could inherit its plan parent's Squadron. A thread's home is now its project, so there is nothing to inherit. ChatView's function is upstream's again: create the thread, start the turn with the plan reference, and delete the thread if the start fails. The launch request and its contract lose sourcePlanRef. J5's launch never passed the reference to the first message, so the plan was not marked completed; upstream's message dispatch does. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Oct 8, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Jacksondr5
marked this pull request as ready for review
October 8, 2026 06:45
The ledger has been keyed by project since the re-key, but the code still called its key a Squadron. This renames the leftover internal names: squadronId becomes projectId, the SquadronId type becomes LedgerProjectId, and the functions, services, errors, test helpers and comments follow. No table, column, route, tool or JSON key changes, and no migration is added. Three error tags that agents read in tool errors change with their classes: ProjectLedgerNotFoundError, PlacementProjectNotFoundError and ArchiveCrewProjectMismatchError. The peer wire fields and the j5Squadrons capability key keep their names. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Jacksondr5
force-pushed
the
fold/internal-names-say-project
branch
from
October 8, 2026 06:45
13a6480 to
edc79a1
Compare
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Jacksondr5
changed the base branch from
j5/fold-plan-implementation-back-to-upstream
to
j5/main
October 8, 2026 06:50
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This was referenced Oct 8, 2026
This was referenced Oct 8, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since the ledger was re-keyed (#482), a ledger is keyed by a project, but the code still calls that key a Squadron:
squadronId,SquadronId,readSquadron, and about 2,200 more. Part of #412. Stacked on #483.What changed
Names only. No table, column, route, tool, tool description or JSON key changes, and no migration is added.
squadronId→projectId, with compound names following (senderSquadronId→senderProjectId).SquadronId→LedgerProjectId. It stays its own type, apart from upstream'sProjectId: a ledger key is this server's project for a local row and a peer's id for a remote one.readSquadron→readProjectLedger,listSquadrons→listProjectLedgers,ensureSquadron→ensureProjectLedger,J5SquadronCreationLayer→J5ThreadRegistrationLayer.FleetSquadron→FleetLedgerProject, because the Fleet page already has aFleetProjectfor the sidebar's project.Every identifier rename, with the number of places (79 pairs, 2,214 places)
squadronId→projectIdSquadronId→LedgerProjectIdsquadronId→ledgerProjectIdsquadron→projectsquadron→ledgerProjectrequestedSquadronId→requestedProjectIdsquadronName→projectTitlevmSquadron→vmProjectsquadrons→projectscreateSquadron→createProjectLedgerlocalSquadron→localProjectJ5SquadronCreationLayer→J5ThreadRegistrationLayerFleetSquadron→FleetLedgerProjectexistingSquadronId→existingProjectIdsenderSquadronId→senderProjectIdhomeSquadron→homeProjecthomeSquadronId→homeProjectIdcrossSquadron→crossProjectlaptopSquadron→laptopProjectScopedFleetSquadron→ScopedFleetLedgerProjectlistSquadrons→listProjectLedgersreadSquadron→readProjectLedgerensureSquadron→ensureProjectLedgersetupSameSquadron→setupSameProjectlocalSquadronId→localProjectIdaskerSquadronId→askerProjectIdprojectFleetSquadron→projectFleetProjectSquadron→ProjectLedgerreplierSquadronId→replierProjectIdsquadron_name→project_titleowningExchangeSquadronId→owningExchangeProjectIdPlacementSquadronNotFoundError→PlacementProjectNotFoundErrorSquadronNotFoundError→ProjectLedgerNotFoundErrorlegacySquadronId→legacyProjectIdledgerSquadronId→ledgerProjectIdsquadronIds→projectIdscorruptedSquadronId→corruptedProjectIdexpectedSquadronId→expectedProjectIdFleetSquadronCrew→FleetProjectCrewlistForSquadron→listForProjectexchangeSquadronId→exchangeProjectIdalphaSquadron→alphaProjectbetaSquadron→betaProjectinSquadron→inProjectwinningSquadronId→winningProjectIdsetupTwoSquadrons→setupTwoProjectsextraSquadronId→extraProjectIdforeignSquadronId→foreignProjectIdcloseSquadronId→closeProjectIdseedSquadronAndSpawner→seedProjectAndSpawnerArchiveCrewSquadronMismatchError→ArchiveCrewProjectMismatchErrorexistingSquadronId→existingLedgerProjectIdsquadronCrews→projectCrewsfirstSquadronId→firstProjectIdsecondSquadronId→secondProjectIdSquadronRow→ProjectLedgerRowsquadronFromRow→projectLedgerFromRowselectSquadrons→selectProjectLedgersremoteSquadronId→remoteProjectIdsameSquadron→sameProjectreceiver_squadron→receiver_projectmissingSquadronId→missingProjectIdsquadronError→projectErrorduplicateSquadronId→duplicateProjectIdsubjectSquadronId→subjectProjectIdmakeJ5SquadronCreationLayer→makeJ5ThreadRegistrationLayersquadronKey→projectKeyeventSquadronId→eventProjectIdwrongSquadron→wrongProjectisSquadron→isProjectdecodeSquadron→decodeProjectLedgermissingSquadron→missingProjectisSquadronNotFound→isProjectLedgerNotFoundSquadronName→ProjectTitlesquadronNames→projectTitlessquadronCreationProvided→threadRegistrationProvidedParticipantId→LedgerProjectIdSquadronId→ParticipantIdsquadronId→threadThe only changes anything outside the code can see
Three error tags, which agents read as the
codeof a tool error and clients read in J5 HTTP error bodies:SquadronNotFoundError→ProjectLedgerNotFoundErrorPlacementSquadronNotFoundError→PlacementProjectNotFoundErrorArchiveCrewSquadronMismatchError→ArchiveCrewProjectMismatchErrorNothing matches on the old strings: a search of web, mobile, desktop, the CLI, the tests and the docs found no use outside the three class definitions.
Three telemetry span names:
j5.a2a.ensureSquadron,j5.a2a.placement.ensureSquadronandj5.a2a.agentCrewInstances.listForSquadronend inensureProjectLedger,ensureProjectLedgerandlistForProject.Still on the wire, pending a decision
These keep their names in this PR. They are not an oversight. Jackson has since decided the peer wire fields are renamed; that is #489, stacked on this PR. The capability key stays.
originSquadronIdon a delivery,squadronIdin a dropped Exchange's cause, andsquadronIdandsquadronNameon a roster entry (packages/contracts/src/j5.ts). They are mapped atpeerDeliveryBody.ts,peerRoster.ts,PeerDirectory.tsandPeerInboundService.ts.j5Squadronscapability key, which a client reads to recognize an older J5 server and which this server reports asfalse.Where the word stays, by design
j5_a2a_retired_squadrontable.SpawnBrief.tsx,ThreadA2ARenderer.tsx).apps/server/src/j5/a2a/README.md: it describes the Squadron design and needs rewriting, not renaming.How this was built, and how to check it
The rename is scripted from a written map. The four steps are separate commits on
fold/internal-names-say-project-steps, whose tree is identical to this PR's.StartSpawnBriefInput:squadronId→ledgerProjectId(the declaration and its three callers).seedTarget's result inDeliveryTransport.integration.test.ts:squadronId→ledgerProjectId(the declaration and 24 uses).agentPersonaLaunch.integration.test.tspassed asquadronIdthat nothing has read since feat(a2a): a thread's home is its project #482. A rename would have turned it into a secondprojectIdspread over the real one, so it is removed.projectIdin scope, the ledger key in scope becomesledgerProjectIdso the two stay apart; a member name still becomesprojectId.Hand edits to review are steps 1, 3 and 4:
git diff 3995271f74 ed6510bfb6andgit diff 7f96b6fec2 ae5a3d176c. Those commits predate the restack; this PR's tree differs fromae5a3d176conly byj5/main's marketing change.The mechanical check. A script parses every changed file at the base and at the head and compares them token by token, ignoring comments and layout:
squadronbecameledgerand whose column aliassquadron_namebecameproject_title. The rest are test titles and fixture ids.{ squadronId }written out as{ projectId: ledgerProjectId }, where the member and the thing in scope now have different names. Three are the removed test input. One is a separator the formatter added.Upstream impact
apps/server/src/server.tsJ5SquadronCreationLayeris nowJ5ThreadRegistrationLayer; the case text is updatedapps/server/src/orchestration-v2/runtimeLayer.test.ts,DelegatedCompletionDelivery.test.ts, three*OrchestratorV2.live.test.ts,mcp/toolkits/worktree/registration.test.tsNo change to what upstream's product does.
How it was checked
vp run typecheckin contracts, client-runtime, web, mobile, desktop and server: 0 errors each.vp test runin contracts (564), client-runtime (1,953) and web (5,842): all passed. Serversrc/j5,src/environmentand the launch tests: 1,079 passed.j5/main; the restack brought in only main's marketing change): the required job "Format, lint, typecheck, and unit tests" passed, with the whole server suite in three shards (Test Server 1, 2 and 3), the client tests, and format, lint and typecheck.ArchiveCrewProjectMismatchErrorwas seen live, and a peer on the base exchanged an ask and a reply with the head.Checklist
FORK.md(case text and file-table row) in this PRdocs/j5/product/upstream.md— noneAGENTS.md) — contracts: no wire field changes; clients: the three error tags are not matched anywheredocs/j5/product/and user docs rewritten where this changes them — left for the docs PR; this PR edits one identifier in FORK.mdClaude Opus 5.5 (1M context), Claude Code in J5 Code.
🤖 Generated with Claude Code
Summary by CodeRabbit