From 5d932c46f655c337d14947d202fc175e577d0f1e Mon Sep 17 00:00:00 2001 From: Anthony Giacalone Date: Tue, 27 Oct 2026 10:03:11 -0700 Subject: [PATCH] feat: case-study fact sheets (--artifact fact-sheet) A one-page, student-facing reference card per named case study: a facts table, grouped bullets (numbered with #steps) and a linked Sources line. Facts are a new role tag, `#fact [case:: Name]`, with [label::] for a table row or [group::] for a bullet; a #case-study with the same [case::] supplies the opening paragraph. A fact without [case::] is a hard error; one inside a numbered section is a warning, because facts live under an unnumbered heading that section-walking artifacts never read. The sheet is skipped when a lecture has no facts, so `all` is unchanged for existing lectures. First built for Mirai in the CECS 378 Denial of Service lecture. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LMsLD73YktSkHCT6wBQMFb --- CHANGELOG.md | 17 +++++ CLAUDE.md | 2 + README.md | 3 +- SKILL.md | 5 ++ generate.js | 16 ++++ generators/fact-sheet.js | 138 ++++++++++++++++++++++++++++++++++ generators/fact-sheet.test.js | 97 ++++++++++++++++++++++++ package.json | 2 +- parser/main-parser.js | 2 +- parser/validators.js | 21 ++++++ references/style-guide.md | 59 +++++++++++++++ 11 files changed, 359 insertions(+), 3 deletions(-) create mode 100644 generators/fact-sheet.js create mode 100644 generators/fact-sheet.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 1295109..541ec59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,23 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] +### Added +- **Fact sheets for case studies (`--artifact fact-sheet`).** A one-page, + student-facing reference card per named case study (a botnet, a breach, an + outage): a facts table, grouped bullets such as removal and prevention steps, + and a linked *Sources* line. The Cornell handout teaches a case and withholds + part of it; the fact sheet is what a student keeps afterwards. Facts are a new + role tag in the lecture main, `#fact [case:: Name]`, with `[label::]` for a table + row or `[group::]` for a bullet (`#steps` numbers a group). A `#case-study` with + the same `[case::]` supplies the opening paragraph. A fact without `[case::]` is + a hard error, and one inside a numbered section is a warning, since facts live + under an unnumbered `## Fact sheet: ` heading that section-walking artifacts + never read. The sheet is skipped, with no file written, when a lecture has no + facts, so `all` is unchanged for every existing lecture. First built for Mirai in + CECS 378's Denial of Service lecture, from the CISA alert TA16-288A. The PDF is + tagged; veraPDF's PDF/UA-1 check reports one advisory rule (7.1-3), from the shared + preamble rather than the table, like the lecture notes' remaining finding. + ### Fixed - **Links in LaTeX handouts.** A Markdown link (`[OSTEP](https://…)`) printed as raw Markdown, and a vault wikilink (`[[note|alias]]`) leaked into a Cornell case-study diff --git a/CLAUDE.md b/CLAUDE.md index 896fb60..73a65da 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -36,6 +36,7 @@ priors, but the formats split into two tiers: - `_cornell_handout.pdf` (student) + `_cornell_handout_key.pdf` (instructor answer key — never distribute) - `_study_questions.md` (student review) - `_quiz.pdf` + `_quiz_key.pdf` + - `_fact_sheet.pdf` (student reference, one page per case study) - `_slides.md` (Slidev) — render/export with the `slides:dev` / `slides:build` scripts - `README.md` (GitHub Classroom) - (exams are no longer produced here — built by lectern's `reg-exam-build` from the @@ -142,6 +143,7 @@ assembly draws from, and the per-exam *reading-list* study guide. | `[topic]_quiz.pdf` + `[topic]_quiz_key.pdf` | Pop quiz | 5 questions (~10 min), MC+short answer, separate key PDF; `.tex` retained | | `[topic]_question_bank.md` | Question bank | ~50 tagged questions (mc/tf/code/fib/sa · ★/★★/★★★ · subtopic); source of truth for exam assembly (in lectern) | | `[topic]_reading_list.md` *or* `[scope]_reading_list.md` | Reading-list companion | Hybrid scaffold paired 1:1 (or 1:N) with Cornell handout(s). Generator emits cue-table rows inside `` … ``; manual content (curated primary sources, References, instructor notes) outside the fence is preserved on regen. | +| `[topic]_fact_sheet.pdf` | Case-study fact sheet | One student-facing page per case, from `#fact [case::]` items under an unnumbered heading; facts table + grouped bullets + Sources; skipped when there are no facts; `.tex` retained | | `README.md` | GitHub Classroom README | Rigid boilerplate — copy structure exactly | | `[topic]_slides.md` | Slide deck (Slidev) | 14–18 slides; render live or export via the `slides:dev` / `slides:build` scripts. *(Slide styling is mid-migration — the Beamer-era palette notes below are being reworked.)* | diff --git a/README.md b/README.md index 05d9262..c2d3d42 100644 --- a/README.md +++ b/README.md @@ -72,9 +72,10 @@ Run against the bundled sample (`examples/file_systems_abstraction_lecture_main. | Slide deck | `slides` | `.md` (Slidev) | no | | GitHub Classroom README | `readme` | `.md` | no | | Reading-list companion | `reading-list` | `.md` | no | +| Case-study fact sheet | `fact-sheet` | `.tex` → `.pdf` | yes | | Consistency audit | `audit` | console report | no | -Printed artifacts (`lecture-notes`, `cornell`, `quiz`) compile to PDF with +Printed artifacts (`lecture-notes`, `cornell`, `quiz`, `fact-sheet`) compile to PDF with `pdflatex`. Pass `--no-pdf` to emit the `.tex` and skip compilation if you don't have a LaTeX toolchain installed. The slide deck is Slidev Markdown — preview it live with `npm run slides:dev` or export with `npm run slides:build`. diff --git a/SKILL.md b/SKILL.md index c030171..9fef087 100644 --- a/SKILL.md +++ b/SKILL.md @@ -66,6 +66,7 @@ These fields live in the YAML frontmatter and `#meta` section of the | Pop quiz | `[topic]_quiz.pdf` + `[topic]_quiz_key.pdf` (`.tex` retained) | 5-question in-class quiz with separate instructor answer-key PDF | | Question bank | `[topic]_question_bank.md` | ~50 tagged questions (mc/tf/code/fib/sa), scoped to full topic (2–4 sessions) | | Reading-list companion | `[topic]_reading_list.md` (single topic) or `[scope]_reading_list.md` (multi-topic, e.g. `final_third_reading_list.md`) | Hybrid scaffold paired 1:1 (or 1:N) with Cornell handout(s); the generator emits a `` … `` fence with cue-to-source rows; manual content outside the fence is preserved on regen. Can also serve as a pre-exam review deliverable. | +| Fact sheet | `[topic]_fact_sheet.pdf` (`.tex` retained) | One student-facing reference page per case study, from `#fact` items under an unnumbered `## Fact sheet: ` heading. Withholds nothing (unlike the Cornell handout). Skipped when the lecture has no facts. | | GitHub README | `README.md` | GitHub Classroom assignment (reading or lab/programming variant) | | Slide deck | `[topic]_slides.md` (Slidev markdown) | 14–18 slides. Theme auto-selected from `course:` frontmatter: **blueprint** (CECS 326, 378) or **terminal** (CECS 478); default blueprint. Present live via `npx slidev [topic]_slides.md` — no PDF export (slides are a presentation artifact, not a distributed document). | @@ -181,6 +182,7 @@ generators/ slides.js # → [topic]_slides.md (Slidev markdown) question-bank.js # → [topic]_question_bank.md reading-list.js # → [topic]_reading_list.md (fenced scaffold; manual content preserved) + fact-sheet.js # → [topic]_fact_sheet.tex + .pdf (one page per #fact case) archive/ spec-driven-2025/ # historical: init-spec.js + lecture-spec.json (do not author new specs) ``` @@ -198,6 +200,7 @@ node generate.js --main /mnt/es1/anthony/obsidian/vault/classes/326/file_systems node generate.js --main path/to/topic_lecture_main.md --artifact slides node generate.js --main path/to/topic_lecture_main.md --artifact bank node generate.js --main path/to/topic_lecture_main.md --artifact reading-list +node generate.js --main path/to/topic_lecture_main.md --artifact fact-sheet # Override output directory and skip pdflatex node generate.js --main path/to/topic_lecture_main.md --out ./out --no-pdf @@ -334,6 +337,7 @@ cryptography_quiz_key.pdf cryptography_question_bank.md cryptography_slides.md cryptography_reading_list.md +cryptography_fact_sheet.pdf # one page per case study README.md # Reading-list companion (multi-topic — covers a unit or final third): @@ -356,6 +360,7 @@ rules. In particular, check it for: - quiz timing, answer-key format, and question constraints - question-bank schema, numbering, dedupe, and tagging - reading-list companion frontmatter, callouts, cue-table format, and References discipline +- fact-sheet source schema (`#fact`, `[case::]`, `[label::]`, `[group::]`, `#steps`) and content rules - GitHub README boilerplate and Markdown rules - Slidev theme palettes (blueprint / terminal), layout mapping, `` and `` components, and standard deck structure - ADA Title II compliance: `[alt::]` requirement on `#diagram` and diagram slide layouts; color-and-glyph pairing on Cornell sections; tagged-PDF preference diff --git a/generate.js b/generate.js index 8c9b9f5..e8b90f4 100644 --- a/generate.js +++ b/generate.js @@ -21,6 +21,7 @@ import { generateStudyQuestions } from './generators/study-questions.js'; import { generateQuiz } from './generators/quiz.js'; import { generateReadingList } from './generators/reading-list.js'; import { generateReadme } from './generators/readme.js'; +import { generateFactSheet } from './generators/fact-sheet.js'; import { generateAudit } from './generators/audit.js'; import { markUsedTags } from './generators/mark-used.js'; @@ -46,6 +47,7 @@ const ARTIFACTS = new Set([ 'quiz', 'reading-list', 'readme', + 'fact-sheet', ]); const ARTIFACT_ALIASES = { @@ -67,6 +69,7 @@ Artifacts (--artifact): quiz reading-list readme + fact-sheet one page per case study, from #fact items (skipped when there are none) Flags: --main path to _lecture_main.md @@ -340,6 +343,18 @@ async function runArtifact({ artifact, parsed, slug, outDir, log, opts }) { log.info(`✓ readme (${variant}) → ${path.basename(out)}`); return; } + case 'fact-sheet': { + const { tex, cases } = generateFactSheet(parsed, { ...filterOpts }); + if (!tex) { + log.info('· fact-sheet skipped (no #fact items)'); + return; + } + const out = path.join(outDir, `${slug}_fact_sheet.tex`); + writeText(out, tex); + log.info(`✓ fact-sheet → ${path.basename(out)} (${cases.join(', ')})`); + maybeCompile(out, outDir, log, opts.noPdf); + return; + } default: throw new Error(`unhandled artifact: ${artifact}`); } @@ -354,6 +369,7 @@ const ALL_ARTIFACTS = [ 'quiz', 'reading-list', 'readme', + 'fact-sheet', ]; async function runMain(args) { diff --git a/generators/fact-sheet.js b/generators/fact-sheet.js new file mode 100644 index 0000000..f13cadb --- /dev/null +++ b/generators/fact-sheet.js @@ -0,0 +1,138 @@ +// Fact sheet: a one-page, student-facing reference card for each named case +// study in a lecture (a botnet, a breach, an outage). Unlike the Cornell +// handout it withholds nothing: it is the "what happened, when, how big, what +// to do about it" summary a student keeps after the case has been taught. +// +// Source schema (see references/style-guide.md § Fact Sheet): +// #fact [case:: Mirai] [label:: Discovered] August 2016 +// → a row in that case's facts table (label | text) +// #fact [case:: Mirai] [group:: Preventing infection] Change every default password. +// → a bullet under that group's heading; add #steps to any item in the +// group to number the whole group +// #case-study [case:: Mirai] … → the case's opening paragraph (first one wins) +// [citation:: …] on any of them → the case's Sources line, linked the same way +// the exam reference sheet links them +// +// One case per page, in the order each case first appears in the source. +// #draft items are skipped, and the --semester / --strict-semester filters apply. + +import { createRequire } from 'node:module'; +import { applyTermFilter } from './_filter.js'; +import { renderCitation, citationUrlMap } from './exam-reference-sheet.js'; +const require = createRequire(import.meta.url); +const { texPreamble, texEscape, texDocHeader } = require('../lib/tex-helpers.js'); + +const DEFAULT_GROUP = 'Key points'; + +function field(item, k) { + return (item.fields && item.fields.get && item.fields.get(k)) || ''; +} + +function live(items, opts) { + return applyTermFilter(items || [], opts).filter((it) => !it.tags.has('draft')); +} + +// Group the #fact items by [case::], keeping source order for cases, rows and +// groups alike. Items without a case are left to the validator, which rejects them. +export function collectCases(parsed, opts = {}) { + const facts = live(parsed.byRole.get('fact'), opts) + .slice().sort((a, b) => (a.sourceLine || 0) - (b.sourceLine || 0)); + const cases = new Map(); + for (const f of facts) { + const name = field(f, 'case').trim(); + if (!name) continue; + if (!cases.has(name)) cases.set(name, { name, intro: null, rows: [], groups: new Map(), cites: [] }); + const c = cases.get(name); + const label = field(f, 'label').trim(); + if (label) { + c.rows.push({ label, text: f.text }); + } else { + const g = field(f, 'group').trim() || DEFAULT_GROUP; + if (!c.groups.has(g)) c.groups.set(g, { items: [], numbered: false }); + const grp = c.groups.get(g); + grp.items.push(f.text); + if (f.tags.has('steps')) grp.numbered = true; + } + if (field(f, 'citation')) c.cites.push(field(f, 'citation')); + } + for (const cs of live(parsed.byRole.get('case-study'), opts)) { + const c = cases.get(field(cs, 'case').trim()); + if (c && !c.intro) { + c.intro = cs.text; + if (field(cs, 'citation')) c.cites.unshift(field(cs, 'citation')); + } + } + return [...cases.values()]; +} + +function sourcesLine(cites, citeOpts) { + const seen = new Map(); + for (const raw of cites) { + for (const part of String(raw).split(/\s*;\s*/)) { + const r = renderCitation(part, citeOpts); + if (r && !seen.has(r.key)) seen.set(r.key, r.md); + } + } + return [...seen.values()].join(' · '); +} + +function factsTable(rows) { + if (!rows.length) return ''; + // \textcolor, not {\color …}: a \color switch at the start of a p{} cell + // opens an empty line and drops the label below its detail. + const body = rows + .map((r) => `\\textcolor{instrNavy}{\\textbf{${texEscape(r.label)}}} & ${texEscape(r.text)} \\\\\\hline`) + .join('\n'); + // Header row tagged /TH for PDF/UA (same group-scoped directive as texComparisonTable). + return ` +{\\tagpdfsetup{table/header-rows={1}}\\renewcommand{\\arraystretch}{1.3}% +\\noindent\\begin{tabularx}{\\linewidth}{|p{0.24\\linewidth}|X|} +\\hline +\\rowcolor{instrNavy} +\\textcolor{white}{\\textbf{Fact}} & \\textcolor{white}{\\textbf{Detail}} \\\\\\hline +${body} +\\end{tabularx}} +\\vspace{6pt} +`; +} + +function groupBlock(name, grp) { + const env = grp.numbered ? 'enumerate' : 'itemize'; + const items = grp.items.map((t) => ` \\item ${texEscape(t)}`).join('\n'); + return ` +\\needspace{4\\baselineskip} +{\\color{instrNavy}\\textbf{${texEscape(name)}}} +\\begin{${env}} +${items} +\\end{${env}} +\\vspace{4pt} +`; +} + +function caseBlock(c, course, citeOpts) { + const out = [texDocHeader(c.name, 'Fact sheet', course)]; + if (c.intro) out.push(`${texEscape(c.intro)}\n\n\\vspace{6pt}`); + out.push(factsTable(c.rows)); + for (const [name, grp] of c.groups) out.push(groupBlock(name, grp)); + const src = sourcesLine(c.cites, citeOpts); + if (src) out.push(`\n\\vspace{2pt}\n{\\small\\textbf{Sources:} ${texEscape(src)}}\n`); + return out.join('\n'); +} + +// Returns { tex, cases } — tex is null when the lecture has no #fact items, so +// the orchestrator can skip the artifact instead of writing an empty sheet. +export function generateFactSheet(parsed, opts = {}) { + const cases = collectCases(parsed, opts); + if (!cases.length) return { tex: null, cases: [] }; + const fm = parsed.frontmatter || {}; + const course = fm.course || ''; + const topic = fm.title || 'Case studies'; + const citeOpts = { citationUrls: citationUrlMap(fm) }; + const out = [ + texPreamble(`Fact sheet: ${topic}`, course, { fontSize: '11pt', margin: '0.75in' }), + '\\begin{document}', + cases.map((c) => caseBlock(c, course, citeOpts)).join('\n\\newpage\n'), + '\\end{document}', + ]; + return { tex: out.join('\n'), cases: cases.map((c) => c.name) }; +} diff --git a/generators/fact-sheet.test.js b/generators/fact-sheet.test.js new file mode 100644 index 0000000..14fc26c --- /dev/null +++ b/generators/fact-sheet.test.js @@ -0,0 +1,97 @@ +import { describe, it, expect } from 'vitest'; +import { parse, validate } from '../parser/index.js'; +import { generateFactSheet, collectCases } from './fact-sheet.js'; +import { generateLectureNotes } from './lecture-notes.js'; + +const SOURCE = `--- +title: Denial of Service Attacks +course: CECS 378 +topic-slug: denial_of_service +term: fa26 +citation-urls: + - citation: 'CISA TA16-288A' + url: https://www.cisa.gov/news-events/alerts/2016/10/14/heightened-ddos-threat-posed-mirai-and-other-botnets +--- + +# Denial of Service Attacks + +## I. Opener (10 min) + +- Mirai turned cameras and DVRs into a botnet. #concept #section/I [slide:: 1] +- Mirai (2016) took down Dyn. #case-study #section/I [case:: Mirai] [citation:: Krebs 2016] + +## Fact sheet: Mirai + +- IoT botnet malware for DDoS attacks #fact [case:: Mirai] [label:: What] +- August 2016 #fact [case:: Mirai] [label:: Discovered] [citation:: CISA TA16-288A] +- Telnet on ports 23 and 2323, with 62 default passwords #fact [case:: Mirai] [label:: Infection] +- Disconnect the device. #fact #steps [case:: Mirai] [group:: Removing an infection] +- Reboot it while offline. #fact [case:: Mirai] [group:: Removing an infection] +- Change every default password. #fact [case:: Mirai] [group:: Preventing infection] +- Old rumour, cut. #fact #draft [case:: Mirai] [label:: Rumour] + +## Fact sheet: Smurf + +- 1997 #fact [case:: Smurf] [label:: First seen] +`; + +const parsed = () => parse({ source: SOURCE }); + +describe('fact-sheet generator', () => { + it('validates the fact schema cleanly', () => { + const v = validate(parsed()); + expect(v.ok).toBe(true); + expect(v.warnings.filter((w) => /#fact/.test(w.message))).toEqual([]); + }); + + it('groups facts by case in source order, rows before groups, drafts dropped', () => { + const cases = collectCases(parsed()); + expect(cases.map((c) => c.name)).toEqual(['Mirai', 'Smurf']); + const m = cases[0]; + expect(m.rows.map((r) => r.label)).toEqual(['What', 'Discovered', 'Infection']); + expect([...m.groups.keys()]).toEqual(['Removing an infection', 'Preventing infection']); + expect(m.groups.get('Removing an infection').numbered).toBe(true); + expect(m.groups.get('Preventing infection').numbered).toBe(false); + expect(m.intro).toBe('Mirai (2016) took down Dyn.'); + }); + + it('renders one page per case with a tagged header row, steps numbered, sources linked', () => { + const { tex, cases } = generateFactSheet(parsed()); + expect(cases).toEqual(['Mirai', 'Smurf']); + expect(tex).toMatch(/^\\DocumentMetadata/); + expect((tex.match(/\\newpage/g) || []).length).toBe(1); + expect(tex).toContain('table/header-rows={1}'); + expect(tex).toContain('\\begin{enumerate}'); + expect(tex).toContain('\\begin{itemize}'); + expect(tex).toContain('cisa.gov'); + expect(tex).toContain('Krebs 2016'); + expect(tex).not.toContain('Rumour'); + expect(tex).not.toMatch(/#fact|\[case::/); + }); + + it('returns null tex when a lecture has no facts', () => { + const r = parse({ source: '---\ntitle: T\n---\n\n## I. A\n\n- x #concept\n' }); + expect(generateFactSheet(r)).toEqual({ tex: null, cases: [] }); + }); + + it('keeps facts out of section-walking artifacts', () => { + const notes = generateLectureNotes(parsed()); + expect(notes).not.toContain('62 default passwords'); + }); +}); + +describe('fact validators', () => { + it('rejects a #fact without [case::]', () => { + const r = parse({ source: '---\ntitle: T\n---\n\n## Facts\n\n- 1997 #fact [label:: Year]\n' }); + const v = validate(r); + expect(v.ok).toBe(false); + expect(v.errors[0].message).toMatch(/\[case::/); + }); + + it('warns on a fact placed inside a numbered lecture section', () => { + const r = parse({ source: '---\ntitle: T\n---\n\n## I. A\n\n- 1997 #fact [case:: X] [label:: Year]\n' }); + const v = validate(r); + expect(v.ok).toBe(true); + expect(v.warnings.some((w) => /unnumbered heading/.test(w.message))).toBe(true); + }); +}); diff --git a/package.json b/package.json index 1b26222..04eab65 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "test": "vitest run", "test:watch": "vitest", "verify:a11y": "node lib/a11y/verify.js", - "check": "node --check generate.js && node --check exam-reading-list-cli.js && node --check parser/index.js && node --check parser/main-parser.js && node --check parser/validators.js && node --check lib/tex-helpers.js && node --check lib/cornell-tex.js && node --check lib/a11y/contrast.js && node --check lib/a11y/palette-audit.js && node --check lib/a11y/project-palette.js && node --check lib/a11y/verify.js && node --check generators/_filter.js && node --check generators/lecture-notes.js && node --check generators/cornell-handout.js && node --check generators/study-questions.js && node --check generators/quiz.js && node --check generators/readme.js && node --check generators/slides.js && node --check generators/question-bank.js && node --check generators/reading-list.js && node --check generators/audit.js && node --check generators/exam-reading-list.js && node --check generators/mark-used.js", + "check": "node --check generate.js && node --check exam-reading-list-cli.js && node --check parser/index.js && node --check parser/main-parser.js && node --check parser/validators.js && node --check lib/tex-helpers.js && node --check lib/cornell-tex.js && node --check lib/a11y/contrast.js && node --check lib/a11y/palette-audit.js && node --check lib/a11y/project-palette.js && node --check lib/a11y/verify.js && node --check generators/_filter.js && node --check generators/lecture-notes.js && node --check generators/cornell-handout.js && node --check generators/study-questions.js && node --check generators/quiz.js && node --check generators/readme.js && node --check generators/slides.js && node --check generators/question-bank.js && node --check generators/reading-list.js && node --check generators/audit.js && node --check generators/exam-reading-list.js && node --check generators/mark-used.js && node --check generators/fact-sheet.js", "slides:dev": "slidev", "slides:build": "slidev build" }, diff --git a/parser/main-parser.js b/parser/main-parser.js index 39aaf91..f08b4c3 100644 --- a/parser/main-parser.js +++ b/parser/main-parser.js @@ -5,7 +5,7 @@ import MarkdownIt from 'markdown-it'; const ROLE_TAGS = new Set([ 'concept', 'vocab', 'blank', 'key-callout', 'case-study', 'diagram', 'self-quiz', 'summary', 'discussion', 'activity', 'question', - 'objective', 'slide', + 'objective', 'slide', 'fact', ]); const TAG_RE = /(?:^|\s)#([A-Za-z][A-Za-z0-9_/-]*)/g; diff --git a/parser/validators.js b/parser/validators.js index 5881263..715e873 100644 --- a/parser/validators.js +++ b/parser/validators.js @@ -118,6 +118,27 @@ export function validate(parsed) { } } + // ── #fact rules ────────────────────────────────────────── + if (it.tags.has('fact')) { + if (!String(it.fields.get('case') || '').trim()) { + pushIssue(errors, it, '#fact without [case:: …] — every fact must name the case study its fact sheet belongs to'); + } + if (it.fields.has('label') && it.fields.has('group')) { + warnings.push({ + message: '#fact with both [label::] and [group::] — it renders as a table row; [group::] is ignored', + line: it.sourceLine, + text: it.text, + }); + } + if (it.section != null) { + warnings.push({ + message: `#fact inside lecture section ${it.section} — keep facts under an unnumbered heading (e.g. "## Fact sheet: ") so section-walking artifacts never pick them up`, + line: it.sourceLine, + text: it.text, + }); + } + } + // ── #diagram rules ─────────────────────────────────────── if (it.tags.has('diagram') && !it.tags.has('slide')) { if (!it.fields.has('alt')) { diff --git a/references/style-guide.md b/references/style-guide.md index a122213..d132d7e 100644 --- a/references/style-guide.md +++ b/references/style-guide.md @@ -17,6 +17,7 @@ enforce the invariants below as hard errors and block compilation. - `#slide` — a slide block. **Requires `[layout:: …]`** from the 11-layout enum. - `#diagram` — a figure or partial diagram. **Requires `[alt:: …]`** (ADA Title II). - `#example`, `#case-study`, `#activity`, `#discussion` +- `#fact` — one entry on a case study's fact sheet. **Requires `[case:: …]`** (hard error if missing). See § *Fact Sheet*. **Scope tags** (which lecture section the block belongs to): - `#section/I`, `#section/II`, … through `#section/XII` @@ -652,6 +653,64 @@ whenever the `.md` updates. --- +## Fact Sheet (.pdf) + +A one-page reference card for each named case study in a lecture: a botnet, a +breach, an outage. It is student-facing and withholds nothing. The Cornell +handout teaches the case; the fact sheet is what a student keeps afterwards: +what happened, when, how big, who, and what to do about it. The first one was +Mirai, in CECS 378's Denial of Service lecture. + +**File:** `[topic]_fact_sheet.pdf` (`.tex` retained). One page per case, in the +order each case first appears in the source. Skipped, with no file written, when +the lecture has no `#fact` items. + +### Source schema + +Keep facts under an **unnumbered** heading, one per case, so section-walking +artifacts never pick them up (a `#fact` inside a numbered section is a warning): + +```markdown +## Fact sheet: Mirai + +- August 2016 #fact [case:: Mirai] [label:: Discovered] +- Telnet on ports 23 and 2323 #fact [case:: Mirai] [label:: Infection] [citation:: CISA TA16-288A] +- Disconnect the device. #fact #steps [case:: Mirai] [group:: Removing an infection] +- Reboot it while it is offline. #fact [case:: Mirai] [group:: Removing an infection] +``` + +| Field or tag | Effect | +|---|---| +| `[case:: Name]` | **Required.** Which case's sheet the fact belongs to; also the sheet's title. | +| `[label:: Text]` | The fact is a row in the facts table: label, then the item text. | +| `[group:: Heading]` | Without a label, the fact is a bullet under that heading (default *Key points*). | +| `#steps` | On any item in a group, numbers the whole group. | +| `[citation:: …]` | Collected into the sheet's *Sources* line, linked like the exam reference sheet (OSTEP, RFC, NIST, FIPS, or the frontmatter `citation-urls:` map). | +| `#draft` | Left off the sheet. | + +A `#case-study` item carrying the same `[case::]` supplies the sheet's opening +paragraph; the first such item wins. The `--semester` / `--strict-semester` +filters apply. + +### Layout + +- 11pt, 0.75in margins, US Letter; aim for one page per case. +- Header block: case name in navy, *Fact sheet*, course. +- Facts table: two columns (*Fact* | *Detail*), navy header row tagged as + header cells for PDF/UA, labels bold navy. +- Groups follow the table in source order; *Sources* closes the page. + +### Content rules + +- Every figure on the sheet needs a source in the lecture or on the sheet. Prefer + an official advisory (CISA, NIST, a vendor bulletin) and peer-reviewed + measurement over press coverage. +- Where sources disagree, give the range and its source ("1.1 to 1.5 Tbps"), and + mark an unconfirmed figure as an estimate. +- Short rows. A row that wraps past two lines belongs in a group. + +--- + ## Study Questions (.md) - **Count:** 10 questions