Repository navigation
feat(jit): a person names the record check's idempotency key at confirm_params - #1339
Merged
Merged
Conversation
…rm_params The openIMIS claim program's mined record check already selects the saved claim by the confirmed claim_no parameter, but carried no at-most-once key, so clinical-write's require_idempotency_key_for refused it (#1329). confirm_params (and `jit review --idempotency-key PARAM`) takes the parameter that identifies one saved record. It must be a task parameter that a mined record-written check selects by (placeholders don't count); otherwise it refuses and lists the parameters it could take. The check gets idempotency_key=param and key_field=that field, the bundle is re-sealed, and the recorder is re-signed for the new digest, as after the parameter recompile. The params record and status() list the keys. The gate is unchanged. Refs #1329 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y-key # Conflicts: # packages/flow/docs/JIT.md
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.
Addresses the idempotency-key refusal in #1329. The other refusals in that issue are correct, and this PR doesn't change them; see the analysis comment on the issue.
Problem
The openIMIS claim program's mined record check already selects the saved claim by the confirmed
claim_noparameter, withexpected_count=1. It carried noidempotency_key, soclinical-write'srequire_idempotency_key_forrefused the save step (step_015). One run can't show which input identifies a record, so this needs a person to name it.Change
confirm_params(..., idempotency_key="claim_no"), on bothCompiledAgentandlifecycle, andopenadapt-flow jit review --idempotency-key claim_no.record_writtencheck selects its record by. A placeholder check doesn't count, and neither does a parameter bound to two fields. Otherwise it refuses and lists the parameters it could take.idempotency_key=ValueExpr(param=...)andkey_field=<that field>. The bundle is re-sealed and the recorder re-signed for the new digest, as after the parameter recompile. The params record andstatus()list the keys.verify.yaml'srecord.duplicate_keyapplies in qualify.It detects a duplicate after the write; it doesn't prevent one. Name a key only when the app keeps the value unique.
Evidence
The recorded openIMIS first run (
launch-4, #1303), rebuilt offline on #1303 + #1336 + this branch. No model calls.require_reviewed_action_riskon step_002 and step_012,require_human_approval_below_confidenceon step_012 and step_015, andrequire_idempotency_key_foron step_015.idempotency_key="claim_no": the key is bound on step_015 (claim_no), confirm and review succeed, and only the four risk and confidence violations remain. Still not admitted.Tests
tests/test_jit_lifecycle.py, synthetic claim bundle:Results:
tests/test_jit_lifecycle.py: 55 passed.tests/test_jit.pyandtests/test_jit_surface_pixels.py: 41 passed.This adds no new command (an option on
jit review), so CAPABILITIES.md doesn't change.docs/JIT.md(Parameters) is updated.🤖 Generated with Claude Code