RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/CLAUDE.md/milvus-io/milvus

CLAUDE.md

CLAUDE.md
CLAUDE.mdroot

Quality

89/100

Scores the file, not the repository.

Length

1,317 words

12 headings · 3 code blocks

Repository

46k

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
milvus-io/milvus/CLAUDE.mdRawGitHub
1# Milvus
2 
3Vector database. Go + C++ (internal/core/) + Rust (tantivy).
4pkg has its own go.mod (module: `github.com/milvus-io/milvus/pkg/v3`). Run `go get` from `pkg/` when adding dependencies there, not from root.
5 
6## Architecture
7 
8Coordinators manage metadata and scheduling; nodes execute work.
9- Coordinators: rootcoord, datacoord, querycoordv2 (note the v2 suffix in directory names)
10- Nodes: proxy (user-facing), querynodev2, datanode, streamingnode
11- All component interfaces defined in `internal/types/types.go`
12 
13## Subsystems & Code Map
14 
15Each subsystem has a **top-level doc** (overview with links to sub-documents) and multiple **sub-documents** (detailed design, invariants, interfaces). The top-level doc alone is NOT sufficient — it is an index, not the content.
16 
17### Mandatory reading procedure
18 
19When your task modifies, explains, depends on, or affects a subsystem below, execute these steps IN ORDER before responding or writing code:
20 
21**Step 1 — Read the top-level doc.** Identify all sub-documents it links to.
22 
23**Step 2 — Read sub-documents.** The scope depends on task type:
24- **Design tasks** (new feature, architecture change, cross-component change): Read **every** sub-document under the subsystem. No exceptions — design requires full-picture understanding. Do NOT judge relevance yourself; read all of them.
25- **Targeted tasks** (bug fix, single-component change, code explanation): Read sub-documents that cover the components your task touches. When uncertain whether a sub-document is relevant, read it.
26 
27**Step 3 — Read source code** listed in each doc's "Key Packages" section. At minimum read the files directly related to your task.
28 
29**Step 4 — Cross-check** documentation against code. If they contradict, STOP and ask the user to resolve before proceeding.
30 
31NEVER answer based on documentation alone or code alone. NEVER skip Step 2 — this is the most common failure mode.
32 
33### Subsystems Reference
34 
35- [**Observability**](docs/agent_guides/observability/README.md): Logging, metrics, tracing, and observability debug workflows.
36- [**Streaming System**](docs/agent_guides/streaming-system/streaming-system.md): Write path, WAL, DDL/DCL execution, replication && CDC.
37 
38## Testing
39 
40Go tests MUST use `-tags dynamic,test` and `-gcflags="all=-N -l"` (disable optimizations/inlining) or they won't compile / mockey-based monkey patching will fail:
41 
42```bash
43go test -tags dynamic,test -gcflags="all=-N -l" -count=1 ./internal/querycoordv2/...
44go test -tags dynamic,test -gcflags="all=-N -l" -count=1 ./internal/proxy/... -run TestXxx
45```
46 
47Per-module shortcuts: `make test-querycoord`, `make test-proxy`, etc.
48 
49## Verification gate (MANDATORY before claiming "done" or pushing for review)
50 
51The reading procedure above tells you how to *enter* the code. This tells you how to *prove a change works*. A change is NOT verified by "it compiles + unit tests pass + success-path e2e is green." When the goal of a change is a **behavior** (retry / classification / routing / error-code propagation / fallback / cache invalidation / concurrency), execute these IN ORDER. Skipping them is the most expensive failure mode — it ships changes that are self-consistent but miss their purpose.
52 
53**G1 — Verify the data, not just your transform.** If your change adds a function/layer that maps or preserves a value X (an error code, a Status, a category, a flag), you only verified *your function*. Now verify its INPUT. Audit **every** place that constructs, throws, or rewrites X across the **whole repo** — not only the lines you edited. grep the escape hatches: `throw`, `.ToString()`/stringify, blanket fallbacks (catch-all → `Invalid` / `IOError` / `UnexpectedError`). A value destroyed or mis-set upstream makes your boundary logic dead code. Audit at the SOURCE of X, never only at the boundary that consumes it.
54 
55**G2 — Trace each real failure mode end-to-end.** Success-path e2e — even thousands of cases — does NOT exercise the failure modes a behavioral change exists for (S3 throttle, corrupt file, OOM, cancel, timeout, not-ready). For EACH one: either trace it by hand from origin → consumer, or fault-inject it, and confirm it lands in the intended bucket. "All green" on the happy path is not evidence the change works; it is only evidence you did not break the happy path.
56 
57**G3 — Do not over-claim.** Commit messages and PR body may assert ONLY benefits verified end-to-end via G1+G2. A benefit that depends on un-audited upstream or an un-triggered failure mode must be written as "follow-up" or "preserves codes for observability; retry wiring unverified" — never as achieved. A reviewer will verify your claim against the running system; over-claiming wastes their round.
58 
59**G4 — Adversarial self-review before human review.** Before pushing, do one pass asking: which failure mode have I NOT traced to its bucket? which upstream construction site of X have I NOT read? what would an adversarial reviewer grep for? Fix the gaps, or list them explicitly in the PR.
60 
61## Run Milvus Locally
62 
63```bash
64scripts/start_standalone.sh # start standalone mode
65scripts/start_cluster.sh # start cluster mode
66scripts/stop_graceful.sh # stop
67scripts/standalone_embed.sh # embedded standalone (no external deps)
68```
69 
70## Code Conventions
71 
72- Error handling: use `merr` package, not fmt.Errorf — see mandatory procedure below
73- Logging: use `github.com/milvus-io/milvus/pkg/v3/mlog` only; do not use `pkg/log`, standard `"log"`, direct `zap`, or `fmt.Println`. Every log call must pass a real `ctx` by priority: function parameter ctx > struct ctx > `context.TODO()`. Refer to [logging.md](docs/agent_guides/observability/logging.md).
74- Import order: standard → third-party → github.com/milvus-io (enforced by gci)
75- Config params: paramtable (`pkg/v2/util/paramtable`), config in `configs/milvus.yaml`
76 
77### Error handling (mandatory when originating, wrapping, or classifying errors)
78 
79Read [error_handling_guide.md](docs/dev/error_handling_guide.md) (decision tree,
80Input-vs-System) and [error_handling_casebook.md](docs/dev/error_handling_casebook.md)
81(the 7 mistake patterns) BEFORE writing the change. Non-negotiable rules:
82 
831. Blame test: is the **request content itself** what forces this branch? → Input factory. A Milvus bug, or an internal/transient failure (not-ready, TOCTOU race), → System factory — even when a correct Milvus does reach it on a valid request (transient errors are System, and must stay retriable). "Looks like validation" is not the test.
842. Add context to an existing error with `merr.Wrap/Wrapf` ONLY — `WrapErrXxxErr(err, …)` masks the inner code; cause never goes into a format string.
853. Before marking anything InputError: grep `retry.Do` consumers. Before converting an `errors.New` sentinel to merr: grep `errors.Is` guards.
864. Pick codes from the existing family ranges in `pkg/util/merr/errors.go` (scan first; see the partition table in [error_sentinel_convention.md](docs/dev/error_sentinel_convention.md)); never hand-pick 20xx segcore codes.
875. Touched a wire projection, oldCode mapping, or metric label? Run the merr guard tests AND a full `make test-go` — contract changes break packages you didn't touch.
886. **C++ side (segcore / milvus-storage / cgo boundary) — the rules above are Go/merr; the same discipline applies in C++, and the verification gate (G1) is non-negotiable here.** The final class is decided at the `ThrowInfo` / `AssertInfo` / `SegcoreError` / arrow-`Status` / `LOON_*` **construction sites**, NOT at the cgo boundary translator. A boundary helper (`KnowhereStatusToErrorCode` / `ArrowStatusToErrorCode` / `LoonResultToErrorCode`) is correct ONLY if its inputs carry the right category — so audit upstream, not the helper. When a code must survive to the cgo boundary, grep every construction/throw/rewrite site and confirm none collapse it: `FailureCStatus` needs a real `SegcoreError` (an `ExecOperatorException` or `throw std::runtime_error(status.ToString())` destroys the code), and an upstream `IOError`-rewritten-as-`Invalid` (or catch-all → `IOError`) silently inverts transient vs permanent. Apply the blame test (rule 1) at EVERY such site, not only the ones you edit.
89 
90## PR and Commit Conventions
91 
92PR title format: `{type}: {description}`. Valid types: `feat:`, `fix:`, `enhance:`, `test:`, `doc:`, `auto:`, `build(deps):`.
93PR body must be non-empty. Issue/doc linking rules:
94- `fix:` — must link issue (e.g. `issue: #123`)
95- `feat:` — must link issue + design doc under `docs/design-docs`
96- Every Milvus feature should have a related design doc under `docs/design-docs`; submit the doc in this repository and link it from the Milvus feature PR.
97- `enhance:` — must link issue if size L/XL/XXL
98- `doc:`, `test:` — no issue required
99- 2.x branch PRs must link the corresponding master PR (e.g. `pr: #123`)
100 
101DCO check is required. Always use `-s` so the developer's Signed-off-by is appended last:
102 
103```
104git commit -s -m "commit message
105 
106Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"
107```
108 
109`-s` auto-appends `Signed-off-by: <developer>` at the end. The developer MUST be the final sign-off, not the AI.
110 
111## Generated Files — Do Not Hand-Edit
112 
113- Mock files (`internal/mocks/*`, `mock_*.go`): regenerate with `make generate-mockery-{module}`
114- Proto files (`pkg/proto/*.pb.go`): regenerate with `make generated-proto-without-cpp`
115 

