Files
chia-blockchain/.cursor/rules/context-routing.mdc
T
Almog De PazandGitHub 346fb9a0cf Add Bugbot review context, update context (#21113)
* Add Bugbot consensus review context

Document the validation-state and sub-epoch-summary invariant so automated PR review has the same consensus context as local agents.

* Route Bugbot to repository context docs

Keep Bugbot guidance focused on subsystem context routing so automated reviews use the same module map as local agents.

* Add generated repository context docs

Include the expanded module context map and route Bugbot to the same subsystem docs used by local agents.

* Add EDC agent context pointer

Include the generated EDC agent guidance alongside the Cursor agent context docs.

* Fold EDC guidance into AGENTS

Keep agent context entrypoints consolidated in AGENTS.md and remove the separate EDC pointer.

* Remove generator name from agent guidance

Keep AGENTS.md focused on repository context locations rather than the tooling used to produce them.

* Consolidate context corpus into one source-verified canonical set

- Normalize all subsystem docs to canonical names without chia- prefix,
  removing the split between old and new-dominant corpora.
- Merge new-dominant content into consensus.md, full-node.md, wallet.md;
  split networking.md into server.md, protocols.md, apis.md; add types.md.
- Rename 15 genuinely-new subsystem docs; fold chia-root.md into
  architecture-overview.md.
- Remove filter-branch leakage (filter_challenge, predictable filter,
  protocol 0.0.38) from types.md, protocols.md, harvester.md.
- Correct factual inaccuracies: /push_tx vs wallet queue semantics,
  Err sign/ban policy, protocol import-time coverage, server peer-serving,
  address-manager mutation rule, wallet tx-store rollback, ValidationState
  speculative advancement, block-creation default, MempoolItem fallback.
- Replace unreachable verification SHA with PR-head commit.
- Consolidate test guidance into one small router plus 12 on-demand
  testing/ docs; remove duplicate auto-attached test guides.
- Make INDEX.md the authoritative routing manifest; update BUGBOT.md,
  AGENTS.md, and context-routing.mdc to reference one canonical corpus.
- Replace context-chia-*.mdc rules with canonical narrow rules; remove
  recursive .cursor/** rule and consolidate duplicate tooling rules.
- Tighten clvm-execution.md: remove stale cost_calculator.py reference,
  fix block-creation default, replace opcode catalogue with pointer.

* Trim redundant context and testing docs after value audit

- Trim benchmarks.md: remove per-script Workload Groups narration that is
  obvious from opening each script; keep fidelity, coupling, and fragility
  sections.
- Trim testing/patterns.md: slim to the module-by-module setup map and
  layered-assertion list; remove block/tx/assertion how-to that duplicates
  per-area testing docs.
- Trim testing/full-node.md: slim to starter template and sync-convergence
  tip; remove fixture list and assertion patterns duplicated by patterns.md
  and architecture.md.
- Fold testing/service-wiring.md per-cluster correlation details into
  testing/architecture.md; delete service-wiring.md (high overlap with
  architecture.md).
- Fix protocols.md: correct NewSignagePointHarvester2 message-ID wording
  (ID reassigned to 66, not literally the same ID).
- Update INDEX.md and testing-guide.mdc router to reflect service-wiring.md
  removal.

* Fix verification SHA to reference the main source baseline

The docs were verified against source at PR base 24db9ad390 (origin/main),
not a5647a9327 (the original PR head, which only adds context docs and is
not a meaningful source baseline). The chia/ source tree is identical across
both commits since the PR changes no production code.

* Fix remaining V2 filter-branch leakage in harvester.md and types.md

- harvester.md: replace calculate_effective_plot_filter_bits() and
  calculate_min_plot_strength() (filter-branch-only) with the actual main
  source path: calculate_prefix_bits() with NUMBER_ZERO_BITS_PLOT_FILTER_V2
  and height adjustments, then passes_plot_filter(); strength bounds checked
  by check_plot_param() against MIN_PLOT_STRENGTH/MAX_PLOT_STRENGTH.
- harvester.md: use meta_group (actual PartialProofsData field name) instead
  of "meta group".
- types.md: correct that candidate height feeds prefix-bit reductions for
  both V1 and V2, not just V1; calculate_prefix_bits() branches on V1/V2
  constants and height thresholds.
2026-07-27 07:26:41 -07:00

55 lines
2.8 KiB
Plaintext

# Deep Context — Read Before You Grep
Pre-built deep context exists in `.cursor/context/`. **Before running broad
code searches** (semantic search, grep, glob) to understand how a subsystem
works, read the matching context file first. It will answer most structural
questions instantly.
## Routing table
Match the files or intent to the right context doc:
| If you're touching… | Read first |
|----|---|
| `chia/consensus/**` or block validation / reorg / difficulty | `.cursor/context/consensus.md` |
| `chia/full_node/mempool*.py`, `eligible_coin_spends.py`, fee logic | `.cursor/context/mempool.md` |
| `chia/full_node/full_node.py`, `full_node_api.py`, `full_node_store.py`, sync | `.cursor/context/full-node.md` |
| `chia/server/**`, connections, rate limits | `.cursor/context/server.md` |
| `chia/protocols/**`, wire messages | `.cursor/context/protocols.md` |
| `chia/apis/**`, API stub metadata | `.cursor/context/apis.md` |
| `chia/types/**`, shared types, serialization boundary | `.cursor/context/types.md` |
| `chia/wallet/**` | `.cursor/context/wallet.md` |
| CLVM execution, generators, puzzles, conditions | `.cursor/context/clvm-execution.md` |
| `chia/farmer/**` | `.cursor/context/farmer.md` |
| `chia/harvester/**` | `.cursor/context/harvester.md` |
| `chia/timelord/**` | `.cursor/context/timelord.md` |
| `chia/plotting/**` | `.cursor/context/plotting.md` |
| `chia/plot_sync/**` | `.cursor/context/plot-sync.md` |
| `chia/pools/**` | `.cursor/context/pools.md` |
| `chia/daemon/**` | `.cursor/context/daemon.md` |
| `chia/data_layer/**` | `.cursor/context/data-layer.md` |
| `chia/rpc/**` | `.cursor/context/rpc.md` |
| `chia/ssl/**` | `.cursor/context/ssl.md` |
| `chia/simulator/**` | `.cursor/context/simulator.md` |
| `chia/solver/**` | `.cursor/context/solver.md` |
| `chia/seeder/**` | `.cursor/context/seeder.md` |
| `chia/introducer/**` | `.cursor/context/introducer.md` |
| `chia/cmds/**` | `.cursor/context/cmds.md` |
| `chia/util/**` | `.cursor/context/util.md` |
| `benchmarks/**` | `.cursor/context/benchmarks.md` |
| Root config, build scripts, workflows, tooling | `.cursor/context/repo-tooling.md` |
| Cross-cutting / security review / unsure | `.cursor/context/global-invariants.md` |
| First time / orientation / unfamiliar area | `.cursor/context/architecture-overview.md` |
| Tests (`chia/_tests/**`) | See `.cursor/rules/testing-guide.mdc` |
## Protocol
1. Identify which subsystem(s) the task touches.
2. Read the matching context file(s) via the Read tool.
3. State: `Context loaded: <filename> (area: <area>)`.
4. Only then do targeted code reads for the specific lines you need to change.
The context files contain: file maps, function-level analysis, invariants,
constants, assumptions, and cross-module dependencies. They replace the need
for broad exploratory searches.