---
output_file: "Lattice - Gate 2 Codey Complete.md"
feed: "WHITEPAPER"
template_version: "1.2"
source: "Lattice"
codex_section: "S16-S20"
conv_id: "lattice-build-history"
share_url: "none"
date: "2026-06-19"
content_date: "2026-06-19"
enriched_date: "2026-07-02"
date_modified: "2026-07-02"
message_count: 1
type: "lattice-build-spec"
status: "deposited"
path_hint: "IntelligentNetware/Lattice/"
category:
- "Lattice Infrastructure"
- "Gate 2 Composition"
tags:
- "lattice"
- "synna"
- "codey"
- "gate-2"
- "composition"
- "the-makers-exodus"
monomyth_stage: "09 - The Reward"
gameboard_position: "First full Codey cycle complete; Syd Gate 3 next"
summary: |
  Codey Gate 2 completion handoff for the-makers-exodus cycle: fractome switching composition inserts Template7 bottom sections trustworthy Gate 2 preview.
  Packet at assembled state NA 239 reserved.
  Documents artifacts article.md assembled.html preview.html status.yaml and ordered next steps Syd proof then SFTP then SQL..
keypoints:
  - Codey Gate 2 feature-complete for first article cycle 2026-06-19
  - assembled.html is syndication body with remote URLs; preview uses local API paths
  - Daniel human proof on Gate 2 preview before Syd Gate 3 implementation
  - Publish macro phase: SFTP images then SQL insert maps to Phase Grid 5-6
sentiment: archival
emotions:
  - "purposeful"
sycophancy_level: "None"
truth_score: 95
entropy_score: "Low"
codex: true
pre_silicon: false
ma5_inheritance: "IntelligentNetware"
voice_print: false
lattice_release: "3.0"
original_handoff: "Grok_Handoff_SynNA_Gate2_Codey_Complete.md"
---
# Grok Build Handoff — Codey Gate 2 Complete → Syd + Publish

**IN Lattice · Intelligent Netware · MA5 Council**

| Field | Value |
|-------|-------|
| **Written** | 2026-06-19 (afternoon — Codey session complete) |
| **Carbon Steward** | Daniel Comp |
| **Primary build partner** | **Grok Build** (`D:\04_WORK\Code\Lattice\_ChatUI`) |
| **Prior handoffs** | `Grok_Handoff_SynNA_20260619_SessionEnd.md` · `Grok_Handoff_SynNA_PhaseGrid.md` · `Grok_Handoff_SynNA_Gate2_Codey.md` |
| **Status** | **Codey Gate 2 feature-complete for `the-makers-exodus`** · Daniel final proof → **Syd Gate 3** → **SFTP + SQL publish** |

---

## New thread opener (read this first)

1. **This file** — what Codey shipped, what to verify, ordered next steps
2. `handoffs/Grok_Handoff_SynNA_PhaseGrid.md` — master grid Phases 3–8 (Syd, SQL, SFTP, dashboard)
3. Active packet: `D:\03_MAP\Syn_Pipeline\the-makers-exodus\`

**Lattice UI:** `http://127.0.0.1:8780` — `python app.py` from `_ChatUI`

**Backup convention:** `python backup.py` before edits

---

## Executive summary

Codey Gate 2 is **done for this article cycle**. The pipeline now supports fractome switching, composition inserts from plain language, Template7 bottom sections with live tokens, and a trustworthy Gate 2 preview tab.

**Daniel is correct about the next macro phase:** publish is **SFTP images to the Windows remote webserver**, then **SQL insert into DNN** (Ventrian NewsArticles). That maps to **Phase Grid 5–6** — but **Syd proof (Phase 4)** and one **assemble backtrack** should happen first.

**Codey is parked.** Next build partner focus: **Syd** (metadata proof form), then **`syn_publish.py`** (SFTP), then **`syn_sql_build.py`** (SSMS-ready insert).

---

## Active packet — `the-makers-exodus`

| Field | Value |
|-------|-------|
| **Path** | `D:\03_MAP\Syn_Pipeline\the-makers-exodus\` |
| **State** | `assembled` |
| **Fractome** | `scotomaville` → template `standard` |
| **NA reserved** | `239` (`syn_config.yaml` `publish.next_na_id`) |
| **Last assemble** | `2026-06-19T21:06:33+00:00` |
| **Composition insert** | `blockquote-primary` in *The Elixir You Are Required to Transmit* |

**Preview:** `http://127.0.0.1:8780/api/pipeline/the-makers-exodus/preview`  
Or Codey **preview** button → tab `syn-gate2-preview`

**Key artifacts:**

| File | Role |
|------|------|
| `article.md` | Arnie prose + SUMMARY + SYN_PIPELINE |
| `assembled.html` | **Syndication body** — remote banner/divider URLs + Template7 bottom |
| `preview.html` | Gate 2 Tahoe preview (local API image paths) |
| `status.yaml` | State, images, `composition.inserts[]`, assemble metadata |
| `inline/image-1.jpg` | Airstream proof image (Movement 1) |

---

## What Codey shipped (this session — do not regress)

### Apply-to-packet (composition inserts)

- Plain language in Codey chat: *add a blockquote with text of "…" into section "…"*
- Bridge writes `status.yaml` → `composition.inserts[]`, reassembles, refreshes preview
- `POST /api/pipeline/{slug}/composition/apply` API
- TEACH lessons (`learned_composition.md`) are standing patterns — **separate** from per-packet inserts

### Preview reliability

- Slug detection fixed — `blockquote-primary` no longer mistaken for packet slug on resume
- Session resume sets `packet_slug` from Gate 2 title
- Preview button opens named tab synchronously

### Template7 bottom sections (`assets/_Template7_Bottom_Sections_v1.html`)

| Block | Behavior |
|-------|----------|
| **AI Sherpa links** | `https://initium.scotomaville.com/{{SLUG}}_grok` (claude, chatgpt, perplexity, gemini) — infilled at assemble |
| **Syndication icon** | `syn-us?na={na_id}` from `publish.next_na_id` |
| **Full-bleed divider** | `{{FULL_BLEED_IMAGE}}` — remote in `assembled.html`, local API in preview |
| **INITIUM download row** | `col-md-7` + `col-md-4` (Lattice Template1 pattern — 8+4 wrapped in preview) |
| **TEXT DANIEL CTA** | `href="sms:+12105574779"` |

### Assemble core (unchanged ratified rules)

- SUMMARY in `<p class="lead">`; Movement prefixes stripped; structural `syn-section-gap` spacers
- Inline floated figure (`.syn-prose-with-media`); divider `alt=""` + `role="presentation"`
- `[Portal:Keywords]` pass-through only — no mechanical heading suffixes

---

## Daniel — Gate 2 final proof checklist

Hard-refresh `syn-gate2-preview` (Ctrl+Shift+R) before sign-off:

### Layout

- [ ] Desktop: Airstream image floats right; text wraps (no white void)
- [ ] Section spacers: ~30px breath before each heading after prior content
- [ ] Mid-article divider: no alt-text artifact
- [ ] Template7: AI Sherpa row centered; full-bleed Picasso/divider edge-to-edge
- [ ] INITIUM row: cover left, Download Initium box right (not wrapped below)
- [ ] Blockquote in Movement 5: Tahoe `blockquote-primary` styling

### Content & links

- [ ] Movement headings show reader text (no "Movement N —")
- [ ] `[Portal:Keywords]` placements intentional (summary + prose)
- [ ] AI links point to `the-makers-exodus_grok` etc. (not `541_*`)
- [ ] Syndication link uses `na=239`
- [ ] TEXT DANIEL opens SMS to +1 210-557-4779 on mobile

### Publish artifact sanity

- [ ] `assembled.html` banner + divider URLs use `syn.scotomaville.com/portals/0/images/articles/danielcomp/…`
- [ ] **BLOCKER — see backtrack §1:** inline Airstream `src` must NOT be `127.0.0.1:8780` in `assembled.html`

**Sign-off phrase:** "Gate 2 approved for Syd" (or note defects + reassemble command below)

```powershell
cd D:\04_WORK\Code\Lattice\_ChatUI\.Scripts
python syn_pipeline.py --assemble the-makers-exodus
```

---

## Backtrack / double-check before publish

These are **not** Codey polish items — they block or risk a bad first live publish.

