test(agents): add failing regression for the skill gate's OR-composed global safety (#189) #192

Merged
CoreRasurae merged 1 commit from tdd/m1-skill-gate-global-safety-and into develop 2026-11-26 11:06:34 +00:00
Member

Summary

Adds the mandatory TDD issue-capture test for #189 ("ToolAgent._is_global_unsafe composes host-unsafe-mode and the agent's own safe_mode with OR instead of AND, weakening the skill double-safety gate (ADR-2034 D-9)").

ToolAgent._is_global_unsafe (src/cleveractors/agents/tool.py, ~line 1622) currently returns (not self.safe_mode) or bool(context.get("_unsafe_mode", False)). Because this is an OR, either the agent's own safe_mode: false alone, or the invocation context's _unsafe_mode: true alone, opens the "global safety" half of the ADR-2034 D-9 double-safety gate — even though the corrected D-9 text (amended 2026-11-25; see docs/adr/ADR-2034-skill-package-support.md and docs/index.md §4.4.8) requires both to hold at once, mirroring the AND composition §13 already uses for shell execution.

This PR adds a new Behave scenario to features/agent_skills.feature, alongside the existing double-safety-gate coverage, tagged @tdd_issue @tdd_issue_189 @tdd_expected_fail:

  • Leaves the ToolAgent's own "safe_mode" at its default true.
  • Loads a safe_mode: false pdf-processing skill bundling the existing "every D-8 class" fixture (fixtures/sample.pdf, a non-standard resource).
  • Sets the invocation context to globally unsafe (_unsafe_mode: true).
  • Asserts the non-standard read is refused (gate closed).

No new step definitions were added — every step already existed in features/steps/agent_skills_steps.py and is reused as-is.

Verified locally that removing @tdd_expected_fail makes the scenario's assertion genuinely fail against current develop (the gate currently opens and the read succeeds instead of being refused), proving the bug. The failing step raises only AssertionError, so the TDD CI hook inverts it correctly and the scenario passes CI with the tag in place.

The actual fix (switching _is_global_unsafe to AND) lands separately on bugfix/m1-skill-gate-global-safety-and for issue #189, once this TDD PR is merged.

Note: this repository's PRs target develop (not master); issue #190's Definition of Done has been amended accordingly.

Closes #190

Test plan

  • nox -s lint — green
  • nox -s format -- --check — green
  • nox -s typecheck — green (0 errors)
  • nox -s security_scan — green (bandit + semgrep, 0 findings)
  • nox -s dead_code — green (vulture, 0 findings)
  • nox -s complexity — green (informational)
  • nox -s unit_tests — green (3362/3362 scenarios, including the new TDD scenario passing via @tdd_expected_fail inversion)
  • nox -s integration_tests — green (382/382 Robot Framework tests)
  • nox -s coverage_report — 97.3% (≥ 97% threshold)
  • nox -s build — green
  • Confirmed the new scenario's assertion fails when @tdd_expected_fail is removed locally (proving the bug is genuinely reproduced)

🤖 Generated with Claude Code

## Summary Adds the mandatory TDD issue-capture test for #189 ("`ToolAgent._is_global_unsafe` composes host-unsafe-mode and the agent's own `safe_mode` with OR instead of AND, weakening the skill double-safety gate (ADR-2034 D-9)"). `ToolAgent._is_global_unsafe` (`src/cleveractors/agents/tool.py`, ~line 1622) currently returns `(not self.safe_mode) or bool(context.get("_unsafe_mode", False))`. Because this is an OR, either the agent's own `safe_mode: false` alone, or the invocation context's `_unsafe_mode: true` alone, opens the "global safety" half of the ADR-2034 D-9 double-safety gate — even though the corrected D-9 text (amended 2026-11-25; see `docs/adr/ADR-2034-skill-package-support.md` and `docs/index.md` §4.4.8) requires both to hold at once, mirroring the AND composition §13 already uses for shell execution. This PR adds a new Behave scenario to `features/agent_skills.feature`, alongside the existing double-safety-gate coverage, tagged `@tdd_issue @tdd_issue_189 @tdd_expected_fail`: - Leaves the `ToolAgent`'s own `"safe_mode"` at its default `true`. - Loads a `safe_mode: false` `pdf-processing` skill bundling the existing "every D-8 class" fixture (`fixtures/sample.pdf`, a non-standard resource). - Sets the invocation context to globally unsafe (`_unsafe_mode: true`). - Asserts the non-standard read is refused (gate closed). No new step definitions were added — every step already existed in `features/steps/agent_skills_steps.py` and is reused as-is. Verified locally that removing `@tdd_expected_fail` makes the scenario's assertion genuinely fail against current `develop` (the gate currently opens and the read succeeds instead of being refused), proving the bug. The failing step raises only `AssertionError`, so the TDD CI hook inverts it correctly and the scenario passes CI with the tag in place. The actual fix (switching `_is_global_unsafe` to AND) lands separately on `bugfix/m1-skill-gate-global-safety-and` for issue #189, once this TDD PR is merged. **Note:** this repository's PRs target `develop` (not `master`); issue #190's Definition of Done has been amended accordingly. Closes #190 ## Test plan - [x] `nox -s lint` — green - [x] `nox -s format -- --check` — green - [x] `nox -s typecheck` — green (0 errors) - [x] `nox -s security_scan` — green (bandit + semgrep, 0 findings) - [x] `nox -s dead_code` — green (vulture, 0 findings) - [x] `nox -s complexity` — green (informational) - [x] `nox -s unit_tests` — green (3362/3362 scenarios, including the new TDD scenario passing via `@tdd_expected_fail` inversion) - [x] `nox -s integration_tests` — green (382/382 Robot Framework tests) - [x] `nox -s coverage_report` — 97.3% (≥ 97% threshold) - [x] `nox -s build` — green - [x] Confirmed the new scenario's assertion fails when `@tdd_expected_fail` is removed locally (proving the bug is genuinely reproduced) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
test(agents): add failing regression for the skill gate's OR-composed global safety (#189)
Some checks failed
CI / security (pull_request) Successful in 1m19s
CI / lint (pull_request) Successful in 1m24s
CI / typecheck (pull_request) Successful in 1m35s
CI / build (pull_request) Successful in 49s
CI / quality (pull_request) Successful in 3m15s
CI / integration_tests (pull_request) Successful in 4m49s
CI / unit_tests (pull_request) Successful in 6m50s
CI / coverage (pull_request) Successful in 6m30s
CI / benchmark (pull_request) Has been cancelled
CI / status-check (pull_request) Successful in 2s
f95e162697
Adds a failing-first Behave regression test proving issue #189:
ToolAgent._is_global_unsafe (src/cleveractors/agents/tool.py, ~line
1622) composes the ADR-2034 D-9 "global safety" half of the skill
double-safety gate with OR -- (not self.safe_mode) or
context.get("_unsafe_mode", False) -- so either the agent's own
safe_mode: false alone, or the invocation context's _unsafe_mode: true
alone, opens that half of the gate. The corrected D-9 text (amended
2026-11-25, see docs/adr/ADR-2034-skill-package-support.md and
docs/index.md Sec 4.4.8) requires both to hold at once, mirroring the
AND composition Sec 13 already uses for shell execution.

