chore(ci): fix pre-commit hook failures

Fix JSON syntax errors in .devcontainer/devcontainer.json (removed
invalid JS-style // comments) and .devcontainer/opencode.json (removed
90+ trailing commas). Apply auto-fixes for end-of-file and trailing
whitespace issues across 100+ files. Fix SIM105 ruff violations in
benchmarks/core_circuit_breaker_bench.py (use contextlib.suppress).

Note: The security fix from issue #7478 (validate_path startswith bypass)
was already delivered to master in commit e18ac5f2. This PR as currently
structured is non-atomic (35 commits across 10+ issues) and needs
significant restructure before merge. This commit only addresses the
CI/pre-commit failures.

ISSUES CLOSED: #7478
This commit is contained in:
2026-05-17 14:58:50 +00:00
committed by drew
parent 90083e3ae5
commit f808abff86
101 changed files with 227 additions and 372 deletions
-1
View File
@@ -456,4 +456,3 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
renders permission requests directly in the conversation stream for single-file
operations. Users can allow/reject with single-key shortcuts (`a`/`A`/`r`/`R`),
navigate with arrow keys, confirm with `Enter`, or press `v` to open the full
@@ -173,17 +173,17 @@ During the Strategize phase, the strategy actor follows a structured reasoning l
def strategize(plan, context):
# System has already created the prompt_definition root decision
# Invariant Reconciliation Actor has already recorded invariant_enforced decisions
# Actor receives: plan description, enforced invariants, project context
while unresolved_ambiguities_remain(plan, context):
# 1. Identify a choice point
choice_point = analyze_context_for_ambiguity(context)
# 2. Evaluate options
options = generate_options(choice_point, context)
best_option = evaluate_options(options, context, invariants)
# 3. Record the decision via tool call
decision_id = record_decision(
decision_type = choice_point.type, # strategy_choice, subplan_spawn, etc.
@@ -193,10 +193,10 @@ def strategize(plan, context):
confidence_score = best_option.confidence,
rationale = best_option.rationale
)
# 4. Decision becomes part of the actor's context for subsequent reasoning
context.add_decision(decision_id)
# Result: a complete decision tree for this plan's strategy
```
@@ -165,7 +165,7 @@ When `agents plan correct <decision_id> --mode=revert` targets an Execute-phase
WARNING: The following resources cannot be rolled back (sandbox strategy: none):
- local/external-api
- local/notification-service
Resource changes since this decision will persist.
Proceed with rollback of other resources? [y/N]
```
@@ -179,7 +179,7 @@ When `agents plan correct <decision_id> --mode=revert` targets an Execute-phase
irreversible external effects:
- local/deploy-to-staging (1 invocation) — external deployment
- local/send-notification (2 invocations) — emails sent
Sandbox resources can be rolled back, but external effects cannot be undone.
Proceed? [y/N]
```
@@ -239,29 +239,29 @@ def compute_affected_subtree(target_decision_id: str) -> tuple[set[str], set[str
affected_decisions = {target_decision_id}
affected_plans = set()
queue = [target_decision_id]
while queue:
current = queue.pop(0)
# Follow structural tree children
children = db.query(
"SELECT decision_id FROM decisions "
"WHERE parent_decision_id = :current AND superseded_by IS NULL",
current=current
)
# Follow influence DAG dependents
dependents = db.query(
"SELECT downstream_ref FROM decision_dependencies "
"WHERE upstream_decision_id = :current AND dependency_type = 'decision'",
current=current
)
for decision_id in children | dependents:
if decision_id not in affected_decisions:
affected_decisions.add(decision_id)
queue.append(decision_id)
# Collect affected child plans
child_plans = db.query(
"SELECT downstream_ref FROM decision_dependencies "
@@ -269,7 +269,7 @@ def compute_affected_subtree(target_decision_id: str) -> tuple[set[str], set[str
current=current
)
affected_plans.update(child_plans)
return affected_decisions, affected_plans
```
@@ -76,7 +76,7 @@ blockdiag {
label = "Tier 2: Workers";
color = "#FCE4EC";
"Implementation Worker\n(issue-impl mode)" [color = "#C62828", textcolor = "#fff"];
"PR Reviewer" [color = "#C62828", textcolor = "#fff"];
"UAT Worker" [color = "#C62828", textcolor = "#fff"];
"Bug Hunter Worker" [color = "#C62828", textcolor = "#fff"];
@@ -3379,10 +3379,10 @@ FG --> BGR : cleanup old tickets
note bottom of FG
Tracking issues follow format:
[PREFIX] Type (Cycle N)
Announcements follow format:
[PREFIX] Announce: message
ALL carry "Automation Tracking" label
end note
@enduml
+1 -1
View File
@@ -240,7 +240,7 @@ for issue in automation_tracking_issues:
expected_interval = get_expected_interval(issue.agent_prefix, issue.type)
time_since_creation = now() - issue.created_at
staleness_threshold = expected_interval * 1.2 # 20% tolerance
if time_since_creation > staleness_threshold:
mark_agent_as_stalled(issue.agent_prefix)
trigger_recovery_actions(issue.agent_prefix, issue)
+28 -29
View File
@@ -59,7 +59,7 @@ Plan: Convert Firefox Renderer to Rust
├── [<span style="color: magenta;">strategy_choice</span>] Architecture approach: Start with leaf modules, work inward
│ Context: Analyzed module dependency graph, 2,847 modules total
│ Resources: module_graph.json, architecture_docs.md
├── [<span style="color: magenta;">subplan_parallel_spawn</span>] Phase 1: Convert utility libraries (no external deps)
│ └── [<span style="color: magenta;">subplan_spawn</span>] Convert string_utils module
│ └── Plan: 01KH29R8WPKPBHRY7Q0NA9XW86
@@ -87,21 +87,21 @@ During the Strategize phase, the strategy actor employs several mechanisms to co
<span style="opacity: 0.7;"># Pseudocode of what happens inside a strategy actor</span>
<span style="color: magenta; font-weight: 600;">def</span> <span style="color: cyan; font-weight: 600;">compute_closure_for_refactoring</span>(target_module):
closure = ResourceClosure()
<span style="opacity: 0.7;"># Direct file dependencies</span>
closure.add_files(find_imports(target_module))
closure.add_files(find_includes(target_module))
<span style="opacity: 0.7;"># Symbol dependencies</span>
<span style="color: magenta; font-weight: 600;">for</span> symbol <span style="color: magenta; font-weight: 600;">in</span> extract_exported_symbols(target_module):
closure.add_files(find_symbol_usage(symbol, scope=<span style="color: #66cc66;">&#x27;project&#x27;</span>))
<span style="opacity: 0.7;"># Test dependencies</span>
closure.add_files(find_tests_for_module(target_module))
<span style="opacity: 0.7;"># Build system dependencies</span>
closure.add_files(find_build_references(target_module))
<span style="color: magenta; font-weight: 600;">return</span> closure
</code></pre></div>
@@ -117,10 +117,10 @@ During the Strategize phase, the strategy actor employs several mechanisms to co
<span style="color: cyan; font-weight: 600;">decision_type</span>: subplan_spawn
<span style="color: cyan; font-weight: 600;">chosen_option</span>: <span style="color: #66cc66;">&quot;Refactor authentication module&quot;</span>
<span style="color: cyan; font-weight: 600;">downstream_plan_ids</span>: [&quot;plan-auth-refactor-123&quot;]
<span style="color: cyan; font-weight: 600;">artifacts_produced</span>:
<span style="color: cyan; font-weight: 600;">artifacts_produced</span>:
- <span style="color: cyan;">auth_module_files</span>: [&quot;auth.rs&quot;, &quot;auth_test.rs&quot;, &quot;auth_types.rs&quot;]
- <span style="color: cyan;">api_updates</span>: [&quot;api/v2/login.rs&quot;, &quot;api/v2/logout.rs&quot;]
<span style="opacity: 0.7;"># Parallel group of child plans</span>
<span style="color: cyan; font-weight: 600;">decision_type</span>: subplan_parallel_spawn
<span style="color: cyan; font-weight: 600;">chosen_option</span>: <span style="color: #66cc66;">&quot;Convert utility libraries in parallel&quot;</span>
@@ -137,14 +137,14 @@ STRATEGIZE PHASE:
- Identifies 847 C++ files in netwerk/ directory
- Traces public API surface (237 exported functions)
- Maps internal dependencies (1,432 internal calls)
2. Compute minimal closure for Phase 1 (DNS resolver):
- Core files: dns_resolver.cpp, dns_cache.cpp, dns_config.cpp (3 files)
- Direct dependencies: 12 files in netwerk/base/
- Test files: 8 test files specific to DNS
- Build files: 2 moz.build files
- Total closure: 25 files (not 847!)
3. Generate execution blueprint with child plans:
- [<span style="color: magenta;">subplan_parallel_spawn</span>] DNS module conversions:
- convert-dns-types: Closure of 5 files (type definitions)
@@ -183,7 +183,7 @@ The Firefox example would decompose into ~1,000 bounded child plans (grouped via
- Sandbox A1: Contains only auth/*.cpp, auth_tests/*.cpp
- Cannot see Plan B&#x27;s intermediate states
- Cannot accidentally depend on Plan B&#x27;s half-done work
Plan B (updating API endpoints):
- Sandbox B1: Contains only api/*.cpp, api_tests/*.cpp
- Makes changes assuming current auth interface
@@ -197,13 +197,13 @@ The Firefox example would decompose into ~1,000 bounded child plans (grouped via
- <span style="color: cyan;">Coordination</span>: Git&#x27;s three-way merge algorithm
- Conflict detection: Built into Git
- <span style="color: cyan;">Rollback</span>: git reset/checkout
<span style="color: cyan; font-weight: 600;">Databases</span>:
- <span style="color: cyan;">Strategy</span>: Transaction isolation
- <span style="color: cyan;">Coordination</span>: MVCC (multi-version concurrency control)
- Conflict detection: Serialization failures
- <span style="color: cyan;">Rollback</span>: Transaction abort
Cloud Infrastructure:
- <span style="color: cyan;">Strategy</span>: Terraform workspaces
- <span style="color: cyan;">Coordination</span>: State locking
@@ -217,7 +217,7 @@ The Firefox example would decompose into ~1,000 bounded child plans (grouped via
<span style="color: magenta; font-weight: 600;">def</span> <span style="color: cyan; font-weight: 600;">merge_subplan_results</span>(subplan_results):
<span style="opacity: 0.7;"># Group by resource type</span>
by_resource = group_by_resource_type(subplan_results)
<span style="opacity: 0.7;"># Apply resource-specific merge strategies</span>
<span style="color: magenta; font-weight: 600;">for</span> resource_type, changes <span style="color: magenta; font-weight: 600;">in</span> by_resource:
<span style="color: magenta; font-weight: 600;">if</span> resource_type == <span style="color: #66cc66;">&#x27;git-checkout&#x27;</span>:
@@ -226,7 +226,7 @@ The Firefox example would decompose into ~1,000 bounded child plans (grouped via
merge_fs_changes(changes) <span style="opacity: 0.7;"># Copy-on-write reconciliation</span>
<span style="color: magenta; font-weight: 600;">elif</span> resource_type.startswith(<span style="color: #66cc66;">&#x27;database&#x27;</span>):
merge_db_changes(changes) <span style="opacity: 0.7;"># Sequential application</span>
<span style="opacity: 0.7;"># Validate merged state</span>
run_integration_tests()
</code></pre></div>
@@ -248,14 +248,14 @@ Parent Plan: Refactor auth library
├── [<span style="color: magenta;">subplan_spawn</span>] Plan 1: Update auth library interface
│ Sandbox: Only auth library files
│ Output: New interface definition
├── Barrier: Wait for Plan 1 completion
├── [<span style="color: magenta;">subplan_parallel_spawn</span>] Plans 2-16: Update each service (in parallel)
│ Each sandbox: Only that service&#x27;s files
│ Each uses: New interface from Plan 1
│ No inter-service dependencies during execution
└── Merge Phase:
- Collect all service updates
- <span style="color: yellow; font-weight: 600;">Apply</span> to main branch in order
@@ -270,7 +270,7 @@ Parent Plan: Refactor auth library
Two child plans both modify api/user.rs:
- Plan A: Adds async fn get_user_profile()
- Plan B: Adds fn validate_user_permissions()
Merge strategy:
- Git merge succeeds (different functions)
- Semantic validation ensures both functions work together
@@ -351,7 +351,7 @@ Invariants are attached at four scopes (global, project, action, plan) and manag
)
<span style="opacity: 0.7;"># Apply precedence: plan &gt; project &gt; global</span>
<span style="color: magenta; font-weight: 600;">return</span> reconciler.reconcile(raw, precedence=[<span style="color: #66cc66;">&#x27;plan&#x27;</span>, <span style="color: #66cc66;">&#x27;project&#x27;</span>, <span style="color: #66cc66;">&#x27;global&#x27;</span>])
<span style="color: magenta; font-weight: 600;">def</span> <span style="color: cyan; font-weight: 600;">collect_all_invariants</span>(self, plan):
<span style="color: #66cc66;">&quot;&quot;&quot;Collect invariants from all scopes accessible to this plan.&quot;&quot;&quot;</span>
invariants = []
@@ -361,13 +361,13 @@ Invariants are attached at four scopes (global, project, action, plan) and manag
invariants.extend(self.get_action_invariants(plan.action))
invariants.extend(self.get_plan_invariants(plan))
<span style="color: magenta; font-weight: 600;">return</span> invariants
<span style="opacity: 0.7;"># Example invariants at different scopes:</span>
<span style="opacity: 0.7;"># Global: &quot;Payment processing must be idempotent&quot;</span>
<span style="opacity: 0.7;"># Project: &quot;Database transactions must complete within 5 seconds&quot;</span>
<span style="opacity: 0.7;"># Action: &quot;Test files must not import production secrets&quot;</span>
<span style="opacity: 0.7;"># Plan: &quot;All API calls over TCP must be mocked&quot;</span>
<span style="color: magenta; font-weight: 600;">def</span> <span style="color: cyan; font-weight: 600;">check_invariant_preservation</span>(self, changes, enforced_invariants):
<span style="color: magenta; font-weight: 600;">for</span> invariant <span style="color: magenta; font-weight: 600;">in</span> enforced_invariants:
<span style="color: magenta; font-weight: 600;">if</span> <span style="color: magenta; font-weight: 600;">not</span> self.verify_invariant(invariant, changes):
@@ -407,12 +407,12 @@ PROACTIVE CONTAINMENT IN ACTION:
- Detects: PaymentService.chargeCard() called after OrderCreated event
- Semantic issue: Payment before order confirmation violates business rules
- Automatic fix: Insert OrderConfirmed event requirement
3. Validation Node Catches Edge Case:
- Discovers: Audit service expects synchronous order numbers
- Impact: Async events break compliance reporting
- Resolution: Add audit event buffer with guaranteed ordering
4. Pre-<span style="color: yellow; font-weight: 600;">Apply</span> Semantic Verification:
- Simulates production event flow
- Detects: Under high load, events can arrive out of order
@@ -520,8 +520,8 @@ agents plan tree &lt;plan_id&gt;
<span style="opacity: 0.7;"># User knows gRPC would be better for this use case</span>
agents plan correct &lt;decision_id&gt; <span style="color: cyan;">--mode</span>=revert <span style="opacity: 0.7;">\</span>
<span style="color: cyan;">--guidance</span> &quot;Use gRPC instead of REST. This service requires streaming
updates and binary protocol efficiency. Set up protocol
<span style="color: cyan;">--guidance</span> &quot;Use gRPC instead of REST. This service requires streaming
updates and binary protocol efficiency. Set up protocol
buffer definitions and generate client/server stubs.&quot;
<span style="opacity: 0.7;"># System:</span>
@@ -553,10 +553,10 @@ True autonomy isn't about removing humans - it's about the system understanding
<span style="color: #66cc66;">&#x27;risk_assessment&#x27;</span>: self.evaluate_risk(decision),
<span style="color: #66cc66;">&#x27;invariant_complexity&#x27;</span>: self.analyze_invariants(decision)
}
confidence = self.compute_confidence(factors) <span style="opacity: 0.7;"># Returns 0.01.0</span>
threshold = profile.get_threshold(decision.flag) <span style="opacity: 0.7;"># From profile</span>
<span style="color: magenta; font-weight: 600;">if</span> confidence &gt;= threshold:
<span style="color: magenta; font-weight: 600;">return</span> ProceedAutonomously(decision, confidence)
<span style="color: magenta; font-weight: 600;">else</span>:
@@ -720,4 +720,3 @@ The difference between handling a 1,000 file project and a 100,000 file project
- More validation patterns (accumulate over time)
This isn't speculative architecture astronautics - it's applying proven distributed systems principles to AI agent coordination. The innovation is in the integration, not in requiring fundamental breakthroughs.
-1
View File
@@ -224,4 +224,3 @@ additional_properties: false
# maxValue -> max_value
# schemaVersion -> schema_version
# Legacy camelCase keys emit a warning but are accepted.
-1
View File
@@ -242,4 +242,3 @@ additional_properties: false
# sideEffects -> side_effects
# toolFilter -> tool_filter
# Legacy camelCase keys emit a warning but are accepted.
+1 -1
View File
@@ -29,4 +29,4 @@ Examples in this directory demonstrate:
---
*Examples in this directory are automatically generated from successful UAT test runs.*
*Examples in this directory are automatically generated from successful UAT test runs.*
@@ -79,7 +79,7 @@ $ python -m cleveragents project list
**Expected Output:**
```
Projects
Projects
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Name ┃ Namespace ┃ Description ┃ Resources ┃ Created ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━┩
@@ -217,7 +217,7 @@ $ python -m cleveragents actor context list
**Expected Output:**
```
Context Files (1 total)
Context Files (1 total)
┏━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ File Path ┃ Type ┃ Size ┃ Added ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
@@ -292,7 +292,7 @@ $ python -m cleveragents session list
**Expected Output:**
```
Sessions
Sessions
┏━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓
┃ ID ┃ Name ┃ Actor ┃ Messages ┃ Updated ┃
┡━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩
@@ -413,7 +413,7 @@ $ python -m cleveragents project create local/my-webapp --description "A sample
# 3. List projects
$ python -m cleveragents project list
Projects
Projects
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Name ┃ Namespace ┃ Description ┃ Resources ┃ Created ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━┩
@@ -439,7 +439,7 @@ $ python -m cleveragents actor context add src/main.py
# 6. List context
$ python -m cleveragents actor context list
Context Files (1 total)
Context Files (1 total)
┏━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ File Path ┃ Type ┃ Size ┃ Added ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
@@ -465,7 +465,7 @@ $ python -m cleveragents session create
# 8. List sessions
$ python -m cleveragents session list
Sessions
Sessions
┏━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓
┃ ID ┃ Name ┃ Actor ┃ Messages ┃ Updated ┃
┡━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩
+1 -1
View File
@@ -29,4 +29,4 @@ Examples cover common data formats:
---
*Examples in this directory are automatically generated from successful UAT test runs.*
*Examples in this directory are automatically generated from successful UAT test runs.*
+1 -1
View File
@@ -95,4 +95,4 @@ Now that you've seen how to [what was built], try these variations:
---
*This example was automatically generated and verified by the CleverAgents UAT system.*
*Feature area: [area] | Test cycle: [N] | Generated: [timestamp]*
*Feature area: [area] | Test cycle: [N] | Generated: [timestamp]*
+1 -1
View File
@@ -47,4 +47,4 @@ These examples are automatically generated by our UAT system. If you'd like to s
---
*Last updated: This index is automatically maintained by the CleverAgents UAT system.*
*Last updated: This index is automatically maintained by the CleverAgents UAT system.*
+1 -1
View File
@@ -29,4 +29,4 @@ Examples demonstrate various testing patterns:
---
*Examples in this directory are automatically generated from successful UAT test runs.*
*Examples in this directory are automatically generated from successful UAT test runs.*