Big cleanup: CI, README refresh, protocol ratification, revert dead grant (directive-75) - #9
Merged
Merged
Conversation
… Task 4) D-72's grant on message_consumptions was superseded by D-73's real fix — the bion-desktop-mail stdio MCP connector, which reuses bion_rw instead. An unused write grant on a read-designated role is exactly the drift least-privilege exists to prevent. bion_desktop_ro returns to SELECT-only everywhere. Applied live and verified via information_schema + has_table_privilege() (real ACL evaluation, not SET ROLE/bion_super — per the standing correction from D-72's own incident): can_insert=false, can_select=true. bion_rw/bion_owner grants confirmed untouched. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ective-75 Task 2) Was dated July 27, describing only the original record()/send()/ query_state()/handoff() primitives. Rewrite covers what's actually on main today: the mailbox + Comms Protocol v1 (escalate intent included), the bion mail CLI and the bion-desktop-mail MCP connector, the daemon + dev-wide watchers, Auto Mode, cost tracking, and task management — plus a full src/ layout table. Same design -> setup -> layout structure and tone as before, content only. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
No .github/workflows/ existed at all — every merge to date landed on a locally-reported gate, never independently re-checked. Runs on push to main and PRs targeting main: pnpm install, typecheck, test. This repo's own db:provision/provision-test-db.sh scripts assume a persistent, manually initdb'd local cluster (~/.bion-pg) - not a fit for CI's ephemeral environment. Added a CI-specific provisioning step using a postgres:16 service container: creates the same roles the tracked migrations assume exist (bion_owner/bion_rw, plus bion_desktop_ro since migrations 0008/0009 reference it and its own creation predates the migration-file convention, directive-72), then bion_test + grants, then writes a fresh .env.test — never the real local secrets. No deploy step, no secrets needed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Never caught before because no CI existed until this directive: - test/env.test.ts asserted the checkout lives under a directory literally named "repo" — true only on this dev machine's own folder naming, not a real invariant. directive-11's actual invariant (cwd-independent resolution to repoRoot()/.env.local) is already fully covered by the assertion immediately above it; dropped the environment-fragile one. - Every scripts/*.sh hardcodes a Windows PGBIN default behind an existing BION_PGBIN override — CI just never set it. Set it at the job level instead of touching eight scripts, plus a defensive postgresql-client install if psql isn't already on the runner. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
test/env.test.ts exercises directive-11's real production concern — the Task-Scheduler-launched daemon must load .env.local regardless of cwd — by loading that exact file into an isolated object and checking it exists + its values are truthy. A fresh CI checkout has no .env.local at all (gitignored, only written by local db:provision). Write one in CI too, same shape as .env.test; safe placeholder ntfy URL since the test never touches real process.env with it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
.github/workflows/ci.yml) —pnpm install/typecheck/teston push tomainand PRs targeting it. Provisions an ephemeralpostgres:16service container with the roles the tracked migrations assume exist.escalateintent,bion mailCLI,bion-desktop-mailMCP connector, daemon + watchers, Auto Mode, cost tracking, tasks) — was dated July 27, describing only the original Phase A-C primitives.migrations/0009_revoke_desktop_consumption_grant.sql: reverts D-72's now-deadbion_desktop_roINSERT grant onmessage_consumptions, superseded by D-73's real connector design (reusesbion_rw). Applied live, verified viahas_table_privilege().BION-COMMS-PROTOCOL-v1.md's header ratified — that file lives outside this repo, no diff here.)Test plan
vitest run— 38 files / 162 tests passingtsc --noEmitcleanbion_desktop_roconfirmed SELECT-only everywhere againFull detail:
_internal/BION-DIRECTIVE-75-STATUS.md.