Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Unsupervisedcom/deepwork
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: Unsupervisedcom/deepwork
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: pre-release
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 8 commits
  • 35 files changed
  • 3 contributors

Commits on Apr 15, 2026

  1. feat: add tool requirements policy enforcement system

    Introduces a PreToolUse hook-based policy system that evaluates tool calls
    against RFC 2119-style requirements defined in .deepwork/tool_requirements/*.yml.
    Policies are checked via an HTTP sidecar server (spawned alongside the MCP server)
    using Haiku for semantic evaluation. Failed checks can be appealed via a new
    appeal_tool_requirement MCP tool. Approvals are cached with a 1-hour TTL.
    
    Key features:
    - Policy files with tools, match (param regex), requirements, extends (inheritance)
    - no_exception rules that cannot be appealed
    - Fail-closed: hook denies if MCP sidecar is unreachable
    - Loop prevention: appeal tool calls skip the hook
    - Multi-instance support via PID-keyed + session-keyed port files
    - Evaluator encapsulated behind ABC for future swap to direct API calls
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
    nhorton and claude committed Apr 15, 2026
    Configuration menu
    Copy the full SHA
    9416577 View commit details
    Browse the repository at this point in the history
  2. fix: address code review findings

    - engine.py: rename loop variable `f` to `failure` for clarity
    - sidecar.py: move `import asyncio` to module level, fix event loop leak
      with try/finally, fix inaccurate comment, add session_id validation
    - evaluator.py: change `continue` to `break` on raw JSON array parse,
      filter non-dict items in _extract_json_array
    - discovery.py: fix double-name warning message, remove dead code
    - test_engine.py: add type hints to MockEvaluator.evaluate, remove unused imports
    - test_tool_requirements_hook.py: remove redundant test
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
    nhorton and claude committed Apr 15, 2026
    Configuration menu
    Copy the full SHA
    291ab6c View commit details
    Browse the repository at this point in the history
  3. docs: update documentation for tool requirements system

    - doc/mcp_interface.md: add appeal_tool_requirement as tool #12, bump count
    - doc/architecture.md: add tool_requirements/ package and hook to structure
    - CLAUDE.md: add tool_requirements/ and hook to project structure appendix
    - src/deepwork/hooks/README.md: add tool_requirements.py to files table
    - CHANGELOG.md: add tool requirements feature to Unreleased
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
    nhorton and claude committed Apr 15, 2026
    Configuration menu
    Copy the full SHA
    0944b53 View commit details
    Browse the repository at this point in the history
  4. fix: address round-2 review findings

    - evaluator.py: fix comment accuracy, extract _filter_dicts to reduce DRY
    - discovery.py: fix diamond inheritance by copying visited set per parent
    - test_engine.py: remove redundant @pytest.mark.asyncio decorators,
      fix dict type annotation, replace internal cache access with call_count
    - test_evaluator.py: add tests for HaikuSubprocessEvaluator, deduplication,
      non-dict filtering, and invalid bracket JSON
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
    nhorton and claude committed Apr 15, 2026
    Configuration menu
    Copy the full SHA
    feb32d5 View commit details
    Browse the repository at this point in the history
  5. docs: add DW-REQ-012 requirement spec and test traceability

    - Create DW-REQ-012-tool-requirements.md with 12 sub-requirements
      covering policy format, discovery, inheritance, matching, evaluation,
      check flow, appeal, caching, hook, sidecar, multi-instance, and startup
    - Add PLUG-REQ-001.15 for the PreToolUse hook registration
    - Add requirement ID references to all test module docstrings
    - Add THIS TEST VALIDATES traceability comments to critical tests
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
    nhorton and claude committed Apr 15, 2026
    Configuration menu
    Copy the full SHA
    2174e03 View commit details
    Browse the repository at this point in the history
  6. fix: address round-3 review findings

    - DW-REQ-012.5.3: make SHOULD violation criterion concrete and testable
    - PLUG-REQ-001: fix section ordering (001.14 before 001.15)
    - test_engine.py: use two-level REQ ID format (DW-REQ-012.6 not 012.6.3)
    - test_hook.py: use two-level REQ ID format, fix traceability comment placement
    - test_evaluator.py: move tests to correct class, remove redundant decorators
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
    nhorton and claude committed Apr 15, 2026
    Configuration menu
    Copy the full SHA
    9358aee View commit details
    Browse the repository at this point in the history
  7. fix: address round-4 review findings

    - test_tool_requirements_hook.py: move import to module level (DRY)
    - test_evaluator.py: add missing blank line between classes (E302)
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
    nhorton and claude committed Apr 15, 2026
    Configuration menu
    Copy the full SHA
    012f0af View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    0e2ed75 View commit details
    Browse the repository at this point in the history
Loading