Skip to content

Commit 86e6ab5

Browse files
committed
Keep reconciliation validation and tests lint clean
1 parent 3168464 commit 86e6ab5

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

‎src/infermatrix_copilot/kb_service/reconcile.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def _validate_target(knowledge, target: str) -> dict:
148148
tool = source / "knowledge" / "tools" / name
149149
if not tool.is_file():
150150
raise ReconciliationError(f"mandatory validator missing: {name}")
151-
run = subprocess.run([sys.executable, str(tool)], cwd=source, capture_output=True, timeout=180)
151+
run = subprocess.run([sys.executable, str(tool)], cwd=source, capture_output=True, timeout=180, check=False)
152152
if run.returncode:
153153
detail = (run.stdout + run.stderr).decode(errors="replace")[-2000:]
154154
raise ReconciliationError(f"{name} failed: {detail}")

‎test/test_kb_reconcile_reviewed.py‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@
66
from types import SimpleNamespace
77

88
import pytest
9+
from test_kb_audit import _git, _land, _setup
910

1011
from infermatrix_copilot.kb_service import reconcile
12+
from infermatrix_copilot.kb_service.accept import accept_pending, request_accept
1113
from infermatrix_copilot.kb_service.activate import activate
12-
from infermatrix_copilot.kb_service.accept import request_accept, accept_pending
13-
from infermatrix_copilot.kb_service.audit import audit_main, open_unknown, provenance_problems, publish_trusted
14+
from infermatrix_copilot.kb_service.audit import (
15+
audit_main,
16+
open_unknown,
17+
provenance_problems,
18+
publish_trusted,
19+
)
1420
from infermatrix_copilot.knowledge_service.signing import SignatureError, verify
15-
from test_kb_audit import _setup, _land, _git
1621

1722

1823
class MergeGitHub:
@@ -39,7 +44,7 @@ def get(self, path, **_params):
3944

4045
@pytest.fixture
4146
def world(tmp_path, monkeypatch):
42-
rt, lifecycle, scheduler, origin = _setup(tmp_path)
47+
rt, _lifecycle, scheduler, origin = _setup(tmp_path)
4348
_land(origin, "knowledge/AGENTS.md", "# Agent instructions\n", "baseline entry")
4449
for name in ("check_knowledge_tree.py", "check_wiki_lint.py"):
4550
_land(origin, f"knowledge/tools/{name}", "import subprocess\nsubprocess.run(['git','ls-files','--error-unmatch','knowledge/AGENTS.md'], check=True, capture_output=True)\nprint('fixture validation passed')\n", "baseline validator")
@@ -53,8 +58,8 @@ def world(tmp_path, monkeypatch):
5358
monkeypatch.setattr(reconcile, "_repository", lambda knowledge: "org/kb")
5459
monkeypatch.setenv("KB_KNOWLEDGE_CLONE", str(rt.knowledge.path))
5560
return SimpleNamespace(rt=rt, scheduler=scheduler, origin=origin, sha=sha, base=baseline,
56-
key=rt.outbox._key, options=dict(target=sha, allow_mergers=["owner"],
57-
required_checks=["suite"], reason="authorized owner recovery"))
61+
key=rt.outbox._key, options={"target": sha, "allow_mergers": ["owner"],
62+
"required_checks": ["suite"], "reason": "authorized owner recovery"})
5863

5964

6065
def test_supervised_admission_passes_real_activation_without_disposing_or_changing_modes(world):

0 commit comments

Comments
 (0)