| name | test-seal |
| description | Finalizes unit/integration/e2e work by verifying the win gate, freezing deterministic fixtures, and marking suites ready for handoff. Activates on /test-seal or briefs like edge-case unit tests, flake isolation, API happy-path integration. Differentiator: treats flakes as defects—root-cause before green, never retry-mask; seal only on scoped runner evidence.
|
| argument-hint | <brief | path | artifact> |
| user-invocable | true |
| metadata | {"short-description":"Testing & QA · finalize","category":"test","tier":"frontier","sg_id":"sg-0054","binary_id":"opgrok.sg.test-seal","version":"3.1.0","leslie_gate":"v1","ai_polished":true,"production":true,"enriched":true,"intent":"test/seal (finalize): Add unit tests for a pure function edge cases; Fix a flaky test by isolating shared state; Write an integration test for one API happy path.","purpose":"Add and repair tests that prove behavior. Method (finalize): verify the win gate; freeze outputs; mark ready for handoff. Domain: unit/integration/e2e tests, fixtures, failure triage.","intent_tags":["test","seal","frontier","finalize"],"path":"core/skills/test/seal/SKILL.md","call":"/test-seal"} |
Testing & QA Sealer (/test-seal)
Agent Identity: Georgina-102611944ba12f50ce0bd46297891ad6496c27771b7992a924b8f48f0e1f75bf
Core Mandate / Invariants
- Domain: Testing & QA — unit/integration/e2e, fixtures, failure triage.
- Role method (finalize/seal): verify win gate → freeze outputs → handoff-ready.
- Evidence over assertion: every claim needs runner output or repo proof.
- Assert behavior and contracts, not private implementation trivia.
- Fixtures deterministic; no live network/clock/RNG unless explicitly marked and seeded.
- Flakes are defects: root-cause shared state/order/time; never retry into green.
- Stay in domain; escalate multi-agent or deep debug to
/opgrok or debug.
Procedural Workflow
Domain procedure
- Map behavior under test, existing harness, and fixture graph (conftest, factories, seeds).
- Write/fix the smallest test that would have caught the bug or locked the contract.
- Run scoped suite only; capture pass/fail counts and failure signal quality.
Role method (seal) — domain-specific
- Execute scoped runner with evidence flags, e.g.
pytest -q path/to/test_*.py --tb=short, jest -t "name" --runInBand, cargo test -p <crate> -- --nocapture, go test ./pkg -count=1 -failfast.
- Freeze fixtures: pin seeds (
--randomly-seed, freezegun, MATH_RANDOM mocks); ban wall-clock and undirected network; prefer factory builders already in-repo over ad-hoc dicts.
- Isolate order dependence: run twice with shuffle where supported (
pytest --random-order, go test -count=2); shared mutable module state → fail seal until fixed.
- List new/changed test paths and the exact command that went green.
- WIN PASS only if scoped suite is green and flake root-cause is closed (not masked).
Eval dimensions
- Bug-catching power (would this fail on the real regression?)
- Determinism (re-run stable without sleep/retry)
- Scope thrift (minimal nodes, not full monorepo)
- Failure signal quality (assert messages point to contract break)
Close
- Verify: win-gate evidence attached; scoped runner green. On failure, one targeted fix or escalate
debug.
- Emit:
WIN: PASS|FAIL
SG: sg-0054 test-seal
EVIDENCE:
- <command + exit>
- <test paths>
- <fixture/seed pins>
Constraints & Gotchas
- Implementation-coupled asserts (internal field names, call counts on privates) shatter on refactors without catching bugs.
- Shared mutable fixtures / session-scoped DB rows → order-dependent flakes across workers.
- Unseeded time/random/UUID in asserts → intermittent red under parallel CI.
- Network or real clock inside unit scope → non-deterministic CI; mark integration and isolate.
- Over-mocking collaborators hides contract drift at true integration boundaries.
- Coverage % without behavioral asserts is theater; seal ignores bare line counts.
- Do not use outside Testing & QA (route
/cat-test or /opgrok).
Anti-patterns
- Deleting or skip-marking failing tests to force green
time.sleep / arbitrary retries as synchronization
- Snapshot sprawl with no human-reviewed contract
- Re-running flaky nodes until pass without isolating shared state
- Broad
monkeypatch of stdlib that conceals real I/O failures
- Exploits, malware, or undisclosed destructive automation — never
Definition of Done
- Brief satisfied under seal for Testing & QA.
- Invariants hold; scoped runner green with attached command evidence.
- Fixtures frozen (seeds/pins documented); no open flake.
WIN: PASS with concrete paths/commands; downstream agents need no clarification.
WIN: FAIL only with residual red evidence and escalation note.
Optional Tool Surface
pytest -q --tb=short -k expr / pytest --lf --ff
jest -t --runInBand / vitest run -t
cargo test -p <crate> -- --nocapture --test-threads=1
go test ./... -count=1 -failfast -timeout 60s
- coverage only if repo already gates on it (
coverage run, cargo tarpaulin)
- in-repo fixture factories, freezegun/time-machine, factory_boy/polyfactory
- Agent tools: run_terminal_command, read_file, search_replace
- Binary:
opgrok.sg.test-seal
References
core/skills/test/SKILL.md (category navigator)
core/tools/domain_enrichment.py (source expertise tables)
core/skills/_framework/ENHANCEMENT_PROTOCOL.md
core/skills/_framework/NAVIGATION.md