# MATHCHAST — CURRENT STATE AUDIT Дата обследования: 2026-09-12 Режим: read-only audit Production/БД/nginx/Docker/cron/systemd: не изменялись. Правило статусов: `REAL WORKING`, `CODE NOT CONNECTED`, `MOCK-DOC`, `NOT FOUND`, `NEEDS CHECK`. ## 1. Executive summary Фактическая система — не один репозиторий, а рабочее дерево с несколькими staging-контурaми и серверными roots. Публичный `mathchast.com` сейчас обслуживается nginx из статического root `/mnt/data10tb/sites/mathchast/current`; локально рядом есть Next.js-исходники `public-site/`, но связь этого каталога с текущим production build в ходе аудита не доказана. `work.mathchast.com` обслуживает отдельный root `/mnt/data10tb/sites/mathchast/work`, статические HTML/Markdown и API. Реально переиспользуемые части: PostgreSQL editorial-модель, D15 queue/contracts, ISP13 public research collector, HTML component package, image/Qwen service layer, nginx/Work publishing. Не доказано, что они собраны в один end-to-end production pipeline. Рекомендуемый первый slice: один разрешённый источник → frozen source snapshot + hash → Research Pack JSON/HTML → ручной запуск Luna/Codex → article package → deterministic HTML/SEO/link QA → отдельный staging deploy → human review. ## 2. Current topology | Контур | Состояние | Подтверждение | |---|---|---| | Windows workspace | `REAL WORKING` | `H:\__=PYTON_PROJECTS=\CLI_Freeman\18_MathChast` | | Public site source | `REAL WORKING` | `public-site/`, Next 14.2.15, React 18.3.1 | | Public production | `REAL WORKING` | nginx root `/mnt/data10tb/sites/mathchast/current` | | Work | `REAL WORKING` | nginx root `/mnt/data10tb/sites/mathchast/work` | | Editor DB | `REAL WORKING` | PostgreSQL 16, DB `mathchast_editor` | | Research code | `CODE NOT CONNECTED` | `services/isp13/` exists; single production route not proven | | Writer/Qwen | `REAL WORKING` / `CODE NOT CONNECTED` | service and D15 code exist; end-to-end publication not proven | | One canonical Git repository | `NOT FOUND` | workspace root and checked subdirectories have no `.git` | ## 3. Repository map ### 3.1 Answers 1–10 1. **[NEEDS CHECK]** Основной Git-репозиторий в указанной рабочей папке не найден. Абсолютный workspace path: `H:\__=PYTON_PROJECTS=\CLI_Freeman\18_MathChast`; это не Git root. 2. **[NOT FOUND]** Git remote для этого workspace отсутствует, потому что `.git` в корне не найден. URL remote не установлен/не подтверждён. 3. **[NEEDS CHECK]** Текущая ветка и dirty tree единого репозитория не определяются. Для отдельных внешних репозиториев проверка нужна отдельно. 4. **[REAL WORKING]** Верхний уровень содержит `public-site/`, `work-templates/`, `html-components-package/`, `services/`, `ai-brains-staging/`, `mathcast-staging/`, `browser_extension_work_article_bridge/`, `deploy/`, `docs/`, `monitoring/`, `ops/`, `test-fixtures/`, `tools/`. 5. **[REAL WORKING]** `mathchast.com` и `work.mathchast.com` используют разные server roots: `/mnt/data10tb/sites/mathchast/current` и `/mnt/data10tb/sites/mathchast/work`. Один общий Git repo не подтверждён. 6. **[REAL WORKING]** Source of truth — смесь filesystem, документов, PostgreSQL и server configuration. Единого источника истины не найдено. 7. **[REAL WORKING]** Реально полезные документы: `docs/AI_WORKFLOW.md`, `docs/d15-*`, `services/d15_writer/README.md`, `mathcast-staging/research/catalog/README.md`, Journalist/Agent docs в Work. 8. **[REAL WORKING]** Тесты есть в `services/d15_writer/`, `services/d15_pilot/`, `tools/`, `test-fixtures/`, `public-site` image checks. Полный общий test suite проекта не найден. 9. **[NOT FOUND]** Единый CI/CD workflow для всего workspace не найден. Push-triggered jobs не подтверждены. 10. **[NEEDS CHECK]** Staging фактически есть как каталоги `mathcast-staging/`, `ai-brains-staging/`, `.work-d11` и server stage containers, но единый promotion workflow не подтверждён. ## 4. Public publishing today 11. **[REAL WORKING]** `https://mathchast.com/` обслуживает nginx на SRV2, HTTPS server block в `/etc/nginx/sites-enabled/mathchast.com.conf`. 12. **[REAL WORKING]** Production files: `/mnt/data10tb/sites/mathchast/current`. 13. **[REAL WORKING]** Front door — nginx. Для `mathchast.com` используется static root; Next.js есть в исходниках, но production runtime Node/Next не подтверждён. 14. **[REAL WORKING]** Relevant config: `root /mnt/data10tb/sites/mathchast/current;`, `index index.html;`, `try_files $uri $uri/ =404;`, image cache location; Work имеет отдельный root/proxy locations. 15. **[REAL WORKING]** Главная в production — физический `index.html` в nginx root, а не доказанно runtime-generated page. 16. **[NEEDS CHECK]** Путь одной live article URL до конкретного production file и media нужно трассировать по выбранному slug; локальный Next route описан в `public-site/app/articles/[slug]/page.js`. 17. **[REAL WORKING]** Local canonical article data: `public-site/content/articles.js`; production copy: `/mnt/data10tb/sites/mathchast/current`. Полное совпадение не проверено. 18. **[REAL WORKING]** Local model — structured JS article records plus React component rendering; production serving format — static HTML/assets. DB article storage существует отдельно в PostgreSQL. 19. **[NEEDS CHECK]** В local Next список строится из `articles.js`; production listing update mechanism не подтверждён. 20. **[REAL WORKING]** В local source slug хранится как поле article record; автоматический slug generator не найден. 21. **[REAL WORKING]** Next code generates title, description, canonical, OG, Twitter and robots per article. JSON-LD, breadcrumbs, dates, author, category and related are not all confirmed in the inspected route. 22. **[REAL WORKING]** `public-site/app/sitemap.js` generates sitemap from `articles`; production update mechanism is not confirmed. 23. **[NOT FOUND]** Connected IndexNow not found in inspected public-site source. 24. **[REAL WORKING]** `public-site/app/robots.js` generates robots metadata and sitemap URL; production physical robots response still needs live comparison. 25. **[NEEDS CHECK]** Exact Zed→production deploy script was not proven. Observed model is file/build preparation followed by copy/sync into nginx roots; do not treat as canonical until deploy script is named. 26. **[REAL WORKING]** Static file changes do not require application restart; nginx reload is only needed for nginx config changes, not ordinary HTML/assets. 27. **[REAL WORKING]** nginx asset caching exists, including long cache for images. CDN and purge API were not confirmed. 28. **[NEEDS CHECK]** Deployment scripts exist under local `deploy/` and `public-site/scripts/`, but one canonical production script was not identified. 29. **[NEEDS CHECK]** Rollback can be done by restoring previous static root/snapshot, but an automated rollback command or release manifest was not confirmed. 30. **[NEEDS CHECK]** Local lint/image checks exist; complete pre/post publication QA and live smoke suite are not proven. ## 5. Work: implemented vs mock 31. **[REAL WORKING]** Work source documents are in local `docs/`, `ai-brains-staging/`, Journalist staging, and server root `/mnt/data10tb/sites/mathchast/work`; exact source-to-server sync contract is not unified. 32. **[REAL WORKING]** Work is a mixture: static HTML/Markdown/docs plus authenticated editor API and service proxies. 33. **[REAL WORKING]** Editorial DB/API is real; many visible catalog pages are static documentation/UI and are not automatically DB-backed. 34. **[REAL WORKING]** `article`, `article_version`, `asset`, `task`, `workflow`, `d15_writer_task` are DB tables. `source`, `claim`, `research_pack`, `job` are present in code/docs or partial schema, not one confirmed unified model. 35. **[REAL WORKING]** HTML library: `html-components-package/`. 36. **[REAL WORKING]** 68 entries in `html-components-package/components.json`; manifest exists. Examples and components are under the same package. 37. **[CODE NOT CONNECTED]** A component renderer exists in pilot code, but a verified one-command complete article builder with source/fact/QA/deploy contracts was not found. 38. **[REAL WORKING]** Examples are in `html-components-package/examples/`, including image, fact, and link examples. 39. **[CODE NOT CONNECTED]** Components have machine-readable manifest metadata; semantic block selection rules for a Writer are not established as a single executable policy. 40. **[REAL WORKING]** Relevant local docs include `mathcast-staging/site/docs/seo-master-instruction-traffic-2026.html`, `22-robots-sitemap-indexnow-ai-crawlers.html`, `article-editor-master-plan.html`, `docs/d15-fact-check-contract.*`, `docs/d15-image-worker-contract.*`, `ai-brains-staging/source/writer-04-article-markup.html`, `writer-05-style-fingerprint.html`, `writer-08-fact-checker.html`, `researcher-06-evidence-pack.html`. 41. **[NEEDS CHECK]** These are useful instruction candidates, but canonical/obsolete/conflicting status requires a document decision register. D15 contracts and current Agent/Journalist docs should be treated as separate generations until reconciled. 42. **[REAL WORKING]** Yes: a Work Markdown page can link to canonical docs without duplicating them. This audit itself is an example of that pattern. ## 6. Raw material, scraping, research 43. **[REAL WORKING]** Main discovered code: `services/isp13/collector.py`, `services/isp13/extract.py`, cache/control/models/media modules; additional research artifacts in `mathcast-staging/research/`. 44. **[CODE NOT CONNECTED]** ISP13 collector accepts resource/request/article URLs, respects pacing/robots, discovers links, extracts articles and stores research result/cache/media; a single production scheduler/consumer was not proven. 45. **[REAL WORKING]** Collector has URL/article discovery and extraction; metadata and evidence models exist. Image/link completeness depends on extractor/resource and was not benchmarked here. 46. **[REAL WORKING]** Sitemap/XML discovery is present in collector logic and resource registry. 47. **[NEEDS CHECK]** RSS-specific collector was not separately verified; XML discovery exists but RSS semantics need a targeted check. 48. **[NEEDS CHECK]** Playwright/Selenium is referenced in project search/staging material, but live crawler use for ISP13 was not established. 49. **[REAL WORKING]** `MediaStore` exists in ISP13; full production image downloader contract is not verified. 50. **[REAL WORKING]** URL parsing/allowed-host and canonical-like normalization logic exists; global dedup policy needs review. 51. **[REAL WORKING]** Hashing/cache primitives exist; one project-wide content fingerprint contract was not proven. 52. **[REAL WORKING]** Observation cache supports unchanged checks via response metadata/content; full change-detection history is not confirmed. 53. **[CODE NOT CONNECTED]** Research request/control and D15 DB queues exist; a live scraping job queue with operational dashboard was not confirmed. 54. **[REAL WORKING]** Collector has delay, timeout, max runtime, consecutive network-failure limit, cooldown and watchdog controls. 55. **[REAL WORKING]** `urllib.robotparser` is used in `services/isp13/collector.py`. 56. **[REAL WORKING]** Source registry exists in `services/isp13/registry.py`; live enabled sources require separate inventory. 57. **[REAL WORKING]** Resource catalog exists in `services/isp13/registry.py` and `mathcast-staging/research/catalog/`. 58. **[REAL WORKING]** Resource model has operational fields such as allowed hosts/discovery and request constraints; exact requested fields enabled/interval/priority/trust/last_scan need schema inspection. 59. **[NOT FOUND]** A verified scheduled crawl cron was not found. User crontab on SRV2 showed unrelated startup scripts. 60. **[REAL WORKING]** Collector interval/delay is CLI-configurable; changing a persistent schedule without code is not proven. 61. **[REAL WORKING]** Discovery of links/sitemaps exists; autonomous discovery of new trusted source domains is not confirmed. 62. **[NEEDS CHECK]** Web/XML/GitHub-like research materials exist; YouTube/Telegram/Reddit/patent/scientific integrations were not all verified as connected. 63. **[NEEDS CHECK]** Per-API file/library/limits require a separate inventory. Secrets were intentionally not inspected. 64. **[REAL WORKING]** Reuse ISP13 fetch/robots/cache/resource/evidence/media primitives and D15 evidence contracts. 65. **[REAL WORKING]** Do not reuse unchecked experimental adapters as production truth, especially source-specific hacks and unvalidated evaluator assumptions. ## 7. Research / evidence / facts 66. **[REAL WORKING]** Evidence, claim and research result models exist in ISP13/D15 code and contracts. 67. **[REAL WORKING]** Relevant files: `services/isp13/models.py`, `services/d15_writer/evidence.py`, `docs/d15-fact-check-contract.*`, `docs/d11-mcp-writer-contract.*`. 68. **[REAL WORKING]** Source/evidence records include URLs, timestamps/status/content and references; exact production schema for every claim field is not unified. 69. **[REAL WORKING]** Evidence/source references can point to source URLs and IDs. 70. **[REAL WORKING]** Scoring/trust-like source logic exists; one enforced global trust score is not confirmed. 71. **[REAL WORKING]** D15 claim statuses include confirmed/conflicting/uncertain/not found/unsupported; all requested epistemic types are not proven as DB enums. 72. **[CODE NOT CONNECTED]** Fact-check contracts and evaluation code exist; production fact-checker route is not proven. 73. **[CODE NOT CONNECTED]** Conflicting evidence is represented in contracts; automatic broad contradiction search is not confirmed. 74. **[CODE NOT CONNECTED]** ISP13 is a research collector/service codebase, not proven as a deployed autonomous Researcher agent. 75. **[CODE NOT CONNECTED]** A bounded research request can be represented and executed by collector; end-user “добери информацию по X” API is not verified. 76. **[REAL WORKING]** CLI/request models exist in `services/isp13/cli.py` and models; production API/queue contract remains unproven. 77. **[REAL WORKING]** Checkpoints, progress path, kill switch and cache are implemented in collector code. 78. **[REAL WORKING]** Runtime/document limits and watchdogs exist; a semantic research-loop budget needs explicit contract. 79. **[RECOMMENDATION]** Extend existing source/evidence/job model with versioned `research_pack` artifact rather than starting an unrelated parallel source graph. ## 8. Qwen 30B / old Journalist 80. **[REAL WORKING]** Qwen/Hermes code: `services/d15_pilot/qwen_adapter.py`, `services/d15_writer/hermes_adapter.py`, D15 worker/contracts/tests, Journalist docs. 81. **[REAL WORKING]** Live Qwen server is llama.cpp: `qwen-llama-server.service`, binary `/mnt/ssd_projects/apps/llama_cpp_b9837/llama-server`, loopback port 18080. 82. **[REAL WORKING]** It runs on SRV2 as systemd service; not a Docker container. 83. **[NEEDS CHECK]** Service command confirms port 18080, but endpoint paths/models API should be queried separately; credentials were not inspected. 84. **[NEEDS CHECK]** Preset file `/mnt/ssd_projects/apps/qwen_models/qwen-router.ini` exists as configured source; exact loaded model at audit moment was not queried. 85. **[REAL WORKING]** SRV2 has RTX 4080 SUPER with 16,376 MiB VRAM; live service limits/context/speed were not benchmarked in this audit. 86. **[REAL WORKING]** Machine-readable D15 skill tests exist under `services/d15_writer/` and `docs/`. 87. **[REAL WORKING]** Results/artifacts exist in `docs/`, D15 JSON reports and service fixtures; one canonical latest result index is not established. 88. **[NEEDS CHECK]** Contracts define reliable narrow JSON/checkpoint behavior; broad factual/editorial reliability must be re-benchmarked before use. 89. **[REAL WORKING]** Existing D15 skill reports document failures; no new quality claim is made here. 90. **[REAL WORKING]** Classification/claims/checkpoint skills are represented; entities/tags/translation/duplicate detection are not all proven as measured capabilities. 91. **[RECOMMENDATION]** Re-benchmark structured extraction, classification, entity/tag normalization, duplicate detection, claim status assignment and refusal/uncertainty handling. 92. **[REAL WORKING]** D15 worker/queue selects a route and capability profile; global multi-model orchestrator is not confirmed. 93. **[CODE NOT CONNECTED]** Journalist/INGEST documents and tests are isolated project artifacts; production article publishing connection is not proven. 94. **[REAL WORKING]** Preserve queue, contracts, evidence refs, checkpoint/idempotency and observability patterns; do not inherit unvalidated editorial quality assumptions. ## 9. Database and search 95. **[REAL WORKING]** PostgreSQL is live; Docker Postgres/pgvector also exists for another app stack. 96. **[REAL WORKING]** PostgreSQL 16.15, service `postgresql@16-main.service`, DB `mathchast_editor`, loopback 127.0.0.1:5432. 97. **[REAL WORKING]** Main tables: `editorial.article`, `article_stage`, `article_version`, `asset`, `annotation`, `task`, `task_event`, `workflow`, `d15_writer_task`, `d15_writer_task_event`, `platform.project`, `platform.audit_event`. 98. **[REAL WORKING]** SQL migrations exist locally in `services/`, including `007_project_scope.sql` and `008_source_job.sql`; migration runner not identified. 99. **[NEEDS CHECK]** pgvector availability in `mathchast_editor` was not queried during this audit. 100. **[NEEDS CHECK]** Embedding columns/records were not confirmed. 101. **[NOT FOUND]** No embedding provider/model was proven from inspected evidence. 102. **[NEEDS CHECK]** Embedding object coverage not confirmed. 103. **[NEEDS CHECK]** FTS/tsvector/pg_trgm extensions/indexes were not queried. 104. **[NEEDS CHECK]** Trend/observation tables were not confirmed in editorial DB; ISP13 has observation cache/history artifacts. 105. **[REAL WORKING]** Redis Docker container exists in `smm-app000-stage0-redis-1`; system `redis-server` was inactive. Mathchast usage is not confirmed. 106. **[REAL WORKING]** PostgreSQL-backed D15 queue exists. BullMQ/Celery/RQ was not found as the confirmed Mathchast queue. 107. **[REAL WORKING]** D15 worker/systemd and PostgreSQL task lease architecture is real; several other worker descriptions remain code/docs until live route is proven. ## 10. Storage and disks 108. **[REAL WORKING]** SRV2: root 98G/41G used/53G free; `/mnt/ssd_projects` 1007G/118G used/838G free; `/mnt/data10tb` 9.1T/36G used/8.6T free. SRV1: root 98G/52G used/42G free; `/data` 787G/253G used/494G free; NFS shared 9.1T/36G used/8.6T free. Windows capacity not measured in this audit. 109. **[REAL WORKING]** `/mnt/ssd_projects` is fast local project storage; `/mnt/data10tb` is large data storage. Exact SSD/NVMe/HDD device classes need `lsblk` confirmation. 110. **[REAL WORKING]** SRV1 `/data` is a separate large mount; exact rotational class not confirmed. 111. **[RECOMMENDATION]** Windows disk may be optional cold copy only; risks are account dependence, workstation availability, permissions, sync drift and no server-side durability guarantee. 112. **[REAL WORKING]** MinIO container `smm-app000-stage0-minio-1` exists; Mathchast bucket use is not confirmed. 113. **[NEEDS CHECK]** Buckets/prefixes were not listed to avoid credentials/config leakage. 114. **[REAL WORKING]** Public-site image source is `public-site/content/image-source/`; production image location is under `/mnt/data10tb/sites/mathchast/current` and requires exact file inventory. 115. **[REAL WORKING]** Local source/temp image areas include `public-site/content/image-source/`, `tools/`, staging directories and shared image storage. 116. **[NOT FOUND]** Lifecycle cleanup policy was not confirmed. 117. **[NOT FOUND]** Automatic N-day temp deletion was not confirmed. 118. **[REAL WORKING]** Hash/dedup primitives exist in parts of the code; one enforced file-dedup service was not proven. 119. **[NEEDS CHECK]** Average sizes were not calculated from a representative sample; do not use estimates for capacity planning. 120. **[RECOMMENDATION]** Hot: active DB/queues/current build/raw working set on SSD. Warm: snapshots/reports/media on `/mnt/data10tb`. Cold: immutable archives and manifests, optionally replicated off-machine. Do not retain unbounded raw temp. ## 11. Images 121. **[REAL WORKING]** Image-related code/services exist in public-site scripts, ISP13 MediaStore, D15 image contracts, Hermes SEO image workers and ComfyUI infrastructure. 122. **[REAL WORKING]** Local paths: `public-site/scripts/optimize-images.mjs`, `public-site/content/image-manifest.json`, `docs/d15-image-worker-contract.*`, `services/isp13/media_store.py`; server services include SEO image workers. 123. **[REAL WORKING]** Resize/optimization and image prompt/worker contracts exist; all generate/redraw/reference/background/crop/rights modes are not one verified pipeline. 124. **[REAL WORKING]** CLI/scripts, systemd workers and ComfyUI/API infrastructure exist; one unified UI/API entrypoint is not proven. 125. **[REAL WORKING]** D15 contracts and image manifest provide partial input contracts; full article image-plan contract needs explicit adoption. 126. **[REAL WORKING]** Public-site manifest/output and image worker contract provide partial output contracts. 127. **[CODE NOT CONNECTED]** An article image plan can be represented, but automatic whole-article execution after Writer was not proven. 128. **[NEEDS CHECK]** Prompt/angle diversity protection was not confirmed. 129. **[REAL WORKING]** Rights/source concepts exist in resource/evidence docs; enforcement for every public image is not proven. 130. **[CODE NOT CONNECTED]** Automatic Writer→image pipeline is not established; keep it after human-approved image plan. ## 12. SEO, links, knowledge base 131. **[REAL WORKING]** Metadata, robots and sitemap code exist in `public-site/app/`; broader QA checks are partial. 132. **[REAL WORKING]** Title/description/canonical/OG/Twitter/robots/sitemap generators exist. JSON-LD/breadcrumb/related generation requires targeted route inspection. 133. **[NOT FOUND]** Project-wide broken-link checker not confirmed. 134. **[NEEDS CHECK]** HTML validation exists only if included in local scripts/docs; no live gate confirmed. 135. **[NOT FOUND]** Playwright mobile/responsive gate not confirmed. 136. **[REAL WORKING]** robots/indexability metadata exists; end-to-end production noindex smoke test not confirmed. 137. **[NOT FOUND]** Search Console integration not found in inspected source. 138. **[NOT FOUND]** Yandex Webmaster/IndexNow connection not confirmed. 139. **[REAL WORKING]** Related/recommendation artifacts exist (`services/recommendations/published_index.json`), but automatic internal-link insertion is not proven. 140. **[REAL WORKING]** Categories/topics exist in article/content/docs models; unified term taxonomy not confirmed. 141. **[NEEDS CHECK]** Term/knowledge-base/reference-page entity not proven as one DB model. 142. **[NEEDS CHECK]** Reference pages may exist in public/staging docs; published canonical inventory not audited. 143. **[RECOMMENDATION]** Add versioned term dictionary `alias → canonical URL` and deterministic link budget before publication. 144. **[RECOMMENDATION]** Enforce per-article/per-term max links, same-target dedup and first-meaningful-occurrence policy. 145. **[RECOMMENDATION]** Build batch relinking as a post-publication versioned job, not as hidden Writer behavior. ## 13. Ready articles and deploy queue 146. **[NEEDS CHECK]** Editorial DB has article/workflow/task tables, but a confirmed “ready to publish” catalog and production deploy queue were not found. 147. **[RECOMMENDATION]** Contract: Writer outputs package → validator/QA → deployer consumes immutable artifact; Writer must not know production paths. 148. **[RECOMMENDATION]** Yes, deployer maps logical IDs to environment paths through config/DB and publishes atomically. 149. **[RECOMMENDATION]** Deployer resolves category/slug from validated article metadata, media IDs from manifest, listing/sitemap/link indexes from generated artifacts. 150. **[REAL WORKING]** Reuse PostgreSQL task/workflow tables, D15 queue/lease code, public-site metadata/sitemap modules and Work/static deployment conventions. 151. **[REAL WORKING]** Use idempotency key `(article logical id, version, target environment)` and immutable release manifest. 152. **[REAL WORKING]** Existing D15 queue uses idempotency and leases; extend same pattern for article publishing lock. 153. **[REAL WORKING]** Some states are represented in D15/editorial workflow; full requested state machine is not proven. 154. **[RECOMMENDATION]** Extend existing editorial workflow rather than introduce a second status authority. ## 14. Two developers, Zed, handoff 155. **[NEEDS CHECK]** Since this workspace has no Git root, commit/author identity cannot be tied to the current folder. Use Git author + signed/traceable deployment metadata in the real repo. 156. **[NEEDS CHECK]** Multiple Windows accounts are a known risk for local browser/Figma services and paths; exact account ownership was not audited here. 157. **[RECOMMENDATION]** One shared repo with protected main, short-lived branches, review and release tags is preferable once the source roots are consolidated. 158. **[REAL WORKING]** `docs/AI_WORKFLOW.md` exists; a single current root `HANDOFF.md` was not found. 159. **[RECOMMENDATION]** Put canonical `HANDOFF.md` at the actual shared repo root, not only in Work. 160. **[REAL WORKING]** Generate a read-only Work Project State page from handoff metadata; do not make Work prose the source of truth. 161. **[RECOMMENDATION]** Hourly read-only exporter plus explicit `save handoff` command, both writing versioned snapshots and last-success metadata. 162. **[RECOMMENDATION]** Include branch, SHA, author, changed files, completed/current/next codes, tests, deploy status, blockers, environment and artifact URLs. 163. **[RECOMMENDATION]** Separate staging roots, release locks, ownership labels, atomic deploy and no direct editing of production files. 164. **[RECOMMENDATION]** Yes: protected main/release plus development/staging branch or environment. ## 15. Settings 165. **[CODE NOT CONNECTED]** Configuration exists across service args, systemd, code and docs; a centralized Settings model was not found. 166. **[REAL WORKING]** Examples: ISP13 CLI parameters, service unit arguments, Qwen preset path, public-site code metadata and DB schema. 167. **[RECOMMENDATION]** Move sources, intervals, retention, concurrency, research limits, Writer timeout, QA retries and publish mode into versioned non-secret config/DB. 168. **[REAL WORKING]** Credentials, tokens, private keys, DB passwords and model access secrets must remain in secret store/environment, never Work or article packages. 169. **[NEEDS CHECK]** `platform.audit_event` exists; settings-change audit coverage is not confirmed. 170. **[RECOMMENDATION]** Store config version/hash on every job and article package; immutable config snapshots for reruns. ## 16. Resources and observability 171. **[REAL WORKING]** SRV2: Ubuntu x86_64, 62 GiB RAM, RTX 4080 SUPER 16,376 MiB VRAM, roots/storage listed above; CPU model and temperatures not collected. 172. **[REAL WORKING]** SRV1: Ubuntu x86_64, 31 GiB RAM, RTX 5070 Ti 16,303 MiB VRAM, `/data` 787G; CPU model/temperature not collected. 173. **[NEEDS CHECK]** Docker/systemd services and Qwen are live; a sampled resource ranking over time was not performed. 174. **[NEEDS CHECK]** Safe Chromium concurrency requires benchmark; start conservatively at one per domain and small global concurrency. 175. **[NEEDS CHECK]** Qwen concurrency limit requires measured context/VRAM benchmark; default one active generation on single-model llama.cpp service. 176. **[NEEDS CHECK]** Docker resource limits were not inventoried. 177. **[REAL WORKING]** Point-in-time `free`, `df`, `nvidia-smi`, systemd/docker visibility exists; durable monitoring stack was not confirmed. 178. **[NOT FOUND]** Disk-space alert rule was not confirmed. 179. **[REAL WORKING]** systemd/Docker logs and D15 telemetry code exist; unified job-log UI not confirmed. 180. **[NOT FOUND]** Retry/dead-letter dashboard not confirmed; queue tables contain states/events. ## 17. Conclusions for new contour 181. **[REAL WORKING]** Reuse: fetch/robots/cache/evidence, PostgreSQL editorial model, D15 queue/checkpoint, HTML components, public-site metadata/sitemap, image optimization, Work static publishing. 182. **[RECOMMENDATION]** Write: unified source→Research Pack contract, independent fact/reference evaluator, Writer protocol, package validator, deploy manifest and operational observability. 183. **[REAL WORKING]** Main divergence: many documents describe target architecture while live server has multiple roots/services and no proven single orchestrator; staging artifacts are not automatically production capability. 184. **[RECOMMENDATION]** Minimal slice: 1 source URL → raw/hash → evidence pack → manual Luna input → article.html/article.json → deterministic QA → Work staging URL → human approval. 185. **[RECOMMENDATION]** Risks: source access/robots, encoding, duplicate content, factual drift, disconnected staging, path/account drift, missing rollback, image rights, queue idempotency, unmeasured model limits. 186. **[RECOMMENDATION]** Likely bottlenecks: source/network reliability first, then human/evidence validation and Writer context; GPU is not first bottleneck for one-article slice. 187. **[RECOMMENDATION]** Before Luna: fetch/decode/dedup, extract text/metadata, source ranking, claim/evidence table, contradiction flags, missing fields, concise outline and image plan. 188. **[RECOMMENDATION]** Research Pack: version/hash, request, selected sources, concise facts with evidence spans, claims/status, conflicts, unknowns, links, freshness, rights and next questions. 189. **[RECOMMENDATION]** Do not send raw HTML, navigation, duplicate sources, full media, low-ranked snippets or unresolved noise by default; keep retrievable by evidence ID. 190. **[RECOMMENDATION]** Writer emits `NEED_MORE_RESEARCH` with structured query/claim IDs; orchestrator creates a child research job and resumes same writer run after evidence merge. 191. **[RECOMMENDATION]** Give external Writer a read-only signed/expiring URL to immutable Research Pack, with JSON plus human HTML and no write/API credentials. 192. **[RECOMMENDATION]** Protocol: input pack/version → `READY/WRITING/NEED_MORE_RESEARCH/BLOCKED/QA/COMPLETE/FAILED` → output refs/claims/package/errors/next request. 193. **[RECOMMENDATION]** Minimal package: `article.html`, `article.json`, `sources.json`, `claims.json`, `image-plan.json`, `manifest.json`, `qa.json`. 194. **[RECOMMENDATION]** Deploy-ready adds immutable release ID, target/category/slug, media manifest/hashes, link plan, sitemap delta, validation result, approval and rollback pointer. 195. **[RECOMMENDATION]** Fact-check immediately after Research Pack and after Writer; originality before QA/deploy, both blocking only according to explicit policy. 196. **[RECOMMENDATION]** Default one automatic repair/retry, maximum two; configurable and never silently changes source/model/config. 197. **[RECOMMENDATION]** Parallelize independent source requests with per-domain limits; serialize dependent follow-ups and cap total at 20. 198. **[RECOMMENDATION]** Keep durable source URL/canonical, normalized fingerprint, title/date, claim/evidence hashes, article/package hashes and publication history even if raw expires. 199. **[RECOMMENDATION]** Retain indefinitely: source identity/fingerprint, Research Pack version, claims/evidence refs, article versions, manifests, config/model/prompt hashes, QA/decision/deploy audit. 200. **[RECOMMENDATION]** Hot SSD: DB, queues, active snapshots and current builds. Warm large disk: raw/media/reports. Cold Windows/SRV1 copy: encrypted immutable archive only, never sole source. ## 18. Reusable components | Component | Status | Path | Reuse? | Notes | |---|---|---|---|---| | Public site metadata/sitemap | REAL WORKING | `public-site/app/` | Yes | Adapt to package-based publishing | | HTML component manifest | REAL WORKING | `html-components-package/components.json` | Yes | 68 components | | Article component examples | REAL WORKING | `html-components-package/examples/` | Yes | Reference, not complete pipeline | | ISP13 fetch/robots/cache | CODE NOT CONNECTED | `services/isp13/` | Yes with audit | Bounded public research | | Evidence/claim contracts | REAL WORKING | `services/d15_writer/`, `docs/d15-*` | Yes | Reconcile versions | | PostgreSQL editorial model | REAL WORKING | DB `mathchast_editor` | Yes | Extend, don’t duplicate | | D15 queue/lease/idempotency | REAL WORKING | `services/d15_writer/queue.py` | Yes | Useful deploy/job base | | Qwen llama.cpp service | REAL WORKING | SRV2 `qwen-llama-server.service` | Benchmark only | Narrow worker use | | Image optimization | REAL WORKING | `public-site/scripts/optimize-images.mjs` | Yes | Validate against package | | Work static publishing | REAL WORKING | `/mnt/data10tb/sites/mathchast/work` | Yes | Docs/staging artifacts | ## 19. Missing components 1. One canonical repository/release manifest. 2. Versioned Source/ResearchPack/ArticlePackage schemas connected to DB jobs. 3. Independent deterministic evaluator and fact/number/rights gates. 4. Verified deployer with atomic release and rollback. 5. Unified observability, retry/dead-letter view and disk alerts. 6. Canonical taxonomy/term dictionary/internal-link batch. 7. Explicit source rights and retention policy. 8. One staging-to-production promotion contract. ## 20. Risks - **P0:** Publishing from an unverified root or mixed static/document source. - **P0:** Writer receives evidence without immutable version/hash and can silently fabricate. - **P0:** No proven rollback/atomic deploy contract. - **P1:** Source access, robots, anti-bot and encoding differences. - **P1:** Multiple Windows accounts/local services create path and ownership drift. - **P1:** Duplicate research/article generation after raw cleanup. - **P1:** Qwen limits and capability assumptions not benchmarked for the new workload. - **P1:** Work documents mistaken for production contracts. - **P2:** Missing automated link/mobile/HTML QA and capacity alerts. ## 21. Audit boundary This page is an evidence-backed first audit, not a declaration that every service is production-ready. Items marked `NEEDS CHECK` or `CODE NOT CONNECTED` require a targeted read-only follow-up before implementation. No credentials, private keys or secret values were copied into this document.