Serve one alpha page: filters, roles, the tracker, and Jobs

/, GET /api/roles|companies|applications, POST /api/companies/{key}/affinity
and /api/applications[/{id}/status]. The Jinja2 template renders an empty
shell; static/app.js fills it and drives Save, affinity and status changes.
<desk-jobs> from pipeline.web mounts at the bottom so Pull can be started
from the page.

Store.roles gains q, function, remote, days and hide_muted, and company/
place move from a key match to a substring on the text a board wrote.
hide_muted filters in SQL before LIMIT: filtering after it shipped first and
broke immediately on real data, since Databricks' freshly pulled 884 roles
were the newest 200-plus rows in the table and muting it left nothing to
show.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Sonnet 5 committed 2026-09-23 11:56:10 +02:00
1 parent 867ebe6405
commit b44f78ca7e
13 files changed
+1143 -22

No files matched your search

+42
View File
@@ -149,6 +149,38 @@ def test_roles_newest_first_and_filtered(store: Store, clock: Clock) -> None:
assert [r.source_id for r in store.roles(limit=1)] == ["3"]
def test_roles_filters_q_function_remote_and_days(store: Store, clock: Clock) -> None:
store.upsert_role(posting("1", company="Acme", place="Berlin",
function="engineering", remote=True))
clock.tick(hours=48)
store.upsert_role(posting("2", company="Acme", place="Munich",
function="sales"))
assert [r.source_id for r in store.roles(q="senior engineer")] == ["2", "1"]
assert [r.source_id for r in store.roles(q="backend nonsense")] == []
assert [r.source_id for r in store.roles(function="engineering")] == ["1"]
assert [r.source_id for r in store.roles(remote="remote")] == ["1"]
assert [r.source_id for r in store.roles(company="ac")] == ["2", "1"]
assert [r.source_id for r in store.roles(place="berlin")] == ["1"]
assert [r.source_id for r in store.roles(days=1)] == ["2"]
assert [r.source_id for r in store.roles(days=30)] == ["2", "1"]
def test_roles_hide_muted_excludes_before_the_limit(store: Store, clock: Clock) -> None:
store.add_company("Acme", key="acme", affinity=-1)
store.upsert_role(posting("other", company="Other"))
clock.tick()
for i in range(3):
store.upsert_role(posting(f"a{i}", company="Acme"))
clock.tick()
# Acme's roles are the three newest, so a plain limit=1 shows only Acme;
# hide_muted has to reach past all three to find "other" rather than
# just dropping Acme's rows out of an already-limited page.
assert [r.source_id for r in store.roles(limit=1)] == ["a2"]
assert [r.source_id for r in store.roles(limit=1, hide_muted=True)] == ["other"]
assert {r.source_id for r in store.roles(hide_muted=True)} == {"other"}
assert {r.source_id for r in store.roles()} == {"a0", "a1", "a2", "other"}
def test_mark_closed_closes_what_the_board_no_longer_lists(store: Store) -> None:
sub = store.add_subscription("ats", "greenhouse:acme")
other = store.add_subscription("ats", "greenhouse:other")
@@ -188,6 +220,16 @@ def test_companies_crud(store: Store) -> None:
assert store.company("acme") is None
def test_open_role_counts_and_company_boards(store: Store) -> None:
sub = store.add_subscription("ats", "greenhouse:acme", company="Acme", board="greenhouse")
store.add_company("Acme", key="acme")
store.upsert_role(posting("1", company="Acme", place="Berlin"), sub)
store.upsert_role(posting("2", company="Acme", place="Munich"), sub)
store.mark_closed("ats", ["1"], sub.id)
assert store.open_role_counts() == {"acme": 1}
assert store.company_boards() == {"acme": "greenhouse"}
# ----------------------------------------------------------- subscriptions
def test_subscriptions_crud(store: Store) -> None: