Skip to content
Agent Orchestration
Skill

/host-contract-verification

宿主契约验证规范 — 为 Hook / CLI / bootstrap / visible envelope / workspace guard / LinkCapabilityDecision / MCP fallback 定义 direct replay、fixture replay、部署同步与证据路线

BOOST
From plugin
devcodex
43888 skills2 agents2 MCP
Install
$ npx -y skills add devcodex-labs/devcodex --skill host-contract-verification --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/host-contract-verification

Context preview

The summary Claude sees to decide when to auto-load this skill.

宿主契约验证规范 — 为 Hook / CLI / bootstrap / visible envelope / workspace guard / LinkCapabilityDecision / MCP fallback 定义 direct replay、fixture replay、部署同步与证据路线

SKILL.md

host-contract-verification.SKILL.md
name: host-contract-verification
description: 宿主契约验证规范 — 为 Hook / CLI / bootstrap / visible envelope / workspace guard / LinkCapabilityDecision / MCP fallback 定义 direct replay、fixture replay、部署同步与证据路线

Host Contract Verification Skill

职责

当任务涉及宿主事件契约、Hook 可见回复、workspace 项目识别、bootstrap 护栏、产物链接可点击性、MCP bridge fallback 或部署副本同步时,本 Skill 负责把“怎么证明宿主行为真的成立”收口为可复审的验证路线。

它不替代 `test-router`、`report` 或 runtime tests,而是为这些产物提供统一的宿主证据模型。

触发条件

| 场景 | 是否触发 | |------|:--------:| | Hook runtime / 宿主适配 / Hook 输出契约变更 | 🔴 必须 | | Stop / PreCompact 可见回复验证语义变更 | 🔴 必须 | | sticky `activeProject` / `mode` / workspace guard 变更 | 🔴 必须 | | Bootstrap、部署副本、父链同步口径变更 | 🔴 必须 | | `EntryCheckModelV3` / `DevCodexVisibleEnvelopeV3` / V1/V2 只读兼容 / `PostCompletionActionSetV1` / `UserFacingArtifactSetV1` / `LinkCapabilityDecisionV1` / `HostLinkCapabilityDecisionV2` / `ArtifactDeliveryAttemptV1` 变更 | 🔴 必须 | | Copilot / Codex MCP bridge 报错、`profile_load` fallback、`invoke undefined` 恢复链变更 | 🔴 必须 | | `ContextReadPlanV2` / `ContextReadReceiptV2`(含 V1 兼容)、Pre/Post 相关性、内容身份/复用、上下文读取 allowlist 或 fallback 语义变更 | 🔴 必须 | | 公开本地 probe、checkpoint 证据语义或 trace show/replay 变更 | 🔴 必须 | | 仅普通业务代码改动 | N/A |

HostContractRoute

| 字段 | 必填 | 说明 | |------|:----:|------| | `hostSurface` | ✅ | Copilot / Claude Code / Codex / instruction-fallback 中本轮实际验证的宿主面 | | `eventScope` | ✅ | `UserPromptSubmit` / `PreToolUse` / `PostToolUse` / `PreCompact` / `Stop` / bootstrap / deploy-sync | | `evidenceMode` | ✅ | direct replay / fixture replay / targeted test / validate probe / manual trace | | `fixtureSource` | 条件 | 使用 fixture replay 时记录脚本、payload 或样例来源 | | `visibleReplyEvidence` | 条件 | `verified-present` / `verified-missing` / `unverified`,以及证据来源 | | `workspaceGuard` | 条件 | 多项目 workspace、sticky project、workspace profile 提示等边界验证 | | `bootstrapScope` | 条件 | 父链部署体、入口检查块、adapter 初始化或 update 部署验证 | | `artifactLinkMatrix` | 条件 | `presentationSurface + capability evidence` 主选 renderer,hostSurface 只验 adapter 匹配;记录 `ArtifactDeliveryAttemptV1` 的 actionId/attempted/actionStatus/readback/status/fallbackReason 与 renderer parity | | `mcpFallback` | 条件 | MCP bridge 失败时是否降级到同计划有界文件读取 / instruction-fallback;记录错误文本、fallback 路线和是否停止重试 | | `contextAcquisition` | 条件 | plan/epoch/target/source 相关性、Pre attempted、Post success receipt、fallback 与完成状态 | | `turnLiveness` | 条件 | 长任务/无续接场景的 host-native、Hook-event、sidecar 能力边界,以及 lease、ACK、terminal、checkpoint 证据 | | `localProbe` | 条件 | `LocalProbeDescriptorV1/ResultV1` 的 ID、依赖、local-only、同步只读和 zero-write 证据 | | `checkpointValidation` | 条件 | response-time / post-execution 的 evidence、deadline、status 与 incomplete/timeout 处理 | | `localTaskTrace` | 条件 | `LocalTaskTraceV1` 的 sequence、duplicate、terminal、restart 与只读 replay 边界 | | `commands` | ✅ | 本轮实际执行命令或 targeted tests |

最小验证矩阵

| 变更类型 | 最小验证 | |----------|----------| | Hook 输出契约 | targeted test + direct replay | | 可见回复三态 | fixture replay 或 direct replay,报告中写明 `visibleReplyEvidence` | | sticky project / workspace guard | multi-project fixture + follow-up replay | | bootstrap / 部署副本 | `node scripts/validate.js` + 部署同步后的落点复核 | | managed deployment manifest | legacy 多 owner + workspace-namespace fixture、规范化 destination 单一 current owner、project current host=0、workspace missing/mismatch/stale/duplicate=0、V8 direct replay | | workspace 宿主作用域 | `HostAdapterScopeV1` owner/activation 一致 + 子项目五类 generated host artifact=0 + Grok workspace plugin/用户登记正向 + uninstall/repeat/reinstall 配置保真 + status/doctor 同 owner + root native kernel + child plain partial + `devcodex grok --rules` full 路线 + `--cwd`/nested workspace/Windows path identity + outside-workspace no-op 负向 | | visible set / 产物打开 | manifest/projection property test + Codex Desktop、VS Code、Zed、WebStorm、Codex CLI、Claude/unknown renderer fixture;renderer-only 必须 fallback,`opened` 必须同时具备 action success + readback success;若声称当前 presentationSurface 已打开,需 direct replay 或用户实测证据 | | MCP bridge fallback | MCP server no-args direct replay + 非 Full 宿主 fallback 文案探针;若错误来自宿主桥接层,只能声明 fallback 已覆盖,不能声明宿主 bug 已修复 | | 意图驱动上下文获取 | `ContextAcquisitionToolAllowlistProbe` + plan/receipt direct replay + Pre/Post fixture + hidden-full-read 负例 + fallback no-deadlock | | Turn Liveness / orphaned turn | state-machine fault matrix + Hook direct replay + restart rehydrate;事件停止后的 proactive 检测只能由 host-native watchdog 或 gray read-only sidecar 证明 | | 本地 probe | descriptor/dependency/error fixture + CLI JSON/human replay + state hash zero-write;不得联网、启动 watcher 或写 telemetry | | checkpoint / local trace | fixed-clock 双阶段 fixture + Hook terminal replay + sequence/duplicate/restart/terminal 负例;trace replay 必须证明 payload 不执行且源 state hash 不变 | | 仅文档声明变更 | `source-consumer-sync` + validate probe;若声称宿主行为改变则不得只改文档 |

证据要求

VisibleOutputHostEvidenceGate

Stop/PreCompact 对最终回复证据必须使用 `verified-present / verified-missing / unverified`:只有观察到可解析 assistant 内容和当前 `DevCodexVisibleEnvelopeV3` marker、合法动作标题、语义 item 才能判定 present/missing;V1/V2 marker 只记录 `legacy-v1-read-only` / `legacy-v2-read-only`,不得把它当作新写入证据。未观察到只能 unverified。记录 `evidenceSource / missingItems / semanticDigest`,不得保存不必要的完整回复正文。

legacy “主要产物 + 绝对路径”最多为 `unverified-legacy`。能力未 direct 验证时保持 portable/plain;Rich clickable 只显示单个语义链接。session、daily、SUMMARY、task/checkpoint 和 raw ledger 默认 internal-only,但宿主验证仍要核对它们已进入 internal manifest 和 ECR。

HostPermissionAuthorityInvariant

`PreToolUse` 与 `PermissionRequest` 的文件、命令、删除及工具调用权限完全归当前宿主和用户宿主配置。DevCodex 只能记录风险 advisory、telemetry 或 typed workflow-invalid;runtime、输出 builder 和每个宿主 adapter 均不得发出或转译 `allow / deny / ask / block / continue:false` 操作权限载荷。Stop、PreCompact 等非操作生命周期完成门禁不受此条影响。验证必须向 Codex、Claude、Gemini、Copilot、Grok、Cursor 注入遗留允许/拒绝载荷,并证明最终操作事件投影不含任何 permission carrier。

ContextAcquisitionHostEvidenceGate

  • `ContextAcquisitionToolAllowlistProbe` 只允许已注册的只读 Profile / memory 查询工具推进 source state;普通文件搜索、写工具、legacy no-args 全文读取或未知工具不得伪造完成。
  • `PreToolUse` 只记录 correlated attempted;只有 `PostToolUse` 中可解析的成功结果,且 invocation planId、planContentId、contextEpoch、active
Read more
Ships withdevcodex

Intent-driven AI coding workflow runtime for consistent context, skills, approvals, validation, and handoffs across six AI coding hosts.

Get the whole plugin

Other skills on devcodex.