- Always refer to files by repo-root relative path. Prefer
@path/to/filenotation when it improves clarity. - This repository does not have a single top-level build or test entrypoint. Run commands in the owning module directory.
@agentis the Rust workspace fordeepflow-agent. Shared Rust crates live in@agent/cratesand@agent/plugins, and eBPF/C sources live in@agent/src/ebpf.- Prefer
@agent/cratesfor new Rust code. @serveris the main Go server module. The main subsystems are@server/controller,@server/ingester,@server/querier, and shared code under@server/libs.@cliis the Go CLI module fordeepflow-ctl.@messagecontains shared protobuf definitions and message packages used by Go components.@docs,@manifests, and@automation_testcontain product docs, deployment assets, and automation test assets.- Go code is split across multiple modules. In addition to
@server,@cli, and@message, there are nestedgo.modfiles under@server/**. Confirm the owning module before changing dependencies or runninggocommands.
- Treat files under
@messageas the source of truth for shared protobuf definitions. Do not hand-edit copied proto files or generated*.pb.gofiles under@server/libs/**/pb,@server/vendor/**, or@cli/vendor/**unless the source definition was updated first. @agent/crates/trace-utils/src/trace_utils.his generated according to instructions in@agent/crates/trace-utils/README.md.@server/Makefilegenerates and refreshes checked-in artifacts, including files under@server/libs/hmap/**,@server/libs/kubernetes/watcher.gen.go, and multiple protobuf outputs. If you change a generator input, regenerate the output instead of editing the generated file by hand.@serverand@clibuild through vendored dependencies plus local patch files. Prefer the relevantmaketargets when protobufs, dependencies, or generated code are involved.- Do not manually edit vendored code under
@server/vendoror@cli/vendor. Recreate it through the provided module Makefile targets.
- Start with
@README.mdfor the repo overview. Use@README-CN.mdor@README-JP.mdwhen language-specific top-level docs are more appropriate. - Use
@agent/build.mdfor agent build prerequisites and environment assumptions. - Component-specific behavior is documented in local READMEs such as
@agent/README.md,@server/README.md,@message/README.md, and files under@docs/**. - Deployment and packaging examples live under
@manifests/**. - If you change an operator-facing workflow, config, or generation path, update the nearest component README or doc page in the same task when appropriate.
- Keep changes scoped to the component you are modifying. Avoid broad cleanup that is unrelated to the task.
- Prefer changing the real input to a generator instead of patching generated outputs.
- When a task crosses protobuf, Go, and Rust boundaries, update the source of truth first, regenerate downstream artifacts second, and validate third.
- Follow the surrounding file's formatting, naming, and macro style.
- In
@agent/src/ebpf, inspect adjacent headers and Makefiles before introducing new build assumptions or generated artifacts.
- Use
gofmton changed Go files. If a generator also runs formatting tools, still verify the checked-in output. @serverand@clideclare Go 1.24 toolchains, while@messagestill declares Go 1.18. Do not silently raise cross-module language assumptions.- When changing Go dependencies, use the owning module's
goormakeworkflow sogo.mod,go.sum, vendor contents, and local patches stay consistent.
- Format code with rustfmt.
@agentuses thestableRust toolchain via@agent/rust-toolchain.- Prefer placing new Rust code in
@agent/crates. - Dependencies in any
Cargo.tomlmust be sorted in alphabet order. usedeclaration order isstd, external crate, thiscrate, andsuper. Declarations should be grouped and sorted in alphabet order.
- Run the narrowest relevant checks for the component you changed.
- For Rust agent changes, run commands from
@agent. Typical checks arecargo fmt, targetedcargo test, orcargo build. - For server changes, run commands from
@server. Prefermake test,make server, ormake querierbecause these targets also prepare vendor and generated prerequisites. - For shared server library changes, run commands from
@server/libs;make testis the standard entrypoint there. - For CLI changes, run commands from
@cli;make cliis the standard build path and refreshes vendored and generated inputs first. - If you modify protobufs, templates, or other shared inputs, rerun the relevant generation or build flow for every affected component, not only the directory you edited.
- Format code before committing.
- If there are any changes to
@server/agent_config/template.yaml, executepython3 @server/agent_config/gendoc.pyin the script's directory, commit@server/agent_config/README.mdand@server/agent_config/README-CH.mdas well. - Use file
@commit-templateas template for commit messages. - The commit template uses conventional prefixes such as
feat,fix,docs,style,refactor,perf,test, andchore.