From e023793c6bc8e5d849574aa3330982bd847fb7c6 Mon Sep 17 00:00:00 2001 From: razyd Date: Thu, 8 Oct 2026 09:34:46 +0200 Subject: [PATCH 1/3] docs(scheduling): point cross references to docs/scheduling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove SCHEDULING-SOLVER-PLAN.md references (archived) - Add note about 2026-04-22 entry in decisions.md - Fix TODO.md path (root → docs/TODO.md) - Fix frontend AGENTS.md path (CLAUDE.md → AGENTS.md) --- backend/scheduling-solver/AGENTS.md | 9 ++++----- backend/services/scheduling/AGENTS.md | 15 +++++++-------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/backend/scheduling-solver/AGENTS.md b/backend/scheduling-solver/AGENTS.md index 5f1b5893..2f336d25 100644 --- a/backend/scheduling-solver/AGENTS.md +++ b/backend/scheduling-solver/AGENTS.md @@ -199,8 +199,8 @@ matches, generic fallback. When an INFEASIBLE appears in production that the analyzer can't diagnose, **don't blindly patch here**: rebuild the real `SolverInput` for that month, -identify the pattern, and then extend the analyzer with a -new branch. One correct, specific message beats a thousand generic ones. +identify the pattern, and then extend the analyzer with a new branch. One +correct, specific message beats a thousand generic ones. ## Local setup @@ -280,9 +280,8 @@ that drifts. - `docs/scheduling/constraints.md` — textual specification of the rules. Source of truth when code and constraints disagree. - `docs/scheduling/decisions.md` — decision log (why each constraint is - hard/soft, why the weights, what was tried and discarded). -- `SCHEDULING-SOLVER-PLAN.md` (repo root) — original solver plan. Historical, - not updated; the code is the current truth. + hard/soft, why the weights, what was tried and discarded); the 2026-04-22 + entry keeps the original phases. - `backend/services/scheduling/build-solver-input.ts` — the TS side that assembles `SolverInput`. Any new field here needs its counterpart there. - `backend/services/scheduling/solver-client.ts` — daemon process management, diff --git a/backend/services/scheduling/AGENTS.md b/backend/services/scheduling/AGENTS.md index b3a1515e..abaec3e8 100644 --- a/backend/services/scheduling/AGENTS.md +++ b/backend/services/scheduling/AGENTS.md @@ -12,8 +12,8 @@ Manages monthly staff schedules through **manual cell-by-cell editing with real-time validation**, plus optional **auto-generation** via a CP-SAT solver (Python). -**Month states:** `draft` (editable, validation surfaces warnings) ↔ -`published` (read-only for staff). +**Month states:** `draft` (editable, validation surfaces warnings) ↔ `published` +(read-only for staff). **Cell locking.** Assignments with `source_constraint_id` are **locked**: they come from approvals (vacations, IT, etc.) and can't be overwritten from the UI @@ -471,8 +471,8 @@ git log. ## Historical Excel importer The one-off importer that loaded `PLANNING 2026.xlsx` (January-May) into -`scheduling_*` in draft state was removed on 2026-10-04: it held the real -names of the staff and had already run. The months stay in the database. +`scheduling_*` in draft state was removed on 2026-10-04: it held the real names +of the staff and had already run. The months stay in the database. ## Cross-month gotcha (H4/H5) — outstanding debt @@ -496,8 +496,7 @@ logic in `consecutive-rest.constraint.ts` and - `docs/scheduling/constraints.md` — full textual specification. Source of truth. - `docs/scheduling/decisions.md` — decision log (why hard/soft, why the weights, - what was tried). -- `SCHEDULING-SOLVER-PLAN.md` (root) — original plan. Historical. -- `TODO.md` (root) — known module bugs (setSchedulableEmployees, H5 cross-month + what was tried); the 2026-04-22 entry keeps the original phases. +- `docs/TODO.md` — known module bugs (setSchedulableEmployees, H5 cross-month debt, etc.). -- `frontend/app/components/scheduling/CLAUDE.md` — the UI side of the module. +- `frontend/app/components/scheduling/AGENTS.md` — the UI side of the module. From 2a1ff7231e8e4ef309b3340ab12658ca29a78bcd Mon Sep 17 00:00:00 2001 From: razyd Date: Thu, 8 Oct 2026 09:38:13 +0200 Subject: [PATCH 2/3] docs(scheduling): replace archived plan references in solver comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - main.py: SCHEDULING-SOLVER-PLAN.md §3.4 → docs/scheduling/solver.md «Where it runs» - schemas.py: §3.1-§3.2 → docs/scheduling/solver.md «Input» y «Output» - test_benchmark.py, test_corpus.py, solver-parity.test.ts: Fase 1/2 → docs/scheduling/decisions.md entrada 2026-04-22 --- backend/scheduling-solver/main.py | 2 +- backend/scheduling-solver/schemas.py | 2 +- backend/scheduling-solver/tests/test_benchmark.py | 2 +- backend/scheduling-solver/tests/test_corpus.py | 2 +- backend/tests/scheduling/solver-parity.test.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/scheduling-solver/main.py b/backend/scheduling-solver/main.py index 14906cb7..27bd1008 100644 --- a/backend/scheduling-solver/main.py +++ b/backend/scheduling-solver/main.py @@ -1,7 +1,7 @@ """ main.py — CLI entry point del solver. -Protocolo (SCHEDULING-SOLVER-PLAN.md §3.4): +Protocolo (docs/scheduling/solver.md, «Where it runs»): stdin → JSON con SolverInput stdout → JSON con SolverOutput stderr → logs de debug diff --git a/backend/scheduling-solver/schemas.py b/backend/scheduling-solver/schemas.py index 5750e6cd..9200d2aa 100644 --- a/backend/scheduling-solver/schemas.py +++ b/backend/scheduling-solver/schemas.py @@ -1,6 +1,6 @@ """ schemas.py — Contratos de input/output entre Node y el solver Python. -Corresponde a SCHEDULING-SOLVER-PLAN.md §3.1-§3.2. +Corresponde a docs/scheduling/solver.md, «Input» y «Output». """ from __future__ import annotations diff --git a/backend/scheduling-solver/tests/test_benchmark.py b/backend/scheduling-solver/tests/test_benchmark.py index 27379722..701a3cae 100644 --- a/backend/scheduling-solver/tests/test_benchmark.py +++ b/backend/scheduling-solver/tests/test_benchmark.py @@ -1,7 +1,7 @@ """ test_benchmark.py — Benchmark sintético: 30 empleados × 31 días. -Criterio de cierre Fase 2 (SCHEDULING-SOLVER-PLAN.md): +Criterio de cierre Fase 2 (docs/scheduling/decisions.md, entrada 2026-04-22): - 30 empleados × 31 días resueltos en < 30 segundos con horario factible. - Validación: no hard errors en validator (delegada a tests/scheduling/ TS, aquí sólo medimos status/tiempo del solver). diff --git a/backend/scheduling-solver/tests/test_corpus.py b/backend/scheduling-solver/tests/test_corpus.py index 5429537b..ebc9cd62 100644 --- a/backend/scheduling-solver/tests/test_corpus.py +++ b/backend/scheduling-solver/tests/test_corpus.py @@ -1,7 +1,7 @@ """ test_corpus.py — Corpus de fixtures del scheduler contra el solver Python. -Objetivo (SCHEDULING-SOLVER-PLAN.md Fase 1): +Objetivo (docs/scheduling/decisions.md, entrada 2026-04-22): - Ningún fixture produce status='error' (sin crashes internos). - Fixtures con parámetros claramente resolubles → status='ok'. diff --git a/backend/tests/scheduling/solver-parity.test.ts b/backend/tests/scheduling/solver-parity.test.ts index 28e93777..c97d015a 100644 --- a/backend/tests/scheduling/solver-parity.test.ts +++ b/backend/tests/scheduling/solver-parity.test.ts @@ -1,7 +1,7 @@ // tests/scheduling/solver-parity.test.ts // Parity test: solver output must pass ScheduleValidator with 0 hard errors. // -// SCHEDULING-SOLVER-PLAN.md Fase 1 criterion: +// docs/scheduling/decisions.md, entrada 2026-04-22: // "Output del solver pasa ScheduleValidator.validate() con 0 hard errors." // // Each test case: build SolverInput from a corpus fixture → run solver → validate matrix. From 23d4887e2e85e03e4aff14a433d1a1fd4e4d0f61 Mon Sep 17 00:00:00 2001 From: razyd Date: Sun, 11 Oct 2026 10:48:04 +0200 Subject: [PATCH 3/3] docs(scheduling): point test headers to the sections that hold their criteria MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - test_benchmark.py: the 30x31 exit criterion lives in the 2026-05-09 entry of decisions.md, not in 2026-04-22. - test_corpus.py, solver-parity.test.ts: point to «How it is tested» in solver.md and drop a quote that no document contains. Why: the previous commit replaced the archived plan with references that did not hold the cited text. --- backend/scheduling-solver/tests/test_benchmark.py | 2 +- backend/scheduling-solver/tests/test_corpus.py | 2 +- backend/tests/scheduling/solver-parity.test.ts | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/scheduling-solver/tests/test_benchmark.py b/backend/scheduling-solver/tests/test_benchmark.py index 701a3cae..be64e448 100644 --- a/backend/scheduling-solver/tests/test_benchmark.py +++ b/backend/scheduling-solver/tests/test_benchmark.py @@ -1,7 +1,7 @@ """ test_benchmark.py — Benchmark sintético: 30 empleados × 31 días. -Criterio de cierre Fase 2 (docs/scheduling/decisions.md, entrada 2026-04-22): +Criterio de cierre Fase 2 (docs/scheduling/decisions.md, entrada 2026-05-09): - 30 empleados × 31 días resueltos en < 30 segundos con horario factible. - Validación: no hard errors en validator (delegada a tests/scheduling/ TS, aquí sólo medimos status/tiempo del solver). diff --git a/backend/scheduling-solver/tests/test_corpus.py b/backend/scheduling-solver/tests/test_corpus.py index ebc9cd62..0454d1a8 100644 --- a/backend/scheduling-solver/tests/test_corpus.py +++ b/backend/scheduling-solver/tests/test_corpus.py @@ -1,7 +1,7 @@ """ test_corpus.py — Corpus de fixtures del scheduler contra el solver Python. -Objetivo (docs/scheduling/decisions.md, entrada 2026-04-22): +Objetivo (docs/scheduling/solver.md, «How it is tested»): - Ningún fixture produce status='error' (sin crashes internos). - Fixtures con parámetros claramente resolubles → status='ok'. diff --git a/backend/tests/scheduling/solver-parity.test.ts b/backend/tests/scheduling/solver-parity.test.ts index c97d015a..1b9e297d 100644 --- a/backend/tests/scheduling/solver-parity.test.ts +++ b/backend/tests/scheduling/solver-parity.test.ts @@ -1,8 +1,7 @@ // tests/scheduling/solver-parity.test.ts // Parity test: solver output must pass ScheduleValidator with 0 hard errors. // -// docs/scheduling/decisions.md, entrada 2026-04-22: -// "Output del solver pasa ScheduleValidator.validate() con 0 hard errors." +// See docs/scheduling/solver.md, «How it is tested». // // Each test case: build SolverInput from a corpus fixture → run solver → validate matrix.