Skip to content

feat(bob): add the one-click macOS installer and its release zip - #971

Merged
amiddavid merged 5 commits into
mainfrom
feat/bob-installer
Nov 9, 2026
Merged

amiddavid merged 5 commits into
mainfrom
feat/bob-installer

Conversation

@vz-ibm

@vz-ibm vz-ibm commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #968 (and #967). Review and merge those first. This PR's own change is the last commit, feat(bob): add the one-click macOS installer and its release zip.

Release change. On a v* tag, the release workflow now also attaches 3 files to the GitHub release: the Bob installer zip, its SHA-256 file, and install-bob.sh. The zip is never in git. Nothing else in the release changes.

No behavior change for existing users. Everything else is new and runs only when a user double-clicks the installer.

Summary

This PR adds an installer for context-guru on IBM Bob (macOS). There are 2 ways to run it. Both run the same installer.

1. One Terminal command (recommended). macOS does not block it, so the files need no signing:

curl -fsSL https://github.com/rossoctl/context-guru/releases/latest/download/install-bob.sh | bash
curl -fsSL https://github.com/rossoctl/context-guru/releases/latest/download/install-bob.sh | bash -s uninstall

2. Double-click. The user downloads the zip, double-clicks Install context-guru for Bob.command and types y. macOS asks the user to allow the unsigned file once.

What changed

Installer (bob-plugin/release/)

Install

  1. Checks first, and changes nothing yet:
    • macOS, and arm64 or Intel.
    • Bob is installed.
    • python3 works.
    • Every package file matches SHA256SUMS. An unlisted file or a link is refused.
  2. Shows the plan and asks once. The default is No.
  3. Quits Bob with osascript. It never kills Bob. If Bob does not quit in 30 s, the installer stops.
  4. Copies the plugin and the right proxy binary, then runs setup. It uses its own copy of the binary, never another one on PATH.
  5. Creates ~/.bob/playground if it is missing.
    • Bob uses this folder for a chat with no folder open, but it does not create it.
    • Without the folder, every shell command in such a chat fails, the CG skills too.
  6. Checks the result: setup, /healthz, doctor, status, the status bar. It shows a ✓/✗ table.
  7. On any failure, Ctrl-C or a closed window, it undoes everything.

Uninstall

  • It removes files only after the undo reports result=removed. Otherwise it keeps the record and says "run this file again".
  • It removes only the files the install owns.
  • It keeps the dashboard history unless the user says yes to a second question.
  • It removes a ~/.bob/plugins/context-guru folder only when that folder is ours.
  • It checks only our recorded port. Another program on 8891–8990 is not a failure.
  • It keeps ~/.bob/playground, because that folder belongs to Bob.

Log: ~/Library/Logs/context-guru-bob-install.log, mode 0600. It holds the step names and results only. It never holds prompts, answers, tokens or file contents.

One-command install (bob-plugin/release/install-bob.sh)

  • It downloads context-guru-bob-SHA256SUMS, then the zip that file names, and checks the zip.
    • A missing sum or a mismatch stops before anything runs.
    • The SHA-256 is the only integrity check, the same as the Claude Code plugin's install.sh.
  • curl gives the file no quarantine mark, so Gatekeeper does not block the unsigned installer.
  • It runs the installer with input from the terminal (/dev/tty), not from the pipe that carries the script.
  • The whole script is one function, called on the last line. A download cut short gives a parse error and runs nothing.
  • It removes its temp folder when done.

Build and release

  • make bob-release:
    • builds both Mac proxies (pure Go, CGO_ENABLED=0) and the status bar .vsix;
    • then runs package.sh, which writes dist/context-guru-bob-<version>.zip (about 25 MB).
  • .github/workflows/release.yaml: after GoReleaser, it builds the zip. On tags only, it runs gh release upload for the zip, context-guru-bob-SHA256SUMS and install-bob.sh. A manual run adds all 3 to the snapshot artifacts.
    • install-bob.sh has a fixed name, so releases/latest/download/install-bob.sh always works.
  • bob-plugin/bobplugin_test.go: TestBobReleasePythonSuite runs the release tests.

Data dependence

None. The installer changes local files only, and it sends nothing.

How it was tested

  • go test ./bob-plugin/: OK.
    • 167 plugin tests and 55 release tests.
    • The 8 one-command tests pipe the script into bash, as curl | bash does. A local HTTP server serves a real zip built by package.sh.
    • They check: install, uninstall with every byte restored, an answer read from the terminal and not from the pipe, a wrong SHA-256, a missing sum file, a half script, and an unknown command.
    • Every test runs in a temp HOME with a fake launchctl, bobide, pgrep and osascript.
    • Tests include: a happy path that restores every byte, a failed undo, a planted extra file, a Ctrl-C during install, another program on our port range, a HOME path with a space, and the playground folder.
  • Linux, as the release runner: in a golang:1.26.4 container, make bob-release built the zip (both Mac binaries are inside). The release tests ran too: 45 macOS tests skip and 2 packager tests pass.
  • make bob-release on macOS: OK.
  • Live, on a real Mac with the real Bob IDE (2026-11-08):
    • install → all ✓ → a Bob chat through CG → CG ✓ in the status bar → uninstall → all ✓.
    • .bash_profile, .zshrc, .bashrc, .profile and Bob's settings.json matched their SHA-256 from before.
    • That run used the package before the playground step. The playground step is covered by tests only.

