Skip to content

Bob 2.0.2 awareness: trust preflight + approval-wedge fast-abort (2.3.0) - #50

Merged
Joshua-Gilbert merged 6 commits into
mainfrom
feat/bob-2.0.2-support
Aug 8, 2026
Merged

Bob 2.0.2 awareness: trust preflight + approval-wedge fast-abort (2.3.0)#50
Joshua-Gilbert merged 6 commits into
mainfrom
feat/bob-2.0.2-support

Conversation

@Joshua-Gilbert

@Joshua-Gilbert Joshua-Gilbert commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Bob 2.0.2 (staged 2026-08-06, applies on the editor's next restart) leaves every contract the in-process driver relies on intact — startTask, the tasks/messages schema, the status lifecycle, mode resolution, and the settings keys were all verified unchanged against the 2.0.2 bundle — but it changes two things a headless dispatcher must handle:

  1. An untrusted workspace now runs on Bob's pristine defaults. Auto-approve off, command security on, allowed_permissions down to ["read"], and workspace-scoped custom modes hidden — with ~/.bob/settings/settings.json ignored entirely. On 2.0.1 our auto-approve config applied regardless of trust; on 2.0.2 a dispatch into an untrusted folder (a fresh worktree is the likely case) wedges on its first tool prompt or throws "Mode not found" on review/refactor/devsecops.
  2. Un-auto-approved tool requests are now persisted to bob.db (task_pending_approvals) while the task sits frozen on them — previously invisible to a sibling process.

Changes

  • Workspace-trust preflight. Bob2Host gains an optional workspaceTrusted() seam fed live from vscode.workspace.isTrusted; the dispatch fails fast — before the settings.json auto-approve write — when it reports false, naming the folder to trust. Absent/null (an older extension build) reads as unknown and proceeds, preserving pre-2.0.2 behavior.
  • Approval-wedge fast-abort. The completion watch extends the settle rule (extracted as turnSettled) with a probe over the task's task_pending_approvals rows: a persisted approval older than approvalWedgeMs (default 5s — margin so a just-raised request Bob is still resolving can't abort a healthy turn) aborts the dispatch immediately with the tool named, e.g. execute_command (execute), instead of burning the dispatch timeout (default 5 min). Real settle is checked first so a finished turn reports its true outcome past a stale approval row; on a pre-2.0.2 store the table probe memoizes to a no-op.
  • Version 2.3.0 across the package, extension, and plugin manifests, with a CHANGELOG entry.

Compatibility

  • Older extension build + new connector: no isTrusted dep → trust unknown → no preflight (pre-2.0.2 behavior).
  • New extension + older connector: the extra dep is ignored.
  • Bob 2.0.0/2.0.1 stores: no task_pending_approvals table → the probe returns []; behavior identical to 2.2.0.

Release train

The v* tag now ships everything at once: release.yml gained a publish-npm job alongside the VSIX packaging — same trigger, its own tag-vs-package.json drift gate, idempotent when the version is already on the registry, and an explicit failure (with the fix named) when the NPM_TOKEN secret is absent. Manual workflow runs npm publish --dry-run instead of touching the registry.

After merge: tag v2.3.0 on main → the workflow publishes the GitHub release + .vsix + @pounceai/bob-control@2.3.0. One-time setup: add an npm automation token as the NPM_TOKEN repo secret. The LobeHub listing refresh (stale-scan fix) follows the npm publish.

…fast-abort

Bob 2.0.2 runs an untrusted workspace on pristine defaults (auto-approve
off, command security on, workspace custom modes hidden), ignoring
~/.bob/settings/settings.json - so a headless dispatch there wedges on its
first tool prompt or throws "Mode not found". Dispatch now preflights
vscode.workspace.isTrusted (new optional host seam; absent = unknown =
proceed, so older extension builds keep the pre-2.0.2 behavior) and fails
fast naming the folder to trust, before the settings.json auto-approve
write.

2.0.2 also persists un-auto-approved tool requests to bob.db
(task_pending_approvals) while the task sits frozen on them. The completion
watch probes that table: a pending approval older than approvalWedgeMs
(default 5s) aborts the dispatch immediately with the tool named, instead
of burning the dispatch timeout. Real settle is checked first so a finished
turn reports its true outcome past a stale approval row; a pre-2.0.2 store
(no table) is a no-op.

Every other 2.0.x contract the driver relies on (startTask, tasks/messages
schema, lifecycle, mode resolution, settings keys) verified unchanged
against the 2.0.2 bundle.
Review follow-ups (board task #141):

- The wedge predicate required Date.now() - (created_at ?? 0) >= margin, so
  a null created_at (impossible per the DDL's NOT NULL, but Bob owns the
  column) read as infinitely old and instantly aborted a healthy dispatch.
  It now requires a non-null timestamp - schema drift falls back to the
  plain dispatch timeout instead of a false abort. Regression test pins it.
- The isSettled closure narrowed `store` with a non-null assertion; use a
  post-guard alias instead so the invariant stays type-checked.
- quietMs feeds both the awaitTurnSettled option and the closure's
  turnSettled from one local, so the two settle paths can't diverge.
- The pendingApprovals oldest-first test now builds its store over the
  complete 2.0.2 schema rather than probing a table created after the
  store existed.

Declined: narrowing Bob2PendingApproval.created_at to number - row types
stay wide for Bob-owned columns (the Bob2TaskRow convention); the predicate
fix removes the hazard without breaking that.
The npm side of a release was manual (2.1.0/2.2.0 were published by hand),
so the package could lag the tagged extension + GitHub release. The Release
workflow now carries a publish-npm job: same v* trigger, its own
tag-vs-package.json drift gate, idempotent when the version is already on
the registry, and a clear failure when the NPM_TOKEN secret is missing.
Manual (workflow_dispatch) runs npm publish --dry-run instead of touching
the registry.
@Joshua-Gilbert
Joshua-Gilbert merged commit 85727ae into main Aug 8, 2026
3 checks passed
@Joshua-Gilbert
Joshua-Gilbert deleted the feat/bob-2.0.2-support branch August 8, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant