consensus-deployment-guard
INLINECODE0 is the final safety gate before deployment execution.
What this skill does
- - validates deployment requests against a strict JSON schema (reject unknown fields)
- evaluates hard-block and rewrite policy flags for release risk patterns
- runs deterministic persona-weighted voting (or aggregates external votes)
- returns one of: INLINECODE1
- writes decision artifacts for replay/audit
Decision policy shape
Hard-block examples:
- - required tests not passing
- CI status failed
- rollback artifact missing when required
- incompatible schema migration
- error budget already breached
Rewrite examples:
- - production rollout not using canary when policy requires it
- initial rollout percentage above policy limit
- production deploy missing explicit human confirmation gate
- CI still pending
- schema compatibility unknown
Runtime and safety model
- - runtime binaries:
node, INLINECODE3 - network behavior: none in guard decision logic
- environment config read by this package:
CONSENSUS_STATE_FILE, INLINECODE5 - filesystem writes: consensus board/state artifacts under configured state path
Invoke contract
Modes:
- -
mode="persona" (default): use local deterministic persona defaults for internal voting - INLINECODE8 : consume
external_votes[], aggregate deterministically, and enforce policy
Install
CODEBLOCK0
Quick start
CODEBLOCK1
Tests
CODEBLOCK2
Coverage includes schema rejection, hard-block paths, rewrite paths, allow paths, idempotent retries, and external-agent aggregation behavior.
See also: SECURITY-ASSURANCE.md for threat model, runtime boundaries, and deployment hardening guidance.
consensus-deployment-guard
consensus-deployment-guard 是部署执行前的最终安全防护门。
该技能的功能
- - 根据严格的JSON模式验证部署请求(拒绝未知字段)
- 评估硬阻断和重写策略标志以识别发布风险模式
- 运行确定性角色加权投票(或聚合外部投票)
- 返回以下结果之一:ALLOW | BLOCK | REQUIRE_REWRITE
- 写入决策工件以供回放/审计
决策策略形态
硬阻断示例:
- - 必需测试未通过
- CI状态失败
- 需要时缺少回滚工件
- 不兼容的模式迁移
- 错误预算已超支
重写示例:
- - 生产部署未按策略要求使用金丝雀发布
- 初始发布百分比超过策略限制
- 生产部署缺少明确的人工确认关卡
- CI仍处于待处理状态
- 模式兼容性未知
运行时与安全模型
- - 运行时二进制文件:node、tsx
- 网络行为:防护决策逻辑中无网络行为
- 此包读取的环境配置:CONSENSUSSTATEFILE、CONSENSUSSTATEROOT
- 文件系统写入:在配置的状态路径下写入共识板/状态工件
调用契约
- - invoke(input, opts?) -> Promise
模式:
- - mode=persona(默认):使用本地确定性角色默认值进行内部投票
- mode=externalagent:消费externalvotes[],进行确定性聚合,并执行策略
安装
bash
npm i consensus-deployment-guard
快速开始
bash
node --import tsx run.js --input ./examples/input.json
测试
bash
npm test
测试覆盖范围包括:模式拒绝、硬阻断路径、重写路径、允许路径、幂等重试以及外部代理聚合行为。
另请参阅:SECURITY-ASSURANCE.md,了解威胁模型、运行时边界和部署加固指南。