Versions in this module Expand all Collapse all v0 v0.1.6 Oct 11, 2026 Changes in this version + type CopyNote struct + Doc string + ID string + Line int + Reason string + Skipped bool type System + func (s *System) FencesReport(res scan.Result, doc string, src []byte) ([]byte, int, []CopyNote) v0.1.5 Oct 5, 2026 v0.1.4 Oct 4, 2026 v0.1.3 Oct 1, 2026 Changes in this version + var ErrContextMode = errors.New("context: unknown mode") + var ErrDelegateNotOwner = errors.New("docsync: delegated_by must name a person listed in [owners] (§26.7)") + var ErrRange = errors.New("docsync: no def binds exactly that line range") + var ErrSinceCommit = errors.New("context: since a commit needs OldBody, the body of a block at that commit") + var ErrUnknownEnv = errors.New("docsync: environment not in env.known") type ContextOptions + OldBody func(b block.Block) (string, bool) type Option + func WithCommandName(name string) Option + func WithForeignLink(f func(b block.Block) (string, bool)) Option + func WithLocalReader(f func(path string) ([]byte, error)) Option + func WithSnapshotBlock(f func(id, sha string) (block.Block, bool)) Option + type RemoteCiter struct + Doc string + Line int + Repo string + Verb string type Report + func (r Report) ApplyRuns(runs []check.RunResult) Report type Why + RemoteRefs []RemoteCiter v0.1.2 Oct 1, 2026 v0.1.1 Oct 1, 2026 v0.1.0 Sep 30, 2026 Changes in this version + const BytesPerToken + const EdgeAbt + const EdgeCite + const EdgeCov + const EdgeFrom + const JSONFormat + const ModeAuto + const ModeDiff + const ModeFull + const ModeLine + const ModeValue + const NodeDef + const NodeDoc + const ReasonOverBudget + const ReasonUnchanged + const SinceAck + const SpecVersion + const TriageThreshold + var ErrBadLabel = errors.New("docsync: not a label") + var ErrBadLines = errors.New("docsync: bad lines") + var ErrDelegationRequired = errors.New("docsync: an agent ack needs delegated_by (§26.7)") + var ErrGeneratedPath = errors.New(...) + var ErrHashMismatch = errors.New("docsync: reference is not to that id") + var ErrNewerRule = errors.New("docsync: recorded under a newer extraction rule than this build implements") + var ErrNoCarrier = errors.New("docsync: no comment carrier for this file type") + var ErrNoFS = errors.New("docsync: WithFS is required") + var ErrNoPageReview = errors.New("docsync: page has no review_every to record a review against") + var ErrNoReference = errors.New("docsync: no reference at that doc line") + var ErrNoStore = errors.New("docsync: no store configured (WithStore)") + var ErrNotFound = errors.New("docsync: not found") + var ErrOtherRule = errors.New(...) + var ErrWouldNotBind = errors.New("docsync: the directive would not bind") + var ModeValues = []string + func CheckRule(l ledger.Ledger, r ledger.Refs) error + func LineCR(line string) string + func Tokens(s string) int + type AckRequest struct + Actor string + ActorKind ledger.ActorKind + Claim bool + DelegatedBy string + Doc string + Env string + ID string + Line int + Note string + Page bool + Preview bool + type AdoptResult struct + Adopted int + Edits []Edit + Unresolved []Unresolved + type AuditOptions struct + ActorKind ledger.ActorKind + ID string + Since time.Time + type BlameResult struct + Acks []ledger.Ack + Block block.Block + Change match.Change + Finding check.Finding + Reference block.Reference + type CheckOptions struct + Env string + Full bool + Resolve bool + Run bool + Strict bool + type Classifier = match.Classifier + type ContextItem struct + Content string + File string + ID string + Lines [2]int + Mode string + Rank int + Tokens int + Why string + type ContextOptions struct + Budget int + Mode string + Since string + type ContextResult struct + BudgetTokens int + Items []ContextItem + Omitted []Omitted + Target string + UsedTokens int + type DefineOptions struct + Desc string + Env string + Label string + Owner string + Stability string + Tags string + type DefineResult struct + Block block.Block + Edit Edit + Existing bool + ID string + type Edit struct + Delete bool + File string + Line int + New string + Next string + Old string + func (e Edit) Apply(src []byte) ([]byte, error) + func (e Edit) IsZero() bool + type Envelope struct + Commit string + GeneratedAt time.Time + JSONFormat int + Repo string + type Fact struct + CitedBy []block.Position + Env string + File string + ID string + Line int + Owner string + Secret bool + Type string + Value string + type FindOptions struct + File string + Query string + Tag string + type Graph struct + Edges []GraphEdge + Nodes []GraphNode + func (g Graph) DOT() string + type GraphEdge struct + From string + Kind string + Line int + To string + type GraphNode struct + ID string + Kind string + Label string + State check.State + type ImpactGroup struct + Findings []check.Finding + Key string + type ImpactResult struct + ByDoc []ImpactGroup + ByOwner []ImpactGroup + ByRepo []ImpactGroup + Total int + type KeySpec struct + Known []string + Required []string + type Literal struct + Doc string + ID string + Line int + Value string + type ManualFix struct + File string + Line int + Reason string + func (m ManualFix) String() string + type MapChain struct + Hops int + Root string + State check.State + type MapDef struct + CitedBy int + Desc string + File string + ID string + Lines [2]int + Stability block.Stability + State check.State + Tokens int + type MapOptions struct + Budget int + type MapPage struct + Cites int + Covers int + Owner string + Path string + State map[check.State]int + Tokens int + type MapResult struct + BudgetTokens int + Chains []MapChain + Defs []MapDef + Freshness map[check.State]int + Omitted int + Pages []MapPage + UsedTokens int + type Notifier interface + Notify func(ctx context.Context, findings []check.Finding) error + type Observer interface + OnAck func(ledger.Ack) + OnFinding func(check.Finding) + type Omitted struct + ID string + Reason string + type Option func(*System) error + func WithAcks(a ledger.Acks) Option + func WithBodyAt(f func(hash string) (string, bool)) Option + func WithClassifier(c Classifier) Option + func WithClock(f func() time.Time) Option + func WithCommit(sha string) Option + func WithCommitLookup(f func(sha string) bool) Option + func WithConfig(c config.Config) Option + func WithExtractCache(c scan.Cache) Option + func WithExtractor(es ...extract.Extractor) Option + func WithFS(fsys fs.FS) Option + func WithForeignSnapshot() Option + func WithMerged(blocks ...block.Block) Option + func WithMergedRefs(rows ...ledger.RefRow) Option + func WithNotifier(n Notifier) Option + func WithObserver(o Observer) Option + func WithOldContent(f func(row ledger.Row) (string, bool)) Option + func WithPicker(p Picker) Option + func WithPrevious(l ledger.Ledger, r ledger.Refs) Option + func WithPreviousForeign(rows ...ledger.Row) Option + func WithRecords(f func(args map[string]string) ([]map[string]string, error)) Option + func WithRegistry(r *extract.Registry) Option + func WithRemoved(ids map[string]string) Option + func WithRenderer(r Renderer) Option + func WithRepo(name string) Option + func WithResolver(r check.Resolver) Option + func WithSnapshot(f func(id, sha string) (string, bool)) Option + func WithStore(st Store) Option + func WithStoredHashes(m map[string]string) Option + func WithTestResults(m map[string]check.TestOutcome) Option + func WithURLCheck(f func(href string) check.URLResult) Option + func WithVerb(names ...string) Option + func WithVerbHandler(v Verb) Option + type OwnerMetrics struct + Key string + State map[check.State]int + type Picker interface + Pick func(arg, content string) (pick.Result, error) + Scheme func() string + type Prefix struct + Count int + Prefix string + type RenameResult struct + Edits []Edit + Mapping map[string]string + type RenderOptions struct + Env string + Runs map[int]render.RunResult + Source []byte + type Renderer interface + Render func(nodes []render.Node) ([]byte, error) + type RepairResult struct + Edits []Edit + Manual []ManualFix + type Report struct + Changes []match.Change + ExitCode int + Findings []check.Finding + Scan scan.Result + States map[check.State]int + Summary map[check.Severity]int + TruthHashes map[string]string + type ReportOptions struct + Churn map[string]int + Limit int + ServedBytes int64 + SourceBytes int64 + type ReportResult struct + BusyPrefixes []Prefix + ContextSavings float64 + Gaps []string + Literals []Literal + MeanTimeToAck time.Duration + OrphanedOwners []string + PerOwner []OwnerMetrics + PerPage []OwnerMetrics + ServedBytes int64 + SourceBytes int64 + Stalest []Stale + Uncovered []block.Block + Unmarked []Unmarked + type Stale struct + Cites int + Doc string + NeverAck bool + OldestAck time.Time + type Store interface + Load func(ctx context.Context) (ledger.Ledger, ledger.Refs, ledger.Acks, error) + Save func(ctx context.Context, l ledger.Ledger, r ledger.Refs, a ledger.Acks) error + type System struct + func New(opts ...Option) (*System, error) + func (s *System) Ack(res scan.Result, req AckRequest) (ledger.Ack, error) + func (s *System) Adopt(_ context.Context, res scan.Result) (AdoptResult, error) + func (s *System) Audit(opts AuditOptions) []ledger.Ack + func (s *System) Blame(rep Report, doc string, line int) (BlameResult, error) + func (s *System) Bodies(res scan.Result) map[string]string + func (s *System) Check(ctx context.Context, opts CheckOptions) (Report, error) + func (s *System) Config() config.Config + func (s *System) Context(ctx context.Context, target string, opts ContextOptions) (ContextResult, error) + func (s *System) ContextFor(rep Report, target string, opts ContextOptions) ContextResult + func (s *System) Define(_ context.Context, target string, opts DefineOptions) (DefineResult, error) + func (s *System) ExtractFile(ctx context.Context, path string, src []byte) ([]block.Block, error) + func (s *System) Facts(res scan.Result) []Fact + func (s *System) Fences(res scan.Result, doc string, src []byte) ([]byte, int) + func (s *System) Find(res scan.Result, query string) []block.Block + func (s *System) FindBy(res scan.Result, opts FindOptions) []block.Block + func (s *System) FixDuplicates(res scan.Result) (RenameResult, error) + func (s *System) Graph(rep Report) Graph + func (s *System) Impact(ctx context.Context) (ImpactResult, error) + func (s *System) LocateID(res scan.Result, id string) (block.Block, bool) + func (s *System) Map(ctx context.Context, opts MapOptions) (MapResult, error) + func (s *System) Notify(ctx context.Context, rep Report) error + func (s *System) Read(res scan.Result, id, lines string) (string, error) + func (s *System) Registry() *extract.Registry + func (s *System) Rename(res scan.Result, oldPrefix, newPrefix string) (RenameResult, error) + func (s *System) Render(ctx context.Context, doc string, opts RenderOptions) ([]byte, []render.Note, error) + func (s *System) Repair(res scan.Result) RepairResult + func (s *System) Report(rep Report, opts ReportOptions) ReportResult + func (s *System) SaveState(ctx context.Context, res scan.Result, acks ledger.Acks) error + func (s *System) Scan(ctx context.Context) (scan.Result, error) + func (s *System) ScanFull(ctx context.Context) (scan.Result, error) + func (s *System) Snapshot(res scan.Result) (ledger.Ledger, ledger.Refs) + func (s *System) Why(res scan.Result, target string) (Why, error) + type TriageGroup struct + Classes []block.Class + Diff string + Findings []check.Finding + Group int + func Triage(rep Report) []TriageGroup + type Unmarked struct + Churn int + File string + Line int + Symbol string + type Unresolved struct + Doc string + Line int + Reason string + Target string + type Verb interface + Carriers func() []block.Carrier + Check func(ref block.Reference, st *VerbState) []check.Finding + Keys func() KeySpec + Name func() string + Render func(ref block.Reference, st *VerbState, inline bool) (text string, ok bool, err error) + type VerbState struct + Defs map[string]block.Block + Repo string + type Why struct + Chain []block.Block + Copies []block.Block + CoveredBy []string + Defs []block.Block + History []ledger.Ack + ID string + Refs []block.Reference