CodeNib / test
CLAUDE.md86 starsChanged 4 months agoApache-2.0View on GitHub
Mirrors the codenib/ package layout. Loads on top of the project-wide .claude/CLAUDE.md. A new test defaults to the unit tier — only add a marker if it actually needs the heavier deps, and pick the right tier: anything that mutates a shared repo must be integration_serial, never plain integration — the integration job runs parallel under pytest-xdist and a mutating test breaks it. The CI jobs key off exactly these markers (unit, integration, integration-serial, graph-consumer, slow; scip-core runs the C++…
In this repository2 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
The file
Files
test/ — rules
Mirrors the codenib/ package layout. Loads on top of the project-wide
.claude/CLAUDE.md.
Marker tiers
| Marker | Scope | Duration |
| (none) | Unit — pure logic, mocks only | ~1 min |
integration | External repos, read-only / parallel-safe: chunkers, fixture-based SCIP | ~2 min |
integration_serial | Mutates shared repos (SCIP indexing, process_instance, git checkout/apply) — must run sequentially | ~25 min |
integration_serial_consumer | Consumes the graph.pkl written by integration_serial (runs in a separate downstream job) | ~5 min |
slow | LLM API calls, GPU embeddings | ~15 min |
make test # unit only; safe local default
pytest -m "not slow and not integration and not integration_serial and not integration_serial_consumer" -x # unit only
pytest -m "integration and not slow" # parallel-safe integration
pytest -m integration_serial # serial (repo-mutating)
pytest -m integration_serial_consumer # graph.pkl consumers
make test-slow # slow only; may make billed callsA new test defaults to the unit tier — only add a marker if it actually needs
the heavier deps, and pick the right tier: anything that mutates a shared
repo must be integration_serial, never plain integration — the
integration job runs parallel under pytest-xdist and a mutating test breaks
it. The CI jobs key off exactly these markers (unit, integration,
integration-serial, graph-consumer, slow; scip-core runs the C++
executables and SCIP/Fact/clangd Python gates through make core-test) — see
docs/ci_cd.md for the job chain.
Fixtures & caches
- Repo fixtures cache clones under
${CODENIB_TEMP_DIR}/gt-test/. - HuggingFace dataset cache lives at
~/.codenib/. - Git fixtures that copy or swap
.gitmust disable automatic maintenance before committing, so transient maintenance files cannot race the snapshot. - CodeNib's managed loggers do not propagate to the root logger. Attach
caplog.handlerto the actual logger and usecaplog.set_levelfor the expected severity when asserting its records. Console setup can change capture-handler thresholds; attaching the handler alone still depends on another test's logging setup.
Gotchas
- Package shadowing: a
test/<name>/__init__.pywhose<name>matches a top-level package (e.g.scripts/) shadows that real package under pytest's rootdir import mode. Two independently-green PRs can break once merged — when a test dir mirrors a top-level package name, revalidate the merged tree, not just per-PR CI. - The
slowjob needs LLM API keys + a GPU; a redslowrun is usually pre-existing infra flake, not a regression in your change — don't block merges on it without checking it failed for the same reason before your PR.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

