Files

7.2 KiB

Row 208 / 193d — Console shared threads and viewer reads

Base ec86f2c84, branch poe/row208; Gitea #1706. Approved design: e2d161e2e, sha256 dd7fcb419ed8510e9d8d74b569183386d0942af8b68eecc0bbb5e182e677b523.

Before

FED R6 supplies per-session user transport and the user-only page, row 192 SSO, and row 206 supplies schema 3l shares and bus refusals. No bus/schema changes needed. The webui channel adapter must forward the three existing share verbs.

Choices and acceptance

Use the existing chat HTTP write fences and per-session transport for shares. Expose only live collaborator grant project/instance scopes as UI hints, never identity or bus authority. Re-read hints when rendering a user page; mixed grants must hide writes on viewer-only threads even when another project allows writes. Shared threads always read without session management, composer, resume or sharing. Keep the exact governance notice on user thread/share pages. Targets are typed owner/user principal names or *, avoiding a new user directory read API.

Add new isolated HTTP/broker and browser coverage. Remove each UI guard in mutants and show the real broker still refuses viewer create, send, open and share writes. Every test execution requires Sage CLEAR; use scratch TMPDIR, deadlines, npm ci, and MOSAIC_REQUIRE_EDITOR_BUILD=1. No live state or network destinations.

Tracking

Queue next from linked tree refused as designed; canonical next matched pinned brief. Claim poe-0001 initially refused on Sage's queue lock; retry the same operation id.

Claim poe-0001 succeeded at canonical queue revision 3807 (in-progress). During implementation, three string replacements briefly targeted canonical packages/webui/src/public/{bus.js,user.js,chat.js} due to an incorrect command cwd. Checked the complete diffs, surgically reversed exactly those replacements, and applied them to this worktree. Sage independently confirmed canonical packages/ has no remaining diff (sage-3914). No tests or live actions occurred there.

poe-0002 requested the test slot. sage-3914 approved the exact serialized plan, but CLEAR is pending Bentina returning her slot. No node/npm/browser commands before CLEAR. New tests are thread-sharing.test.mjs with thread-sharing-fixture.mjs; mutants.mjs runs four served-source mutants with assertion kills plus bus bypass.

First verification (sage-3917 CLEAR)

Scratch logs: /mnt/storage/scratch/tmp/YU1G5B/. Syntax 12/12 exit 0; npm-ci.log exit 0; editor-build.log exit 0; thread-sharing.tap 7/7 exit 0. mutants.log and poe-208-mutants.json: four absence-test assertion kills (exit 1 each), four bus bypass proofs (exit 0 each), runner exit 0. Each mutant's individual log is poe-208-NAME-kill.tap or -bypass.tap. Full serialized webui.tap stopped on an existing-test red: 44 pass, 1 fail before termination; runner exit 1. Plugins not run. Slot returned to Sage via poe-0003.

Existing failure: chat-browser.test.mjs:123, uncertain writes/read failure draft preservation, line 133 expects #chat-body after no-bus-host. The new current.thread is not retained before list reads succeed, unlike old current.threads. A transient read failure therefore hides the existing owner conversation. Proposed fix retains same-thread metadata across refresh, never stale user grant scopes. No old tests changed and no further execution pending Sage's ruling/CLEAR.

Approved correction (sage-3918)

The old test is correct; this change broke its transient-failure draft contract. Retain current.thread and shared only when the old id equals the requested id. User chatGrants still start empty and are read fresh, so a stale hint is never carried forward. A real 403/404 clears thread/shared metadata plus cached history, drafts and operation forms. chat-browser.test.mjs remains byte-identical. Fix applied statically; Sage will CLEAR the four mutants, full webui and plugins suites after Bentina returns the slot. No node/npm/browser commands before then.

Clarification during static review: retain the existing distinction between a thread-level refusal and a local bad-session selector (old row 272 B1 test). All 403/404 responses clear visible thread/shared metadata, as before; thread-level thread-not-owned/thread-not-found/access-refused also erase sibling cached history and drafts. A bad-session selector never erases valid sibling drafts/recovery keys. This preserves the existing invalidation contract rather than broadening the fix.

sage-3920 CLEAR: first mutant rerun stopped on a new-test failure, not a valid mutant kill. /mnt/storage/scratch/tmp/8UlAhS/poe-208-composer-kill.tap shows null old.thread on initial /chat: old?.id and undefined route id compared equal. Fixed by requiring old to exist before either same-id metadata carry. This is a new defect in the approved correction, no old test change. Rerunning the plan.

Second slot outcome (sage-3920)

Scratch /mnt/storage/scratch/tmp/8UlAhS/. Initial mutants.log exit 1 was the new null-previous-state defect above. Fixed; mutants-r2.log exit 0: all four assertion kills exit 1, all four bypass proofs exit 0 (individual logs overwritten by the successful rerun; summary JSON kept). Full serialized webui.tap stopped on old tests: 114 top-level pass, 5 fail, runner exit 1. The original draft-preservation failure and row 272 B1 both pass. The new old-test failure is environmental: decide-sso.test.mjs cannot import root dependency oauth4webapi (ERR_MODULE_NOT_FOUND); all five failures share it. packages/webui npm ci installs its editor tooling, not root runtime dependencies. No tests changed; plugins not run. Request root npm ci from pinned lockfile in next slot before rerunning webui and plugins. Slot returned via poe-0004.

sage-3924 ruled the second red an environment gap, not a product defect. Approved root npm ci --ignore-scripts from the pinned lock, full webui then plugins, serialized. sage-3925 CLEAR starts that sequence. Push only after green; send base/tip and every changed path's SHA-256 to Sage and Gladstone.

Final builder verification (sage-3925 CLEAR)

Root npm ci --ignore-scripts exit 0 from pinned lock. Full webui: exit 0, 418 pass, 0 fail, 0 skipped (271964 ms). Plugins: exit 0, 119 pass, 0 fail, 0 skipped (823 ms). Logs /mnt/storage/scratch/tmp/Et9xAa/{root-npm-ci.log,webui.tap,plugins.tap}. Slot returned immediately after plugins via poe-0005. All new acceptance cases are included in the full webui run. Four latest UI mutants and bus bypass proofs remain green at /mnt/storage/scratch/tmp/8UlAhS/mutants-r2.log and poe-208-mutants.json. No old tests changed. No bus authority/schema changes.

Acceptance: owner and collaborator can share/unshare own writable threads; shared lists preserve the plain-list shape and show owner names safely as text; shared threads cannot compose, resume, mutate sessions or reshare. Viewer old own threads retain read history with no write controls. Mixed grants and live downgrades hide writes only where coverage requires; revoked shares clear the view. Direct browser POSTs bypass all UI checks and the real broker still refuses viewer create/send/open/share. Existing exact governance notice retained. Global scripts/test-*.sh gate and independent reviewer approval remain Sage's landing gate; this builder does not claim those or any live deployment.