78 lines
3.7 KiB
Markdown
78 lines
3.7 KiB
Markdown
# iftypeset status (pubstyle)
|
||
|
||
**Updated:** 2026-01-03
|
||
**Project root:** `/root/ai-workspace/iftypeset/`
|
||
|
||
## What exists (working today)
|
||
|
||
- **Spec + schema:** `spec/schema/rule.schema.json`, `spec/manifest.yaml`
|
||
- **Profiles:** `spec/profiles/*.yaml` (`web_pdf`, `print_pdf`, `dense_tech`, `memo`, `slide_deck`)
|
||
- **Post-render QA gates:** `spec/quality_gates.yaml`
|
||
- **Rule registry (seeded):** `spec/rules/**.ndjson`
|
||
- **Indexes (derived):** `spec/indexes/*.json` (rebuildable)
|
||
- **CLI:** `validate-spec`, `report`, `lint`, `render-html`, `render-pdf`, `qa`, `emit-css`
|
||
- **Ephemeral extraction helpers:** `tools/` (Chicago OCR is grep-only, temp files deleted)
|
||
- **Forgejo integration note:** `forgejo/README.md`
|
||
- **Fixtures + tests:** `fixtures/` and `tests/`
|
||
- **CI script:** `scripts/ci.sh` (validate-spec, report, unit tests)
|
||
|
||
## Rule corpus snapshot
|
||
|
||
From `out/coverage-report.json`:
|
||
|
||
- **Total rules:** 307
|
||
- **By category:** citations 61, numbers 62, punctuation 55, layout 46, headings 32, tables 23, typography 15, links 5, accessibility 4, code 4
|
||
- **By enforcement:** manual 186, typeset 62, lint 46, postrender 13
|
||
- **By severity:** must 28, should 263, warn 16
|
||
|
||
## Current rule batches
|
||
|
||
- `spec/rules/accessibility/v1_accessibility_001.ndjson` (4)
|
||
- `spec/rules/citations/v1_citations_001.ndjson` (16)
|
||
- `spec/rules/citations/v1_citations_002.ndjson` (45)
|
||
- `spec/rules/code/v1_code_001.ndjson` (4)
|
||
- `spec/rules/headings/v1_headings_001.ndjson` (12)
|
||
- `spec/rules/headings/v1_headings_002.ndjson` (20)
|
||
- `spec/rules/layout/v1_layout_001.ndjson` (12)
|
||
- `spec/rules/layout/v1_layout_002.ndjson` (30)
|
||
- `spec/rules/layout/v1_layout_003.ndjson` (4)
|
||
- `spec/rules/links/v1_links_001.ndjson` (5)
|
||
- `spec/rules/numbers/v1_numbers_001.ndjson` (12)
|
||
- `spec/rules/numbers/v1_numbers_002.ndjson` (50)
|
||
- `spec/rules/punctuation/v1_punctuation_001.ndjson` (15)
|
||
- `spec/rules/punctuation/v1_punctuation_002.ndjson` (40)
|
||
- `spec/rules/tables/v1_tables_001.ndjson` (8)
|
||
- `spec/rules/tables/v1_tables_002.ndjson` (15)
|
||
- `spec/rules/typography/v1_typography_001.ndjson` (8)
|
||
- `spec/rules/typography/v1_typography_002.ndjson` (7)
|
||
|
||
## How to validate and inspect
|
||
|
||
- Validate spec + rebuild indexes:
|
||
- `PYTHONPATH=src python3 -m iftypeset.cli validate-spec --spec spec --build-indexes`
|
||
- Lint:
|
||
- `PYTHONPATH=src python3 -m iftypeset.cli lint --input fixtures/sample.md --out out --profile web_pdf`
|
||
- Render HTML + CSS:
|
||
- `PYTHONPATH=src python3 -m iftypeset.cli render-html --input fixtures/sample.md --out out --profile web_pdf`
|
||
- Render PDF (if renderer installed):
|
||
- `PYTHONPATH=src python3 -m iftypeset.cli render-pdf --input fixtures/sample.md --out out --profile web_pdf`
|
||
- Run QA gates (HTML fallback if no PDF):
|
||
- `PYTHONPATH=src python3 -m iftypeset.cli qa --out out --profile web_pdf`
|
||
- Coverage report:
|
||
- `PYTHONPATH=src python3 -m iftypeset.cli report --spec spec --out out --build-indexes`
|
||
- Emit CSS for a profile:
|
||
- `PYTHONPATH=src python3 -m iftypeset.cli emit-css --spec spec --profile web_pdf --out out-css`
|
||
- Run unit tests:
|
||
- `python3 -m unittest discover -s tests -p 'test_*.py'`
|
||
|
||
## Key constraints (don’t drift)
|
||
|
||
- **No bulk OCR/transcription** of books into repo. Rules must be paraphrased and pointer-backed.
|
||
- `source_refs` must be **pointers**, not quotes; include `(scan pN)` only as a single page hint.
|
||
- Chicago extraction may use OCR **ephemerally** only to locate pointers; do not persist OCR output.
|
||
|
||
## Next work (highest leverage)
|
||
|
||
- Add new batches for: `figures`, `frontmatter`, `backmatter`, `abbreviations`, `i18n`, and expand `accessibility`.
|
||
- Grow post-render QA rule coverage (widows/orphans, heading keeps, overflow) beyond the current seed set.
|
||
- Add a real PDF-layout analyzer when a stable renderer is selected (widows/orphans, overflow).
|