schema-change
Skill2 starsChanged 3 months agoMITView on GitHub
Change Synapse index persistence safely — SQLite schema, writer contract, migrations, lifecycle repair. Use when touching core/index (schema.py, writes.py, reads.py), symbol-write invariants, or anything the watch daemon persists.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- kagkarlsson/db-schedulertheir own version, first seen Oct 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- kagkarlsson/db-scheduler★ 1.7ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ab-evalSkill
- add-adapterSkill
- add-languageSkill
- add-mcp-toolSkill
- releaseSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
When in doubt, bump the writer contract.
- Very specific: line 65
Update the invariant/bump-rule prose in AGENTS.md and docs/architecture.md if the rule itself changed, and add a CHANGELOG.md [Unreleased] …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Change index persistence
Persistence changes ripple through a fixed set of guards. Skipping a step does not fail fast — it produces stale indexes, daemons writing under an old contract, or repairs that never trigger.
1. Which constant moves? (src/synapse/core/index/contract.py)
SCHEMA_VERSION— bump when the on-disk shape changes. It also feeds the reference-extraction fingerprint (core/indexing/references.pyhashesf"schema:{SCHEMA_VERSION}"), so a bump forces a full rebuild on next ensure.INDEX_WRITER_CONTRACT_VERSION— bump whenever symbol-write invariants change, even with no schema change. The package version is not enough: two development builds share one version, and a running watch daemon built from older code would otherwise keep writing under the old contract. The module docstring lists the current contract's invariants (every symbol row carries its handle written in the same statement; file symbol replacement is delete-then-insert in one transaction; handles are unique) — extend that list when the contract grows.
When in doubt, bump the writer contract; a spurious bump costs one daemon restart, a missed one corrupts evidence silently.
2. Schema and write path
src/synapse/core/index/schema.py— the SQL, the_migrate_columnstables, and_rebuild_symbols_table's copy-column list. TheCHECKconstraint andSCHEMA"must never drift" (comment in file). Rebuilds use explicit statements in one transaction — neverexecutescriptmid-rebuild — so a partial rebuild cannot commit. Migrations must be re-runnable against an already-migrated database.- Then
writes.py/reads.py, andhandles.pyif handle shape is involved.
3. Consumers to verify by reading, not assuming
core/provenance.py—runtime_provenance()payload reports both versions.core/watch/state.py— daemon status mismatch check and the stampedcontract_version.core/watch/daemon.py— the mismatch error message.core/lifecycle.py— thewriter-contract-mismatchrepair reason; a mismatched daemon must be stopped before any repair touches the database.
4. Test gate
uv run pytest -q tests/core/index tests/core/watch tests/core/test_lifecycle.py tests/core/test_provenance.py tests/core/test_navigation_readiness.pyplus the slow multi-process suite (spawns real interpreters):
uv run pytest -q tests/core/test_multiprocess_rebuild.pyKey suites and what they pin: tests/core/index/test_writer_contract.py (constant + invariant
list), test_schema_migration.py, test_handle_integrity.py,
tests/core/watch/test_writer_contract.py, tests/core/test_lifecycle.py (every repair trigger
has a named reason; stale daemon stopped before rebuild), test_navigation_readiness.py
(healthy path stays read-only and cheap), test_multiprocess_rebuild.py (stale fingerprint
rebuilds exactly once under concurrency).
5. Docs
Update the invariant/bump-rule prose in AGENTS.md and docs/architecture.md if the rule
itself changed, and add a CHANGELOG.md [Unreleased] entry for anything user-visible
(a forced rebuild counts as user-visible).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

