Skip to content

feat(harbor): upload standard verifier output - #716

Closed
David Leen (dleen) wants to merge 2 commits into
braintrustdata:mainfrom
dleen:codex/harbor-verifier-evidence
Closed

David Leen (dleen) wants to merge 2 commits into
braintrustdata:mainfrom
dleen:codex/harbor-verifier-evidence

Conversation

@dleen

Copy link
Copy Markdown
Contributor

Summary

  • ingest Harbor standard verifier output (test-stdout.txt, test-stderr.txt, and ctrf.json)
  • show a bounded summary on the verification span and each score, with one shared verifier-output.json attachment
  • support multi-step trials and scoreless verifier failures while respecting attachments=none
  • apply the integration standard structured-key normalization and configured redact_patterns before upload
  • enforce safe bounded reads, reject symlinks and non-regular files, and share the trial attachment budget

Complexity

  • verifier output collector: 14 to 9
  • bounded file reader: 13 to 10
  • _sync_final_result: 56 to 48, matching upstream

Testing

  • nox -s test_harbor(latest): 34 passed with Harbor 0.22.0
  • nox -s test_harbor(0.16.0): 34 passed
  • focused pre-commit hooks: passed
  • pylint --errors-only on changed Python files: passed
  • strict live backfill confirmed verifier_output_summary and verifier-output.json on the verification span

@dleen
David Leen (dleen) force-pushed the codex/harbor-verifier-evidence branch from 02ccbe3 to 9e75b9f Compare August 28, 2026 01:45

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 02ccbe3675

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread py/src/braintrust/integrations/harbor/plugin.py
@dleen
David Leen (dleen) force-pushed the codex/harbor-verifier-evidence branch from 9e75b9f to 749f7e5 Compare August 28, 2026 19:12
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@AbhiPrasad

Copy link
Copy Markdown
Member

opened #724 as a follow up, will close this. Will credit you on that one David Leen (@dleen) - thanks for the PR!

Abhijeet Prasad (AbhiPrasad) added a commit that referenced this pull request Sep 1, 2026
Supersedes
#716

## AI Summary

Braintrust already received the reward numbers for each Harbor trial.
Now it also receives the evidence the verifier wrote, so you can see
*why* a trial failed without leaving the UI.

```
<trial-dir>/verifier/
├── reward-details.json   already uploaded
├── ctrf.json             NEW  standard test-report JSON
├── test-stdout.txt       NEW  raw verifier log
└── test-stderr.txt       NEW  raw verifier log
```

Verifier evidence shows up in two places: a bounded inline preview and
one complete normalized `verifier-output.json` attachment.

```
root (experiment row)
├── task
│   └── verification    ← verifier_output_summary   (inline preview)
│                         verifier_output           (full evidence, attached)
└── scorer: reward      ← same two fields
```

## Attachment modes

Harbor runs are evaluation environments, where complete failure evidence
is generally more useful than omitting raw logs. The default therefore
captures all standard verifier output.

| `attachments=` | `ctrf.json` | `test-stdout/stderr.txt` | task
artifacts |
|---|:---:|:---:|:---:|
| `none` | — | — | — |
| `structured` | ✅ | — | — |
| `all` *(default)* | ✅ | ✅ | ✅ (with `artifact_include`) |

`structured` is the JSON-only tier for environments that should not
upload raw verifier logs. Task artifacts remain opt-in even under `all`:
they require an explicit `artifact_include` glob.

Structured redaction matches sensitive **key names**, while plain text
has no keys:

```python
# ctrf.json — the key is named ANTHROPIC_API_KEY, so the value is caught
{"env": {"ANTHROPIC_API_KEY": "[REDACTED]"}}

# test-stdout.txt — plain text is covered only by configured patterns
"+ export ANTHROPIC_API_KEY=sk-ant-REAL-SECRET"
```

If an eval environment contains sensitive values, configure
`redact_patterns` or use `attachments="structured"`. `redact_patterns`
is the only redaction applied to raw verifier logs and is empty by
default.

## Size limits are gone

There used to be a 5 MB per-file cap and a 20 MB per-trial cap. The
per-trial cap was one shared pot, spent in source order:

```
artifacts ──► trajectory images ──► verifier output ──► reward details
^ spends first                                         ^ often got nothing left
```

That meant a few screenshots could push out the score evidence, and the
same trial with a slightly larger screenshot could upload different
evidence. Attachments are intended for large payloads, so both
attachment caps and their shared-budget plumbing are removed and every
accepted file uploads whole.

`trajectory.json` keeps a separate limit (`max_trajectory_bytes`, 20 MB)
because it is parsed in-process rather than treated as an attachment.

## Configuration changes

- `attachments="all"` is now the default.
- `attachments="verifier-details"` is renamed to
`attachments="structured"`.
- `max_attachment_bytes` and `max_total_attachment_bytes` are removed
and no longer impose an upload ceiling.

---------

Co-authored-by: David Leen <dleen@netflix.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@AbhiPrasad

Copy link
Copy Markdown
Member

released with https://github.com/braintrustdata/braintrust-sdk-python/releases/tag/py-sdk-v0.36.0. Thanks for the PR! Will update docs in a bit.

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.

2 participants