Skip to content

Harden the citation cache; reject paper_author outside paper types - #97

Merged
bits-bytes-nn merged 2 commits into
mainfrom
review-r3
Oct 14, 2026
Merged

bits-bytes-nn merged 2 commits into
mainfrom
review-r3

Conversation

@bits-bytes-nn

Copy link
Copy Markdown
Owner

Follow-ups from an adversarial review of main at ea6ee73. Both the code/tests/docs review and the UI/UX review found 0 MAJOR issues; this PR applies their cheap MINOR fixes.

  • js/citations.js:
    • A failed refresh (429, 404, network) now re-stamps the cached count, so the visitor's browser waits a day before asking again instead of retrying on every view.
    • A cache timestamp in the future no longer counts as fresh.
    • An entry without a paperId is not linked.
    • The expected failure is logged with console.warn.
  • script/lint-posts.rb: new rule. paper_author is rejected outside the paper types, as paper_doi already was; the layout prints "Paper by …" for any post that has it.
    • Passes: a Paper Reviews post with paper_author.
    • Fails: a Tech Guides post with paper_author: "Mistral AI" (paper_author is for Paper Reviews and Paper Summaries posts).
    • No current post is affected.
  • Docs: docs/tech-doc.md lists all three scripts, and the skip-link comment counts the seventh tab.

_data/post_conventions.yml is unchanged.

Verification:

  • tests: 174 runs, 0 failures
  • lint: 35 posts pass
  • strict build, htmlproofer and validate-site.sh all pass
  • Playwright with the API mocked: a 200 response, a reload within 24h with no request, 429 with and without a cache, a blocked request, and the 5s timeout

A failed refresh keeps the cached count for another day instead of
asking on every view, a future timestamp no longer counts as fresh, and
an entry without a paperId is not linked. paper_author is now rejected
outside paper types, as paper_doi already was.
@bits-bytes-nn
bits-bytes-nn merged commit b801401 into main Oct 14, 2026
3 checks passed
@bits-bytes-nn
bits-bytes-nn deleted the review-r3 branch October 15, 2026 11:30
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