Repository navigation
fix(store): make assignment planning authorization atomic (M4B-3) - #1852
Conversation
Pause HTTP assignment admission after role and project prechecks, advance the coordinator fence, and require refusal without assignment or event changes. The fixture deliberately delegates to the existing legacy Store writer for the compiling semantic RED. Test-First: src-tauri/src/api/tests/planning_access_tests.rs::planning_assignment_fence_interleaving_rejects_without_assignment_or_event Co-authored-by: OpenAI GPT-6.1 <noreply@openai.com>
Acquire the SQLite writer lock before checking run, owner, fence, coordinator role and target project. Reject scoped coordinator-role escalation after normalization, require explicit API authority forwarding, and preserve operator assignments and existing revision and claim controls. Test-First: src-tauri/src/api/tests/planning_access_tests.rs::planning_assignment_fence_interleaving_rejects_without_assignment_or_event Test-First: src-tauri/src/api/tests/planning_access_tests.rs::planning_assignment_native_controls_preserve_authority_revision_and_operator 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.
ℹ️ 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".
| | 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 | | ||
| | Z4-M4B-3-ASSIGN | Atomare Zuweisung, team_assignments.rs plus api/planning_access/Tests/main, 200–280 ALL | ein serieller st/api/mn-Owner | Z4-M4B-2-TASK (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 Assignment/Revision/Event; Selbsteskalation abweisen, gültige Zuweisung/Operator erhalten; eigene prepush/zwei Fremdreviews | 15d92066 | | ||
| | 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: #1849 (merged 2026-10-22T21:03:34Z, `8c86bfc44c50e55209da7de48fdc7e3cb692a750`); TASK prüft Run/Owner/Fence/Rolle/Zielprojekt atomar in seiner SQLite-Schreibtransaktion; erforderliche API-Weiterleitung, Operator None erhalten. 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.
Synchronize the M4B summary with the completed rows
After this row records M4B-2 as merged, the release-order summary at docs/PLAN.md:571-574 still says GOAL has not been accepted and that TASK follows it, leaving the canonical plan internally contradictory. Update that summary to reflect the merged GOAL/TASK state and the current ASSIGN/IMPORT sequence before approval.
AGENTS.md reference: AGENTS.md:L139-L139
Useful? React with 👍 / 👎.
|
@Mergifyio queue |
Merge Queue Status
This pull request spent 13 minutes 17 seconds in the queue, including 12 minutes 37 seconds running CI. Required conditions to merge
|
Zuweisungen prüfen ihre Berechtigung jetzt atomar beim Schreiben.
Damit kann ein überholter Koordinator keine Zuweisung mehr nach einer bereits bestandenen Vorprüfung speichern.
Für dich ist nichts zu tun; unabhängige Prüfung und Abnahme stehen noch aus.
Report
Plan-ID: Z4-M4B-3-ASSIGN
Tier: A. Operator: UMSETZEN. Owner: srv-m4b-3-assign. Parent: Z4 / M4B, Root acceptance. Ticket: 15d92066-a3aa-4fb0-a91c-bdaf5434550d.
Candidate:
e341b6f5999ded2304ace30248fcf2bde032df0doncodex/m4b-3-assign. Pinned base / merge-base:8c86bfc44c50e55209da7de48fdc7e3cb692a750. Raw size: 242 additions plus deletions across 9 files, including tests, compatibility declarations and PLAN; no exclusions. Limit: 300.What changed
Option<PlanningAuthority>to the real Store writer. The obsolete API legacy method is removed; the legacy Store wrapper is test-only. IMPORT remains its existing pass-through. Production GOAL/TASK writers are unchanged.assign_continuous_task_with_authorityobtainsBEGIN IMMEDIATEthrough the existingcontinuous::begin_writehelper. It then checks run, owner, live fence, dispatch role and target task project throughrequire_planning_authorityon that same transaction. Assignment admission, revision checks, upsert andteam_assignmentevent use that transaction and commit together. There is no second authorization transaction.coordinatorrole, including padded input. Refusal uses the existingPLANNING_REFUSEDvocabulary and HTTP 403/refused audit mapping. Explicit operatorNoneretains the frozen policy and may assign coordinator work.Public semantic proof
The new HTTP test
api::tests::planning_access_tests::planning_assignment_fence_interleaving_rejects_without_assignment_or_eventuses real SQLite and a real scoped coordinator credential. Its coordinator task is distinct from the open, unclaimed target. A bounded fixture handshake proves HTTP role/project prechecks have completed, then an independent connection advances the live coordinator fence before writer admission. Sender drop precedes scoped joins on unwind; no sleeps or production hooks are used.The compiling RED commit
9a11625612909d5272109753e2c05247d4b102dfchanges only tests; its native fixture calls the existing legacy Store assignment writer against frozen production. The assertion fails with exit 101: HTTP 200, assignment revision 1 and an accepted audit envelope, instead of 403/refused. There were no compiler errors. On the candidate, the same test function is byte-identical; only fixture writer delegation changes. It passes and verifies the full public assignment (including revision) and publiccontinuous_changesevents are unchanged, plus the refused audit envelope.Separately, post-fix native controls cover successful own-project HTTP assignment; direct public Store refusal of missing run, wrong owner, stale fence, missing/foreign target, wrong role and padded coordinator escalation; no partial assignment/revision/events in either project; operator HTTP coordinator assignment with explicit taskId/role/revision assertions. This sibling test is post-fix guard coverage, not the compiling semantic RED proof.
The stock exact selector on the pinned base exited 0 with zero tests. That is absent-selector evidence only, not semantic RED.
--listafter adding the fixture found the exact test; candidate listing finds both new selectors.Evidence
Commands ran serially in the assigned worktree with its configured warm target and
CARGO_BUILD_JOBS=1.gh pr view 1849 --json state,mergedAt,mergeCommitgh run view 39854120963 --json status,conclusion,headShaandgh run view 39854120965 --json status,conclusion,headShacargo test --manifest-path src-tauri/Cargo.toml --bin projecta api::tests::planning_access_tests::planning_assignment_fence_interleaving_rejects_without_assignment_or_event -- --exact --listcargo test --manifest-path src-tauri/Cargo.toml --bin projecta api::tests::planning_access_tests::planning_assignment_fence_interleaving_rejects_without_assignment_or_event -- --exact --nocapturecargo test --manifest-path src-tauri/Cargo.toml --bin projecta planning_assignment -- --listcargo 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::team_assignments::tests -- --nocapturecargo test --manifest-path src-tauri/Cargo.toml --bin projecta api::tests::planning_access_tests::planning_assignment_native_controls_preserve_authority_revision_and_operator -- --exact --nocapturebash scripts/ci/secret-scan.shbefore each normal commit, plus precommit hooksbash scripts/ci/red-first.sh --planat candidatenode scripts/ci/architecture-drift.mjs checkbash scripts/ci/gates.sh lane prepushat candidategit push -u origin codex/m4b-3-assignwith normal full prepush hookgit ls-remote origin codex/m4b-3-assigngit status --porcelain=v1/ rawgit diff --numstat/ frozen-test equality checkThe targeted planning suite preceded only assertion-readability edits in the sibling control test; that exact control was rerun, and both complete final-head prepush runs cover the final candidate. No source changes followed these runs.
Architecture drift
Replace exactly the existing assignment
API_STORE_BLOCK_ONallowlist occurrence withtauri::async_runtime::block_on(self.store.assign_continuous_task_with_authority(authority,task_id,request),). Category/count remain unchanged. This preserves the decided F1 ApiBackend placement and visible production forwarding. Existing assignment types and the goal-list read return type are imported to simplify signatures and keep main below its unchanged ceiling; GOAL/TASK production writers are byte-identical.Admission and native goal
Own runtime observed 2026-10-22: Codex CLI 0.163.0, provider openai, model gpt-6.1-sol, effort high, assigned worktree. Native weekly usage was 8% at 21:15:20Z and 9% at 21:34:55Z; the npm check alone does not establish provider headroom. Fresh load/RAM/process evidence and
npm run dev:start-check -- --max-cargo 2 --min-free-gb 3.5exited 0 adjacent to build/test/check, commit, gate and push phases; admission samples stayed below load 8 with sufficient RAM and no competing Cargo builds. No workers or reviewers were launched.Own
get_goalreturned null;create_goalestablished the bounded ticket objective, and subsequentget_goalobservations kept it active through verified push. Completion is limited to checked worker handover, not Root acceptance. Objective editing is unavailable in the exposed goal API; the bounded objective remains unchanged. AgentsRoom memory/team/usage-overview functions are unavailable in this harness and the locallage-jetztmirror is absent; live Git/GitHub and own runtime/process evidence were used without inventing native team state.Root explicitly permitted the pinned base if #1839 landed first.
gh pr view 1839 --json state,mergedAt,mergeCommitfreshly observed its merge at 2026-10-22T21:22:50Z (5ad970f2814ce251cf86077c4b4a686c1d7a9865). No freshness merge, rebase or history rewrite was performed.NICHT ABGEDECKT
#[cfg(windows)]tests (run_in_pty, npm_shim, ConPTY, DPAPI) or Windows Clippy branches. The Windows lane runs in the merge queue.Reviews and handover
Review: ausstehend (Stufe A).
Required: Root commissions the qualified GLM 5.3 (or permitted 5.3 Flash) and DeepSeek v4.1 Flash reviews from two non-author families, plus a separate GPT observer. No independent review verdict is claimed. Max two rounds; Root owns final merge/split/drop, acceptance, readiness, review-ok and Mergify queueing. Worker does not launch reviews, mark ready or enqueue.
State: implemented, tested, committed and verified pushed; one draft PR is the handover. Independent reviews, Root acceptance, merge and Windows/desktop evidence remain outstanding. IMPORT starts only after actual ASSIGN acceptance/merge and seam release. Parent security goal remains open.
Draft PR: #1852
Tier-A reviews on e341b6f (Root disposition, 2026-10-22 22:10Z)
Reviews via fail-closed sequential
review-seq.sh, diff base 8c86bfc, prompt sha256 0e440f50b808950a. glm-5.3:cloud (Zhipu; admission 21:47:12Z load1=1.79; report 21:54:54Z) and deepseek-v4.1-flash:cloud (DeepSeek; admission 21:54:54Z load1=1.58; report 21:57:08Z). Both families differ from the author (OpenAI, gpt-6.1-sol). Both verdicts: approve with conditions. No high finding.planning_access.rs:14-16,main.rsimport_plan: import writer still authorizes outside its transaction (sibling race)team_assignments.rs:30-38:#[cfg(test)] assign_continuous_taskis an authority-free aliasteam_assignments.rs:62-66: every writer refusal maps to the genericPLANNING_REFUSEDtext, so audit cannot tell self-escalation from a stale fencedevelopment_runs.rs:1205definesPLANNING_REFUSED = "planning target is outside the run project"and:1219documents "Every refusal is the samePLANNING_REFUSED(no oracle for foreign ids)"; tests therefore correctly assert that exact text. Richer audit cause, if wanted, is a follow-up.role: coordinatorgets 403planning_access_tests.rs:265coordinator_cannot_assign_the_coordinator_roleasserts 403 over HTTP for"coordinator"and" coordinator ";api.rs:2274mapsPLANNING_REFUSEDto 403 (continuous_error).api/tests/mod.rs:FakeBackendnon-native path fabricates success without authority checksnative_store).Next: Root marks ready for CI (
red-first, linux/windows gates) and reads the GPT observer; review-ok only on this head after both are clean.CI and GPT observer on e341b6f (Root, 2026-10-22 22:49Z)
All PR checks SUCCESS on e341b6f (red-first, gates linux/windows, linux_1/linux_2, windows_1/windows_2/windows_native, CodeQL, GitGuardian).
docs/PLAN.md:482vs:571-574: M4B release-order summary still says GOAL is not accepted and TASK followsRoot acceptance: tier A met (glm-5.3 Zhipu + deepseek-v4.1-flash DeepSeek on this head, both non-author families), no open high finding, conditions recorded (IMPORT next, security finding stays open until IMPORT). review-ok bound to e341b6f.