feat(trios-macos): merge the Queen supervisor work, keeping the TODO inspector - #1087
feat(trios-macos): merge the Queen supervisor work, keeping the TODO inspector#1087gHashTag wants to merge 4 commits into
Conversation
…inspector Two trees had diverged since the switchover moved this app out of BrowserOS. This merges them rather than overwriting either. From gHashTag/BrowserOS (never ported back): - Queen supervisor: QueenWorkerRunner starts a delegated bee on its own transport; QueenBranchCommitter attributes its edits through a throwaway index and commit-tree, so HEAD and the working tree are never touched - QueenObserver reads a live transcript for looping, spinning, out-of-bounds writes and overspending - a pure function, not a second agent - QueenSalience + SalienceLearner rank the review queue by learned intervention rate rather than age alone, with a threshold derived from the priors - Skills as a managed resource: SkillCatalog/SkillStore/SkillsTabView, and QueenSystemPrompt so the Queen can actually see what she can run - ReplayTransport with SSE cassettes, and the model/keychain stack Kept from this repository, which the other tree had archived as a prototype: - TodoPanelPolicy, TodoListProjection and their tests - QueenIntelligenceEngine, QueenMasterViewModel and the delegation chain - The TODO inspector in FullscreenChatWorkspace, threaded through ChatPanelView - Package.swift, xtask, MIGRATED.md Three files genuinely conflicted. FullscreenChatWorkspace was merged by hand so the TODO inspector and the swarm surfaces coexist. ChatPanelView was taken from this repository, which had the richer version. CLAUDE.md was kept as-is because its paths and CI are repository-specific. agent-server/ was deliberately not brought across: the switchover replaced it with the Rust trios-server. The orphaned-tool-call repair that lives there has no home here yet. Verified: build.sh --dev succeeds, and the headless chat SSE harness passes including the cassette, observer and salience-learner assertions. The XCTest suite remains broken, as it was before. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Law L1 is enforced in CI here: a single .sh anywhere fails Constitutional Enforcement. The merge brought eight of them across, all from the BrowserOS tree, and none of them existed on main. Four already have Rust ports in xtask - build, chat-sse-e2e, mesh-chat-e2e and e2e-flow are one-to-one replacements written when the scripts were removed. Bringing the originals back re-added exactly what this repository had deliberately ported away. The other four came with them and had no business here either. The Makefile goes too: it was a wrapper around build.sh and means nothing without it. xtask picks up the new sources on its own - it compiles every git-tracked Swift file plus a short allowlist, so the Queen surfaces added by this branch are included the moment they are committed. No build change was needed. The agent-safe-build skill described the Makefile as the interface, which was true in the other repository and false here. Rewritten around xtask, keeping the verification traps, which are about judgement rather than tooling and cost real sessions to learn. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The merge moved the app tree but not everything it depended on, and it brought 36 test files into a job that had been running 5. **CSQLCipher.** MemoryStore encrypts the agent database with SQLCipher, whose `sqlite3_key` the system sqlite3 does not have, so the C library has to be declared rather than assumed. Its systemLibrary target lived at the browseros repo *root* and did not travel with the app. Ported here, with `brew install sqlcipher` on the runner. `HotkeyAnalytics.swift` was missing from the library sources for the same reason - nothing referenced it until its test arrived. **The suite hung rather than failed.** `ProjectPaths.buildVariant` reads the bundle's Info.plist, and under `swift test` there is no bundle, so it reported `prod`, took the Keychain path, and blocked in `SecItemCopyMatching` on a password dialog no runner can answer. That is worse than a red build: the job would have died on its 30-minute timeout having reported nothing at all. The plist still wins where there is one, so no shipped app can be moved off its own data directory by an environment variable; the environment is consulted only when there is no bundle to ask. CI sets `TRIOS_VARIANT=dev` and the tests use file-backed secrets. **25 of the 36 tests are excluded, by name.** Fifteen do not compile and ten fail. All of it predates this merge - CI never built these files in the tree they came from, so nothing caught the drift for a long time. Fifteen are one shape: the sources became actor-isolated and the tests still call them synchronously. Repairing them is real work and does not belong inside a merge, where it would bury the merge. Listed individually in Package.swift and enumerated in #1089 so the gap is countable instead of silent. `TriOSEncryptionTests.testTamperDetection` is on that list and its name is alarming, so: tamper detection works. AES-GCM rejects the flipped byte and `XCTAssertThrowsError` passes. The test then asserts the error's *type*, and CryptoKit throws its own rather than TriOSEncryptionError. `MockURLProtocol` lived inside `SSETransportTests.swift`, so excluding that file took the helper with it and broke three suites that had nothing wrong with them. It has its own file now. Result: 16 files, 120 tests, green - against the 5 files this job ran before. Refs #1089 Closes #1088 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`recordFetchSuccess` and `recordFamilyRevoked` hand the audit write to a
detached Task so the auth path is never blocked by disk IO. They return before
the entry exists. Both tests read the file on the next line.
Locally this passed, which is the interesting part: an earlier test had already
created the file, so there was always something to read. On CI's clean checkout
there was not, and the suite failed there and only there. The same staleness
meant `testRecordFamilyRevoked...` could have passed on a line written by a
different test entirely - it asserted `contains("family.revoked")` against
whatever happened to be in the file.
Both now poll for the marker with a 2s deadline instead of assuming the write
has landed, and the log is cleared in both setUp and tearDown rather than only
after. Clearing only afterwards makes the first run on a clean machine behave
differently from every run after it, which is how this stayed hidden.
Verified on a clean data directory and again immediately after, both green:
120 tests, 0 failures.
Refs #1089
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
All four required checks are green: Three things had to be fixed to get there, and two of them are worth a look L1. The merge carried eight shell scripts across. This repository forbids The Swift job could not compile. The suite did not fail - it hung. Two judgement calls to review25 of the 36 incoming test files are excluded by name — 15 do not compile,
Two files were resolved unilaterally and deserve a second opinion: One real bug found on the wayThe audit-log tests read the file on the line after the call that writes it, but I cannot merge this myself: branch protection requires one approving review and |
Two trees had diverged since the switchover moved this app out of
gHashTag/BrowserOS.This merges them rather than letting either overwrite the other.
What came across
Work done in BrowserOS after the switchover and never ported back:
QueenWorkerRunnerstarts a bee on its owntransport, so navigating between chats cannot cancel it.
QueenBranchCommitterattributes its edits through a throwaway index and
commit-tree— HEAD, the realindex and the working tree are never touched.
QueenDashboardViewabove 760pt,QueenCompactSupervisorBarin the 400pt panel,QueenTaskBannerin each worker chat.QueenObserverreads a live transcript for looping, spinning, out-of-boundswrites and overspending. A pure function over the transcript, not a second agent:
these patterns are mechanical, and a mechanical check cannot hallucinate the way the
thing it watches can.
QueenSalience+SalienceLearnerrank the review queue by learned interventionrate rather than age alone. The observation threshold is derived from the priors, not
chosen.
SkillCatalog/SkillStore/SkillsTabView, andQueenSystemPromptso the Queen can see what she can run — she previously could reach4 of 26 because the list was a Swift literal.
ReplayTransportwith SSE cassettes, plus the model and keychain stack.What was kept from this repository
This tree had productionised things the other had archived as prototypes. All preserved:
TodoPanelPolicy,TodoListProjectionand their testsQueenIntelligenceEngine,QueenMasterViewModeland the delegation chainFullscreenChatWorkspace, threaded throughChatPanelViewPackage.swift,xtask,MIGRATED.mdThe three real conflicts
FullscreenChatWorkspace.swiftChatPanelView.swiftCLAUDE.mdEverything else differed only because this repository snapshotted an earlier point in
time.
Not brought across
agent-server/— the switchover replaced it with the Rust trios-server. Theorphaned-tool-call repair that lives there has no home here yet, so
AI_MissingToolResultsErrorafter an aborted turn is still unhandled on this side.Testing
./build.sh --devsucceedstests/swift/run_chat_sse_e2e.shpasses, including the cassette-replay, observer andsalience-learner assertions
tests/TriOSKitTests/remains broken, as it was beforeCaveats worth a reviewer's eye
build.shcame from the other tree and assumes../Sources/CSQLCipher; this repo hasno module map at that path. I staged one locally to verify the build — it is not in
this diff, so
build.shwill not work here until that is resolved or the SPM path isused instead.
ChatPanelView.swiftwas resolved by taking one side whole. If the BrowserOS side hadsession-recovery UI worth keeping, it is not in this commit.
🤖 Generated with Claude Code
Closes #1088