From 156a131c594eae7308e2a1852dcd756a0c851b41 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 2 Sep 2026 16:55:41 +0000 Subject: [PATCH] docs: stop postgres and nats bugs from shipping green through verify (#3273) Co-authored-by: nova28 <17953305+nova28@users.noreply.github.com> Co-authored-by: Claude Sonnet 5 Co-authored-by: Carlos Florencio --- .agents/skills/verify/references/impact-matrix.md | 14 ++++++++++++-- AGENTS.md | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.agents/skills/verify/references/impact-matrix.md b/.agents/skills/verify/references/impact-matrix.md index 71b700bf44..cfa6e09211 100644 --- a/.agents/skills/verify/references/impact-matrix.md +++ b/.agents/skills/verify/references/impact-matrix.md @@ -2,7 +2,10 @@ Collect `base...HEAD`, staged, unstaged, and untracked paths. Deduplicate the union, then run every matching row. Prefer package/suite targets over -individual test names so changed dependents remain covered. +individual test names so changed dependents remain covered. For an +`apps/backend/**` path, the path match alone does not select the dialect or +event-bus rows below. Inspect the diff, then apply each specialized row whenever +its predicate matches. When the planner supplies a last verified SHA and a `/commit` hook receipt, read [hook-evidence.md](hook-evidence.md). Eligible hook evidence removes the @@ -16,6 +19,8 @@ uncovered command. | `.github/workflows/**` | `python3 .github/scripts/lint-action-pinning_test.py` plus applicable harness lint | | `scripts/**`, `.github/scripts/**` | sibling syntax/test when obvious; otherwise `make test-scripts` | | `apps/backend/**` | `make fmt-backend`, `make test-backend`, `make lint-backend` | +| A backend diff that changes dialect-sensitive schema or SQL, including `CREATE TABLE`, `ALTER TABLE`, `CREATE INDEX`, PostgreSQL-specific types/operators/functions, a `dialect.IsPostgres` branch, a table-rebuild/cutover migration, or SQLite-only `rowid`/JSON/date syntax | `KANDEV_TEST_POSTGRES_DSN= make -C apps/backend test`, plus the changed package's focused PostgreSQL tests by test name with verbose output (see `apps/backend/AGENTS.md` § Schema & migrations). Confirm that the focused tests pass instead of skipping. No DSN available: record the gap explicitly instead of reporting a pass | +| A backend diff that adds or changes an event-bus subscriber, or type-asserts `event.Data` | Add a decode-path unit test that marshals the payload to JSON, decodes into `interface{}`, and invokes the subscriber with the resulting wire-shaped value (pattern: `TestGitHubPRMergedSubscriberAcceptsJSONDecodedPayload` in `internal/automation/github_pr_merged_subscriber_test.go`); a bare `event.Data.(*T)` assertion is a finding, since JSON decoding may produce a map, scalar, or array depending on the payload, not the typed pointer (see how `normalizeTaskPR` in `internal/automation/github_pr_merged_subscriber.go` accepts all three representations) | | Eligible narrow pure helper in `apps/web/**` | changed-file Prettier/ESLint when uncovered, package-local typecheck, and the helper's colocated test file | | `apps/web/**` | generate web metadata, `make fmt-web`, `make typecheck-web`, `make test-web`, `make lint-web` | | `apps/cli/**` | workspace format, CLI TypeScript check/build, `make test-cli` | @@ -28,7 +33,12 @@ safe row; the user requests it; delivery has no PR CI; or changes touch root build/toolchain/dependency lockfiles, Makefiles, profiles, generated contracts, release tooling, migrations/shared schemas, or unusually broad plan implementation. Multiple known rows are not automatically ambiguous: run their -union when ownership and dependents are clear. +union when ownership and dependents are clear. `mode=full` does not set +`KANDEV_TEST_POSTGRES_DSN` either — a migrations/shared-schemas escalation still +needs the dialect row above. + +A suite that self-skips (missing `KANDEV_TEST_POSTGRES_DSN`) is not coverage: +report it as not run, never as a pass. ## Narrow Pure Web Helper diff --git a/AGENTS.md b/AGENTS.md index 5ebc465a1b..4bfaa1a662 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -83,6 +83,8 @@ Static analysis runs in CI and pre-commit. Each subtree has its own thresholds: When you hit a limit: extract a helper function, custom hook, or sub-component. Prefer composition over growing a single function. +Production comments state the invariant, not the argument for it: no `AC-NN` reference, no "Review round N", no "BLOCKING FINDING", no narration of a bug's history. That context belongs in the spec, the plan, or the PR body — a comment that has to argue the code is correct usually means the code is not constrained enough to be obviously correct. + ### Testing Every code change must include tests for new or changed logic. Backend: `*_test.go` files alongside the source. Frontend: `*.test.ts` files for utility functions, hooks, API clients, and store slices. Exceptions: config files, generated code, React component markup. Use `/tdd` for test-driven development.