CANONIC Foundation

COMMUNITY-LEARNING

Scope


Paper Spec (MAGIC 255)

The paper makes three claims. Every section must serve at least one. No section may serve zero.

Claim 1: EVOLUTION

The community matures from exploration to active care navigation over 30 days.

Claim 2: COMPARISON

CaribChat outperforms ChatGPT on Caribbean cancer navigation.

Claim 3: GOVERNANCE

Clinically relevant intelligence accumulates without PII, across jurisdictions without data protection law.


Constraints

MUST:     Every section serve at least one of the three claims (EVOLUTION, COMPARISON, GOVERNANCE)
MUST:     Ledger data sourced from TALKS/CARIBCHAT/LEARNING.md (single source of truth)
MUST:     All thematic classifications auditable against ledger entries
MUST:     Comparison data reproducible (score_comparison.py + chatgpt_responses.json)
MUST:     Chart values sum to stated totals (no arithmetic drift)
MUST:     Three-phase evolution visible in Results (early/middle/late)
MUST:     ChatGPT comparison in Key Points, Abstract, Results, Discussion, Table 3
MUST:     Co-author affiliations UPPERCASED per JAMA convention
MUST:     Patent references cite inventor, assignee, application number
MUST:     Data freeze date and session target declared in paper text
MUST:     JAMA word limit: body ≤3000, abstract ≤350, figures+tables ≤5
MUST NOT: Include PII in any artifact
MUST NOT: Diverge from ledger counts
MUST NOT: Hand-edit DOCX (regenerate from markdown)
MUST NOT: Publish pre-freeze data as final (stage: WORKING until data freeze)
MUST NOT: Mention MAGIC 255 by brand name in submission (describe functionally as "eight-dimension compliance kernel")

Section Map

Section Words Claims Served Key Data
Key Points ~100 ALL THREE 100% vs 46.4%, three-phase evolution, no PII
Abstract ≤350 ALL THREE Full structured abstract with comparison P values
Introduction ~400 Sets up all three No prior head-to-head; healing tradition gap; governance gap
Methods ~600 ALL THREE Thematic + temporal classification; ChatGPT API protocol; ledger schema
Results: Evolution ~500 EVOLUTION Three phases, domain shifts, narrative arc, exemplar threads
Results: Comparison ~400 COMPARISON Table 3, Toco/Gasparillo/”their number” examples
Results: Secondary ~150 GOVERNANCE Healing traditions 13/13, herb-drug 5/5
Discussion ~600 ALL THREE Two main findings (comparison + evolution), healing traditions, privacy, limitations
Conclusions ~150 ALL THREE Summary with the woman in Sangre Grande

Reproducible Analyses

Every analysis in the paper can be regenerated from source. No manual steps.

# Working directory
cd ~/CANONIC/hadleylab-canonic/PAPERS/COMMUNITY-LEARNING

# 1. THEMATIC CLASSIFICATION — count SESSION_LEDGERED entries from ledger
#    Source: TALKS/CARIBCHAT/LEARNING.md (single source of truth)
#    136 total, 114 substantive, 22 non-substantive

# 2. CHATGPT COMPARISON — run 28 screening queries through GPT-4o API
#    Requires: OPENAI_API_KEY (from ~/Code/mcode_translator/.env)
export OPENAI_API_KEY=$(grep OPENAI_API_KEY ~/Code/mcode_translator/.env | cut -d= -f2)
#    Generates: chatgpt_responses.json (raw API responses, archived)
#    Note: responses are date-stamped (April 2, 2026). Re-running will produce
#    different responses due to model updates. Original responses are the governed record.

# 3. SCORING — automated scoring of comparison responses
python3 score_comparison.py
#    Reads:  chatgpt_responses.json
#    Writes: comparison_scores.json
#    Output: CaribChat 28/28 (100%) vs GPT-4o 13/28 (46.4%) facility citation
#            CaribChat 28/28 (100%) vs GPT-4o 10/28 (35.7%) actionable navigation

# 4. FIGURES — render mermaid diagrams to PNG
for f in /tmp/mermaid-figs/fig*.mmd; do
  mmdc -i "$f" -o "fig_$(basename $f .mmd | tr -dc '0-9').png" -w 1200 -b white
done
#    Generates: fig_0.png through fig_9.png

# 5. SUBMISSION DOCX — compile from markdown
pandoc submission.md -f markdown -t docx -o submission.docx

# 6. FULL PREPRINT DOCX — compile with embedded PNGs
python3 -c "
import re
with open('community-learning-ledgers-caribbean.md') as f: c = f.read()
n = [-1]
def r(m): n[0] += 1; return f'![](fig_{n[0]}.png)'
open('/tmp/p.md','w').write(re.sub(r'\x60\x60\x60mermaid\n.*?\x60\x60\x60', r, c, flags=re.DOTALL))
"
pandoc /tmp/p.md -f markdown -t docx -o community-learning-ledgers-caribbean.docx

Artifacts

File Type Description
submission.md Source JAMA-formatted submission (≤3000 words body)
submission.docx Compiled Word document for submission
community-learning-ledgers-caribbean.md Source Full preprint (11,500 words, all appendices)
community-learning-ledgers-caribbean.docx Compiled Full preprint Word with embedded PNGs
chatgpt_responses.json Data Raw GPT-4o API responses (28 queries)
comparison_scores.json Data Structured scoring results
score_comparison.py Code Reproducible scoring script
fig_0.png through fig_9.png Compiled Mermaid diagram renders

*COMMUNITY-LEARNING CANON PAPERS*
CANONIC ∩ FOUNDATION
TALK AUTO