Expand description
Code anchors (C0 1.9): where in the code a fact, or a piece of task evidence, applies.
An anchor names a repo-relative path, optionally a symbol in it, and
the digest of what it covered when it was written. The engine resolves
anchors against its local code graph; Cloud only stores them.
The digest (section 3) is anchor_digest of the covered bytes: the
exact bytes of the symbol’s syntax node (without the comments before it),
or of the whole file without a symbol, normalized by
normalize_anchor_content. vectors.json → anchor_digest holds the
reference cases every implementation reproduces.
Structs§
- Code
Anchor V1 - One code anchor.
Constants§
Functions§
- anchor_
digest sha256:+ lowercase hex of the normalized content.- normalize_
anchor_ content - The covered content as it is hashed: a leading UTF-8 byte-order mark
dropped, every
\r\nand lone\rturned into\n, and trailing spaces and tabs removed from every line. Nothing else changes: indentation, blank lines and the final newline (or its absence) stay. - validate_
anchor_ path - A repo-relative,
/-separated path without.or..segments (the rule for anchors and, 1.9 section 8, the code graph). 1.9 R3: no:(drive letters, alternate data streams) and no invisible format characters. - validate_
anchors - A list of anchors: at most
MAX_ANCHORS, sorted by(path, symbol)(no symbol first), without repeats.