Commands it names

  • go test -tags dynamic,test -gcflags="all=-N -l" -count=1 ./internal/querycoordv2/...
  • go test -tags dynamic,test -gcflags="all=-N -l" -count=1 ./internal/proxy/... -run TestXxx
  • git commit -s -m "commit message
  • go get
  • make test-querycoord
  • make test-proxy
  • make test-go
  • make generate-mockery-{module}
  • make generated-proto-without-cpp

Sections

  • Milvus
  • Architecture
  • Subsystems & Code Map
  • Mandatory reading procedure
  • Subsystems Reference
  • Testing
  • Verification gate (MANDATORY before claiming "done" or pushing for review)
  • Run Milvus Locally
  • Code Conventions
  • Error handling (mandatory when originating, wrapping, or classifying errors)
  • PR and Commit Conventions
  • Generated Files — Do Not Hand-Edit

What it covers

testcode-styletesting-strategygit-prdo-not

Stack — with the evidence

go

(1.00)

ai-agent

(0.90)

docker

(0.60)

github-actions

(0.60)

Format

CLAUDE.md

Claude Code's memory file. Shaped like AGENTS.md but with two things it lacks: @path imports, so shared rules live in one place, and a user-scope layer that follows the developer across repos rather than shipping with the code.

What the corpus says about it

