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 <noreply@anthropic.com> Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
This commit is contained in:
@@ -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=<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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user