Skip to content

Big cleanup: CI, README refresh, protocol ratification, revert dead grant (directive-75) - #9

Merged
Mayakovsky merged 5 commits into
mainfrom
bion/directive-75-big-cleanup
Aug 17, 2026
Merged

Big cleanup: CI, README refresh, protocol ratification, revert dead grant (directive-75)#9
Mayakovsky merged 5 commits into
mainfrom
bion/directive-75-big-cleanup

Conversation

@Mayakovsky

Copy link
Copy Markdown
Owner

Summary

  • CI: minimal GitHub Actions workflow (.github/workflows/ci.yml) — pnpm install/typecheck/test on push to main and PRs targeting it. Provisions an ephemeral postgres:16 service container with the roles the tracked migrations assume exist.
  • README: rewritten to describe the system as it exists today (mailbox + Comms Protocol v1, escalate intent, bion mail CLI, bion-desktop-mail MCP 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-dead bion_desktop_ro INSERT grant on message_consumptions, superseded by D-73's real connector design (reuses bion_rw). Applied live, verified via has_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 passing
  • tsc --noEmit clean
  • Migration 0009 applied live against the real local DB, bion_desktop_ro confirmed SELECT-only everywhere again
  • This PR's own CI run is the first real one — first-run proof, watch it go green

Full detail: _internal/BION-DIRECTIVE-75-STATUS.md.

Mayakovsky and others added 5 commits August 16, 2026 22:21
… 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>
@Mayakovsky
Mayakovsky merged commit d1a6e20 into main Aug 17, 2026
1 check passed
@Mayakovsky
Mayakovsky deleted the bion/directive-75-big-cleanup branch August 17, 2026 02:31
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