Skip to content

Treat a figure as content, not as a block to ignore - #24

Open
peterbjohnson wants to merge 2 commits into
mainfrom
wb/t24
Open

peterbjohnson wants to merge 2 commits into
mainfrom
wb/t24

Conversation

@peterbjohnson

Copy link
Copy Markdown
Member

On UCL_MechEng/Worksheet_2.pdf the spec the agent wrote holds ignore: Para text~'Figure [0-9]+:'. Mathpix writes each figure as one paragraph, the image line then its caption, so that selector marks every figure of the sheet ignored: Figure 1 (the Lucy Ashton, which Q4 is about), Figure 2 (the model test results Q4 ii) asks the student to read) and Figure 3 (the drag-coefficient curve Q4 asks the student to digitise). The set built with no images, and nothing in the run said so.

A figure is content. In in2lambda_agent/spec.py, the spec-writing prompt says that a paragraph holding an image belongs to the question or part it illustrates, and that ignore is for headings, rubric and page furniture, never for a paragraph holding ![. After spec run, the pipeline reads the draft and counts the blocks marked ignore whose lines hold an image reference; if there are any, it reports them as a coverage finding (b10 (lines 29-30) holds an image and is marked ignore) and the spec is rewritten once with that finding, as t16's iteration does for unassigned blocks; if the rewrite still ignores an image, the run carries on and the stage line says how many images were dropped. A test in tests/test_spec.py runs a source with a figure paragraph through a fake backend whose first spec ignores it and asserts that the second call's prompt names the block and that the stage line reports it. Done when a run over Worksheet_2.pdf builds a zip whose media/ holds the three figures, or says which it dropped.


Workbench ticket t24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant