Skip to content

Commit d6f7e1a

Browse files
committed
chore(opencode): restore bounded asyncio-toolchain scope
1 parent e61ef0c commit d6f7e1a

5 files changed

Lines changed: 19 additions & 196 deletions

File tree

‎AGENTS.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22

33
<!-- CWL-ENTRY -->
44
> **Agents: read the master context FIRST.** Before any work, read [`docs/CWL-MASTER-CONTEXT.md`](docs/CWL-MASTER-CONTEXT.md) (mission · naruon-as-platform + inter-component UML · cross-cutting disciplines · conventions · roadmap · current state), the live **GitHub Project #1** <https://github.com/orgs/ContextualWisdomLab/projects/1> (work/roadmap source of truth), the full spec **ContextualWisdomLab/naruon#974**, and operate the Project per [`docs/agent-github-project-protocol.md`](docs/agent-github-project-protocol.md). The repo/Project — not any private agent memory — is the source of truth.
5-
6-
Materialize accepts only exact SHA-256 pins or a bounded relative `-r` include (no `.`/`..`); a lone `--require-hashes` directive is not trust evidence. See [`docs/doctoring/opencode-asyncio-test-runtime.md`](docs/doctoring/opencode-asyncio-test-runtime.md).

‎ARCHITECTURE.md‎

Lines changed: 0 additions & 94 deletions
This file was deleted.

‎CLAUDE.md‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@ Details: `README.md` and `PR_GOVERNANCE_AUDIT.md`.
6464
- `fuzz/` + `.clusterfuzzlite/` — Atheris fuzz targets for the review-output normalizer and the
6565
ClusterFuzzLite discovery marker.
6666
- `docs/` — master context, Project protocol, `org-required-workflow-rollout.md`,
67-
`scorecard-governance.md`, SBOM inventory. Doctoring records live under
68-
`docs/doctoring/`. [`ARCHITECTURE.md`](ARCHITECTURE.md) is the control-plane
69-
diagram for review, the asyncio coverage toolchain, and merge trust
70-
boundaries.
67+
`scorecard-governance.md`, SBOM inventory.
7168
- `.jules/` — recorded performance (`bolt.md`) and security (`sentinel.md`) learnings from past work
7269
on `scripts/ci/`; worth scanning before optimizing or hardening those scripts.
7370

‎scripts/ci/materialize_base_python_requirements.py‎

Lines changed: 16 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -87,58 +87,6 @@ def _is_candidate_lock_name(name: str) -> bool:
8787
)
8888

8989

