Skip to content

test(workers): cover scheduler negative matrix (replacement) - #412

Merged
mergify[bot] merged 3 commits into
mainfrom
codex/m4-r7-02-negative-matrix-b
Oct 5, 2026
Merged

mergify[bot] merged 3 commits into
mainfrom
codex/m4-r7-02-negative-matrix-b

Conversation

@Cuarroc

@Cuarroc Cuarroc commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Dieses Paket prüft, dass der Scheduler ohne erfüllte Schranken keinen Worker startet.
Es belegt außerdem den Schutz gegen Doppelstarts, veraltete Schreibrechte und unvollständige Abhängigkeiten.
Produktionscode wurde nicht geändert.

Report

Windows fix: CRLF-normalized source assertions (queue run 37245521200)

What changed

  • Recreated the final content of test(workers): cover scheduler negative matrix #407 as fresh commits from the observed base, with corrected Test-First and Regression-For trailers.
  • Added a fake-adapter refusal matrix for draft goals, unresolved dependencies, exhausted attempts, profile mismatch, unattested route state, the test-only scheduler permit, and the global emergency stop; every runtime refusal records zero spawns and a named reason.
  • Added concurrent dispatch coverage proving exactly one launch and rejection of the losing owner/fence write.
  • Added dependency-boundary coverage for fulfilled, open, missing, foreign-project, and 65-entry truncated dependency sets; only the fully satisfied case launches.
  • Retained the positive proof that admitted work creates exactly one spawn and one durable launched run intent.
  • Fixed the commit-msg candidate test to be pipefail-safe; this changes no application behavior.
  • Replaces test(workers): cover scheduler negative matrix #407 (wrong trailer in pushed commit 16d9321).

Evidence

  • Base: ae29c63 (observed origin/main after the required fetch).
  • Candidate: 130ef90.
  • npm run dev:start-check — exit 0 before builds; 11.4 GB free and one cargo build running, within the server limit. Provider usage file was not supplied.
  • cargo test --manifest-path src-tauri/Cargo.toml workers::tests:: -- --list — exit 0; exact new Rust test names observed.
  • bash scripts/ci/red-first.sh --plan — exit 0; 8 evidence items and 5 test specs.
  • bash scripts/ci/gates.sh lane prepush — exit 0; 1,793 Rust tests passed, 7 skipped; log: /tmp/projecta-m4-r7-02-prepush-final.log.
  • git push -u origin codex/m4-r7-02-negative-matrix-b — exit 0; the foreground pre-push hook completed the full lane.
  • git ls-remote origin refs/heads/codex/m4-r7-02-negative-matrix-b — exit 0; remote SHA equals the candidate SHA.
  • Diff size: 281 added lines, 1 deleted line against the observed base.
  • Architecture drift: no new occurrences; architecture-drift gate passed.

NICHT ABGEDECKT

  • Linux does not compile or run the #[cfg(windows)] tests or the Windows clippy arms; the Windows lane runs in the merge queue.
  • The desktop GUI was not launched.
  • No real provider process was launched; the scheduler boundary uses FakeAgents and the existing test-only attested route.
  • Provider usage limits were not checked because no usage file was supplied to the start check.
  • Production scheduler activation remains unavailable until W4-03 supplies a permit after user approval.

Review

Review: Stufe B abgeschlossen (Claude Sonnet 5.5), Kandidat 130ef90.

Review disposition

  • Reviewer: Claude Sonnet 5.5 (other family than author codex), Tier B, one round, candidate 130ef90. Checked full diff, trailers (red-first.sh --plan exit 0, count=8, specs=5), CI (all checks pass), architecture drift (no production code, no new pattern).
  • Finding 1 (niedrig, src-tauri/src/workers.rs truncated-dependency test): dispatch_once_refuses_truncated_dependency_set overlaps the truncated row of dependency_matrix_launches_only_fully_satisfied_task. Rejected: the standalone test is the named Test-First/Regression-For target for the store regression; removing it would invalidate the pushed trailer.
  • Finding 2 (niedrig, scheduler_dispatch_requires_the_test_only_permit): source-string assertions are brittle against refactors. Rejected: the permit has no runtime branch to test; a failing assertion is a deliberate prompt to re-review the permit boundary.
  • Finding 3 (niedrig, concurrent_dispatch_starts_one_worker_and_refuses_stale_writer): the stale-writer check would also reject an owner that never claimed; the exclusivity itself is proven by the exactly-one-Ok and one-spawn assertions. Rejected: no gap in the claimed guarantee.
  • No high or medium findings; no code changed by the review.

Open points

  • Coordinator review and the Windows merge-queue lane remain pending.

Test-First: src-tauri/src/workers.rs::dispatch_once_refuses_each_missing_gate_without_spawning
Test-First: src-tauri/src/workers.rs::scheduler_dispatch_requires_the_test_only_permit
Test-First: src-tauri/src/workers.rs::concurrent_dispatch_starts_one_worker_and_refuses_stale_writer
Test-First: src-tauri/src/workers.rs::dependency_matrix_launches_only_fully_satisfied_task
Regression-For: 939c7e9
Regression-For: 55f7857
No-Test: make the commit-msg candidate test pipefail-safe; runtime behavior is unchanged
Co-Authored-By: Codex GPT-5 <47299143+Cuarroc@users.noreply.github.com>
Test-First: src-tauri/src/workers.rs::dispatch_once_refuses_truncated_dependency_set
Regression-For: 55f7857
Co-Authored-By: Codex GPT-5 <47299143+Cuarroc@users.noreply.github.com>
@Cuarroc
Cuarroc marked this pull request as ready for review October 4, 2026 23:41
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-04T23:47:07.687836Z 130ef90 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 130ef90536

ℹ️ 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".

Comment thread src-tauri/src/workers.rs
Comment on lines +3494 to +3495
#[tokio::test]
async fn dispatch_once_refuses_truncated_dependency_set() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Ersetze den Commit durch einen mit Red-first-Trailern

Dieser Commit fügt mehrere Rust-Tests hinzu und ändert ein CI-Skript, enthält aber weder einen Test-First:-/Regression-For:- noch einen No-Test:-Trailer. Der Lauf BASE_SHA=9fd9f3e^ HEAD_SHA=9fd9f3e bash scripts/ci/red-first.sh --plan endet deshalb mit Exit 1 und meldet ausdrücklich „aendert Quellcode ohne Test-First:/Regression-For:/No-Test:“, sodass dieser Kandidat die vorgeschriebene Red-first-Prüfung nicht bestehen kann und mit korrekten Trailern neu erstellt werden muss.

AGENTS.md reference: AGENTS.md:L167-L170

Useful? React with 👍 / 👎.

Comment thread src-tauri/src/workers.rs
}
}

async fn seed_dispatch_case(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Teile das S-Paket auf höchstens 150 Diffzeilen

M4-R7-02 ist in docs/PLAN.md:155 als Größe S eingestuft, dieser Commit umfasst jedoch 282 Diffzeilen (281 Ergänzungen und eine Löschung) und überschreitet damit die in docs/PLAN.md:237 festgelegte S-Grenze von 150 Zeilen einschließlich Tests deutlich. Das Paket muss vor der Integration aufgeteilt oder vom Koordinator im Plan neu eingestuft werden.

AGENTS.md reference: AGENTS.md:L13-L15

Useful? React with 👍 / 👎.

Comment thread src-tauri/src/workers.rs
Comment on lines +3669 to +3672
let stale = fx
.store
.checkpoint_continuous_task("due-task", loser, 1, Some("running"), None)
.await

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Prüfe einen tatsächlich veralteten Fence

Wenn die Checkpoint-Prüfung künftig nur noch den aktuellen Owner, aber nicht mehr den Fence validiert, bleibt dieser Test grün: Der Aufruf verwendet den vollständig anderen loser-Owner und Fence 1, sodass bereits die Owner-Prüfung ihn als „unauthorized“ ablehnt. Damit belegt der Test trotz seines Namens keinen stale-Fence-Fall desselben Owners; ergänze einen Schreibversuch mit dem berechtigten Owner und einem veralteten Fence, damit die geforderte Concurrency-Regression wirklich erkannt wird.

AGENTS.md reference: AGENTS.md:L87-L89

Useful? React with 👍 / 👎.

Comment thread src-tauri/src/workers.rs Outdated
Comment on lines +3620 to +3624
let source = include_str!("workers/scheduler.rs");
assert!(source.contains("pub struct SchedulerPermit(());"));
assert!(source.contains("#[cfg(test)]\npub(super) fn test_permit()"));
assert!(source.contains("_permit: &SchedulerPermit"));
assert!(!source.contains("pub fn permit()"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Sichere alle Produktionskonstruktoren des Permits ab

Wenn versehentlich ein Produktionskonstruktor mit einem anderen Namen hinzukommt, etwa SchedulerPermit::new() oder eine öffentliche Konstante, bleibt dieser Test grün, weil er ausschließlich nach dem exakten Text pub fn permit() sucht. Dadurch schützt der neue Regressionstest die behauptete Test-only-Grenze nicht; verwende eine strukturelle beziehungsweise Compile-fail-Prüfung, die jeden außerhalb von #[cfg(test)] erreichbaren Konstruktionspfad erkennt, solange die Scheduler-Aktivierung eingefroren ist.

AGENTS.md reference: AGENTS.md:L125-L130

Useful? React with 👍 / 👎.

@mergify

mergify Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@Cuarroc Cuarroc added the review-ok Pipeline: review disposition complete, no open high finding label Oct 4, 2026
@Cuarroc

Cuarroc commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@mergify

mergify Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 11 minutes 20 seconds in the queue, including 11 minutes 6 seconds running CI.

Reason

The merge conditions cannot be satisfied due to failing checks

  • gates (windows)

Failing checks:

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for
  • check-success = gates (windows)
All conditions

Requeued — the merge queue status continues in this comment ↓.

@mergify mergify Bot added dequeued and removed queued labels Oct 5, 2026
Regression-For: b4b2a17

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mergify mergify Bot removed the dequeued label Oct 5, 2026
@Cuarroc

Cuarroc commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@mergify mergify Bot added the queued label Oct 5, 2026
@mergify
mergify Bot merged commit e3bd932 into main Oct 5, 2026
11 checks passed
@mergify
mergify Bot deleted the codex/m4-r7-02-negative-matrix-b branch October 5, 2026 00:49
@mergify

mergify Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 13 minutes 45 seconds in the queue, including 12 minutes 34 seconds running CI.

Required conditions to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-ok Pipeline: review disposition complete, no open high finding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant