- Rust 65.6%
- Python 31.4%
- PLpgSQL 1.5%
- Shell 1.1%
- Starlark 0.3%
- Other 0.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .agent | ||
| .agents | ||
| agents | ||
| assets | ||
| bin | ||
| crates | ||
| docs | ||
| integrations/codex | ||
| migrations | ||
| references | ||
| scripts | ||
| skills | ||
| src | ||
| tests | ||
| .dockerignore | ||
| .env.dev.example | ||
| .gitignore | ||
| .gitmodules | ||
| AGENTS.md | ||
| BUILD.bazel | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CHANGELOG.md | ||
| CLAUDE.md | ||
| docker-compose.dev.yml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| install.sh | ||
| LICENSE | ||
| PROJECT_AGENT_CONTEXT.md | ||
| pyproject.toml | ||
| README.md | ||
| SKILL.md | ||
| uv.lock | ||
Tribe
Tribe is the native coordination and memory layer shipped with the patched Codex client. Its Rust service owns durable objectives, roles, agent identity, task graphs, backlog, policy, messages, and scoped memory. PostgreSQL and pgvector hold the authoritative state. The Codex runtime calls this service in process through the Tribe native module; model-facing MCP, prompt instructions, and shell hooks are not the primary execution path.
The source is pinned as the vendor/tribe Git submodule of codex-patched. The native module and the patched Core host are released together. A supported installation uses the patched client and its matching module catalog. An unpatched Codex binary is not a Tribe runtime.
Native contract
Codex Core supplies trusted thread, execution environment, workspace URI, and lifecycle event identities. The module uses them to register or resolve the profile and project scope and to start or resume the root objective on the first user turn or first explicit goal. It records spawn reservation and binding, worker reports and stops, accepted goal changes, and turn context through direct Rust service calls. Paused, completed, or cleared goals suspend new dispatch. The model sees bounded authoritative state and can call typed native tools for explicit task, roster, message, and memory operations.
The direct service entry point is crates/tribe-mcp/src/native.rs. It reuses the semantic business methods and PostgreSQL repositories already used by the RMCP adapter. The RMCP adapter remains a development transport for protocol inspection; it is not part of the normal Codex runtime route. The native module lives in the codex-patched source tree.
Native memory lookup supports scoped PostgreSQL text search. Vector nearest-neighbor lookup uses pgvector when a 1536-dimensional embedding is supplied; the native service does not synthesize an embedding or claim that text lookup used a vector model. Deadline scheduling and cancellation are durable. Due deadlines appear in bounded turn context; delivery to an idle thread requires the host wakeup callback.
Persistence and availability
PostgreSQL is mandatory for authoritative Tribe state. Native work that cannot obtain a confirmed state returns an explicit unavailable or unknown result. Ordinary Codex work can continue when Tribe infrastructure is unavailable; it must not claim a completed Tribe mutation. The local authority ledger and replay code are in crates/tribe-persistence. Remote replay, conflicts, and snapshots retain event evidence and revision checks.
Secrets belong in the runtime's private configuration. Do not put database credentials, session contents, private memory, or native identity tokens into Git or model-visible status.
Source layout
| Path | Purpose |
|---|---|
crates/tribe-mcp/src/native.rs |
Direct typed native service facade |
crates/tribe-mcp/src/native_features.rs |
Pool, deadline, and memory search operations |
crates/tribe-mcp/src/native_tasks.rs, native_agents.rs, native_plan.rs |
Shared live and replay transaction bodies |
crates/tribe-mcp/src/semantic.rs |
Stable semantic request and response types |
crates/tribe-persistence/ |
PostgreSQL repositories, authority ledger, local database support |
migrations/ |
Embedded schema migrations |
.agents/ |
Static role and project guidance |
The release build and runtime checks run through the remote runner documented in the parent codex-patched repository. Do not compile the client or Tribe locally on the operator laptop.