Skip to content

Commit 4bfa618

Browse files
nficanoclaude
andcommitted
refactor phase 5: ARG cleanup, dispatch-handler arg names
Rename intentionally-unused parameters to underscore-prefixed names at production sites (cli._echo's ctx, three runtime.server dispatch handlers' rt arg, _dispatch_envelope's transport arg, and _materialize_session's envelope arg). Add per-file ARG001/ARG002 ignores for tests/** and examples/** where the unused args are protocol-mandated tool/handler signatures. Phase 3 already tightened pyright to fully strict, so the only remaining Phase-5-class lint families (B006, E722, RUF012, SLF, ARG) are now all clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5026503 commit 4bfa618

4 files changed

Lines changed: 10 additions & 7 deletions

File tree

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ ignore = [
7676
]
7777

7878
[tool.ruff.lint.per-file-ignores]
79-
"tests/**" = ["B011"]
79+
# Tools (`async def f(ctx, args)`) and inbound handlers (`async def h(env)`)
80+
# have protocol-mandated signatures; unused-arg lints are noise here.
81+
"tests/**" = ["B011", "ARG001", "ARG002"]
82+
"examples/**" = ["ARG001", "ARG002"]
8083

8184
[tool.ruff.lint.pydocstyle]
8285
convention = "google"

src/arcp/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def serve(transport: str, bind: str, token: tuple[str, ...]) -> None:
9090
)
9191
)
9292

93-
async def _echo(ctx: JobContext, args: dict[str, Any]) -> dict[str, Any]:
93+
async def _echo(_ctx: JobContext, args: dict[str, Any]) -> dict[str, Any]:
9494
return {"echo": args}
9595

9696
rt.register_tool("echo", _echo)

src/arcp/runtime/server.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ async def _handle_cancel(rt: ARCPRuntime, state: SessionState, env: Envelope) ->
237237
await rt._send(state, refused)
238238

239239
async def _handle_human_input_response(
240-
rt: ARCPRuntime, state: SessionState, env: Envelope
240+
_rt: ARCPRuntime, state: SessionState, env: Envelope
241241
) -> None:
242242
cid = env.correlation_id
243243
if cid is None:
@@ -247,7 +247,7 @@ async def _handle_human_input_response(
247247
state.pending.resolve(cid, dict(env.payload))
248248

249249
async def _handle_human_choice_response(
250-
rt: ARCPRuntime, state: SessionState, env: Envelope
250+
_rt: ARCPRuntime, state: SessionState, env: Envelope
251251
) -> None:
252252
cid = env.correlation_id
253253
if cid is None:
@@ -297,7 +297,7 @@ async def _handle_permission_grant(
297297
)
298298

299299
async def _handle_permission_deny(
300-
rt: ARCPRuntime, state: SessionState, env: Envelope
300+
_rt: ARCPRuntime, state: SessionState, env: Envelope
301301
) -> None:
302302
cid = env.correlation_id
303303
if cid is None:
@@ -615,7 +615,7 @@ async def _sink(env: Envelope) -> None:
615615
return result.state
616616

617617
async def _dispatch_envelope(
618-
self, transport: Transport, state: SessionState, envelope: Envelope
618+
self, _transport: Transport, state: SessionState, envelope: Envelope
619619
) -> None:
620620
# Persist inbound for dedupe & resume.
621621
was_new = await self.event_log.append(envelope)

src/arcp/runtime/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def _validate_token(self, auth: AuthBlock) -> str:
271271

272272
def _materialize_session(
273273
self,
274-
envelope: Envelope,
274+
_envelope: Envelope,
275275
payload: SessionOpenPayload,
276276
capabilities: Capabilities,
277277
principal: str,

0 commit comments

Comments
 (0)