Known limits

  • The files are not signed or notarized. The one-command install avoids the macOS prompt. A double-clicked .command file is blocked once, and the user allows it in System Settings → Privacy & Security → Open Anyway. The README says how.
  • CG saves 0% on Bob today. Tool deferral for Bob is the next step.
  • A custom Bob playgroundPath is not read. The README says to create that folder by hand.

Open questions

  • Signing and notarizing is now optional: it only removes the prompt for the double-click path. It needs an Apple Developer ID ($99 a year, or an IBM one).

@vz-ibm vz-ibm left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (claude, user of @vz-ibm) Claude Code 2.1.316 offload-review skill, @vz-ibm's session fresh 1 of 2 1 of 2 34a1c9f26e28 blocking

Verdict: blocking

Findings

  1. bob-plugin/release/install-bob.sh:35-36 — the one-command install leaves its temp folder (about 25 MB zip and its unzipped copy) on every normal run, and the test that should catch this cannot fail
    • What fails: work is local to main, and the EXIT trap reads it. When the installer finishes, main returns and the script ends. The trap then runs outside the function, where work no longer exists. Under set -u the trap fails with work: unbound variable, and rm -rf never runs. This happens on every run that reaches the installer: install, uninstall, "No" at the question, and an installer failure. Only the stop paths (an exit inside main) clean up. The user also sees a work: unbound variable error after a good install.
    • Proof: a test of the same shape, run with /bin/bash 3.2.57 (macOS):
      main() { set -u; local work; work=$(mktemp -d /tmp/pr971/w.XXXXXX); trap 'rm -rf "$work"' EXIT; echo made $work; }
      main
      
      The output was t.sh: line 1: work: unbound variable, and /tmp/pr971/w.rlR9lr was still there. The same shape with the last command returning 3 (as the installer does on a failure) also kept its folder. With exit 1 inside main (the stop path), the folder was removed.
    • Why the test passes: test_the_download_folder_is_removed_after_the_run (test_release.py:942) looks for self.root.glob("tmp/cg-bob-install.*"). But the test sets TMPDIR to self.root (line 230), so the script makes <root>/cg-bob-install.XXXXXX, not <root>/tmp/.... The glob always returns [], so the test passes whether or not the folder is removed.
    • Fix: do not make work local, or expand it when the trap is set (trap "rm -rf '$work'" EXIT, since mktemp gives a safe name), or remove the folder after the installer runs and keep its exit code. Change the test to self.root.glob("cg-bob-install.*"). Add one more check that the folder is removed after a full y install too, and that stderr has no unbound variable.

Non-blocking

  • .github/workflows/release.yaml: the Bob zip is built after GoReleaser has already published the tag's release. If make bob-release fails (for example npm ci), the release is public with no Bob files. install-bob.sh then stops safely on the missing sum file, but releases/latest/download/install-bob.sh is a 404 until someone fixes it by hand. Think about building the zip before the GoReleaser step and uploading after it.
  • GET /expand (proxy.go:3011) checks the owner only against x-context-guru-session or ?session=. A Bob IDE session is now keyed on X-Task-Id, so a manual /expand call for a Bob IDE marker needs ?session=<task id>. The model-driven expand loop does not use this path, so no current flow breaks. It may help to say this in the docs.
  • Install .command, reinstall path: when the user picks r, the old install is removed first. If the new install then fails, rollback says "Your files are as they were before", but the old install is gone. The message could say that the old install was removed too.
  • The status bar reads /api/sessions?agent=bob (session id, saved) and /api/cachestate. These are metadata. The docs/data-dependence.md Bob plugin row names status only. One more sentence about the status bar would make the row complete.

What I checked

  • CLAUDE.md, docs/design.md (session section), the PR body, and the 7 commits in 354fcb32..34a1c9f2.
  • Go: session.Explicit and the host ids, apply.ExplicitSession, every call site of the session header in proxy/ (chat, serve observe-shadow, expand repair, newRecCtx, /compact, /expand), bobUsage and bobResponseUsage, streamRecOn, and the dash alias comment. The X-Task-Id read is limited to bobModelPath. It comes after the header and the body ids. apply.go:505 gets the already-resolved id through o.Session, so the alias rule still holds. I found no defect in the Go code. I read the names and structure of the new Go tests (bobsession_test.go, bobusage_test.go, bobprofile_test.go, dash_test.go), not every assertion line.
  • Shell: install-bob.sh, package.sh, both .command files, reset.sh, in full. Bash 3.2 behavior checked with 3 small local scripts (no Go, no project code run).
  • Python: bob_plugin.py, bob_hooks.py, bob_route.py, in full. test_release.py: setup, BootstrapTest, PackageTest. I did not read every line of test_bob_plugin.py, test_bob_control.py or the rest of test_release.py.
  • TypeScript: client.ts, model.ts, extension.ts, package.json. I did not read the TS tests or package-lock.json line by line. All 296 resolved URLs in the lock point to registry.npmjs.org.
  • Build and release: the Makefile targets, release.yaml, .gitignore for dist/ and *.vsix, and the git file modes (the scripts are 100755).
  • I did not read the 7 SKILL.md files or the two READMEs line by line.
  • No Go build or test was run. Live tests are not approved, and Go is not on this machine.

