Skip to content

Commit a7fbb22

Browse files
committed
chore(docs): restore bounded automation specification tree
1 parent e15c262 commit a7fbb22

6 files changed

Lines changed: 18 additions & 135 deletions

File tree

AGENTS.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
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.
55
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/automation-control-plane-standards.md`](docs/doctoring/automation-control-plane-standards.md).
7-
86
For central review, security, merge, fix, sandbox, or autonomous-maintenance work,
97
also read the authoritative [automation documentation graph](docs/automation/README.md)
108
and update its traceability/ADR entries whenever an authority, trust, failure,

ARCHITECTURE.md

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,3 @@ shared automation control plane.
1515
The durable boundary is central shared policy and trusted execution with thin,
1616
versioned consumers. Product repositories remain independently operable and own
1717
their domain code, data, tests, releases, deployments, and migrations.
18-
19-
```mermaid
20-
flowchart LR
21-
Buyer["Commercial buyer / reviewer"]
22-
Agents["Agents on AGENTS.md"]
23-
Project["GitHub Project #1"]
24-
Hub["This repo: org .github"]
25-
Products["Owned products<br/>naruon · orchestrator · engines"]
26-
Runner["Required workflows in each repo context"]
27-
28-
Buyer --> Hub
29-
Agents --> Project
30-
Agents --> Hub
31-
Project --> Hub
32-
Hub --> Runner
33-
Runner --> Products
34-
Products -->|"standalone or as module"| Buyer
35-
```
36-
37-
```mermaid
38-
sequenceDiagram
39-
participant PR as Pull request
40-
participant RW as Required workflows
41-
participant OC as OpenCode reviewer
42-
participant SV as sandboxed_verify / web E2E
43-
participant MS as Merge scheduler
44-
45-
PR->>RW: pull_request_target on trusted base
46-
RW->>OC: bounded evidence + NVIDIA NIM / OpenCode
47-
OC->>SV: PoC command in isolated copy
48-
SV-->>OC: redacted stdout/stderr + command metadata
49-
OC-->>PR: APPROVE or request changes
50-
MS->>PR: merge only on current-head approval + green checks
51-
```

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Semantic Versioning where the repository publishes a release.
1818

1919
### Fixed
2020

21-
- Materialized base Python locks only when every package line is an exact SHA-256 pin or a bounded relative `-r`/`--requirement` include. A lone `--require-hashes` directive, a dotted include such as `./lock.txt`, or `-r other-hashes.txt` no longer enters the trusted build context.
2221
- Reconciled superseded autonomous-loop guidance so historical fixed 45-minute/minute-35 cutoffs cannot replace practical-budget plus double-sweep exit proof, and retired the historical `COPILOT_GITHUB_TOKEN` Agent Tasks API alias in favor of purpose-bound GitHub authority separated from `NVIDIA_NIM_API_KEY` model access.
2322
- Bounded the Strix quality self-test's deterministic timeout fixtures to 3-second process and 5-second fake-sleep budgets so exact-head policy evidence completes inside the existing job limit without changing production Strix scanner timeouts, providers, credentials, or review semantics.
2423
- Allowed commas and ASCII parentheses in the bounded Strix changed-file path policy so legal tracked Packrat fixtures can receive exact-head security analysis, while rejecting raw `..` components before normalization and keeping controls, backslashes, whitespace ambiguity, and shell punctuation fail-closed.

docs/doctoring/automation-control-plane-standards.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Doctoring — automation control-plane standards baseline
22

3-
Materialize accepts only exact SHA-256 pins or a bounded relative `-r` include; a lone `--require-hashes` line is not lock evidence.
4-
53
Research date: 2026-08-09
64
Scope: architecture, requirements engineering, product quality, secure development, CI/CD supply chain, GitHub trust, AI-assisted review, observability, and testing
75

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)