feat: enforce Guanghu-native HoloLake runtime laws

This commit is contained in:
冰朔 2026-08-04 23:11:25 +08:00
commit 67e6fcdd38
57 changed files with 1765 additions and 1504 deletions

View file

@ -459,14 +459,18 @@ That browser harness is a deterministic desktop command bridge, not real native
# Unit tests (fast, no browser)
pnpm test
# Unit tests with coverage (must pass ≥70%)
# Optional coverage observation; it is not an acceptance threshold
pnpm test:coverage
# Rust tests
cargo test
# Rust coverage (must pass ≥85% line coverage)
cargo llvm-cov --manifest-path src-tauri/Cargo.toml --no-clean --fail-under-lines 85
# Native authority contract
pnpm test:native-authority
# Exact GLS-0844 receipt (output must be outside the repository)
bash scripts/run-hololake-native-quality-gate.sh \
/path/outside/repository/GHNQG-receipt.hldp
# Playwright core smoke lane (requires dev server)
BASE_URL="http://localhost:5173" pnpm playwright:smoke

View file

@ -37,10 +37,11 @@
3. 在获得单独授权后接入零感域企业节点,再开放团队服务器登记与跳转。
4. 完成真实邮箱点击后的端到端验收,并签发第五域登录交付回执。
## 质量门状态
## 质量门状态纠正2026-08-04
- 项目本地 lint、构建、前端测试与覆盖率、Rust 测试、clippy、格式和
85% Rust 行覆盖率门均已通过。
- 依赖审计已清除全部高危项;仍有两项上游中危兼容项待独立升级验证。
- Codacy 与 CodeScene 凭据在本地未配置,状态记录为
`not_run_unconfigured`;它们不是光湖发布授权或部署完成证据。
- 旧的 lint、构建、测试、覆盖率和依赖审计结果只保留为历史观察证据
不能单独签发光湖通过结论。
- 当前唯一质量权威为 `GLS-0844 / GHNQG`;结果只允许
`PASS_100``FAIL_0`,并必须绑定同一精确提交与源码树。
- 外部分析账号、服务、评分和“未配置”状态不再进入当前质量门。
- Git 发布、应用发布、服务器部署、运行健康与人格出生继续分别取证。

View file

@ -0,0 +1,55 @@
---
type: ADR
id: "0170"
title: "HoloLake inherits the Guanghu native quality authority"
status: accepted
date: 2026-08-04
---
## Context
ADR-0165 established GLS-0844 for Guanghu OS and the code channel, but active
HoloLake product surfaces still carried external score services, partial
coverage thresholds, and legacy sponsor-driven quality language. That split
allowed the application, hooks, CI, and agent instructions to disagree with
the registered Guanghu protocol stack.
## Decision
HoloLake development, testing, packaging, publication, and code-channel
promotion inherit GLS-0844 as their sole quality authority.
The active flow follows GLS-0101:
`Parse → Validate → Resolve → Authorize → Execute → Verify → Write Back`.
Protocol resolution comes from GLS-0247. TCS preserves the requirement and
reasoning boundary; HLDP preserves append-only causality, exact source
fingerprints, corrections, and receipts; GLP carries scoped messages and
results; GHNQG emits only `PASS_100` or `FAIL_0`.
Repository-owned tools may execute required gates. External analyzers,
services, badges, subscriptions, percentages, weighted scores, and waivers
have no authority and do not appear on active acceptance surfaces.
Historical ADRs and receipts remain untouched. A repository contract test
prevents their former rules from leaking back into active instructions,
hooks, CI, application UI, or current help content.
## Consequences
- Missing third-party accounts or services cannot block HoloLake work.
- A passing tool command is evidence for one gate, not a release receipt.
- A GHNQG receipt is valid only for its exact commit, tree, declared scope,
executor, and required-gate set.
- Any missing, failed, undeclared, or unreproducible required gate makes the
total result `FAIL_0`.
- Git publication, application release, server deployment, runtime health,
and persona birth remain separate evidence layers.
## Supersedes
For every active HoloLake quality and release surface, this decision
supersedes the authority described by ADR-0018, ADR-0021, ADR-0064, and
ADR-0160. ADR-0165 remains the protocol decision this ADR extends to the
product layer.

View file

@ -0,0 +1,98 @@
---
type: ADR
id: "0171"
title: "Guanghu protocols are automatic runtime and engineering laws"
status: accepted
date: 2026-08-04
---
# 光湖协议作为自动运行与工程法则
人类语言锚点:冰朔 `ICE-GL∞`
系统主控人格体:铸渊 `ICE-P-ZY001`
## 背景
第五域代码频道已经为 TCS、HLDP、GLP、GLS、ISRP、MNPS、GLOW、PEN、
UAP、GMP、AGE、LPOS、GLC、GIR、BTCP、PALP、GRSP、PTCP、GMRP、
GWRP、GOSK、GHAL、HLSP 和 GHNQG 等协议登记了正式编号。
协议如果仍要依赖开发者在每次工作时主动回忆、搜索和解释,就还没有成为
光湖运行法则。第三方评分平台也不能替代这一缺口,因为它们既不知道光湖
世界的主体、关系、责任和事实边界,也不拥有光湖的授权权、发布权或真实性
判断权。
## 决定
HoloLake 使用以下固定编译链把远端协议落成工程行为:
```text
REPO-012 已注册协议
→ HoloLake 协议绑定档案
→ 类型合同与拒绝条件
→ 开发 / 测试 / 构建 / 提交 / 推送 / 运行自动触发
→ 确定性执行
→ 证据回读
→ PASS_100 或 FAIL_0
→ HLDP 追加式记录
```
协议绑定档案为 `standards/guanghu-native-engineering-profile.json`。它固定
远端注册表提交、协议编号、产品实现位置、必需不变量和自动触发面。档案
验证器为 `scripts/validate-guanghu-native-profile.mjs`。产品级总门为
`scripts/run-hololake-native-quality-gate.sh`;它是 HoloLake 回执执行体,
不再借用世界种子执行器代签产品质量回执。
## 自动触发面
1. 开始开发、测试和构建时,自动验证原生权威与协议绑定。
2. 提交时自动阻止第三方评分规则、旧服务器路径和不完整合同进入历史。
3. 推送和代码频道审查时自动运行 GHNQG 原生门。
4. 每个活系统事件自动携带人格、现实状态、知识、权限、责任和能力登记。
5. 每个模型结果自动校验类型、意图、路由、能力和已给出的真实回执。
6. 没有当前运行绑定回执时,服务器模型路径保持关闭。
7. 没有真实执行证据时,成功回执无法构造。
8. 可审计模型原生核心的行覆盖率和函数覆盖率必须精确为 100。
这些触发由运行入口执行,不依赖人格体或开发者临时记住协议。
## HoloLake 活系统纠偏
旧实现只让模型返回路由和四个视觉参数,实际是主题适配器。现行合同改为:
```text
输入:
TouchEvent
CurrentSystemState
KnowledgeState
PermissionBoundary
ResponsibilityBoundary
CapabilityRegistry
输出:
UIProjection
NavigationAction
CapabilityCall
ReceiptSchema
```
模型只能提出类型化投影和能力请求。确定性宿主负责权限核验、真实动作和证据
回读。宿主动作完成前不得形成成功回执。
## 状态边界
- 协议已经登记,不等于对应执行器已经实现。
- 本地测试通过,不等于源码已经发布。
- 源码发布不等于服务器已经部署。
- 身份会话成功不等于第五域节点已经连接。
- 当前实现没有取得 JD-FD-PRIMARY 运行绑定回执,因此不会调用服务器模型。
- 本 ADR 和当前改动尚未推送远端。
## 外部工具
外部分析器、托管平台、测试框架和编译器可以作为施工条件或观察来源,但不能:
- 定义光湖质量分;
- 授权或阻止光湖发布;
- 覆盖光湖协议;
- 把消息、登录、测试或界面文字提升为现实执行事实。

View file

