7.0 KiB
Formats
Purpose
Synaptopus uses JSON-facing artifact types as the bridge to future browser and TypeScript tooling:
- artifact manifest
- graph schema
- execution trace
- run report
- demo snapshot
These are generated today by the internal demo exporter. The examples below reflect the current output shapes rather than speculative formats.
All exported artifacts are wrapped in a versioned envelope with this top-level shape:
artifact_typeschema_versionpayloadmetadata
Example:
{
"artifact_type": "graph_schema",
"schema_version": "1.0",
"payload": {
"nodes": [],
"edges": []
},
"metadata": {}
}
Artifact Manifest
The manifest is the directory-level index for a set of exported artifacts.
Top-level fields:
schema_versionartifactsmetadata
Each artifact entry has:
artifact_typefile_name
Example:
{
"schema_version": "1.0",
"artifacts": [
{ "artifact_type": "graph_schema", "file_name": "graph.json" },
{ "artifact_type": "execution_trace", "file_name": "trace.json" },
{ "artifact_type": "run_report", "file_name": "report.json" },
{ "artifact_type": "demo_snapshot", "file_name": "snapshot.json" }
],
"metadata": {
"example": "parity_pressure",
"snapshot_after_accepted": 2
}
}
Graph Schema
The graph schema describes node roles and wiring. It does not encode full runtime behavior by itself.
Top-level fields:
nodesedges
Each node has:
node_idnode_typeinput_namesoutput_names
Each edge has:
source_node_idsource_outputtarget_node_idtarget_input
Example:
{
"artifact_type": "graph_schema",
"schema_version": "1.0",
"payload": {
"nodes": [
{
"node_id": "generator",
"node_type": "generator",
"input_names": ["state"],
"output_names": ["candidate"]
},
{
"node_id": "policy",
"node_type": "policy",
"input_names": ["state", "candidate", "critique", "category"],
"output_names": ["decision", "accepted"]
}
],
"edges": [
{
"source_node_id": "generator",
"source_output": "candidate",
"target_node_id": "critic",
"target_input": "candidate"
}
]
},
"metadata": {}
}
Execution Trace
The execution trace captures the real runtime behavior of a system under the generic accept/reject loop.
Top-level fields:
acceptedattemptsfinal_statetotal_seconds
Each step trace contains:
previous_statenext_statecandidateacceptedelapsed_secondsmetadata
The metadata payload is intentionally architecture- and example-specific, but it must still be JSON-safe. For the XOR novelty demo it contains:
critiquecategorydecision
Example excerpt:
{
"artifact_type": "execution_trace",
"schema_version": "1.0",
"payload": {
"accepted": [
{
"candidate": [0, 1],
"accepted": true,
"metadata": {
"critique": {
"outputs": [0.9850980332426884],
"loss": 0.0
},
"category": {
"winner": 0,
"matched": true,
"new_category": false,
"delta_vigilance": false
},
"decision": {
"accepted": true,
"label": "accept"
}
}
}
]
},
"metadata": {}
}
Generic And Example-Specific Trace Fields
The execution trace has two layers:
- generic runtime fields, which should remain stable across examples
metadata, which may vary by example or architecture family
Generic fields:
previous_statenext_statecandidateacceptedelapsed_seconds
Example-specific metadata should stay JSON-safe and should be interpreted by consumers only when they know the example or system family.
Run Report
The run report is a compact summary artifact for comparison, dashboarding, and experiment logging.
Top-level fields inside payload:
parametersaccepted_countattempt_counttotal_secondssequence_analysisaverage_attempts_per_accept
Example:
{
"artifact_type": "run_report",
"schema_version": "1.0",
"payload": {
"parameters": {
"example": "xor_novelty",
"accepted_count": 2,
"max_attempts_per_accept": 4
},
"accepted_count": 2,
"attempt_count": 3,
"total_seconds": 0.00019715959206223488,
"sequence_analysis": {
"item_count": 2,
"alphabet_size": 4,
"unigram_entropy_bits": 1.0,
"conditional_entropy_bits": 0.0,
"normalized_entropy": 0.5,
"predictability": 1.0,
"redundancy": 0.5
}
},
"average_attempts_per_accept": 1.5
},
"metadata": {}
}
The sequence_analysis object is optional. When present, it currently contains:
item_countalphabet_sizeunigram_entropy_bitsconditional_entropy_bitsnormalized_entropypredictabilityredundancy
Demo Snapshot
The demo snapshot artifact is the first checkpoint/resume format in Synaptopus. It is currently scoped to the internal demos rather than arbitrary user-defined systems.
Top-level fields inside payload:
demo_namesystemrecordparameters
The system object stores the mutable model internals needed to resume execution, such as ART1 categories and backpropagation weights. The record object stores the accumulated execution history up to the checkpoint.
Example:
{
"artifact_type": "demo_snapshot",
"schema_version": "1.0",
"payload": {
"demo_name": "parity_pressure",
"system": {
"critic_network": {},
"categorizer_network": {},
"acceptance_threshold": 0.8
},
"record": {
"accepted": [],
"attempts": [],
"final_state": {
"accepted": [[0, 0, 1], [1, 0, 0]],
"attempts": 5
},
"total_seconds": 0.0005
},
"parameters": {
"accepted_count": 2,
"max_attempts_per_accept": 12
}
},
"metadata": {
"demo_name": "parity_pressure"
}
}
Versioning
The current artifact schema version is:
1.0
Any future breaking change to the envelope, manifest, or payload structures should increment the schema version rather than silently changing field meaning.
Format Constraints
These constraints should remain stable:
- artifacts must be JSON-safe without Python-specific types
- exported files should be versioned via envelopes
- artifact sets should include a manifest
- tuples must serialize as arrays
- dataclass-like records must serialize as plain objects
- graph schemas must remain declarative
- traces must reflect actual runtime attempts and acceptances
- reports should stay compact and comparison-friendly
Intended TypeScript Mapping
The natural future TypeScript split is:
- manifest interfaces
- artifact envelope interfaces
- graph schema interfaces
- trace interfaces
- report interfaces
Those should be derived directly from the current artifact contracts rather than reinterpreted independently in the frontend.