A stored `stage:extract` / `stage:summarise` in the state table overrides
extract.enabled / summarise.enabled; with none, the file applies. One
function, stages.stage_on, decides, and both tasks' finders ask it.
GET/PUT /api/stages and `app stages` show and set it with who would answer;
Runs has a "What the model reads" block, and a search agent's card says when
a stage is off and links to the switch.
Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
roles.js already checked a role's original_url is http(s) before
putting it in an href, so a board that wrote something other than a
URL could not make the reader navigate to it; sources.js (a search
sample's row.url), companies.js (careers_url) and applications.js
(application.url) put the same kind of outside data straight into a
link unchecked.
safeUrl moves to app.js, beside the app's other shared helpers, and
is exported the same way; a link whose safeUrl comes back empty is
now left out of the page (plain text) instead of getting an href of
"".
Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
The init block awaited /api/agents and /api/companies, both of which
only dim hidden companies, draw the affinity control and pick the
score order, before ever calling loadFeed; a slow or failed one left
the feed blank for good behind a silent catch that returned early.
The feed's own request now goes out alongside them rather than after.
Agents and companies fill in and redraw what they touch (the rail,
the feed's dimming, the reader's affinity slot) whenever they land,
reloading the feed if the real agent turns out to differ from what it
first loaded with. The feed's own fetch failing gets an empty state
with a retry instead of the same silent blank.
Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
The feed only ever shows a title, a few badges and a short excerpt,
but the list endpoint answered with every role's full row --
description, feed_text, raw and article_text included, about 5.5 KB
a role -- so a 1000-row restore was several megabytes of text a phone
never renders.
Store.roles_page selects only the fields a row draws (RoleRow), with
excerpt built server-side off a SUBSTR of summary or description, so
the big columns never cross into the response. The reader is
unaffected: it already fetched the whole role by uid when it opened
one; the reader pane's own reliance on the list row carrying the body
is removed too, so it no longer flashes a wrong "no description"
before that fetch lands.
Measured on a copy of the live database: a 60-row page went from
392 KiB to 39 KiB, and a 1000-row restore from 6.6 MB to 631 KiB.
Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
Store.set_affinity creates a minimal company row (key, and the name its roles
give most often) for a key with roles and no row, so a Jobindex or Adzuna
employer can be hidden or liked; the reader draws the control for any role
with a company_key and reloads the company list after the first change.
/api/companies derives from_search: no ats subscription (detached included)
and no ats, careers_url or domain. companies.js labels it "from job boards"
and keeps it out of "Not readable yet".
Co-Authored-By: Claude Opus <noreply@anthropic.com>
Switching a company's board or a job board search off, replacing a
company's board and detaching one all close open roles in a tap; each
now asks first, naming the count (a replace also names the old and the
new board), the same as removing a search and deleting an agent
already do.
Switching a target back on, following a board, setting a board and
saving a search used to show nothing until the schedule's next pull,
up to six hours later. Each now queues a pull job right in the API
route, so the CLI and any other caller of the same endpoint behave
like the page; the queued pull's own refusal while one is already
running is not surfaced as an error.
Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
score is solo, so a request during a run was deduped into the running job,
which had already read the old state. _score_after_change returns a queued
score when one has not started, else enqueues a plain score and, if that
dedupes to a running job, one follow-up with depends_on it, after="done" and
dedup_key score:after:<id>. POST /api/score answers with that job and
agents.js waits on it; the affinity route answers with score_job.
The flaky affinity test was pipeline's race, not the app's: Jobs.enqueue
re-raises the UNIQUE IntegrityError when the live job it collided with
finishes before the SELECT that should hand it back. The app retries.
Co-Authored-By: Claude Opus <noreply@anthropic.com>
_get streams the body with a running byte count, so an oversized board is
refused at MAX_BYTES instead of after it is held whole, and bounds the whole
request, redirects included, by DEADLINE, checked between chunks. The
per-phase timeouts are httpx.Timeout(10, read=30), set from 84 live requests
against mongodb, feedzai and the five Greenhouse boards with most open roles,
with and without pay_transparency=true: the body arrives in under 1 s, the
first byte waited up to 16.6 s, and the flag made no measurable difference.
_paged works unchanged through it (tested over a mock transport, 429 included).
Correct pull.py's BATCH_SIZE comment: a batch reads its boards in sequence,
and the parallelism is the http pool's.
Co-Authored-By: Claude Opus <noreply@anthropic.com>
Every ats parser now writes one human-readable pay line whether or not it
converts to yearly salary_min/salary_max/currency: hourly and daily rates,
Greenhouse's several pay zones, and a range with no currency all survive as
text instead of being dropped outright. Stored in roles.salary_text
(migration 12), replaced whole on every pull like title, so a board that
stops stating pay clears it rather than leaving a stale line. salary_state
is derived, not stored ('normalised', 'stated', or ''), and is what the
feed's new Pay filter and badge read; gates and scoring are unchanged, still
reading only the normalised columns.
Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
country_of folds with _place_fold (ł, đ, ø, æ map to ASCII; _fold keeps building
company_key unchanged), knows every ISO country by English name and European
ones by their own, and the cities among the 150 most frequent unresolved
places on the live data. Within one location a country beats a US state or
Canadian province, which beats a city. A state code that is also an ISO code
counts as the state only when the line names a US place. Several countries,
all European, are EU; otherwise ''. A code in parentheses is read when no
name matched.
Migration 12 recomputes country from place for roles extract has not read
and whose board sent no country in raw. On the live data: open roles with no
country 2,827 -> 1,183 of 16,841; 1,705 open roles change, 48 from a code.
Co-Authored-By: Claude Opus <noreply@anthropic.com>
scale() maps a cosine to clip((cos - lo) / (hi - lo), 0, 1) with constants
from CALIBRATION in app/config.py, keyed by model and replaceable under
embed.calibration. multilingual-e5-small: fit 0.75..0.88, taste -0.14..0.19
(taste from synthetic votes). An uncalibrated model falls back to min-max
and logs a warning once per run.
The extract and summarise bars default to 0.55 and 0.65, about 300 and 35
roles for the starter agent on the measured data; stored limits are kept.
An agent without an intent is left out of the model-stage scope, and each
score run names such agents in one score.no_intent notice.
Co-Authored-By: Claude Opus <noreply@anthropic.com>
MOVED and _moved answered 301 for twelve paths the settings cog moved
off of a few days ago. A browser caches a 301 indefinitely, so a path
reused later would be unreachable through no fault of that page, and
a one-person app has no outstanding bookmark to protect. Drop the
table, the routes, its export from app.web, and the tests that pinned
it; the old paths now answer plain 404. Keep the test that every
section of the Sources page exists, rewritten without MOVED.
Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
Part A: Ashby (?includeCompensation=true), Greenhouse (pay_transparency=true,
already free on the list request), Lever (salaryRange), Recruitee (salary)
and Personio (salaryInformation) all give structured pay; Workable and
SmartRecruiters do not (checked live). Every host converts to a yearly
salary_min/salary_max/currency, multiplying a monthly figure by 12 and
skipping an hourly or daily one rather than annualising a number nobody
stated. A range with no currency is ignored, and Greenhouse's own multi-zone
ranges are skipped outright since nothing says which zone the role is at.
Part B: classify() matched substrings, so " it" matched inside "Italy",
filing European sales roles as engineering; it now matches on word
boundaries (full boundary for the handful of short tokens that are
themselves the start of an unrelated word, prefix matching kept for the
stems). Title is checked before department (a hand-checked sample found
title-first right about twice as often), nothing matching returns '' rather
than "other", and a modest set of German/Dutch/Danish/Norwegian/Swedish/
French keywords covers the seed's other languages.
function is not a board field, so it gets the opposite rule from every
other raw column: extract's answer overwrites the classifier's guess
outright, and once extracted_at is set no later pull may put the guess
back. Migration 9 recomputes function for every not-yet-extracted role from
its stored title and department.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The pull records a board that fails on every fetch under ats:failing:<target>, and set_board can now move a company to another board. The old target's record would have outlived the board and counted in `app companies check` for good.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
recency and the newest feed both counted from first_seen, when the app
itself first stored a role, so a newly added board's whole backlog scored
as freshly posted for two weeks: 10,223 of 15,415 board roles were posted
more than 30 days before they were first seen (average gap in days: Ashby
78, Greenhouse 143, Lever 226, Personio 333).
Add roles.posted_at (migration 9): the earlier of first_seen and a trusted
host's published_at, where TRUSTED_POSTED_HOSTS (app/models.py) records
which of the ats and search hosts report a creation date rather than one
that moves on an edit, checked against live boards and the live database.
A future or pre-2015 date is not trusted either. upsert_role sets it on
insert and keeps the earliest on update, so an edit on the board can only
move it earlier, never later. recency, the feed's newest order, the "new
since" days filter and _top_scope's tie-break now read posted_at;
first_seen is unchanged and still what the UI shows as when the app found
a role. The row's age in roles.js now shows the posted date instead.
A partial index (posted_at DESC, uid) WHERE closed_at IS NULL serves the
newest feed; sqlite3's bundled build has no STAT4, so its planner
otherwise sorts every open role instead of using it, measured 30x slower
on the live database, so Store.roles() forces it for that query shape.
Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
A second pull (schedule, Run button, `app job pull` in another process) could
start while one was fetching and overwrite the stored run marker, so the first
run's boards failed their stamp check or a settle closed on the other run's id
lists. `claim_run` sets `pull:run` in one conditional statement, only while it
equals `pull:settled` or is older than an hour; a refused `pull` job queues no
stage and says so in its result and a notice, and the CLI exits 1. Batches
carry the marker in their payload, the plugins stamp with it, and the settle
reads it off its own batches' payloads before releasing the run.
Co-Authored-By: Claude Opus <noreply@anthropic.com>
`app.jobs.sources.set_board` attaches a board to an existing company,
replaces the one it has (closing the old board's open roles) or creates
the company, with row and subscription changed in one transaction by
`Store.set_company_board`. A board that lists zero roles is kept. `add`,
`discover --add`, the seed importer (moved out of app/cli.py) and the new
`POST|DELETE /api/companies/{key}/board` all go through it; a seed re-run
attaches a board to a row that never had one. A company's subscription is
rewritten in place, and detaching hides it.
`companies.ats_slug` (migration 9) keeps the slug of a host the app
cannot read yet, and discovery returns such a host before probing slugs.
The Companies rows get Set board / Change, the host select is rendered
from `plugins.ats.HOSTS`, and a row with nothing found reads "board not
found" and is in the "Not readable yet" filter.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Workable and SmartRecruiters page their lists, and both parsers read page one
only, so the settle closed every role past it (Delivery Hero: 980 stated, 100
open). `_paged` follows nextPage and offset, and the plugin stamps
`ats:complete` only when the distinct ids read equal the stated total; a 429
after page one keeps what was read and closes nothing. Adzuna completes on its
`count`, Jobindex counts raw items and raises on an answer with no channel.
A board whose fetch raises is recorded under `ats:failing:<target>` with the
first failure's time and the latest reason; after STALE_DAYS the settle closes
its roles, and its next answer reopens them. `/api/companies`, the Companies
list and `app companies check` show it.
Co-Authored-By: Claude Opus <noreply@anthropic.com>
Measured on the live roles against the "Copenhagen engineering" agent's
intent: the English-only all-MiniLM-L6-v2 separates engineering from
non-engineering roles with an AUC of 0.68 overall but only 0.74 restricted
to Danish-country roles (a Danish engineering role beats the rest's
non-engineering median only 68% of the time). multilingual-e5-small reaches
0.70 overall and 1.00 on Danish-country roles, for about 3x the CPU time.
paraphrase-multilingual-MiniLM-L12-v2 measured worse than the English-only
baseline (AUC 0.60) and was dropped.
e5 needs "query: "/"passage: " prefixes; app/jobs/embed.py adds them by
matching the model name so a model change can't leave a stale prefix
setting behind. Added tests for the prefixing and for the two invariants
the model change relies on: embed drops the old model's vectors before
re-embedding, and an agent's cached intent vector is keyed by model so a
model change is a cache miss, never a stale-dimension read.
Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
The Python configurations had no interpreter, and a Windows one cannot open
the Linux .venv or share roledesk.db with the distro. Each is now a Shell
Script configuration running uv in /home/claude/cboxcode/jobboard. serve
reloads, and worker is new.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A require gate on an empty column gated the role ("country unknown"), and extract, the stage that fills the column, is bounded to the roles that rank, so 2,281 of 15,556 open roles could never come back: every board that writes "Remote", "Hybrid" or "Distributed" as its location. An empty column now neither passes nor fails a gate; the role ranks, extract reads it, the rescore decides.
`any` is a third gate mode: the any gates are one group a role must match one of, so a ranking can say "in Denmark, or remote", which require alone could not. The group is gated only when some member had evidence against it.
`remote_of(place)` fills `remote` from the location line the way `country_of` fills `country`, and the startup backfill does both, since Greenhouse writes "Hybrid" as the location and gives no flag.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The schedule cadence is a picker, the add row is behind a button and off
here, a running-jobs chip with Kill and Stop run sits in every header, and
a declared schedule's label is refreshed at startup.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Run one stage goes: the cascade is the unit of work and app job keeps the
per-stage entry points. The pull button is disabled while a pull runs and
the lede no longer hardcodes the cadence. Messages folds into Runs as
Problems. pull_batch checks for a cancel before every board, one plugin per
target, and both plugins now close their HTTP client.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
agents.limits holds extract_top, extract_min, summarise_top and
summarise_min; the scope query reads them per ranked row, and a row saved
before this behaves like a fresh agent. The four global config keys go.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`app companies prune`, `/api/prune` and the Sources disclosure switched off every board with no open role in a region. It existed because the first seed was 186 US boards; the European seed makes it moot, and it was wrong on its own terms: a board with no European role today (a company between openings, or a fetch that timed out) was switched off for good. A company that hires nowhere near should not be in the list, and a ranking's country gate handles the rest. `EUROPE` in models had no other reader and goes with it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The seed was jobhunt-hq's 186 US boards, chosen because they could be read. It is now a hand-picked list of European tech employers, with `board` filled by the new `app.jobs.discover` from each company's own careers site and every board fetched once before it landed: 175 have one, and the rest keep the ATS host their site runs on (Teamtailor 32, Workday 12, SuccessFactors 9, ...) and a careers URL, as rows the app cannot read yet. Companies shows them as "not readable yet" with a link, behind a filter, so the next parser to write is the host that filter shows most.
`app companies discover NAME DOMAIN [--add]` reads the home page, its careers links and the usual paths for a link into a known host, one level down on a careers page, and probes Greenhouse, Lever, Ashby, SmartRecruiters, Recruitee and Personio by slug when the pages link nothing. It is what the LinkedIn flow will call.
Migration 7 adds companies.ats, country and city. The Workable parser now reads the v3 shape its list endpoint actually sends (location object, department list, shortcode and no URL or text); the first populated board showed it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The free stages run first and their score bounds the two model stages.
Extract reads only the best extract.per_agent roles of each agent at
extract.min_score or more, then score runs again so the gates read what it
filled; summarise gets a min_score of its own. The cascade steps by
position, since score is in it twice.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A search agent is a persona, and every like or pass belongs to the one
being viewed. The rail now opens on Viewing as: a full-width chooser,
the name alone with one agent, a note with none, remembered in the URL
and localStorage. The vote buttons, the reader's affinity control, the
feed, the tag counts and the reader fetch all carry that agent; before,
votes sent none and every one landed on the default agent. Best first
and Newest first are back as the segmented control under Order,
independent of the agent. The rail selects no longer clip descenders:
Chrome ignores line-height on a select, so the fixed box is gone in
favour of padding and a min-height.
Settings render inside a sticky rail (Search agents; Sources with Job
boards, Company boards, Runs, Messages; Account), a strip under the
header on a phone, so Runs is one click away however long the company
list gets. Sources shows one section at a time, chosen by the fragment,
so the old redirects still land. Search agents are cards, newest first:
name, an On/Off switch with its word, the intent in full, the weights,
Edit in place, New agent on top, and a link to Roles as that agent.
Switching one on rescores it.
replace_scores writes nothing for an agent deleted while score was
running, instead of failing the run on the foreign key.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The per-agent migration becomes v6 behind main's v5. A vote still stamps
the role's read_at, tag counts hide the agent's hidden companies, and
/api/filters takes the agent like /api/roles.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Votes on roles and company affinity move to role_votes and agent_companies,
one row per search agent, so two agents rank the same roles differently. The
score gains taste, the cosine to mean(liked) - mean(passed) of the agent's
votes, as newsdesk ranks articles. The API takes agent on roles, votes and
companies and falls back to the default agent, the enabled one with the
lowest id.
Settings become Search agents (a list again, with New and Delete), Sources
(job boards, company boards and runs with the message log, one section per
plugin) and Account. Old paths answer 301 to their section.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The Roles tab takes newsdesk's shell, ported from its index.html and
app.css rather than rewritten: a filter rail (Show read, Best first or
Newest first, first seen, tag chips with counts, the old filters behind a
disclosure), the feed in newsdesk's row layout (score gutter, title,
company, place, badges, age, tags, the summary as excerpt, judge buttons)
and the reader as a third column that replaces the list on a phone. The
router pushes /roles/{uid}, which the server also renders with the reader
open, so the separate read page and role.js go. j/k, u/n/d, S, Enter,
Escape, o, /, f and c work as in newsdesk. The phone rules come with their
comments.
Two things the row lacked: roles.read_at, stamped when the reader opens a
role or a vote is cast, behind include_read on /api/roles; and role_tags,
written by summarise alongside the summary and served with counts by
/api/filters, filtered in SQL before LIMIT. Migration 5.
PyCharm run configurations in .run/ for serve, pull, seed and pytest.
core.autocrlf=input is set locally so a Windows-side checkout commits LF.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
When the checkout lives under \\wsl.localhost, step 1 runs its tests in the
distro through deploy/test-commit.sh and db.ps1 push makes its snapshot
there, because the .venv is a Linux one. pipeline/context.py narrows by
sys.platform so mypy passes on Linux. See boilerplate docs/wsl.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>