Skip to content

Make the trust and lifecycle checks do what the docs say - #13

Merged
MartinForReal merged 5 commits into
mainfrom
fix/trust-lifecycle-gaps
Jul 31, 2026
Merged

MartinForReal merged 5 commits into
mainfrom
fix/trust-lifecycle-gaps

Conversation

@MartinForReal

@MartinForReal MartinForReal commented Jul 31, 2026 •

Copy link
Copy Markdown
Owner

Three §5 trust signals that the README and the 0.3.0 notes described as shipped were either never surfaced or never checked. This makes each claim true, then corrects the prose. Released as 0.5.0.

Closes #10, closes #11, closes #12.

stale_after is enforced, not just parsed (#10)

isStale derived the answer but nothing called it, so validation checked only the date's form — a deadline from last year passed silently. A note past its stale_after now says it's due for review.

The derived trust tier is shown (#11)

trustTier was computed and dropped on the floor. It now appears in the status-bar tooltip. The report pane lists only files that have issues, so a conformant note — the case where the tier is most worth knowing — would never show one there; the status bar is the surface that covers every note.

sources[].author is validated (#12)

The per-entry loop checked resource, usage_count and last_modified, never author, despite the docs listing all four. Warns when author is present and isn't a non-empty string.

Scope

All three sit behind Validate trust & lifecycle fields, off by default, so no vault starts reporting anything new unless it had already opted in. Every new finding is a warning — §11 keeps these out of conformance, so nothing that passed before now fails.

Version

0.5.0, minor rather than patch: these are new checks and a new surface, listed under ### Added. This repo has kept patches for bugfixes and re-releases (0.4.1, 0.2.2) and taken a minor for every new capability (0.2.0, 0.3.0, 0.4.0).

Bumped with npm version minor --no-git-tag-version, so version-bump.mjs wrote manifest.json and versions.json in its own format and package-lock.json stayed in step. No tag is created by this PR — tagging remains a separate step after merge.

The default actor moves to okf-enforcer/0.5 with it. That string carries <major>.<minor> and was bumped the same way at 0.3.0 and 0.4.0, but left alone for the 0.4.1 patch. It's only a default: a saved setting is kept as written.

Verification

No test framework here, so this was checked with throwaway esbuild harnesses against a stubbed obsidian (deleted before commit).

  • stale_after: past date and today flagged, future date and absent silent, malformed still gets the form warning rather than the deadline one.
  • author: empty string, whitespace-only, null and a number all flagged; a real name and an absent key silent; the index in the message tracks the right entry.
  • Tier: unverified / machine-confirmed / human-reviewed derived correctly, human: winning over process: in a mixed list; null for a note with no frontmatter or unparseable YAML.
  • Tooltip: tier line present on conformant and warning notes with the toggle on, absent with it off.
  • Gate: with Validate trust & lifecycle fields off, a note that is both stale and has an empty author produces neither warning.
  • Actor bump: auto-fix on a bare note writes generated: { by: okf-enforcer/0.5, ... }, and the result re-validates with zero errors and no provenance complaints.

tsc --noEmit is clean, main.js is rebuilt, and the build was installed into a real vault and exercised in Obsidian.

Docs

README.md's feature list, status-bar entry, Settings Rules entry, and default-actor example now match the behaviour, as does the in-app settings description. The 0.3.0 changelog entry is corrected in place — it claimed derived tiers and author validation that hadn't shipped — with a note recording the correction, so the old entry doesn't keep misleading anyone.

Also fixed while in there: five changelog headings (0.4.1 and all of 0.2.x) had no matching link definition and rendered as bare [0.4.1] text. All eleven now resolve, verified by HTTP rather than by pattern — 0.1.0 and 0.1.1 are tags with no release, but GitHub serves a tag page at the same URL shape.

isStale derived the answer but nothing called it, so validation only
checked the date's form: a deadline from last year passed silently.
Under Validate trust & lifecycle fields, a note past its stale_after
now says it is due for review. Advisory only — §11 keeps it out of
conformance.
The README and the 0.3.0 notes both listed `author` among the §5.1
credibility signals this plugin validates, but the loop only looked at
`resource`, `usage_count` and `last_modified`. Warn when an `author` is
present and isn't a non-empty string, matching its neighbours.
trustTier computed unverified / machine-confirmed / human-reviewed from
`verified` (§5.3), but nothing called it, so the tier reached no surface
even though the README advertised it.

The status bar is the right home: the report pane lists only files that
have issues, so a conformant note — the case where the tier is most
worth knowing — would never appear there. Shown only when Validate trust
& lifecycle fields is on, since that is the toggle that governs §5.

trustTierOfContent wraps the parse so main.ts doesn't have to reach for
parseYaml itself.
The README's feature list and the 0.3.0 changelog entry described
derived trust tiers and `sources[].author` validation that hadn't
shipped. The three commits before this one make those claims true; this
one brings the prose in line and records the correction against the
0.3.0 entry, so anyone reading the old notes isn't misled.
The earlier commit corrected the two claims that were outright wrong.
This covers what was left:

- The Unreleased blurb lumped all three gaps together as overclaimed
  docs. Only two were: 0.3.0 accurately described `stale_after` as an
  absolute-date check, and the gap there was that form was all it ever
  checked. Say that instead.
- README's status-bar and Rules entries didn't mention the tier at all.
  A validation toggle changing what a tooltip shows is surprising
  enough to say out loud in Settings, not just in Features.
- Add the missing changelog link definitions. Unreleased, 0.4.1, and
  all of 0.2.x had headings with no matching reference, so they
  rendered as bare `[0.4.1]` text. 0.1.0 and 0.1.1 are tags with no
  release, but GitHub serves a tag page for those, so the same URL
  shape works throughout.
@MartinForReal
MartinForReal merged commit 4a598c4 into main Jul 31, 2026
1 check passed
@MartinForReal
MartinForReal deleted the fix/trust-lifecycle-gaps branch July 31, 2026 09:58
@MartinForReal MartinForReal mentioned this pull request Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant