From 5948e079643f6cb4a08ad398dc39cd621d8d0e57 Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Fri, 28 Aug 2026 05:12:41 +0000 Subject: [PATCH] docs(scheduler-snapshot-job-allocation): close final invariant-audit follow-up, feature complete Task 4.5: scheduler dimension-4 field-completeness audit run against the finished implementation -- clean, no undocumented gap. Corrects the one remaining stale premise in snapshot.c's "internal_state contents" comment (claimed job->allocs/accounts were still unrestored; they are now, per task 2.2) while preserving its still-valid sharedInUse/resInUse rationale. All tasks (1.1-4.5) for scheduler-snapshot-job-allocation are complete. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01SSuXfK6nD1Nue5EjjdhjNZ --- .../scheduler-snapshot-job-allocation/tasks.md | 2 +- src/scheduler/src/snapshot.c | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.kiro/specs/scheduler-snapshot-job-allocation/tasks.md b/.kiro/specs/scheduler-snapshot-job-allocation/tasks.md index 05d76315..3ca84b04 100644 --- a/.kiro/specs/scheduler-snapshot-job-allocation/tasks.md +++ b/.kiro/specs/scheduler-snapshot-job-allocation/tasks.md @@ -83,7 +83,7 @@ - _Depends: 2.2_ - _Boundary: snapshot.c (scope-decision header comment only)_ -- [ ] 4.5 Run the project's scheduler design-invariant audit as final validation +- [x] 4.5 Run the project's scheduler design-invariant audit as final validation - Run the scheduler component's field-completeness invariant audit dimension (or manually re-check it) against the finished implementation. - Confirm the audit finds no undocumented gap introduced or left behind by this feature. - Observable completion: the audit dimension reports clean, with this feature's fields correctly classified as fixed or documented. diff --git a/src/scheduler/src/snapshot.c b/src/scheduler/src/snapshot.c index c16af889..2e873642 100644 --- a/src/scheduler/src/snapshot.c +++ b/src/scheduler/src/snapshot.c @@ -215,12 +215,13 @@ * (core.h) documents that it resets "shared resval" at the start of * EVERY session, and the driver's sched_account_jobs() unconditionally * re-sums them from currently RUNNING jobs' accounts immediately after. - * Since this task also does not restore job->allocs/accounts (see - * "Scope decisions" below), restoring stale in-use numbers with no - * accounts to justify them would be actively inconsistent, and they - * would be wiped by the very next session anyway -- the Observable this - * task proves is specifically about the NEXT session's decisions, which - * never observes pre-session in-use state. + * This still holds even though job->allocs/accounts ARE now restored on + * load (see "Scope decisions" below): capturing sharedInUse/resInUse + * directly anyway would be redundant with, and could silently drift + * from, those restored accounts, since sched_account_jobs() re-derives + * the in-use totals from them on the very next session regardless -- + * the Observable this task proves is specifically about the NEXT + * session's decisions, which never observes pre-session in-use state. * - core->session_start / core->session_duration_ns: pure diagnostics * (core.h's own field comment: "nothing in the scheduling/decision path * reads them"), but cheap and harmless to round-trip, so they ARE