Repository navigation
refactor(daemon): Cargo workspace — relay-policy and relay-ops read-only by clippy, fuzzable crates - #962
Merged
Conversation
Upstream moved the v1 tag to e2a55d2 (dtolnay/rust-toolchain#187, "Safely handle action inputs": multi-line-safe GITHUB_OUTPUT writes and argv-array rustup flags instead of string-built command lines). zizmor's online ref-version-mismatch audit now fails every PR's lint step because our six SHA pins, commented '# v1', point at the old head 7e38f4b. The new commit descends from the old pin and changes only action.yml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017phewNxcFMxpU3ntX2TKek (cherry picked from commit 0a3a00a)
…nly by clippy, fuzzable crates relay-exec (sole spawning crate), relay-ops (write-banned) and relay-transport move out of daemon/src; step-1 guards extended to them, plus spawn, unsafe, ExecRequest and feature censuses. Closes #889 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017phewNxcFMxpU3ntX2TKek
Merged
3 tasks done
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.
Closes #889
This is step 2 of 2. Step 1 was #935 (merged).
What changed
The relay-daemon's execution, Operation and transport code now lives in three workspace crates:
The bin keeps its name, its path and its release build (
-p relay-daemon).main.rs,dispatch.rs,scheduler.rs,dedup.rs,shutdown.rs,config.rs,selfref.rs,services.rs,policy_check.rs,version.rsandcatalog.rsstay in the bin.Runtime behaviour does not change.
git diff -Mshows 17 renames at 76–100% similarity (renew.rsis a 100% rename).Crate layout
executor,cancel,not_executed,limits(ResourceLimitsandclean_io_error, moved fromconfig.rs)Command::newkeeps its statement-level allow.operations/*(registry, schema, the four Natives,template),templates,raw_exectunnel,identity,enroll,renew,rand_unitidentitywrites the node key and cert.Crate graph:
Edits that are not byte-identical moves
Four would-be dependency cycles forced these:
ResourceLimitsandclean_io_errormoved torelay_exec::limits.MAX_OUTPUT_BYTESstays inconfig.rs.EnrollConfig::from_configbecame the bin'sconfig::enroll_config. The body is identical; its three tests moved with it, keeping their names.READ_CONCURRENCYdefinition moved to relay-opsregistry;schedulerre-exports it.rand_unitmoved to the relay-transport crate root.Also changed:
pub(crate)becamepubwhere the bin needs the item.file_readwas narrowed topub(crate).TemplateSet::is_emptywas added because clippy'slen_without_is_emptylint fires now thatlenis reachable.#[allow(clippy::disallowed_methods)]attributes: statement-level allows on test cleanups inexecutor,raw_execandfile_read, one module-level allow ontemplates'mod tests, and the production allow onfile_read's read-only open (see below).file_read's open is split:let opened = …open(path);under the allow, thenmatch openedoutside it. The open itself is unchanged (.read(true)plusO_NONBLOCK|O_NOCTTY).TemplateSet::{for_test, empty_static}andidentity::mode_assertmoved fromcfg(test)tocfg(any(test, feature = "test-util")), because the bin's tests reach them across crates.Guards
Every step-1 guard now covers the new crates:
READ_ONLYgains relay-exec and relay-ops.may_depend_ongains the arms relay-exec → {relay-proto} and relay-ops → {relay-proto, relay-policy, relay-exec, relay-log}.policy_never_opened_for_write,log_fields_escaped,virtual_clock_guard) are repointed with no count changed.New guards in
daemon/tests/clippy_write_ban.rs:Command,pre_exec, the libc exec/fork/execveat/clone/syscallnames andSYS_exec*/SYS_fork*/SYS_clone*, including aliased and brace-imported forms) appears only in relay-exec's executor, exactly 3 times.unsafecensus. Everyunsafein the daemon (bin, every crate, tests included) is pinned per file: 6 sites, none in the bin or relay-transport.file_read's allowed statement is pinned to its exact text.templates' allow must sit onmod tests.ExecRequestcensus. relay-ops buildsExecRequestat exactly the four pinned sites.[features]table is pinned, and on host and muslcargo tree -e normal -p relay-daemonmust resolve notest-utilorban-probefeature.READ_ONLY.New ban entries.
libc::execveat,libc::cloneandlibc::syscallare added to the rootdaemon/clippy.tomland to the five byte-identical read-only copies.libc::execveatcarriesallow-invalid = true: the libc crate has noexecveaton musl. The gnu passes still enforce the entry, and probe lines prove it fires.libc::clone3is not in the libc crate, so only the census names it.Operator-visible
Log targets of the moved modules change. Their tracing targets become
relay_exec::…,relay_ops::…andrelay_transport::….RUST_LOGdirective onrelay_daemon::{executor,raw_exec,templates,tunnel,…}no longer matches.relay_daemon::allowandrelay_daemon::denyare unchanged.docs/operations/relay-daemon-install.md§6 now documents the per-crate targets. Step 1 had flagged this without documenting it.Agent-maintained citations are repointed to the module or crate:
docs/operations/{daemon-privilege-posture,demo-fleet}.md;relay-daemon.service,docker/fixtures/dev-fleet-serviceand the democatalog.toml.The demo Template's fingerprint may change. The
catalog.tomlchange is a comment, but the file is loaded as a Template, so its fingerprint may change. Nothing pins it.The release binary behaves identically but is not bit-identical. Panic locations and symbol paths now name
crates/….Verification
make verifygreen, run twice: after implementation and after the security fix cycle. Command:RELAY_SMOKE_PORT=20889 GOLANGCI_LINT_CACHE=<worktree>/.dev-loop/golangci-cache make verify, exit 0.Lanes covered:
cargo fmt.-D warningsin debug/all-targets, host release and musl release.check-daemon-bans: policy 106, log 31, proto 31, exec 54, ops 129.cargo test:clippy_write_ban(39 tests), the structural guards,dev_fleet_fixturesandshutdown_signal.test-integration.TestCrossBinary|TestFleetE2Eok).cargo-deny: bans, licenses and sources ok.Also run:
cargo buildofdaemon/fuzz; its lockfile is unchanged.Gates skipped:
check-crosslinks(gh apicannot list milestones from this environment). CI runs it.cargo +nightly fuzz build: no nightly toolchain here./protois untouched, so the proto gates do not apply.Pre-existing: the musl clippy pass warns that relay-log's
libc::renameat2entry does not resolve. This comes from step 1's config and is not a lint failure.Branch: this branch carries a merge of
origin/main. Therust-toolchainrepin from #956, which this branch had cherry-picked, is now on main, so it adds nothing to this diff.Reviews
unsafecensus, statement-level test allows, thefile_readpin andban-probe = [].file_read's allow scope, the relay-ops read-only overclaim, and unchecked[features]tables.reason=not-installed). The gate ran with one reviewer.Capability spec
docs/specs/is still true of the code after this changeSpec:
docs/specs/execution.mdanddocs/specs/policy.mdare legacy (aspirational), so they are context only. No claims are named and none are promoted. Every moved test keeps its name, so test-name proof rows in the migrated specs still resolve.Security surface
/proto, Policy, execution, transport, mTLS, auth, blast caps, label authorityInvariants touched (none amended):
unsafecensus back clippy across every crate and the bin. The new libc exec-family ban entries cover the bin too.templates(the trust-root loader) and the Operations now sit in a write-banned crate.file_read, ADR-0018) is pinned statement-exact.selfrefand the unit'sProtectSystem.dedupstays in the bin; only its test helper import moves.enroll_configstill fails closed on scheme.Paths on the security surface:
daemon/Cargo.tomlandCargo.lock;daemon/crates/**file this PR adds or moves;daemon/clippy.tomland the five read-onlyclippy.tomlcopies;ban_probe.rsfiles;daemon/src/{config,main,scheduler}.rs;daemon/tests/{clippy_write_ban,policy_never_opened_for_write}.rs;daemon/packaging/relay-daemon.service(comment only);scripts/clippy-ban-probe.sh;docs/agents/security-surface.txt(moved paths only).Unresolved
The review budgets are spent: one security fix cycle and two code-review cycles. These need a human decision: fix them here, or accept them as tracked in #961.
suppression_sitescan mark production code as test code. Security re-review rated this CONCERNS and recommended fixing it in this PR. A#[cfg(test)]on a bare block, anif/matchstatement or a braced macro call swallows the following statement up to the next top-level;. With a test allow deleted in the same file, a production allow can hide behind it at equal counts. It takes two deliberate edits in a security-surface file. The fix is about 5 lines and fails closed: count a#[cfg(test)]span only for item-like targets.libc::execveat,cloneandsyscallfrom every config and both probe files at once fails no test. The same is true of step 1's exec entries. The fix is arequired_exec_ban()set, plus an assertion thatallow-invalidappears onexecveatonly.use libc as l; l::syscalltaken as a function item escapes the regex. Clippy's resolved-path ban and theunsafecensus still catch it.Escalations
daemon/fuzzstill imports only relay-proto, and new targets over relay-policy and relay-ops parsing are left to that issue.EnrollConfig::from_configmoved into the bin asconfig::enroll_configrather than moving withenroll.Configcannot leave the bin without dragging Operations into transport.#[cfg(test)]. It now readsTemplateSet::{for_test, empty_static}andidentity::mode_assertas production code. This is harmless: they contain no open or write, andidentityis already on the write allowlist.Plan, review record and revert checks
IMPLEMENTATION PLAN (revision 2)
Issue: daemon: Cargo workspace — relay-policy and relay-ops read-only by clippy, fuzzable crates (#889), STEP 2 of 2 (closes #889)
Spec: docs/specs/execution.md, docs/specs/policy.md Binding: legacy (both
aspirational), context onlyClaims: none. This is a pure move. Migrated specs nearby (
policy-preflight.md,policy-catalog.md) cite tests by name only.check-docs.shfinds those names anywhere underdaemon/, and every moved test keeps its name, so every proof row still resolves.Summary
This step moves the exec, ops and transport code out of
daemon/srcinto three workspace crates:Command::newkeeps its statement-level allow.It then extends every step-1 guard to the new layout and adds four new guards:
unsafecensus for the read-only crates;file_read's now-suppressed open;It also:
daemon/srclines insecurity-surface.txt;No behaviour changes.
Changes from v1, by review finding:
unsafecensus.file_readchain pin.ban-probe = [].MAX_OUTPUT_BYTESstays inconfig.rs; thedispatch.rsedit is dropped.config.rs:58doc is updated, the existingENV_LOCKis reused, and a PR note covers the lexer's reading oftest-utilitems.The module graph today (measured from
use/crate::/super::edges)Four edges would form cycles across the named crates. Each is cut as below; nothing else changes.
file_read,pkg_install,service_restartandtemplateneedResourceLimitsandclean_io_error, butConfigneeds enroll and ops. Cut: moveResourceLimits(with its impls) andclean_io_errortorelay-exec/src/limits.rs.ConfigandMAX_OUTPUT_BYTESstay in the bin.MAX_OUTPUT_BYTESis not on any cycle (review #6): onlydispatch.rsuses it, and the executor gets the value throughExecRequest::max_output_bytes.EnrollConfig::from_config(body and tests) moves into the bin asconfig::enroll_config(&Config). The rest of enroll moves.registry.rs, andscheduler.rsre-exports it.rand_unitmoves to the relay-transport crate root, andmain.rsimports it.Resulting crate DAG:
There are no cycles.
What stays in the bin, and why
main.rs,dispatch.rs,scheduler.rs,dedup.rs,shutdown.rs: named by the issue.selfref.rs: maintainer decision.config.rs: needs enroll and ops. The lexer guard also pins it as a Policy-path-naming module.version.rs: reads the bin package'sCARGO_PKG_VERSION*, the ADR-0014 stamp.services.rs: depends on dedup and scheduler.policy_check.rs: depends on dispatch and selfref.catalog.rs: test-only, and itsinclude_str!paths are relative tosrc/. Keeping it avoids a data-file change in a read-only crate (ALLOWED_DATA_FILES).Placement inside the new crates:
raw_execgoes to relay-ops:registry.rscallsrun_raw_exec, and raw_exec needs Policy, which relay-exec may not depend on.Affected files: omitted here for length — the diff is the record (54 files).
Key decisions:
remove_fileonly.executor.rs(4), relay-opsraw_exec.rs(1) andfile_read.rs(4). The exec ban stays live in those test modules.templates.rskeeps one module-level allow (about 17 fixture statements), and the widened spawn-family census covers it.Command, a brace-imported libc exec/fork, or apre_execoutside relay-exec fails a test even where a clippy allow is in scope.unsafecensus pinned per file, tests included (review #2). This restores the backstop relay-policy gets fromforbid(unsafe_code), which relay-exec (pre_exec) and relay-ops (getifaddrs) cannot use. relay-policy keeps itsforbid.file_readchain pinned in clippy_write_ban.rs (review #4). That is where sanctioned suppressions in read-only crates are reviewed. The lexer guard is kept whole, and only its paths change.ban-probe = []for both new crates (review #5): the step-1 form. The script's--workspacelint resolvestokio::fsandtokio::process, and a resolution failure is loud, not silent.MAX_OUTPUT_BYTESstays inconfig.rs(review #6). It is not on a cycle, and onlydispatch.rs(bin) uses it. Leaving it keepsdispatch.rs,daemon-privilege-posture.md:166and three Go comments (job.go:144,job_test.go:861,dayone.go:69) correct with no edit.identity.rsis a sanctioned writer (lexer allowlist).from_config, move theREAD_CONCURRENCYdefinition, moverand_unit) is the minimum the named crates need. Rejected alternatives:Configin relay-transport: it would drag ops into transport and put the Policy-path-naming module beside the identity writer.use relay_exec::limits as configalias: misleading.test-utilfeatures (the step-1 pattern): relay-opsTemplateSet::{for_test, empty_static}and relay-transportidentity::mode_assert. Extended test (d) keeps them bin-dev-only.config.rssplit (limits out,enroll_configin, two doc lines);from_config→config::enroll_config(body verbatim) and its tests' call sites;rand_unitandREAD_CONCURRENCYdefinitions;any(test, feature = "test-util");#[allow(clippy::disallowed_methods, reason=…)]attributes (relay-exec 4; relay-ops 1 production + 6 test);ResourceLimitsdoc phrase;crate::config::→crate::limits::paths;pub(crate)→pubwhere required.Test strategy:
cargo testat the workspace root, which includesdev_fleet_fixtures,shutdown_signaland every structural guard. Moved unit tests now run in their own crate's test binary.daemon/tests/clippy_write_ban.rs:spawn_family_appears_only_in_relay_exec_executorspawn_scanner_catches_aliases_and_the_libc_familyunsafe_in_read_only_crates_is_exactly_the_pinned_mapfile_read_open_is_exactly_the_pinned_read_only_chainban_probe_script_covers_exactly_the_read_only_cratesread_only_clippy_configs_are_identical_and_carry_the_write_ban,clippy_config_files_are_exactly_the_expected_set,read_only_crates_depend_only_on_permitted_first_party_crates,read_only_crates_have_exactly_the_pinned_dependencies,lint_suppressions_are_exactly_the_pinned_map,path_mounts_and_includes_are_exactly_the_pinned_map,compiled_sources_of_read_only_crates_stay_inside_their_crate,compiled_sources_carry_no_unpinned_suppression_or_mount,read_only_crates_use_only_allowlisted_cfgs,ban_probe_mount_is_exactly_the_pinned_text,every_probeable_clippy_entry_has_a_probe_line,test_support_is_dev_only_and_no_dependency_enables_test_only_features.make check-daemon-bansmust reportok relay-exec (54 entries fire)andok relay-ops (127 entries fire), plus the step-1 three (104/31/31).std::fs::writein relay-ops non-test code →make lint-daemonfails, in all three passes.std::fs::writein relay-exec non-test code → lint fails.std::process::Command::newin relay-ops non-test code → lint fails, and so does the spawn census.Command::newin relay-transport or a bin module → lint fails (root ban), and so does the spawn census.file_read's production allow → lint fails.relay-transportto relay-ops' deps →may_depend_onfails.tempfileto relay-exec → the pinned-keys test fails.#[allow(clippy::disallowed_methods)]in relay-ops → the suppression census fails.#[cfg(not(debug_assertions))]in relay-exec → the cfg test fails.fs::writein relay-opstemplates.rsproduction → lexerpolicy_modules_never_writefails.tunnel.rs→log_fields_escapedfails.test-utilon relay-transport in a normal dependency → (d) fails.16. Statement-level allows (#3): add
let _ = std::process::Command::new("x");inside relay-execexecutor.rsmod tests→ clippy fails. This proves the exec ban is live in relay-exec's tests.17. Spawn census, alias form (h): inside relay-ops
templates.rsmod tests, which is module-allowed, adduse tokio::process::Command as C;andlet _ = C::new("x");. Clippy passes, because the module allow covers it. The spawn census fails.18. Spawn census, libc form (h): in the same module, add
use libc::{fork};withlet _ = fork;→ the spawn census fails.19.
unsafecensus (i): in relay-opssystem_facts.rsproduction, add// SAFETY: testandlet _ = unsafe { libc::dup2(0, 0) };. Clippy passes, becausedup2is not on the ban list. Theunsafecensus fails.20.
file_readchain (j), numeric flag: changelibc::O_NONBLOCK | libc::O_NOCTTYtolibc::O_NONBLOCK | 0o2. Clippy passes (allowed statement). The chain test fails.21.
file_readchain (j), write mode: add.write(true)to the same chain → the chain test fails.22. Probe-script crate list (k): drop relay-exec from
PROBE_CRATES→ban_probe_script_covers_exactly_the_read_only_cratesfails.make verify;cargo build --release --locked -p relay-daemon, host and--target x86_64-unknown-linux-musl;cargo deny --workspace --locked check bans licenses sources;cd daemon/fuzz && cargo build(stable);make test-crossbinaryandmake opschema-check(the shipped binary's behaviour and the Operation schema are unchanged);scripts/security-surface-test.sh, andscripts/check-docs.shfor the doc edits.verifywhile another build holds the target lock.Constraints and risks:
Invariants touched (none amended):
unsafecensus closes the libc-outside-the-list gap. Policy evaluation is untouched.daemon/**,docs/agents/security-surface.txt,scripts/**, the lockfiles and the manifests.AGENTS.md "pure move" discipline. The non-byte-identical edits listed under Key decisions are forced by the graph or by doc correctness. The
enroll_configrelocation is the one judgement call; the PR states it plainly as a deviation, not an escalation.Operator-visible change: tracing targets of the moved modules become
relay_exec::…,relay_ops::…andrelay_transport::…, so module-keyedRUST_LOGdirectives onrelay_daemon::{executor,raw_exec,templates,tunnel,…}stop matching. The decision records (relay_daemon::allow/relay_daemon::deny) are unchanged.relay-daemon-install.md§6 now documents this, and the PR repeats it.The release binary is behaviour-identical, not bit-identical: panic locations and symbol paths now name
crates/….Note for reviewers (review Wire proto codegen: buf → Go relay types + Rust tonic/prost build.rs #7): the lexer guard strips only a bare
#[cfg(test)](its header item (d)). It will now readTemplateSet::{for_test, empty_static}, which sit undercfg(any(test, feature = "test-util")), as production code. That is harmless (they contain no open or write), but the PR says so.Follow-ups the PR body lists, for the maintainer to file. The runner files no issues. These are the human-owned citations that go stale:
docs/adr/0015(:18,:57,operations/schema.rsandmod.rs);docs/adr/0034:131(renew.rs);docs/adr/0036(:30,:61-62,:69,:147:identity.rs,templates.rs,file_read.rs,mode_assert);docs/security/threat-model.md:264(executor.rs) and:302(raw_exec.rs);docs/security/secret-handling-audit.md:82-83(enroll.rs,identity.rs);relay/internal/capability/refusal.go:38,nodestate/nodestate.go:216and:327,controlplane/mcp/tools_operations.go:90,controlplane/console/dayone.go:44,console/job.go:839,console/job_test.go:1109,opvocab/opvocab.go:35and:108-111,opvocab/opvocab_test.go:115,registry/label.go:95, plus step 1'srefusal.go:28andnodestate.go:327(policy.rs).Suggested title: "docs: repoint human-owned daemon path citations after the daemon: Cargo workspace — relay-policy and relay-ops read-only by clippy, fuzzable crates #889 workspace split".
Second follow-up for the maintainer to file (review Implement the Go Relay binary: plaintext gRPC server handling Hello/Ping #8): "daemon/fuzz: fuzz targets over relay-ops Template/schema parsing and relay-policy TOML loading". This is the issue's "fuzzable crates" goal. The crates are now importable, but the targets were not in this issue's acceptance criteria.
Ordering risk. The guards (steps 10-13), the probe script (14), the probe headers (9) and the surface file (15) must land in the same commit series as the moves, or
cargo testandcheck-daemon-bansfail mid-series.Lockfile: CI builds
--locked, so the updateddaemon/Cargo.lockmust be committed.Gate skips to report:
/protois untouched, so the proto gates do not apply.check-crosslinks(ghmilestones) if it skips again.cargo +nightly fuzz buildis not run; say so.No ESCALATE. No migrated spec claim, ADR or invariant conflicts with this plan. The PR still needs human merge and security review.
Addendum (coordinator, folding in plan review cycle 2's suggestions — APPROVE):
mod tests: also remove the now-unuseduse crate::gen::Facts;andMutexfromuse std::sync::{Arc, Mutex};(onlyfake_config/ENV_LOCKused them).operations/system_facts.rs:5module doc namesEnrollConfig::from_config; reword to "the bin'sconfig::enroll_config" and list it among the non-byte-identical edits.identity::mode_assertalso moves undercfg(any(test, feature = "test-util")), so the lexer reads it as production (harmless: metadata only, identity.rs is allowlisted).docker/fixtures/templates.d/relay-demo/catalog.tomlcomment edit may change that demo Template file's fingerprint (nothing pins it).Revert checks (cycle 2 developer record)
All restored: yes. Each file was copied back from a saved copy,
cmpagainst the copy matched,Cargo.lockis unchanged, andgit diff --statmatched the pre-check baseline (14 files, +623/−70).std::fs::writein relay-ops productioncargo clippy --workspace --all-targets, then--lib --release, then--lib --release --target x86_64-unknown-linux-musl(the three passes ofmake lint-daemon, run separately)use of a disallowed method std::fs::writeatrelay-ops/src/lib.rs:34, in all three passesstd::fs::writein relay-exec productionuse of a disallowed method std::fs::writeatrelay-exec/src/lib.rs:29std::process::Command::newin relay-ops production--test clippy_write_ban spawn_family_appears_onlydisallowed method std::process::Command::new. Census:left: {executor.rs: 3, relay-ops/src/lib.rs: 1}Command::newin relay-transportrelay-transport/src/lib.rs:40; census{…, relay-transport/src/lib.rs: 1}Command::newin the bin (shutdown.rs)src/shutdown.rs:24; census{…, src/shutdown.rs: 1}executor.rs'sCommand::newdisallowed method tokio::process::Command::newatexecutor.rs:138file_read's production allowdisallowed method OpenOptionsExt::custom_flagsatfile_read.rs:127relay-transportto relay-ops' dependencies--test clippy_write_ban read_only_crates_depend_only_on_permittedrelay-ops: [dependencies] depends on relay-transport; … may depend on [relay-proto, relay-policy, relay-exec, relay-log] onlyregexto relay-exec's dependenciesread_only_crates_have_exactly_the_pinned_dependenciesleft: {regex, relay-proto, rustix, tokio} right: {relay-proto, rustix, tokio}#[allow(clippy::disallowed_methods)]in relay-opslib.rslint_suppressions_are_exactly_the_pinned_mapandproduction_and_test_suppressions_are_pinned_apartrelay-ops/src/lib.rs: 1entry, and the production list gains("[allow(clippy::disallowed_methods)]", "fn__inj(){}")#[cfg(not(debug_assertions))]in relay-execread_only_crates_use_only_allowlisted_cfgsrelay-exec/src/lib.rs: conditional compilation ["[cfg(not(debug_assertions))]"] is not allowlistedevery_probeable_clippy_entry_has_a_probe_line, thenmake check-daemon-bansrelay-ops: ban_probe.rs has 128 probe lines for 129 probe-able entries. The probe script still passed (128 fire), so the plan's "and the script fails" was wrongtokio::fs::File::set_lennin all five configsmake check-daemon-bans`tokio::fs::File::set_lenn` does not refer to a reachable functionin four configs, thenprobe lines clippy did NOT flagfs::writeintemplates.rsproduction--test policy_never_opened_for_writepolicy_modules_never_writefails:crates/relay-ops/src/templates.rs:57: fs:: path writererror = err.to_string()in relay-transporttunnel.rs--test log_fields_escapedtunnel.rs:[197]: field error = err.to_string() … is neither wrapped in log_field::untrusted nor an allowlisted local fieldfeatures = ["test-util"]on relay-transport in the bin's[dependencies]test_support_is_dev_only…relay-daemon: [dependencies] enables test-util on relay-transport; only the bin's [dev-dependencies] maystd::process::Command::newinside relay-execexecutor.rsmod testsdisallowed method std::process::Command::newatexecutor.rs:589use tokio::process::Command as C; C::new("x")intemplates.rsmod tests{…, templates.rs: 1}use libc::{fork}; let _ = fork;in the same module{…, templates.rs: 2}unsafe { libc::dup2(0, 0) }insystem_facts.rsproductionunsafe_anywheresystem_facts.rs: 2against pinned 1O_NONBLOCK | 0o2infile_readfile_read_openleft: "letopened=…custom_flags(libc::O_NONBLOCK|0o2).open(path);".write(true)added to thefile_readchainfile_read_openleft: "…read(true).write(true).custom_flags(…)…"PROBE_CRATESban_probe_script_covers_exactly_the_read_only_cratesleftlacksrelay-exec,righthas itlibc::SYS_execveatandSYS_clone3consts in the bin (dispatch.rs){…, src/dispatch.rs: 2}use libc::{syscall as sc};in the bin{…, src/dispatch.rs: 1}let _ = libc::execveat;in the bindisallowed method libc::execveatatdispatch.rs:24let _ = libc::clone;in the bindisallowed method libc::clonelet _ = libc::syscall;in the bindisallowed method libc::syscallunsafe { libc::dup2 }in the binunsafe_anywhere"src/dispatch.rs": 1unsafe { std::mem::zeroed::<u8>() }in relay-transportunsafe_anywhere"crates/relay-transport/src/lib.rs": 1executor.rs, at constant totallint_suppressions_are_exactly…, thenproduction_and_test_suppressions_are_pinned_aparttemplates.rs's allow frommod teststoimpl TemplateSettemplates_test_allow_sits_on_mod_tests…and the split guardtemplates.rs's one suppression must sit directly between #[cfg(test)] and mod tests, and the split test also failsf.set_modified(UNIX_EPOCH)in the match armfile_read_openand the split guardExecRequest { ..a }construction in relay-opslib.rsrelay_ops_builds_exec_requests_only_at_the_pinned_sitesleftgains"crates/relay-ops/src/lib.rs": 1default = ["test-util"]in relay-ops[features]every_features_table…andno_test_util…left: {ban-probe, default, test-util}; andrelay-ops resolves with test-util in the shipped build (features {default, test-util})features = ["test-util"]on relay-ops in[workspace.dependencies]test_support_is_dev_only,every_features_table,no_test_util…relay-ops resolves with test-util in the shipped build (target None, features {test-util})This PR was produced by the dev-loop and must be merged by a human — nothing here merges autonomously.
🤖 Generated with Claude Code
https://claude.ai/code/session_017phewNxcFMxpU3ntX2TKek
Generated by Claude Code