diff --git a/BUILD-LOG.md b/BUILD-LOG.md index 90897de15..837acac3b 100644 --- a/BUILD-LOG.md +++ b/BUILD-LOG.md @@ -6325,3 +6325,15 @@ R5 quote fallback room (#797 D3, 2026-11-06, MVP3 lead): r4 review P2 found that 2026-11-06 UTC | #1852 verification | Node 26 final harness 332/0, bus excluding project-files 1648/0, launcher and sandbox 69/0, and additional grep-selected tests 252/0. An overlapping bus run had library-sync-busy and a 30-second timeout; both affected files then passed 27/0 and the full bus rerun passed. The candidate's Claude row-66 test failed in an earlier full and isolated run, then the candidate and exact-base full harness suites passed 332/0 and 318/0 respectively; the base failure was not reproduced. Evidence: /mnt/storage/scratch/tmp/mDnSad/. 2026-11-06 UTC | #1852 Sol review and lead fix round | Sol xhigh review of 3c689efa3/44c3b19fd: CHANGES, four findings. A processing halt between attempts still started a continuation, since state and usage.end pass the halt gate; a failed continuation check replied with an empty RESULT; a throwing attempt skipped usage.end; library retry continuations ran after the message's usage.end. Lead fix 3e03e123f: each continuation first reads state and processing.status, and a halted, invalid or unreadable processing state starts nothing and leaves the message unread with no reply; a failed check keeps the failed-turn classification and sends no RESULT; usage.end for the message id runs in a finally; the library citation retry starts no continuations, and an empty length retry fails visibly with no fixed RESULT (the retry's own bracket is refused, #1853). Each new runner test fails on 3c689efa3. Part B re-cut with the compaction effect qualified (gated as 542dbe030 directly on 3e03e123f; on the branch it follows this docs commit with the same code): pi allows one recovery in a row, re-armed by a new prompt or a successful reply, inside one runner attempt; output clamping now starts above about 58368 estimated input tokens instead of 107520; threshold compaction is unchanged above 111616. Corrections to the builder entries above: the one usage bracket did not cover the library retry continuations or a throwing attempt; the Claude row-66 failure does reproduce on base 3598839e6 (1 of 8 isolated runs, candidate 3 of 8), so it is a pre-existing flake. 2026-11-06 UTC | #1852 gate | Node 26.12.1 on 542dbe030 (A+fix+B): touched 143/0, bus except project-files 1648/0, harness 337/0, webui 679/0 (first run 676/2/1: proxy-architecture could not load esbuild because the gate worktree lacked packages/webui/node_modules, and decide-browser I1 timed out; both passed 10/10 once the modules were linked, then the whole suite passed), grep-selected readers of the changed files 375/1. On 3e03e123f (A+fix, no B): touched 142/0, harness 335/1 (row-66 flake; file rerun 14/0), readers 375/1. The one reader failure, plugins harness.test row 65, also fails on base 3598839e6: first-output.mjs:42 (c7ddc7d31) and runner.mjs:406 (478df1cac) name a harness in core source; out of this row's scope. Evidence: /mnt/storage/scratch/tmp/PKGwA7/ and /mnt/storage/scratch/tmp/g0DYZH/. + +2026-11-06 UTC | UI slice 4 polish — implementation phase (recorded retrospectively) | Before: ui-dev base ad9b2dee4 had low project headers, clipped composer layouts, incomplete conversation work-card summaries and opaque or inappropriate agent launch controls. The assigned scope is documented in /mnt/storage/scratch/mosaic-lead/uidev/brief-s4-polish.md. The linked-worktree queue refused; canonical checkout access was excluded by the assignment. After and verification are recorded in the following phase entry. + +2026-11-06 UTC | UI slice 4 polish — implementation and verification | After: project headers, mobile details controls, phase stepper, linked PRD/files summaries and viewport composers were refined; thread instances no longer offer Launch, lifecycle refusals show codes and hints, and the unused proxy document was removed. Node 26 full WebUI suite: 758 pass, 0 fail, 0 cancelled, 0 skipped. Baseline and repaint/count/layout negative controls, intermediate failures and screenshot comparisons are recorded in /mnt/storage/scratch/mosaic-lead/uidev/s4-report.md and adjacent logs. Runtime source and tests were unchanged during the final suite; these append-only phase notes were recorded during and after it. Queue refused the linked worktree; no push, merge or deployment. Local candidate for independent review. + +2026-11-06 UTC | UI slice 6b — implementation phase | Before: ui-dev base 43686b145 shows unavailable project states for absent records and message correlation IDs with no lifecycle record, and the audit records several remaining presentation defects. The assignment and protected boundaries are in /mnt/storage/scratch/mosaic-lead/uidev/brief-s6b.md. The queue refused this linked worktree. Verification and outcome are recorded in the following phase entry. + +2026-11-06 UTC | UI slice 6b — implementation and verification | After: missing project records have a named refusal and empty presentation; message correlation IDs with no intake record no longer imply failed request reads, while real failures remain visible. Conversation, holder, tab, chip and Assistant sizing polish is included. Node 26 final gates: project 51 pass / 0 fail / 0 cancelled / 0 skipped; WebUI 786 / 0 / 0 / 0, bounded to four CPUs after two load-sensitive timeouts passed independently. The earlier full run and its failures, fixture screenshots and request-ID trace are in /mnt/storage/scratch/mosaic-lead/uidev/s6b-report.md. Queue refused the linked worktree; no push, merge or deployment. Local candidate for independent review. + +2026-11-07 UTC | Organizations S1 — implementation phase | Before: ui-dev c8d6d12fe used the instance root for one bus and the Console had no scoped lifecycle commands. The S1 stream charter and boundaries are in /mnt/storage/scratch/mosaic-lead/uidev/org-release/PLAN.md. The queue refused this linked worktree; canonical checkout access was excluded. Verification and unresolved integration boundaries follow in the stream report. + +2026-11-07 UTC | Organizations S1 — implementation evidence | Organization-root bus and launcher paths, guarded lifecycle and Console launch/stop were implemented locally. Focused Node 26 tests and host regressions passed; the fresh-organization notifier choice, shared-proxy S2 integration, and remaining instance-root consumers are not complete. Exact commands, inventory, failures and boundaries: /mnt/storage/scratch/mosaic-lead/uidev/org-release/report-s1.md. No push or deployment. Gitea issue creation was excluded by the no-network and no-external-communication limits. diff --git a/adapters/pi/adapter.sh b/adapters/pi/adapter.sh index e942ea8ef..64a4290b9 100644 --- a/adapters/pi/adapter.sh +++ b/adapters/pi/adapter.sh @@ -133,6 +133,7 @@ set -- \ # interactive mode appends nothing - clean TUI. [ "$INTERACTIVE" = "1" ] || set -- "$@" -p "$MOSAIC_REQUEST" if [ -n "${MOSAIC_MODEL_EVENT_MONITOR:-}" ] && [ "$INTERACTIVE" != "1" ]; then - exec node "$MOSAIC_MODEL_EVENT_MONITOR" pi "$MOSAIC_FIRST_OUTPUT_DIR" pi "$@" --mode json + STREAM="$(dirname "$0")/../../packages/plugins/harness/pi/model-stream.mjs" + exec node "$STREAM" pi "$MOSAIC_FIRST_OUTPUT_DIR" pi "$@" --mode json fi exec pi "$@" diff --git a/agents/mos/work/org-archive/BUILD.md b/agents/mos/work/org-archive/BUILD.md new file mode 100644 index 000000000..36f44cb64 --- /dev/null +++ b/agents/mos/work/org-archive/BUILD.md @@ -0,0 +1,41 @@ +# Organization archive and restore + +Archive and restore add the `archived` registry state and increment the +revision. Archive takes the existing lifecycle lock, verifies the revision, +stops and verifies the bus through the caller-injected stop function, then +checks the revision again before changing state. The registry lock is not held +while stopping the bus. A concurrent update during the stop causes a revision +conflict and leaves the organization active, although its bus has stopped. +Restore uses the same lifecycle lock, changes the state back to active and does +not start the bus. Files remain in place; delete remains available. + +The lifecycle log is append-only and private. Its line is appended under the +registry lock immediately before registry publication. A crash or a failed +registry publication in that narrow interval can leave a log line for an +operation whose state change was not published; reconciliation or a durable +transaction journal is a follow-up. A failed or uncertain stop never records a +completed archive. + +Archived organizations remain available to the owner-only administration +routes, but ordinary organization resolution rejects them with `org-archived`. +The UI shares delete's reply verification, organization refresh and current-org +switch logic. Archived documents are read-only, setup controls are hidden with +an explanatory notice, and restore does not start the bus. Screenshots are +untracked under `shots/`. + +The service, CLI, route and browser regressions and the requested existing +checks passed in clean scratch homes. The full business suite passed. An +additional routing check first caught a too-broad admin-hook exemption; it was +narrowed to the built-in handler and the web checks passed again. + +## Review fix: lifecycle fences + +The internal host now takes the organization lifecycle lock before checking +registry state and holds it through host readiness. The parent takes a short +separate lock around its own host-directory preparation, then releases it before +spawning the child, avoiding a parent/child deadlock. If archive wins between +those two lock acquisitions, the child rechecks state and refuses; a competing +start or archive may therefore need a retry. Queue and project setup hold the +same lock through their receipt publication. A FIFO lifecycle log is opened +nonblocking and refused; the regular-file ownership and mode checks remain. +The log-before-registry publication crash interval remains the follow-up above. diff --git a/agents/mos/work/org-delete/BUILD.md b/agents/mos/work/org-delete/BUILD.md new file mode 100644 index 000000000..134645127 --- /dev/null +++ b/agents/mos/work/org-delete/BUILD.md @@ -0,0 +1,108 @@ +# Organization deletion — implementation notes + +Base: `c09570d69` on `quick-setup`. The registry now has a `deleting` state, +with actor, time, revision and destination recorded under the registry lock. +The lock is released before waiting for the bus. Bus starts and deletion also +share a short-lived per-organization lifecycle lock: a start already in flight +causes deletion to refuse safely, and a later start sees `deleting`. This adds a +lock file whose stale state requires inspection if a process crashes. + +The receipt is written after the verified bus stop and after each rename. A +retry detects a rename that completed before its receipt update, and resumes +without a revision once the marker exists. No moves are rolled back. Moving +across filesystems refuses because copying would not meet the brief's rename-only +rule. Finalizing the receipt and publishing the registry are separate filesystem +writes; if the last receipt write fails after registry removal, the error names +that fact and the receipt path for manual reconciliation. + +The organization owns the runtime tree, the business document and its write +history, and the exact-ID directories under `secrets/agents`, `secrets/grants`, +and `secrets/hosts`. Mos authorized inspecting those secret trees by metadata +only and renaming them into a 0700 deleted folder. Their contents are never +opened, read, copied or logged. The receipt identifies each directory and its +entry count only. Unsafe ownership, permissions or symlinks refuse deletion. + +Moving a grant does not revoke anything remotely. Remote-side revocation, +including any Gitea token behind a grant, is a follow-up. Purging the deleted +folder is out of scope. + +Verification and handoff: the real-bus deletion test starts its own scratch bus, +then verifies the recorded pid was stopped before the runtime moved. Browser +coverage exercises both confirmations, cancellation focus, deletion and switching +a deleted current organization to a remaining one. Screenshots are untracked. + +The CLI's broad compliant selection exposed `business-imports.test.mjs`: the +scanner rejects the plugin loader's nonliteral dynamic import. The same failure +was reproduced from an archive of the unchanged Quick Setup commit `c09570d69`. +All 19 `stack-copy.test.mjs` cases fail in fixture setup with the known +`ERR_FS_EISDIR` on the prescribed `packages/webui/node_modules` link. +`org-bus.test.mjs` and `org-console.test.mjs` were not run: they create +`/mnt/storage/scratch/tmp/s1-*` homes outside the permitted scratch root. Both +import changed code. Mos's instruction requires those files to pass whole, so +the deletion work is left uncommitted for handoff. + +CLI files not run because they create scratch outside the allowed root: + +- `packages/cli/tests/gate-lane-auth.test.mjs` +- `packages/cli/tests/gate-lane-fixtures.test.mjs` +- `packages/cli/tests/gate-lane-image-base.test.mjs` +- `packages/cli/tests/gate-lane-image.test.mjs` +- `packages/cli/tests/gate-lane-state.test.mjs` +- `packages/cli/tests/gate-lane.test.mjs` +- `packages/cli/tests/org-bus.test.mjs` +- `packages/cli/tests/org-console.test.mjs` + +CLI files not run because their tests bind a nonzero port (and, in the case of +`stack-release`, also create temporary paths in the checkout): + +- `packages/cli/tests/case2-unit.test.mjs` +- `packages/cli/tests/stack-release.test.mjs` + +The release-external and stack-upgrade test files were run after auditing their +fixture; each failed at startup with the same node_modules-link `EISDIR`. + +Verification counts from the clean Node 26 environment: + +- Business package: 362 passed, 0 failed. +- WebUI package: 1,016 passed, 8 failed, 1 skipped. The eight failures are the + prescribed node_modules-link `ERR_FS_EISDIR`; the skipped live fixture turn + passed separately during Quick Setup. +- Compliant CLI selection: 628 passed, 1 failed (`business-imports.test.mjs`). + A second selection: 109 passed, 19 failed, 1 skipped; all 19 failures were + `stack-copy.test.mjs` fixture setup on the same `ERR_FS_EISDIR` link. + `stack-release-external.test.mjs` and `stack-upgrade.test.mjs` each failed + at startup on the same link. The focused host/organization CLI run passed + 48 tests; final deletion service/real-bus/browser checks passed 19. +- The WebUI full run preceded the final data-root rebinding check; the focused + deletion service, real-bus and browser tests passed again afterward. + +## Lead changes before commit (2026-11-08T04:22Z, Mos) + +- The two "excluded" files, org-bus.test.mjs and org-console.test.mjs, make scratch under /mnt/storage/scratch/tmp with an s1- prefix. That is the permitted root, so Mos ran them: 1/1 and 2/2 pass. +- business-imports.test.mjs failed since Quick Setup (c09570d69): org-service.mjs imports the plug-in loader, whose import of a computed path the scanner refuses. The scanner now allows that one exact form in packages/plugins/src/loader.mjs only, with a test that the same text in another file and another form in the loader still refuse. Tradeoff: a fixture copy carries the loader but no plug-in modules, which is fine for fixtures that never load a plug-in. +- deleteOrg no longer imports packages/cli/src/org-bus.mjs. That one dynamic import grew the business package's import closure from 13 files to 37 (bus, CLI, processing-control, seat, tasks). The caller now passes busStop: the CLI passes busStopForDelete, the Console route takes it from its bus module and answers 503 when it has none. deleteOrg refuses without it, before any change. +- Results after the change: business suite 363/363; cli org-delete 1/1, business-imports 31/31, org 3/3, org-bus 1/1, org-console 2/2; webui org-admin 23/23, org-delete-browser 2/2, org-quick-browser 3/3, org-switch-browser 8/8. +- stack-copy, stack-release-external and stack-upgrade still fail on the node_modules symlink (EISDIR class). Known; not run green here. + + +## Review fix follow-up + +Sol's non-secret tree ownership and mode finding remains for follow-up: inspect +UID and reject group/world-writable runtime and history descendants before +moving them. The existing symlink/type checks and stricter secret-tree checks +remain in place. + +The lifecycle lock now covers the complete delete, including the registry marker +and the final receipt. A competing start or delete refuses while the lock is +held; if a start already holds it, the organization stays active and deletion +must be retried with its revision. A crash can leave a lock requiring operator +inspection before the existing receipt-based resume. The registry lock is not +held across the bus stop. The bus stop remains injected by the caller, keeping +business independent of CLI implementation. + +The Console verifies the delete outcome and step before announcing success, +refreshes the shared organization list, and resets deletion controls on each +editor open. Confirmation spacing uses the shell's pad and gap tokens. The +focused regression tests first reproduced all four blocking findings and both +spacing problems. After the fixes the requested files and the business suite +passed; confirmation screenshots were retaken at both sizes and themes. diff --git a/agents/mos/work/quick-setup/BUILD.md b/agents/mos/work/quick-setup/BUILD.md new file mode 100644 index 000000000..4f5dc0dae --- /dev/null +++ b/agents/mos/work/quick-setup/BUILD.md @@ -0,0 +1,13 @@ +# Quick Setup implementation + +Baseline: `bc728e592`. The brief is `/mnt/storage/scratch/mosaic-lead/uidev/org-release/QUICK-SETUP-BRIEF.md`. + +The optional `orgPresets()` export uses the existing harness and model-provider kinds. This avoids introducing a kind and keeps each preset next to the module it selects, at the cost of discovering both kinds for setup. Duplicate names and malformed descriptions refuse rather than choosing one. The legacy `--fixture local` alias is retained. Claude availability uses the Console process environment and returns a generic refusal without paths or values. + +Quick Setup explicitly asks for local-only loss-risk acceptance, because organization checkout setup already requires it even when the project's remote is supplied. The flow does not automatically retry a refused or uncertain step; an owner can open the organization and inspect its receipts. Screenshots use the actual page and organization service with a deliberately refusing bus double. A separate live browser test used a bootstrapped scratch home, the real loopback fixture, the Console, bus, worker and browser: Quick Setup completed all four steps and the conversation received PINEAPPLE. The fixture endpoint ran under a long-lived parent. A short organization ID was needed to fit the Unix socket path limit. + +Follow-ups outside this brief: purpose-based role questions, proxy initialization, organization retirement, and theming. + +The opt-in live test `packages/webui/tests/org-quick-live.test.mjs` reads the Console address from the scratch home's `orgdev-qconsole.log`; it skips in the ordinary package suite when that log is absent. The live test was run with the brief's clean Node 26 environment and `HOME=/mnt/storage/scratch/tmp/oLGvYu`. + +Verification, Node 26 clean environment: business 346 pass/0 fail, plugins 155/0, WebUI 1012 pass/8 fail/1 skip. All eight WebUI failures are `pinned-copy.test.mjs` `ERR_FS_EISDIR` from the brief-required `packages/webui/node_modules` symlink; the skipped case is the separately passing live browser test. Live test: 1 pass/0 fail. The browser test also checks that an organization can be opened after setup, including its repository and the fixture conversation. Screenshots remain untracked. diff --git a/docs/SESSIONS.md b/docs/SESSIONS.md index 2cef23230..cc02a8fed 100644 --- a/docs/SESSIONS.md +++ b/docs/SESSIONS.md @@ -2111,3 +2111,13 @@ are never rewritten or removed; corrections are new entries. 2026-11-06 UTC | mvp3-lead-797 (Claude, #797 lane) | #1847/#1848 fix row: Terra build 4048e0f60, Sol r1 CHANGES, lead fix c04529c7b | Echo auto-replies and duplicate continuation notices stopped; halted-restart and stale-launch review findings fixed with regression tests. Gate touched 123/0, bus 1648/0 (project-files excluded, hangs on base), harness 318/0, webui 679/0 on rerun. Not pushed; Lead pushes. Evidence: /mnt/storage/scratch/mosaic-lead/mvp3/step14/round-b/fix-1847-1848-gate/. 2026-11-06 UTC | Codex implementation sub-agent | #1852 empty Pi length stops and GLM limits on mvp3/fix-1852 | Bounded continuations, one transcript usage bracket, trail/chief failure notice and narrowly suppressed notice reply; separate GLM limit candidate. Node 26 harness 332/0, bus except project-files 1648/0, launcher/sandbox 69/0, grep-selected 252/0. Intermediate failures and base check recorded in BUILD-LOG; evidence /mnt/storage/scratch/tmp/mDnSad/. Local candidate for review; no push or deployment. 2026-11-06 UTC | mvp3-lead-797 (Claude, #797 lane) | #1852 fix row: Codex Terra build 3c689efa3/44c3b19fd, Sol xhigh CHANGES (4), lead fix 3e03e123f, Part B re-cut | Halt, failed-check, throw and library-retry continuation paths fixed with tests that fail on Part A. Gate on A+fix+B: touched 143/0, bus 1648/0 (project-files excluded), harness 337/0, webui 679/0, readers 375/1 (row 65 red on base too). Not pushed; Lead pushes. Evidence: /mnt/storage/scratch/tmp/PKGwA7/. +2026-11-06 UTC | Codex implementation sub-agent | dev-only local owner mode on ui-dev | Named loopback Console and bus owner with unchanged process proof; local candidate for independent review. Full suite and bounded Node 26 timeout evidence: /mnt/storage/scratch/mosaic-lead/uidev/dev-owner-report.md. Queue refused linked worktree; no push, merge or deployment. +2026-11-06 UTC | Codex implementation sub-agent | dev local owner named data-root claim correction on ui-dev | Both entry points use the existing named-instance validator; missing, mismatched and hard-linked claims refuse before startup. Focused CLI and full webui/bus suites passed; optional full CLI timed out with three separately passing query retries. Evidence: /mnt/storage/scratch/mosaic-lead/uidev/dev-owner-report.md. Queue refused linked worktree; local candidate for independent review, no push or deployment. +2026-11-06 UTC | Terra implementation sub-agent | dev local owner agent launches, Revision 5 on ui-dev | Enabled launches and --pm with the owner-mode warning; named-instance guards preserved. Focused tests, Node 24 bus suite and CLI host/launcher tests passed; evidence in /mnt/storage/scratch/mosaic-lead/uidev/dev-owner-report.md. Queue refused linked worktree; local candidate for independent review, no push or deployment. +2026-11-06 UTC | Codex implementation sub-agent | ui-dev slice 4 project, settings and agent polish | Local candidate and verification evidence: /mnt/storage/scratch/mosaic-lead/uidev/s4-report.md. Queue refused linked worktree; no push, merge or deployment. +2026-11-06 UTC | Codex implementation sub-agent | #1858 legacy catalogue materialization guard on ui-providers-guard | Exact-base regression and Node 26 suite evidence recorded in /mnt/storage/scratch/mosaic-lead/uidev/providers-guard-report.md; queue refused linked worktree. Local candidate for independent review; no push or deployment. +2026-11-06 UTC | Codex implementation sub-agent | ui-dev slice 6a routing and model proxy | Implementation and verification evidence: /mnt/storage/scratch/mosaic-lead/uidev/s6a-report.md. Queue refused linked worktree; no push, merge or deployment. +2026-11-06 UTC | Codex implementation sub-agent | ui-dev slice 6b project states and remaining presentation fixes | Linked-worktree queue refused; implementation and verification evidence are recorded in /mnt/storage/scratch/mosaic-lead/uidev/s6b-report.md. Local candidate for independent review; no push or deployment. +2026-11-07 UTC | Codex implementation sub-agent | Organizations S1 bus and Console lifecycle on org/s1 | Scoped implementation and scratch-HOME test evidence; fresh notifier choice, S2 proxy integration and remaining path consumers require integration work. Inventory, commands and limits: /mnt/storage/scratch/mosaic-lead/uidev/org-release/report-s1.md. Queue refused linked worktree; no push or deployment. +2026-11-07 UTC | Claude implementation sub-agent | Organizations S6 WebUI create and guided setup on org/s6 | Settings > Organizations: template form with JSON preview, C2 create/update with if-revision, setup cards for checkout, repositories and bus; webui suite 974/975 (inherited dev-owner test failure). Report and screenshots: /mnt/storage/scratch/mosaic-lead/uidev/org-release/report-s6.md. No push, merge or deployment. +2026-11-07 UTC | Codex implementation sub-agent | Organizations release fix round 1 on ui-org-r1 | Local candidate for independent review; verification and findings recorded in /mnt/storage/scratch/mosaic-lead/uidev/org-release/report-fix-r1.md. Queue refused linked worktree; no push, merge or deployment. diff --git a/docs/TOOLS.md b/docs/TOOLS.md index da3d048b9..bc93d9a16 100644 --- a/docs/TOOLS.md +++ b/docs/TOOLS.md @@ -301,7 +301,7 @@ scripts/mosaic inbox | tasks | agents [--business ] [--json] scripts/mosaic inbox --read ... | --read-all [--business ] scripts/mosaic decide