90-
91-
def _is_candidate_lock_path(path: pathlib.PurePosixPath) -> bool:
92-
"""Return whether one safe tracked path can name a pip requirements lock.
93-
94-
In addition to conventional ``requirements*.txt`` names, repositories often
95-
keep concrete environment closures as direct children such as
96-
``requirements/ci.txt`` or ``service/requirements/package.txt``. Only direct
97-
``.txt`` children of a directory named ``requirements`` gain this path-based
98-
eligibility; content must still pass the independent complete hash-pin
99-
validation before it reaches the trusted image build context.
100-
"""
101-
return _is_candidate_lock_name(path.name) or (
102-
path.suffix == ".txt" and path.parent.name == "requirements"
103-
)
104-
105-
106-
def _is_bounded_requirement_include(line: str) -> bool:
107-
"""Return whether one requirements include names a bounded relative file.
108-
109-
Includes are accepted only as a two-token ``-r``/``--requirement`` form
110-
whose target is itself a candidate lock path written as a normalized
111-
relative POSIX path. Absolute paths, ``.`` or ``..`` components, double
112-
slashes, URLs, option-like targets, shell/Windows path separators,
113-
fragments, queries, extra inline options or hashes, and includes of
114-
non-lock files are rejected before a base-owned file can enter the
115-
trusted build context.
116-
The downstream installer still proves that the candidate is an independently
117-
complete hash closure; this predicate grants syntax eligibility only.
118-
"""
119-
fields = line.split()
120-
if len(fields) != 2 or fields[0] not in {"-r", "--requirement"}:
121-
return False
122-
target = fields[1]
123-
if (
124-
target.startswith(("-", "~"))
125-
or "\\" in target
126-
or ":" in target
127-
or "?" in target
128-
or "#" in target
129-
):
130-
return False
131-
include_path = pathlib.PurePosixPath(target)
132-
return (
133-
bool(include_path.parts)
134-
and target == include_path.as_posix()
135-
and not include_path.is_absolute()
136-
and "." not in include_path.parts
137-
and ".." not in include_path.parts
138-
and _is_candidate_lock_path(include_path)
139-
)
140-
141-
14290
def _requirement_lines(content: bytes) -> list[str]:
14391
"""Return logical requirement lines, joining backslash line-continuations.
14492
@@ -159,27 +107,26 @@ def _requirement_lines(content: bytes) -> list[str]:
159107

160108

161109
def _is_hash_pinned(content: bytes) -> bool:
162-
"""Return whether content carries only trusted pins or bounded includes.
163-
164-
Discovery is content-based rather than name-based so exact hash-pinned locks
165-
in service subdirectories and role-specific requirements files can be
166-
considered for offline coverage. Candidate syntax is deliberately stricter
167-
than a substring search: each package line must be an exact ``==`` pin with
168-
one or more complete SHA-256 hashes, or a bounded relative requirements
169-
include. A global ``--require-hashes`` directive is not trust evidence by
170-
itself. The downstream installer separately preflights every candidate as an
171-
independent ``pip --require-hashes`` closure, so syntax eligibility never
172-
substitutes for dependency-closure proof.
110+
"""Return whether content carries hash pins and is safe to preflight.
111+
112+
Discovery is content-based rather than name-based so hash-pinned locks in any
113+
location (a service subdirectory, ``requirements-dev.txt``,
114+
``requirements-test.txt``) can be considered for offline coverage, while an
115+
unpinned or PR-mutable requirements file is still excluded from the networked
116+
build context. Hash syntax cannot prove that a file includes every transitive
117+
dependency, so the trusted image installer separately preflights every
118+
candidate as an independent ``--require-hashes`` closure. An empty file
119+
carries no installable dependency and is not materialized.
173120
"""
174121
lines = _requirement_lines(content)
175-
requirement_lines = [line for line in lines if line != "--require-hashes"]
176-
if not requirement_lines:
122+
if not lines:
177123
return False
178-
return all(
179-
_is_fully_hash_pinned_requirement(line)
180-
or _is_bounded_requirement_include(line)
181-
for line in requirement_lines
124+
return any(line == "--require-hashes" for line in lines) or all(
125+
"--hash=" in line or line.startswith(("-r ", "--requirement "))
126+
for line in lines
182127
)
128+
129+
183130
def _is_fully_hash_pinned_requirement(line: str) -> bool:
184131
"""Return whether one uv-export line is an exact package pin with SHA-256 hashes."""
185132
fields = re.split(r"\s+(?=--hash=)", line)

‎tests/test_materialize_base_python_requirements.py‎

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ def _created_tool_directory(path: Path) -> str:
3030
return str(path)
3131

3232

33-
def _force_linux_x86_64_installer(monkeypatch: pytest.MonkeyPatch) -> None:
34-
"""Exercise the installer path that GitHub-hosted linux x86_64 runners use."""
35-
monkeypatch.setattr(materializer.sys, "platform", "linux")
36-
monkeypatch.setattr(materializer.platform, "machine", lambda: "x86_64")
37-
materializer._install_trusted_uv.cache_clear()
38-
39-
4033
def test_materializes_only_regular_hash_locks_from_exact_base(tmp_path: Path) -> None:
4134
"""A PR-modified lock cannot enter the networked coverage image build context."""
4235
repo = tmp_path / "repo"
@@ -157,24 +150,9 @@ def test_lock_name_candidates_are_pip_requirements_files() -> None:
157150
def test_hash_pin_detection_includes_pinned_and_excludes_unpinned_or_empty() -> None:
158151
"""Only fully hash-pinned, non-empty lock content is materialized."""
159152
assert not materializer._is_hash_pinned(b"# comment only\n\n")
160-
assert not materializer._is_hash_pinned(b"--require-hashes\ndemo==1\n")
153+
assert materializer._is_hash_pinned(b"--require-hashes\ndemo==1\n")
161154
assert materializer._is_hash_pinned(b"demo==1 --hash=sha256:" + b"a" * 64 + b"\n")
162-
assert materializer._is_hash_pinned(b"-r requirements-other.txt\n")
163-
assert not materializer._is_hash_pinned(b"-r other-hashes.txt\n")
164-
assert not materializer._is_hash_pinned(b"-r ./requirements-other.txt\n")
165-
assert not materializer._is_hash_pinned(b"-r ../escape.txt\n")
166-
assert materializer._is_bounded_requirement_include(
167-
"--requirement requirements-other.txt"
168-
)
169-
assert not materializer._is_bounded_requirement_include("-r .")
170-
assert not materializer._is_bounded_requirement_include("-r -evil.txt")
171-
assert not materializer._is_bounded_requirement_include("-r ~evil.txt")
172-
assert not materializer._is_bounded_requirement_include("-r C:foo.txt")
173-
assert not materializer._is_bounded_requirement_include("-r foo?bar.txt")
174-
assert not materializer._is_bounded_requirement_include("-r foo#bar.txt")
175-
assert not materializer._is_bounded_requirement_include(r"-r foo\\bar.txt")
176-
assert not materializer._is_bounded_requirement_include("-r")
177-
assert not materializer._is_bounded_requirement_include("-r /abs/requirements.txt")
155+
assert materializer._is_hash_pinned(b"-r other-hashes.txt\n")
178156
assert not materializer._is_hash_pinned(b"untrusted==1\n")
179157
# uv export / pip-compile multi-line continuation format (spec, then --hash= lines).
180158
assert materializer._is_hash_pinned(
@@ -666,7 +644,6 @@ def test_install_trusted_uv_verifies_version_and_caches_path(
666644
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
667645
) -> None:
668646
"""The installer writes one executable, verifies its version, and caches it."""
669-
_force_linux_x86_64_installer(monkeypatch)
670647
tool_dir = tmp_path / "uv"
671648
monkeypatch.setattr(
672649
materializer.tempfile,
@@ -713,7 +690,6 @@ def test_install_trusted_uv_rejects_version_process_failures(
713690
failure: OSError | subprocess.TimeoutExpired,
714691
) -> None:
715692
"""A missing or hung downloaded executable is removed and rejected."""
716-
_force_linux_x86_64_installer(monkeypatch)
717693
tool_dir = tmp_path / "uv"
718694
monkeypatch.setattr(
719695
materializer.tempfile,
@@ -745,7 +721,6 @@ def test_install_trusted_uv_rejects_wrong_version_or_exit_status(
745721
completed: subprocess.CompletedProcess[bytes],
746722
) -> None:
747723
"""Unexpected version output or a nonzero status cannot satisfy the pin."""
748-
_force_linux_x86_64_installer(monkeypatch)
749724
tool_dir = tmp_path / f"uv-{completed.returncode}-{len(completed.stdout)}"
750725
monkeypatch.setattr(
751726
materializer.tempfile,

0 commit comments

Comments
 (0)