Extends features/agent_skills.feature (alongside the existing
double-safety-gate coverage, ~line 736) with a new scenario that
leaves the ToolAgent's own "safe_mode" at its default true, loads a
safe_mode: false "pdf-processing" skill bundling a non-standard
fixtures/sample.pdf resource (the existing "every D-8 class" fixture),
sets the invocation context globally unsafe, and asserts the
non-standard read is refused. No new step definitions were needed --
every Given/When/Then step already exists in
features/steps/agent_skills_steps.py and is reused as-is.

The scenario is tagged @tdd_issue @tdd_issue_189 @tdd_expected_fail.
Verified locally that removing @tdd_expected_fail makes the scenario's
assertion fail against current develop (the gate currently opens and
the read succeeds instead of being refused), confirming the bug is
genuinely reproduced; the failing step raises only AssertionError, so
the TDD CI hook inverts it correctly. With the tag restored, nox -s
unit_tests, nox -s coverage_report (97.3%), nox -s lint, nox -s format
-- --check, nox -s typecheck, nox -s security_scan, nox -s dead_code,
nox -s complexity, nox -s integration_tests, and nox -s build are all
green.

The actual fix (switching _is_global_unsafe to AND) lands separately
on bugfix/m1-skill-gate-global-safety-and per issue #189.

ISSUES CLOSED: #190
Refs: #189
CoreRasurae added this to the v2.1.0 milestone 2026-11-25 13:08:41 +00:00
hurui200320 requested changes 2026-11-25 16:00:04 +00:00
Dismissed
hurui200320 left a comment

