Repository navigation
fix(web-fetch): build the resource image from the src layout - #231
Merged
Merged
Conversation
lanyue-llk
commented
Nov 4, 2026
lanyue-llk
left a comment
Contributor
Author
There was a problem hiding this comment.
Independent review, round 1
Reviewed head: 5e2d56c7. No defects found. There are no P0, P1, P2 or P3 findings.
No Docker daemon was available for this review either, so no image was built. make resource-image and a real validate() against an image remain unrun, as the PR states.
What I verified
Paths and build inputs
- Every context
COPYsource inresource.Dockerfileexists after.dockerignorefiltering./workspace/harnessandCOPY harnessno longer appear in any tracked file. The Makefile target's context and-fpath are correct. - The other four Dockerfiles copy only
start-chromium.shor nothing, so they do not depend on harness code. - I rebuilt the file layout the Dockerfile selects, using the test's own helpers (504 files), and checked three things there:
build_editablesucceeds and produces the.ptheditable wheel, withLICENSE,NOTICEandTHIRD_PARTY.mdincluded.repository_root()resolves to the workspace root,DEFAULT_PACKAGEtonode_modules/node-html-markdownunder it, andCONVERTERtosrc/harness/web_fetch/html_to_markdown.mjs.python -m harness.web_fetch.providers.headless_workerstarts and reaches request handling. It stops with aKeyErroronurlfor my empty{}request, which shows the imports succeed.
- The worker import opens no missing non-bytecode file. The only non-Python file it reads is inside
src/, so the.dockerignoredconfigs/andevaluation/are not needed at import. - I repeated the import while blocking every third-party module outside the
uv.lockclosure of the core dependencies plusheadless-eval. It succeeded; only optional probes were blocked (lxml,chardet,cchardet,html5lib,backports_abc,org).
Evidence and frozen bindings
validate()returns no path, andworker_sha256hashes the unchanged worker bytes.- No tracked evaluation, research or package-data file binds
container_resources.py,resource.Dockerfileor.dockerignore. - A text search for
/workspace/harnessacross the localevidence,implementations,runtime,builds,report-buildsandreviewsstores found no match. Like the author's search, it did not read compressed archives or binaries.
Tests
Each negative control below was reapplied independently and fails the expected test:
| Mutation | Failing test |
|---|---|
Old COPY harness ./harness |
test_every_copy_source_exists_in_the_build_context, and also test_runtime_hashes_the_worker_where_the_image_holds_it |
Removing the new COPY of install inputs |
test_image_receives_every_input_of_the_project_install |
Old validate() path |
test_runtime_hashes_the_worker_where_the_image_holds_it |
Old .dockerignore pattern |
test_build_context_excludes_credentials_and_host_dependencies |
Local runs on this head:
tests/test_resource_build_context.py,tests/test_container_resources.pyandtests/test_golden_reports.py: 27 passed. The golden snapshots are unchanged.- Both
ruffgate commands: pass.
Scope
- The PR meets the path and test items of #229.
validate()is deliberately left unchanged, and the PR records the open owner decision about binding more modules, as the work item instructed.- The PR's description of what happens with an image built before this change is accurate:
sha256sumfails inside the container, Docker raises that error, and no calls run.
CI on this head
- All checks pass: "Tests and static checks", "Installation and packaging", "Rendered reference and report checks", "Python 3.11", "Select check scope", "OCR dispatch" and
ocr-review. mainhas moved since the PR's base. The only overlap with this PR's inputs is one line inpyproject.toml, and a trial merge shows no conflict.
lanyue-llk
added a commit
that referenced
this pull request
Nov 4, 2026
lanyue-llk
force-pushed
the
fix/resource-image-source-path
branch
from
November 4, 2026 07:28
5e2d56c to
98e4c95
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues
Closes #229
Summary
make resource-imagecopied aharness/directory that no longer exists at the repository root. The image now mirrors thesrc/layout.No image was built. No Docker daemon is available here, so
docker buildand a realvalidate()against an image have not run. The owner's nextmake resource-imageis the first real build.examples/web_fetch/docker/resource.DockerfileCOPY src ./srcreplacesCOPY harness ./harness. Also copiesREADME.md,LICENSE,NOTICE,THIRD_PARTY.mdandsetup.py, whichpyproject.tomldeclares for the project installcontainer_resources.pyvalidate()hashes/workspace/src/harness/web_fetch/providers/headless_worker.py.dockerignorebrowser_harness_eval.egg-infoonly matched the root; it now also matchessrc/, where the install writes ittests/test_resource_build_context.pyCOPYlines against the real build context instead of a fixture pathThe extra
COPYwas not in the issue. Without those files the editable build still succeeds, but setuptools warns that an unmatchedlicense-filespattern stops being supported after 2027-02-18, and the image build does not pin setuptools.Paths checked and left unchanged
Makefileresource-image: its build context and-fpath are correct./workspace/.venv/bin/python -m harness.web_fetch.providers.headless_worker: the module name does not change, anduv syncinstalls the project in editable mode fromsrc.repository_root()and the converter'sDEFAULT_PACKAGE: on a copy of the image file layout these resolve to the workspace root andnode_modules/node-html-markdownthere. The import opened no missing file, including the.dockerignoredconfigs/.examples/trajectory_replay/copy no harness code.HEADLESS.md,docs/provider-contract.mdandconfigs/providers.headless.jsonname no container path.Evidence and receipts
No recorded value changes.
validate()returns hashes, limits and image identity, never a container path. A new test asserts this.worker_sha256hashes file bytes, and the worker file is not changed.evidence,implementationsandruntimestores under the data home for/workspace/harnessfound no match. That search covered text files only, so compressed archives and binaries were not read.Behavior to expect
An image built before this change holds the worker at the old path.
validate()now fails on it, with Docker'ssha256sumerror rather than the "rebuild the declared image" message, and no calls run. Rebuild it. A rebuilt image gets a new image ID; IDs already recorded in evidence stay as they are.Owner decision left open
The issue asks whether
validate()should also bind the modules the worker imports. This PR leaves that as it is, because the hash is part of the recorded environment. So an image holding the current worker but an olderheadless.pystill passesvalidate(), as described in the issue.Test plan
tests/test_resource_build_context.pyandtests/test_container_resources.py: all pass.COPY harness ./harness:test_every_copy_source_exists_in_the_build_contextCOPYof build inputs:test_image_receives_every_input_of_the_project_installvalidate()path:test_runtime_hashes_the_worker_where_the_image_holds_it.dockerignorepattern:test_build_context_excludes_credentials_and_host_dependenciesbuild_editable. The import and the build both succeeded.tests/test_golden_reports.py: unchanged and passing, with no rendered output affected.ruff, both gate commands: pass.tests/test_headless.py,tests/test_headless_runner.py,tests/test_headless_engine_routes.pyandtests/test_cowagent_isolation.py, 4 in all:test_converter_shared_and_nonzero_not_convertedandtest_worker_runs_from_source_without_an_installed_harnessare already known local failures.test_shipped_main_and_resource_cohorts_validate_their_own_release_pinsandtest_shipped_cohorts_keep_portable_dns_through_public_boundariesfail only because this worktree sits inside an older checkout, whoseevaluation/lexbench-webfetch.jsonthe parent-directory search reaches. All 34 tests in that file pass from a non-nested checkout of the base commit. That run was on the base, not on this branch, so CI is the check for this branch.