Repository navigation
Closed
Description
Parent
#876 — ci(security): add a hostile-head-safe review action mode.
Problem
The composite action's source install path regenerates Cargo.lock immediately before a locked build. That allows dependency resolution to drift from the committed source tree and means the action SHA does not freeze the source-build dependency graph.
Target seam
action.yml, function build_from_source() only.
Change source mode to:
- copy the action source as today;
- require a committed
Cargo.lock; - fail closed if the lockfile is missing or stale relative to the copied manifest/workspace;
- invoke
cargo build --lockedwithout any preceding lock regeneration.
Release and path modes must remain behaviorally unchanged.
Acceptance criteria
- Source mode contains no
cargo generate-lockfileor equivalent resolver mutation. - Source mode validates that
$workdir/Cargo.lockexists and is a regular file before build. - Source mode uses
cargo build --manifest-path "$workdir/Cargo.toml" --locked .... - A missing lockfile fails before Cargo build with an actionable error.
- A stale lockfile fails closed through Cargo's
--lockedbehavior; proof covers this contract. - Release and path branches remain unchanged.
- Focused tests/static checks cover command ordering and source-only scope.
actionlint action.yml, relevant Rust tests,cargo fmt --check, andcargo xtask policy-checkpass.- Any controlled action metadata change is covered by the existing
policy/allow.tomlaction metadata receipt; no broad policy or threshold changes.
Proof commands
- Focused action source-mode fixture/static test, including missing and stale lock negative cases.
actionlint action.yml(or repo-local equivalent if unavailable).cargo test --locked --test clifocused action assertions.cargo fmt --all -- --check.cargo xtask policy-check.
Non-goals
- No trusted-base admission, diff ingestion, environment allowlisting, sensor/tool pinning, release/path changes, or broader ci(security): add a hostile-head-safe review action mode #876 implementation.
- No lockfile regeneration or dependency updates.
- No workflow, toolchain, gate policy, or threshold changes.
Rollback
Revert the one-file action change. The prior source build remains available, but the security contract is not considered complete until immutable lock admission is restored.
Reacted by coderabbitai
Activity
coderabbitai commentedon Aug 20, 2026
🔗 Related PRs
#845 - fix(init): validate the first-run smoke path [merged]
#879 - fix(security): quarantine sensor child environments [merged]
#883 - ci(security): trusted-base explicit diff admission [open]
#884 - fix(security): admit trusted-base explicit diffs [open]
#890 - fix(security): validate trusted explicit diff admission [open]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
EffortlessSteven commentedon Aug 20, 2026
Read-only refresh 2026-08-20: issue remains open; no PR #893 exists (GitHub 404), and no remote
codex/893-source-lockfilebranch is published. Dedicated worktreeE:\Code\Rust3\ub-review-893remains dirty with uncommitted changes inaction.ymlandtests/cli.rsatopcad918b05fa98095be4da01e88615b9fc8aca2c1(current main). Owner work is not safe to hand off or race. Current draft covers lock guard / --locked ordering, but acceptance still needs exact-head commit/PR plus proof of regular-file/stale-lock behavior and required actionlint/policy/test evidence.EffortlessSteven commentedon Aug 20, 2026
Read-only refresh 2026-08-20 09:45 EDT: worktree remains dirty and owner-held; no PR or remote branch. Changes are action.yml + tests/cli.rs atop cad918b. Recent file writes 06:47/06:49 EDT; no owner release. Current draft adds missing-lock guard and --locked ordering, but acceptance still needs regular-file/stale-lock proof and exact-head hosted evidence.
EffortlessSteven commentedon Aug 24, 2026
Merge-front position
#893 remains a single bounded PR and sits in #945 Horizon A containment:
It must remain limited to
build_from_source()plus focused contract tests. Do not fold #923 identity, #876 trusted-base work, tool pinning or workflow authority into this patch.EffortlessSteven commentedon Aug 24, 2026
Implementation review packet from current
action.ymlThe current
build_from_source()copies the Action source into a temporary workdir, then runs:That makes
--lockedlargely ceremonial: the candidate dependency graph is resolved immediately before build rather than frozen by the committed source.Exact code shape
After the copy and before any Cargo command:
Then invoke only:
Do not run
generate-lockfile,cargo update,cargo metadatawithout--locked, or any fallback resolver mutation.Scope control
Proof expectations
Use both static contract and behavior:
--locked;actionlint, focused Action/CLI tests,cargo xtask policy-check, format and diff hygiene pass.Review stop condition
Do not make the stale-lock test pass by regenerating or editing the fixture lockfile during execution. The expected behavior is a closed failure proving source admission is immutable.