@vz-ibm vz-ibm left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (claude, user of @vz-ibm) Claude Code 2.1.316 offload-review skill, @vz-ibm's session fresh 2 of 2 1 of 2 34a1c9f26e28 blocking

Verdict: blocking

Findings

  1. bob-plugin/release/install-bob.sh:37 — the EXIT trap never removes the temp folder, and the test that should catch it cannot fail
    • What fails: work is local to main. The trap rm -rf "$work" runs at shell exit, after main has returned, so work is out of scope. With set -u the trap aborts with work: unbound variable. Every run that gets past the download then:
      • leaves $TMPDIR/cg-bob-install.XXXXXX on disk. It holds the full zip (about 25 MB), the unzipped package and both proxy binaries;
      • prints bash: line 66: work: unbound variable to the user's terminal after the installer's own "Done" text.
        This happens for install and for uninstall, on success and on failure. The PR text says "It removes its temp folder when done". That is not true.
    • Proof: I ran the real script with a local file:// release that holds a stub .command, on macOS /bin/bash 3.2.57:
      $ TMPDIR=$R/tmp CG_BOB_RELEASE_URL=file://$R/rel CG_BOB_TTY=$R/tty /bin/bash < bob-plugin/release/install-bob.sh
      Downloading context-guru for IBM Bob…
      ✓ download matches SHA-256
      fake-installer-ran
      /bin/bash: line 66: work: unbound variable
      rc=0
      $ ls $R/tmp
      cg-bob-install.VDXufk
      
      When the stub exits 1, rc=1 still comes through, so only the cleanup is broken.
      The test cannot catch it. test_the_download_folder_is_removed_after_the_run (test_release.py:938-942) globs self.root / "tmp/cg-bob-install.*". But TMPDIR is self.root (test_release.py:230), so the folder is self.root/cg-bob-install.*. There is no tmp/ level, so the glob always returns [] and the test always passes.
    • Fix:
      • Do not make work local. Or run rm -rf "$work" explicitly after the installer returns and keep its exit code. Or expand the path when the trap is set: trap "rm -rf '$work'" EXIT. A path with ' is safe here because mktemp makes the name.
      • In the test, glob self.root.glob("cg-bob-install.*").
      • Also check that stderr has no unbound variable text.

Non-blocking

  • Install context-guru for Bob.command: the installer creates ~/.bob/playground before the "binary has no Bob support" check and before setup. A rollback keeps the folder. That is deliberate, because the folder is Bob's. But the PR says "On any failure … it undoes everything". Say in the README and PR that the playground folder is the one change that stays.
  • proxy/bobusage.go: bobResponseUsage splits the whole SSE body into strings on every Bob response. It runs only on the sniffer window (bounded), so the cost is small. Note only.
  • proxy/proxy.go:3011 (/expand endpoint) still scopes by x-context-guru-session only. A Bob IDE session is now keyed on X-Task-Id. So a manual /expand call from the Bob IDE without the CG header cannot reach its own stash. The model-driven expand loop is not affected. Mention this as a known limit, or pass the same id here.
  • bob-plugin/release/install-bob.sh: the SHA-256 file and the zip come from the same release over the same TLS channel. So the check proves integrity, not origin. The PR says this. It is the same model as the Claude plugin's install.sh. Note only.

What I checked

  • Read CLAUDE.md, the relevant parts of docs/design.md, the PR body and all 7 commits (git log 354fcb32..HEAD).
  • Read the full Go diff:
    • session/session.go: host ids come last in Explicit, ExplicitStrict is unchanged, and the new table test covers this;
    • apply (the rename to ExplicitSession, and that the grace alias still uses "");
    • proxy/proxy.go (explicitSessionOf is used at the pipeline, the expand repair, the observe shadow record and the wire recorder; bobModelPath gates both X-Task-Id and bobUsage);
    • proxy/recctx.go, proxy/dashcapture.go, proxy/bobusage.go.
  • Checked that upstreamFor keeps static.path, so up.path == bobModelPath in serve matches static.path in chat.
  • bobUsage fails open. A missing, non-integer or negative count returns base. So does a 1h write larger than the write, and read+write larger than prompt. Other routes keep the shared parser.
  • Data dependence: the new rows for the session tracker, billed-token records and the Bob plugin are present. All are metadata only.
  • Read in full: bob_plugin.py, bob_route.py, bob_hooks.py, reset.sh, both .command files, install-bob.sh, package.sh, the Makefile targets, release.yaml, the Go test runners, and the status bar src/*.ts.
  • Checked the fail-closed parts of the installer:
    • the package check refuses a link or an unlisted file;
    • the consent default is No;
    • a rollback runs on HUP/INT/TERM after the first change;
    • the uninstaller deletes our files only after result=removed;
    • the plugin_is_ours and ContextGuruManaged checks are in place;
    • the zip name in the SHA-256 file is checked against */* and ...
  • Skimmed the Python and TS test files (test_bob_plugin.py, test_bob_control.py, test_release.py, statusbar tests). I did not read every test line. I looked closely at the BootstrapTest class, where finding 1 is.
  • Did not read bob-plugin/statusbar/package-lock.json line by line (generated, 3,886 lines).
  • No Go build or test was run, because live tests are not approved. The only run was the bash reproduction above, in /tmp.

@vz-ibm
vz-ibm force-pushed the feat/bob-installer branch from 34a1c9f to a36a4fa Compare November 9, 2026 09:25
@vz-ibm

vz-ibm commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator Author

Round 1: replies

Both reviewers found the same bug. It is real, and it was mine. Fixed in 7ba54fef. I also fixed 2 non-blocking notes in a36a4fa9.

R1-1 and R2-1: the temp folder is never removed, and its test cannot fail. Fixed.

  • The cause: the EXIT trap read work, a local of main, after main had returned. Under set -u it failed with work: unbound variable, and the 25 MB download stayed. Only the stop paths cleaned up.
  • The fix: main now removes the folder after the installer returns, keeps the installer's exit code, and clears the trap. The trap stays for stop and Ctrl-C. It now expands the path when it is set (trap "rm -rf '$work'" EXIT). mktemp makes the name, so it holds no quote.
  • The test: I wrote a test that could never fail. It globbed tmp/cg-bob-install.*, but TMPDIR is the test root, with no tmp/ level. I did not check that test red. The new tests:
    • glob cg-bob-install.* at the test root;
    • check that stderr has no unbound variable;
    • cover 3 cases: a No, a full install, and a failed install. The failed install also checks that the exit code comes through.
    • Before the fix, all 3 failed with a leftover folder.

Non-blocking, fixed in a36a4fa9:

  • The release order (R1). You were right: the zip was built after GoReleaser had published. A failed npm ci would leave a public release with no Bob files, and install-bob.sh would then fail.
    • The workflow now builds the zip before GoReleaser, into bob-dist/, which --clean does not empty. A failed build stops the tag before a release exists. The upload still runs after GoReleaser.
    • make bob-release takes BOB_DIST. The default stays dist.
    • /bob-dist/ is in .gitignore, so GoReleaser sees a clean tree. I checked: after the build, git status shows no untracked file.
  • The reinstall message (R1). A failed reinstall said "Your files are as they were before", but the old install was removed first. It now says that the old install was removed, that context-guru is not installed now, and that Bob talks to IBM directly. New test test_a_failed_reinstall_says_the_old_install_is_gone; it failed before the change.

Non-blocking, no change:

  • GET /expand scoped by x-context-guru-session (R1, R2). Correct: a manual /expand call for a Bob IDE marker needs ?session=<task id>. Nothing in the plugin calls /expand. The expand path inside the pipeline uses the Bob session (feat(proxy): Bob chat sessions and cache-write usage, Bob route only #967 has a test for that). I will open an issue for the manual endpoint.
  • The playground folder survives a rollback (R2). This is deliberate: the folder belongs to Bob.
  • The data-dependence row and the status bar (R1). Fixed in feat(bob-plugin): add the IBM Bob plugin and its status bar #968 (2bf2b267).
  • Integrity, not origin (R2). Correct, and the PR says so. It is the same model as the Claude plugin's install.sh.

Checks

  • Release suite: 58 tests OK (python3 -m unittest discover -s bob-plugin/release).
  • make bob-release BOB_DIST=bob-dist: OK, and it leaves no untracked file.
  • go vet ./bob-plugin/: clean.

@vz-ibm vz-ibm left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (claude, user of @vz-ibm) Claude Code 2.1.316 offload-review skill, @vz-ibm's session resumed 1 of 2 2 of 2 a36a4fa9afef approve

Verdict: approve

Findings

None.

Earlier findings

  • R1-1 and R2-1 (the temp folder stays, and its test cannot fail): fixed in 7ba54fef.
    • install-bob.sh:39 now expands the path when it sets the trap. install-bob.sh:63-67 removes the folder after the installer returns, keeps the exit code and clears the trap.
    • I ran the same shape with macOS /bin/bash 3.2.57. With an installer that exits 3, the script exits 3 and the folder is gone. With exit 1 inside main (the stop path), the folder is gone too.
    • The tests now glob self.root.glob("cg-bob-install.*"), which is where TMPDIR=self.root puts the folder. They also check stderr for unbound variable. They cover a No, a full install and a failed install. The failed install also checks the exit code. CONTEXT_GURU_BOB_APP points at the removed bob_app, so the installer stops with bob_missing (exit 1), as the test expects.
  • R1 non-blocking, release order: fixed in a36a4fa9. The zip is now built before GoReleaser, into bob-dist/, which --clean does not empty. The upload still runs after GoReleaser, on tags only. /bob-dist/ is in .gitignore, so GoReleaser's dirty-tree check stays clean. BOB_RELEASE_BUILD now sits under $(BOB_DIST), so nothing is left in dist/ either. The snapshot artifact paths are updated.
  • R1 non-blocking, reinstall message: fixed in a36a4fa9. rollback now says that the old install was removed. REINSTALL is set before rollback can run. A new test covers it.
  • R1 non-blocking, data-dependence row: fixed in 2bf2b267. The row now names doctor and the status bar and the fields they read. All are counts, times and ids.
  • R1 and R2 non-blocking, GET /expand and X-Task-Id: the author does not change it now. I accept the reason. Nothing in the plugin calls /expand, and the pipeline's expand path uses the Bob session. The author will open an issue.
  • R2 non-blocking, playground folder and integrity vs. origin: the author's reasons are right. These are notes only.

Non-blocking

  • 2bf2b267 adds npm ci --ignore-scripts. I checked package-lock.json: no package has hasInstallScript, so the build does not need any install script.

What I checked

  • Last review: round 1, 34a1c9f26e2828b90ee97f6c391fa2a2b057572a, 2026-11-09T09:02:21Z.
  • New commits read: 3. The author rebased the branch. git range-diff shows commits 1-5 and d4b298d8 are unchanged. 4a45bab8 differs from 8f59a772 only by the --ignore-scripts flag in the Makefile.
    • 2bf2b267 fix(bob-plugin): status bar never hangs on a cut-off reply; review fixes
    • 7ba54fef fix(bob): the one-command install removes its temp folder
    • a36a4fa9 fix(release): build the Bob zip before the release is published
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files).
  • New items since my last review:
    • Reviewer 2's round-1 review. Its finding 1 is the same as my finding 1, and it is fixed (see above). I checked its non-blocking notes against the author's replies.
    • The author's "Round 1: replies" comment (09:25:59Z). I checked each reply against the code, as listed under "Earlier findings".
  • The full diff 34a1c9f2..a36a4fa9 (417 lines), and the code around it:
    • install-bob.sh, all of main.
    • The rollback function and the REINSTALL flow in Install context-guru for Bob.command.
    • release.yaml from the test steps to the artifact upload.
    • The bob-statusbar and bob-release targets in the Makefile.
    • .gitignore.
  • client.ts getJson:
    • It settles once.
    • fail reads deadline and request only after both are defined.
    • A non-200 reply, a body that is too large, aborted, and close with an incomplete reply all reject once. end after complete resolves, and the close that follows does nothing.
    • The new cut-off test sends Content-Length: 100 with 5 bytes and then closes the socket. It shows the old hang.
  • model.ts and poll: a missing saved now shows saved —. A real 0 still shows saved 0. The changed tests assert the exact text.
  • docs/data-dependence.md: the new Bob plugin row.
  • No Go build or test was run. Live tests are not approved. The only runs were 2 bash 3.2 scripts in /tmp.

