Repository navigation
Preserve generated document namespace for audit identity - #685
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Evidence
Governing issue and intended outcome
Implementation scope
Major files or components changed: preserved-artifact document/audit identity reconciliation, focused production-shaped regression coverage, and hosted-backfill developer documentation.
Important behavior intentionally left unchanged or out of scope: schemas, migrations, connectors, source retrieval, importer semantics, reviewer-created state, deployment, production execution, and Issue Fix preserved-artifact backfill failures for 27 facilities #476.
Existing source-document selection remains facility-scoped and persisted-identity ordered; no positional cross-document matching was introduced.
Reviewer UI regression contracts: RT-RC-004 and RT-RC-006 remain protected invariants; no reviewer-facing presentation or interaction changed.
Root cause
Connector normalization generated a current document ID and audit IDs in that namespace. During preserved-artifact replay, persisted source-document original values replaced normalized source-document metadata before
_preserve_stable_identitiescaptured the generated document ID. As a result, unmatched audit IDs still carried the generated namespace, but the prefix-translation step no longer knew that generated namespace and emitted new source-record keys.The correction captures the connector-generated document ID before persisted document metadata is restored. Existing audits continue to reconcile only within the correct persisted source document; genuinely unmatched audits are translated into that historical document scope.
Acceptance-criteria evidence
ccld-...-inx-...namespaces.Validation and failure classification
C:\Repos\CCLD-complaints-poc\.venv\Scripts\python.exe -m pytest tests/unit/test_hosted_ccld_backfill.py::test_preserved_artifact_scopes_new_audits_to_historical_document_identity -qccld-...-inx-...prefixesC:\Repos\CCLD-complaints-poc\.venv\Scripts\python.exe -m pytest tests/unit/test_hosted_ccld_backfill.py::test_preserved_artifact_scopes_new_audits_to_historical_document_identity -qC:\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 -qC:\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.pyC:\Repos\CCLD-complaints-poc\.venv\Scripts\python.exe -m mypy src/ccld_complaints/hosted_app/ccld_backfill.py.\scripts\docs.ps1withC:\Repos\CCLD-complaints-poc\.venv\Scriptsprepended to PATHgit diff --checkjsonschema, then the documented shared runtime passed.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 redesign.
Documentation, assumptions, and remaining risks
Governed-boundary review
Required GitHub checks
validatedocs-checkfixturessecurity