Skip to content

fix(j5): route Squadrons and inbox across environments - #125

Merged
Jacksondr5 merged 3 commits into
j5/mainfrom
j5/remote-squadrons-inbox
Sep 13, 2026
Merged

Jacksondr5 merged 3 commits into
j5/mainfrom
j5/remote-squadrons-inbox

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Sep 11, 2026 •

Copy link
Copy Markdown
Owner

Closes #105

What Changed

Squadrons and the human inbox now read from each connected environment. Creation, thread homes, launch choices, inbox navigation, and replies keep the owning environment throughout the web/desktop flow. Disconnected sources retain their loaded results and show incomplete coverage.

Why

These J5 features previously sent reads and actions through the primary environment even when remote environments were connected. The change reuses the existing connection registry and the shared authenticated HTTP transport, including bearer and relay DPoP credentials with one refresh-and-retry. Data stays on its owning server; no database migration is needed.

Takeover changes (aaa3719f5b)

  • J5 reads go through executeAuthenticatedEnvironmentHttpRequest, so a relay token the server rejects is refreshed and retried once; focused test added.
  • The index landing keeps upstream's bootstrap wait before judging a Squadron's folder missing.
  • Environment labels render only once results span more than one environment; a single-environment client keeps the name-only picker row from FORK case 20 (the multi-environment label line is recorded there as pending Jackson's sign-off).
  • The docs/user/remote-access.md edit moved under docs/j5/product/cross-device.md; FORK.md case 34 records the upstream-owned paths and amends cases 9 and 20.
  • CodeRabbit findings dispositioned in the PR comment; two fixed.

Validation

  • Touched tests pass: 154 web, 25 client-runtime J5, 12 server; scoped typechecks clean for contracts, client runtime, web, and server; lint reports only pre-existing React compiler warnings in the touched scope.
  • Headless Chromium with two isolated, populated servers (original head): merged Squadrons/inbox, remote creation (HTTP 201), a remote reply (HTTP 200), navigation to the remote sender thread; database reads confirmed only the remote question closed.
  • Headless Chromium against a seeded single-environment worktree (takeover head): thread homes, scope dropdown and filtering, ambient-scope auto-launch, New thread picker, draft chip, inbox page and bell; offline state renders the per-environment notice.
  • Web and desktop share the updated entry points: sidebar, command palette, new-thread shortcuts, draft chip, and inbox. Native mobile screens are a separate increment; provider adapters are unchanged.
  • Direct HTTP was exercised end to end. Relay token refresh is covered by a focused test; a live relay/tunnel session remains unverified.

UI Changes

Two-environment captures use the same fixture data on both servers (same Linux host, so the displayed hostname is shared). Before: j5/main at the time. After: original head 19b20b1ad9; the multi-environment presentation is unchanged at aaa3719f5b.

View Before After
Inbox Only the local question appears Local and remote questions appear
Squadron picker Only the local Squadron appears Local and remote Squadrons appear

Remote reply recording (10 seconds) · Inbox after the remote reply

Single-environment presentation at aaa3719f5b (no environment labels, matching case 20):

Picker Scope dropdown
Picker rows are the Squadron name alone Scope choices are the Squadron name alone

Evidence lives on j5/evidence, pinned to 414156c02 (two-environment) and 0b4237987 (single-environment, with SHA256SUMS).

Checklist

  • One concern: environment routing for Squadrons and the human inbox
  • Explained what changed and why
  • Included before/after images
  • Included a short interaction recording
  • FORK.md case recorded for the upstream-owned paths

Implemented with GPT-6 using the Codex harness; takeover fixes by Claude Fable 5.1 using Claude Code.

🤖 Generated with Claude Code

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). labels Sep 11, 2026
J5 reads now go through executeAuthenticatedEnvironmentHttpRequest, so a
relay token the server rejects gets one refresh and retry like every other
authenticated client read. The index landing keeps upstream's bootstrap wait
before judging a Squadron's folder missing. Environment labels appear only
once a read model spans more than one environment, keeping case 20's
name-only picker row for a single environment. The remote-access user doc
edit moves under docs/j5, and FORK.md case 34 records the upstream-owned
paths this feature touches.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Jacksondr5

Copy link
Copy Markdown
Owner Author

Posted by an AI agent on Jackson's behalf

CodeRabbit CLI record — coderabbit review --committed --base j5/main --agent at reviewer-clean head 19b20b1ad9; 6 findings, dispositioned here and fixed where noted in aaa3719f5b.

# Severity File Disposition
1 major apps/web/src/j5/squadron/ThreadHomesClient.ts (scope effect reads requestedRef) Dismissed. New refs are requested by the non-forced effect as they arrive; the forced reread is deliberately keyed to scope selection and its generation only, so a thread-list change never forces a whole-scope reread.
2 minor apps/web/src/j5/state.ts (force bypasses unsupported) Fixed. An unsupported source is never refreshed; force only bypasses the in-flight guard.
3 minor apps/web/src/j5/a2a/HumanInboxBell.tsx (? when count is 0 and incomplete) Dismissed. Documented behavior: a question mark means no positive count is available while some environment cannot be refreshed; 0* would claim a known zero.
4 minor apps/web/src/j5/a2a/HumanInboxPage.tsx (previous key set dropped when data is null) Dismissed. data is null only for an unsupported source or one that has never loaded; AsyncResult keeps the last value across failures, so a transient failure keeps its key set.
5 minor packages/client-runtime/src/j5/inbox.ts (notice copy separator) Fixed. Error notices use the same em-dash separator as the offline notice.
6 minor packages/client-runtime/src/j5/squadrons.ts (all-unsupported directory reports error) Dismissed. When every environment lacks the J5 routes the first-run gate must show unavailable-with-retry, not an empty ready directory that invites creation.

