镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

feat: clearer messages when an api call is refused or held back - #9576

Open
atlaie wants to merge 1 commit into
devfrom
atlaie/policy-ux-messages
Open

atlaie wants to merge 1 commit into
devfrom
atlaie/policy-ux-messages

Conversation

@atlaie

@atlaie atlaie commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Found while testing #9566 end to end in Colab: when a policy refuses or holds back a call, the evaluator gets messages that point to the wrong place, and the DO doesn't see an api's arguments or a job's parameters. This only changes messages and displays; no behaviour changes.

Changes

  • job.output_paths: a call refused by a policy prints the reason and points to job.policy_error, not to job.stderr (which the evaluator doesn't get). Other failures still point to job.stderr.
  • job.output_paths: a done job whose outputs the output policy held back says so, and that the data owner can still share them, instead of blaming the script.
  • A blocking api call prints why it ended (the refusal reason, or that the outputs were held back), through a small _print_call_result helper.
  • The api table has a Policies column (input, output, input, output or -), and the text view shows the same.
  • ApiResult lists the api's arguments and says when set_policies cleared the state; print(result) now shows the same text as repr(result).
  • The job view shows code/params.json in a Parameters section, pretty-printed and escaped.

Testing

  • Ran uv sync --all-packages, just test-unit-job (157 passed), just test-unit-rds (155 passed), uv run pytest tests/unit/syft_bg (174 passed) and pre-commit run --all-files (passes).
  • Added capsys checks for the output-policy and rate-limit refusals, a held-back test and a Policies column test in syft-rds/tests/test_api_policies.py; tests/unit/syft_bg/test_api_result.py for the args and the cleared state; a Parameters test in syft-job/tests/test_policies.py. The new tests fail on dev.
  • tests/integration/syft_bg/test_cli.py gives 24 passed and 2 failed; the 2 remove-peer failures happen the same way on dev without this change (the test sets up an api without run.sh), so I left them alone.

Asana task

🤖 Generated with Claude Code

- output_paths points to job.policy_error when a policy refused the call,
  and says when the output policy held the outputs back
- a blocking api call prints why it ended (_print_call_result)
- the api table has a Policies column
- ApiResult shows the api's args and when set_policies cleared its state;
  print(result) shows the same text as repr
- the job view shows code/params.json in a Parameters section

Messages and displays only; no behaviour changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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