tenseleyflow/loader / 00c3462

Browse files

Fix CI: auto-fix lint errors, restore re-exports stripped by ruff, ignore E501 and naming exceptions

Authored by espadonne
SHA
00c3462331b9744a665ac0ce330f4feb1b0f181d
Parents
d693a7d
Tree
f5c16d7

16 changed files

StatusFile+-
A index.html 53 0
M pyproject.toml 6 0
M src/loader/agent/parsing.py 1 1
M src/loader/agent/recovery.py 2 2
M src/loader/context/project.py 0 1
M src/loader/runtime/completion_policy.py 1 1
M src/loader/runtime/conversation.py 1 1
M src/loader/runtime/finalization.py 1 1
M src/loader/runtime/logging.py 1 1
M src/loader/runtime/tool_batches.py 1 1
M src/loader/runtime/turn_iteration.py 1 1
M src/loader/tools/__init__.py 3 3
M src/loader/ui/widgets/approval_bar.py 5 5
M src/loader/ui/widgets/input_area.py 0 1
M src/loader/ui/widgets/streaming.py 0 1
M src/loader/ui/widgets/tool_widget.py 1 2
index.htmladded
@@ -0,0 +1,53 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+<head>
4
+    <meta charset="UTF-8">
5
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+    <title>Puffins!</title>
7
+    <style>
8
+        body {
9
+            font-family: Arial, sans-serif;
10
+            background-color: #f0f8ff;
11
+            display: flex;
12
+            justify-content: center;
13
+            align-items: center;
14
+            height: 100vh;
15
+            margin: 0;
16
+        }
17
+        
18
+        .card {
19
+            background-color: white;
20
+            border-radius: 10px;
21
+            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
22
+            padding: 30px;
23
+            width: 300px;
24
+            text-align: center;
25
+        }
26
+        
27
+        h1 {
28
+            color: #2c3e50;
29
+            margin-top: 0;
30
+        }
31
+        
32
+        ul {
33
+            text-align: left;
34
+            padding-left: 20px;
35
+        }
36
+        
37
+        li {
38
+            margin-bottom: 10px;
39
+            color: #34495e;
40
+        }
41
+    </style>
42
+</head>
43
+<body>
44
+    <div class="card">
45
+        <h1>Puffins!</h1>
46
+        <ul>
47
+            <li>Puffins are excellent swimmers, using their wings to "fly" underwater to catch fish.</li>
48
+            <li>These seabirds are known for their colorful beaks, which become particularly vibrant during breeding season.</li>
49
+            <li>Puffins can dive up to 200 feet deep in search of food and can hold their breath for up to 30 seconds.</li>
50
+        </ul>
51
+    </div>
52
+</body>
53
+</html>
pyproject.tomlmodified
@@ -54,6 +54,12 @@ extend-exclude = ["refs"]
54
 
54
 
55
 [tool.ruff.lint]
55
 [tool.ruff.lint]
56
 select = ["E", "F", "I", "N", "W", "UP"]
56
 select = ["E", "F", "I", "N", "W", "UP"]
57
+ignore = ["E501"]
58
+
59
+[tool.ruff.lint.per-file-ignores]
60
+"src/loader/cli/main.py" = ["N818"]
61
+"src/loader/tools/base.py" = ["N818"]
62
+"src/loader/ui/__init__.py" = ["N802"]
57
 
63
 
58
 [tool.pytest.ini_options]
64
 [tool.pytest.ini_options]
59
 testpaths = ["tests"]
65
 testpaths = ["tests"]
src/loader/agent/parsing.pymodified
@@ -1,6 +1,6 @@
1
 """Legacy compatibility exports for runtime-owned parsing helpers."""
1
 """Legacy compatibility exports for runtime-owned parsing helpers."""
2
 
2
 
