Handbook
Coding task executor (`forge_lcdl.coding`)
Cheap models should work on one bounded patch unit at a time: allowed paths, forbidden paths, acceptance checks, and explicit verification commands. This package plans units, runs a caller-supplied apply function…
Coding task executor (forge_lcdl.coding)
Purpose
Cheap models should work on one bounded patch unit at a time: allowed paths, forbidden paths, acceptance checks, and explicit verification commands. This package plans units, runs a caller-supplied apply function, optionally verifies outcomes, and emits a proof report (Markdown + JSON). It does not call LLMs and does not auto-edit the filesystem; only your apply_fn may write files.
Patch unit
PatchUnit carries:
patch_id,goalallowed_files/forbidden_files(path strings; overlap rejected byvalidate_patch_unit)acceptance_criteria,verification_commands(each entry is anargvtuple forPytestVerifier— same explicit-argv model as VERIFICATION.md)- Optional
ContextPack,max_files_changed,max_lines_changed
Planner
create_patch_units is deterministic: keywords in the task string add ordered units (pytest / test → tests, contract → contracts, doc / readme → docs), otherwise one generic unit. Default forbidden list denies env / secret-like globs (callers must still enforce in real tools). Optional ContextPack.included_files seed allowed hints.
Execution
validate_patch_unitapply_fn(unit) -> ApplyPatchOutcome- Optional
post_verify(unit, outcome)returningVerificationResulttuples (for tests/MCP) - Each
verification_commandsargv run viaPytestVerifierunlessskip_verification=True - Failures map to
PatchUnitResult; first failed verification can attach aRepairInstructionviaREPAIR-LOOPS.mdhelpers
Proof report
proof_report_from_results aggregates PatchUnitResult rows into ProofReport. Use proof_report_to_markdown for human-readable output and proof_report_to_dict for JSON.
Related modules
- Context:
CONTEXT-PACKS.md - Verification:
VERIFICATION.md - Repair:
REPAIR-LOOPS.md - Graph executor:
GRAPH.md— separate DAG runner; not replaced by this sprint
Risks
Callers must enforce repo policy (branches, backups, review). verification_commands run subprocesses with caller-supplied argv only.