anchor_recapture
Repair broken location anchors on code findings by recapturing them from the git object store. Runs as a dry run unless apply is set.
Instructions
Rebuild stored location anchors from the git object store. DRY RUN by default.
The sanctioned repair path: meta.loc is writable through
update_finding(meta_update=) and NOTHING validates it there, so a
hand-assembled object is accepted at the write and read back as
unknown(invalid_anchor). This verb builds the object itself, from the
same capture the file-time resolver uses.
Four behaviours are specified rather than incidental. A FAILED capture
never replaces a valid stored anchor (outcome kept) — the refusal is
usually about the environment, and the anchor it would destroy is still
good in a clone that has the history. The loc: null tombstone ("do not
recapture") is left alone unless force_tombstone says otherwise. The
git work runs outside any transaction, and only the version check and
the write share one — so a row whose anchor changed while the capture
ran is reported stale and left to the other writer.
include_unanchored widens the POPULATION to rows that never carried an
anchor at all — every finding filed before the capture seam landed, since
capture runs only when a genuine new finding is filed. They report
would_backfill/backfilled, never folded into would_update/updated:
"acquired an anchor for the first time" is the number this exists to
produce. It is NOT force_tombstone (a loc: null tombstone is a key
that is present and null, and this flag never touches it) and it is NOT a
fingerprint backfill — nothing here reads or writes that column.
Args:
finding_id: Repair one finding instead of a population
status: Status filter; "all" widens to every status (default: open)
category: Restrict to one category
file: Restrict to one file (the finding's
filecolumn)project_dir: The repository to capture from. Omitting it makes every capture refuse with
no_root, which by the rule above leaves every valid anchor untouchedapply: Write the rebuilt anchors (default: report only)
force_tombstone: Overwrite a
loc: nulltombstoneinclude_unanchored: Also take rows carrying no
lockey at all (the backfill population). Leaves tombstones alone; still a dry run unlessapplyis setlimit: Maximum findings examined (default 10000). 0 means NO findings are examined; a negative value is an error (it used to mean "no limit").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | ||
| apply | No | ||
| limit | No | ||
| status | No | open | |
| category | No | ||
| finding_id | No | ||
| project_dir | No | ||
| force_tombstone | No | ||
| include_unanchored | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||