fix(cleanup): invalidate sandbox_dirs_cache after purge (#7527) #11091

Merged
HAL9000 merged 10 commits from fix-invalidate-sandbox-dirs-cache-after-purge-7527 into master 2026-06-12 16:23:52 +00:00

10 Commits

Author SHA1 Message Date
cleveragents-auto 3e34c5a5fc chore: worker ruff auto-fix (pre-push lint gate)
CI / lint (pull_request) Successful in 37s
CI / quality (pull_request) Successful in 1m7s
CI / build (pull_request) Successful in 44s
CI / typecheck (pull_request) Successful in 1m21s
CI / security (pull_request) Successful in 1m22s
CI / helm (pull_request) Successful in 58s
CI / push-validation (pull_request) Successful in 25s
CI / unit_tests (pull_request) Successful in 5m11s
CI / docker (pull_request) Successful in 1m37s
CI / integration_tests (pull_request) Successful in 8m45s
CI / coverage (pull_request) Successful in 9m24s
CI / status-check (pull_request) Successful in 4s
2026-06-12 12:08:13 -04:00
HAL9000 a51149a2e1 test(merge): scope ca_merge_ leftover check to scenario-local tmpdirs
The "no temporary merge files should remain on disk" step in
features/sandbox_merge_strategies.feature:36 scanned global
tempfile.gettempdir() for any ca_merge_* entry and asserted zero. Under
behave-parallel --processes 8 a sibling scenario's in-flight tmpdir in
the same shared /tmp could be observed mid-merge and trip the
assertion, even though GitMergeStrategy.merge cleans up its own tmpdir
in a finally block
(src/cleveragents/infrastructure/sandbox/merge.py:151-155).

Patch tempfile.mkdtemp inside cleveragents.infrastructure.sandbox.merge
for the @when step to track the tmpdirs this scenario's merge actually
creates, then assert those specific paths are gone in the @then step.
Production merge code is unchanged; the contract under test
(cleanup-on-success) is preserved; sibling scenarios sharing /tmp no
longer race the assertion.

ISSUES CLOSED: #7527
2026-06-12 12:08:13 -04:00
controller-ci-rerun 138002c31f chore: re-trigger CI [controller] 2026-06-12 12:08:13 -04:00
HAL9000 9d5128c265 fix(cleanup): fix CI failures and address review feedback (#7527)
- Remove unused typing.Any import from dirs_cache.py (ruff lint)
- Collapse multiline expressions without trailing commas (ruff format)
- Rename ambiguous behave step "the result should be {True,False}" to
  "the dir membership result should be {True,False}" — resolves conflict
  with existing step @then('the result should be {expected}') in
  cli_steps.py that caused all 31 feature workers to crash on load
- Add self._sandbox_dirs_cache = None invalidation to
  CleanupService._purge_sandboxes() — the actual fix for issue #7527;
  without this, subsequent scan() calls return stale deleted paths
- Fix CONTRIBUTORS.md PR reference from #10989 to #11091

ISSUES CLOSED: #7527
2026-06-12 12:08:13 -04:00
HAL9000 9801d34cad fix(cleanup): invalidate sandbox_dirs_cache after purge (#7527)
Adds SandboxDirsCache to track filesystem paths of sandbox-created directories indexed by plan_id. Cache is purged in cleanup_all(), cleanup_abandoned(), clear_sandbox_dirs_cache(), and the at-exit handler matching the existing clear_boundary_cache() invalidation.
2026-06-12 12:08:13 -04:00
clever-agent e716b6015c build: Had to re-restrict the permissions on the agents, they were misbehaving 2026-06-12 12:08:13 -04:00
HAL9000 ad88422efe docs(spec): clarify layer boundary DI exception, ULID scope, TUI/ACMS gap-fill [AUTO-ARCH-1]
Add targeted clarifications to docs/specification.md to fill identified gaps:

1. Layer boundary DI Container Exception (Cross-Milestone Architectural Invariants)
2. ULID Scope Clarification - domain vs internal identifiers
3. ACMS Pipeline Protocol Contracts with storage tiers and budget protocol
4. TUI Component Interfaces with verifiable checks

Co-authored-by: CleverAgents Bot <bot@cleveragents.com>

ISSUES CLOSED: #10451
2026-06-12 12:08:13 -04:00
clever-agent f09a59cc2b build: testing agents with allow first permissions 2026-06-12 12:08:13 -04:00
clever-agent e62a70b086 build: implement explicit-vs-fetched variable propagation across all agents
All agents now track which variables were explicitly present in their prompt
versus fetched from environment variables or git remote. When constructing
subagent prompts, only explicitly-present variables are included. Fetched
variables are omitted, allowing each subagent to fetch them independently.

This prevents credentials and other fetched values from being garbled as they
propagate through multiple LLM prompt layers.

Affected agents:
- auto-agents (primary orchestrator)
- implementation-supervisor, pr-merge-supervisor, pr-review-supervisor
- supervisor (generic)
- implementation-worker, pr-merge-worker, pr-review-worker
- task-implementor, tier-dispatcher
- work-group-util, git-clone-util, git-push-util, git-checkout-util
2026-06-12 12:08:13 -04:00
clever-agent 8ffa9a73ec build: added critical rule clearly stating no question asking 2026-06-12 12:08:13 -04:00