Task `pw_mechanics_repair` v1

Given previous mechanics JSON plus a structured validation_failure payload from the source-ingest runtime, propose repaired_mechanics and a concise patch_summary. Intended for iterative loops against deterministic…

Updated

Task pw_mechanics_repair v1

Summary

Given previous mechanics JSON plus a structured validation_failure payload from the source-ingest runtime, propose repaired_mechanics and a concise patch_summary. Intended for iterative loops against deterministic validators—LCDL does not run Playwright.

Inputs

Field Type Required Notes
url string yes Context URL (non-empty when stripped).
previous_mechanics object yes Last mechanics spec (may be {}).
validation_failure object yes Failure facts (stage, expected, actual, etc.).
operator_hints string no Extra hints; omit or "".
temperature number no Default 0.05.
timeout_sec int no Default profile.timeout_sec.

Output

Field Type Notes
repaired_mechanics object Updated mechanics object for runtime retry (may be {}).
patch_summary string Human-readable delta summary.
confidence number Coerced to [0.0, 1.0].
issues array of string Residual risks or open problems (may be []).

Post-validation

  • Code-carrier keys rejected recursively (extractor_python, code, script, etc.—see reject_code_carrier_keys_tree).
  • When actions is present as object or array, every kind must be an allowed ACTION_KINDS token and not eval / execute_js / script.

Failure modes

  • SchemaFailure — invalid shapes vs contract or forbidden action kinds after repair.
  • ParseFailure — assistant returned non-JSON or incomplete repaired_mechanics.
  • GatewayFailure — upstream model errors.

Verification

Recursive key rejection and mechanics shape validation in task implementation; compare against validation_failure payload stages when provided.

Examples

{
  "url": "https://example.com/q",
  "previous_mechanics": {},
  "validation_failure": { "schema_version": "validation_failure_v1", "code": "schema_invalid", "message": "test" }
}

Changelog

  • v1 — Initial mechanics repair path.