Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FORK.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Treat these upstream areas as off-limits except for those explicit appended case

Against upstream pin `993407dd9e57f1edf2f5681d70140bfefeca93cc`, the complete A2A exception inventory is exactly these four cases. Line numbers identify this revision; the named symbol or test is the durable anchor after nearby upstream movement.

1. A1's independent migration lane: `apps/server/src/persistence/Layers/Sqlite.ts:10` imports `runJ5A2AMigrations`, and `:42` runs it after upstream migrations. Introduced by `a064a87ac40ea2d2d936ba72008c95edeb8bbc2b` and merged in `521c50aa9bb6b4c7f55bc10a772822ec31129f2d`.
1. A1's independent Squadron communication-ledger migration lane: `apps/server/src/persistence/Layers/Sqlite.ts:10` imports `runJ5A2AMigrations`, and `:42` runs it after upstream migrations. Introduced by `a064a87ac40ea2d2d936ba72008c95edeb8bbc2b` and merged in `521c50aa9bb6b4c7f55bc10a772822ec31129f2d`.
2. The one shared authenticated J5 MCP/runtime seam: `apps/server/src/mcp/McpHttpServer.ts:31` imports `J5McpIntegrationLive`, and `:247-248` append its sole entry to `layer`. Registration and runtime composition stay in `apps/server/src/j5/a2a/mcp/registration.ts`; A6 extends the J5-owned toolkit without another protected-file registration.
3. The internal delivery-dedup contract proof: `apps/server/src/orchestration-v2/runtimeLayer.test.ts:188-234`, test `replays an internal thread send without injecting a second message`.
4. The authenticated shared-toolkit integration proof: `apps/server/src/mcp/toolkits/worktree/registration.test.ts:15,70,83-90,128-131`, within test `production mcp layer lists worktree tools over http`.
Expand Down
20 changes: 10 additions & 10 deletions apps/server/src/j5/a2a/DeliveryTransport.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import { formatHumanEnvelope, formatPeerEnvelope } from "./EnvelopeFormatter.ts"
import { A2ALedger, layer as ledgerLayer } from "./LedgerService.ts";
import {
CommCommandId,
EpicId,
SquadronId,
ExchangeId,
GLOBAL_HUMAN_PARTICIPANT_ID,
LedgerMessageId,
Expand Down Expand Up @@ -259,7 +259,7 @@ const seedTarget = (suffix: string) =>
const ledger = yield* A2ALedger;
const threadId = ThreadId.make(`thread:j5-a2a-delivery-${suffix}`);
const projectId = ProjectId.make(`project:j5-a2a-delivery-${suffix}`);
const epicId = EpicId.make(`epic:j5-a2a-delivery-${suffix}`);
const squadronId = SquadronId.make(`squadron:j5-a2a-delivery-${suffix}`);
const senderId = ParticipantId.make(`agent:j5-a2a-delivery-${suffix}-sender`);
const receiverId = ParticipantId.make(`agent:j5-a2a-delivery-${suffix}-receiver`);
const exchangeId = ExchangeId.make(`exchange:j5-a2a-delivery-${suffix}`);
Expand All @@ -281,12 +281,12 @@ const seedTarget = (suffix: string) =>
branch: null,
worktreePath: `/tmp/j5-a2a-delivery-${suffix}`,
});
yield* ledger.createEpic({
epic: { id: epicId, name: `J5 A2A ${suffix} delivery`, createdAt },
yield* ledger.createSquadron({
squadron: { id: squadronId, name: `J5 A2A ${suffix} delivery`, createdAt },
});
yield* ledger.appendEvents({
commandId: CommCommandId.make(`command:j5-a2a-delivery-${suffix}-join-target`),
epicId,
squadronId,
acceptedAt: createdAt,
events: [
{
Expand All @@ -306,15 +306,15 @@ const seedTarget = (suffix: string) =>
return {
threadId,
projectId,
epicId,
squadronId,
senderId,
receiverId,
exchangeId,
messageId,
message,
delivery: {
originEpicId: epicId,
receiverEpicId: epicId,
originSquadronId: squadronId,
receiverSquadronId: squadronId,
messageId,
senderId,
receiverId,
Expand Down Expand Up @@ -345,7 +345,7 @@ it.effect("starts an idle recipient immediately without the implicit auto mode",
deliveredMessages[0]?.text,
formatPeerEnvelope({
senderId: target.senderId,
originEpicId: target.epicId,
originSquadronId: target.squadronId,
exchangeId: target.exchangeId,
message: target.message,
}),
Expand Down Expand Up @@ -421,7 +421,7 @@ it.effect("steers a busy recipient inside its active turn without queueing a lat
deliveredMessages[0]?.text,
formatPeerEnvelope({
senderId: target.senderId,
originEpicId: target.epicId,
originSquadronId: target.squadronId,
exchangeId: target.exchangeId,
message: target.message,
}),
Expand Down
18 changes: 9 additions & 9 deletions apps/server/src/j5/a2a/DeliveryTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as SqlClient from "effect/unstable/sql/SqlClient";
import * as ThreadManagement from "../../orchestration-v2/ThreadManagementService.ts";
import { formatHumanEnvelope, formatPeerEnvelope } from "./EnvelopeFormatter.ts";
import {
EpicId,
SquadronId,
ExchangeId,
GLOBAL_HUMAN_PARTICIPANT_ID,
Participant,
Expand Down Expand Up @@ -37,8 +37,8 @@ export class A2ADeliveryTransportError extends Schema.TaggedErrorClass<A2ADelive
) {}

export interface AgentDeliveryInput {
readonly originEpicId: EpicId;
readonly receiverEpicId: EpicId;
readonly originSquadronId: SquadronId;
readonly receiverSquadronId: SquadronId;
readonly messageId: LedgerMessageId;
readonly senderId: ParticipantId;
readonly receiverId: ParticipantId;
Expand Down Expand Up @@ -98,8 +98,8 @@ export const live: Layer.Layer<
Effect.gen(function* () {
const rows = yield* sql<MembershipRow>`
SELECT payload
FROM j5_a2a_epic_membership
WHERE epic_id = ${input.receiverEpicId}
FROM j5_a2a_squadron_membership
WHERE squadron_id = ${input.receiverSquadronId}
AND participant_id = ${input.receiverId}
LIMIT 1
`;
Expand Down Expand Up @@ -132,7 +132,7 @@ export const live: Layer.Layer<
})
: formatPeerEnvelope({
senderId: input.senderId,
originEpicId: input.originEpicId,
originSquadronId: input.originSquadronId,
exchangeId: input.exchangeId,
message: input.message,
});
Expand All @@ -155,21 +155,21 @@ export const live: Layer.Layer<
deliverHuman: (input) =>
sql`
INSERT INTO j5_a2a_human_inbox_data (
origin_epic_id,
origin_squadron_id,
message_id,
exchange_id,
sender_id,
payload,
created_at
) VALUES (
${input.originEpicId},
${input.originSquadronId},
${input.messageId},
${input.exchangeId},
${input.senderId},
${input.message},
${input.createdAt}
)
ON CONFLICT(origin_epic_id, message_id) DO NOTHING
ON CONFLICT(origin_squadron_id, message_id) DO NOTHING
`.pipe(
Effect.asVoid,
Effect.mapError(
Expand Down
Loading
Loading