Give an agent a soft profile of likes and dislikes and take the must-haves off the form (wp-likes)

Add agents.like_text (migration 30) beside avoid_text, now shown as "What I don't like". The judge reads both under <likes> and <dislikes>, its career rubric judges against the prompts, the likes and the dislikes, and FORMAT 3 makes earlier judgements be made again. The form drops the must-haves box and no longer sends must_text, so a stored one is kept and still caps career in code.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Sonnet 5.5 committed 2026-10-03 22:48:46 +02:00
1 parent 82afa831f2
commit 8c6cbdf002
18 files changed
+144 -75

No files matched your search

+31 -11
View File
@@ -44,21 +44,24 @@ def test_an_agent_keeps_its_cv_fields_when_a_save_leaves_them_out(store: Store)
cv_languages=[CvLanguage(language="DA", level="native"),
CvLanguage(language="en", level="fluent"),
CvLanguage(language="da", level="basic")],
avoid_text="Pure reporting.", must_text="Permanent contract.")
like_text=" Building teams. ", avoid_text="Pure reporting.",
must_text="Permanent contract.")
assert made.cv_text == "VP Data."
assert [(lang.language, lang.level) for lang in made.cv_languages] == \
[("da", "native"), ("en", "fluent")]
assert (made.avoid_text, made.must_text) == ("Pure reporting.", "Permanent contract.")
assert (made.like_text, made.avoid_text, made.must_text) == \
("Building teams.", "Pure reporting.", "Permanent contract.")
kept = store.save_agent("Data", "data leadership", agent_id=made.id)
assert (kept.cv_text, kept.avoid_text, kept.must_text) == \
("VP Data.", "Pure reporting.", "Permanent contract.")
assert (kept.cv_text, kept.like_text, kept.avoid_text, kept.must_text) == \
("VP Data.", "Building teams.", "Pure reporting.", "Permanent contract.")
assert len(kept.cv_languages) == 2
cleared = store.save_agent("Data", "data leadership", agent_id=made.id, cv_text="",
cv_languages=[], avoid_text="", must_text="")
assert (cleared.cv_text, cleared.cv_languages, cleared.avoid_text, cleared.must_text) \
== ("", [], "", "")
cv_languages=[], like_text="", avoid_text="",
must_text="")
assert (cleared.cv_text, cleared.cv_languages, cleared.like_text, cleared.avoid_text,
cleared.must_text) == ("", [], "", "", "")
def test_a_cv_language_is_a_code_and_a_level_of_the_ladder() -> None:
@@ -93,7 +96,7 @@ def test_v28_adds_the_cv_columns_and_the_host_deadline_and_runs_twice(tmp_path:
migrated = Store(path)
assert migrated.migrations_applied == [28, 29]
assert migrated.migrations_applied == [28, 29, 30]
rows = {r["source_id"]: r for r in migrated._rows(
"SELECT source_id, languages_required, deadline_host, deadline FROM roles")}
assert (rows["a"]["deadline_host"], rows["a"]["deadline"]) == ("2026-10-18", None)
@@ -105,7 +108,7 @@ def test_v28_adds_the_cv_columns_and_the_host_deadline_and_runs_twice(tmp_path:
assert migrated.role(posting("a").uid).deadline == "2026-10-18"
with sqlite3.connect(path) as conn:
conn.execute("PRAGMA user_version = 27")
assert Store(path).migrations_applied == [28, 29]
assert Store(path).migrations_applied == [28, 29, 30]
# ---------------------------------------------------------------- deadline
@@ -246,12 +249,29 @@ def test_v29_adds_the_musts_and_broken_columns_and_runs_twice(tmp_path: Path) ->
conn.execute(f"ALTER TABLE role_judgements DROP COLUMN {column}")
conn.execute("PRAGMA user_version = 28")
assert Store(path).migrations_applied == [29]
assert Store(path).migrations_applied == [29, 30]
with sqlite3.connect(path) as conn:
columns = {r[1] for r in conn.execute("PRAGMA table_info(role_judgements)")}
assert {"musts", "broken"} <= columns
conn.execute("PRAGMA user_version = 28")
assert Store(path).migrations_applied == [29]
assert Store(path).migrations_applied == [29, 30]
def test_v30_adds_like_text_and_runs_twice(tmp_path: Path) -> None:
path = tmp_path / "v29.db"
Store(path).save_agent("Data", "data leadership", avoid_text="Reporting.")
with sqlite3.connect(path) as conn:
conn.execute("ALTER TABLE agents DROP COLUMN like_text")
conn.execute("PRAGMA user_version = 29")
migrated = Store(path)
assert migrated.migrations_applied == [30]
[data] = migrated.agents()
assert (data.like_text, data.avoid_text) == ("", "Reporting.")
with sqlite3.connect(path) as conn:
conn.execute("PRAGMA user_version = 29")
assert Store(path).migrations_applied == [30]
def test_the_musts_text_is_one_must_have_per_line() -> None: