Skip to content

feat: show the submitter of an enclave job every data owner's approval - #9647

Merged
koenvanderveen merged 4 commits into
devfrom
koen/enclave-submitter-sees-approvals
Nov 20, 2026
Merged

koenvanderveen merged 4 commits into
devfrom
koen/enclave-submitter-sees-approvals

Conversation

@koenvanderveen

@koenvanderveen koenvanderveen commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • When the submitter (DS) of an enclave job looks at the job, in the job view or with print(job), it previously saw only "Requested". Now, once the enclave has distributed the job, it also sees the two rows a data owner (DO) sees since feat: show every data owner's approval of an enclave job to each data owner #9629, with a line per DO:
    • "Job approved": ✓ when that DO approved, ✗ and its reason when it rejected, and "pending" when it has not decided yet.
    • "Output files approved": the files that DO approved, and for whom, or "none".
  • When the enclave distributes a job, it previously let only the DOs read the approval files. Now the submitter may read them too, so the enclave's sync sends each approval file, and each later change to it, to the submitter as well. This adds at most one message to the submitter per sync pass in which an approval file changed.
  • When a party reads an enclave job's status, the enclave, a DO and the submitter previously each worked it out differently: the enclave from the approval file of every DO in its config, a DO from its own approval file only, and the submitter from the job's state, which never says rejected. Now they all use the same rule on the approval files they hold: rejected when a DO rejected, approved when every DO approved this submission, and pending otherwise. So a DO that approved sees pending until every DO approved, and the submitter sees rejected after a rejection. The enclave still uses the DOs in its config, so a missing approval file counts as no approval. With no DOs configured, a job is never approved, even when its state says approved.
  • JobInfo.read_permission_rows(), and its override in EnclaveJobInfo, is renamed to read_permissions_repr_rows(), because it gives the rows that the job's repr shows. It is a public method, but only the job repr, str(job) and the tests call it.

Guidelines

High level

  • 🟢 Split: no need to split.
  • 🟢 Size: show the submitter of an enclave job every DO's approval, and give every party the same status.

Mid level

  • 🟢 User-facing code
  • 🟢 Error handling
  • 🟢 State versioning: no new state. Only who may read the approval files changes.
  • 🟢 Function structure
  • 🟢 Tests

Low level

  • 🟢 Naming
  • 🟢 Code style

Security

The submitter can now read every DO's approval file: its decision and when it made it, the files it approved and for whom, and its rejection reason. Before, only the enclave and the DOs could. No dataset contents are in the file. The submitter cannot write any approval file, and a DO can still write only its own; the enclave drops any other change. The test checks this.

The enclave's decision to run a job does not change: run_jobs starts a job only once every DO in its config approved this exact submission, and no DO and not the submitter can write the job's state or owner record, which start a run.

The signed receipt already told the submitter which DOs approved and when, after the run. The job view does not read the receipt.

Testing

  • test_owners_and_submitter_see_every_approval (was test_data_owner_sees_every_owner_approval): the submitter sees the same rows as DO 1, every party may read DO 2's approval file, and only DO 2 may write it.
  • test_owners_and_submitter_see_every_approval also checks that DO 1's status is pending after its own approval, and that every party sees rejected after DO 2 rejects.
  • test_run_jobs_waits_for_every_data_owner: run_jobs does not start a job that only DO 1 approved, and starts it once DO 2 approved too. No DO and not the submitter can write the job's state or owner record.
  • test_enclave_without_data_owners_never_approves: with no DOs configured, the enclave's status stays pending, even when the state says approved.
  • just test-unit-fast and the syft-enclave and syft-job tests pass.

Asana task

@koenvanderveen
koenvanderveen merged commit 2378255 into dev Nov 20, 2026
24 checks passed
@koenvanderveen
koenvanderveen deleted the koen/enclave-submitter-sees-approvals branch November 20, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant