2.7 KiB
2.7 KiB
AGENTS.md — iftypeset working rules
These instructions apply to the entire iftypeset/ tree.
Non‑negotiables (copyright + scope)
- Do not OCR/transcribe Chicago/Bringhurst into the repo. Rules are paraphrases only with pointer refs (e.g.,
CMOS18 §6.2 p377 (scan p10)). - OCR is allowed only ephemerally (stdout or temp files deleted) to locate pointers.
- Prefer deterministic, measurable rules. If it can’t be automated, mark it as manual via
tags: ["manual_checklist=true"]and ensure it lands in the checklist output.
“Don’t lose work” operating practice
- Trust the filesystem, not the chat transcript.
- Use
./scripts/audit.shto capture current state. - Use
./scripts/ci.shas the fastest sanity check. - After meaningful changes, create a restore point:
./scripts/checkpoint.sh "short note". - Checkpoints are recorded in
docs/CHECKPOINTS.md.
Session ID hygiene (required)
Codex CLI shows a session_id via /status (look for the Session: line). To prevent two terminals from sharing/overwriting one session state:
- Run
/statusat session start and copy theSession:value. - When claiming a task in
docs/13-task-board.md, include it inowner(example:codex-cli (gpt-5.2) [sid: 019b…]). - Also include it in your row in
/root/docs/SESSION_STATE.md(either inwhoornotes). - If you ever see two live terminals with the same
session_id, stop one and start a fresh session (newsession_id).
Fallback (if /status is unavailable):
day_dir=/root/.codex/sessions/$(date -u +%Y/%m/%d)
latest=$(ls -1t "$day_dir"/rollout-*.jsonl | head -n 1)
python3 - <<'PY' "$latest"
import json,sys
print(json.loads(open(sys.argv[1]).readline())["payload"]["id"])
PY
If multiple sessions are active, run this immediately after starting your session so “latest” corresponds to your own launch.
When adding rules
- Follow
spec/schema/rule.schema.jsonstrictly; runPYTHONPATH=src python3 -m iftypeset.cli validate-spec --spec spec --build-indexes. - Keep
rule_textshort and paraphrased; never paste long passages. - Prefer adding new batches (e.g.,
v1_links_004.ndjson) over editing old IDs; deprecate instead of mutating IDs.
When changing code
- Keep dependencies minimal (currently
requirements.txtis intentionally small). - Update
app/CLI_SPEC.mdandSTATUS.mdwhen behavior or counts change. - Ensure
./scripts/ci.shpasses before handing off.
Typography baseline (house default)
- Default body font size is
12ptfor reader-facing PDFs; do not go below12ptunless the profile description explicitly justifies it (e.g., slide decks, constrained one-page CVs). - Prefer fixing density with margins/spacing/layout before shrinking type.