МАТЧАСТЬMASTER PLAN 15 · WORK CONTROL CENTER & OPERATIONS

Порядок выполнения уточнён

Эта глава входит в готовый комплект из 26 документов. Статус реализации хранится в журнале; требования главы сами по себе не являются выполненной работой.

[15.1] OPS-01 — карточка выполнения. Весь план и его состояние.

Уточнения для этой главы

[15.0.14] F0-05 проверяет переносимость в независимых clean clones. Проверка двух реальных учётных записей отмечается отдельно и доказывается OPS-10, когда второй оператор доступен. Тест двух clones под одним SSH-пользователем нельзя назвать проверкой двух операторов.

[15.0.15] Журнал задач реализации — docs/masterplan-execution/state.json в Git. Это не runtime очередь статей. Текущая задача, доказательства, handoff и страницы Work строятся из этого журнала. Старый aw001-packet/razraba state относится только к Supereditor и не управляет M2.

[15.0.16] После каждого задания сохранять результат и выбирать следующий доступный шаг автоматически. Не требовать подтверждения каждого перехода. При истинной внешней зависимости записать точный блокер с проверками; продолжить независимые готовые задачи. Не объявлять долгую работу или смену чата блокировкой.

Mathchast / Work Control Center & Operations / 15

SEE
THE WHOLE
SYSTEM.

Оператору нужен один экран, где видно, что система делает, где застряла, что требует решения и что произошло последним.

Work — control plane и projection layer. Он управляет существующими Git/PostgreSQL/artifact authorities, но не становится второй скрытой базой правды.

WORK CONTROLS THE SYSTEM. IT DOES NOT BECOME THE SYSTEM OF RECORD.
Project State + queues + approvals + blockers + settings + health + audit + operator actions.

One control center.
Many canonical backends.

Work должен давать целостную картину проекта и безопасные operational actions: запуск, pause, retry, cancel, approve, review, settings changes, diagnostics and handoff — при этом все canonical states остаются в своих authoritative systems.

PRIMARY OUTCOME
Operational clarity.

На одном месте видны pipeline stage, next action, blocker, owner, last event, config version/hash and release status.

PROJECT STATE
Durable snapshot.

Сводка branch/SHA/tasks/tests/deploy/blockers/artifacts/settings revision and next exact action обновляется примерно раз в 60 минут.

CONTROL
Validated actions.

Work вызывает canonical services/APIs; UI не пишет напрямую в random tables/files and does not bypass state machines.

COLLABORATION
Two operators, one truth.

Два Windows-оператора работают через независимые clones одной private remote and shared canonical backend, с явной provenance действий.

BoundaryWork не создаёт «удобную копию» article/source/release state, которая со временем начинает расходиться с PostgreSQL/Git/artifacts.

Audit the control plane
before redesigning it.

WORK / OPERATIONS AUDIT Known: Work URL: https://work.mathchast.com/ Work root: WORK_ROOT Inspect: 1. Current Work pages / routes / APIs / JS. 2. Existing article/source/task/settings/project state views. 3. editorial.task / task_event / workflow / d15_writer_task. 4. platform.project / platform.audit_event. 5. Existing health/status endpoints and scripts. 6. Current settings UI / config files. 7. HANDOFF.md / Project State export mechanism. 8. Authentication / authorization boundaries. 9. Any live operator runbooks. 10. Tests / screenshots / consumers. Classify every capability: REUSE → EXTEND → WRAP → MIGRATE → NEW Only after audit freeze page/module/API names.
✓
Reuse `platform.project` for project identity/scope if audit confirms fit.
✓
Reuse/extend `platform.audit_event` and existing task events rather than inventing Work-only audit logs.
✓
Reuse canonical Settings service from branch 3.4; Work is its UI.
×
Не создавать Work-local copies of queues/articles/releases as primary truth.

What is true
right now?

PROJECT STATE SNAPSHOT project id / name git branch commit SHA working-tree state if relevant pipeline active article count stage distribution failed / blocked / waiting review tests last known relevant suites + result deploy current production release id latest successful deploy rollback target settings revision / config hash health queues / workers / DB / disk / site blockers[] recent critical events[] artifacts[] next_exact_action generated_at generator_version
CADENCE
Initial refresh target ≈ 60 minutes, configurable. Critical event views are live/event-driven where available; Project State is the durable periodic summary.
NO AUTO COMMIT
Hourly exporter must not auto-commit to Git just to record a timestamp.
HANDOFF
Root `HANDOFF.md` remains human-readable durable handoff. Work Project State can render/export from canonical data plus Git state.
NEXT ACTION
Every snapshot should name one precise next executable action, not a vague "continue implementation".

From Radar
to released URL.

ARTICLE / CANDIDATE TIMELINE RADAR OBSERVATION → TREND / OPPORTUNITY → DUPLICATE GUARD → RESEARCH PACK → WRITER → ARTICLE BUILDER → FACT / ORIGINALITY → IMAGE DIRECTOR → KNOWLEDGE LINKS → SEO → RELEASE QUEUE → RELEASED → INDEX / TRAFFIC / LEARNING For each stage show: status current version started / last event owner / worker attempt config_hash blocker artifacts next allowed actions
NO FAKE LINEARITY
UI must show loops: NEED_MORE_RESEARCH, QA rewrites, retries, rollback, review states and superseded versions.
ARTIFACTS
Direct links to Research Pack, Writer outputs, Article Package, QA reports, visual package, SEO report and release manifest.
RELATIONS
NEW/FOLLOW_UP/UPDATE_EXISTING and parent/update target visible explicitly.

Actions follow
state machines.

ActionRules
START / ENQUEUEOnly when canonical stage allows; captures actor/reason/config snapshot.
PAUSEStops future scheduling/claims where supported; does not corrupt active transaction.
RETRYUses stage-specific idempotent retry path; no manual duplicate job.
CANCELExplicit cancellation event; running worker termination only where safe and supported.
APPROVEPins exact package/release hash; permissioned and audited.
REJECT / SEND BACKReason required; routes to explicit owning stage.
TAKEOVEROnly for expired/stale writer/worker claim using canonical lease semantics.
ROLLBACKCalls Deployer rollback path; never ad hoc filesystem repair.
CHANGE SETTINGSPreview → validation → revisioned commit with expected revision and reason.
UI ruleIf an action is illegal in the current canonical state, Work should not merely gray it out cosmetically — the backend service must reject it too.

Review only where
human judgment is required.

RELEASE REVIEW
Review-mode publication with article preview, QA/SEO status, update diff, image set and exact package hash.
AMBIGUOUS DUP
Duplicate Guard `NEED_REVIEW` cases with comparison pack and reason codes.
QA REVIEW
Unresolved critical fact/originality ambiguity after bounded automated cycles.
SOURCE / RIGHTS
Ambiguous source discovery or image rights cases where policy requires human decision.
RISKY SETTINGS
MIGRATION_REQUIRED / DRAIN_REQUIRED / high-impact config changes may require elevated approval.
EXACT OBJECT
Every approval binds to immutable object/hash/revision, so later mutation invalidates it automatically.

Show what failed.
Show what fixes it.

BLOCKER RECORD / VIEW blocker_id object_type / object_id stage severity reason_code human_summary technical_detail_ref first_seen last_seen owner_stage owner? retryable next_allowed_actions[] dependency? related_event_ids[] status = OPEN | ACKNOWLEDGED | RESOLVED | SUPERSEDED
OWNER STAGE
Work routes blocker back to actual owner: Research, Writer, QA, Image, SEO, Deployer etc.
NO GENERIC FAIL
"FAILED" без reason code/next action is operationally insufficient.
RESOLUTION
Resolved blocker retains history; same recurring reason can be measured across the system.

Edit configuration
without configuration drift.

READ
Definitions, effective value, default, source/provenance, constraints, current override, change class and last revision.
PREVIEW
Old→new effective diff, validation, affected subsystem and restart/drain/migration implications before commit.
COMMIT
Expected revision + reason + actor; optimistic locking prevents silent overwrite between operators.
HISTORY
Revision diff, actor, reason, config_hash and rollback-as-new-revision.
SECRETS
Show profile/status only; never reveal secret values in Work.

Know when the engine
is degrading.

HEALTH GROUPS PUBLIC SITE availability / smoke marker / current release WORK availability / API health POSTGRESQL connectivity / migrations state / queue pressure indicators STORAGE ARCHIVE_VOLUME SSD_VOLUME /data on SRV1 watermarks: warn ~70 / high ~82 / critical ~92 RADAR due lag / source health / failures WORKERS queue depth / leases / stale jobs / local Qwen health WRITER active claims / stale claims / waiting research RELEASE queue age / failed smoke / rollback state
SUMMARY
Green/yellow/red overview must drill down into measurable evidence, not hide everything behind a single badge.
CRITICAL
Critical disk/release/site/DB conditions surface above editorial backlog noise.
NO DUP METRICS DB
Work reads metrics/health from canonical telemetry/services; it does not invent conflicting counters.

Human and agent actions
must be attributable.

