Skip to content

fix: Advance style coverage with verified incremental appends - #814

Draft
buildingjoshbetter wants to merge 2 commits into
fix/l0-style-maintenance-publish-747from
fix/l0-style-incremental-publish-747
Draft

buildingjoshbetter wants to merge 2 commits into
fix/l0-style-maintenance-publish-747from
fix/l0-style-incremental-publish-747

Conversation

@buildingjoshbetter

@buildingjoshbetter buildingjoshbetter commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Scope

Checkpoint B for #747, stacked on #812. Advance verified style coverage during ordinary message inserts. Automatic background routing remains checkpoint C and is required before release or issue closure.

Problem and correction

An ordinary append can leave style coverage stale and cause redundant full rebuilds. Updating a normalized profile also loses the raw-sum information needed for correct incremental accumulation. This change advances the existing raw-sum accumulator and its exact source coverage in one transaction.

  • Capture complete current provenance and the six source counters before insertion under existing engine, model and writer ordering.
  • Verify exactly one source insertion through an indexed lookup. Apply the existing raw-sum updater once, then publish output count and coverage in the same transaction. No source-wide or profile-wide scan and no full rebuild on the append path.
  • Advance coverage for excluded anonymous or directive rows without inventing a style profile. Preserve zero-vector occurrence counts.
  • Defer legacy, missing, dirty, failed or running coverage. Preserve the source insert and newer failure diagnostics. Keep the existing failed-attempt retry baseline.
  • Recheck source, hash version, accumulator format, dependency and checkpoint ownership before final publication. Pending diagnostics use a whole-row conditional update.
  • Defer unsupported MAIN or TEMP triggers on style profiles, maintenance checkpoints or metadata without writing diagnostic rows. Admit only the exact three owned MAIN profile triggers. This also fixes an inherited preparation gap where a hash-marker trigger could delete profiles and still certify completion.
  • Preserve owned commit, borrowed savepoint, cache publication and rollback behavior. Unknown rollback failures remain visible.

The public style algorithm, dimension, models, rerankers and low-level builder contracts are unchanged. Two existing test fixtures now establish genuinely verified coverage; their behavioral assertions are retained.

Validation

  • Root: 105 focused tests passed using stdlib and in-memory SQLite.
  • Independent adversarial review: actual SQL trigger mutations, whole-row diagnostic races, six second-connection races, cancellation and rollback cases passed. The final metadata-trigger correction passed both MAIN and TEMP witnesses; reverting only that correction reproduces the inherited failure.
  • Performance control: 75 ordinary appends, 225 indexed point reads, zero additional full style builds. Each eligible occurrence is counted once.
  • Integration-based author branch: 2,888 passed, 22 skipped, 3 deselected; 2,118 subtests passed, with actual sqlite-vec. Log SHA256: 9cb6136dc9179916ce3393198bbe21afb85aaf6df47624051f62cb89eb876d7c.
  • Exact isolated publication branch: 2,777 passed, 22 skipped, 3 deselected; 1,464 subtests passed, with actual sqlite-vec. Log SHA256: 10239c221dd5dd1312ffd30c4c36c2e2aa1413cd286ca8928a2d7081e2133912.
  • All five production and test files are byte-identical to the independently reviewed candidate. Documentation preserves the prerequisite sections.
  • Ruff, Python 3.10 grammar, whitespace, scoped new-content privacy and public commit-identity checks passed. At the prior head 73b7a0509b956a38d2cfa0de2768158a6a433268, 33 hosted checks passed and one Ubuntu Python 3.13 rebuild test failed. See the corrected follow-up below.

Earlier failed adversarial receipts and source versions are retained. Passing full-suite tests did not replace the trigger and transaction audit.

Current follow-up gate

The corrected head is 157f45189663df8f6067e45a7b8dd2108238dee0. New hosted checks are pending. Earlier hosted and full-suite failures remain recorded below.

A controlled synthetic diagnostic reproduced the following rebuild failure when a real maintenance worker from the preceding directive test acquired the model lock after the original capture boundary. Scoped cancel/close/wait inside the original model patch prevented that overlap and restored all 17 cases. Observation without forced overlap passed. This is a demonstrated mechanism, not proof of the historical CI lock owner.

A reviewed test-only follow-up drains four known directive-test ownership paths, including the actual Memory instance created inside recall. It also corrects two config tests to isolate the delegated MCP directory, config and lock. All 49 directive and 20 platform assertions remain. Production code is unchanged by this follow-up.

  • Unprivileged author suite: 2,893 passed, 17 skipped, 3 deselected; 2,118 subtests passed. Log SHA256: 3a58fb3a7f345256ad3eb37e6b4d84f85a4c060b14f153d9d7ae8d6d610b7bea.
  • Exact publication candidate: 1 failed, 2,781 passed, 17 skipped, 3 deselected; 1,464 subtests passed. Log SHA256: 35f24e94e4da9722084624746afd7e13c4bfa5a55c6117fe5e86d90a97183556.
  • That publication candidate failed the config-cache test's global Path.read_text counter. A deterministic independent control produces the same assertion from an unrelated thread read with zero foreground config rereads. Actual attribution in that failed suite remains unknown. The reviewed observational full run passed with zero reads captured at that test and verified recorder cleanup; it did not reproduce or attribute the historical failure.

The final measurement correction scopes the config read counter to the fixture path and invoking thread. Every read still delegates to the original method. Deterministic different-path and same-path/background-thread controls run after the second config call, preserving its TTL window. All 22 original assertions remain; a forced genuine foreground reread still fails. No TTL, clock or production change.

The exact final publication source passed 2,782 tests and 1,464 subtests, with 17 skips and 3 deselections, under an unprivileged account with actual sqlite-vec. Log SHA256: d0b92ab9e581d0cb7db0e1cfeaa87b5d12f51ef4bb6900c51e844370786c4289. Remote source hash, distinct run receipt and container mount were checked. The three test files match the independently reviewed candidates. New-content privacy and commit-identity checks passed.

The earlier two config-path failures, read-count failure and failed hosted check are retained. Their causes are not inferred from a passing rerun. Hosted validation of the corrected head remains pending.

Remaining release gates

Checkpoint C must connect startup, explicit, bulk and background style work to coalesced ownership and bounded health reporting. Current source-trigger definitions alone cannot prove that no historical trigger gap occurred; that source-trust limitation remains open.

All workload data was synthetic. These results do not establish native latency, whole-process memory, MPS or thermal improvement. No personal memories, transcripts or credentials were exported. No main merge, release or issue closure.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant