可审计港口 AI 生命周期平台:从数据来源、数字孪生、真实训练和留出评测,到模型治理、受控干预与证据回放。 An auditable port-AI lifecycle platform spanning provenance, digital twins, real training, held-out evaluation, model governance, bounded intervention, and evidence replay.
Evidence scope: parameter-declared digital-twin counterfactual over public MPA anchors; not a measured terminal KPI, online A/B test, or audited financial saving.
为什么是 Port DT Multi? / Why Port DT Multi?
港口 AI 项目真正困难的部分,不是再画一张驾驶舱,而是让“数据从哪里来、算法究竟跑了什么、评测是否泄漏、策略为何允许进入下一道门、执行到底有没有发生”能够被复核。Port DT Multi 把这些问题组织成一条可本地运行、可替换数据源、可留存证据的工程主链。
The hard part of port AI is not another dashboard. It is making data origin, algorithm execution, leakage control, promotion criteria, action authority, and final evidence independently reviewable. Port DT Multi turns those concerns into a local, replaceable, evidence-producing engineering workflow.
能力域 / Domain
已实现 / Implemented
可审计证据 / Evidence
数据与来源 / Data & provenance
规范字段映射、质量门禁、单位/时区/许可元数据、SHA-256 Canonical mapping, quality gates, unit/time-zone/licence metadata, and SHA-256
数据卡、质量报告、数据集指纹 Dataset card, quality report, and fingerprint
This is a research, teaching, software-verification, and pre-integration assessment platform—not a certified autonomous port controller. All inference is advisory by default with dispatch_allowed=false; production authority remains behind independent site approval, equipment interlocks, and change management.
🧭 系统全景 / System at a glance
flowchart LR
subgraph D["Data & Provenance Plane / 数据与来源平面"]
A1["Public dataset replay\n公开数据回放"]
A2["Mapped site export\n现场映射数据"]
A3["Live REST adapters\n现场 REST 适配器"]
Q["Schema + quality + licence + hash\n模式·质量·许可·哈希"]
A1 --> Q
A2 --> Q
A3 --> Q
end
subgraph T["Twin & Experiment Plane / 孪生与实验平面"]
V["PortViz + DTDL graph\n港区态势与语义图"]
E["Chronological environment\n时间顺序实验环境"]
C["SAC · PPO · TD3 · DQN · A2C · TQC · MPC"]
Q --> V
Q --> E --> C
end
subgraph G["Evidence & Governance Plane / 证据与治理平面"]
H["Held-out evaluation\n留出集独立评测"]
R["Model cards + registry\n模型卡与注册表"]
O["OpsX + drift + audit\n运行治理与审计"]
C --> H --> R --> O
V --> O
end
subgraph X["Bounded Action Plane / 受控动作平面"]
S["Safety envelope\n软件安全包络"]
M["Human approval\n人工审批"]
W["Allowlist + two-channel gateway\n白名单与二通道网关"]
P["Site PLC / EMS / TOS\n现场系统"]
O --> S --> M --> W -. "disabled by default / 默认关闭" .-> P
end
This is not a monolithic “AI that does everything.” Provenance levels, environment isolation, registry gates, and authority separation keep sensing, experimentation, evaluation, recommendations, and equipment actuation accountable to different boundaries.
The training advisor, full-system assistant, and floating entry point now share one transparent Xiaoyi Q-style maritime-officer asset. The character explains evidence, navigates, and prepares bounded commands without bypassing training confirmation or actuation gates.
运营总览 / Operations cockpit:港区态势、数据来源、KPI、ESG/合规、策略链与审计入口。缺少正式证据时显示“未接入/未评定”,不补造优秀指标。 Port situation, provenance, KPI, ESG/compliance, policy chain, and audit entry points. Missing formal evidence is shown as “not connected / not assessed,” never replaced with flattering metrics.
强化学习面板 / RL panel:选择规范数据集和七类控制器,读取后端真实进度,训练完成后再启动留出集评测与轨迹回放。 Select a canonical dataset and one of seven controllers, read backend-owned progress, and start holdout evaluation and replay only after training completes.
运营助手 / Ops copilot:把自然语言意图映射为受支持的只读查询或白名单候选动作;不扩大调用者权限。 Maps natural-language intent to supported read-only queries or allowlisted candidate actions without expanding caller authority.
集成中枢 / Integration hub:展示现场连接、功能开关和安全门;验证链运行在 dry-run,不能冒充生产下发。 Surfaces site connections, feature flags, and safety gates. Integration verification runs as dry-run and cannot masquerade as production dispatch.
Story / OpsX / TwinLab:用于证据叙事、运行治理、故障注入和接港前契约联调;每类数据保持 replay、simulation、derived、measured 标签。 Supports evidence narratives, operational governance, fault injection, and pre-integration contract testing while preserving replay/simulation/derived/measured labels.
All seven baselines share one canonical data contract and evaluation protocol without pretending to be the same kind of method: SAC, PPO, TD3, DQN, and A2C are optimized by Stable-Baselines3, TQC by SB3-Contrib, and MPC is a non-learning constrained controller implemented with SciPy.
For port replacement, port_ops_v2 exposes 37 observations (base state, twelve international-port factors, and per-factor availability masks) and five advisory actions (BESS, service intensity, flexible load, berth priority, and yard flow). Existing port_ops_v1 models and metrics remain readable. Port assets, objectives, safety bounds, and factor requirements live in replaceable config/ports/*.json profiles.
Portable evaluation summaries live in evidence/rl. Short runs remain labelled RL_SMOKE_WIRING_ONLY; formal RL evidence requires RL_HELD_OUT_EVALUATION plus the dataset fingerprint, model hash, optimizer steps, seed, holdout windows, and 95% intervals. Model binaries stay out of Git and are reproducible with the documented command.
The Web endpoint /api/rl/business-benchmark exposes only the pinned counterfactual report whose data, configuration, and computation code pass SHA-256 verification. public_port_ops_v1 anchors 52,608 consecutive hourly driver records to official MPA Singapore monthly container throughput and container-vessel arrivals for 2020–2025, then applies a chronological 35,064 train / 8,784 validation / 8,760 test split. Against static FCFS plus a fixed energy schedule, the sealed test produces:
Throughput is held constant. Unrestored flexible load and terminal BESS state of charge are settled daily at a fixed reference price to prevent cross-day energy borrowing or artificial savings through under-supply. Across 365 complete test days, 2,000 paired bootstrap resamples yield 95% intervals of 8.89%–8.97%, 16.92%–16.97%, and 11.79%–11.84%; the report also retains 27 predeclared parameter-sensitivity cases. These are public-input-driven digital-twin scenario results—not measured terminal KPIs, an online A/B test, or a financial audit. See the business KPI benchmark and resume evidence page for formulas, parameters, and boundaries.
The Flutter frontend uses the same FastAPI /api/mobile/* contract to read candidates, submit human decisions, obtain receipts, and upload audit evidence; it is not a separate backend. A fixed suite of 500 closed-loop operations checks duplicate submissions, conflicting idempotency keys, unauthorized production dispatch, and the audit chain. See the dual-frontend architecture, mobile workflow benchmark, and dual-frontend resume evidence.
The container runs as a non-root user and retains the research/integration boundary. Start production hardening from .env.example and the production-readiness checklist.
public_port_ops_v1 is an integration dataset for reproducible adapters, environments, and tests. Its public inputs are MPA Singapore monthly container throughput and container-vessel arrivals for 2020–2025. Hourly load, throughput/arrival allocation, tariff, carbon, temperature and tide-stress fields are documented deterministic derivatives; tide is excluded from the three business KPIs. It is not measured hourly terminal telemetry and must not be used for site-performance attribution.
接入新港口无需改写算法,只需通过 /api/rl/datasets/upload 提供:
To connect another port without rewriting algorithms, upload through /api/rl/datasets/upload with:
来源不混淆 / No provenance blur:dataset、engineering_simulator、live_rest、measured 是不同等级;真实接口失败不会静默生成业务值。 dataset, engineering_simulator, live_rest, and measured are distinct levels; a failed live interface never silently generates business values.
模型不越权 / Models have no authority:模型注册、champion 别名和软件包络都不是现场部署批准。 Registration, a champion alias, and a software envelope do not constitute site deployment approval.
执行失败关闭 / Execution fails closed:南向网关默认禁用;启用后仍需资产/动作白名单、参数上下界、幂等键、异人确认和独立二通道密钥。 The southbound gateway is disabled by default and, when enabled, still requires asset/action allowlists, parameter bounds, idempotency, four-eyes confirmation, and an independent second-channel key.
生产认证分离 / Certification is external:ESG、合规、孪生保真度和安全指标只有在提供正式证据时才成立,软件输出不构成法律、财务或安全认证。 ESG, compliance, twin fidelity, and safety claims require formal evidence; software output is not legal, financial, or safety certification.
生产模式门禁 / Production gate:PORT_DT_ENV=production 时 API 需要长密钥、显式 CORS;数据覆盖、模型晋级/回滚和执行变更另需独立管理员密钥;Swagger 默认关闭。 With PORT_DT_ENV=production, APIs require strong keys and explicit CORS; dataset replacement, model promotion/rollback, and execution changes require a separate administrator key; Swagger is disabled.
标识符安全 / Identifier safety:训练、评测和模型目录只接受受限标识符,并拒绝路径穿越与符号链接逃逸。 Training, evaluation, and model directories accept constrained identifiers and reject path traversal and symlink escape.
The default runtime exposes the trusted core only. Legacy engineering simulators, legacy RL artifacts, local desktop launchers, and production execution require explicit opt-in. See .env.example.
The current gate runs the complete unit-test suite and a 64-step smoke experiment that genuinely executes SAC, PPO, TD3, DQN, A2C, TQC, and MPC. Formal comparisons separately require at least three seeds and 10,000 steps per RL method. CI also audits installed dependencies; public-only workflows add CodeQL, Dependency Review, OpenSSF Scorecard, SBOM generation, and source attestations.
Contributions should be provenance-aware, reproducible, and explicit about safety impact. Read the contribution guide, governance, code of conduct, and support policy. The pull-request template asks for data, evaluation, rollback, and verification evidence.
安全问题请不要提交公开 Issue;请使用 GitHub Private Vulnerability Reporting。/ Do not disclose vulnerabilities in public issues; use GitHub Private Vulnerability Reporting.
用于研究或教学时,请通过 CITATION.cff 引用具体软件版本,并分别引用原始数据集。
If this repository supports research or teaching, cite the versioned software release through CITATION.cff and cite the original datasets independently.