Skip to content

Shared release gate and single publisher call for every track - #369

Merged
lanyue-llk merged 5 commits into
mainfrom
refactor/release
Nov 24, 2026
Merged

lanyue-llk merged 5 commits into
mainfrom
refactor/release

Conversation

@lanyue-llk

Copy link
Copy Markdown
Contributor

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]
Loading

What changed

  • Report checks fail after any code edit until the report is rebuilt #354 Web Extract checks no longer reject a report because report.py or report_suite.py bytes changed (renderer_sha256, composition_sha256 are still recorded). Tamper detection stays: the bound file inventory and hashes, the bound profile and evidence, and re-rendered page comparisons. docs/report-hosting.md says how to refresh after a renderer change. Web Search recorded renderer_sha256 but never checked it.
  • Shared release-check and package skeleton #332 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 four validate_release implementations now run through it:
    • Web Fetch is split into an identity rule (which release kind) and an evidence rule.
    • Browser Use and Replay use VisualReceipt.
    • Lexbench's matrix rule is renamed check_release_matrix.
    • The shared presentation stage runs over every page of every gated track. It parses only pages that carry presentation markers.
    • The language stage checks declared editions only.
    • Web Fetch skips the source-tree link stage because it checks links over the projected inventory.
  • One publisher interface over the publication lifecycles #333 reporting/publish.publish(release, mode, transport=) is the single publisher call, with update modes create, update and reuse.
    • PublicationTarget with read_target is the one target schema. It reads flat artifact_hub_* targets, nested publication targets and host/slug target files.
    • Sharing (visibility or a share link) is a field of the target for every lifecycle.
    • BoundTrack builds its requests, multipart body, binding recovery and binding from declared data. The Browser Use and replay wrappers lose request, multipart_archive, recover_publication_binding and bind_*.
    • All seven wrappers call publish. Stored receipts, journals and binding schemas are unchanged.
  • Reader-facing "Artifact Site" → "Yours" in the touched modules and docs.

Breaking changes (Python API, no CLI changes)

  • Removed reporting.publish.publish_receipt_release, publish_bound_release and publish_staged_update. Use publish(release, mode).
  • ReceiptRelease lost mode, base_url, expected_version and visibility; they are now target=PublicationTarget(...) plus the mode argument. StagedUpdate lost base, slug, expected_version and share_path; use target=.
  • BoundTrack callables were replaced by data fields.
  • Removed browser_use.report_publish.request, multipart_archive and recover_publication_binding, plus the bind_published_version function. Removed trajectory_replay.webarena_report_publish.request, multipart_archive, recover_publication_binding and bind_publication. Use track() and its methods.
  • lexbench.verification.validate_release was renamed to check_release_matrix.

Remaining (Part of)

Allowlists / baselines

Instance-literal allowlist: 1 → 1. Layering: 0 → 0. tests/baselines unchanged. 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_execution signal tests; they pass serially and are flaky under xdist load).
  • After the rebase, reporting, publication, browser, replay, extract, search, baselines and architecture tests: 5204 passed.
  • make lint-check passes.
  • New tests/test_reporting_release_gate.py covers:
    • stage order and visual rerun;
    • presentation negative control (missing highlight);
    • missing edition;
    • broken link;
    • symlink refusal.

Closes #354
Part of #332
Part of #333

@lexmount-ocr lexmount-ocr 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.

⚠️ Review complete · 44aba29

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
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).

Comment thread src/harness/reporting/publish.py Outdated
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(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security · high
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.

@lexmount-ocr lexmount-ocr 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.

⚠️ Review complete · 69b1c0e

This review found 1 issue(s), including 1 blocking issue(s).

Comment on lines +857 to +858
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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
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.
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.

@lexmount-ocr lexmount-ocr 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.

✅ Review complete · 133e508

No findings in this review.

@lexmount-ocr lexmount-ocr 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.

⚠️ Re-review complete · 93875f4

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
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.

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

OCR on 93875f4: target.title / target.share_url being accepted but not validated in _publish_receipt is a P2 robustness gap (the authoritative title and saved share URL are still the ones used, so nothing is published wrongly). Deferred to #333's remaining work; merging on green required checks. The earlier P1s (site check, non-public access in bound and staged lifecycles) are fixed in b4ed0c6 and 93875f4.

@lanyue-llk
lanyue-llk merged commit 42007ee into main Nov 24, 2026
9 of 10 checks passed
@lanyue-llk
lanyue-llk deleted the refactor/release branch November 24, 2026 13:21
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.

Report checks fail after any code edit until the report is rebuilt

1 participant