Bring the by-hand plan in line with the Watchlist tab and migration 16
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
161e89c955
commit
1ebfab1b99
1 file changed
+6
-7
@@ -38,7 +38,7 @@ The 49 were missed because the slug is not the company's name (`BoschGroup`, `ji
|
||||
|
||||
**No reader is built on a key lifted from a site's script.** Maersk's API, New Work's and Welcome to the Jungle's search index answer only with a key that the page's JavaScript carries. They go on the by-hand list.
|
||||
|
||||
**The by-hand list is the `companies` table.** A company is on it when it has no shown board and is not known from a search only. `careers_url` and `notes` exist already; migration 15 adds `hand_reason` and `checked_at`. No second table, since a company has one careers link and the list needs no history of checks.
|
||||
**The by-hand list is the `companies` table, and the Watchlist tab is the list.** A company is on it when it has no shown board and is not known from a search only. `careers_url`, `notes`, `watch` (the rating) and `careers_opened_at` exist already, the last being the date a person last looked at the careers page; migration 16 adds `hand_reason`. There is no `checked_at`, since opening the page from the Watchlist stamps the date already. No second table, since a company has one careers link and the list needs no history of checks.
|
||||
|
||||
**A link typed by hand is kept.** `add_discovered` and the seed fill `careers_url` only when it is empty.
|
||||
|
||||
@@ -75,16 +75,15 @@ def probe_ok(body: bytes) -> bool: ...
|
||||
|
||||
Slugs: Workday `lego.wd103/LEGO_External`; SuccessFactors, Phenom and the sitemap reader take the site's hostname, with a path where the site has one (`jobs.teradyne.com/MiR`); Oracle `<host>/<siteNumber>`.
|
||||
|
||||
Company JSON, in `GET /api/companies`: `CompanyOut` gains `domain`, `notes`, `hand_reason`, `checked_at` and `by_hand` (bool). `hand_reason` is one of `''`, `unread` (readable, no parser yet), `robots`, `blocked` (the site answers a program with a challenge), `key`, `group`, `gone`, `added` (by hand or by an import, not looked at). `from_search` is false for a company with a `hand_reason`.
|
||||
Company JSON, in `GET /api/companies`: `CompanyOut` has `domain`, `city`, `watch` and `careers_opened_at` from the Watchlist, and gains `notes`, `hand_reason` and `by_hand` (bool, no board shown and not `from_search`). `hand_reason` is one of `''`, `unread` (readable, no parser yet), `robots`, `blocked` (the site answers a program with a challenge), `key`, `group`, `gone`, `added` (by hand or by an import, not looked at). `from_search` is false for a company with a `hand_reason`.
|
||||
|
||||
| Endpoint | Body | Answer |
|
||||
|---|---|---|
|
||||
| `POST /api/companies` | `name`, `careers_url`, `notes`, `hand_reason` (default `added`) | 201 `CompanyOut`; 409 when the key is taken |
|
||||
| `PATCH /api/companies/{key}` | any of `name`, `careers_url`, `notes`, `hand_reason` | `CompanyOut`; the key stays; 409 on `name` for a company with a board |
|
||||
| `POST /api/companies/{key}/checked` | none | `CompanyOut` with `checked_at` now |
|
||||
| `DELETE /api/companies/{key}` | none | 204; 409 when it has a board or open roles; its `agent_companies` rows go with it |
|
||||
|
||||
`careers_url` is http or https, as `safeUrl` demands on the page.
|
||||
`POST /api/companies/{key}/careers` and `POST /api/companies/{key}/opened` of the Watchlist stay and answer a `Company`; `POST .../careers` and `PATCH` check the link with the same function (`check_careers_url` in `app/jobs/sources.py`). `careers_url` is http or https, as `safeUrl` demands on the page. A person looking at the page is `POST .../opened`, which stamps `careers_opened_at`.
|
||||
|
||||
## Work packages
|
||||
|
||||
@@ -94,7 +93,7 @@ Wave 0, in parallel, from today's `main`:
|
||||
|---|---|---|---|
|
||||
| 0 Host modules | `wp0-hosts` | Opus | `plugins/ats.py`, `plugins/atshosts/`, `app/jobs/discover.py`, `tests/test_ats.py`, `tests/test_discover.py`, `tests/test_atshosts.py` |
|
||||
| 1 By-hand backend | `wp1-byhand-api` | Sonnet | `app/models.py`, `app/storage/schema.py`, `app/storage/store.py`, `app/web/api.py`, `app/jobs/sources.py`, `app/cli.py`, `tests/test_storage.py`, `tests/test_web.py`, `tests/test_sources.py` |
|
||||
| 2 By-hand page | `wp2-byhand-ui` | Opus | `app/templates/settings/sources.html`, `app/static/byhand.js`, `app/static/companies.js`, `app/static/app.css`, `app/web/pages.py` |
|
||||
| 2b By-hand editing | `wp2b-byhand-ui` | Opus | `app/static/watchlist.js`, `app/templates/watchlist.html`, `app/static/app.css`, `tests/test_pages.py` |
|
||||
|
||||
Wave 1, in parallel, from `main` after WP0 is merged. Each owns its modules in `plugins/atshosts/`, `tests/test_ats_<host>.py` and `tests/fixtures/ats/<host>*`, and nothing else:
|
||||
|
||||
@@ -111,9 +110,9 @@ Wave 2 is decided after wave 1 by the roles each company would add: a module per
|
||||
|
||||
**WP0.** The eight hosts move into modules with no change in behaviour: the existing tests pass with edits to imports only. `careers_url`, `is_known_target`, `_allowed_host` and `_paged` lose their Teamtailor branches to the module. `_get` takes `headers`. `detail` and the robots check are added to the shared code with tests against a fake host. `discover.py` takes `READABLE`, `HOSTS`, `_PROBES` and the body checks of `probe` from the modules; the hosts it names but cannot read stay in a table of its own. Discovery gains Lever's EU host. The tests that use `workday:` or `successfactors` as the unreadable host use `taleo` instead.
|
||||
|
||||
**WP1.** Migration 15, the four endpoints, `CompanyOut`'s new fields, `remove_company` taking the `agent_companies` rows, `careers_url` filled only when empty in `add_discovered` and `seed_companies`, the seed reading `hand_reason`, and `app companies add`, `edit`, `checked` and `remove` in the CLI. The `workday:` and `successfactors` fixtures in its three test files become `taleo`.
|
||||
**WP1.** Migration 16 with `hand_reason` only, the endpoints `POST /api/companies`, `PATCH` and `DELETE`, `CompanyOut`'s new fields, `remove_company` taking the `agent_companies` rows, `careers_url` filled only when empty in `add_discovered` and `seed_companies`, the seed reading `hand_reason`, `check_careers_url` as the one rule for a typed link, and `app companies add`, `edit`, `checked`, `by-hand` and `remove` in the CLI, where `checked` stamps `careers_opened_at` and `by-hand` lists the never opened first. The `workday:` and `successfactors` fixtures in its three test files become `taleo`.
|
||||
|
||||
**WP2.** A section "Check by hand" in the Sources rail, after Company boards: a count, a New company button, and rows sorted by `checked_at`, never checked first. A row shows the name, the affinity control, the reason, the careers link, the note, "checked 3 days ago", and Checked, Edit and Remove. New and Edit use the form pattern of the job boards section (`sources.js`: a `<template>`, the row becomes the form in place). The filter "Not readable yet" in Company boards is removed, since the section replaces it. Until WP1 is merged the page is built against the contract above.
|
||||
**WP2b.** New, Edit and Remove on the Watchlist tab, which is the by-hand list. New puts a form on top of the list: name, careers link, note and reason, sent to `POST /api/companies`. A row gains Edit, which turns it into the same form in place (`PATCH`), and Remove, which asks first (`DELETE`, and a 409 is shown in the row). A row shows the reason and the note. New and Edit use the form pattern of the job boards section (`sources.js`: a `<template>`, the row becomes the form in place). The page lists a company by the rule it has (no shown board and not `from_search`, or a failing board), so a company added by hand appears at once. The Sources rail is left as it is. Until WP1 is merged the page is built against the contract above.
|
||||
|
||||
**WP3 to WP8.** One module per host as the contract says, with parser tests from a saved response, paging and completeness tests against a fake `get`, and the allow-list and slug tests. Each host's notes name the listing, the paging quirks and the fields.
|
||||
|
||||
|
||||
Reference in new issue
Block a user