@vz-ibm vz-ibm left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (claude, user of @vz-ibm) Claude Code 2.1.316 offload-review skill, @vz-ibm's session resumed 2 of 2 2 of 2 a36a4fa9afef approve

Verdict: approve

Findings

None.

Status of earlier findings

  • R1-1 and R2-1 (the temp folder is never removed, and its test cannot fail): fixed in 7ba54fef.
    • main now removes $work after the installer returns, keeps the exit code, and clears the trap. The trap is now trap "rm -rf '$work'" EXIT, so it expands the path when it is set. The stop and Ctrl-C paths still clean up.
    • I ran the new script on macOS /bin/bash 3.2.57 against a local file:// release with a stub installer:
      • stub exits 0: rc=0, 0 folders left, no unbound variable;
      • stub exits 3: rc=3, 0 folders left;
      • wrong SHA-256: rc=1, "does not match", 0 folders left.
    • The tests now glob self.root.glob("cg-bob-install.*"), the folder that TMPDIR=self.root makes. They check stderr for unbound variable. They cover a No, a full install, and a failed install with its exit code. These tests can fail.
  • R1 non-blocking, release order: fixed in a36a4fa9.
    • The zip is now built before GoReleaser, into bob-dist/. --clean does not empty that folder, and .gitignore lists /bob-dist/, so GoReleaser sees a clean tree.
    • A failed npm ci or go build now stops the job before a release exists.
    • The upload and the snapshot artifact paths both use bob-dist/.
    • make bob-release keeps dist as the BOB_DIST default.
  • R1 non-blocking, reinstall message: fixed in a36a4fa9.
    • rollback checks REINSTALL. REINSTALL is set at line 110, before the trap and every rollback call.
    • The new test installs once, then reinstalls with a proxy that dies, and checks the new text.
  • R1 non-blocking, data-dependence row: fixed in 2bf2b267. The row now names doctor and the status bar, and the fields they read. All of them are counts, times and ids.
  • R1 and R2 non-blocking, /expand scoped by the CG header only: the author accepts it and will open an issue. I accept this. No plugin path calls the manual /expand endpoint.
  • R2 non-blocking, the playground folder stays after a rollback: the author rejected it, because the folder is Bob's. I accept this reason.
  • R2 non-blocking, the check proves integrity, not origin: the author agrees, and the PR already says so. No change needed.

Non-blocking

  • install-bob.sh:55: trap "rm -rf '$work'" breaks if TMPDIR holds a '. On macOS, TMPDIR is a /var/folders/... path, so this does not happen in practice. Note only.
  • client.ts: fail() now calls request.destroy() on every error path. That is right. On a good reply, end sets settled before close, and response.complete is true, so close does nothing. I found no double settle.

