Skip to content

Export each citation's standing and what clears it - #379

Open
dmarx wants to merge 1 commit into
claude/laughing-brahmagupta-17c985from
claude/laughing-brahmagupta-17c985-export-standing
Open

dmarx wants to merge 1 commit into
claude/laughing-brahmagupta-17c985from
claude/laughing-brahmagupta-17c985-export-standing

Conversation

@dmarx

@dmarx dmarx commented Oct 21, 2026

Copy link
Copy Markdown
Owner

This is stacked on #378. Merge that first; this PR's base will then move to main.

Why

The export's citations table had one binary column, excused, set to 1 when a directive acknowledges the citation. It could not tell apart five situations the lint already distinguishes:

In-force sites and unacknowledged ones both exported as excused = 0, and a sanctioned site looked unacknowledged.

What

  • New column standing TEXT NOT NULL: one of in-force, acknowledged, sanctioned, unacknowledged or dangling. A dangling site under unresolved-ok is acknowledged.
  • New column excused_by TEXT: what clears the site. It is inactive-ok @ path:line for a directive (or inactive-ok-file, or unresolved-ok), lint.inactive_ok[N] for a rule, and NULL when nothing clears it.
  • excused generalized: it is now 1 when a directive or a rule excuses the site.
  • One source. The standing is derived once, in ref_status (Citation.standing, Citation.cleared_by), from the same scan the lint reads. export.py only copies the values out (DP-004). Citation now keeps two facts the scan already had and was dropping: whether the code resolves, and whether the cited document is in force.

mention-ok sites

  • A mention-ok over a document in force leaves the site in-force, with excused = 1 and excused_by naming the mention, since a mention claims nothing about status.
  • Over a retired or dangling target, the mention answers the finding, so the site is acknowledged.
  • Where a rule also matches, the rule wins in both standing and excused_by.

Record

  • ADR ADR-tmptj3j3 records the change of meaning for excused and the rejected alternatives: keeping excused as it was and adding only standing; dropping excused; deriving the standing in export.py.
  • A changelog fragment and a devlog entry.
  • docs/cli.md describes the new columns.

Tests

  • Written first and seen to fail. They cover each of the five standings, excused_by for a directive and for a rule, excused = 1 for both acknowledged and sanctioned sites, the mention-ok cases, and Citation.standing itself.
  • Full suite: 1884 passed, 33 skipped.
  • luria lint gives the same findings as before.

Generated by Claude Code

The export's `citations` table conflated five situations in `excused`
(1 when a directive acknowledges it): an in-force site and a loud one
both exported 0, and so did a site a lint.inactive_ok rule sanctions.

- `standing`: in-force | acknowledged | sanctioned | unacknowledged |
  dangling, read from Citation.standing in ref_status (DP-004), so the
  export copies the lint's reading rather than re-deriving it. A
  mention-ok site stands where its target puts it: in-force over a
  document in force, acknowledged over a retired or dangling one.
- `excused_by`: the directive (`inactive-ok @ path:line`) or the rule
  (`lint.inactive_ok[N]`), NULL when nothing clears the site.
- `excused` widens to 1 for a directive OR a rule.

Citation now carries `resolves` and `in_force`, which _acknowledge
already knew and dropped. Record: ADR-tmptj3j3, changelog, devlog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KC8NN4NtUf8sd5unC6dpFV

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants