Repository navigation
Shared release gate and single publisher call for every track - #369
Conversation
There was a problem hiding this comment.
This review found 2 issue(s), including 2 blocking issue(s).
| def publish_receipt_release(config: ReceiptRelease, *, transport=None): | ||
| def _publish_receipt(config: ReceiptRelease, mode: str, *, transport=None): | ||
| """Upload or finish a receipt; remote byte verification is a separate command.""" | ||
| requested = config.target |
There was a problem hiding this comment.
The new target's site field is never checked. require_publication_site compares the receipt with the profile, not with requested.site, so a caller passing PublicationTarget(site="other-site") still updates the profile-bound site successfully. Validate a supplied site against the bound profile before any remote operation (and reject it for create if selecting a site is unsupported).
| if not share_url: | ||
| status, raw = send( | ||
| site_path + "/shares", json.dumps({"policy": "public"}).encode(), "application/json" | ||
| site_path + "/shares", json.dumps({"policy": target.visibility or "public"}).encode(), |
There was a problem hiding this comment.
An explicit visibility is only applied when there is no saved share URL. For an already-bound public report, setting publication.visibility to private or unlisted leaves the existing access unchanged, and the public checks can still pass and mark the publication verified. Apply and verify the requested access state even when a share URL already exists, or reject unsupported visibility changes before uploading rather than silently ignoring them.
44aba29 to
69b1c0e
Compare
There was a problem hiding this comment.
This review found 1 issue(s), including 1 blocking issue(s).
| if not update.base or not update.slug or not update.expected_version: | ||
| raise ValueError(f"{update.label} publication requires a bound site and version") |
There was a problem hiding this comment.
StagedUpdate accepts a target with explicit visibility, but this lifecycle never reads that field or updates sharing. For example, requesting visibility="private" for an existing public site still uploads the new report, verifies its public share, and returns success while leaving it public. Honor the requested access setting, or reject unsupported explicit visibility before writing the journal or making remote changes. Add a test confirming such a request cannot silently succeed with unchanged access.
Browser Use, Browser Trajectory Replay, Web Fetch and Lexbench run their release rules through reporting.release_check.validate_release, which owns the order (identity, languages, links, presentation, evidence, visual receipt) and runs the shared presentation checks on every track.
69b1c0e to
133e508
Compare
Every track publishes through publish(release, mode). PublicationTarget is the one target schema (host, site, expected version, visibility, share link); read_target reads each stored format. BoundTrack builds its requests, multipart body and profile binding from declared data, so the Browser Use and replay wrappers lose their request, multipart, recover and bind helpers. Stored receipts, journals and bindings keep their formats.
A requested site must match the profile-bound site, and create rejects one. Profile-bound releases verify through a public share, so a private or unlisted target now fails before any request instead of leaving the report public.
There was a problem hiding this comment.
This review found 1 issue(s), including 1 blocking issue(s).
| def publish_receipt_release(config: ReceiptRelease, *, transport=None): | ||
| def _publish_receipt(config: ReceiptRelease, mode: str, *, transport=None): | ||
| """Upload or finish a receipt; remote byte verification is a separate command.""" | ||
| requested = config.target |
There was a problem hiding this comment.
ReceiptRelease now accepts target.title and target.share_url, but neither field is read or validated anywhere in _publish_receipt: uploads always use config.title, and completion selects the saved receipt/profile URL. Consequently, an explicitly conflicting target is silently accepted and publication succeeds with different values. Validate supplied fields against the authoritative title/share link before submitting (or explicitly reject unsupported fields), and add regression tests for conflicting values.
|
OCR on 93875f4: |
Purpose
Converge release checking and publishing on one shared gate and one publisher (spec rule 3), and stop report checks failing after unrelated code edits.
flowchart LR subgraph Tracks WF[Web Fetch rules] & BU[Browser Use rules] & TR[Replay rules] & LB[Lexbench rules] end Tracks -->|ReleaseRules callbacks| G["validate_release<br/>identity → languages → links → presentation → evidence → visual receipt"] G --> P[package_archive / track packager] P --> PUB["publish(release, mode)<br/>PublicationTarget: host, site, expected version, visibility, share"] PUB --> R[ReceiptRelease<br/>private receipt] PUB --> B[BoundTrack<br/>profile + attestation] PUB --> S[StagedUpdate<br/>per-release journal]What changed
report.pyorreport_suite.pybytes changed (renderer_sha256,composition_sha256are still recorded). Tamper detection stays: the bound file inventory and hashes, the bound profile and evidence, and re-rendered page comparisons.docs/report-hosting.mdsays how to refresh after a renderer change. Web Search recordedrenderer_sha256but never checked it.reporting/release_check.validate_release(report, ReleaseRules)is the one release gate. Its order is fixed: identity, languages, links, presentation, evidence bindings, visual receipt. Each track adds its own rules as callbacks. The fourvalidate_releaseimplementations now run through it:VisualReceipt.check_release_matrix.reporting/publish.publish(release, mode, transport=)is the single publisher call, with update modescreate,updateandreuse.PublicationTargetwithread_targetis the one target schema. It reads flatartifact_hub_*targets, nestedpublicationtargets andhost/slugtarget files.BoundTrackbuilds its requests, multipart body, binding recovery and binding from declared data. The Browser Use and replay wrappers loserequest,multipart_archive,recover_publication_bindingandbind_*.publish. Stored receipts, journals and binding schemas are unchanged.Breaking changes (Python API, no CLI changes)
reporting.publish.publish_receipt_release,publish_bound_releaseandpublish_staged_update. Usepublish(release, mode).ReceiptReleaselostmode,base_url,expected_versionandvisibility; they are nowtarget=PublicationTarget(...)plus the mode argument.StagedUpdatelostbase,slug,expected_versionandshare_path; usetarget=.BoundTrackcallables were replaced by data fields.browser_use.report_publish.request,multipart_archiveandrecover_publication_binding, plus thebind_published_versionfunction. Removedtrajectory_replay.webarena_report_publish.request,multipart_archive,recover_publication_bindingandbind_publication. Usetrack()and its methods.lexbench.verification.validate_releasewas renamed tocheck_release_matrix.Remaining (Part of)
package_archive.Allowlists / baselines
Instance-literal allowlist: 1 → 1. Layering: 0 → 0.
tests/baselinesunchanged. The scorer sources (src/lexbench_webfetch) are untouched.Verification
uv run --frozen --all-extras python -m pytest -n 8 --dist worksteal tests: 23003 passed, 2 failed (test_benchmark_executionsignal tests; they pass serially and are flaky under xdist load).make lint-checkpasses.tests/test_reporting_release_gate.pycovers:Closes #354
Part of #332
Part of #333