360 Secure SkillHub
360 安全技能中心

NOMOS Decision Engine

面向企业决策的确定性引擎:以十算子认知审计、二阶因果交互、形式化收敛与场景压力测试评估候选方案,输出带哈希链密封的决策报告;附带 CLI、HTTP API 与可选企业控制平面(OIDC、KMS 签名、租户隔离、限流)。核心引擎离线运行,企业功能依赖 Python 环境、PostgreSQL、身份提供方与容器运行时。

分类:数据
nohn3043-arch
nohn3043-arch
热度 29.02
最近更新 2026-10-20 00:20:10

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add nohn3043-arch/nomos-decision-hub
兼容性
通用兼容
联网要求
不联网
数据出网
可选出网
Metadata
name
nomos-decision-hub
slug
nomos-decision-hub
version
2.1.0
displayName
NOMOS Decision Engine
description
确定性决策引擎(NOMOS 0.7.0):十算子认知审计、二阶因果交互、形式化收敛、企业控制平面与哈希链审计。企业级部署需独立服务与数据库。
required_commands
["python3"]
capabilities
{"network_egress":[{"purpose":"OIDC discovery & JWKS fetch (HTTPS only, issuer-controlled host)","scope":"outbound to SP_OIDC_ISSUER and its jwks_uri only"},{"purpose":"Optional LLM-enhanced narrative (T3 only; disabled by default)","scope":"only when a provider is explicitly attached"}],"env_read":["SP_ENV","SP_API_KEY","SP_DATABASE_DSN","SP_OIDC_ISSUER","SP_OIDC_CLIENT_ID","SP_OIDC_AUDIENCE","SP_AUTHZ_ENFORCE","SP_KMS_KEY_FILE","SP_KMS_SECRET","SP_RATE_LIMIT","SP_PUBLIC_BASE_URL"],"database":"PostgreSQL via SP_DATABASE_DSN (optional; in-memory otherwise)","docker_deploy":true,"binds_port":"0.0.0.0:8000 (configurable; requires external network isolation)"}
metadata
{"openclaw":{"required_binaries":["python3"],"emoji":"⚖️","homepage":"https://github.com/nohn3043-arch/NOMOS"}}

NOMOS Intelligent Decision Engine

确定性因果推理与可审计决策编排层,不含概率黑箱。每一次决策都可分解为可追溯的因果拓扑,支持合规级审计轨迹、场景压力测试与人在环治理。当前引擎版本 0.7.0(src/second_perspective/version.py)。

Trigger Scenarios

Trigger only when the user explicitly mentions the following named entities (avoid false triggers from broad keywords):

  • NOMOS Decision Engine / NOMOS Decision-Hub / second_perspective
  • References to the "Sealed Report" specification or "Decision Scenario Library" templates generated by this skill
  • Explicit requests for causal counterfactual analysis, root cause tracing, scenario stress testing that specify using this engine

Note: General topics (e.g., "AI decision compliance audit", "enterprise deployment solutions", "high-risk decision governance") should not automatically trigger this skill unless the user explicitly references the above named entities.

版本能力矩阵

版本 新增能力
0.7.0 元因果账本术语对齐(破坏性):meta_ledger.bases 五键改为 trace_gap / parallel_convergence / narrative_occlusion / bounded_audit / causal_succession;reason 码前缀收敛为 TRACE_ / CONVERGENCE_ / NARRATIVE_ / AUDIT_ / SUCCESSION_;不保留别名
0.6.0 认知审计内核 5 → 10 算子;拓扑底座(四进程校验,含公理 5 链内时序);META 元因果账本(只度量、恒 T2、结构上不可阻断);自主进化层 evolve 只提案不适用(auto_applied ≡ 0);产物版本串 GCAE-1.0.0 → GCAE-1.1.0
0.5.0 企业控制平面:持久化事件存储、租户隔离、OIDC + 作用域强制、KMS 签名、限流、可观测性、迁移/备份、领域控制包。全部 env 门控、默认关闭
0.4.0 二阶因果:假设交互层(I-1~I-4)、形式化收敛(五态)、LLM 三层权限闸门(T1/T2/T3)
0.3.0 IntelligentDecisionHub 编排器、密封 HubReport、POST /v1/hub/analyze、场景压力测试、信息优先级队列