Additional changes in aaa3719f5b from the takeover review: J5 reads now go through the shared executeAuthenticatedEnvironmentHttpRequest (relay token refresh-and-retry, with a focused test); the index landing keeps upstream's bootstrap wait; environment labels render only once results span more than one environment (case 20 kept for a single environment); the docs/user/remote-access.md edit moved under docs/j5; FORK.md case 34 records the upstream-owned paths.

@Jacksondr5
Jacksondr5 marked this pull request as ready for review September 13, 2026 02:29
…abel

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Jacksondr5
Jacksondr5 merged commit 732a3f5 into j5/main Sep 13, 2026
21 checks passed
@Jacksondr5
Jacksondr5 deleted the j5/remote-squadrons-inbox branch September 13, 2026 03:01
Jacksondr5 added a commit that referenced this pull request Sep 14, 2026
… cross-environment changes

Rebased onto j5/main. Folds main's five doc changes into the rewritten
definitions in their own shape: list_squadrons and join_squadron in the
agent tools and substrate definitions and as Squadron AC14; reversible
archive, unarchive and separate deletion in the archive-flow and tools
definitions; the cross-environment merge (#125) as cross-device
AC7–AC10 and inbox criteria, with build status in the dogfood plan.
Records #126 and #127 as landed in the A2A plan. Moves the Squadron
Scope section into the Definition and the plan per the conventions.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Jacksondr5 added a commit that referenced this pull request Sep 14, 2026
* docs(j5): how the J5 docs are organized — five kinds, lifetimes, two identifier kinds

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(j5): glossary rewritten as index + owned distinctions; casing rule made unambiguous

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(j5): cite principles by name — headings un-numbered, every numeric citation rewritten

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(j5): Squadron rewritten as a definition; naming session moved to a record; glossary review fixes; shared example fleet

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(j5): A2A definition, substrate and agent-tools as definitions; communication-graph draft to a record; A2A plan to plans/

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(j5): steering after the upstream integration — two independent policies, truthful-steer guard, stop wins over restart continuation; Astra delivery guidance removed

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(j5): inbox, thread rendering and archive flow as definitions; Replied everywhere; a person receives asks only and never opens one

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(j5): A2A definition — a person receives asks only and never opens one (repairs edits missed against the staged text)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(j5): Roles, Crews, Memos, Playbooks, Spawning Guide, Shared Squadrons as definitions — the design-review register dissolved into them

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(j5): dogfood plan consolidated under plans/; decision log, design review and backlog become records; principles' cases point at definitions by name; GitHub milestones carry the backlog

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(j5): problems, use cases, fleet vision, cross-device and the PR pane as definitions; the posted PR-pane brief kept as a record

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(j5): mechanical sweep — records renamed date-first with frontmatter, research stamped as_of, runbooks under runbooks/, process classified, README rewritten

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(j5): fold the Fleet page contract into a definition

Rewrites sidebar-and-roster as the Fleet page and sidebar definition
(AC1–AC26, scenarios, History mapping SB1–SB7, FV1–FV11 and DV6),
moves the 2026-09-04 fleet-visibility session record to its date-first
name with a pointer to the definition, re-keys the dogfood plan's
narrowing table by criterion, and gives the glossary's Fleet page,
Squadron scope, orphan and delivery alarm terms their owners. Supersedes
PR #107.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(j5): rebase onto main and absorb the landed lifecycle, join, and cross-environment changes

Rebased onto j5/main. Folds main's five doc changes into the rewritten
definitions in their own shape: list_squadrons and join_squadron in the
agent tools and substrate definitions and as Squadron AC14; reversible
archive, unarchive and separate deletion in the archive-flow and tools
definitions; the cross-environment merge (#125) as cross-device
AC7–AC10 and inbox criteria, with build status in the dogfood plan.
Records #126 and #127 as landed in the A2A plan. Moves the Squadron
Scope section into the Definition and the plan per the conventions.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(server): pin the send_message description to the definition's new shape

The EnvelopeFormatter test reads the send_message description out of
docs/j5/product/a2a/agent-tools.md and compares it byte-for-byte with
the runtime string; the docs rewrite changed the heading and label the
parser looked for. Update the parser to the definition shape, drop the
stale "or a reply" toward a person from the runtime string (a person
never opens an ask, so there is nothing to reply to; the channel itself
went in #127), and hold the definition's description to the shipped
string. The regarding sentence returns with #111.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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.

Deferred: support remote Squadrons and inboxes in the local client

1 participant