Documentation
¶
Index ¶
- Constants
- func FormatTuneReport(report *FSRSTuneReport) string
- func TrustStageLabel(stage int) string
- type Dependency
- type EpisodeWriteAuthority
- type FSRSTuneReport
- type FactSearchOptions
- type FactVerificationResult
- type FactWriteAuthority
- type Filter
- type RecallRequest
- type RecallResult
- type Vault
- func (v *Vault) AddDependency(missionSlug, depSlug, depType string) error
- func (v *Vault) AnalyzeFSRS() (*FSRSTuneReport, error)
- func (v *Vault) ApplyTuneReport(report *FSRSTuneReport) error
- func (v *Vault) ArchiveStaleFacts(threshold float64) (int, error)
- func (v *Vault) AuditWikiLinks(write bool) (*WikiLinkAudit, error)
- func (v *Vault) CanStart(missionSlug string) (bool, []string, error)
- func (v *Vault) CheckAutoCompletion(completedSlug string) ([]string, error)
- func (v *Vault) CreateMission(title, description, priority string) (string, error)
- func (v *Vault) DecayAllBeliefs() (int, error)
- func (v *Vault) DecayFacts() (int, error)
- func (v *Vault) FindCorrections(query string) ([]*markdown.Document, error)
- func (v *Vault) FormatCorrectionHints(query string) string
- func (v *Vault) FormatTraceHints(query string) string
- func (v *Vault) GetBelief(relPath string) (*markdown.Document, error)
- func (v *Vault) GetDependencies(missionSlug string) ([]map[string]interface{}, error)
- func (v *Vault) GetEntity(name string) (*markdown.Document, error)
- func (v *Vault) GetMission(slug string) (*markdown.Document, error)
- func (v *Vault) GetPR(slug string) (*markdown.Document, error)
- func (v *Vault) GetTrustStage() (int, map[string]interface{}, error)
- func (v *Vault) List(subdir string, filters ...Filter) ([]*markdown.Document, error)
- func (v *Vault) ListBeliefs(subject string, limit int) ([]*markdown.Document, error)
- func (v *Vault) ListBlueprints(limit int) ([]*markdown.Document, error)
- func (v *Vault) ListCorrections(limit int) ([]*markdown.Document, error)
- func (v *Vault) ListEntities() ([]*markdown.Document, error)
- func (v *Vault) ListFacts(subject string, limit int) ([]*markdown.Document, error)
- func (v *Vault) ListMissions(status string, limit int) ([]*markdown.Document, error)
- func (v *Vault) ListPRs(status string) ([]*markdown.Document, error)
- func (v *Vault) ListTraces(limit int) ([]*markdown.Document, error)
- func (v *Vault) LoadTunedFSRS() error
- func (v *Vault) MergePR(relPath, closedBy string) error
- func (v *Vault) MissionBoard() map[string][]*markdown.Document
- func (v *Vault) OpenPR(title, openedBy, targetType, targetID string, reasoning string, ...) (string, error)
- func (v *Vault) Path(parts ...string) string
- func (v *Vault) Read(relPath string) (*markdown.Document, error)
- func (v *Vault) RecallFacts(req RecallRequest) (RecallResult, error)
- func (v *Vault) ReinforceBelief(relPath, source string) error
- func (v *Vault) ReinforceFact(relPath string) error
- func (v *Vault) RejectPR(relPath, closedBy, reason string) error
- func (v *Vault) RemoveDependency(missionSlug, depSlug string) error
- func (v *Vault) ResolveWikiLink(link string) string
- func (v *Vault) SaveTuneReport(report *FSRSTuneReport) (string, error)
- func (v *Vault) Search(query string, limit int) ([]index.SearchResult, error)
- func (v *Vault) SearchFacts(query string, limit int) ([]string, error)
- func (v *Vault) SearchFactsWithOptions(query string, limit int, opts FactSearchOptions) ([]string, error)
- func (v *Vault) SearchTraces(query string, limit int) ([]*markdown.Document, error)
- func (v *Vault) SetTrustStage(stage int, updatedBy, reason string) error
- func (v *Vault) ShipClock() (map[string]interface{}, error)
- func (v *Vault) ShipClockJSON() (string, error)
- func (v *Vault) Status() map[string]interface{}
- func (v *Vault) StatusJSON() (string, error)
- func (v *Vault) StoreCorrection(original, corrected, context, createdBy string) (string, error)
- func (v *Vault) StoreEpisodeGoverned(body string, auth EpisodeWriteAuthority) (string, string, error)
- func (v *Vault) StoreFact(subject, predicate, value string, confidence float64, importance string) (string, error)
- func (v *Vault) StoreFactGoverned(subject, predicate, value string, confidence float64, importance string, ...) (string, error)
- func (v *Vault) StoreTrace(task, outcome string, steps []string, durationSec float64, toolsUsed []string, ...) (string, error)
- func (v *Vault) TouchFact(relPath string) error
- func (v *Vault) WeakenBelief(relPath string) error
- func (v *Vault) Write(relPath string, fm map[string]interface{}, body string) error
- type WikiLinkAudit
- type WikiLinkIssue
- type WikiLinkRewrite
Constants ¶
const ( HotMemoryAdmissionCap = 12 HotMemoryStaleReviewDays = 30 HotMemoryReviewArtifactDir = "memory/maintenance" ElderMemoryCap = 24 ElderMemoryStaleReviewDays = 365 )
const ( VerificationModeCritical = "critical" VerificationStatusVerified = "verified" VerificationStatusReviewRequired = "review_required" VerificationStatusMismatch = "mismatch" VerificationStatusUnverified = "unverified" VerificationStatusSourceMissing = "source_missing" )
Variables ¶
This section is empty.
Functions ¶
func FormatTuneReport ¶ added in v0.5.0
func FormatTuneReport(report *FSRSTuneReport) string
FormatTuneReport formats the analysis as a human-readable report.
func TrustStageLabel ¶
TrustStageLabel returns a human-readable label for a trust stage.
Types ¶
type Dependency ¶
type Dependency struct {
Slug string `json:"slug"`
Type string `json:"type"` // blocks, informs, enhances
}
Dependency represents a typed relationship between missions.
type EpisodeWriteAuthority ¶ added in v0.5.0
type EpisodeWriteAuthority struct {
ProducingOffice string
ProducingSubsystem string
StaffingContext string
AuthorityScope string
TargetDomain string
Source string
SourceRef string
SourceRefs []string
ProofRef string
PromotionStatus string
EventID string
LineageID string
EventKind string
Subject string
CueTerms []string
AllowApproval bool
Mission string
WorkItemID string
Environment string
MemorySecurityClass string
RelatedFactPaths []string
RelatedEpisodePaths []string
RelatedEntityRefs []string
RelatedMissionRefs []string
}
EpisodeWriteAuthority describes the authority and provenance behind an episodic memory write. Episodes preserve raw or near-raw traces and are the barcode-like identity surface behind later semantic memory.
type FSRSTuneReport ¶ added in v0.5.0
type FSRSTuneReport struct {
TotalFacts int
ByImportance map[string]*importanceBucket
GeneratedAt time.Time
Proposals map[string]fsrsProposal
}
FSRSTuneReport holds the analysis of current FSRS behavior.
type FactSearchOptions ¶ added in v0.5.0
type FactVerificationResult ¶ added in v0.5.0
type FactWriteAuthority ¶ added in v0.5.0
type FactWriteAuthority struct {
ProducingOffice string
ProducingSubsystem string
StaffingContext string
AuthorityScope string
TargetDomain string
Source string
SourceRef string
SourceRefs []string
ProofRef string
PromotionStatus string
MemoryTemperature string
AllowApproval bool
SourceEventID string
LineageID string
CueTerms []string
Mission string
WorkItemID string
Environment string
MemoryProtectionClass string
MemorySecurityClass string
ObservedAt string
ValidFrom string
ValidTo string
TemporalStatus string
SupersedesPaths []string
RelatedFactPaths []string
RelatedEpisodePaths []string
RelatedEntityRefs []string
RelatedMissionRefs []string
}
FactWriteAuthority describes the declared authority behind a canonical fact write.
type Filter ¶
type Filter struct {
Field string
Value string
Exclude bool // if true, exclude matches instead of including
}
Filter constrains List results by frontmatter field.
type RecallRequest ¶ added in v0.5.0
type RecallRequest struct {
Query string
Limit int
Options FactSearchOptions
Harness string
Adapter string
Mode string
ProducingOffice string
ProducingSubsystem string
StaffingContext string
WorkItemID string
}
RecallRequest describes a harness-level retrieval attempt. Unlike plain search, a recall request is durable proof that memory was consulted under a specific mode, through a specific adapter, with a bounded result set.
type RecallResult ¶ added in v0.5.0
type RecallResult struct {
RecallID string
ReceiptPath string
Lines []string
ResultPaths []string
Verification []FactVerificationResult
LinkedFactPaths []string
LinkedEpisodePaths []string
LinkedEntityRefs []string
LinkedMissionRefs []string
}
RecallResult is the durable result of a recall operation, including the human-usable lines returned to the caller and the receipt artifact path.
type Vault ¶
Vault provides unified access to the entire vault — brain, memory, atlas, missions.
func (*Vault) AddDependency ¶
AddDependency adds a typed dependency to a mission's frontmatter. depType must be "blocks", "informs", or "enhances".
func (*Vault) AnalyzeFSRS ¶ added in v0.5.0
func (v *Vault) AnalyzeFSRS() (*FSRSTuneReport, error)
AnalyzeFSRS scans all facts and computes retention statistics per importance tier. Returns a report with over-retained and over-forgotten counts plus proposed adjustments. This is advisory only — it does not modify any configuration.
func (*Vault) ApplyTuneReport ¶ added in v0.5.0
func (v *Vault) ApplyTuneReport(report *FSRSTuneReport) error
ApplyTuneReport promotes a tuning report's proposals into the active FSRS config. Writes the new config to memory/fsrs-config.md with a reference to the source report. This is the explicit apply step — it must be called separately from analysis.
func (*Vault) ArchiveStaleFacts ¶
ArchiveStaleFacts marks facts below a confidence threshold as archived. Returns the number of facts archived.
func (*Vault) AuditWikiLinks ¶ added in v0.5.0
func (v *Vault) AuditWikiLinks(write bool) (*WikiLinkAudit, error)
func (*Vault) CanStart ¶
CanStart checks if all blocking dependencies are satisfied. Returns (canStart, list of unsatisfied blockers).
func (*Vault) CheckAutoCompletion ¶
CheckAutoCompletion checks if any group-archetype missions should auto-complete after the given mission was completed. Returns slugs of auto-completed missions.
func (*Vault) CreateMission ¶
CreateMission writes a new mission .md file.
func (*Vault) DecayAllBeliefs ¶
DecayAllBeliefs sweeps all belief files in atlas/beliefs/ and applies per-predicate linear confidence decay. Returns the number of beliefs updated.
func (*Vault) DecayFacts ¶
DecayFacts sweeps all fact files and applies FSRS-based confidence decay. Confidence = retrievability R(t) = (1 + t/(9*S))^(-1), floored per importance. Returns the number of facts updated.
func (*Vault) FindCorrections ¶ added in v0.5.0
FindCorrections scans memory/corrections/ for corrections whose original field matches the query. Returns matching correction documents.
func (*Vault) FormatCorrectionHints ¶ added in v0.5.0
FormatCorrectionHints formats matching corrections as search-time annotations. These are prepended to search results as hints, not silent rewrites.
func (*Vault) FormatTraceHints ¶ added in v0.5.0
FormatTraceHints formats matching traces as search-time annotations for inclusion in memory_search results.
func (*Vault) GetDependencies ¶
GetDependencies returns a mission's dependencies with satisfaction status.
func (*Vault) GetMission ¶
GetMission finds a mission by slug or title.
func (*Vault) GetTrustStage ¶
GetTrustStage reads the current trust stage from vault/atlas/trust.md. Returns the stage (1-3), the full frontmatter config, and any error.
func (*Vault) ListBeliefs ¶
ListBeliefs returns beliefs, optionally filtered by subject.
func (*Vault) ListBlueprints ¶
ListBlueprints returns mission blueprints.
func (*Vault) ListCorrections ¶ added in v0.5.0
ListCorrections returns all correction documents, most recent first.
func (*Vault) ListEntities ¶
ListEntities returns all entity documents from atlas/entities/.
func (*Vault) ListMissions ¶
ListMissions returns missions filtered by status.
func (*Vault) ListTraces ¶ added in v0.5.0
ListTraces returns recent traces, most recent first.
func (*Vault) LoadTunedFSRS ¶ added in v0.5.0
LoadTunedFSRS reads memory/fsrs-config.md and overrides the default FSRS parameters. Called at startup. If the file doesn't exist, defaults are used.
func (*Vault) MergePR ¶
MergePR marks a PR as merged and reinforces all linked beliefs. Only the operator should call this — MODUS never closes its own PRs.
func (*Vault) MissionBoard ¶
MissionBoard returns missions grouped by status.
func (*Vault) OpenPR ¶
func (v *Vault) OpenPR(title, openedBy, targetType, targetID string, reasoning string, confidence float64, linkedBeliefIDs []string) (string, error)
OpenPR creates a new PR (evolution proposal) in vault/atlas/prs/. Returns the relative path of the created PR file.
func (*Vault) RecallFacts ¶ added in v0.5.0
func (v *Vault) RecallFacts(req RecallRequest) (RecallResult, error)
func (*Vault) ReinforceBelief ¶
ReinforceBelief boosts the confidence of a belief file. Independent source: +0.05, same source: +0.02. Capped at 1.0.
func (*Vault) ReinforceFact ¶
ReinforceFact increases a fact's confidence and stability after a successful recall. This is the FSRS "review" operation — accessing a fact proves it's still relevant, so stability grows and confidence resets toward 1.0.
func (*Vault) RemoveDependency ¶
RemoveDependency removes a dependency from a mission.
func (*Vault) ResolveWikiLink ¶
ResolveWikiLink finds the .md file matching a [[wiki-link]].
func (*Vault) SaveTuneReport ¶ added in v0.5.0
func (v *Vault) SaveTuneReport(report *FSRSTuneReport) (string, error)
SaveTuneReport writes a versioned tuning report to memory/fsrs-tuning/. Reports are never overwritten — each analysis gets its own timestamped file.
func (*Vault) Search ¶
Search performs full-text search across the index. Returns empty results if no index is loaded.
func (*Vault) SearchFacts ¶
SearchFacts searches memory facts via FTS, filtering to memory/facts/ paths. Falls back to listing all facts if no index is loaded.
func (*Vault) SearchFactsWithOptions ¶ added in v0.5.0
func (*Vault) SearchTraces ¶ added in v0.5.0
SearchTraces searches memory/traces/ for traces matching the query. Uses the index if available, falls back to substring matching.
func (*Vault) SetTrustStage ¶
SetTrustStage updates the trust stage. Only the operator should call this — MODUS never self-promotes. Appends a transition record to the history in the body.
func (*Vault) ShipClockJSON ¶
ShipClockJSON returns ShipClock as formatted JSON.
func (*Vault) StatusJSON ¶
StatusJSON returns Status() as formatted JSON.
func (*Vault) StoreCorrection ¶ added in v0.5.0
StoreCorrection writes a correction pattern to memory/corrections/. Corrections are search-time annotations — they never rewrite canonical facts. The original phrasing is matched against future queries to surface the corrected version.
func (*Vault) StoreEpisodeGoverned ¶ added in v0.5.0
func (v *Vault) StoreEpisodeGoverned(body string, auth EpisodeWriteAuthority) (string, string, error)
StoreEpisodeGoverned writes a first-class episodic memory object. Episodes are append-only raw or near-raw traces that later semantic memory can cite by source_event_id and lineage_id.
func (*Vault) StoreFact ¶
func (v *Vault) StoreFact(subject, predicate, value string, confidence float64, importance string) (string, error)
StoreFact writes a new memory fact as a .md file.
func (*Vault) StoreFactGoverned ¶ added in v0.5.0
func (v *Vault) StoreFactGoverned(subject, predicate, value string, confidence float64, importance string, auth FactWriteAuthority) (string, error)
StoreFactGoverned writes a canonical fact only after the trust gate has classified the declared authority and, when permitted, records the decision in the ledger.
func (*Vault) StoreTrace ¶ added in v0.5.0
func (v *Vault) StoreTrace(task, outcome string, steps []string, durationSec float64, toolsUsed []string, createdBy, model string) (string, error)
StoreTrace writes a task execution trace to memory/traces/. Traces are provenance-rich procedural memory — they record what was tried, what worked, and what failed, with full attribution.
func (*Vault) WeakenBelief ¶
WeakenBelief reduces the confidence of a belief by 0.10, with a floor of 0.05.
type WikiLinkAudit ¶ added in v0.5.0
type WikiLinkAudit struct {
Documents int
Links int
Rewrites []WikiLinkRewrite
Issues []WikiLinkIssue
UpdatedDocs int
}