Repository navigation
feat: add atomic-facade — native API layer over command-level reads - #152
Closed
vinceblock99 wants to merge 4 commits into
Closed
vinceblock99 wants to merge 4 commits into
vinceblock99 wants to merge 4 commits into
Conversation
Adds a library crate exposing the read operations behind the CLI as callable functions with serde-serializable DTOs, so a server can link them in-process instead of shelling out to the atomic binary: - change_detail / list_log with hash / prefix / #seq / @ identifier resolution (mirrors atomic change/log -f json field-for-field) - list_views / view_summary (ViewInfo as JSON with scope + parent) - list_intents / intent_detail and list_memories / memory_detail, including the tracked-entry-then-legacy-sidecar attestation dual-read with Fresh/Stale classification promoted from the CLI bridges The CLI keeps its own copies for now; migrating atomic-cli onto the facade is a follow-up refactor.
- Scope the CLI-interchangeability doc claim to changes/log; the view/intent/memory DTOs are new richer shapes, not a CLI contract - Propagate resolver infrastructure errors instead of mapping every resolve_intent_key failure to NotFound (a DB error is a 500, not 404) - An existing-but-unreadable attestation sidecar is a hard IO error again (CLI parity), not silently 'no attestation' - Reject '@~N' with the CLI's explicit not-yet-supported message - Drop needless clones in the detail/summary builders
Team decision: Atomic's strength is that everything a client needs is on the laptop — the storage server is primarily transport, and any server-side read surface is a separate, deliberate call. Frame the crate for its real consumers (local UIs, tools, agent harnesses) and drop the retired atomic-enterprise reference.
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.
What
A new library crate,
atomic-facade, that exposes the read operations behind the CLI as plain functions returning serde-serializable DTOs:change_detail/list_log— whatatomic change -f json/atomic log -f jsonprint, including hash / prefix /#seq/@identifier resolutionlist_views/view_summary— view state, scope, parent, change countslist_intents/intent_detail,list_memories/memory_detail— including the attestation dual-read (tracked vault entry first, legacy sidecar fallback, fresh/stale classification)Additive only — no existing crate changes beyond registering the workspace member.
Why
Everything an integration needs is already on the laptop, inside the repo — but today the only way for a local UI, tool, or agent harness to read it is shelling out to the
atomicbinary and parsing its output, because the best JSON shapes and the attestation/identifier plumbing are trapped inside theatomic-clibinary. This crate makes those reads a typed, in-process library call.Deliberately not a server contract: Atomic is local-first and the storage server is primarily transport. Whether any of this ever gets exposed server-side is a separate, intentional decision — this crate neither implies nor requires it.
For changes/log, JSON field names mirror the CLI's
-f jsonoutput exactly, so serialized responses and CLI output stay interchangeable.Notes
atomic-clionto the facade (removing the duplication) is a planned follow-up PR.Test plan
cargo test -p atomic-facade) covering identifier forms, list/detail round-trips, not-found mapping, JSON serializationcargo check --workspaceandcargo clippy -p atomic-facadeclean