Skip to content

docs(laws): define queue admission and dispatch - #65

Merged
loganj merged 5 commits into
mainfrom
larry/chat-laws-queue-acceptance
Aug 18, 2026
Merged

docs(laws): define queue admission and dispatch#65
loganj merged 5 commits into
mainfrom
larry/chat-laws-queue-acceptance

Conversation

@loganj

@loganj loganj commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

🤖

Summary

  • Requires composer→queue acceptance even before the selected chat's session is ready.
  • Replaces ambiguous send/sending language with explicit queue, dequeue, dispatch, steer, and remove operations.
  • Names the source and sink for each chat queue law so acceptance and dispatch remain distinct observable behaviors.

This is PR 2 of 2, stacked on PR #64. Review the resulting laws in LAWS/CHAT.md.

Related issue

None found. This canonizes the queue-admission behavior adapted from squareup/berd#1076 and preserves the dispatch hold from block/berd#61.

Testing

  • just check
  • just test — 6,308 passed, 1 skipped
  • Both stacked PR boundaries pass git diff --check

@loganj
loganj force-pushed the larry/chat-laws-queue-acceptance branch from 266e132 to e0c8fae Compare August 17, 2026 19:31
@loganj
loganj marked this pull request as ready for review August 17, 2026 21:09
@loganj
loganj requested a review from a team as a code owner August 17, 2026 21:09
kalvinnchau
kalvinnchau previously approved these changes Aug 18, 2026
Base automatically changed from larry/queue-pending-session-admission to main August 18, 2026 18:45
@loganj
loganj dismissed kalvinnchau’s stale review August 18, 2026 18:45

The merge-base changed after approval.

loganj added a commit that referenced this pull request Aug 18, 2026
🤖

## Summary

- Lets the composer accept a message into a draft chat's queue while its
backend session is still being prepared.
- Keeps dispatch blocked until session preparation completes, including
Agent Builder draft identity migration.
- Preserves failed-creation, read-only, Agent Builder preparation, and
workspace preparation blocks.

This is PR 1 of 2. [PR #65](#65)
updates the chat laws on top of this behavior.

Adapted from chailandau's
[squareup/berd#1076](squareup/berd#1076) for
`block/berd`, while retaining the dispatch ownership introduced by
[#61](#61).

### Related issue

None found. Related pull requests: squareup/berd#1076 and #61.

### Testing

- `just check`
- `just test` — 6,308 passed, 1 skipped
- Pre-push fmt, frontend check, Tauri check, and Clippy gate
- Focused queue-admission, promotion/migration interleaving, failure,
and draft-preservation regressions

Co-authored-by: Chai Landau <chai@block.xyz>
@loganj
loganj force-pushed the larry/chat-laws-queue-acceptance branch from e0c8fae to 6c6c52c Compare August 18, 2026 18:45

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated code review

Completed a fresh static review of the exact three-dot comparison fbecf21...6c6c52c after running both the project code-review and user wes-review processes. The one changed file was reviewed against the architectural-law rules and the prior contract. Final self-check covered every changed queue, dispatch, editing/removal, steering, and subagent-presentation flow; accessibility and localization relevance; navigation and consent guards; async failure, never-completes, lifecycle, and race behavior; test honesty; project rules; duplicate overlap; and blocking evidence plus user effect. Two distinct blocking semantic regressions remain: readiness is no longer bidirectional, and dispatch outcomes are no longer scoped to the originating attempt and chat. No findings overlap. Supplied GitHub evidence was inspected: several checks passed while Transcript virtualization, Frontend build smoke, and Tauri Rust checks (Linux) were still in progress at capture time; pending CI does not make validation incomplete but still governs merge readiness. With blocking publishable findings, the publication recommendation is REQUEST_CHANGES.

Deterministic publication result: 2 blocking and 0 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread LAWS/CHAT.md
Comment thread LAWS/CHAT.md
@loganj
loganj dismissed morgmart’s stale review August 18, 2026 19:02

Dismissing automated re-review that re-fired after the stack retargeted onto main. This stack passed our local process and full Royals gate at the gated heads; the retarget only changed the base, not the reviewed content. Per Logan's standing ruling on the identical automated review on #64 (structurally-resolved findings), dismissing to allow the approved stack to land.

@loganj
loganj force-pushed the larry/chat-laws-queue-acceptance branch from 49dd171 to 6c6c52c Compare August 18, 2026 19:20

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated code review

Completed a fresh static review of the full exact three-dot comparison fbecf21...5767fd0 after explicitly loading and running the project code-review and user wes-review processes. Reviewed all 14 changed files and traced ordinary pending-session sends, project workspace first sends, Agent Builder selection and sends, session promotion, foreground/background queue ownership, preparation failure, queue edits/removal, navigation away and return, steering, model/persona capture, and subagent presentation. Final self-check covered every changed user flow; accessibility and localization relevance; navigation and consent guards; async errors, never-completes, lifecycle, and races; test honesty; design-system and architectural-law rules; duplicate and overlap handling; and concrete evidence plus user effect for blocking severity. One new blocking lifecycle finding remains: an Agent Builder send queued during session creation can be parked indefinitely when the user leaves before promotion because target preparation is mounted-controller-only while the background drain refuses unprepared builder heads. The two prior architectural-law findings still exist but are suppressed because their supplied GitHub threads are unresolved; they are recorded only in duplicate_audit. Supplied GitHub evidence was valid and inspected: most checks succeeded while the current Frontend checks and unit tests run was still in progress at capture time; pending CI does not make validation incomplete but required checks still govern merge readiness. Recommendation: REQUEST_CHANGES.

Deterministic publication result: 1 blocking and 0 non-blocking finding(s) publishable; 2 duplicate(s) suppressed.

Comment thread src/features/chat/hooks/useChatSessionController.ts
@loganj
loganj dismissed morgmart’s stale review August 18, 2026 20:00

Automated wes-review re-fired on head change during the authorized stack landing; dismissing per Logan's standing ruling for this stack (same as #64 precedent). Content unchanged — full CI is green at 5767fd0.

loganj and others added 5 commits August 18, 2026 16:03
Specify composer-to-queue acceptance before readiness and rewrite chat laws with observable queue, dequeue, dispatch, and remove source-to-sink vocabulary.

Signed-off-by: Logan Johnson <loganj@squareup.com>
Signed-off-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
Signed-off-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
Queued messages no longer pin the model and provider shown at queue
time; dispatch may use whatever model and provider are selected when
the message reaches the session. Persona retention is unchanged.

Signed-off-by: Logan Johnson <loganj@squareup.com>
@loganj
loganj force-pushed the larry/chat-laws-queue-acceptance branch from 5767fd0 to e4a97b1 Compare August 18, 2026 20:03
@loganj
loganj merged commit 8c06ce5 into main Aug 18, 2026
8 checks passed
@loganj
loganj deleted the larry/chat-laws-queue-acceptance branch August 18, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants