Skip to content

Add full footnote forms for Chicago and OSCOLA to /format - #328

Open
dknauss wants to merge 1 commit into
mainfrom
claude/project-thread-cipila
Open

dknauss wants to merge 1 commit into
mainfrom
claude/project-thread-cipila

Conversation

@dknauss

@dknauss dknauss commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Part 2 of the note citations build (#243), following #326. The plan is docs/planning/note-citations-plan.md.

What it does

  • Chicago Notes-Bibliography and OSCOLA get a <citation> layout in their bundled CSL files. It is the full note a footnote gives the first time it cites a work, with an optional pinpoint.
    • Chicago: "Ivan Illich, Tools for Conviviality (Harper & Row, 1973), 12".
    • OSCOLA 5: "HLA Hart, The Concept of Law (3rd edn, OUP 2012) 135". Initials have no full stops (bibliography_builder_oscola_note_names()). A comma comes before the pinpoint after an article's first page or a statute's title. There is no final full stop.
  • POST /bibliography/v1/format takes layout: "citation" and an optional locators list, one pinpoint per item by position. Pinpoints are stripped of tags, have whitespace collapsed, and are capped at BIBLIOGRAPHY_BUILDER_MAX_LOCATOR_LENGTH (100). The response names the layout.
  • Any other style asking for the citation layout gets 400 bibliography_builder_formatter_no_note_layout.
  • The whole-response cache and the per-style entry map are kept apart by layout. Bibliography cache keys are unchanged, so existing caches stay warm.

Tests

  • New goldens in tests/fixtures/csl-styles/notes/ are pinned by CslNoteGoldenTest. It renders each item with no pinpoint and with "12", and also checks:
    • only the notes styles have the layout;
    • the caches stay separate;
    • other styles are refused;
    • pinpoints are normalized;
    • OSCOLA initials lose their full stops.
  • RestEdgeCasesTest covers the route.
  • The runtime matrix's format-styles.php checks the note goldens on every PHP version.
  • Locally: PHPUnit (915 tests), phpcs, Jest, and Prettier pass. Psalm needs PHP 8.3.16, so it runs in CI only.

Playground demo

No demo change in this PR. The editor doesn't use the new layout yet, so nothing changes for users. The next PR ("Cite in a footnote") uses it and adds a short OSCOLA essay with footnotes to the demo.

Docs

  • docs/csl-styles.md gets a new "Full notes" section.
  • The /format line in CLAUDE.md is extended.
  • CHANGELOG.md Unreleased gets an entry.
  • docs/current-metrics.md is updated.

Generated by Claude Code

Note citations, PR 2 of the #243 build (plan tickets N2.1 and N2.2).

chicago-notes-bibliography.csl and oscola.csl gain a <citation>
layout: the full form of the first note citing a work, with its
pinpoint, written from CMOS 18 ch. 13 and OSCOLA 5. Borges works out
note positions itself, so the layouts need no position tests.

POST /bibliography/v1/format takes "layout": "citation" and an
optional "locators" list for the notes styles; other styles get 400
bibliography_builder_formatter_no_note_layout. Response caches and the
per-style entry map are kept apart by layout, and bibliography cache
keys are unchanged. OSCOLA notes drop the full stops after initials.

Goldens in tests/fixtures/csl-styles/notes/ (CslNoteGoldenTest), also
checked on every PHP version by the runtime-matrix smoke.

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

Copy link
Copy Markdown

Plugin readme preview

Open preview · Commit 001f822

37 passed · 0 warnings · 0 notes

Passed checks (37)
  • 145 / 150 characters in the short description.
  • Plugin name header recognized.
  • License header recognized: GPLv2 or later.
  • 5 tags accepted within the five-tag limit.
  • Description is within the parser’s word limit.
  • Installation is within the parser’s word limit.
  • Faq is within the parser’s word limit.
  • Changelog is within the parser’s word limit.
  • Tested up to 7.1, the latest WordPress major release.
  • Stable tag is declared: 1.23.0.
  • The PHP Version header is declared: 1.23.0.
  • Stable tag matches the PHP Version header: 1.23.0.
  • The readme “Requires at least” value is valid: 6.4.
  • The PHP “Requires at least” header is a numeric version: 6.4.
  • “Requires at least” matches between the readme and PHP header: 6.4.
  • The readme “Requires PHP” value is valid: 8.1.
  • The PHP “Requires PHP” header is a numeric version: 8.1.
  • “Requires PHP” matches between the readme and PHP header: 8.1.
  • “Tested up to” 7.1 meets the minimum WordPress version 6.4.
  • Installation content is present.
  • FAQ content is present.
  • Changelog content is present.
  • Screenshot captions are present.
  • The first changelog release matches Stable tag: 1.23.0.
  • The first changelog release matches PHP Version: 1.23.0.
  • Banner image loaded.
  • Plugin icon loaded.
  • Screenshot 1 has a matching image and caption.
  • Screenshot 2 has a matching image and caption.
  • Screenshot 3 has a matching image and caption.
  • Screenshot 4 has a matching image and caption.
  • Screenshot 5 has a matching image and caption.
  • Screenshot 6 has a matching image and caption.
  • Screenshot 7 has a matching image and caption.
  • Screenshot 8 has a matching image and caption.
  • Screenshot 9 has a matching image and caption.
  • Plugin PHP header loaded.

Readme and PHP-header checks only; this does not test plugin runtime compatibility.

@codecov

codecov Bot commented Nov 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.42%. Comparing base (97a7538) to head (001f822).

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #328      +/-   ##
============================================
+ Coverage     87.34%   87.42%   +0.08%     
  Complexity       67       67              
============================================
  Files           115      115              
  Lines         12917    12993      +76     
  Branches       1373     1373              
============================================
+ Hits          11282    11359      +77     
+ Misses          489      488       -1     
  Partials       1146     1146              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dknauss
dknauss marked this pull request as ready for review November 30, 2026 05:59
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-30T05:59:09.730920Z
We couldn’t complete this review. Comment @codex review to try again.
001f822 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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