citeformer 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. citeformer-0.1.0/.claude/agents/contract-reviewer.md +41 -0
  2. citeformer-0.1.0/.claude/commands/bump.md +29 -0
  3. citeformer-0.1.0/.claude/commands/contract-check.md +20 -0
  4. citeformer-0.1.0/.claude/commands/release-check.md +25 -0
  5. citeformer-0.1.0/.claude/commands/release.md +22 -0
  6. citeformer-0.1.0/.claude/launch.json +29 -0
  7. citeformer-0.1.0/.claude/skills/add-citation-format/SKILL.md +160 -0
  8. citeformer-0.1.0/.claude/skills/contract-invariant/SKILL.md +46 -0
  9. citeformer-0.1.0/.claude/skills/grammar-shape/SKILL.md +76 -0
  10. citeformer-0.1.0/.claude/skills/piggyback-first/SKILL.md +43 -0
  11. citeformer-0.1.0/.claude/skills/release-bump/SKILL.md +52 -0
  12. citeformer-0.1.0/.env.example +24 -0
  13. citeformer-0.1.0/.github/pull_request_template.md +31 -0
  14. citeformer-0.1.0/.github/workflows/ci.yml +89 -0
  15. citeformer-0.1.0/.github/workflows/release.yml +65 -0
  16. citeformer-0.1.0/.gitignore +113 -0
  17. citeformer-0.1.0/.pre-commit-config.yaml +38 -0
  18. citeformer-0.1.0/.readthedocs.yaml +20 -0
  19. citeformer-0.1.0/AGENTS.md +69 -0
  20. citeformer-0.1.0/CHANGELOG.md +833 -0
  21. citeformer-0.1.0/CLAUDE.md +96 -0
  22. citeformer-0.1.0/CONTRIBUTING.md +64 -0
  23. citeformer-0.1.0/LICENSE +201 -0
  24. citeformer-0.1.0/Makefile +63 -0
  25. citeformer-0.1.0/PKG-INFO +342 -0
  26. citeformer-0.1.0/README.md +238 -0
  27. citeformer-0.1.0/benchmarks/README.md +326 -0
  28. citeformer-0.1.0/benchmarks/__init__.py +6 -0
  29. citeformer-0.1.0/benchmarks/_common.py +231 -0
  30. citeformer-0.1.0/benchmarks/adversarial.py +214 -0
  31. citeformer-0.1.0/benchmarks/calibration_data.py +295 -0
  32. citeformer-0.1.0/benchmarks/demo.py +204 -0
  33. citeformer-0.1.0/benchmarks/fetch_fixtures.py +131 -0
  34. citeformer-0.1.0/benchmarks/findings/figures/fabrication-structural-vs-empirical.png +0 -0
  35. citeformer-0.1.0/benchmarks/findings/figures/multiprompt-summary.png +0 -0
  36. citeformer-0.1.0/benchmarks/findings/figures/nli_calibration_DeBERTa-v3-large-mnli-fever-anli-ling-wanli.png +0 -0
  37. citeformer-0.1.0/benchmarks/findings/figures/premise-comparison.png +0 -0
  38. citeformer-0.1.0/benchmarks/findings/figures/sweep-summary.png +0 -0
  39. citeformer-0.1.0/benchmarks/findings/multiprompt-20260423T234641Z.json +502 -0
  40. citeformer-0.1.0/benchmarks/findings/nli_calibration_DeBERTa-v3-large-mnli-fever-anli-ling-wanli.json +529 -0
  41. citeformer-0.1.0/benchmarks/findings/sweep-20260423T212115Z.json +197 -0
  42. citeformer-0.1.0/benchmarks/findings/sweep-20260423T214616Z.json +96 -0
  43. citeformer-0.1.0/benchmarks/findings/sweep-20260423T215333Z.json +97 -0
  44. citeformer-0.1.0/benchmarks/findings/sweep-20260423T215926Z.json +173 -0
  45. citeformer-0.1.0/benchmarks/findings/sweep-20260423T223040Z.json +136 -0
  46. citeformer-0.1.0/benchmarks/findings/sweep-20260423T223421Z.json +136 -0
  47. citeformer-0.1.0/benchmarks/fixtures/ai_papers.json +420 -0
  48. citeformer-0.1.0/benchmarks/multiprompt_sweep.py +490 -0
  49. citeformer-0.1.0/benchmarks/plot.py +582 -0
  50. citeformer-0.1.0/benchmarks/sweep.py +363 -0
  51. citeformer-0.1.0/benchmarks/threshold_calibration.py +261 -0
  52. citeformer-0.1.0/docs/conf.py +108 -0
  53. citeformer-0.1.0/docs/decisions/001-gbnf-over-lark.md +26 -0
  54. citeformer-0.1.0/docs/decisions/002-inline-markers-stay-numeric.md +36 -0
  55. citeformer-0.1.0/docs/decisions/003-bundle-five-csl-styles.md +35 -0
  56. citeformer-0.1.0/docs/decisions/004-citeproc-rewrite.md +45 -0
  57. citeformer-0.1.0/docs/decisions/005-metadata-deps-in-main-install.md +33 -0
  58. citeformer-0.1.0/docs/decisions/006-vllm-excluded-from-all-extra.md +21 -0
  59. citeformer-0.1.0/docs/decisions/007-required-policy-progression-gap.md +79 -0
  60. citeformer-0.1.0/docs/decisions/008-generation-result-schema-v2.md +48 -0
  61. citeformer-0.1.0/docs/decisions/009-bounded-content-required.md +96 -0
  62. citeformer-0.1.0/docs/decisions/010-verification-report-schema-v3.md +77 -0
  63. citeformer-0.1.0/docs/decisions/011-configurable-marker-styles.md +79 -0
  64. citeformer-0.1.0/docs/decisions/index.md +23 -0
  65. citeformer-0.1.0/docs/development/dev-setup.md +30 -0
  66. citeformer-0.1.0/docs/development/releasing.md +30 -0
  67. citeformer-0.1.0/docs/getting-started.md +93 -0
  68. citeformer-0.1.0/docs/guarantees.md +32 -0
  69. citeformer-0.1.0/docs/index.md +79 -0
  70. citeformer-0.1.0/docs/reference/api.md +11 -0
  71. citeformer-0.1.0/docs/reference/architecture.md +58 -0
  72. citeformer-0.1.0/docs/reference/contracts.md +54 -0
  73. citeformer-0.1.0/docs/reference/index.md +7 -0
  74. citeformer-0.1.0/docs/spec/v0.md +42 -0
  75. citeformer-0.1.0/docs/verification.md +122 -0
  76. citeformer-0.1.0/examples/01_quickstart_mock.py +93 -0
  77. citeformer-0.1.0/examples/02_rag_with_hf_and_verify.py +170 -0
  78. citeformer-0.1.0/examples/03_standalone_rendering.py +79 -0
  79. citeformer-0.1.0/examples/04_fetch_and_render.py +59 -0
  80. citeformer-0.1.0/examples/05_streaming.py +91 -0
  81. citeformer-0.1.0/examples/06_langchain_rag.py +135 -0
  82. citeformer-0.1.0/examples/07_llamaindex_rag.py +134 -0
  83. citeformer-0.1.0/examples/08_literature_review.ipynb +301 -0
  84. citeformer-0.1.0/examples/README.md +130 -0
  85. citeformer-0.1.0/hf-space/README.md +53 -0
  86. citeformer-0.1.0/hf-space/app.py +296 -0
  87. citeformer-0.1.0/hf-space/requirements.txt +2 -0
  88. citeformer-0.1.0/pyproject.toml +214 -0
  89. citeformer-0.1.0/src/citeformer/__init__.py +78 -0
  90. citeformer-0.1.0/src/citeformer/_version.py +8 -0
  91. citeformer-0.1.0/src/citeformer/backends/__init__.py +28 -0
  92. citeformer-0.1.0/src/citeformer/backends/anthropic.py +249 -0
  93. citeformer-0.1.0/src/citeformer/backends/base.py +91 -0
  94. citeformer-0.1.0/src/citeformer/backends/hf.py +285 -0
  95. citeformer-0.1.0/src/citeformer/backends/llamacpp.py +171 -0
  96. citeformer-0.1.0/src/citeformer/backends/mock.py +89 -0
  97. citeformer-0.1.0/src/citeformer/backends/openai.py +333 -0
  98. citeformer-0.1.0/src/citeformer/backends/vllm.py +133 -0
  99. citeformer-0.1.0/src/citeformer/citeformer.py +338 -0
  100. citeformer-0.1.0/src/citeformer/cli/__init__.py +9 -0
  101. citeformer-0.1.0/src/citeformer/cli/app.py +165 -0
  102. citeformer-0.1.0/src/citeformer/core.py +382 -0
  103. citeformer-0.1.0/src/citeformer/csl.py +311 -0
  104. citeformer-0.1.0/src/citeformer/grammar/__init__.py +31 -0
  105. citeformer-0.1.0/src/citeformer/grammar/builder.py +221 -0
  106. citeformer-0.1.0/src/citeformer/integrations/__init__.py +19 -0
  107. citeformer-0.1.0/src/citeformer/integrations/langchain.py +176 -0
  108. citeformer-0.1.0/src/citeformer/integrations/llamaindex.py +198 -0
  109. citeformer-0.1.0/src/citeformer/metadata/__init__.py +39 -0
  110. citeformer-0.1.0/src/citeformer/metadata/arxiv.py +143 -0
  111. citeformer-0.1.0/src/citeformer/metadata/bibtex.py +431 -0
  112. citeformer-0.1.0/src/citeformer/metadata/cache.py +38 -0
  113. citeformer-0.1.0/src/citeformer/metadata/crossref.py +94 -0
  114. citeformer-0.1.0/src/citeformer/metadata/pdf.py +111 -0
  115. citeformer-0.1.0/src/citeformer/metadata/url.py +151 -0
  116. citeformer-0.1.0/src/citeformer/metadata/zotero.py +116 -0
  117. citeformer-0.1.0/src/citeformer/prompts.py +143 -0
  118. citeformer-0.1.0/src/citeformer/py.typed +0 -0
  119. citeformer-0.1.0/src/citeformer/render/__init__.py +39 -0
  120. citeformer-0.1.0/src/citeformer/render/csl.py +96 -0
  121. citeformer-0.1.0/src/citeformer/render/formatters/__init__.py +95 -0
  122. citeformer-0.1.0/src/citeformer/render/formatters/_base.py +236 -0
  123. citeformer-0.1.0/src/citeformer/render/formatters/apa.py +257 -0
  124. citeformer-0.1.0/src/citeformer/render/formatters/chicago.py +236 -0
  125. citeformer-0.1.0/src/citeformer/render/formatters/ieee.py +227 -0
  126. citeformer-0.1.0/src/citeformer/render/formatters/mla.py +215 -0
  127. citeformer-0.1.0/src/citeformer/render/formatters/nature.py +197 -0
  128. citeformer-0.1.0/src/citeformer/render/formatters/vancouver.py +212 -0
  129. citeformer-0.1.0/src/citeformer/render/styles.py +41 -0
  130. citeformer-0.1.0/src/citeformer/verify/__init__.py +48 -0
  131. citeformer-0.1.0/src/citeformer/verify/coverage.py +96 -0
  132. citeformer-0.1.0/src/citeformer/verify/entailment.py +84 -0
  133. citeformer-0.1.0/src/citeformer/verify/existence.py +59 -0
  134. citeformer-0.1.0/src/citeformer/verify/nli.py +376 -0
  135. citeformer-0.1.0/src/citeformer/verify/report.py +127 -0
  136. citeformer-0.1.0/src/citeformer/verify/sentences.py +177 -0
  137. citeformer-0.1.0/src/citeformer/verify/verifier.py +138 -0
  138. citeformer-0.1.0/tests/integration/__init__.py +0 -0
  139. citeformer-0.1.0/tests/integration/test_hf_backend.py +220 -0
  140. citeformer-0.1.0/tests/integration/test_integrations_real_libs.py +131 -0
  141. citeformer-0.1.0/tests/integration/test_llamacpp_backend.py +109 -0
  142. citeformer-0.1.0/tests/integration/test_schemas/test_generation_result_canonical_snapshot.yml +33 -0
  143. citeformer-0.1.0/tests/integration/test_schemas/test_verification_report_canonical_snapshot.yml +21 -0
  144. citeformer-0.1.0/tests/integration/test_schemas.py +99 -0
  145. citeformer-0.1.0/tests/integration/test_verify_nli.py +153 -0
  146. citeformer-0.1.0/tests/integration/test_vllm_backend.py +93 -0
  147. citeformer-0.1.0/tests/unit/cassettes/test_extract_url_returns_metadata_and_content.yaml +53 -0
  148. citeformer-0.1.0/tests/unit/cassettes/test_fetch_arxiv_returns_csl_json_with_abstract.yaml +88 -0
  149. citeformer-0.1.0/tests/unit/cassettes/test_fetch_arxiv_strips_version_suffix.yaml +88 -0
  150. citeformer-0.1.0/tests/unit/cassettes/test_fetch_crossref_accepts_url_and_prefixed_forms.yaml +862 -0
  151. citeformer-0.1.0/tests/unit/cassettes/test_fetch_crossref_returns_csl_json.yaml +432 -0
  152. citeformer-0.1.0/tests/unit/cassettes/test_source_from_arxiv_puts_abstract_in_content.yaml +88 -0
  153. citeformer-0.1.0/tests/unit/cassettes/test_source_from_doi_builds_source.yaml +432 -0
  154. citeformer-0.1.0/tests/unit/cassettes/test_source_from_url_builds_source.yaml +53 -0
  155. citeformer-0.1.0/tests/unit/test_api_backends.py +337 -0
  156. citeformer-0.1.0/tests/unit/test_backends_mock.py +61 -0
  157. citeformer-0.1.0/tests/unit/test_bibtex_zotero.py +311 -0
  158. citeformer-0.1.0/tests/unit/test_citeformer.py +81 -0
  159. citeformer-0.1.0/tests/unit/test_cli.py +103 -0
  160. citeformer-0.1.0/tests/unit/test_core.py +145 -0
  161. citeformer-0.1.0/tests/unit/test_csl_suite/test_csl_suite_snapshot_apa_7.yml +173 -0
  162. citeformer-0.1.0/tests/unit/test_csl_suite/test_csl_suite_snapshot_chicago_author_date.yml +175 -0
  163. citeformer-0.1.0/tests/unit/test_csl_suite/test_csl_suite_snapshot_ieee.yml +178 -0
  164. citeformer-0.1.0/tests/unit/test_csl_suite/test_csl_suite_snapshot_mla_9.yml +174 -0
  165. citeformer-0.1.0/tests/unit/test_csl_suite/test_csl_suite_snapshot_nature.yml +171 -0
  166. citeformer-0.1.0/tests/unit/test_csl_suite/test_csl_suite_snapshot_vancouver.yml +167 -0
  167. citeformer-0.1.0/tests/unit/test_csl_suite.py +757 -0
  168. citeformer-0.1.0/tests/unit/test_csl_validation.py +133 -0
  169. citeformer-0.1.0/tests/unit/test_dedupe.py +66 -0
  170. citeformer-0.1.0/tests/unit/test_formatters.py +291 -0
  171. citeformer-0.1.0/tests/unit/test_formatters_edge_cases.py +268 -0
  172. citeformer-0.1.0/tests/unit/test_fuzz.py +562 -0
  173. citeformer-0.1.0/tests/unit/test_grammar_builder/test_grammar_auto_snapshot.yml +18 -0
  174. citeformer-0.1.0/tests/unit/test_grammar_builder/test_grammar_quotes_only_snapshot.yml +22 -0
  175. citeformer-0.1.0/tests/unit/test_grammar_builder/test_grammar_required_custom_bound_snapshot.yml +21 -0
  176. citeformer-0.1.0/tests/unit/test_grammar_builder/test_grammar_required_snapshot.yml +22 -0
  177. citeformer-0.1.0/tests/unit/test_grammar_builder/test_grammar_required_unbounded_snapshot.yml +22 -0
  178. citeformer-0.1.0/tests/unit/test_grammar_builder/test_grammar_scales_cite_id_with_n_sources.yml +29 -0
  179. citeformer-0.1.0/tests/unit/test_grammar_builder.py +200 -0
  180. citeformer-0.1.0/tests/unit/test_integrations.py +226 -0
  181. citeformer-0.1.0/tests/unit/test_marker_styles.py +124 -0
  182. citeformer-0.1.0/tests/unit/test_metadata_cache.py +35 -0
  183. citeformer-0.1.0/tests/unit/test_metadata_fetchers.py +128 -0
  184. citeformer-0.1.0/tests/unit/test_metadata_pdf.py +81 -0
  185. citeformer-0.1.0/tests/unit/test_nli_chunking.py +293 -0
  186. citeformer-0.1.0/tests/unit/test_prompts.py +162 -0
  187. citeformer-0.1.0/tests/unit/test_render_csl/test_render_snapshot_apa_7.yml +14 -0
  188. citeformer-0.1.0/tests/unit/test_render_csl/test_render_snapshot_chicago_author_date.yml +15 -0
  189. citeformer-0.1.0/tests/unit/test_render_csl/test_render_snapshot_ieee.yml +16 -0
  190. citeformer-0.1.0/tests/unit/test_render_csl/test_render_snapshot_mla_9.yml +15 -0
  191. citeformer-0.1.0/tests/unit/test_render_csl/test_render_snapshot_nature.yml +14 -0
  192. citeformer-0.1.0/tests/unit/test_render_csl/test_render_snapshot_vancouver.yml +14 -0
  193. citeformer-0.1.0/tests/unit/test_render_csl.py +197 -0
  194. citeformer-0.1.0/tests/unit/test_render_styles.py +62 -0
  195. citeformer-0.1.0/tests/unit/test_streaming.py +156 -0
  196. citeformer-0.1.0/tests/unit/test_verify.py +297 -0
  197. citeformer-0.1.0/tests/unit/test_version.py +17 -0
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: contract-reviewer
3
+ description: Reviews a diff or set of changes for compliance with citeformer's three §10 contracts (grammar shape, CSL metadata, output schemas). Use when the user asks whether a change is safe, or before opening a PR that touches src/citeformer/grammar/, src/citeformer/core.py, or src/citeformer/verify/report.py.
4
+ tools: Read, Grep, Glob, Bash
5
+ model: inherit
6
+ ---
7
+
8
+ You are the contract reviewer for citeformer. Your job is to audit a diff or set of changes against the three §10 contracts documented in [`docs/reference/contracts.md`](docs/reference/contracts.md).
9
+
10
+ ## The three contracts
11
+
12
+ 1. **§10.1 — Citation marker grammar.** `cite-id ::= "[" <digits> "]"` (GBNF) and the three policies (`required`, `quotes_only`, `auto`). Anything touching `src/citeformer/grammar/` or the `Policy` enum is a contract touch.
13
+ 2. **§10.2 — `Source.metadata` shape.** CSL-JSON item. Changing required fields or renaming fields breaks it; adding optionals is additive.
14
+ 3. **§10.3 — Output schemas.** `GenerationResult` and `VerificationReport` pydantic models carry `schema_version: 1`. Any shape change requires a `schema_version` bump.
15
+
16
+ ## Your process
17
+
18
+ 1. Read the relevant diff (pull from `git diff main...HEAD` or what the user surfaces).
19
+ 2. For each contract, classify as one of:
20
+ - **Untouched** — no relevant file changed.
21
+ - **Additive** — field added, new policy, new CSL field passed through; minor bump.
22
+ - **Breaking** — renamed/removed field, changed grammar shape, removed policy; major bump, `schema_version` must be bumped.
23
+ 3. For each touched contract, verify:
24
+ - Snapshot regression tests were regenerated (grep `pytest-regressions` snapshot dirs).
25
+ - `schema_version` was bumped if breaking §10.3.
26
+ - CHANGELOG `[Unreleased]` entry notes the change under a "Contracts (§10)" section.
27
+ - The PR template's "Invariant touched?" section is filled.
28
+
29
+ ## Output
30
+
31
+ A terse report:
32
+
33
+ ```
34
+ §10.1 grammar shape: Untouched
35
+ §10.2 CSL metadata: Additive (added `abstract` passthrough to Source.metadata). Snapshot regenerated. OK.
36
+ §10.3 output schemas: Breaking (renamed `GenerationResult.text` → `body`). Missing: schema_version bump. BLOCKING.
37
+
38
+ Recommended bump: MAJOR.
39
+ ```
40
+
41
+ Be direct. Don't hedge. If a ceremony step is missing, say so clearly.
@@ -0,0 +1,29 @@
1
+ ---
2
+ description: Bump version in _version.py and move [Unreleased] → [X.Y.Z] in CHANGELOG. Stops before commit.
3
+ argument-hint: "[patch|minor|major]"
4
+ ---
5
+
6
+ Bump the citeformer version. Usage: `/bump patch` (or `minor`, or `major`).
7
+
8
+ ## What to do
9
+
10
+ 1. Read current `src/citeformer/_version.py` — parse `__version__`.
11
+ 2. Compute new version per the requested bump type (patch / minor / major).
12
+ 3. Write the new version into `src/citeformer/_version.py`.
13
+ 4. Read `CHANGELOG.md`.
14
+ 5. Rename the `## [Unreleased]` section to `## [X.Y.Z] — YYYY-MM-DD` using today's date (UTC).
15
+ 6. Insert a new empty `## [Unreleased]` section above it.
16
+ 7. Update the compare link at the bottom: `[Unreleased]: .../compare/vX.Y.Z...HEAD` and add `[X.Y.Z]: .../releases/tag/vX.Y.Z`.
17
+ 8. Print a summary: old version, new version, dated entries.
18
+
19
+ ## Stop before committing
20
+
21
+ Do NOT run `git add`, `git commit`, or `git tag`. That's the user's decision — they may want to amend the changelog, add a release-note paragraph, etc.
22
+
23
+ ## Rubric for picking the bump type (if the user didn't)
24
+
25
+ - **Patch** — bug fixes, doc clarifications, additive internal refactors, dependency pins that don't change public API.
26
+ - **Minor** — new features, additive §10 contract changes (new CSL field passed through, new policy), `schema_version` additive with same number.
27
+ - **Major** — §10 contract break: renamed/removed CSL field, renamed `GenerationResult` field, changed citation marker shape, dropped policy. Must include a `schema_version` bump on the affected model.
28
+
29
+ If in doubt, run `/contract-check` first to confirm the bump level.
@@ -0,0 +1,20 @@
1
+ ---
2
+ description: Audit a diff against citeformer's three §10 contracts (grammar, CSL metadata, output schemas).
3
+ ---
4
+
5
+ Review the pending changes (compared to `main`) for §10 contract compliance. Delegates the heavy lifting to the `contract-reviewer` agent.
6
+
7
+ ## Steps
8
+
9
+ 1. Run `git diff main...HEAD` (or `git diff --cached` if the user specified pre-commit).
10
+ 2. Launch the `contract-reviewer` agent with the diff as context. Ask it to classify each contract touch as Untouched / Additive / Breaking and to verify the required ceremony happened.
11
+ 3. Surface the agent's report verbatim to the user.
12
+ 4. If the report says BLOCKING on any contract, do not suggest moving to `/bump` yet. If it's all OK / additive, print the recommended bump level (patch / minor / major) the agent concluded.
13
+
14
+ ## What counts as a contract touch
15
+
16
+ - §10.1 — any file under `src/citeformer/grammar/`, or the `Policy` enum in `src/citeformer/core.py`.
17
+ - §10.2 — the CSL-JSON consumer in `src/citeformer/render/csl.py` or the `Source.metadata` type annotation in `src/citeformer/core.py`.
18
+ - §10.3 — `GenerationResult` or `VerificationReport` pydantic models (search for `schema_version` and nearby fields).
19
+
20
+ See [docs/reference/contracts.md](docs/reference/contracts.md) for the full ceremony.
@@ -0,0 +1,25 @@
1
+ ---
2
+ description: Dry-run preflight for a release. Zero side effects.
3
+ ---
4
+
5
+ Run all the checks a release tag push would run, without pushing or committing anything.
6
+
7
+ ## Steps
8
+
9
+ 1. `make lint` — ruff check, ruff format check, mypy strict.
10
+ 2. `make test` — full pytest suite.
11
+ 3. `make docs-build` — Sphinx build with `-W` (warnings are errors).
12
+ 4. `uv build` — builds sdist + wheel into `dist/`. Verifies the package is actually buildable.
13
+ 5. `uv run python -c "import citeformer; print(citeformer.__version__)"` — sanity-check the installed version.
14
+ 6. Grep for any lingering TODO / FIXME / XXX markers in `src/` and flag them (non-blocking, but worth noting for the release narrative).
15
+ 7. Verify `CHANGELOG.md` has content under `[Unreleased]` (or has been freshly bumped to a new version).
16
+
17
+ ## Output
18
+
19
+ Terse summary of pass/fail per step. On failure, say exactly which step failed and surface the relevant error output — don't hide it.
20
+
21
+ If everything passes: print `release-check: OK — version X.Y.Z ready`.
22
+
23
+ ## No side effects
24
+
25
+ Do not commit, tag, push, or modify any tracked file. `dist/` is gitignored and safe to leave behind.
@@ -0,0 +1,22 @@
1
+ ---
2
+ description: Full release pipeline — preflight, bump, commit, tag. Pushes only if --direct.
3
+ argument-hint: "[patch|minor|major] [--direct]"
4
+ ---
5
+
6
+ End-to-end release flow for citeformer. Usage: `/release minor` (opens a PR) or `/release minor --direct` (pushes main + tag directly; requires permission).
7
+
8
+ ## Steps
9
+
10
+ 1. **Preflight** — run `/release-check` and confirm green. If anything fails, stop.
11
+ 2. **Bump** — invoke `/bump <type>` to update `_version.py` + `CHANGELOG.md`.
12
+ 3. **Commit** — stage `src/citeformer/_version.py` + `CHANGELOG.md`, commit with message `release: vX.Y.Z`.
13
+ 4. **Tag** — create `vX.Y.Z` annotated tag locally.
14
+ 5. **Push**:
15
+ - **Default (no flag)**: open a branch `release/vX.Y.Z`, push it, open a PR via `gh pr create` titled `release: vX.Y.Z` with the new changelog section as the body. Human review + merge required before the tag hits main. Tag lands when someone pushes it after merge.
16
+ - **With `--direct`**: push `main` and the tag directly (`git push origin main && git push origin vX.Y.Z`). Only use this for patch releases on a clean branch; the GitHub Actions release workflow triggers on the tag.
17
+
18
+ ## Safety
19
+
20
+ - Do not invoke `--direct` unless the user explicitly asked for it.
21
+ - Never force-push.
22
+ - Confirm the version in `_version.py` matches the tag before pushing.
@@ -0,0 +1,29 @@
1
+ {
2
+ "version": "0.0.1",
3
+ "configurations": [
4
+ {
5
+ "name": "docs-preview",
6
+ "runtimeExecutable": "uv",
7
+ "runtimeArgs": [
8
+ "run",
9
+ "sphinx-autobuild",
10
+ "-a",
11
+ "--watch",
12
+ "src",
13
+ "docs",
14
+ "docs/_build/html",
15
+ "--host",
16
+ "127.0.0.1",
17
+ "--port",
18
+ "5190"
19
+ ],
20
+ "port": 5190
21
+ },
22
+ {
23
+ "name": "pytest-watch",
24
+ "runtimeExecutable": "uv",
25
+ "runtimeArgs": ["run", "pytest", "--lf", "--ff", "-x"],
26
+ "description": "Re-run pytest focused on last-failed, first-failed."
27
+ }
28
+ ]
29
+ }
@@ -0,0 +1,160 @@
1
+ ---
2
+ name: add-citation-format
3
+ description: Add a new CSL citation style as a CitationFormatter subclass in src/citeformer/render/formatters/. Covers the template, required test matrix, and registration steps.
4
+ ---
5
+
6
+ # Adding a new citation format
7
+
8
+ A citeformer style is a `CitationFormatter` subclass that turns a CSL-JSON
9
+ item (our `Source.metadata` shape) into an inline marker + bibliography
10
+ entry. The goal of this skill is to land a new style — e.g. APSA, ACS,
11
+ AMA, a journal-specific one — with the same quality bar as the six
12
+ built-ins (APA, MLA, Chicago, IEEE, Nature, Vancouver).
13
+
14
+ ## When to use this
15
+
16
+ - A user asks for a new citation style that isn't in `bundled_style_names()`.
17
+ - You're adapting citeformer to a house / journal / school style that
18
+ isn't covered by the six built-ins.
19
+ - A bundled style has drifted out of spec and needs a rewrite.
20
+
21
+ Skip this if the user just wants a one-off citation they can copy-paste
22
+ manually — the formatters are for repeated use.
23
+
24
+ ## Steps
25
+
26
+ ### 1. Research the style
27
+
28
+ Find an authoritative source: the style's own manual (CMOS, MLA Handbook,
29
+ APA Publication Manual, ICMJE), a university library guide, or the
30
+ official `.csl` file at https://github.com/citation-style-language/styles.
31
+ Write down:
32
+
33
+ - The `citation_format` classification (author-date / author / numeric / note / label).
34
+ - The inline marker shape (examples: `(Smith, 2023)`, `[1]`, `(Smith 45)`).
35
+ - The bibliography entry shape for **at least these five CSL types**:
36
+ - `book`
37
+ - `article-journal`
38
+ - `chapter`
39
+ - `thesis`
40
+ - `paper-conference`
41
+ - The author-name format (`Last, First` / `F. M. Last` / `Last FF`) and
42
+ the `et al.` threshold for the bibliography and for inline cites.
43
+ - Page-range conventions: en-dash (`45–67`), hyphen, or `pp. ` prefix.
44
+
45
+ Three short examples of each type from the style manual, copied verbatim,
46
+ are the ground truth for your tests.
47
+
48
+ ### 2. Copy the closest existing formatter
49
+
50
+ Pick the most similar built-in as a starting point:
51
+
52
+ - Numeric scientific style → clone `nature.py` or `ieee.py`.
53
+ - Author-date social-sciences style → clone `apa.py` or `chicago.py`.
54
+ - Author-only / MLA-style → clone `mla.py`.
55
+ - Biomedical numeric (NLM / ICMJE-adjacent) → clone `vancouver.py`.
56
+
57
+ ```bash
58
+ cp src/citeformer/render/formatters/nature.py \
59
+ src/citeformer/render/formatters/<new-style>.py
60
+ ```
61
+
62
+ ### 3. Adapt the formatter
63
+
64
+ Rename the class (`<Name>Formatter`), set the `name` and `citation_format`
65
+ class attributes, and rewrite the `inline()` + `_article`, `_book`,
66
+ `_chapter`, `_thesis`, `_paper_conference`, `_webpage` methods. Keep
67
+ bodies direct — `chunks: list[str] = []` + conditional appends + `" "
68
+ .join(...)` is the pattern. Reach for helpers in `_base.py` first:
69
+
70
+ - `parse_authors(raw)` / `parse_year(issued)` / `get_str(item, key)` /
71
+ `get_title(item)` — robust CSL-JSON accessors.
72
+ - `format_page_range(pages, dash="–")` — hyphen/en-dash/em-dash handling.
73
+ - `format_doi(doi)` — `10.1/x` → `https://doi.org/10.1/x`.
74
+ - `ensure_period(text)` — append a `.` only if one isn't already there
75
+ (critical for author lists that end with initials).
76
+
77
+ If the style needs a new helper, add it to `_base.py` first (shared), not
78
+ inline in the formatter.
79
+
80
+ ### 4. Register the formatter
81
+
82
+ Edit `src/citeformer/render/formatters/__init__.py`:
83
+
84
+ 1. Import the new class.
85
+ 2. Add an entry to `_REGISTRY` for each name/alias the style uses (e.g.
86
+ `"apsa"` and `"apsa-2018"` both pointing at `APSAFormatter`).
87
+ 3. Append the canonical name to `_CANONICAL`.
88
+ 4. Append the class name to `__all__`.
89
+
90
+ ### 5. Test
91
+
92
+ Add a test file `tests/unit/test_formatters.py` entries (not a new file —
93
+ append to the existing one). Follow the pattern:
94
+
95
+ ```python
96
+ def test_<style>_inline_marker_shape() -> None:
97
+ f = get_formatter("<style>")
98
+ assert f.inline(_book(), 1) == "(Expected, 2023)" # or "[1]" etc.
99
+
100
+ def test_<style>_bib_starts_correctly() -> None:
101
+ f = get_formatter("<style>")
102
+ out = f.bibliography(_article(), 1)
103
+ assert out.startswith("Expected prefix")
104
+ assert "Journal of X" in out
105
+ ```
106
+
107
+ Also add a snapshot in `tests/unit/test_render_csl.py`:
108
+
109
+ ```python
110
+ def test_render_snapshot_<style>(data_regression) -> None:
111
+ refs = render_references(_canonical_sources(), _full_citations(), "<style>")
112
+ data_regression.check(_refs_dict(refs))
113
+ ```
114
+
115
+ Run the snapshot twice to create + lock it:
116
+
117
+ ```bash
118
+ uv run pytest tests/unit/test_render_csl.py -k <style> # creates the .yml
119
+ uv run pytest tests/unit/test_render_csl.py -k <style> # verifies match
120
+ ```
121
+
122
+ Eyeball the generated YAML against the ground-truth examples you wrote
123
+ down in step 1. If the output is wrong, fix the formatter *before*
124
+ committing the snapshot.
125
+
126
+ ### 6. Document
127
+
128
+ - `docs/decisions/003-bundle-five-csl-styles.md` — if you're growing the
129
+ bundled set, update the canonical list here. Any addition is an
130
+ additive change (minor bump); a replacement (dropping a bundled style)
131
+ is a §10-adjacent break.
132
+ - `CHANGELOG.md` — add an `[Unreleased]` entry under "Added" describing
133
+ the new style and pointing at the skill's invocation.
134
+ - `README.md` — bump the "bundled styles" mention if it's hard-coded.
135
+
136
+ ### 7. Run the full suite
137
+
138
+ ```bash
139
+ make lint && make test && make docs-build
140
+ ```
141
+
142
+ The `test_every_style_renders_canonical_types_without_error` parametrized
143
+ test automatically covers the new style once it's registered — make sure
144
+ it passes without errors for every fixture type.
145
+
146
+ ## Red flags
147
+
148
+ - **Double periods** in output (`Smith, E. A..`) — use `ensure_period()`
149
+ on any chunk that might already end in `.`. This bit Nature in the
150
+ initial rewrite.
151
+ - **Missing fallbacks**: a formatter that raises on missing `author` or
152
+ `year` is broken. APA uses `"Anon"` and `"n.d."`; other styles should
153
+ follow a similar convention.
154
+ - **Silent wrong output**: if `get_str(item, "foo")` returns None for a
155
+ required field, the formatter should still produce *something*. Skip
156
+ the section, don't inject an empty string that screws up the spacing.
157
+ - **Adding a style-specific CSL file**: don't. Our value is in the Python
158
+ formatters, not in hand-rolling CSL XML. If a style genuinely needs
159
+ features we don't have, the user can install `citeformer[citeproc-compat]`
160
+ and provide their own `.csl` file.
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: contract-invariant
3
+ description: Before modifying src/citeformer/grammar/, src/citeformer/core.py, or src/citeformer/verify/report.py, remember these are §10 contract files. Touching them requires ceremony — not silent edits.
4
+ ---
5
+
6
+ # Contract invariant — §10 ceremony
7
+
8
+ Three files carry §10 contracts. Edits require a ceremony, not a silent commit.
9
+
10
+ ## §10.1 — `src/citeformer/grammar/`
11
+
12
+ Changes the grammar shape (`cite-id` rule) or the semantics of a policy (`required` / `quotes_only` / `auto`).
13
+
14
+ **Ceremony:**
15
+ 1. Regenerate `tests/unit/test_grammar_builder.py` snapshots via `pytest --regen-all tests/unit/test_grammar_builder.py`.
16
+ 2. Classify the change:
17
+ - Adding a new policy → **minor** bump.
18
+ - Changing an existing policy's semantics → **major** bump.
19
+ - Changing the `cite-id` rule shape → **major** bump.
20
+ 3. Add a "Contracts (§10)" section to `CHANGELOG.md` [Unreleased] noting the change.
21
+ 4. Fill the PR template's "Invariant touched?" section with §10.1.
22
+
23
+ ## §10.2 — `src/citeformer/core.py` (`Source.metadata` type) + `src/citeformer/render/csl.py`
24
+
25
+ Changes the expected CSL-JSON shape that `Source.metadata` must conform to (and that `citeproc-py` consumes).
26
+
27
+ **Ceremony:**
28
+ 1. Regenerate `tests/unit/test_csl_rendering.py` snapshots (`pytest --regen-all tests/unit/test_csl_rendering.py`).
29
+ 2. Classify:
30
+ - Passing through a new optional CSL field → **minor**.
31
+ - Renaming / removing a field we read → **major**.
32
+ 3. CHANGELOG + PR template as above.
33
+
34
+ ## §10.3 — `GenerationResult` + `VerificationReport`
35
+
36
+ Pydantic models with `schema_version: 1`. Any shape change bumps `schema_version` AND requires PR-description callout.
37
+
38
+ **Ceremony:**
39
+ 1. Bump `schema_version` on the owning model (1 → 2, etc.).
40
+ 2. Update `tests/integration/test_generation_result_schema.py` or `test_verification_report_schema.py`.
41
+ 3. Document migration path in CHANGELOG if the change is breaking.
42
+ 4. CHANGELOG + PR template as above.
43
+
44
+ ## The meta-rule
45
+
46
+ If you're editing one of these files and you haven't thought about which contract you're touching — **stop**. Run `/contract-check` first. "I didn't think it was a contract change" is how breaking changes ship as patches and ruin everyone's week.
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: grammar-shape
3
+ description: The cite-id rule and per-policy grammar bodies in src/citeformer/grammar/ are §10.1 load-bearing. Tokenizer alignment, marker shape, and policy semantics matter. Read before editing.
4
+ ---
5
+
6
+ # Grammar shape
7
+
8
+ The grammar machinery in `src/citeformer/grammar/` is where citeformer's core guarantee lives. Getting this wrong breaks the "structurally impossible to fabricate" promise.
9
+
10
+ ## The load-bearing rule
11
+
12
+ GBNF format (xgrammar / llama.cpp / llguidance native):
13
+
14
+ ```
15
+ cite-id ::= "[" ("1" | "2" | ... | "N") "]"
16
+ ```
17
+
18
+ `("1" | "2" | ... | "N")` is the `<digits>` enum from the §10.1 contract — dynamically constrained at decode time to the 1-indexed source ids in scope. This is what makes fabricating a citation to a non-existent source a logit-level impossibility when the backend masks against the grammar.
19
+
20
+ ## Why GBNF and not Lark
21
+
22
+ xgrammar's `compile_grammar()` expects GBNF (`rule ::= production`) rather than Lark (`rule: production`). llama.cpp's constrained-decoding also uses GBNF natively. We emit GBNF directly from `build_grammar()` to keep the pipeline one hop — no Lark→GBNF translator in the middle. Earlier iterations used Lark (with a now-removed `parse_ok` helper); the switch landed in P2b. See [`docs/reference/contracts.md`](../../../docs/reference/contracts.md) for the ceremony around DSL changes.
23
+
24
+ ## Tokenizer alignment
25
+
26
+ `[1]` tokenizes differently across models — one token for GPT-2, three tokens for Llama, sometimes fragmented across whitespace for Mistral. XGrammar handles this via `TokenizerInfo.from_huggingface()`, but only if the grammar and the tokenizer info agree. Red flags:
27
+
28
+ - Hardcoding assumptions about token boundaries in code that calls xgrammar.
29
+ - Using `" ["` (with a leading space) unless you've confirmed the tokenizer aligns — xgrammar will still mask correctly, but it's a sign of shaky reasoning.
30
+ - Passing `tokenizer.vocab_size` instead of `config.vocab_size` to `TokenizerInfo.from_huggingface()` — these can differ, and the mismatch silently misaligns logit indices.
31
+
32
+ ## Per-policy grammar bodies
33
+
34
+ Each policy lays different rules on top of `cite-id`:
35
+
36
+ - **`required`** — every sentence must end with at least one `cite-group`. GBNF:
37
+
38
+ ```
39
+ root ::= sentence (ws sentence)*
40
+ sentence ::= content cite-group sent-end
41
+ content ::= [^\[.!?]+
42
+ sent-end ::= "." | "!" | "?"
43
+ ```
44
+
45
+ - **`quotes_only`** — only quoted spans require a cite. GBNF:
46
+
47
+ ```
48
+ root ::= (text | quoted-cite)+
49
+ quoted-cite ::= quote cite-group
50
+ quote ::= "\"" [^"]* "\""
51
+ ```
52
+
53
+ - **`auto`** — cite-group optional everywhere. GBNF:
54
+
55
+ ```
56
+ root ::= (text | cite-group)+
57
+ text ::= [^\[]+
58
+ ```
59
+
60
+ Adding a new policy = new body + new snapshot in `tests/unit/test_grammar_builder.py`. That's a §10.1 additive change (minor bump).
61
+
62
+ ## What NOT to do
63
+
64
+ - **Don't change the marker shape without a major bump.** Users in the wild may have downstream parsers keyed on `[N]`.
65
+ - **Don't embed policy-specific masking into the backend layer.** The grammar is computed in `grammar/builder.py` and handed down; backends only see the compiled GBNF.
66
+ - **Don't skip the `test_hf_backend_grammar_compiles` integration test** when touching the grammar. That's the authoritative syntax check — xgrammar's parser rejecting your grammar is the definitive "this is broken".
67
+
68
+ ## Design rationale
69
+
70
+ Why `[N]` instead of `(Smith 2023)`?
71
+
72
+ - `[N]` is tokenizer-friendly across every model we care about.
73
+ - `[N]` is trivially parseable client-side for post-processing.
74
+ - `[N]` decouples inline markers from metadata — the number is an index, not a semantic claim. Rendering `(Smith 2023)` from the same internal representation is a `render/inline.py` responsibility (P3), not a grammar responsibility.
75
+
76
+ If someone wants numeric-alphabetic markers, author-year markers, or footnote-style markers in the *rendered* output, that's a render-layer choice, not a grammar change.
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: piggyback-first
3
+ description: Before writing new code in citeformer, consult the piggyback map. The hard work — token masking, CSL rendering, PDF extraction, NLI — already lives in well-maintained deps. We compose; we don't reinvent.
4
+ ---
5
+
6
+ # Piggyback-first
7
+
8
+ Before writing new code in citeformer, ask: **is this already done by one of the libraries we depend on?**
9
+
10
+ The piggyback map lives in `docs/reference/architecture.md`. The short version:
11
+
12
+ | We piggyback on | For |
13
+ |---|---|
14
+ | **XGrammar** / **llguidance** | Token-level logit masking |
15
+ | **transformers** / **vLLM** / **llama-cpp-python** | Running the model |
16
+ | **citeproc-py** + CSL styles repo | Reference-list rendering |
17
+ | **lark** | Authoring grammars before handoff |
18
+ | **httpx** + **diskcache** | Metadata fetchers with caching |
19
+ | **grobid-client-python** | PDF extraction |
20
+ | **readability-lxml** | URL extraction |
21
+ | **DeBERTa-v3-MNLI** via transformers | Entailment verification |
22
+
23
+ ## What citeformer actually owns
24
+
25
+ - The **citation grammar shape** (§10.1 contract) — `cite-id` GBNF rule + policy rules.
26
+ - The **CSL-JSON source metadata contract** (§10.2).
27
+ - The **output pydantic models** and their schema versions (§10.3).
28
+ - The **inline-marker-to-reference coupling** (no reference without a matching marker; no marker without a reference).
29
+ - The **orchestration loop** — fetching metadata, building the grammar, handing to the backend, decoding output, rendering references, verifying.
30
+
31
+ Everything else should compose something else.
32
+
33
+ ## Red flags
34
+
35
+ If you catch yourself doing any of these, stop and check whether a dep already solves it:
36
+
37
+ - Writing a token-by-token sampling loop. (Use XGrammar / llguidance.)
38
+ - Parsing CSL style XML. (Use citeproc-py.)
39
+ - Reimplementing PDF layout extraction. (Use GROBID.)
40
+ - Rolling a BibTeX parser. (Use pybtex or citeproc-py's bib support.)
41
+ - Computing entailment from scratch. (Use DeBERTa-v3-MNLI.)
42
+
43
+ When the answer is genuinely "no existing dep does this" — document why in a code comment, with the dep you considered and the gap you found.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: release-bump
3
+ description: Use this rubric when deciding between patch, minor, and major version bumps for citeformer. Patch bumps are cheap — prefer frequent small releases over feature-batching.
4
+ ---
5
+
6
+ # Release bump rubric
7
+
8
+ citeformer versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html), with patch bumps preferred over feature-batching.
9
+
10
+ ## Patch — bug fixes, docs, internal refactors
11
+
12
+ Pick patch if:
13
+
14
+ - You fixed a bug without changing the public API.
15
+ - You clarified documentation, typos, or examples.
16
+ - You refactored internals with no user-visible effect.
17
+ - You pinned a dependency tighter (e.g. `torch>=2.4` → `torch>=2.5`) for a compatibility reason.
18
+ - You updated CI, build, or tooling configs.
19
+
20
+ ## Minor — new features or additive contract changes
21
+
22
+ Pick minor if:
23
+
24
+ - You added a new public function, class, backend, policy, CSL style, or metadata adapter.
25
+ - You added a new optional parameter to an existing function.
26
+ - You added a new optional dependency extra.
27
+ - You added a new field to `Source.metadata` passthrough (§10.2 additive).
28
+ - You added a new policy (§10.1 additive — e.g. `numeric_only` alongside `required`/`quotes_only`/`auto`).
29
+ - You added a new field to `GenerationResult` or `VerificationReport` without bumping `schema_version` (§10.3 additive; fields are non-breaking because existing consumers ignore them).
30
+
31
+ ## Major — §10 contract break
32
+
33
+ Pick major if any of the three §10 contracts is *broken* (not additive):
34
+
35
+ - **§10.1** — the `cite-id` rule shape changes; the semantics of an existing policy change; a policy is removed.
36
+ - **§10.2** — a field is renamed or removed from the `Source.metadata` expected shape.
37
+ - **§10.3** — a field is renamed or removed from `GenerationResult` or `VerificationReport`; `schema_version` must be bumped (1 → 2).
38
+
39
+ Major bumps must include:
40
+
41
+ - A `schema_version` bump on the affected model (§10.3 only).
42
+ - A CHANGELOG `Contracts (§10)` section describing the break and the migration path.
43
+ - `contracts:breaking` PR label if the CI enforces it.
44
+
45
+ ## When in doubt
46
+
47
+ - Unsure whether a change is additive or breaking? Run `/contract-check`. The agent will classify and tell you the recommended bump.
48
+ - Unsure whether a fix is a bug or a behavior change? If it changes observable output for any valid input, it's at least minor. If it changes the shape of the output, it's probably major.
49
+
50
+ ## Cadence
51
+
52
+ Target 1–2 patch releases per week while the repo is under active development. Minor releases land when a phase completes (P1, P2, …) or when a coherent feature batch is ready. Major releases are rare by construction — they only come from contract breaks.
@@ -0,0 +1,24 @@
1
+ # citeformer environment variables
2
+ #
3
+ # Copy to .env and fill in values, then `source .env` (or use direnv / a
4
+ # tool like `dotenv`) to load them into your shell. .env is gitignored.
5
+ #
6
+ # None of these are required for P0 scaffolding. They come online in later
7
+ # phases as noted.
8
+
9
+ # --- P2 + (HF backend) --------------------------------------------------
10
+ # Hugging Face token, required only for gated models (Llama 3.2, Gemma, etc.).
11
+ # The default example model `microsoft/Phi-3.5-mini-instruct` is open-access
12
+ # and does not need a token. Create a token at:
13
+ # https://huggingface.co/settings/tokens
14
+ HF_TOKEN=
15
+
16
+ # Optional: where HF downloads and caches weights. Defaults to ~/.cache/huggingface.
17
+ # Pointing at a shared path keeps multiple citeformer projects from re-downloading.
18
+ # HUGGINGFACE_HUB_CACHE=
19
+
20
+ # --- P4 + (Crossref metadata fetcher) -----------------------------------
21
+ # Polite-pool email for Crossref's REST API. Not required, but including
22
+ # one puts requests in Crossref's fast lane and is good API citizenship.
23
+ # See: https://api.crossref.org/swagger-ui/index.html#tips
24
+ # CITEFORMER_CROSSREF_MAILTO=
@@ -0,0 +1,31 @@
1
+ <!--
2
+ Thanks for the PR! A few quick things before you click Create:
3
+
4
+ 1. CHANGELOG.md has an [Unreleased] entry describing the change.
5
+ 2. `make lint && make test && make docs-build` all pass locally.
6
+ 3. If you touched a §10 contract (grammar shape, CSL metadata schema, output
7
+ schema_version), `/contract-check` is clean and the ceremony note below is filled.
8
+ -->
9
+
10
+ ## Summary
11
+
12
+ <!-- One paragraph: what changed and why. -->
13
+
14
+ ## Invariant touched?
15
+
16
+ <!-- Which §10 contract, if any, was affected? Options:
17
+ - None — no contract changed.
18
+ - §10.1 grammar shape — the citation marker terminal or per-policy grammar rules changed.
19
+ - §10.2 CSL metadata — the expected CSL-JSON shape on Source.metadata changed.
20
+ - §10.3 output schemas — GenerationResult or VerificationReport schema_version bumped.
21
+ If yes, describe the ceremony (snapshot regenerated? schema_version bumped? etc.). -->
22
+
23
+ None.
24
+
25
+ ## Test plan
26
+
27
+ <!-- Bulleted checklist: what you ran, what you verified. -->
28
+
29
+ - [ ] `make lint` green
30
+ - [ ] `make test` green
31
+ - [ ] `make docs-build` green (if docs touched)