Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions schemas/soxl_tqqq_clean_cutover_snapshot.v1.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$vocabulary": {"https://json-schema.org/draft/2020-12/vocab/format-assertion": true},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Activate format assertions through the selected dialect

When a downstream consumer uses an ordinary Draft 2020-12 validator without separately installing and enabling a format checker, format remains annotation-only because $schema selects the standard meta-schema; declaring $vocabulary in this instance schema does not activate assertion behavior. Dates such as 2026-02-30 therefore satisfy the regex and pass schema validation, while the test masks this by explicitly supplying FORMAT_CHECKER; select a meta-schema that declares the assertion vocabulary or otherwise make the validator requirement enforceable.

Useful? React with 👍 / 👎.

"$id": "https://quantstrategylab.github.io/schemas/soxl_tqqq_clean_cutover_snapshot.v1.schema.json",
"title": "Offline SOXL/TQQQ clean-cutover snapshot manifest",
"type": "object",
"additionalProperties": false,
"required": [
"schema", "pair_id", "symbols", "payload_sha256", "calendar_sha256", "timezone", "coverage",
"adjustment_semantics", "evidence_generation", "plugin", "offline_fixture", "source_identity",
"producer_identity", "producer_contract_version", "materialized_at", "materialization_receipt", "compatibility", "size"
],
"properties": {
"schema": {"const": "soxl_tqqq_clean_cutover_snapshot.v1"},
"pair_id": {"enum": ["QQQ_TQQQ", "SOXX_SOXL"]},
"symbols": {"type": "array", "items": {"type": "string"}, "minItems": 2, "maxItems": 2, "uniqueItems": true},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bind schema symbols to the selected pair

When a downstream consumer validates a manifest only against this new schema, pair_id: "QQQ_TQQQ" can be paired with any two unique strings, including SOXX/SOXL or unrelated symbols, even though the Python verifier requires the exact PAIR_SYMBOLS mapping. This allows a schema-valid manifest to misidentify its dataset; add pair-specific conditional constraints so each pair_id requires its canonical ordered symbol list.

Useful? React with 👍 / 👎.

"payload_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"calendar_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"timezone": {"const": "America/New_York"},
"coverage": {
"type": "object",
"additionalProperties": false,
"required": ["first_available_session", "last_available_session", "completed_sessions", "row_count", "per_symbol_counts"],
"properties": {
"first_available_session": {"type": "string", "format": "date", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"},
"last_available_session": {"type": "string", "format": "date", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"},
"completed_sessions": {"type": "array", "items": {"type": "string", "format": "date", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"}, "minItems": 1, "uniqueItems": true},
"row_count": {"type": "integer", "minimum": 2},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require an even coverage row count

For either supported pair, every completed session contains exactly two symbols, but this schema accepts an odd row_count such as 3 alongside one completed session and one count per symbol. A schema-only consumer can therefore accept impossible coverage that the Python verifier rejects; require at least multipleOf: 2 so the static pair cardinality is represented in the schema.

Useful? React with 👍 / 👎.

"per_symbol_counts": {"type": "object", "additionalProperties": {"type": "integer", "minimum": 1}}
}
},
"adjustment_semantics": {"const": "adjusted_close"},
"evidence_generation": {"const": "clean_cutover_v1"},
"plugin": {"const": "ABSENT_DISABLED"},
"offline_fixture": {"const": true},
"source_identity": {"type": "string", "minLength": 1},
"producer_identity": {"type": "string", "minLength": 1},
"producer_contract_version": {"const": "soxl_tqqq_clean_cutover_snapshot.materializer.v1"},
"materialized_at": {"type": "string", "format": "date-time", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"},
"materialization_receipt": {"const": "offline_fixture"},
"compatibility": {
"type": "object",
"additionalProperties": false,
"required": ["legacy_read", "legacy_write", "dual_read", "auto_migration", "fallback", "side_by_side_namespace"],
"properties": {
"legacy_read": {"const": "historical_read_only"},
"legacy_write": {"const": "forbidden"},
"dual_read": {"const": "forbidden"},
"auto_migration": {"const": "forbidden"},
"fallback": {"const": "forbidden"},
"side_by_side_namespace": {"const": "required_new_namespace"}
}
},
"size": {"const": 0}
},
"allOf": [
{
"if": {"properties": {"pair_id": {"const": "QQQ_TQQQ"}}, "required": ["pair_id"]},
"then": {
"properties": {
"symbols": {"const": ["QQQ", "TQQQ"]},
"coverage": {
"properties": {
"per_symbol_counts": {
"type": "object",
"additionalProperties": false,
"required": ["QQQ", "TQQQ"],
"properties": {
"QQQ": {"type": "integer", "minimum": 1},
"TQQQ": {"type": "integer", "minimum": 1}
}
}
}
}
}
}
},
{
"if": {"properties": {"pair_id": {"const": "SOXX_SOXL"}}, "required": ["pair_id"]},
"then": {
"properties": {
"symbols": {"const": ["SOXX", "SOXL"]},
"coverage": {
"properties": {
"per_symbol_counts": {
"type": "object",
"additionalProperties": false,
"required": ["SOXX", "SOXL"],
"properties": {
"SOXX": {"type": "integer", "minimum": 1},
"SOXL": {"type": "integer", "minimum": 1}
}
}
}
}
}
}
}
]
}
Loading
Loading