What I checked

  • Last review: round 1, 34a1c9f26e2828b90ee97f6c391fa2a2b057572a, 2026-11-09T09:04:29Z.
  • New commits read: 3 changed since my last review. The branch was rebased, so 34a1c9f2 is not an ancestor of HEAD. I read git diff 34a1c9f2 a36a4fa9: 13 files, 417 lines, in full.
    • 2bf2b267 fix(bob-plugin): status bar never hangs on a cut-off reply; review fixes
    • 7ba54fef fix(bob): the one-command install removes its temp folder
    • a36a4fa9 fix(release): build the Bob zip before the release is published
    • ae7fb838..d4b298d8 were rebased. The tree diff shows no change in them beyond the 3 commits above.
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files).
  • New items since my last review:
    • The author's "Round 1: replies" comment (09:25:59Z). I checked each reply against the code. See "Status of earlier findings".
    • Reviewer 1's round-1 review (09:02:21Z). I first read it in this round. Its finding is the same as mine and is fixed. Its 4 non-blocking notes are handled as listed above.
  • Checked client.ts around the change. The new handlers are aborted, error and close with !response.complete. The new test makes a reply that is cut off mid-body and checks that the call rejects within the deadline.
  • Checked the saved — change: poll leaves saved undefined when there is no number. formatSaved(undefined) returns saved —. The tests are updated to match, and the one test that needs saved 0 now passes saved: 0.
  • Checked --ignore-scripts: only keytar (optional) and @vscode/vsce-sign in package-lock.json have install scripts. The author reports that the build and the .vsix work without them. I did not run npm.
  • Checked the README edits: the stale "No status bar yet" line is gone, and the signal hook note is correct.
  • No Go build or test was run, because live tests are not approved. The only runs were the 3 bash reproductions above, in /tmp.

@vz-ibm
vz-ibm force-pushed the feat/bob-installer branch 2 times, most recently from 98545ba to 3b760c3 Compare November 9, 2026 14:24
@amiddavid

Copy link
Copy Markdown
Collaborator

Summary

What changed

  • The rebase had no conflicts. The file list matches the list before the rebase (10 files).
  • New commit: test_interrupt_during_install_undoes_everything failed on Python 3.13. communicate() flushed a stdin the test had closed. The test now sets run.stdin = None. It passes.
  • No binary files in the diff. No git-lfs pointers.