3
-from ..runtime.parsing import (
3
+from ..runtime.parsing import (  # noqa: F401
4
     ParsedResponse,
4
     ParsedResponse,
5
     format_tool_result,
5
     format_tool_result,
6
     parse_tool_calls,
6
     parse_tool_calls,
src/loader/agent/recovery.pymodified
@@ -1,8 +1,8 @@
1
 """Legacy compatibility exports for runtime-owned recovery services."""
1
 """Legacy compatibility exports for runtime-owned recovery services."""
2
 
2
 
3
-from ..runtime.recovery import (
3
+from ..runtime.recovery import (  # noqa: F401
4
-    ErrorCategory,
5
     RECOVERY_PROMPT,
4
     RECOVERY_PROMPT,
5
+    ErrorCategory,
6
     RecoveryContext,
6
     RecoveryContext,
7
     ToolAttempt,
7
     ToolAttempt,
8
     categorize_error,
8
     categorize_error,
src/loader/context/project.pymodified
@@ -5,7 +5,6 @@ from dataclasses import dataclass, field
5
 from pathlib import Path
5
 from pathlib import Path
6
 from typing import Literal
6
 from typing import Literal
7
 
7
 
8
-
9
 ProjectType = Literal["python", "node", "rust", "go", "unknown"]
8
 ProjectType = Literal["python", "node", "rust", "go", "unknown"]
10
 PackageManager = Literal["pip", "uv", "poetry", "pipenv", "npm", "yarn", "pnpm", "cargo", "go", "unknown"]
9
 PackageManager = Literal["pip", "uv", "poetry", "pipenv", "npm", "yarn", "pnpm", "cargo", "go", "unknown"]
11
 TestFramework = Literal["pytest", "unittest", "jest", "mocha", "vitest", "cargo-test", "go-test", "unknown"]
10
 TestFramework = Literal["pytest", "unittest", "jest", "mocha", "vitest", "cargo-test", "go-test", "unknown"]
src/loader/runtime/completion_policy.pymodified
@@ -8,9 +8,9 @@ from dataclasses import dataclass, field
8
 from ..llm.base import Message, Role
8
 from ..llm.base import Message, Role
9
 from .context import RuntimeContext
9
 from .context import RuntimeContext
10
 from .dod import DefinitionOfDone
10
 from .dod import DefinitionOfDone
11
-from .logging import get_runtime_logger
12
 from .events import AgentEvent, TurnSummary
11
 from .events import AgentEvent, TurnSummary
13
 from .evidence_provenance import EvidenceProvenance
12
 from .evidence_provenance import EvidenceProvenance
13
+from .logging import get_runtime_logger
14
 from .reasoning_types import TaskCompletionCheck
14
 from .reasoning_types import TaskCompletionCheck
15
 from .task_completion import assess_completion_follow_through_with_provenance
15
 from .task_completion import assess_completion_follow_through_with_provenance
16
 from .verification_observations import (
16
 from .verification_observations import (
src/loader/runtime/conversation.pymodified
@@ -6,7 +6,6 @@ from collections.abc import Awaitable, Callable
6
 
6
 
7
 from .artifact_invalidation import ArtifactInvalidationAssessor
7
 from .artifact_invalidation import ArtifactInvalidationAssessor
8
 from .assistant_turns import AssistantTurnRequester
8
 from .assistant_turns import AssistantTurnRequester
9
-from .logging import reset_runtime_logger
10
 from .bootstrap import (
9
 from .bootstrap import (
11
     RuntimeBootstrapSource,
10
     RuntimeBootstrapSource,
12
     RuntimeBootstrapView,
11
     RuntimeBootstrapView,
@@ -19,6 +18,7 @@ from .dod import DefinitionOfDoneStore
19
 from .events import AgentEvent, TurnSummary
18
 from .events import AgentEvent, TurnSummary
20
 from .executor import ToolExecutor
19
 from .executor import ToolExecutor
21
 from .finalization import TurnFinalizer
20
 from .finalization import TurnFinalizer
21
+from .logging import reset_runtime_logger
22
 from .phases import TurnPhase, TurnPhaseTracker, TurnTransitionKind
22
 from .phases import TurnPhase, TurnPhaseTracker, TurnTransitionKind
23
 from .repair import ResponseRepairer
23
 from .repair import ResponseRepairer
24
 from .response_routing import AssistantResponseRouter
24
 from .response_routing import AssistantResponseRouter
src/loader/runtime/finalization.pymodified
@@ -3,7 +3,6 @@
3
 from __future__ import annotations
3
 from __future__ import annotations
4
 
4
 
5
 from collections.abc import Awaitable, Callable
5
 from collections.abc import Awaitable, Callable
6
-from .logging import get_runtime_logger
7
 from dataclasses import dataclass, field
6
 from dataclasses import dataclass, field
8
 from datetime import UTC, datetime
7
 from datetime import UTC, datetime
9
 from pathlib import Path
8
 from pathlib import Path
@@ -25,6 +24,7 @@ from .evidence_provenance import (
25
     summarize_evidence_provenance,
24
     summarize_evidence_provenance,
26
 )
25
 )
27
 from .executor import ToolExecutor
26
 from .executor import ToolExecutor
27
+from .logging import get_runtime_logger
28
 from .memory import MemoryStore
28
 from .memory import MemoryStore
29
 from .policy_timeline import append_verification_timeline_entry
29
 from .policy_timeline import append_verification_timeline_entry
30
 from .session import normalize_usage
30
 from .session import normalize_usage
src/loader/runtime/logging.pymodified
@@ -4,7 +4,7 @@ from __future__ import annotations
4
 
4
 
5
 import json
5
 import json
6
 import time
6
 import time
7
-from dataclasses import asdict, dataclass, field
7
+from dataclasses import dataclass, field
8
 from pathlib import Path
8
 from pathlib import Path
9
 from typing import Any
9
 from typing import Any
10
 
10
 
src/loader/runtime/tool_batches.pymodified
@@ -7,7 +7,6 @@ from dataclasses import dataclass, field
7
 
7
 
8
 from ..llm.base import ToolCall
8
 from ..llm.base import ToolCall
9
 from .context import RuntimeContext
9
 from .context import RuntimeContext
10
-from .logging import get_runtime_logger
11
 from .dod import (
10
 from .dod import (
12
     DefinitionOfDone,
11
     DefinitionOfDone,
13
     DefinitionOfDoneStore,
12
     DefinitionOfDoneStore,
@@ -20,6 +19,7 @@ from .dod import (
20
 from .events import AgentEvent, TurnSummary
19
 from .events import AgentEvent, TurnSummary
21
 from .evidence_provenance import EvidenceProvenance, EvidenceProvenanceStatus
20
 from .evidence_provenance import EvidenceProvenance, EvidenceProvenanceStatus
22
 from .executor import ToolExecutionState, ToolExecutor
21
 from .executor import ToolExecutionState, ToolExecutor
22
+from .logging import get_runtime_logger
23
 from .policy_timeline import append_verification_timeline_entry
23
 from .policy_timeline import append_verification_timeline_entry
24
 from .tool_batch_checks import ToolBatchConfidenceGate, ToolBatchVerificationGate
24
 from .tool_batch_checks import ToolBatchConfidenceGate, ToolBatchVerificationGate
25
 from .tool_batch_recovery import ToolBatchRecoveryController
25
 from .tool_batch_recovery import ToolBatchRecoveryController
src/loader/runtime/turn_iteration.pymodified
@@ -10,10 +10,10 @@ from ..llm.base import Message, Role
10
 from .assistant_turns import AssistantTurnRequester
10
 from .assistant_turns import AssistantTurnRequester
11
 from .context import RuntimeContext
11
 from .context import RuntimeContext
12
 from .dod import DefinitionOfDone
12
 from .dod import DefinitionOfDone
13
-from .logging import get_runtime_logger
14
 from .events import AgentEvent, TurnSummary
13
 from .events import AgentEvent, TurnSummary
15
 from .executor import ToolExecutor
14
 from .executor import ToolExecutor
16
 from .finalization import merge_usage
15
 from .finalization import merge_usage
16
+from .logging import get_runtime_logger
17
 from .phases import TurnPhase, TurnPhaseTracker, TurnTransitionKind
17
 from .phases import TurnPhase, TurnPhaseTracker, TurnTransitionKind
18
 from .policy_timeline import append_policy_timeline_entry
18
 from .policy_timeline import append_policy_timeline_entry
19
 from .repair import ResponseRepairer
19
 from .repair import ResponseRepairer
src/loader/tools/__init__.pymodified
@@ -1,10 +1,10 @@
1
 """Tool system for the agent."""
1
 """Tool system for the agent."""
2
 
2
 
3
-from .base import Tool, ToolRegistry, ConfirmationRequired
3
+from .base import ConfirmationRequired, Tool, ToolRegistry
4
-from .file_tools import ReadTool, WriteTool, EditTool, PatchTool, GlobTool
4
+from .file_tools import EditTool, GlobTool, PatchTool, ReadTool, WriteTool
5
 from .git_tools import GitTool
5
 from .git_tools import GitTool
6
-from .shell_tools import BashTool
7
 from .search_tools import GrepTool
6
 from .search_tools import GrepTool
7
+from .shell_tools import BashTool
8
 
8
 
9
 __all__ = [
9
 __all__ = [
10
     "Tool",
10
     "Tool",
src/loader/ui/widgets/approval_bar.pymodified
@@ -1,10 +1,10 @@
1
 """Approval bar widget for command confirmation (Claude Code style)."""
1
 """Approval bar widget for command confirmation (Claude Code style)."""
2
 
2
 
3
 from textual.app import ComposeResult
3
 from textual.app import ComposeResult
4
-from textual.message import Message
5
-from textual.widgets import Static
6
 from textual.binding import Binding
4
 from textual.binding import Binding
5
+from textual.message import Message
7
 from textual.widget import Widget
6
 from textual.widget import Widget
7
+from textual.widgets import Static
8
 
8
 
9
 
9
 
10
 class ApprovalBar(Widget, can_focus=True):
10
 class ApprovalBar(Widget, can_focus=True):
@@ -127,7 +127,7 @@ class ApprovalBar(Widget, can_focus=True):
127
         """Handle 'y' key - approve the action."""
127
         """Handle 'y' key - approve the action."""
128
         try:
128
         try:
129
             with open("/tmp/loader_debug.log", "a") as f:
129
             with open("/tmp/loader_debug.log", "a") as f:
130
-                f.write(f"[approval-bar] action_approve called, posting Approved message\n")
130
+                f.write("[approval-bar] action_approve called, posting Approved message\n")
131
         except Exception:
131
         except Exception:
132
             pass
132
             pass
133
         self.post_message(self.Approved())
133
         self.post_message(self.Approved())
@@ -137,7 +137,7 @@ class ApprovalBar(Widget, can_focus=True):
137
         """Handle 'n' or escape - reject the action."""
137
         """Handle 'n' or escape - reject the action."""
138
         try:
138
         try:
139
             with open("/tmp/loader_debug.log", "a") as f:
139
             with open("/tmp/loader_debug.log", "a") as f:
140
-                f.write(f"[approval-bar] action_reject called, posting Rejected message\n")
140
+                f.write("[approval-bar] action_reject called, posting Rejected message\n")
141
         except Exception:
141
         except Exception:
142
             pass
142
             pass
143
         self.post_message(self.Rejected())
143
         self.post_message(self.Rejected())
@@ -147,7 +147,7 @@ class ApprovalBar(Widget, can_focus=True):
147
         """Handle 'e' key - edit the command."""
147
         """Handle 'e' key - edit the command."""
148
         try:
148
         try:
149
             with open("/tmp/loader_debug.log", "a") as f:
149
             with open("/tmp/loader_debug.log", "a") as f:
150
-                f.write(f"[approval-bar] action_edit called, posting EditRequested message\n")
150
+                f.write("[approval-bar] action_edit called, posting EditRequested message\n")
151
         except Exception:
151
         except Exception:
152
             pass
152
             pass
153
         self.post_message(self.EditRequested(self._full_command))
153
         self.post_message(self.EditRequested(self._full_command))
src/loader/ui/widgets/input_area.pymodified
@@ -6,7 +6,6 @@ from textual.events import Key
6
 from textual.message import Message
6
 from textual.message import Message
7
 from textual.widgets import Input, Static
7
 from textual.widgets import Input, Static
8
 
8
 
9
-
10
 # Available slash commands for suggestions
9
 # Available slash commands for suggestions
11
 SLASH_COMMANDS = [
10
 SLASH_COMMANDS = [
12
     "/help",
11
     "/help",
src/loader/ui/widgets/streaming.pymodified
@@ -1,7 +1,6 @@
1
 """Streaming text widget for LLM responses."""
1
 """Streaming text widget for LLM responses."""
2
 
2
 
3
 from rich.text import Text
3
 from rich.text import Text
4
-
5
 from textual.reactive import reactive
4
 from textual.reactive import reactive
6
 from textual.widgets import Static
5
 from textual.widgets import Static
7
 
6
 
src/loader/ui/widgets/tool_widget.pymodified
@@ -2,11 +2,10 @@
2
 
2
 
3
 from rich.markup import escape
3
 from rich.markup import escape
4
 from rich.text import Text
4
 from rich.text import Text
5
-
6
 from textual.app import ComposeResult
5
 from textual.app import ComposeResult
7
 from textual.containers import Vertical
6
 from textual.containers import Vertical
8
 from textual.reactive import reactive
7
 from textual.reactive import reactive
9
-from textual.widgets import Static, Button
8
+from textual.widgets import Button, Static
10
 
9
 
11
 
10
 
12
 class ToolCallWidget(Vertical):
11
 class ToolCallWidget(Vertical):