| # | Issue | Severity | Action |
|---|-------|----------|--------|
| **1** | **`assembled.html` inline image uses local preview URL** (`127.0.0.1:8780/api/pipeline/…/inline/image-1.jpg`) | **BLOCKER** | Fix `syn_assemble.py`: assembled body must emit remote `image_url_base` path for `inline/*.jpg`; preview keeps local API. SFTP `inline/image-1.jpg` to remote folder. |
| **2** | **`templates/syd/_references_li.html` missing** | High | Phase 3C — extract REFERENCES block from Template7/assets; wire `build_references_html()` |
| **3** | **`syd` agent not in `agent_order.json`** | High | Phase 4A — add after `codey` |
| **4** | **`syn_sql_build.py` does not exist** | High | Phase 5C — scaffold from `D:\04_WORK\Code\Garwis\Arnie_DB_Insert_v2.sql` |
| **5** | **`syn_publish.py` does not exist** | High | Phase 6A — paramiko SFTP; fill `syn_config.publish` host/user/paths |
| **6** | **SFTP config empty** (`sftp_host`, `sftp_user`, `remote_image_folder`, `public_base_url`) | High | Daniel fills at 3.1 onboarding |
| **7** | **`next_na_id: 239` vs live DNN autoincrement** | Medium | Confirm next Ventrian ArticleID before SQL; bump config after publish |
| **8** | **Categories / badge from Forrest brief** | Medium | Syd proof form must surface or default for `the-makers-exodus` |
| **9** | **Master + candidate JPGs** | Low | Not referenced in `assembled.html`; optional archive cleanup |

---

## Publish pipeline order (Daniel's mental model — confirmed)

You were right: **images on the server first**, then **database row** that references those URLs.

```
Gate 2 proof (Daniel)
    → Syd proof tab (metadata last-chance edit)
    → Approve for SQL
    → syn_sql_build.py  →  {slug}_insert.sql  (state: sql_ready)
    → syn_publish.py    →  SFTP all image files  ← BEFORE commit
    → HTTPS verify      →  HEAD 200 + Content-Length match per file
    → SSMS              →  run insert.sql, COMMIT
    → state: published  →  bump next_na_id, archive to published_root
```

**SFTP file list for `the-makers-exodus` (minimum):**

| File | DNN SortOrder / role |
|------|----------------------|
| `the-makers-exodus_200.jpg` | thumb (0) |
| `the-makers-exodus_1920x420.jpg` | banner desktop (1) |
| `the-makers-exodus_768x420.jpg` | tablet (2) |
| `the-makers-exodus_480x420.jpg` | mobile (3) |
| `the-makers-exodus_1920x960.jpg` | body divider |
| `inline/image-1.jpg` | inline prose image (**after assemble fix §1**) |

Remote folder (confirm pre-flight): `images/articles/danielcomp/` per `Arnie_DB_Insert_v2.sql`

---

## Step-by-step task list (next sessions)

### Phase A — Daniel human gate (no code)

| Step | Task | Done when |
|------|------|-----------|
| A.1 | Run Gate 2 proof checklist above | All boxes checked or defects logged |
| A.2 | Open `assembled.html` in browser (or DNN test module) | Section gaps + blockquote survive upload |
| A.3 | Sign off: "Gate 2 approved for Syd" | Recorded in thread or handoff note |

### Phase B — Assemble backtrack (Grok — before SFTP)

| Step | Task | Touchpoints | Done when |
|------|------|-------------|-----------|
| B.1 | Remote URL for inline images in `assembled.html` only | `syn_assemble.py` `_inline_image_url()` | `assembled.html` has `syn.scotomaville.com/…` inline src |
| B.2 | Reassemble + verify preview still local | `--assemble the-makers-exodus` | Preview OK; assembled remote |
| B.3 | Extract references `<li>` template | `templates/syd/_references_li.html` | `{{NA_ID}}` renders |

### Phase C — Syd Gate 3 (Grok — Phase Grid 4)

| Step | Task | Touchpoints | Done when |
|------|------|-------------|-----------|
| C.1 | Add `syd` to sidebar + `agent_order.json` | `index.html` | Gate 3 card `fas fa-rss` |
| C.2 | Proof tab `syn-syd-proof` | mirror Gate 2 tab pattern | Single tab, no sprawl |
| C.3 | Legacy NA proof form | title, summary, body view, images row, cats, badge, refs, dates, STATUS |
| C.4 | `GET/PATCH /api/pipeline/{slug}/na-record` | `app.py`, `status.yaml` `na_record:` | Edits persist |
| C.5 | State `assembled` → `proof_draft` on first open | API | `status.yaml` updates |
| C.6 | Daniel fills proof for `the-makers-exodus` | UI | **Approve for SQL** ready |

