feat(skills): reject safe_mode:true skills that bundle scripts/ or non-standard resources #196
No reviewers
Labels
No labels
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cleveragents/cleveractors-core!196
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/m1-skill-safe-mode-resource-audit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
SkillValidator.validatenow rejects a skill whose effectivesafe_modeistrue(explicit or default) when it bundles ascripts/resource or a non-standard top-level folder (ADR-2034 D-11), naming the skill'snameand every offending path.safe_mode: falseis unaffected regardless of whatresourcesit bundles (one-directional rule). No change needed inSkillLoader/AgentCreationErrorwrapping.safe_mode: false(now rejected by this check), and split the resource-classification Scenario Outline so it keeps covering D-8 classification without tripping D-11.Test plan
nox -s lintnox -s format -- --checknox -s typechecknox -s coverage_report(97.3%, threshold 96.5%) — 160 features / 3370 scenarios / 15520 steps passednox -s security_scannox -s dead_codenox -s complexitynox -s integration_tests— 382/382 Robot tests passednox -s benchmarknox -s docsnox -s buildISSUES CLOSED: #191
PR Review: !196 (Ticket #191)
Reviewed from
feature/m1-skill-safe-mode-resource-audit(3faefe3) againstdevelop(5dfbc9b). Scope notes: the PR has no prior review comments or author responses, so nothing was excluded as out-of-scope/deferred; red-tape items excluded per review policy (and they are fine anyway — commit first line matches the ticket Metadata exactly,ISSUES CLOSED: #191present, single commit, branch matches Metadata, rebased on latestdevelop, no merge commits). GISM0 was unavailable this session, so the ticket memory journal could not be consulted.Verdict: Approve
The implementation faithfully realizes ADR-2034 D-11 exactly as specified in ticket #191 and the authoritative docs (ADR-2034 §D-11, Actor Registry Standard §16.1/§16.3 v1.3.0, index.md §4.4.8 v1.10.1 — already on
develop). All acceptance criteria are met; every quality gate was re-verified locally on the PR head. Only one minor test-strength issue and a few nits — none blocking.Critical Issues
None.
Major Issues
None.
Minor Issues
features/skill_directory_packages.feature:45-51(+features/steps/skill_directory_packages_steps.py:158-160) — the rewritten fixture no longer isolatessafe_modeas the cause of the package-ID difference. Ondevelop, "An explicit safe_mode false is preserved and changes the package ID" used two content-identical directories (both full, onlysafe_modediffering), so "the two packed package IDs should differ" specifically provedsafe_mode: falseparticipates in the content-addressed identity (§16.2: "a safety downgrade visible in the content-addressed identity"). Now the safe dir is minimal (no privileged resources) and the unsafe dir is full (privileged resources), so the IDs differ due to both content andsafe_mode; a regression that droppedfalsefrom canonicalization would no longer be caught by this scenario. It is mitigated —features/agent_skills.feature:91("A skill declaring safe_mode false retains it and changes its package ID") still isolates the property at the validator level — but the packing-level scenario should keep its original power. Recommendation: keep both directories content-identical (both minimal — D-11 explicitly permitssafe_mode: falsewith no privileged resources, per ADR-2034: "unusual but not inconsistent") so onlysafe_modediffers.Nits
features/agent_skills.feature:195-199— Scenario title says "…with only references, assets, and root files…" but the fixture bundles onlyreferences/+assets/; no root-level file is exercised. Root-file-under-default-safe-mode success is covered only implicitly via the classification outline (LICENSE.txt). Consider adding a root file to the fixture or adjusting the title.src/cleveractors/agents/skill_schema.py:483-486— The error message says "declares safe_mode: true" even whensafe_modewas omitted and only defaulted totrue. Slightly imprecise for an author who never wrote the field; "has effective safe_mode: true" (or "defaults to safe_mode: true") would read more accurately. Cosmetic.features/steps/skill_directory_packages_steps.py:96-101—_create_full_skill's docstring summary wraps mid-sentence across the first line (PEP 257 prefers a one-line summary). Cosmetic; lint passes.scripts/withoutsafe_mode: falsenow failsSkillDirectoryPacker.packwithSkillPackingError, and a violating package file likewise fails the unpacker, because both funnel throughSkillValidator.validate. One scenario per layer would lock in that propagation.Verification (local, on the PR head — authoritative)
nox -s unit_tests: 160 features / 3370 scenarios / 15520 steps passed (matches the PR report exactly).nox -s coverage_report: COVERAGE OK: 97.3% (threshold 96.5%);skill_schema.pyhas zero missing lines, so the new check is fully covered.nox -s typecheck: 0 errors (1 pre-existing optional-dependency warning inllm_imports.py, unrelated to this PR).nox -s lint: all checks passed.nox -s integration_tests -- robot/agent_skills.robot: 13/13 passed (full 382/382 per PR report).Summary
A clean, well-scoped implementation of ADR-2034 D-11. The cross-field check lives in
SkillValidator.validate(afterresources/safe_modeare computed, beforeSkillconstruction — the single construction gate, so it cannot be bypassed), reuses the D-8 classifier via the already-computedresource_class(no reimplementation), is one-directional exactly as specified, fails fast with the standardValidationError(whichSkillLoader._validate_onealready wraps asAgentCreationError— correctly requiring no loader change), and names the skill'snameplus every offending path (deterministically sorted). It correctly applies inrelaxedmode too, consistent with--relaxed's documented contract of easing only the description-length/frontmatter-key checks. All five required Behave scenarios are present with meaningful assertions (including the multi-path error-message case), the split classification outline retains full D-8 coverage including theScripts/case-sensitivity case, and all fixture updates (features, steps, Robot lib) are the honest ones D-11 demands — no example package, benchmark, or Robot fixture that bundles privileged resources was left declaring the unsafe default. Docs needed no changes (the D-11 spec text landed ondevelopwith the ADR revision). Approve — the minor fixture-isolation issue and nits can be addressed in a follow-up if desired.3faefe321e9a0e667f4cThanks for the review! Addressed in a commit amend (force-pushed, same commit — still unreleased/iterating):
safe_mode: falseis not required to contain any script or non-standard resource... unusual but not inconsistent"). Both directories now bundle only non-privileged resources and differ solely insafe_mode, so the asserted package-ID divergence is isolated to that field again.references/,assets/, and root-level files"). Added a root-level file (LICENSE.txt) to that scenario.skill_directory_packages.feature,skill_directory_unpacking.feature) pinning that D-11 propagates throughSkillDirectoryPacker/SkillDirectoryUnpackerasSkillPackingError/SkillUnpackingError, not deferred.Re-verified via
nox: lint/format/typecheck/security_scan/dead_code/complexity green; coverage scoped to this feature's Behave files showsskill_schema.py,skill_packer.py, andskill_unpacker.pyeach at 100% (0 missing), 254/254 scenarios passing. Full-suite coverage/integration/benchmark/docs/build were already green on the prior revision and are unaffected by this test/wording-only refinement.