Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .code-review-graphignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# BEGIN AI-HUB CRG GLOBAL POLICY
build/**
.worktrees/**
worktrees/**
.agents/worktrees/**
.code-review-graph/wiki/**
*.db
*.db-shm
*.db-wal
*.sqlite
*.sqlite3
*.min.js
*.min.css
coverage/**
.coverage/**
.pytest_cache/**
.ruff_cache/**
.mypy_cache/**
.tox/**
.cache/**
tmp/**
temp/**
.claude/worktrees/**
.codex/worktrees/**
.gemini/worktrees/**
.kimi-code/worktrees/**
.cursor/worktrees/**
.config/worktrees/**
.vscode/worktrees/**
.aider/worktrees/**
# END AI-HUB CRG GLOBAL POLICY
28 changes: 28 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by `flext_infra codegen conform`.
# === SECTION: header (managed) ===
# Source: template (base/.mise.toml.j2)
# Free: no
# End SECTION: header
# NOTE: mise carries the Python runtime and native tools from the config SSOT.
# Python dependencies and uv are resolved by the caller-provided environment.

# === SECTION: tools (managed) ===
# Source: config:python_version, config:codegen.scaffold.project.dev native toolchain floors
# (kubectl_version, helm_version, kind_version, taplo_version, ast_grep_version,
# gitleaks_version, tokei_version, beads.selector, beads.version)
[tools]
python = "3.13"
# Native toolchain (single source: Infra.codegen.toolchain in codegen.yaml).
kubectl = "1.32.0"
helm = "3.19.4"
kind = "0.31.0"
taplo = "0.10.0"
ast-grep = "0.45.0"
gitleaks = "8.30.1"
tokei = "14.0.0"
# mise resolves go: backend selectors through a dependency graph, so the Go
# runtime must be a declared tool; without it mise looks for go on PATH and
# every runner without an ambient toolchain fails to install beads.
go = "1.26.5"
"go:github.com/steveyegge/beads/cmd/bd" = "423afdcb2813e36b2bc4c96b07e0fc3516a34495"
# End SECTION: tools
142 changes: 8 additions & 134 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,138 +1,11 @@
> Universal rules: `~/.agents/AGENTS.md` loads first. This file is the
> project-canonical overlay for `/home/marlonsc/mcb`.

# AGENTS.md - MCB Project Rules

<!-- BEGIN UNIVERSAL AGENT LAW (portable; regenerable; do not edit inside) -->
## Universal Agent Law (portable core)

**This block is the inviolable, agent-agnostic core of engineering conduct for this repository.** It is
self-contained: it binds any AI agent — Claude, Codex, Gemini, Cursor, Cline, GitHub Copilot, or any other —
and any user, with or without access to the author's personal configuration. The live user's explicit
instructions override this block; nothing else does. These rules apply to every project type and every
session, and may not be relaxed, reinterpreted, or scoped-out for convenience, speed, or perceived triviality.

### 1. Zero-Tolerance / Strict-Total
- **Always** fix the root cause — generically, cleanly, via reuse of existing canonical code — and validate it
in the same turn with the actual command, its exit code, and the relevant output line.
- **Always** remove superseded code in the same cycle the replacement lands. No dead code "for later".
- **Always** fail loud when the single source of truth (identity, config, contract, version) is absent — never
substitute a guess, a local copy, or an alternative path.
- **Never** use a fallback, compatibility wrapper, legacy branch, allowlist/carve-out, skip, suppression,
hardcode, stub, fake, `TODO`/`FIXME`, or a side-script to make a gate pass.
- **Never** classify a failure surfaced by the current task as "pre-existing", "cosmetic", "unrelated", or
"acceptable legacy". If it appears in your flow, you own it.

### 2. Fix-Forward-Only
Multiple agents may share one working tree. Reverting to a past state silently destroys another agent's
in-flight work. **Accept the current state and fix forward.** Discarding changes via `git checkout -- <path>`,
`git restore`, `git reset --hard`, `git reset <path>`, `git stash` (hiding others' work), `git clean`, or
`git revert` of another's commit is **forbidden**. If you think you must revert → **STOP and ask the user**;
never unilaterally revert shared work.

### 3. Root Cause Only — No Workarounds
No TODOs, stubs, fakes, fallbacks, compat wrappers, or "temporary" workarounds. No suppression directives
(`# type: ignore`, blanket `# noqa`, `@ts-ignore`, `eslint-disable`, etc.) and no escape-hatch typing
(`Any`, bare `object`, unchecked casts) unless carrying a one-line documented justification. A bypass that
hides a symptom is a defect even when the gate turns green.

### 4. Stay In Scope
Do exactly what the user asked — nothing more. No unrequested refactors, renames, cleanups, "obvious
improvements", or adjacent fixes. Found something unrelated? Mention it in one sentence; do not touch it.

### 5. Evidence Before Done — Report Honesty Is 100% Mandatory
"Done" means the **complete chain validated** with objective evidence (command + exit code + output), not
conclusion-by-sample. **Never** present partial, assumed, speculative, or unverified results as verified.
State explicitly when a step was skipped, when a check failed (paste the output), and when a result is
unverified. If something only worked via a workaround, say so — it is not "done".

### 6. Execute As Planned, Else Stop And Ask
Execute the agreed plan exactly. On anything that cannot be done cleanly — a blocked tool, a missing source of
truth, a real ambiguity, or a step that would require a bad practice — **STOP and ask**, presenting concrete
options. **Every option must be a clean, root-cause solution.** Fallback, hack, hardcode, suppression, skip,
or stub are **forbidden as suggestions** — never offer one, even labelled "quick" or "temporary". Any
mid-execution deviation from the plan requires explicit user confirmation **before** applying.

### 7. Blocked-Operation Protocol
When a tool, command, or edit is blocked (deny rule, security hook, sandbox, missing permission, unavailable
integration): (1) **Stop** — do not retry a variation or seek a bypass; (2) **diagnose in one sentence** what
was blocked and why; (3) **hand the exact command or edit to the user** to run on their side; (4) **wait for
their output** before continuing; (5) **never claim done because a substitute ran** — a successful bypass is
still a violation. Forbidden bypass techniques include `bash -c`/`sh -c` subshell wrapping, `eval`/`exec`,
`env <blocked>`, `xargs <blocked>`, absolute-path swaps to dodge prefix deny rules, pipes/command-chains into a
blocked command, and invoking it via a `subprocess` call.

### 8. Strict, Most-Restrictive Typing
Use the most restrictive type that compiles. No `Any`, no bare `object`, no suppression of type errors. Fix
types at the source; depend on declared contracts, not loosely-typed escape hatches.

### 9. Universal Engineering Principles (always, no exception)
- **SSOT** — one authoritative source per fact; reference it, never duplicate or restate it; fail loud when
absent.
- **SOLID** — SRP / OCP / LSP / ISP / DIP respected. Type-switching where polymorphism applies, fat
interfaces, and god-objects are defects.
- **YAGNI** — no speculative params, dead branches, future-hooks, or single-implementation abstractions.
Build only what the task needs now; delete the rest.
- **DI / DIP** — depend on abstractions (protocols/interfaces); inject collaborators; no hidden globals or
hard-wired construction inside business logic.

### 10. User Manages Git
Do not run `git add`/`commit`/`push`/`tag` unless the user explicitly requests it, and do not suggest
committing. Read-only inspection (`status`/`log`/`diff`) is fine. When a commit is authorized, write it as the
user with no agent/bot attribution — no `Co-Authored-By`, no "Generated with …" trailer, and never override
author/committer identity.

### 11. Multi-Agent Coordination
Agents may share one working tree. Coordinate through a committed task board (e.g.
`<repo>/.agents/coordination/tasks.md`): claim a task with an ownership + lease entry before editing, heartbeat
the lease, set `done`/`blocked` on finish, and recover stale tasks from git history. Commit small and often so
a fresh agent rebuilds state from `git log`. **Never overwrite or discard another agent's work** (see Rule 2);
on a divergent approach, stop and escalate to the user.

### 12. When Unsure — Ask
If a task is unclear, ambiguous, or would expand scope → ask one focused question. If an action is hard to
reverse, affects shared state, or could surprise the user → confirm first. Authorization is scope-specific:
approval for one action once does not authorize it in future contexts.

### 13. Destructive Commands — Archive, Don't Destroy
Prefer non-destructive moves: archive a file as `<file>.bak` instead of deleting it. Do not escalate
privileges (`sudo`/`su`), change ownership/permissions, perform remote operations, or fetch over the network
without explicit user confirmation. Use the agent's structured file/search/edit tools over raw destructive
shell commands.
<!-- END UNIVERSAL AGENT LAW -->

MCB (Memory Context Browser) is a Rust 2024 MCP server for persistent agent
memory, semantic code search, and architecture validation.

## Current Status

- Source version: `0.3.1` from `Cargo.toml`.
- Active branch observed during init: `release/v0.3.1`.
- Rust toolchain: stable, MSRV `1.92`, edition `2024`.
- Workspace: 7 first-party crates; `third-party/` is excluded from the
workspace and should not be edited unless the user explicitly asks.
- Platform state: the v0.3 SeaQL + Loco.rs rebuild is the current baseline.
- Public MCP surface: 24 tool names registered through `linkme` descriptors,
grouped into 9 handler families in `docs/MCP_TOOLS.md`.

When a static document disagrees with `Cargo.toml`, `Makefile`, `make/*.mk`,
`config/*.yaml`, or the code, trust the executable source first and update the
doc as part of the same change.

## Source Of Truth

- Version, MSRV, workspace members, lint policy: `Cargo.toml`.
- Rust toolchain components and targets: `rust-toolchain.toml`.
- Developer commands: `Makefile` plus `makefiles/ui.mk`, `makefiles/dispatch.mk`,
and the canonical monopoly script `scripts/lib/mcb.sh` (exit codes, the
`APPLY=Y` gate, SSOT readers, the banned-pattern guard, the agent bash-guard).
- Runtime configuration: `config/development.yaml`, `config/test.yaml`,
`config/production.yaml`.
- Architecture validation config: `config/mcb-validate.toml` and
`config/mcb-validate-internal.toml`.
- MCP tool contract: `docs/MCP_TOOLS.md` and `crates/mcb-server/src/args/`.
- Architecture rules and ADR context: `docs/architecture/` and `docs/adr/`.
# AGENTS.md — mcb

> **Parent workspace law** lives in [`../AGENTS.md`](../AGENTS.md) — read it first.
> Universal engineering core: `~/.agents/UNIVERSAL_CORE.md`. Composition: global skills + parent/root `AGENTS.md` + this scope delta. Do not re-embed universal law.
>
> **Standalone / independent mode:** when `../AGENTS.md` does not resolve, pin the parent raw `AGENTS.md` URL to the same branch/release as this package (never `main`).

<!-- AIHUB-AGENTS-SCOPE-LOCAL-BEGIN -->
## Commands

The whole dev cycle runs through few canonical `make` verbs backed by the single
Expand Down Expand Up @@ -307,3 +180,4 @@ passed unless that exact gate was run in the current turn.
on static status.
- `docs/architecture/ARCHITECTURE.md`: architecture overview and historical
context.
<!-- AIHUB-AGENTS-SCOPE-LOCAL-END -->
Loading