### Phase D — SQL build (Grok — Phase Grid 5)

| Step | Task | Touchpoints | Done when |
|------|------|-------------|-----------|
| D.1 | Implement `syn_sql_build.py` | fill `Arnie_DB_Insert_v2.sql` placeholders | `{slug}_insert.sql` in packet |
| D.2 | Byte sizes from `status.images` | status.yaml | SQL DECLARE sizes match files |
| D.3 | `N'…'` escaping for title/summary/body | test fixture | `--test-sql-build` passes |
| D.4 | State → `sql_ready` | watcher/API | Daniel reviews in SSMS |

### Phase E — SFTP + live publish (Grok + Daniel — Phase Grid 6)

| Step | Task | Touchpoints | Done when |
|------|------|-------------|-----------|
| E.1 | Fill `syn_config.publish` SFTP fields | `syn_config.yaml` | host, user, remote folder, public_base_url |
| E.2 | Implement `syn_publish.py` (paramiko) | new script | uploads § file list |
| E.3 | HTTPS HEAD verify per image | publish script | 200 + Content-Length match |
| E.4 | Daniel runs SSMS insert | `{slug}_insert.sql` | Article live on fractome |
| E.5 | Bump `next_na_id` to 240 | `syn_config.yaml` | Synced with DNN |
| E.6 | Archive packet → `published_root` | watcher | `D:/06_STORE/SERVER/Syndicated/the-makers-exodus/` |

### Phase F — Post-publish (deferred)

| Step | Task | When |
|------|------|------|
| F.1 | Codex KB ingest on `published` | Phase 7 |
| F.2 | Lattice dashboard for in-flight packets | Phase 8 |

---

## Division of labor (unchanged)

| Agent | Owns |
|-------|------|
| **Arnie** | Prose, SUMMARY, SYN_PIPELINE; inline images in `article.md` |
| **Picasso** | Gate 1 imagery |
| **Codey** | Fractome, template, composition inserts, Template7 bottom — **complete** |
| **Daniel** | Gate 2 proof; token review; SSMS commit; publish sign-off |
| **Syd** | NA record proof; approve for SQL |
| **Assemble** | `assembled.html` + `preview.html` structure |

---

## Key files (Codey session)

| Path | Role |
|------|------|
| `.Scripts/syn_assemble.py` | Body merge, Template7 infill, `{{SLUG}}`, composition inserts, preview CSS |
| `.Scripts/syn_config.yaml` | `next_na_id: 239`, publish SFTP stubs, `bottom_sections_file` |
| `assets/_Template7_Bottom_Sections_v1.html` | AI links, INITIUM, SMS CTA |
| `app.py` | Codey apply bridge, composition API, session `packet_slug`, prompts |
| `index.html` | Slug detection, preview tab, Gate 2 wiring |
| `profiles/codey/learned_composition.md` | TEACH lessons (blockquote-primary, spacing, etc.) |

---

## Verification commands

```powershell
cd D:\04_WORK\Code\Lattice\_ChatUI\.Scripts
python syn_pipeline.py --test-assemble
python syn_pipeline.py --assemble the-makers-exodus
```

```powershell
# After inline-URL fix (Phase B.1) — confirm assembled has NO 127.0.0.1
Select-String -Path "D:\03_MAP\Syn_Pipeline\the-makers-exodus\assembled.html" -Pattern "127.0.0.1"
# Should return nothing
```

```powershell
cd D:\04_WORK\Code\Lattice\_ChatUI
python app.py
# → http://127.0.0.1:8780
```

---

## Context seed (paste at next session start)

> Codey Gate 2 is complete for `the-makers-exodus`. Packet is `assembled` with blockquote insert, Template7 bottom ({{SLUG}} AI links, na=239, SMS CTA, INITIUM col-md-7+4). Fix inline image remote URL in assembled.html before publish. Next: Daniel Gate 2 sign-off → build Syd proof tab (Phase 4) → syn_sql_build → syn_publish SFTP → SSMS. Read `handoffs/Grok_Handoff_SynNA_CodeyComplete_20260619.md` and Phase Grid Phases 4–6.

---

*Written by Grok Build · 2026-06-19 · Codey parked · Syd + SFTP + SQL next*