feat: preserve Quant OS target-package vertical slice
This commit is contained in:
+507
-47
@@ -18,10 +18,27 @@ PROJECT = Path(__file__).resolve().parents[1]
|
||||
DEFAULT_OUTPUT = PROJECT / "status" / "status-data.js"
|
||||
GLOBAL_NAME = "QUANT_OS_PUBLIC_STATUS"
|
||||
SCHEMA_VERSION = 1
|
||||
REACHABILITY_PATH = (
|
||||
"releases/quant60-research-candidate-v1/reachability.json"
|
||||
)
|
||||
JOINQUANT_TARGET_PACKAGE_RUN_PATH = (
|
||||
"evidence/joinquant/TP-20240311-795dcfba/"
|
||||
"2457a7c39a276e09e0fabf99e28978e1/run.json"
|
||||
)
|
||||
JOINQUANT_TARGET_PACKAGE_DOC_PATH = (
|
||||
"docs/JOINQUANT_TARGET_PACKAGE_EVIDENCE_2026-07-26.md"
|
||||
)
|
||||
JOINQUANT_TARGET_PACKAGE_RUN_ID = "2457a7c39a276e09e0fabf99e28978e1"
|
||||
JOINQUANT_TARGET_PACKAGE_OBSERVED_AT = "2026-07-26T08:50:15Z"
|
||||
JOINQUANT_TARGET_PACKAGE_BUNDLE_SHA256 = (
|
||||
"0586930ddc483f4489f09b562f4d4232b458b703e6a1194af809b707211be8c4"
|
||||
)
|
||||
|
||||
SOURCE_PATHS: Tuple[str, ...] = (
|
||||
"gate_scorecard.json",
|
||||
"dist/bundle_manifest.json",
|
||||
REACHABILITY_PATH,
|
||||
JOINQUANT_TARGET_PACKAGE_RUN_PATH,
|
||||
"configs/baseline.json",
|
||||
"README.md",
|
||||
"docs/ARCHITECTURE.md",
|
||||
@@ -29,8 +46,10 @@ SOURCE_PATHS: Tuple[str, ...] = (
|
||||
"docs/PLATFORM_MATRIX.md",
|
||||
"docs/CROSS_ENGINE_CONSISTENCY.md",
|
||||
"docs/JOINQUANT_HOSTED_EVIDENCE_2026-07-26.md",
|
||||
JOINQUANT_TARGET_PACKAGE_DOC_PATH,
|
||||
"docs/TUSHARE_LOCAL_DATA.md",
|
||||
"runbooks/PLATFORM_DEPLOYMENT.md",
|
||||
"tools/build_release_reachability.py",
|
||||
"tools/build_public_status.py",
|
||||
)
|
||||
|
||||
@@ -245,6 +264,287 @@ def _validate_bundle_manifest(
|
||||
return public_artifacts
|
||||
|
||||
|
||||
def _validate_reachability_manifest(
|
||||
project: Path, manifest: Mapping[str, Any]
|
||||
) -> Dict[str, Any]:
|
||||
source_root = project / "src"
|
||||
inserted = str(source_root) not in sys.path
|
||||
if inserted:
|
||||
sys.path.insert(0, str(source_root))
|
||||
try:
|
||||
from quant60.release_reachability import ( # pylint: disable=import-outside-toplevel
|
||||
ReleaseReachabilityError,
|
||||
validate_release_reachability,
|
||||
)
|
||||
|
||||
try:
|
||||
manifest = validate_release_reachability(
|
||||
manifest,
|
||||
repository_root=project,
|
||||
expected_release_id="quant60-research-candidate-v1",
|
||||
)
|
||||
except ReleaseReachabilityError as exc:
|
||||
raise PublicStatusError(
|
||||
f"release reachability manifest failed canonical verification: {exc}"
|
||||
) from exc
|
||||
finally:
|
||||
if inserted:
|
||||
sys.path.remove(str(source_root))
|
||||
|
||||
expected_layers = {"universe", "alpha", "portfolio", "risk", "execution"}
|
||||
expected_capabilities = {
|
||||
"implemented",
|
||||
"unit_tested",
|
||||
"local_entrypoint_reachable",
|
||||
"jq_entrypoint_reachable",
|
||||
"qmt_entrypoint_reachable",
|
||||
"real_platform_observed",
|
||||
}
|
||||
declared_sha = str(manifest.get("manifest_sha256", ""))
|
||||
body = {
|
||||
key: value
|
||||
for key, value in manifest.items()
|
||||
if key != "manifest_sha256"
|
||||
}
|
||||
body_bytes = json.dumps(
|
||||
body,
|
||||
ensure_ascii=False,
|
||||
sort_keys=True,
|
||||
separators=(",", ":"),
|
||||
).encode("utf-8")
|
||||
actual_sha = _sha256_bytes(body_bytes)
|
||||
if not re.fullmatch(r"[0-9a-f]{64}", declared_sha) or declared_sha != actual_sha:
|
||||
raise PublicStatusError("release reachability manifest self-hash is invalid")
|
||||
|
||||
layers = manifest.get("layers")
|
||||
if not isinstance(layers, dict) or set(layers) != expected_layers:
|
||||
raise PublicStatusError(
|
||||
"release reachability manifest must contain the canonical five layers"
|
||||
)
|
||||
calculated_summary: Dict[str, bool] = {}
|
||||
real_platforms: set[str] = set()
|
||||
real_platform_observed_layers: set[str] = set()
|
||||
for capability in sorted(expected_capabilities):
|
||||
statuses: List[bool] = []
|
||||
for layer in sorted(expected_layers):
|
||||
claims = layers[layer]
|
||||
if not isinstance(claims, dict) or set(claims) != expected_capabilities:
|
||||
raise PublicStatusError(
|
||||
f"release reachability claims are incomplete for {layer}"
|
||||
)
|
||||
claim = claims[capability]
|
||||
if not isinstance(claim, dict) or not isinstance(
|
||||
claim.get("status"), bool
|
||||
):
|
||||
raise PublicStatusError(
|
||||
f"release reachability status is invalid for {layer}.{capability}"
|
||||
)
|
||||
artifacts = claim.get("artifacts")
|
||||
if not isinstance(artifacts, list):
|
||||
raise PublicStatusError(
|
||||
f"release reachability artifacts are invalid for {layer}.{capability}"
|
||||
)
|
||||
status = claim["status"]
|
||||
if status != bool(artifacts):
|
||||
raise PublicStatusError(
|
||||
f"release reachability evidence/status mismatch for "
|
||||
f"{layer}.{capability}"
|
||||
)
|
||||
for index, artifact in enumerate(artifacts):
|
||||
if not isinstance(artifact, dict):
|
||||
raise PublicStatusError(
|
||||
f"release reachability artifact is invalid for "
|
||||
f"{layer}.{capability}[{index}]"
|
||||
)
|
||||
path = _safe_repo_path(
|
||||
artifact.get("path"),
|
||||
label=f"{layer}.{capability}[{index}].path",
|
||||
)
|
||||
_verify_file_hash(project, path, str(artifact.get("sha256", "")))
|
||||
if capability == "real_platform_observed":
|
||||
real_platforms.add(str(artifact.get("platform", "")))
|
||||
real_platform_observed_layers.add(layer)
|
||||
statuses.append(status)
|
||||
calculated_summary[f"all_layers_{capability}"] = all(statuses)
|
||||
|
||||
summary = manifest.get("summary")
|
||||
if not isinstance(summary, dict) or summary != calculated_summary:
|
||||
raise PublicStatusError(
|
||||
"release reachability summary does not match per-layer claims"
|
||||
)
|
||||
if (
|
||||
real_platforms != {"joinquant"}
|
||||
or real_platform_observed_layers != {"execution"}
|
||||
or calculated_summary["all_layers_real_platform_observed"]
|
||||
):
|
||||
raise PublicStatusError(
|
||||
"current release may claim only JoinQuant execution observation"
|
||||
)
|
||||
release_id = str(manifest.get("release_id", ""))
|
||||
if release_id != "quant60-research-candidate-v1":
|
||||
raise PublicStatusError("unexpected release reachability release_id")
|
||||
return {
|
||||
"releaseId": release_id,
|
||||
"manifest": REACHABILITY_PATH,
|
||||
"manifestSha256": declared_sha,
|
||||
"summary": calculated_summary,
|
||||
"realPlatformsObserved": sorted(
|
||||
platform for platform in real_platforms if platform
|
||||
),
|
||||
"realPlatformObservedLayers": sorted(real_platform_observed_layers),
|
||||
}
|
||||
|
||||
|
||||
def _validate_joinquant_target_package_run(
|
||||
project: Path,
|
||||
run: Mapping[str, Any],
|
||||
) -> Dict[str, Any]:
|
||||
"""Validate the narrow, redacted hosted execution observation."""
|
||||
|
||||
if run.get("record_type") != "joinquant_target_package_execution_smoke":
|
||||
raise PublicStatusError("unexpected JoinQuant TargetPackage run type")
|
||||
if run.get("platform") != "joinquant" or run.get("status") != "completed":
|
||||
raise PublicStatusError("JoinQuant TargetPackage run is not completed")
|
||||
if (
|
||||
run.get("platform_evidence_class") != "real_platform_runtime"
|
||||
or run.get("input_evidence_class") != "synthetic-research"
|
||||
or run.get("performance_claim") is not False
|
||||
):
|
||||
raise PublicStatusError(
|
||||
"JoinQuant TargetPackage evidence classes are unsafe"
|
||||
)
|
||||
if run.get("run_id") != JOINQUANT_TARGET_PACKAGE_RUN_ID:
|
||||
raise PublicStatusError("unexpected JoinQuant TargetPackage run identity")
|
||||
if run.get("observed_at") != JOINQUANT_TARGET_PACKAGE_OBSERVED_AT:
|
||||
raise PublicStatusError("unexpected JoinQuant TargetPackage observation time")
|
||||
|
||||
backtest = run.get("backtest")
|
||||
if not isinstance(backtest, dict):
|
||||
raise PublicStatusError("JoinQuant TargetPackage backtest must be an object")
|
||||
expected_url = (
|
||||
"https://www.joinquant.com/algorithm/backtest/detail?backtestId="
|
||||
+ JOINQUANT_TARGET_PACKAGE_RUN_ID
|
||||
)
|
||||
expected_backtest = {
|
||||
"id": JOINQUANT_TARGET_PACKAGE_RUN_ID,
|
||||
"url": expected_url,
|
||||
"start_date": "2024-03-11",
|
||||
"end_date": "2024-03-13",
|
||||
"initial_capital_cny": 1_000_000,
|
||||
"frequency": "day",
|
||||
"python": "Python3",
|
||||
"benchmark": "000905.XSHG",
|
||||
"timezone": "Asia/Shanghai",
|
||||
}
|
||||
if backtest != expected_backtest:
|
||||
raise PublicStatusError("JoinQuant TargetPackage settings drifted")
|
||||
|
||||
identity = run.get("artifact_identity")
|
||||
if not isinstance(identity, dict):
|
||||
raise PublicStatusError("JoinQuant TargetPackage identity must be an object")
|
||||
expected_identity = {
|
||||
"bundle_sha256": JOINQUANT_TARGET_PACKAGE_BUNDLE_SHA256,
|
||||
"browser_snapshot_sha256": JOINQUANT_TARGET_PACKAGE_BUNDLE_SHA256,
|
||||
"exact_browser_match": True,
|
||||
"bundle_manifest_sha256": (
|
||||
"91f4b4dc0bdd0d9f99b3466c830600e2678be78dd991d4499a4154bffec8597a"
|
||||
),
|
||||
"portable_core_sha256": (
|
||||
"f9de9f18e4008bb0fc80edb0b21cae6ea06a61828d89e9b7c11057f98225fc19"
|
||||
),
|
||||
"wrapper_sha256": (
|
||||
"0c672b64665b7c1d4409ba288b00d1608e976800af3a4f9a6467767ce4def592"
|
||||
),
|
||||
}
|
||||
if identity != expected_identity:
|
||||
raise PublicStatusError("JoinQuant TargetPackage artifact identity drifted")
|
||||
|
||||
target_package = run.get("target_package")
|
||||
if not isinstance(target_package, dict):
|
||||
raise PublicStatusError("JoinQuant TargetPackage identity is missing")
|
||||
if (
|
||||
target_package.get("package_id") != "TP-20240311-795dcfba"
|
||||
or target_package.get("evidence_class") != "synthetic-research"
|
||||
or target_package.get("package_sha256")
|
||||
!= "baa15c8156aa6cb54d3775d0cd562613a9d0a4f15b0c39f2a60e0f8b8c6f1f3a"
|
||||
or target_package.get("tape_sha256")
|
||||
!= "5383c376951637b8d4b1ca42fc6db80347abda74c0181c0f70d6c411fb97ea64"
|
||||
):
|
||||
raise PublicStatusError("JoinQuant TargetPackage lineage drifted")
|
||||
|
||||
sessions = run.get("session_observations")
|
||||
if not isinstance(sessions, list) or [
|
||||
(item.get("date"), item.get("event"), item.get("orders"), item.get("fills"))
|
||||
for item in sessions
|
||||
if isinstance(item, dict)
|
||||
] != [
|
||||
("2024-03-11", "TARGET_PACKAGE_NOOP", 0, 0),
|
||||
("2024-03-12", "TARGET_PACKAGE_HIT", 3, 3),
|
||||
("2024-03-13", "TARGET_PACKAGE_NOOP", 0, 0),
|
||||
]:
|
||||
raise PublicStatusError("JoinQuant TargetPackage session evidence drifted")
|
||||
if run.get("counts") != {
|
||||
"orders": 3,
|
||||
"fills": 3,
|
||||
"skipped_orders": 0,
|
||||
}:
|
||||
raise PublicStatusError("JoinQuant TargetPackage order/fill counts drifted")
|
||||
|
||||
boundary = run.get("claim_boundary")
|
||||
if not isinstance(boundary, dict):
|
||||
raise PublicStatusError("JoinQuant TargetPackage claim boundary is missing")
|
||||
required_false = (
|
||||
"upstream_layers_real_platform_observed",
|
||||
"authorized_real_data_oos_observed",
|
||||
"qmt_peer_observed",
|
||||
"same_input_cross_engine_parity_observed",
|
||||
"all_five_layers_real_platform_observed",
|
||||
"g9_passed",
|
||||
"baseline_60_passed",
|
||||
"release_verified",
|
||||
"investment_value_claim",
|
||||
)
|
||||
if boundary.get("real_platform_observed_layers") != ["execution"] or any(
|
||||
boundary.get(field) is not False for field in required_false
|
||||
):
|
||||
raise PublicStatusError(
|
||||
"JoinQuant TargetPackage run overclaims its evidence boundary"
|
||||
)
|
||||
performance = run.get("performance")
|
||||
if (
|
||||
not isinstance(performance, dict)
|
||||
or performance.get("investment_value_claim") is not False
|
||||
or performance.get("scope") != "three-session execution wiring smoke only"
|
||||
):
|
||||
raise PublicStatusError(
|
||||
"JoinQuant TargetPackage performance boundary is unsafe"
|
||||
)
|
||||
|
||||
path = _safe_repo_path(
|
||||
JOINQUANT_TARGET_PACKAGE_RUN_PATH,
|
||||
label="JoinQuant TargetPackage run",
|
||||
)
|
||||
if not (project / path).is_file():
|
||||
raise PublicStatusError("tracked JoinQuant TargetPackage run is missing")
|
||||
return {
|
||||
"runId": JOINQUANT_TARGET_PACKAGE_RUN_ID,
|
||||
"observedAt": JOINQUANT_TARGET_PACKAGE_OBSERVED_AT,
|
||||
"marketDataFrom": backtest["start_date"],
|
||||
"marketDataThrough": backtest["end_date"],
|
||||
"bundleSha256": identity["bundle_sha256"],
|
||||
"packageId": target_package["package_id"],
|
||||
"evidenceClass": target_package["evidence_class"],
|
||||
"orders": 3,
|
||||
"fills": 3,
|
||||
"observedLayers": ["execution"],
|
||||
"allFiveLayersObserved": False,
|
||||
"qmtPeerObserved": False,
|
||||
"g9Passed": False,
|
||||
"baseline60Passed": False,
|
||||
"investmentValueClaim": False,
|
||||
}
|
||||
|
||||
|
||||
def _extract_test_summary(facts: Sequence[Any]) -> Tuple[int | None, int | None]:
|
||||
for fact in facts:
|
||||
text = str(fact)
|
||||
@@ -288,7 +588,13 @@ def _platform_status(name: str) -> str:
|
||||
def _platform_evidence_links(name: str) -> List[str]:
|
||||
links = ["platform-matrix"]
|
||||
if "JoinQuant" in name:
|
||||
links.append("joinquant-hosted-evidence")
|
||||
links.extend(
|
||||
(
|
||||
"joinquant-hosted-evidence",
|
||||
"joinquant-target-package-evidence",
|
||||
"joinquant-target-package-run",
|
||||
)
|
||||
)
|
||||
if "Qlib" in name or "Tushare" in name:
|
||||
links.append("tushare-data")
|
||||
if "QMT" in name or "XtTrader" in name:
|
||||
@@ -337,6 +643,12 @@ def _build_evidence(project: Path) -> List[Dict[str, Any]]:
|
||||
"dist/bundle_manifest.json",
|
||||
"machine_record",
|
||||
),
|
||||
(
|
||||
"release-reachability",
|
||||
"Five-layer release reachability manifest",
|
||||
REACHABILITY_PATH,
|
||||
"machine_record",
|
||||
),
|
||||
("readme", "Quant OS verification guide", "README.md", "documentation"),
|
||||
(
|
||||
"architecture",
|
||||
@@ -364,10 +676,22 @@ def _build_evidence(project: Path) -> List[Dict[str, Any]]:
|
||||
),
|
||||
(
|
||||
"joinquant-hosted-evidence",
|
||||
"JoinQuant hosted smoke boundary",
|
||||
"JoinQuant hosted momentum smoke boundary",
|
||||
"docs/JOINQUANT_HOSTED_EVIDENCE_2026-07-26.md",
|
||||
"runtime_evidence",
|
||||
),
|
||||
(
|
||||
"joinquant-target-package-evidence",
|
||||
"JoinQuant TargetPackage execution evidence boundary",
|
||||
JOINQUANT_TARGET_PACKAGE_DOC_PATH,
|
||||
"runtime_evidence",
|
||||
),
|
||||
(
|
||||
"joinquant-target-package-run",
|
||||
"Redacted JoinQuant TargetPackage hosted run",
|
||||
JOINQUANT_TARGET_PACKAGE_RUN_PATH,
|
||||
"machine_record",
|
||||
),
|
||||
(
|
||||
"tushare-data",
|
||||
"Tushare inventory and Qlib bridge record",
|
||||
@@ -403,14 +727,14 @@ def _build_layers() -> List[Dict[str, Any]]:
|
||||
"id": "data",
|
||||
"name": "数据与时点",
|
||||
"status": "tested",
|
||||
"claim": "不可变快照、PIT 字段合同和 Tushare→Qlib 技术链路已实现并有本地合同/运行证据。",
|
||||
"claim": "不可变快照、PIT 字段合同和 Tushare→Qlib 技术链路已有本地合同/运行证据;这些 provider-data 路径尚未接成当前 Ridge 五层候选。",
|
||||
"capabilities": [
|
||||
"JQData raw/factor/limits/paused/PIT membership/ST snapshot",
|
||||
"Tushare completed-Parquet inventory and immutable Qlib provider",
|
||||
"semantic manifest and data-version verification",
|
||||
],
|
||||
"limitations": [
|
||||
"尚无授权 JQData 真实快照与许可 lineage;Tushare 镜像仅部分完成且缺生产关键字段。"
|
||||
"尚无授权 JQData 真实快照与许可 lineage;Tushare 镜像仅部分完成且缺生产关键字段;当前五层候选仍使用 synthetic 数据。"
|
||||
],
|
||||
"evidenceLinks": ["architecture", "tushare-data", "scorecard"],
|
||||
"releaseVerified": False,
|
||||
@@ -419,52 +743,65 @@ def _build_layers() -> List[Dict[str, Any]]:
|
||||
"id": "research",
|
||||
"name": "研究与模型",
|
||||
"status": "real_runtime",
|
||||
"claim": "synthetic research pipeline 已通过测试;Qlib 0.9.7 的 momentum 与 Alpha158/LightGBM fixture 已在真实本地运行时完成。",
|
||||
"claim": "synthetic 五层研究入口能冻结 train-only Ridge ModelBundle、逐层 trace 与 TargetPackageV1;Qlib momentum 和 Alpha158/LightGBM fixture 是另外的受限研究 smoke。",
|
||||
"capabilities": [
|
||||
"PIT features, purged walk-forward and deterministic Ridge",
|
||||
"train-only preprocessing, purged walk-forward and deterministic Ridge",
|
||||
"replayable frozen ModelBundle and synthetic TargetPackageV1",
|
||||
"Qlib native momentum",
|
||||
"Qlib Alpha158, LightGBM and Recorder workflow",
|
||||
],
|
||||
"limitations": [
|
||||
"fixture 仅两只 synthetic 股票;没有授权长样本 OOS、冻结模型包或投资价值证据。"
|
||||
"候选和 Qlib fixture 均是 synthetic;尚无授权长样本 OOS、真实数据校准、平台候选观察或投资价值证据。"
|
||||
],
|
||||
"evidenceLinks": [
|
||||
"architecture",
|
||||
"platform-matrix",
|
||||
"release-reachability",
|
||||
"scorecard",
|
||||
],
|
||||
"evidenceLinks": ["architecture", "platform-matrix", "scorecard"],
|
||||
"releaseVerified": False,
|
||||
},
|
||||
{
|
||||
"id": "signal-portfolio",
|
||||
"name": "信号、组合与事前风险",
|
||||
"status": "tested",
|
||||
"claim": "Signal→Target→Order Delta 合同、成本、风险与约束目标在本地测试路径可重放。",
|
||||
"claim": "当前 synthetic 主链把 Ridge Alpha、显式成本、60 日对角 realized variance、deterministic optimizer 和 post-risk gate 接成可重放 TargetPackage。",
|
||||
"capabilities": [
|
||||
"portable momentum scoring and capped target weights",
|
||||
"lot-rounded target quantities and T+1 sellable deltas",
|
||||
"factor risk, dated cost and constrained target research",
|
||||
"explicit fee/spread/square-root-impact cost forecast",
|
||||
"diagonal realized-variance risk input and deterministic constrained target",
|
||||
"single-name, industry, gross, capacity and turnover constraints",
|
||||
"post-risk weights with hash-linked lineage",
|
||||
],
|
||||
"limitations": [
|
||||
"风险、冲击和容量尚未用授权真实数据校准;G4/G5 均未通过。"
|
||||
"factor_risk.py 与 optional CVXPY solver 未被当前主链选择;风险、冲击和容量尚未用授权真实数据校准,G4/G5 均未通过。"
|
||||
],
|
||||
"evidenceLinks": [
|
||||
"architecture",
|
||||
"release-reachability",
|
||||
"scorecard",
|
||||
],
|
||||
"evidenceLinks": ["architecture", "scorecard"],
|
||||
"releaseVerified": False,
|
||||
},
|
||||
{
|
||||
"id": "backtest",
|
||||
"name": "回测与跨引擎",
|
||||
"status": "real_runtime",
|
||||
"claim": "本地 synthetic、Qlib fixture 与一次真实 JoinQuant hosted smoke 已运行;QMT 仍只有 bundle/harness。",
|
||||
"claim": "本地 synthetic 五层候选、平台 harness 和一次真实 JoinQuant TargetPackage execution smoke 已运行;QMT 尚无真实 peer run。",
|
||||
"capabilities": [
|
||||
"local event and snapshot backtests",
|
||||
"JoinQuant hosted single-file bundle",
|
||||
"QMT built-in/qmttools backtest-only bundle",
|
||||
"fail-closed JoinQuant TargetPackage single-file consumer",
|
||||
"fail-closed QMT built-in TargetPackage backtest consumer",
|
||||
"Qlib research runners",
|
||||
],
|
||||
"limitations": [
|
||||
"没有冻结同输入的本地/聚宽/QMT 逐层对比;真实 QMT 尚未运行,G9 未通过。"
|
||||
"聚宽只观察到一个 synthetic-research TargetPackage 的消费、账户/开盘价绑定和三笔成交;无真实长样本 OOS、QMT peer 或逐层真实数据 parity,G9 未通过。"
|
||||
],
|
||||
"evidenceLinks": [
|
||||
"platform-matrix",
|
||||
"joinquant-hosted-evidence",
|
||||
"joinquant-target-package-evidence",
|
||||
"joinquant-target-package-run",
|
||||
"cross-engine",
|
||||
"release-reachability",
|
||||
"scorecard",
|
||||
],
|
||||
"releaseVerified": False,
|
||||
@@ -473,17 +810,23 @@ def _build_layers() -> List[Dict[str, Any]]:
|
||||
"id": "platforms",
|
||||
"name": "平台适配",
|
||||
"status": "real_runtime",
|
||||
"claim": "Local、Colab、JoinQuant、Qlib 有可执行入口;JoinQuant/Qlib 有受限真实运行时 smoke。",
|
||||
"claim": "Local、Colab、JoinQuant、QMT、Qlib 有入口;JoinQuant 已真实观察 synthetic-research TargetPackage 的 execution consumer,QMT 候选仍未实跑。",
|
||||
"capabilities": [
|
||||
"local and Colab zero-account smoke",
|
||||
"JQData snapshot entrypoint",
|
||||
"JoinQuant upload bundle",
|
||||
"QMT built-in and qmttools entrypoints",
|
||||
"JoinQuant momentum or explicit TargetPackage upload bundle",
|
||||
"QMT built-in TargetPackage and qmttools entrypoints",
|
||||
],
|
||||
"limitations": [
|
||||
"JQData 真实账号、QMT 客户端/数据权限及平台完整导出仍是外部前置条件。"
|
||||
"JoinQuant 没有重跑上游四层;JQData 授权真实候选、QMT 客户端/数据权限、QMT peer 导出与逐层真实数据 parity 仍是外部前置条件。"
|
||||
],
|
||||
"evidenceLinks": [
|
||||
"platform-matrix",
|
||||
"joinquant-target-package-evidence",
|
||||
"joinquant-target-package-run",
|
||||
"platform-deployment",
|
||||
"release-reachability",
|
||||
],
|
||||
"evidenceLinks": ["platform-matrix", "platform-deployment"],
|
||||
"releaseVerified": False,
|
||||
},
|
||||
{
|
||||
@@ -526,11 +869,11 @@ def _build_models() -> List[Dict[str, Any]]:
|
||||
{
|
||||
"id": "portable-momentum-v1",
|
||||
"name": "portable-momentum-v1",
|
||||
"role": "跨引擎冻结计算基线",
|
||||
"role": "平台连通性 smoke 策略",
|
||||
"status": "real_runtime",
|
||||
"claim": "共享 symbol normalization、momentum、target weight/quantity 与 order-delta 计算;已进入 JoinQuant hosted smoke 和本地 Qlib momentum 路径。",
|
||||
"claim": "共享 symbol normalization、momentum、target weight/quantity 与 order-delta 计算;2024 JoinQuant hosted run 只证明这一 smoke 路径。",
|
||||
"limitations": [
|
||||
"尚无同输入 L1–L4 真实跨引擎通过证据,不是已验证的生产 champion。"
|
||||
"不是 Ridge/TargetPackage Baseline 候选;旧 hosted run 不得用于候选或 G9 计分。"
|
||||
],
|
||||
"evidenceLinks": [
|
||||
"architecture",
|
||||
@@ -543,13 +886,18 @@ def _build_models() -> List[Dict[str, Any]]:
|
||||
{
|
||||
"id": "ridge-challenger",
|
||||
"name": "Deterministic Ridge",
|
||||
"role": "synthetic 研究候选",
|
||||
"role": "synthetic 五层 Baseline 研究候选",
|
||||
"status": "tested",
|
||||
"claim": "purged walk-forward research pipeline 中可确定性训练和评估。",
|
||||
"claim": "train-only 预处理、系数、截距、训练截止和 lineage 可冻结为可重放 ModelBundle;其 synthetic TargetPackageV1 已被真实 JoinQuant execution consumer 消费并成交。",
|
||||
"limitations": [
|
||||
"只在 synthetic 研究路径验证;无真实 OOS、versioned model bundle 或跨平台推理验证。"
|
||||
"JoinQuant 只观察执行边界,未重跑上游四层;无授权真实 OOS、真实校准、QMT peer 或投资价值证据。"
|
||||
],
|
||||
"evidenceLinks": [
|
||||
"architecture",
|
||||
"platform-matrix",
|
||||
"joinquant-target-package-evidence",
|
||||
"joinquant-target-package-run",
|
||||
],
|
||||
"evidenceLinks": ["architecture", "platform-matrix"],
|
||||
"investmentValueClaim": False,
|
||||
"releaseVerified": False,
|
||||
},
|
||||
@@ -570,9 +918,15 @@ def _build_models() -> List[Dict[str, Any]]:
|
||||
|
||||
|
||||
def _build_next_actions(scorecard: Mapping[str, Any]) -> List[Dict[str, Any]]:
|
||||
missing = scorecard.get("current_delivery", {}).get(
|
||||
"external_evidence_missing", []
|
||||
)
|
||||
delivery = scorecard.get("current_delivery", {})
|
||||
if not isinstance(delivery, dict):
|
||||
raise PublicStatusError("scorecard current_delivery must be an object")
|
||||
internal = delivery.get("internal_delivery_gaps", [])
|
||||
missing = delivery.get("external_evidence_missing", [])
|
||||
if not isinstance(internal, list) or len(internal) < 3:
|
||||
raise PublicStatusError(
|
||||
"scorecard must list the internal delivery gaps blocking Baseline"
|
||||
)
|
||||
if not isinstance(missing, list) or len(missing) < 5:
|
||||
raise PublicStatusError(
|
||||
"scorecard must list the external evidence blocking release"
|
||||
@@ -580,30 +934,36 @@ def _build_next_actions(scorecard: Mapping[str, Any]) -> List[Dict[str, Any]]:
|
||||
return [
|
||||
{
|
||||
"priority": 1,
|
||||
"title": "生成授权 JQData 不可变真实快照",
|
||||
"why": str(missing[0]),
|
||||
"gateIds": ["G1", "G3", "G7"],
|
||||
"title": "接通真实数据五层候选",
|
||||
"why": f"{internal[0]} External prerequisite: {missing[0]}",
|
||||
"gateIds": ["G1", "G2", "G3", "G5", "G7"],
|
||||
},
|
||||
{
|
||||
"priority": 2,
|
||||
"title": "冻结聚宽同输入并完成逐层本地比较",
|
||||
"why": str(missing[1]),
|
||||
"gateIds": ["G3", "G9"],
|
||||
"title": "冻结主链风险、优化与执行选择",
|
||||
"why": str(internal[1]),
|
||||
"gateIds": ["G3", "G5", "G7", "G9"],
|
||||
},
|
||||
{
|
||||
"priority": 3,
|
||||
"title": "取得真实 QMT built-in 与 qmttools 导出",
|
||||
"why": str(missing[2]),
|
||||
"gateIds": ["G3", "G6", "G9"],
|
||||
"title": "扩展 JoinQuant 多期对账与逐层 parity",
|
||||
"why": f"{internal[2]} Required evidence: {missing[1]}",
|
||||
"gateIds": ["G3", "G7", "G9"],
|
||||
},
|
||||
{
|
||||
"priority": 4,
|
||||
"title": "运行真实 QMT TargetPackage 候选",
|
||||
"why": str(missing[2]),
|
||||
"gateIds": ["G6", "G8", "G9"],
|
||||
},
|
||||
{
|
||||
"priority": 5,
|
||||
"title": "完成 QMT 券商合同探针与至少 20 日影子盘",
|
||||
"why": str(missing[3]),
|
||||
"gateIds": ["G6", "G8", "G9"],
|
||||
},
|
||||
{
|
||||
"priority": 5,
|
||||
"priority": 6,
|
||||
"title": "完成连续对账、恢复演练与券商合规确认",
|
||||
"why": str(missing[4]),
|
||||
"gateIds": ["G8", "G10"],
|
||||
@@ -615,6 +975,7 @@ def _build_freshness(
|
||||
*,
|
||||
scorecard: Mapping[str, Any],
|
||||
joinquant_markdown: str,
|
||||
joinquant_target_package_run: Mapping[str, Any],
|
||||
tushare_markdown: str,
|
||||
) -> List[Dict[str, Any]]:
|
||||
period_match = re.search(
|
||||
@@ -686,15 +1047,44 @@ def _build_freshness(
|
||||
},
|
||||
{
|
||||
"id": "joinquant-hosted-market-window",
|
||||
"label": "JoinQuant hosted smoke 行情区间",
|
||||
"label": "JoinQuant hosted momentum smoke 行情区间",
|
||||
"status": "runtime_smoke",
|
||||
"marketDataFrom": joinquant_start,
|
||||
"marketDataThrough": joinquant_end,
|
||||
"value": f"{joinquant_start} — {joinquant_end}",
|
||||
"productionReady": False,
|
||||
"semantics": "单次真实 hosted runtime smoke 的回测区间;不代表同输入跨引擎通过。",
|
||||
"semantics": "旧 momentum hosted runtime smoke 的回测区间;不是 TargetPackage 候选或同输入跨引擎证据。",
|
||||
"evidenceLinks": ["joinquant-hosted-evidence", "scorecard"],
|
||||
},
|
||||
{
|
||||
"id": "joinquant-target-package-execution-smoke",
|
||||
"label": "JoinQuant TargetPackage execution smoke",
|
||||
"status": "runtime_smoke",
|
||||
"observedAt": str(joinquant_target_package_run["observedAt"]),
|
||||
"marketDataFrom": str(
|
||||
joinquant_target_package_run["marketDataFrom"]
|
||||
),
|
||||
"marketDataThrough": str(
|
||||
joinquant_target_package_run["marketDataThrough"]
|
||||
),
|
||||
"value": (
|
||||
f"{joinquant_target_package_run['marketDataFrom']} — "
|
||||
f"{joinquant_target_package_run['marketDataThrough']}; "
|
||||
"3 orders / 3 fills"
|
||||
),
|
||||
"productionReady": False,
|
||||
"investmentValueClaim": False,
|
||||
"semantics": (
|
||||
"真实平台只观察 synthetic-research TargetPackage 的 execution "
|
||||
"consumer;不代表上游四层真实平台执行、长样本 OOS 或 G9。"
|
||||
),
|
||||
"evidenceLinks": [
|
||||
"joinquant-target-package-evidence",
|
||||
"joinquant-target-package-run",
|
||||
"release-reachability",
|
||||
"scorecard",
|
||||
],
|
||||
},
|
||||
{
|
||||
"id": "tushare-daily-market-data",
|
||||
"label": "Tushare daily 行情覆盖",
|
||||
@@ -806,6 +1196,10 @@ def build_public_status(
|
||||
project = project.resolve()
|
||||
scorecard = _load_json(project / "gate_scorecard.json")
|
||||
manifest = _load_json(project / "dist" / "bundle_manifest.json")
|
||||
reachability_manifest = _load_json(project / REACHABILITY_PATH)
|
||||
joinquant_target_package_run_raw = _load_json(
|
||||
project / JOINQUANT_TARGET_PACKAGE_RUN_PATH
|
||||
)
|
||||
baseline = _load_json(project / "configs" / "baseline.json")
|
||||
platform_markdown = (project / "docs" / "PLATFORM_MATRIX.md").read_text(
|
||||
encoding="utf-8"
|
||||
@@ -870,6 +1264,13 @@ def build_public_status(
|
||||
test_count, optional_skips = _extract_test_summary(facts)
|
||||
|
||||
artifacts = _validate_bundle_manifest(project, manifest)
|
||||
reachability = _validate_reachability_manifest(
|
||||
project, reachability_manifest
|
||||
)
|
||||
joinquant_target_package_run = _validate_joinquant_target_package_run(
|
||||
project,
|
||||
joinquant_target_package_run_raw,
|
||||
)
|
||||
source_records: List[Dict[str, str]] = []
|
||||
for relative in SOURCE_PATHS:
|
||||
safe_path = _safe_repo_path(relative, label="provenance source")
|
||||
@@ -883,6 +1284,19 @@ def build_public_status(
|
||||
|
||||
claim_policy = scorecard["claim_policy"]
|
||||
delivery = scorecard["current_delivery"]
|
||||
internal_delivery_gaps = delivery.get("internal_delivery_gaps", [])
|
||||
external_evidence_missing = delivery.get("external_evidence_missing", [])
|
||||
if not isinstance(internal_delivery_gaps, list) or len(internal_delivery_gaps) < 3:
|
||||
raise PublicStatusError(
|
||||
"scorecard must list the internal delivery gaps blocking Baseline"
|
||||
)
|
||||
if (
|
||||
not isinstance(external_evidence_missing, list)
|
||||
or len(external_evidence_missing) < 5
|
||||
):
|
||||
raise PublicStatusError(
|
||||
"scorecard must list the external evidence blocking release"
|
||||
)
|
||||
payload: Dict[str, Any] = {
|
||||
"schemaVersion": SCHEMA_VERSION,
|
||||
"generatedAt": generated_at_value,
|
||||
@@ -905,8 +1319,20 @@ def build_public_status(
|
||||
"testsRecorded": test_count,
|
||||
"optionalSkipsRecorded": optional_skips,
|
||||
"testEvidenceQualifier": "Scorecard-recorded run; tests do not prove real-platform or broker gates.",
|
||||
"candidateRealPlatformObserved": bool(
|
||||
reachability["realPlatformsObserved"]
|
||||
),
|
||||
"candidateRealPlatformObservationScope": (
|
||||
"target_package_execution_consumer_only"
|
||||
),
|
||||
"allFiveLayersRealPlatformObserved": bool(
|
||||
reachability["summary"][
|
||||
"all_layers_real_platform_observed"
|
||||
]
|
||||
),
|
||||
"realRuntimeSmokes": [
|
||||
"JoinQuant hosted daily backtest (runtime/path only)",
|
||||
"JoinQuant TargetPackage execution consumer: one synthetic-research package, 3 orders / 3 fills (not Baseline/G9 evidence)",
|
||||
"JoinQuant portable_momentum_smoke hosted daily backtest (not Baseline/TargetPackage evidence)",
|
||||
"Qlib native momentum fixture",
|
||||
"Qlib Alpha158 + LightGBM fixture",
|
||||
"Tushare completed-partition Qlib momentum smoke",
|
||||
@@ -915,12 +1341,45 @@ def build_public_status(
|
||||
"productionReady": False,
|
||||
"investmentValueClaim": False,
|
||||
},
|
||||
"candidateBoundary": {
|
||||
"decisionMode": "target_package",
|
||||
"localEvidenceClass": "synthetic_research",
|
||||
"connectedRiskModel": "60-session diagonal realized variance",
|
||||
"connectedOptimizer": "deterministic constrained optimizer",
|
||||
"connectedExecution": "reference one-shot quantity/order-delta planner",
|
||||
"realJoinQuantObserved": (
|
||||
"joinquant" in reachability["realPlatformsObserved"]
|
||||
),
|
||||
"realQmtObserved": (
|
||||
"qmt" in reachability["realPlatformsObserved"]
|
||||
),
|
||||
"realPlatformObservedLayers": reachability[
|
||||
"realPlatformObservedLayers"
|
||||
],
|
||||
"allFiveLayersRealPlatformObserved": bool(
|
||||
reachability["summary"][
|
||||
"all_layers_real_platform_observed"
|
||||
]
|
||||
),
|
||||
"joinQuantTargetPackageRun": joinquant_target_package_run,
|
||||
"joinQuantTargetPackageCountsAsBaseline": False,
|
||||
"joinQuantTargetPackageCountsAsG9": False,
|
||||
"historicalJoinQuantMode": "portable_momentum_smoke",
|
||||
"historicalJoinQuantCountsAsBaseline": False,
|
||||
"reachability": reachability,
|
||||
"releaseVerified": False,
|
||||
},
|
||||
"deliveryGaps": {
|
||||
"internal": [str(item) for item in internal_delivery_gaps],
|
||||
"externalEvidence": [str(item) for item in external_evidence_missing],
|
||||
},
|
||||
"layers": _build_layers(),
|
||||
"models": _build_models(),
|
||||
"platforms": _build_platforms(platform_markdown),
|
||||
"freshness": _build_freshness(
|
||||
scorecard=scorecard,
|
||||
joinquant_markdown=joinquant_markdown,
|
||||
joinquant_target_package_run=joinquant_target_package_run,
|
||||
tushare_markdown=tushare_markdown,
|
||||
),
|
||||
"gates": gates,
|
||||
@@ -954,6 +1413,7 @@ def build_public_status(
|
||||
"provenance": {
|
||||
"scorecard": "gate_scorecard.json",
|
||||
"bundleManifest": "dist/bundle_manifest.json",
|
||||
"releaseReachability": REACHABILITY_PATH,
|
||||
"platformMatrix": "docs/PLATFORM_MATRIX.md",
|
||||
"baselineConfig": "configs/baseline.json",
|
||||
"sourceSetSha256": source_set_sha,
|
||||
|
||||
Reference in New Issue
Block a user