Repository navigation
feat(workers): fail-closed continuous activation switch (W4-03) - #481
Merged
Merged
Conversation
Add workers::activation, the only production route to a SchedulerPermit. enable() refuses unless the verdict token matches, no emergency stop is active, the acceptance evidence for matrix rows 1-26 is accepted for exactly the policy revision named, and the switch was not enabled for that revision before. The production evidence source (NoMachineReadableEvidence) is always locked, so the switch cannot be turned on yet. Two Tauri commands (get_continuous_activation, enable_continuous_activation) and a read-only status entry in the Control API snapshot are wired in main.rs; the permit is only parked, no dispatch loop is started. The scheduler permit constructor is narrowed so only the activation module can build one. The status call in the ApiBackend uses the decided block_on pattern (allowlisted drift line). Test-First: src-tauri/src/workers/activation.rs::workers::activation::tests::activation_refuses_a_stale_policy_revision Test-First: src-tauri/src/workers/activation.rs::workers::activation::tests::activation_refuses_missing_or_wrong_verdict_token Test-First: src-tauri/src/workers/activation.rs::workers::activation::tests::activation_refuses_while_the_emergency_stop_is_active Test-First: src-tauri/src/workers/activation.rs::workers::activation::tests::activation_stays_locked_without_machine_readable_evidence Test-First: src-tauri/src/workers/activation.rs::workers::activation::tests::only_the_activation_module_builds_a_production_permit Test-First: src-tauri/src/workers/activation.rs::workers::activation::tests::unlocked_activation_enables_exactly_once_for_the_accepted_revision Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Cuarroc
marked this pull request as ready for review
October 5, 2026 10:13
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
… guard (W4-03 review) No-Test: strengthens an existing test and adds a comment; no behaviour change Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Owner
Author
|
@Mergifyio queue |
12 tasks done
Contributor
Merge Queue Status
This pull request spent 13 minutes 50 seconds in the queue, including 13 minutes 34 seconds running CI. Required conditions to merge
|
This was referenced Oct 6, 2026
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.
Dieser PR baut den Schalter, der den Dauerbetrieb (Continuous Mode) einschalten könnte, aber so, dass er im Zweifel zubleibt. Er lehnt jeden Einschaltversuch ab, solange das Prüfzeugnis für die Abnahme-Zeilen 1–26 nicht maschinenlesbar vorliegt – und das tut es heute nicht, der Schalter bleibt also gesperrt. Es startet noch keine Arbeitsschleife; das ist ein späteres Paket.
Report
Supersedes branch
claude/w4-03-activation-switch(head aa9b3f4, left untouched): its feature commit carried the wrong subject and aNo-Testtrailer, and no PR was opened. This is the same content (git diff origin/main...aa9b3f4applied cleanly) as one correct commit. Base: origin/main 4c1d9db.What changed
src-tauri/src/workers/activation.rs: the only production route to aSchedulerPermit.enable()refuses unless: the verdict token matches; no emergency stop is active; the evidence source reports rows 1-26 accepted for exactly the requested policy revision (stale revision refused); the switch was not already enabled for that revision. The production sourceNoMachineReadableEvidenceis alwaysLocked.main.rs(seam): Tauri commandsget_continuous_activation(read-only status) andenable_continuous_activation; the permit is parked inHeldSchedulerPermit, nothing consumes it. Control API snapshot gets a read-onlycontinuousActivationentry.scheduler.rs: permit constructor narrowed so only the activation module can build one (testonly_the_activation_module_builds_a_production_permit).Evidence
cargo test --bin projecta activation -- --list(exit 0): 6 new tests + 1 existing.bash scripts/ci/red-first.sh --plan(exit 0): count=6, specs=6.bash scripts/ci/gates.sh lane prepushat final HEAD 0448cf2 (exit 0), also run as the pre-push hook (exit 0). Remote SHA = local SHA (git ls-remote).Architecture drift
scripts/ci/architecture-drift.allowgets oneAPI_STORE_BLOCK_ONline for the newApiBackendstatus call inmain.rs: the decided pattern (ApiBackend stays in main.rs until after M4). No other drift finding.Open points (from the first job)
api.rsseam; only the read-only status is exposed there.NICHT ABGEDECKT
#[cfg(windows)]tests, Windows clippy arms): runs in the merge queue.Review
Review: Stufe A durchgeführt (Ollama, autor-fremd).
Review disposition
Reviewer: kimi-k3 (
kimi-k3:cloud) und glm-5.2 (glm-5.2:cloud) über.pa/review_transport.py, beide Exit 0. Kandidat-SHA: 0448cf2; Fix-Commit 58b9a89 (Delta nur Test + Kommentar). Beide: „freigeben mit Auflagen“.activation.rsenable(): Stop-Check undset_settingnicht atomar. Gegengeprüft: Dispatch-Schreibzugriffe sind durch die Emergency-Stop-Trigger im Store geschützt (store/emergency_stop.rs:23-47), ein später gesetzter Stop blockiert jede Nutzung des Permits; heute wird der Permit nur geparkt. Als Defekt widerlegt; Kommentar an der Stelle ergänzt (58b9a89).activation.rstokens_match). Angenommen: gleichlange Falschtokenst0k/toKim Test ergänzt (58b9a89,No-Test-Trailer: bestehender Test verstärkt, red-first OK)..manage(), vorhandeneAPI_STORE_BLOCK_ON-Erlaubnis.cargo test --bin projecta activation(Exit 0, 7 passed);bash scripts/ci/red-first.sh(Exit 0); Push mit prepush-Hook (Exit 0), Remote-SHA = lokal 58b9a89; CI auf 58b9a89: gates (linux) pass, gates (windows) pass (Stub auf PR).🤖 Generated with Claude Code