dsh-pre-push-checks
DSH Pre-Push Checks
Use this skill to run relevant local evidence once before a deepseek-harness push. The sole ordering exception is gh stack sync, which may publish a cascading rebase before the rewritten layers can be validated; validate them immediately afterward and do not merge until the evidence passes. Git hooks are intentionally narrow: pre-commit fixes staged lint, checks staged whitespace, and guards vendored-source metadata; pre-push runs only the incremental repository typecheck. CI owns exhaustive coverage and the platform matrix.
Inspect the outgoing change
- Confirm the checkout and branch.
git status --short --branch
git rev-parse --show-toplevel- Verify the live PR base or stack parent, fetch that ref, and inspect the complete scope against it.
pnpm --silent run change-scope --base <verified-base-ref>The command never guesses or fetches a base. Supply the ref verified from current remote or stack state; use --head <ref> when inspecting a commit other than HEAD. Its versioned JSON records committed paths relative to the resolved merge base, while staged, unstaged, and untracked paths describe the current worktree. After merging a changed base, rerun the report, reassess which behavior the combined scope can affect, and rerun only checks invalidated by the merge.
Select relevant evidence
There is no universal local baseline beyond the hooks. Every behavior change needs the narrowest available test or purpose-built check that would fail for its regression; add broader checks only for surfaces the diff actually reaches.
When the outgoing change adds or changes a resource-owning or asynchronous test, fixture, helper, or CI execution path, use dsh-ci-test-reliability first to decide whether restoration, negative-control, quiescent-teardown, or concurrent-process evidence applies. This skill still selects the commands and avoids repeating evidence that already passed.
- Package or script behavior: run the owning Vitest file or focused test name. Add adjacent package tests when a shared contract changes; leave repository-wide coverage to CI unless the change is genuinely cross-cutting or the user requests it.
- Remote mock typing: unbuilt
anyis an explicit local fallback, not strict evidence. Runpnpm run typecheckbefore handing off Remote/mock changes; rebuild missing, stale, or partial generated declarations before diagnosing remaining errors. Keep the exception in the test proxy, never in production Remote types, ambient flags, or copied signatures. - Documentation, Agent Notes, catalogs, or doc-linked comments: run
pnpm run doc-sync; run full lint when the documentation workflow requires it. - User-visible UI: use the UI change workflow and its minimum checks to verify required inspection and new cumulative effects. Disclose missing checks; optional paperwork is not a substitute for inspecting the result. Reuse valid evidence; ordinary changes do not need a separate full-audit report at push time. Keep existing test, GUI GIF and designer/product approval requirements. Tests alone do not establish visual acceptance.
- Model-, editor-, CLI-, or terminal-visible output: run the focused keyless snapshot or real runnable-example scenario that owns the output.
- Expected-output placement: a test whose selected recorded Session generation is replay input and expected persisted output belongs under top-level
snapshots/, withsnapshot.ymlnaming its shippeddshprofile and composition/header pin. Canonical parent files aresession[.vN].jsonl, children aresession.<ordinal>[.vN].jsonl, and the harness selects the highest generation per role. ARIA, geometry, generator, CLI, and unit expectations without that Session round trip stay beside their owning test undertests/expected/; do not place them insnapshots/or give them a*.snapshot.tsowner. Use the owningtest:expected,test:web, ortestlane. - Profile and configuration placement: cross-package behavior of a shipped
dshprofile belongs underapps/cli/tests/profiles/; a package-specific Loader composition belongs under that package'stests/fixtures/. User-facing optional overlays live underapps/cli/config/examples/and pair with a guide underdocs/user/. - Package manifests, public exports, build configuration, worker/bin entries, or built runtime paths: run
pnpm run build, the relevant hygiene checks, and the owning built-artifact smoke. - Repository test and script types:
pnpm run build:artifactschecks package projects only. Before claiming completion of TypeScript changes, runpnpm run build:checkafter the latestbuild:artifacts, or runpnpm run build;build:checkreads the existingbuild:artifactsoutput and never rebuilds it. - Real provider or agent behavior: run the relevant
pnpm run test:e2etarget when credentials are available; never print secrets.
Do not manually repeat a passing check merely because commit or push follows. In particular, do not run typecheck immediately before pushing solely to duplicate the pre-push hook.
Pass Vitest file and name filters directly after the script name with pnpm run; do not insert a standalone --, which reaches Vitest and can disable -t filtering. For example, this command runs one headless snapshot scenario:
pnpm run test:snapshot snapsh