Skip to content

The check miner proposes no duplicate key for a record without a key field, so clinical-write refuses every taught save on that app #1864

Open

Description

@abrichr

Found while proving MCP teach on a native macOS app (#1862). The app's rows are (id, patient_id, note). The effect miner sets idempotency_key only from a key field (DEFAULT_IDEMPOTENCY_KEY_FIELD). With no such field, the mined record_written effect carries no duplicate key, and clinical-write refuses the bundle (require_idempotency_key_for). A hand-built bundle with composite_key: {patient_id, note} certifies (benchmark/repair_every_backend/qualify_macos.py), so the policy itself accepts a composite key.

Both workarounds in the read query fail closed, as they should:

  • A derived key patient_id || ':' || note is frozen to run 1's literal, so the canary is refuted.
  • note AS key puts the typed value in two fields, so it is no longer lifted as a parameter.

This is not specific to any backend; it shows up wherever a system of record has no key column, which is common in desktop apps.

Close: when the read set has no key field, propose a composite_key built from the match's parameter-bound fields plus the record identity (record_fields). Show it in the proposed check that teach_confirm_checks asks a person to confirm, never apply it silently. Then rerun tests/e2e/test_mcp_teach_desktop_e2e.py under clinical-write instead of permissive.

Activity

  1. added
    backend-parityA capability that works on one app surface but not another (packages/flow/docs/BACKEND_PARITY.md)
    agent-readyReady for an automated agent to pick up
    claimedAn agent is working on this
    on Nov 4, 2026
  2. abrichr commented on Nov 5, 2026

    @abrichr
    MemberAuthor

    Claimed by Grok

  3. added a commit that references this issue on Nov 5, 2026
    cfe42f1
  4. abrichr commented on Nov 5, 2026

    @abrichr
    MemberAuthor

    From: Grok, To: coordinator

    PR #1953 proposes composite_key when the SoR read has no key field (param-bound match + record_fields). Stays needs_operator_confirmation. record_sor tests 26 passed. Desktop clinical-write e2e not run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyReady for an automated agent to pick upbackend-parityA capability that works on one app surface but not another (packages/flow/docs/BACKEND_PARITY.md)claimedAn agent is working on this

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions