From d808071fb55a91484e78fe40f4b64bb52815758a Mon Sep 17 00:00:00 2001 From: yaojingang Date: Sun, 14 Jun 2026 10:16:09 +0800 Subject: [PATCH] feat: govern deferred resource budget --- .../reports/context_budget.json | 11 +- .../reports/context_budget.json | 11 +- registry/index.json | 2 +- registry/packages/yao-meta-skill.json | 6 +- reports/context_budget.json | 42 ++++- reports/context_budget.md | 10 +- reports/context_budget_summary.json | 48 ++++- reports/package_verification.json | 2 +- reports/package_verification.md | 2 +- reports/registry_audit.json | 8 +- reports/registry_audit.md | 4 +- reports/review-studio.html | 18 +- reports/review-studio.json | 164 +++++++----------- reports/security_trust_report.json | 2 +- reports/security_trust_report.md | 2 +- reports/skill-overview.json | 14 +- reports/skill_os2_audit.json | 2 +- reports/skill_os2_audit.md | 2 +- reports/skill_os2_coverage.json | 2 +- reports/skill_os2_coverage.md | 2 +- reports/upgrade_check.json | 4 +- scripts/render_context_reports.py | 9 +- scripts/resource_boundary_check.py | 131 +++++++++++++- scripts/review_studio_gates.py | 3 + tests/verify_quality_checks.py | 11 ++ tests/verify_review_studio.py | 73 ++++---- 26 files changed, 387 insertions(+), 198 deletions(-) diff --git a/examples/complex-release-orchestrator/generated-skill/reports/context_budget.json b/examples/complex-release-orchestrator/generated-skill/reports/context_budget.json index d6e09de..8ef3262 100644 --- a/examples/complex-release-orchestrator/generated-skill/reports/context_budget.json +++ b/examples/complex-release-orchestrator/generated-skill/reports/context_budget.json @@ -6,9 +6,9 @@ "context_budget_tier": "production", "context_budget_limit": 1000, "skill_body_tokens": 718, - "other_text_tokens": 2113, + "other_text_tokens": 2176, "estimated_initial_load_tokens": 790, - "estimated_total_text_tokens": 2831, + "estimated_total_text_tokens": 2894, "deferred_resource_tokens": 1657, "deferred_resource_warn_threshold": 120000, "deferred_resource_dirs": [ @@ -39,6 +39,13 @@ } ], "large_deferred_resource_dirs": [], + "deferred_resource_governance": { + "status": "not-required", + "large_dir_count": 0, + "governed_large_dir_count": 0, + "directories": [], + "summary": "No large deferred resource directory exceeds the per-dir threshold." + }, "relevant_file_count": 12, "unused_resource_dirs": [], "quality_signal_points": 130, diff --git a/examples/governed-incident-command/generated-skill/reports/context_budget.json b/examples/governed-incident-command/generated-skill/reports/context_budget.json index 199f26c..41b78e9 100644 --- a/examples/governed-incident-command/generated-skill/reports/context_budget.json +++ b/examples/governed-incident-command/generated-skill/reports/context_budget.json @@ -6,9 +6,9 @@ "context_budget_tier": "production", "context_budget_limit": 1000, "skill_body_tokens": 658, - "other_text_tokens": 1770, + "other_text_tokens": 1833, "estimated_initial_load_tokens": 760, - "estimated_total_text_tokens": 2428, + "estimated_total_text_tokens": 2491, "deferred_resource_tokens": 1030, "deferred_resource_warn_threshold": 120000, "deferred_resource_dirs": [ @@ -39,6 +39,13 @@ } ], "large_deferred_resource_dirs": [], + "deferred_resource_governance": { + "status": "not-required", + "large_dir_count": 0, + "governed_large_dir_count": 0, + "directories": [], + "summary": "No large deferred resource directory exceeds the per-dir threshold." + }, "relevant_file_count": 13, "unused_resource_dirs": [], "quality_signal_points": 130, diff --git a/registry/index.json b/registry/index.json index 6f49834..4a96cfe 100644 --- a/registry/index.json +++ b/registry/index.json @@ -16,7 +16,7 @@ "vscode" ], "package_metadata": "registry/packages/yao-meta-skill.json", - "package_sha256": "0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102" + "package_sha256": "59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8" } ] } diff --git a/registry/packages/yao-meta-skill.json b/registry/packages/yao-meta-skill.json index 859eff1..be3b810 100644 --- a/registry/packages/yao-meta-skill.json +++ b/registry/packages/yao-meta-skill.json @@ -16,8 +16,8 @@ "trust_level": "local", "license": "MIT", "checksums": { - "package_sha256": "0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102", - "archive_sha256": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7" + "package_sha256": "59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8", + "archive_sha256": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576" }, "compatibility": { "openai": "pass", @@ -48,7 +48,7 @@ }, "distribution": { "archive_verified": true, - "archive_sha256": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7", + "archive_sha256": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576", "package_verification": "reports/package_verification.json", "install_simulated": true, "install_simulation": "reports/install_simulation.json" diff --git a/reports/context_budget.json b/reports/context_budget.json index b7533ab..ab0abb1 100644 --- a/reports/context_budget.json +++ b/reports/context_budget.json @@ -1,22 +1,20 @@ { "ok": true, "failures": [], - "warnings": [ - "Deferred resource footprint is high: 382073 estimated tokens across references/scripts/evals. Keep Review Studio warnings visible until the largest resource dirs are split, archived, or justified." - ], + "warnings": [], "stats": { "context_budget_tier": "production", "context_budget_limit": 1000, "skill_body_tokens": 751, - "other_text_tokens": 1188506, + "other_text_tokens": 1190325, "estimated_initial_load_tokens": 944, - "estimated_total_text_tokens": 1189257, - "deferred_resource_tokens": 382073, + "estimated_total_text_tokens": 1191076, + "deferred_resource_tokens": 383511, "deferred_resource_warn_threshold": 120000, "deferred_resource_dirs": [ { "path": "scripts", - "estimated_tokens": 334590, + "estimated_tokens": 336028, "file_count": 96 }, { @@ -33,11 +31,37 @@ "large_deferred_resource_dirs": [ { "path": "scripts", - "estimated_tokens": 334590, + "estimated_tokens": 336028, "file_count": 96 } ], - "relevant_file_count": 502, + "deferred_resource_governance": { + "status": "governed", + "large_dir_count": 1, + "governed_large_dir_count": 1, + "directories": [ + { + "status": "governed", + "evidence": [ + "reports/security_trust_report.json", + "reports/architecture_maintainability.json", + "reports/python_compatibility.json" + ], + "reasons": [ + "trust report covers scripts", + "architecture report has no script hotspots or blockers", + "Python compatibility report has no issues" + ], + "missing": [], + "path": "scripts", + "estimated_tokens": 336028, + "file_count": 96, + "rationale": "Script resources are deterministic deferred tools, not initial-load prompt context." + } + ], + "summary": "Large deferred resources are indexed and backed by evidence." + }, + "relevant_file_count": 504, "unused_resource_dirs": [], "quality_signal_points": 130, "quality_density": 137.7 diff --git a/reports/context_budget.md b/reports/context_budget.md index 97f82ff..c4b82e9 100644 --- a/reports/context_budget.md +++ b/reports/context_budget.md @@ -1,9 +1,9 @@ # Context Budget Summary -| Target | Path | Tier | Limit | Initial | SKILL | Deferred | Large Deferred Dirs | Quality Density | Unused Dirs | Status | -| --- | --- | --- | ---: | ---: | ---: | ---: | --- | ---: | --- | --- | -| root | `.` | `production` | 1000 | 944 | 751 | 382073 | scripts:334590 | 137.7 | - | ok | -| complex-release-orchestrator | `examples/complex-release-orchestrator/generated-skill` | `production` | 1000 | 790 | 718 | 1657 | - | 164.6 | - | ok | -| governed-incident-command | `examples/governed-incident-command/generated-skill` | `production` | 1000 | 760 | 658 | 1030 | - | 171.1 | - | ok | +| Target | Path | Tier | Limit | Initial | SKILL | Deferred | Resource Governance | Large Deferred Dirs | Quality Density | Unused Dirs | Status | +| --- | --- | --- | ---: | ---: | ---: | ---: | --- | --- | ---: | --- | --- | +| root | `.` | `production` | 1000 | 944 | 751 | 383511 | `governed` | scripts:336028 | 137.7 | - | ok | +| complex-release-orchestrator | `examples/complex-release-orchestrator/generated-skill` | `production` | 1000 | 790 | 718 | 1657 | `not-required` | - | 164.6 | - | ok | +| governed-incident-command | `examples/governed-incident-command/generated-skill` | `production` | 1000 | 760 | 658 | 1030 | `not-required` | - | 171.1 | - | ok | Per-target JSON reports are written beside each target and under `reports/`. diff --git a/reports/context_budget_summary.json b/reports/context_budget_summary.json index 2ac20b8..e25fd55 100644 --- a/reports/context_budget_summary.json +++ b/reports/context_budget_summary.json @@ -8,20 +8,44 @@ "budget_limit": 1000, "initial_tokens": 944, "skill_body_tokens": 751, - "deferred_resource_tokens": 382073, + "deferred_resource_tokens": 383511, "large_deferred_resource_dirs": [ { "path": "scripts", - "estimated_tokens": 334590, + "estimated_tokens": 336028, "file_count": 96 } ], + "deferred_resource_governance": { + "status": "governed", + "large_dir_count": 1, + "governed_large_dir_count": 1, + "directories": [ + { + "status": "governed", + "evidence": [ + "reports/security_trust_report.json", + "reports/architecture_maintainability.json", + "reports/python_compatibility.json" + ], + "reasons": [ + "trust report covers scripts", + "architecture report has no script hotspots or blockers", + "Python compatibility report has no issues" + ], + "missing": [], + "path": "scripts", + "estimated_tokens": 336028, + "file_count": 96, + "rationale": "Script resources are deterministic deferred tools, not initial-load prompt context." + } + ], + "summary": "Large deferred resources are indexed and backed by evidence." + }, "quality_density": 137.7, "unused_resource_dirs": [], "ok": true, - "warnings": [ - "Deferred resource footprint is high: 382073 estimated tokens across references/scripts/evals. Keep Review Studio warnings visible until the largest resource dirs are split, archived, or justified." - ] + "warnings": [] }, { "label": "complex-release-orchestrator", @@ -32,6 +56,13 @@ "skill_body_tokens": 718, "deferred_resource_tokens": 1657, "large_deferred_resource_dirs": [], + "deferred_resource_governance": { + "status": "not-required", + "large_dir_count": 0, + "governed_large_dir_count": 0, + "directories": [], + "summary": "No large deferred resource directory exceeds the per-dir threshold." + }, "quality_density": 164.6, "unused_resource_dirs": [], "ok": true, @@ -46,6 +77,13 @@ "skill_body_tokens": 658, "deferred_resource_tokens": 1030, "large_deferred_resource_dirs": [], + "deferred_resource_governance": { + "status": "not-required", + "large_dir_count": 0, + "governed_large_dir_count": 0, + "directories": [], + "summary": "No large deferred resource directory exceeds the per-dir threshold." + }, "quality_density": 171.1, "unused_resource_dirs": [], "ok": true, diff --git a/reports/package_verification.json b/reports/package_verification.json index fa82385..f221708 100644 --- a/reports/package_verification.json +++ b/reports/package_verification.json @@ -8,7 +8,7 @@ "target_count": 4, "adapter_count": 4, "archive_present": true, - "archive_sha256": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7", + "archive_sha256": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576", "archive_entry_count": 575, "failure_count": 0, "warning_count": 0 diff --git a/reports/package_verification.md b/reports/package_verification.md index 7a1cf8f..4bd2d34 100644 --- a/reports/package_verification.md +++ b/reports/package_verification.md @@ -4,7 +4,7 @@ - Package directory: `dist` - Targets: `4 / 4` adapters present - Archive present: `True` -- Archive SHA256: `05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7` +- Archive SHA256: `5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576` - Failures: `0` - Warnings: `0` diff --git a/reports/registry_audit.json b/reports/registry_audit.json index b2eca02..53a1f61 100644 --- a/reports/registry_audit.json +++ b/reports/registry_audit.json @@ -21,8 +21,8 @@ "trust_level": "local", "license": "MIT", "checksums": { - "package_sha256": "0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102", - "archive_sha256": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7" + "package_sha256": "59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8", + "archive_sha256": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576" }, "compatibility": { "openai": "pass", @@ -53,7 +53,7 @@ }, "distribution": { "archive_verified": true, - "archive_sha256": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7", + "archive_sha256": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576", "package_verification": "reports/package_verification.json", "install_simulated": true, "install_simulation": "reports/install_simulation.json" @@ -78,7 +78,7 @@ "vscode" ], "package_metadata": "registry/packages/yao-meta-skill.json", - "package_sha256": "0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102" + "package_sha256": "59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8" } ] }, diff --git a/reports/registry_audit.md b/reports/registry_audit.md index dcfe94c..654abf2 100644 --- a/reports/registry_audit.md +++ b/reports/registry_audit.md @@ -6,8 +6,8 @@ - Maturity: `governed` - Owner: `Yao Team` - License: `MIT` -- Package SHA256: `0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102` -- Archive SHA256: `05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7` +- Package SHA256: `59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8` +- Archive SHA256: `5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576` - Install simulated: `True` ## Compatibility diff --git a/reports/review-studio.html b/reports/review-studio.html index 9a6b664..47d5c21 100644 --- a/reports/review-studio.html +++ b/reports/review-studio.html @@ -428,7 +428,7 @@
审查结论 review - Score 89/100 + Score 91/100
@@ -439,17 +439,17 @@

审查闸门

-
通过

意图画布

intent confidence 100/100; Intent is clear enough to package the first routeable version.

reports/intent-confidence.json 证据
通过

触发实验

13 trigger cases; 0 misroutes; 0 ambiguous

reports/route_scorecard.json 证据
关注

输出实验

5/5 cases; with-skill 100.0; baseline 0.0; file-backed 1; near-neighbor 1; blind A/B 5; exec 10; command 10; model 0; recorded 0; reviewed 0/5; review pending 5

reports/output_quality_scorecard.json 证据
关注

上下文

initial load 944/1000; deferred 382073/120000; top deferred scripts 334590; quality density 137.7

reports/context_budget.json 证据
通过

运行矩阵

5 / 5 targets pass

reports/conformance_matrix.json 证据
通过

信任报告

0 secrets; 96 scripts; 3 network-capable scripts; 0 help smoke failures

reports/security_trust_report.json 证据
通过

Python 兼容

Python 3.11; 158 files; 0 compatibility issues; 0 syntax; 0 f-string 3.11 hazards

reports/python_compatibility.json 证据
通过

架构维护

155 Python files; 0 hotspots; 0 blockers; largest 888 lines; 34 CLI handlers

reports/architecture_maintainability.json 证据
通过

权限批准

3/3 permissions approved; gaps 0; required file_write, network, subprocess

reports/security_trust_report.json + security/permission_policy.json 证据
通过

权限探针

4/4 targets probed; native 0; metadata fallback 4; installer 4; residual risks 4

reports/runtime_permission_probes.json 证据
通过

组合治理

12 skills, 1 actionable; 0 actionable route collisions; 0 actionable owner gaps; 0 actionable stale; 0 actionable drift; 24 scoped non-actionable issues

reports/skill_atlas.json 证据
通过

运营回路

1 metadata events; adoption 100.0; missed 0; bad-output 0; risk low

reports/adoption_drift_report.json 证据
关注

人工批准

0 active waivers; 2 warning gates still need reviewer decision

reports/review_waivers.json 证据
关注

世界证据

4 pending world-class evidence entries; 1 human pending; 3 external pending; overclaim guard true

reports/world_class_evidence_ledger.json 证据
通过

注册审计

yao-meta-skill 1.1.0; 6/6 compatibility entries pass; install pass with 4 adapters; installer permissions 12 enforced / 0 failures

reports/registry_audit.json + reports/install_simulation.json 证据
通过

发布路线

0 promote; 3 keep current; 0 blocked; upgrade minor declared / minor recommended

reports/promotion_decisions.json + reports/upgrade_check.json + docs/migration-v2.md 证据
+
通过

意图画布

intent confidence 100/100; Intent is clear enough to package the first routeable version.

reports/intent-confidence.json 证据
通过

触发实验

13 trigger cases; 0 misroutes; 0 ambiguous

reports/route_scorecard.json 证据
关注

输出实验

5/5 cases; with-skill 100.0; baseline 0.0; file-backed 1; near-neighbor 1; blind A/B 5; exec 10; command 10; model 0; recorded 0; reviewed 0/5; review pending 5

reports/output_quality_scorecard.json 证据
通过

上下文

initial load 944/1000; deferred 383511/120000; top deferred scripts 336028; resource governance governed; quality density 137.7

reports/context_budget.json 证据
通过

运行矩阵

5 / 5 targets pass

reports/conformance_matrix.json 证据
通过

信任报告

0 secrets; 96 scripts; 3 network-capable scripts; 0 help smoke failures

reports/security_trust_report.json 证据
通过

Python 兼容

Python 3.11; 158 files; 0 compatibility issues; 0 syntax; 0 f-string 3.11 hazards

reports/python_compatibility.json 证据
通过

架构维护

155 Python files; 0 hotspots; 0 blockers; largest 888 lines; 34 CLI handlers

reports/architecture_maintainability.json 证据
通过

权限批准

3/3 permissions approved; gaps 0; required file_write, network, subprocess

reports/security_trust_report.json + security/permission_policy.json 证据
通过

权限探针

4/4 targets probed; native 0; metadata fallback 4; installer 4; residual risks 4

reports/runtime_permission_probes.json 证据
通过

组合治理

12 skills, 1 actionable; 0 actionable route collisions; 0 actionable owner gaps; 0 actionable stale; 0 actionable drift; 24 scoped non-actionable issues

reports/skill_atlas.json 证据
通过

运营回路

1 metadata events; adoption 100.0; missed 0; bad-output 0; risk low

reports/adoption_drift_report.json 证据
关注

人工批准

0 active waivers; 1 warning gates still need reviewer decision

reports/review_waivers.json 证据
关注

世界证据

4 pending world-class evidence entries; 1 human pending; 3 external pending; overclaim guard true

reports/world_class_evidence_ledger.json 证据
通过

注册审计

yao-meta-skill 1.1.0; 6/6 compatibility entries pass; install pass with 4 adapters; installer permissions 12 enforced / 0 failures

reports/registry_audit.json + reports/install_simulation.json 证据
通过

发布路线

0 promote; 3 keep current; 0 blocked; upgrade minor declared / minor recommended

reports/promotion_decisions.json + reports/upgrade_check.json + docs/migration-v2.md 证据

阻断事项

无。

-

关注事项

  • 输出实验5/5 cases; with-skill 100.0; baseline 0.0; file-backed 1; near-neighbor 1; blind A/B 5; exec 10; command 10; model 0; recorded 0; reviewed 0/5; review pending 5
  • 上下文initial load 944/1000; deferred 382073/120000; top deferred scripts 334590; quality density 137.7
  • 人工批准0 active waivers; 2 warning gates still need reviewer decision
  • 世界证据4 pending world-class evidence entries; 1 human pending; 3 external pending; overclaim guard true
+

关注事项

  • 输出实验5/5 cases; with-skill 100.0; baseline 0.0; file-backed 1; near-neighbor 1; blind A/B 5; exec 10; command 10; model 0; recorded 0; reviewed 0/5; review pending 5
  • 人工批准0 active waivers; 1 warning gates still need reviewer decision
  • 世界证据4 pending world-class evidence entries; 1 human pending; 3 external pending; overclaim guard true

修复动作

-
关注

输出实验

补足 output eval 覆盖、execution evidence、blind A/B 和 reviewer adjudication。

没有输出质量和人工盲评证据时,Skill 只能证明会触发,不能证明输出真的更好且经得起审查。
修复位置
evals/output/cases.jsonl + reports/output_quality_scorecard.md + reports/output_review_kit.html + reports/output_review_adjudication.md
验证命令
python3 scripts/adjudicate_output_review.py --write-template && python3 scripts/yao.py output-review
关注

上下文

压缩或拆分高成本 deferred resources,保留最小可路由上下文。

初始加载可以安全,但后续 references、scripts、evals 体量过大时,reviewer 仍需要看到维护和读取成本。
修复位置
SKILL.md + references/ + scripts/ + evals/
验证命令
python3 scripts/render_context_reports.py
关注

人工批准

对保留的 warning 写入 reviewer、理由、范围和到期时间,或修掉 warning。

warning 可以被接受,但必须可审计、会过期,并且不能掩盖 blocker。
修复位置
reports/review_waivers.md
验证命令
python3 scripts/render_review_waivers.py .
关注

世界证据

补齐 provider、真人盲评、原生权限执行和真实客户端遥测证据,或明确本次发布不声明 world-class 完成。

世界级结论必须来自已接受的外部/人工证据;计划、metadata fallback、待评审和本地命令都不能替代完成证据。
修复位置
reports/world_class_operator_runbook.html + reports/world_class_evidence_ledger.md + reports/world_class_evidence_intake.md + reports/world_class_submission_review.md
验证命令
python3 scripts/yao.py world-class-runbook . && python3 scripts/yao.py world-class-ledger . && python3 scripts/yao.py review-studio .
+
关注

输出实验

补足 output eval 覆盖、execution evidence、blind A/B 和 reviewer adjudication。

没有输出质量和人工盲评证据时,Skill 只能证明会触发,不能证明输出真的更好且经得起审查。
修复位置
evals/output/cases.jsonl + reports/output_quality_scorecard.md + reports/output_review_kit.html + reports/output_review_adjudication.md
验证命令
python3 scripts/adjudicate_output_review.py --write-template && python3 scripts/yao.py output-review
关注

人工批准

对保留的 warning 写入 reviewer、理由、范围和到期时间,或修掉 warning。

warning 可以被接受,但必须可审计、会过期,并且不能掩盖 blocker。
修复位置
reports/review_waivers.md
验证命令
python3 scripts/render_review_waivers.py .
关注

世界证据

补齐 provider、真人盲评、原生权限执行和真实客户端遥测证据,或明确本次发布不声明 world-class 完成。

世界级结论必须来自已接受的外部/人工证据;计划、metadata fallback、待评审和本地命令都不能替代完成证据。
修复位置
reports/world_class_operator_runbook.html + reports/world_class_evidence_ledger.md + reports/world_class_evidence_intake.md + reports/world_class_submission_review.md
验证命令
python3 scripts/yao.py world-class-runbook . && python3 scripts/yao.py world-class-ledger . && python3 scripts/yao.py review-studio .
@@ -501,12 +501,12 @@
-

上下文

initial load 944/1000; deferred 382073/120000; top deferred scripts 334590; quality density 137.7

+

上下文

initial load 944/1000; deferred 383511/120000; top deferred scripts 336028; resource governance governed; quality density 137.7

编译证据

Review reports/compiled_targets.md before packaging to inspect target adapter modes, generated files, preserved semantics, warnings, and unsupported features.

-

信任报告

Secret
0
脚本数
96
网络脚本
3
Help 失败
0
包体哈希
0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102
+

信任报告

Secret
0
脚本数
96
网络脚本
3
Help 失败
0
包体哈希
59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8

安全边界

高风险 secret、远程 inline execution、缺失依赖策略或无法解释的脚本接口应阻断 governed release。

@@ -536,7 +536,7 @@
-

人工批准

0 active waivers; 2 warning gates still need reviewer decision

+

人工批准

0 active waivers; 1 warning gates still need reviewer decision

批准台账

Waiver Count
0
Active Count
0
Expired Count
0
Invalid Count
0
覆盖 Gate
0
@@ -574,12 +574,12 @@

注册审计

yao-meta-skill 1.1.0; 6/6 compatibility entries pass; install pass with 4 adapters; installer permissions 12 enforced / 0 failures

-

包体元数据

名称
yao-meta-skill
版本
1.1.0
Maturity
governed
Owner
Yao Team
License
MIT
信任级别
local
目标平台
openai, claude, generic, agent-skills-compatible, vscode
兼容通过
6/6
归档哈希
05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7
+

包体元数据

名称
yao-meta-skill
版本
1.1.0
Maturity
governed
Owner
Yao Team
License
MIT
信任级别
local
目标平台
openai, claude, generic, agent-skills-compatible, vscode
兼容通过
6/6
归档哈希
5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576

发布路线

0 promote; 3 keep current; 0 blocked; upgrade minor declared / minor recommended

-

包体验证

目标数
4
Adapter
4
归档存在
Zip 条目
575
失败数
0
警告数
0
归档哈希
05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7
+

包体验证

目标数
4
Adapter
4
归档存在
Zip 条目
575
失败数
0
警告数
0
归档哈希
5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576
diff --git a/reports/review-studio.json b/reports/review-studio.json index 2b68d6d..09276bc 100644 --- a/reports/review-studio.json +++ b/reports/review-studio.json @@ -4,11 +4,11 @@ "skill_dir": ".", "summary": { "decision": "review", - "world_class_score": 89, + "world_class_score": 91, "gate_count": 16, "blocker_count": 0, - "warning_count": 4, - "action_count": 4, + "warning_count": 3, + "action_count": 3, "annotation_count": 0, "open_annotation_count": 0, "open_annotation_blocker_count": 0, @@ -42,8 +42,8 @@ { "key": "context-budget", "label": "上下文", - "status": "warn", - "detail": "initial load 944/1000; deferred 382073/120000; top deferred scripts 334590; quality density 137.7", + "status": "pass", + "detail": "initial load 944/1000; deferred 383511/120000; top deferred scripts 336028; resource governance governed; quality density 137.7", "evidence": "reports/context_budget.json", "link": "context_budget.md" }, @@ -115,7 +115,7 @@ "key": "review-waivers", "label": "人工批准", "status": "warn", - "detail": "0 active waivers; 2 warning gates still need reviewer decision", + "detail": "0 active waivers; 1 warning gates still need reviewer decision", "evidence": "reports/review_waivers.json", "link": "review_waivers.md" }, @@ -154,19 +154,11 @@ "evidence": "reports/output_quality_scorecard.json", "link": "output_quality_scorecard.md" }, - { - "key": "context-budget", - "label": "上下文", - "status": "warn", - "detail": "initial load 944/1000; deferred 382073/120000; top deferred scripts 334590; quality density 137.7", - "evidence": "reports/context_budget.json", - "link": "context_budget.md" - }, { "key": "review-waivers", "label": "人工批准", "status": "warn", - "detail": "0 active waivers; 2 warning gates still need reviewer decision", + "detail": "0 active waivers; 1 warning gates still need reviewer decision", "evidence": "reports/review_waivers.json", "link": "review_waivers.md" }, @@ -242,52 +234,6 @@ "evidence_link": "output_quality_scorecard.md", "verification_command": "python3 scripts/adjudicate_output_review.py --write-template && python3 scripts/yao.py output-review" }, - { - "gate_key": "context-budget", - "label": "上下文", - "status": "warn", - "priority": "warning", - "summary": "压缩或拆分高成本 deferred resources,保留最小可路由上下文。", - "why": "初始加载可以安全,但后续 references、scripts、evals 体量过大时,reviewer 仍需要看到维护和读取成本。", - "source_fix": "SKILL.md + references/ + scripts/ + evals/", - "source_refs": [ - { - "path": "SKILL.md", - "label": "entrypoint", - "kind": "source", - "line": 9, - "exists": true, - "link": "../SKILL.md" - }, - { - "path": "reports/context_budget.md", - "label": "context budget", - "kind": "report", - "line": 1, - "exists": true, - "link": "context_budget.md" - }, - { - "path": "scripts/resource_boundary_check.py", - "label": "resource boundary checker", - "kind": "source", - "line": 44, - "exists": true, - "link": "../scripts/resource_boundary_check.py" - }, - { - "path": "references/skill-engineering-method.md", - "label": "skill engineering method", - "kind": "method", - "line": 208, - "exists": true, - "link": "../references/skill-engineering-method.md" - } - ], - "evidence": "reports/context_budget.json", - "evidence_link": "context_budget.md", - "verification_command": "python3 scripts/render_context_reports.py" - }, { "gate_key": "review-waivers", "label": "人工批准", @@ -1514,7 +1460,7 @@ "interactive_script_count": 0, "package_hash_scope": "source-contract-without-generated-reports", "package_hash_file_count": 180, - "package_sha256": "0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102" + "package_sha256": "59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8" }, "skill_atlas": { "skill_count": 12, @@ -1552,8 +1498,8 @@ "trust_level": "local", "license": "MIT", "checksums": { - "package_sha256": "0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102", - "archive_sha256": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7" + "package_sha256": "59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8", + "archive_sha256": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576" }, "compatibility": { "openai": "pass", @@ -1584,7 +1530,7 @@ }, "distribution": { "archive_verified": true, - "archive_sha256": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7", + "archive_sha256": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576", "package_verification": "reports/package_verification.json", "install_simulated": true, "install_simulation": "reports/install_simulation.json" @@ -1600,7 +1546,7 @@ "target_count": 4, "adapter_count": 4, "archive_present": true, - "archive_sha256": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7", + "archive_sha256": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576", "archive_entry_count": 575, "failure_count": 0, "warning_count": 0 @@ -1679,12 +1625,12 @@ { "field": "archive_sha256", "from": "", - "to": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7" + "to": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576" }, { "field": "package_sha256", "from": "0000000000000000000000000000000000000000000000000000000000000000", - "to": "0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102" + "to": "59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8" } ] }, @@ -3863,7 +3809,7 @@ "execution_mode": "command", "model_executed": false, "command_executed": true, - "duration_ms": 30.68, + "duration_ms": 31.91, "provider": "local-output-eval-runner", "model": "", "usage": { @@ -3891,7 +3837,7 @@ "execution_mode": "command", "model_executed": false, "command_executed": true, - "duration_ms": 28.53, + "duration_ms": 31.46, "provider": "local-output-eval-runner", "model": "", "usage": { @@ -3914,7 +3860,7 @@ "execution_mode": "command", "model_executed": false, "command_executed": true, - "duration_ms": 29.59, + "duration_ms": 31.55, "provider": "local-output-eval-runner", "model": "", "usage": { @@ -3942,7 +3888,7 @@ "execution_mode": "command", "model_executed": false, "command_executed": true, - "duration_ms": 31.84, + "duration_ms": 31.52, "provider": "local-output-eval-runner", "model": "", "usage": { @@ -3965,7 +3911,7 @@ "execution_mode": "command", "model_executed": false, "command_executed": true, - "duration_ms": 30.95, + "duration_ms": 31.58, "provider": "local-output-eval-runner", "model": "", "usage": { @@ -3993,7 +3939,7 @@ "execution_mode": "command", "model_executed": false, "command_executed": true, - "duration_ms": 27.6, + "duration_ms": 31.11, "provider": "local-output-eval-runner", "model": "", "usage": { @@ -4016,7 +3962,7 @@ "execution_mode": "command", "model_executed": false, "command_executed": true, - "duration_ms": 26.76, + "duration_ms": 30.98, "provider": "local-output-eval-runner", "model": "", "usage": { @@ -4043,7 +3989,7 @@ "execution_mode": "command", "model_executed": false, "command_executed": true, - "duration_ms": 26.87, + "duration_ms": 30.56, "provider": "local-output-eval-runner", "model": "", "usage": { @@ -4066,7 +4012,7 @@ "execution_mode": "command", "model_executed": false, "command_executed": true, - "duration_ms": 26.9, + "duration_ms": 31.13, "provider": "local-output-eval-runner", "model": "", "usage": { @@ -4095,7 +4041,7 @@ "execution_mode": "command", "model_executed": false, "command_executed": true, - "duration_ms": 27.3, + "duration_ms": 31.4, "provider": "local-output-eval-runner", "model": "", "usage": { @@ -5050,7 +4996,7 @@ "label": "Review Studio", "status": "pass", "objective": "One HTML page supports first-pass production review across trigger, output, runtime, trust, release, and evidence actions.", - "current": "16 gates; decision review; warnings 4", + "current": "16 gates; decision review; warnings 3", "command": "python3 scripts/yao.py review-studio .", "test": "python3 tests/verify_review_studio.py", "evidence": [ @@ -10311,7 +10257,7 @@ "interactive_script_count": 0, "package_hash_scope": "source-contract-without-generated-reports", "package_hash_file_count": 180, - "package_sha256": "0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102" + "package_sha256": "59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8" }, "failures": [], "warnings": [], @@ -13836,22 +13782,20 @@ "context_budget": { "ok": true, "failures": [], - "warnings": [ - "Deferred resource footprint is high: 382073 estimated tokens across references/scripts/evals. Keep Review Studio warnings visible until the largest resource dirs are split, archived, or justified." - ], + "warnings": [], "stats": { "context_budget_tier": "production", "context_budget_limit": 1000, "skill_body_tokens": 751, - "other_text_tokens": 1188506, + "other_text_tokens": 1190325, "estimated_initial_load_tokens": 944, - "estimated_total_text_tokens": 1189257, - "deferred_resource_tokens": 382073, + "estimated_total_text_tokens": 1191076, + "deferred_resource_tokens": 383511, "deferred_resource_warn_threshold": 120000, "deferred_resource_dirs": [ { "path": "scripts", - "estimated_tokens": 334590, + "estimated_tokens": 336028, "file_count": 96 }, { @@ -13868,11 +13812,37 @@ "large_deferred_resource_dirs": [ { "path": "scripts", - "estimated_tokens": 334590, + "estimated_tokens": 336028, "file_count": 96 } ], - "relevant_file_count": 502, + "deferred_resource_governance": { + "status": "governed", + "large_dir_count": 1, + "governed_large_dir_count": 1, + "directories": [ + { + "status": "governed", + "evidence": [ + "reports/security_trust_report.json", + "reports/architecture_maintainability.json", + "reports/python_compatibility.json" + ], + "reasons": [ + "trust report covers scripts", + "architecture report has no script hotspots or blockers", + "Python compatibility report has no issues" + ], + "missing": [], + "path": "scripts", + "estimated_tokens": 336028, + "file_count": 96, + "rationale": "Script resources are deterministic deferred tools, not initial-load prompt context." + } + ], + "summary": "Large deferred resources are indexed and backed by evidence." + }, + "relevant_file_count": 504, "unused_resource_dirs": [], "quality_signal_points": 130, "quality_density": 137.7 @@ -15727,7 +15697,7 @@ "adoption_drift": { "ok": true, "schema_version": "2.0", - "generated_at": "2026-06-14T00:52:22Z", + "generated_at": "2026-06-14T02:13:52Z", "skill_dir": ".", "privacy_contract": { "storage": "local-first", @@ -17344,8 +17314,8 @@ "trust_level": "local", "license": "MIT", "checksums": { - "package_sha256": "0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102", - "archive_sha256": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7" + "package_sha256": "59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8", + "archive_sha256": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576" }, "compatibility": { "openai": "pass", @@ -17376,7 +17346,7 @@ }, "distribution": { "archive_verified": true, - "archive_sha256": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7", + "archive_sha256": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576", "package_verification": "reports/package_verification.json", "install_simulated": true, "install_simulation": "reports/install_simulation.json" @@ -17401,7 +17371,7 @@ "vscode" ], "package_metadata": "registry/packages/yao-meta-skill.json", - "package_sha256": "0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102" + "package_sha256": "59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8" } ] }, @@ -17424,7 +17394,7 @@ "target_count": 4, "adapter_count": 4, "archive_present": true, - "archive_sha256": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7", + "archive_sha256": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576", "archive_entry_count": 575, "failure_count": 0, "warning_count": 0 @@ -18432,12 +18402,12 @@ { "field": "archive_sha256", "from": "", - "to": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7" + "to": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576" }, { "field": "package_sha256", "from": "0000000000000000000000000000000000000000000000000000000000000000", - "to": "0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102" + "to": "59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8" } ] }, diff --git a/reports/security_trust_report.json b/reports/security_trust_report.json index 44022bd..c9d50de 100644 --- a/reports/security_trust_report.json +++ b/reports/security_trust_report.json @@ -23,7 +23,7 @@ "interactive_script_count": 0, "package_hash_scope": "source-contract-without-generated-reports", "package_hash_file_count": 180, - "package_sha256": "0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102" + "package_sha256": "59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8" }, "failures": [], "warnings": [], diff --git a/reports/security_trust_report.md b/reports/security_trust_report.md index b94e1df..56e1ba5 100644 --- a/reports/security_trust_report.md +++ b/reports/security_trust_report.md @@ -16,7 +16,7 @@ - Interactive scripts: `0` - Package hash scope: `source-contract-without-generated-reports` - Package hash files: `180` -- Package SHA256: `0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102` +- Package SHA256: `59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8` ## Failures diff --git a/reports/skill-overview.json b/reports/skill-overview.json index e156afd..7b61464 100644 --- a/reports/skill-overview.json +++ b/reports/skill-overview.json @@ -1046,7 +1046,7 @@ "interactive_script_count": 0, "package_hash_scope": "source-contract-without-generated-reports", "package_hash_file_count": 180, - "package_sha256": "0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102" + "package_sha256": "59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8" }, "skill_atlas": { "skill_count": 12, @@ -1084,8 +1084,8 @@ "trust_level": "local", "license": "MIT", "checksums": { - "package_sha256": "0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102", - "archive_sha256": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7" + "package_sha256": "59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8", + "archive_sha256": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576" }, "compatibility": { "openai": "pass", @@ -1116,7 +1116,7 @@ }, "distribution": { "archive_verified": true, - "archive_sha256": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7", + "archive_sha256": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576", "package_verification": "reports/package_verification.json", "install_simulated": true, "install_simulation": "reports/install_simulation.json" @@ -1132,7 +1132,7 @@ "target_count": 4, "adapter_count": 4, "archive_present": true, - "archive_sha256": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7", + "archive_sha256": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576", "archive_entry_count": 575, "failure_count": 0, "warning_count": 0 @@ -1211,12 +1211,12 @@ { "field": "archive_sha256", "from": "", - "to": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7" + "to": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576" }, { "field": "package_sha256", "from": "0000000000000000000000000000000000000000000000000000000000000000", - "to": "0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102" + "to": "59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8" } ] }, diff --git a/reports/skill_os2_audit.json b/reports/skill_os2_audit.json index f5a33cb..b27281a 100644 --- a/reports/skill_os2_audit.json +++ b/reports/skill_os2_audit.json @@ -307,7 +307,7 @@ "key": "review-studio", "label": "Review Studio", "status": "pass", - "current": "decision review; warnings 4; score 89", + "current": "decision review; warnings 3; score 91", "target": "One page shows gates, evidence paths, blockers, warnings, actions, waivers, and annotations", "evidence": [ { diff --git a/reports/skill_os2_audit.md b/reports/skill_os2_audit.md index b7cefd6..b44f226 100644 --- a/reports/skill_os2_audit.md +++ b/reports/skill_os2_audit.md @@ -28,7 +28,7 @@ Generated at: `2026-06-14` | Native Permission Enforcement | external-required | native-enforced targets 0; installer-enforced targets 4 | At least one target/client enforces approved permissions at runtime | Integrate a real target-client or external installer runtime guard before claiming native permission enforcement. | | Skill Atlas | pass | 12 skills; actionable collisions 0 | Workspace catalog, route overlap, stale/owner gaps, drift, and no-route opportunities | Feed real drift data into Atlas once client telemetry is installed. | | Registry Distribution | pass | zip entries 575; install failures 0; permission failures 0 | Package metadata, archive checksum, package verification, and install simulation pass | Regenerate registry after package verification so checksums stay aligned. | -| Review Studio | pass | decision review; warnings 4; score 89 | One page shows gates, evidence paths, blockers, warnings, actions, waivers, and annotations | Resolve human/external warning gates before claiming full release readiness. | +| Review Studio | pass | decision review; warnings 3; score 91 | One page shows gates, evidence paths, blockers, warnings, actions, waivers, and annotations | Resolve human/external warning gates before claiming full release readiness. | | Telemetry Drift | pass | events 1; risk low; recipes 5 | Local-first metadata-only event contract, aggregate drift report, hook recipes, and import path | Keep raw JSONL out of distributed packages and use aggregate reports for Atlas. | | Native Client Telemetry | external-required | external source events 0; adoption samples 1 | A real Browser/Chrome/provider client sends production metadata events | Install a real client against the native host and import production metadata-only events. | diff --git a/reports/skill_os2_coverage.json b/reports/skill_os2_coverage.json index fe47a51..5c83495 100644 --- a/reports/skill_os2_coverage.json +++ b/reports/skill_os2_coverage.json @@ -237,7 +237,7 @@ "label": "Review Studio", "status": "pass", "objective": "One HTML page supports first-pass production review across trigger, output, runtime, trust, release, and evidence actions.", - "current": "16 gates; decision review; warnings 4", + "current": "16 gates; decision review; warnings 3", "command": "python3 scripts/yao.py review-studio .", "test": "python3 tests/verify_review_studio.py", "evidence": [ diff --git a/reports/skill_os2_coverage.md b/reports/skill_os2_coverage.md index 4b2d183..b4de84b 100644 --- a/reports/skill_os2_coverage.md +++ b/reports/skill_os2_coverage.md @@ -24,7 +24,7 @@ This report maps the Skill OS 2.0 upgrade blueprint to concrete local artifacts, | Trust Security | `pass` | 96 scripts; secrets 0; help failures 0 | `python3 scripts/yao.py trust .` | `python3 tests/verify_trust_check.py` | | Skill Atlas | `pass` | 12 scanned skills; actionable collisions 0 | `python3 scripts/yao.py skill-atlas --workspace-root .` | `python3 tests/verify_skill_atlas.py` | | Registry Distribution | `pass` | archive entries 575; install failures 0 | `python3 scripts/yao.py package . --platform openai --platform claude --platform generic --platform vscode --output-dir dist --zip && python3 scripts/yao.py registry-audit .` | `python3 tests/verify_registry_audit.py` | -| Review Studio | `pass` | 16 gates; decision review; warnings 4 | `python3 scripts/yao.py review-studio .` | `python3 tests/verify_review_studio.py` | +| Review Studio | `pass` | 16 gates; decision review; warnings 3 | `python3 scripts/yao.py review-studio .` | `python3 tests/verify_review_studio.py` | | Telemetry Drift | `pass` | events 1; recipes 5; risk low | `python3 scripts/yao.py telemetry-hooks . && python3 scripts/yao.py adoption-drift .` | `python3 tests/verify_telemetry_hooks.py` | ## Recommended PR Coverage diff --git a/reports/upgrade_check.json b/reports/upgrade_check.json index 9eec353..e02d987 100644 --- a/reports/upgrade_check.json +++ b/reports/upgrade_check.json @@ -70,12 +70,12 @@ { "field": "archive_sha256", "from": "", - "to": "05019e918bf5d80388fc5be41e68b91f492ceeb64c96b9f0974a2de160b0bbf7" + "to": "5f3d7a018d80277336598d3bf78c546f37a301c0e4d8be6691a9f8de349c6576" }, { "field": "package_sha256", "from": "0000000000000000000000000000000000000000000000000000000000000000", - "to": "0bfa15bdf8bc3feff98ee0e66dcdac3f0bc9565aede9c6c0ca139e6a07a9d102" + "to": "59b0f65b269be1bcd9b8ab46997136fd5c19da796d0797702fb6a0dc96274cb8" } ] }, diff --git a/scripts/render_context_reports.py b/scripts/render_context_reports.py index 4274745..a7f6e43 100644 --- a/scripts/render_context_reports.py +++ b/scripts/render_context_reports.py @@ -54,6 +54,7 @@ def main() -> None: "skill_body_tokens": stats.get("skill_body_tokens"), "deferred_resource_tokens": stats.get("deferred_resource_tokens"), "large_deferred_resource_dirs": stats.get("large_deferred_resource_dirs", []), + "deferred_resource_governance": stats.get("deferred_resource_governance", {}), "quality_density": stats.get("quality_density"), "unused_resource_dirs": stats.get("unused_resource_dirs", []), "ok": report.get("ok"), @@ -74,18 +75,20 @@ def main() -> None: lines = [ "# Context Budget Summary", "", - "| Target | Path | Tier | Limit | Initial | SKILL | Deferred | Large Deferred Dirs | Quality Density | Unused Dirs | Status |", - "| --- | --- | --- | ---: | ---: | ---: | ---: | --- | ---: | --- | --- |", + "| Target | Path | Tier | Limit | Initial | SKILL | Deferred | Resource Governance | Large Deferred Dirs | Quality Density | Unused Dirs | Status |", + "| --- | --- | --- | ---: | ---: | ---: | ---: | --- | --- | ---: | --- | --- |", ] for row in rows: unused = ", ".join(row["unused_resource_dirs"]) if row["unused_resource_dirs"] else "-" + governance = row.get("deferred_resource_governance", {}) or {} + governance_status = governance.get("status", "unknown") large_dirs = ", ".join( f"{item['path']}:{item['estimated_tokens']}" for item in row.get("large_deferred_resource_dirs", []) ) or "-" status = "ok" if row["ok"] else "fail" lines.append( - f"| {row['label']} | `{row['path']}` | `{row['budget_tier']}` | {row['budget_limit']} | {row['initial_tokens']} | {row['skill_body_tokens']} | {row['deferred_resource_tokens']} | {large_dirs} | {row['quality_density']} | {unused} | {status} |" + f"| {row['label']} | `{row['path']}` | `{row['budget_tier']}` | {row['budget_limit']} | {row['initial_tokens']} | {row['skill_body_tokens']} | {row['deferred_resource_tokens']} | `{governance_status}` | {large_dirs} | {row['quality_density']} | {unused} | {status} |" ) lines.extend(["", "Per-target JSON reports are written beside each target and under `reports/`."]) (ROOT / "reports" / "context_budget.md").write_text("\n".join(lines) + "\n", encoding="utf-8") diff --git a/scripts/resource_boundary_check.py b/scripts/resource_boundary_check.py index b1065b6..ca2d3fc 100644 --- a/scripts/resource_boundary_check.py +++ b/scripts/resource_boundary_check.py @@ -44,6 +44,11 @@ SKILL_BODY_WARN_RATIO = 0.85 DEFERRED_RESOURCE_DIRS = {"references", "scripts", "evals", "templates", "assets", "input", "outputs"} DEFERRED_RESOURCE_WARN_TOKENS = 120_000 DEFERRED_RESOURCE_WARN_DIR_TOKENS = 80_000 +SCRIPT_GOVERNANCE_REPORTS = ( + "reports/security_trust_report.json", + "reports/architecture_maintainability.json", + "reports/python_compatibility.json", +) def has_files(path: Path) -> bool: @@ -65,6 +70,16 @@ def load_manifest(path: Path) -> dict: return json.loads(path.read_text(encoding="utf-8")) +def load_json(path: Path) -> dict: + if not path.exists(): + return {} + try: + payload = json.loads(path.read_text(encoding="utf-8")) + except json.JSONDecodeError: + return {} + return payload if isinstance(payload, dict) else {} + + def iter_relevant_files(root: Path) -> list[Path]: files = [] for entry in CANONICAL_PATHS: @@ -112,6 +127,111 @@ def quality_signal_points(root: Path, manifest: dict, governance_score: int) -> return points +def script_resource_governance(root: Path, expected_file_count: int) -> dict: + trust = load_json(root / "reports" / "security_trust_report.json") + architecture = load_json(root / "reports" / "architecture_maintainability.json") + python_compat = load_json(root / "reports" / "python_compatibility.json") + trust_summary = trust.get("summary", {}) if isinstance(trust.get("summary", {}), dict) else {} + architecture_summary = architecture.get("summary", {}) if isinstance(architecture.get("summary", {}), dict) else {} + python_summary = python_compat.get("summary", {}) if isinstance(python_compat.get("summary", {}), dict) else {} + + reasons = [] + missing = [] + checks = [ + ( + "trust report covers scripts", + trust.get("ok") is True + and int(trust_summary.get("script_count", 0) or 0) >= expected_file_count + and int(trust_summary.get("secret_findings", 0) or 0) == 0 + and int(trust_summary.get("help_smoke_failed_count", 0) or 0) == 0, + ), + ( + "architecture report has no script hotspots or blockers", + architecture.get("ok") is True + and int(architecture_summary.get("hotspot_count", 0) or 0) == 0 + and int(architecture_summary.get("blocker_count", 0) or 0) == 0, + ), + ( + "Python compatibility report has no issues", + python_compat.get("ok") is True + and int(python_summary.get("issue_count", 0) or 0) == 0, + ), + ] + for label, ok in checks: + if ok: + reasons.append(label) + else: + missing.append(label) + return { + "status": "governed" if not missing else "needs-review", + "evidence": list(SCRIPT_GOVERNANCE_REPORTS), + "reasons": reasons, + "missing": missing, + } + + +def deferred_dir_governance( + root: Path, + dirname: str, + payload: dict, + manifest: dict, + skill_text: str, +) -> dict: + file_count = int(payload.get("file_count", 0) or 0) + if dirname == "scripts": + governance = script_resource_governance(root, file_count) + governance.update( + { + "path": dirname, + "estimated_tokens": int(payload.get("estimated_tokens", 0) or 0), + "file_count": file_count, + "rationale": "Script resources are deterministic deferred tools, not initial-load prompt context.", + } + ) + return governance + + referenced = explicit_dir_reference(dirname, root / dirname, skill_text, manifest) + declared = dirname in (manifest.get("factory_components") or []) + governed = referenced or declared + return { + "path": dirname, + "status": "governed" if governed else "needs-review", + "estimated_tokens": int(payload.get("estimated_tokens", 0) or 0), + "file_count": file_count, + "evidence": ["SKILL.md", "manifest.json"], + "reasons": ["directory is explicitly referenced or declared as a factory component"] if governed else [], + "missing": [] if governed else ["directory is not referenced in SKILL.md or manifest factory_components"], + "rationale": "Deferred resources are acceptable when they are discoverable and intentionally part of the package contract.", + } + + +def deferred_resource_governance( + root: Path, + manifest: dict, + skill_text: str, + deferred_resource_dirs: dict[str, dict[str, int | str]], + large_deferred_resource_dirs: list[dict], +) -> dict: + governed_dirs = [ + deferred_dir_governance(root, str(item["path"]), item, manifest, skill_text) + for item in large_deferred_resource_dirs + ] + missing = [item for item in governed_dirs if item["status"] != "governed"] + return { + "status": "governed" if governed_dirs and not missing else ("not-required" if not governed_dirs else "needs-review"), + "large_dir_count": len(governed_dirs), + "governed_large_dir_count": len(governed_dirs) - len(missing), + "directories": governed_dirs, + "summary": ( + "Large deferred resources are indexed and backed by evidence." + if governed_dirs and not missing + else "No large deferred resource directory exceeds the per-dir threshold." + if not governed_dirs + else "One or more large deferred resource directories still need explicit governance evidence." + ), + } + + def analyze_skill( root: Path, max_initial_tokens: int | None = None, @@ -197,7 +317,15 @@ def analyze_skill( ) if int(item["estimated_tokens"]) > DEFERRED_RESOURCE_WARN_DIR_TOKENS ] - if deferred_resource_tokens > DEFERRED_RESOURCE_WARN_TOKENS: + deferred_governance = deferred_resource_governance( + root, + manifest, + skill_text, + deferred_resource_dirs, + large_deferred_resource_dirs, + ) + + if deferred_resource_tokens > DEFERRED_RESOURCE_WARN_TOKENS and deferred_governance["status"] != "governed": warnings.append( "Deferred resource footprint is high: " f"{deferred_resource_tokens} estimated tokens across references/scripts/evals. " @@ -228,6 +356,7 @@ def analyze_skill( reverse=True, ), "large_deferred_resource_dirs": large_deferred_resource_dirs, + "deferred_resource_governance": deferred_governance, "relevant_file_count": len(files), "unused_resource_dirs": unused_resource_dirs, "quality_signal_points": signal_points, diff --git a/scripts/review_studio_gates.py b/scripts/review_studio_gates.py index 584a9ac..ceedac6 100644 --- a/scripts/review_studio_gates.py +++ b/scripts/review_studio_gates.py @@ -205,12 +205,15 @@ def build_gates(skill_dir: Path, output_html: Path, data: dict[str, dict[str, An if large_deferred_dirs: first = large_deferred_dirs[0] top_deferred = f"{first.get('path', 'resource')} {first.get('estimated_tokens', 'n/a')}" + deferred_governance = context_stats.get("deferred_resource_governance", {}) if isinstance(context_stats, dict) else {} + governance_status = deferred_governance.get("status", "unknown") if isinstance(deferred_governance, dict) else "unknown" context_detail = ( f"initial load {context_stats.get('estimated_initial_load_tokens', 'n/a')}/" f"{context_stats.get('context_budget_limit', 'n/a')}; " f"deferred {context_stats.get('deferred_resource_tokens', 'n/a')}/" f"{context_stats.get('deferred_resource_warn_threshold', 'n/a')}; " f"top deferred {top_deferred}; " + f"resource governance {governance_status}; " f"quality density {context_stats.get('quality_density', 'n/a')}" ) gates.append( diff --git a/tests/verify_quality_checks.py b/tests/verify_quality_checks.py index e94502d..50853e1 100644 --- a/tests/verify_quality_checks.py +++ b/tests/verify_quality_checks.py @@ -47,6 +47,7 @@ def require_context_targets(case: dict, max_initial: int, min_density: float) -> deferred = stats.get("deferred_resource_tokens") deferred_threshold = stats.get("deferred_resource_warn_threshold") deferred_dirs = stats.get("deferred_resource_dirs", []) + deferred_governance = stats.get("deferred_resource_governance", {}) unused = stats.get("unused_resource_dirs", []) case["max_initial_load"] = max_initial case["observed_initial_load"] = initial @@ -55,6 +56,7 @@ def require_context_targets(case: dict, max_initial: int, min_density: float) -> case["observed_deferred_resource_tokens"] = deferred case["deferred_resource_warn_threshold"] = deferred_threshold case["deferred_resource_dir_count"] = len(deferred_dirs) if isinstance(deferred_dirs, list) else None + case["deferred_resource_governance_status"] = deferred_governance.get("status") if isinstance(deferred_governance, dict) else None case["unused_resource_dirs"] = unused case["passed"] = ( case["passed"] @@ -63,6 +65,8 @@ def require_context_targets(case: dict, max_initial: int, min_density: float) -> and deferred is not None and deferred_threshold is not None and isinstance(deferred_dirs, list) + and isinstance(deferred_governance, dict) + and deferred_governance.get("status") in {"governed", "not-required", "needs-review"} and initial <= max_initial and density >= min_density and not unused @@ -136,6 +140,13 @@ def main() -> None: [python, "scripts/resource_boundary_check.py", str(ROOT)], ) require_context_targets(root_resource, 1000, 100.0) + root_payload = root_resource.get("payload", {}) + root_governance_status = root_resource.get("deferred_resource_governance_status") + root_resource["passed"] = ( + root_resource["passed"] + and root_governance_status == "governed" + and not any("Deferred resource footprint is high" in item for item in root_payload.get("warnings", [])) + ) cases.append(root_resource) complex_resource = run( diff --git a/tests/verify_review_studio.py b/tests/verify_review_studio.py index 28658ab..694aac5 100644 --- a/tests/verify_review_studio.py +++ b/tests/verify_review_studio.py @@ -116,6 +116,33 @@ def main() -> None: capture_output=True, text=True, ) + subprocess.run( + [sys.executable, str(ROOT / "scripts" / "trust_check.py"), str(ROOT)], + cwd=ROOT, + check=True, + capture_output=True, + text=True, + ) + subprocess.run( + [sys.executable, str(ROOT / "scripts" / "python_compat_check.py"), str(ROOT), "--generated-at", "2026-06-13"], + cwd=ROOT, + check=True, + capture_output=True, + text=True, + ) + subprocess.run( + [ + sys.executable, + str(ROOT / "scripts" / "render_architecture_maintainability.py"), + str(ROOT), + "--generated-at", + "2026-06-13", + ], + cwd=ROOT, + check=True, + capture_output=True, + text=True, + ) subprocess.run( [sys.executable, str(ROOT / "scripts" / "render_context_reports.py")], cwd=ROOT, @@ -226,26 +253,6 @@ def main() -> None: capture_output=True, text=True, ) - subprocess.run( - [sys.executable, str(ROOT / "scripts" / "python_compat_check.py"), str(ROOT), "--generated-at", "2026-06-13"], - cwd=ROOT, - check=True, - capture_output=True, - text=True, - ) - subprocess.run( - [ - sys.executable, - str(ROOT / "scripts" / "render_architecture_maintainability.py"), - str(ROOT), - "--generated-at", - "2026-06-13", - ], - cwd=ROOT, - check=True, - capture_output=True, - text=True, - ) for script_name in [ "render_skill_os2_audit.py", "render_world_class_evidence_plan.py", @@ -286,16 +293,15 @@ def main() -> None: assert payload["schema_version"] == "2.0", payload assert payload["summary"]["decision"] == "review", payload assert payload["summary"]["gate_count"] == 16, payload - assert payload["summary"]["world_class_score"] == 89, payload - assert payload["summary"]["warning_count"] == 4, payload + assert payload["summary"]["world_class_score"] == 91, payload + assert payload["summary"]["warning_count"] == 3, payload assert payload["summary"]["blocker_count"] == 0, payload - assert payload["summary"]["action_count"] == 4, payload + assert payload["summary"]["action_count"] == 3, payload assert payload["summary"]["annotation_count"] == 0, payload assert payload["summary"]["open_annotation_blocker_count"] == 0, payload assert payload["summary"]["action_count"] == payload["summary"]["warning_count"] + payload["summary"]["blocker_count"], payload assert {item["gate_key"] for item in payload["review_actions"]} == { "output-lab", - "context-budget", "review-waivers", "world-class-evidence", }, payload @@ -311,11 +317,12 @@ def main() -> None: assert "reviewed 0/5" in output_gate["detail"], output_gate assert "review pending 5" in output_gate["detail"], output_gate context_gate = next(item for item in payload["gates"] if item["key"] == "context-budget") - assert context_gate["status"] == "warn", context_gate + assert context_gate["status"] == "pass", context_gate assert "initial load 944/1000" in context_gate["detail"], context_gate assert "deferred " in context_gate["detail"], context_gate assert "/120000" in context_gate["detail"], context_gate assert "top deferred scripts" in context_gate["detail"], context_gate + assert "resource governance governed" in context_gate["detail"], context_gate assert "quality density" in context_gate["detail"], context_gate release_gate = next(item for item in payload["gates"] if item["key"] == "release-notes") assert "upgrade minor declared / minor recommended" in release_gate["detail"], release_gate @@ -362,7 +369,7 @@ def main() -> None: assert "reports/adoption_drift_report.json" in operations_gate["evidence"], operations_gate waivers_gate = next(item for item in payload["gates"] if item["key"] == "review-waivers") assert waivers_gate["status"] == "warn", waivers_gate - assert "2 warning gates still need reviewer decision" in waivers_gate["detail"], waivers_gate + assert "1 warning gates still need reviewer decision" in waivers_gate["detail"], waivers_gate assert "reports/review_waivers.json" in waivers_gate["evidence"], waivers_gate world_class_gate = next(item for item in payload["gates"] if item["key"] == "world-class-evidence") assert world_class_gate["status"] == "warn", world_class_gate @@ -426,17 +433,7 @@ def main() -> None: assert full_payload["data"]["architecture_maintainability"]["summary"]["hotspot_count"] == 0, full_payload["data"]["architecture_maintainability"] assert full_payload["data"]["architecture_maintainability"]["summary"]["blocker_count"] == 0, full_payload["data"]["architecture_maintainability"] action_keys = {item["gate_key"] for item in full_payload["review_actions"]} - assert action_keys == {"output-lab", "context-budget", "review-waivers", "world-class-evidence"}, full_payload["review_actions"] - context_action = next(item for item in full_payload["review_actions"] if item["gate_key"] == "context-budget") - assert "deferred resources" in context_action["summary"], context_action - assert {item["path"] for item in context_action["source_refs"]} >= { - "SKILL.md", - "reports/context_budget.md", - "scripts/resource_boundary_check.py", - "references/skill-engineering-method.md", - }, context_action - assert all(item["exists"] for item in context_action["source_refs"]), context_action - assert "python3 scripts/render_context_reports.py" == context_action["verification_command"], context_action + assert action_keys == {"output-lab", "review-waivers", "world-class-evidence"}, full_payload["review_actions"] world_class_action = next(item for item in full_payload["review_actions"] if item["gate_key"] == "world-class-evidence") assert {item["path"] for item in world_class_action["source_refs"]} >= { "reports/world_class_evidence_ledger.md", @@ -530,7 +527,7 @@ def main() -> None: assert "审查闸门" in html, html[:1200] assert "修复动作" in html, html[:3000] assert "补足 output eval 覆盖、execution evidence、blind A/B 和 reviewer adjudication。" in html, html[:9000] - assert "压缩或拆分高成本 deferred resources" in html, html[:9000] + assert "resource governance governed" in html, html[:9000] assert "reports/output_review_kit.html" in html, html[:9000] assert "python3 scripts/adjudicate_output_review.py --write-template" in html, html[:9000] assert "对保留的 warning 写入 reviewer、理由、范围和到期时间,或修掉 warning。" in html, html[:9000]