Share the readers' place, table-lookup and country helpers, unify the employment vocabulary, and list the enrich switch with the stages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 10:13:24 +02:00
1 parent ca80219bbb
commit 903b69b6d3
34 files changed
+290 -207

No files matched your search

+2 -2
View File
@@ -152,8 +152,8 @@ def build_parser() -> argparse.ArgumentParser:
prompt.add_argument("--remove", action="store_true", help="remove the prompt instead")
stages = sub.add_parser(
"stages", help="show whether extract and summarise run, or switch one")
stages.add_argument("name", nargs="?", choices=["extract", "summarise"])
"stages", help="show whether extract, summarise and enrich run, or switch one")
stages.add_argument("name", nargs="?", choices=["extract", "summarise", "enrich"])
stages.add_argument("state", nargs="?", choices=["on", "off"])
sub.add_parser("seniority", help="per host, how often the stated level equals the model's")
+10 -4
View File
@@ -13,8 +13,8 @@ finders ask it (`extract.extract_task`, `summarise.summarise_task`).
asks no model and is on by default (`enrich.enabled`); its switch is
`stage:enrich`, set the same way through `PUT /api/stages/enrich`.
`describe` is what `GET /api/stages` and `app stages` show: for each model
stage whether it is on, where that comes from, the model it uses, and who
`describe` is what `GET /api/stages` and `app stages` show: for each stage
with a switch, the model stages and `enrich`, whether it is on, where that comes from, the model it uses, and who
would answer.
"""
@@ -33,6 +33,8 @@ NAMES = ("extract", "summarise")
#: Every stage with a switch: the model stages and `enrich`.
SWITCHES = (*NAMES, "enrich")
#: What `describe_one` says of a stage that asks no model.
NO_ASK = "reads role pages, asks no model"
NO_MODEL = ("no model is reachable: set ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN, "
"see docs/llm-backends.md")
ANSWERS = {
@@ -42,7 +44,7 @@ ANSWERS = {
class Stage(BaseModel):
"""One model stage as the page shows it. `source` is "stored" when the
"""One stage as the page shows it. `source` is "stored" when the
switch set it and "config" when it is still config.yaml's default.
`backend` is `agent.backend`'s answer, "" for nobody, and `answer` says
it in words."""
@@ -89,6 +91,10 @@ def answer(config: Config) -> tuple[str, str]:
def describe_one(config: Config, store: Store, name: str) -> Stage:
if name not in NAMES:
return Stage(name=name, on=stage_on(config, store, name),
source="config" if stored(store, name) is None else "stored",
model="", backend="", answer=NO_ASK)
backend, said = answer(config)
return Stage(name=name, on=stage_on(config, store, name),
source="config" if stored(store, name) is None else "stored",
@@ -97,4 +103,4 @@ def describe_one(config: Config, store: Store, name: str) -> Stage:
def describe(config: Config, store: Store) -> list[Stage]:
return [describe_one(config, store, name) for name in NAMES]
return [describe_one(config, store, name) for name in SWITCHES]
+3 -2
View File
@@ -1,5 +1,5 @@
/* The Runs section of Sources: the "Run the pull now" button, and the
* switches for the two stages that ask a model.
* switches for the stages of a pull: the two that ask a model and enrich.
*
* The switches are `/api/stages`: one row per stage, drawn as the search
* rows above are (`.srow`, `.switch`), and a switch is a PUT that stores the
@@ -62,6 +62,7 @@
const DOES = {
extract: "fills in country, seniority, salary and the like from what the posting says",
summarise: "writes a short summary and tags for the best roles",
enrich: "reads the own page of the best roles whose list gave no text",
};
const el = (tag, className, text) => {
@@ -105,7 +106,7 @@
if (!stage.on) row.dataset.muted = "true";
const name = el("span", "name");
name.append(el("span", "", stage.name[0].toUpperCase() + stage.name.slice(1)),
el("span", "badge", stage.model));
...(stage.model ? [el("span", "badge", stage.model)] : []));
row.append(name, stageSwitch(stage, () => renderStages(stages)));
const sub = el("span", "sub");
sub.append(`${DOES[stage.name]}. How deep it reads is set per search agent, under `);
+1 -1
View File
@@ -414,7 +414,7 @@ class StageBody(BaseModel):
@router.get("/stages")
def list_stages(store: StoreDep, config: ConfigDep) -> list[jobs.stages.Stage]:
"""The two model stages of a pull: whether each is on, whether the
"""The stages of a pull with a switch, extract, summarise and enrich: whether each is on, whether the
stored switch or config.yaml says so, its model, and who would answer."""
return jobs.stages.describe(config, store)