Current task: —

← Session 10 — Website planning + local dashboard build

#381 assistant 2026-08-19 17:51:30.082 UTC · 438→1895 tok open ⤢
Now writing RH-WEBSITE.md.
tool: Write ok
input
{
  "file_path": "D:\\Python\\Quantum\\RH-WEBSITE.md",
  "content": "# RH-WEBSITE.md \u2014 NGUYEN-RH-1 Research Website\n# Standing plan + operations document. READ FIRST when doing website work.\n# Created: 2026-08-19 | Status: ACTIVE | Version: 1.0\n# ============================================================\n\n## 0. \u26d4 HARD RULE \u2014 READ FIRST (user directive, 2026-08-19)\n**DO NOT WRITE to any research document.** The research archive\n(NGUYEN.md, STATE.md, everything under `research/`, git history) is the\nsingle source of truth and is modified ONLY by the research agent per\nNGUYEN.md \u00a78.4. Website work may touch ONLY:\n- `D:\\Python\\Quantum\\web\\`          (all website code, data, logs)\n- `D:\\Python\\Quantum\\RH-WEBSITE.md` (this file)\n\nThe website reads research files exclusively through READ-ONLY handles:\nSQLite via `mode=ro` URI, text files opened `'r'`. Feedback submissions\ngo to `web/feedback/` + `web/feedback.db` \u2014 never into `research/`.\nWhen committing, stage ONLY `web/` and `RH-WEBSITE.md` by name.\n\n## 1. PURPOSE\nPublic-facing-style (localhost-only) interactive dashboard for the\nNGUYEN-RH-1 Riemann Hypothesis research project. Goals:\n- Landing page explaining RH and the research mission to a general audience.\n- Live progress: current stage, next action, metrics \u2014 auto-updating as the\n  research agent writes to the file system.\n- Browsable archive: results, experiments (+ interactive charts),\n  derivations, graveyard, journal, resources atlas, paper status.\n- Feedback channel: visitors submit comments/suggestions; searchable;\n  researcher reviews them to help the research.\n\n## 2. ARCHITECTURE\n- Location: `D:\\Python\\Quantum\\web\\` \u2014 Django project `rhweb`, app `dashboard`.\n- Interpreter: project `.venv` (`./.venv/Scripts/python.exe`).\n  Deps: `web/requirements-web.txt` (Django, markdown).\n- Server: `python web/manage.py runserver 127.0.0.1:8000` \u2014 localhost only.\n- Frontend: vanilla JS + vendored Plotly.js (interactive charts) +\n  vendored MathJax (tex-chtml) for math in markdown. NO CDN dependency.\n- Live updates: frontend polls `GET /api/status/` every 3 s; the endpoint\n  reports file mtimes + parsed STATE.md + active run-logs + new-feedback\n  count; changed panels refresh in place. No WebSockets/Redis.\n\n### Data flow (all read-only on research/)\n| Source | How read | Used by |\n|---|---|---|\n| STATE.md | parse `## SECTION` blocks ('r') | Dashboard, status bar |\n| NGUYEN.md | checklist \u00a75 `- [x]/[~]/[ ]` counts; \u00a77 ledger | Dashboard metrics, Roadmap |\n| research/research.db | sqlite3 `file:...?mode=ro` | Ledger, Experiments, Derivations, Graveyard, Journal indexes |\n| research/numerics/data/*.json | json.load ('r') | Experiment cards (checks, key values, caveats) |\n| research/numerics/data/*.csv | csv module, downsampled | Plotly charts, table previews |\n| research/**/*.md | python-markdown + math-protect | Archive pages |\n| research/numerics/data/*-run.log | tail (last N lines) | Live Runs page |\n| git log | `git log --oneline` subprocess (read-only) | Dashboard activity feed |\n\n## 3. FILE MAP\n```\nweb/\n\u251c\u2500\u2500 manage.py\n\u251c\u2500\u2500 requirements-web.txt\n\u251c\u2500\u2500 rhweb/                  # project: settings.py, urls.py, wsgi.py\n\u251c\u2500\u2500 dashboard/\n\u2502   \u251c\u2500\u2500 research_data.py    # ALL read-only parsers (single module to audit \u00a70)\n\u2502   \u251c\u2500\u2500 models.py           # Feedback model (lives in web/feedback.db ONLY)\n\u2502   \u251c\u2500\u2500 views.py            # pages\n\u2502   \u251c\u2500\u2500 api.py              # /api/health, /api/status, /api/logtail\n\u2502   \u251c\u2500\u2500 urls.py\n\u2502   \u251c\u2500\u2500 templates/dashboard/*.html\n\u2502   \u2514\u2500\u2500 static/dashboard/{style.css, app.js, vendor/plotly.min.js, vendor/tex-chtml.js}\n\u251c\u2500\u2500 feedback/               # one JSON per submission (dual storage)\n\u251c\u2500\u2500 feedback.db             # SQLite index for search (Django default DB)\n\u2514\u2500\u2500 logs/                   # server.log, healthcheck.log\n```\n\n## 4. PAGES (left sidebar)\n1. **Home** `/` \u2014 RH explainer, mission, 4 attack tracks, success ladder.\n2. **Dashboard** `/dashboard/` \u2014 current stage (STATE.md), next action,\n   progress metrics (phases bar, tasks done/total, ledger size), git feed.\n3. **Roadmap** `/roadmap/` \u2014 NGUYEN.md \u00a75 checklist rendered w/ status.\n4. **Results Ledger** `/ledger/` + `/ledger/R-NNN/` \u2014 claims + honesty tags.\n5. **Experiments** `/experiments/` + `/experiments/E-NNN/` \u2014 sidecar cards;\n   Plotly charts from CSVs (config in research_data.CHARTS); pass/fail badges.\n6. **Derivations** `/derivations/` + detail \u2014 37 D-files, math rendered.\n7. **Graveyard** `/graveyard/` \u2014 documented dead ends.\n8. **Journal** `/journal/` + detail \u2014 session narratives.\n9. **Resources** `/resources/` + detail \u2014 43-note RH-equivalence atlas.\n10. **Paper** `/paper/` \u2014 draft status, references, paper-folder inventory.\n11. **Live Runs** `/live/` \u2014 tail view of *-run.log, 3 s polling.\n12. **Feedback** `/feedback/` \u2014 submit form + search (text, category, status).\n\n## 5. FEEDBACK SYSTEM\n- Submit: name (optional), category (general/suggestion/question/correction/\n  track-A/B/C/D), text. CSRF-protected; autoescaped on render.\n- Dual storage (mirrors NGUYEN.md \u00a78.2): JSON file per submission in\n  `web/feedback/FB-<utc>-<id>.json` + row in `web/feedback.db`.\n- Search: full-text (name+text) + category/status filters.\n- Statuses: new \u2192 reviewed \u2192 acted-on (status changes are website data,\n  allowed under \u00a70; researcher notes field for follow-up).\n\n## 6. OPERATIONS\n### 6.1 Session-start protocol (website work)\n1. Read this file.\n2. Health check: `curl -s http://127.0.0.1:8000/api/health/` \u2192 `{\"ok\":true}`.\n3. If down: start detached (see 6.2), re-check.\n4. Review new feedback: `web/feedback.db` status='new' (or the /feedback/ page);\n   surface relevant items to the user.\n### 6.2 Start server (detached, sandbox DISABLED \u2014 long-run rule)\n```\ncd D:\\Python\\Quantum && ./.venv/Scripts/python.exe web/manage.py runserver \\\n  127.0.0.1:8000 >> web/logs/server.log 2>&1   # DETACHED_PROCESS\n```\n### 6.3 Restart / health\n- Stop: find PID via `netstat -ano | findstr :8000`, `taskkill /PID <pid> /F`.\n- Log tail: `web/logs/server.log`.\n- First run after code change to models:\n  `./.venv/Scripts/python.exe web/manage.py migrate`.\n### 6.4 Updating the site when research data changes shape\n- New experiment: automatic (db + sidecars). Charts: add entry to\n  `research_data.CHARTS` (x/y columns, type).\n- New markdown folders: register in `research_data.MD_COLLECTIONS`.\n- Never patch around \u00a70 \u2014 if a feature needs research-archive writes,\n  STOP and ask the user.\n\n## 7. BUILD STATUS\n- [x] Plan written (v1.0, 2026-08-19)\n- [ ] Dependencies installed; vendored JS\n- [ ] Django scaffold\n- [ ] Parsers / views / API\n- [ ] Templates / CSS / JS\n- [ ] Server verified live at 127.0.0.1:8000\n- [ ] Initial commit (web/ + RH-WEBSITE.md only)\n"
}
result 2026-08-19 17:51:30Z → 2026-08-29 05:33:55Z
{
  "type": "create",
  "filePath": "D:\\Python\\Quantum\\web\\logs\\smtp_test.py",
  "content": "\"\"\"SSH: send a direct test mail via 127.0.0.1:25 from the server itself,\nreporting the SMTP conversation so failures are visible (unlike the\nfail_silently path in views.py).\"\"\"\nimport paramiko\n\nSSH_HOST = \"208.109.226.46\"\nSSH_USER = \"[cpanel-user]\"\nSSH_PASS = \"[REDACTED]\"\n\nPY = r'''\nimport smtplib, sys, time\nstamp = time.strftime(\"%Y-%m-%d %H:%M:%S UTC\", time.gmtime())\ntry:\n    s = smtplib.SMTP(\"127.0.0.1\", 25, timeout=20)\n    s.set_debuglevel(1)\n    msg = (\"From: noreply@researchai.dev\\r\\n\"\n           \"To: dan@researchai.dev\\r\\n\"\n           \"Subject: [researchai.dev] SMTP direct test\\r\\n\"\n           \"\\r\\n\"\n           \"Direct smtplib test from the server, \" + stamp + \".\\r\\n\"\n           \"Verifying remote-mail routing for dan@researchai.dev.\\r\\n\")\n    refused = s.sendmail(\"noreply@researchai.dev\",\n                         [\"dan@researchai.dev\"], msg)\n    print(\"REFUSED:\", refused)\n    s.quit()\n    print(\"SEND OK\")\nexcept Exception as e:\n    print(\"SEND FAILED:\", type(e).__name__, e)\n'''\n\nclient = paramiko.SSHClient()\nclient.set_missing_host_key_policy(paramiko.AutoAddPolicy())\nclient.connect(SSH_HOST, port=22, username=SSH_USER, password=SSH_PASS,\n               timeout=20)\ncmd = (\"/opt/alt/python311/bin/python3.11 -c \"\n       + repr(PY))\nstdin, stdout, stderr = client.exec_command(cmd)\nprint(stdout.read().decode(\"utf-8\", \"replace\"))\nprint(stderr.read().decode(\"utf-8\", \"replace\"))\nclient.close()\n",
  "structuredPatch": [],
  "originalFile": null
}
raw content_json (database row)
[{"type":"text","text":"Now writing RH-WEBSITE.md."},{"type":"tool_use","id":"Write_17","name":"Write","input":{"file_path":"D:\\Python\\Quantum\\RH-WEBSITE.md","content":"# RH-WEBSITE.md — NGUYEN-RH-1 Research Website\n# Standing plan + operations document. READ FIRST when doing website work.\n# Created: 2026-08-19 | Status: ACTIVE | Version: 1.0\n# ============================================================\n\n## 0. ⛔ HARD RULE — READ FIRST (user directive, 2026-08-19)\n**DO NOT WRITE to any research document.** The research archive\n(NGUYEN.md, STATE.md, everything under `research/`, git history) is the\nsingle source of truth and is modified ONLY by the research agent per\nNGUYEN.md §8.4. Website work may touch ONLY:\n- `D:\\Python\\Quantum\\web\\`          (all website code, data, logs)\n- `D:\\Python\\Quantum\\RH-WEBSITE.md` (this file)\n\nThe website reads research files exclusively through READ-ONLY handles:\nSQLite via `mode=ro` URI, text files opened `'r'`. Feedback submissions\ngo to `web/feedback/` + `web/feedback.db` — never into `research/`.\nWhen committing, stage ONLY `web/` and `RH-WEBSITE.md` by name.\n\n## 1. PURPOSE\nPublic-facing-style (localhost-only) interactive dashboard for the\nNGUYEN-RH-1 Riemann Hypothesis research project. Goals:\n- Landing page explaining RH and the research mission to a general audience.\n- Live progress: current stage, next action, metrics — auto-updating as the\n  research agent writes to the file system.\n- Browsable archive: results, experiments (+ interactive charts),\n  derivations, graveyard, journal, resources atlas, paper status.\n- Feedback channel: visitors submit comments/suggestions; searchable;\n  researcher reviews them to help the research.\n\n## 2. ARCHITECTURE\n- Location: `D:\\Python\\Quantum\\web\\` — Django project `rhweb`, app `dashboard`.\n- Interpreter: project `.venv` (`./.venv/Scripts/python.exe`).\n  Deps: `web/requirements-web.txt` (Django, markdown).\n- Server: `python web/manage.py runserver 127.0.0.1:8000` — localhost only.\n- Frontend: vanilla JS + vendored Plotly.js (interactive charts) +\n  vendored MathJax (tex-chtml) for math in markdown. NO CDN dependency.\n- Live updates: frontend polls `GET /api/status/` every 3 s; the endpoint\n  reports file mtimes + parsed STATE.md + active run-logs + new-feedback\n  count; changed panels refresh in place. No WebSockets/Redis.\n\n### Data flow (all read-only on research/)\n| Source | How read | Used by |\n|---|---|---|\n| STATE.md | parse `## SECTION` blocks ('r') | Dashboard, status bar |\n| NGUYEN.md | checklist §5 `- [x]/[~]/[ ]` counts; §7 ledger | Dashboard metrics, Roadmap |\n| research/research.db | sqlite3 `file:...?mode=ro` | Ledger, Experiments, Derivations, Graveyard, Journal indexes |\n| research/numerics/data/*.json | json.load ('r') | Experiment cards (checks, key values, caveats) |\n| research/numerics/data/*.csv | csv module, downsampled | Plotly charts, table previews |\n| research/**/*.md | python-markdown + math-protect | Archive pages |\n| research/numerics/data/*-run.log | tail (last N lines) | Live Runs page |\n| git log | `git log --oneline` subprocess (read-only) | Dashboard activity feed |\n\n## 3. FILE MAP\n```\nweb/\n├── manage.py\n├── requirements-web.txt\n├── rhweb/                  # project: settings.py, urls.py, wsgi.py\n├── dashboard/\n│   ├── research_data.py    # ALL read-only parsers (single module to audit §0)\n│   ├── models.py           # Feedback model (lives in web/feedback.db ONLY)\n│   ├── views.py            # pages\n│   ├── api.py              # /api/health, /api/status, /api/logtail\n│   ├── urls.py\n│   ├── templates/dashboard/*.html\n│   └── static/dashboard/{style.css, app.js, vendor/plotly.min.js, vendor/tex-chtml.js}\n├── feedback/               # one JSON per submission (dual storage)\n├── feedback.db             # SQLite index for search (Django default DB)\n└── logs/                   # server.log, healthcheck.log\n```\n\n## 4. PAGES (left sidebar)\n1. **Home** `/` — RH explainer, mission, 4 attack tracks, success ladder.\n2. **Dashboard** `/dashboard/` — current stage (STATE.md), next action,\n   progress metrics (phases bar, tasks done/total, ledger size), git feed.\n3. **Roadmap** `/roadmap/` — NGUYEN.md §5 checklist rendered w/ status.\n4. **Results Ledger** `/ledger/` + `/ledger/R-NNN/` — claims + honesty tags.\n5. **Experiments** `/experiments/` + `/experiments/E-NNN/` — sidecar cards;\n   Plotly charts from CSVs (config in research_data.CHARTS); pass/fail badges.\n6. **Derivations** `/derivations/` + detail — 37 D-files, math rendered.\n7. **Graveyard** `/graveyard/` — documented dead ends.\n8. **Journal** `/journal/` + detail — session narratives.\n9. **Resources** `/resources/` + detail — 43-note RH-equivalence atlas.\n10. **Paper** `/paper/` — draft status, references, paper-folder inventory.\n11. **Live Runs** `/live/` — tail view of *-run.log, 3 s polling.\n12. **Feedback** `/feedback/` — submit form + search (text, category, status).\n\n## 5. FEEDBACK SYSTEM\n- Submit: name (optional), category (general/suggestion/question/correction/\n  track-A/B/C/D), text. CSRF-protected; autoescaped on render.\n- Dual storage (mirrors NGUYEN.md §8.2): JSON file per submission in\n  `web/feedback/FB-<utc>-<id>.json` + row in `web/feedback.db`.\n- Search: full-text (name+text) + category/status filters.\n- Statuses: new → reviewed → acted-on (status changes are website data,\n  allowed under §0; researcher notes field for follow-up).\n\n## 6. OPERATIONS\n### 6.1 Session-start protocol (website work)\n1. Read this file.\n2. Health check: `curl -s http://127.0.0.1:8000/api/health/` → `{\"ok\":true}`.\n3. If down: start detached (see 6.2), re-check.\n4. Review new feedback: `web/feedback.db` status='new' (or the /feedback/ page);\n   surface relevant items to the user.\n### 6.2 Start server (detached, sandbox DISABLED — long-run rule)\n```\ncd D:\\Python\\Quantum && ./.venv/Scripts/python.exe web/manage.py runserver \\\n  127.0.0.1:8000 >> web/logs/server.log 2>&1   # DETACHED_PROCESS\n```\n### 6.3 Restart / health\n- Stop: find PID via `netstat -ano | findstr :8000`, `taskkill /PID <pid> /F`.\n- Log tail: `web/logs/server.log`.\n- First run after code change to models:\n  `./.venv/Scripts/python.exe web/manage.py migrate`.\n### 6.4 Updating the site when research data changes shape\n- New experiment: automatic (db + sidecars). Charts: add entry to\n  `research_data.CHARTS` (x/y columns, type).\n- New markdown folders: register in `research_data.MD_COLLECTIONS`.\n- Never patch around §0 — if a feature needs research-archive writes,\n  STOP and ask the user.\n\n## 7. BUILD STATUS\n- [x] Plan written (v1.0, 2026-08-19)\n- [ ] Dependencies installed; vendored JS\n- [ ] Django scaffold\n- [ ] Parsers / views / API\n- [ ] Templates / CSS / JS\n- [ ] Server verified live at 127.0.0.1:8000\n- [ ] Initial commit (web/ + RH-WEBSITE.md only)\n"},"extra_content":null}]