Handbook
Artifact `PageMechanicsSpec` v1
JSON object exchanged between source-ingest Playwright runtime and LCDL mechanics tasks. It describes inferred page kind, confidence, a question context blob, ordered actions the runtime may execute (declarative kinds…
Artifact PageMechanicsSpec v1
Summary
JSON object exchanged between source-ingest Playwright runtime and LCDL mechanics tasks. It describes inferred page kind, confidence, a question context blob, ordered actions the runtime may execute (declarative kinds only—no arbitrary scripts), and metadata for grading, loops, safety, and notes.
LCDL does not run Playwright; the runtime consumes this spec after validation.
Root object
| Field | Type | Required | Notes |
|---|---|---|---|
schema_version |
string | yes | Must be exactly page_mechanics_v1. |
page_kind |
string | yes | One of the allowed page_kind values (see below). Use unknown when unsure. |
confidence |
number | yes | Model or heuristic confidence in [0.0, 1.0]. |
question |
object | yes | Opaque context for the question flow (e.g. stems, option labels, DOM hints). May be {}. |
actions |
array | yes | Ordered list of action objects (see Action object). |
grading |
object | yes | How correctness is observed (e.g. revealed answer, score selector). May be {}. |
loop |
object | yes | Pagination / repeat hints. May be {}. |
safety |
object | yes | Bounds (max steps, stop conditions). May be {}. |
notes |
string | yes | Human-readable caveats; use "" if none. |
Allowed page_kind values
static_mcq_pageinteractive_quizpaginated_static_quizapi_backed_quizpdf_or_documentlogin_or_blockedunknown
Any other string is invalid for v1.
Action object
Each element of actions is an object:
| Field | Type | Required | Notes |
|---|---|---|---|
kind |
string | yes | One of the allowed action kinds (see below). |
| … | varies | no | Additional fields (e.g. selector, value, timeout_ms) are defined by the runtime; this contract does not enumerate them. |
Allowed action kind values
clickclick_if_presentclick_option_by_indexselect_option_by_valuefillpresswait_for_selectorwait_for_text_changewait_for_url_changewait_for_network_idleread_textread_attributeread_class
Forbidden action kinds
These must never appear—arbitrary JavaScript execution is out of scope:
evalexecute_jsscript
(Case-insensitive match for rejection in validators.)
Validation split
- forge-lcdl (
validate_page_mechanics_shape,validate_allowed_actions): lightweight structural and enum checks for tasks and tooling. - Source-ingest runtime: selector existence, timeouts, deterministic replay, and full Playwright semantics.
Changelog
- v1 — Initial mechanics discovery contract.