STATIYA_POLUCHATEL_1
SP-11 · BATCH HTML & MASTER INDEX
P4 / RENDER ONE DATASET FROM ONE FROZEN MODEL

HTML-пакеты по 30 и MASTER INDEX

Генератор превращает frozen dataset model в компактный набор автономных HTML-файлов: один MASTER INDEX и последовательные batches максимум по 30 статей. Видимый интерфейс и machine-readable manifest генерируются из одних и тех же данных, поэтому не могут расходиться незаметно.

30max records / batch
1root index
0source fetches during render
PASSrequired before deploy

01 / Output topology

ROOT / MASTER INDEX

One entry point for one source dataset. Knows source identity, dataset status, all batches, total article count and traversal order.

BATCH

One HTML page with up to 30 article records. Knows its range, previous/next batch, root index and article IDs.

ARTICLE

One logical record inside a batch. Visible payload is title+URL; machine layer adds stable ID, sequence and graph links.

Build input is frozen.

Renderer не ходит на исходный сайт и не меняет article set. Он только отображает уже принятый dataset graph.

02 / File tree

ArtifactRole
index.htmlMASTER INDEX — source identity, corpus stats, batch directory, AI manifest, validation summary.
articles-001-030.htmlBatch 1.
articles-031-060.htmlBatch 2.
articles-061-090.htmlBatch 3, etc.
articles-XXX-YYY.htmlFinal partial batch if record count is not divisible by 30.
datasets/example-source/ ├── index.html ├── articles-001-030.html ├── articles-031-060.html └── articles-061-065.html

03 / MASTER INDEX

SectionContent
Dataset headerSource name, original source URL, source code, dataset status, article count.
Quick statsTotal articles, total batches, ordering method/confidence, generated date.
Batch directoryOne row/card per batch with range, count and OPEN link.
AI instructionsShort deterministic traversal guidance.
Validation summaryPASS/PARTIAL plus checks/build/version.
Machine manifestEmbedded STATIYA_ARTICLE_DATABASE JSON for the entire dataset map.

04 / Batch page

SectionContent
Batch headerSource name, batch range, record count, position X / total batches.
Root navigationBack to MASTER INDEX.
Previous / next batchAdjacent file navigation when present.
Article listExactly 30 visible records except final partial batch.
Machine manifestSelf-contained dataset/batch/article JSON.
Footer navigationRepeat root and prev/next controls after long list.

05 / Article markup contract

ElementRule
Container<article> or equivalent semantic block with id=article_id.
data-article-idStable public article ID.
data-sequenceSequence number.
data-source-idSource identity.
data-batch-idBatch identity.
data-urlCanonical original-source URL.
Visible numberSequence formatted consistently.
Visible titleEscaped original title.
Visible linkOPEN ↗ to original source; target behavior consistent across all batches.
<article id="EXAMPLE_000031" data-article-id="EXAMPLE_000031" data-sequence="31" data-source-id="SRC_EXAMPLE" data-batch-id="EXAMPLE_BATCH_002" data-url="https://example.com/article"> <span class="seq">031</span> <a href="https://example.com/article">Original article title</a> </article>

06 / Filename rules

IDRule
F-11-01MASTER file is always index.html inside source dataset folder.
F-11-02Batch filenames derive only from actual sequence range.
F-11-03Pad ranges to at least 3 digits for normal datasets: articles-001-030.html.
F-11-04For >999 articles, width expands consistently for all batch files in that build if needed.
F-11-05Do not encode article titles in filenames.
F-11-06Filename generation is deterministic from frozen dataset model.

07 / Rendering rules

IDRule
R-11-01Renderer consumes frozen dataset model; it must not query/crawl source pages.
R-11-02Visible HTML and embedded JSON are generated in one render pass from the same objects.
R-11-03All external titles/URLs are escaped safely.
R-11-04No runtime JavaScript is required to read core dataset content.
R-11-05Search/filter JavaScript, if added, is progressive enhancement only.
R-11-06Batch content remains readable with JS disabled.
R-11-07No external font/build dependency is required to open generated HTML.
R-11-08No server-local paths, secrets, job diagnostics or private state enter public HTML.
R-11-09Every build writes to isolated staging directory first.
R-11-10Only fully rendered + validated build is eligible for deploy.

09 / Visual contract

RuleContract
Editorial technical dossierLight paper background, dark text, restrained green/olive accent; no purple/lilac.
Minimal article rowsDo not turn each record into a large marketing card.
Large source headerSource and dataset identity immediately visible.
Readable density30 rows should fit in a reasonably compact page.
Stable row geometryLong titles wrap but do not break number/link alignment.
MobileRows collapse gracefully; link remains tappable.
AccessibilitySemantic headings/links, visible focus states, adequate contrast.
No decorative bloatDataset is primarily a working research index.
Optional enhancementRule
Optional local filterFilter current batch by title/ID/URL without server request.
MASTER filterMay filter batch directory by range/ID, but not necessary for MVP.
No global full-text searchNot needed because records contain only title+URL.
No hidden dataset mutationFiltering changes presentation only.
No dependencyGenerated files remain useful if search JS fails.

10 / Build flow

StepAction
1Load frozen dataset model/build_id.
2Validate sequence and batch assignment preconditions.
3Create isolated staging output directory.
4Render MASTER INDEX from root manifest.
5Render batches in sequence from shared template/model.
6Embed JSON manifests and navigation metadata.
7Run structural validator against generated files.
8Open representative pages in browser acceptance test.
9Compute build manifest/checksums if adopted.
10Mark build VALIDATED and hand to SP-12 deploy layer.
Build fieldMeaning
build_idImmutable render build.
dataset_idDataset identity.
output_dirStaging directory reference, internal only.
master_fileindex.html.
batch_files[]Ordered generated batch files.
article_countTotal.
batch_countTotal.
template_versionRenderer template version.
schema_versionSTATIYA_ARTICLE_DATABASE version.
validation_statusPASS / FAIL.
validation_report_refEvidence/report path.
generated_atTimestamp.

11 / Structural validators

IDCheckContract
V-11-01HTML parseEvery output file parses as HTML and contains required head/body structure.
V-11-02Master manifestMASTER embedded JSON parses and document_type=MASTER_INDEX.
V-11-03Batch manifestEvery batch embedded JSON parses and document_type=ARTICLE_BATCH.
V-11-04CountsMASTER article_count equals batch records sum.
V-11-05Batch sizesAll non-final batches exactly 30; final 1–30.
V-11-06Visible/JSON equalityEvery visible title/URL/sequence matches manifest record.
V-11-07IDsNo duplicate article IDs or DOM element IDs.
V-11-08RangesBatch filename/range/manifest/visible range all agree.
V-11-09Internal linksMASTER↔batch and batch prev/next hrefs resolve in staging output.
V-11-10External link formatOriginal article URLs are valid http/https URLs.
V-11-11GraphArticle prev/next chain reciprocal across all records.
V-11-12EscapingHostile title fixture cannot inject markup/script.
V-11-13No secretsKnown internal path/env/token patterns absent from output.
V-11-14No source fetchRendering test proves no network dependency required.

12 / Browser acceptance

IDScenario
BROWSER-01Open MASTER with JS enabled; batch links visible and clickable.
BROWSER-02Open MASTER with JS disabled; core dataset still readable.
BROWSER-03Open first batch; MASTER and next navigation work.
BROWSER-04Open middle batch; prev and next work.
BROWSER-05Open final partial batch; no invalid next link.
BROWSER-06Long title fixture wraps without destroying layout.
BROWSER-07Mobile viewport preserves title/link usability.
BROWSER-08Hostile escaped title renders as text, not executable HTML.

13 / Failure modes

IDFailureBehavior
F-11-01Render interrupted halfwayStaging build remains incomplete; never deploy.
F-11-02One batch template failsWhole build FAIL; do not publish partial files.
F-11-03Visible/JSON mismatchValidation FAIL.
F-11-04MASTER points to missing batchValidation FAIL.
F-11-05Article count changes during renderFrozen build input prevents this; otherwise abort.
F-11-06Title contains HTML/scriptEscape; regression fixture required.
F-11-07Final batch filename wrong after total changesRebuild staging from frozen dataset; no manual rename.
F-11-08JS filter breaksCore content unaffected; progressive enhancement only.
F-11-09Template version changes mid-buildForbidden; one build pins one template version.

14 / Definition of Done

IDCriterion
A-11-01Given N records, generator creates index.html plus ceil(N/30) batches.
A-11-020 records does not produce a fake empty completed dataset.
A-11-031/29/30/31/60/61/65 fixtures produce correct ranges and file counts.
A-11-04Every non-final batch contains exactly 30 visible and machine records.
A-11-05MASTER links to all generated batches exactly once.
A-11-06Every batch links back to MASTER.
A-11-07Prev/next batch navigation is correct.
A-11-08Visible title/link/sequence exactly match embedded JSON.
A-11-09Generated files are useful with JavaScript disabled.
A-11-10External source strings cannot inject executable markup.
A-11-11Renderer performs no source-site fetches.
A-11-12Failed validation prevents build from reaching deploy-ready state.
A-11-13Browser acceptance passes for first/middle/final batch and mobile viewport.
A-11-14Build manifest records schema/template/build versions.
A-11-15No secrets or server-local paths exist in public output.

15 / Luna Medium bounded blocks

BlockScopeExpected result
LUNA-11-ATemplate skeletonsMASTER + batch static templates from mock data.
LUNA-11-BBatch partitionerN→30-sized ranges and deterministic filenames.
LUNA-11-CRendererGenerate visible rows and embedded manifests from same objects.
LUNA-11-DNavigation compilerMASTER/batch prev-next and article graph binding.
LUNA-11-EEscaping/securityHostile title/URL fixtures and no-secret public output.
LUNA-11-FStructural validatorCounts/ranges/JSON/links/graph consistency.
LUNA-11-GBrowser acceptanceJS-on/off, desktop/mobile, first/middle/final pages.
LUNA-11-HBuild artifact contractImmutable build_id + validated staging output for SP-12.

16 / Handoff

NEXT PLANNING ARTIFACT Statiya_poluchatel_1_12_WORK_DEPLOY_AND_CATALOG_INTEGRATION.html SP-12 receives: - VALIDATED immutable build_id - staging output directory - index.html - ordered batch_files[] - validation report - dataset/source identity - target public route from SP-03 SP-12 must: stage → publish atomically → verify live → register dataset in Work.