# Full Notes Framework

**Purpose:** build a self-contained, searchable, collapsible revision page for one subject/exam — accurate definitions, worked examples, diagrams, assessment-objective coaching, and answer structures — from the official scope, shared resources, guides, and past/specimen papers.

**Canonical example:** `Exam Syllabus/HYE/BM_SL_HYE_Notes.html`  
Start from that file's shell (header, search, index, `<details>` pattern, SVG style, JS) and replace the subject content; do not rebuild the UI from scratch.
**Companions:** `CHECKLIST_FRAMEWORK.md` (tracking checklist) and `DIAGNOSTIC_FRAMEWORK.md` (topic-by-topic test). Use all three for a complete HYE pack.

---

## 1. Inputs and source priority

1. Official exam focus / syllabus / timetable (newest dated version).
2. Subject guide: assessment objectives, command terms, formulae, markbands.
3. Indus LMS shared resources (teacher notes, worksheets, question banks).
4. Teacher mails and attachments (weekly updates, exam-pattern mails, practice papers).
5. Shared papers in OneDrive/SharePoint: question paper (QP) and mark scheme (MS).
6. Existing repo notes and guides.
7. Web sources only to corroborate or fill a clearly labelled gap.

Rules:

- Newest **dated official** source wins. Record conflicts in the footer; do not silently choose.
- Separate **specimen scope** from **this exam's scope**. A specimen may test topics the school has excluded.
- The **mark scheme** is a primary source: it reveals markbands, command-term expectations, acceptable workings, and common errors.
- Cite the source at the end of each section and in a final source list.
- Read-only: never submit, mark, send, or mutate school data.

## 2. Source acquisition

### Mail

- Prefer the school-mail MCP/CLI if available. Fallback: Apple Mail via JXA/AppleScript.
- Plain message `content` often drops hyperlinks. To recover links, read the raw message source:
  - JXA: `m.source()` for a message, then parse the MIME with Python’s `email` module.
  - Extract `text/html`, decode quoted-printable/base64, then pull `https://…` URLs.
- Save attachments to a temp/working folder and extract text with `pdftotext -layout`.
- Search recent mail by subject/sender plus “HYE”, “exam pattern”, “practice paper”, “marking scheme”.

### OneDrive / SharePoint (logged-in Safari)

- Use Safari with the student’s existing session; do not ask for credentials.
- Open the shared folder URL in a new Safari document. Wait for the web app to render.
- Read the page with:
  `do JavaScript "document.body.innerText.slice(0,5000)" in tab`
- To download a file, construct:
  `https://<tenant>-my.sharepoint.com/personal/<user>/_layouts/15/download.aspx?SourceUrl=<url-encoded-server-relative-path>`
  and open it in Safari. Files land in `~/Downloads`.
- If the MCP has `od_*` tools and a valid login, prefer them; otherwise Safari is the fallback.
- Always download both QP and MS when available.

### Papers and mark schemes

- Identify whether the paper is **official IB specimen**, **school practice**, or **actual HYE**. Label it.
- Extract: duration, marks, section structure, question tariffs, command terms, markbands.
- Use the QP for format and the MS for expected depth; do **not** import out-of-scope topics into the notes.

## 3. Content architecture

Build the page in this order:

1. **Header:** subject/level/exam, duration, paper structure, marks, scope note.
2. **Search + index:** search every collapsible section; index grouped by unit.
3. **Exam format and scope:** in-scope list; explicit “not at this level” list; specimen caveat.
   - If a practice paper is shared, add a debrief: paper level/duration, which questions are in scope, which are HL-only/out of scope, key answers/traps, and a timed practice set.
4. **Assessment objectives:** AO1–AO4 definitions, command terms, markband decoder, mark-to-time guidance.
5. **Answer frames:** subject-specific structures (BM: SADEC — Statement, Advantages, Disadvantages, Evaluation, Conclusion, audited with SLAP and tested with ATE; other subjects: their own), 2/4/6/10-mark templates, calculation protocol, and a pre-submit checklist (command term, case evidence, tool, both sides, stakeholders, short/long term, weighing, recommendation, missing information).
6. **Topic sections** in syllabus order. Each section:
   - definition(s) and key terms;
   - features / comparison tables;
   - formula(s) and a worked example with units;
   - at least one diagram where a process, matrix, chart, or structure benefits;
   - “exam application” / traps;
   - source line.
7. **Toolkit / methods:** separate section; de-duplicate tools; note HL-only tools.
8. **Formula sheet:** one compact table for final revision.
9. **Sources:** paths, page/section references, mail dates, paper names.
10. **Footer:** build date, scope warning, static/no-tracking note.

Content rules:

- One topic per collapsible section; 300–800 words is usually enough. Prefer tables and bullets over paragraphs.
- Define before explaining; explain before evaluating.
- Every formula needs a worked example with units and a one-line interpretation.
- Every evaluation section needs criteria and a judgement, not just two lists.
- Include case-style application lines, not only textbook facts.
- Mark HL-only or out-of-scope content clearly; do not count it as required.
- If the school has a named answer framework (e.g. BM SADEC), include it exactly and integrate it into the 10-mark guidance.

## 4. UI specification — brutalist terminal

- Single self-contained `.html`; no external fonts, scripts, images, analytics, or network calls. Must work from `file://`.
- Cross-nav: the shared `.hye-nav` bar immediately inside `<main class="wrap">`, before the header. Link `[ HYE index ]`, then the sibling checklist, notes, diagnostic and topic worksheets for the same subject. Mark the current page with `aria-current="page"`; relative links only; same tab.
- Left-aligned, `max-width: 900–960px`, `margin: 0`; never centred.
- Monospace system stack; 13–14px body; 1.55–1.65 line-height.
- Flat: 1px rules, no rounded corners, shadows, gradients, cards, icons, emoji.
- Terminal cues: `>` prompt, `[+]` / `[-]`, `[ expand all ]`, `[ collapse all ]`, `//` labels, ASCII-style separators.
- One accent colour; light theme by default. Do not auto-switch to dark.
- Tables: full width, 1px borders, uppercase micro-headers, wrapped in a horizontal-scroll container on mobile.
- Quantitative notes: formula-sheet tables and inline equations use the system math/serif stack via `.math` (or `#formulae td:nth-child(2)`); no external math library or CDN font.
- Diagrams: inline SVG, `viewBox`, `role="img"`, `<title>`, readable labels, caption, no external assets. Aim for 5+ diagrams (process, matrix, chart, structure, decision tree). On mobile, keep a readable minimum width and let the figure scroll horizontally — never the page.
- Search: input at top; `/` focuses; Escape clears; results open the target section and all ancestor `<details>`; show match count.
- Index: grouped links; clicking opens the target; works without JS as normal anchors.
- Collapsible sections: topic sections closed by default; key playbook sections (exam format, AO/answer frames) may start open. Include an expand-all control.
- Keyboard: visible `:focus-visible`; search results are buttons; summary works with Enter/Space.
- Mobile: no horizontal overflow at 390px; tables scroll; diagrams scale; tap targets ≥ 24px.
- Print: hide search/controls; open all details before printing (`beforeprint`), avoid breaks inside sections.

## 5. JavaScript contract

- Vanilla JS only; no build step.
- Cache each searchable section’s title/unit/keywords/text on load.
- Search tokens use AND logic; cap results; click opens ancestors and scrolls.
- Index links use the same open-target function; do not duplicate logic.
- Expand/collapse toggles every `<details>` on the page.
- Notes do not need localStorage. Search/open state is ephemeral. Persist only for checklists.
- No hash changes required; if used, ensure deep links open the right section.

## 6. Verification checklist

1. **Scope:** every exam topic present; no HL-only/out-of-scope topic presented as required; specimen-only topics flagged.
2. **Definitions:** checked against the subject guide and shared notes; no invented terminology.
3. **Formulas/calculations:** formula, substitution, answer, units; worked example arithmetic re-checked.
4. **AO alignment:** AO definitions and command terms match the guide; answer frames match the paper's mark tariffs and markbands.
5. **School frameworks:** named framework (e.g. SADEC) included and correctly applied.
6. **Diagrams:** labels do not overlap; axes/scales correct; captions explain the takeaway.
7. **Search/index:** every topic findable by title and a key term; result opens the section; no broken anchors.
8. **Layout:** 390px and ~900px; no overflow; tables scroll; print preview sane.
9. **Console:** no errors on load or interaction.
10. **Formula readability:** quantitative formulas are set in the `.math` system font, the formula-sheet table is legible on mobile, and no formula overflows its container.
11. **Sources:** per-section source lines and final source list; dates and paper names accurate.
12. **Navigation:** `.hye-nav` is present before the header; `[ HYE index ]` and every sibling link resolve; the current page has `aria-current="page"`; `index.html` links back to these notes; no external assets or new-tab links.
13. **Index sync:** the HYE index file count and any Math practice links match the files on disk.

Run `python3 scripts/verify_hye.py` before delivery.

Report: file path, topic count, navigation/index status, source conflicts, and anything the student must confirm with the teacher.

## 7. Agent prompt (copy-paste)

> Read `NOTES_FRAMEWORK.md` and `CHECKLIST_FRAMEWORK.md`. Build a full notes page for `<subject / level / exam>`.
> Inputs: `<official focus, guide, LMS resources, mails, OneDrive QP/MS>`. Confirm the exam format and scope from the newest official source; separate specimen-only topics. Extract definitions, formulas, worked examples, tools and the school's answer framework (e.g. SADEC for BM). Build a single self-contained HTML file with searchable index, collapsible topics, inline SVG diagrams, AO/command-term coaching, answer frames and a formula sheet. Use the brutalist-terminal UI spec. Verify scope, accuracy, search, mobile, print and console. Report totals and source conflicts.

## 8. Anti-patterns

- A wall of textbook prose with no case application or judgement.
- Copying a specimen paper’s full topic list when the school exam scope is narrower.
- Treating HL-only content as required at SL without a label.
- Decorative UI: rounded cards, gradients, shadows, emoji, remote fonts.
- Diagrams without labels/scales, or images that cannot print.
- A search box that only searches titles, or an index with broken anchors.
- Omitting the school’s answer framework and inventing a generic essay structure.
- No mark scheme / markband alignment, so the notes teach content but not marks.
- No source lines; unreproducible claims.
- No `.hye-nav`, a dead sibling link, or no index entry for a HYE page.
- Shipping without testing search, mobile overflow, and console errors.
