Skip to content
Closed
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: 2 additions & 0 deletions FORK.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ migrations after upstream migrations.
72. Settings › People, and a project's Sharing section ([#535](https://github.com/Jacksondr5/j5code/issues/535), [#541](https://github.com/Jacksondr5/j5code/issues/541), register D33, Jackson's 2026-10-12 design and approval of the Settings navigation and route registration). The page (`apps/web/src/j5/sharing/PeoplePage.tsx`) and everything it draws are J5-owned; `apps/web/src/routes/settings.people.tsx` is a J5-owned route file in upstream's routes folder, the shape of `settings.skills.tsx` (case 42), and `routeTree.gen.ts` regenerates with it. Registering a settings section takes upstream's own tables, each one entry: in `apps/web/src/components/settings/settingsSearch.ts` the `SettingsPath` union, `SETTINGS_SECTION_LABELS` (after Connections, which sets the sidebar order), `SETTINGS_CATEGORY_SCOPES` (`"connections"`, the page is about the primary server as Connections is) and one search item, `people`; in `SettingsSidebarNav.tsx` the icon map (`UsersIcon`) and one more condition in the nav filter, `item.to !== "/settings/people" || canSeePeople`, with `useCanSeePeople()` from J5-owned `j5/sharing/peopleAccess.ts` (the primary connection holds `access:read`, which a guest's never does); in `SettingsScopeSentence.tsx` one line adding the path to `SETTINGS_DEVICE_ONLY_PATHS`, so the page shows no project-and-environment picker, as Connections shows none. `apps/web/src/components/settings/ProjectSettingsPanel.tsx` gains one import and one mount, `<ProjectSharingSettings projects={group.memberProjects} />`, above the Danger section; `ProjectSettingsPanel.test.tsx` mocks that one module (two lines), because the test replaces the connection runtime with `undefined` and J5's sharing commands are made from it when their module loads. The palette entry "Open People" joins case 71's hook with no further upstream edit. On a pin advance: if upstream reshapes how a settings section is declared, re-register People after Connections; if upstream adds a settings page of its own for people or access, read D33 before keeping J5's.
73. A shared thread says who is on it, and a guest's client fits what a guest can do ([#535](https://github.com/Jacksondr5/j5code/issues/535), [#541](https://github.com/Jacksondr5/j5code/issues/541), register D33, Jackson's 2026-10-12 design and approval of one mount or item in each of these files). All of it is J5-owned code under `apps/web/src/j5/sharing/`, mounted once in each upstream file. `apps/web/src/components/chat/ChatHeader.tsx`: one import and `<ThreadPeopleChip … />` after the breadcrumb, for a server thread; it draws nothing unless a guest holds a grant on the thread or its project. `apps/web/src/components/chat/ThreadDetailsPanel.tsx`: one import and `<ThreadPeopleSection … />` after `ThreadRelationshipsPanel`, under the same `density === "full" && !props.draftId` condition as its neighbours; it uses upstream's exported `ThreadDetailsSection`. `apps/web/src/components/chat/ChatComposer.tsx`: one import, one hook call after the props are read (`useViewOnlyComposerProps(environmentId, canOperateThread)`), and one spread, `{...viewOnlyComposerProps}`, placed after upstream's `placeholder={…}` prop so that it replaces the placeholder for a guest whose level on the thread is View and is empty for everyone else; a first branch in upstream's nested ternary would have re-indented all of it. The composer collapsed to one line on a narrow window has its own fallback text, `"Ask anything..."`, a few hundred lines above; that literal becomes `(viewOnlyComposerProps.placeholder ?? "Ask anything...")` (one line and a comment). A guest's thread menu needs no further upstream line: case 71's two calls in `useThreadActionMenu.ts` and `Sidebar.tsx` now drop Archive, Delete, "Project settings" and "Share thread…" for a guest and put "Leave thread" where Archive was (`j5/sharing/sharingMenu.ts`, told who is a guest by `guestAccess.ts` so that it still imports nothing of the connection runtime). The chip and the section ask the server who reaches the thread (`j5.sharing.listThreadPeople`) and ask again when its counter moves (`j5.sharing.subscribeThreadPeopleChanges`); that stream joins `EnvironmentSubscriptionRpcTag` in `packages/client-runtime/src/rpc/client.ts`, one more line beside case 69's `subscribeThreadAccess`. Two route files carry the guest's way in (Jackson's 2026-10-13 approval). `apps/web/src/routes/pair.tsx`: the import of upstream's `PairingRouteSurface` becomes an import of J5's `GuestAwarePairingSurface`, and the JSX tag changes with it (three lines; the props are the same and upstream's `components/auth/PairingRouteSurface.tsx` is not edited). J5's surface asks `POST /api/j5/sharing/describe` what the link opens, without spending it, only for a link that carries J5's mark, and waits up to five seconds for the answer. Everything else gets upstream's surface with the props it was given: no token, and any link without the mark, at once and with no request made about it (an ordinary pairing token is sent nowhere but upstream's own exchange); a marked link when the server cannot be asked or does not answer in time. Case 71's link step puts that mark, `j5share=1`, in the fragment beside upstream's `token`; upstream reads the fragment as parameters and takes only `token`, in the direct and the hosted form. `apps/web/src/routes/_chat.index.tsx`: one import, and `<IndexDraftLanding />` is wrapped in `<GuestLanding>`. For a member the wrapper renders its child at once, with the sharing answer pending or failed; it holds the frame only for a browser that remembers being paired through a share link (one `localStorage` key, written by the pairing surface and overwritten by the server's answer), and for a guest it shows their thread, a list, or that nothing is shared with them. Upstream's hosted pairing surface is left alone, so a named link opened through the hosted app pairs as upstream has it, and a join link is never offered in the hosted form. Two edits quiet what a guest could only see fail (the build lead under Jackson's 2026-10-13 standing permission for one import and one or two lines). `ThreadDetailsPanel.tsx`, beside the People mount: one more import, `const isGuest = useIsGuest(props.environmentId)` at the top of the component, and `&& !isGuest` on the condition that mounts upstream's `ThreadAutomationsPanel`, which asks for the server's scheduled tasks. `apps/web/src/components/settings/SettingsSidebarNav.tsx`: case 72's nav-filter condition becomes one call into J5, `shownForConnection(item.to)` from `useSettingsNavShown()` (the file gains two lines over case 72), which also leaves Scheduled Tasks, Source Control and Archive, and J5's own Personas and Skills, out of the Settings sidebar of a person who is a guest on every connected server (someone who is also a member of another keeps them; People follows the primary server's own answer); those pages still show upstream's own error to a guest who types their address. `apps/web/src/routes/__root.tsx` (Jackson approved it on 2026-10-13 with one rule: a client is changed only for a person who is a guest on every server they are connected to, never because one of several is a guest one): one import, one hook call beside `primaryEnvironmentAuthenticated`, `useFirstRunSetupOffered(primaryEnvironmentAuthenticated)`, and `FirstRunGate`'s `enabled` reads its answer. For a browser never paired through a share link the answer is upstream's own; a browser that remembers being paired through one is not sent to the setup wizard, which asks a guest to connect computers and import projects, and is offered it again when the server's answer says member and the key clears, or as soon as any other connected server says this person is a member of it (the hook lives in J5's `j5/sharing/firstRunSetup.ts`). `apps/web/src/components/Sidebar.tsx` (approved the same day, under the same rule): one import, `const isGuest = useIsGuestEverywhere()` beside the primary environment's id, and `&& !isGuest` on the empty list's `projects.length === 0` condition, so a guest with nothing shared reads upstream's own "No threads yet" in place of "No projects yet" over an "Add project" button that could only fail. `apps/web/src/j5/artifacts/ArtifactsPage.tsx` is J5's own file. On a pin advance: if upstream moves the composer's `placeholder` prop, keep the spread after it, or a View guest reads upstream's "Ask anything…" over a composer that cannot send; if upstream renames the menu's `archive` or `delete` items, a guest sees them again, disabled, and `sharingMenu.test.ts` still passes, so check a guest's menu in a browser; if upstream reorders the details panel, keep People after Lineage and the guest condition on the Automations mount; if upstream adds a Settings page that asks a guest for what it is not given, add its path to `HIDDEN_FROM_A_GUEST` in `j5/sharing/peopleAccess.ts`; if upstream changes how a pairing address carries its token, or starts to refuse a fragment it does not know, reread `SHARE_LINK_MARK` in J5-owned `packages/contracts/src/j5/sharing.ts` (the web client and the live-test rig's `guest` both mark a link there), whose test in `apps/web/src/j5/sharing/shareLink.logic.test.ts` reads a marked address with upstream's own `getPairingTokenFromUrl`; if upstream renames `PairingRouteSurface` or changes its props, J5's surface fails to compile; if upstream's index route stops rendering `IndexDraftLanding`, re-wrap whatever it renders, or a guest's first screen is a draft they cannot send; if upstream renames `FirstRunGate`'s `enabled` or gates first run elsewhere, a guest with nothing shared lands on the setup wizard again.
74. An agent's browser tab is private unless it names a profile (register D34, Jackson's 2026-10-13 decision). Upstream's `resolveOpenProfile` in `apps/server/src/preview/ServerBrowser.ts` gives a `preview_open` call without a `profileId` the person's default profile, whose stored state every agent tab on the server shares. J5 changes that one return to `INCOGNITO_BROWSER_PROFILE_ID`, which the file already imports, so the tab gets its own throwaway storage through upstream's existing incognito path. A named profile resolves as upstream's does. The `preview_open` description in `apps/server/src/mcp/toolkits/preview/tools.ts` changes one clause to say what omitting `profileId` now means. `ServerBrowser.test.ts` changes two expectations and their test titles. On a pin advance, keep the return and the description clause; if upstream makes agent tabs private by default, take upstream's and retire this case and D34.
75. A guest who holds Collaborate writes to the agent, and the agent is told who is speaking ([#533](https://github.com/Jacksondr5/j5code/issues/533), register D33, Jackson's 2026-10-09 and 2026-10-11 rulings; **draft: the `ws.ts` edit and the agent-facing wording await Jackson's approval**). All of it is J5-owned code under `apps/server/src/j5/sharing/` (`GuestCommands.ts`, `SharedConversation.ts`), reached from one upstream file. In `apps/server/src/ws.ts`, `layerWsRpc` reads `sharedConversation` once and returns upstream's handler record with `orchestration.dispatchCommand` wrapped: `admit(currentSession, command)` runs before upstream's own handler and hands it the command to dispatch (one import, one read, and the wrapped return; nothing inside upstream's handler changes). For a member's connection in a thread no guest holds Collaborate on, `admit` returns the very command it was given, after one lookup for any Collaborate grant on the server. In a shared conversation it puts the author's line first in a person's message text. For a guest's connection it refuses every command type but the five in `GUEST_COMMAND_TYPES` and rebuilds each from the fields a guest may set, so a guest's message always uses upstream's `queue_after_active`. The guest gate's rule for `orchestration.dispatchCommand` reads the thread from the command itself and needs Collaborate on it. Nothing in `Orchestrator.ts`, the adapters or upstream's contracts is edited; who wrote a message is J5's own table (migration 39).

## Pin and upstream advance runbook

Expand Down Expand Up @@ -748,6 +749,7 @@ explicitly marked.
| `apps/server/src/testUtils/shardWeights.json` | N | 65 |
| `apps/server/src/ws.ts` | A | 37, 42, 58, Role library, Saved-agent mentions |
| `apps/server/src/ws.ts` (the guest gate and view) | N | 69 |
| `apps/server/src/ws.ts` (a shared conversation's commands) | N | 75 |
| `apps/web/index.html` | R | B |
| `apps/web/src/branding.test.ts` | R | B |
| `apps/web/src/branding.ts` | R | B |
Expand Down
4 changes: 3 additions & 1 deletion apps/server/src/j5/a2a/Migrations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ it.effect("tracks J5 A2A migrations independently from upstream migrations", ()
{ migration_id: 36, name: "OpenLinks" },
{ migration_id: 37, name: "PersonNames" },
{ migration_id: 38, name: "OpenLinkJoins" },
{ migration_id: 39, name: "MessageAuthors" },
]);
assert.deepStrictEqual(
migrationEntries.map(([id, name]) => [id, name]),
Expand Down Expand Up @@ -134,6 +135,7 @@ it.effect("tracks J5 A2A migrations independently from upstream migrations", ()
[36, "OpenLinks"],
[37, "PersonNames"],
[38, "OpenLinkJoins"],
[39, "MessageAuthors"],
],
);
}).pipe(Effect.provide(NodeSqliteClient.layer({ filename: ":memory:" }))),
Expand Down Expand Up @@ -1382,7 +1384,7 @@ it.effect("recreates earlier-shaped crews tables when 14 runs over them", () =>
applied.map((row) => row.migration_id),
[
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38,
36, 37, 38, 39,
],
);
const memberColumns = yield* sql<{ readonly name: string }>`
Expand Down
2 changes: 2 additions & 0 deletions apps/server/src/j5/a2a/Migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import Migration0035 from "./migrations/035_GuestLinks.ts";
import Migration0036 from "./migrations/036_OpenLinks.ts";
import Migration0037 from "./migrations/037_PersonNames.ts";
import Migration0038 from "./migrations/038_OpenLinkJoins.ts";
import Migration0039 from "./migrations/039_MessageAuthors.ts";

export const J5_A2A_MIGRATIONS_TABLE = "j5_a2a_migrations";

Expand Down Expand Up @@ -88,6 +89,7 @@ export const migrationEntries = [
// 37 sits in the layer below 36 in the stack that introduced both; ids are never renumbered.
[37, "PersonNames", Migration0037],
[38, "OpenLinkJoins", Migration0038],
[39, "MessageAuthors", Migration0039],
] as const;

const makeMigrationLoader = (throughId?: number) =>
Expand Down
24 changes: 24 additions & 0 deletions apps/server/src/j5/a2a/migrations/039_MessageAuthors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import * as Effect from "effect/Effect";
import * as SqlClient from "effect/sql/SqlClient";

// Who sent each message a person wrote in a shared conversation (#533): a
// thread a guest holds Collaborate on. The name is kept as it was when the
// message was sent, so a message stays under its author's name after that
// person is renamed, loses access or is removed. A thread only one person can
// write to records nothing here.
export default Effect.gen(function* () {
const sql = yield* SqlClient.SqlClient;

// No foreign key to the person: a removed guest's messages keep their author.
yield* sql`
CREATE TABLE j5_a2a_message_author (
thread_id TEXT NOT NULL,
message_id TEXT NOT NULL,
person_id TEXT NOT NULL,
person_kind TEXT NOT NULL CHECK (person_kind IN ('member', 'guest')),
display_name TEXT,
created_at TEXT NOT NULL,
PRIMARY KEY (thread_id, message_id)
)
`;
});
Loading
Loading