fix(adoption): the baseline backfill runs to completion — one call adopts a pre-log baseline of any size
A production brain with a 12.7k-row pre-log baseline advanced exactly 800 rows per adoptLogAuthority() call (a five-pass ceiling × the oracle's 200-row listing cap), refused the flip, and sat tree-authoritative for hours across restarts. The bound was sized for drift, never for a baseline. Now: the adoption path runs the oracle uncapped so ONE scan yields the ENTIRE curable set, every pass cures all of it, and the loop runs to completion with the no-progress guard as its only stop. Pace rides the write path (one full-brain scan amortizes over thousands of cures, not two hundred): 1,000 drifted rows adopt green in one call in ~10s. Progress is narrated for a live operator. The wire report keeps its 200-row cap. Pinned: a baseline above the old ceiling adopts green in a single call.
This commit is contained in:
parent
3915180f7b
commit
a5a1883819
3 changed files with 145 additions and 9 deletions
|
|
@ -165,7 +165,16 @@ export async function runLogCompletenessOracle(args: {
|
|||
getVerbs?: (opts: {
|
||||
pagination: { limit: number; offset?: number; cursor?: string }
|
||||
}) => Promise<{ items: unknown[]; hasMore?: boolean; nextCursor?: string }>
|
||||
/**
|
||||
* Cap on the LISTED mismatches (counts are always complete). Defaults to
|
||||
* the wire-friendly {@link MISMATCH_LIST_CAP}; the adoption backfill passes
|
||||
* `Infinity` so ONE scan yields the ENTIRE curable set — a production
|
||||
* brain with a 12.7k-row pre-log baseline once advanced only 800 rows per
|
||||
* adoption call because each pass could see (and cure) at most 200.
|
||||
*/
|
||||
mismatchListCap?: number
|
||||
}): Promise<OracleReport> {
|
||||
const listCap = args.mismatchListCap ?? MISMATCH_LIST_CAP
|
||||
const report: OracleReport = {
|
||||
verdict: 'red',
|
||||
generationsScanned: 0,
|
||||
|
|
@ -176,7 +185,7 @@ export async function runLogCompletenessOracle(args: {
|
|||
mismatchListTruncated: false
|
||||
}
|
||||
const addMismatch = (m: OracleMismatch): void => {
|
||||
if (report.mismatches.length < MISMATCH_LIST_CAP) report.mismatches.push(m)
|
||||
if (report.mismatches.length < listCap) report.mismatches.push(m)
|
||||
else report.mismatchListTruncated = true
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue