Add a Watchlist tab for the companies the app cannot read a board of

Rate each one Yes or No apart from affinity, open its careers page with the
time noted, and set a missing or wrong link in the row. Migration 15 adds
companies.watch and careers_opened_at.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Sonnet 5.5 committed 2026-09-29 16:56:16 +02:00
1 parent 6f273cfdd6
commit 7dcb2c1705
11 files changed
+445 -12

No files matched your search

+29 -3
View File
@@ -69,7 +69,7 @@ def test_schema_creates_on_an_empty_file(tmp_path: Path) -> None:
"application_events", "agents", "scores", "state"} <= tables
assert "idx_roles_cluster" in indexes
assert store.migrations_applied == []
assert LATEST == 14
assert LATEST == 15
# A second open finds it current and applies nothing.
assert Store(path).migrations_applied == []
@@ -88,10 +88,19 @@ def _columns(path: Path, table: str) -> list[tuple[str, str, int, str]]:
return [(r[1], r[2], r[3], r[4]) for r in conn.execute(f"PRAGMA table_info({table})")]
def _undo_v15(conn: sqlite3.Connection) -> None:
"""A fresh file put back to the v14 shape: no Watchlist columns on a
company."""
conn.execute("ALTER TABLE companies DROP COLUMN watch")
conn.execute("ALTER TABLE companies DROP COLUMN careers_opened_at")
def _undo_v14(conn: sqlite3.Connection) -> None:
"""A fresh file put back to the v13 shape: an agent's intent and its
cached vector on the agent row, no prompts, no prompt on a score. Every
downgrade below starts here, since v14 is the last migration."""
downgrade below starts here, after `_undo_v15`, since v15 is the last
migration."""
_undo_v15(conn)
conn.execute("DROP TABLE agent_prompts")
conn.execute("ALTER TABLE scores DROP COLUMN prompt")
conn.execute("ALTER TABLE agents ADD COLUMN intent TEXT NOT NULL DEFAULT ''")
@@ -127,6 +136,23 @@ def test_a_v1_file_migrates_to_the_shape_a_new_file_has(tmp_path: Path) -> None:
assert sorted(_columns(old, table)) == sorted(_columns(fresh, table))
def test_a_v14_file_gains_the_watchlist_columns_and_leaves_companies_unrated(
tmp_path: Path) -> None:
path = tmp_path / "v14.db"
Store(path).add_company("Acme", ats="teamtailor", country="DK", careers_url="https://a.example")
with sqlite3.connect(path) as conn:
_undo_v15(conn)
conn.execute("PRAGMA user_version = 14")
migrated = Store(path)
assert migrated.migrations_applied == [15]
acme = migrated.company("acme")
assert acme is not None
assert (acme.ats, acme.careers_url) == ("teamtailor", "https://a.example")
assert (acme.watch, acme.careers_opened_at) == (None, "")
def test_a_v8_file_gains_ats_slug_and_keeps_its_companies(tmp_path: Path) -> None:
path = tmp_path / "v8.db"
Store(path).add_company("Acme", ats="teamtailor", country="DK")
@@ -325,7 +351,7 @@ def test_v14_makes_each_intent_the_agents_one_prompt_with_its_vector(tmp_path: P
migrated = Store(path)
assert migrated.migrations_applied == [14]
assert migrated.migrations_applied == [14, 15]
assert migrated.agent(backend.id).prompts == [ # type: ignore[union-attr]
Prompt(name="Backend", text="python backend")]
assert migrated.agent(blank.id).prompts == [] # type: ignore[union-attr]