Refactor/uri graph minimal kernel#2
Merged
mkotelnikov merged 3 commits intomainfrom May 1, 2026
Merged
Conversation
Introduce a persistent URI dependency graph kernel with workers as async generators and a single-writer orchestrator driving a fixpoint loop over two interchangeable repository backends: - MemoryGraphStore: in-memory state with abstract persistence (lock/load/store/unlock); ships FilesApi-JSON snapshot adapter and an in-process variant for tests. - SqlGraphStore: libSQL/Turso (Node + browser/OPFS) via @statewalker/db-api. Both backends pass one shared contract test suite (defineGraphStoreContract), guaranteeing isofunctional behaviour. End-to-end pipeline test runs the full file -> text -> chunk -> embedding -> index flow against both stores. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…repo-internal links The previous README was minimal. Rewritten to follow the project's README rules (What it is / Why it exists / How to use / Examples / Internals / License) with self-contained content — no relative links to other packages or notes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ermarks Replaces the prior package (~3200 LOC, 7 SQL tables, staging/run-history, content-hash no-op rule, scope/role machinery) with a minimal core: - Engine.runWorker / Engine.stabilize fixpoint over a Store interface. - Workers are async generators with selects/emits scheme prefixes; the engine streams resources whose latest event has stamp > worker watermark. - Per-worker watermark is the completion stamp minted after the worker generator finishes; by construction it is greater than every input or output stamp the run touched, so filter workers (consume input, produce nothing) advance their watermark and never spin. - Store has two interchangeable backends: MemoryStore (in-process, kept as production-grade for in-memory cell evaluation) and SqlStore (libSQL via @statewalker/db-api). Same WorkerFn runs against either. - Three append-only tables: resources(uri,stamp,status,meta), completions(worker,stamp,finished_at), workers(name,selects,emits) plus a single-row stamp_seq counter. No staging, no run history, no hashes. - Operator-driven: store.invalidate(prefix) emits 'removed' events to cascade re-execution; purgeResources / purgeCompletions for retention. - topoLayers is introspection-only; the engine is data-driven by stamps. Source: 521 LOC (engine 69, sql 224, memory 113, types/store/topo/index). Tests: 624 LOC including a shared store contract suite exercising both backends and an e2e pipeline test parametrised over MemoryStore + SqlStore. All 41 tests pass; tsc clean; biome clean. Design exploration: notes/2026-04/2026-04-25/10.dependencies-exporation.md Implementation plan: notes/2026-04/2026-04-25/11.dependencies-implementation-plan.md Minimal redesign: notes/2026-05/2026-05-01/notes.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.