Status: canonical engineering test strategy
Related:
Git Mind needs canonical repository-shaped test fixtures.
The product now aims to infer meaning from:
- file trees
- source files
- Markdown docs
- ADRs
- repo-local issue / PR / commit references
- commit history
- branches and merges over time
That means the test substrate should be repositories with believable state and history, not only loose files or ad hoc temp directories.
-
Tests are the spec.
- Fixture repos exist to make design acceptance criteria executable.
-
Prefer readable construction over opaque archives.
- A contributor should be able to understand why a fixture exists and what shape it has.
-
Prefer reusable repo shapes over one-off setup boilerplate.
- Repeated
mkdtemp + git init + config + write + commitlogic should converge into shared helpers.
- Repeated
-
Preserve realistic Git behavior where it matters.
- Branches, merges, and commit history are part of the product surface.
-
Freeze exact Git object state only when necessary.
- Archived fixture repos are a last resort, not the default pattern.
Git Mind fixture repos should use three layers:
A shared helper should create and mutate temporary Git repos for tests.
Expected responsibilities:
- create temporary repos
- initialize Git
- configure test identity
- write, update, and delete files
- create commits with controlled messages
- create branches and merges
- expose useful handles for paths, refs, and repo root
Base repos define a stable semantic starting point.
Examples:
- minimal docs + code repo
- ADR-driven service repo
- module-heavy repo
- intentionally noisy repo
Base repos answer:
- what repository shape are we testing?
Scenario overlays add state or evolution to a base repo.
Examples:
- add ADR references
- add issue / PR references
- add recent commit history
- add a feature branch and merge
- add ambiguous or low-confidence signals
Overlays answer:
- what happened to this repo?
- what additional evidence or ambiguity do we want to test?
The exact implementation can evolve, but the intended model is:
const repo = await repoFixture()
.base(minimalDocsAndCodeBase())
.overlay(withAdrOverlay())
.overlay(withIssueRefOverlay())
.overlay(withFeatureBranchOverlay())
.build();Or, for smaller cases:
const repo = await createRepoFixture('minimal-service')
.withFile('README.md', '# Echo Service')
.withFile('src/auth.js', 'export function auth() {}')
.commit('feat: add auth module')
.applyOverlay(withAdrOverlay())
.build();The point is not the exact method names. The point is:
- readable setup
- reusable repo shapes
- composable history/state overlays
Tarballs or archived repos are allowed when:
- exact
.gitobject state matters - merge topology must be preserved exactly
- performance or regression fixtures should be frozen
- recreating the scenario programmatically would be too brittle or too expensive
They should not be the default for routine tests.
Default rule:
- builder first
- archive only when exact historical state is the thing under test
The first useful fixture catalog should likely include:
-
minimal-doc-code- a source file, README, one supporting doc, simple commit history
-
adr-linked-service- ADRs that explicitly point at modules or files
-
history-shaped- recent commits and references that support provenance testing
-
branching-evolution- a feature branch and merge for history-sensitive cases
-
noisy-repo- ambiguous references and weak signals for low-confidence behavior
When writing tests against this substrate:
- start from design acceptance criteria
- cover golden paths
- add negative and edge cases
- add fuzz or stress tests when the design risk justifies them
- name fixtures for the repository story they represent
- keep fixture intent obvious from the test body
The existing suite already contains many temporary Git repo setups. We do not need to rewrite all of them at once.
Recommended path:
- build the shared repo fixture helper
- add the first base repos and overlays
- use them for new Hill 1 work first
- gradually migrate older suites when they are touched
Hill 1 is about low-input semantic bootstrap on an unfamiliar repository.
That is a repository-shaped promise.
If our tests only exercise isolated helpers or handwritten one-off temp dirs, we will miss:
- artifact classification drift
- provenance blind spots
- history-sensitive edge cases
- ambiguous signal handling
- the real user experience of "point it at a repo and see what it finds"