Worked Examples
Developer reference for citation management — Reporting Studio
Examine proposed citation-management contracts for canonical source identities, claim-to-source links, style rendering, revision persistence, rights, and export consistency.
Application: Reporting Studio
Related applications: Citation Studio / Library / Research / Workspace / Workbench / Research Hub / Platform Core
Classification: Developer Reference / Citation Management
Technical level: Advanced
Audience: Backend developers, editor engineers, scientific software engineers, platform architects, QA engineers, and publication administrators
Estimated reading time: 18–22 minutes, excluding code execution and integration testing
Primary acceptance: References resolve consistently to the intended scholarly sources, and claim-level assessments verify that those sources substantively support the in-text claims.
1. Scope and primary contract
Citation management associates manuscript claims and quotation locations with identified, versioned scholarly resources. It must distinguish four separate assertions: (1) an identifier resolves, (2) bibliographic metadata describe the correct work, (3) the cited work contains the relevant material, and (4) that material supports the particular claim and its strength. None of these assertions may be inferred from the preceding one alone.
A report revision is citation-consistent only when each required in-text citation resolves to an authorized canonical source record, its rendered reference represents that record accurately, and substantive claim support has an explicit assessment or a visible unresolved-review status.
2. Authoritative ownership boundaries
| Component | Proposed responsibility | Authority to verify |
|---|---|---|
| Library | Canonical source identities, retrieved bibliographic metadata, source artifacts, rights and permitted access | Source registry and stored provenance |
| Citation Studio | Citation insertion, citation snapshots, bibliography formatting, claim-to-reference validation, formatting profiles | Implemented citation service contracts |
| Reporting Studio | Manuscript structure, citation anchors, frozen report revisions, HTML/DOCX/PDF rendering | Authoritative document storage |
| Research | Governed evidence relationships and claim provenance | Research object registry |
| Workspace | Project ownership, review requirements, acceptance and publication workflow | Workflow policy and decisions |
| Workbench | Dataset, method, notebook, computation and figure revisions cited by reports | Saved computational artifacts |
| Platform Core | Trusted actor identity, object authorization, tenant isolation and service access | Authentication and policy enforcement |
| Research Hub | Only authorized publication representations, references and correction notices | Public disclosure policy |
Do not create a duplicate canonical source registry merely to serve the editor. Existing source and citation implementations should be audited first, especially any previously delivered Harvard-reference and publication-export functions.
3. Canonical source identity and metadata
A canonical source record should have an internal immutable identity independent of a title, URL or DOI. External identifiers are typed, normalized and recorded with their source and verification status. DOI, ISBN, arXiv identifier, PubMed identifier, dataset accession and internal artifact ID are not interchangeable. Not all works have DOIs.
{
"schema_version": "citation-source-v1",
"source_id": "source-017",
"resource_type": "journal-article",
"identifiers": [{"scheme":"doi","value":"10.0000/synthetic.017","verification":"unverified_fixture"}],
"title": "Synthetic evidence study",
"creators": [{"given":"Alex","family":"Example","orcid":null}],
"publication_year": 2025,
"container_title": "Illustrative Journal",
"publisher": null,
"version_label": "publisher-version",
"metadata_origin": "fixture",
"metadata_retrieved_at": null,
"metadata_revision": "source-metadata-v1",
"rights_status": "review_required",
"update_status": "not_checked"
}
All values above are synthetic. A successful identifier lookup does not confirm that a retrieved work matches the manuscript author’s intended citation. Preserve conflicting metadata as reconciliation evidence rather than silently overwriting manually checked values.
4. Metadata source adapters and standards
Provider adapters should use explicit, versioned mapping contracts for Crossref, DataCite and any other authorized provider. DataCite Metadata Schema 4.7 was released in March 2026. Crossref’s REST API exposes deposited metadata and post-publication updates, but field completeness varies by record. Citation Style Language (CSL) supports style-driven rendering; a particular institution’s Harvard requirements still need a selected style and local acceptance fixtures.
- Bound requests with timeouts, response limits and controlled retry policies.
- Normalize identifier syntax without altering substantive bibliographic identity.
- Record provider, retrieval time, raw-response reference and mapped schema version.
- Do not replace a known source using a title-only approximate match.
- Verify rights and license separately from metadata availability.
- Make provider outages explicit; never fabricate missing authors, dates, or page ranges.
5. Source merge and deduplication policy
Merge only when documented identifier evidence or human-approved reconciliation establishes common work identity. Different editions, preprints, translations, datasets, corrections and published versions may require distinct source records linked by explicit relationships.
| Situation | Action |
|---|---|
| Same verified normalized DOI and resource | Review for duplicate aliases and merge under documented policy |
| Similar title, different DOI | Keep separate pending reconciliation |
| Preprint and journal article | Record version relationship; do not silently collapse |
| Correction or retraction notice | Keep independent notice identity and link affected work |
| Unresolved identifier conflict | Hold import or flag manual review |
6. Claim-to-source relationship contract
Claim links must identify the exact manuscript revision, claim or content anchor, canonical source record, and evidence locator. A quotation should include a page, section, figure or other locator where supported. Scientific support is a scoped assessment, not a Boolean inferred from citation syntax.
{
"schema_version": "citation-link-v1",
"link_id": "link-017",
"report_id": "report-017",
"report_revision": "v3",
"claim_id": "claim-004",
"source_id": "source-017",
"source_metadata_revision": "source-metadata-v1",
"locator": {"type":"section","value":"Results"},
"use": "supports-claim",
"support_assessment": "requires_scientific_review",
"assessment_artifact_ref": null,
"created_by": "trusted-actor-reference"
}
Distinguish supports-claim, contradicts-claim, contextual-background, method-reference and quotation if adopted by the domain model. A scholarly citation may appropriately document disagreement; it need not support the author’s position.
7. Authoring and editor serialization
A rich-text editor should store citation nodes as structured references rather than rely solely on rendered strings such as “(Example, 2025).” If Tiptap or another editor is used, audit the actual document schema and extension behavior. A proposed node may contain citation_link_id, source_id, locator, prefix/suffix and render flags, but should not grant authority to create sources or approve evidence relationships.
Read-back after autosave must preserve citation anchors, footnotes, quotes, multi-cite groups, reference ordering and deleted-node reconciliation. Keep stable anchors across presentation changes while preserving exact original revision targets for historical audit.
8. Bibliography rendering and Harvard style
Rendering should use a pinned CSL processor and a versioned style profile where feasible. Harvard is a family of author–date conventions, not one universal output format. Record institution-specific rules for corporate authors, same-author/same-year disambiguation, missing dates, secondary citations, datasets, software, preprints, page locators and URLs.
Acceptance must verify that citations and bibliography agree for an immutable report snapshot, including alphabetical ordering where required, author disambiguation, punctuation, italics, date placement and identifier presentation. Formatting correctness does not establish scientific source support.
9. Citation snapshots and report revision binding
At an accepted report revision, persist a citation snapshot with canonical source IDs, relevant source metadata revisions, citation-link relationships, style identifier and version, bibliography output and content integrity references. A subsequent metadata correction should trigger reconciliation, not silently rewrite already accepted or published artifacts.
{
"schema_version": "citation-snapshot-v1",
"snapshot_id": "snapshot-017",
"report_id": "report-017",
"report_revision": "v3",
"style_id": "institution-harvard",
"style_revision": "style-v2",
"source_revisions": [{"source_id":"source-017","revision":"source-metadata-v1"}],
"link_ids": ["link-017"],
"bibliography_artifact_ref": "bibliography-017",
"snapshot_digest": "server-computed"
}
10. Authorization and tenant separation
Check permissions on each source retrieval, reference import, citation insertion, claim-link change, report read, bibliography export and publication request. Project membership does not automatically grant access to every private Library source. Enforce tenant and object-level authorization before returning titles, authors, excerpts, source existence, counts or relationship metadata.
Server-side policy must derive actor and tenant identity from trusted claims or an authoritative session, not from form fields. Public exports must never leak private research citations, unpublished attachments or reviewer notes through hidden markup or metadata.
11. Rights and source-content handling
Metadata availability and content-reproduction rights differ. A citation may be permitted while embedded figures, full-text excerpts or datasets require specific licenses or review. Store rights state and provenance separately for bibliographic metadata, downloaded full text and reused content. Do not proxy private source files through public citation URLs.
12. Post-publication updates and source status
Track corrections, expressions of concern, retractions, withdrawals and replacements as explicit relationships with original notices. A retracted source may remain citable as an object of analysis; distinguish this from using its invalidated results as currently reliable evidence. When a material source update affects a report claim, flag the specific report revision and require appropriate scientific or editorial reassessment.
13. Proposed API contracts — not deployed endpoint claims
POST /example/citation-sources/import
GET /example/citation-sources/{source_id}
POST /example/reports/{report_id}/citation-links
GET /example/reports/{report_id}/citation-links
POST /example/reports/{report_id}/citation-snapshots
POST /example/reports/{report_id}/bibliography-preview
GET /example/reports/{report_id}/citation-validation
These route names are placeholders. Inspect the actual Reporting Studio and Citation Studio APIs before implementation. Document request/response schemas, accepted content types, authorization, mutation preconditions and typed error bodies. Use RFC 9457 problem details where appropriate for the deployed HTTP contract.
14. Idempotency, concurrency and transaction boundaries
For source import, link insertion, snapshot creation and export jobs, use stable command identifiers with payload hashes. Replay of the same committed command should return its recorded outcome; the same key with conflicting input should fail. Require expected report revision or HTTP conditional semantics for edits to prevent lost updates. For multi-service operations, use explicit commit ownership and reconciled events/outbox patterns as appropriate; do not imply that a single database transaction spans unrelated services.
After a timeout, read authoritative state before retrying. A partial bibliography-render failure must not mark the report scientifically accepted or publicly authorized.
15. Provider requests and SSRF protections
If metadata resolution accepts URLs, do not fetch arbitrary user-supplied destinations. Prefer identifier-based provider adapters, allowlisted HTTPS endpoints, controlled redirect destinations, DNS/IP validation, response-size limits, timeouts and content-type checks. Avoid private network ranges, metadata-service addresses and open redirect chains. Never log API credentials or private source bodies.
16. Audit events and provenance
Proposed event types include citation.source.imported, citation.source.reconciled, citation.link.created, citation.link.reviewed, citation.snapshot.saved, citation.bibliography.rendered and citation.source.update_flagged. Each event should identify trusted actor, authorized project, affected exact revisions, command/correlation ID, outcome and nonsecret evidence reference.
Provenance should connect source identities, derived computations, manuscripts and citations without asserting scientific correctness from the presence of a graph edge.
17. Shared validation package
Consolidate pure contract validators and test fixtures in a reusable scientific-validation package instead of creating one disconnected Python module per Knowledge Base article. The package can expose source-identity checks, citation-link integrity, revision reconciliation and export-comparison functions; it must not become a second authorization or source registry.
scientific_validation/
contracts/
source.py
citation_link.py
citation_snapshot.py
validators/
canonical_metadata.py
claim_reference.py
bibliography_snapshot.py
fixtures/
synthetic_sources.py
tests/
test_source_identity.py
test_claim_links.py
test_bibliography_export.py
test_tenant_boundaries.py
acceptance/
citation_receipt_schema.json
This layout is a proposal, not a verified repository tree.
18. Minimal executable structural validator
This standard-library example checks reference identity and link completeness for synthetic records. It cannot establish scientific support or real authorization.
from dataclasses import dataclass
@dataclass(frozen=True)
class Source:
id: str
metadata_revision: str
@dataclass(frozen=True)
class Link:
claim_id: str
source_id: str
assessed_support: str
def validate(sources, links):
issues = set()
ids = [s.id for s in sources]
if not all(ids) or len(ids) != len(set(ids)):
issues.add("SOURCE_IDENTITY_INVALID")
by_id = {s.id: s for s in sources}
for s in sources:
if not s.metadata_revision:
issues.add("SOURCE_REVISION_MISSING")
for link in links:
if not link.claim_id or link.source_id not in by_id:
issues.add("CLAIM_REFERENCE_UNRESOLVED")
if link.assessed_support != "expert_confirmed":
issues.add("CLAIM_SUPPORT_REVIEW_REQUIRED")
return sorted(issues)
if __name__ == "__main__":
sources = [Source("synthetic-source", "v1")]
links = [Link("claim-1", "synthetic-source", "unassessed")]
print(validate(sources, links))
Expected result: ['CLAIM_SUPPORT_REVIEW_REQUIRED']. The expert_confirmed string is only a fixture value, not verified evidence of an actual expert decision. Production assessment must be bound to trusted actors, review scope and the precise source/claim versions.
19. Required positive and negative test matrix
| Test | Expected behavior |
|---|---|
| Valid verified source and supported claim | Approved link and reproducible bibliography within authorized scope |
| Missing source | Controlled unresolved-reference error |
| Invalid DOI or metadata | Validation failure or explicit unresolved state |
| Duplicate identifier with conflicting work | Reconciliation hold; no silent merge |
| Stale report revision | Write rejected without overwrite |
| Stale source metadata revision | Snapshot discrepancy surfaced |
| Claim contradicts cited source | Scientific review failure; formatting success insufficient |
| Source correction or retraction | Affected claims flagged and status correctly represented |
| Missing rights | Restricted content reuse held without blocking lawful metadata citation by default |
| Wrong tenant or revoked actor | Read and mutation denied, no metadata leak |
| Duplicate exact command | Same outcome; no duplicate citation or snapshot |
| Conflicting idempotency replay | Typed conflict |
| Unsafe provider redirect | Request blocked |
| Private content in public output | Denied or removed before serialization |
| Partial provider or render outage | Explicit incomplete state, not fabricated completeness |
| HTML, DOCX and PDF export | Same approved citation content and bibliography semantics |
| Database migration and restore | Source/link/snapshot relationships reconstruct under correct permissions |
The test matrix is a requirement specification. No production tests are claimed as executed here.
20. Bibliography/export reconciliation procedure
- Freeze an authorized report revision and citation snapshot.
- Resolve each cited canonical source identity and captured metadata revision.
- Verify that all required in-text anchors persist across editor save and reload.
- Render Harvard or the applicable pinned style from the same snapshot.
- Compare in-text citations, bibliography entries, locators and source counts.
- Export supported HTML, DOCX and PDF formats.
- Inspect each output for dropped citations, broken author-date disambiguation, incorrect metadata and hidden restricted content.
- Record source-specific acceptance evidence and unresolved scientific assessments.
A successful rendering response is not proof that the original research supports the cited statements.
21. Migration, rollback and recovery
Stage schema migrations with disposable synthetic tenants and explicit compatibility checks for source IDs, revision keys, citation anchors, bibliography snapshots and access policies. Verify backup, off-host recovery and restoration of both database records and external artifacts. Keep previously accepted report revisions intact; on uncertain write outcomes, reconcile before replaying commands.
Rollback must not restore public exposure of content already restricted by valid privacy or rights decisions. Use documented reconciliation procedures rather than deleting audit history to make migrations pass.
22. Suggested acceptance receipt
{
"schema_version": "citation-dev-acceptance-example-v1",
"classification": "proposed",
"implementation": {"repository": null, "commit": null, "deployed_image": null},
"checks": {
"canonical_source_identity": "not_tested",
"provider_metadata_mapping": "not_tested",
"source_rights": "not_tested",
"claim_to_source_support": "not_tested",
"citation_anchor_persistence": "not_tested",
"harvard_rendering": "not_tested",
"bibliography_snapshot": "not_tested",
"stale_revision_rejection": "not_tested",
"idempotency": "not_tested",
"tenant_isolation": "not_tested",
"provider_redirect_safety": "not_tested",
"retraction_awareness": "not_tested",
"html_docx_pdf_parity": "not_tested",
"migration_restore": "not_tested",
"authenticated_staging": "not_tested"
},
"scientific_acceptance": false,
"publication_authorized": false,
"release_decision": "NO_GO"
}
23. Required implementation anchors
| Anchor | Required evidence |
|---|---|
| Source code | Actual owning repositories, paths, reviewed commits and schema versions |
| API and UI | Implemented editor workflow, route schemas, permissions and error responses |
| Provider integrations | Actual metadata adapters, versions, rate limits and rights policies |
| Persistence | Database migrations, source snapshots, immutable report/link identities |
| Security | Trusted identity, tenant isolation, object-level authorization and SSRF tests |
| Scientific validation | Reviewer-assessed claim/source support on exact versions |
| CI | Executed tests tied to implementation commit and environment |
| Staging | Authenticated import, insert, render, save, reload and export demonstrations |
| Recovery | Backup, restore, rollback and restriction-preservation receipts |
24. Technical references
- DataCite Metadata Working Group (2026). DataCite Metadata Schema 4.7. Official metadata schema.
- Crossref. REST API documentation. Official Crossref REST API.
- Citation Style Language. CSL specification and styles. Citation Style Language.
- W3C. PROV-O: The PROV Ontology. W3C Recommendation.
- IETF. RFC 9110: HTTP Semantics. HTTP specification.
- IETF. RFC 9457: Problem Details for HTTP APIs. Problem-details specification.
- OWASP. Authorization Cheat Sheet. Authorization guidance.
- OWASP. SSRF Prevention Cheat Sheet. Server-side request safety.
25. Completion and verification record
Technical completion criterion: Implemented citation operations preserve canonical source identity, source and report revisions, claim-target relationships, scholarly metadata, rights restrictions, reproducible style rendering and accurate exports. Authorized actor decisions, idempotent mutations, audit history, and recoverable snapshots must remain consistent after reload, migration and restore.
Scientific completion criterion: References resolve to the intended works and material cited claims have been assessed against the actual cited evidence. A correctly formatted bibliography is not scientific validation.
Current implementation status: Proposed source/link/snapshot contracts, metadata mapping boundaries, Harvard rendering, security controls, provider safeguards, lifecycle and audit rules, shared validation package, executable illustrative validator, regression matrix, acceptance receipt and implementation anchors documented. No deployed Citation Studio or Reporting Studio endpoint, integration test, CI run, storage migration or production release is certified by this article.
