Compatibility: designed for Codex CLI and compatible agents on supported
MatrixOne development platforms. Use the Go version in go.mod. CGo work also
requires the repository-supported compiler and matching native artifacts.
Outcome and core workflow
Produce the smallest general change that restores or introduces an explicit
contract, then prove every affected boundary with the cheapest valid evidence.
Rigor is coverage of contracts and unhappy paths, not diff size, command count,
or repeated full-suite runs.
- Resolve scope once. Record base, head, merge-base, committed plus local
changes, and untracked/delivery artifacts. Build the change map and per-closure
R0-R3 classification from
validation-evidence.md.
- Classify design work. Apply the feature/major-refactor gate before
implementation. Ordinary focused bug fixes are exempt from a design document,
but never from invariant, ownership, cost, or validation reasoning.
- State the contract. Write the problem evidence, invariant and negation,
first owner, affected consumers, state transitions, unhappy paths, and
performance/resource budget before choosing the patch.
- Load only applicable domain references. Use the resource map below; do
not load or restate every specialized workflow.
- Implement the narrowest complete closure. Change the common ownership or
protocol boundary, not one observed trace. Update consumers/reverse arcs and
tests in the same functional unit.
- Validate by information value. Reuse semantically valid evidence, run the
cheapest discriminating checks first, and escalate only along mapped risk
dimensions. Do not rerun equivalent author/CI work.
- Review and deliver. Run
mo-self-review on the final scope, resolve every
blocker, inspect the delivery diff, and report the compact evidence record.
For tests and diagnostic probes, acquire each resource only after its preceding
step succeeds and schedule its cleanup immediately in the same lexical scope.
When a loop performs repeated queries or opens rows/statements, use a small
helper or per-iteration closure so defer releases the resource before the
next iteration; a cleanup call at the bottom of a test is not equivalent on an
early assertion failure.
For diagnosis-only requests, stop after proving and explaining the cause; do not
turn diagnosis into an implementation without authorization.
Resource map
Read a reference when its trigger applies:
| Need |
Read |
| Change/risk map, efficient validation order, CI/local evidence reuse |
references/validation-evidence.md |
| Credible shared-state/lifecycle/synchronization/timing failure mode |
references/race-validation.md |
| Large/complex feature or major refactor; design document review (RFC optional) |
references/feature-design-review.md |
| UT/BVT purpose, orthogonality, fixture reuse, cost/flakiness, result and execution evidence |
references/testing-contract.md |
| CGo compile/link/load/module errors, local wrapper, hang attribution, clean-baseline proof, GPU/cuVS/CUDA |
references/cgo-build-test.md |
colexec/process/pipeline lifecycle, typed terminal signals, distributed dispatch/receiver hangs |
references/operator-pipeline.md |
| Planner/explain/rewrite correctness, public reachability, independent black-/white-box oracles |
references/counterexample-testing.md |
| Vector/fulltext algorithm registry, build-tag registration, ISCP/CDC and index-plugin review |
references/index-plugin.md |
Enforcement gates
| Gate |
Trigger |
Required action |
| G-FEATURE-DESIGN |
Feature/major refactor reaches the size threshold or any complexity trigger |
Read the design contract; require and review an approved, versioned design document before implementation. A failed/missing design makes the review decision REQUEST_CHANGES; submit that GitHub review only when the task authorizes the mutation. |
| G-CHANGE-MAP |
Before non-trivial implementation, validation, or review |
Build one complete change map. Every changed hunk and contract must be covered; deep work is routed per closure rather than repeated over the whole diff. |
| G-TEST-CONTRACT |
Production behavior changes or any UT/BVT is added, changed, removed, merged, or optimized |
Read the testing contract. Map behavior to UT/BVT, inventory existing cases/fixtures, preserve all distinct oracles, and reject unnecessary data, sleeps, processes, or setup. |
| G-CGO |
A selected package is CGo-direct/transitive, native/module/link/load errors occur, or GPU mode is involved |
Read the CGo reference and use the controlled wrapper/appropriate GPU workflow. Diagnose the failing layer; do not change product code to mask environment failure. |
| G-OPERATOR |
Editing/reviewing colexec, process signals, pipeline spool/protocol, or a distributed pipeline hang |
Read the operator/pipeline reference before editing or concluding. Trace sender and receiver plus reset/cleanup terminal paths. |
| G-COUNTEREXAMPLE |
Planner/explain/rewrite correctness or scenario-overfit risk |
Read the counterexample reference. Define invariant/negation/reachability and use independent public and typed oracles where each proves a distinct claim. |
| G-INDEXPLUGIN |
Index algorithm dispatch/plugin/registry/ISCP paths change |
Read the index-plugin reference and its review section. New SQL/catalog per-algorithm dispatch is forbidden. |
| G-STATIC-INCREMENTAL |
Any Go source/test edit or SCA failure |
Derive the changed package closure from the merge base (including local staged/unstaged files), run gofmt/vet/lint only for that closure first, and escalate to the full repository scan only under the rules below. |
| G-CI-TRIAGE |
A CI job fails, hangs, is cancelled, or is unexpectedly skipped |
Capture the exact job step, SHA, platform/toolchain, and terminal result; classify code/static/test failure separately from network/cache/quota/disk/runner failure before changing code or deciding to rerun. |
| G-EVIDENCE |
Before claiming pass/done or attributing a failure |
Apply semantic evidence validity. Pending/empty selection/partial output is not a pass; a “pre-existing” claim requires the same failure at the verified clean baseline. |
First-principles change rules
- Start from the violated/missing invariant and the first owner of state or
resources, not the proposed patch, issue spelling, or last stack frame.
- Close success, error, cancellation, timeout, retry, partial initialization,
reset/reuse, restart, and cleanup only where the mapped contract can reach
them. Prove unreachable dimensions instead of testing them ritualistically.
- Prefer deleting duplicated state/transitions/cleanup. Every new stateful
component needs one effective owner, an explicit bound, admission/publication
point, all terminal paths, and a generation/restart rule.
- Keep mechanisms proportional. A local fix does not justify a framework,
cache, worker, retry layer, global, extension point, or generic abstraction.
Require multiple independent recurring needs, a stable contract, and lower
total runtime/operational/testing/maintenance complexity.
- Treat per-row/batch/message/transaction/query paths as hot until bounded.
Account for allocations, copies, scans, synchronization, goroutines, I/O,
logs, and metric cardinality; benchmark/profile only when cost can be
material.
- Avoid incident overfit. Do not encode issue IDs, one plan layout, exact data
shape, or timing coincidence in production logic. Test the invariant,
nearest control, and counterexample with minimum data and deterministic
control.
- Preserve user scope and permissions. Read-only review/diagnosis does not
authorize production changes, GitHub review submission, or other external
mutations.
Efficient validation and completion
Use validation-evidence.md as the source of
truth. In particular:
- prove exact package/test/case selection is non-empty;
- run focused evidence before broader owning-package/group evidence;
- validate a real consumer when an ownership/API boundary changes;
- add BVT/topology/restart/upgrade/race/GPU/performance only when the mapped
contract requires that dimension;
- reuse exact-head CI or local evidence whose relevant semantic inputs and mode
are unchanged; unrelated docs or PR metadata do not invalidate it;
- retain real terminal status and diagnose silence by polling the existing
process, not by launching duplicates.
Incremental static checks (default)
Do not run a repository-wide SCA for every edit. Resolve the merge base once,
include committed and local tracked/untracked Go files, inspect the resulting
package list, and run the configured checks only on that list:
set -euo pipefail
base_ref=${REVIEW_BASE:-origin/main}
merge_base=$(git merge-base HEAD "$base_ref")
tracked_go=$(git diff --name-only "$merge_base" -- '*.go')
untracked_go=$(git ls-files --others --exclude-standard -- '*.go')
changed_go=$(printf '%s\n%s\n' "$tracked_go" "$untracked_go" |
sort -u | sed '/^$/d')
existing_go=$(printf '%s\n' "$changed_go" | while IFS= read -r file; do
if [ -n "$file" ] && [ -f "$file" ]; then printf '%s\n' "$file"; fi
done)
if [ -n "$existing_go" ]; then
format_files=$(printf '%s\n' "$existing_go" | xargs -r gofmt -l)
if [ -n "$format_files" ]; then
printf 'gofmt required for:\n%s\n' "$format_files" >&2
exit 1
fi
fi
changed_dirs=$(printf '%s\n' "$changed_go" | while IFS= read -r file; do
if [ -n "$file" ]; then dirname -- "$file"; fi
done | sort -u)
changed_pkgs=$(printf '%s\n' "$changed_dirs" | while IFS= read -r dir; do
if [ -z "$dir" ]; then continue; fi
if [ ! -d "$dir" ]; then
printf 'changed Go directory was removed; select affected consumers explicitly: %s\n' "$dir" >&2
exit 1
fi
if ! find "$dir" -maxdepth 1 -type f -name '*.go' -print -quit | grep -q .; then
printf 'changed Go directory has no current Go files; select affected consumers explicitly: %s\n' "$dir" >&2
exit 1
fi
GOWORK=off go list -mod=readonly "./${dir#./}" || exit 1
done | sort -u)
if [ -n "$changed_go" ] && [ -z "$changed_pkgs" ]; then
printf 'changed Go files exist, but no package was discovered\n' >&2
exit 1
fi
if [ -n "$changed_pkgs" ]; then
GOWORK=off go vet -mod=readonly $changed_pkgs
GOWORK=off golangci-lint run -c .golangci.yml --new-from-rev "$merge_base" $changed_pkgs
fi
Use the CGo setup and wrapper from
cgo-build-test.md when the selected closure is
CGo-direct/transitive. Add directly affected consumers when an exported/API,
protocol, generated-code, or shared lifecycle contract changed; the package
list must not be a guessed single leaf. A deleted-only package directory must
stop this helper and be handled by explicitly selecting its existing consumers;
do not replace that decision with ./.... If no Go file changed, run the
smallest checker for the changed artifact.
make static-check-analysis, make static-check, golangci-lint run ./...,
and equivalent whole-repository commands are the CI/full-scan path, not the
default edit loop. Escalate to one only when SCA configuration/toolchain or
workflow files changed, the affected consumer closure cannot be bounded, a
release/pre-push gate explicitly requires it, or a CI failure must be
reproduced. Record incremental and full results separately; a focused pass is
not evidence that full CI SCA is green. Never suppress a finding or delete
cleanup merely to make a static check pass.
CI and environment diagnosis
When a CI check is red or silent, do not infer the cause from the check name or
partial output. Inspect the failing step and terminal log at the exact checked
SHA, then classify it before editing:
- Code/static/test: reproduce the smallest affected package/test locally
with the same mode (race, coverage, tags, CGo, platform where possible), and
fix the violated contract. Run static checks before an expensive cluster or
end-to-end test.
- Infrastructure: network/API fetch failures, rate limits, unavailable
caches, runner/toolchain setup, disk exhaustion, or a cancelled/evicted job
do not by themselves prove a product failure. Preserve the log and classify
the cancellation/eviction reason; rerun only a clearly transient job when
authorized, and do not add sleeps, retries, skips, or product workarounds to
hide it.
- Ambiguous/hung: keep the existing run as the source of truth; poll for a
terminal result, inspect the process/stack and resource state, and avoid
launching a duplicate service or test that can contend for ports, native
artifacts, or global state. A timeout is evidence of a liveness failure until
the wait-for path is explained.
For local native/integration work, preflight the selected toolchain, disk and
temporary directory, active test-owned processes/ports, and CGo artifact
provenance. Use the repository wrapper and an explicit temporary directory;
clean only artifacts owned by the test. Report environment failures separately
from code evidence, and never claim CI green from a pending, skipped, cancelled,
or unrelated check.
Ordinary pure-Go examples:
GOWORK=off go test -mod=readonly -list 'TestXxx' ./pkg/target
GOWORK=off go test -mod=readonly -v -count=1 -timeout 120s -run '^TestXxx$' ./pkg/target
GOWORK=off go test -mod=readonly -v -count=1 -timeout 120s ./pkg/target/...
GOWORK=off go vet -mod=readonly ./pkg/target/...
For CGo-direct/transitive packages, replace go test with:
.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s ./pkg/target/...
Before delivery, the record must show:
□ resolved range/worktree scope and complete per-closure change map
□ design-gate decision and approved revision when triggered
□ invariant/root cause/owner/consumer and relevant unhappy paths closed
□ UT/BVT and specialized-domain decisions recorded
□ every required proof is validly reused or passed; gaps/pending work are explicit
□ generated/delivery artifacts, diff stat, and unintended files checked
□ `mo-self-review` has zero unresolved blockers
Never weaken assertions, add sleeps/retries/skips, broaden fixtures, or run an
unrelated package merely to make a checkbox green. Never claim “systematic”
from breadth alone: demonstrate one general contract closed across its relevant
state space with less total complexity than the credible alternatives.
1---2name: mo-dev3description: Develop and validate MatrixOne kernel changes with design-first gates, first-principles invariants, risk-proportional evidence, deterministic UT/BVT, and repository-specific CGo, operator/pipeline, planner, and index-plugin workflows. Use for MatrixOne production or test changes, bug fixes, feature/refactor design, kernel CI failures/hangs, and implementation review.4---56Compatibility: designed for Codex CLI and compatible agents on supported7MatrixOne development platforms. Use the Go version in `go.mod`. CGo work also8requires the repository-supported compiler and matching native artifacts.910## Outcome and core workflow1112Produce the smallest general change that restores or introduces an explicit13contract, then prove every affected boundary with the cheapest valid evidence.14Rigor is coverage of contracts and unhappy paths, not diff size, command count,15or repeated full-suite runs.16171. **Resolve scope once.** Record base, head, merge-base, committed plus local18 changes, and untracked/delivery artifacts. Build the change map and per-closure19 R0-R3 classification from20 [validation-evidence.md](references/validation-evidence.md).212. **Classify design work.** Apply the feature/major-refactor gate before22 implementation. Ordinary focused bug fixes are exempt from a design document,23 but never from invariant, ownership, cost, or validation reasoning.243. **State the contract.** Write the problem evidence, invariant and negation,25 first owner, affected consumers, state transitions, unhappy paths, and26 performance/resource budget before choosing the patch.274. **Load only applicable domain references.** Use the resource map below; do28 not load or restate every specialized workflow.295. **Implement the narrowest complete closure.** Change the common ownership or30 protocol boundary, not one observed trace. Update consumers/reverse arcs and31 tests in the same functional unit.326. **Validate by information value.** Reuse semantically valid evidence, run the33 cheapest discriminating checks first, and escalate only along mapped risk34 dimensions. Do not rerun equivalent author/CI work.357. **Review and deliver.** Run `mo-self-review` on the final scope, resolve every36 blocker, inspect the delivery diff, and report the compact evidence record.3738For tests and diagnostic probes, acquire each resource only after its preceding39step succeeds and schedule its cleanup immediately in the same lexical scope.40When a loop performs repeated queries or opens rows/statements, use a small41helper or per-iteration closure so `defer` releases the resource before the42next iteration; a cleanup call at the bottom of a test is not equivalent on an43early assertion failure.4445For diagnosis-only requests, stop after proving and explaining the cause; do not46turn diagnosis into an implementation without authorization.4748## Resource map4950Read a reference when its trigger applies:5152| Need | Read |53|---|---|54| Change/risk map, efficient validation order, CI/local evidence reuse | [references/validation-evidence.md](references/validation-evidence.md) |55| Credible shared-state/lifecycle/synchronization/timing failure mode | [references/race-validation.md](references/race-validation.md) |56| Large/complex feature or major refactor; design document review (RFC optional) | [references/feature-design-review.md](references/feature-design-review.md) |57| UT/BVT purpose, orthogonality, fixture reuse, cost/flakiness, result and execution evidence | [references/testing-contract.md](references/testing-contract.md) |58| CGo compile/link/load/module errors, local wrapper, hang attribution, clean-baseline proof, GPU/cuVS/CUDA | [references/cgo-build-test.md](references/cgo-build-test.md) |59| `colexec`/`process`/pipeline lifecycle, typed terminal signals, distributed dispatch/receiver hangs | [references/operator-pipeline.md](references/operator-pipeline.md) |60| Planner/explain/rewrite correctness, public reachability, independent black-/white-box oracles | [references/counterexample-testing.md](references/counterexample-testing.md) |61| Vector/fulltext algorithm registry, build-tag registration, ISCP/CDC and index-plugin review | [references/index-plugin.md](references/index-plugin.md) |6263## Enforcement gates6465| Gate | Trigger | Required action |66|---|---|---|67| **G-FEATURE-DESIGN** | Feature/major refactor reaches the size threshold or any complexity trigger | Read the design contract; require and review an approved, versioned design document before implementation. A failed/missing design makes the review decision `REQUEST_CHANGES`; submit that GitHub review only when the task authorizes the mutation. |68| **G-CHANGE-MAP** | Before non-trivial implementation, validation, or review | Build one complete change map. Every changed hunk and contract must be covered; deep work is routed per closure rather than repeated over the whole diff. |69| **G-TEST-CONTRACT** | Production behavior changes or any UT/BVT is added, changed, removed, merged, or optimized | Read the testing contract. Map behavior to UT/BVT, inventory existing cases/fixtures, preserve all distinct oracles, and reject unnecessary data, sleeps, processes, or setup. |70| **G-CGO** | A selected package is CGo-direct/transitive, native/module/link/load errors occur, or GPU mode is involved | Read the CGo reference and use the controlled wrapper/appropriate GPU workflow. Diagnose the failing layer; do not change product code to mask environment failure. |71| **G-OPERATOR** | Editing/reviewing `colexec`, process signals, pipeline spool/protocol, or a distributed pipeline hang | Read the operator/pipeline reference before editing or concluding. Trace sender and receiver plus reset/cleanup terminal paths. |72| **G-COUNTEREXAMPLE** | Planner/explain/rewrite correctness or scenario-overfit risk | Read the counterexample reference. Define invariant/negation/reachability and use independent public and typed oracles where each proves a distinct claim. |73| **G-INDEXPLUGIN** | Index algorithm dispatch/plugin/registry/ISCP paths change | Read the index-plugin reference and its review section. New SQL/catalog per-algorithm dispatch is forbidden. |74| **G-STATIC-INCREMENTAL** | Any Go source/test edit or SCA failure | Derive the changed package closure from the merge base (including local staged/unstaged files), run gofmt/vet/lint only for that closure first, and escalate to the full repository scan only under the rules below. |75| **G-CI-TRIAGE** | A CI job fails, hangs, is cancelled, or is unexpectedly skipped | Capture the exact job step, SHA, platform/toolchain, and terminal result; classify code/static/test failure separately from network/cache/quota/disk/runner failure before changing code or deciding to rerun. |76| **G-EVIDENCE** | Before claiming pass/done or attributing a failure | Apply semantic evidence validity. Pending/empty selection/partial output is not a pass; a “pre-existing” claim requires the same failure at the verified clean baseline. |7778## First-principles change rules79801. Start from the violated/missing invariant and the first owner of state or81 resources, not the proposed patch, issue spelling, or last stack frame.822. Close success, error, cancellation, timeout, retry, partial initialization,83 reset/reuse, restart, and cleanup only where the mapped contract can reach84 them. Prove unreachable dimensions instead of testing them ritualistically.853. Prefer deleting duplicated state/transitions/cleanup. Every new stateful86 component needs one effective owner, an explicit bound, admission/publication87 point, all terminal paths, and a generation/restart rule.884. Keep mechanisms proportional. A local fix does not justify a framework,89 cache, worker, retry layer, global, extension point, or generic abstraction.90 Require multiple independent recurring needs, a stable contract, and lower91 total runtime/operational/testing/maintenance complexity.925. Treat per-row/batch/message/transaction/query paths as hot until bounded.93 Account for allocations, copies, scans, synchronization, goroutines, I/O,94 logs, and metric cardinality; benchmark/profile only when cost can be95 material.966. Avoid incident overfit. Do not encode issue IDs, one plan layout, exact data97 shape, or timing coincidence in production logic. Test the invariant,98 nearest control, and counterexample with minimum data and deterministic99 control.1007. Preserve user scope and permissions. Read-only review/diagnosis does not101 authorize production changes, GitHub review submission, or other external102 mutations.103104## Efficient validation and completion105106Use [validation-evidence.md](references/validation-evidence.md) as the source of107truth. In particular:108109- prove exact package/test/case selection is non-empty;110- run focused evidence before broader owning-package/group evidence;111- validate a real consumer when an ownership/API boundary changes;112- add BVT/topology/restart/upgrade/race/GPU/performance only when the mapped113 contract requires that dimension;114- reuse exact-head CI or local evidence whose relevant semantic inputs and mode115 are unchanged; unrelated docs or PR metadata do not invalidate it;116- retain real terminal status and diagnose silence by polling the existing117 process, not by launching duplicates.118119### Incremental static checks (default)120121Do not run a repository-wide SCA for every edit. Resolve the merge base once,122include committed and local tracked/untracked Go files, inspect the resulting123package list, and run the configured checks only on that list:124125```bash126set -euo pipefail127base_ref=${REVIEW_BASE:-origin/main}128merge_base=$(git merge-base HEAD "$base_ref")129tracked_go=$(git diff --name-only "$merge_base" -- '*.go')130untracked_go=$(git ls-files --others --exclude-standard -- '*.go')131changed_go=$(printf '%s\n%s\n' "$tracked_go" "$untracked_go" |132 sort -u | sed '/^$/d')133existing_go=$(printf '%s\n' "$changed_go" | while IFS= read -r file; do134 if [ -n "$file" ] && [ -f "$file" ]; then printf '%s\n' "$file"; fi135done)136137if [ -n "$existing_go" ]; then138 format_files=$(printf '%s\n' "$existing_go" | xargs -r gofmt -l)139 if [ -n "$format_files" ]; then140 printf 'gofmt required for:\n%s\n' "$format_files" >&2141 exit 1142 fi143fi144145changed_dirs=$(printf '%s\n' "$changed_go" | while IFS= read -r file; do146 if [ -n "$file" ]; then dirname -- "$file"; fi147done | sort -u)148changed_pkgs=$(printf '%s\n' "$changed_dirs" | while IFS= read -r dir; do149 if [ -z "$dir" ]; then continue; fi150 if [ ! -d "$dir" ]; then151 printf 'changed Go directory was removed; select affected consumers explicitly: %s\n' "$dir" >&2152 exit 1153 fi154 if ! find "$dir" -maxdepth 1 -type f -name '*.go' -print -quit | grep -q .; then155 printf 'changed Go directory has no current Go files; select affected consumers explicitly: %s\n' "$dir" >&2156 exit 1157 fi158 GOWORK=off go list -mod=readonly "./${dir#./}" || exit 1159done | sort -u)160if [ -n "$changed_go" ] && [ -z "$changed_pkgs" ]; then161 printf 'changed Go files exist, but no package was discovered\n' >&2162 exit 1163fi164165if [ -n "$changed_pkgs" ]; then166 GOWORK=off go vet -mod=readonly $changed_pkgs167 GOWORK=off golangci-lint run -c .golangci.yml --new-from-rev "$merge_base" $changed_pkgs168fi169```170171Use the CGo setup and wrapper from172[cgo-build-test.md](references/cgo-build-test.md) when the selected closure is173CGo-direct/transitive. Add directly affected consumers when an exported/API,174protocol, generated-code, or shared lifecycle contract changed; the package175list must not be a guessed single leaf. A deleted-only package directory must176stop this helper and be handled by explicitly selecting its existing consumers;177do not replace that decision with `./...`. If no Go file changed, run the178smallest checker for the changed artifact.179180`make static-check-analysis`, `make static-check`, `golangci-lint run ./...`,181and equivalent whole-repository commands are the CI/full-scan path, not the182default edit loop. Escalate to one only when SCA configuration/toolchain or183workflow files changed, the affected consumer closure cannot be bounded, a184release/pre-push gate explicitly requires it, or a CI failure must be185reproduced. Record incremental and full results separately; a focused pass is186not evidence that full CI SCA is green. Never suppress a finding or delete187cleanup merely to make a static check pass.188189### CI and environment diagnosis190191When a CI check is red or silent, do not infer the cause from the check name or192partial output. Inspect the failing step and terminal log at the exact checked193SHA, then classify it before editing:194195- **Code/static/test:** reproduce the smallest affected package/test locally196 with the same mode (race, coverage, tags, CGo, platform where possible), and197 fix the violated contract. Run static checks before an expensive cluster or198 end-to-end test.199- **Infrastructure:** network/API fetch failures, rate limits, unavailable200 caches, runner/toolchain setup, disk exhaustion, or a cancelled/evicted job201 do not by themselves prove a product failure. Preserve the log and classify202 the cancellation/eviction reason; rerun only a clearly transient job when203 authorized, and do not add sleeps, retries, skips, or product workarounds to204 hide it.205- **Ambiguous/hung:** keep the existing run as the source of truth; poll for a206 terminal result, inspect the process/stack and resource state, and avoid207 launching a duplicate service or test that can contend for ports, native208 artifacts, or global state. A timeout is evidence of a liveness failure until209 the wait-for path is explained.210211For local native/integration work, preflight the selected toolchain, disk and212temporary directory, active test-owned processes/ports, and CGo artifact213provenance. Use the repository wrapper and an explicit temporary directory;214clean only artifacts owned by the test. Report environment failures separately215from code evidence, and never claim CI green from a pending, skipped, cancelled,216or unrelated check.217218Ordinary pure-Go examples:219220```bash221GOWORK=off go test -mod=readonly -list 'TestXxx' ./pkg/target222GOWORK=off go test -mod=readonly -v -count=1 -timeout 120s -run '^TestXxx$' ./pkg/target223GOWORK=off go test -mod=readonly -v -count=1 -timeout 120s ./pkg/target/...224GOWORK=off go vet -mod=readonly ./pkg/target/...225```226227For CGo-direct/transitive packages, replace `go test` with:228229```bash230.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s ./pkg/target/...231```232233Before delivery, the record must show:234235```text236□ resolved range/worktree scope and complete per-closure change map237□ design-gate decision and approved revision when triggered238□ invariant/root cause/owner/consumer and relevant unhappy paths closed239□ UT/BVT and specialized-domain decisions recorded240□ every required proof is validly reused or passed; gaps/pending work are explicit241□ generated/delivery artifacts, diff stat, and unintended files checked242□ `mo-self-review` has zero unresolved blockers243```244245Never weaken assertions, add sleeps/retries/skips, broaden fixtures, or run an246unrelated package merely to make a checkbox green. Never claim “systematic”247from breadth alone: demonstrate one general contract closed across its relevant248state space with less total complexity than the credible alternatives.