PR Review: !192 (Ticket #190)

Verdict: Request Changes

The TDD scenario itself is correct, minimal, and verified end-to-end locally: it is a single atomic commit on develop touching only features/agent_skills.feature, all steps reuse existing definitions, the tag trio matches CONTRIBUTING's TDD rules (@tdd_issue_189 correctly references the bug issue), and the failure path raises only AssertionError. Local verification: with the tag removed the scenario fails at the Then step with ASSERT FAILED: Expected an ExecutionError but none was raised (bug genuinely reproduced — under the current OR composition the read succeeds), and with the tag in place it passes via inversion (nox -s coverage_report: 97.3%, full behave suite green; nox -s lint and nox -s typecheck green). The post-fix refusal message (...global safety is true, skill safety is false.) matches the asserted substring, so the scenario will pass once the fix lands.

The one blocking problem is that the spec correction this entire PR is premised on does not exist in the repository. Per the reviewer instruction to drop items already decided out-of-scope or deferred: there are no PR comments or responses on !192 (0 comments, 0 reviews, 0 inline threads), and neither #189 nor #190 records any deferral — both tickets affirmatively claim the D-9 text was "amended 2026-11-25", which is factually not the case in the repo, so the item stays in scope.

Critical Issues

None.

Major Issues

  1. The cited "amended 2026-11-25" D-9 correction is not committed anywhere — docs/adr/ADR-2034-skill-package-support.md (D-9, "Global safety is false", ~line 405) and docs/index.md §4.4.8 (~line 607) still normatively specify the OR composition ("either this agent's own safe_mode … or the invocation context already carries _unsafe_mode: true"). Verified: no branch (this PR branch, develop, master, all remote branches) contains a 2026-11-25 revision of either file, no commit since 2026-11-24 touched them, the ADR revision history's latest entry is 2026-11-09, and no open PR or tracked issue commits the amendment (only open PRs: !192 and the fix !193). PR !193's description states the doc updates are "uncommitted, pre-existing … not part of this PR's commit" — i.e., the correction lives only in an uncommitted working tree and is at risk of never landing. If !192 and !193 merge as-is, develop will have committed tests and code enforcing AND while the authoritative spec mandates OR — a direct spec/implementation contradiction under the project rule that the specification is the source of truth. The tickets also cite a nonexistent "A-14" alternative (the ADR ends at A-13).
    Recommendation: commit the D-9 + §4.4.8 + docs/tools/safe-mode.md amendment — most naturally as a docs commit in this PR (its entire premise is the corrected D-9 text) or in a dedicated docs PR merged before or with !193 — and correct the "amended 2026-11-25" citations in #189/#190 (and the A-14 reference in #189) once it lands.

Minor Issues

  1. Assertion pins only half of the refusal signature — features/agent_skills.feature:764. The sibling refusal scenarios assert both halves ("global safety is true" and "skill safety is false", plus the resource path); this scenario asserts only "global safety is true". After the fix, the refusal message will read "...global safety is true, skill safety is false.", so adding And the skill tool should fail with message containing "skill safety is false" would prove the gate closed for the exact D-9 reason (skill opted in, global half closed) and would catch an implementation that refuses all non-standard reads unconditionally. This changes nothing about today's inversion behavior (the first assert fails identically), so it can also be folded into !193 when the tag is removed — but it is cheap to do here.

Nits

  1. No CHANGELOG.md entry (CONTRIBUTING PR rule 6). !193's changelog entry covers the overall #189 item, so this is procedural only and not blocking per this review's scope.

Summary

A well-executed TDD capture: exactly the missing quadrant (agent's own safe_mode still true + context _unsafe_mode: true), reusing all existing steps, correctly tagged, and proven both ways locally (fails with AssertionError without the tag; passes via inversion with it; full suite + coverage 97.3%, lint, and typecheck all green on this commit). The single blocker is traceability: the corrected D-9 / §4.4.8 text that the PR (and tickets #189/#190) cite as "amended 2026-11-25" has never been committed to the repository and is tracked nowhere, which would leave the committed spec contradicting the committed tests and code once !193 merges. Land the spec amendment (here or alongside !193) and this is good to merge. Note: no gism0 MCP tools were available, so no ticket memory journal was consulted.

## PR Review: !192 (Ticket #190) ### Verdict: Request Changes The TDD scenario itself is correct, minimal, and verified end-to-end locally: it is a single atomic commit on `develop` touching only `features/agent_skills.feature`, all steps reuse existing definitions, the tag trio matches CONTRIBUTING's TDD rules (`@tdd_issue_189` correctly references the *bug* issue), and the failure path raises only `AssertionError`. Local verification: with the tag removed the scenario fails at the `Then` step with `ASSERT FAILED: Expected an ExecutionError but none was raised` (bug genuinely reproduced — under the current OR composition the read succeeds), and with the tag in place it passes via inversion (`nox -s coverage_report`: 97.3%, full behave suite green; `nox -s lint` and `nox -s typecheck` green). The post-fix refusal message (`...global safety is true, skill safety is false.`) matches the asserted substring, so the scenario will pass once the fix lands. The one blocking problem is that the spec correction this entire PR is premised on does **not exist in the repository**. Per the reviewer instruction to drop items already decided out-of-scope or deferred: there are no PR comments or responses on !192 (0 comments, 0 reviews, 0 inline threads), and neither #189 nor #190 records any deferral — both tickets affirmatively claim the D-9 text was "amended 2026-11-25", which is factually not the case in the repo, so the item stays in scope. ### Critical Issues None. ### Major Issues 1. **The cited "amended 2026-11-25" D-9 correction is not committed anywhere** — `docs/adr/ADR-2034-skill-package-support.md` (D-9, "Global safety is false", ~line 405) and `docs/index.md` §4.4.8 (~line 607) still normatively specify the OR composition ("*either* this agent's own `safe_mode` … *or* the invocation context already carries `_unsafe_mode: true`"). Verified: no branch (this PR branch, `develop`, `master`, all remote branches) contains a 2026-11-25 revision of either file, no commit since 2026-11-24 touched them, the ADR revision history's latest entry is 2026-11-09, and no open PR or tracked issue commits the amendment (only open PRs: !192 and the fix !193). PR !193's description states the doc updates are "uncommitted, pre-existing … not part of this PR's commit" — i.e., the correction lives only in an uncommitted working tree and is at risk of never landing. If !192 and !193 merge as-is, `develop` will have committed tests and code enforcing AND while the authoritative spec mandates OR — a direct spec/implementation contradiction under the project rule that the specification is the source of truth. The tickets also cite a nonexistent "A-14" alternative (the ADR ends at A-13). **Recommendation:** commit the D-9 + §4.4.8 + `docs/tools/safe-mode.md` amendment — most naturally as a docs commit in this PR (its entire premise is the corrected D-9 text) or in a dedicated docs PR merged before or with !193 — and correct the "amended 2026-11-25" citations in #189/#190 (and the A-14 reference in #189) once it lands. ### Minor Issues 1. **Assertion pins only half of the refusal signature** — `features/agent_skills.feature:764`. The sibling refusal scenarios assert both halves ("global safety is true" **and** "skill safety is false", plus the resource path); this scenario asserts only `"global safety is true"`. After the fix, the refusal message will read `"...global safety is true, skill safety is false."`, so adding `And the skill tool should fail with message containing "skill safety is false"` would prove the gate closed for the exact D-9 reason (skill opted in, global half closed) and would catch an implementation that refuses *all* non-standard reads unconditionally. This changes nothing about today's inversion behavior (the first assert fails identically), so it can also be folded into !193 when the tag is removed — but it is cheap to do here. ### Nits 1. No `CHANGELOG.md` entry (CONTRIBUTING PR rule 6). !193's changelog entry covers the overall #189 item, so this is procedural only and not blocking per this review's scope. ### Summary A well-executed TDD capture: exactly the missing quadrant (agent's own `safe_mode` still `true` + context `_unsafe_mode: true`), reusing all existing steps, correctly tagged, and proven both ways locally (fails with `AssertionError` without the tag; passes via inversion with it; full suite + coverage 97.3%, lint, and typecheck all green on this commit). The single blocker is traceability: the corrected D-9 / §4.4.8 text that the PR (and tickets #189/#190) cite as "amended 2026-11-25" has never been committed to the repository and is tracked nowhere, which would leave the committed spec contradicting the committed tests and code once !193 merges. Land the spec amendment (here or alongside !193) and this is good to merge. Note: no gism0 MCP tools were available, so no ticket memory journal was consulted.
@ -751,0 +761,4 @@
And the invocation context is globally unsafe
When I create the ToolAgent
And I read resource "fixtures/sample.pdf" via the skill tool for skill "pdf-processing"
Then the skill tool should fail with message containing "global safety is true"
Member

Minor: the sibling refusal scenarios assert both halves of the gate (e.g. And the skill tool should fail with message containing "skill safety is false" plus the resource path). Suggest adding the same here so the assertion pins the exact D-9 refusal signature ("...global safety is true, skill safety is false.") rather than just the global half — this would also catch an implementation that refuses all non-standard reads unconditionally. No effect on today's inversion (the first assert fails identically); fine to fold into !193 when the tag is removed if preferred.

Minor: the sibling refusal scenarios assert both halves of the gate (e.g. `And the skill tool should fail with message containing "skill safety is false"` plus the resource path). Suggest adding the same here so the assertion pins the exact D-9 refusal signature ("...global safety is true, skill safety is false.") rather than just the global half — this would also catch an implementation that refuses all non-standard reads unconditionally. No effect on today's inversion (the first assert fails identically); fine to fold into !193 when the tag is removed if preferred.
hurui200320 requested changes 2026-11-25 16:00:34 +00:00
Dismissed
hurui200320 left a comment

PR Review: !192 (Ticket #190)

Verdict: Request Changes

The TDD scenario itself is correct, minimal, and verified end-to-end locally: it is a single atomic commit on develop touching only features/agent_skills.feature, all steps reuse existing definitions, the tag trio matches CONTRIBUTING's TDD rules (@tdd_issue_189 correctly references the bug issue), and the failure path raises only AssertionError. Local verification: with the tag removed the scenario fails at the Then step with ASSERT FAILED: Expected an ExecutionError but none was raised (bug genuinely reproduced — under the current OR composition the read succeeds), and with the tag in place it passes via inversion (nox -s coverage_report: 97.3%, full behave suite green; nox -s lint and nox -s typecheck green). The post-fix refusal message (...global safety is true, skill safety is false.) matches the asserted substring, so the scenario will pass once the fix lands.

The one blocking problem is that the spec correction this entire PR is premised on does not exist in the repository. Per the reviewer instruction to drop items already decided out-of-scope or deferred: there are no PR comments or responses on !192 (0 comments, 0 reviews, 0 inline threads), and neither #189 nor #190 records any deferral — both tickets affirmatively claim the D-9 text was "amended 2026-11-25", which is factually not the case in the repo, so the item stays in scope.

Critical Issues

None.

Major Issues

  1. The cited "amended 2026-11-25" D-9 correction is not committed anywhere — docs/adr/ADR-2034-skill-package-support.md (D-9, "Global safety is false", ~line 405) and docs/index.md §4.4.8 (~line 607) still normatively specify the OR composition ("either this agent's own safe_mode … or the invocation context already carries _unsafe_mode: true"). Verified: no branch (this PR branch, develop, master, all remote branches) contains a 2026-11-25 revision of either file, no commit since 2026-11-24 touched them, the ADR revision history's latest entry is 2026-11-09, and no open PR or tracked issue commits the amendment (only open PRs: !192 and the fix !193). PR !193's description states the doc updates are "uncommitted, pre-existing … not part of this PR's commit" — i.e., the correction lives only in an uncommitted working tree and is at risk of never landing. If !192 and !193 merge as-is, develop will have committed tests and code enforcing AND while the authoritative spec mandates OR — a direct spec/implementation contradiction under the project rule that the specification is the source of truth. The tickets also cite a nonexistent "A-14" alternative (the ADR ends at A-13).
    Recommendation: commit the D-9 + §4.4.8 + docs/tools/safe-mode.md amendment — most naturally as a docs commit in this PR (its entire premise is the corrected D-9 text) or in a dedicated docs PR merged before or with !193 — and correct the "amended 2026-11-25" citations in #189/#190 (and the A-14 reference in #189) once it lands.

Minor Issues

  1. Assertion pins only half of the refusal signature — features/agent_skills.feature:764. The sibling refusal scenarios assert both halves ("global safety is true" and "skill safety is false", plus the resource path); this scenario asserts only "global safety is true". After the fix, the refusal message will read "...global safety is true, skill safety is false.", so adding And the skill tool should fail with message containing "skill safety is false" would prove the gate closed for the exact D-9 reason (skill opted in, global half closed) and would catch an implementation that refuses all non-standard reads unconditionally. This changes nothing about today's inversion behavior (the first assert fails identically), so it can also be folded into !193 when the tag is removed — but it is cheap to do here.

Nits

  1. No CHANGELOG.md entry (CONTRIBUTING PR rule 6). !193's changelog entry covers the overall #189 item, so this is procedural only and not blocking per this review's scope.

Summary

A well-executed TDD capture: exactly the missing quadrant (agent's own safe_mode still true + context _unsafe_mode: true), reusing all existing steps, correctly tagged, and proven both ways locally (fails with AssertionError without the tag; passes via inversion with it; full suite + coverage 97.3%, lint, and typecheck all green on this commit). The single blocker is traceability: the corrected D-9 / §4.4.8 text that the PR (and tickets #189/#190) cite as "amended 2026-11-25" has never been committed to the repository and is tracked nowhere, which would leave the committed spec contradicting the committed tests and code once !193 merges. Land the spec amendment (here or alongside !193) and this is good to merge. Note: no gism0 MCP tools were available, so no ticket memory journal was consulted.

## PR Review: !192 (Ticket #190) ### Verdict: Request Changes The TDD scenario itself is correct, minimal, and verified end-to-end locally: it is a single atomic commit on `develop` touching only `features/agent_skills.feature`, all steps reuse existing definitions, the tag trio matches CONTRIBUTING's TDD rules (`@tdd_issue_189` correctly references the *bug* issue), and the failure path raises only `AssertionError`. Local verification: with the tag removed the scenario fails at the `Then` step with `ASSERT FAILED: Expected an ExecutionError but none was raised` (bug genuinely reproduced — under the current OR composition the read succeeds), and with the tag in place it passes via inversion (`nox -s coverage_report`: 97.3%, full behave suite green; `nox -s lint` and `nox -s typecheck` green). The post-fix refusal message (`...global safety is true, skill safety is false.`) matches the asserted substring, so the scenario will pass once the fix lands. The one blocking problem is that the spec correction this entire PR is premised on does **not exist in the repository**. Per the reviewer instruction to drop items already decided out-of-scope or deferred: there are no PR comments or responses on !192 (0 comments, 0 reviews, 0 inline threads), and neither #189 nor #190 records any deferral — both tickets affirmatively claim the D-9 text was "amended 2026-11-25", which is factually not the case in the repo, so the item stays in scope. ### Critical Issues None. ### Major Issues 1. **The cited "amended 2026-11-25" D-9 correction is not committed anywhere** — `docs/adr/ADR-2034-skill-package-support.md` (D-9, "Global safety is false", ~line 405) and `docs/index.md` §4.4.8 (~line 607) still normatively specify the OR composition ("*either* this agent's own `safe_mode` … *or* the invocation context already carries `_unsafe_mode: true`"). Verified: no branch (this PR branch, `develop`, `master`, all remote branches) contains a 2026-11-25 revision of either file, no commit since 2026-11-24 touched them, the ADR revision history's latest entry is 2026-11-09, and no open PR or tracked issue commits the amendment (only open PRs: !192 and the fix !193). PR !193's description states the doc updates are "uncommitted, pre-existing … not part of this PR's commit" — i.e., the correction lives only in an uncommitted working tree and is at risk of never landing. If !192 and !193 merge as-is, `develop` will have committed tests and code enforcing AND while the authoritative spec mandates OR — a direct spec/implementation contradiction under the project rule that the specification is the source of truth. The tickets also cite a nonexistent "A-14" alternative (the ADR ends at A-13). **Recommendation:** commit the D-9 + §4.4.8 + `docs/tools/safe-mode.md` amendment — most naturally as a docs commit in this PR (its entire premise is the corrected D-9 text) or in a dedicated docs PR merged before or with !193 — and correct the "amended 2026-11-25" citations in #189/#190 (and the A-14 reference in #189) once it lands. ### Minor Issues 1. **Assertion pins only half of the refusal signature** — `features/agent_skills.feature:764`. The sibling refusal scenarios assert both halves ("global safety is true" **and** "skill safety is false", plus the resource path); this scenario asserts only `"global safety is true"`. After the fix, the refusal message will read `"...global safety is true, skill safety is false."`, so adding `And the skill tool should fail with message containing "skill safety is false"` would prove the gate closed for the exact D-9 reason (skill opted in, global half closed) and would catch an implementation that refuses *all* non-standard reads unconditionally. This changes nothing about today's inversion behavior (the first assert fails identically), so it can also be folded into !193 when the tag is removed — but it is cheap to do here. ### Nits 1. No `CHANGELOG.md` entry (CONTRIBUTING PR rule 6). !193's changelog entry covers the overall #189 item, so this is procedural only and not blocking per this review's scope. ### Summary A well-executed TDD capture: exactly the missing quadrant (agent's own `safe_mode` still `true` + context `_unsafe_mode: true`), reusing all existing steps, correctly tagged, and proven both ways locally (fails with `AssertionError` without the tag; passes via inversion with it; full suite + coverage 97.3%, lint, and typecheck all green on this commit). The single blocker is traceability: the corrected D-9 / §4.4.8 text that the PR (and tickets #189/#190) cite as "amended 2026-11-25" has never been committed to the repository and is tracked nowhere, which would leave the committed spec contradicting the committed tests and code once !193 merges. Land the spec amendment (here or alongside !193) and this is good to merge. Note: no gism0 MCP tools were available, so no ticket memory journal was consulted.
@ -751,0 +761,4 @@
And the invocation context is globally unsafe
When I create the ToolAgent
And I read resource "fixtures/sample.pdf" via the skill tool for skill "pdf-processing"
Then the skill tool should fail with message containing "global safety is true"
Member

Minor: the sibling refusal scenarios assert both halves of the gate (e.g. And the skill tool should fail with message containing "skill safety is false" plus the resource path). Suggest adding the same here so the assertion pins the exact D-9 refusal signature ("...global safety is true, skill safety is false.") rather than just the global half — this would also catch an implementation that refuses all non-standard reads unconditionally. No effect on today's inversion (the first assert fails identically); fine to fold into !193 when the tag is removed if preferred.

Minor: the sibling refusal scenarios assert both halves of the gate (e.g. `And the skill tool should fail with message containing "skill safety is false"` plus the resource path). Suggest adding the same here so the assertion pins the exact D-9 refusal signature ("...global safety is true, skill safety is false.") rather than just the global half — this would also catch an implementation that refuses all non-standard reads unconditionally. No effect on today's inversion (the first assert fails identically); fine to fold into !193 when the tag is removed if preferred.
CoreRasurae force-pushed tdd/m1-skill-gate-global-safety-and from f95e162697
Some checks failed
CI / security (pull_request) Successful in 1m19s
CI / lint (pull_request) Successful in 1m24s
CI / typecheck (pull_request) Successful in 1m35s
CI / build (pull_request) Successful in 49s
CI / quality (pull_request) Successful in 3m15s
CI / integration_tests (pull_request) Successful in 4m49s
CI / unit_tests (pull_request) Successful in 6m50s
CI / coverage (pull_request) Successful in 6m30s
CI / benchmark (pull_request) Has been cancelled
CI / status-check (pull_request) Successful in 2s
to d186c6e146
Some checks failed
CI / lint (pull_request) Successful in 44s
CI / typecheck (pull_request) Successful in 1m26s
CI / security (pull_request) Successful in 1m8s
CI / quality (pull_request) Successful in 1m19s
CI / build (pull_request) Successful in 2m6s
CI / integration_tests (pull_request) Successful in 4m9s
CI / unit_tests (pull_request) Successful in 7m21s
CI / benchmark (pull_request) Failing after 42m39s
CI / coverage (pull_request) Successful in 6m38s
CI / status-check (pull_request) Successful in 2s
CI / lint (push) Successful in 44s
CI / typecheck (push) Successful in 1m47s
CI / security (push) Successful in 1m11s
CI / quality (push) Successful in 1m45s
CI / build (push) Successful in 1m44s
CI / integration_tests (push) Successful in 3m9s
CI / unit_tests (push) Successful in 7m33s
CI / coverage (push) Successful in 7m22s
CI / status-check (push) Successful in 3s
CI / benchmark (push) Failing after 17m7s
2026-11-25 23:11:19 +00:00
Compare
CoreRasurae left a comment

Addressed in commit d186c6e (amended — this is a single-commit TDD issue, #190, so the fix was folded into the same commit rather than added as a new one, per CONTRIBUTING's single-commit-per-issue rule):

  • Major issue (docs amendment missing): confirmed the finding — docs/adr/ADR-2034-skill-package-support.md D-9, docs/index.md §4.4.8, docs/actor-registry-standard.md §16.1, and docs/tools/safe-mode.md were indeed uncommitted anywhere. Landed the full D-9 correction (OR→AND) and D-11 addition in this commit, alongside the regression test it motivates. This also resolves the "A-14 doesn't exist" sub-point — the ADR draft already defines A-14/A-15 as part of this same amendment, so once committed the citation is correct.
  • Minor issue (assertion pins only half the refusal signature): added And the skill tool should fail with message containing "skill safety is false" to the scenario, matching the sibling refusal scenarios.
  • Nit (no CHANGELOG entry): added one, scoped to the spec correction landing in this commit (phrased as an in-progress change, not a fix, since the code change itself hasn't merged yet).

Verified locally: nox -s lint, nox -s format -- --check, nox -s typecheck, nox -s unit_tests (full suite, 3362/3362; scoped features/agent_skills.feature, 152/152), nox -s docs all green. Confirmed via a coverage-delta check that this feature's own scenarios fully exercise ToolAgent._is_global_unsafe and both gate_open call sites (no missing lines in that region) — no src/ changed in this commit, so the full-suite coverage/security/dead-code/complexity/build/integration gates are unaffected and weren't re-run.

Re-requesting review.

Addressed in commit d186c6e (amended — this is a single-commit TDD issue, #190, so the fix was folded into the same commit rather than added as a new one, per CONTRIBUTING's single-commit-per-issue rule): - **Major issue (docs amendment missing)**: confirmed the finding — `docs/adr/ADR-2034-skill-package-support.md` D-9, `docs/index.md` §4.4.8, `docs/actor-registry-standard.md` §16.1, and `docs/tools/safe-mode.md` were indeed uncommitted anywhere. Landed the full D-9 correction (OR→AND) and D-11 addition in this commit, alongside the regression test it motivates. This also resolves the "A-14 doesn't exist" sub-point — the ADR draft already defines A-14/A-15 as part of this same amendment, so once committed the citation is correct. - **Minor issue (assertion pins only half the refusal signature)**: added `And the skill tool should fail with message containing "skill safety is false"` to the scenario, matching the sibling refusal scenarios. - **Nit (no CHANGELOG entry)**: added one, scoped to the spec correction landing in this commit (phrased as an in-progress change, not a fix, since the code change itself hasn't merged yet). Verified locally: `nox -s lint`, `nox -s format -- --check`, `nox -s typecheck`, `nox -s unit_tests` (full suite, 3362/3362; scoped `features/agent_skills.feature`, 152/152), `nox -s docs` all green. Confirmed via a coverage-delta check that this feature's own scenarios fully exercise `ToolAgent._is_global_unsafe` and both `gate_open` call sites (no missing lines in that region) — no src/ changed in this commit, so the full-suite coverage/security/dead-code/complexity/build/integration gates are unaffected and weren't re-run. Re-requesting review.
hurui200320 left a comment

PR Review: !192 (Ticket #190)

Verdict: Approve

All three items from the previous review round are addressed in the amended commit d186c6e and verified against the latest code. Everything claimed in the author's response checks out locally.

Re-verification of previously reported items:

  1. Major — "amended 2026-11-25" D-9 correction not committed anywhere: RESOLVED. The full spec amendment is now committed in d186c6e and is internally consistent across all four files: docs/adr/ADR-2034-skill-package-support.md (D-9 "Global safety" corrected OR→AND with the correction note, new D-11, rejected alternatives A-14/A-15 — which resolves the former "A-14 doesn't exist" sub-point — consequences, risks, and a 2026-11-25 Revision History entry), docs/index.md §4.4.8 (AND wording + "Either alone is insufficient", patch bump to 1.10.1 with matching revision-history entry, D-11 referenced under "Resolution and validation"), docs/actor-registry-standard.md (§16.1 safe-mode/resource consistency rule, §16.3 example clarified, §15 version line + history bumped to 1.3.0), and docs/tools/safe-mode.md (gate composition corrected + D-11 load-time audit note). A repo-wide grep finds no remaining doc text still describing the OR composition. The D-11 spec/code gap is intentionally staged: its implementation is tracked in open issue #191, and the D-9 code fix is PR !193, whose branch is already stacked directly on d186c6e (verified: origin/bugfix/m1-skill-gate-global-safety-and = d186c6e + d1ee3c0), so merge order is conflict-free and the spec and its enforcing code land together on develop.
  2. Minor — assertion pinned only half the refusal signature: RESOLVED. The scenario now also asserts And the skill tool should fail with message containing "skill safety is false", matching the sibling refusal scenarios. Verified from code that the post-fix path reaches the gate refusal branch (not a "resource not found" error): _require_skill_resource looks up the validated catalogue regardless of gate state, and _read_skill_resource raises the gate ExecutionError for a non-standard class when closed — producing exactly "global safety is true, skill safety is false.". So the scenario will genuinely pass once !193 removes the tag (it does), and the second assertion guards against a blanket refusal of all non-standard reads.
  3. Nit — missing CHANGELOG entry: RESOLVED. Entry added under ### Changed, describing the end state of the unreleased changes.

Local verification (authoritative, on d186c6e):

  • nox -s unit_tests -- features/agent_skills.feature: 152/152 scenarios pass (the new TDD scenario passes via @tdd_expected_fail inversion).
  • Tag removed locally: the scenario fails at the first Then with ASSERT FAILED: Expected an ExecutionError but none was raised — a pure AssertionError, so the inversion policy handles it correctly, and the bug is genuinely reproduced against current develop (working tree restored afterwards).
  • nox -s lint, nox -s typecheck (0 errors), nox -s docs: all green.
  • No src/ changes, so coverage/other gates are structurally unaffected (author reports 97.3% ≥ 97% threshold; full suite 3362/3362).
  • All acceptance criteria of ticket #190 verified: tag trio correct (@tdd_issue @tdd_issue_189 @tdd_expected_fail, referencing the bug issue #189), agent's own safe_mode left at default true (config omits it; ToolAgent defaults to True), every D-8 class fixture reused with fixtures/sample.pdf, AssertionError-only failure, all steps reused from the shared steps file with no new definitions, single amended commit whose first line matches the Metadata Commit Message exactly, branch tdd/m1-skill-gate-global-safety-and matches Metadata, based on develop, with !193 properly stacked behind it.

(Note: no gism0 MCP tools available in this environment, so no ticket memory journal was consulted; tickets #189/#190 and prior PR discussion were read directly from Forgejo.)

Critical Issues

None.

Major Issues

None.

Minor Issues

None.

Nits

  1. CHANGELOG.md:12 — the trailing (issue #189) scopes the whole bullet, but its second sentence ("a skill left in safe mode can no longer bundle a script or non-standard resource") corresponds to ADR-2034 D-11, whose implementation is tracked as #191, not #189. Purely a reference-precision point in a permanent record; harmless and safe to leave as-is (or amend opportunistically in !193's changelog touch). Non-blocking.

Summary

A well-executed TDD capture, now complete: the missing gate quadrant (agent's own safe_mode still true + context _unsafe_mode: true) is pinned exactly, every step is reused, tags are correct, and the failure is proven both ways locally (fails with AssertionError without the tag; passes via inversion with it; 152/152 in the touched feature, lint/typecheck/docs green). The previous traceability blocker is fully resolved — the corrected D-9/D-11 spec text is committed in the same commit as the regression it motivates, D-11's implementation has its own tracked issue (#191), and the fix PR !193 is stacked on this commit with the tag removal and sibling-scenario updates already in place. Good to merge; merge !192 before !193.

## PR Review: !192 (Ticket #190) ### Verdict: Approve All three items from the previous review round are addressed in the amended commit d186c6e and verified against the latest code. Everything claimed in the author's response checks out locally. **Re-verification of previously reported items:** 1. **Major — "amended 2026-11-25" D-9 correction not committed anywhere: RESOLVED.** The full spec amendment is now committed in d186c6e and is internally consistent across all four files: `docs/adr/ADR-2034-skill-package-support.md` (D-9 "Global safety" corrected OR→AND with the correction note, new D-11, rejected alternatives A-14/A-15 — which resolves the former "A-14 doesn't exist" sub-point — consequences, risks, and a 2026-11-25 Revision History entry), `docs/index.md` §4.4.8 (AND wording + "Either alone is insufficient", patch bump to 1.10.1 with matching revision-history entry, D-11 referenced under "Resolution and validation"), `docs/actor-registry-standard.md` (§16.1 safe-mode/resource consistency rule, §16.3 example clarified, §15 version line + history bumped to 1.3.0), and `docs/tools/safe-mode.md` (gate composition corrected + D-11 load-time audit note). A repo-wide grep finds no remaining doc text still describing the OR composition. The D-11 spec/code gap is intentionally staged: its implementation is tracked in open issue #191, and the D-9 code fix is PR !193, whose branch is already stacked directly on d186c6e (verified: `origin/bugfix/m1-skill-gate-global-safety-and` = d186c6e + d1ee3c0), so merge order is conflict-free and the spec and its enforcing code land together on `develop`. 2. **Minor — assertion pinned only half the refusal signature: RESOLVED.** The scenario now also asserts `And the skill tool should fail with message containing "skill safety is false"`, matching the sibling refusal scenarios. Verified from code that the post-fix path reaches the gate refusal branch (not a "resource not found" error): `_require_skill_resource` looks up the validated catalogue regardless of gate state, and `_read_skill_resource` raises the gate `ExecutionError` for a non-standard class when closed — producing exactly `"global safety is true, skill safety is false."`. So the scenario will genuinely pass once !193 removes the tag (it does), and the second assertion guards against a blanket refusal of all non-standard reads. 3. **Nit — missing CHANGELOG entry: RESOLVED.** Entry added under `### Changed`, describing the end state of the unreleased changes. **Local verification (authoritative, on d186c6e):** - `nox -s unit_tests -- features/agent_skills.feature`: **152/152 scenarios pass** (the new TDD scenario passes via `@tdd_expected_fail` inversion). - Tag removed locally: the scenario fails at the first `Then` with `ASSERT FAILED: Expected an ExecutionError but none was raised` — a pure `AssertionError`, so the inversion policy handles it correctly, and the bug is genuinely reproduced against current `develop` (working tree restored afterwards). - `nox -s lint`, `nox -s typecheck` (0 errors), `nox -s docs`: all green. - No `src/` changes, so coverage/other gates are structurally unaffected (author reports 97.3% ≥ 97% threshold; full suite 3362/3362). - All acceptance criteria of ticket #190 verified: tag trio correct (`@tdd_issue @tdd_issue_189 @tdd_expected_fail`, referencing the *bug* issue #189), agent's own `safe_mode` left at default `true` (config omits it; `ToolAgent` defaults to `True`), `every D-8 class` fixture reused with `fixtures/sample.pdf`, `AssertionError`-only failure, all steps reused from the shared steps file with no new definitions, single amended commit whose first line matches the Metadata Commit Message exactly, branch `tdd/m1-skill-gate-global-safety-and` matches Metadata, based on `develop`, with !193 properly stacked behind it. (Note: no gism0 MCP tools available in this environment, so no ticket memory journal was consulted; tickets #189/#190 and prior PR discussion were read directly from Forgejo.) ### Critical Issues None. ### Major Issues None. ### Minor Issues None. ### Nits 1. `CHANGELOG.md:12` — the trailing `(issue #189)` scopes the whole bullet, but its second sentence ("a skill left in safe mode can no longer bundle a script or non-standard resource") corresponds to ADR-2034 D-11, whose implementation is tracked as #191, not #189. Purely a reference-precision point in a permanent record; harmless and safe to leave as-is (or amend opportunistically in !193's changelog touch). Non-blocking. ### Summary A well-executed TDD capture, now complete: the missing gate quadrant (agent's own `safe_mode` still `true` + context `_unsafe_mode: true`) is pinned exactly, every step is reused, tags are correct, and the failure is proven both ways locally (fails with `AssertionError` without the tag; passes via inversion with it; 152/152 in the touched feature, lint/typecheck/docs green). The previous traceability blocker is fully resolved — the corrected D-9/D-11 spec text is committed in the same commit as the regression it motivates, D-11's implementation has its own tracked issue (#191), and the fix PR !193 is stacked on this commit with the tag removal and sibling-scenario updates already in place. Good to merge; merge !192 before !193.
CoreRasurae deleted branch tdd/m1-skill-gate-global-safety-and 2026-11-26 11:06:34 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveractors-core!192
No description provided.