Skip to content

Commit 0b6cb4a

Browse files
Pigbibicodex
andcommitted
feat(research): seal historical combo P1 roots
Co-Authored-By: Codex <noreply@openai.com>
1 parent cd6e10b commit 0b6cb4a

6 files changed

Lines changed: 836 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Historical combo P1 immutable-root contract
2+
3+
`qsl.us-equity-historical-combo-p1-root-manifest.v1` is the local, immutable
4+
storage boundary for an already-validated
5+
`qsl.us-equity-historical-combo-p1-input.v1` record. It is deliberately
6+
small: it seals bytes that have already been acquired; it does not decide
7+
whether data are good enough to acquire or use.
8+
9+
## What one root contains
10+
11+
Each fresh private root has mode `0700`, each member has mode `0600`, and the
12+
root is published through an atomic no-replace operation. It contains:
13+
14+
- canonical `input.json`, the self-validating P1 metadata input;
15+
- `price-panel.raw`, whose SHA-256 equals the input's declared raw panel
16+
digest;
17+
- `quality-report.raw`, whose SHA-256 equals the input's declared quality
18+
report digest;
19+
- one `universe-source/NNNN.raw` byte stream for each P1 rebalance decision,
20+
whose SHA-256 equals that decision's point-in-time universe source digest;
21+
and
22+
- canonical `manifest.json`, which records every member's exact path, byte
23+
length and digest, plus the P1 input digest.
24+
25+
`verify_historical_combo_p1_root` checks the exact root layout, private file
26+
modes, canonical metadata, every member digest, and the links back to the P1
27+
price-panel and universe-source declarations. It does not need network,
28+
credentials, a provider, strategy code, or a broker.
29+
30+
## Intended use
31+
32+
The producer receives local bytes explicitly. For a scriptable entry point,
33+
use `seal-historical-combo-p1-root` with the input JSON, raw price panel,
34+
quality report, and one `--universe-source DECISION_AT=PATH` per rebalance.
35+
The output location must be new; retrying an already-created path intentionally
36+
fails instead of overwriting research evidence.
37+
38+
This contract does **not** parse a vendor price format, repair missing data,
39+
certify a quality report, choose a candidate, run P2/P3, publish to cloud, or
40+
authorize paper/shadow/live activity. A later real P3 adapter may consume a
41+
verified root only after it separately validates the panel format, data-quality
42+
criteria, point-in-time disclosure, cost model and frozen P1/P2 identity.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ publish-platform-signal-handoff = "market_signal_sources.cli.publish_platform_si
3434
validate-quality-report = "market_signal_sources.cli.validate_quality_report:main"
3535
validate-research-export = "market_signal_sources.cli.validate_research_export:main"
3636
validate-signal-bundle = "market_signal_sources.cli.validate_signal_bundle:main"
37+
seal-historical-combo-p1-root = "market_signal_sources.cli.seal_historical_combo_p1_root:main"
3738

3839
[tool.setuptools]
3940
package-dir = {"" = "src"}

src/market_signal_sources/artifacts/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,15 @@
117117
calculate_historical_combo_p1_input_sha256,
118118
validate_historical_combo_p1_input,
119119
)
120+
from .historical_combo_p1_root import (
121+
HISTORICAL_COMBO_P1_ROOT_MANIFEST_SCHEMA,
122+
ROOT_STATUS as HISTORICAL_COMBO_P1_ROOT_STATUS,
123+
HistoricalComboP1RootError,
124+
canonical_historical_combo_p1_root_manifest_bytes,
125+
publish_historical_combo_p1_root,
126+
validate_historical_combo_p1_root_manifest,
127+
verify_historical_combo_p1_root,
128+
)
120129
from .validation import (
121130
REQUIRED_INDICATOR_FIELDS_BY_CONSUMER,
122131
SignalBundleValidationError,
@@ -155,6 +164,8 @@
155164
"POINT_IN_TIME_UNIVERSE_SCHEMA",
156165
"HISTORICAL_PRICE_PANEL_SCHEMA",
157166
"HISTORICAL_COMBO_P1_INPUT_SCHEMA",
167+
"HISTORICAL_COMBO_P1_ROOT_MANIFEST_SCHEMA",
168+
"HISTORICAL_COMBO_P1_ROOT_STATUS",
158169
"RESEARCH_EXPORT_SCHEMA_VERSION",
159170
"SIGNAL_OWNERSHIP_MATRIX_SCHEMA_VERSION",
160171
"SIGNAL_SOURCE_FAMILY_CATALOG_MANIFEST_SCHEMA_VERSION",
@@ -168,6 +179,7 @@
168179
"PointInTimeUniverseError",
169180
"HistoricalPricePanelError",
170181
"HistoricalComboP1InputError",
182+
"HistoricalComboP1RootError",
171183
"build_btc_cycle_signal_bundle",
172184
"build_daily_technical_signal_bundle",
173185
"build_derived_indicator_signal_bundle",
@@ -176,6 +188,7 @@
176188
"build_point_in_time_universe_snapshot",
177189
"build_historical_price_panel",
178190
"build_historical_combo_p1_input",
191+
"publish_historical_combo_p1_root",
179192
"consumer_contract_for",
180193
"audit_signal_consumption",
181194
"compatible_profiles_for_signal_source_family",
@@ -214,6 +227,8 @@
214227
"validate_point_in_time_universe_snapshot",
215228
"validate_historical_price_panel",
216229
"validate_historical_combo_p1_input",
230+
"validate_historical_combo_p1_root_manifest",
231+
"verify_historical_combo_p1_root",
217232
"validate_consumption_audit_file",
218233
"validate_runtime_adapter_config",
219234
"validate_runtime_adapter_config_set_files",
@@ -226,6 +241,7 @@
226241
"calculate_point_in_time_universe_sha256",
227242
"calculate_historical_price_panel_sha256",
228243
"calculate_historical_combo_p1_input_sha256",
244+
"canonical_historical_combo_p1_root_manifest_bytes",
229245
"write_research_signal_handoff_manifest",
230246
"write_consumption_audit_artifact",
231247
"write_runtime_signal_injection_plan_artifact",

0 commit comments

Comments
 (0)