МАТЧАСТЬ / MASTER IMPLEMENTATION PLAN / DOCUMENT 44 / 02.09.2026
MASTER PLAN реализации
Исполняемый план сборки mathchast.com после завершения исследовательской фазы. Документ переводит стратегию из Docs 1–43 в конкретную структуру репозитория, модули, миграции, API, страницы, workers, AI‑агентов, policies, тесты, observability и последовательность задач. Его задача — дать Codex/Qwen/другим ИИ‑разработчикам достаточно контекста, чтобы они могли по одной атомарной задаче собирать систему без постоянного переосмысления архитектуры.
44 → codeдальше не исследование, а последовательная реализация
1 task = 1 outcomeкаждая задача ограничена файлами, контрактом, тестами и DoD
AI-operated productroutine editorial/analytics выполняются агентами и rules
Paid slice firstпервая цель — реальная компания, реальная публикация, реальная оплата и реальный отчёт
0. Правило запуска
После этого документа не добавлять новые исследовательские блоки до появления первой рабочей вертикальной цепочки. Любая новая идея попадает в backlog, если она не блокирует путь Company → Publication → Proof → AI Visibility → Report → Next Action.
1. Финальный стек
HOST
Ubuntu Server 24.04
Docker Compose
nginx
WEB
Next.js 16 Active LTS
TypeScript
SSR / Server Components
API
FastAPI
SQLAlchemy 2
Alembic
Pydantic
DATA
PostgreSQL 18.x
pgvector
pg_trgm
Redis
Redis Streams
MinIO
AUTH
Authentik / OIDC
AI
Local Qwen 30B
External approved model adapters
Prompt Registry
Typed Tool Gateway
OPS
OpenTelemetry
Prometheus
Grafana
Loki
Blackbox Exporter
pgBackRest
off-host backup.
2. Monorepo
mathchast/
├─ apps/
│ ├─ web/
│ ├─ api/
│ └─ worker/
├─ packages/
│ ├─ contracts/
│ ├─ design-tokens/
│ └─ config/
├─ db/
│ ├─ migrations/
│ └─ seeds/
├─ policies/
│ ├─ editorial/
│ ├─ commercial/
│ ├─ security/
│ ├─ ai-tools/
│ └─ retention/
├─ prompts/
│ ├─ editorial/
│ ├─ verification/
│ ├─ measurement/
│ └─ recommendations/
├─ evals/
│ ├─ editorial/
│ ├─ security/
│ └─ ai-visibility/
├─ infra/
│ ├─ compose/
│ ├─ nginx/
│ ├─ monitoring/
│ ├─ backups/
│ └─ scripts/
├─ docs/
│ ├─ adr/
│ ├─ runbooks/
│ └─ product/
├─ scripts/
├─ AGENTS.md
├─ README.md
└─ Makefile
3. AGENTS.md — обязательный первый файл
До генерации кода любой ИИ‑разработчик должен читать один короткий authoritative файл с правилами проекта.
# AGENTS.md
PROJECT
What Mathchast is
CORE LOOP
Company → Publication → Proof → AI → Action
ARCHITECTURE
Modular monolith
Postgres truth
Async workers
FORBIDDEN
No microservices
No Kafka
No Neo4j
No unrestricted AI shell
No cross-workspace access
No hidden paid links
MODULE OWNERSHIP
identity
content
trust
commerce
measurement
workspace
TESTS
required commands
MIGRATIONS
Alembic only
SECURITY
least privilege
RLS
typed AI tools
DONE
tests + metrics + audit + docs.
4. Команды разработчика
make dev
make test
make lint
make typecheck
make db-up
make migrate
make seed
make e2e
make security-test
make eval
make build
make staging
make smoke
make backup-test
5. Definition of Done глобальный
FEATURE DONE only if:
✓ implementation works
✓ unit/integration tests
✓ auth checked
✓ tenant scope checked
✓ audit where needed
✓ metrics/logging
✓ error/loading/empty states
✓ migration included
✓ rollback path
✓ no secrets
✓ documentation
✓ AI eval if AI feature
✓ public SEO checks if public page.
6. Task format для Codex/Qwen
TASK ID:
M44-XXX
GOAL:
one concrete outcome
CONTEXT:
relevant architecture/policy
FILES:
allowed paths
DEPENDENCIES:
previous task IDs
IMPLEMENT:
exact behavior
DB:
tables/migrations
API:
routes/contracts
UI:
screens/components
TESTS:
required cases
SECURITY:
checks
OBSERVABILITY:
metrics/logs
DONE:
acceptance criteria
DO NOT:
explicit exclusions.
7. Правило размера задачи
Одна задача должна помещаться в один осмысленный pull request.
GOOD:
"Add organizations table,
aliases table,
repository and GET /companies/{slug}"
BAD:
"Build Entity Graph"
GOOD:
"Implement publication state transition
DRAFT → REVIEW"
BAD:
"Build CMS".
8. Этапы реализации
| Этап | Результат | Business milestone |
|---|---|---|
| 0 Foundation | Repo, infra, auth, DB, observability | Можно безопасно писать продукт |
| 1 Identity | Company/entity/source | Компания существует в системе |
| 2 Publishing | Draft → article → SSR | Матчасть выглядит как медиа |
| 3 AI Editorial | Writer/critic/verifier/policy | Routine content автоматизирован |
| 4 Commerce | Order/payment | Можно взять первые деньги |
| 5 Proof | Publication Health/Search | Есть доказательство результата |
| 6 AI Visibility | Prompt runs/citations | Ключевая дифференциация |
| 7 Report/Action | Before/After + NBA | Замыкается repeat loop |
| 8 Hardening | Security/backup/monitoring | Можно масштабировать пилот |
| 9 Agency | Multi-client | Мультипликатор продаж |
9. Этап 0 — Bootstrap
M44-001 — Инициализировать monorepo
Create:
apps/web
apps/api
apps/worker
packages/*
infra/*
policies/*
prompts/*
evals/*
docs/*
scripts/*
Add:
README
AGENTS
Makefile
.editorconfig
.gitignore
CI skeleton.
M44-002 — Docker development stack
Services:
postgres
redis
minio
api
web
worker
mail catcher optional
Acceptance:
make dev
starts clean environment.
M44-003 — Environment/config package
Typed config:
APP_ENV
DATABASE_URL
REDIS_URL
MINIO_*
OIDC_*
PUBLIC_URL
Fail fast on missing config.
M44-004 — CI baseline
Run:
Python lint/type/test
TS lint/type/test
migration sanity
container build
secret scan.
10. Этап 0 — Database foundation
M44-005 — PostgreSQL cluster conventions
Create schemas:
identity
graph
content
trust
workflow
commerce
measurement
workspace
audit
system.
M44-006 — UUIDv7 / timestamps / enums conventions
Rules:
UUIDv7 primary IDs
timestamptz UTC
created_at
updated_at
explicit lifecycle enum.
M44-007 — Audit Event base
audit.audit_events:
id
actor_type
actor_id
workspace_id
action
object_type
object_id
before_json
after_json
reason
created_at.
M44-008 — Transactional Outbox
system.outbox_events:
id
event_type
aggregate
payload
created_at
published_at
attempts
error.
11. Этап 0 — Auth / Workspace
M44-009 — Authentik OIDC client
Create:
prod/staging app
callback
session
logout
Test:
login/logout/session expiry.
M44-010 — User profile
workspace.users:
id
auth_subject
email
name
status
created_at.
M44-011 — Workspace / Membership
workspaces
memberships
roles
Initial roles:
OWNER
ADMIN
EDITOR
VIEWER.
M44-012 — Permission service
Function:
can(user, action, resource)
No:
permission logic duplicated in routers.
M44-013 — RLS baseline
Private tables:
workspace_id
RLS policy
Test:
A cannot read B
direct UUID attack.
12. Этап 0 — Observability baseline
M44-014 — Structured logging
JSON logs:
service
request_id
trace_id
job_id
level
event
error_code.
Automatic secret redaction.
M44-015 — /health and /metrics
/health/live
/health/ready
/metrics
Prometheus scrape.
M44-016 — Prometheus/Grafana/Loki
Initial dashboard:
web
api
postgres
redis
workers.
M44-017 — external black-box
Probe:
/
known canary page
TLS
DNS.
13. Этап 1 — Entity / Company
M44-020 — Organization table
identity.organizations:
id
canonical_name
legal_name
description
country
status
current_slug.
M44-021 — Entity aliases
entity_aliases:
entity_id
alias
language
alias_type
active.
M44-022 — Official domains
official_domains:
organization_id
domain
verification_state
verified_at
method.
M44-023 — Entity identifiers
identifiers:
entity_id
type
value
source
verified.
M44-024 — Sources
graph.sources:
id
url
publisher
source_type
retrieved_at
status
hash.
M44-025 — Claims
claims:
subject_entity
predicate
value
state
valid_from
valid_to
claim_sources:
claim_id
source_id
support_type.
M44-026 — Relations
relations:
subject
relation_type
object
state
sources.
M44-027 — Public company API
GET /api/v1/public/companies/{slug}
Returns:
identity
domains
verified facts
experts
publications.
M44-028 — Company SSR page
Route:
/companies/{slug}
Includes:
name
description
verification
facts
sources
publications
JSON-LD.
M44-029 — Claim company
Authenticated:
request claim
email/domain proof
state machine:
PENDING
VERIFIED
REJECTED
DISPUTED.
14. Этап 1 — Verification automation
M44-030 — Domain verification
Methods:
email domain
DNS token optional
website token optional
Auto:
verify
audit.
M44-031 — Public-source verifier agent
Input:
company/domain
Agent:
find official pages
extract identifiers
extract key claims
Output:
candidates only.
M44-032 — Claim evidence scorer
Deterministic:
source type
official status
conflict
freshness
States:
VERIFIED
SUPPORTED
UNVERIFIED
CONFLICTED.
M44-033 — Verification exception queue
Only:
conflicts
ownership disputes
low confidence
high-risk identity changes.
15. Этап 2 — Publication data model
M44-040 — Publications
content.publications:
id
type
title
slug
status
author
company
published_at
current_version_id
commercial_classification.
M44-041 — Publication versions
publication_versions:
publication_id
version
content_json
change_reason
created_by
created_at.
M44-042 — Content blocks schema
Blocks:
paragraph
heading
quote
image
chart
table
callout
source
entity
code
list.
M44-043 — Publication entity links
publication_entities:
publication
entity
role
confidence
confirmed.
M44-044 — Topic model
topics
publication_topics
topic relations later.
M44-045 — Citation/link model
links:
url
target_type
commercial_relation
rel_policy
source_reference.
16. Этап 2 — CMS
M44-046 — Draft API
POST /workspace/publications
GET
PATCH version
preview
submit.
M44-047 — Structured editor
P0:
title
dek
blocks
sources
entities
hero
No:
full WordPress clone.
M44-048 — Version diff
Show:
text changes
source changes
commercial/status changes.
M44-049 — Preview page
Signed/private
noindex
same renderer
as public article.
M44-050 — Publication state machine
DRAFT
→ AI_REVIEW
→ POLICY_CHECK
→ EXCEPTION optional
→ APPROVED
→ PUBLISHED
→ UPDATED
→ ARCHIVED.
17. Этап 2 — Public article
M44-051 — Article SSR
/articles/{slug}
Render:
headline
dek
author
company
disclosure
body
sources
entities
related.
M44-052 — Canonical / redirects
slug_history
301 old slug
one canonical.
M44-053 — JSON-LD
Article
Organization
Person
Breadcrumb
as applicable
Same PageViewModel
as HTML.
M44-054 — Sitemap generator
canonical
public
indexable
substantive lastmod.
M44-055 — OG/social renderer
1200×630
template version
title
format
brand.
18. Этап 3 — AI Tool Gateway
M44-060 — AI provider abstraction
Adapters:
LOCAL_QWEN
EXTERNAL_A
EXTERNAL_B
Uniform:
generate()
structured_generate()
embed().
M44-061 — Prompt Registry
prompt_id
task_type
version
template
input_schema
output_schema
provider_policy
active.
M44-062 — AI run ledger
model
prompt version
input hash
output
usage
latency
cost
status
workspace
data class.
M44-063 — Typed Tool Gateway
Tools:
read_publication
read_sources
write_precheck
suggest_entities
create_brief
No shell.
No arbitrary SQL.
M44-064 — Tool policy engine
task
service principal
allowed tools
workspace bound
risk class
audit.
M44-065 — Data routing policy
PUBLIC:
external/local
CLIENT_PRIVATE:
local default
SENSITIVE:
local/redacted
SECRET:
never model.
19. Этап 3 — AI editorial agents
M44-066 — Researcher agent
Input:
brief + sources
Output:
facts
source map
unknowns
questions.
M44-067 — Writer agent
Input:
verified fact package
style guide
content type
Output:
structured draft.
M44-068 — Critic agent
Independent:
clarity
claims
unsupported statements
commercial bias
duplication.
M44-069 — Source verifier
Every material claim:
source relation
evidence state
flag unsupported.
M44-070 — Policy classifier
Commercial?
Advertising?
Partner?
High-risk?
Personal data?
Regulated?
Returns:
classification + rule IDs.
M44-071 — AI editorial orchestrator
research
→ writer
→ critic
→ verifier
→ policy
→ deterministic validators
→ auto/exception.
20. Этап 3 — Deterministic validators
M44-072 — Link policy validator
commercial link
→ sponsored
identity/editorial
→ correct rel.
M44-073 — Disclosure validator
commercial classification
must match visible disclosure.
M44-074 — Source coverage validator
Material factual claims
must be supported
or explicitly framed.
M44-075 — Duplicate/content similarity
FTS/vector candidate
→ duplicate score
→ policy threshold.
M44-076 — Security input validator
prompt injection patterns
PII/secrets
unsafe embeds
malicious URLs.
21. Этап 3 — AI evals
M44-077 — Editorial gold set
20–50 examples:
good/bad
unsupported
commercial
case
research
style.
M44-078 — Security eval set
prompt injection
tool abuse
PII
secret
cross-tenant
fake citation.
M44-079 — Model change gate
Any prompt/model update:
run eval
compare
canary
rollback.
22. Этап 4 — Commerce
M44-090 — Product SKU
PUBLISH
price
currency
included features
active_from.
M44-091 — Orders
order:
workspace
client_entity
payer
advertiser
status
price_snapshot.
M44-092 — Payment adapter
Provider abstraction:
create_payment
verify_webhook
refund later.
M44-093 — Payment webhook
signature
idempotent
captured
failed
refunded.
M44-094 — Order workflow binding
PAID
→ publication entitlement/workflow
No payment:
cannot final commercial publish.
M44-095 — Refund exception
P0:
human/high-risk
reason
audit
provider action.
23. Этап 5 — Publication Health
M44-100 — Health crawler
Checks:
HTTP
canonical
robots
noindex
schema
assets
disclosure
links.
M44-101 — Health snapshot
publication_id
checked_at
check_name
state
details
severity.
M44-102 — Publish event orchestration
PublicationPublished
→ cache invalidation
→ sitemap
→ IndexNow
→ OG
→ health
→ measurement schedule.
M44-103 — IndexNow adapter
event-driven
response logged
retry
does not imply indexed.
M44-104 — Health timeline UI
Published
Technical Ready
Crawler Observed
Search Observed.
24. Этап 5 — Search Proof
M44-105 — GSC connector
URL Inspection
Search Analytics
source freshness
quota
data cutoff.
M44-106 — Yandex Webmaster connector
URL state
search stats
reindex where appropriate
quota/freshness.
M44-107 — Search observation model
engine
URL
observed_at
state
impressions
clicks
queries
source metadata.
M44-108 — Search Proof UI
No SEO score.
Show:
state
timeline
impressions
clicks
queries
last sync.
25. Этап 6 — AI Visibility
M44-120 — Prompt Set
prompt_sets:
id
entity
version
language
region
locked_at.
M44-121 — Prompt records
text
type
intent
brand_status
priority
source
active.
M44-122 — Competitor Set
fixed version
entity IDs
valid from.
M44-123 — Provider adapters
Start:
2–3 providers
Each:
request
normalize
citations
metadata
error/freshness.
M44-124 — AI Run scheduler
baseline
weekly/daily later
replicates
priority
quota.
M44-125 — Answer store
answer
provider
model/mode
run
eligible
error class
raw policy.
M44-126 — Mention resolver
aliases
context
entity match
false-positive eval.
M44-127 — Citation extractor
URL
domain
watched URL?
Mathchast?
source class.
M44-128 — Recommendation prominence
PRIMARY
SHORTLIST
MENTION
CAVEAT
CITATION_ONLY.
M44-129 — Metric engine
Mention Rate
Recommendation Rate
SoV
Citation Rate
Mathchast Citation Rate
coverage.
M44-130 — AI Visibility dashboard
Top:
core metrics
Then:
platform matrix
sources
watched URLs
prompts.
26. Этап 7 — Before / After
M44-140 — Measurement Protocol
scope
intervention
prompt set version
competitor set
platforms
region
language
primary outcome
baseline/post windows.
M44-141 — Intervention event
PUBLICATION
SUBSTANTIVE_UPDATE
DISTRIBUTION
PROFILE_VERIFICATION.
M44-142 — Metric Delta
pre
post
absolute
pp
relative optional
numerator
denominator.
M44-143 — Prompt transitions
ABSENT→PRESENT
PRESENT→PRESENT
PRESENT→ABSENT
ABSENT→ABSENT.
M44-144 — Evidence grade
OBSERVED
TEMPORALLY_ASSOCIATED
COMPARATIVE
QUASI_EXPERIMENTAL
EXPERIMENTAL.
M44-145 — Confounder annotations
PR campaign
product launch
model update
search update
competitor action
site deploy.
27. Этап 7 — Report
M44-146 — Report snapshot
immutable:
data cutoff
methodology version
metrics
sources
limitations
generated_at.
M44-147 — HTML report
Sections:
scope
what changed
Search Proof
AI Visibility
sources
limitations
next action.
M44-148 — PDF renderer
async
print-safe
stored in MinIO
versioned.
M44-149 — Report data-quality gate
Before send:
coverage
freshness
provider changes
missing source
math validation.
28. Этап 7 — Next Best Action
M44-150 — Gap detectors
absence gap
citation gap
source gap
fact gap
case gap
expert gap.
M44-151 — Recommendation rules
Rule:
conditions
evidence
action_type
priority
blocking conditions.
M44-152 — Recommendation types
CREATE_ARTICLE
CREATE_CASE
UPDATE_PAGE
VERIFY_CLAIM
ADD_EXPERT
EARN_MEDIA
FIX_FACT.
M44-153 — Recommendation explainer
LLM:
turn rule result
into clear rationale/brief
Cannot:
change evidence/priority silently.
M44-154 — Recommendation UI
Action
Why
Evidence
Needs
Expected measurable outcome
[Create brief].
29. Этап 8 — Automation exceptions
M44-160 — Human Exception model
type
risk
reason
evidence
recommendation
deadline
decision
resolved_by.
M44-161 — Exception dashboard
Only:
items needing decision
Filters:
security
legal
identity
content
billing.
M44-162 — Adaptive sampling
Sample auto-approved output
by:
content type
model version
risk
error history.
M44-163 — QA outcome taxonomy
FACT_ERROR
SOURCE_ERROR
STYLE
POLICY
ENTITY
SECURITY
NO_ERROR.
M44-164 — Eval feedback loop
QA error
→ gold set
→ prompt/rule fix
→ canary
→ rollout.
30. Этап 8 — Backup/security
M44-170 — Production network hardening
Only 80/443 public
SSH via VPN/allowlist
DB/Redis/MinIO private.
M44-171 — Container hardening
non-root
cap_drop
no privileged
no Docker socket
read-only FS where feasible.
M44-172 — Upload quarantine
type
size
malware
parser isolation
image re-encode.
M44-173 — SSRF protection
block private IP
redirect recheck
port allowlist
timeouts
size limits.
M44-174 — Backup
pgBackRest:
WAL
daily diff
weekly full
repos:
local HDD
off-host encrypted.
M44-175 — Automated restore test
monthly:
restore isolated
run integrity
smoke app
record result.
31. Этап 8 — Monitoring
M44-180 — Queue metrics
depth
oldest age
retry
dead-letter
processing.
M44-181 — Provider health
success
latency
429
5xx
schema
coverage
cost.
M44-182 — Canary article
External monitor:
HTTP
content marker
canonical
TLS.
M44-183 — Alert rules
site down
DB down
backup stale
restore failed
queue stale
provider malformed
disk forecast
payment invariant.
M44-184 — Auto-remediation
restart worker
reclaim job
circuit breaker
safe cleanup
rollback bad deploy.
M44-185 — Incident record/runbooks
auto timeline
severity
actions
verification
postmortem.
32. Этап 9 — Agency Lite
M44-200 — Agency organization
agency
members
roles
client workspace links.
M44-201 — Delegation
client entity
agency
scope
granted
revoked.
M44-202 — Client switcher
recent
pinned
needs attention.
M44-203 — Shared credits
batch
allocation
reserve
consume
return.
M44-204 — Agency report branding
logo
cover
intro
Mathchast provenance retained.
M44-205 — Pitch workspace lite
prospect domain
small AI baseline
report
promote to client.
33. Frontend implementation order
1 Design tokens
2 Public shell/header/footer
3 Company page
4 Article
5 Business landing
6 Login/workspace shell
7 Publication editor/status
8 Publication Health
9 AI Visibility
10 Report
11 Next Action
12 Pricing/order
13 Admin exceptions
14 Agency later.
34. Design tokens P0
color:
Paper / Ink / Graphite / Orange
type:
Onest + IBM Plex Mono
space:
4/8/12/16/24/32/48/64
radius:
4/8/12/18
semantic:
bg/text/border/action/status.
35. Core frontend components
Button
Input
Select
Badge
Status
Card
Table
Tabs
Dialog
Toast
SourceCard
EntityChip
VerificationBadge
EvidenceBlock
Metric
ChartShell
RecommendationCard.
36. No custom components before need
Если конкретный экран можно собрать existing primitives, не создавать новый design-system component.
37. Public SEO gate
Every public route:
SSR
canonical
metadata
structured data if applicable
robots correct
sitemap
accessible heading hierarchy
server-visible content.
38. API conventions
/api/v1/public/*
/api/v1/workspaces/{workspace_id}/*
/api/v1/admin/*
/api/v1/webhooks/*
Errors:
code
message
details
request_id.
39. API auth convention
Public:
anonymous
Workspace:
session + membership
Admin:
privileged role + MFA policy
Webhook:
signature/idempotency.
40. Database migration conventions
Additive first
backfill
switch reads/writes
constraint
remove later
No:
large destructive migration
inside deploy blindly.
41. Background job convention
Job:
id
type
payload
workspace
priority
attempt
idempotency
timeout
Worker:
validate
execute
record
ack.
42. Queue groups
stream:content
stream:crawler
stream:measurement
stream:ai
stream:report
stream:integration.
43. Priority classes
P0:
security/payment/publish
P1:
client report/high-priority AI
P2:
crawler/normal measurement
P3:
backfill/embeddings/experiments.
44. n8n use
Allowed:
CRM sync
Telegram
email workflow
lead enrichment
internal admin integration
Forbidden:
core publication state
payment truth
verification truth
AI metric truth.
45. Qwen use in production
Default:
private drafting
source extraction
classification
summarization
recommendation explanation
code/internal ops assistant
External model:
only when quality gain
and policy allows.
46. Qwen use in development
Routine:
tests
CRUD
docs
fixtures
refactor
lint fixes
Strong external coding model:
architecture-critical
complex bugs
security-sensitive review.
47. Multi-agent development pattern
Coordinator:
selects task
Agent A:
backend
Agent B:
frontend
Agent C:
tests/security
Agent D:
docs/evals
Merge only:
after shared contracts
and CI green.
48. Do not parallelize database ownership
Two agents editing same migration chain or same domain aggregate without coordination is forbidden.
49. Branching
main:
always deployable
feature:
small
short-lived
PR:
tests
self-review
AI review
merge.
50. Commit discipline
One coherent change
clear message
migration with feature
tests with feature
No:
"misc fixes"
100-file random commit.
51. Staging
Separate:
DB
Redis
buckets
OIDC client
provider keys
domain
Never:
prod private data copied casually.
52. Production release checklist
CI green
migration reviewed
backup healthy
staging smoke
security gate
deploy
canary
metrics
rollback available.
53. First deployment milestone
Own editorial article on mathchast.com rendered from real CMS/database.
54. Second deployment milestone
Real company profile linked to real article and sources.
55. Third deployment milestone
Paid pilot company passes end-to-end workflow.
56. Fourth milestone
+30 report produces an evidence-backed next action.
57. First 30 days
| Week | Build | Visible result |
|---|---|---|
| 1 | Repo, DB, Auth, Workspace, Ops | Login + empty workspace |
| 2 | Company, sources, claims | Public company page |
| 3 | Publication model/editor/SSR | First real article |
| 4 | AI editorial + policy | AI-assisted publication |
58. Days 31–60
| Week | Build | Visible result |
|---|---|---|
| 5 | Commerce | Paid order possible |
| 6 | Publication Health | Proof timeline |
| 7 | GSC/Yandex | Search Proof |
| 8 | AI Visibility adapters | Prompt dashboard |
59. Days 61–90
| Week | Build | Visible result |
|---|---|---|
| 9 | AI metrics/source analysis | Baseline report |
| 10 | Before/After | +30 comparison |
| 11 | Next Best Action | Action brief |
| 12 | Security/monitoring/pilot polish | 5–10 pilot clients ready |
60. Sales runs in parallel
Week 1–2:
build 200-account list
Week 3–4:
20 discovery calls
Week 5:
sell founding pilots
Week 6–8:
first paid workflows
Week 9–12:
reports/repeat.
61. Content runs in parallel
Goal by public launch:
20–50 strong pieces minimum
Goal by commercial acceleration:
50–100
Generated:
AI-first
QA:
sample + evidence gates.
62. Brand runs in parallel
Week 1:
tokens/wordmark prototype
Week 2:
article/company
Week 3:
workspace/report
No:
months of logo polishing.
63. The first pilot offer
FOUNDING VISIBILITY PILOT
Company profile
1 publication
Search Proof
AI baseline/post
+30 report
Next Best Action
Real payment.
Limited founding bonus.
64. Pilot intake
company
domain
contact
goal
topic
facts
sources
expert
advertiser
approval contact.
65. Intake automation
Domain
→ company resolution
→ source discovery
→ public facts
→ suggested brief
→ missing data questions.
66. Brief generation
AI asks only:
what cannot be found
or safely inferred.
Goal:
5–10 focused questions
not 40-field form.
67. Publication generation
facts/sources
→ research
→ draft
→ critic
→ source validation
→ policy
→ publish candidate.
68. Publication monitoring
publish
→ health
→ search
→ AI observation
→ report
→ action.
69. Pilot completion condition
NOT:
AI visibility must increase
YES:
publication delivered
measurement delivered
methodology valid
client sees next decision.
70. First 10 customers — build freeze rule
После каждого клиента новые feature requests не идут сразу в код.
Classify:
BLOCKER
REPEATED PAIN
ONE-OFF
NICE TO HAVE
WRONG ICP
Only:
blocker/repeated pain
enters near-term roadmap.
71. Product feedback schema
customer
stage
problem
frequency
workaround
severity
requested solution
actual need
decision.
72. Automation metrics from day one
human_minutes/publication
AI_cost/publication
exception_rate
QA_error_rate
time_to_publish
report_cost
AI_run_cost.
73. Gross margin instrumentation
Order:
revenue
Costs:
AI API
GPU estimate
payment fee
human exception minutes
external services.
Contribution:
computed.
74. Why cost tracking is P0
Automation economics is one of the project's core hypotheses; it must be measured, not assumed.
75. Security metrics from day one
privileged MFA %
cross-tenant failures
blocked SSRF
blocked tool calls
secret detections
backup age
restore age.
76. Data-quality metrics
claims verified %
AI run coverage
citation parser success
provider freshness
reports held for data issues.
77. Reliability metrics
availability
p95
queue age
incidents
auto-remediation %
backup
restore.
78. Product metrics
paid workspaces
published
report opened
repeat
monitoring attach
next action accepted
agency second client later.
79. What to show founder daily
PAID
7
PUBLISHED
11
HUMAN EXCEPTIONS
2
AI COST TODAY
₽...
QUEUE
healthy
PROVIDERS
2/3
BACKUP
47m
RESTORE
12d
INCIDENTS
0.
80. What NOT to show founder daily
hundreds of normal jobs
raw logs
all prompts
all health checks
all crawler requests.
81. Admin exception types
IDENTITY
CONTENT
LEGAL
SECURITY
BILLING
PROVIDER
DATA_QUALITY.
82. Exception SLA
Security:
immediate
Payment:
same day
Content:
working hours
Low-risk identity:
1–2 days
But:
mostly automation.
83. AI prompt version control
prompts/
task_name/
v001.md
v002.md
metadata:
schema
model policy
eval score.
84. Policy version control
policies/
editorial.yaml
commercial.yaml
security.yaml
ai-tools.yaml
retention.yaml
Changes:
PR + tests.
85. Rule example
rule_id: COMMERCIAL_LINK_001
when:
publication.commercial = true
link.external = true
then:
require_rel:
- sponsored
severity: blocking.
86. AI tool rule example
task: editorial_precheck
allowed:
- read_publication
- read_source
- write_precheck
forbidden:
- publish
- refund
- shell
- database_admin.
87. Recommendation rule example
rule_id: NBA_CASE_GAP_001
if:
high_value_prompts_absent >= 3
competitors_case_citations >= 2
verified_client_case_exists = true
then:
action = CREATE_CASE
priority = HIGH.
88. No opaque rules
Every automated decision visible internally with rule IDs and evidence.
89. Testing architecture
UNIT
domain rules
INTEGRATION
Postgres/Redis/MinIO
CONTRACT
provider/API
E2E
user loop
SECURITY
tenant/tool/SSRF/upload
EVAL
AI quality.
90. E2E test #1
Create company
→ verify
→ create draft
→ AI review
→ publish
→ public article works.
91. E2E test #2
Create order
→ payment webhook
→ entitlement
→ publish.
92. E2E test #3
Published article
→ health
→ AI run
→ report
→ recommendation.
93. E2E test #4
Agency A user
tries Client B object
→ denied.
94. E2E test #5
External source contains
prompt injection
→ tool gateway blocks
→ no side effect.
95. E2E test #6
Provider returns missing data
→ report marked partial
→ no zero substitution.
96. E2E test #7
Kill worker
→ auto restart
→ queue resumes.
97. E2E test #8
Restore backup
→ app starts
→ critical records match.
98. Seed database fixtures
company_acme
company_long_name_ru
expert_1
article_editorial
article_commercial
article_case
prompt_set_40
competitors_5
report_partial
report_full.
99. No production secrets in fixtures
Obvious, but must be in AGENTS.md.
100. Search architecture implementation
P0:
exact
prefix
trigram
FTS
P1:
vector semantic
Order:
entity exact first.
101. pgvector first use
duplicate candidate detection
topic similarity
source similarity
Not:
critical identity truth.
102. Crawler P0
HTTP fetch
robots policy
timeouts
redirects
content hash
canonical
source metadata.
103. Browser fallback P1
Only for public pages that truly require JS.
104. Media pipeline P0
upload
validate
quarantine
image re-encode
AVIF/WebP
OG crop
MinIO.
105. AI visual pipeline P1
prompt spec
Comfy/model
render
provenance
editorial approval/rule
derivatives.
106. Procedure graphics P1
static generator first
motion second
Inputs:
topic/data
Outputs:
SVG/canvas/rendered video.
107. Email P0
transactional:
login/invite if needed
approval
report
security
Provider adapter
not self-host mail server.
108. Telegram P0/P1
Internal:
critical alerts
ops notifications
External:
editorial distribution later.
109. Sitemap strategy
sitemap index
articles
companies
experts
topics
Generate:
event-driven
static serve.
110. Robots strategy
Public:
allow indexable
Preview:
noindex
Staging:
blocked/noindex
AI crawlers:
explicit policy
documented.
111. Launch checklist — technical
✓ domain/TLS
✓ SSR
✓ canonical
✓ sitemap
✓ robots
✓ JSON-LD
✓ auth
✓ DB backup
✓ restore test
✓ external monitor
✓ payment
✓ health
✓ AI provider policy
✓ audit
✓ privacy pages.
112. Launch checklist — business
✓ offer
✓ one SKU
✓ invoice/payment
✓ founding customer terms
✓ editorial policy
✓ commercial policy
✓ methodology
✓ support contact
✓ first 5 prospects.
113. Launch checklist — content
✓ homepage not empty
✓ 20+ strong pieces minimum
✓ several company profiles
✓ methodology
✓ flagship research/case
✓ topic structure.
114. Launch checklist — automation
✓ writer
✓ critic
✓ source verifier
✓ policy classifier
✓ tool gateway
✓ eval set
✓ exception queue
✓ audit.
115. Launch checklist — reliability
✓ site external probe
✓ queue monitor
✓ provider health
✓ disk alerts
✓ backup alert
✓ second critical channel
✓ runbooks.
116. Founder daily operating loop
09:00
exception queue
09:15
sales pipeline
09:30
product/reliability health
Then:
build/sales
No:
manual article production queue.
117. Weekly product review
paid
repeat
exceptions
AI QA errors
cost
incidents
feature blockers
client feedback.
118. Weekly AI review
model performance
prompt changes
eval score
security failures
API cost
local GPU usage
automation rate.
119. Weekly reliability review
availability
error budget
queue
backups
restore
incidents
pages/noise.
120. Monthly roadmap review
Which hypothesis passed?
Which failed?
What repeated?
What should be deleted?
What P1 is now justified?
121. The backlog categories
NOW
NEXT
LATER
PARKED
REJECTED
Not:
everything "planned".
122. Feature admission rule
A feature enters NEXT if:
blocks revenue
or
3+ ICP customers need it
or
reduces major human toil
or
reduces major risk.
123. Otherwise
Park it.
124. Stop conditions
STOP scaling if:
repeat weak
automation poor
margin bad
security unreliable
backup untested
human queue growing
AI metrics distrusted.
125. Acceleration conditions
ACCELERATE if:
clients repeat
agency adds second client
monitoring renews
human exceptions fall
gross margin healthy
SLO healthy.
126. When to add first employee
Not because:
"startup needs team"
Add when:
founder is bottleneck
in repeatable commercial/operator work
and revenue supports role.
127. First likely hire
Commercial/operator or account/product generalist is likely more useful than a large editorial hire, because AI should absorb editorial throughput.
128. When to add engineer
When:
AI-assisted solo build
becomes bottleneck
or
operations/quality
needs ownership.
129. When to add human editor
Only if:
exception volume
and quality risk
justify
Role:
policy/quality lead
not article factory.
130. Agency phase entry gate
Single-client flow:
works repeatedly
Tenant isolation:
tested
Credits:
needed
At least:
2 real agency design partners.
131. Reputation phase entry gate
Need:
verified entities
claim/source graph
dispute workflow
moderation automation
real demand.
132. Rating phase entry gate
Need:
independent reviews at scale
fraud control
methodology
legal maturity
Likely P3.
133. International phase entry gate
Russian market:
working economics
Then:
English
payments
legal
AI regions
localization.
134. Infrastructure scaling gate
Measure first:
CPU
DB
queue
GPU
availability
Then:
extract worker/host.
135. First likely infrastructure extraction
GPU worker
or crawler/browser
to second host.
136. No architecture rewrite before metric
No «нам скоро нужен Kubernetes» without concrete failure/scale requirement.
137. Documentation hierarchy
Docs 1–43:
product/research reference
Doc 44:
implementation authority
AGENTS.md:
daily developer authority
Policies:
runtime authority
ADR:
architecture decisions.
138. Conflicts between docs
Priority:
latest explicit decision
→ Doc 44
→ relevant specialized doc
→ older research.
Record:
ADR/policy update.
139. Code should not depend on reading 44 HTML docs
Extract runtime-critical decisions into repository files before coding each area.
140. First extraction set
AGENTS.md
architecture.md
editorial.yaml
commercial.yaml
security.yaml
ai-tools.yaml
data-classification.yaml
retention.yaml
metrics.md.
141. Recommended first prompt to coding AI
Read AGENTS.md and docs/architecture.md.
Do not change architecture.
Implement task M44-001 only.
Before coding:
list files to create/change.
After coding:
run required tests.
Report:
files changed,
tests,
remaining risks.
Do not implement future tasks.
142. Coordinator prompt pattern
You are the implementation coordinator.
1. Read current task.
2. Verify dependencies.
3. Inspect existing code.
4. Produce minimal plan.
5. Assign bounded subtask if useful.
6. Implement.
7. Run tests.
8. Run security checks.
9. Update task state.
10. Stop.
143. Why explicit stop
AI agents tend to «helpfully» expand scope. Stopping after the task protects architecture and reviewability.
144. Progress tracking
tasks/
M44-001.md
M44-002.md
...
Fields:
status
owner/agent
started
completed
commit
tests
notes.
145. Status enum
TODO
READY
IN_PROGRESS
BLOCKED
REVIEW
DONE
DEFERRED.
146. Dependency graph in task metadata
id: M44-067
depends_on:
- M44-061
- M44-066
blocks:
- M44-071.
147. Automated task selection
Coordinator:
find READY tasks
whose dependencies DONE
sort by critical path
assign agent.
148. Critical path tasks
001
→ 005
→ 009
→ 020
→ 040
→ 050
→ 060
→ 071
→ 090
→ 100
→ 120
→ 146
→ 150
→ PILOT.
149. Parallelizable tasks
Design tokens
Monitoring infra
Seed content
GTM prospecting
Prompt/eval preparation
Legal/policy text
can run alongside core.
150. What cannot block pilot
perfect logo
advanced search
agency white-label
ratings
mobile app
7 AI providers
fancy procedural motion.
151. What can block pilot
wrong data
broken auth
payment failure
unsafe AI tool
no backup
no public article
no measurement
no report.
152. First paid customer target date
Planning target: as soon as Sprint 5–7 core is usable; do not wait for full 90-day polish. A concierge pilot can use internal/admin tooling while public/client surfaces remain narrow.
153. First 10 customers target
Aim:
~90–120 days
if build + sales cadence holds
But:
quality/repeat > calendar.
154. What we learn from first 10
best ICP
best first SKU
what report matters
monitoring value
automation cost
agency potential
actual objections.
155. P1 backlog after first 10
Agency Lite
Recurring Billing
References
Case confirmation
Reader follow/save
Scheduled reports
Better distribution
More Next Actions.
156. P2 backlog after first 30
API
SSO/SCIM
advanced agency
white-label
fact accuracy
advanced reputation
read replica
CDN
external integrations.
157. P3 backlog after first 100
ratings
rankings
benchmarks
partner directory
advanced research data products
international
multi-region
HA enterprise.
158. Final anti-scope list
DO NOT BUILD NOW:
social network
open comments
third-party placement marketplace
100 industries
full CRM
mobile app
Kubernetes
Kafka
Neo4j
Elasticsearch
ClickHouse
7 provider connectors
ranking score
reviews marketplace
autonomous root agent.
159. Final technical success criterion
One command can deploy a version; one test suite can prove key invariants; one backup can restore the product; one company can complete the entire paid loop without founder editing database rows.
160. Final business success criterion
After receiving the first report, a client decides to take a second paid action because Mathchast produced useful evidence.
161. Final automation success criterion
Routine publication and measurement work passes through AI + rules with humans seeing only exceptions and QA samples.
162. Final product success criterion
Company
↓
Article
↓
Proof
↓
AI
↓
Report
↓
Action
↓
Repeat.
163. Stop reading, start building
Docs 1–43 дали нам достаточно информации, чтобы перестать проектировать платформу в теории. Следующий правильный артефакт — не ещё одно исследование, а репозиторий с M44‑001.
164. Рекомендуемый порядок первых 15 задач
M44-001 Monorepo
M44-002 Docker dev
M44-003 Config
M44-004 CI
M44-005 DB schemas
M44-006 ID conventions
M44-007 Audit
M44-008 Outbox
M44-009 Authentik
M44-010 User
M44-011 Workspace
M44-012 Permissions
M44-013 RLS
M44-014 Logging
M44-015 Health/Metrics
165. Затем
M44-020 Company
M44-024 Sources
M44-025 Claims
M44-028 Company page
M44-040 Publication
M44-046 Draft API
M44-050 State Machine
M44-051 Article SSR
M44-060 AI adapter
M44-071 Editorial Orchestrator.
166. Затем
M44-090 Commerce
M44-100 Health
M44-105 Search Proof
M44-120 Prompt Set
M44-123 AI Providers
M44-129 Metrics
M44-146 Report
M44-150 Next Action
M44-174 Backup
M44-183 Alerts.
167. Decision
Утвердить Doc 44 как implementation authority и начать разработку с M44‑001. Все будущие решения должны либо помогать critical path к первому paid end-to-end loop, либо откладываться. Основная организационная единица разработки — атомарная задача с ограниченным scope, dependency list, tests, security, observability и Definition of Done. Qwen/Codex работают через repository rules and typed tasks; routine coding, editorial production, measurement and operations максимально автоматизируются. Humans remain responsible for architecture/policy changes, exceptional legal/security situations and sampling QA. После появления первого working vertical slice начинается paid pilot before broad platform expansion. Это завершает проектирование «Матчасти» и переводит проект в фазу реализации.
168. Первый реальный шаг после документа
CREATE REPOSITORY
↓
WRITE AGENTS.md
↓
IMPLEMENT M44-001
↓
M44-002
↓
...
↓
FIRST ARTICLE
↓
FIRST CLIENT
↓
FIRST REPORT
↓
FIRST REPEAT.