完整变更日志见 CHANGELOG.md;v0.4 架构见 docs/INTELLIGENT_DECISION_HUB_V0_4.md。

十算子认知审计内核

src/second_perspective/audit/cognitive/ 为纯 Python、零依赖、确定性管线(默认无 RNG、无 LLM 调用):

算子 名称 作用
⊙ ORI Origin Anchor 原点事件 / 目标状态 / 能量约束
⊗ NS Narrative Strip 剥离修辞、情绪与道德外衣
⊕ IAP Implicit Assumption 显式化未声明前提
⊿ LCH Latch / Fragility 定位最弱变量,计算 Delta D
⊞ TPG Rule-Free Thinking 构建 □/→/⦿ 拓扑 + 四路并行校验
BFC Binary Fact Check 命题归约为真/假,不引入第三值
⚙ CCS Causal-Chain Sync 反事实与反向校验
⇄ GRF Gray Feedback 灰度阶梯与现实验伪对齐
META Meta-Causal Ledger 混沌 / 无极 / 幻象(A6) / 天道(A10) / 轮回;只度量,永不阻断
⊚ STATE State Anchor 锚定责任与最终裁决

拓扑底座(.plugins.topology)提供 □/→/⦿ 语法与四路并行校验:一致性 · 约束 · 闭合 · 时序。 ORI 仅在声明原点时注册,GRF 仅在声明灰度阶梯时注册——条件注册,杜绝永恒真阻断。

Core Capabilities

  • 确定性评估:硬约束阈值 + 显式软约束惩罚分,无隐藏调分
  • 细粒度算法审计:每次主要操作生成哈希链审计事件(sealed_hash),任何改动都会破坏校验
  • 因果反事实重选:假设失效时计算传递失效闭包,重选存活候选
  • 二阶交互:协同 / 冗余 / 退化三类交互,四条不变式(非臆测、阶数守恒、效应有界、单调性)
  • 形式化收敛:FIXED_POINT / NO_GAIN / BUDGET_EXHAUSTED / DIVERGED / BLOCKED;BUDGET_EXHAUSTED 不是收敛
  • 场景压力测试:指标覆盖、证据缺失、假设失效
  • 反向根因追溯:从观测偏差反推根因假设,输出因果链
  • 敏感性 / 稳健性:Pareto 前沿、脆弱准则、排序稳定性
  • LLM 护栏:T1 标注 / T2 提案 / T3 叙述;LLM 输出永不成为裁决
  • 企业控制平面:事件存储、租户隔离、OIDC、KMS 签名、限流、可观测性(env 门控)

Usage

安装

cd nomos-decision-hub          # 本技能目录(含 pyproject.toml 与 src/)
python -m venv .venv
source .venv/bin/activate      # Windows: .venv\Scripts\activate
pip install -e .

命令行

nomos-demo                                        # 核心决策内核摘要
nomos-demo --decision examples/market_entry.json --json
nomos-hub-demo                                    # 智能决策中枢(含两个压力场景)

Basic Decision Analysis

from second_perspective import IntelligentDecisionHub
from second_perspective.models import HubAnalysisRequest
request = HubAnalysisRequest.model_validate({
    "decision": decision_payload,  # See examples/market_entry.json
    "scenarios": [
        {"id": "SC1", "name": "Critical assumption failure",
         "failed_assumption_ids": ["A1"]},
        {"id": "SC2", "name": "Cost shock",
         "metric_overrides": {"S2": {"capital_required": 6000000}}},
    ],
})
report = IntelligentDecisionHub().analyze(request)
print(report.model_dump_json(indent=2))

