Documentation
¶
Overview ¶
Package lineage stores portable causal history beside native agent transcripts. Native files stay vendor-owned; receipts describe their exact logical coverage.
Index ¶
- Constants
- func PathFor(main string) string
- func Subset(a, b map[ir.NodeID]bool) bool
- type Branch
- type CodeHop
- type Compensation
- type Hop
- type Journey
- type Manifest
- func (m *Manifest) ActiveHops() []Hop
- func (m *Manifest) AdoptNativeFork(parent ReplicaID, child Replica, proof []agent.NativeInheritance, ...) (*Manifest, error)
- func (m *Manifest) AppendHop(h Hop) error
- func (m *Manifest) Clone() *Manifest
- func (m *Manifest) Covered(heads []ir.NodeID) map[ir.NodeID]bool
- func (m *Manifest) Deliver(replica ReplicaID, cursor ir.Cursor, projection []ir.Projection, ...) State
- func (m *Manifest) Departed(current ReplicaID) (Hop, bool)
- func (m *Manifest) Departure(current ReplicaID) (Hop, bool)
- func (m *Manifest) Encode() []byte
- func (m *Manifest) Find(key agent.SessionKey, location string) (Replica, ReplicaID, bool)
- func (m *Manifest) FindBinding(key agent.SessionKey, endpoint, binding string) (Replica, ReplicaID, bool)
- func (m *Manifest) FindEndpoint(key agent.SessionKey, endpoint string) (Replica, ReplicaID, bool)
- func (m *Manifest) FindOnBranch(key agent.SessionKey, location, line string) (Replica, ReplicaID, bool)
- func (m *Manifest) ForBranch(branch string) *Manifest
- func (m *Manifest) Fork(id string, heads []ir.NodeID) string
- func (m *Manifest) HasReplica(id ReplicaID) bool
- func (m *Manifest) Heads(ids []ir.NodeID) []ir.NodeID
- func (m *Manifest) Journey() Journey
- func (m *Manifest) LastHopTo(id ReplicaID) (Hop, bool)
- func (m *Manifest) LatestState(id ReplicaID) (State, bool)
- func (m *Manifest) Merge(o *Manifest) error
- func (m *Manifest) Observe(replica ReplicaID, seg *ir.Segment) (State, error)
- func (m *Manifest) ObserveBinding(r Replica, seg *ir.Segment) (ReplicaID, State, error)
- func (m *Manifest) OrderedHops() []Hop
- func (m *Manifest) ReplaceProjection(replica ReplicaID, cursor ir.Cursor, projection []ir.Projection, ...) State
- func (m *Manifest) Replica(id ReplicaID) Replica
- func (m *Manifest) ReturnReplicas(current ReplicaID) []Replica
- func (m *Manifest) State(id StateID) State
- func (m *Manifest) UndoOperation(id string) error
- func (m *Manifest) Upsert(r Replica) ReplicaID
- func (m *Manifest) Validate() error
- type Range
- type Replica
- type ReplicaID
- type Revision
- type Rollover
- type State
- type StateID
Constants ¶
const ( HopMove = "move" HopContinue = "continue" HopHandoff = "handoff" HopFetch = "fetch" )
const Format = "lineage/5"
const Suffix = ".hopsesh.json"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CodeHop ¶ added in v0.4.0
type CodeHop struct {
Way agent.CodeWay `json:"way"`
Remote string `json:"remote,omitempty"`
Branch string `json:"branch,omitempty"`
Base string `json:"base,omitempty"`
Snapshot string `json:"snapshot,omitempty"`
Withheld []string `json:"withheld,omitempty"`
Redactions int `json:"redactions,omitempty"`
}
type Compensation ¶ added in v0.4.0
type Hop ¶
type Hop struct {
Notify bool `json:"notify,omitempty"` // optional source notice; never conversation work
Rollover *Rollover `json:"rollover,omitempty"`
ID string `json:"id"`
Parents []string `json:"parents,omitempty"`
Line string `json:"line"`
Time time.Time `json:"time"`
From ReplicaID `json:"from"`
To ReplicaID `json:"to"`
Source StateID `json:"source,omitempty"`
Target StateID `json:"target,omitempty"`
Kind string `json:"kind"`
Fork bool `json:"fork,omitempty"`
Backup bool `json:"backup,omitempty"`
Fidelity string `json:"fidelity,omitempty"`
Written *Range `json:"written,omitempty"`
Code *CodeHop `json:"code,omitempty"`
}
type Journey ¶ added in v0.4.0
type Journey struct {
MachineTransfers int `json:"machineTransfers"`
MachineRoundTrips int `json:"machineRoundTrips"`
MachineReturns int `json:"machineReturns"`
OriginProfile string `json:"originProfile,omitempty"`
ParentBranch string `json:"parentBranch,omitempty"`
Origin string `json:"origin,omitempty"`
Transfers int `json:"transfers"`
RoundTrips int `json:"roundTrips"`
Returns int `json:"returns"`
Fork bool `json:"fork"`
Branch string `json:"branch"`
Family string `json:"family"`
}
type Manifest ¶
type Manifest struct {
Format string `json:"hopsesh"`
Family string `json:"family"`
Branch string `json:"branch"` // branch of the native session beside this manifest
Branches []Branch `json:"branches"`
Replicas []Replica `json:"replicas"`
Revisions []Revision `json:"revisions"`
States []State `json:"states"`
Hops []Hop `json:"hops"`
Compensations []Compensation `json:"compensations,omitempty"`
}
func (*Manifest) ActiveHops ¶ added in v0.4.0
ActiveHops excludes undone operations and implementation-only native backups. OrderedHops supplies causal ordering; wall-clock timestamps are not authorities.
func (*Manifest) AdoptNativeFork ¶ added in v0.4.0
func (m *Manifest) AdoptNativeFork(parent ReplicaID, child Replica, proof []agent.NativeInheritance, seg *ir.Segment) (*Manifest, error)
AdoptNativeFork requires module-verified native inheritance. It returns a new branch view without modifying the parent's manifest or its native session.
func (*Manifest) Deliver ¶ added in v0.4.0
func (m *Manifest) Deliver(replica ReplicaID, cursor ir.Cursor, projection []ir.Projection, heads []ir.NodeID, loss []string) State
Deliver records the destination's own receipt. It acknowledges only this replica, keeping all provenance and losses; another destination's receipt is unaffected.
func (*Manifest) Departed ¶ added in v0.4.2
Departed returns where a replica's branch went after it: the latest hop on its line, when the replica left that line and has not been returned to since. It is the committed movement record, whether or not the move asked for a notice; a fork leaves its parent current and is not a departure.
func (*Manifest) Departure ¶ added in v0.4.0
Departure returns the latest unambiguous route away from a replica. A return clears it. Fork notices describe a separate branch and never retire the parent.
func (*Manifest) FindBinding ¶ added in v0.4.2
func (m *Manifest) FindBinding(key agent.SessionKey, endpoint, binding string) (Replica, ReplicaID, bool)
FindBinding selects the current segment of one physical session without confusing it with its retained historical login segments.
func (*Manifest) FindEndpoint ¶ added in v0.4.0
func (*Manifest) FindOnBranch ¶ added in v0.4.0
func (*Manifest) HasReplica ¶ added in v0.4.0
func (*Manifest) LatestState ¶ added in v0.4.0
func (*Manifest) Observe ¶ added in v0.4.0
Observe validates previously delivered native anchors, then registers only newly authored records. Imported nodes retain their logical origins through every hop.
func (*Manifest) ObserveBinding ¶ added in v0.4.0
ObserveBinding starts a new replica segment when the login bound to a root changes. Native anchors verify inherited history; old revisions retain their original author. This never grants permission to replay protected native data across accounts.
func (*Manifest) OrderedHops ¶ added in v0.4.0
func (*Manifest) ReplaceProjection ¶ added in v0.4.0
func (m *Manifest) ReplaceProjection(replica ReplicaID, cursor ir.Cursor, projection []ir.Projection, heads []ir.NodeID, loss []string) State
ReplaceProjection is a verified native replacement, not an append receipt.
func (*Manifest) ReturnReplicas ¶ added in v0.4.0
ReturnReplicas lists destinations actually visited by this branch before the selected replica's latest arrival. A sibling's or parent's history is not a return.
func (*Manifest) UndoOperation ¶ added in v0.4.0
type Replica ¶
type Replica struct {
Binding string `json:"binding,omitempty"`
ID ReplicaID `json:"id"`
Key agent.SessionKey `json:"key"`
Endpoint string `json:"endpoint"`
Location string `json:"location"`
Line string `json:"line"`
AgentVersion string `json:"agentVersion,omitempty"`
// Native checkpoints are derived from immutable states, never merge authorities.
Head ir.NodeID `json:"-"`
Offset int64 `json:"-"`
Time time.Time `json:"time"`
URL string `json:"url,omitempty"`
Branch string `json:"branch,omitempty"` // code branch, independent of conversation Line
}
type Rollover ¶ added in v0.4.0
Rollover records the unchanged replica retained when its active context was full.
type State ¶ added in v0.4.0
type State struct {
ID StateID `json:"id"`
Replica ReplicaID `json:"replica"`
Parents []StateID `json:"parents,omitempty"`
Head ir.NodeID `json:"head,omitempty"`
Offset int64 `json:"offset"`
Heads []ir.NodeID `json:"heads,omitempty"`
Projection []ir.Projection `json:"projection,omitempty"`
Loss []string `json:"loss,omitempty"`
}