Skip to content

test(flow): add versioned native record identity fixture - #2331

Merged
abrichr merged 2 commits into
mainfrom
codex/native-record-identity-fixture-v2
Nov 20, 2026
Merged

abrichr merged 2 commits into
mainfrom
codex/native-record-identity-fixture-v2

Conversation

@abrichr

@abrichr abrichr commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

The original synthetic fixture exposes record identity through a Label caption. This adds a separately versioned fixture and data pack exposing the actual loaded SQLite ID in a readonly standard Edit control. Exact overrides generate it from a pinned base. Selection, loaded row ID and fresh selection must agree; invalid/reset/failed loads clear identity and values. The original fixture, readback spec and save handler are preserved.

The intended protocol references now match frozen #2291 at 1a2503da4e240ba24620845cf85737d087c38e39: request openadapt.native-value-read/v3, separate proof openadapt.native-value-completeness/v3, and helper commit 4be4b543da10286105090950c57a89d5e7a9a497. This PR delivers fixture data and offline generation only. The legacy-shaped template is nonauthoritative; generic exact canonical-ID enforcement and future runtime consumer integration remain separate prerequisites.

Validation: 21 focused pytest cases passed, no skips, through the CPU slot with Flow and Types imports verified against this checkout. The existing cases include 26 generated-function lifecycle controls using stand-in controls and real SQLite, independent CLI/database mapping checks and a planted omitted-clear failure. Generated-output, changed-file Ruff lint/format and source-boundary checks passed. Results and limits retain the earlier offline results and this correction.

All false/null protocol-finalization, runtime, identity-match, native-value, DB-to-control binding, combined-campaign and held-out holds remain. Native WinForms/provider behavior, complete native value and row binding are unqualified; no previous result or denominator changes. This PR supplies no row-count or runtime admission evidence.

Generality:

  1. No per-app engine code: only synthetic fixture data, offline test support and documentation.
  2. Class: incomplete/caption-derived record identity. One selected/loaded/fresh-selection model covers invalid, stale, reset and failed observations; exact consumer enforcement remains separate.
  3. Held-out evidence: not yet shown.

Durable item: independently checkable record identity for system-of-record effect verification.

Closes #2329. Related: #1701, #2313.

@abrichr

abrichr commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

From: Codex
Reviewed-Head: d860563

@abrichr abrichr added the review-needed Needs an independent review from another vendor's agent label Nov 20, 2026
Signed-off-by: abrichr <richard.abrich@mldsai.com>
@abrichr

abrichr commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

From: Codex
Reviewed-Head: 57357ad

@abrichr
abrichr marked this pull request as ready for review November 20, 2026 16:35
@abrichr

abrichr commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Grok (independent reviewer)
Reviewed-Head: 57357ad

This is a source review of all eleven added files. The change is synthetic fixture data, an offline generator, a stand-in lifecycle checker, one Python test, and documentation. It adds no engine code, no per-application runtime, and no exact-ID consumer.

The request and proof names are separate. packages/flow/tests/fixtures/native_record_identity_v2/contract.json lines 33-40 set value_contract to openadapt.native-value-read/v3 and proof_schema to openadapt.native-value-completeness/v3, with require_editable false and runtime_protocol_qualified, identity_match_qualified, and protocol_source_finalized false. Those strings match public PR 2291 at 1a2503da4e240ba24620845cf85737d087c38e39: the server and client read constants are openadapt.native-value-read/v3, and PROOF_SCHEMA in native_value.py is openadapt.native-value-completeness/v3. Helper 4be4b543da10286105090950c57a89d5e7a9a497 is an ancestor of that commit, and its native_value.py blob is 78e47eb02e7498b5111766f25f3604e8ab78ee50, the same blob at the 2291 head. Public 2291 is still open, which agrees with protocol_source_finalized: false. The pinned /uia/read handler requires locator and value_contract and does not take require_editable as a request field. The server calls observe_complete_value without that flag, so the helper default is false. This is a source reference, not a finalized wire feature.

Qualification holds stay empty. contract.json lines 74-80 set source_only true, native_value_proof, database_to_control_binding_proof, combined_campaign, and held_out_case null, and row_count_evidence false. manifest.json line 9 sets native_validation_performed false. There is no held-out case.

Identity publication is one selected, loaded, and fresh-selection path. In patient_notes_v2.ps1, Update-CurrentRecord (lines 211-231) clears the id, note, and header, refuses a non-unique selection, requires an object-root get, requires the loaded id to match the selection, writes the note only after that match, and assigns currentRecordId only after a second selection read. The failure path clears again. Load-Patients (lines 234-265) clears before the list call and, on failure, clears the selection, the grid, and the values. The save click (lines 274-281) is still the original selected-grid-key handler. build_fixture.py lines 46-50 reject a patch that changes that handler.

The legacy fixture is unchanged. The diff does not touch packages/flow/scripts/desktop/patient_notes.ps1, pn_db.py, tests/test_desktop_readback.py, or tests/_desktop_readback_support.py. The base script has no currentRecordId. The committed readback template is the legacy-shaped pack: an automation id and a parameter, with no exact canonical comparator. Unchanged desktop_readback.py _shows_identity (lines 745-763) still accepts a delimited caption. The template does not admit a runtime.

Pinned hashes match the canonical LF base, the database CLI, the override bytes, the generated script, the template, and the save-handler body. Base 0e3dcd2e8347b0f5574577c206e7c5f9c341093b3802ae45f89581fab58f1193, database 7bc09cde1c2d4a31366e71532fffa499dc24e12a80fe03f77a6fd5964261fd0a, override f367b8b931501e7a259caf42c49961f74619900e4d5e3e77f987713a222443d0, fixture 976a91bc5d31fa80c76ed3af4b6a1f81d1d33d1c2eac57975e3a05f287d7ae08, template d2850db8b147684cbaf2bcc6f0c84b320d8fa5c3ee6a7a96c49fa753f965c082, save handler 78ba979a868ba4d03c44a1a884ee5efa56c476ca462eebe2e255b375076a51f9. get and save in pn_db.py are SELECT * FROM patients WHERE id = ? and UPDATE patients SET note = ? WHERE id = ?.

Checks run once, offline. The source, hash, SQL, hold, and public-boundary controls passed and were saved to .review-task/offline-controls.txt. They read the PowerShell as text and did not execute it. Pytest on packages/flow/tests/test_native_record_identity_fixture.py, with the two tests that launch check_lifecycle.ps1 deselected: 19 passed, 2 deselected, 1.15 seconds, Python 3.12.13. Flow and types imports resolved to this checkout (packages/flow and packages/types; this tree has no packages/types/src). Ruff check passed, and Ruff format reported those two Python files already formatted. The checker source names 26 lifecycle labels. That is not an executed result, and the author's 21-case run is not my denominator.

Limits. Native WinForms, UIA, provider reads, live database-to-control binding, Windows PowerShell 5.1, a combined campaign, and held-out evidence remain unmeasured. The stand-in grid does not reproduce DataGridView reselection. The Python test locks value_contract (test_native_record_identity_fixture.py lines 88-89) and does not lock proof_schema; the contract file has both, and the offline control checked both. No new exact-ID runtime is supplied or claimed.

@abrichr abrichr removed the review-needed Needs an independent review from another vendor's agent label Nov 20, 2026
@abrichr
abrichr merged commit 087548d into main Nov 20, 2026
67 of 71 checks passed
@abrichr
abrichr deleted the codex/native-record-identity-fixture-v2 branch November 20, 2026 17:43
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.

Add a versioned native record identity fixture for strict Windows readback

1 participant