Repository

Owner
milvus-io
Language
—
License
—
Archived
no

All configs in this repo

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
stacklok/toolhiveCLAUDE.md · 2.0kCLAUDE.mdgogithub-actionsbuildteststylearch+4100/1003 days ago
Adit-Jain-srm/NightmareNetCLAUDE.md · 45CLAUDE.mdtypescriptpython+18buildtestlint-formatstyle+6100/1003 days ago
bagisto/bagistoCLAUDE.md · 28kCLAUDE.mdphplaravel+8setupbuildteststyle+5100/1003 days ago
nullclaw/nullclawCLAUDE.md · 8.0kCLAUDE.mdzigdocker+1buildteststylearch+597/1003 days ago
jeecgboot/JeecgBootjeecgboot-vue3/CLAUDE.md · 47kCLAUDE.mdtypescriptvite+9setupbuildtestlint-format+1097/1003 days ago
ruvnet/rufloruflo/src/ruvocal/CLAUDE.md · 67kCLAUDE.mdtypescriptnode+15setupbuildtestlint-format+697/1003 days ago
lepinkainen/network-monitorCLAUDE.md · 0CLAUDE.mdgodocker+1buildtestlint-formatstyle+1197/1003 days ago
ente/enteweb/CLAUDE.md · 28kCLAUDE.mdtypescriptnode+13setupbuildlint-formatarch+497/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack