Commit Graph
13 Commits
Author SHA1 Message Date
aiongg 522874f58f Convert the pre-merge store and the PR facts loader to the Kysely query builder, with the SQL of their tests 2026-11-21 21:56:44 +00:00
aiongg 44af247ce2 Review gate: failure-key LIKE patterns keep their wildcards, the newest-review read narrows verdict to non-null and drops the NULL order on a NOT NULL column; its tests name tables as the old SQL did, and the blocker fixture in plan-changes is built with Kysely 2026-11-21 21:24:08 +00:00
aiongg 35af7377f6 Review gate: queries built with Kysely, and the tests that read or write its rows 2026-11-21 21:05:50 +00:00
aiongg f65efca093 Postgres: discussion reads, scope answers and remaining planner-chain statements portable; lease and plan-change tests read ids with RETURNING 2026-11-21 19:02:36 +00:00
aiongg cdad9b309a Portable SQL helpers (src/db/portable.ts) with tests on both dialects; pnpm test:pg:suite runs the SQLite suite on a throwaway Postgres: a test preload redirects connectDb on SQLite paths to per-path databases copied from a migrated template, dropped at exit, a reporter prints totals and failures per file; sqliteOnly skips for tests that need SQLite itself 2026-11-21 18:28:03 +00:00
aiongg f82b0e1553 Live topics and the plan change log on Postgres: one plpgsql function per table and operation evaluates every topic and change-log trigger (src/db/pg-triggers.ts); counters (change_seq, plan_full) move once per transaction at commit through a deferred constraint trigger that locks touched rows in sorted order; the change log is consumed by key on both dialects (a pass deletes exactly the seqs it read, late commits are read next pass) and plan_full is a full-pass generation; bulk marker on Postgres is the transaction-local ac.bulk; connectDb migrates a Postgres database at open (schema and triggers in one transaction under the migration lock, skipped when the stored stamp is current); parity, out-of-order commit, counter and plan-coverage tests 2026-11-21 18:15:40 +00:00
aiongg 20061c88d9 Apply async codemod: node scripts/codemod-async.ts over the program 2026-11-21 17:00:38 +00:00
aiongg d968d9e53f Change log: blocker lookups through review_blockers and covering pair indexes keep per-row trigger cost near zero; bulk writes take one full mark; triggers survive malformed rows, lost marker rows and column drops; trigger rebuild in one transaction; shadow differences plan from the full load; pass durations; plan-log status and drop 2026-11-21 14:57:11 +00:00
aiongg 6935265ab8 Incremental planner pass in the runner's worker: facts kept per connection, reloaded for logged and due items, full loads at start, on a full-pass mark, on a change outside the database and every 30 min; shadow check against a full load in the same read transaction (plan_shadow), differences in plan_shadow_diffs and pass counts in plan_pass_stats 2026-11-21 14:12:06 +00:00
aiongg 01b8940b40 Fact loaders read the pass time only, and facts carry refreshAt
Every loader on the fact path decides with the load's now: the blocker
expiry and the daily re-review cap in staleReviews, the card lock of
decisions, the cached write permission of a settling maintainer (bound
as :settles_after instead of SQLite's clock) and the author permission
TTL. PrFacts and ItemFacts carry refreshAt, the earliest time a load at
a later now could give other facts: timed holds and unsent asks, blocker
lists expiring, daily caps ending at UTC midnight, card locks going
stale, duplicate-set retries and drop pauses, and permission caches
aging out.

The diff re-read pace is instance-wide: decidePr takes it as PassFacts,
read once per pass (PlanSet.pass), instead of every pending PR holding
it in diffPending.
2026-11-21 13:52:54 +00:00
aiongg 6394dd0bdd Change log: every full-pass mark counts under its trigger in plan_full_causes 2026-11-21 12:57:39 +00:00
aiongg 53c96b5952 Change log: cross inputs without refs only force full passes; the registry test checks item inputs have repo and number columns 2026-11-21 07:57:23 +00:00
aiongg 38b328b791 Planner change log: item_changes and a full-pass marker, filled by triggers generated from a registry of every table the fact loaders read 2026-11-21 07:45:41 +00:00