STATIYA_POLUCHATEL_1
SP-10 · AI-READABLE SCHEMA
P4 / DATASET GRAPH / HUMAN MINIMAL · MACHINE COMPLETE

AI-readable schema для связанной HTML-базы

Человеку показываем почти только номер, заголовок и ссылку. Машине даём стабильную структуру: источник, batches, article IDs, последовательность, canonical URLs, prev/next связи, build/schema versions и validation status. Благодаря этому база читается как единая система, а не как набор несвязанных HTML-файлов.

1.0target schema version
30records max / batch
3visible article fields
1master AI entry point

01 / Dataset 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.

One source = one connected dataset graph.

MASTER INDEX является единой точкой входа. Batch-файлы знают root и соседей. Article records знают свои sequence/ID и соседние статьи.

02 / Объекты схемы

ObjectRole
datasetRoot object for one source corpus.
sourceSource identity, input/canonical URLs and source code.
orderingDeclared ordering method, confidence and evidence summary.
batches[]All batch descriptors in sequence.
articles[]Article records for current batch or master summary depending document type.
navigationRoot/batch/article graph links.
generationSchema/template/build version metadata.
verificationValidation state and evidence summary.

03 / MASTER dataset fields

FieldPurpose
schema_nameConstant: STATIYA_ARTICLE_DATABASE.
schema_versionSemantic schema version, starts at 1.0.
document_typeMASTER_INDEX or ARTICLE_BATCH.
dataset_idStable dataset identity.
source_idStable source identity.
source_codePublic prefix used in article IDs.
source_nameHuman-readable source title.
source_urlNormalized source root.
dataset_statusSTAGED / VALIDATED / DEPLOYED / PARTIAL / SUPERSEDED.
article_countTotal logical articles in final dataset.
batch_countTotal number of batch files.
batch_size30.
ordering_methodarchive/date/feed/sitemap/discovery fallback.
ordering_confidenceHIGH / MEDIUM / LOW.
generated_atBuild timestamp.
build_idImmutable render/build identity.
identity_versionDedup/canonical/order version.
classifier_profile_versionSource classifier profile version.
crawl_plan_versionPreflight plan version used.
master_index_urlCanonical public dataset root.

04 / Batch descriptor

FieldPurpose
batch_idStable batch identity.
batch_number1..M.
range_startFirst sequence number.
range_endLast sequence number.
record_count1..30.
file_namearticles-001-030.html etc.
public_urlLive URL after deploy.
previous_batch_idNull for first.
next_batch_idNull for last.
previous_fileRelative link.
next_fileRelative link.
master_indexRelative/root link.
first_article_idFirst article in batch.
last_article_idLast article in batch.

05 / Article record

FieldPurpose
article_idStable public ID, e.g. FWW_000421.
sequence_numberInteger sequence inside source dataset.
source_idOwning source.
batch_idOwning batch.
titleOriginal visible article title after safe normalization.
canonical_urlPreferred original-source URL.
aliases[]Optional observed alternative URLs; machine only.
previous_article_idNull for first article.
next_article_idNull for last article.
previous_article_urlOptional dataset-local anchor/link.
next_article_urlOptional dataset-local anchor/link.
ordering_methodCopied or inherited for self-contained records.
ordering_keyMachine sort evidence; may be omitted from visible HTML.
ordering_confidenceHIGH / MEDIUM / LOW.
verification_statusVERIFIED / PARTIAL / NOT_PROVEN.
identity_versionRuleset version that produced identity.
Visible payload stays minimal.

В карточке пользователь не обязан видеть aliases, ordering key, profile version и т. п. Эти поля существуют для устойчивого AI traversal и validation.

07 / Как данные встраиваются в HTML

LayerRule
JSON manifestEvery HTML document contains <script type='application/json'> with the document's machine-readable object.
JSON-LDOptional/secondary semantic layer for ItemList/Article navigation; must not contradict primary manifest.
data-* attributesVisible article rows/cards carry stable article_id/sequence/batch/source attributes for local machine inspection.
rel prev/nextBatch document head may use rel=prev/next for adjacent batch files.
canonicalDataset HTML canonical is the Work page URL; article canonical_url remains the original source URL in record data.
No hidden divergenceIf visible title/link differs from manifest article title/link, validation fails.

08 / Что должен показывать MASTER INDEX

BlockContent
Source headersource name, root URL, source code, dataset status.
Corpus statsarticle_count, batch_count, batch_size.
Orderingmethod + confidence + short note.
Build/versionschema, build_id, generated_at, identity/profile/plan versions.
Batch directoryAll batches with range, count and link.
Traversal hintInstruction for AI: read manifest → choose batch → inspect article records → open original URL only when needed.
Validation summaryFinal checks and any PARTIAL limitations.

09 / AI traversal workflow

StepAction
1Open MASTER INDEX.
2Read embedded STATIYA_ARTICLE_DATABASE manifest.
3Confirm source_id, schema_version, article_count and ordering.
4Use batches[] to choose relevant range.
5Open batch HTML and read its embedded manifest.
6Find article by ID/title/sequence/canonical URL.
7Follow previous/next batch/article links when traversing sequentially.
8Open original canonical_url only when source content itself is needed.
9Do not infer missing articles or renumber records.

10 / Example machine manifests

{ "schema_name": "STATIYA_ARTICLE_DATABASE", "schema_version": "1.0", "document_type": "MASTER_INDEX", "dataset_id": "SRC_FWW_DATASET", "source": { "source_id": "SRC_FWW", "source_code": "FWW", "name": "Fine Woodworking", "url": "https://www.finewoodworking.com/" }, "article_count": 65, "batch_count": 3, "batch_size": 30, "ordering": { "method": "official_archive_reverse_chronological", "confidence": "HIGH" }, "batches": [ { "batch_id": "FWW_BATCH_001", "range": [ 1, 30 ], "file": "articles-001-030.html", "record_count": 30 }, { "batch_id": "FWW_BATCH_002", "range": [ 31, 60 ], "file": "articles-031-060.html", "record_count": 30 }, { "batch_id": "FWW_BATCH_003", "range": [ 61, 65 ], "file": "articles-061-065.html", "record_count": 5 } ] }
{ "schema_name": "STATIYA_ARTICLE_DATABASE", "schema_version": "1.0", "document_type": "ARTICLE_BATCH", "dataset_id": "SRC_FWW_DATASET", "batch": { "batch_id": "FWW_BATCH_002", "batch_number": 2, "range_start": 31, "range_end": 60, "record_count": 30, "previous_file": "articles-001-030.html", "next_file": "articles-061-065.html", "master_index": "index.html" }, "articles": [ { "article_id": "FWW_000031", "sequence_number": 31, "title": "Example article", "canonical_url": "https://example.com/article", "previous_article_id": "FWW_000030", "next_article_id": "FWW_000032", "verification_status": "VERIFIED" } ] }

11 / Schema versioning

CaseRule
Schema 1.xBackward-compatible field additions allowed.
Schema 2.0Breaking semantic/structural change requires explicit new major version.
Unknown fieldReaders should ignore unknown optional fields but preserve known required semantics.
Required field removedBreaking change.
Field meaning changedBreaking change even if name stays same.
Template versionSeparate from schema version.
Build IDEvery render of a frozen dataset gets immutable build ID.

12 / Validation invariants

IDCheck
V-10-01MASTER article_count equals sum of all batch record_count.
V-10-02Every batch except final has exactly 30 records.
V-10-03Final batch has 1–30 records.
V-10-04Article sequence is contiguous 1..N.
V-10-05Public article IDs match source code and sequence.
V-10-06No duplicate article_id.
V-10-07No duplicate canonical logical article unless explicitly preserved as distinct.
V-10-08Batch ranges do not overlap or leave gaps.
V-10-09prev/next article graph is reciprocal and complete.
V-10-10prev/next batch graph is reciprocal and complete.
V-10-11Visible article title/link equals manifest title/canonical_url.
V-10-12All batch links listed by MASTER exist in build output.
V-10-13Schema/document_type required fields validate.
V-10-14No secret/internal server paths appear in public manifest.

13 / Failure modes

IDFailureBehavior
F-10-01Visible row differs from JSONBuild fails validation; never deploy.
F-10-02Master count differs from batchesBuild fails.
F-10-03Broken prev/next chainBuild fails.
F-10-04Unknown schema versionReader warns/blocks depending major version.
F-10-05Article alias list leaks internal/debug URLSanitize public manifest; internal evidence remains elsewhere.
F-10-06Source title contains HTML/scriptEscape visible HTML and encode safely in JSON.
F-10-07Generated filename collidesBatch compiler must deterministically derive unique filenames from ranges.
F-10-08Partial dataset presented as completedataset_status and validation summary must explicitly say PARTIAL.

14 / Definition of Done

IDCriterion
A-10-01A new AI session can understand one dataset by reading MASTER INDEX without chat history.
A-10-02Every batch is self-describing and links back to root.
A-10-03Every visible article has matching machine-readable record.
A-10-04Article records remain minimal for humans while sufficient for machine traversal.
A-10-05Schema supports exactly 30-per-batch plus final partial batch.
A-10-06Article prev/next traversal works across batch boundary.
A-10-07Batch prev/next traversal works from first to last.
A-10-08MASTER lists every batch exactly once.
A-10-09Schema and template versions are separate.
A-10-10Build contains no secrets/internal filesystem paths.
A-10-11Manifest is valid JSON and parseable without executing page JS.
A-10-12Validation detects visible/machine divergence.
A-10-13Unknown optional fields do not break 1.x readers.
A-10-14A 65-article fixture renders and validates as 30/30/5 with complete graph.

15 / Luna Medium bounded blocks

BlockScopeExpected result
LUNA-10-AJSON schema/data classesDefine MASTER/BATCH/article contracts and required fields.
LUNA-10-BNavigation graph compilerprev/next article + batch + master links.
LUNA-10-CManifest serializersSafe JSON embedding and deterministic output.
LUNA-10-DVisible ↔ manifest bindingdata-* IDs and exact title/URL consistency.
LUNA-10-EVersioning contractschema/template/build versions.
LUNA-10-FValidatorCounts, ranges, graph reciprocity, JSON parse, no-secret checks.
LUNA-10-GFixture suite0/1/29/30/31/60/61/65 article datasets.

16 / Handoff

NEXT PLANNING ARTIFACT Statiya_poluchatel_1_11_BATCH_HTML_AND_MASTER_INDEX.html SP-11 will define: - exact HTML composition - MASTER INDEX layout - batch page layout - article row/card markup - embedded JSON placement - prev/next links - local filtering/search if useful - rendering pipeline - 30/30/.../partial batch generation - browser and machine validation