Skip to content

Reduce writer contention during vector repair discovery - #206

Open
Coding-Dev-Tools wants to merge 2 commits into
codex/rework-memory-foundationfrom
codex/memory-maintenance-boundaries
Open

Reduce writer contention during vector repair discovery#206
Coding-Dev-Tools wants to merge 2 commits into
codex/rework-memory-foundationfrom
codex/memory-maintenance-boundaries

Conversation

@Coding-Dev-Tools

@Coding-Dev-Tools Coding-Dev-Tools commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Description

Depends on #203 and targets codex/rework-memory-foundation. This keeps the existing release candidate unchanged while making repair discovery a separate reviewable change.

Finding one erasure behind queued updates previously reserved SQLite's writer for every skipped update. Discovery now reads canonical headers in 100-row pages before acquiring the writer and stops the filtered iterator as soon as its provider-attempt budget is spent, including after failed cleanup.

The memory join uses the Store workspace predicate, retaining excluded records for cleanup and allowed historical records for indexing. Publication still revalidates generation, current canonical state, quarantine and vector identity inside the writer reservation, then acknowledges only the applied generation. Public signatures, return fields, schema and ranking defaults are unchanged. No migration is needed.

Adds real sync/storage regressions, a reproducible repair-only probe with source/driver identities and persisted failed attempts, and documentation of the remaining import/scheduling dependencies. Whole-queue scans, failed-deletion fairness, provider deadlines and full-engine capacity remain separate work.

Type

  • Bug fix
  • Documentation
  • New feature
  • CI/CD

Verification

  • Focused repair/storage/workspace/probe tests: 91 passed, 4 optional native-backend skips, including ten allow-list/time/recovery cases and both CLI evidence-retention cases.
  • Five original regressions fail on the base; two review-added regressions reproduce the post-budget tail scan. The GitHub workspace-binding finding was reproduced on ad6f7c6d and fixed in dc4382d1. All final focused cases pass.
  • ruff check . passes
  • python -m eval.harness --dataset eval/datasets/sample.jsonl --k 5 passes
  • Pyright, commercial manifest, strict-CSP asset check and the other documented deterministic evaluation gates pass.
  • Final committed-source Windows full suite: 5,032 passed, 47 optional/platform skips.
  • All 20 GitHub checks passed on dc4382d1: full-stack Python 3.12 has 5,097 passed / 18 skipped; browser suite has 156 passed; coverage is 85.27%. Python 3.9 floor, full-stack 3.10-3.14, encryption, package, integration and Docker gates passed.

Final-source repair probe (dc4382d1 versus 31da32c0), five independent processes per variant/backlog:

Queued updates Writer reservations before → after Median elapsed ms before → after
1,000 1,002 → 2 106.82 → 8.94
10,000 10,002 → 2 1,126.72 → 95.58

All 20 final runs verified erasure. The same driver uses disposable file-backed SQLite databases, fixed vectors and a synchronous fixture adapter. Timing includes instrumented discovery, writer acquisition, fixture publication and queue counts. Hardware: Intel i7-10700KF, 16 logical CPUs, 34,221,301,760 RAM bytes; Windows 11, CPython 3.12.10, NumPy 2.4.5, SQLite 3.49.1. No model, tokenizer or network call is measured. These are synthetic maintenance results, not the 100k capacity or semantic-quality gate.

Three bounded internal reviewers and the integration owner reviewed the slice; the fourth requested worker could not start because the tool reported its agent-thread limit. Their findings and the GitHub workspace-binding finding were reproduced and fixed. No descendants or separate tasks were used. The addressed GitHub thread was reverified against dc4382d and resolved after the user's explicit authorization.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T09:37:08.365345Z dc4382d New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ad6f7c6d67

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread engraphis/core/vector_repair.py
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