ACTION PROVENANCE operator_id git_author agent_id task_code project_id object_type / object_id action reason git_branch git_sha config_hash request/correlation_id created_at Optional: source Work page / API automation / model route approved_by
TWO OPERATORS
Разные Windows accounts/clones не должны терять attribution when they touch shared backend.
AGENT
Если действие выполнил Zed/Luna/automation, сохранять `agent_id` and task_code without pretending it was a human manual action.
NO COT
Audit stores decision/action/reason/artifact refs, not private chain-of-thought.

Share source of truth.
Not working directories.

REMOTE
Recommended: one private remote repository as canonical Git source-of-truth.
CLONES
Each operator uses an independent clone/worktree rather than sharing one mutable Windows working directory.
BRANCH/SHA
Work Project State shows relevant branch/SHA so collaborators know which code/config state produced tasks/releases.
CONFLICTS
Git conflicts resolved in Git workflow, not by Work silently choosing one local file.
EXPORTER
Project State exporter can write/update snapshot artifacts, but must not commit hourly automatically.

Turn failures
into repeatable recovery.

INCIDENT VIEW
Critical site/deploy/DB/disk/queue event groups timeline, affected objects, release IDs and current mitigation state.
RUNBOOK
Links to exact recovery procedure for rollback, stale writer claim, queue blockage, disk pressure, collector failure, etc.
NO INLINE HEROICS
Work should guide operator to canonical actions; avoid ad hoc SSH/file edits as normal recovery path.
POSTMORTEM SIGNAL
Recurring reason codes and incident outcomes become inputs to reliability improvements and Pilot/Learning stage.

Organize by operations.
Not backend tables.

SurfacePrimary purpose
Overview / Project StateSystem summary, blockers, next action, health, current release, active work.
ArticlesEnd-to-end pipeline timeline, artifacts, relations, QA, release state.
Radar / SourcesCatalog health, runs, observations, discovery, source failures.
CandidatesTrend/Novelty/Opportunity, WHY NOW, Duplicate Guard decisions.
ResearchResearch Packs, versions, gaps, NEED_MORE_RESEARCH loops.
WritersClaims/locks, Luna/external mode, waiting research, stale claims.
QAFact/originality reports, rewrite cycles, reviews.
ImagesVisual directions, rights, attempts, assets, QA.
KnowledgeTerms, pages, links, relink waves.
SEOCanonical/indexability/redirect/report state.
ReleasesQueue, approvals, staging, smoke, rollback, history.
SettingsCanonical registry projection, preview/history/rollback.
Health / IncidentsPlatform status, queues, storage, site, workers, runbooks.
UI principleWork page names follow operator jobs and decisions. Database schema names are implementation details, not the information architecture.

Session memory
must not be fragile.

PROJECT STATE EXPORT CONTENT generated_at project id git branch / SHA active task codes latest verified checkpoint tests / verification state current deployment settings revision / config_hash open blockers pending approvals important artifact URLs/paths collaboration notes next exact action Targets: Work Project State root HANDOFF.md optional structured JSON snapshot Cadence: ~60 minutes initial plus explicit checkpoint/update events
SOURCE
Export composes canonical backend/Git state; operators should not manually maintain multiple contradictory summaries.
HISTORY
Keep enough snapshot history/events to understand handoffs, but avoid Git noise from automatic time-based commits.

Read broadly.
Mutate narrowly.

READ
Operational read access can be broad for project operators.
WRITE
Actions are permissioned by capability: settings, approval, release rollback, source disable, etc.
DANGEROUS
Rollback, migration-required setting, bulk cancel and destructive maintenance may require stronger confirmation/role.
SERVICE
Work backend calls canonical services with least-privilege identities; browser never gets DB/production credentials.
AUDIT
Permission failures and successful privileged actions both appear in audit trail.

Operations cadence
is configurable.

Setting familyInitial policy
work.project_state_refresh~60 minutes initial default.
work.dashboard_refreshFast UI refresh/event stream as implementation supports, separate from durable snapshot cadence.
work.blocker_escalationSeverity/time thresholds for surfacing aging blockers.
work.approval_policyWhich action/classes require explicit operator approval.
work.audit_retentionOperational history retention compatible with canonical audit policy.
work.health_thresholdsReferences canonical subsystem/disk/queue thresholds, no duplicated source of truth.
work.notification_policyCritical vs informational operator notifications if/when implemented.

Know when Work
is lying by being stale.

FRESHNESS
Age of Project State, last backend sync/event, stale page/data warnings.
ACTION SUCCESS
Operator action accepted/rejected/failed, backend reason and latency.
PROJECTION ERRORS
Mismatch between Work projection and canonical backend is detected/alerted, not silently cached forever.
USAGE
Approvals, retries, cancellations, settings changes and incident actions by stage/reason.
TRACE
request/correlation id, operator_id, agent_id, task_code, object id, backend event id, config_hash.

Audit Work.
Build one truthful overview.

OPS-01

Audit current Work

Pages/routes/APIs/auth, project/article/source/task/settings views, audit/events, Project State/HANDOFF process and tests.
DONE: reusable surfaces and backend authorities mapped.
OPS-02

Freeze control-plane contracts

Project State snapshot, action provenance, blocker model, approval binding and canonical backend references.
DONE: no Work-only truth introduced.
OPS-03

Project State aggregator

Compose Git/project/tasks/tests/deploy/settings/health/blockers/artifacts/next action into durable snapshot.
DONE: snapshot freshness and source provenance visible.
OPS-04

Overview page

Current release, active pipeline, blockers, approvals, health and next exact action with drill-downs.
DONE: operator can understand system state without opening DB/SSH.
OPS-05

Article timeline

End-to-end stages, loops, artifacts, claims/versions/config hashes, blockers and allowed actions.
DONE: one article history reconstructable from UI.
OPS-06

Action service

Validated start/pause/retry/cancel/approve/reject/takeover calls to canonical services with auth and audit.
DONE: UI cannot bypass backend state machine.
OPS-07

Settings projection

Definitions/effective/history/preview/commit/rollback UI using branch 3.4 service, including optimistic locking.
DONE: two-operator stale edit is rejected safely.
OPS-08

Health + blockers + incidents

DB/storage/site/queues/workers/release health, aging blockers, runbook links and critical ordering.
DONE: stale/critical conditions surface visibly.
OPS-09

Approval inbox

Release/Duplicate/QA/Rights/Risky-settings approvals bound to exact object hashes/revisions.
DONE: post-approval mutation invalidates approval.
OPS-10

Two-operator collaboration pilot

Independent clones/accounts perform concurrent safe actions, settings conflict test and shared Work visibility with correct provenance.
DONE: operator/git/agent attribution remains correct.
OPS-11

Project State exporter

~60m snapshot + explicit checkpoints into Work/HANDOFF.md/optional JSON, without hourly auto-commit.
DONE: handoff survives session closure/restart.
OPS-12

Checkpoint

Run end-to-end operator rehearsal from candidate blocker to article release/rollback visibility; sync HANDOFF/Project State and next branch.
DONE: checkpoint 15 PASS.
Split ruleЕсли current Work architecture после OPS-01 требует независимого backend/API overhaul, вынести его в 15.x. Но Project State/action provenance/blocker/approval contracts должны оставаться общими.

Control plane must
tell the truth.

TestExpected result
backend state changes outside WorkProjection refreshes; Work does not keep contradictory permanent state.
illegal retry/cancel actionBackend rejects despite UI request.
two operators edit same setting revisionOne succeeds; stale expected_revision fails.
approval then package hash changesApproval invalidated.
stale Project StateUI visibly marks age/staleness.
critical disk thresholdSurfaces above normal article backlog.
worker failure creates blockerReason/owner/next action visible and linked to events.
operator A + agent B actionsCorrect operator_id/agent_id/task_code attribution.
external Git commitProject State branch/SHA reflects latest relevant source state after refresh.
hourly exporterDoes not create automatic Git commit.
Work outageCanonical pipeline state remains in PostgreSQL/Git/artifacts; Work recovery can reconstruct projection.
browser without permissionPrivileged mutation rejected server-side.
×
Не считать UI cache canonical state.
×
Не дублировать Settings logic в JavaScript forms.
×
Не давать operator actions обходить queue/lease/release state machines.
×
Не auto-commit Project State каждый час.

The system is
operable by humans.

CHECKPOINT 15 PASS WHEN: ✓ current Work architecture audited reuse-first ✓ Work remains control/projection plane, not second database ✓ Project State contract is stable and durable ✓ Project State refresh target ~60 minutes is implemented/configurable ✓ HANDOFF.md can be regenerated from canonical context ✓ no hourly automatic Git commits are required ✓ operator_id + git author + agent_id + task_code + config_hash are captured ✓ article end-to-end timelines show loops/artifacts/blockers ✓ approvals bind exact hashes/revisions ✓ blockers have reason/owner/next action ✓ retry/cancel/approve/takeover use canonical services/state machines ✓ Settings UI uses canonical Settings Registry with optimistic locking ✓ health covers site/Work/DB/storage/queues/workers/release ✓ critical conditions outrank editorial backlog ✓ two independent operator clones/accounts work safely ✓ privileged actions are authorized and audited ✓ Work outage does not lose canonical pipeline state ✓ collaboration/incident/runbook rehearsal passes ✓ HANDOFF points to Pilot / Ramp / Learning Loop next

Продолжить выполнение

Следующий шаг выбирает журнал задач. Все главы уже подготовлены.

[15.1] OPS-01 — карточка выполнения