Repository navigation
FE-1842: Gather Brunch's website code under its plugin and stop packages importing each other's files - #10029
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
PR SummaryMedium Risk Overview Enforces workspace import hygiene with Brunch-agent test/tooling tweaks: persona browser turn waits for admission before watching approvals; generic agent admission URL matching; new manual Reviewed by Cursor Bugbot for commit fdc60e9. Bugbot is set up for automated code reviews on this repo. Configure here. |
004fec1 to
e7969c2
Compare
e7969c2 to
4e5087a
Compare
…ssion wiring and fold provider admission back into the app
…orbid relative imports into other packages
The four website tests that need the built Brunch server move to `tests/petrinaut-brunch-integration`, which depends on both apps. The website no longer depends on Brunch's server, so its builds and deploys do not build it. `@local/brunch-testing` is removed: its harness returns to `apps/brunch-agent/test/` and is exported as `@apps/brunch-agent/testing/*`, so no package loads another's build by relative path.
Moving one of those modules already fails the test package's type check, and tests/hash-backend-integration imports deep paths the same way without one.
The probe was the one script the image ran from src/. Without it the Dockerfile removes the app's src/ and test/ after the build; the server runs from dist/.
A Brunch card without the plugin's api rendered nothing, so an approval waited with nothing to answer it. The editor shows its view only after every plugin has run, so a missing api means the host left the plugin out or it failed: the card now says so and reports the failure. The file is renamed to editor-api-plugin.tsx, since use-brunch-assistant.tsx is Brunch's entry point.
The rule caught relative paths into another package's src or dist, but not into its test folder or anything under tests/, so imports this branch removed, such as the website's reach into brunch-agent/test, would still have passed.
document and editor described the same open document: one carried the id the conversation binds to, the other its live handle once loaded. BrunchOpenDocument holds both, with the handle null while the document loads.
The transport answered every send with a stream that closed at once. The tool call stayed waiting, so the editor's chat sent again in a loop that starved timers. On CI a query timed out under that load, and the worker ran out of memory after an hour. A stream that stays open, as a real turn does, makes one send.
…sends A static tool-deleteItemsByIds part is one the editor runs itself, so the seeded call ran without anyone answering and the turn continued. Brunch's calls are dynamic tools the editor leaves to the host.
🌟 Purpose
This PR provisionally settles the layout, for the various packages contributing to
brunch-agentconcerns; it also ensures that import paths across packages follow repository rules and conventions; and finally it aligns (at least on a file-placement level) with the new petrinaut "plugin API" in terms of isolating UI code.🔍 Changes
Start with
apps/petrinaut-website/src/main/app/plugins/brunch/use-brunch-assistant.tsx: everything else either moved into the Brunch plugin folder around it or stopped importing across packages.useBrunchAssistantassembles Brunch's assistant (Flue client, document binding, mutation approval, Ledger tab, transport, history, stop, Voice check) and returns the host's plugins with Brunch's added. The demo shell drops from about 790 to 290 lines and only chooses between Brunch and the stock assistant.api. A requiredwebsite.brunchplugin publishes its ownapias a plugin service; the approval, follow-up and draft-experiment cards take it as a prop instead of reading Petrinaut's React contexts. The draft card is the exception that remains: it takes the document handle, because Brunch hashes the full document (see Known issues).plugins/brunch/voice. Renames and import paths only.no-restricted-importsnow rejects relative paths that leave the package, in the website, the Brunch app and library,@local/pi-faux-providersand the new test package. Two moves follow from it:tests/petrinaut-brunch-integration, which depends on both apps, liketests/hash-backend-integrationdoes for the HASH API. The website no longer depends on Brunch's server, so its builds and deploys don't build it.@local/pi-faux-providers, and the app exports its built-server harness as@apps/brunch-agent/testing/*.src/andtest/after the build and runs fromdist/. Nothing ships fromsrc/now that FE-1764: Keep elicited knowledge in an efficient append-only Ledger #9865 drops the RDS IAM probe, which was the one script that ran from it.Users see one change: while Brunch is the assistant, User settings → Plugins lists Brunch, with no switch. Petrinaut's packages are untouched.
api.document.net, which leaves out data for disabled extensions. The two are equal on the website. A test pins the current choice until it is decided (FE-1961).website/plugins.mdxin the Petrinaut architecture docs doesn't listwebsite.brunchyet (FE-1962), and nobody has checked the new Plugins entry in a browser.test:integrationdepends on^build, so it also builds the website bundle.