OptimonCoreSync Studio
IE

Data model and hand-off scripts

The database design that sits underneath these screens. Both scripts have been executed end to end against PostgreSQL and load clean into an empty database.

Simulated fixture data. Every record, receipt and timeline entry on this screen is demonstration material. It is never production evidence.
Tables
22
plus two reporting views
Seeded records
792
28 record types, 28 rows each
Catalogue rows
192 / 24 / 28
use cases / journeys / views
Engine
PostgreSQL 14+
no vendor-specific types

Files in the repository

  • database/schema.sql — full DDL: enums, tables, foreign keys, indexes, append-only rule and two reporting views.
  • database/seed.sql — generated DML that reproduces every row these screens show (792 records, their statuses, links, use-case bindings and evidence timelines).
  • database/generate-seed.ts — regenerates the seed from the application fixtures, so the dev database never drifts from the workspace.
  • database/schema-connectors.sql — additive v0.2 DDL for the connector catalogue (274 profiles, 23 families, 12 templates, capability grid, primary sources), contracts, the 32 management operations, connection lifecycle, recovery, qualification, release gates, the warehouse grain and assisted diagnosis history. Approved canonical contracts and proposed warehouse specialisations live in separate tables and are never merged.
  • database/seed-connectors.sql — generated DML for all of the above, taken from the same packs and fixtures these screens render.
  • database/generate-connector-seed.ts — regenerates that seed so the scripts and the screens cannot drift.
  • database/schema-vision.sql — additive v0.3 DDL for the machine vision (EyeZ) extension: 33 camera and perception profiles, 16 software and standards dependencies, 60 EyeZ jobs with their camera and software candidates, 12 payload contracts, 12 detail screens, 16 fault scenarios, the ten runtime operations with their effect, and the station, calibration, capture-group, view, evidence, inspection, association, recovery, qualification and release grain.
  • database/seed-vision.sql — generated DML for all of the above, taken from the same pack and fixtures the vision screens render.
  • database/generate-vision-seed.ts — regenerates the vision seed so those scripts and screens cannot drift.
  • database/decisions.md — decisions taken and the open proposals awaiting the canonical V9 identifiers and the connector work.
psql "$DATABASE_URL" -f database/schema.sql
psql "$DATABASE_URL" -f database/seed.sql
psql "$DATABASE_URL" -f database/schema-connectors.sql
psql "$DATABASE_URL" -f database/seed-connectors.sql
psql "$DATABASE_URL" -f database/schema-vision.sql
psql "$DATABASE_URL" -f database/seed-vision.sql

Verified by loading all six scripts into a PostgreSQL engine: 274 connector profiles, 408 capability rows, 40 approved shared schemas, 18 proposed warehouse specialisations, 32 management operations, the full warehouse grain, and the vision extension (33 profiles, 60 EyeZ jobs, 624 candidate references, 26 stations, 77 capture views, 73 evidence references, 26 inspections), with no null foreign keys. Constraints in the schema enforce the honesty rules — a count can never post an adjustment, a hold can never be released from CoreSync, an inspection can never release product or cause actuation, and a non-pass vision state can never be admitted as a pass.

Tenancy and context

Two isolated tenants, four sites, named people.
TablePurposeKey
tenantIsolated customer workspace; carries the simulation flag.code unique
sitePhysical plant, warehouse or line inside a tenant.tenant_id, code
personNamed actor referenced by evidence and ownership.tenant_id, display_name

Programme catalogue

The 192 use cases, 23 families, 24 journeys and 28 views are data, not code.
TablePurposeKey
use_case_familyThe 23 families.family_code
use_caseAll 192 use cases with actor, trigger, workflow, exception, acceptance.use_case_id
journeyThe 24 composite journeys with owner and alternate failure path.journey_id
journey_use_caseOrdered steps linking a journey to its use cases.composite
nav_group / app_viewThe seven navigation groups and 28 views with routes.view_id, route unique
view_familyWhich families each view answers for.composite
coverage_entryLedger proving every use case resolves to a view.use_case_id

Record spine

All 28 record types share one identity table so any row can link to any other row.
TablePurposeKey
cs_recordIdentity, tenancy, notes and kind-specific attributes in jsonb.business_id unique
cs_record_statusOne row per status dimension — a single badge is never sufficient.record_id, dimension
cs_record_linkThe interconnection graph; no record is a dead end.from, to, relation
cs_record_use_caseWhich catalogue use cases a record demonstrates.composite
cs_record_journeyWhich journeys a record participates in.composite

Evidence and semantics

Corrections never erase the original; the three times stay apart.
TablePurposeKey
cs_eventAppend-only evidence timeline; deletes are blocked by rule.record_id, occurred_at
observation_valueQuantity kind, unit, quality, truth context and value origin as separate columns.canonical_subject, parameter

Actions and activity

The permission matrix is data so it can change without a migration.
TablePurposeKey
action_definitionEvery action a screen can offer, and what it moves.action_code
action_permissionWhich roles may execute a permission key.permission_key, role
activity_logWhat was done, acting as which role, with the evidence written.acted_at

Invariants the schema enforces

  • Lifecycle, approval, deployment, disposition, runtime health and evidence maturity are separate status dimensions — never collapsed into one column.
  • Original source time, recorded time and valid time are three distinct columns on every observation.
  • Quantity kind, unit, quality, truth context and value origin are separate; none of them implies another.
  • Evidence is append-only: a correction is a new row pointing back, and the original stays readable.
  • Every record carries its tenant and a simulation flag, so no fixture row can be read as production evidence.
  • Replay, backfill and reprocessing are modelled as distinct recovery operations, not one verb.

Where each record type lands

Every one of these is a row in cs_record with its kind-specific attributes in jsonb. See the coverage ledger for what is and is not demonstrated.