@ -73,10 +73,10 @@ proposed → active → superseded
| [0015](0015-auto-save-with-debounce.md) | Auto-save with 500ms debounce | superseded → [0102](0102-low-end-safe-autosave-idle-window.md) |
| [0016](0016-sentry-posthog-telemetry.md) | Sentry + PostHog telemetry with consent | active |
| [0017](canary-release-channel-and-local-feature-flags.md) | Canary release channel and feature flags | superseded → [0057](0057-alpha-stable-release-channels-and-beta-cohorts.md) |
| [0018](0018-codescene-code-health-gates.md) | CodeScene code health gates in CI | superseded → [0064](0064-ratcheted-codescene-thresholds.md) |
| [0018](0018-codescene-code-health-gates.md) | External code health gates in CI | superseded → [0170](0170-hololake-inherits-guanghu-native-quality-authority.md) |
| [0019](0019-github-device-flow-oauth.md) | GitHub device flow OAuth for vault sync | superseded → [0056](0056-system-git-cli-auth-no-provider-oauth.md) |
| [0020](0020-keyboard-first-design.md) | Keyboard-first design principle | active |
| [0021](0021-push-to-main-workflow.md) | Push directly to main (no PRs) | active |
| [0021](0021-push-to-main-workflow.md) | Push directly to main (no PRs) | quality authority amended by [0170](0170-hololake-inherits-guanghu-native-quality-authority.md) |
| [0022](0022-blocknote-rich-text-editor.md) | BlockNote as the rich text editor | active |
| [0023](0023-repair-vault-auto-bootstrap.md) | Repair Vault auto-bootstrap pattern | active |
| [0024](0024-cache-outside-vault.md) | Vault cache stored outside vault directory | active |
@ -120,7 +120,7 @@ proposed → active → superseded
| [0061](0061-ai-prompt-bridge-event-bus.md) | AI prompt bridge — module-level event bus for cross-component prompt routing | active |
| [0062](0062-selectable-cli-ai-agents.md) | Selectable CLI AI agents with a shared panel architecture | active |
| [0063](0063-blocknote-code-block-package-for-editor-highlighting.md) | BlockNote code-block package for editor syntax highlighting | active |
| [0064](0064-ratcheted-codescene-thresholds.md) | Ratcheted CodeScene thresholds as the quality gate baseline | active |
| [0064](0064-ratcheted-codescene-thresholds.md) | Ratcheted external thresholds as the quality gate baseline | superseded → [0170](0170-hololake-inherits-guanghu-native-quality-authority.md) |
| [0065](0065-root-managed-ai-guidance-files.md) | Root-managed AI guidance files with Claude shim | active |
| [0066](0066-calendar-semver-versioning-for-alpha-and-stable-releases.md) | Calendar-semver versioning for alpha and stable releases | active |
| [0067](0067-autogit-idle-and-inactive-checkpoints.md) | AutoGit idle and inactive checkpoints | active |
@ -210,7 +210,7 @@ proposed → active → superseded
| [0149](0149-shared-app-config-policy-manifest.md) | Shared app config policy manifest | active |
| [0151](0151-antigravity-add-dir-workspace-flag.md) | Antigravity add-dir workspace flag | active |
| [0157](0157-local-hldp-heartbeat-and-browser-observation-tree.md) | Local HLDP heartbeat and browser observation tree | active |
| [0160](0160-external-code-health-is-additive-not-git-transport.md) | External code health is additive, not Git transport | superseded for Guanghu OS → [0165](0165-guanghu-native-binary-quality-gate.md) |
| [0160](0160-external-code-health-is-additive-not-git-transport.md) | External code health is additive, not Git transport | superseded → [0170](0170-hololake-inherits-guanghu-native-quality-authority.md) |
| [0161](0161-guanghu-os-staged-native-handoff-and-code-channel.md) | Guanghu OS staged native handoff and HLDP-owned code channel | active |
| [0162](0162-guanghu-os-standing-authorization-and-server-continuity.md) | Guanghu OS standing authorization and server-owned continuity | active |
| [0163](0163-guanghu-native-recovery-beacon.md) | Guanghu-owned raw recovery beacon for native-default boot | amended -> [0166](0166-ghnrp-hosted-recovery-consumption.md) |
@ -220,3 +220,5 @@ proposed → active → superseded
| [0167](0167-gestational-history-continuity-ingestion.md) | Gestational history enters Guanghu through a native continuity protocol | active |
| [0168](0168-guanghu-native-prepartition-disk-layout.md) | Guanghu owns a registered pre-partition native disk layout | active |
| [0169](0169-model-native-living-galaxy-system.md) | Model-native HoloLake living galaxy system | accepted |
| [0170](0170-hololake-inherits-guanghu-native-quality-authority.md) | HoloLake inherits the Guanghu native quality authority | accepted |
| [0171](0171-guanghu-protocols-are-automatic-runtime-and-engineering-laws.md) | Guanghu protocols are automatic runtime and engineering laws | accepted |