Documentation
¶
Overview ¶
Package archive implements M8.3 (方案 §14.2): conservative archiving of the append-only JSONL streams — project events and run streams — to keep the working tree small without losing history.
Archive layout (all committed, all ordinary files):
.devsys/archive/events/<YYYY-MM>.jsonl archived event shards .devsys/archive/runs/<run-id>.jsonl archived run streams .devsys/archive/manifest.yaml what moved, when, by whom
Reads merge live and archived state: events.Read covers both shard trees, readRunStream-equivalents fall back to the archived stream when the live one is gone. Search excludes archive/ (current-state retrieval only). There is deliberately no delete/purge shape: dropping archived history is a manual git operation (默认保守:不删,只归档).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PlanEvents ¶
PlanEvents lists the live event shards strictly older than beforeMonth (YYYY-MM, zero-padded so lexical order is chronological).
Types ¶
type Entry ¶
type Entry struct {
Kind string `json:"kind" yaml:"kind"` // "events" | "run_stream"
Source string `json:"source" yaml:"source"`
SHA256 string `json:"sha256" yaml:"sha256"`
Bytes int64 `json:"bytes" yaml:"bytes"`
Lines int `json:"lines" yaml:"lines"`
ArchivedAt string `json:"archived_at" yaml:"archived_at"`
ArchivedBy string `json:"archived_by" yaml:"archived_by"`
Reason string `json:"reason" yaml:"reason"`
}
Entry records one archived file: the pointer that keeps history queryable.
type Manifest ¶
type Manifest struct {
SchemaVersion int `json:"schema_version" yaml:"schema_version"`
Entries []Entry `json:"entries" yaml:"entries"`
}
Manifest is the archive catalogue.
type Report ¶
type Report struct {
Archived []string `json:"archived"`
Skipped []string `json:"skipped,omitempty"`
BytesArchived int64 `json:"bytes_archived"`
BytesBefore int64 `json:"bytes_before"`
BytesAfter int64 `json:"bytes_after"`
Manifest Manifest `json:"manifest"`
DryRun bool `json:"dry_run,omitempty"`
Note string `json:"note,omitempty"`
}
Report is what an archive run moved.