# Stage 6 Handoff Prompt

Use this prompt to brief a new chat on the current state of the JoGPT content pipeline.

---

## Prompt (paste this into a new chat)

You are being brought into an ongoing content pipeline project. Read this briefing carefully before doing anything.

**Project:** JoGPT — a web-based revision tool for Pearson T Level Digital Support and Security students. The tool serves teaching content from a structured Markdown master file that is processed by a Node.js generator script into a JavaScript data file loaded by the site.

**Authority order (most to least authoritative):**
1. Pearson T Level Digital Support and Security specification
2. JoGPT Master Source Teaching Guide
3. Stage 6 `Core_Content_Master_Dataset_DIAGRAMS.md`
4. Stage 4 `complete_core_master.md` (frozen reference — do not modify)

---

### The two master files

**Stage 4** — `C:\Users\DuhhI\Desktop\file_analysis\STAGE 4\output\complete_core_master.md`
- 4,661 lines. The frozen pipeline output from Stage 3 processing.
- Contains spec compliance errors (see below). Preserved as the uncorrected reference.
- Do not modify this file under any circumstances.

**Stage 6** — two variants, both in `C:\Users\DuhhI\Desktop\file_analysis\STAGE 6\`

| File | Lines | Use |
|------|-------|-----|
| `Core_Content_Master_Dataset.md` | 4,675 | Feed to the generator — no Mermaid blocks |
| `Core_Content_Master_Dataset_DIAGRAMS.md` | 4,975 | Authoring source — all Mermaid diagrams intact |

The clean file and the DIAGRAMS file are identical except the DIAGRAMS version has 17 Mermaid fenced code blocks. The generator cannot currently process those blocks, so the clean version is used in production until the generator is updated.

---

### What Stage 6 fixed

Stage 4 had the following confirmed errors, all of which have been corrected in Stage 6:

- **Section 4.1** — contained US legislation (HIPAA, ECPA, CFAA). These are out of scope. Replaced with Budapest Convention on Cybercrime (2001) content, which is the correct international law for this qualification.
- **Section 8.4** — contained ABAC (Attribute-Based Access Control). ABAC is explicitly out of scope. Removed. RBAC and RuBAC remain.
- **Section 3.11** — RuBAC description was incorrectly framed. Corrected. RuBAC vs RBAC comparison table added.
- **Section 1.2** — spec coverage table had wrong command words. Pseudocode was listed as the primary algorithm representation term; spec requires "written descriptions using hierarchical markers" as primary. Both corrected.
- **Section 8.1** — missing CIA triad framing block. Added.
- **Section 8.3** — IAAA framing block confirmed present and verified.
- **Section 6.1** — had only one Emerging Issues sub-domain. Expanded to three: AI and automation, sustainability and e-waste, digital inclusion.
- **All sections** — pipeline metadata (`Sources file`, `Usable Stage 3 sources`, `Subtopic`) was embedded in section bodies. All 42 blocks stripped.
- **Diagrams** — Stage 4 had no visual content. Stage 6 adds 17 Mermaid/Markdown diagrams across sections 1.1, 1.2, 2.7, 2.8, 2.9, 7.1, 7.3, 8.3, 8.4.
- **Exam angles** — callout blocks added to sections 1.1, 1.2, 7.3, 8.4.
- **Presentation comments** — HTML comments added at sparse sub-sections 1.1.7 and 1.1.9 to flag them for web rendering treatment.

---

### The generator pipeline

The generator lives at:
`C:\Users\DuhhI\Documents\JoGPT_archive_data\shell_development\scripts\generate-topic-content.js`

It reads `Core_Content_Master_Dataset.md`, parses each `<!-- BEGIN X.X -->` block into typed content blocks (h3, h4, p, ul, ol, table), and writes structured HTML into:
`C:\Users\DuhhI\Documents\JoGPT_archive_data\shell_development\assets\data\topic-content.js`

That JS file is loaded directly by `index.html` — there is no build step.

**Current limitation:** the generator has no handler for fenced code blocks. Mermaid blocks pass through as garbled paragraph text. To fix this:
1. Add Mermaid.js to `index.html` (CDN is already allowed in the CSP — `cdn.jsdelivr.net` is whitelisted).
2. In `parseLineBlocks`: detect backtick-mermaid fences, collect until closing fence, emit `{ type: 'mermaid', code: '...' }`.
3. In `renderSectionBlocks`: render `mermaid` type as `<div class="mermaid">...</div>`.
4. Switch the generator's `MASTER_PATH` to point at `Core_Content_Master_Dataset_DIAGRAMS.md`.

---

### What has not been done yet

These Stage 6 deliverables from the original plan do not exist yet:
- `Core_Content_Master_READABLE.pdf`
- `Core_Content_Master_Sources.md`
- `Core_Content_Master_Teaching.md`
- `Core_Content_Master_READABLE.svg`
- `mermaid.mid.js`

The generator also still points at the Stage 4 file path. It needs its `MASTER_PATH` constant updated to point at the Stage 6 clean file before being run.

---

### Key reference files

| File | Purpose |
|------|---------|
| `STAGE 6/README.md` | Full written record of all Stage 6 changes |
| `STAGE 6/stage6_update_log.txt` | Machine log confirming every operation applied |
| `STAGE 6/apply_stage6_updates.py` | Script that generated Stage 6 from Stage 4 |
| `STAGE 6/data_cleaning/DIAGRAM_REQUIREMENTS_MAP.html` | Diagram priority ratings (M/S/O) per spec section |
| `STAGE 6/data_cleaning/SECTION_PROMPT_TEMPLATE.md` | Section structure template all content must conform to |
| `STAGE 4/output/corrections_log.txt` | Log of all 14 corrections applied to Stage 4 before Stage 6 was split |
