I rebuilt a question found in actual production source as independent synthetic code. The complete implementation, examples and tests are shared without connecting the original business program or material.
Keep title separate from provenance
Chart classification is explicit: official, synthetic or unverified. A title never upgrades it. Reference, date and unit remain separate declarations, not institution authentication. A title sounding official can still describe synthetic data.
A scope card requires finding, observation scope, unestablished conclusions and a next check together. There is no automatic expansion into a treatment claim. The example contains no actual study or patient material and concerns presentation boundaries.
Trace the same asset and claim
Notice comparison checks asset, language, version and statement between card and file, returning differing fields. Text consistency does not certify actual rights. The contract checks presentation agreement without pretending to make a legal decision.
Lineage connects an asset identifier, origin and permission note to claims and evidence references. Orphans, duplicate identifiers and missing caller review fail. The flag remains a declaration; a human must assess what the image supports. Inputs are copied rather than changed.
Separate structure from expert review
Review state distinguishes editorial depth, recorded source checking and expert review. Recorded expert review requires evidence; an inactive review cannot carry an inconsistent evidence value. No combination grants publication authorization.
This is a presentation-state contract, not an access-control system. Reading the source site’s final enhancement and build order motivated the distinction between structured prose and professional review. Actual content validity still needs separate review.
Explore the implementation
Complete independent synthetic implementation
"""Independent synthetic presentation contracts. No fact or rights certification."""
from copy import deepcopy
from datetime import date
def text(value):
if not isinstance(value,str) or not value.strip() or len(value)>800: raise ValueError('bounded nonempty text required')
return value
def chart(title, kind, reference, checked, unit):
if kind not in ('official','synthetic','unverified'): raise ValueError('explicit provenance required')
for v in (title,reference,unit): text(v)
date.fromisoformat(checked)
return dict(title=title,provenance=kind,reference=reference,checked=checked,unit=unit,caller_declared=True)
def notice_pair(card, file):
keys={'asset','language','version','statement'}
for row in (card,file):
if set(row)!=keys: raise ValueError('explicit notice fields required')
for v in row.values(): text(v)
return {'consistent':card==file,'differences':sorted(k for k in keys if card[k]!=file[k]),'rights_certified':False}
def lineage(assets, claims):
if not isinstance(assets,list) or not isinstance(claims,list): raise ValueError('lists required')
ids=[text(a['id']) for a in assets]
if len(set(ids))!=len(ids): raise ValueError('duplicate asset')
for a in assets:
if set(a)!={'id','origin','permission_note'}: raise ValueError('asset contract')
text(a['origin']);text(a['permission_note'])
seen=set()
for c in claims:
if set(c)!={'id','asset','claim','evidence','reviewed'}: raise ValueError('claim contract')
if text(c['id']) in seen: raise ValueError('duplicate claim')
seen.add(c['id'])
if c['asset'] not in ids or c['reviewed'] is not True: raise ValueError('missing asset or caller review')
text(c['claim']);text(c['evidence'])
return {'assets':deepcopy(assets),'claims':deepcopy(claims),'automatic_truth_judgment':False}
def review_state(depth, source_check, expert_review, expert_evidence=None):
if depth not in ('initial','structured') or source_check not in ('not_recorded','recorded') or expert_review not in ('not_performed','recorded'): raise ValueError('unknown status')
if expert_review=='recorded': text(expert_evidence)
elif expert_evidence is not None: raise ValueError('inactive evidence')
return dict(depth=depth,source_check=source_check,expert_review=expert_review,expert_evidence=expert_evidence,publication_authorized=False)
def scope_card(finding, study_scope, not_established, next_check):
return {k:text(v) for k,v in locals().items()}Do not manufacture a review event
Evidence attached to an unperformed expert review is inconsistent, while a recorded review requires a reference. Even that does not authenticate the reviewer’s qualifications. The contract keeps the explanation allowed by state separate from the factual responsibility of verifying an actual professional review.
The counterexample is inspectable through tests and saved execution records. Adoption requires checking input meaning and failure policy before changing labels. A small independent function does not replace an operational application.
Published code and ZIP use the same reviewed files. The central decision can be inspected without importing company records or running another system. Any added integration needs separate observed results; the existing package does not pre-certify its behavior.
Actual execution evidence and its boundary
The source folder and a fresh ZIP extraction each passed 12 tests. Actual example results are saved in records.json, and the published core can be compared with the download. Historical project completion messages and test totals were not reused as evidence of this execution.
The selector reads results saved by actual local runs; it does not execute Python or a server in the browser. These checks do not establish rendered-browser or physical-device behavior. An integrated service needs its own observed verification rather than inheriting a broader claim from these small tests.
Before adapting the download
The ZIP contains core implementation, tests, runner, saved results and guidance; live examples also include bilingual HTML. This is new synthetic code with permission to modify and reuse, without original customer images, operational records or credentials. It contains no instruction to execute the source business program or transmit its material.
Begin adoption by defining units, input provenance and failure messages for the actual workflow. Passing tests cannot certify all supplied facts or grant operational authority. Authentication, persistence, transmission and rendered-interface review remain outside the small contract. I share both a reusable implementation and the decisions an adopter still needs to make.