feat: establish Quant OS production-80 architecture

This commit is contained in:
2026-07-30 22:59:25 +08:00
parent 919c64c679
commit 26cc814f3f
67 changed files with 7005 additions and 142 deletions
+173 -23
View File
@@ -1457,7 +1457,7 @@
<div class="masthead__brand">
<p class="eyebrow">Release control / public snapshot</p>
<h1 class="brand-title" id="page-title">Quant OS</h1>
<p class="brand-subtitle">个人 A 股研究到执行的证据审计台</p>
<p class="brand-subtitle">个人沪深 A 股研究到执行的证据审计台</p>
</div>
<div class="masthead__claim">
<div class="claim-line">
@@ -1479,15 +1479,15 @@
<div class="safety-banner" role="note" aria-label="资金安全边界">
<svg class="icon" aria-hidden="true"><use href="#icon-shield-alert"></use></svg>
<p><strong>可运行框架 ≠ 可投入资金。</strong> 本页只呈现构建时证据快照,不是实时服务健康监控,也不构成投资收益声明。</p>
<p><strong>可运行框架 ≠ 可投入资金。</strong> 本页只呈现构建时证据快照,不是实时服务健康监控,也不构成投资收益声明。<span id="market-scope-copy">当前交易执行范围仅覆盖沪深;北交所尚未接入,所有北交所委托必须 fail closed。</span></p>
<span class="snapshot-label">LIVE READY = FALSE</span>
</div>
<section class="metrics" aria-label="核心状态指标">
<div class="metric">
<span class="metric__label">Delivery score</span>
<strong class="metric__value" id="metric-score">NOT SCORED</strong>
<span class="metric__note">不把文章估分冒充系统得分</span>
<span class="metric__label">Production 80</span>
<strong class="metric__value" id="metric-score">0 / 100</strong>
<span class="metric__note">证据得分;Hard Gate 不可补偿</span>
</div>
<div class="metric">
<span class="metric__label">Gate evidence</span>
@@ -1513,9 +1513,10 @@
<a href="#layers"><span class="rail__index">01</span><span>系统分层</span></a>
<a href="#models"><span class="rail__index">02</span><span>模型边界</span></a>
<a href="#platforms"><span class="rail__index">03</span><span>平台接入</span></a>
<a href="#gates"><span class="rail__index">04</span><span>G1G10</span></a>
<a href="#bundles"><span class="rail__index">05</span><span>发布包</span></a>
<a href="#provenance"><span class="rail__index">06</span><span>证据来源</span></a>
<a href="#maturity80"><span class="rail__index">04</span><span>80 分标准</span></a>
<a href="#gates"><span class="rail__index">05</span><span>G1G10</span></a>
<a href="#bundles"><span class="rail__index">06</span><span>发布包</span></a>
<a href="#provenance"><span class="rail__index">07</span><span>证据来源</span></a>
</nav>
<main class="main-content" id="main-content" tabindex="-1">
@@ -1626,9 +1627,48 @@
</div>
</section>
<section class="audit-section" id="gates" aria-labelledby="gates-title">
<section class="audit-section" id="maturity80" aria-labelledby="maturity80-title">
<div class="section-header">
<span class="section-code">SEC.04</span>
<div>
<h2 class="section-title" id="maturity80-title">Production 80 · 受限生产标准</h2>
<p class="section-intro">80 分以 Baseline 60 全门通过为前置,并要求真实 QMT、60 个交易日 shadow、10 个交易日受限资金 canary、持续对账、恢复演练和券商程序化交易确认。</p>
</div>
</div>
<div class="overview-board">
<div class="overview-copy">
<h3>当前 80 分判定</h3>
<p><strong id="maturity80-score">0 / 100 · BLOCKED</strong></p>
<p id="maturity80-policy">等待 machine profile。缺失数据时不得获得分数。</p>
</div>
<div class="evidence-summary">
<h3>不可补偿前置</h3>
<ul class="runtime-list" id="maturity80-prerequisites">
<li>等待状态数据</li>
</ul>
</div>
</div>
<div class="matrix-wrap">
<table class="bundle-table">
<caption class="visually-hidden">Quant OS 80 分七个维度的已验证得分和最低分</caption>
<thead>
<tr>
<th scope="col">Domain</th>
<th scope="col">Verified</th>
<th scope="col">Weight</th>
<th scope="col">Required floor</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody id="maturity80-domain-body"></tbody>
</table>
</div>
<div class="gate-stack" id="maturity80-control-list"></div>
</section>
<section class="audit-section" id="gates" aria-labelledby="gates-title">
<div class="section-header">
<span class="section-code">SEC.05</span>
<div>
<h2 class="section-title" id="gates-title">Baseline 60 · G1G10</h2>
<p class="section-intro">Gate 是发布闸门,不是代码清单。展开每项查看验收定义和缺失证据;当前 10 项均未通过。</p>
@@ -1639,7 +1679,7 @@
<section class="audit-section" id="bundles" aria-labelledby="bundles-title">
<div class="section-header">
<span class="section-code">SEC.05</span>
<span class="section-code">SEC.06</span>
<div>
<h2 class="section-title" id="bundles-title">跨平台发布包完整性</h2>
<p class="section-intro">构建器核对共享核心、wrapper、配置与生成单文件的 SHA-256。哈希一致只证明代码发布包完整,不证明目标平台通过。</p>
@@ -1664,7 +1704,7 @@
<section class="audit-section" id="provenance" aria-labelledby="provenance-title">
<div class="section-header">
<span class="section-code">SEC.06</span>
<span class="section-code">SEC.07</span>
<div>
<h2 class="section-title" id="provenance-title">证据来源与快照血缘</h2>
<p class="section-intro">所有公开字段由仓库中的权威记录生成并脱敏。链接指向私有 Gitea 源码,访问时可能要求登录。</p>
@@ -1738,7 +1778,7 @@
<footer class="page-footer">
<p>本页是公开、脱敏的构建时快照。未发布本地行情、运行 artifacts、券商状态或可复用凭据。任何实盘决策必须回到 G1–G10 的发布级证据。</p>
<a href="https://git.gomars.fun/boat/quants-strategies/src/branch/master/quant-os" target="_blank" rel="noopener noreferrer">
<a href="https://git.gomars.fun/boat/quant-os/src/branch/master" target="_blank" rel="noopener noreferrer">
源码(需登录)
<svg class="icon" aria-hidden="true"><use href="#icon-external"></use></svg>
</a>
@@ -1759,7 +1799,7 @@
(() => {
"use strict";
const repoBase = "https://git.gomars.fun/boat/quants-strategies/src/branch/master/quant-os/";
const repoBase = "https://git.gomars.fun/boat/quant-os/src/branch/master/";
const statusLabels = {
implemented: { label: "已实现", tone: "implemented" },
tested: { label: "合同验证", tone: "tested" },
@@ -1830,13 +1870,14 @@
const renderHeader = (data) => {
const claim = data.claim || {};
const summary = data.summary || {};
const maturity80 = data.maturity80 || {};
byId("claim-status").textContent = claim.status || "NOT_BASELINE_60";
byId("claim-gates").textContent = `${claim.gatesPassed ?? 0} / ${claim.gatesTotal ?? 10} GATES`;
byId("claim-reason").textContent = claim.reason || "缺少发布级证据。";
byId("overview-reason").textContent = claim.reason || "缺少发布级证据。";
byId("metric-score").textContent = claim.score == null
? String(claim.scoreStatus || "not_scored").replaceAll("_", " ").toUpperCase()
: String(claim.score);
byId("market-scope-copy").textContent = data.marketScope?.statement ||
"当前交易执行范围仅覆盖沪深;北交所尚未接入,所有北交所委托必须 fail closed";
byId("metric-score").textContent = `${maturity80.effectiveScore ?? 0} / ${maturity80.maximumScore ?? 100}`;
byId("metric-gates").textContent = `${claim.gatesPassed ?? 0} / ${claim.gatesTotal ?? 10}`;
byId("metric-tests").textContent = summary.testsRecorded == null ? "—" : String(summary.testsRecorded);
byId("metric-tests-note").textContent = summary.optionalSkipsRecorded == null
@@ -1853,6 +1894,63 @@
: "<li>无真实运行证据记录</li>";
};
const renderMaturity80 = (data) => {
const maturity = data.maturity80 || {};
byId("maturity80-score").textContent =
`${maturity.effectiveScore ?? 0} / ${maturity.maximumScore ?? 100} · ${maturity.state || "BLOCKED"}`;
byId("maturity80-policy").textContent = maturity.evidencePolicy ||
"缺少 hash-linked evidence 时不得计分。";
const prerequisiteLabels = {
baseline_60_all_gates: "Baseline 60 · G1G10 全通过",
real_qmt_observed: "真实 QMT 已观察",
broker_programmatic_confirmation: "券商程序化交易确认",
shadow_trading_days: "同一候选 60 个交易日 shadow",
canary_trading_days: "受限资金 10 个交易日 canary",
open_p0_within_limit: "未关闭 P0 = 0",
open_p1_within_limit: "未关闭 P1 = 0"
};
const prerequisites = maturity.prerequisites || {};
const prerequisiteRows = Object.entries(prerequisiteLabels)
.map(([key, label]) => `<li>${escapeHtml(label)} · ${prerequisites[key] === true ? "PASS" : "BLOCKED"}</li>`)
prerequisiteRows.push(
`<li>Pre-canary 授权记录已核验 · ${maturity.preCanaryAuthorizationVerified === true ? "PASS" : "BLOCKED"}</li>`,
`<li>Canary 证据反向绑定授权 · ${maturity.canaryAuthorizationChainVerified === true ? "PASS" : "BLOCKED"}</li>`,
`<li>最终 promotion 可信 attestation · ${maturity.trustedAttestationVerified === true ? "PASS" : "BLOCKED"}</li>`
);
byId("maturity80-prerequisites").innerHTML = prerequisiteRows.join("");
const domains = Array.isArray(maturity.domains) ? maturity.domains : [];
byId("maturity80-domain-body").innerHTML = domains.map((domain) => `
<tr>
<td><strong>${escapeHtml(domain.id)} · ${escapeHtml(domain.name)}</strong></td>
<td>${escapeHtml(domain.score)}</td>
<td>${escapeHtml(domain.weight)}</td>
<td>${escapeHtml(domain.minimumScore)}</td>
<td>${statusTag(domain.floorPassed ? "tested" : "blocked")}</td>
</tr>
`).join("");
const controls = Array.isArray(maturity.controls) ? maturity.controls : [];
byId("maturity80-control-list").innerHTML = controls.map((control) => `
<details class="gate-item">
<summary>
<span class="gate-id">${escapeHtml(control.id)}</span>
<span class="gate-name">${escapeHtml(control.name)}</span>
<span class="gate-acceptance">${control.hardGate ? "HARD GATE" : "SCORED CONTROL"} · ${escapeHtml(control.weight)} points · min ${escapeHtml(control.minimumEvidenceTier)}</span>
${statusTag(control.status)}
</summary>
<div class="gate-detail">
<div>
<h4>Current gap</h4>
<p>${escapeHtml(control.note || "No qualifying evidence recorded.")}</p>
</div>
<div>
<h4>Evidence rule</h4>
<p>只有绑定同一候选身份、达到最低 tier、SHA-256 可重算且通过可信 verifier 的 claim 才能通过。</p>
</div>
</div>
</details>
`).join("");
};
const renderLayers = (data) => {
const layers = Array.isArray(data.layers) ? data.layers : [];
byId("layer-list").innerHTML = layers.map((layer, index) => `
@@ -2071,15 +2169,66 @@
const validatePublicData = (data) => {
if (!data || typeof data !== "object") throw new Error("missing public status object");
if (data.claim?.status !== "NOT_BASELINE_60") throw new Error("unsafe claim status");
if (data.claim?.releaseVerified !== false || data.claim?.liveReady !== false) {
throw new Error("unsafe release claim");
const claim = data.claim || {};
if (!["NOT_BASELINE_60", "BASELINE_60_VERIFIED"].includes(claim.status)) {
throw new Error("unsupported claim status");
}
if (data.claim?.gatesPassed !== 0 || data.claim?.gatesTotal !== 10) {
throw new Error("unexpected gate score");
if (!Array.isArray(data.gates) || data.gates.length !== claim.gatesTotal) {
throw new Error("gate set mismatch");
}
if (!Array.isArray(data.gates) || data.gates.some((gate) => gate.status !== "not_passed")) {
throw new Error("all gates must remain explicitly not_passed");
if (data.gates.some((gate) => !["passed", "not_passed"].includes(gate.status))) {
throw new Error("unsupported gate status");
}
const gatesPassed = data.gates.filter((gate) => gate.status === "passed").length;
if (gatesPassed !== claim.gatesPassed) throw new Error("gate count mismatch");
const baselineVerified = claim.status === "BASELINE_60_VERIFIED";
if (baselineVerified !== Boolean(claim.releaseVerified)) {
throw new Error("baseline release claim mismatch");
}
if (baselineVerified && gatesPassed !== claim.gatesTotal) {
throw new Error("baseline claim requires every gate");
}
const maturity = data.maturity80 || {};
const marketScope = data.marketScope || {};
if (
JSON.stringify(marketScope.included) !== JSON.stringify(["SSE", "SZSE"])
|| JSON.stringify(marketScope.excludedFailClosed) !== JSON.stringify(["BSE"])
|| marketScope.bseTradingEnabled !== false
) {
throw new Error("unsafe or ambiguous market scope");
}
if (Boolean(maturity.baseline60Passed) !== baselineVerified) {
throw new Error("60/80 assessment mismatch");
}
if (Boolean(maturity.qualified) !== Boolean(claim.liveReady)) {
throw new Error("limited-live claim mismatch");
}
if (maturity.qualified && (
maturity.state !== "LIMITED_LIVE_VERIFIED"
|| !maturity.trustedAttestationVerified
|| !maturity.preCanaryAuthorized
|| !maturity.canaryAuthorizationChainVerified
)) {
throw new Error("unattested production-80 claim");
}
if (
["PRE_CANARY_AUTHORIZED", "CANARY_RUNNING"].includes(maturity.state)
&& !maturity.preCanaryAuthorized
) {
throw new Error("current canary state lacks authorization");
}
if (maturity.preCanaryAuthorized
&& !maturity.preCanaryAuthorizationVerified) {
throw new Error("unattested pre-canary authorization");
}
if (
String(maturity.state || "").startsWith("TEST_ONLY_")
&& (!maturity.testOnly || maturity.qualified)
) {
throw new Error("test-only assessment overclaim");
}
if (!baselineVerified && maturity.effectiveScore > 59) {
throw new Error("production-80 score violates baseline-60 cap");
}
};
@@ -2095,6 +2244,7 @@
renderLayers(data);
renderModels(data);
renderPlatforms();
renderMaturity80(data);
renderGates(data);
renderBundles(data);
renderActions(data);