drift-ground-truth-fixture-development
Skill14 starsChanged 7 months agoMITView on GitHub
Drift-specific workflow for creating, extending, and validating ground-truth fixtures for signal precision and recall. Use when adding TP/TN fixtures, confounders, boundary cases, or file_history_overrides in tests/fixtures/ground_truth.py. Keywords: ground truth, fixture, precision recall, TP, TN, confounder, boundary, file_history_overrides, ALL_FIXTURES.
In this repository41 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- llms.txtllms.txt
- brainstormingSkill
- drift-adr-workflowSkill
- drift-agent-prompt-authoringSkill
- drift-commit-pushSkill
- drift-dependency-updateSkill
- drift-docs-gap-fixSkill
- drift-evidence-artifact-authoringSkill
- drift-finding-message-authoringSkill
- drift-mcp-repo-ops-usageSkill
- drift-pr-review-loopSkill
- drift-pr-reviewSkill
- drift-releaseSkill
- drift-risk-audit-artifact-updatesSkill
- drift-security-triageSkill
- drift-session-handover-authoringSkill
- drift-signal-development-full-lifecycleSkill
- fix-failing-actionsSkill
- grill-meSkill
- guard-src-drift-apiSkill
- guard-src-drift-commandsSkill
- guard-src-drift-ingestionSkill
- guard-src-drift-outputSkill
- guard-src-drift-signalsSkill
- guard-src-driftSkill
- improve-codebase-architectureSkill
- prd-to-issuesSkill
- self-improving-agentSkill
- simplify-and-hardenSkill
- skill-creatorSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- tddSkill
- test-driven-developmentSkill
- verification-before-completionSkill
- workspace-automation-orchestratorSkill
- write-a-prdSkill
- writing-plansSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 8 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Use this skill when Drift needs reproducible fixture coverage for signal behavior.
- Distinctive: line 22
Keep fixtures minimal and deterministic: No external dependencies, no hidden runtime assumptions.
- Very specific: line 31
Before adding or changing fixtures, use the gate format from .github/instructions/drift-policy.instructions.md.
- Distinctive: line 35
Use these types deliberately:
- Very specific: line 64
Use kind= explicitly for boundary and confounder fixtures.
- Distinctive: line 68
Write the smallest file tree that expresses the behavior under test.
- Distinctive: line 77
Avoid giant fixtures that mix multiple concerns unless the signal truly depends on that interaction.
- Distinctive: line 83
Use it when a signal needs non-default history behavior, for example:
- Distinctive: line 93
keep the values interpretable by a reviewer
- Very specific: line 97
Add the fixture to ALL_FIXTURES in tests/fixtures/ground_truth.py.
- Very specific: line 99
Use a short, unique, signal-oriented fixture name consistent with existing repository practice, for example pfs_tp, avs_tn, or …
- Very specific: line 101
Do not forget that the derived indexes are built from ALL_FIXTURES:
- Distinctive: line 126
Run the relevant evaluation path after structural validation:
- Distinctive: line 145
If the fixture exists to lock a false-positive or false-negative regression, say that explicitly in the description.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Drift Ground-Truth Fixture Development Skill
Use this skill when Drift needs reproducible fixture coverage for signal behavior.
When To Use
- A new signal needs baseline TP and TN coverage
- A false positive or false negative needs to become a regression fixture
- A threshold or calibration change needs boundary coverage
- A benign lookalike case needs a confounder fixture
- A signal depends on history-like data and needs
file_history_overrides
Core Rules
- Run the Drift Policy Gate first. Fixtures should validate admissible work, not justify inadmissible work.
- Keep fixtures minimal and deterministic. No external dependencies, no hidden runtime assumptions.
- Every fixture needs explicit expectations. Empty fixtures are invalid.
- Prefer source-like realism over size. Small but representative beats large and noisy.
- Use fixture kinds intentionally. TP/TN are the baseline; boundary and confounder cases are for calibration and trust hardening.
- Fixture und Logik zusammen bauen — nicht alle Fixtures zuerst. Eine TP-Fixture schreiben, die passende Signal-Logik implementieren, dann TN. Horizontales Batch-Schreiben produziert Tests gegen imaginiertes Verhalten.
- Nur an echten Systemgrenzen mocken. Externe APIs, Zeit und Dateisystem sind valide Mock-Ziele. Interne Signal-Methoden, AST-Helfer und Scoring-Zwischenwerte nicht — teste ausschließlich den Public-Output von
analyze(). Kurzregel: AST/Scoring = in-process, direkt testbar; Git-History =file_history_overridesals lokaler Stand-in; externe HTTP-Calls = an der Interface-Grenze mocken.
Step 0: Run The Drift Policy Gate
Before adding or changing fixtures, use the gate format from .github/instructions/drift-policy.instructions.md.
Step 1: Choose The Right Fixture Type
Use these types deliberately:
- positive the signal must fire
- negative the signal must not fire
- boundary the case sits near a threshold or decision edge
- confounder the case looks like a real finding but is intentionally benign
For new signal logic, start with at least one TP and one TN fixture. Add boundary or confounder fixtures when the change is calibration-sensitive or specifically aims to reduce false positives or false negatives.
Step 2: Model The Fixture With The Existing Dataclasses
Fixtures live in tests/fixtures/ground_truth.py and are built from these pieces:
GroundTruthFixtureExpectedFindingFixtureKindFileHistoryOverride
The essential fields are:
namedescriptionfilesexpected
Use kind= explicitly for boundary and confounder fixtures.
Step 3: Keep File Layout And Expectations Concrete
Write the smallest file tree that expresses the behavior under test.
Good fixture design means:
- file paths match what the signal actually reasons about
- content is easy to inspect
- the expected file path points to the real detection target
- each
ExpectedFindingsays whether detection should happen
Avoid giant fixtures that mix multiple concerns unless the signal truly depends on that interaction.
Step 4: Use History Overrides Only When The Signal Needs Them
file_history_overrides exists for signals that depend on churn or recency semantics.
Use it when a signal needs non-default history behavior, for example:
- churn-sensitive signals such as temporal volatility
- system misalignment cases using recency
- any test that needs controlled commit-count or frequency assumptions
When using overrides:
- match the override key to a real file in
files - override only the fields you need
- keep the values interpretable by a reviewer
Step 5: Register The Fixture Correctly
Add the fixture to ALL_FIXTURES in tests/fixtures/ground_truth.py.
Use a short, unique, signal-oriented fixture name consistent with existing repository practice, for example pfs_tp, avs_tn, or dia_boundary_tp.
Do not forget that the derived indexes are built from ALL_FIXTURES:
FIXTURES_BY_SIGNALFIXTURES_BY_KIND
The signal and kind indexes are populated from fixture expectations and inferred kinds, so fixture naming and explicit kind= values matter.
Step 6: Validate Structure Before Semantics
The structural benchmark tests catch common fixture mistakes:
pytest tests/test_benchmark_structure.py -vThis protects against problems like:
- duplicate fixture names
- empty expectation lists
- missing TP coverage
- missing TN coverage
- missing boundary or confounder coverage in the overall suite
Step 7: Validate Behavior With Precision/Recall Tests
Run the relevant evaluation path after structural validation:
pytest tests/test_precision_recall.py -vFor a narrower loop, run only the affected fixture or signal-focused subset when available, then rerun the broader precision/recall suite before concluding the work is stable.
Step 8: Capture Common Failure Modes Early
Watch specifically for these mistakes:
- fixture name collisions
- expectations targeting the wrong path
- forgetting to add the fixture to
ALL_FIXTURES - mismatch between
kindand expectations file_history_overrideskeys that do not match real files- confounders that are actually true positives or negatives in disguise
If the fixture exists to lock a false-positive or false-negative regression, say that explicitly in the description.
Review Checklist
- Policy Gate passed for the underlying task
- The chosen fixture type matches the test intent
- The fixture is minimal, deterministic, and readable
- Every fixture has explicit expectations
- TP/TN coverage exists where required
- Boundary/confounder cases are used intentionally, not decoratively
- Any
file_history_overrideskeys match real files in the fixture - The fixture was added to
ALL_FIXTURES - Structural tests and precision/recall checks are named explicitly
References
.github/instructions/drift-policy.instructions.md.github/instructions/drift-quality-workflow.instructions.mdtests/fixtures/ground_truth.pytests/test_benchmark_structure.pytests/test_precision_recall.pyDEVELOPER.mdCONTRIBUTING.md
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.

