Skip to content

Make capture default to inbox source#1387

Open
Mikemansour wants to merge 2 commits into
garrytan:masterfrom
Mikemansour:codex/fix-capture-inbox-routing
Open

Make capture default to inbox source#1387
Mikemansour wants to merge 2 commits into
garrytan:masterfrom
Mikemansour:codex/fix-capture-inbox-routing

Conversation

@Mikemansour
Copy link
Copy Markdown

Objective

Make gbrain capture "thought" safe as a human inbox command when run from inside repos that have .gbrain-source, while preserving explicit source routing for operators.

Changes

  • Plain capture now writes to the default inbox source unless --source or GBRAIN_SOURCE is set.
  • --source <id> still routes capture to the explicit source.
  • GBRAIN_SOURCE=<id> still routes capture to the operator-selected source.
  • Capture help now documents the inbox-first policy.
  • Existing local branch also includes the CLI hang fix for pending last_retrieved_at writebacks.

Verification

  • bun test test/commands/capture.test.ts test/source-resolver-with-tier.test.ts: 35 pass, 0 fail
  • git diff --check

Context

This came from Axiom issue #9: plain capture from /Users/mike/axiom inherited .gbrain-source and wrote to the Axiom source mirror instead of the general inbox. For human-facing quick capture, cwd source inheritance is surprising; repo/source writes should be explicit.

Why:
- Plain gbrain capture should be safe for human thoughts even when run inside a repo with .gbrain-source.
- Repo/source writes should require explicit source intent.

Changes:
- Plain capture now writes to default unless --source or GBRAIN_SOURCE is set.
- Capture help documents the inbox-first source policy.
- Regression tests cover dotfile ignore, explicit --source, and GBRAIN_SOURCE.

Verification:
- bun test test/commands/capture.test.ts test/source-resolver-with-tier.test.ts
- git diff --check

Trace:
- Axiom issue: Mikemansour/axiom#9
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