{"id":39461322,"url":"https://github.com/flarebyte/baldrick-rebec","last_synced_at":"2026-02-10T22:09:40.959Z","repository":{"id":319220226,"uuid":"1074495029","full_name":"flarebyte/baldrick-rebec","owner":"flarebyte","description":"Autonomous build automation tool and task runner","archived":false,"fork":false,"pushed_at":"2026-02-10T09:29:15.000Z","size":692,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-10T15:09:43.269Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flarebyte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-11T22:42:23.000Z","updated_at":"2026-02-10T09:29:17.000Z","dependencies_parsed_at":"2025-10-18T13:42:34.339Z","dependency_job_id":null,"html_url":"https://github.com/flarebyte/baldrick-rebec","commit_stats":null,"previous_names":["flarebyte/baldrick-rebec"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flarebyte/baldrick-rebec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flarebyte%2Fbaldrick-rebec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flarebyte%2Fbaldrick-rebec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flarebyte%2Fbaldrick-rebec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flarebyte%2Fbaldrick-rebec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flarebyte","download_url":"https://codeload.github.com/flarebyte/baldrick-rebec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flarebyte%2Fbaldrick-rebec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29319465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T20:44:44.282Z","status":"ssl_error","status_checked_at":"2026-02-10T20:44:43.393Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-18T04:43:27.017Z","updated_at":"2026-02-10T22:09:40.952Z","avatar_url":"https://github.com/flarebyte.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# baldrick-rebec\nAutonomous build automation tool and task runner\n\n![baldrick-rebec hero image](./baldrick-rebec-hero-image.jpg)\n\n## First-Time Setup\n\nUse these steps to configure the CLI and initialize PostgreSQL for the first time.\n\n- Create or update your config\n  - Minimal example using local Postgres:\n    - `rbc config init --overwrite --pg-host 127.0.0.1 --pg-port 5432 --pg-dbname rbc --pg-app-user rbc_app --pg-app-password 'app_password' --pg-admin-user postgres --pg-admin-password 'admin_password'`\n  - Check secrets and verify admin role visibility from the app connection:\n    - `rbc config check --passwords --verify`\n\n- Bootstrap roles, database, privileges, and schema\n  - One-shot scaffold (roles + DB + privileges + base schema + content table + FTS):\n    - `rbc db scaffold --all --yes`\n\n- Confirm database status\n  - `rbc db status`\n\n- Send a test message (reads stdin; logs metadata to stderr)\n  - `echo \"Hello world\" | rbc message send --conversation c1 --attempt a1 --profile default`\n\nIf you need to wipe and start fresh in development:\n- `rbc db reset --force`\nThen run the scaffold step again.\n\nSee DATABASES.md for full workflow and a setup checklist. For ops-focused learning prompts, see LEARNING.md.\n\n## Build\n\n- Source of truth for version: a root `VERSION` file (single line, e.g., `1.2.3`).\n- Build with ZX (injects `cli.Version` and `cli.Date` via `-ldflags`):\n  - `make build`\n  - or `npx zx build-go.mjs`\n- CI override (skip file):\n  - `VERSION=1.2.3 npx zx build-go.mjs`\n\nOutputs are placed in `build/` for common OS/architectures with checksums in `build/checksums.txt`.\n\n## Blackboard CLI\n\n- Sync id ↔ folder: `rbc blackboard sync id:_ folder:notes [--dry-run] [--delete] [--clear-ids] [--force-write] [--include-archived]`\n- Diff id vs folder: `rbc blackboard diff id:_ folder:notes [--detailed] [--include-archived]`\n- Import from folder: `rbc blackboard import notes [--detailed]` (preserves IDs; requires ids not to exist in DB)\n\n## Snapshot Backups\n\nUse the schema-aware snapshot subsystem to capture and restore long‑lived entities into a dedicated Postgres schema (default: `backup`). It stores full JSONB row snapshots plus tracked entity schemas, and supports append/replace restores.\n\n- Create a backup\n  - `rbc snapshot backup --description \"before schema cleanup\" --who your-user --json`\n  - Optional filters:\n    - `--include roles,projects` (overrides defaults) and/or `--exclude stickies`\n    - `--schema backup_alt` for a custom backup schema\n- List backups\n  - `rbc snapshot list --limit 20`\n  - JSON: `rbc snapshot list --json`\n- Show backup summary\n  - `rbc snapshot show \u003cbackup-id\u003e`\n- Restore\n  - Append missing rows: `rbc snapshot restore \u003cbackup-id\u003e --mode append`\n  - Replace table contents: `rbc snapshot restore \u003cbackup-id\u003e --mode replace`\n  - Limit entities: `--entity roles,projects`\n  - Validate without changes: `--dry-run`\n- Delete backup\n  - `rbc snapshot delete \u003cbackup-id\u003e --force`\n\nBy default, permanent-ish entities like `roles`, `workflows`, `tags`, `projects`, `scripts`, `tasks`, `topics`, `workspaces`, `blackboards`, `stickies`, `stickie_relations`, `task_replaces`, `packages`, `task_variants`, and `scripts_content` are included. Ephemeral tables such as `conversations`, `experiments`, `messages`, `messages_content`, `queues`, and `testcases` are excluded unless explicitly included.\n\nSnapshot connections require a dedicated backup role configured in `~/.baldrick-rebec/config.yaml` (no admin fallback):\n\npostgres:\n  host: 127.0.0.1\n  port: 5432\n  dbname: rbc\n  sslmode: disable\n  admin:\n    user: rbc_admin\n    password: pass\n  app:\n    user: rbc_app\n    password: pass\n  backup:\n    user: rbc_backup\n    password: pass\n\nGrant this role permissions to own or write to the backup schema, e.g. (or run `rbc db scaffold --grant-backup --yes`):\n- `CREATE SCHEMA IF NOT EXISTS backup AUTHORIZATION rbc_backup;`\n- `GRANT USAGE ON SCHEMA backup TO rbc_backup;`\n\n## Notes on Postgres admin passwords\n- For initial provisioning (roles/db/privileges/schema), set the Postgres admin password via `--pg-admin-password`.\n- Ensure app credentials are configured for runtime use:\n  - `rbc config init --pg-app-user rbc_app --pg-app-password '\u003capp-pass\u003e'`\n## ZX CLI Helpers (scripts)\n\nThis repo includes helper utilities under `script/cli-helper.mjs` to make end-to-end flows easier to read and maintain. They wrap the `rbc` CLI using Google ZX.\n\nKey exports:\n\n- Core: `runRbc`, `runRbcJSON`, `idFrom`, `logStep`, `assert`\n- Roles/Workflows: `runSetRole({name,title,description?,notes?})`, `runSetWorkflow({name,title,description?,role?,notes?})`\n- Scripts: `createScript(role,title,description,body,{name?,variant?,archived?})`, `scriptListJSON({role,...})`, `scriptFind({name,variant?,archived?,role?})`\n- Tasks: `runSetTask({...})`, `taskSetReplacement({...})`\n- Blackboards: `blackboardSet({...})`\n- Stickies: `stickieSet({...})`, `stickieListJSON({...})`, `stickieFind({...})`, `stickieList`, `stickieListByBlackboard`, `stickieRelSet`, `stickieRelList`, `stickieRelGet`\n- Conversations/Experiments: `conversationSet({title,role?})`, `experimentCreate({conversation})`\n- Queue: `queueAdd({...})`, `queuePeek`, `queueSize`, `queueTake`\n- Lists and counts: `listWithRole(cmd,role,limit)`, `experimentList(limit)`, `dbCountPerRole`, `dbCountJSON`\n- Snapshot: `snapshotBackupJSON({description,who})`, `snapshotList`, `snapshotShow`, `snapshotRestoreDry`, `snapshotDelete`\n  - Verify/Prune: `snapshotVerifyJSON({id,schema?})`, `snapshotPrunePreviewJSON({olderThan?,schema?})`, `snapshotPruneYesJSON({olderThan?,schema?})`\n\nExample:\n\n```js\nimport { runSetRole, runSetWorkflow, createScript, scriptFind } from './cli-helper.mjs';\n\nawait runSetRole({ name: 'rbctest-user', title: 'Test User' });\nawait runSetWorkflow({ name: 'ci-test', title: 'CI Test', role: 'rbctest-user' });\nconst sid = await createScript('rbctest-user', 'Unit: go test', 'Run unit tests', '#!/usr/bin/env bash\\ngo test ./...\\n', { name: 'Unit: go test', variant: ''});\nconst script = await scriptFind({ name: 'Unit: go test', variant: '', role: 'rbctest-user' });\n```\n\nThe test script `script/test-all.mjs` demonstrates broader usage across entities.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflarebyte%2Fbaldrick-rebec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflarebyte%2Fbaldrick-rebec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflarebyte%2Fbaldrick-rebec/lists"}