Documentation
¶
Overview ¶
Package memorycapture persists immutable capture inputs and caller-reported attempt evidence and acknowledged processing receipts. It does not execute agents.
Index ¶
- Variables
- type Batch
- type Identity
- type Message
- type MessageRevision
- type Payload
- type Receipt
- type Store
- func (s *Store) Acknowledge(ctx context.Context, id Identity, batch string) (*Receipt, error)
- func (s *Store) Close() error
- func (s *Store) Complete(ctx context.Context, id Identity, current []Message, closure *uint64) (bool, error)
- func (s *Store) Pending(ctx context.Context, id Identity) (*Batch, error)
- func (s *Store) Publish(ctx context.Context, id Identity, p Payload) (*Batch, error)
- func (s *Store) Receipts(ctx context.Context, id Identity) ([]Receipt, error)
- func (s *Store) Report(ctx context.Context, id Identity, batch string, paths []string) error
- func (s *Store) Unprocessed(ctx context.Context, id Identity, current []Message) ([]Message, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Batch ¶
Batch contains immutable input and a separately updated attempt-evidence union. All returned data is detached from storage and from other callers.
type Identity ¶
type Identity struct{ Vault, Conversation, Generation string }
Identity uses the canonical vault path and exporter-owned conversation and transcript generation. A routing ID alone cannot identify a generation.
type Message ¶
type Message struct{ ID, Revision, Text, Timestamp, Speaker, Agent, Session string }
Message preserves exporter-owned row identity, text revision and attribution. Revision must change whenever text on the same stable row changes.
type MessageRevision ¶
type MessageRevision struct{ ID, Revision string }
MessageRevision identifies processed text on one exporter-owned stable row. Opaque revisions have no ordering; distinct revisions are independent work.
type Payload ¶
type Payload struct {
Agent, Model string
Messages []Message
Metadata json.RawMessage
LastTextEntry, LastDeliveredEntry uint64
ClosingEntry *uint64
}
Payload is frozen at first publication. Metadata carries additional structured exporter input. ClosingEntry is independent of delivered and eligible text.
type Receipt ¶
type Receipt struct {
BatchID string
Identity Identity
Processed []MessageRevision
LastTextEntry, LastDeliveredEntry uint64
ClosingEntry *uint64
ChangedPaths []string
}
Receipt acknowledges processing, not that every statement became a fact. ChangedPaths includes durable reports from failed attempts as well as success. All values are detached from storage and other callers.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store holds a private state directory. Operations are safe across concurrent handles/processes; Close waits for this handle's active operations.
func New ¶
New opens state below home/.pyry/memory/capture without following symlinks. The caller supplies the account home directory, not the notes vault.
func (*Store) Acknowledge ¶
Acknowledge atomically moves the matching pending batch into durable history. The caller must authorize execution success; failures should leave it pending. Replay returns the historical receipt without changing newer pending work. Errors return no receipt, even if rename committed before a later sync failed.
func (*Store) Complete ¶
func (s *Store) Complete(ctx context.Context, id Identity, current []Message, closure *uint64) (bool, error)
Complete requires the current closure acknowledged, all current eligible revisions processed, and no pending batch. An open transcript is never final. Later eligible text or an edited row invalidates completion without changing historical receipts or the exporter-owned closure marker.
func (*Store) Publish ¶
Publish durably publishes a payload or returns the existing pending batch. A nil batch accompanies every error, including ambiguous post-rename failures, and successful publication of an already acknowledged payload.
func (*Store) Receipts ¶
Receipts returns acknowledgement-order history for one canonical vault/conversation/transcript-generation identity.