findingkey

package
v0.17.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package findingkey derives the stable key of a consistency finding (G1 of itd-2609291923559186, spc-2610021456200324): `cfk-` and sixteen hex digits, the same for the same contradiction on every run.

It is the ONE derivation. The consistency pass keys every finding and report row with it and capture writes it into the issue a finding files (`finding_ref:`), so a contradiction found again is joined to the record that already holds it; record-lint keys its cross-document findings with it too. It sits under core/record beside match because both core/intent and core/lint call it, and lint cannot import intent. It is a leaf: it reads nothing, writes nothing and never prints.

Index

Constants

View Source
const Prefix = "cfk-"

Prefix opens every key.

Variables

This section is empty.

Functions

func Derive

func Derive(class string, a, b End) string

Derive is the key of a finding of class between a and b. Each end's path becomes its identity path and each quote is collapsed; the two ends are ordered by identity path, then by quote; and the key is the prefix and the first sixteen hex digits of the SHA-256 of the domain, the class and the two ordered (path, quote) pairs, with NUL between every field.

The key is over the reviewers' quotes, so it is exactly as stable as they are, and that has two limits a caller must not read past:

  • the same contradiction quoted differently (another sentence of the same passage, a longer or shorter excerpt, a reworded document) gets another key, so a resolved or won't-fix record carrying the old key does not mark it addressed, and it is filed again unless the prose match links it to an open record;
  • a contradiction fixed and later reintroduced with the same text gets the same key, so a resolved record carrying it marks the new occurrence addressed and files nothing.

Quotes are compared with whitespace collapsed and nothing else: no stemming, no fuzzy match, so neither limit narrows with wording that only looks alike.

func StatusFoldersForTest

func StatusFoldersForTest(root string) []string

StatusFoldersForTest returns the status folders this package drops from a path under root, or nil when root is no status-foldered store. It exists for the tests that pin each list to its owner's.

func Valid

func Valid(s string) bool

Valid reports whether s is verbatim a key's shape. Capture refuses a `finding_ref` that is not, and record_schema reports one, so the writer and the committed-ledger gate agree.

Types

type End

type End struct {
	Path  string
	Quote string
}

End is one end of a finding: the repo-relative, slash-separated path of the document it sits in, and the text it quotes (empty for a finding that quotes nothing, such as a record-lint rule's).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL