Repository navigation
data: R01 - superseding reassessment writer for a live revision (ADR-0074 A2.3) - #530
Conversation
… (ADR-0074 A2.3) (#519) Appends one new quality report (a fail that retires a valid revision, or a pass that restores it) for the current live revision of one natural partition, then runs the existing A16 lifecycle seam. The report is filed under the same suite and profile as the assessment it supersedes, copies its bound evidence unchanged, carries metrics.supersedes_assessment_signature = the exact signature of the current leaf, and must pass current_partition_report before anything is written. Idempotent; refuses a superseded, writing or closed revision, foreign evidence, a different dataset or key. Two short transactions (report, then the seam); a crash between them converges on a repeat. Tests: unit (argument rules), real-PostgreSQL gate (retire/restore, supersession link, evidence copy, reads exclude the retired revision under every policy, bytes/manifests/reports untouched, refusals write nothing, a concurrent S13 publication waits for the writer, no lock held after, crash window), a CI job, mutation: 22 mutants, 0 survivors. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
GitHub rifiuta la review formale perche autore e revisore condividono la credenziale NeoNix-Lab (Can not approve your own pull request). Questo commento e il report di fallback: APPROVE e il verdetto tecnico, senza stato formale di approvazione GitHub. Review indipendente / avversaria di #530 (R01, issue #519), commit Esito: APPROVE tecnico sul perimetro R01 esaminato. Nessun finding azionabile. Nessun merge o operazione sui dati di produzione eseguito. Semantica e confini. Ho letto il mandato #519, SCOPE Part D, ADR-0074 Amendment 2 A2.3/A2.5/A2.7 e ADR-0030, oltre ai documenti canonici del repository. Il delta e limitato al nuovo writer data-plane, ai test, alla mappa dei moduli e al job CI. Nessuna modifica di schemi, ADR, governance, S13/S14, repair, retention o contratti frozen. Il writer usa il dataset lock prima della topologia, seleziona il current leaf con il resolver A16, copia le evidenze legate al target e il relativo profilo/suite e applica lo stato tramite la seam A16. Non sostituisce la registrazione ordinaria di S13. Prova PostgreSQL della PR rieseguita sul commit esatto: valid -> invalid -> valid; supersession link e firma del leaf; evidenze e report precedenti conservati; idempotenza; invariabilita di Parquet e manifest; rifiuti senza scrittura nei casi previsti (bound evidence, dataset/key/revision, stati non ammessi, warn -> pass); esclusione da tutte le lifecycle policy; pubblicazione S13 concorrente su un altro giorno dello stesso dataset bloccata dalla transazione del writer e poi completata; nessun lock trattenuto dopo; crash tra report e lifecycle e retry; sensitivita del fail ad archive identity e commit; record_quality_report ordinario continua a rifiutare una partizione non closed. Gate PASS. Probe aggiuntivi indipendenti, su un altro database e fixture importata dal percorso canonico:
La finestra fra commit del report e applicazione della lifecycle resta quella esplicitamente descritta dal disegno a due transazioni: non e una rivalutazione atomica con l'import. Ho verificato la convergenza del retry, non un effetto di cutover atomico, che ADR-0074 A2.8 esclude da questa slice. Consumer dello stato invalid: le tre LifecyclePolicy di access non lo includono e il catalogo filtra gli stati in un unico SELECT; la prova PostgreSQL conferma l'esclusione anche da VALID_AND_CLOSED e VALID_CLOSED_AND_DEGRADED e il rifiuto strict. Retention ammette solo closed/valid/degraded/superseded, quindi invalid non diventa automaticamente un candidato di cancellazione. L'ammissione K12 seleziona tramite DataGateway; nessun meccanismo di revoca o riscrittura di manifest gia sigillati e introdotto qui. L'A10 puo riconoscere il trigger invalid/fail soltanto quando qualcuno invoca esplicitamente un repair intent; nessun automatismo o nuova fonte di repair e aggiunto. Altre verifiche:
Evidenze fuori Git in WSL La review non attesta R02, rebuild delle 31 giornate, scelta o esecuzione di un piano sui dati reali, cleanup/retention, deployment o governance di chiusura. Nessuna patch, push, merge o operazione su sistemi/dati di produzione. |
data: R01 - superseding reassessment writer for a live revision (ADR-0074 Amendment 2, A2.3)
Refs #519. Parent: DG-R (
SCOPE.mdPart D,R01). Post-version;R02(#520) comes after.What changes
src/quant_platform/data/quality_reassessment.py(new, next toquality_lifecycle.py; data plane, no import ofaccess):reassess_live_partition(connection, inputs=..., status="fail"|"pass", ...)appends one newcatalog.quality_reportsrow for the current live revision of one natural partition, then applies the existing A16 seam (QualityLifecycleCatalog.apply_partition_lifecycle):failtakes avalidrevision toinvalid, a supersedingpasstakes it back tovalid. Nothing is deleted or rewritten.certification_profile,natural_partition_identity, manifest and artifact hashes, coverage ids and hashes, the evidence categories), sets the coverage category status and, forfail, a violationlegacy_publication_incomplete_daynaming the archive identity;metrics.supersedes_assessment_signatureis the exact semantic signature of the current leaf;code_refis the producing commit. It must passcurrent_partition_reportbefore anything is written.failwith another archive identity or another commit is a different assessment and supersedes the current one.writingorclosed(ordinary S13 ownsclosed,record_quality_reportis unchanged), a revision absent from its key, a foreign dataset, durable evidence that does not equal the catalog (hashes, coverage, storage root), awarnleaf that apasscannot be built over, a bad status, a blank commit, afailwith no archive identity.FOR UPDATE, then the key's topology). Two short transactions, each committed on its own, as the issue's design 4 says: the report, then the seam. A crash between them leaves a currentfailwith the state stillvalid; repeating the call converges (no second report; the seam applies the state).load_lifecycle_inputs(dataset_manifest, partition_manifest, coverage_manifests)reads and hashes the three durable manifests with the loader S13 uses and returns what the seam needs.quality-reassessment-postgres(own database). Module map entry in the package-boundary test.To verify first (issue): who reacts to
invalidaccess/catalog.pyselectsp.state = ANY(policy states);invalidis in none of the three lifecycle policies, soVALID_ONLY,VALID_AND_CLOSEDandVALID_CLOSED_AND_DEGRADEDall exclude it (proved on PostgreSQL).operations/retention.py): candidates must be in_FINALIZED_STATES = {closed, valid, degraded, superseded};invalidis not one, so a retired revision is refused as a deletion candidate, not offered as one.catalog.partitions.stateitself (no separate eligibility table); K12 admitted inputs read through the gateway.data/repair.py): aninvalidlive revision with afailleaf isREPAIR_REQUIREDif someone runs a repair intent for that key. Nothing runs one automatically (ADR-0044: no authoritative repair source). Worth knowing forR02; no change here.Tests
tests/test_quality_reassessment_v1.py(5): the argument rules, no catalog access on a refused call.tests/integration_quality_reassessment_postgres.py, real PostgreSQL, a partialETHUSDTday imported through the ordinary S13/S14 path (avalidrevision with apass): retire (valid -> invalid), the supersession link equals the original leaf's signature, the evidence is copied unchanged (all categories but coverage), the violation names the archive; every lifecycle policy excludes the retired revision (and astrictread refuses); the Parquet, the partition manifest, the catalog row and the earlier report are byte-identical; idempotence; restore by a supersedingpass, re-retire supersedes the restore; refusals (wrong status/commit/archive, wrong partition or dataset hash, coverage end, storage root, missing revision,writing,closed,superseded, a foreign dataset) each write nothing; a concurrent S13 import on the same dataset waits for the writer's transaction and proceeds, and no lock is held afterwards (FOR UPDATE NOWAITsucceeds); the crash window converges; awarnleaf refuses apassand accepts afail;record_quality_reportstill refuses a partition that is notclosed.current_partition_reportgate, dataset lock, seam applied, commit before the seam, argument rules, violation content, inserted flag, superseded signature). Four survived the first round: two were redundant checks (removed or merged: thewritingmessage and the live-revision equality, which the unique index and the superseded check already imply), one needed thewarntest, one needed the crash test to read through a second connection; all caught now.Not claimed
R02; no production run; nothing deleted; no retention or cleanup code touched; no governance file, ADR, schema or migration changed.integration_a10_repair_postgres.pyfails in my local WSL PostgreSQL 16 ("injected mid-cutover DB failure was not raised") with or without this change (checked on a clean tree); it does not import the new module. I have not read this PR's CI.Checks
Unit tests of the area, ruff, markdown links,
git diff --check,workflow.py preflight --base implement/fid, package boundaries; the new PostgreSQL gate and the publication-certification gate pass on a disposable PostgreSQL 16.🤖 Generated with Claude Code