Worked Examples
Developer reference for report revision history — Reporting Studio
Examine revision-history contracts for immutable accepted manuscripts, reviewer feedback, exact-revision approvals, version transitions, and auditable recovery.
Application: Reporting Studio
Cross-application area: Workspace / Research / Research Hub / Library / Workbench / Citation Studio / Platform Core
Classification: Developer Reference / Report Revision History
Audience: Backend developers, editor engineers, database engineers, platform architects, security reviewers, DevOps engineers, and scientific software maintainers
Technical level: Advanced
Reference environment: Python 3.10 or later; standard library
Relevant specifications: W3C PROV-O, W3C Web Annotation Data Model, RFC 9110, RFC 9457, and OWASP Authorization Cheat Sheet
Primary outputs: Versioned revision contracts, immutable-content references, reviewer and author-decision records, concurrency controls, audit events, reproducible validation, and implementation acceptance evidence
1. Service responsibility and primary contract
Reporting Studio should support accountable scientific authoring in which reports can be edited, reviewed, accepted, and published without destroying previously accepted versions or their associated decisions.
The primary engineering contract is:
Prior accepted report revisions, reviewer observations, author responses, and version-specific decisions must remain retrievable and auditable after subsequent editing, approval, publication, migration, and authorized recovery.
At minimum, the implementation must distinguish:
- Temporary editor state.
- Durable draft revisions.
- Review submissions.
- Accepted immutable versions.
- Published versions.
- Corrections and superseding versions.
Revision acceptance and public publication must be separate, authorized transitions.
2. Establish actual system ownership
Before writing new code, identify which existing service owns report identity, document content, reviewer decisions, project authorization, and public release.
| Component | Intended responsibility | Authoritative concern |
|---|---|---|
| Reporting Studio | Report revisions, content snapshots, comment references, and authoring workflow | Report content and revision identity |
| Workspace | Project ownership, reviewer assignments, and approval workflows | Project governance |
| Platform Core | Trusted user and service identity, tenant policy, and access control | Authorization decisions |
| Research | Governed research objects and versioned handoff relationships | Receiving research identity |
| Research Hub | Authorized public publications and correction notices | Public disclosure state |
| Library | Dataset, source, citation, and artifact references | Research-source identity and rights |
| Workbench | Computational results, notebook outputs, figures, and reproducibility | Scientific computation provenance |
These are proposed boundaries. Confirm the deployed service owners and avoid creating duplicate authorities for the same report or approval record.
3. Proposed revision architecture
Authenticated author
|
v
Report access and project check
|
v
Load authoritative current revision
|
v
Editor draft and tracked changes
|
v
Expected-version comparison
|
v
Create immutable revision snapshot
|
+-- Content integrity reference
+-- Parent revision reference
+-- Scientific source manifest
+-- Authoring event
|
v
Reviewer annotations
|
v
Author responses and dispositions
|
v
Exact-version scientific/editorial review
|
v
Accepted revision
|
v
Separate publication authorization
|
v
Approved Research / Research Hub output
Each revision must have a durable identity and must refer to the exact content snapshot considered by its reviewers.
4. Define the report revision contract
A proposed revision record:
{
"schema_version": "report-revision-v1",
"report_id": "report-017",
"revision_id": "revision-v4",
"parent_revision_ids": ["revision-v3"],
"content": {
"artifact_id": "artifact-v4",
"content_type": "application/vnd.example.report+json",
"digest_algorithm": "sha256",
"digest": null,
"serialization_revision": "editor-schema-v1"
},
"source_manifest_id": "sources-v4",
"created_by": "actor-reference",
"created_at": null,
"state": "draft",
"visibility": "private"
}
The record should identify the content representation and its canonicalization rules. The digest must be calculated from the authoritative stored representation, not from an untrusted user assertion.
A multi-parent model may be useful for merging branches, but should not be enabled without documented merge semantics and conflict review.
5. Preserve immutable accepted snapshots
When a revision becomes accepted, its content and scientific dependency manifest should be preserved under a stable version identity.
Later edits create a new revision rather than mutating the accepted snapshot.
Accepted v3
|
+-- Immutable manuscript snapshot
+-- Figure/table/source manifests
+-- Review decisions
+-- Original comment anchors
|
v
Draft v4
|
+-- New author changes
+-- New scientific dependencies
+-- New review cycle
Database-level controls should prevent unintended updates to accepted snapshot content. Examples include append-only revision storage, protected artifact objects, constrained mutations, and transactionally enforced state transitions.
For stronger tamper evidence, consider protected audit storage, digest verification, and externally retained recovery evidence. Ordinary application permissions alone do not protect against every privileged or infrastructure-level modification.
6. Separate editor operations from revision commits
Visual editing can generate many temporary changes before the author deliberately creates a revision.
The implementation should define:
- Temporary editor state.
- Autosave or recovery snapshot behavior.
- Explicit saved revision creation.
- Review-submission state.
- Acceptance and publication state.
Autosaving editor state must not overwrite accepted versions or constitute an approval.
Where a rich-text editor such as Tiptap is used, preserve the editor document schema version and any necessary migration rules. Editor-specific transaction history should not be treated as a replacement for the authoritative server-side revision record.
7. Define reviewer annotation contracts
Reviewer comments should remain associated with a precise revision and content target.
Illustrative record:
{
"schema_version": "review-annotation-v1",
"comment_id": "comment-017",
"report_id": "report-017",
"target": {
"revision_id": "revision-v3",
"content_digest": null,
"object_id": "section-methods",
"selector": {
"type": "TextQuoteSelector",
"exact": "Synthetic example passage"
}
},
"reviewer_reference": "reviewer-017",
"created_at": null,
"disposition": "open",
"visibility": "reviewers"
}
The W3C Web Annotation Data Model provides concepts for targeting and selecting portions of resources.
A comment anchored to revision v3 must remain anchored to that historical representation. If the comment is carried forward to v4, create an explicit new target relationship or reattachment decision.
Do not silently relocate a reviewer comment to a visually similar passage.
8. Define author decision records
Author responses should be separate records rather than destructive edits to the original reviewer comment.
Suggested fields:
- Decision ID.
- Original comment ID.
- Responsible actor reference.
- Response and scientific justification.
- Disposition.
- Related resulting revision.
- Decision timestamp.
- Review status of the response, if required.
Illustrative decision:
{
"schema_version": "author-decision-v1",
"decision_id": "decision-017",
"comment_id": "comment-017",
"actor_reference": "author-017",
"disposition": "addressed",
"response": "Clarified the methods and added an uncertainty note.",
"resulting_revision": "revision-v4",
"reviewer_acceptance": "pending"
}
Author disposition and reviewer acceptance are different facts. A resolved comment in the editor is not necessarily proof that a scientific concern was independently resolved.
9. Define approval records and version binding
Approval must bind to the exact reviewed artifact and review scope.
{
"schema_version": "report-approval-v1",
"approval_id": "approval-017",
"report_id": "report-017",
"revision_id": "revision-v4",
"content_digest": null,
"scope": "scientific",
"reviewer_reference": "reviewer-017",
"decision": "approved",
"decided_at": null
}
A revision should not inherit approval automatically after material changes.
Actual acceptance must establish reviewer authority from trusted identity and permissions services.
Scientific approval, editorial approval, rights clearance, revision acceptance, and public release remain distinct operations.
10. Implement conditional writes and concurrency control
Concurrent editors must not silently overwrite one another’s revisions.
Use authoritative expected-version checks when creating new revisions or updating mutable workflow state.
Illustrative HTTP request:
POST /example/reports/report-017/revisions
If-Match: "current-head-v3"
Idempotency-Key: example-command-017
Content-Type: application/json
{
"parent_revision": "revision-v3",
"content_artifact": "artifact-v4"
}
Important: This is a conceptual example route. It is not an existing verified Reporting Studio endpoint.
RFC 9110 defines conditional request behavior. A failed If-Match precondition ordinarily results in HTTP 412, subject to the specification’s handling of already completed state-changing requests.
Where the implementation requires a precondition but none is supplied, HTTP 428 may be appropriate under a documented API policy.
Use transactionally enforced checks at the authoritative storage boundary, not only a client-side comparison.
11. Define idempotency and duplicate-command behavior
Revision creation, reviewer decisions, and acceptance transitions are state-changing operations.
Each accepted command should have a stable identity and defined replay behavior.
The service should distinguish:
- First execution of a valid command.
- Exact repetition of an already accepted command.
- Reuse of a command ID with different input.
- A failed command with no committed mutation.
- An uncertain response after a successful commit.
Exact replay should return the recorded outcome where supported rather than creating another revision. Reuse of the same command identity with different content must be rejected.
Atomic storage of command identity, resulting revision, and audit event prevents replay records from diverging.
Do not assume that all POST operations are inherently idempotent.
12. Enforce tenant and object-level authorization
Authorization must be evaluated for each report and operation, not merely at initial sign-in.
| Operation | Required enforcement |
|---|---|
| Read a draft | Authorized project membership and draft visibility |
| Read historical revision | Version-specific access and confidentiality |
| Create revision | Authorized authoring role and expected head |
| Create reviewer comment | Reviewer authority and authorized revision access |
| Record author response | Permitted author or delegate role |
| Approve scientific review | Authorized reviewer and exact target scope |
| Accept revision | Workflow authority and satisfied review gates |
| Publish revision | Separate public-release authority |
Enforce deny-by-default authorization and confirm permissions for every request. Do not rely on user-supplied tenant IDs, role names, or document ownership claims.
Where object existence is sensitive, design error responses to avoid leaking protected report or reviewer information.
13. Define controlled state transitions
A proposed lifecycle is:
DRAFT
|
v
IN_REVIEW
|
+-- Changes requested --> New draft revision
|
v
REVIEWED
|
v
ACCEPTED
|
+-- New changes --> New draft revision
|
v
PUBLICATION_CANDIDATE
|
v
PUBLISHED
The actual service may use a different state model. It must nonetheless distinguish reviewer completion, revision acceptance, and public-release authorization.
Changes to accepted content must result in a new version, not a mutation of the prior accepted artifact.
14. Preserve scientific dependency manifests
Report revisions may depend on different datasets, methods, figures, tables, citations, and computational results.
Each revision should reference its actual scientific dependencies:
Report v3
|
+-- Dataset snapshot D1
+-- Notebook revision N2
+-- Figure F3
+-- Table T4
+-- Citation manifest C2
Report v4
|
+-- Dataset snapshot D1
+-- Notebook revision N3
+-- Figure F4
+-- Table T4
+-- Citation manifest C3
Changes to scientific dependencies should be visible in revision comparisons.
Do not update the dependency manifest of an accepted historical revision when a newer result becomes available.
15. Define audit events and evidence requirements
Proposed event types include:
report.revision.created
report.revision.review_submitted
report.comment.created
report.comment.responded
report.comment.disposition_changed
report.review.decision_recorded
report.revision.accepted
report.revision.superseded
report.publication.authorized
report.publication.released
report.publication.corrected
These are proposed event names, not verified production events.
Each authoritative audit event should include the actor or service identity, target object and revision, timestamp, permitted operation, recorded outcome, and nonsecret correlation ID.
Do not record passwords, tokens, confidential manuscript text, or private reviewer discussions in unrestricted logs.
16. Provide typed failure contracts
| Code | Meaning | Expected behavior |
|---|---|---|
| REPORT_NOT_FOUND | Report cannot be resolved in authorized scope | Controlled error without disclosure |
| REVISION_NOT_FOUND | Referenced version unavailable | No historical version fabricated |
| REVISION_ACCESS_DENIED | Caller lacks authority | Operation denied |
| REVISION_PARENT_MISSING | Invalid lineage reference | Creation rejected |
| REVISION_CONTENT_MISMATCH | Digest or snapshot content differs | Integrity incident recorded |
| REVISION_STALE_HEAD | Expected current revision changed | Conditional write rejected |
| REVISION_SCHEMA_UNSUPPORTED | Payload or editor schema incompatible | Typed validation failure |
| COMMENT_TARGET_INVALID | Annotation target missing or mismatched | Comment held or rejected |
| AUTHOR_DECISION_INCOMPLETE | Required response or disposition missing | Closure not accepted |
| REVIEW_APPROVAL_STALE | Decision applies to another revision or digest | Approval not reused |
| IDEMPOTENCY_CONFLICT | Command ID reused with different content | Conflicting replay rejected |
| REVISION_WRITE_OUTCOME_UNKNOWN | Previous write outcome uncertain | Authoritative read-back required |
| PUBLICATION_NOT_AUTHORIZED | Public-release gate incomplete | Artifact remains nonpublic |
These are proposed codes. Actual HTTP status mappings must follow the implemented API and applicable RFC 9110 and RFC 9457 semantics.
17. Design durable persistence and audit storage
At the storage boundary, aim to preserve:
- Report identity and ownership.
- Immutable revision snapshots.
- Revision parent relationships.
- Versioned scientific manifests.
- Reviewer annotations.
- Author decisions.
- Version-bound approval records.
- Idempotency records.
- Append-only or protected audit events.
- Publication releases and correction relationships.
Use database transactions to ensure that accepted state changes and their audit evidence commit together.
Where artifacts reside in object storage rather than the database, define a durable staging and finalization protocol and reconcile orphaned artifacts after failures.
Never mark a revision accepted when required evidence exists only in volatile editor memory.
18. Reference implementation and synthetic validation
The following Python reference models version integrity, reviewer annotations, approvals, stale writes, tenant boundaries, and command replay.
It uses synthetic objects and does not access external services.
Prepare the environment:
mkdir reporting-revision-contract
cd reporting-revision-contract
python3 -m venv .venv
source .venv/bin/activate
python --version
Create:
revision_contract.py
test_revision_contract.py
19. Implement the synthetic contract validator
Save as revision_contract.py.
from dataclasses import dataclass
from hashlib import sha256
def digest(value):
return sha256(value.encode()).hexdigest()
@dataclass(frozen=True)
class Revision:
id: str
parent: str | None
body: str
sha: str
state: str
@dataclass(frozen=True)
class Comment:
id: str
target_id: str
target_sha: str
disposition: str
response: str
@dataclass(frozen=True)
class Approval:
target_id: str
target_sha: str
scope: str
approved: bool
def inspect(revisions, comments, approvals):
issues = []
ids = [r.id for r in revisions]
if not all(ids) or len(ids) != len(set(ids)):
issues.append("REVISION_ID_INVALID")
lookup = {r.id: r for r in revisions}
for revision in revisions:
if digest(revision.body) != revision.sha:
issues.append("CONTENT_CHANGED")
if not revision.parent and revision.id != "v1":
issues.append("PARENT_MISSING")
if revision.parent and revision.parent not in lookup:
issues.append("PARENT_MISSING")
if revision.state not in {
"draft", "reviewed",
"accepted", "published"
}:
issues.append("STATE_INVALID")
seen = set()
cursor = revision.id
while cursor in lookup:
if cursor in seen:
issues.append("CYCLE")
break
seen.add(cursor)
cursor = lookup[cursor].parent
comment_ids = [c.id for c in comments]
if len(comment_ids) != len(set(comment_ids)):
issues.append("COMMENT_ID_INVALID")
for comment in comments:
target = lookup.get(comment.target_id)
if target is None:
issues.append("COMMENT_TARGET_MISSING")
elif target.sha != comment.target_sha:
issues.append("COMMENT_TARGET_CHANGED")
if (
comment.disposition in {"addressed", "rejected"}
and not comment.response.strip()
):
issues.append("RESPONSE_MISSING")
for approval in approvals:
target = lookup.get(approval.target_id)
if target is None:
issues.append("APPROVAL_TARGET_MISSING")
elif target.sha != approval.target_sha:
issues.append("STALE_APPROVAL")
for revision in revisions:
if revision.state in {"accepted", "published"}:
valid_approval = any(
approval.target_id == revision.id
and approval.target_sha == revision.sha
and approval.scope == "scientific"
and approval.approved
for approval in approvals
)
if not valid_approval:
issues.append("APPROVAL_MISSING")
return sorted(set(issues))
class Conflict(Exception):
pass
class Denied(Exception):
pass
def create_revision(
head,
expected_head,
*,
actor_tenant,
report_tenant,
command_id,
seen_commands,
new_id,
body
):
if actor_tenant != report_tenant:
raise Denied("WRONG_TENANT")
if not command_id:
raise ValueError("COMMAND_ID_REQUIRED")
payload = (
expected_head,
new_id,
digest(body)
)
if command_id in seen_commands:
if seen_commands[command_id] != payload:
raise Conflict("IDEMPOTENCY_CONFLICT")
# A real service must return the durable
# recorded outcome of this command.
return None
if head.id != expected_head:
raise Conflict("STALE_HEAD")
return Revision(
new_id,
head.id,
body,
digest(body),
"draft"
)
V1 = Revision(
"v1", None, "Original",
digest("Original"), "accepted"
)
V2 = Revision(
"v2", "v1", "Revision",
digest("Revision"), "accepted"
)
C1 = Comment(
"c1", "v1", V1.sha,
"addressed", "Explained change in v2"
)
A1 = Approval(
"v1", V1.sha,
"scientific", True
)
A2 = Approval(
"v2", V2.sha,
"scientific", True
)
if __name__ == "__main__":
print({
"status": (
"PASS_PREFLIGHT"
if not inspect(
(V1, V2), (C1,), (A1, A2)
)
else "FAIL"
),
"findings": inspect(
(V1, V2), (C1,), (A1, A2)
),
"real_authorization": "NOT_TESTED",
"durable_persistence": "NOT_TESTED",
"scientific_validity": "NOT_TESTED"
})
Implementation limitation: The validator deliberately uses a simplified synthetic revision model. Its special treatment of v1 as the root is a fixture convention, not a general revision-graph rule. A production implementation must support the actual root and branch contracts, reject ambiguous parent identities, and enforce state transitions.
Likewise, the tenant check uses supplied fixture values and must not be mistaken for real authentication. The command replay example does not persist the idempotency record or return a stored result; actual duplicate protection must be transactional.
20. Implement and execute negative regression tests
Save as test_revision_contract.py.
import unittest
from dataclasses import replace
from revision_contract import (
V1, V2, C1, A1, A2,
digest, inspect,
create_revision, Conflict, Denied
)
class Tests(unittest.TestCase):
def test_valid(self):
self.assertEqual(
inspect((V1, V2), (C1,), (A1, A2)),
[]
)
def test_tamper(self):
result = inspect(
(V1, replace(V2, body="Tampered")),
(C1,), (A1, A2)
)
self.assertIn("CONTENT_CHANGED", result)
def test_missing_parent(self):
result = inspect(
(V1, replace(V2, parent="absent")),
(C1,), (A1, A2)
)
self.assertIn("PARENT_MISSING", result)
def test_cycle(self):
result = inspect(
(replace(V1, parent="v2"), V2),
(C1,), (A1, A2)
)
self.assertIn("CYCLE", result)
def test_comment_target(self):
result = inspect(
(V1, V2),
(replace(C1, target_sha="bad"),),
(A1, A2)
)
self.assertIn("COMMENT_TARGET_CHANGED", result)
def test_author_response(self):
result = inspect(
(V1, V2),
(replace(C1, response=""),),
(A1, A2)
)
self.assertIn("RESPONSE_MISSING", result)
def test_stale_approval(self):
result = inspect(
(V1, V2), (C1,),
(A1, replace(A2, target_sha="bad"))
)
self.assertIn("STALE_APPROVAL", result)
def test_approval_missing(self):
result = inspect(
(V1, V2), (C1,), (A1,)
)
self.assertIn("APPROVAL_MISSING", result)
def test_stale_head(self):
with self.assertRaises(Conflict):
create_revision(
V2, "v1",
actor_tenant="t1",
report_tenant="t1",
command_id="cmd",
seen_commands={},
new_id="v3",
body="x"
)
def test_wrong_tenant(self):
with self.assertRaises(Denied):
create_revision(
V2, "v2",
actor_tenant="t2",
report_tenant="t1",
command_id="cmd",
seen_commands={},
new_id="v3",
body="x"
)
def test_duplicate_idempotency(self):
result = create_revision(
V2, "v2",
actor_tenant="t1",
report_tenant="t1",
command_id="cmd",
seen_commands={
"cmd": ("v2", "v3", digest("x"))
},
new_id="v3",
body="x"
)
self.assertIsNone(result)
def test_key_reuse_conflict(self):
with self.assertRaises(Conflict):
create_revision(
V2, "v2",
actor_tenant="t1",
report_tenant="t1",
command_id="cmd",
seen_commands={
"cmd": ("v2", "v3", digest("y"))
},
new_id="v3",
body="x"
)
def test_new_revision(self):
result = create_revision(
V2, "v2",
actor_tenant="t1",
report_tenant="t1",
command_id="cmd",
seen_commands={},
new_id="v3",
body="x"
)
self.assertEqual(result.parent, "v2")
if __name__ == "__main__":
unittest.main()
Run:
python -m unittest -v test_revision_contract.py
Executed reference result: 13 tests passed, 0 failures. The tests were run against the synthetic Python implementation in isolation, not against Reporting Studio’s actual APIs or persistent storage.
Additional contract and security coverage is required before production acceptance.
21. Test the actual implementation boundaries
| Test | Required outcome |
|---|---|
| Create authorized draft revision | Unique snapshot and parent reference persist |
| Read historical accepted revision | Exact prior content reconstructs |
| Unknown report or revision | Controlled missing-object response |
| Revoked author access | Write denied without state change |
| Cross-tenant access | Private history and comments inaccessible |
| Stale expected revision | Conditional write rejected |
| Duplicate command | Recorded outcome reused without duplicate revision |
| Conflicting command replay | Input conflict rejected |
| Incomplete revision payload | Typed validation failure |
| Unsupported editor schema | Controlled incompatibility or migration |
| Altered accepted snapshot | Integrity failure detected |
| Reviewer comment moved to new text | Original anchor preserved; reattachment explicit |
| Stale scientific approval | New revision remains unapproved |
| Partial database failure | No accepted revision without required audit evidence |
| Unauthorized publication | No public output exposed |
| Unsafe redirect or remote fetch | Unapproved destination blocked if external resource retrieval exists |
| Backup and restore | Revision lineage, comments, decisions, and approvals reconstruct |
The unsafe-redirect test applies only if the implementation retrieves remote resources through a network-capable editor, import, or preview service. Do not invent an outbound-fetch feature solely to satisfy the test matrix.
22. Validate saved-state and restore acceptance
Revision history is not operationally reliable unless it survives restart and authorized recovery.
Required checks include:
- Create a report and controlled revision under an isolated test identity.
- Add a reviewer comment targeting that exact revision.
- Record an author response and an appropriate review decision.
- Accept a new revision through the trusted workflow.
- Read back the prior accepted snapshot and its original review material.
- Reload the editor and verify the lineage and comment targets.
- Restart the receiving service and repeat the authoritative read-back.
- Restore from an independently verified test backup.
- Reconstruct revision, comment, decision, and approval relationships.
- Confirm private drafts and reviewer material remain protected.
Use disposable PostgreSQL or the actual approved isolated storage engine for restore testing. Do not mount production volumes or join production networks.
A backup’s existence alone is not proof that the complete revision history can be restored.
23. Handle schema migrations and editor upgrades
Rich-text editor upgrades and database changes can affect stored document representations, comment selectors, and revision comparisons.
Before migration:
- Identify existing and target editor schema revisions.
- Preserve immutable accepted snapshots.
- Define supported document transformations.
- Verify scientific tables, figures, equations, citations, and footnotes remain intact.
- Preserve reviewer targets or explicitly record unsupported anchors.
- Confirm historical digests still refer to their original serialized representations.
- Test forward migration and the authorized recovery procedure.
A migration should not rewrite stored accepted-content digests to make transformed documents appear byte-identical to their originals.
Where migration produces a different representation, preserve the original artifact and create an explicit migrated representation with its own identity and derivation record.
24. Keep publication boundaries separate
Reporting Studio may hold a substantial internal authoring and review history. Not all of that history is intended for public disclosure.
Verify that public Research and Research Hub integrations expose only:
- Approved published report versions.
- Authorized public metadata.
- Approved correction or supersession notices.
- Specifically permitted research artifacts.
Reviewer comments, internal author decisions, rejected drafts, and private source material must remain protected unless separate disclosure authority exists.
Public-release checks should cover pages, APIs, downloads, search indexes, cached previews, and knowledge-graph representations where implemented.
25. Prepare an acceptance receipt
Illustrative JSON:
{
"schema_version": "example-1.0",
"workflow": "report_revision_history_developer_acceptance",
"classification": "proposed",
"implementation": {
"repository": null,
"commit": null,
"api_schema": null,
"editor_schema": null,
"deployed_build": null
},
"acceptance": {
"report_identity": "not_tested",
"revision_creation": "not_tested",
"accepted_content_immutability": "not_tested",
"parent_lineage": "not_tested",
"content_digest": "not_tested",
"review_comment_targets": "not_tested",
"author_decisions": "not_tested",
"version_bound_approvals": "not_tested",
"trusted_actor_identity": "not_tested",
"tenant_isolation": "not_tested",
"conditional_writes": "not_tested",
"idempotency": "not_tested",
"audit_event_atomicity": "not_tested",
"editor_schema_compatibility": "not_tested",
"source_provenance": "not_tested",
"publication_authorization": "not_tested",
"public_content_isolation": "not_tested",
"database_migration": "not_tested",
"backup_restore": "not_tested",
"authenticated_staging": "not_tested",
"production_runtime": "not_tested"
},
"reference_test_result": {
"tests": 13,
"passed": 13,
"scope": "synthetic_python_reference_only"
},
"production_release_decision": "NO_GO"
}
The receipt is illustrative. Replace placeholders with authoritative implementation and execution evidence before production acceptance.
26. Required implementation anchors
| Anchor | Required evidence |
|---|---|
| Repository and commit | Exact owning repository, branch, and immutable commit |
| Revision storage | Actual source module, schema, and persistence implementation |
| Editor integration | Actual editor, saved content format, and schema revision |
| Comment contracts | Actual annotation and target-resolution implementation |
| Author-decision workflow | Decision and disposition records |
| Approvals | Exact-version review and authorization source |
| Identity | Trusted authorization and tenant enforcement |
| Concurrency | Expected-version and simultaneous-write tests |
| Idempotency | Durable command replay implementation |
| Audit history | Atomic and protected event evidence |
| Scientific manifests | Actual figure, table, source, and calculation references |
| Publication bridge | Real Research and Research Hub contracts |
| CI | Executed integration and security results tied to the commit |
| Staging | Authenticated acceptance and read-back evidence |
| Migration | Executed schema compatibility evidence |
| Recovery | Verified backup and isolated restore receipt |
| Production | Deployed build identity and authorized release decision |
A missing mandatory implementation anchor must remain visibly Not Tested or Blocked. A synthetic contract test cannot substitute for an authenticated production or staging test.
27. Developer escalation and recovery
Escalate when:
- Accepted content changes unexpectedly.
- Revision history cannot be reconstructed after reload or restore.
- Reviewer comments lose their original content targets.
- Author decisions or approval records disappear.
- A stale editor overwrites a newer report revision.
- Approval from an earlier revision is reused incorrectly.
- Unauthorized users access private report history.
- A migration corrupts scientific figures, tables, equations, or citations.
- Public interfaces disclose private drafts or review material.
- A partial write creates an accepted revision without its required audit record.
Preserve the last accepted snapshot, stop unsafe mutation or publication, reconcile the authoritative stored state, and repeat the affected integration and negative tests in an isolated environment.
Never repair an inconsistent report history by inventing reviewer decisions, silently deleting accepted versions, or modifying historical timestamps.
28. Technical 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/.
- Internet Engineering Task Force (IETF). HTTP Semantics, RFC 9110. Available at: https://www.rfc-editor.org/rfc/rfc9110.html.
- Internet Engineering Task Force (IETF). 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 guidance.
- Python Software Foundation. hashlib — Secure Hashes and Message Digests. Available at: Python documentation.
- Python Software Foundation. unittest — Unit Testing Framework. Available at: Python documentation.
29. Completion and verification record
| Criterion | Pass requirement |
|---|---|
| Revision identity | Unique and authoritative report version references |
| Historical integrity | Previously accepted content remains immutable and reconstructable |
| Lineage | Valid parent relations without silent loss or overwrite |
| Tracked changes | Material changes associated with the correct revisions |
| Reviewer comments | Exact target revision and content relationship preserved |
| Author decisions | Responses, dispositions, and author authority recorded |
| Approvals | Decisions bound to exact content and review scopes |
| Scientific provenance | Historical source, figure, table, and calculation relationships retained |
| Concurrency | Stale writes rejected without overwriting accepted work |
| Idempotency | Duplicate commands do not create conflicting revisions |
| Authorization | Trusted author, reviewer, project, and tenant boundaries enforced |
| Persistence | Revision and decision history survives reload and restart |
| Recovery | History reconstructs after isolated restore |
| Publication boundary | Private drafts and comments excluded from unauthorized public outputs |
| Implementation evidence | Exact source commits, executed tests, deployment identity, and release decision recorded |
Developer completion criterion: Report revision history is technically accepted when previous accepted versions remain immutable and independently retrievable; revision lineage and scientific dependencies can be reconstructed; reviewer comments and author decisions retain their original targets and actors; approvals bind to exact content; stale writes, duplicate commands, and unauthorized access are controlled; and history survives restart, migration, and independently verified restore.
Scientific limitation: A complete revision graph and valid content digests establish traceability and consistency, not the scientific correctness of the report. Material changes to data, methods, figures, calculations, uncertainty, or conclusions still require appropriate scientific review.
Current implementation status: Proposed revision architecture, versioned contracts, reviewer annotations, author decisions, exact-version approvals, immutable snapshots, concurrency controls, idempotency, tenant isolation, audit events, publication boundaries, migration and restore requirements, and thirteen executed synthetic Python regression tests documented. No specific Reporting Studio revision-history API, Tiptap integration, reviewer storage service, Workspace authorization bridge, or production release is certified without actual repository inspection, authenticated integration tests, durable persistence evidence, and independent operational acceptance.
