Skip to content

Security runs and the Security review: thirdshift finds, reproduces and fixes vulnerabilities - #556

Merged
JacobStephens2 merged 85 commits into
mainfrom
issue-427
Oct 9, 2026
Merged

JacobStephens2 merged 85 commits into
mainfrom
issue-427

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds Fencing with thirdshift secure and opt-in guidance Security reviews. Findings are recorded privately and reproduced before an allowed fix becomes public work.

Security run
  gates: shared Pass lock → Ready issue → failed fix still open
  work: most severe reproduced fix, else wait/unchanged skip, else audit
  audit: origin/Base branch → quick audit → private records → sequential reproductions
  allowed fix: terse Ticket or Spec → dispatched Run or Spec run

Delivery (Run, Base fix, or completed Spec PR; excludes Ticket Runs)
  opening session → optional guidance Security review → push → Repair/CI → ready or Self-merge
  introduced finding left unfixed / refused or incomplete review → hold Self-merge
  reproduced old finding → private record for a later Security run
  • Public repositories use draft advisories; private repositories use security-finding issues. Records match fingerprints across states and preserve the Day shift's grades. Failed fixes keep their Claim and pause Fencing until closed.
  • Command words and [security] settings control review, fixing and Harness choice; both features default off. Setup asks about review and fixing. Codex security sessions retain refusal checks, answering-Model logs and the raised thread cap; guidance reviews stay in one session, including Resume.
  • Security runs share Pass locking, Activity and Command logs, and dispatch notifications. Notifications include severity, title and private link; no private write-up. Undecided fixing is offered explicitly.
  • Embeds the MIT-licensed Cloudflare audit skill at c1c8a8c, including its Node validators. Adds README setup and cron examples, generated prompts and the Prompts and skills page. The graded trial records the Day shift's guidance-mode choice and its detection limits.

Closes #427

Evidence

  • Before: cargo test --test security_review guidance_security_review_on_codex_does_not_request_delegated_auditors -- --exact --nocapture failed: Codex appended a delegation instruction to the single-session guidance review. After: passes; covers the initial session and Resume. The existing full-audit regression also passes with fresh sub-agents on both launches.
  • Before: cargo test --test security_review reproduced_old_review_finding_sets_the_private_advisory_severity -- --exact --nocapture failed with null instead of low. After: passes; new reproduced review records use the existing private-record update rules to write the scored severity and proof-of-concept.
  • Validation: cargo nextest run --test-threads 8: 1,632 passed, one existing benchmark skipped. cargo test also passed. Node validators: 65 passed. cargo fmt --check and cargo clippy --all-targets -- -D warnings pass. Generated-page checks pass in the Rust suite.

Test seams

  • The end-to-end scenario harness: the real binary and git, fake GitHub and Harness CLIs; observable command results, prompts, records, delivery, logs and notifications.
  • The Pass seam's in-memory double: gate order, work selection and waiting permutations.

Unaddressed findings

Standards

None.

Spec

Inherited informational advisory grade decision: #567, originally raised by PR #566, remains open with only needs-triage. The Spec asks for the rubric grade and proof-of-concept on the record, while the public advisory severity field cannot carry informational. src/github/advisories.rs:500–506 deliberately fails before writing an unsupported grade; private finding issues retain it. The Day shift must choose the representation, which the Spec has not settled.

Focused runs both pass and exercise this exact boundary: cargo test --test security_run an_informational_advisory_requires_a_day_shift_decision_without_an_invented_grade -- --exact verifies the deliberate public failure and unchanged evidence; cargo test --test security_run a_private_reproduction_accepts_the_rubrics_informational_severity -- --exact verifies private preservation. These runs document the deferred policy; they do not claim the public requirement is complete.

Review coverage

Review fixed point: main at 3a81a11; original Spec head: 58bb0de. Both axes read all 106 changed files, including generated files, imported skill sources and tests. No changed file was left unread. Reports with each axis's final files-read list are saved as .thirdshift-review-igwNvs/standards.md and .thirdshift-review-igwNvs/spec.md.

Merge Danger

Door: two-way

The code and opt-in settings can be reverted. Enabled Security runs create private GitHub records; explicitly allowed fixing can publish issues and push code, disclosing the fixed vulnerability as described in ADR 0015.

Blast Radius: factory

Touches shared Pass, Harness and Delivery paths used by Runs, Spec runs, Base fixes and scheduled Passes. Security review and fixing stay off by default; the whole-repository audit and guidance review have separate execution policies.

Tickets

Built with codex · gpt-6.1-sol · xhigh

Ship Cloudflare security-audit as a Factory skill
Prefactor shared Pass lock, logging and command words
Trial the Security review's two modes
Fix macOS stdout-holder interruption test timing
On case-insensitive macOS filesystems, the lowercase candidate resolves to
the tracked docs/THREAT-MODEL.md file, so discovery named the wrong spelling
in the Session prompt. Require an exact match in the audited checkout's
tracked paths before selecting an existing document.

Keep the end-to-end regression unchanged. It failed with the CI symptom in
a local replay of case-insensitive lookup and passes with this fix.
Record private repository Security findings as labelled issues
Preserve failed Security-fix lifecycle tracking alongside Spec-sized fixes and reuse of private finding issues. Update the failure fixtures and help text, and cover failed Spec fixes pausing Security and Pickup until closure.

Validation: cargo check --all-targets; cargo fmt --check; cargo clippy --all-targets -- -D warnings; cargo test --no-fail-fast (1605 passed, 0 failed, 1 ignored).
Pause Security after failed fixes and offer fixing
Add opt-in guidance Security reviews to Runs
Run guidance Security review once on Spec PRs
Preserve whole-Spec guidance Security reviews alongside private recording of pre-existing findings. Update the Spec review fixtures for the private report, pre-existing count, and pinned published merge base.

Validation: cargo check --all-targets; cargo clippy --all-targets -- -D warnings; cargo fmt --check; UPDATE_PROMPTS=1 cargo test prompts_page; cargo test --no-fail-fast (1630 passed, 0 failed, 1 ignored).
Record old Security review findings privately
Keep Codex guidance reviews in one session across Resume while retaining
security refusal checks, Model logging and the security thread cap.
Record the scored severity of reproduced old review findings through the
existing private-record update rules. Retain both review regressions.
@JacobStephens2
JacobStephens2 marked this pull request as ready for review October 9, 2026 11:21
Preserve Security settings and Ready issue exclusions alongside the
configurable Pickup settling window. Put the notification Result line
before Security audit metadata while retaining private finding redaction.
Keep interrupted-work preservation assertions alongside upstream
natural-expiry and delayed-cleanup regression coverage.

Validation: cargo check --locked --all-targets; cargo clippy --locked
--all-targets -- -D warnings; cargo test --locked --no-fail-fast --
--test-threads=8 (1659 passed, 0 failed, 1 ignored); cargo fmt --check;
Node validator tests (65 passed).
@JacobStephens2
JacobStephens2 merged commit b5111b2 into main Oct 9, 2026
17 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-427 branch October 9, 2026 11:55
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security runs and the Security review: thirdshift finds, reproduces and fixes vulnerabilities

1 participant