-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Problem
Releases are currently stored under .synix/releases/<name>/ where <name> comes from --to local. Releasing twice to the same name overwrites the previous release — history is only preserved in a history/ subdirectory of receipt JSONs, but the actual materialized artifacts (search.db, context.md) are lost.
Additionally, pipeline.build_dir is a misnomer — nothing is written to it during synix build. It's only used as an anchor to locate .synix/ via synix_dir_for_build_dir(). The FlatFile adapter's default output_path="./build/context.md" further confuses this by writing outside .synix/.
Proposed Layout
.synix/releases/
├── <snapshot-oid>/ # immutable, snapshot-addressed
│ ├── search.db
│ ├── context.md
│ └── receipt.json
├── HEAD -> <latest-oid>/ # symlink to most recent release
└── local -> <oid>/ # named alias (from --to local)
Every release is immutable by snapshot ID. Named targets (local, prod) become symlinks. Re-releasing to the same name just repoints the symlink. Old releases are preserved and addressable.
What Changes
release_engine.py— write toreleases/<snapshot_oid>/, create/update symlink for named targetsearch/adapter.py,flat_file_adapter.py— no change needed (they write totarget_pathwhich is passed in)synix search --release <name>— resolve symlink, same behaviorsynix releases list— show both snapshot-addressed releases and named aliasessynix revert <ref> --to <name>— repoint symlink to existing snapshot release (instant if already materialized)- SDK
Releaseclass — resolve symlinks transparently pipeline.build_dir— consider renaming toproject_diror removing entirely (separate from this, but related naming confusion)
Context
Surfaced during review of #96 (Chunk transform PR). Both the OpenAI and Claude automated reviewers flagged the build_dir naming confusion. The snapshot-addressed layout would also make synix revert instant when the target snapshot was previously released.