STATIYA_POLUCHATEL_1
SP-16 · MASTER MERGE
FINAL PLANNING MERGE / RUNTIME FACTS BEFORE ARCHITECTURE FREEZE

MASTER MERGE → START_PROJECT → Luna Medium

SP-16 сводит SP-01…SP-15 в один implementation handoff. Продуктовые решения уже можно считать принятыми. Технологическая архитектура остаётся условной до выполнения SP-03 на реальном Work. После live discovery создаётся immutable START_PROJECT, затем канонический project state и первый короткий Active Window для GPT-5.6 Luna / Medium.

15merged subplans
25accepted decisions
20active window tasks
1runtime gate before freeze

01 / Канонический переход из планирования в разработку

MERGESP-01…SP-15 accepted decisions
LIVE DISCOVERYExecute SP-03
CONFLICT REVIEWRuntime vs planning
START_PROJECTImmutable bootstrap
FREEZE + STATEADRs + /razraba
ACTIVE WINDOW10–30 bounded Luna tasks
Сейчас нельзя честно «заморозить» runtime architecture.

SP-03 пока является готовым discovery-контрактом, а не выполненным инфраструктурным исследованием. Поэтому repo/root, runtime, queue, DB, logging и deploy stack нельзя выдумывать в финальном merge.

02 / Принятые решения проекта

M-01
Product

One job handles one source URL/domain. User sees preflight plan before full crawl.

M-02
First gate

Collect first up to 30 valid articles, freeze preview, wait for explicit Continue.

M-03
Corpus end

After Continue, process the entire defensible source corpus until traversal plan is exhausted.

M-04
Article rule

Standalone written content + meaningful prose + at least one qualifying content image.

M-05
Exclusions

Video-only, category/archive/service/forum/uncertain pages are excluded.

M-06
Precision

Uncertain never auto-includes. Do not fill batches with doubtful records.

M-07
Crawler

Execute approved crawl_plan; HTTP-first; browser fallback only where proven necessary.

M-08
Scope

Same-source public web only; no private network, auth/CAPTCHA bypass or silent host expansion.

M-09
Ordering

Mechanism chooses best deterministic source-specific ordering and records method/evidence/confidence.

M-10
Dedup

Resolve logical article identity before numbering. Same title alone never merges records.

M-11
Canonical

Use redirect/canonical/source evidence; external canonical conflicts are never silently accepted.

M-12
IDs

Per-source stable public IDs assigned only after dedup + ordering are frozen.

M-13
Batches

Maximum 30 records per full batch; final partial batch is valid.

M-14
State

Canonical persistent job state + checkpoints; logs are not execution state.

M-15
Owner approval

WAITING_FOR_OWNER survives restart. Continue is durable and idempotent.

M-16
UI

Operator sees current status, phase, counters, crawl plan, live logs and diagnostic packet.

M-17
Dataset

Human-visible records remain minimal; machine layer contains full graph/IDs/navigation/versioning.

M-18
HTML

MASTER INDEX + linked batch pages generated from one frozen dataset model.

M-19
Validation

Visible HTML and machine manifest must agree exactly; failed validation blocks deploy.

M-20
Deploy

Validated immutable build only; stage → publish → verify live → catalog register → DONE.

M-21
Security

Admin/operator controls private; public datasets may be public according to Work policy.

M-22
Benchmark

Fine Woodworking / WOOD is the primary reference corpus for quality comparison.

M-23
Updates

Post-MVP updates preserve public IDs; no silent renumbering of deployed records.

M-24
Reuse

Do not build crawler/browser/queue/template infrastructure from scratch if existing Work/runtime solutions fit.

M-25
Implementation model

GPT-5.6 Luna / Medium receives bounded tasks with explicit verification and rollback.

03 / Source registry

IDSourceArtifactStatus
SRC-PLAN-01SP-01 Product Scope & AcceptanceStatiya_poluchatel_1_01_PRODUCT_SCOPE_AND_ACCEPTANCE.htmlACCEPTED
SRC-PLAN-02SP-02 Reuse / Skills ResearchStatiya_poluchatel_1_02_REUSE_SKILLS_RESEARCH.htmlACCEPTED_WITH_RUNTIME_DEPENDENCIES
SRC-PLAN-03SP-03 Live Discovery Work InfraStatiya_poluchatel_1_03_LIVE_DISCOVERY_WORK_INFRA.htmlEXECUTION_REQUIRED
SRC-PLAN-04SP-04 Source Preflight & Crawl PlanStatiya_poluchatel_1_04_SOURCE_PREFLIGHT_AND_CRAWL_PLAN.htmlACCEPTED
SRC-PLAN-05SP-05 URL Discovery CrawlerStatiya_poluchatel_1_05_URL_DISCOVERY_CRAWLER.htmlACCEPTED
SRC-PLAN-06SP-06 Article Detection & FilteringStatiya_poluchatel_1_06_ARTICLE_DETECTION_FILTERING.htmlACCEPTED
SRC-PLAN-07SP-07 Ordering / Dedup / Canonical / IDsStatiya_poluchatel_1_07_ORDERING_DEDUP_CANONICAL_IDS.htmlACCEPTED
SRC-PLAN-08SP-08 Job State / Checkpoint / ResumeStatiya_poluchatel_1_08_JOB_STATE_CHECKPOINT_RESUME.htmlACCEPTED
SRC-PLAN-09SP-09 Operator UI / Live LogsStatiya_poluchatel_1_09_OPERATOR_UI_LIVE_LOGS.htmlACCEPTED
SRC-PLAN-10SP-10 AI-Readable Dataset SchemaStatiya_poluchatel_1_10_AI_READABLE_DATASET_SCHEMA.htmlACCEPTED
SRC-PLAN-11SP-11 Batch HTML & Master IndexStatiya_poluchatel_1_11_BATCH_HTML_AND_MASTER_INDEX.htmlACCEPTED
SRC-PLAN-12SP-12 Work Deploy & Catalog IntegrationStatiya_poluchatel_1_12_WORK_DEPLOY_AND_CATALOG_INTEGRATION.htmlACCEPTED_WITH_RUNTIME_DEPENDENCIES
SRC-PLAN-13SP-13 Security / Robots / Rate LimitsStatiya_poluchatel_1_13_SECURITY_ROBOTS_RATE_LIMITS.htmlACCEPTED
SRC-PLAN-14SP-14 Validation / Tests / BenchmarkStatiya_poluchatel_1_14_VALIDATION_TESTS_BENCHMARK.htmlACCEPTED
SRC-PLAN-15SP-15 Update Existing DatasetStatiya_poluchatel_1_15_UPDATE_EXISTING_DATASET.htmlPOST_MVP_READY

04 / Runtime gate: что ещё нельзя считать фактом

IDMust be verified live
RUNTIME-01Actual Work repository/project_root
RUNTIME-02Active branch/commit and deploy ownership
RUNTIME-03Python/Node/runtime versions
RUNTIME-04Existing backend/web framework
RUNTIME-05Existing worker/queue model
RUNTIME-06Redis/Valkey/PostgreSQL/SQLite or other stateful services
RUNTIME-07Existing structured logging/live stream mechanism
RUNTIME-08Nginx/reverse-proxy/public document-root conventions
RUNTIME-09Existing Work authentication/admin model
RUNTIME-10Existing deployment/rollback mechanism
RUNTIME-11Services catalog source and update mechanism
RUNTIME-12work-ai-index source/generator/update mechanism
Next exact action = SP-03 execution.

Coding-AI сначала запускает read-only discovery D-01…D-11, сохраняет evidence, потом обновляет technology decisions. Ни одного production install до этого.

05 / Architecture freeze slots

IDDecision areaProvisional directionStatus
A-CORE-01Application hostserver2 / actual Work hostVERIFY SP-03
A-CORE-02Implementation languagePrefer existing Work runtimeVERIFY SP-03
A-CORE-03Crawler coreCrawlee Python OR ScrapyDECIDE after equal spike
A-CORE-04Browser fallbackPlaywrightAPPROVED CONCEPT; install only if required
A-CORE-05Article text signalDOM rules + optional Trafilatura spikeCONDITIONAL
A-CORE-06Job queueExisting Work queue first; RQ only if Redis/Valkey fit; Celery only if already justifiedOPEN
A-CORE-07State storeExisting DB/state system preferredOPEN
A-CORE-08Structured loggingExisting Work logging preferred; structlog conditionalOPEN
A-CORE-09HTML rendererExisting renderer or Jinja2 if PythonOPEN
A-CORE-10Deploy adapterExisting Work deploy mechanism onlyVERIFY SP-03
GateRequired before freeze
FREEZE-01SP-03 runtime facts VERIFIED.
FREEZE-02Crawler candidate comparison completed.
FREEZE-03State/queue/logging/deploy choices have ADRs.
FREEZE-04No unresolved conflict between planning and runtime facts.
FREEZE-05Security boundaries compatible with selected runtime.
FREEZE-06START_PROJECT contains exact repo/root/branch/runtime references.
FREEZE-07Active Window tasks point to real modules/paths after repo discovery.

06 / START_PROJECT bootstrap snapshot

START_PROJECT создаётся один раз после live discovery + gap/conflict review.

После начала разработки этот файл не превращается в рабочий журнал и не переписывается каждый день. Он остаётся исторической точкой старта. Текущее состояние живёт отдельно.

#SectionRequired content
01Project identityName, purpose, canonical repo/root, runtime host, owner.
02Accepted product contractMerged immutable decisions M-01…M-25.
03Verified runtime passportOnly SP-03 VERIFIED facts.
04Architecture decisionsChosen crawler/state/logging/render/deploy stack + ADR refs.
05Security boundariesAdmin/private controls, public crawling scope, SSRF/robots/rate policies.
06Canonical schemasJob state, crawl_plan, classifier result, dataset manifest, build/deploy result.
07Source registrySP-01…SP-16 + runtime evidence + benchmark reference.
08Project structureRepo folders/modules, /razraba, tests, fixtures, docs.
09Verification contractQuality gates and release blockers.
10Active Window 01Only nearest bounded Luna tasks.
11Rollback strategyHow to revert code/config/deploy safely.
12Open runtime-dependent itemsExplicit remaining unknowns; no guesses.
TARGET NAME START_PROJECT_AUTONOMOUS_SITE_RESEARCH_PIPELINE_YYYY-MM-DD.html Created only after: SP-03 VERIFIED + candidate spikes + architecture ADRs + conflict reconciliation Then immutable.

07 / Canonical live project state

FieldPurpose
project_idStable project identity.
project_statusPLANNING / IMPLEMENTING / BLOCKED / RELEASE_CANDIDATE / LIVE.
active_branchVerified Git branch.
active_commitCurrent implementation commit.
architecture_versionCurrent accepted architecture revision.
active_window_idCurrent bounded task window.
active_task_idCurrent/next task.
completed_tasks[]Task IDs + verification refs.
blocked_tasks[]Task IDs + blocker reasons.
open_decisions[]Unresolved ADRs.
runtime_facts_versionSP-03 evidence snapshot version.
test_gate_statusCurrent GATE-01…GATE-10 state.
last_checkpointProject-level checkpoint.
next_exact_actionOne next action.

08 / /razraba structure

PathRole
/razraba/README.htmlHuman + AI entry point to current implementation state.
/razraba/project_state.jsonCanonical live project state.
/razraba/active_window.jsonOnly current bounded tasks.
/razraba/tasks/One self-contained task contract per active/completed task.
/razraba/evidence/Test outputs, screenshots/refs, discovery evidence.
/razraba/adr/Architecture decision records.
/razraba/checkpoints/Project-level checkpoint snapshots.
/razraba/fixtures/Controlled crawler/classifier/security test fixtures if project convention permits.
/razraba — текущая рабочая память проекта.

Новая AI-сессия должна открыть README/project_state/active_window и быстро понять, где проект находится сейчас, не перечитывая весь чат.

09 / Обязательный contract каждого Luna-task

FieldRequired meaning
TASK_IDStable task identifier.
TITLEOne bounded capability/change.
STATUSREADY / IN_PROGRESS / BLOCKED / DONE.
INPUTExact files/modules/state/evidence required.
PROCESS / COMPONENTWhat component is changed.
WHAT IT DOESPlain-language behavior.
WHAT IT READSInputs/state/config.
WHAT IT WRITES / STORESFiles/tables/state/artifacts.
OUTPUTConcrete deliverable.
NEXT CONSUMERWho/what uses output.
ACCEPTANCEExecutable success criteria.
VERIFICATIONExact test/command/browser check.
ROLLBACK / RISKHow to undo and principal risk.
DEPENDENCIESOnly real prior task IDs.
SOURCE REFSSP/ADR/runtime evidence references.
TASK SHAPE INPUT → PROCESS / COMPONENT → WHAT IT DOES → WHAT IT READS → WHAT IT WRITES / STORES → OUTPUT → NEXT CONSUMER → ACCEPTANCE → VERIFICATION → ROLLBACK / RISK If one task contains two independently testable systems: SPLIT IT BEFORE CODING.

10 / ACTIVE WINDOW 01 — GPT-5.6 Luna / Medium

TaskScopeDone when
AW01-01Execute SP-03 discoveryRun D-01…D-11 read-only on verified Work/server2 environment; sanitize evidence.GATE-01 evidence complete.
AW01-02Create runtime passportCompile verified repo/root/runtime/services/deploy/auth/logging facts; mark conflicts.Runtime passport JSON/HTML.
AW01-03Reconcile SP-02 shortlistDecide which candidate spikes are compatible with actual Work runtime.Updated candidate matrix.
AW01-04Crawler spike AImplement isolated Crawlee OR first compatible candidate spike on fixtures; include forced-stop/resume.Evidence packet A.
AW01-05Crawler spike BImplement isolated Scrapy OR alternate compatible candidate spike under same benchmark.Evidence packet B.
AW01-06Architecture ADR: crawler coreCompare A/B evidence and choose one production crawler framework.ADR approved.
AW01-07Architecture ADR: persistence/queueChoose state store + queue/worker using existing Work infrastructure first.ADR approved.
AW01-08Architecture ADR: logging/UI transportChoose existing logging + SSE/WebSocket/polling transport based on runtime.ADR approved.
AW01-09Create START_PROJECT snapshotWrite immutable bootstrap from merged planning + verified runtime + accepted ADRs.START_PROJECT_<PROJECT>_<DATE>.html.
AW01-10Create canonical /razraba stateInitialize project_state.json, active_window.json, ADR/evidence/checkpoint folders.Canonical live state exists.
AW01-11Implement core data contractsJob state, crawl_plan, request, classifier result, article identity, dataset manifest schemas.Schema tests pass.
AW01-12Implement URL/security guardScheme/DNS/IP/redirect/scope checks with SSRF fixtures.Security unit suite passes.
AW01-13Implement preflight v1URL scope + robots + sitemap topology + bounded evidence output.Preflight fixtures pass.
AW01-14Implement persistent crawl queueRequest normalization/dedup/status/checkpoint layer.Queue unit/integration tests pass.
AW01-15Implement HTTP fetch workerRetries/timeouts/rate/content limits; no browser yet.Crawler core fixture suite passes.
AW01-16Implement candidate discoveryApproved traversal surfaces → idempotent candidate emission.Discovery integration passes.
AW01-17Implement classifier v1Hard exclusions + text/image/title/canonical extraction + uncertain→exclude.Classifier fixture suite passes.
AW01-18Implement identity/order/batch compilerDedup/canonical/order/IDs/batch ranges on frozen corpus.29/30/31/60/61/65 fixtures pass.
AW01-19Implement renderer v1MASTER + batch HTML + embedded manifest from frozen model.SP-10/11 validators pass.
AW01-20Checkpoint / Active Window reviewRun gates, record evidence, split next window based on actual code state.Window 02 compiled from evidence, not speculation.
Это окно — максимум, а не один prompt.

Каждый пункт превращается в отдельный bounded TASK/CR. После AW01-20 следующий Active Window компилируется по реальному состоянию кода и evidence.

11 / Что намеренно не тащим в первое окно

CapabilityReason
UI integrationOperator UI/live logs after core state/events are stable.
Browser fallbackOnly after HTTP-first benchmark proves a real need.
Fine Woodworking full benchmarkAfter end-to-end local pipeline is runnable.
Deploy adapterAfter renderer/validation + Work deploy ADR are proven.
Catalog integrationAfter verified deploy path.
Post-MVP update modeAfter MVP dataset lifecycle is stable.

12 / Conflict rules

IDRule
C-16-01Runtime overrides stale documentation, but conflict must be recorded.
C-16-02Accepted product requirement outranks a convenient library default.
C-16-03Security boundary is not weakened to make a candidate library easier to use.
C-16-04If Work already has an equivalent subsystem, reuse it unless an ADR justifies replacement.
C-16-05If a planned path/module does not exist, update plan references; do not create duplicate architecture blindly.
C-16-06If Luna task grows beyond one coherent capability, split before implementation.

13 / Definition of Done для всего planning package

IDCriterion
A-16-01SP-01…SP-15 are represented in one merged source registry.
A-16-02Accepted product decisions are separated from runtime-dependent decisions.
A-16-03Architecture freeze is explicitly blocked until SP-03 live discovery is executed.
A-16-04START_PROJECT template is self-contained for a new AI session.
A-16-05START_PROJECT is immutable after coding begins.
A-16-06Live implementation progress is stored in canonical project state + /razraba.
A-16-07Active Window contains no more than 30 bounded tasks.
A-16-08Each implementation task uses the full INPUT→PROCESS→OUTPUT→ACCEPTANCE→VERIFICATION→ROLLBACK contract.
A-16-09First active window starts with runtime evidence, not speculative coding.
A-16-10Crawler/state/logging choices have evidence-backed ADRs before production implementation.
A-16-11No third-party component is installed into production before its compatibility/security review.
A-16-12Next windows are generated from completed evidence/current code state, not prewritten hundreds of tasks.
A-16-13Fine Woodworking remains benchmark evidence, not hardcoded source logic.
A-16-14MVP remains focused; post-MVP update mode stays deferred until release core is stable.

14 / Exact next action

DO NOT START MASS IMPLEMENTATION YET. 1. Execute SP-03 on the actual Work environment. 2. Save sanitized runtime evidence. 3. Reconcile SP-02 candidates with real runtime. 4. Run equal bounded crawler spikes. 5. Record ADRs: - crawler core - state/queue - logging transport - renderer - deploy adapter 6. Resolve planning/runtime conflicts. 7. Create immutable START_PROJECT_AUTONOMOUS_SITE_RESEARCH_PIPELINE_YYYY-MM-DD.html. 8. Initialize canonical /razraba state. 9. Execute ACTIVE WINDOW 01 task-by-task. 10. After AW01-20, compile ACTIVE WINDOW 02 from evidence.