How it was tested

  • bob-plugin/release/test_release.py: 58 tests, pass (after the fix).
  • test_bob_plugin.py (128 tests) and test_bob_control.py: pass.
  • Box: go vet ./... clean. go test -race ./bob-plugin/... passes (includes TestBobPluginPythonSuite).
  • CI and CodeQL: green.
  • Docs check fails, and main fails the same way. research/compaction-client-vs-server.md (from docs(research): compare client-side and server-side compaction #976) is not in the mkdocs nav. This PR does not touch it.

Release zip

  • make bob-release cannot run in one place: the box has no npm or zip, the laptop has no Go.
  • So I built both Mac binaries on the box, built the status bar on the laptop, and ran package.sh.
  • Zip context-guru-bob-<version>.zip: 35 entries, 41.6 MB.
    • Both .command files, README.md, SHA256SUMS
    • bin/darwin-arm64/ and bin/darwin-amd64/ context-guru-proxy
    • plugin/: plugin.json, README.md, scripts/ (4 files), skills/ (7), statusbar/context-guru-bob.vsix
  • The release workflow itself is not tested yet. It runs at a tag.

@amiddavid

Copy link
Copy Markdown
Collaborator

Summary

How it was tested

vz-ibm and others added 5 commits November 9, 2026 22:09
A Bob user double-clicks one .command file to install context-guru for
IBM Bob, and one to remove it.

- The installer checks the Mac, Bob, python3 and every package file,
  shows the plan, and asks once. It quits Bob but never kills it. It
  checks each step, and on any failure or interrupt undoes everything.
- It creates Bob's missing ~/.bob/playground folder. Bob runs a chat
  with no folder open there but does not create it, so every shell
  command in such a chat failed.
- The uninstaller removes only our files, and only after a full undo.
  It keeps the dashboard history unless the user says yes to a second
  question.
- The package check refuses an unlisted file or a link.

make bob-release builds one zip with both Mac proxies (arm64, amd64),
the plugin and the status bar. The release workflow attaches it and
its SHA-256 to the GitHub release. The zip is never in git.

The .command tests run on macOS only; on Linux they skip, and the
packager test runs.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>
curl -fsSL .../releases/latest/download/install-bob.sh | bash

install-bob.sh downloads the release zip, checks it against the
release SHA-256 and runs the installer in it. A file curl downloads
has no quarantine mark, so macOS does not block the unsigned installer.
"bash -s uninstall" runs the full uninstaller the same way.

- A missing sum or a mismatch stops before anything runs.
- The installer reads the user's answers from the terminal, not from
  the pipe that carries the script.
- The whole script is one function, called on the last line, so a
  download cut short runs nothing.
- It removes its temp folder when done.

The release workflow attaches install-bob.sh, under a fixed name, so
the latest/download URL always works.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>
The EXIT trap read a local of main after main returned, so under set -u
it failed with "work: unbound variable" and left the 25 MB download
behind on every run. main now removes the folder after the installer
returns and keeps its exit code; the trap, for stop and Ctrl-C, expands
the path when it is set.

The old test globbed tmp/cg-bob-install.* under a TMPDIR that has no
tmp/ level, so it could never fail. The new tests glob the right place,
check stderr, and cover a full install and a failed one.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>
The zip was built after GoReleaser had published the tag's release. A
failed build (npm ci, for example) left a public release without the
Bob files, and the one-command install then failed. The workflow now
builds the zip first, into bob-dist/, which GoReleaser's --clean does
not empty. A failed build stops the tag before a release exists.
make bob-release takes BOB_DIST; the default stays dist.

A failed reinstall no longer says "your files are as they were
before": the old install was removed before the new one started.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>
communicate() flushes stdin. The test had closed it already. Set it to None.

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid

Copy link
Copy Markdown
Collaborator

Summary

How it was tested

  • test_release.py: 58 pass. test_bob_plugin.py: 129 pass. test_bob_control.py: 51 pass.
  • CI, CodeQL, DCO: green.
  • TestDashboardAddsNoRequestLatencyWithContentCapture failed once (known load flake). The rerun passed.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.321 offload-review skill, @amiddavid's session fresh 1 of 2 3 of 3 c3774e1c216a approve

Verdict: approve

Findings

None.

Earlier findings

  • R1-1 and R2-1 (the temp folder stays, and its test cannot fail): still fixed. The rebase kept the fix as 7402a221.
    • install-bob.sh:39 expands the path when it sets the trap. install-bob.sh:63-67 removes the folder after the installer returns, keeps the exit code and clears the trap.
    • The tests (test_release.py:952-973) glob cg-bob-install.*, check stderr for unbound variable, and cover a No, a full install and a failed install.
  • R1 non-blocking, release order: still fixed. release.yaml builds the zip before the GoReleaser step, into bob-dist/. /bob-dist/ is in .gitignore. The upload runs after GoReleaser, on tags only. Snapshot artifacts include the zip, the sums and install-bob.sh.
  • R1 non-blocking, reinstall message: still fixed. Install context-guru for Bob.command:186-192 says the old install was removed. REINSTALL is set at line 110, before any rollback call. Test at test_release.py:726.
  • R1 non-blocking, data-dependence row: fixed in #968, as the author said. I checked docs/data-dependence.md:239. The row names status, doctor and the status bar, and the fields they read.
  • R1 and R2 non-blocking, /expand and X-Task-Id: the author opened issue #972, as promised. It is open. No plugin path calls the manual /expand endpoint.
  • R2 non-blocking, playground folder and integrity vs. origin: the author rejected them with reasons I accepted in round 2. Nothing changed.

The new commit

  • c3774e1c (test only, correct). test_release.py:559 sets run.stdin = None after run.stdin.close().
    • Why: Python 3.13's communicate() flushes stdin. The test had closed it, so the flush raised ValueError and failed the test on 3.13.
    • The fix is safe. communicate() reaches the pipe only through the stdin attribute. With None it does not touch it. The file descriptor is already closed, which is what the test wants. Older Pythons behave the same. Nothing after communicate() reads run.stdin.
    • No shipped code changes. The installer script is not touched.

Non-blocking

  • install-bob.sh:39: trap "rm -rf '$work'" breaks if TMPDIR holds a '. Reviewer 2 named this in round 2. macOS TMPDIR is a /var/folders/... path, so it holds no quote. Note only.

What I checked

  • Last review: round 2, a36a4fa9afef6c47f0668eb5002143e91c8fa949, 2026-11-09T09:32:25Z.
  • New commits read: the round-2 head a36a4fa9 is gone from the repo. The author rebased the branch 3 times after round 2 (comments at 16:22, 16:47 and 21:53). I could not run git diff a36a4fa9..HEAD; I re-read the whole PR instead.
    • The branch now holds 5 commits on base 10329879: 6d6dc454 (installer and zip), f2ff9826 (one-command install), 7402a221 (temp folder fix, the rebased 7ba54fef), c5e54056 (release order fix, the rebased a36a4fa9), c3774e1c (the Python 3.13 test fix).
    • The only new content since round 2 is c3774e1c, one line. The author's comments say the two later rebases changed nothing; the commit stats and the full file read agree. 7402a221 and c5e54056 carry the same patches round 2 approved.
  • Read in full: 4 reviews, 4 comments, 0 inline comments (from the three files).
  • New items since my last review:
    • Reviewer 2's round-2 review (09:32:51Z). It approved. I checked its 2 non-blocking notes: the TMPDIR quote note still holds (above); the client.ts note is about code that moved to #968 with the rebase, so it is out of this PR now.
    • The author's 3 rebase comments (16:22:39Z, 16:47:26Z, 21:53:54Z). Each names its new head, the file list and the test runs. The 21:53 comment reports one flaky dash test (TestDashboardAddsNoRequestLatencyWithContentCapture), a known load flake, rerun passed. This PR does not touch that code.
    • Commit c3774e1c. Reviewed above.
  • The full diff 10329879..c3774e1c: 10 files, 1874 insertions. I read every file in full, not only the diff lines:
    • install-bob.sh (70 lines), package.sh (41), both .command files (272 and 242), README.md (125), test_release.py (1068).
    • release.yaml, Makefile, .gitignore, bobplugin_test.go from the diff.
  • Checks I made on the re-read:
    • The commit sizes add up to the diff: 1618 + 207 + 29 + 44 + 1 = 1899 gross, 1874 net after the fix commits' edits. No file outside the 10.
    • The release sums file lists only the zip name, which matches what install-bob.sh:45-52 accepts.
    • BootstrapTest and PackageTest: on Linux the darwin-only Release class skips, and PackageTest skips without zip, so TestBobReleasePythonSuite passes on the eval box even though the box has no zip. This matches the author's test runs.
    • Issue #972 exists and is open. The data-dependence row is in main.
  • No Go build or test was run. Live tests are not approved, and Go is not on this machine.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.321 offload-review skill, @amiddavid's session fresh 2 of 2 3 of 3 c3774e1c216a approve

Verdict: approve

Findings

None.

Status of earlier findings

  • R1-1 / R2-1 (the temp folder is never removed, and its test cannot fail): still fixed. The fix lives in 7402a221 now. Its patch is byte-identical to 7ba54fef, which I verified in round 2 with bash 3.2 runs.
  • R1 non-blocking, release order: still fixed. The fix lives in c5e54056. Patch byte-identical to a36a4fa9.
  • R1 non-blocking, reinstall message: still fixed. Same commit, same patch.
  • R1 non-blocking, data-dependence row: fixed in 2bf2b267. That commit left this PR and merged to main through #968. Out of this PR's scope now.
  • R1/R2 non-blocking, /expand and X-Task-Id: the author will open an issue. Accepted in round 2. No change in this PR.
  • R2 non-blocking, playground folder, and integrity vs. origin: author rejected with reasons I accepted in round 2. No change.

Non-blocking

  • test_release.py:559 sets run.stdin = None by hand. That is the standard way to keep communicate() off a closed pipe, and the comment says why. Note only.

What I checked

  • Last review: round 2, a36a4fa, 2026-11-09T09:32:51Z.
  • New commits read: 1 new commit, plus a rebase check of all 5 commits on the branch.
    • c3774e1c test(bob): fix the interrupt test on Python 3.13 — new, reviewed in full.
    • 6d6dc454, f2ff9826, 7402a221, c5e54056 — rebased copies of 4a45bab8, d4b298d8, 7ba54fef, a36a4fa9. I fetched the old SHAs from GitHub and compared each commit's own patch (git diff <sha>^ <sha>) by hash. All 4 patches are byte-identical to what I reviewed and approved in rounds 1 and 2.
    • The branch base moved to 10329879 (the squash of #968). The proxy and bob-plugin commits left the PR through #967/#968. The PR now touches 10 files, all installer and release files.
    • File check: 9 of the 10 changed files are byte-identical between a36a4fa9 and c3774e1c. The 10th (test_release.py) differs by exactly the 1 new line. So the whole content change since my approval is that line.
  • Read in full: 4 reviews, 3 comments, 0 inline comments (from the three files).
  • New items since my last review:
    • Author comment at 16:22:39Z: rebase onto #968, plus the Python 3.13 test fix. I reviewed that fix (below).
    • Author comment at 16:47:26Z: rebase report. Nothing to check beyond the final state.
    • Author comment at 21:53:54Z: final rebase onto main. Reports all suites pass, CI and CodeQL green, one known dashboard flake that passed on rerun. Nothing asks me to do anything.
  • The new commit, checked:
    • On Python 3.13.5 (this laptop) I ran a 6-line script in /tmp with the test's exact shape: Popen with stdin=PIPE, write "y\n", stdin.close(), then communicate(). It fails with ValueError: I/O operation on closed file. So the test really broke on 3.13.
    • With run.stdin = None added before communicate(), the same shape returns normally and the child received the "y\n". The fix works.
    • The child still sees EOF: stdin.close() happened before the assignment. Nothing after line 559 reads run.stdin. Popen cleanup does not try to close it again.
    • On older Pythons, communicate() with stdin=None and no input never touches stdin. The fix is safe there too. No other test in the file has this pattern (grep: one stdin.close(), one communicate).
    • bobplugin_test.go runs this suite from CI (TestBobReleasePythonSuite), so the fix matters there, not only locally.
  • The base move: I diffed a36a4fa9..c3774e1c outside the PR's 10 files. All differences come from main (#967, #968 and later). None of them touches the installer or release files this PR owns.
  • No Go build or test was run. The only runs were the two Python checks above, in /tmp, with no project code.

amiddavid added a commit that referenced this pull request Nov 10, 2026
…1014)

TestDashboardAddsNoRequestLatencyWithContentCapture failed on loaded
CI runners (on #930, #971, #996, #1010) because one pass of 40 paired
samples was too noisy for the 45 ms budget. It now measures the guard
in up to 3 rounds, and passes as soon as one round is in budget; a
real slowdown fails all 3. Closes #1013.

Behavior change: none. Test only (proxy/dash_test.go).
Data dependence: none.
Known limit (older than this PR): under heavy load, a 50 ms delay in
capture.finish does not fail the test; filed as its own issue.

Reviews: 2 offload reviews (GLM), round 2, both approve at 2fbb429.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants