Skip to content

Finish preserved artifact idempotence correction - #683

Merged
nicho1ab merged 1 commit into
mainfrom
issue-475-residual-idempotence-correction
Aug 10, 2026
Merged

nicho1ab merged 1 commit into
mainfrom
issue-475-residual-idempotence-correction

Conversation

@nicho1ab

Copy link
Copy Markdown
Owner

Pull Request Evidence

Governing issue and intended outcome

Implementation scope

  • Major files or components changed: preserved-artifact provenance reconciliation, allegation semantic sibling identity reconciliation, focused Make preserved-artifact backfills safely repeatable #475 regressions, and hosted-backfill developer documentation.
  • Important behavior intentionally left unchanged or out of scope: schemas, migrations, source connectors, live retrieval, facility-reference precedence, event/extraction-audit reconciliation, reviewer-created state, reviewer UI presentation, deployment configuration, Issue Fix preserved-artifact backfill failures for 27 facilities #476, and production execution.
  • Reviewer UI regression contracts: RT-RC-004 and RT-RC-006 remain protected invariants. Stable source-derived identities, source-document relationships, reviewer-created-state separation, fixture relationships, and reviewer/audit relationships remain protected; no reviewer-facing presentation or interaction changes.

Acceptance-criteria evidence

Acceptance criterion Evidence and result
Final-projection provenance idempotence PASS - regression proves superseded duplicate projections no longer cause provenance-only repeat writes when the complete importer-visible final representation is equivalent.
Genuine provenance change detection PASS - added, removed, or genuinely changed final projections retain newly generated provenance and remain update-detectable.
Semantic allegation sibling identity PASS - historical allegations are associated by source-derived semantic content before positional identity reservation; insertion at ordinal 2 preserves historical sibling IDs and allocates a collision-free ID to the genuinely new allegation.
Immediate preserved-artifact repeat PASS - regression lifecycle reports updated=0 and unchanged=1.
Equivalent canonical replay PASS - equivalent canonical-complaint-observations replay reports updated=0 and unchanged=1.
Second apply idempotence PASS - second apply performs zero source-derived writes.
Genuine allegation correction PASS - genuine governed allegation change reports updated=1.
Protected state PASS - stable IDs, source-document relationships, raw hashes, import scope, conflicts/traceability, reviewer-created state, and audit history remain protected by assertions.
Production acceptance Pending - merge/deployment must complete retained-29 dry/apply/repeat and final retained-312 zero-update dry run before #475 closes.

Validation and failure classification

Exact command Result Failure classification, if applicable
C:\Repos\CCLD-complaints-poc.venv\Scripts\python.exe -m pytest tests/unit/test_hosted_ccld_backfill.py::test_preserved_artifact_identity_uses_final_persisted_projections -q Expected pre-fix FAIL - 1 failed because an intermediate-only projection changed artifact identity implementation-caused behavior reproduced before correction
C:\Repos\CCLD-complaints-poc.venv\Scripts\python.exe -m pytest tests/unit/test_hosted_ccld_backfill.py::test_preserved_artifact_insertion_keeps_allegation_semantic_siblings -q Expected pre-fix FAIL - historical sibling 2 received stable ID 3 implementation-caused behavior reproduced before correction
C:\Repos\CCLD-complaints-poc.venv\Scripts\python.exe -m pytest tests/unit/test_hosted_ccld_backfill.py::test_preserved_artifact_identity_uses_final_persisted_projections -q PASS - 1 passed in 0.63s none
C:\Repos\CCLD-complaints-poc.venv\Scripts\python.exe -m pytest tests/unit/test_hosted_ccld_backfill.py::test_preserved_artifact_insertion_keeps_allegation_semantic_siblings -q PASS - 1 passed in 0.50s none
C:\Repos\CCLD-complaints-poc.venv\Scripts\python.exe -m pytest tests/unit/test_hosted_ccld_backfill.py tests/unit/test_hosted_seeded_corpus_import.py -q PASS - 23 passed in 4.88s none
C:\Repos\CCLD-complaints-poc.venv\Scripts\python.exe -m pytest tests/unit/test_hosted_ccld_backfill.py::test_preserved_artifact_repeat_is_unchanged_with_duplicate_complaint_projections tests/unit/test_hosted_ccld_backfill.py::test_preserved_artifact_repeat_is_unchanged_when_extraction_adds_child -q PASS - 2 passed in 3.72s none
C:\Repos\CCLD-complaints-poc.venv\Scripts\python.exe -m ruff check src/ccld_complaints/hosted_app/ccld_backfill.py tests/unit/test_hosted_ccld_backfill.py PASS - All checks passed none
C:\Repos\CCLD-complaints-poc.venv\Scripts\python.exe -m mypy src/ccld_complaints/hosted_app/ccld_backfill.py PASS - no issues found in 1 source file none
C:\Repos\CCLD-complaints-poc.venv\Scripts\python.exe -m ruff format --check src/ccld_complaints/hosted_app/ccld_backfill.py tests/unit/test_hosted_ccld_backfill.py FAIL - broader unchanged formatter drift remains pre-existing non-governing formatter drift; no unrelated bulk reformat performed
.\scripts\docs.ps1 FAIL - No module named jsonschema environmental PATH-Python prerequisite failure; not relied upon for passage
C:\Repos\CCLD-complaints-poc.venv\Scripts\python.exe scripts/check_docs.py PASS - Documentation check passed none
git diff --check PASS - exit 0 with no output none
git diff --check; git status --short; git diff --name-only; git rev-parse HEAD; git branch --show-current PASS - only the three intended files; base and branch remained correct none
C:\Repos\CCLD-complaints-poc.venv\Scripts\python.exe scripts/audit_portable_paths.py publication --field handoff --input C:\tmp\issue-475-residual-correction-handoff.txt PASS - Portable-path contract passed none
C:\Repos\CCLD-complaints-poc.venv\Scripts\python.exe -m pytest Not run - bounded residual correction used focused validation and required GitHub CI remains the repository-wide gate none
  • Implementation-caused failures: Both new regressions intentionally reproduced the two current defects before correction. One post-correction Class B execution also exposed an incorrect test assertion comparing the complete pre-insertion key set with the intentionally enlarged post-insertion set; the assertion was corrected to preserve every existing key/hash pair and require the post-apply snapshot to remain stable. A transient implementation that globally changed fingerprint serialization was rejected before final validation because it would rotate provenance for already-stable facilities.
  • Pre-existing failures: Supplemental Ruff format check reports broader unchanged formatter drift; no unrelated reformat was used to obtain passage.
  • Environmental failures: .\scripts\docs.ps1 selected PATH Python without jsonschema in the secondary worktree; the documented shared primary Python runtime completed scripts/check_docs.py successfully.
  • Tests intentionally not run and why: Full local pytest suite was intentionally not run because the correction remained bounded; required GitHub CI remains the repository-wide merge gate.

UI and accessibility evidence (when applicable)

Not applicable - no UI or accessibility change.

Reviewer-facing redesign artifact classification (when applicable)

Not applicable - no reviewer-facing removal, merge, rename, relocation, replacement, or redesign.

Documentation, assumptions, and remaining risks

Governed-boundary review

Governed boundary Status Specific explanation or evidence
Schemas and migrations No change No schema or migration changed.
Ingestion and source-connector contracts No change No connector or live-source retrieval contract changed; correction is confined to preserved-artifact replay/reconciliation.
Security and privacy No change No authentication, authorization, secret, private-data, or reviewer-state handling changed.
Production data and correction behavior Authorized change Equivalent persisted source semantics may reuse the existing uniquely resolved artifact provenance; semantic allegation identities are reconciled before positional fallbacks. Genuine source changes remain update-detectable.
Deployment and infrastructure No change No Docker, Compose, QNAP, Cloudflare, host, port, or deployment configuration changed.
Repository governance No change No repository governance file, policy, or workflow changed.
Required GitHub workflows and checks No change validate, docs-check, fixtures, and security remain required and unchanged.
Tests or checks weakened to obtain passage Authorized change Focused regressions were added/strengthened for both residual defect classes. No test, assertion, required workflow, or check was removed, skipped, relaxed, or weakened to obtain passage.

Required GitHub checks

  • validate
  • docs-check
  • fixtures
  • security

@nicho1ab
nicho1ab merged commit ecfc53f into main Aug 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant