Skip to content

Commit 38dab2d

Browse files
committed
fix(merge): resolve lv↔main semantic conflicts surfaced by the build
Post-merge coherence fixes the conflict-marker resolution alone didn't catch (only the full build/test gate did): - hooks.py: post_tool_use_hook had a DUPLICATE stuck_guard kwarg + a duplicated K7 docstring/record_tool_result block (both sides added stuck_guard to the same signature; git kept both → SyntaxError 'duplicate argument', and the guard was fed twice per tool call). Collapsed to one stuck_guard param + one record block. - pipeline.py: restored 'import subprocess' (main's #623 dropped it when it removed the git-config subprocess calls, but lv's A6 code_changed block still calls subprocess.run → would NameError at runtime). Also the linter's import-order fix. - test_pipeline.py: main's test_git_identity_uses_env_vars_not_global_config mocked verify_build/verify_lint with a bare bool, but the resolved source keeps lv's VerifyOutcome shape (build_outcome.passed) → AttributeError. Fixed both mocks to VerifyOutcome(passed=True), matching every other lv pipeline test. Gates green after: cdk 3207 tests + synth + eslint; agent 1374 tests + ruff + ty (under AGENT_SESSION_ROLE_ARN set — no ECS hang).
1 parent c0bb849 commit 38dab2d

3 files changed

Lines changed: 3 additions & 15 deletions

File tree

agent/src/hooks.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,11 +1070,6 @@ async def post_tool_use_hook(
10701070
redacted version (steered enforcement — content is sanitized, not
10711071
blocked).
10721072
1073-
K7: when a ``stuck_guard`` is supplied, every tool result is recorded so a
1074-
between-turns hook can detect a repeating failing command (the ABCA-483
1075-
spin loop) and steer / bail. Recording is best-effort and never alters the
1076-
screening outcome.
1077-
10781073
``progress`` is optional (preserves the Phase 1 test call shape). When
10791074
present, an egress-denial signature in the tool output emits an
10801075
``egress_denied`` blocker event (#251) — best-effort observability,
@@ -1109,14 +1104,6 @@ async def post_tool_use_hook(
11091104
if not isinstance(tool_response, str):
11101105
tool_response = str(tool_response)
11111106

1112-
# K7: feed the stuck-guard (best-effort — a tracking error must never block
1113-
# the screening path that follows).
1114-
if stuck_guard is not None:
1115-
try:
1116-
stuck_guard.record_tool_result(tool_name, hook_input.get("tool_input"), tool_response)
1117-
except Exception as exc:
1118-
log("WARN", f"stuck-guard record raised (ignored): {type(exc).__name__}: {exc}")
1119-
11201107
# #251: best-effort egress-denial detection. A blocked outbound connection
11211108
# (non-allowlisted host hitting the DNS Firewall, refused connection, name
11221109
# resolution failure) surfaces in the tool's stderr here. Emit an

agent/src/pipeline.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import hashlib
77
import inspect
88
import os
9+
import subprocess
910
import sys
1011
import time
1112
from typing import TYPE_CHECKING

agent/tests/test_pipeline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ async def fake_run_agent(_prompt, _system_prompt, config, cwd=None, trajectory=N
192192

193193
with (
194194
patch("pipeline.ensure_committed", return_value=False),
195-
patch("pipeline.verify_build", return_value=True),
196-
patch("pipeline.verify_lint", return_value=True),
195+
patch("pipeline.verify_build", return_value=VerifyOutcome(passed=True)),
196+
patch("pipeline.verify_lint", return_value=VerifyOutcome(passed=True)),
197197
patch(
198198
"pipeline.ensure_pr",
199199
return_value="https://github.com/org/repo/pull/1",

0 commit comments

Comments
 (0)