Skip to content

Strengthen Company Brain V0 implementation plan - #19

Open
jackye426 wants to merge 13 commits into
mainfrom
cursor/cloud-agent-1787754973206-6kene
Open

Strengthen Company Brain V0 implementation plan#19
jackye426 wants to merge 13 commits into
mainfrom
cursor/cloud-agent-1787754973206-6kene

Conversation

@jackye426

@jackye426 jackye426 commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • isolated Company Brain service for Jack and Eric, with persistent Supabase support
  • complete GitHub delivery → observation → proposal/revision in one ordered transaction
  • transactional founder approval with consistent lock ordering
  • signed/minimized GitHub events, per-PR work state, correct ingest attribution
  • fail-closed COMPANY_BRAIN_* config, production persistence requirement, strong unique secrets
  • read-only Data API RLS roles; all mutations stay behind authenticated server/RPC boundaries
  • MCP idempotency, evidence requirements/lineage, and protocol errors
  • HTTP body limits and terminal webhook acknowledgements
  • migration upgrade path that seeds actors and queues legacy partial deliveries for replay

How to verify

pnpm test:company-brain
pnpm --filter @cortex/company-brain build
pnpm --filter @cortex/company-brain-server typecheck

Fresh and legacy-upgrade migrations execute in in-memory Postgres tests, including RLS, atomic ingestion, replay recovery, and verdict behavior.

Not in this slice: Granola, Codex collector, Gmail, Notion, live GitHub App install, or provisioning the dedicated Supabase project.

Open in Web Open in Cursor 

jackye426 and others added 5 commits August 23, 2026 14:02
Dream-phase work (lint, backlinks, extract, synthesize, patterns, embed,
orphans) was never scheduled — it only ran when someone invoked `gbrain
dream` by hand. gbrain ships an autopilot daemon for exactly this, but
`autopilot --install` only targets launchd/systemd/cron, so on Windows pm2
has to be the supervisor.

Autopilot's cycle already covers sync and embed, so keeping those in the
3-minute loop only contended for the same locks. The loop is reduced to the
one step autopilot cannot do: committing collector output, since gbrain
indexes commits rather than the working tree.

Moves the loop out of the gitignored .cortex/ so the ecosystem entry points
at a tracked file, and retires gbrain-embed-drain.mjs now that embedding is
the daemon's job.

Co-authored-by: Cursor <cursoragent@cursor.com>
The README still described Railway vault + twin-pipeline as the daily path,
so agents (and Jack) could not tell what was actually running. Rewrite it
as the live collect → commit → autopilot contract, including manual
backfill/compilers and local MCP wiring.

Also persist the Windows autopilot launcher (--inline, windowsHide) so
detached gbrain.exe children stop opening a terminal per job.

Co-authored-by: Cursor <cursoragent@cursor.com>
Call mingw git.exe from the commit loop, and give autopilot a hidden console so Bun-spawned git inherits it instead of popping a window.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: jackye426 <jackye426@users.noreply.github.com>
@supabase

supabase Bot commented Aug 26, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project lxcrdadydyboklgnyjba because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

Co-authored-by: jackye426 <jackye426@users.noreply.github.com>
@jackye426
jackye426 marked this pull request as ready for review August 26, 2026 14:39
cursoragent and others added 7 commits August 26, 2026 14:41
Co-authored-by: jackye426 <jackye426@users.noreply.github.com>
Isolated Forma company-state service with fail-closed COMPANY_BRAIN_* config, founder approval, and a signed GitHub webhook path. Personal Cortex credentials and records are refused.

Co-authored-by: jackye426 <jackye426@users.noreply.github.com>
Co-authored-by: jackye426 <jackye426@users.noreply.github.com>
Co-authored-by: jackye426 <jackye426@users.noreply.github.com>
Reuse the existing Cortex EU project with cb_* tables; add migration and
GitHub App manifest scripts; document the live provisioning runbook.

Co-authored-by: jackye426 <jackye426@users.noreply.github.com>
Reads existing Cortex Supabase credentials and generates bearer tokens
for local Company Brain provisioning.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add railpack/railway config, PORT binding for Railway, and env sync script.
Live at cortexcompany-brain-production.up.railway.app.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

2 participants