Report Material Pack
LensBench does not typeset or write analysis text: the engine produces only the material, and the final report is assembled and written by an external AI (or by you). A single command, lb pack, exports everything you need for writing a report into one directory. Every item carries an evidence id, and the manifest states its meaning, unit and file. If the design changes, lb pack-status tells you which items are out of date. The CLI, the desktop app (ribbon "交付" (Deliver) › "素材包" (Material Pack): export report material pack… / is the pack out of date… / check report numbers…; the first two are also in the "文件" (File) menu; export runs in the background and the interface stays usable) and MCP all use the same command.
lb pack cooke.lens # writes to <lens directory>/reports/cooke_pack/
lb pack cooke.lens out/pack --items "prescription layout mtf verify conclusions"
lb pack cooke.lens --dpi 600 --lang en # PNG resolution (default 300), figure language
lb pack-status cooke.lens # after the design changed: which items are out of dateWhat is in the directory
| File | Content |
|---|---|
manifest.json | Manifest: for each item its id, name, meaning, unit, file, evidence id and evidence key; plus the lens name, model hash, engine build number and export time |
README.md | The same manifest as a table; it opens with the hard constraints for writing the report (see below) |
figures/<kind>.png, .svg | Publication-quality figures (300 dpi PNG + vector SVG) with a figure frame: title, info block, evidence id, model hash |
data/<kind>.csv, .json | The data table page of each figure (CSV, units in the header, with a BOM so Excel opens it directly) and the raw data (JSON, NaN written as null) |
tables/<table>.csv, .json | The prescription table (prescription), first-order quantities (paraxial), the acceptance table (verify), and manufacturability (manufacturing) |
conclusions.json | Deterministic conclusions, each with an evidence id |
The signoff section of the manifest states whether this version has been signed off (lb signoff): signed off, only text changed after sign-off, optics changed after sign-off (sign-off no longer valid), or never signed off. The README opens with the same statement, and for a version that is not signed off the report is required to say "not reviewed".
Files that were in the previous pack but are no longer exported this time are deleted (only those listed in the manifest; other files in the directory are left alone). A figure that is unavailable on the current system (for example a footprint on a coordinate break), or an acceptance table when there is no spec, is recorded under skipped in the manifest together with the reason.
What gets exported: the pack statement
Written in the .lens file; like view, it is saved with the design and can be diffed. It can span several lines, which are merged in order of appearance:
pack prescription paraxial layout spot spot_density mtf fieldcurv
pack encircled_energy seidel verify manufacturing conclusionsAn entry is a table (prescription paraxial verify manufacturing), a figure kind (same as view, see the Plotting Guide), or conclusions. Without a pack statement the default set is exported: prescription, first-order quantities, layout, spot diagram, spot density map, ray fan, MTF, field curvature and distortion, encircled energy, Seidel, acceptance, manufacturability, and deterministic conclusions. Sampling and display options of the figures are taken from the view statements as usual, so the figures in the pack are the same ones you see in the interface and produce with lb plot. A multi-configuration design is exported with configuration 1; for the layout with all configurations side by side (configs=all), use lb plot separately.
Deterministic conclusions
Every entry in conclusions.json is derived mechanically from analysis results and carries a type, a one-sentence text, numeric values, and an evidence id:
| type | Content | Basis |
|---|---|---|
spec_pass / spec_fail / spec_unknown | All specs pass, or which one failed, with value and limit (multi-configuration: one "all pass" entry per configuration; failures are tagged with the configuration and cite that configuration's evidence id; the acceptance table gains configuration and evidence columns) | lb verify |
dominant_aberration | The two largest contributors among the third-order aberrations (sum of the Seidel wavefront coefficients) | lb seidel |
worst_field | The field with the largest polychromatic spot RMS | lb spot |
distortion | The maximum distortion, whether it is barrel or pincushion, and at which field | lb field-curvature |
lateral_color | The maximum lateral color, compared with the Airy radius | lb lateral-color |
manufacturing / manufacturing_ok | Mounting violations (interpenetration, negative edge thickness) and lenses with edge thickness below 0.5 mm | The layout's mounting check |
Hard constraints for writing the report
These are written at the top of the README.md of every pack, for the external AI to read:
- Copy numbers verbatim from the material (CSV / JSON / conclusions); do not rewrite them, estimate them, or read values off a figure, and cite the evidence id (
ev-…) in the text. - Causal statements (such as "the low MTF at the edge field is due to coma") may rest only on the conclusions in
conclusions.jsonor on an explicitly cited analysis; without a basis, do not write them. - Items marked out of date in the manifest must not be used: if the design has changed, export again.
When a cloud AI writes the report, the material (including the prescription and analysis values) is sent to the model provider; with a local model nothing leaves your machine.
With an MCP client you can pick the prompt template "整理报告素材" (Prepare report material, report_materials) directly: it runs verify first, then pack, reads the README and conclusions, checks the finished draft with check_report, and uses pack_status to look for out-of-date items after the design changes (see Native AI).
Checking numbers in a report draft
After the external AI has written a report draft (Markdown / text), hand it back for checking:
lb check-report cooke.lens report_draft.md # the pack is expected in reports/cooke_pack/ by default
lb check-report cooke.lens report_draft.md --strict # exit code 1 if any number does not match; usable as a gate before deliveryIf the pack is not in the default location, add --dir <directory>. The rules are deterministic and do not guess at semantics:
- Sentences are split at 。!?; and line breaks (full-width Chinese punctuation); one row of a Markdown table counts as one sentence. The evidence id cited in a sentence is the source of that sentence's numbers.
- The source's values are: the data table page / table (CSV, JSON) of that evidence in the pack, plus the deterministic conclusions that cite it (text and values).
- A number matches if, rounded to the number of digits written in the draft, it equals one of the values (writing 50.02 against 50.021 35 matches; writing 50.03 does not). Also accepted are ×100 (a ratio written as a percentage) and the ×1000 conversion between mm and µm; the result states which conversion was used. The sign must be right.
- Only numbers with at least 2 significant digits are checked. A number with 1 significant digit ("3 elements", "F/5") will always find a match somewhere in a large table, so checking it is meaningless; these are listed as "unchecked".
- There are four verdicts: matched, not matched (✗), cites an evidence id that is not in the pack (✗), and has a number but cites no evidence (? hint only). Dates, evidence ids themselves, and list ordinals do not count as numbers.
It checks whether the numbers were copied faithfully, not whether the statements are correct: whether a causal claim has a basis still needs a human to read it.
Staleness check
Evidence ids are deterministic (model hash + engine + analysis kind + sampling parameters), so lb pack-status does not recompute any analysis: it recomputes the evidence id on the current design from the evidence key of each item in the manifest, and any that do not match are out of date.
- Optics changed (radius, thickness, glass, fields, wavelengths…): all items are out of date.
- Only
specchanged: the acceptance table and the deterministic conclusions are out of date; figures and the prescription are not. However, the spec annotations drawn on the MTF, spot, field curvature and distortion, lateral color and chromatic focal shift figures are still the old ones; runlb packagain to update the annotations. - The engine or analysis conventions changed after upgrading LensBench: all items are out of date (the evidence id contains the engine identifier); just export again.
- Only the name, comments, or formatting changed: nothing is out of date (these do not enter the model hash).
When something is out of date, run lb pack again and have the AI regenerate the report.