chore(tests): add evidence-aware commit hook and align validation guidance #242

Open
opened 2026-10-03 08:11:32 +00:00 by gabogg · 0 comments
Owner

Goal

Replace unconditional local full-suite execution with an evidence-aware commit hook backed by #241, and align agent/workflow guidance with ADR 0009. Keep formatting/lint on every hook invocation and independent full-suite remote CI on the exact head revision.

Decision sources

Requirements and acceptance criteria

  1. Resolve relevant scope through #241's validated explicit groups and conservative full-suite fallback. The hook checks for applicable completed passing evidence and runs the selected tests when evidence is absent. A matching manual execution can satisfy the hook.
  2. Match actual contents visible after formatting and pre-commit staging isolation. Partial staging, formatter edits or changed source/test contents invalidate mismatched evidence. HEAD or the initial index hash alone cannot authorize reuse.
  3. Keep lint and formatting on every invocation. Reuse messages link the earlier execution and covered scope; failed, incomplete, missing-tool or unapproved-skip results cannot suppress execution.
  4. Update AGENTS.md and workflow guidance together: scoped local validation is allowed; remote CI independently runs the full suite and failed, pending or missing results cannot authorize merge. A successful result must match the revision merged.
  5. A CI fix after the final review requires a new review examining the fix and why validation missed the failure. If the optimized testing system caused the miss, file a separate system-defect issue; distinguish deliberate omission of local tests. Exact review template/pass numbering remains unspecified.
  6. Verify hook behavior with and without matching evidence, partial staging, post-format edits, changed inputs, approved skips and missing tools, and confirm the head-pinned CI merge gate remains effective.

There is no path-filtered docs-only bypass, smoke-only alternative or unconditional status-quo option in this accepted design. Unknown paths fall back to full local execution until their scope is documented. Keep current executable guidance until this implementation lands.

Dependencies and milestone

Depends on #241's validated runner/evidence interface. This issue belongs to Milestone 3 because the evidence-aware hook and consistent guidance are required to deliver the agent test loop. Follow-ups join only if the milestone cannot complete without them.

## Goal Replace unconditional local full-suite execution with an evidence-aware commit hook backed by #241, and align agent/workflow guidance with ADR 0009. Keep formatting/lint on every hook invocation and independent full-suite remote CI on the exact head revision. ## Decision sources - [ADR 0009](https://git.gaboggamer.online/gabogg/hikcentral/src/branch/docs/test-policy-217/docs/adr/0009-scoped-local-tests-with-independent-ci.md) and [validation policy](https://git.gaboggamer.online/gabogg/hikcentral/src/branch/docs/test-policy-217/docs/architecture/agent-test-validation-policy.md), documentation draft #265. - [Confirmed #217 decisions D1–D16](https://git.gaboggamer.online/gabogg/hikcentral/issues/217#issuecomment-4305) and [D16 confirmation](https://git.gaboggamer.online/gabogg/hikcentral/issues/217#issuecomment-4342). - Research PR #218: [docs/research/217-test-performance-and-agent-workflows.md](https://git.gaboggamer.online/gabogg/hikcentral/src/branch/fix/test-isolation/docs/research/217-test-performance-and-agent-workflows.md) (not yet merged). Withdrawn projections and older briefs are superseded by the measured findings and these decisions. ## Requirements and acceptance criteria 1. Resolve relevant scope through #241's validated explicit groups and conservative full-suite fallback. The hook checks for applicable completed passing evidence and runs the selected tests when evidence is absent. A matching manual execution can satisfy the hook. 2. Match actual contents visible after formatting and pre-commit staging isolation. Partial staging, formatter edits or changed source/test contents invalidate mismatched evidence. HEAD or the initial index hash alone cannot authorize reuse. 3. Keep lint and formatting on every invocation. Reuse messages link the earlier execution and covered scope; failed, incomplete, missing-tool or unapproved-skip results cannot suppress execution. 4. Update AGENTS.md and workflow guidance together: scoped local validation is allowed; remote CI independently runs the full suite and failed, pending or missing results cannot authorize merge. A successful result must match the revision merged. 5. A CI fix after the final review requires a new review examining the fix and why validation missed the failure. If the optimized testing system caused the miss, file a separate system-defect issue; distinguish deliberate omission of local tests. Exact review template/pass numbering remains unspecified. 6. Verify hook behavior with and without matching evidence, partial staging, post-format edits, changed inputs, approved skips and missing tools, and confirm the head-pinned CI merge gate remains effective. There is no path-filtered docs-only bypass, smoke-only alternative or unconditional status-quo option in this accepted design. Unknown paths fall back to full local execution until their scope is documented. Keep current executable guidance until this implementation lands. ## Dependencies and milestone Depends on #241's validated runner/evidence interface. This issue belongs to Milestone 3 because the evidence-aware hook and consistent guidance are required to deliver the agent test loop. Follow-ups join only if the milestone cannot complete without them.
gabogg changed title from chore(ci): refine pre-commit hook scope to skip pytest on docs-only changes to chore(tests): add evidence-aware commit hook and align validation guidance 2026-10-03 13:06:24 +00:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gabogg/hikcentral#242
No description provided.