@AGENTS.md
The Mac checkout is source-editing only. Do not run any Ragweld runtime,
container, model, database, indexing, evaluation, build, test, browser-
acceptance, or observability workload locally. Specifically, never start
./start.sh, Docker, Compose, Colima, Uvicorn, Vite, PostgreSQL, Neo4j,
Qdrant, LiteLLM, MLflow, Flyte, vLLM, or other Ragweld services on the Mac.
Do not use localhost as a fallback when remote execution is blocked.
Ragweld lives on Proxmox node pve1 (192.168.68.171), with the application
runtime in LXC100 (ragweld, 192.168.68.225, /opt/ragweld). Run all
Ragweld commands, tests, builds, services, indexing, and acceptance work
there. Use pve1 only for host/container administration and LXC100 for the
application runtime.
The user explicitly authorizes agents working in this repository to:
- SSH to pve1 (
192.168.68.171) and LXC100 (192.168.68.225) using the existing SSH configuration and keys. - Make the remote runtime changes required by the requested task.
- Open and operate the live Ragweld web application and related authenticated operator surfaces for browser verification.
- Use existing authenticated browser sessions. If a password, passkey, or OTP must be entered, pause for the user to perform that sensitive step.
Do not claim runtime or UI success from source inspection, unit tests, HTTP status alone, or an unauthenticated page. Verify the live deployment through SSH and the authenticated web interface.
Before doing anything else:
- Read
/Users/davidmontgomery/ragweld/AGENTS.mdfully. - Read this file fully.
- Read the project-local memory index at
/Users/davidmontgomery/.codex/projects/-Users-davidmontgomery-ragweld/MEMORY.md. - Read the current recovery handoff at
/Users/davidmontgomery/ragweld/docs/exec-plans/active/ragweld-recovery-foundation-2026-08-19.md. - Read every additional repo-local reference that handoff marks as mandatory context.
Do not plan, browse, edit, or run the app before that read pass is complete.
Pydantic validates serialized boundaries; internal domain and local UI types stay with their owners, while public frontend wire contracts are generated from registered backend schemas.
Local main is canonical; origin/main is its publication target. Keep one local
branch and one worktree unless the user explicitly requests another. Modernization
work is replacement-only.
- No fallbacks.
- No legacy compatibility shims.
- No transition-period dual paths.
- No keeping broken old subsystems alive "just in case."
- If a slice is replaced in backend code, the UI/docs/tests/instructions for that slice must move with it in the same branch.
- Do not market ragweld as fully DSV-compliant today.
Locked target:
vLLM+LiteLLMFlyteHaystack + Docling + QdrantNeo4jfor graph parityUnslothMLflow + Ragas + PromptfooLangfuseOpenTelemetry + Grafana Alloy + Tempo + Loki + Mimir + Pyroscope + Faroassistant-uiinside the ragweld shell for the future chat rebuild
If older repo notes conflict with this canon, this section and AGENTS.md win.
This project was renamed to ragweld. The codebase and API still use tribrid in many places (config keys, module names, docs titles). This is expected.
- Do not attempt mass-renames of
tribrid->ragweld.
These files define what exists. If something isn't in these files, IT DOES NOT EXIST.
server/models/tribrid_config_model.py— current typed config composition root and registered boundary-model aggregatedata/models.json(~50+ model definitions) — LLM/embedding/reranker models, pricing, context windowsdata/glossary.json(~250 terms) — tooltip definitions
registered Pydantic boundary models
↓ pydantic2ts (uv run scripts/generate_types.py)
web/src/types/generated.ts (AUTO-GENERATED - DO NOT EDIT)
↓ imports
web/src/stores/*.ts (ZUSTAND STORES)
↓ wraps
web/src/hooks/*.ts (REACT HOOKS)
↓ uses
web/src/components/**/*.tsx (REACT COMPONENTS)
- Pydantic First — add field to config model before implementing anything
- No Hand-Written API Types — import from
generated.ts - Local Types Stay Local — internal Python/domain types and frontend view/state types need not become wire contracts
- Explicit Boundary Mapping — typed, tested transformations are allowed at real semantic boundaries
- Typed Tunables — operator/runtime choices belong in config; constants, invariants, and derived values do not
- Field Constraints Govern Boundaries — UI/API must honor public
ge/le/defaultconstraints
- Imports: redis, langchain wrappers (LangGraph IS allowed; Qdrant/Haystack/Docling are allowed on this branch)
- Terms: card/cards -> chunk_summary, golden questions -> eval_dataset, ranker -> reranker
- Smells: duplicated wire DTOs, lossy payload guessing, compatibility fallbacks, and dual-read/write contracts
- Does the feature expose a serialized public boundary? → Define a focused Pydantic schema and register it for generation when the frontend consumes it.
- Does it add a real operator/runtime tunable? → Add it to the closest domain config composed by
TriBridConfig. - Is it internal domain state or a local UI view model? → Keep it local and typed; do not export it merely to satisfy generation.
- Add to the closest domain-owned boundary/config module when serialized or configurable
- Add to
data/glossary.json(tooltip for the feature) - Run
uv run scripts/generate_types.py - Update store if needed
- Update hook if needed
- Update component
server/
├── models/ # Validated boundary schemas and config models
├── api/ # FastAPI routers
├── db/ # Database clients (Postgres, Neo4j)
├── retrieval/ # Search pipeline
├── reranker/ # MLX/LoRA reranker inference + artifacts
├── indexing/ # Chunking, embedding, graph building
├── training/ # Reranker training (LoRA fine-tuning)
└── services/ # Business logic
web/src/
├── types/generated.ts # AUTO-GENERATED from Pydantic - DO NOT EDIT
├── stores/ # Zustand stores
├── hooks/ # React hooks
├── components/ # React components
└── api/ # API client
data/
├── models.json # LLM model definitions
└── glossary.json # Tooltip definitions
Run these only in /opt/ragweld on LXC100 (192.168.68.225), never in the
Mac checkout:
uv run scripts/generate_types.py # Regenerate after registered public boundary/config changes
uv run scripts/validate_types.py # Verify type sync
uv run scripts/check_banned.py # Check banned patternsDo NOT rely on "completion promises" alone. This repo prevents fake completion with a verification-based Stop hook that blocks stopping until checks pass.
- Stop hook:
.claude/hooks/verify-tribrid.sh— blocks stopping if validators/tests fail - Ralph loop: the
ralph-loopplugin keeps re-feeding the same prompt each iteration
- Start Claude Code from repo root:
cd /Users/davidmontgomery/ragweld - Restart Claude Code after changing
.claude/settings.json(hooks snapshot at startup) - Project config must include
enabledPlugins.ralph-loop@claude-plugins-official = trueand the Stop hook
/ralph-loop "Continue implementing TriBridRAG.
At the start of EACH iteration:
1) Read TODO.md and pick the first unchecked [ ] item.
2) Implement it end-to-end.
3) Run verification: check_banned, validate_types, pytest
4) Mark [x] only when truly done.
IMPORTANT: If Stop hook blocks, fix that exact failure." --max-iterations 200 --completion-promise "COMPLETE"- Monitor:
grep '^iteration:' .claude/ralph-loop.local.md - Cancel:
/cancel-ralph
Every change must be tested before completion. See .claude/rules/testing.md for full details.
- Temporary tests →
.tests/(gitignored) - Permanent tests →
tests/ - Zero-mocked tests enforced for new/edited tests
- No Playwright API mocking, no Python mocking, no skip stubs
For every major task or significant debugging session, create a dedicated .md file in auto memory
(~/.claude/projects/<project>/memory/) and link it from MEMORY.md under the appropriate heading.
Each file should capture:
- What was done and why
- Key decisions made
- Gotchas encountered
- Outcome / result
This ensures institutional knowledge accumulates across sessions.
- Is this serialized across a public, persistence, provider, or process boundary? → Use a focused validated boundary schema.
- Is this a frontend wire payload? → Import its generated type; do not duplicate it.
- Is this internal or UI-only state? → A local dataclass, Protocol, TypedDict, interface, or type alias is appropriate.
- Should this value be operator-tunable? → Put it in typed domain config; otherwise keep the invariant in code.
- Can I map between semantic boundaries? → Yes, explicitly and with contract tests. Do not add compatibility fallbacks or competing schemas.
This project is indexed by GitNexus as ragweld (18757 symbols, 39820 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
Index stale? Run
node .gitnexus/run.cjs analyzefrom the project root — it auto-selects an available runner. No.gitnexus/run.cjsyet?npx gitnexus analyze(npm 11 crash →npm i -g gitnexus; #1939).
- MUST run impact analysis before editing any symbol. Before modifying a function, class, or method, run
impact({target: "symbolName", direction: "upstream"})and report the blast radius (direct callers, affected processes, risk level) to the user. - MUST run
detect_changes()before committing to verify your changes only affect expected symbols and execution flows. For regression review, compare against the default branch:detect_changes({scope: "compare", base_ref: "main"}). - MUST warn the user if impact analysis returns HIGH or CRITICAL risk before proceeding with edits.
- When exploring unfamiliar code, use
query({search_query: "concept"})to find execution flows instead of grepping. It returns process-grouped results ranked by relevance. - When you need full context on a specific symbol — callers, callees, which execution flows it participates in — use
context({name: "symbolName"}). - For security review,
explain({target: "fileOrSymbol"})lists taint findings (source→sink flows; needsanalyze --pdg).
- NEVER edit a function, class, or method without first running
impacton it. - NEVER ignore HIGH or CRITICAL risk warnings from impact analysis.
- NEVER rename symbols with find-and-replace — use
renamewhich understands the call graph. - NEVER commit changes without running
detect_changes()to check affected scope.
| Resource | Use for |
|---|---|
gitnexus://repo/ragweld/context |
Codebase overview, check index freshness |
gitnexus://repo/ragweld/clusters |
All functional areas |
gitnexus://repo/ragweld/processes |
All execution flows |
gitnexus://repo/ragweld/process/{name} |
Step-by-step execution trace |
| Task | Read this skill file |
|---|---|
| Understand architecture / "How does X work?" | .claude/skills/gitnexus/gitnexus-exploring/SKILL.md |
| Blast radius / "What breaks if I change X?" | .claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md |
| Trace bugs / "Why is X failing?" | .claude/skills/gitnexus/gitnexus-debugging/SKILL.md |
| Rename / extract / split / refactor | .claude/skills/gitnexus/gitnexus-refactoring/SKILL.md |
| Tools, resources, schema reference | .claude/skills/gitnexus/gitnexus-guide/SKILL.md |
| Index, status, clean, wiki CLI commands | .claude/skills/gitnexus/gitnexus-cli/SKILL.md |