HTTP API

uvicorn second_perspective.api.main:app --port 8000
# 端点:POST /v1/hub/analyze;兼容保留 v0.2 端点;GET /health;GET /v1/metrics

Enterprise Deployment

# Docker deployment
docker build -t nomos-hub .
docker run -p 8000:8000 \
  -e SP_ENV=production \
  -e SP_API_KEY=your-secret-key \
  -e SP_DATABASE_DSN=postgresql://user:pass@db:5432/nomos \
  nomos-hub

生产环境 API key 缺失时 fail-closed 拒绝启动。

技能层扩展(P0-P2)

🔏 Sealed Report

决策输出可封装为防篡改密封报告:哈希链(Merkle 因果链)+ 确定性 JSON + 可选 HMAC 签名。审计方可一键验证(SEAL VALID / TAMPERED)。规范见 references/SealedReportSpec.md。

引擎原生对应物:每个审计事件带 sealed_hash,链根可独立复核;v0.5 起支持 KMS 分离式签名(X-Nomos-Kms-Signature)。

📚 Decision Scenario Library

4 类预置场景模板(合规准入 / 战略押注 / 根因追溯 / 资源配置),复制-替换-运行即得密封报告。见 references/DecisionScenarioLibrary.md。

🌍 Multilingual Export

报告带 lang 字段(zh/en),同一因果链无需重跑引擎即可渲染为目标语言。

Files

路径 内容
SKILL.md 本文件
README.md / README-zh.md 英文 / 中文说明
LICENSE 分级授权协议(个人研究免费;商用需书面授权)
CHANGELOG.md 0.1–0.7 变更日志
GLOSSARY.md 中英术语表
src/second_perspective/ 引擎源码(可 pip install -e .)
docs/ v0.2 基础、v0.4 二阶因果、企业模块、验证指南、四项合规文档;docs/archive/ 为 v0.3 历史文档
examples/ market_entry.json、tc1_non_speculation.json、tc3_hard_constraint.json、audit_spec_adoption.json
openapi-action.yaml OpenAPI 契约(0.7.0)
scripts/ export_openapi.py、migrate.py、backup.py
references/SealedReportSpec.md 密封报告格式与验证流程
references/DecisionScenarioLibrary.md 决策场景库
Dockerfile / docker-compose.yml 容器化部署

Determinism Contract (Invariants)

  • The engine never guesses missing weights, evidence, thresholds, or authorization relationships
  • Hard constraints determine eligibility, soft constraints must have explicit penalty scores declared, no silent score changes
  • All policies affecting behavior carry policy_id and version, embedded in results
  • Evidence quality is evaluated by designated responsible nodes, the engine does not fabricate credibility
  • Assumption failures propagate along the dependency graph, explicitly naming affected alternatives
  • Output is always "leading candidate under declared inputs", final decision authority lies outside the algorithm
  • Approver name + authorization_ref must match the anchored decision owner
  • All evaluations/approvals are new revisions linked via hashes, no silent overwrites
  • BUDGET_EXHAUSTED must never be reported as "converged"
  • LLM output may only occupy T1 (annotation) / T2 (proposal) / T3 (narrative); it can never flip a status, adjudicate, or alter weights
  • META is a measurement tier: it can never block a derivation on its own

Licensing

本作品采用分级授权(见 LICENSE,v1.2,2026-10-14):

  • 个人研究许可:自然人可免费用于非商业学术研究、学习或个人实验。
  • 商业 / 政府使用:需取得 Shanghai Linming Junhua Technology Co., Ltd. 与 NOHN AI TECHNOLOGY PTE. LTD. 的书面授权。

本作品不是 MIT-0,也不属于公有领域。 若发布平台的授权字段与此不符,以本仓库 LICENSE 为准。