mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-16 11:52:25 +02:00
fix(harness): ship coherent vendor harness cluster
Rebuild PR C to ship the vendor/photocraft harness as a coherent unit (vendor implementation + vendor tests) instead of a per-file ahead/behind mix that produced broken imports and 6+ test failures. - Flip 36 harness impl/route/test files back to vendor (the per-file line-set policy misclassified user-rewritten files as 'behind'). - Flip core/models.py + src/tool_approval_scopes.py to vendor: vendor's harness (authority.py, turn_contract.py, clean_agent_preview.py) depends on vendor's older approval-scope API; upstream added CHAT_SESSION_APPROVAL_SIGNATURE_FIELD that vendor's core/models.py lacks. - Add src/shutdown.py (new vendor infra) required by routes/chat_routes.py. - Keep src/agent_tools/__init__.py at upstream (editor_tools registration lives in PR B). Upstream-only security divergence preserved in C_upstream_delta.patch and flagged for integration-time reconciliation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
364229f2dc
commit
9bdea753ae
@@ -167,56 +167,10 @@ def test_renders_one_table_row_per_variable(generator, fake_tree, monkeypatch):
|
||||
page = generator.render(found, generator.naive_line_scan(fake_tree))
|
||||
|
||||
assert page.startswith("---\nlayout: default\n---\n")
|
||||
assert "| `ODYSSEUS_VIA_HELPER` | `5 * 1024` | `src/indirect.py` | A synthetic limit. |" in page
|
||||
assert "| `ODYSSEUS_VIA_HELPER` | `5 * 1024` | `src/indirect.py:16` | A synthetic limit. |" in page
|
||||
assert "### Search" in page
|
||||
|
||||
|
||||
def _render_one(generator, root, name, monkeypatch):
|
||||
monkeypatch.setitem(
|
||||
generator.VARIABLE_NOTES, name, ("Search", generator.USER, "A synthetic flag.")
|
||||
)
|
||||
return generator.render(
|
||||
{name: generator.collect(root)[name]}, generator.naive_line_scan(root)
|
||||
)
|
||||
|
||||
|
||||
def test_page_does_not_change_when_an_unrelated_edit_shifts_lines(
|
||||
generator, fake_tree, monkeypatch
|
||||
):
|
||||
"""An edit that moves a read down a file must not make the page stale.
|
||||
|
||||
The page used to cite `path:line`, so any PR adding a line above a read had
|
||||
to regenerate it and then conflicted with every other PR that had.
|
||||
"""
|
||||
before = _render_one(generator, fake_tree, "ODYSSEUS_VIA_HELPER", monkeypatch)
|
||||
source = fake_tree / "src" / "indirect.py"
|
||||
source.write_text("import sys\n\n\n" + source.read_text(encoding="utf-8"), encoding="utf-8")
|
||||
|
||||
after = _render_one(generator, fake_tree, "ODYSSEUS_VIA_HELPER", monkeypatch)
|
||||
|
||||
assert generator.collect(fake_tree)["ODYSSEUS_VIA_HELPER"].primary.lineno == 19
|
||||
assert after == before
|
||||
|
||||
|
||||
def test_extra_reads_are_counted_per_file(generator, tmp_path, monkeypatch):
|
||||
monkeypatch.setattr(generator, "SOURCE_ROOTS", ("app.py", "src"))
|
||||
_write(tmp_path, "app.py", """
|
||||
import os
|
||||
|
||||
FIRST = os.environ.get("ODYSSEUS_READ_OFTEN", "1")
|
||||
SECOND = os.environ.get("ODYSSEUS_READ_OFTEN", "1")
|
||||
""")
|
||||
_write(tmp_path, "src/elsewhere.py", """
|
||||
import os
|
||||
|
||||
AGAIN = os.getenv("ODYSSEUS_READ_OFTEN")
|
||||
""")
|
||||
|
||||
page = _render_one(generator, tmp_path, "ODYSSEUS_READ_OFTEN", monkeypatch)
|
||||
|
||||
assert "| `app.py` (+1 more) |" in page
|
||||
|
||||
|
||||
def test_every_variable_read_in_the_repository_is_documented(built):
|
||||
_, variables, problems = built
|
||||
|
||||
|
||||
Reference in New Issue
Block a user