TG-PARSE
TrustGate Signal Parser Engine
0. Identity
Depends on module:
1. Purpose
The TrustGate Signal Parser Engine (TG-PARSE) is the first executable micro-engine in the TrustGate runtime pipeline.
TG-PARSE receives inbound raw signals from Input Hub, federation gateways, connectors, APIs, uploaded files, and internal event streams. Its purpose is to parse those raw inputs into canonical TrustGate signal objects that can be normalized, enriched, validated, scored, routed, replayed, and anchored.
TG-PARSE does not decide whether a signal is trusted. It establishes whether the signal can be structurally interpreted and represented as a deterministic runtime object.
The output of TG-PARSE becomes the required input to TG-VALIDATE-STRUCTURE.
Only structurally admitted signals may proceed to TG-NORMALIZE-SIGNAL.
2. Position Within TrustGate
2.1. Pipeline Position
External Source / Input Hub / Federation Gateway
│
▼
TG-PARSE — Signal Parser Engine
│
▼
TG-VALIDATE-STRUCTURE — Structure Validation Engine
│
▼
TG-NORMALIZE-SIGNAL — Signal Normalizer Engine
│
▼
TG-ENRICH-CONTEXT — Context Enrichment Engine
TG-PARSE SHALL execute before normalization, enrichment, validation, scoring, routing, replay artifact preparation, DAL anchoring, and federation exchange.
2.2. Architectural Role
| Responsibility Area | Role of TG-PARSE |
|---|---|
| Runtime Pipeline | First executable parsing stage |
| Data Integrity | Converts raw payloads into deterministic canonical objects |
| Replayability | Preserves input hashes and parse metadata required for deterministic replay |
| Lineage | Creates the first TrustGate parsing lineage event |
| DAL | Produces parse-stage anchor candidates |
| Federation | Preserves source ECO Number, DID metadata, signatures, and federation context when present |
3. Canonical Identity
3.1. Engine Identity
| Property | Value |
|---|---|
| Engine Name | Signal Parser Engine |
| Short Name | TG-PARSE |
| MEID | MEID_SIGNAL_INGEST_PARSER |
| Canonical CMI | vera.TG-PARSE.ENGINE.SIGNAL.1_0_0 |
| ZAR Code | TGP01 |
| CMI Kind | ENGINE |
| Owner Module | Verification & Assurance |
| Runtime Tier | Tier-0 |
| Criticality | Critical |
| Replay Support | Native |
| DAL Anchoring | Yes |
| Federation Aware | Yes |
3.2. MEID Binding
The logical engine identity is stable:
MEID_SIGNAL_INGEST_PARSER
The CMI identifies the versioned executable implementation:
vera.TG-PARSE.ENGINE.SIGNAL.1_0_0
ZAR SHALL bind the MEID to one or more CMI versions.
MEID_SIGNAL_INGEST_PARSER
├── vera.TG-PARSE.ENGINE.SIGNAL.1_0_0
├── vera.TG-PARSE.ENGINE.SIGNAL.1_1_0
└── vera.TG-PARSE.ENGINE.SIGNAL.2_0_0
4. Runtime Responsibilities
TG-PARSE SHALL perform the following responsibilities:
| Responsibility | Description |
|---|---|
| Payload Intake | Accept raw payloads or payload references from approved ingress channels |
| Format Detection | Identify JSON, XML, CSV, XBRL, PDF-extracted JSON, OCR-derived JSON, API payloads, or binary references |
| Envelope Parsing | Extract event metadata, source metadata, tenant context, ECO Number, and routing hints where present |
| Structural Parsing | Convert raw payload into a canonical internal parse object |
| Hashing | Generate deterministic input hash and parse output hash |
| Schema Candidate Detection | Identify candidate SSSR schema references |
| Source Preservation | Preserve raw payload URI or immutable payload pointer |
| Parse Diagnostics | Emit parse warnings, ambiguity indicators, and field-level parse status |
| Lineage Creation | Emit initial TrustGate parse lineage event |
| Replay Preparation | Store all information needed for deterministic re-parse |
| DAL Preparation | Create parse-stage DAL anchor candidate |
TG-PARSE SHALL NOT perform trust scoring, business validation, threshold routing, or quarantine decisions except for unrecoverable parse failures.
5. Inputs
5.1. Canonical Input CSIs
TrustGate CSI identifiers SHALL follow the canonical CSI pattern:
<csi_module>.<csi_component>.<csi_kind>.<csi_name>.<csi_version_maj>_<csi_version_min>
Example:
comp.AIIL.INPUT.TRUST-SCORE.v1_0
TG-PARSE consumes the following CSI contracts:
| CSI | Required | Description |
|---|---|---|
vera.TG.INPUT.RAW-SIGNAL.v1_0 | Yes | Raw inbound signal or payload reference |
vera.TG.INPUT.SOURCE-METADATA.v1_0 | Yes | Source system, connector, tenant, and ingestion metadata |
vera.TG.INPUT.ROUTING-HINT.v1_0 | No | Optional routing hint emitted by ZSSR or upstream orchestrator |
vera.TG.INPUT.FEDERATION-CONTEXT.v1_0 | No | Optional AFLE/EGFS federation context |
siss.SSSR.INPUT.SCHEMA-REF.v1_0 | No | Optional explicit schema reference |
5.2. Minimal Input Envelope
{
"event_id": "01JBF0W4Y5T2V5W3N5X7A1B2C",
"event_type": "trustgate.raw_signal",
"event_time": "2026-06-25T09:40:12Z",
"eco_number": "ECO-A123",
"source_system": "mice_invoice_emissions",
"payload_format": "json",
"payload": {
"invoice_id": "INV-203948",
"line_id": "INV-203948-L5",
"description": "Recycled copy paper A4 80gsm"
},
"routing_hint": {
"version": "1.0",
"proposed_by_cmi": "vera.ZSSR-RULESET.RULESET.INVOICE-LINES.2026_06_01",
"candidates": [
{
"next_zar_code": "TGP01",
"reason": "TrustGate parsing",
"confidence": 0.94
}
]
}
}
5.3. Input Validation Requirements
TG-PARSE SHALL verify that:
event_idis present and unique within the ingestion window;event_timeis present and parseable;- either
payloadorpayload_uriis present; - source metadata is present;
- payload size is within configured limits;
- if an ECO Number is present, its format is valid;
- if a signature is present, the signature envelope is preserved for later verification.
6. Outputs
6.1. Canonical Output CSIs
| CSI | Description |
|---|---|
vera.TG.OUTPUT.CANONICAL-SIGNAL.v1_0 | Canonical parsed signal object |
vera.TG.OUTPUT.PARSE-METADATA.v1_0 | Format, schema candidate, parser version, diagnostics |
vera.TG.OUTPUT.PARSE-DIAGNOSTICS.v1_0 | Parse warnings, recoverable errors, ambiguity markers |
vera.TG.OUTPUT.LINEAGE-EVENT.v1_0 | Parse-stage lineage event |
vera.TG.OUTPUT.DAL-CANDIDATE.v1_0 | Parse-stage DAL anchor candidate |
6.2. Canonical Parsed Signal
{
"parsed_signal_id": "PSG-2026-000001",
"source_event_id": "01JBF0W4Y5T2V5W3N5X7A1B2C",
"eco_number": "ECO-A123",
"payload_format": "json",
"schema_candidates": [
"siss.SSSR.SCHEMA.TRUSTGATE-RAW-SIGNAL.1_0_0"
],
"canonical_payload": {
"invoice_id": "INV-203948",
"line_id": "INV-203948-L5",
"description": "Recycled copy paper A4 80gsm"
},
"parse_metadata": {
"parser_cmi": "vera.TG-PARSE.ENGINE.SIGNAL.1_0_0",
"input_hash": "sha256:a2f4f6e0d9a3...",
"output_hash": "sha256:9a5b1f2d0c4e...",
"parse_duration_ms": 14,
"warnings": []
},
"created_at": "2026-06-25T09:40:12Z"
}
7. Processing Pipeline
7.1. Pipeline Steps
Receive Input
│
▼
Validate Envelope
│
▼
Detect Payload Format
│
▼
Load Parser Strategy
│
▼
Parse Payload
│
▼
Generate Canonical Signal
│
▼
Compute Hashes
│
▼
Emit Parse Metadata
│
▼
Emit Lineage Event
│
▼
Forward to TG-NORM
7.2. Runtime Algorithm
function parse_signal(input_event):
validate_required_envelope(input_event)
payload_ref = resolve_payload(input_event.payload, input_event.payload_uri)
input_hash = canonical_hash(payload_ref)
format = detect_format(payload_ref)
parser = select_parser_strategy(format, input_event.source_system)
canonical_payload = parser.parse(payload_ref)
schema_candidates = infer_schema_candidates(canonical_payload)
output_hash = canonical_hash(canonical_payload)
parse_metadata = build_parse_metadata(
parser_cmi,
input_hash,
output_hash,
format,
schema_candidates
)
emit_canonical_signal(canonical_payload, parse_metadata)
emit_lineage_event()
emit_dal_candidate()
return canonical_payload
8. Runtime Configuration
8.1. Configuration Object
{
"engine_cmi": "vera.TG-PARSE.ENGINE.SIGNAL.1_0_0",
"strict_schema_detection": false,
"allow_payload_uri": true,
"allow_inline_payload": true,
"maximum_payload_size_mb": 50,
"accepted_formats": [
"JSON",
"XML",
"CSV",
"XBRL",
"PARQUET",
"PDF_EXTRACTED_JSON",
"OCR_JSON"
],
"hash_algorithm": "SHA-256",
"preserve_raw_pointer": true,
"emit_parse_diagnostics": true
}
8.2. Configuration Rules
| Configuration | Default | Description |
|---|---|---|
strict_schema_detection | false | Whether parsing fails if no schema candidate is found |
allow_payload_uri | true | Whether payloads may be referenced by URI |
allow_inline_payload | true | Whether inline payloads are accepted |
maximum_payload_size_mb | 50 | Maximum allowed payload size |
preserve_raw_pointer | true | Whether raw payload pointer is preserved |
emit_parse_diagnostics | true | Whether diagnostics are emitted |