Summarise every saved or liked role whatever its rank, queue it at once on save or like, and shorten the order labels to Agent match, CV match and Newest so they fit one line
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1d0a4c37f2
commit
ee8e450640
20 files changed
+208
-60
No files matched your search
@@ -214,3 +214,47 @@ def test_summarise_follows_score_and_finds_nothing_without_a_model(
|
||||
[batch] = stage.finder(config, store)
|
||||
assert len(batch.payload["uids"]) == 2
|
||||
assert stage.kind == "summarise_batch" and stage.callback == cascade.STEP
|
||||
|
||||
|
||||
def test_saved_and_liked_roles_are_waiting_whatever_their_rank(
|
||||
store: Store, config: Config) -> None:
|
||||
"""The owner's picks join the top lists: an application (the star) or an
|
||||
up vote from an enabled agent. A vote from a disabled agent, a pass, a
|
||||
closed role and a role given up on do not."""
|
||||
from app.models import Application
|
||||
|
||||
first, second, saved, liked, passed, disabled_like, closed, given_up = ranked(
|
||||
store, "1", "2", "3", "4", "5", "6", "7", "8")
|
||||
backend = store.agents()[0]
|
||||
quiet = store.save_agent("Quiet", "python", enabled=False)
|
||||
store.save_application(Application(role_uid=saved, company_key="acme", role_title="B"))
|
||||
store.save_application(Application(role_uid=closed, company_key="acme", role_title="B"))
|
||||
store.save_application(Application(role_uid=given_up, company_key="acme", role_title="B"))
|
||||
store.set_vote(backend.id, liked, 1)
|
||||
store.set_vote(backend.id, passed, -1)
|
||||
store.set_vote(quiet.id, disabled_like, 1)
|
||||
with store.transaction() as conn:
|
||||
conn.execute("UPDATE roles SET closed_at = ? WHERE uid = ?", (store.now(), closed))
|
||||
store.summarise_missed([given_up])
|
||||
store.summarise_missed([given_up])
|
||||
store.summarise_missed([given_up])
|
||||
|
||||
waiting = {r.uid for r in store.summarise_waiting(20)}
|
||||
|
||||
assert waiting == {first, second, saved, liked}
|
||||
assert store.summarise_pending() == 4
|
||||
|
||||
|
||||
def test_a_saved_role_is_summarised_once_by_the_stage(
|
||||
store: Store, config: Config, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
from app.models import Application
|
||||
|
||||
*_, deep = ranked(store, "1", "2", "3")
|
||||
store.save_application(Application(role_uid=deep, company_key="acme", role_title="B"))
|
||||
model = stub(monkeypatch)
|
||||
|
||||
modeltask.run(summarise.TASK, config, store)
|
||||
modeltask.run(summarise.TASK, config, store)
|
||||
|
||||
asked = [i["uid"] for batch in model.asked for i in batch]
|
||||
assert sorted(asked) == sorted({deep, posting("1").uid, posting("2").uid})
|
||||
Reference in new issue
Block a user