Skip to content

fix(packaging): ship the Lexbench template and stop public packaging without site logins - #227

Merged
lanyue-llk merged 2 commits into
mainfrom
fix/lexbench-template-and-publish-passwords
Nov 4, 2026
Merged

lanyue-llk merged 2 commits into
mainfrom
fix/lexbench-template-and-publish-passwords

Conversation

@lanyue-llk

@lanyue-llk lanyue-llk commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What, why and how of this PR

Issues

Closes #188
Closes #160

Summary

Two small release-safety fixes.

Lexbench template (#188). template/* is now package data of harness.lexbench, so python -m harness.lexbench report finds its template in a wheel or sdist install. MANIFEST.in needs no change: a built sdist already lists all five template files from the package-data entry. tests/package_smoke.py reads the template from the installed package, and the existing inventory check now requires those files byte for byte. The source-install sentence is gone from the Lexbench README, and the missing-template error no longer limits the default template to a checkout. uv.lock does not change. No Web Search collection is in flight on this host, so changing the pyproject.toml hash stops no resume.

Public WebArena password check (#160). This applies the issue's default. build() in public_webarena/publication.py now resolves site logins through known_site_secrets(), the function Browser Use uses, and stops before it writes anything when a registered login is unset. Publishing stops too, including when it resumes a saved submission, because its package check calls build() before any request. export_public_report_bundle, the example export route for site assembly, stops the same way, scans the report pages it copies for every site password, and writes nothing when either check fails. Rendering is unchanged: public_projection, stage_report and rebuild_report.py still work without logins. The package smoke runs on synthetic values, and also checks that rebuilding works without logins and that packaging does not.

known_site_secrets() resolves the whole login, so a registered username that is unset also stops packaging, exactly as it does for Browser Use. make public-webarena-report packages after it renders, so it now needs the logins as well; rebuild_report.py is the route that renders without them.

Other limits in #160

These stay as they are, on the issue's default, and are now recorded in docs/trajectory-replay-protocol.md:

  • A password under a variable name outside the site registry is scrubbed only at run time, from the attempt's error text, its evaluate_result trace step and its validation. Runs do not record the variable names they used.
  • The frozen trajectory's trace steps and the HAR are not scrubbed, because they must stay what the trajectory executed.

No measured evidence, profile or receipt changes. Golden report hashes are unchanged.

Test plan

  • Lint gate: ruff check --config 'include=["*.py"]' --select F,TID252 . and ruff check: passed.
  • pytest tests/test_golden_reports.py tests/trajectory_replay/public_webarena tests/browser_use/test_publication.py tests/test_lexbench_report_runtime.py tests/test_package_contents.py tests/test_packaging_hygiene.py tests/test_moli_report_render_contract.py tests/environments/test_webarena_topology.py: 890 passed, 3 skipped.
  • pytest tests/web_search tests/test_lexbench_dependency_boundary.py tests/test_release_metadata.py tests/test_report_software_versions.py tests/test_resource_build_context.py tests/test_runtime_entrypoints.py tests/trajectory_replay/test_catalog_contracts.py: 617 passed, 1 skipped.
  • Same public WebArena, golden and topology targets on the new head: 784 passed, 3 skipped. Lint gate passed. New export tests fail with the source change reverted.
  • New export tests: the export stops while a login is unset, and rejects a plain or HTML-escaped password in a report page, writing nothing in each case.
  • New tests: packaging stops for an unset password, an exported value cannot stand in, rendering still succeeds and no output is written; publishing stops with no requests, for a new and a saved submission.
  • Built a wheel and an sdist locally with setuptools.build_meta from a copy of the tree and confirmed both list the five template files. From the unpacked wheel, outside the checkout, ran verify_package_tree, verify_lexbench_package and verify_public_trajectory_publication: passed.
  • The complete tests/package_smoke.py and full suite were not run locally; CI runs them on Linux.

@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 · 96f3b02

No findings in this review.

@lanyue-llk lanyue-llk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Independent review, round 1

Reviewed head 96f3b02c. One finding, P2.

P2: src/harness/trajectory_replay/public_webarena/publication.py:50, the public export route still runs without site logins

Problem. export_public_report_bundle (entry point examples/trajectory_replay/public_webarena/export_public_report_bundle.py, "bundle for site assembly") writes a public bundle, but only build() got the new stop. With the logins unset, the export succeeds. public_projection skips the unset password, and the report pages are copied without a password scan. So the #160 limit, "a host without the values", remains on this route. The new text in docs/trajectory-replay-protocol.md and examples/trajectory_replay/public_webarena/README.md, "every public package is checked", therefore overstates what Closes #160 delivers.

Reproduced. I used the report fixture, with an absent credentials file and a password string added to the staged page and to artifact_provenance in the manifest:

  • build() raises ValueError naming WEBARENA_..., as intended.
  • export_public_report_bundle() on the same input succeeds, and the string appears in both reports/webarena-trajectory-replay-latest.html and run/manifest.json of the output.

Suggested fix. Treat the export as packaging. Call known_site_secrets() first in export_public_report_bundle, and apply _contains_site_password to the copied pages. Add a test that the export stops with logins unset and writes nothing. If the owner prefers to leave the export alone, the docs and the PR body must name it as a third limit, not say that every public output is checked. Removing the route is also an option, since only the example and tests call it.

Verified without findings

#188

  • template/* is declared as package data. An sdist built from a copy of this head lists all five template files, so MANIFEST.in needs no change.
  • verify_package_tree derives its expected inventory from package-data, and verify_lexbench_package now reads TEMPLATE_DIRECTORY from the installed package.
  • The source-install sentence is gone from the Lexbench README, and no other text in src/harness/lexbench says the template is missing from an install.

#160, packaging and publishing

  • known_site_secrets() returns the same values as configured_site_secrets() when all logins are set, so the scan does not change for a complete .env. It stops on unset or whitespace-only values.
  • build() resolves the logins before it writes anything.
  • publish_current reaches build() through package_check before any request, on the new-submission, saved-submission and journal paths.
  • release.py skips local build() for a pending publish, but the publish subprocess still stops, and its error text is passed on.
  • The new tests would fail with configured_site_secrets() in build(): packaging would succeed, and the publish tests would not raise.
  • public_projection, stage_report and rebuild_report.py remain tolerant of unset logins.
  • The other two #160 limits are recorded in the protocol doc.

Rules

  • git diff shows no change to evidence, profiles, receipts, workflows or golden snapshots, and no compatibility alias or parallel implementation.
  • uv.lock does not change.

Local runs

  • The lint gate passed.
  • tests/test_golden_reports.py, tests/trajectory_replay/public_webarena, tests/browser_use/test_publication.py, tests/test_lexbench_report_runtime.py, tests/test_lexbench_cli.py, tests/test_package_contents.py, tests/test_packaging_hygiene.py, tests/environments/test_webarena_topology.py, tests/test_reporting_publish_client.py and tests/test_local_path_privacy.py: 1037 passed, 3 skipped.
  • I did not run the full suite or tests/package_smoke.py locally. CI covers them.

CI at this head

  • Tests and static checks, Installation and packaging, and Rendered reference and report checks all pass.

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

Review round 1:

Fixed (P2, export route without the password stop), commit 5b0cf30. export_public_report_bundle now calls known_site_secrets() first and applies _contains_site_password to the report pages it copies, before it creates the output directory. New tests in test_publication.py cover an unset login and a plain or HTML-escaped password in a page, each leaving no output; they fail with the source change reverted. docs/trajectory-replay-protocol.md and .env.example now name exporting alongside packaging and publishing.

Nothing disputed.

@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 · 5b0cf30

No findings in this incremental review.

@lanyue-llk lanyue-llk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Independent review, round 2

Head reviewed: 5b0cf306. No defects were found.

Round 1 finding. Fixed. export_public_report_bundle now resolves the logins first and scans the copied pages before it creates any output. With a login unset, the export stops and writes nothing. The run/manifest.json and run/summary.json it writes still go through public_projection, which has every password once the logins resolve.

What I verified

  • #188, package data: I built a wheel and an sdist from a clean copy of the head. Both list the five template files, and MANIFEST.in needs no change. verify_package_tree expands the new template/* entry, so the installed files are compared byte for byte. verify_lexbench_package reads the template from the installed package. The source-install sentence is gone from the README, and no other text still says it.
  • #160, stopping: build() and the export both use known_site_secrets(). It returns the same passwords as configured_site_secrets(), but stops when a login is unset. An exported variable cannot stand in for a login. Publishing stops before any request, also when resuming a saved submission, because package_check calls build(). release.py skips build() for a pending submission, but the publisher subprocess still runs that check.
  • #160, rendering: public_projection, stage_report and rebuild_report.py still work without logins; rebuild_report.py does not import the publication module.
  • #160, scope: The other two limits are unchanged and recorded in docs/trajectory-replay-protocol.md. The PR body discloses two side effects: an unset username also stops packaging, and make public-webarena-report now needs the logins.
  • Tests fail without the fix: I reverted each source change in turn.
    • build() back to configured_site_secrets(): 4 tests fail.
    • Export back to configured_site_secrets(): 1 test fails.
    • Export scan disabled: 2 tests fail.
  • Package smoke: The login list matches the four sites in topology.json. Resetting _repository_credentials_file to None restores its default.
  • Rules: Hash-bound evidence, profiles and receipts are untouched, uv.lock does not change, and no workflow file changes. There are no aliases or parallel implementations.

Results

  • Lint gate: passed.
  • Local tests, 1025 passed, 3 skipped: tests/test_golden_reports.py (snapshots unchanged), tests/trajectory_replay/public_webarena, tests/test_lexbench_report_runtime.py, tests/test_package_contents.py, tests/test_packaging_hygiene.py, tests/test_reporting_publish_client.py, tests/test_local_path_privacy.py, tests/browser_use/test_publication.py and tests/environments/test_webarena_topology.py.
  • CI on this head: all checks pass. That includes "Tests and static checks", "Rendered reference and report checks" and "Installation and packaging". The last one runs make package-check, whose log shows the installed-wheel checks passing.

My own attempt to run the smoke functions from an unpacked wheel failed in my harness script before reaching them, so that coverage comes from the CI package check.

lanyue-llk added a commit that referenced this pull request Nov 4, 2026
…gins

The export route writes a public bundle but had no password check: it skipped an unset password and copied report pages unscanned. It now resolves every registered login first and scans the pages before writing anything, as packaging does.
@lanyue-llk
lanyue-llk force-pushed the fix/lexbench-template-and-publish-passwords branch from 5b0cf30 to 46a134f Compare November 4, 2026 05:50

@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 · 46a134f

No findings in this review.

@lanyue-llk
lanyue-llk merged commit f8e47d0 into main Nov 4, 2026
7 checks passed
@lanyue-llk
lanyue-llk deleted the fix/lexbench-template-and-publish-passwords branch November 4, 2026 06:00
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.

Declare the Lexbench report template as package data Decide the remaining limits of public WebArena password redaction

1 participant