Skip to content

feat(server): anyone who can write to a shared thread answers its prompts, and who answered is kept - #600

Closed
Jacksondr5 wants to merge 16 commits into
j5code/share-4b-notesfrom
j5code/share-4c-prompts
Closed

Jacksondr5 wants to merge 16 commits into
j5code/share-4b-notesfrom
j5code/share-4c-prompts

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Jackson ruled on this layer on 2026-10-13, and nothing here is open with him: the agent is not told who answered an approval; a guest's message carries composer context, with attachments left for #597; a guest approves a roster whatever access its seats have; a thread grant writes to the one agent it names (#534); both ws.ts wraps and the inbox reply's envelope are approved; mobile is out of scope. Stacked on #599.

Approved by Jackson: an envelope every agent reads changes. A person's reply from the inbox to an agent's ask, once the server holds a name for that person:

  • Before, in every thread: [Message from human:dfc92701-…]
  • After, in an ordinary thread: [Message from Jackson (human:dfc92701-…)]
  • After, in a shared conversation: [Message from Jackson (member) (human:dfc92701-…)]
  • With no name on record: unchanged.

The web card that draws this message parses the old header and is not changed in this PR (its file is changed in #602); until it is, a reply sent after this lands shows its sender as the whole label and is not matched to the person.

Problem

In a shared conversation any member or guest collaborator may answer the agent's prompts, the first answer settles one, and the settled prompt shows who answered. Nothing recorded who answered, and a Crew roster could be answered only by a member. Third of three server layers for #533.

What changed

  • Who answered an approval or a question is recorded (j5_a2a_prompt_answer), on any thread that is or has been a shared conversation, so a prompt a member answers after the last guest has gone still says who answered. Each person's answer is written down as it is taken in, before upstream has it, as a claim. Who answered is read as the claim whose command upstream's own event log shows settled the prompt. Upstream answers "accepted" again for any command id it has already taken, so its saying so is not proof: a replayed id, a refused or interrupted answer and an answer that lost to an earlier one all name no one. Nothing runs after upstream's handler. The event type is typed against upstream's event union, so a rename there fails to compile.
  • A guest's command goes on to upstream under a command id of that person's own (guestCommandId: command:j5:guest:<person>:<the client's id>). A guest chose its own id, and upstream takes any id it holds a receipt for as already done. A guest could therefore name the id the platform would use to withdraw its queued message and keep that message alive after losing access (the security review proved this), or name an id upstream's recovery used and be read as the one who answered. Under its own id a guest's retry still finds its own receipt, and no one else's id can be named. Upstream's web client does not read back the id it sent. The platform's withdrawal also carries a random part, and logs an error if the run is still queued afterwards. A member's ids are unchanged.
  • A thread started in a shared project is a shared conversation from its first message. With a Collaborate grant on the project, a member's new thread stored its first message as typed, with no note and no author line (found by the live test). The launch request is now taken in as a message is. The thread has no record yet at that point, so whether it will be shared is read from the project. Upstream generates a thread's title from its stored first message, which now begins with the note. No bad title has been seen: a new shared thread in the live test was titled from the typed words. Jackson ruled no upstream edit; the risk is recorded in Shared conversations: upstream surfaces that show a stored message's text show the platform's lines #612.
  • A guest answers a question in words and any other prompt by a decision, never both and never neither. An approval answered in words was marked resolved by upstream and never reached the provider, so nobody could answer it.
  • A guest is handed back a roster without host paths after answering it, as on preview, and a problem reading its playbook is said without the reader's own words.
  • A name or a "here for" line cannot close the platform's note. Angle brackets are taken out of a name and written out in a "here for" line, and look-alike brackets around "member" or "guest" are read as plain ones.
  • A guest's roster reads show no host paths. For a guest's connection previewCrewProposal leaves out workspaceOptions and does not ask git for worktrees, and both it and listThreadRosters replace a seat's worktree folder. The approval token is the same one a member's preview gives.
  • A guest reads a Crew roster on a thread it can read, and answers it as proposed on one it can write to (AC8, AC10, AC11). j5.crews.previewProposal needs View and j5.crews.resolveProposal needs Collaborate on the Captain's thread. A request that carries seats of its own, even the same ones, is refused: changing a seat stays with members.
  • One new read, j5.crews.listThreadRosters({ threadId }), beside J5's other client reads, for anyone who can read the thread. It is the one client read a guest may make: the list of every open proposal on the server, like the rest of those reads, stays refused to a guest.
  • The Captain is told who decided, when its thread is a shared conversation: the gate notices gain one line, decided_by: Priya (guest). Any other Captain reads the notice as it was.
  • Still members only (AC12): a Crew's request for a further seat, a seat's approval, stopping or archiving a Crew, and answering the inbox.

The agent is not told who answered an approval (AC9, Jackson: "The providers dont provide a way for us to give the context, a queued message is terrible UX"). An earlier commit put a line on the next message a person sent, counting approvals per person; it is removed with the columns and the query that existed for it. Who answered is still recorded and shown to the people on the thread.

A guest's message carries what a member's composer adds (Jackson: "We shouldn't put restrictions on message content (other than the prompt injection guard you already have)"): context records and a plan to build from, on a message and on a queued edit. A title seed is left out. Three limits remain, none about what a guest may say:

  • No attachments, and no context record that names one, until a guest can upload (Sharing: let a guest collaborator attach files and mention things #597). Upstream passes a stored attachment's id through unchecked, so a guest could name one from a thread it cannot read.
  • A thread a message attaches for the agent to read must be one the guest can read. A thread whose plan it builds from must be one the guest can write to: upstream marks that plan completed on the plan's own thread.
  • A context record of a kind beginning j5 is refused: the platform keeps those for its own.

Still refused as not content: accept for the session or always, steer, restart, model choice, and the fields that would make a message someone else's. What the agent reads for a guest's context is pinned by a test against upstream's own projection.

A member's slash command goes on as typed (Shared conversations AC22, Jackson 2026-10-13). Upstream and the providers read a command from the first character of the stored text, which in a shared conversation is the author line, so until now no slash command worked there for anyone. Now a member's message whose first character that is not whitespace is / goes on exactly as typed: no author line, no note, no author record. A note that is due rides on the next stamped message. A guest's message is stamped whatever it begins with. A member's own queued message edited into a command goes on as typed and stops being a recorded message; a guest's queued message stays the guest's and stays stamped, whoever edits it. A new thread started with a member's command goes on as typed. The first note gains: "Nor does a member's message that begins with a slash command; a guest's always has one."

Command Read by A member's, in a shared conversation A guest's
/compact (/compress on Cursor) upstream and the adapters compacts the provider's context sent to the agent as words under their name
/logout upstream, then Cursor and Antigravity signs the provider out sent as words; the provider is not signed out
/goal … upstream, the Codex adapter, Claude sets or controls the goal sent as words
a provider's own commands and skills the provider CLI runs the command sent as words

Not covered: a member's queued slash command edited back into ordinary words goes on unstamped, because nothing records who sent an unstamped message. It is a member's, and the agent reads it as not a guest's.

Crews are unchanged (Jackson, 2026-10-13; #534): a thread grant writes to the one agent it names and reads those beneath it, and a guest answers no prompt on a Crew seat's thread.

For a question, a person's answer carries their name on its words (#599). For a Crew roster the Captain is told by the decided_by line.

A person's reply from the inbox names them. [Message from Jackson (human:…)] once a name is on record, in the form the outside-agent header uses for a name and an id; [Message from Jackson (member) (human:…)] in a shared conversation, which is the author line of a typed message with the id after it. The envelope version moves to 27. Messages already stored keep their old line. Mobile does not parse this header.

A guest approves a roster whatever access its seats have (Jackson: "you invited someone to your server to talk to agents, you need to trust them"). Nothing is built for it; AC10 now says it plainly.

Mobile is not supported for sharing and shared conversations (Jackson). Recorded in D33; the follow-up is #609.

Not verified by a unit test: that a second connected client sees a prompt settle. The three events upstream emits are ordinary thread events on the thread's feed; the live test checks it.

Live testing

Report: test-reports/j5code-share-4c-prompts.md, Run 5 (a peer agent, on an isolated test server; real turns on Claude Haiku and GPT Luna; a member and a guest in two browser tabs).

Verdict: pass on 9b380f8aea for what was exercised, after a fail on the commit before it. The earlier commit recorded no answerer at all: the check that a command settled a prompt read a table upstream no longer writes. It reads upstream's live event log now.

Case Recorded By whom
Claude question Yes Priya (guest)
Claude approvals All three Jackson approved, Priya approved, Jackson declined
Codex question Not reached Luna asked in a plain message, so no prompt was raised
Codex approvals All three Jackson approved, Priya approved, Jackson declined
  • The answer names its author. Claude received [Answer from Priya (guest)] Concise checklist as the answer to its question.
  • (The approvals line seen in this run has since been removed.)
  • A replayed command does not take over an answer. The guest re-sent an answer to a prompt the member had already answered, reusing an earlier command id. Upstream returned success, and the stored row still named the member.
  • A reply from the inbox names the person. In a shared thread the agent received the member's inbox reply headed [Message from Jackson (member) (human:…)].
  • Restart. After a restart at rest the answer authors read back the same.

From the earlier runs: the first answer settled the prompt in the other person's tab without a reload, and a late answer was refused with "Runtime request … is resolved."

Not exercised live by this run: the commits since it, the last of which removes the approvals line and lets a guest's message carry context; a focused live pass on those is to follow. The first puts an approval answered before the first message into the first note (the UI builder found it missing and has since confirmed the fix live). The second and third rebuild how who answered is read and when a note counts as told, and put a guest's commands under ids of their own. They have tests on the real orchestrator for the kept-alive queued message and the repeated first note, and unit tests for a rewind and the answerer takeover; a live pass on them is still to come. Also not exercised: a question prompt on Codex; a Crew roster decided by a guest, so the decided_by line and listThreadRosters are covered by tests only; a migration rehearsal from an older database; mobile and desktop. After the restart the first page load showed "No projects yet" with an HTTP 403 and recovered on the next navigation; the tester did not isolate it as a product defect.

Upstream impact

apps/server/src/ws.ts, FORK.md case 75, gains a second wrapped request beside the one #598 added (5 lines; approved by Jackson, 2026-10-13): orchestration.launchThread goes through admitLaunch, because a new thread's first message comes in the launch request and not as a command. The call after upstream's handler that an earlier commit added is gone. FORK.md case 75 now lists every upstream field J5 reads by SQL and what a member's command costs. One change to what upstream receives: a guest's command id is rewritten, recorded in D33.

J5 migrations 40 and 41 are edited in place (41 again for the removed approvals columns). The stack's migrations are 39 to 41, after #615's 38. A test home made on an earlier commit of this stack must be rebuilt.

Checklist

  • One concern: the description has no "also"
  • Tests cover the changed behavior (backend changes ship with focused tests)
  • UI changes: none in this layer
  • Live testing: the section above says what ran live and what did not
  • Upstream-owned files: each one is recorded in FORK.md (case text and file-table row) in this PR
  • Upstream product: recorded in D33
  • Surfaces: contracts (one new read, one new field); providers unaffected. A guest's client must call listThreadRosters, which no client does yet
  • Docs: D33

Claude Opus 5.5, Claude Code in J5 Code.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Oct 14, 2026 6:40pm UTC

Request Review

@Jacksondr5
Jacksondr5 added this pull request to stack #583 October 13, 2026 05:47
@github-actions github-actions Bot added the size:L 100-499 effective changed lines (test files excluded in mixed PRs). label Oct 13, 2026
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-4c-prompts branch from 01302c6 to aeb31ba Compare October 13, 2026 05:51
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Oct 13, 2026
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-4c-prompts branch from aeb31ba to 6b54f1e Compare October 13, 2026 05:56
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-4c-prompts branch from 6b54f1e to 6045144 Compare October 13, 2026 06:15
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-4c-prompts branch from 6045144 to e48e28e Compare October 13, 2026 06:19
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-4c-prompts branch from e48e28e to 1626364 Compare October 13, 2026 06:21
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-4c-prompts branch from 1626364 to 1fa38e2 Compare October 13, 2026 06:25
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-4c-prompts branch from 1fa38e2 to 71ee167 Compare October 13, 2026 06:57
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-4c-prompts branch from 71ee167 to 93d4778 Compare October 13, 2026 07:08
Jacksondr5 and others added 16 commits October 14, 2026 14:37
…mpts, and who answered is kept

Upstream records that a prompt was resolved and not by whom, and a Crew
roster could be answered only by a member.

In a shared conversation the person who answers an approval or a
question is now recorded and served to anyone who can read the thread.
A guest sees a Crew roster on a thread it can read, and with Collaborate
approves or declines it as the Captain proposed it: a request that
carries seats of its own is refused. The Captain's gate notice says who
decided, only when its thread is shared. A Crew's request for a further
seat, a seat's approval, stopping or archiving a Crew and the inbox stay
with members.

For an approval or a question the agent itself is not told who answered:
upstream's adapters hand the provider a fixed answer. That gap against
AC9 is Jackson's to rule on.

Refs #533

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the review of the collaborate layers.

Who is answering a prompt is written before upstream settles it, and
was taken back only when upstream refused the answer. An answer
interrupted while upstream had it left its row behind, so a prompt later
settled another way could read as answered by someone whose answer never
landed. The wrap in ws.ts now settles the row on any exit: kept when
upstream accepted, taken back when it refused or was interrupted.

FORK.md case 74 states what a member pays per command and which two of
upstream's fields J5 reads by SQL, with the test that catches a reshape.

Refs #533

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he prompt, and a guest's roster shows no host paths

From Bryant's review of the stack.

Upstream answers "accepted" again for any command id it has already
taken on a thread, whatever the command was. A guest could replay the id
of an earlier message as an answer to a prompt and be recorded as the
person who answered it, over a member who really had. Who answered is
now kept only when upstream's own event log shows that the command
settled that prompt; otherwise what was written for it is taken back,
and a record is never replaced by a claim.

Who answered is recorded on any thread that is or has been a shared
conversation, so a prompt a member answers after the last guest has
gone still says who answered.

The roster reads a guest may make returned the project's folder, the
host's worktree folders and branch names, and ran git for each preview.
For a guest's connection the workspace options are left out, git is not
asked, and a seat's worktree folder is replaced.

Refs #533

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…th the next message

Jackson ruled on what Bryant's review left for him (2026-10-13).

An approval carries no words to put a name on, so the agent of a shared
conversation was never told who approved or declined its commands. The
note at the top of the next message a person sends now carries one line
for the approvals answered since the agent was last told: a count per
person, members included, naming no command. It uses the same block and
the same carrier as the note about who can write, so one block carries
both when both are due, and a carrier withdrawn before it runs means the
next message carries the line. Only an answer that upstream's log shows
settled a prompt is counted. The last note of a thread that stops being
shared carries what is left, and a thread shared again starts afresh. A
thread that was never shared costs nothing more.

A guest approving a roster whatever access its seats have is unchanged,
and the definition now says so. Sharing and shared conversations are
recorded as not supported on mobile.

Refs #533

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Jackson ruled on the inbox reply's first line (2026-10-13).

A person's reply to an agent's ask reached the agent as
"[Message from human:…]", an id and no name, while a message typed in a
shared thread says who wrote it and where they stand.

Once the server holds a name for the person, the reply's first line is
"[Message from Jackson (human:…)]" in every thread, in the form the
outside-agent header already uses for a name and an id. In a shared
conversation it is "[Message from Jackson (member) (human:…)]", the
author line of a typed message with the id after it, and the first note
tells the agent so. With no name on record the line is what it was.

The envelope version moves to 27. The web card that parses this header
is not changed here.

Refs #533

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

A live run on Claude found that no one was recorded as answering a
question in a shared thread, though the answer reached the agent.

The check that an answer really settled a prompt read a table upstream
no longer writes to, so it never found the settling event and took every
record back. It now reads upstream's live event log: the thread's
stream, the event whose payload is the request, and the id of the
command that caused it. The approvals line depends on the same check and
was equally affected.

The unit tests wrote that event by hand into the wrong table, which is
why they passed. They now write it as upstream's event store does, and
the test over the real orchestrator pins the table, the stream, the
payload's id and the command id on an event upstream writes there.

Refs #533

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

A guest's first act on a shared thread can be answering an approval. The first
note marked every waiting approval as told without telling it, so that one was
never reported. That rule was meant for approvals answered while a thread was
not shared; those are now closed when they are recorded, and the first note
carries what was answered since the thread was shared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…old it, and who answered from upstream's log

What the agent was last told about who can write was kept in one row per
thread with a one-level fallback. A rewind left the agent untold for good,
since a rolled-back run counted as delivered, and a change note built on a
first note that was then withdrawn stood in for it. Each carrier now keeps
what it told and which carrier it was worked out against, on the message's
author record. The agent was last told by the newest carrier that reached it
along with every note it builds on. A rolled-back run counts as lost, for
notes and for approvals told. The told table and its fallback are gone.

Who answered a prompt is now the claim whose command upstream's event log
shows settled it, read when asked. The accepted and refused steps, the settled
column and the call after upstream's handler in ws.ts are gone, and a claim
that lost is never returned. The event type is typed against upstream's union.

Migrations 39 and 40 are edited in place: a test home made on an earlier
commit of this stack must be rebuilt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…queued note is not yet told

A guest chose its own command id, and upstream replays any id it holds a
receipt for on the thread as success. So a guest could name the id the
platform would use to withdraw its queued message, and keep that message
queued after losing access; or name an id upstream's recovery used, and be
read as the one who answered a prompt. A guest's command now goes on under an
id inside a space that is that person's alone, made from the client's id, so a
retry still finds its own receipt. The platform's withdrawal carries a random
part and logs if the run is still queued afterwards.

A note on a message still in the queue has told the agent nothing, and its
author can withdraw it: until a message that carries the note is known to have
run, every message carries it. This replaces the chain of carriers.

A guest answers a question in words and any other prompt by a decision, never
both, so an approval cannot be wedged. A guest is handed back a roster without
host paths after answering it. Angle brackets in a name or a "here for" line
cannot close the platform's note, and look-alike brackets around member or
guest are read as plain ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ation from its first message

A new thread's first message comes in upstream's launch request, not as a
command, so it skipped the check every other message goes through: in a
project a guest holds Collaborate on, the first message was stored as typed,
with no note and no author line. The launch request is now wrapped in ws.ts
beside the command request, and its first message is taken in the same way.
The thread has no record yet at that point, so whether it will be shared is
read from the project the launch names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… that ended unstarted told the agent nothing

Every answer a guest sent was written down as a claim, even one upstream
refused, and each message to a shared conversation reads the thread's claims.
A guest could grow both. A guest's answer or dismissal is now refused unless
upstream has that prompt pending, so nothing is written for an answer that
cannot land.

A message whose run failed or was interrupted before it started counted as
having reached the agent. It now counts as lost, as a withdrawn one does.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt is not told who answered an approval

Two rulings from Jackson's read of the stack (2026-10-13).

A guest's message may carry what a member's composer adds: context records, a
plan to build from and a title seed, on a message and on a queued edit.
Attachments, and records that name one, stay refused until a guest can upload
(#597). Another thread a message names must be one the guest can read, and a
context kind beginning j5 is the platform's.

The line telling the agent who answered its approvals is removed, with the
columns and the query that existed for it. Who answered is still recorded and
shown to people. Migration 40 is edited in place: rebuild test homes.

Both ws.ts edits are recorded as approved. A thread grant still writes to the
one agent it names and reads those beneath it (#534).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… to, and sets no title

Upstream does not only read the plan a message names: it marks it completed on
the plan's own thread. A guest who could read that thread could therefore
complete a member's plan there. Naming a plan now takes Collaborate on its
thread. A thread attached for the agent to read still takes only reading.

A title seed became the title of an empty thread, at any length. It is left
out of a guest's command again; upstream makes a title.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A guest's reduced configuration left out inlineMessageContext, so upstream's
composer took the server for an old one and folded a mention into plain words:
the context a guest may now send never arrived as records. The capability is
told truthfully. It says nothing about the host; the attachment capabilities
stay unsaid, since a guest's attachments are refused.

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

Upstream and the providers read a command from the first character of a
message, which in a shared conversation was the author line, so no slash
command worked there. A member's message whose first character that is not
whitespace is a slash now goes on exactly as typed, with no author line and no
note; a note that is due rides on the next stamped message. A guest's message is
stamped whatever it begins with, so it reaches the agent as words. The same
holds for a queued edit and a new thread's first message. The first note says
so, and Shared conversations AC22 records the rule (Jackson, 2026-10-13).

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

Copy link
Copy Markdown
Owner Author

Closed unmerged, by Jackson's decision (2026-10-17). The product was redefined from first principles in #631 (People and access, and a reworked Shared conversations), which reverses most of this stack's guest restrictions. The parts that still apply (the author line and note, the launch wrap, the answer records, the cards and notices) will be carried into a single rebuild PR against the new definitions, after the next upstream advance. The branch is kept for reference.

🤖 Generated with Claude Code

This branch was successfully deployed

1 active deployment
Preview — a1f88a47 Deployed Oct 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants