Worked Examples
Developer reference for policy brief composition — Reporting Studio
Examine proposed policy-brief authoring contracts for structured sections, linked research evidence, figure references, review decisions, and versioned exports.
Application: Reporting Studio
Cross-application area: Research / Workspace / Library / Citation Studio / Workbench / Research Lab / Decision Studio / Site Intelligence / Research Hub / Platform Core
Classification: Developer Reference / Policy Brief Composition
Audience: Backend developers, editor engineers, scientific software engineers, data engineers, publication architects, security reviewers, and platform maintainers
Technical level: Advanced
Reference environment: Python 3.10 or later; standard library for synthetic validation
Relevant specifications: W3C PROV-O, W3C Web Annotation Data Model, FAIR Guiding Principles, RFC 9110, RFC 9457, and OWASP authorization and SSRF guidance
Primary outputs: Versioned policy brief specification, claim registry, evidence relationships, recommendation audit, source manifest, reviewer decisions, controlled exports, and acceptance receipt
1. Service responsibility and primary contract
Reporting Studio should provide a controlled scientific authoring environment for composing policy briefs that translate research evidence into decision-relevant analysis.
The service should allow researchers to incorporate scientific findings, analytical outputs, figures, tables, citations, policy alternatives, and recommendations while preserving their relationships to authoritative research records.
Primary acceptance contract: Recommendations must distinguish observed or otherwise supported scientific evidence from analytical interpretation, institutional judgment, and uncertainty.
The system should support this distinction through explicit data contracts and editorial review mechanisms rather than relying exclusively on free-text declarations.
The service must not infer scientific validity from the presence of a citation, a successful save, or an approved document status.
2. Establish authoritative application ownership
Before implementation, inspect existing source repositories to determine which service owns report identity, source evidence, computation, approval, and publication state.
| Application | Intended responsibility | Authority boundary |
|---|---|---|
| Reporting Studio | Policy brief content, document specifications, report revisions, and export orchestration | Document and revision identity |
| Research | Research questions, governed evidence objects, scientific provenance, and research output relationships | Research-object ownership |
| Workspace | Project scope, review assignments, workflow decisions, and document acceptance | Project and approval authority |
| Library | Source identifiers, datasets, bibliographic metadata, and rights references | Source authority |
| Citation Studio | Claim-linked citations and bibliography generation where implemented | Citation relationships |
| Workbench | Versioned calculations, scientific figures, tables, and reproducible analytical outputs | Computation authority |
| Research Lab | Scientific methodological assessment and uncertainty review | Scientific assessment evidence |
| Decision Studio | Policy alternatives, decision criteria, and analytical scenario relationships | Decision-model provenance |
| Site Intelligence | Geographic and temporal source evidence where relevant | Geospatial provenance |
| Platform Core | Trusted identity, authorization, service permissions, and tenant isolation | Identity and security authority |
| Research Hub | Authorized public research publications and correction relationships | Public presentation |
These are proposed responsibilities. They must be reconciled with actual implementation ownership before new services or duplicate source registries are introduced.
3. Define the composition lifecycle
Authorized Workspace project
|
v
Research question and policy scope
|
v
Verified source and evidence references
|
v
Scientific calculations and figures
|
v
Claim classification and uncertainty
|
v
Policy alternatives and judgment
|
v
Recommendation construction
|
v
Tiptap document composition
|
v
Versioned source and claim manifests
|
v
Scientific and editorial review
|
v
Accepted report revision
|
v
Publication authorization
|
v
HTML / DOCX / PDF rendering
|
v
Approved Research publication
The order is conceptual. The actual workflow may permit iterative revision between stages.
Every state-changing step must preserve the authoritative object identity and permitted project scope.
4. Define a versioned policy brief contract
A policy brief should have an identifiable document type, report revision, research context, and controlled source relationships.
Illustrative JSON:
{
"schema_version": "policy-brief-v1",
"report_id": "report-017",
"revision_id": "revision-v2",
"document_type": "policy_brief",
"project_id": "project-017",
"research_question_ref": "question-017",
"policy_context": {
"jurisdiction": "illustrative",
"audience": "defined_decision_audience",
"decision_scope": "research_evaluation"
},
"content_artifact_ref": "artifact-v2",
"evidence_manifest_ref": "evidence-manifest-v2",
"claim_manifest_ref": "claims-v2",
"recommendation_manifest_ref": "recommendations-v2",
"figure_manifest_ref": "figures-v2",
"citation_manifest_ref": "citations-v2",
"state": "draft",
"publication_status": "not_published"
}
This is a proposed record structure, not an existing verified API schema.
Server-side services must resolve ownership and authorization independently of client-provided project or organization identifiers.
5. Define the scientific evidence contract
An evidence object should identify the actual research or analytical source used to support a claim.
Recommended fields include:
- Stable evidence identifier.
- Authoritative source reference.
- Dataset, article, or result revision.
- Research object type.
- Observation or execution period.
- Geographic and population scope.
- Methods and relevant assumptions.
- Important limitations.
- Content integrity reference, where appropriate.
- Rights and permitted processing scope.
A source may support multiple claims, but each claim-to-source relationship should be evaluated independently.
The existence of an evidence record does not establish that its source is reliable or relevant.
6. Define claim classification and provenance
Claims should be classified according to their evidentiary basis.
| Type | Meaning | Required reference |
|---|---|---|
| Observed | Direct measurement or documented observation | Source observation and context |
| Derived | Value calculated from source evidence | Saved computation and input revisions |
| Modeled | Estimate produced under specified assumptions | Model, scenario, parameters, and uncertainty |
| Interpretation | Scientific inference based on evidence | Supporting sources and reasoned explanation |
Policy judgment should be represented separately from empirical claim classification.
Do not label a modeled estimate as an observed effect merely because the numerical value is stored in a verified computational artifact.
7. Define the claim-to-source relationship
A proposed claim record:
{
"schema_version": "policy-claim-v1",
"claim_id": "claim-017",
"report_revision": "revision-v2",
"claim_type": "modeled",
"text_anchor": "section-evidence-p3",
"evidence_refs": [
"evidence-017"
],
"uncertainty_ref": "uncertainty-017",
"scientific_review": "not_reviewed"
}
For material claims, the service should preserve:
- Original source or computation identity.
- Claim type.
- Target location in the document.
- Known uncertainty and conditions.
- Review outcome.
- Versioned relationship to the exact manuscript revision.
Claim support must not be inferred solely from bibliographic proximity or matching keywords.
8. Preserve source and calculation provenance
W3C PROV-O can be used to describe relationships among scientific sources, analytical activities, derived results, report claims, and publication artifacts.
Source dataset or publication
|
v
Research evidence object
|
v
Analytical activity
|
v
Verified computational result
|
v
Scientific claim
|
v
Policy recommendation
|
v
Approved report revision
Not every claim requires a computational result. Direct observations, literature findings, and documented institutional facts may have different provenance structures.
The system must not fabricate a computational lineage when one does not exist.
9. Define uncertainty disclosure contracts
Scientific uncertainty should be represented explicitly when it materially affects a claim or recommendation.
Recommended uncertainty metadata include:
- Uncertainty type.
- Source or analytical method.
- Relevant confidence, interval, range, or sensitivity measure.
- Applicable assumptions.
- Study limitations.
- Transferability restrictions.
- Responsible assessment and review state.
A nonempty uncertainty description is a structural requirement, not proof that uncertainty was quantified correctly.
The scientific reviewer must assess whether the uncertainty disclosure is substantively adequate.
10. Define policy recommendation contracts
A recommendation should reference the evidence and analytical judgments used to formulate it.
Illustrative JSON:
{
"schema_version": "policy-recommendation-v1",
"recommendation_id": "recommendation-017",
"report_revision": "revision-v2",
"supporting_claim_refs": [
"claim-017"
],
"policy_judgment": {
"objective": "reduce_uncertainty",
"rationale": "Additional evidence is required"
},
"limitations": [
"Existing evidence has limited transferability"
],
"alternative_refs": [
"option-017",
"option-018"
],
"review_status": "not_reviewed"
}
A recommendation may depend on scientific claims, feasibility assumptions, regulatory constraints, public priorities, or institutional values.
The implementation should make these different dependencies inspectable.
11. Define policy-alternative and decision contracts
Decision Studio may supply structured policy alternatives or analytical scenarios where supported.
A proposed alternative record should include:
- Alternative identifier.
- Policy objective.
- Applicable jurisdiction and implementation context.
- Expected benefits and potential harms.
- Evidence references.
- Model or scenario assumptions.
- Economic and resource implications.
- Feasibility constraints.
- Uncertainty and sensitivity.
Do not infer a preferred alternative solely from a numerical score unless its weighting, evaluation criteria, source data, and policy assumptions have been documented and reviewed.
Alternative ranking and scientific evidence quality are separate assessment problems.
12. Integrate a visual editor without losing research structure
Tiptap or a comparable structured rich-text editor can provide the authoring interface for policy briefs.
Where Tiptap is implemented, consider document extensions for:
- Scientific claim references.
- Source-linked citations.
- Research figures and reproducible tables.
- Policy recommendation blocks.
- Uncertainty notes and methodological limitations.
- Reviewer comments and content anchors.
- Structured executive summaries and sections.
The editor should not become the authoritative owner of source identities, calculation verification, tenant authorization, or publication approval.
Use validated, versioned references from the actual owning services.
Store the editor document schema revision and define migrations before changing document representations.
13. Preserve structured references during authoring
Rich-text content may be reorganized, copied, pasted, or revised.
The implementation should preserve the relationship between document content and its research evidence when those operations occur.
For example, moving a claim from the evidence section to the executive summary should not silently remove its source reference.
Where a claim is substantively rewritten, its prior scientific approval may no longer apply.
A server-side validation process should detect unresolved claim references and incompatible document schemas before accepting the revision.
14. Validate figures, tables, and quantitative outputs
Policy brief tables and figures should refer to controlled scientific outputs rather than arbitrary visual copies.
For each scientific artifact, preserve:
- Artifact and result identity.
- Source dataset or calculation revision.
- Method and transformation references.
- Variable names and units.
- Uncertainty representation.
- Caption and attribution.
- Rights and permitted distribution.
For report tables, reconcile displayed values against the designated saved computation.
For figures, verify that scales, filters, geographic transformations, and visual encodings preserve the intended scientific meaning.
Do not equate a successful image or chart render with scientific acceptance.
15. Define authorization and tenant boundaries
Every source retrieval, report mutation, reviewer decision, and publication action requires appropriate authorization.
| Operation | Required enforcement |
|---|---|
| Read research source | Authorized source and project scope |
| Import scientific artifact | Permitted result access and reuse rights |
| Create policy brief | Authorized report authoring role |
| Revise claim or recommendation | Document mutation permission and expected revision |
| Review scientific claims | Authorized reviewer identity and review scope |
| Accept report revision | Workflow authority and satisfied review requirements |
| Export confidential content | Permitted artifact and distribution scope |
| Publish policy brief | Separate authorized public-release decision |
Client-supplied organization IDs, role labels, or approval fields must not be treated as authoritative.
The synthetic validator below checks tenant field consistency only; real production access control requires trusted server-side authorization.
16. Define revision and approval controls
A policy brief may change substantially after scientific review.
Approval should therefore bind to the exact content revision and associated evidence manifest.
Draft v1
|
v
Scientific review
|
v
Accepted v2
|
+-- Preserved content
+-- Source and claim manifest
+-- Reviewer decisions
|
v
New draft v3
|
v
New review required for changed material
Use versioned revisions and authoritative expected-version checks to prevent a stale editor from overwriting accepted work.
Where an HTTP API supports conditional updates, RFC 9110 provides relevant ETag and If-Match semantics.
Do not assume that approval of v2 automatically authorizes v3.
17. Define proposed API contracts
The following API shapes are illustrative and must not be treated as existing production endpoints.
POST /example/reports/policy-briefs
GET /example/reports/{report_id}/revisions/{revision_id}
POST /example/reports/{report_id}/claims
POST /example/reports/{report_id}/recommendations
POST /example/reports/{report_id}/review-submissions
POST /example/reports/{report_id}/exports
A state-changing request should include an explicit command identity and, where required, an expected revision.
Before persistence, validate:
- Request schema and supported revision.
- Trusted actor and project authority.
- Source and claim identities.
- Rights and reuse restrictions.
- Recommendation dependencies.
- Required uncertainty and judgment disclosures.
- Existing revision and concurrency state.
The API must return typed failures instead of silently dropping unsupported fields or creating invalid research relationships.
18. Define failure and error contracts
| Code | Meaning | Required handling |
|---|---|---|
| POLICY_BRIEF_NOT_FOUND | Report cannot be resolved | Controlled object-resolution failure |
| POLICY_BRIEF_ACCESS_DENIED | Actor lacks required access | Deny without private-data disclosure |
| POLICY_BRIEF_STALE_REVISION | Expected version differs from current state | Reject conflicting write |
| POLICY_BRIEF_SCHEMA_UNSUPPORTED | Document contract incompatible | Typed validation or approved migration |
| EVIDENCE_REFERENCE_MISSING | Claim references unavailable source evidence | Hold affected content |
| SOURCE_RIGHTS_UNVERIFIED | Required source-use permission unresolved | Restrict the affected operation |
| CLAIM_CLASSIFICATION_INVALID | Unsupported evidence classification | Reject invalid claim |
| CLAIM_UNCERTAINTY_MISSING | Required uncertainty disclosure absent | Require review or correction |
| RECOMMENDATION_EVIDENCE_MISSING | Recommendation lacks supporting claim relationships | Hold acceptance |
| POLICY_JUDGMENT_MISSING | Normative rationale not recorded | Require disclosure |
| SCIENTIFIC_REVIEW_INCOMPLETE | Required scientific assessment absent | Hold approval |
| PUBLICATION_NOT_AUTHORIZED | Release requirements incomplete | Keep nonpublic |
| EXPORT_SOURCE_MISMATCH | Export differs from approved revision | Reject artifact acceptance |
| IDEMPOTENCY_CONFLICT | Repeated command conflicts with stored input | Reconcile recorded outcome |
These codes are proposed identifiers, not verified Reporting Studio errors.
RFC 9457 provides a standard format for communicating machine-readable HTTP API problem details.
19. Prevent unsafe source retrieval
Some authoring workflows may import external sources, figures, or other resources.
If the backend performs network requests, it must enforce an approved destination policy and protect against server-side request forgery.
Controls should include:
- Approved source or provider origins.
- HTTPS and permitted transport settings.
- Protection against local, private, link-local, and metadata-service targets.
- DNS and connection-target validation.
- Redirect restrictions and revalidation.
- No automatic credential forwarding to unapproved origins.
- Bounded downloads and timeouts.
- Content and rights validation before import.
Do not implement unrestricted backend URL fetching merely because the rich-text editor can represent external links.
Use OWASP SSRF prevention guidance in the actual transport design.
20. Define bounded execution and idempotency
Policy brief generation may invoke multiple source services, scientific artifact retrieval, and export renderers.
Apply bounded limits to:
- Imported source and artifact counts.
- Request and payload sizes.
- Rendering duration.
- Concurrent generation jobs.
- Retries and retry budgets.
- Stored intermediate artifacts.
- Document complexity and maximum supported size.
Where a write times out, inspect authoritative persistence before retrying it.
Idempotency records should associate a command identifier with the original input and committed outcome. Conflicting reuse of the same identifier should be rejected.
Incomplete renders must not become accepted publication artifacts.
21. Define HTML, DOCX, and PDF rendering contracts
Reporting Studio should preserve the approved content and scientific relationships during rendering.
| Format | Required checks |
|---|---|
| HTML | Semantic headings, accessible tables, links, citations, figure captions, and correct approved text |
| DOCX | Scientific values, document structure, citations, tables, figures, and editability where required |
| Text and figure integrity, layout, pagination, reading order, and applicable accessibility |
Each export should retain a reference to the exact report revision and rendering configuration.
For scientific tables and figures, preserve source artifact identities and verify the rendered result.
An exported file must not be treated as approved solely because the renderer completed successfully.
22. Implement a synthetic reference validator
The following Python example checks selected structural relationships in a fictional policy brief.
It validates evidence identities, claim classifications, uncertainty disclosures, recommendation dependencies, policy judgments, rights flags, tenant consistency, and expected report revisions.
It does not authenticate real users, retrieve authoritative sources, prove scientific accuracy, or publish a report.
Prepare a local environment:
mkdir policy-brief-developer-contract
cd policy-brief-developer-contract
python3 -m venv .venv
source .venv/bin/activate
python --version
Create policy_contract.py and test_policy_contract.py.
23. Implement the reference contract
Save as policy_contract.py.
from dataclasses import dataclass
@dataclass(frozen=True)
class Evidence:
id: str
revision: str
source_ref: str
rights_verified: bool
@dataclass(frozen=True)
class Claim:
id: str
kind: str
evidence_ids: tuple[str, ...]
uncertainty: str
@dataclass(frozen=True)
class Recommendation:
id: str
claim_ids: tuple[str, ...]
judgment: str
limitations: str
@dataclass(frozen=True)
class Brief:
revision: str
expected_revision: str
tenant: str
actor_tenant: str
evidence: tuple[Evidence, ...]
claims: tuple[Claim, ...]
recommendations: tuple[Recommendation, ...]
def validate(brief):
errors = []
holds = []
if brief.actor_tenant != brief.tenant:
errors.append("TENANT_DENIED")
if brief.revision != brief.expected_revision:
errors.append("STALE_REVISION")
for category, items in [
("EVIDENCE", brief.evidence),
("CLAIM", brief.claims),
("RECOMMENDATION", brief.recommendations)
]:
ids = [item.id for item in items]
if not all(ids) or len(ids) != len(set(ids)):
errors.append(category + "_ID_INVALID")
sources = {
item.id: item
for item in brief.evidence
}
claims = {
item.id: item
for item in brief.claims
}
for item in brief.evidence:
if not item.source_ref or not item.revision:
errors.append("SOURCE_PROVENANCE_MISSING")
if not item.rights_verified:
holds.append("RIGHTS_REVIEW_REQUIRED")
for claim in brief.claims:
if claim.kind not in {
"observed", "derived",
"modeled", "interpretation"
}:
errors.append("CLAIM_TYPE_INVALID")
if (
not claim.evidence_ids
or any(
evidence_id not in sources
for evidence_id in claim.evidence_ids
)
):
errors.append("CLAIM_EVIDENCE_INVALID")
if not claim.uncertainty.strip():
holds.append("UNCERTAINTY_REVIEW_REQUIRED")
for recommendation in brief.recommendations:
if (
not recommendation.claim_ids
or any(
claim_id not in claims
for claim_id in recommendation.claim_ids
)
):
errors.append("RECOMMENDATION_CLAIMS_INVALID")
if not recommendation.judgment.strip():
holds.append("POLICY_JUDGMENT_REQUIRED")
if not recommendation.limitations.strip():
holds.append("RECOMMENDATION_LIMITATIONS_REQUIRED")
if errors:
status = "REJECTED"
elif holds:
status = "REVIEW_REQUIRED"
else:
status = "SYNTHETIC_PREFLIGHT_PASS"
return {
"status": status,
"errors": sorted(set(errors)),
"holds": sorted(set(holds)),
"scientific_validity": "NOT_TESTED",
"actor_authority": "NOT_TESTED",
"durable_storage": "NOT_TESTED"
}
FIXTURE = Brief(
"v2",
"v2",
"tenant-1",
"tenant-1",
(
Evidence(
"e1", "r1",
"synthetic-source", True
),
),
(
Claim(
"c1",
"observed",
("e1",),
"Limited to studied conditions"
),
),
(
Recommendation(
"r1",
("c1",),
"Further research is valuable",
"Not generalizable"
),
)
)
if __name__ == "__main__":
import json
print(json.dumps(validate(FIXTURE), indent=2))
The reference implementation deliberately distinguishes structural failures from review requirements.
For example, a recommendation without a known supporting claim is rejected. A recommendation that omits its policy judgment is held for review.
The tenant values are synthetic. Their equality is not equivalent to a trusted authorization decision.
24. Execute and inspect the validator
python policy_contract.py
Expected output:
{
"status": "SYNTHETIC_PREFLIGHT_PASS",
"errors": [],
"holds": [],
"scientific_validity": "NOT_TESTED",
"actor_authority": "NOT_TESTED",
"durable_storage": "NOT_TESTED"
}
SYNTHETIC_PREFLIGHT_PASS establishes only the internal consistency of the fictional fixture under the defined rules.
It is not a scientific-validity, security, or publication-acceptance status.
25. Implement negative regression tests
Save as test_policy_contract.py.
import unittest
from dataclasses import replace
from policy_contract import validate, FIXTURE
class Tests(unittest.TestCase):
def check(self, code, brief, field="errors"):
self.assertIn(
code,
validate(brief)[field]
)
def test_valid(self):
self.assertEqual(
validate(FIXTURE)["status"],
"SYNTHETIC_PREFLIGHT_PASS"
)
def test_unverified_science(self):
self.assertEqual(
validate(FIXTURE)["scientific_validity"],
"NOT_TESTED"
)
def test_tenant(self):
self.check(
"TENANT_DENIED",
replace(FIXTURE, actor_tenant="tenant-2")
)
def test_revision(self):
self.check(
"STALE_REVISION",
replace(FIXTURE, expected_revision="v1")
)
def test_source(self):
self.check(
"SOURCE_PROVENANCE_MISSING",
replace(
FIXTURE,
evidence=(
replace(
FIXTURE.evidence[0],
source_ref=""
),
)
)
)
def test_source_revision(self):
self.check(
"SOURCE_PROVENANCE_MISSING",
replace(
FIXTURE,
evidence=(
replace(
FIXTURE.evidence[0],
revision=""
),
)
)
)
def test_rights(self):
self.check(
"RIGHTS_REVIEW_REQUIRED",
replace(
FIXTURE,
evidence=(
replace(
FIXTURE.evidence[0],
rights_verified=False
),
)
),
"holds"
)
def test_duplicate_evidence(self):
self.check(
"EVIDENCE_ID_INVALID",
replace(
FIXTURE,
evidence=FIXTURE.evidence * 2
)
)
def test_claim_type(self):
self.check(
"CLAIM_TYPE_INVALID",
replace(
FIXTURE,
claims=(
replace(
FIXTURE.claims[0],
kind="fact"
),
)
)
)
def test_unknown_claim_source(self):
self.check(
"CLAIM_EVIDENCE_INVALID",
replace(
FIXTURE,
claims=(
replace(
FIXTURE.claims[0],
evidence_ids=("unknown",)
),
)
)
)
def test_missing_uncertainty(self):
self.check(
"UNCERTAINTY_REVIEW_REQUIRED",
replace(
FIXTURE,
claims=(
replace(
FIXTURE.claims[0],
uncertainty=""
),
)
),
"holds"
)
def test_unknown_recommendation_claim(self):
self.check(
"RECOMMENDATION_CLAIMS_INVALID",
replace(
FIXTURE,
recommendations=(
replace(
FIXTURE.recommendations[0],
claim_ids=("nope",)
),
)
)
)
def test_missing_judgment(self):
self.check(
"POLICY_JUDGMENT_REQUIRED",
replace(
FIXTURE,
recommendations=(
replace(
FIXTURE.recommendations[0],
judgment=""
),
)
),
"holds"
)
def test_missing_limitations(self):
self.check(
"RECOMMENDATION_LIMITATIONS_REQUIRED",
replace(
FIXTURE,
recommendations=(
replace(
FIXTURE.recommendations[0],
limitations=""
),
)
),
"holds"
)
def test_duplicate_recommendations(self):
self.check(
"RECOMMENDATION_ID_INVALID",
replace(
FIXTURE,
recommendations=FIXTURE.recommendations * 2
)
)
def test_deterministic(self):
self.assertEqual(
validate(FIXTURE),
validate(FIXTURE)
)
if __name__ == "__main__":
unittest.main()
26. Run and interpret regression tests
python -m unittest -v test_policy_contract.py
Executed synthetic test result: 16 tests passed, zero failures, using Python’s standard-library test runner.
The tested cases include:
- Valid synthetic policy brief structure.
- Explicit separation from scientific verification.
- Simulated tenant mismatch.
- Stale document revision.
- Missing source identity and revision.
- Unverified rights.
- Duplicate evidence identifiers.
- Invalid claim classification.
- Unresolved claim-to-source references.
- Missing uncertainty disclosure.
- Invalid recommendation-to-claim references.
- Missing policy judgment or limitations.
- Duplicate recommendation identifiers.
- Deterministic validation.
These tests verify only the synthetic validator. They do not exercise real source repositories, external services, databases, browser sessions, or production permissions.
27. Define production integration and security tests
| Test | Expected outcome |
|---|---|
| Authorized policy brief creation | Report and project references persist correctly |
| Missing research project | Controlled object-resolution failure |
| Revoked source access | Unauthorized source retrieval denied |
| Wrong tenant | Cross-owner source and report access denied |
| Stale report revision | Conflicting update rejected |
| Missing source object | Claim reference rejected or held |
| Incomplete claim payload | Typed schema validation failure |
| Invalid document schema | Controlled compatibility failure |
| Missing recommendation evidence | Recommendation cannot be accepted |
| Missing uncertainty | Required review or correction |
| Incorrect scientific table | Numerical reconciliation fails |
| Unauthorized figure import | Rights or permission enforcement prevents import |
| Unsafe outbound source URL | Unapproved destination blocked where fetching is supported |
| Duplicate save command | No unintended duplicate report revision |
| Renderer failure | Partial export not accepted |
| HTML export | Approved claims, figures, and citations preserved |
| DOCX export | Approved scientific content and structure preserved |
| PDF export | Approved content and applicable accessibility preserved |
| Unauthorized public response | Private drafts, source material, and reviewer comments withheld |
| Persistence replay | Exact accepted revision reconstructs |
| Backup and restore | Report, claims, sources, and review decisions reconstruct |
Run integration tests against actual service contracts and authorized synthetic research identities.
Use isolated storage for destructive, migration, and recovery testing. Do not mount production volumes or use live credentials as disposable test fixtures.
28. Define audit events and observability
Meaningful workflow events may include:
policy_brief.created
policy_brief.revision.saved
policy_brief.claim.bound
policy_brief.source.imported
policy_brief.recommendation.created
policy_brief.validation.failed
policy_brief.review.submitted
policy_brief.scientific_review.recorded
policy_brief.editorial_review.recorded
policy_brief.revision.accepted
policy_brief.export.completed
policy_brief.publication.authorized
policy_brief.publication.released
These are proposed event names, not verified platform events.
Record the authoritative actor or service, affected report and revision, relevant source references, timestamp, operation result, and nonsecret correlation identifier.
Do not place confidential manuscript text, research datasets, access tokens, or private reviewer observations in unrestricted logs.
29. Prepare a developer acceptance receipt
The following JSON illustrates the expected form of an implementation-specific acceptance record.
{
"schema_version": "example-1.0",
"workflow": "policy_brief_developer_acceptance",
"classification": "proposed",
"implementation": {
"repository": null,
"commit": null,
"api_schema": null,
"editor_schema": null,
"deployed_build": null
},
"acceptance": {
"document_contract": "not_tested",
"project_identity": "not_tested",
"source_provenance": "not_tested",
"claim_classification": "not_tested",
"claim_to_source_binding": "not_tested",
"uncertainty_disclosure": "not_tested",
"policy_judgment_disclosure": "not_tested",
"recommendation_traceability": "not_tested",
"policy_alternative_contract": "not_tested",
"figure_and_table_integrity": "not_tested",
"citation_integration": "not_tested",
"trusted_authorization": "not_tested",
"tenant_isolation": "not_tested",
"conditional_writes": "not_tested",
"idempotency": "not_tested",
"audit_event_persistence": "not_tested",
"scientific_review": "not_tested",
"editorial_review": "not_tested",
"rights_review": "not_tested",
"revision_immutability": "not_tested",
"html_export": "not_tested",
"docx_export": "not_tested",
"pdf_export": "not_tested",
"public_boundary": "not_tested",
"migration": "not_tested",
"restore": "not_tested",
"authenticated_staging": "not_tested",
"production_runtime": "not_tested"
},
"synthetic_reference": {
"tests_executed": 16,
"tests_passed": 16,
"scope": "local_structural_validation_only"
},
"scientific_acceptance": false,
"publication_approved": false,
"production_release_decision": "NO_GO"
}
This receipt is illustrative. It is not evidence that the described services are already deployed.
Actual acceptance must identify the exact implementation revision, approved test environment, source contracts, reviewer decisions, and executed results.
30. Migration, recovery, and rollback requirements
Schema and editor upgrades must preserve historical scientific meaning and approved content.
Before migration:
- Identify the current authoritative schema and target revision.
- Preserve existing accepted policy brief snapshots.
- Verify claim and recommendation identifiers.
- Preserve source, figure, table, and citation references.
- Test editor-document transformation and compatibility.
- Verify reviewer comment targets remain resolvable.
- Confirm accepted versions are not rewritten in place.
- Test the migration against isolated synthetic storage.
- Restore an approved test backup and reconstruct the historical document.
- Record any unsupported or unrecoverable content explicitly.
Do not regenerate historical scientific claims from newer evidence while labeling the result as an unchanged original publication.
When a change requires an updated scientific interpretation, create a new controlled revision and obtain the applicable review.
31. Required implementation anchors
| Anchor | Required evidence |
|---|---|
| Repository | Actual owning repository, branch, and commit |
| Report implementation | Source modules for policy brief generation and persistence |
| Editor integration | Actual Tiptap or alternative editor configuration and document schema |
| Claim contracts | Versioned claim, source, and uncertainty schemas |
| Recommendation contracts | Policy judgment and evidence relationship implementation |
| Research integration | Authoritative research-object references and permissions |
| Library integration | Source and rights identity contract |
| Citation integration | Verified citation generation and source binding |
| Workbench integration | Saved computation, table, and figure references |
| Decision integration | Actual policy-alternative and scenario contracts |
| Identity | Trusted user, project, and tenant authorization |
| Review workflow | Version-bound scientific, editorial, and rights decisions |
| Publication | Actual release authority and public Research handoff |
| Renderers | Implemented HTML, DOCX, and PDF export contracts |
| CI | Executed tests tied to exact source revision |
| Staging | Authenticated positive and negative acceptance |
| Recovery | Verified backup, migration, restore, and rollback |
| Production | Deployed build identity and authorized release decision |
Any unsupported capability or unverified mandatory control should remain recorded as Not Tested, Blocked, or Not Applicable with an explanation.
32. Developer escalation and incident handling
Escalate when:
- A scientific claim loses its authoritative source reference.
- A modeled estimate becomes incorrectly classified as observed evidence.
- Policy recommendations lose their judgment or uncertainty disclosures.
- A scientific figure or table no longer matches its approved computation.
- Reviewer approvals are applied to changed content.
- Source rights or tenant restrictions are bypassed.
- Public output exposes private research or reviewer material.
- Duplicate commands create conflicting report revisions.
- An editor or schema migration corrupts scientific document structure.
- A restored publication cannot reconstruct its approved evidence relationships.
Preserve the last accepted content, source manifests, reviewer decisions, and sanitized diagnostic evidence.
Contain unsafe mutation or publication, correct the responsible component, and rerun affected tests in an authorized isolated environment.
Do not fabricate missing claims, scientific reviews, source metadata, or approval records to make a publication appear complete.
33. Technical and scientific references
- World Wide Web Consortium (W3C). PROV-O: The PROV Ontology. Available at: https://www.w3.org/TR/prov-o/.
- World Wide Web Consortium (W3C). Web Annotation Data Model. Available at: https://www.w3.org/TR/annotation-model/.
- Wilkinson, M.D. et al. (2016). ‘The FAIR Guiding Principles for Scientific Data Management and Stewardship’, Scientific Data, 3, 160018. Available at: https://doi.org/10.1038/sdata.2016.18.
- World Health Organization. Evidence-informed decision-making. Available at: WHO Evidence-informed Policy Network.
- European Commission Joint Research Centre. Knowledge for Policy. Available at: https://knowledge4policy.ec.europa.eu/.
- Internet Engineering Task Force. HTTP Semantics, RFC 9110. Available at: https://www.rfc-editor.org/rfc/rfc9110.html.
- Internet Engineering Task Force. Problem Details for HTTP APIs, RFC 9457. Available at: https://www.rfc-editor.org/rfc/rfc9457.html.
- OWASP Foundation. Authorization Cheat Sheet. Available at: OWASP authorization guidance.
- OWASP Foundation. Server-Side Request Forgery Prevention Cheat Sheet. Available at: OWASP SSRF guidance.
- Python Software Foundation. dataclasses — Data Classes. Available at: Python documentation.
- Python Software Foundation. unittest — Unit Testing Framework. Available at: Python documentation.
34. Completion and verification record
| Criterion | Pass requirement |
|---|---|
| Report identity | Unique controlled report and version |
| Research ownership | Trusted project and organization context |
| Evidence provenance | Authoritative source and computation references |
| Claim classification | Observed, derived, modeled, and interpretive claims distinguished |
| Claim traceability | Material claims linked to actual source evidence |
| Uncertainty | Required limitations and uncertainty disclosures recorded |
| Policy judgment | Normative and institutional rationale distinct from empirical evidence |
| Recommendations | Supporting claims, alternatives, and limitations traceable |
| Scientific outputs | Figures and tables bound to appropriate saved calculations |
| Citations | Bibliographic relationships preserved and verifiable |
| Editor schema | Structured content valid and migration compatible |
| Authorization | Trusted user, source, project, and tenant permissions enforced |
| Revision history | Accepted prior content remains immutable and reconstructable |
| Review decisions | Scientific and editorial approvals bound to exact revisions |
| Idempotency | Duplicate commands do not create conflicting output |
| Auditability | Meaningful state transitions and decisions recorded |
| Exports | HTML, DOCX, and PDF preserve approved scientific content |
| Publication | Only separately authorized versions released publicly |
| Recovery | Source and publication relationships survive verified restore |
| Runtime evidence | Actual source commits, executed tests, and staging acceptance recorded |
Developer completion criterion: Policy brief composition is technically accepted when an authorized report revision preserves its source evidence, claim classifications, analytical outputs, uncertainty, policy alternatives, and recommendations; observed evidence is distinguishable from policy judgment; versioned review and publication controls are enforced; HTML, DOCX, and PDF exports retain approved content; and the workflow passes implementation-specific security, integration, persistence, and recovery acceptance.
Scientific limitation: A structurally complete policy brief may still contain unsupported scientific claims or inappropriate recommendations. Claim accuracy, evidence quality, uncertainty, causal inference, policy feasibility, and normative judgments require independent scientific and institutional assessment.
Current implementation status: Proposed policy brief architecture, structured evidence and claim contracts, recommendation provenance, uncertainty disclosures, Tiptap authoring boundaries, API and security requirements, document rendering, revision control, synthetic Python validator, sixteen executed reference regression tests, migration and recovery requirements, and production acceptance criteria documented. No specific Sustainable Catalyst Reporting Studio policy brief endpoint, claim registry, Tiptap extension, Decision Studio integration, reviewer service, or production publication workflow is certified without actual repository inspection, authenticated integration tests, source-specific scientific review, and independent operational acceptance.
