Documentation
¶
Overview ¶
Package fsstore is a reference, test-only persistent checkpoint backend that stores checkpoints as JSON files on disk. It exists to exercise the pluggable backend seam (registry + mirror fan-out) with a real, non-git implementation of the api/checkpoint contract, and to serve as a worked example for new backends.
It is deliberately NOT registered by production code: only a test-only helper (registerForTesting, in register_test.go) wires it into the checkpoint registry, so a production binary can never select it. As a mirror it receives best-effort write fan-out; it intentionally ignores the git-specific blob-hash fields of the contract and stores transcript bytes directly, which keeps the example small and makes the contract's remaining git leakage concrete.
It is faithful to the contract's per-session metadata and write-request semantics — including prompt and summary redaction via the shared checkpoint helpers — but it does not replicate two git-writer behaviors: cross-session aggregation (the root summary's TokenUsage reflects the latest session, not a sum) and derived stamps the git writer adds (CLI version, skill-events version). Neither is needed to validate the pluggable seam.
Index ¶
- type Store
- func (s *Store) List(_ context.Context) ([]cp.CheckpointInfo, error)
- func (s *Store) Read(_ context.Context, checkpointID id.CheckpointID) (*cp.CheckpointSummary, error)
- func (s *Store) ReadSessionContent(_ context.Context, checkpointID id.CheckpointID, sessionIndex int) (*cp.SessionContent, error)
- func (s *Store) ReadSessionMetadata(_ context.Context, checkpointID id.CheckpointID, sessionIndex int) (*cp.Metadata, error)
- func (s *Store) ReadSessionMetadataAndPrompts(_ context.Context, checkpointID id.CheckpointID, sessionIndex int) (*cp.Metadata, string, error)
- func (s *Store) ReadSessionPrompts(_ context.Context, checkpointID id.CheckpointID, sessionIndex int) (string, error)
- func (s *Store) Write(_ context.Context, req cp.WriteRequest) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a JSON-file-backed persistent checkpoint store. One file per checkpoint (<root>/<checkpoint-id>.json) holds the root summary plus all session content.
func (*Store) Read ¶
func (s *Store) Read(_ context.Context, checkpointID id.CheckpointID) (*cp.CheckpointSummary, error)
Read returns the checkpoint summary, or (nil, nil) when absent so the contract helper normalizes it to ErrCheckpointNotFound.
func (*Store) ReadSessionContent ¶
func (s *Store) ReadSessionContent(_ context.Context, checkpointID id.CheckpointID, sessionIndex int) (*cp.SessionContent, error)