Squash Odysseus development history

This commit is contained in:
pewdiepie-archdaemon
2026-09-11 06:04:19 +00:00
parent c9dd68d890
commit 84aa9a91de
871 changed files with 265870 additions and 27854 deletions
+38
View File
@@ -109,6 +109,32 @@ def test_toggle_rejects_other_owner(monkeypatch):
assert db.commits == 0
def test_ablation_scope_blocks_nonfixture_even_with_matching_owner(monkeypatch):
from src.tool_routing_experiment import note_fixture_scope
note = _note(owner='alice')
db = _install_fakes(monkeypatch, note)
token = note_fixture_scope.set(frozenset({'different-fixture'}))
try:
result = _run({'action': 'delete', 'id': note.id})
finally:
note_fixture_scope.reset(token)
assert result['exit_code'] == 1
assert db.deleted == [] and db.commits == 0
def test_ablation_scope_allows_owned_fixture(monkeypatch):
from src.tool_routing_experiment import note_fixture_scope
note = _note(owner='alice')
db = _install_fakes(monkeypatch, note)
token = note_fixture_scope.set(frozenset({note.id}))
try:
result = _run({'action': 'delete', 'id': note.id})
finally:
note_fixture_scope.reset(token)
assert result['exit_code'] == 0
assert db.deleted == [note] and db.commits == 1
def test_update_allows_matching_owner(monkeypatch):
note = _note(owner="alice")
db = _install_fakes(monkeypatch, note)
@@ -118,3 +144,15 @@ def test_update_allows_matching_owner(monkeypatch):
assert result["exit_code"] == 0
assert note.title == "Changed"
assert db.commits == 1
def test_view_returns_full_freeform_note_content(monkeypatch):
content = "First line. " + ("complete detail " * 10) + "FINAL_MARKER"
note = _note(owner="alice", title="Long note", content=content)
_install_fakes(monkeypatch, note)
result = _run({"action": "view", "id": "abc12345"})
assert result["exit_code"] == 0
assert content in result["results"]
assert "FINAL_MARKER" in result["results"]