ai-sdlc-package-trust

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ai-sdlc-package-trust: Trusted Packages And Private Metrics

ai-sdlc-package-trust:可信包与私有指标

Internal AI SDLC skill, not client-facing by default. Integrity and provenance evidence do not grant install or execution authority.
内部AI SDLC技能,默认不面向客户。 完整性和溯源证据不授予安装或执行权限。

0. Skill Card

0. 技能卡片

  • Skill name:
    ai-sdlc-package-trust
  • Primary audience: Security, Delivery, Release
  • Supporting audience: Dev, Architecture
  • Audience tags: Security, Delivery, Release, Dev
  • SDLC stage: Package trust and local observability
  • Purpose: Fail closed on untrusted packages and measure delivery without content collection.
  • Output:
    _ai_sdlc/trust/<package-id>/decision.{toon,json,md}
    or
    _ai_sdlc/metrics/local.{toon,json,md}
  • 技能名称:
    ai-sdlc-package-trust
  • 主要受众:安全团队、交付团队、发布团队
  • 支持受众:开发人员、架构师
  • 受众标签:Security、Delivery、Release、Dev
  • SDLC阶段:包信任与本地可观测性
  • 用途:对不可信包执行闭环拦截,在不收集内容的情况下衡量交付情况。
  • 输出:
    _ai_sdlc/trust/<package-id>/decision.{toon,json,md}
    _ai_sdlc/metrics/local.{toon,json,md}

0.1 Required Inputs

0.1 必需输入

  • Package root, versioned manifest, allowed origins/capabilities, active harness API, and provenance policy.
  • Repository-local runtime and evidence records for metrics.
  • 包根目录、带版本的清单、允许的来源/能力、激活的Harness API以及溯源策略。
  • 用于指标计算的仓库本地运行时和证据记录。

0.2 Clarification Rules

0.2 澄清规则

  • Ask when trust policy or package root is ambiguous.
  • Reject unsafe paths, symlinks, hash drift, incompatible APIs, undeclared or disallowed capabilities, and missing required provenance.
  • Never equate a digest with author identity or approval.
  • 当信任策略或包根目录不明确时发起询问。
  • 拒绝不安全路径、符号链接、哈希偏移、不兼容API、未声明或不被允许的能力,以及缺失必需溯源信息的情况。
  • 切勿将摘要等同于作者身份或审批。

0.2.1 Flow Mode Flags

0.2.1 流程模式标志

  • Support
    --quick-flow
    and
    --full-flow
    ; full flow takes precedence.
  • Full flow reviews every file, capability, origin, provenance claim, and privacy field.
  • 支持
    --quick-flow
    --full-flow
    ;全流程模式优先。
  • 全流程会检查每个文件、能力、来源、溯源声明和隐私字段。

0.3 Output Rules

0.3 输出规则

  • Default to complete TOON trust decisions or content-free aggregate metrics.
  • Return summaries directly in the Codex response.
  • Emit
    ai-sdlc-handoff/v1
    with
    result
    ,
    blockers
    ,
    next_required
    , and
    next_optional
    ; actions include
    reason
    ,
    command
    , and
    expected_artifact
    .
  • Do not create
    summary.txt
    ,
    *-summary.txt
    , or another standalone summary file.
  • 默认生成完整的TOON信任决策或无内容的聚合指标。
  • 在Codex响应中直接返回摘要。
  • 发送包含
    result
    blockers
    next_required
    next_optional
    ai-sdlc-handoff/v1
    消息;操作内容包括
    reason
    command
    expected_artifact
  • 禁止创建
    summary.txt
    *-summary.txt
    或其他独立摘要文件。

0.4 Artifact Routing

0.4 制品路由

  • Write generated decisions and metrics only below
    _ai_sdlc/
    .
  • Never rewrite package files, manifests, runtime records, or evidence ledgers.
  • 仅在
    _ai_sdlc/
    目录下写入生成的决策和指标。
  • 切勿重写包文件、清单、运行时记录或证据台账。

0.5 Feature State Machine

0.5 特性状态机

  • Read owning feature
    _ai_sdlc/state.toon
    before using a trust decision.
  • Trust and metrics do not advance feature state.
  • 在使用信任决策前,先读取所属特性的
    _ai_sdlc/state.toon
    文件。
  • 信任决策和指标不会推进特性状态。

0.6 Artifact Metadata And Metatags

0.6 制品元数据与元标签

  • Related Markdown uses canonical
    artifact_metadata
    and
    metatags
    .
  • Machine records use versioned package, trust-decision, and local-metrics schemas.
  • 相关Markdown文件使用标准
    artifact_metadata
    metatags
  • 机器记录使用带版本的包、信任决策和本地指标 schema。

0.7 Specs Index

0.7 规范索引

  • Read
    _ai_sdlc/specs-index.toon
    first and use
    specs-index.md
    for human review.
  • Trust and metrics outputs do not refresh either index.
  • 优先读取
    _ai_sdlc/specs-index.toon
    ,供人工审核使用
    specs-index.md
  • 信任决策和指标输出不会刷新上述任一索引。

References

参考资料

  • Read
    references/trust-metrics-contract.md
    before interpreting results.
  • Validate manifests with
    references/package.schema.json
    .
  • Use
    scripts/package_trust.py
    for trust and
    scripts/metrics.py
    for aggregation.
  • 在解读结果前,请先阅读
    references/trust-metrics-contract.md
  • 使用
    references/package.schema.json
    验证清单。
  • 信任验证使用
    scripts/package_trust.py
    ,聚合计算使用
    scripts/metrics.py

Script Usage

脚本使用

bash
python3 skills/ai-sdlc-package-trust/scripts/package_trust.py . --package-root package --manifest package.json --allowed-origin repository --allowed-capability filesystem.read --require-provenance --write
python3 skills/ai-sdlc-package-trust/scripts/metrics.py . --generate --write
bash
python3 skills/ai-sdlc-package-trust/scripts/package_trust.py . --package-root package --manifest package.json --allowed-origin repository --allowed-capability filesystem.read --require-provenance --write
python3 skills/ai-sdlc-package-trust/scripts/metrics.py . --generate --write

Steps

步骤

  1. Validate manifest structure, safe inventory, origin, API range, and capabilities.
  2. Rehash every declared regular file and the normalized inventory.
  3. Validate required provenance fields without claiming cryptographic identity.
  4. Emit an explainable allow or deny decision; never install the package.
  5. Aggregate local run states and evidence coverage using counts and numeric budgets only.
  6. Reject any metrics structure containing content-bearing field names.
  7. Emit deterministic TOON-first local metrics with explicit insufficient-data state.
  1. 验证清单结构、安全清单、来源、API范围和能力。
  2. 对每个已声明的常规文件和标准化清单重新计算哈希值。
  3. 验证必需的溯源字段,不主张加密身份。
  4. 输出可解释的允许或拒绝决策;绝不安装包。
  5. 仅使用计数和数值预算聚合本地运行状态和证据覆盖率。
  6. 拒绝任何包含内容相关字段名的指标结构。
  7. 输出确定性的TOON优先本地指标,并明确标记数据不足状态。

Output Spec

输出规范

Trust decisions report each control, evidence, reason, and fingerprint. Metrics report only aggregate counts, statuses, retries, tokens, coverage, freshness, and input fingerprints; they never include paths, source, prompts, commands, or diffs.
信任决策报告每个控制项、证据、理由和指纹。指标仅报告聚合计数、状态、重试次数、令牌、覆盖率、新鲜度和输入指纹;绝不包含路径、源代码、提示词、命令或差异文件。

Scope Boundary

范围边界

  • Do not install, execute, publish, sign, approve, or delete packages.
  • Do not upload metrics or collect content-bearing fields.
  • Do not weaken allowed origins, capabilities, or provenance policy.
  • 不得安装、执行、发布、签名、批准或删除包。
  • 不得上传指标或收集内容相关字段。
  • 不得放宽允许的来源、能力或溯源策略。