Copy of .claude/rules/ats-filler-delta.md from aetherion-autoapply
Generated from aetherion-autoapply/.claude/rules/ats-filler-delta.md at commit 89a92b10. Edit the source file, not this copy.
paths: - "src/aetherion_web/automation/fill/" - "backend/tests/fixtures/fill/" - "backend/tests/test_fill.py"
Per-ATS filler deltas¶
A filler delta is a thin subclass of GenericFiller (automation/fill/base.py). It only
corrects what the shared filler gets wrong on one ATS. It is never a rewrite. lever.py
is the reference example. Greenhouse and Ashby need no delta: React-select, ARIA
listboxes and aria-pressed toggle buttons are handled in shared code.
When to add one¶
- Only when the generic filler gets a live-behaviour fixture of that ATS wrong (a widget that doesn't take the value, or that the post-fill check can't read back).
- First check whether shared code should change instead. If the widget follows a public
contract that isn't specific to one ATS (an ARIA role or state, React-select's
select__*classes, a native control), fixbase.py/verify.py.
Structure: one file, automation/fill/<ats>.py, aim for < 100 lines¶
"""<ATS> delta.
- matches: inventories from the ``<ats>`` extractor
- <hook>: <one line per quirk, naming the widget>
"""
from .base import GenericFiller
class <Ats>Filler(GenericFiller):
name = "<ats>" # equals the extractor's name
option_selectors = (*GenericFiller.option_selectors, "...") # declarative (preferred)
def matches(self, ats: str) -> bool: return ats == "<ats>" # required
async def fill_text(self, el, f, value): ... # override only the widget hooks you need:
async def set_toggle(self, el, want): ... # fill_text, set_toggle, select_native,
async def pick_custom(self, el, f, values): ... # pick_custom, set_file
async def set_file(self, el, f, path): ...
__init_subclass__ rejects a class
that overrides fill(). Find elements through self.element(inventory, ref, opt) (the
[data-aeth-ref] stamps), never by re-scanning the page.
- A hook raises (FillError with a message for the bidder) when the widget doesn't take
the value. Never swallow it: fill() turns it into a Problem and moves on.
- The read-back in verify.py is shared. If it can't see an ATS widget's state, extend
_READ_JS with a generic signal (an ARIA attribute, a public class), not an ATS branch.
- Selectors follow the extractor rule: stable hooks (name, id, data-*, ARIA, public
vendor class prefixes), never hashed CSS-module classes.
- Never click a submit, next or apply button from a filler. Navigation and submit belong
to the orchestrator.
Fixtures and tests¶
- Captured extract fixtures (
tests/fixtures/extract/<ats>/) have their scripts stripped, so custom widgets in them can't react. Fill tests need a hand-written live-behaviour fixture,tests/fixtures/fill/<ats>_<widget>.htmlplus.meta.jsonwith a URL the ATS extractor matches. Copy the DOM contract from the captured snapshot and add the smallest inline script that keeps the widget's state the way the real one does. - In
tests/test_fill.py, add a test that fills it and passespostfill_validate, and a test showing thatGENERICfails on it (otherwise the delta isn't needed). - Register the class in
fill._register().FillerContractTestchecks that the name matches an extractor and that only hooks are overridden. uv run python -m unittest discover testsanduv run ruff check src tests.