ποΈ chore: adopt bun workspaces at plugin root (closes #42)#43
Closed
ZaxShen wants to merge 2 commits into
Closed
ποΈ chore: adopt bun workspaces at plugin root (closes #42)#43ZaxShen wants to merge 2 commits into
ZaxShen wants to merge 2 commits into
Conversation
closes #42) Two coupled fixes surfaced during a dogfood attempt that ran bun install at the plugin repo root and failed β there was no root package.json. Workspaces - New plugin/package.json declares `workspaces: ["mcp/trajectory-server", "monitors"]`. One `bun install` at plugin root installs every subpackage; dedups `better-sqlite3` that both subpackages share. - Root `scripts.build` runs `bun --filter='*' run build` β every workspace with a build script rebuilds. Root `scripts.test` runs `bash tests/run-all.sh`. - Subpackage `bun.lock` files deleted (mcp/trajectory-server + monitors); replaced by a single root `bun.lock` (26 KB). Gitignore dogfood-generated paths - Add `docs/trustmybot/` to .gitignore. The plugin's own contributor docs live at `docs/architecture/`, not `docs/trustmybot/`. If a contributor dogfoods inside this repo (instead of a scratch project), architect/SWE would create `docs/trustmybot/snapshots/`, `docs/trustmybot/architecture/auto/`, etc. as if this were a user project β those artifacts should never land in commits. - The plugin-root .gitignore's existing `.claude/` rule already covers the runtime DB + worktrees path. Docs updated - docs/local-testing.md Prereqs section: one-command `bun install` + `bun run build` at the plugin repo root. Two other places that said `cd plugin/mcp/trajectory-server && bun run build` trimmed the same way. CI simplified - .github/workflows/test.yml: three install/build/test steps that each set `working-directory: mcp/trajectory-server` collapsed into a single root-level `bun install --frozen-lockfile`, `bun run build`, and `bash tests/run-all.sh` (picks up MCP + hook + lint suites). Verified - `bun install` at plugin root installs 260 packages, produces one consolidated lockfile. - `bun run build` at plugin root compiles MCP server successfully (monitors has no build; `bun --filter` skips it cleanly). - `bash tests/run-all.sh`: 235 MCP + 16 hook + 4 agent-budget lint, all green. Closes #42 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Users were copy-pasting `/absolute/path/to/trustmybot-plugin` literally and launching Claude Code with a bogus `--plugin-dir`, so no plugin loaded and `@gatekeeper` had nothing to bind to. Replace the placeholder with `$(pwd)` captured from the plugin repo root, with a sanity-check echo and a fallback note for users who run from elsewhere. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Folding into #41 β both changes are dogfood-enablement (test plan + the infra that makes the plan runnable). One combined PR is easier to review than two interleaved ones. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
package.jsondeclaringmcp/trajectory-serverandmonitorsas a bun workspace β a singlebun installat plugin root now installs both subpackages and produces one consolidatedbun.lock.docs/local-testing.mdand.github/workflows/test.ymlto use the root-level commands (bun install,bun run build,bash tests/run-all.sh).docs/trustmybot/to.gitignoreso dogfood-from-inside-repo runs (which write architecture snapshots + task artifacts under that path) never pollute commits.Why
User hit
Bun could not find a package.json file to install fromwhen followingdocs/local-testing.mdat the plugin root. Industry standard for multi-package repos with bun is workspaces β one install, one lockfile, contributors don't juggle subdirectories. The.gitignoreline covers the other concern from the same report: local testing inside this repo must not generate files that end up tracked by git.Test plan
bun install --frozen-lockfileat plugin root resolves both subpackages (260 packages, singlebun.lock).bun run buildat plugin root compiles the MCP server successfully.bash tests/run-all.sh: 235 MCP + 16 hook + 4 agent-budget lint, all green.working-directory).docs/trustmybot/ignored β no pollution if dogfood writes there.Closes #42