Inspect source for changes; no public mutation.
01 / Главный lifecycle contract
После первого production deploy идентификатор статьи становится стабильным ключом. Если позже нашлась старая пропущенная статья, мы не перенумеровываем сотни существующих записей.
Первый релиз может не иметь кнопки «обновить dataset», но архитектура SP-07/SP-10/SP-12 уже должна позволять реализовать update без полного разрушения публичной идентичности.
02 / Update modes
Build a candidate update plan and show delta summary.
Add clearly new articles while preserving published IDs.
Fix title/canonical URL/aliases for same logical article without changing public ID.
Controlled migration when two published records are proven to be one logical article.
Mark source article unavailable/moved without deleting historical identity.
Re-render dataset from updated stable identity graph before deploy.
03 / Stable identity principles
| ID | Rule |
|---|---|
| I-15-01 | Public article_id remains bound to the same logical article after publication. |
| I-15-02 | Canonical URL may change if the logical article is the same. |
| I-15-03 | New historical articles do not trigger global renumbering. |
| I-15-04 | Routine update must preserve old working dataset URLs whenever possible. |
| I-15-05 | Aliases and redirect evidence accumulate over time. |
| I-15-06 | Corrections are versioned and reversible. |
| I-15-07 | Deleted/moved source pages are not silently forgotten from published history. |
04 / Change types
| Type | Meaning |
|---|---|
| NEW_ARTICLE | Valid article not present in published dataset. |
| URL_MOVED | Existing logical article now resolves to a new URL. |
| CANONICAL_CHANGED | Canonical preference changed but logical identity is same. |
| TITLE_CHANGED | Source title changed. |
| ARTICLE_REMOVED | Previously published source URL is unavailable or intentionally removed. |
| ARTICLE_REDIRECTED | Old URL redirects to another same-source article/location. |
| DUPLICATE_DISCOVERED | Two published records are now proven to be one logical article. |
| FALSE_POSITIVE_FOUND | Published record no longer meets accepted article policy. |
| SOURCE_ORDER_CHANGED | Current site chronology/order differs from original published sequence. |
| SOURCE_POLICY_CHANGED | robots/access/content structure changed. |
05 / Update flow
| Step | Action |
|---|---|
| 1 | Load deployed dataset manifest, identity version, build_id and current public IDs. |
| 2 | Run source preflight again using current rules, but in CHECK_ONLY/PREVIEW mode. |
| 3 | Discover/classify current source corpus without mutating published dataset. |
| 4 | Resolve current logical identities against existing published identity graph. |
| 5 | Generate delta set by change type. |
| 6 | Apply stability policy: preserve IDs, URLs/aliases may update, new IDs allocated only for new logical articles. |
| 7 | Build update preview with counts and risky conflicts. |
| 8 | OWNER GATE for destructive/ambiguous migrations. |
| 9 | Create new immutable dataset build in staging. |
| 10 | Run full SP-14 validation/benchmark subset relevant to update. |
| 11 | Deploy through SP-12 replacement/update path with rollback. |
| 12 | Persist update history/version and new build_id. |
06 / Новые статьи и ordering после публикации
| Rule | Policy |
|---|---|
| Default | Assign a new public article_id at the end of the stable ID namespace. |
| Sequence vs display order | Public ID order and display/order position may diverge after updates; do not renumber old IDs to force equality. |
| Manifest | Store stable article_id separately from current display_order/current ordering key. |
| Batch rendering | May rebuild batch files according to current display order only if existing public article anchors/IDs remain stable. |
| Alternative safe MVP extension | Append new articles to new batches without reshuffling historical batch files if simplicity/stability is preferred. |
| Owner decision | Final append-vs-reflow behavior is chosen in SP-16/implementation after evaluating URL stability and update UX. |
| Concept | Policy |
|---|---|
| Published ID | Immutable identity key. |
| Published sequence | Historical/original sequence may be retained as immutable field. |
| Current display order | May be recomputed from source chronology when update policy allows. |
| Batch membership | Can be treated as build-time presentation, not identity, if URLs do not encode immutable article meaning. |
| Risk | If batch filenames change due reflow, old inbound links may break; deploy policy must decide redirects/aliases or append-only batches. |
В первом production build article_id и sequence могут совпадать по смыслу. После обновлений стабильный ID и текущая display order могут разойтись. Это нормально и безопаснее, чем массовая перенумерация.
07 / Duplicate migration after deploy
| Step | Policy |
|---|---|
| Detect | Require strong identity evidence: redirects/canonical/source stable ID/content evidence. |
| Choose survivor | One existing public article_id remains canonical logical identity. |
| Retired ID | Do not silently reuse. Mark alias/tombstone → survivor. |
| HTML behavior | Old anchor/record may redirect or clearly state superseded-by, depending rendering strategy. |
| Manifest | Record superseded_by and migration_version. |
| Owner gate | Required before production mutation. |
08 / Removed / unavailable / false-positive records
| Case | Policy |
|---|---|
| Temporary fetch failure | Do not mark removed immediately. |
| Repeated 404/410 | Mark source_status=UNAVAILABLE/REMOVED after threshold/evidence. |
| Redirect | Treat as moved if identity consistent. |
| Dataset record | Keep public article_id and historical title/URL evidence. |
| Visible behavior | May show unavailable marker or keep source link with status metadata. |
| Deletion | Hard deletion from published identity registry is exceptional and owner-approved. |
| False positive | Policy |
|---|---|
| Before deploy | Remove freely and rebuild staging IDs/order. |
| After deploy | Do not silently delete/reuse ID. |
| Correction | Mark record RETRACTED_FROM_DATASET or superseded, depending severity. |
| Presentation | Optionally hide from default article list while preserving machine history/tombstone. |
| Owner gate | Required. |
| Reason | Preserve referential integrity for AI links, external references and future audits. |
09 / Update manifest
| Field | Purpose |
|---|---|
| update_id | Stable update attempt ID. |
| dataset_id | Target dataset. |
| from_build_id | Currently live build. |
| to_build_id | Candidate/new build. |
| started_at | Timestamp. |
| mode | CHECK_ONLY / PREVIEW_UPDATE / apply mode. |
| source_snapshot_ref | Current preflight/crawl evidence. |
| changes[] | Typed delta records. |
| added_count | New logical articles. |
| corrected_count | Metadata/canonical corrections. |
| removed_count | Unavailable/removed source records. |
| duplicate_merge_count | Controlled identity merges. |
| owner_gate_required | Boolean. |
| owner_decision | APPROVED / REJECTED / NOT_REQUIRED. |
| validation_status | PASS / FAIL. |
| deploy_status | NOT_STARTED / DEPLOYED / ROLLED_BACK. |
| Delta field | Purpose |
|---|---|
| change_id | Stable delta item. |
| change_type | One of defined types. |
| article_id | Existing public ID if applicable. |
| new_candidate_id | New candidate/logical identity if applicable. |
| old_value | Previous relevant state. |
| new_value | Proposed state. |
| evidence[] | Why change is believed true. |
| risk | LOW / MEDIUM / HIGH. |
| automatic_action | Allowed automatic behavior. |
| owner_action | Required approval if any. |
10 / OWNER GATE rules
| Gate | When |
|---|---|
| No gate required | Simple new article addition with high-confidence identity and no published-ID mutation. |
| Gate required | Duplicate merge involving published IDs. |
| Gate required | False-positive correction/removal of published record. |
| Gate required | Source root/domain identity migration. |
| Gate required | Large unexplained ordering/corpus delta. |
| Gate required | Any update that breaks old public URLs. |
11 / Update validation
| ID | Check |
|---|---|
| V-15-01 | All previously published non-retired article IDs still resolve to same logical articles. |
| V-15-02 | No retired ID is reassigned to new content. |
| V-15-03 | New article IDs are unique. |
| V-15-04 | Canonical corrections preserve logical identity evidence. |
| V-15-05 | Update delta totals match actual manifest diff. |
| V-15-06 | Rendered dataset passes SP-11 validators. |
| V-15-07 | Security checks from SP-13 still pass. |
| V-15-08 | Live deploy replacement passes SP-12 verification. |
| V-15-09 | Old required URLs/anchors either remain valid or have explicit migration/redirect policy. |
| V-15-10 | Rollback restores previous build_id and catalog state. |
12 / Structured update events
| Event | Payload |
|---|---|
| UPDATE_CHECK_START | dataset_id, from_build_id |
| UPDATE_DELTA_FOUND | change_id, change_type, article_id, risk |
| UPDATE_PREVIEW_READY | update_id, totals, owner_gate_required |
| UPDATE_OWNER_APPROVED | update_id, decision |
| UPDATE_BUILD_START | update_id, to_build_id |
| UPDATE_VALIDATION_OK | update_id, to_build_id |
| UPDATE_DEPLOY_OK | update_id, from_build_id, to_build_id |
| UPDATE_ROLLBACK | update_id, restored_build_id, reason |
13 / Failure modes
| ID | Failure | Required behavior |
|---|---|---|
| F-15-01 | Current source inaccessible | CHECK_ONLY/PREVIEW fails safely; live dataset unchanged. |
| F-15-02 | Huge unexpected corpus delta | Require owner review; no automatic apply. |
| F-15-03 | New historical article would shift all IDs | Allocate new stable ID instead; do not renumber. |
| F-15-04 | Canonical change points to unrelated article | Do not merge; conflict review. |
| F-15-05 | Duplicate discovered after publication | Controlled merge/tombstone, never ID reuse. |
| F-15-06 | Old article disappears temporarily | Do not immediately mark removed. |
| F-15-07 | Update build fails validation | Keep current live build. |
| F-15-08 | Replacement deploy fails | Rollback to previous build. |
| F-15-09 | Catalog update duplicates entry | Upsert by dataset_id. |
14 / Definition of Done
| ID | Criterion |
|---|---|
| A-15-01 | CHECK_ONLY can inspect changes without mutating public dataset. |
| A-15-02 | Published article IDs never silently change logical meaning. |
| A-15-03 | New historical article does not renumber existing IDs. |
| A-15-04 | URL/canonical correction preserves article_id when logical identity is same. |
| A-15-05 | Published duplicate merge requires controlled migration. |
| A-15-06 | Retired IDs are never reused. |
| A-15-07 | Source removal does not immediately erase historical dataset identity. |
| A-15-08 | Update preview clearly lists additions/corrections/removals/merges. |
| A-15-09 | High-risk/destructive update requires owner gate. |
| A-15-10 | New build is validated before replacement deploy. |
| A-15-11 | Rollback restores previous live build and registry state. |
| A-15-12 | Update history records from_build_id → to_build_id and typed deltas. |
| A-15-13 | Routine update remains compatible with AI-readable dataset schema. |
15 / Luna Medium bounded blocks
| Block | Scope | Expected result |
|---|---|---|
| LUNA-15-A | Existing dataset loader | Read deployed manifest/identity graph safely. |
| LUNA-15-B | Current-source comparator | Run preflight/crawl/classify in non-mutating mode. |
| LUNA-15-C | Delta classifier | Map differences to typed change records. |
| LUNA-15-D | Stable identity updater | Preserve IDs; allocate only new identities. |
| LUNA-15-E | Owner-gate rules | Risk classification and approval requirements. |
| LUNA-15-F | Update renderer | Build new immutable dataset version. |
| LUNA-15-G | Replacement deploy | SP-12-compatible replace/rollback flow. |
| LUNA-15-H | Migration regression suite | New historical article, moved URL, duplicate merge, removed article. |