Files
reuse-surface/tests/test_interactive.py
tegwick b24ec507aa
Some checks failed
ci / validate-registry (push) Has been cancelled
WP-0016 finished: interactive registry maintain with llm-connect automation
Closes the registry maintenance loop from inside each domain repo:
interactive prompting for judgment calls, full automation for safe and
high-confidence changes, both backed by the llm-connect HTTP bridge.

- New modules: maintain.py, maintain_llm.py, patches.py, interactive.py
- Schema: schemas/registry-patch.schema.json
- CLI: reuse-surface maintain; establish --scaffold --hook
- Sibling templates: Makefile fragment, pre-commit hook
- Deterministic signal collectors extended; validate cwd auto-detect
- Docs, gap priority 28, SCOPE update
- Tests: test_maintain.py, test_interactive.py (59 pytest total)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 04:00:39 +02:00

45 lines
1.2 KiB
Python

from __future__ import annotations
import pytest
from reuse_surface.interactive import NonInteractiveError, format_patch_summary, prompt_batch
def test_format_patch_summary():
text = format_patch_summary(
{
"capability_id": "capability.demo.sample",
"kind": "vector_sync",
"confidence": "high",
"rationale": "drift",
"value": "D2 / A0 / C0 / R0",
}
)
assert "vector_sync" in text
def test_prompt_batch_non_tty_raises():
with pytest.raises(NonInteractiveError):
prompt_batch(
[
{
"capability_id": "capability.demo.sample",
"kind": "vector_sync",
"confidence": "high",
"rationale": "drift",
"value": "D2 / A0 / C0 / R0",
}
]
)
def test_prompt_batch_assume_yes():
patch = {
"capability_id": "capability.demo.sample",
"kind": "vector_sync",
"confidence": "high",
"rationale": "drift",
"value": "D2 / A0 / C0 / R0",
}
selected = prompt_batch([patch], assume_yes=True)
assert selected == [patch]