Repository navigation
fix(store): make task planning authorization atomic (M4B-2) - #1849
Conversation
Prove the public HTTP precheck-to-writer fence race against unchanged production code. Delegate the existing native fixture to the legacy Store task writer before the fix. Test-First: src-tauri/src/api/tests/planning_access_tests.rs::planning_task_fence_interleaving_rejects_without_task_or_event Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Compare the complete public task snapshot after fixture setup has advanced the coordinator fence. Preserve the writer admission handshake and refusal assertions; the unchanged production writer still accepts the stale request. Also name the real task_create audit action in the native fixture control. Test-First: src-tauri/src/api/tests/planning_access_tests.rs::planning_task_fence_interleaving_rejects_without_task_or_event Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Recheck scoped planning authority under the existing goal/task writer lock before task writes. Require explicit task authority forwarding in the API backend, keep operator None and GOAL semantics, and leave assignment/import adapters unchanged. Test-First: src-tauri/src/api/tests/planning_access_tests.rs::planning_task_fence_interleaving_rejects_without_task_or_event Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af8226f8ab
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| #[test] | ||
| fn planning_task_fence_interleaving_rejects_without_task_or_event() { |
There was a problem hiding this comment.
Add the required red-first trailer
This source-changing commit adds the regression test but contains no Test-First:, Regression-For:, or No-Test: trailer (tf_message_has_required_trailer rejects its message), so the red-first gate cannot associate or replay the claimed failing test and the commit is not mergeable under the repository workflow. Add the exact test selector as a Test-First: trailer.
AGENTS.md reference: AGENTS.md:L268-L271
Useful? React with 👍 / 👎.
| | Z4-M4B-1-GOAL | Atomare Autorisierung und Goal/Replan, continuous.rs plus api/planning_access/Tests/main, 220–290 ALL | ein serieller st/api/mn-Owner | Z4-M4B-1a-PLUMB; freigegebene Sicherheitskorrektur ohne Continuous-Aktivierung | eigener Worktree | A | Erledigt nach Merge von #1842: atomarer GOAL-Schreiber geliefert; vor Merge bleiben Fremdreviews und Root-Abnahme ausstehend. Sicherheitsbefund bis Z4-M4B-4-IMPORT offen; Continuous bleibt eingefroren. | deterministisches kompilierendes Fence-Interleaving-Rot; stale ohne Goal/Event; PLANNING_REFUSED muss HTTP 403 und audit_planning mit refused ergeben (eigener deterministischer Rot vor Fix); Alle vier Planungs-POSTs liefern Some(Run/Owner/Fence), Operator explizit None; Scoped Goal-POST erreicht das erforderliche create_continuous_goal_with_authority mit gebundener Run-/Owner-/Fence-Autorität, Operator None; kein ignorierender Produktionsdefault für Goal, kein Goal-Legacy-Routenbypass; Import/Task/Zuweisung behalten ihre Durchreicher bis zum eigenen Paket; scoped control/queue bleiben gesperrt; gültiger Coordinator erfolgreich, autonome Root operator-only, Operator/Audit erhalten; eigene prepush, zwei zulässige Fremdreviews und GPT-Beobachter gemäß AGENTS.md | 2be81e2e | | ||
| | Z4-M4B-2-TASK | Atomare Taskanlage, gleicher begrenzter Dateisatz wie GOAL, 180–270 ALL | ein serieller st/api/mn-Owner | Z4-M4B-1-GOAL (Nahtübergabe) | eigener Worktree | A | Geplant: strikt seriell (Nutzer 16.10., K7 A; Prüfbericht 16.10.: der Befund gilt weiter); Sicherheitsbefund besteht bis Z4-M4B-4-IMPORT fort, Continuous bleibt eingefroren | Fence-Interleaving-Rot; stale ohne Task/Event; eigenes Projekt erfolgreich, fremde Goals/Dependencies abweisen, Operator erhalten; eigene prepush/zwei Fremdreviews | 8dbd5dc7 | | ||
| | Z4-M4B-1-GOAL | Atomare Autorisierung und Goal/Replan, continuous.rs plus api/planning_access/Tests/main, 220–290 ALL | ein serieller st/api/mn-Owner | Z4-M4B-1a-PLUMB; freigegebene Sicherheitskorrektur ohne Continuous-Aktivierung | eigener Worktree | A | Erledigt: #1842 (merged 2026-10-22T18:35:12Z, fa4f2d9a). Sicherheitsbefund bis Z4-M4B-4-IMPORT offen; Continuous bleibt eingefroren. | deterministisches kompilierendes Fence-Interleaving-Rot; stale ohne Goal/Event; PLANNING_REFUSED muss HTTP 403 und audit_planning mit refused ergeben (eigener deterministischer Rot vor Fix); Alle vier Planungs-POSTs liefern Some(Run/Owner/Fence), Operator explizit None; Scoped Goal-POST erreicht das erforderliche create_continuous_goal_with_authority mit gebundener Run-/Owner-/Fence-Autorität, Operator None; kein ignorierender Produktionsdefault für Goal, kein Goal-Legacy-Routenbypass; Import/Task/Zuweisung behalten ihre Durchreicher bis zum eigenen Paket; scoped control/queue bleiben gesperrt; gültiger Coordinator erfolgreich, autonome Root operator-only, Operator/Audit erhalten; eigene prepush, zwei zulässige Fremdreviews und GPT-Beobachter gemäß AGENTS.md | 2be81e2e | | ||
| | Z4-M4B-2-TASK | Atomare Taskanlage, gleicher begrenzter Dateisatz wie GOAL, 180–270 ALL | ein serieller st/api/mn-Owner | Z4-M4B-1-GOAL (Nahtübergabe) | eigener Worktree | A | Erledigt nach Merge dieses Pakets: TASK prüft Run/Owner/Fence/Rolle/Zielprojekt atomar in seiner SQLite-Schreibtransaktion; erforderliche API-Weiterleitung, Operator None erhalten. Eigene prepush ist Pflicht; vor Merge bleiben zwei qualifizierte Fremdvendor-Reviews plus GPT-Beobachter und Root-Abnahme ausstehend. ASSIGN/IMPORT und GOAL-Restbefunde (Ticket 2dbc396c-9b74-4556-9c28-d9e00f5c6310) bleiben offen; Sicherheitsbefund bis IMPORT offen, Continuous bleibt eingefroren. | Fence-Interleaving-Rot; stale ohne Task/Event; eigenes Projekt erfolgreich, fremde Goals/Dependencies abweisen, Operator erhalten; eigene prepush/zwei Fremdreviews | 8dbd5dc7 | |
There was a problem hiding this comment.
Bring the TASK plan status up to date
At this reviewed head, the recorded review disposition says the two vendor reviews have completed, but this row still says both vendor reviews are outstanding. Because docs/PLAN.md is the canonical dispatch state, leaving that claim here can cause the coordinator to schedule duplicate reviews and prevents the required head status from being accurate before review-ok; update the row to distinguish the completed vendor reviews from the still-pending GPT observation and Root acceptance.
AGENTS.md reference: AGENTS.md:L139-L139
Useful? React with 👍 / 👎.
|
@Mergifyio queue |
Merge Queue Status
This pull request spent 52 minutes 13 seconds in the queue, including 51 minutes 42 seconds running CI. Required conditions to merge
|
Die Taskanlage prüft die Koordinatorberechtigung jetzt innerhalb derselben SQLite-Schreibtransaktion erneut.
Ein deterministischer HTTP-Test belegt die bisherige Fence-Lücke und ihre Abweisung ohne neuen Task oder Event.
Continuous bleibt deaktiviert und eingefroren; unabhängige Reviews und Root-Abnahme stehen noch aus.
Report
Plan-ID: Z4-M4B-2-TASK
Change and delivery
5a07fc0895ff6bb813df265fa9d730d38d1b1ed9; candidate:af8226f8ab06982e038e957a0398de290dbf85c0oncodex/m4b-2-task.create_continuous_task_with_authorityreusesrequire_planning_authoritywithPlanningTarget::Goalafterbegin_goal_task_auditobtainsBEGIN IMMEDIATE, before task normalization and domain writes. Authority checks, task/event writes, savepoint rollback and the goal/task audit share that writer transaction.ApiBackendexplicitly forwards authority; the obsolete legacy API method is removed. The legacy Store convenience wrapper is test-only and passes explicitNone; operator HTTP writes also reach the required method withNone.Semantic red-first and test boundary
Regression:
api::tests::planning_access_tests::planning_task_fence_interleaving_rejects_without_task_or_eventinsrc-tauri/src/api/tests/planning_access_tests.rs.The public HTTP boundary uses the existing
FakeBackend.native_storefixture with real SQLite role/project prechecks and task writes. A bounded test-only admission handshake pauses after those real prechecks. An independent SQLite connection advances the coordinator fence before releasing writer admission. Both receives are time-bounded; unwinding disconnects the resume sender before scoped joins. No sleeps or production test hook were added.5a07fc08production plus the finalized test overlay recorded incbd8a2e039427709db2678c2b0e3f1ae76ea260f; production-source diff against the base was empty (exit 0). The RED fixture overrides the already existing authority method but delegates to the legacy Store writer. The exact test ran and exited 101, observing HTTP 200, a newly created task and an accepted planning envelope instead of 403/refused. No missing-selector result is used as semantic evidence.50f69238d6c0eb04ea2f2a2abab67e2dd7b5be9731bc8cb972e790df6176844f. The only GREEN fixture change is delegation to the new authority-aware Store entry point with the real authority.Store::continuous_context(project, 0).tasks; events use publiccontinuous_changes. SQL is used for boundary setup/fence mutation and the existing audit-read pattern.task_createaudit alongside the two planning envelopes.Evidence (2026-10-22, Linux)
All Cargo invocations and heavy phases ran serially in this package's worktree. Resource admission preceded heavy phases: fresh UTC/load/RAM/cargo observations, load below 8, available RAM above 3500 MiB, no existing cargo build at admission;
npm run dev:start-check -- --max-cargo 2 --min-free-gb 3.5exited 0. Actual native harness reportedgpt-6.1-sol, efforthigh; observed weekly utilization remained below the implementation cap.cargo test --manifest-path src-tauri/Cargo.toml --bin projecta api::tests::planning_access_tests::planning_task_fence_interleaving_rejects_without_task_or_event -- --listcargo test --manifest-path src-tauri/Cargo.toml --bin projecta api::tests::planning_access_tests::planning_task_fence_interleaving_rejects_without_task_or_event -- --exact --nocapturecargo test --manifest-path src-tauri/Cargo.toml --bin projecta api::tests::planning_access_tests -- --nocapturecargo test --manifest-path src-tauri/Cargo.toml --bin projecta store::continuous::tests -- --nocapturebash scripts/ci/gates.sh lane prepushgit push -u origin codex/m4b-2-taskgit ls-remote origin refs/heads/codex/m4b-2-task refs/heads/mainbash scripts/ci/red-first.sh --plannode scripts/ci/architecture-drift.mjs checkbash scripts/ci/secret-scan.shgit diff --check 5a07fc08...HEADgh run view 39837362146 --json headSha,status,conclusionArchitecture drift
Replace exactly the existing task
API_STORE_BLOCK_ONallowlist occurrence with the authority-aware call. This preserves the decided F1 location ofApiBackenduntil after M4; no new category, occurrence or ceiling. Main remains 4059/4059 lines; API shrinks to 2554/2574. No warning suppression was added.Review and remaining ownership
Review: ausstehend (Stufe A).
Root commissions two qualified non-OpenAI vendor reviews (
glm-5.3or permittedglm-5.3-flash, plusdeepseek-v4.1-flash) and a separate Codex observer, bound toaf8226f8ab06982e038e957a0398de290dbf85c0. No independent review is claimed and the author launched none. Findings/dispositions: pending; Root retains the two-round merge/split/drop decision and review-ok/queue authority.Parent: Z4/M4B atomic scoped planning authorization. Ticket:
8dbd5dc7-7de2-4eea-bdcd-b98d14a93365; execution owner:srv-m4b-2-task. This bounded handover delivers TASK; the parent remains open. Dependencies GOAL #1842 and base #1835 are merged. Next: qualified reviews and Root acceptance, then Mergify; later ASSIGN/IMPORT stay separate. Residual GOAL review inventory remains open in ticket2dbc396c-9b74-4556-9c28-d9e00f5c6310.NICHT ABGEDECKT
#[cfg(windows)]tests (run_in_pty, npm_shim, ConPTY, DPAPI) or Windows clippy branches. The Windows lane runs in the merge queue; this is only Linux evidence.--plan, explicit selector listing and the compiling semantic RED/GREEN runs above are the observed evidence.Review round 1 — Root disposition (2026-10-22T19:57Z, head af8226f, base 5a07fc0)
Tier A (seams api.rs, main.rs, store/). Author family OpenAI (gpt-6.1-sol). Reviewers: glm-5.3 (Zhipu) approve with conditions, deepseek-v4.1-flash (DeepSeek) approve with conditions; no high. Size 212+/27- = 239 lines (≤300). PLAN rows: Z4-M4B-1-GOAL now "Erledigt: #1842", Z4-M4B-2-TASK "Erledigt nach Merge…" — both parse as valid statuses (parseGoals; the 8 pre-existing invalid rows are unchanged).
PLANNING_REFUSEDgit grepat af8226f finds no non-test caller ofcreate_continuous_task((incl. bin/pa.rs) and exactly threeimpl ControlBackend(main.rs:2574, api/tests/mod.rs:690, api/agent_access.rs:657), all updated; prepush runscargo clippy --all-targets(gates.sh:206), exit 0begin_goal_task_audit→begin_writeusesBEGIN IMMEDIATE(store/continuous.rs:1168)native_storeis set — whole api module green?server.descriptor_path()is the server's operator API descriptor (api.rs:1096), same pattern as api/tests/mod.rs:2229; assertingtask.goalIdthere too is a low follow-upNo accepted code finding → no NACHBESSERN round. Next: PR checks, GPT observer (codex bot) on af8226f, then acceptance.
GPT observer + acceptance — Root, 2026-10-22T20:11Z, head af8226f
Test-First: src-tauri/src/api/tests/planning_access_tests.rs::planning_task_fence_interleaving_rejects_without_task_or_event;tf_message_has_required_trailer(scripts/lib/test-first.sh:54, origin/main) returns 0 for each; CIred-firstSUCCESS on af8226fPR checks on af8226f: all green (gh pr checks --watch exit 0). Tier A met: glm-5.3 (Zhipu) + deepseek-v4.1-flash (DeepSeek), no high, no accepted code finding; GPT observer dispositioned. Root decision: merge. The overall M4B security finding stays open until Z4-M4B-4-IMPORT.