# Context Loading

> Load the maximum *relevant* context with the minimum noise. Do **not** read the whole repository by default.

_Governance layer. Verified 2026-07-23. See [`task-classification.md`](task-classification.md)._

---

## Principles
1. **Start from the KB, not the codebase.** Read [`../README.md`](../README.md), classify the task, load that class's docs.
2. **Read code narrowly.** Each KB doc names its authoritative source files; open only those for the area you are changing.
3. **Respect `Unknown - requires confirmation`.** If the needed fact is marked unknown, confirm — do not scan the repo hoping to infer it.
4. **Expand only on evidence.** Add a doc/file only when the task actually reaches it.

## Example bundles

**Investor notification change**
- [`../02-business/investors.md`](../02-business/investors.md)
- [`../02-business/notifications.md`](../02-business/notifications.md)
- related integration: [`../04-integrations/external-services.md`](../04-integrations/external-services.md) (SendPulse/SMS)

**AI agent task**
- [`../01-architecture/ai-architecture.md`](../01-architecture/ai-architecture.md)
- [`../03-ai-agents/agents.md`](../03-ai-agents/agents.md)
- [`../03-ai-agents/tools.md`](../03-ai-agents/tools.md)
- [`../03-ai-agents/actions.md`](../03-ai-agents/actions.md)
- [`../03-ai-agents/permissions.md`](../03-ai-agents/permissions.md)
- [`agent-rules.md`](agent-rules.md)

**Database migration**
- [`../05-development/database-rules.md`](../05-development/database-rules.md)
- [`../06-history/migrations.md`](../06-history/migrations.md)
- the affected domain in [`../02-business/`](../02-business/)

**Meeting / booking change**
- [`../02-business/meetings.md`](../02-business/meetings.md)
- [`../04-integrations/microsoft-graph.md`](../04-integrations/microsoft-graph.md)

**Monday sync change**
- [`../04-integrations/monday.md`](../04-integrations/monday.md)
- [`../01-architecture/data-flow.md`](../01-architecture/data-flow.md)
- affected domain ([`../02-business/investors.md`](../02-business/investors.md) / [`startups.md`](../02-business/startups.md))

## Cross-cutting entities (Notes, Files, Tags, Labels)
These attach to multiple domains and are usually written from several paths. When a task touches one:
- Load the **affected domain doc(s)** ([`../02-business/investors.md`](../02-business/investors.md) / [`startups.md`](../02-business/startups.md)) — where Notes/Files/Tags/Labels are described.
- If the entity has **MCP/API write paths** (most do — notes, tags, files), also load:
  - [`../05-development/api-rules.md`](../05-development/api-rules.md)
  - [`../03-ai-agents/tools.md`](../03-ai-agents/tools.md)
- Then inspect **every** write path in code (dashboard / API / MCP / jobs / imports) before changing a rule — see the shared-invariant rule in [`change-management.md`](change-management.md).

> **General rule:** whenever the field you are changing also has an MCP tool or API endpoint, load `api-rules.md` + `tools.md` in addition to the domain doc.

## Anti-patterns
- Reading all of `app/` or all migrations "to be safe" — start from the named source files instead.
- Loading every `03-ai-agents/*` file for a pure business bug fix.
- Trusting a KB summary over the code when about to change behavior (read the code).
