Skip to content

Use caplinks' AttemptGuard and JsonRecords for the review gate - #91

Merged
thorwhalen merged 3 commits into
mainfrom
use-caplinks-guard
Oct 26, 2026
Merged

thorwhalen merged 3 commits into
mainfrom
use-caplinks-guard

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

Part of i2mint/caplinks#3: heed's review gate now uses caplinks 0.0.4 (AttemptGuard, JsonRecords, FileTexts) instead of its own copies. Behaviour unchanged: the gated-page tests pass as they were.

  • Removes _JsonRecords and the hand-rolled _locked dict / two-limiter logic (net 29 lines in, 56 out); the guard is built lazily on the first unlock, so caplinks is still imported only when a record exists.
  • heed[gate] and dev now need caplinks>=0.0.4.

Adversarial review (fresh Opus agent): ship. Checked: no valid heed id rejected by caplinks' stricter token rule, no fail-open path, lock-out equivalent, thread-safe, no dead code. It found that a dangling symlink at access/<id>.json was served open before (now 404, since FileTexts refuses symlinks) and that heed review revoke crashed on such a record (fixed: it is replaced, closed); test added; comment corrected; one-use helper inlined. Side effect: the records folder is now 0700 and writes are fsynced.

@thorwhalen
thorwhalen merged commit 50a1654 into main Oct 26, 2026
13 checks passed
@thorwhalen
thorwhalen deleted the use-caplinks-guard branch October 26, 2026 10:21
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.

1 participant