Skip to content

Tighten survey and chat-history Typst templates - #64

Open
GiggleLiu wants to merge 3 commits into
mainfrom
feat/dense-report-templates
Open

GiggleLiu wants to merge 3 commits into
mainfrom
feat/dense-report-templates

Conversation

@GiggleLiu

@GiggleLiu GiggleLiu commented Sep 16, 2026

Copy link
Copy Markdown
Member

Observation

The chat-history PDF spent most of page one on front matter (large title, subtitle, date line, scope and coverage paragraphs, a Transcript heading) before the first prompt appeared. The survey scaffold used pastel rounded boxes, fully ruled tables with fixed column fractions, and two figures before the first approach, and its placeholder already ran to two pages.

Issue

Both reports exist to present information quickly. Front matter that pushes the content down, and decoration that does not carry information, work against that. The survey table widths also did not fit their own header and priority labels, and long tables did not repeat headers across pages.

Fix

  • skills/dump-chat-history/assets/report.typ: front matter is title, optional subtitle, one date line; the first prompt follows directly. Scope and coverage move to "Sources and limits". The per-message entry style is unchanged. Phase labels stick to the next message, and the footer grid keeps the title clear of the page number.
  • skills/survey/template.typ: plain title line, 18 mm margins, 10 pt justified body, "Assessment in brief" callout after Scope, "Mechanism / Best evidence" labels per approach, a shared report-table helper with horizontal rules, repeating headers, and content-fitted widths; compare_table accepts custom headers and columns; urgency labels are written text; a "Next step" paragraph closes the report. The placeholder fits one page.
  • skills/survey/template.typ and skills/survey/SKILL.md: "What and why" becomes "Overview", and a new "Key questions" section sits before the techniques: one subsection per subtopic with the question, why it matters (understanding and/or practical value), and where it stands. Strengths and limitations stay with techniques only.
  • Both templates accept --input heading-font=... (the chat template also body-font) for builds without system fonts.
  • skills/dump-chat-history/SKILL.md, skills/survey/SKILL.md, skills/how-to-write-ideas-report/references/typst-reference.md: describe the resulting layout.

Rendered comparison (committed / earlier redesign / this PR): https://claude.ai/artifact/VY1qV8uD11TSXteN1LAjqr

Verification

  • python3 scripts/validate_skills.py: 16 skills validated.
  • python3 -m pytest -q: 256 passed, including the existing test_pdf_handles_long_original_text_and_structured_answers (every original string survives the PDF) and the new tests/test_typst_reports.py (a 45-row problem table paginates with the header repeated on every page and all rows present; compare_table with custom headers and the legacy positional stage color still compile without warnings under --ignore-system-fonts).

🤖 Generated with Claude Code

GiggleLiu and others added 2 commits September 16, 2026 16:24
Chat-history PDF: shorten front matter to title, subtitle, and one date line
so the first prompt lands on page one; move scope and coverage to the
closing section; keep the existing entry style; phase labels stick to the
next message and the footer grid keeps title and page number apart.

Survey review: open with an "Assessment in brief" callout after Scope,
label each approach by mechanism and best evidence, use horizontal-rule
tables with repeating headers and content-fitted widths, write urgency as
text, and close with a next step. Plain title line, 18 mm margins, 10 pt
justified body; the placeholder now fits one page.

Both templates accept --input heading-font for builds without system
fonts. Add a render test for tables that cross page boundaries.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
report_table asserts that headers match columns and every row matches
the column count, naming the offending row, instead of shifting cells
silently. problem_table gains the same headers/columns overrides as
compare_table; stage defaults its fill; the survey template defines the
sans fallback tuple once. The chat template accepts --input body-font so
a bundled-fonts build is warning-free, and a new test renders it that way
and checks the first prompt lands on page one with scope and coverage in
the closing section.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@GiggleLiu

Copy link
Copy Markdown
Member Author

Self-review (fresh-context reviewer, commit 2319ff1)

Git audit: GATE PASS. harm.secrets OK, harm.dangerous-files OK, harm.generated-artifacts OK, harm.cache OK, harm.debug-leftovers OK (only the survey scaffold's intentional TODO: fill-in markers). pr.description-quality OK, pr.traceable OK (no issue; purpose and verification stated in the body).

Design: DRY minor issue (survey template repeated the (sans, serif) fallback tuple at seven call sites); KISS OK; HC/LC OK.

Findings and disposition

# Severity Finding Disposition
1 Important report-table silently mis-nested cells when headers, columns, or a row disagreed in length. Fixed. report_table now asserts header/column count and per-row length with messages naming the row; two tests cover both failure modes.
2 Important The chat template's heading-font input was never compiled under --ignore-system-fonts, and Charter still warned in such a build. Fixed. Added body-font input; new test renders the chat fixture with bundled fonts only, asserts no warnings, first prompt and phase on page one, scope/coverage only after "Sources and limits", and the long title clear of the page number.
3 Minor Survey template defined sans as a string and repeated the fallback tuple. Fixed. sans is the tuple, matching the chat template.
4 Minor Mixed hyphen/underscore naming for new identifiers. Fixed. report_table, review_date, short_title. Public helper names unchanged.
5 Minor problem_table lacked the headers/columns overrides; stage required fill positionally. Fixed. Both siblings take the overrides; stage defaults fill: tint.
6 Minor Doc drifts: bundled-fonts claim vs Charter warning, rect in survey SKILL.md, title sizes in typst-reference.md. Fixed. Docs describe body-font, say block, and give the 18–20 pt / 13–14 pt range both templates use.
7 Minor Pagination test's "Problem" header check was satisfied by Problem-N row text. Fixed. Rows renamed Row-N.

Gate after fixes: python3 scripts/validate_skills.py 16 skills OK; python3 -m pytest -q 273 passed.

Rename "What and why" to "Overview" and add a "Key questions" section
between it and the techniques: one subsection per subtopic with the
question, why it matters (understanding and/or practical value), and
where it stands. Strengths and limitations remain for techniques only.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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