Required by the assessment: tools used, tasks delegated, what was verified, and AI suggestions that were corrected or rejected. Keep adding entries as you build. The build record (≤ 2 pages) will quote a few selected excerpts from here.
| Tool | Used for |
|---|---|
| Claude (Opus 5.5) in the Claude app, linked to the project folder | Reading the assessment brief, scoping, requirements, architecture, research on Saskatchewan rules and design standards, the UI design canvas, documentation, git setup |
| OpenRig (from 2026-11-20) | Implementation, per docs/process/HANDOFF.md; add its entries below |
| # | Date | Task delegated to AI | How it was verified | Correction / rejection |
|---|---|---|---|---|
| 1 | 2026-11-19 | Read the assessment PDF and suggest how an existing app idea fits | Lead re-read the brief; rubric weights checked against the PDF | — |
| 2 | 2026-11-19 | Propose scope | Lead reviewed | AI recommendation partly overridden. AI recommended one narrow workflow (safe shift swaps). The lead chose a broader scheduling prototype; AI then tiered features Must/Should/Could to manage the risk. Later the lead cut trades and notifications (ADR-010). |
| 3 | 2026-11-19 | Research Saskatchewan rest and hours law | Cross-checked against saskatchewan.ca employment-standards pages (8 h rest in 24 h; 16 h max in 24 h, except emergencies) | — |
| 4 | 2026-11-19 | Find or mock up collective-agreement rules | Sources labelled per rule (SEA, SGEU PS/GE 2022–2025, federal CX agreement, Nunavut, NWT, MOCK) | AI flagged that it could not read the full SGEU agreement text and that local letters of understanding aren’t public: all MOCK values need validation by someone who works in a correctional centre. |
| 5 | 2026-11-19 | Choose a rules engine | Lead reviewed options | AI suggestion rejected. AI recommended a custom rule-type catalogue (ADR-007). The lead chose Drools so non-technical staff can edit rules as decision tables (ADR-012). |
| 6 | 2026-11-19 | Pick Java and Spring Boot versions | Checked Apache KIE release notes | AI corrected itself. First proposed Java 25 + Spring Boot 4.1; after checking that Apache KIE 10.2 lists Spring Boot 3.5 and Java 21 support, revised to Java 21 and added a Day 1 compatibility spike with a documented fallback. |
| 7 | 2026-11-19 | Keep docs consistent after scope changes | Lead noticed while viewing the GitHub page | AI error caught. README still listed “trade limits” after trades were removed; fixed in commit 012dcab. |
| 8 | 2026-11-19 | Design the UI (design canvas) | Reviewed sample data for internal consistency | AI error caught before publishing. The overtime candidate list was out of order (21 h ranked after 34.5 h), contradicting the fair-distribution rule; reordered. A CSS class used in the first draft (st-block) was undefined; added. |
| 9 | 2026-11-19 | Restyle to the Government of Saskatchewan digital standard | Colours and font taken from the published standard; contrast checked | AI deviated from the standard deliberately: its error red #EE0000 fails 4.5:1 text contrast, so blocked messages use #A30000. AI declined to copy the government logo, wheat sheaf or coat of arms (would present the prototype as an official service). |
| 10 | 2026-11-19 | Size the test dataset | Arithmetic: supply per hour vs requirement | AI corrected its own earlier design. The coverage rule “a shift counts toward a block if it covers half of it” double-counted 12 h shifts and distorted sizing. Replaced with hourly coverage (ADR-013 revised). |
| 11 | 2026-11-19 | Create the GitHub repo and push | Repo checked in the browser | AI could create the repo through the browser but couldn’t push (session lacked access); the lead pushed from their own terminal. |
| 12 | 2026-11-19 | Apply the lead’s shift times (8 h 07–15/15–23/23–07; 12 h 00–12/12–24; 16 h 20:00–12:00) | Re-ran the hourly supply vs requirement arithmetic; checked rest between consecutive 12 h shifts | AI flagged a consequence: a 12–24 shift followed by 00–12 gives zero rest, so the 12 h rotation was reordered (2 × 00–12, then 2 × 12–24, then 4 off). Planted case PC-01 and the API example were rewritten for the new times (7 h rest, 17 h in 24 h). |
| 13 | 2026-11-19 | Model 16 h shifts and overtime | Re-ran hourly supply and daily staff-hours (≈ 585 available vs 560 required) | Lead corrected two AI assumptions: (1) AI had treated 16 h shifts as overtime-only doubles; they’re regular rostered shifts. (2) AI had modelled overtime per shift/day; it’s based on hours per week or pay period. AI then noted the consequences: a rostered 16 h shift sits exactly at the legal 16 h-in-24 h limit, so any extension is blocked without an emergency override; period averaging depends on a modified work arrangement under the Employment Act (recorded as an assumption, ADR-016). |
| 14 | 2026-11-20 | Day 1 compatibility spike: Spring Boot 4.x + Drools 10.x on Java 21 (HANDOFF §6 step 1) | docker run … maven:3.9-eclipse-temurin-21 ./mvnw test in Docker: 6/6 tests pass (4 rule boundary tests in shiftcircle-rules, 2 Spring context tests in shiftcircle-api). Then the packaged jar was started on eclipse-temurin:21-jre-alpine and reached Started ShiftCircleApplication — the rule base compiled at startup on a JRE with no jdk.compiler module, so runtime rule compilation (needed by the publish pipeline) does not require a JDK image. |
AI corrected itself twice, from real build errors: (1) The first template used a literal-first constraint ("ANY" == "@col" || shiftKind == "@col"), which Drools 10 rejects at compile time (ConstraintBuilder$DummyConstraintBuilder.setExprInputs → UnsupportedOperationException); the template now uses a property-first regex shiftKind matches ".*", which also gives the grid an “Any shift” wildcard. (2) The rule base would not compile with only drools-engine + drools-templates: DRL constraint building needs org.drools:drools-mvel, which is not in the drools-engine bundle. Version choice: Spring Boot 4.1.3 (latest patched 4.1 line) rather than 4.2.0, which was released the same day and has no patch releases yet. |
| 15 | 2026-11-20 | Design seat: write docs/ui/build-notes.md (ADR-015/016 corrections to the mockups; patterns for the screens with no mockup) |
Grepped every mockup for old codes and times (D12, N12, OT, 07–19, 19:00) and listed each hit by file:line; checked chip codes against 06-data-model.md, PC-01 against 10-testing.md §6.6, and screen permissions against 09-access-control.md §2 |
AI caught three gaps the specs hadn’t covered: (1) with hourly coverage, a block cell showing one headcount can hide a short hour, so the cell shows the lowest hourly count and names the short hours (the API must return them); (2) Rules approvers can’t see the roster, so the dry-run impact on the review screen shows counts without names; (3) the mockup’s “Night 12 h → Day 12 h” proposal becomes P12 → A12, which gives zero rest when the day before is a P12. AI corrected itself in its own draft: it removed two invented claims (“checks already saved aren’t re-run” after publish; a blanket “this proposal must be blocked”) that the specs don’t support. |
| 16 | 2026-11-20 | Design seat: sync the specs with the four confirmed UI decisions (ADR-017) | Lead reviewed the four decisions against HANDOFF §4 and docs 07/10 and confirmed them; each doc edit was checked to match exactly one existing line | Lead extended decision 2: the generator must give every past shift an actual, added as self-check 8. Defined “ended” as end_at ≤ now and added a boundary test row plus scenario T14. |
| 17 | 2026-11-20 | Step 2, api half: five-module Maven scaffold (domain, rules, application, infrastructure, api), GET /api/v1/version, startup refusal without POSTGRES_PASSWORD/SC_JWT_SECRET, api Dockerfile, docker-compose.yml, .env.example, dev override |
./mvnw test in Docker: 13/13 tests (4 rule boundary, 4 secret-refusal, 3 version/health/actuator, 2 context). Then docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build db api: both containers healthy; curl /api/v1/version → {"name":"shiftcircle-api","version":"0.1.0-SNAPSHOT","buildTime":"…","gitCommit":"39d00b6","ruleSetVersion":"v1","profiles":"demo"}; readiness {"status":"UP"}; id in the api container → uid=100(app); logs are ECS JSON |
Host finding, design adjusted: host ports 5432, 5433 and 8080 were already taken by unrelated projects, so fixed host ports would have made the first docker compose up fail on this machine. Host ports are now configurable (SC_WEB_PORT, SC_DB_PORT, SC_API_PORT) with the documented defaults unchanged. Also confirmed the runtime image needs no JDK: the Drools rule base compiles at startup on the JRE image. |
| 18 | 2026-11-20 | Step 3: Flyway V1–V3, repository tests for T10, T11, shift overlap, pay-period overlap, append-only audit and override reasons | ./mvnw test in Docker with the socket mounted: 28/28 (4 rule + 15 schema/repository + 9 api). Then docker compose … up -d --build db api on an empty volume: flyway_schema_history shows V1, V2, V3 all success = t, rule_row = 19, unit = 6, readiness UP |
Three problems found by building, not by guessing: (1) QA was right about the U-01 evidence string — the test fixture said “ended 23:00; starts 07:00” even for 4 h of rest; evidence is now derived from the measured gap. (2) Spring Boot 4 silently skipped Flyway: the auto-configuration lives in its own spring-boot-flyway module, not in spring-boot-starter-jdbc, so the app started, reported readiness UP and had no schema. Fixed, and readiness now also asserts a published rule set exists (referenceData indicator) so an unmigrated database can never present as ready again. (3) Testcontainers 2.0 renamed its artifacts (testcontainers-postgresql, testcontainers-junit-jupiter) and PostgreSQLContainer is no longer generic; the Boot BOM manages the version but not the old names. |
| 19 | 2026-11-20 | Step 4: rules engine — fact builders, eight templates, rule set v1, full boundary matrix (docs/10 §3) | ./mvnw test in Docker: 68/68 (43 rule tests, 16 database tests, 9 api). Every matrix line is under/exact/over: U-01 7h59/8h00/8h01, U-02 11h59/12h, U-03 11h59/12h, U-04 9h59/10h (and 3h59 extension not triggered), U-05 16h/16h15, U-14 48/48.25/60.25, U-08 7/8/8th-by-OT, U-09 4/5/5th-by-OT, U-10 4/5, U-11 3/4/4th-at-7-days/11-in-28, U-12 48h/47h59, P-01 80/80.5/96, P-04 29/30 min, L-01 and S-03; plus month-end and 12h-ends-at-midnight cases |
Design decisions made while building: (1) U-04 promoted from document-only to a live Warn row (one row: 4 h extension trigger, 10 h rest); docs/04 and docs/10 already assumed it, only docs/05 listed it as future. v1 is 20 rows → now 19 after (2). (2) U-15 removed as a decision-table row: a rolling window cannot express a pay-period status; the under/approaching/over state is computed with the pay classification (P-01) and shown on the planning board. The rule table had no column that made sense for it. (3) A drift test compares the V2 seed rows with the code rule set (code, severity, override policy, message, source, placeholder, order and every param) — without it the demo could run rules the boundary tests never proved. It caught a real sort-order drift on its first run. (4) The pay and overtime-ranking tables mix checks with settings: rows without a condition (P-01b rate, P-04 minimum) stay in the rule set for the classifier but generate no Drools rule, which is documented in the template. |
| 20 | 2026-11-20 | Build the web/ scaffold: Vite + React + TypeScript + MUI, the Sask-styled app shell (top bar, role-specific nav, footer), the About/version screen, and the nginx container |
pnpm build (TypeScript project build + Vite), pnpm test (9 Vitest tests), docker build web/, then the image was run and probed with curl: /healthz → 200, / → 200, /planning → 200 (SPA fallback), /actuator/health → 404, and /api/v1/version proxied to a mock api on the api network alias with its JSON returned unchanged |
AI suggestion rejected. The build instruction said to proxy /api/ to http://api:8080; docs/08-deployment.md §2 and §6 and the api builder both use 8081, so 8081 was used and confirmed with the api builder before the image was built. AI error caught by the build. The first theme used the MUI 5/6 button style slots (containedPrimary), which do not exist in MUI 9; pnpm build failed on the unknown property and the slots were corrected to contained / outlined. |
| 21 | 2026-11-20 | Decide how the version screen reads GET /api/v1/version |
Compared against docs/07-api-spec.md §4.8, which pins the endpoint but not the JSON field names |
AI did not guess. Because the response shape is not specified, the reader looks for the build version, git commit and live rule set under the usual names and falls back to showing the raw response, instead of pinning one guessed shape that would render a blank. |
| 22 | 2026-11-20 | Design seat: sync docs 06/08/09 with the built scaffold and database (review-r1 findings on 502c434) |
Each claim checked against the source: web/Dockerfile (corepack pnpm, --frozen-lockfile, stock nginx:stable-alpine), no Makefile in the repo, V1__schema.sql (no GRANT/REVOKE; append-only triggers at lines 406-426), SchemaConstraintsTest covering them |
Reviewer caught AI-written specs that had drifted from the build: npm ci (it’s pnpm), make env (no Makefile), “nginx runs non-root” (the stock image’s master runs as root), and “the app role has INSERT, SELECT only on audit_event” (no grants exist). Fixed the docs; the nginx root master is recorded as a known prototype deviation with a pilot fix (nginx-unprivileged), and the grant deferral as ADR-018, which states the trigger’s limit (a database owner can still disable it). |
| 23 | 2026-11-20 | Doc sync: maker/checker CHECK text in 06-data-model.md §3 (from dev-qa finding 3, routed by the lead) |
Read V1__schema.sql:118-119 and checked PostgreSQL CHECK semantics: a CHECK whose expression evaluates to NULL is satisfied, so approved_by IS NULL OR approved_by <> created_by already allows a NULL created_by |
AI claim corrected on evidence. QA’s finding (relayed by the lead) said the old doc text would reject an approved version with a NULL creator. It wouldn’t: both forms behave the same. The doc was still reworded to match the code (… OR created_by IS NULL OR …) and to say why the extra arm changes nothing (63a7eb8). |
| 24 | 2026-11-20 | Governance exception: human review of the rule boundary tests (HANDOFF §5 guardrail 4) | The project lead told the operator on 2026-11-20; relayed by orch.lead |
Guardrail waived by the project lead, not by AI. Guardrail 4 required every rule’s boundary tests to be reviewed by a human. The lead waived that on 2026-11-20. The boundary tests are reviewed by AI verifiers instead: dev-qa (GLM 5.3, with mutation spot-checks) and review-r2 (GLM 5.3, independent of the DeepSeek author). No human review took place. A pilot should restore it. Recorded in HANDOFF §5 “Governance exceptions”. The AI verifiers’ verdicts get their own rows when they’re in. |
| 25 | 2026-11-20 | Integrity correction: the fact-builder package was never in git | git check-ignore -v api/shiftcircle-rules/src/main/java/ca/shiftcircle/rules/build/ShiftFact.java → .gitignore:15:build/; after the fix, git ls-files …/rules/build lists 10 files and a scratch worktree at HEAD compiles and passes |
Review-r2 caught a real blocker: AI’s step-4 “68/68” ran against untracked files. The unanchored build/ pattern (meant for the web container) ignored the Java package …/rules/build/, so a clean clone could not compile the rule tests. The pattern is now anchored (/web/build/, /web/dist/), the package is committed (b4a2562), and verification moved to a clean worktree — which immediately found one more real failure (an evidence assertion still expecting the old wording, 9b5f45d). From now on, step claims are verified from a scratch worktree, not the working tree. |
| 26 | 2026-11-20 | Review-r2 logic findings F2, F3, F5, F6, F7, F8 and the F4 validation duty | Tests added for each finding before the fix: equal-length overtime/scheduled runs, per-window days off (24 h → 0 days, 24 h 01 m → 1, 47 h 59 m → 1, 48 h → 2, earlier-week break), extended 12/16-hour shifts, U-14 warn level, missing pay row, drift guard enabled |
Six real defects, all now fixed with regression tests: F2 an overtime run hid an equal-length scheduled run (c034923); F3 days-off was measured over the whole schedule, so an earlier week’s long break satisfied the current week and a lone shift reported zero (31da064); F5 shift kind came from the clock, so an extended P12 left U-09 and an extended L16 left U-11, and L-01 rejected extended 16-hour shifts (1da1cf8); F6 the U-14 warn branch reported the 60 h ceiling instead of the 48 h warn level, and warn ≥ ceiling was accepted (f5e7710); F7 the pay classifier silently used built-in defaults when a pay row was disabled (00582b9); F8 the drift guard ignored enabled (6755e4f). F4 is a publish-pipeline duty (reject row values the builders cannot produce), recorded in docs/04 §5a. Design note kept as is: U-08, U-09 and U-14 Block rows carry the ACKNOWLEDGE override policy on purpose — docs/05 gives those rules no emergency override, so a supervisor must acknowledge, not override. |
| 27 | 2026-11-20 | Step 5: demo data generator (100 officers × 90 days, planted cases next), self-check, reproducible checksum | ./mvnw test in Docker: 83/83 (55 rules, 19 infrastructure including the generator, 9 api). The generator runs in ~19 s and passes its own eight checks; the reproducibility test generates twice in one container and compares the checksum and row counts |
Two spec numbers could not both hold, and the arithmetic is why: docs/10 §6.5 asks for ~4% sick + ~4% vacation and §6.7 asks for 3–6% overtime. A 12-hour 4-on-4-off crew works 84 h per two-week period, so 4 h is overtime before any absence is covered, and the 8-hour staff sit at exactly 80 h — nowhere to absorb 8% absences. The generator now uses 2% sick + 2% vacation and the self-check accepts 3–8% overtime (was 3–6%), with the comment in the code and this row as the record. It also refuses to schedule or accept a shift that would break U-03 (12 h rest after a 16-hour shift) or put any rolling 168 h window over 60 h (U-14), because those are Block rules. U-08/U-09/U-14 ACKNOWLEDGE policy is intentional (see #26). |
| 28 | 2026-11-20 | Design review round 1 of the web UI on web-step7-planning at 15e2421 (planning board, rule check, override, overtime, My schedule, time and attendance, reports, rules admin) by dev-design (Claude Opus 5.5) |
Code read against docs/ui/README.md, docs/ui/build-notes.md, the mockups and ADR-015/016/017/019. Not run live; the proof screenshots predated these screens |
Seven blocking findings sent to the builder with file:line: (1) the overtime direct-assign acknowledge path saves a plain assignment instead of assigning the open shift; (2) “Acknowledge” commits the save without saying so, and override saves ignore Warn results; (3) roster chips aren’t clickable, so the PC-01 proposal can’t open the rule panel (E1); (4) the offer card’s “Rules OK for you” is hard-coded; (5) “paid at overtime rates” contradicts ADR-016; (6) Approve and Publish aren’t gated by role or status; (7) a gendered reason in a fixture. Eleven nits went to the lead. Confirmed correct: ADR-015 chips, overtime as a pay-period pill, short hours in coverage cells, the footer, the ADR-017 lock gating, override reasons, and no auto-approval. Fixes and re-check pending. |
| 29 | 2026-11-20 | Step 5 continued: planted cases PC-01 to PC-09, then review-r2’s generator findings R1-R5 | ./mvnw test in Docker: 84/84 (56 rule tests, 19 infrastructure, 9 api). Generator: 6188 assignments, 194 absences, 194 open shifts, 309 offers, ~18-20 s, checksum e0e7215719f7ad66d1dd991a8ff53341ffdc369d54b32afed0bcfbc8f0a4eeb2 reproduced on four runs. The self-check now asserts every planted case shape (Nia’s P12 and the open Unit B Saturday day shift, the exactly-8 h night slot, Piotr’s four A12 plus an open fifth, the 17 h override, 80 h / 80 h 29 m / over in the locked period, three four-night runs, a shared overtime total with different seniority, and an open Control shift whose top candidate lacks CONTROL) |
Review-r2 found that the generator’s “actuals” were not what the self-check evaluated. R1: past assignments were extended 30-120 min including 16-hour shifts (about 16.5-18 h worked, past the U-05 ceiling) while the self-check read scheduled times only; extensions now respect the next shift’s rest, the 16-hour ceiling and the rolling 168 h ceiling, and the self-check evaluates actual times. R2: U-04 could never fire because the fact carried a stored extension of 0; it now derives the extension from the worked duration. R3: the pay-code loop reimplemented the 80 h threshold and 30-minute minimum; it now calls PayClassifier. R4: the three decorative emergency overrides attached to non-violating shifts were removed as false audit records (PC-03 is the real one), and the inert minBreakHours column is gone (the 24 h clause lives in the fact builder). R5: the 12-hour tie case for F2 is tested, not just the days case. Commits: 1c73768 (R1-R4), f32c5bd (evidence ids so an override can be matched), baf42d0 (R5). |
| 30 | 2026-11-20 | Design review round 2 of the web UI at 4413ea0 (B1–B7 fixes, the mock sign-in picker, the nits) by dev-design (Claude Opus 5.5) |
Mutation check: in a scratch worktree, each fix’s source file was reverted to 7b228b9^ and the new tests re-run. Every B1–B6 test failed without its fix and passed with it; the full suite is 83/83 at the tip. Keyboard walks used jsdom and user-event, not a live browser, because the person was away and browser automation needs permission prompts |
B1–B6 confirmed fixed; B7 fixed in the text (no test). The B2 override-with-warnings path is correct but untested. Five new blocking findings: (1) the approver’s sign-in lands on “Page not found”; (2) the fixture refuses approval of any L. Fraser draft whoever approves, so E3 can’t finish in fixtures mode, and the existing test only checked that the button appears; (3) Build ignores unsaved table edits, so an admin could submit believing a change was made; (4) a leftover word on the offer card (“paid counts toward…”) that the test’s regex hid; (5) in api mode the role switch changes the shown user without a new token. AI corrected itself: it withdrew its round-1 nit about the clock date, because the Regina date really was 19 Nov. Fixes and a round-3 check are pending. |
| 35 | 2026-11-20 | Design review round 3 of the web UI on web-step7-planning (R1–R5 fixes at f14b261, then c919c8f) by dev-design (Claude Opus 5.5). Numbered 35 because the web branch already uses 28–34 for other entries; renumber at merge. |
Each fix and both safeguard guards were mutated one at a time in a scratch worktree, and every one made its test fail. The guards were: Build/Submit role gate; the author can’t approve; save before build; the approver route; the fixture’s maker/checker actor; the 401 session expiry; no role chip on /login; no role switch after sign-in. c919c8f passes 98/98. Demo flows were walked with scripted jsdom tests in fixtures mode, not a live browser and not the real api |
Confirmed fixed: R1–R5, the Build/Submit role gate, and the author excluded from Approve. The E3 test genuinely walks two users through sign-in, edit, build, submit, sign-out, approve and publish. Found: (1) the committed f14b261 failed one of its own tests, because a session-reset line in the test setup was uncommitted (committed in c919c8f); (2) the B2 override-with-warnings test still passes with the fix deleted, because the fixture doesn’t refuse unacknowledged warnings, so it’s a weak test; (3) E2 is blocked in fixtures mode: an offer made on the overtime board never reaches the employee’s My schedule, and no Confirm appears after acceptance. E1, E3 and E4 (the lock refusal and the locked-period CSV export) work. |
| 36 | 2026-11-20 | Playwright e2e layer for flows E1–E5 (docs/10 §5) on branch e2e-playwright (859d78d, ca34c95) by dev-design (Claude Opus 5.5): desktop 1440 and tablet 768, axe on every screen reached, keyboard-only E1 and E3, and an @fixtures tag for the real-api run |
The browser ran in Docker (mcr.microsoft.com/playwright:v1.65.1-noble) against the fixtures-mode build of web-step7-planning 46ba5f6. Two identical runs: 25 passed, 3 failed, 4 skipped, 0 flaky. The 4 skipped are E5, marked fixme because the wall display isn’t built |
A real accessibility defect found in a browser that jsdom couldn’t show: axe scrollable-region-focusable (serious). A read-only scroll box has nothing focusable inside, so a keyboard user can’t scroll it. It shows on the locked pay period and on the approver’s rules table at 768 px, and was sent to the builder. The keyboard path was measured: 67 Tab presses from sign-in to the PC-01 chip, and 54 even from the skip link. AI corrected its own test setup twice: (1) vite preview rejected the host.docker.internal host with a 403, so the build is served with serve -s instead; (2) runs with 7 workers on the shared host (load average 17) were flaky (13, then 6 passing), so the defaults became 2 workers and a 10 s expect timeout, rather than retries that would hide real failures. AI corrected one of its own specs: the E3 test typed into the rule field without selecting the row, which a person never does; it now clicks the field first, so the test asserts real behaviour. |
| 37 | 2026-11-20 | Step 6 review fixes from dev-qa and review-r2 (S1–S4) and the smaller findings: preview unit scope, concurrent-save race, bad-input 500s, 28-day lookback, hardcoded rule-set version, override vs warnings. Numbered after the web branch’s 28–36 entries to avoid a merge clash. |
Tests were written first and each failed for its own reason: j.chen previewing Unit B returned 200; two parallel saves for one officer both returned 201; an override without warn acknowledgement returned 201; the 11th 16-hour shift in 28 days produced no U-11; bogus unit/employee/template ids and a missing startAt returned 500; the preview reported version 1 after the published row was set to 42. After the fixes the targeted run was 12 assignment + 6 matrix + 5 problem + 2 advice tests green, and a clean worktree at f73d6c5 ran 56 rules + 20 infrastructure + 66 api = 142 tests, 0 failures. |
The overlap-constraint 409 cannot be reached through the API after the officer lock, because an overlap always breaks U-01 first; ApiProblemAdviceTest therefore proves the mapping directly and the code says it is the last line of defence. Decision recorded as ADR-021: an override excuses Blocks, never Warns; the same request must carry every warn code. |
| 38 | 2026-11-20 | Step 8 backend: OvertimeRanker, open shifts, ranked candidates, offers, accept/confirm, direct assign, /me/schedule, /me/offers |
Rules: 10 ranker tests (PC-07 tie by seniority, PC-09 unqualified head of list, skip-keeps-place, keepPlace off, deterministic ties, O-01..O-03 fire); 66 rule tests green. API: 9 overtime/me tests recreate the planted shapes (PC-07, PC-08 offer→accept→confirm, PC-09, PC-02 exactly 8 h) plus S-04 and unit scope; full suite in Docker 66 rules + 20 infrastructure + 76 api = 162 tests, 0 failures. | Two findings from real failures, not inspection: (1) other api test classes share the Postgres container, so their officers entered the candidate pool and their pay period hit the exclusion constraint; the fixture now deactivates outside officers and clears an overlapping period. (2) overtime_offer had no CONFIRMED status; V4 widens the CHECK instead of pretending ACCEPTED means confirmed. Decision in docs/07 §4.3: candidates are limited to the caller’s unit scope because the list shows overtime totals, which the permission matrix limits to scope; a facility-wide list would be a policy change. AI suggestion rejected: trusting the accept-time snapshot at confirmation; the confirmation re-runs the rules and refuses a new warning, so nothing auto-approves. |
| 39 | 2026-11-20 | Step 9 backend (HANDOFF): time entries and actuals, absences, period overtime, lock/unlock, payroll CSV, on api-time-payroll (dev-build2) |
./mvnw -B test in Docker (maven:3.9-eclipse-temurin-21 with the socket mounted): BUILD SUCCESS, 140 tests (56 rules, 20 infrastructure, 64 api). New: PayrollApiTest 9/9 (record actual and pay codes, 88 h → 8 h OT through PayClassifier, absence clears the missing actual, T14 lists 3, lock + audit, T11 409 and the database trigger, unlock reason/audit, export locked-only + SHA-256 record, one authorization cell per role/scope) and PayrollExportGoldenTest 1/1 (T8: locked period 26 Oct – 8 Nov equals the checked-in 1,009-row CSV; per-officer CSV hours equal the time entries; OT rows equal hours beyond 80 with P-04; the file hash is in payroll_export) |
The API keeps the pay maths in one place. PayClassifier gained allocate(...), so the service and the export do not re-implement the threshold or the 30-minute minimum; the CSV split and the on-screen codes come from the same call. Two honest limitations, stated rather than hidden: (1) a pay period is facility-wide, so lock/unlock/export require a supervisor with some unit scope (the prototype has no facility-level role); (2) the spec’s cost_centre has no column in the data model, so the unit code is used, and the golden file records that. Data finding: the demo hours are stored to 2 dp, so the CSV keeps 2-dp hours instead of rounding to 15-minute steps; rounding would break the required “CSV totals equal the actual time entries”. The golden rows were hand-checked against the entries (E-001 80.00 h no OT; E-002 80.48 h all regular under P-04; E-003 84.00 h with 4.00 h OT15). |
| 41 | 2026-11-20 | review-r2 fixes on step 9, branch api-time-payroll (dev-build2). Number reserved against main, which is at entry 39; renumber at merge if needed |
./mvnw -B test in Docker: PayrollApiTest 12/12, PayrollProblemAdviceTest 1/1, and PayrollExportGoldenTest 1/1 — the golden file is byte-identical after the CSV change. New tests: hostile employee numbers (=2+5*10, E,1, E"2) export neutralised/quoted; an actual in 2036 answers 400 application/problem+json; two parallel lock requests answer 200/200 with exactly one lock_pay_period audit row; the OT display multiplier equals policy.overtimeRate(); AUDITOR lock/unlock/export and EMPLOYEE unlock/export answer 403. |
P2 (CSV injection): real and fixed. Cells now use RFC 4180 quoting only where needed and prefix a leading = + - @ with a single quote, so a spreadsheet cannot evaluate an employee number as a formula and a comma cannot split a row. P3: real. Adjusted times are validated to the rostered shift ±24 h and answer a invalid-actual-window 400 problem; a numeric overflow (SQLSTATE 22003) maps to a 400 invalid-hours problem instead of a 500. Low finding: real. The lock UPDATE now has WHERE status = 'OPEN' and audits only when a row changed, so a lost race is idempotent without a second audit row. P1 was left to dev-build (it is in AssignmentService on main, as the lead directed). |
| 42 | 2026-11-20 | Step-8 review fixes from review-r1 (F1–F7): the qualification/availability gate, offer/confirm races, CANCELLED offers, re-offers, IDOR, the demo clock |
Tests first where the defect was externally visible; the targeted run after the fixes was 13 assignment + 16 overtime + 2 context tests green. Full suite on the merge commit 2b5f3fe: 82 rules + 20 infrastructure + 98 api = 200 tests. |
F1 was a real display-only gate: candidates() marked unqualified/overlapping officers UNAVAILABLE but offer/confirm/direct-assign never checked, so an unqualified officer could be offered and confirmed. The same requireAvailable now runs in all three (422 officer-unavailable). F3 was a real race: respond()/confirm() checked status then updated without a guard; they now take the offer row FOR UPDATE and update with AND status = … + rowcount, with double-accept, accept-after-confirm and a parallel pair tested. F2/F4: CANCELLED shifts refuse offers; a declined/expired offer is reactivated (ON CONFLICT DO UPDATE … WHERE status IN ('DECLINED','EXPIRED','WITHDRAWN')). F7: the overtime quarter is sc.demo.today, not now(), in both the ranked list and My schedule. F5: docs/06 now lists CONFIRMED (V4). F6: another officer’s offer answers 404, tested. |
| 43 | 2026-11-20 | Step 11: the rules publish pipeline (drafts, validation, compile, scenarios, dry run, maker/checker, hot swap) | Rules: RuleRowValidator 13 tests at this commit, RuleScenarioRunner 3 (T1–T5 + ranking), 82 rule tests green. API: RuleSetApiTest 4 — T13 (U-01 = 7 fails validation with the plain “8-hour legal floor” message; submit 409), T10 (the author cannot approve their own draft, 403), T7 (U-10 4→3: dry run shows a new U-10 PASS→WARN row for the four-night run; after approve/publish the same preview warns, no code change), E3 (U-03 12→14 publishes; the live version increments). Full suite in Docker 82 rules + 20 infrastructure + 103 api = 205 tests, 0 failures; the final tree is 206 after entry 44. |
The live rule base was a startup constant; it now comes from PostgreSQL. PublishedRuleSet loads the published rows at boot (fallback v1 only when none exists) and publish compiles before swapping, so a failed build changes nothing and a restart keeps the published rules. A build is evidence that can go stale: the build stores a fingerprint of the exact rows it validated/compiled/ran; saving rows clears it and submit/publish refuse an older build (409). Scenario scope stated, not stretched: the pipeline runs the rule-firing scenarios T1–T5 and the O-02 ranking check; T8–T14 are DB/workflow scenarios (payroll, maker/checker, lock, privacy) already covered by their own tests and cannot be affected by a rule row. A test-infrastructure limit found, not a product bug: with twelve cached Spring contexts the shared PostgreSQL hit too many clients; the test profile now caps Hikari at 4 connections, which is why the same tests pass. |
| 44 | 2026-11-20 | Two review flags on the step-11 groundwork: the rule snapshot was two volatile writes, and the validator did not require the Must rules | 33 targeted tests after the fix (validator 14, rulesets 4, overtime 16, assignment 13 minus cross-module counts). Clean worktree at a46580b: 83 rules + 20 infrastructure + 103 api = 206 tests, 0 failures. |
Both were real, not style: (a) PublishedRuleSet now keeps the rows and their compiled KieBase in one immutable Snapshot swapped by an AtomicReference; the rule check, the ranked list and the dry run read it once per request, so a publish cannot rank under one version while evaluating under another. (b) RuleRowValidator now refuses a rule set that dropped a Must rule (the v1 codes, docs/05 §3) and names it at validation, before compile or scenarios; the test deletes U-01 and expects the violation. Test-infrastructure note: one clean run failed in ReferenceDataMatchesRuleRowsTest while a fresh container was still accepting its first SSL handshake; the migration now retries up to three times (a real migration error is stable and still fails), and the re-run at the same commit was green. |
| 45 | 2026-11-20 | Step 10 backend (HANDOFF): coverage, hours, overtime and overrides reports plus CSV export, on api-reports (dev-build2). Number 42 (41 is the step 9 review fixes) |
ReportsApiTest 6/6 on the demo dataset in Docker: coverage hours reconcile with the assignments hour slot by hour slot, the hours report reconciles with the time entries, the overtime report and the payroll export’s OT15 rows agree for the locked period, the overrides count equals the override rows and the planted PC-03 row carries its reason and rule codes, the CSV headers are asserted, one authorization cell per role/scope is checked, and NFR-05 medians on a 90-day range are coverage 20 ms, hours 19 ms, overtime 16 ms, overrides 5 ms (limit 2 s). |
The first coverage query was wrong and slow, and the tests caught both. It joined every hour slot to every shift and counted actual rows after the same join, so an actual entry was counted once per scheduled shift covering the hour; it also took about 3.8 s for 90 days. It now reads the intervals once and marks the hour slots in Java, which is exact and fast. Two honest definitions: coverage hours count one per hour slot a shift or actual covers (the board’s hourly semantics, ADR-013), so a 7 h 35 m actual counts 8 staffed hours; the hours report classifies overtime on the hours inside the selected range, and the default range is a whole pay period, which is what the screen uses. Scope: coverage/overtime/overrides are supervisor/auditor; hours also allows an employee, who sees only their own row (docs/07 §4.6); an out-of-scope unit or employee filter answers 404. docs/07 now documents the CSV contract and those defaults. |
| 46 | 2026-11-20 | Build the planning board, the rule-check panel and the emergency override dialog (HANDOFF step 7, web half) | pnpm build, 37 Vitest tests, pnpm lint; the image was run and probed with curl, and the board was rendered in a browser at 1600 px and 768 px and looked at |
AI error caught by the build. The theme used the MUI 5/6 button style slots (containedPrimary), which do not exist in MUI 9; pnpm build failed on the unknown property and the slots were corrected to contained / outlined. AI error caught by looking at the screen. MUI multiplies a numeric borderRadius in sx by the theme’s shape.borderRadius, so every radius was four times the design value - cards were 40 px instead of 10 px. Only the screenshots showed it; the tests all passed. Lead corrected the AI twice. The build instruction said to proxy /api/ to http://api:8080, but the api is on 8081 (docs/08-deployment.md §2 and §6, confirmed by the api builder); and the fixtures were the default, but the shipped build must talk to the real api, with the fixtures behind a visible “demo fixtures” badge. Both were changed. |
| 47 | 2026-11-20 | Build the overtime board and the employee My schedule with the overtime offer card (HANDOFF step 8, web half) | pnpm build, 54 Vitest tests, pnpm lint; both screens were rendered in a browser and looked at |
Lead corrected the AI. The candidate reasons in the mockup were gendered (“Keeps his place”); the lead pointed out that officers are people of unspecified gender in the synthetic data, so the reason now reads “Keeps their place”. AI did not hard-code the candidate reasons. docs/ui/build-notes.md §1.4 says the reasons come from GET /open-shifts/{id}/candidates, so the screen shows what the api sends and the fixture carries the mockup’s sample reasons. AI left out what was not asked for. The “+ Create open shift” button was not built, because POST /open-shifts is not in the screen map the lead gave, and a visible dead button reads as unfinished in the demo. |
| 48 | 2026-11-20 | Build the Time and attendance screen (HANDOFF step 9, web half) | pnpm build, 62 Vitest tests, pnpm lint; the screen was rendered in a browser and looked at |
The mockup’s pay-period hours did not add up to its own shift patterns, so the demo hours now come from the shifts. Tara worked 48 h in the mockup’s own week but the mockup said 72 h for the two-week period; the planning board and the time screen would then disagree about the same officer. The fixture now counts the shifts, so both screens show the same hours (Tara 96 h, not 72 h), and the tests follow. AI recorded what the api could not answer. The screen needs the officer’s name and unit on a time entry, the period’s overtime threshold and lock totals, and the actual times with the unpaid extension (P-04); the three additions are now written into docs/07-api-spec.md so the api builder has them. |
| 49 | 2026-11-20 | Build the Reports screen (HANDOFF step 10, web half) | pnpm build, 67 Vitest tests, pnpm lint; the screen was rendered in a browser and looked at |
AI did not draw the chart from the numbers alone. The coverage chart shows the share of required staff-hours that were scheduled and that were actually worked (ADR-013, hourly), the axis starts at 94% and says so, and the chart carries a text summary for a screen reader with the same figures in a table under it - docs/ui/README.md §5.5 asks for the data table as well as the summary. The OT 2x column is hidden when it is empty, because the 2x band is off by default. |
| 50 | 2026-11-20 | Build the Rules admin screen (HANDOFF step 11, web half) | pnpm build, 74 Vitest tests, pnpm lint; the screen was rendered in a browser and looked at |
AI kept the maker/checker rule in the screen, not only in the api. The person who created the draft does not get an Approve button; the screen says “You created this version. Another approver must review it” and a second approver gets the action. The dry-run impact is counts by rule, unit and date and never names, because the approver has no roster access (ADR-017). AI left out the Excel round-trip on purpose: docs/07 §4.7 has the endpoints, but the round trip is a Should item (HANDOFF step 12), and a visible dead button reads as unfinished in the demo. |
| 51 | 2026-11-20 | Round-2 UI review fixes R1–R5 on web-step7-planning (dev-build2) |
pnpm build, pnpm test (94 tests, 11 files), pnpm lint; the five review items each got a test written to fail first: R1 the approver’s sign-in no longer lands on “Page not found” (/rules route, version picked by status); R2 the test now walks E3 through two real sign-ins and to a published v8, and the fixture refuses only the author’s own approval; R3 Build and Submit save unsaved table edits (asserted against the fixture’s stored rows) and show “You have unsaved edits”; R4 the offer sentence reads “these hours count toward your pay-period hours”; R5 the role switch is gone once a real session exists, the chip opens Sign out, a 401 sends the screen to /login with the session notice, and the chip is hidden on /login |
AI corrected two of its own assumptions while testing. (1) It first read the R2 fixture as needing a fake “second approver” identity; the real fix is that approval compares the signed-in person with the draft’s creator, which also let the E3 test drop the role switch entirely. (2) It expected Submit to re-save edits in the E3 walk; Build already saved them, so the test was corrected to assert the plain submit message, while the separate R3 test covers the save-then-rebuild path. Role gating applied per docs/09 §2: only RULES_ADMIN builds/submits, only RULES_APPROVER approves/publishes, and canApprove excludes the draft’s author even for a dual-role user. The fixtures role switch remains only for tests/demos until someone signs in. |
| 52 | 2026-11-20 | Web/api contract correction from dev-qa’s comparison of the real responses (main @ 0dc96e1) with web/src/api/types.ts |
pnpm build, pnpm test (98 tests, 12 files), pnpm lint; a new web/src/api/contract.test.ts parses payloads copied from AuthController/RuleCheckService (demo user, mock-login, rule results, an EXTRA save) so the types are tested against the api’s shape, not only against the fixtures |
The web was built against a shape the api does not send, and the fixtures hid it. (1) DemoUser now matches {id, username, displayName, roles, units, employeeId}; the picker shows the display name and derives “Units A, B” from the unit codes. (2) RuleCheckChange is ASSIGN | EXTRA per docs/07 §3; the PATCH/DELETE branches and the move/cancel actions are gone, because the api has no such endpoints and a “move” would have silently created a second assignment — the shift dialog now says that plainly instead. (3) Evidence is {label} only. (4) RuleResult carries ruleTable and overridePolicy, and the override dialog is offered only when every blocking result is EMERGENCY. (5) The duplicated DemoUser/MockLoginResult block and duplicate sign-in methods are removed. Corrected before the backend slices, as the lead asked. |
| 53 | 2026-11-20 | Round-3 UI review fixes on web-step7-planning (dev-build2): E2 in fixtures, the weak B2 test, and the shift link |
pnpm build, pnpm test (102 tests, 12 files), pnpm lint; new tests: an offer created on the overtime board appears in My schedule, comes back accepted, and the supervisor confirms it (E2); the override save is asserted to carry acknowledgeWarnings: ['U-14']; /overtime?shift= and ?unit=&startAt= open the named shift; the planning board’s “Find eligible officer” link now carries unit+start |
Both findings were real and the fixtures were the cause. (1) createOffers now also records the employee’s offer card and a history row keyed by offer id, respondToOffer updates the same row, and confirmOffer confirms it; resetFixtures restores both lists. (2) The fixture now refuses an override with unacknowledged warnings, exactly like AssignmentService, so deleting acknowledgeWarnings fails the B2 test even without the spy. (3) “Find eligible officer” carries the slot (unit, startAt) and the overtime board matches it, instead of relying on PC-08 being first; the planning board cannot name an open shift because a proposal is not one, so it names the unit and start. |
| 54 | 2026-11-20 | Round-4 UI review: the Playwright/axe finding (scrollable-region-focusable) and the article nit |
pnpm build, pnpm test (104 tests, 12 files), pnpm lint; tests assert both scroll containers are focusable regions and that the composed sentence reads “After a 16 h shift” |
The axe serious finding was a real keyboard blocker. The two horizontally scrolling boxes whose contents can be read-only (Time & attendance grid, the rules decision table) now carry tabIndex={0}, role="region" and an aria-label, so a keyboard user can reach and scroll them; tests check both. The sentence builder now adds “a” before a shift kind that starts with a digit (“After a 16 h shift”), while “any shift” stays as it is. Not done: roving tabindex across the roster grid (the 67-Tab path to Nia’s chip). The lead’s step-7 brief explicitly said to skip arrow-key grid navigation, and a roving tabindex without arrow keys would make most chips unreachable; it is a separate accessibility change, recorded here rather than half-built. |
| 55 | 2026-11-20 | Round-5: the fixture payroll CSV header did not match docs/07 §4.5 (caught by the Playwright E4 test once the axe failure stopped hiding it) | pnpm build, pnpm test (105 tests, 12 files), pnpm lint; a test asserts the exact header and that a data row has 8 columns, an E-### employee number, the period dates and 2-dp hours |
The fixture was showing a CSV shape the api never produces. The export now emits employee_no,pay_period_start,pay_period_end,work_date,pay_code,hours,unit_code,cost_centre, one row per officer per day per pay code, with a stable E-### number derived from the fixture’s officers and the unit code in both unit columns (matching the api’s cost-centre choice). The fixture’s data also now covers the two weeks before the roster week, so the locked period 26 Oct – 8 Nov has real rows instead of only a header. |
| 56 | 2026-11-20 | Integration run: web against the real api for the first time, in worktree integration off main (dev-build2) |
docker compose -p sc-integration -f docker-compose.yml -f docker-compose.dev.yml up -d --build with ports 28080/38081/35432: db, api and web all healthy; api /version and /auth/demo-users answer through nginx; demo data generated (6,183 assignments, 193 absences, 194 open shifts, 309 offers). Playwright against the real api, each viewport on a fresh stack: desktop 5 passed / 2 skipped, tablet 5 passed / 2 skipped (E1 @api, E2 offer-accept-confirm, E2 employee privacy, E4 locked export, E4 unlock; E3 and the fixture-only E1/E4/keyboard tests skipped). Web suite 108/108. |
Six real integration defects, all fixed in small commits: (1) the API would not start: DemoDataGenerator gained a second constructor for tests, so Spring found no default one; the 2-arg constructor is now @Autowired. (2) M. Ellis arrived as Employee because the api’s role array order is not promised; the web now picks the role by precedence. (3) the planning board never sent unitId/from/to; it now loads GET /units and the Monday–Sunday week of the demo today. (4) the overtime history had no offer id, so Confirm could only work in fixtures; the api now returns it and the web confirms by id. (5) the Find eligible officer link compared a Z instant with an offset string; it compares instants. (6) accepted offers vanished from My schedule because /me/offers?status=OFFERED excluded them; the screen now shows the status and keeps accepted/confirmed offers visible. Two data/spec mismatches: the demo employee (Tara) was rostered in Unit C on Sat 21 Nov, so PC-08 could not be offered to the only account that can sign in; the planted case now frees her. The real api blocks PC-01 on U-01, U-05 and U-14 (the week passes 60 h) and offers no override because U-14 is ACKNOWLEDGE; the @api spec asserts that safeguard, and docs/10 now says so. Not covered: E3 is pending (the rules API is step 11); the proposed-chip path and the other fixture-only tests are tagged @fixtures. E2 is stateful against a shared database, so the two viewports were run on separate fresh stacks. |
| 57 | 2026-11-20 | E3 against the real api: rules admin, maker/checker and publish, on the integration branch (dev-build2) |
Desktop and tablet on separate fresh stacks: 7 passed / 2 skipped per viewport (E1 @api, E2 offer-accept-confirm, E2 privacy, E3 admin+approver publish, E3 supervisor denial, E4 locked export, E4 unlock); the stack was torn down with down -v. The E3 test now creates the draft from the live version, edits U-03 12->14, builds, submits, signs out, signs in as P. Singh, approves, publishes, and checks /api/v1/version reports a new live rule set. RuleSetApiTest 5/5, web suite 109/109, full clean-worktree API suite green (82 rules + 20 infrastructure + 104 api). |
The rules screen could not start a change against the real api: it assumed a seeded draft and used the readable table slugs while the api used its internal codes. Fixed: the api resolves both rest-between-shifts and REST; the table view now returns the friendly after label (“16 h shift”) and the params key the hours field edits (minRestHours, etc.); the web writes that key into params instead of only the display field; a new POST /rule-sets/drafts call backs a “Start a draft” card shown when no draft exists. A real edit was being lost because the web sent the old params with a changed display value; the new hoursParam contract fixes it and a test asserts the stored params.minRestHours becomes 14. The draft pill now counts unsaved edits, not only the api’s saved change count, so “1 change in draft” appears while the admin types. Dataset: freeing Tara on Sat 21 Nov changed the demo checksum to 0f1ba078a793f450fbae1ddb31f70c6dcbe053b1f8c62415431973e2b71be6de (6,182 assignments); the generator self-check still passes and the T8 golden file (26 Oct - 8 Nov) is still byte-identical (PayrollExportGoldenTest green). |
| 58 | 2026-11-20 | Step 12a: the wall display GET /display/today (E5), then the ignored-source guard |
DisplayApiTest 3/3 in Docker: ADR-017 shape, the night block running 23:00–07:00 across midnight, no employee name/number/id anywhere in the payload, supervisor unit scope, roles and 401. A clean worktree at f191d07 ran 83 rules + 20 infrastructure + 106 api = 209 tests, 0 failures. The guard was tested both ways: the clean tree exits 0; a planted docs/check-ignored-plant.log exits 1 naming that path. |
The first “verified” claim was wrong, and only a clean checkout caught it. 6649eb1 did not compile: .gitignore’s unanchored coverage/ (meant for web Vitest output) hid the new Java package ca.shiftcircle.api.coverage. The targeted test passed because the file existed in the authoring tree — the same failure mode as the build/ package in entry 25. Fixed in f191d07 (build, dist and coverage are anchored to /web/), and scripts/check-ignored-sources.sh (6237258) now fails on any ignored path under api/*/src, web/src, e2e/ or docs/, with a step in README §4. AI corrected its own fixture: the first display test put a night shift on the previous night and expected 00:00–07:00 to be empty, but the NIGHT block for date D is 23:00 D to 07:00 D+1; the calculator was right and the fixture was wrong. Decision: docs/07 §4.8 listed DISPLAY + SUPERVISOR for the endpoint while the docs/09 §2 matrix already gives AUDITOR a tick; the endpoint follows the matrix (auditor is read-only across the facility) and docs/07 was corrected to match. |
| 59 | 2026-11-20 | review-r2’s critical DRL injection (S1) plus S2–S5, and the ReDoS follow-up | Hostile-value tests were written first and failed for each sink: a shift-kind regex, a message and a code all reached the Drools source; then S1’s API tests drive the regex and a renamed code through the real build endpoint (validation fails, the compile step never runs, no injected system property is set). Each fix has its own commit: e13ddeb S1, b572dff S2, 444f685 S3 + the shift-kind bound, 03ceb19 S4, 35c225d S5. Clean worktree at 35c225d: 89 rules + 20 infrastructure + 126 api = 235 tests, 0 failures; scripts/check-ignored-sources.sh passes. |
S1 was real and is now closed at both ends. A rule row is DRL source, so codes are [A-Za-z0-9-]{1,16}, messages allow no quote/backslash/newline/brace, and validation refuses before compile; TemplateColumns re-checks the code and regex and escapes the message, so a row that reached the database another way still cannot compile into injected Java. Compiler errors are logged and the client only learns that the rules did not compile (the old message named generated classes and line numbers: a build oracle). ReDoS (review follow-up): the shift-kind column is now an alternation of shift codes, optionally parenthesised, or .*, at most 64 characters - no quantifiers, groups, backreferences or escapes, so (a+)+ is refused; the seeded (D8|E8|N8|A12|P12) still validates. Other DRL-from-strings paths checked: counts is an enum, overtimeSeverity is WARN/BLOCK, severity/overridePolicy are database CHECKs, shift-length conditions are numbers only; no Excel import exists yet. S2 real: the UPDATE never wrote message, so an edit vanished while the screen showed it saved. S3 real: weakening U-01’s override policy passed the whole pipeline; Must rows are now pinned to their documented policy (ADR-023), and T9’s save half is already covered in AssignmentApiTest (U-08 ACKNOWLEDGE, overridable=false). S4: limits are capped and the dry run names a rule that fires under the live base and nowhere under the candidate. S5: unknown table 404, a string in a numeric column 400 naming the label, a bad effectiveDate 400, duplicate rows 400. Two of my own slips while testing: the first end-to-end hostile-code body was an incomplete row (Jackson refused it before the service), and a hostile afterShiftKind was overwritten by the screen’s friendly after label - the crafting request must omit after; and the unknown-table wrapper never fired because resolveTable already answered 400, so the status was changed at the source instead. Count honesty: I repeated dev-build2’s 231 for 2b572c1; my own run is 224 (83+20+121). The 7 difference is the reports tests on integration2, explained by the lead. |
| 60 | 2026-11-20 | M1-M6 review items on the reports, branch api-reports (dev-build2). Number 59 against main (58) |
Targeted Docker run: ReportsApiTest 9/9 (includes M1 reversed and >366-day ranges -> 400 on all four reports, M3 unknown groupBy -> 400, M4 DISPLAY -> 403 on all four), ReportsEmptyDatabaseTest 1/1 (M5: schema and users, no pay periods -> 200 empty report), CsvTest 3/3 (M2: the shared helper, including TAB and CR), PayrollApiTest 12/12 and PayrollExportGoldenTest 1/1 (the payroll export now uses the same Csv helper and the golden file is still byte-identical). |
M1: the checks already existed in validate; they are now tested on every report endpoint. M2: ca.shiftcircle.api.csv.Csv.cell is the one helper for payroll and reports; the duplicate in ReportsService and PayrollService.csvCell are gone. M3: groupBy other than day/week now answers 400 instead of silently meaning week. M4: the DISPLAY denials are tested for hours, overtime and overrides, not only coverage. M5: hoursPeriod used queryForMap and failed when the range had no pay-period row; it now returns the period header with no lock fields, so the report is an empty 200. M6: docs/07 §4.6 now says a custom range classifies only the entries inside it, so a partial period can differ from the payroll export. |
| 61 | 2026-11-20 | Three dev-qa integration findings, branch integration3 (dev-build2) |
Clean detached worktree at the merged tip: ./mvnw -B test -> BUILD SUCCESS, 89 rules + 20 infrastructure + 137 api = 246 tests; scripts/check-ignored-sources.sh OK. Playwright against the real api at d9cebd1, fresh stack per viewport: desktop 8 passed / 2 skipped, tablet 8 passed / 2 skipped (E1 @api, E2 offer-accept-confirm, E2 privacy, E3 maker/checker publish, E3 supervisor denial, E4 open-period lock, E4 locked export, E4 unlock); fixtures suite 28 passed / 8 skipped / 0 failed. New tests: BusinessClock 2/2 (frozen demo noon, real clock when unset), PayrollApiTest 13/13 with the 12:00/12:01 boundary, OvertimeApiTest 17/17 with unknown/malformed shift ids, ReportsApiTest 9/9 with the full PC-03 row. |
(1) The real-clock bug was real and blocked E4. Payroll needsActual and the lock precondition used Instant.now() while the demo day is frozen at 2026-11-19 noon, so 44 shifts that end after the demo day looked ended and the open period could not be locked. A BusinessClock now supplies the same frozen noon the schedule/overtime/reports use; with no demo date it uses the real clock. The boundary is tested: a shift ending exactly 12:00 is ended, 12:01 is not, and the real E4 lock flow now passes. (2) Offers on an unknown shift id now 404 (Open shift not found) and a malformed UUID answers a 400 that names id, instead of the generic “could not be read”. (3) The auditor overrides row was not actually joining badly on this build - I reproduced the report and employee/unit/rule code were present; the real gaps were that PC-03 had no actor and its created_at was the stack start time, so the default range excluded it. PC-03 now carries M. Ellis as actor and its 4 Nov 13:05 story time, and the test asserts reason, actor, rule codes U-05, employee and unit, plus the default-range visibility. The dataset checksum is unchanged (0f1ba078...) and the T8 golden file is still byte-identical. No change to the wall display. |
| 62 | 2026-11-20 | Merges (integration2, integration3 + its docs, web-display), the two review-r2 LOW nits, schedule publish, and the NFR-05 performance smoke | Merges: only ai-dev-log numbering conflicted; clean worktrees at c67488d (242 tests) and 17308b7 (246: 89 + 20 + 137); web-display’s only api call is GET /display/today. Nits: rules module 24/24. Publish: SchedulePublishApiTest 2/2. Perf on the full dataset: board four weeks 54/58 ms, rule check 4/7 ms, 90-day coverage 7/15 ms, rule build 655 ms, publish 516 ms; a second run gave 59/65, 3/4, 8/24 ms and a 954 ms build. Clean worktree at 51a4cc5: 91 + 20 + 140 = 251 tests. |
The merges themselves were quiet: integration3 already contained integration2, so main took two merges, and the only conflict was the log’s numbering (59 S1-S5, 60 reports M1-M6, 61 dev-qa integration findings). The guard had a real false positive (dev-build2’s fix, adopted): e2e/node_modules, test-results and playwright-report are build output and are now excluded. Nits: unbalanced parentheses fail validation with the shape in the message, and TemplateColumns’ own checks throw RuleCompilationException, so a bypassed validator still answers “the rules did not compile” instead of a 500. Publish is one-way, audited, scope-404 and the board’s publishedState reads the same row; absences were already on main from step 9. Perf: my first timing wrapped submit and approve inside the publish measurement; corrected to time only the swap, and docs/10 records the corrected figures with the date, the Docker Desktop caveat and the checksum. NFR-05’s board case is 14 days; the test uses 28, so it is stricter. |
| 63 | 2026-11-20 | Boot validation of published rule rows, and PATCH/DELETE /assignments/{id} (orch-lead’s move/cancel decision) |
Boot: two direct-edit tests (a semantically invalid U-01 and params = 'null') each make the constructor refuse to start and restore the row. Move/cancel: AssignmentMoveCancelApiTest 16/16, existing AssignmentApiTest 13/13, RuleSetApiTest 12/12. Clean worktree at 62dd4fc: 91 rules + 20 infrastructure + 158 api = 269 tests, 0 failures, BUILD SUCCESS; guard OK. An earlier clean run at c1dd6ad was 268 (before the second boot test). |
Boot had two silent paths, not one. The validator was missing, and RuleRowsRepository caught every RuntimeException, so a row that existed but could not be read fell back to the v1 fixture even though the database said something else was published. The query failure (first boot before migrations) still falls back; unreadable rows now stop the boot with a plain message. Move/cancel shares the POST contract rather than copying it: decide(outcome, request, principal) is the one acknowledgement/override path, so warnings and Block policies cannot drift between save and move. Moving evaluates the target with the assignment’s own current row excluded (RuleCheckService overload), otherwise a shift conflicts with the slot it replaces; both officers are locked in id order when the officer changes; If-Match is compared inside that lock, and the concurrency test sees exactly one 200 and one 412. My own slip: the first If-Match parser accepted W/"3"; If-Match requires a strong validator, so weak input is a 400 and a test now pins it. Offer decision: dev-design settled that cancelling a filled open shift resets the open shift and leaves the offer rows as history (docs/07, docs/10 §8), so nothing sets WITHDRAWN; the lead’s earlier “withdraw its offers” note was superseded. I added the lead-required extra state refusal (actual-recorded) and dev-design put it in the check order. Web handoff: POST/PATCH/DELETE carry ETag/version, board and /me/schedule SHIFT items carry version; exact request/response and failure shapes were sent to dev-build2. Count honesty: 268 was my clean run at the move/cancel commit; 269 is the later one with the second boot test. |
| 64 | 2026-11-20 | Requirement-to-proof traceability, derived from the test sources | Grepped every @Test, Playwright test(...) title and Flyway migration at 62dd4fc; docs/traceability.md now maps 20 rules plus workflow-enforced S-04, T1–T14, E1–E5, guardrails 1–8 and ADR-001…023 to exact class#method or spec#title. All 65 Java class#method references were checked against the source (a small script; no missing method). Docs-only: no test run changes, code tip remains 62dd4fc (269 tests). |
The derivation found real overstatements, now written down rather than smoothed over. (1) docs/10 §2 and docs/process/HANDOFF.md §7 said the scenarios are JSON data files and T1–T13 run in the publish pipeline; no such directory exists, RuleScenarioRunner holds T1–T5 plus the T6 ranking check in Java, and T7–T14 are API/DB tests. I corrected the docs/10 test-strategy row, and §8 now lists FR-07, NFR-09 and the shift-time editor as not built. (2) U-15 is a Must feature but only the UNDER state is asserted; no 72 h/80 h boundary test, so the traceability marks it PARTIAL. (3) FR-07 (notice check + per-officer “changed” flag) is not built; only unpublishedChanges counts exist. (4) NFR-09 OpenAPI/Swagger is promised in docs/07 but absent from the code and dependencies. (5) ADR-015’s shift-time editing flow is not built: the shift-types route aliases the SHIFT_LENGTHS table, and start times are seed-only. (6) docs/10’s “E2E timing” does not exist (only PerformanceSmokeTest), and its “one test per denied/scoped cell” is grouped assertions, not one method per cell. (7) T2’s U-14 detail is accepted by a count, not asserted by rule code. Also fixed from dev-qa’s finding: README’s api-test command now uses --build, because compose silently reused a stale image and could report BUILD SUCCESS for a tip that never ran. |
| 65 | 2026-11-20 | U-15 board-status boundaries, review-r2’s reason caps and absence guard, and the E5 traceability correction | Targeted run: ScheduleApiTest, AssignmentApiTest, AssignmentMoveCancelApiTest, PayrollApiTest, RuleSetApiTest — 66/66, 0 failures. Clean worktree at f1d696d: 91 rules + 20 infrastructure + 163 api = 274 tests, 0 failures. |
U-15 was a real gap and now has two tests: 71.99 h UNDER, exactly 72 h APPROACHING, 79.99 h APPROACHING, exactly 80 h and 80.01 h IN_OVERTIME, plus the last day and a 23:00–07:00 entry staying in their own period while a 2027 period’s 80 h does not leak. The hours column is numeric(5,2), so the 71 h 59 m case is 71.99 h (71 h 59 m 24 s); that limit is documented rather than hidden. My first test run failed for the wrong reason: the boundary method left an 80 h entry behind and listsTheOfficerRows... then saw IN_OVERTIME; the schedule fixture now clears the officer’s time entries before each test. The other three failures were expected — the caps were written as tests first and the production change landed after that compile. Review-r2 notes: cancel, override, unlock and reject reasons now cap at 500 trimmed characters with a 400 naming the field, and cancel also refuses absence-recorded when an absence row references the shift (the test plants the row directly because the API cannot create that state yet). docs/07 now lists both state refusals. E5: dev-qa’s full real-api pass at web-display a4b307e and the stale fix at 067e556 (docs/process/review-rounds.md R26/R27, 9 passed / 1 skipped, fit test desktop-only) moved the traceability row from PARTIAL to PASS; no code change. |
| 66 | 2026-11-20 | Order-proof test isolation, the generated-password smell, and the final count | Clean worktree at 22375d4: 91 rules + 20 infrastructure + 165 api = 276 tests, 0 failures, in three class orders — reverse (-Dsurefire.runOrder=reversealphabetical), random seed 20261120 and random seed 20261121; each 276, each BUILD SUCCESS. PostgresTestSupport creates one database per class; static @Test count is also 276 and Surefire reports 0 skipped. Targeted: AuthApiTest 10, ProdLikeAuthTest 2, AuthorizationMatrixTest 8, OvertimeApiTest 17, ReportsApiTest 9, DisplayApiTest 3. |
The authz failure was a real stale token, not only shared data. AuthorizationMatrixTest nulled t.nakamura’s employee link but kept using a token minted earlier; after OvertimeApiTest had linked that demo user to its officer and confirmed an offer, the token still carried the old employee id and /me/offers returned the leftover. The test now resets the link before minting tokens and re-logs in after unlinking, so it tests an unlinked user; Overtime also restores the demo user and employee flags after each method. Class-level isolation is the systematic fix: the shared container stays (expensive), but each class gets a fresh database (sc_test_N) and Flyway builds it, so a class that generates the roster or publishes a rule set cannot change the next one. Reverse and two random orders prove it on this suite. Generated password: a UserDetailsService bean that refuses every username makes Boot’s auto-configuration back off; the log now says passwordAuthenticationIsDisabled, not a generated password, and AuthApiTest asserts no InMemoryUserDetailsManager exists plus basic auth with user:password is 401. Count reconciliation: our clean run at 62dd4fc and the static @Test count there are both 269 (91 + 20 + 158); review-r2’s 270 (api 159) is one more than the files at that commit yield and remains unexplained. The final tip counts 276 statically and in every run, and README, PROGRESS and traceability now say the same. |
| 67 | 2026-11-20 | Schedule periods in the demo dataset, a board that names its period, and a real “unpublished changes” count (orch-lead’s schedule-publish row) | Targeted: DemoDataGeneratorTest 6/6, SchedulePublishApiTest 2/2, ScheduleApiTest 9/9, SchedulePeriodSeedApiTest 5/5 (it gained the sixth case, a two-week board, afterwards) — all in Docker. Clean worktree at fe6487d: 91 rules + 22 infrastructure + 171 api = 284 tests, 0 failures, in the default order and a random order (seed 20261120); scripts/check-ignored-sources.sh OK before the commit and in the worktree. The generator’s checksum is now 3390148255db715844c4df90f553ae342530417621539b23499f638c5b126539 (roster and the 84 roster weeks); the T8 payroll golden file is unchanged (PayrollExportGoldenTest green). |
The gap was real and simple: nothing in production created a schedule_period row, so POST /schedule-periods/{id}/publish was unreachable on a fresh stack — the feature existed, its data did not. Two instructions from the lead needed a correction against the schema. The row said “UNPUBLISHED for the current and the next period”, but schedule_period.status is DRAFT or PUBLISHED (docs/06) and the publish endpoint’s guard is status = 'DRAFT'; DRAFT is the unpublished state, so no migration was added and the guard still holds. The row also named only the current and the next period, but I seed every week of the window (past published, the rest drafts): a board on any week then has a period to publish, and the rule is written down in docs/10 §6.1. Rejected two tempting sources for the “unpublished changes” count. shift_assignment.created_at is unusable: the generator’s rows all carry the stack start time, so every seeded shift would look “changed after publishing” and a past week would report thousands of changes. version is unusable too: a move before the publication also bumps it. The source is the append-only audit trail — the assign_shift, move_assignment and cancel_assignment events of that period’s shifts after published_at — which is what the trail is for. For a period that is not published the count is null, not zero: there is no publication to compare against, and the board says “not published” instead of a misleading “0 changes”. The board’s published flag changed meaning: it was “any overlapping published period”, and it is now the status of the one period the board shows (the period whose dates contain the board’s range). A board that spans two weeks has no such period and says so (period: null) rather than guessing which week to publish — the web’s board is one week, so this only shows up on wide ranges. The checksum moved because the periods are now part of the dataset the checksum identifies; the roster itself did not change (6,182 assignments, unchanged). |
| 68 | 2026-11-20 | Delta-pass items 6–7 at 22375d4/16b287f, and the web UX branch ux-audit 2d25918 (superseded by dev-build2’s branch) |
Item 6 (performance): run twice from a clean detached worktree in Docker — full suite schedule median=57 p95=61 ms; rule-check median=3 p95=4 ms; coverage median=8 p95=12 ms; build=259 ms; publish=168 ms, class alone 64/70, 5/6, 8/9 ms; build=1162 ms; publish=1567 ms; both inside the NFR limits. Read PerformanceSmokeTest.assertLimit (two assertions: median and p95). Proved from the run log that the rule version it publishes cannot reach another class: PostgresTestSupport gives each API test class its own database (17 distinct sc_test_N for 17 classes; PerformanceSmokeTest → sc_test_13). Item 7 (counts): counted @Test on its own line myself — 91 + 20 + 165 = 276, the same split the docs give. Item B (the web branch): web 141/141 vitest, lint 0 errors / 2 warnings, build clean; private compose project sc-qac on port 29080, up -d --build --wait 22 s warm and the stack usable the instant --wait returned (/open-shifts 67 for m.ellis; 93 for j.chen, whose scope is narrower — the count is scope-dependent, not a fixed 67); Playwright real api desktop 18/18 and tablet 17 passed / 1 skipped, each on its own fresh stack; fixtures 41 passed / 3 skipped. By hand against the real api: the audit viewer, move/cancel (428/412/400/200/403), “Record actual” needing a choice, and the dock’s primary action inside the viewport at 1366×768. |
The counts are a method, not a number. A naive grep @Test gives 284: 8 hits are @TestInstance, @Testcontainers and @TestMethodOrder. Only @Test on its own line is the test count, and the per-module split (91/20/165) is what makes it checkable. The 276 is in the docs tip 16b287f, not the code tip — 22375d4 alone still says 269, so “the docs say 276” is only true of the docs commit. Three findings, none of them the UX work’s fault. (1) An overlapping POST /assignments that is emergency-overridden hits the database exclusion constraint and returns a raw 500 instead of 409: PayrollProblemAdvice.onConflict rethrows for every SQLSTATE but 22003, and a rethrow inside an @ExceptionHandler aborts handler resolution, so ApiProblemAdvice’s 409 never runs. I proved the fix on a patched scratch stack (500 → a clean 409 Problem Details body). This is on main too, not a branch defect. (2) The auditor’s sign-in showed a blank page: the api sends actualPercent: null for a week that has not happened, and the coverage chart filtered only undefined, so Math.min(...actuals) returned null and null.toFixed() threw, unmounting the whole app. The fixtures omit the field, so the 141/141 web suite and the fixtures e2e cannot see it — only the api’s shape triggers it. I reproduced it on a real stack, proved the fix in a scratch copy (auditor then got 6 nav links, “Reports”, 0 page errors), and the lead’s 6ee662e on main is the same fix. (3) ux-audit is based on 920e026 and never took main’s 22375d4 per-class-database fix, so AuthorizationMatrixTest.overtimeAndOwnScheduleCells fails there: reproduced on untouched 2d25918 in reverse-alphabetical order, and green with 22375d4’s two test files applied. A missing main merge, not a regression. My own errors, recorded because they nearly cost findings: the first Playwright run failed because e2e/node_modules was not installed (my harness, not the product); the first perf re-run failed because -Dtest= on the whole reactor stops at the domain module (needs -pl shiftcircle-api -am); and my first “duplicate assignment” probe produced a 500 that I initially took for a defect until the database showed the slot was already occupied by the rostered shift — the real trigger needs the override path, which the rules would otherwise stop with a clean 422. |
| 69 | 2026-11-20 | The raw 500 on an overlapping emergency-overridden assignment (orch-lead’s urgent row; dev-qa’s R32 finding 1) | Targeted, all in Docker: ConstraintProblemApiTest 3/3, ApiProblemAdviceTest 6/6, PayrollProblemAdviceTest 1/1, and the neighbours AssignmentApiTest 14/14, AssignmentMoveCancelApiTest 17/17, PayrollApiTest 13/13. Clean worktree at the tip: 91 rules + 22 infrastructure + 178 api = 291 tests, 0 failures, in the default order and a random order (seed 20261120); scripts/check-ignored-sources.sh OK before the commit and in the worktree. The T8 payroll golden file is unchanged. |
The bug was in the advice wiring, not in the rule engine. Two advices claimed DataIntegrityViolationException, and PayrollProblemAdvice rethrew every SQLSTATE it did not recognise; the rethrow aborted the handler resolution, so ApiProblemAdvice’s conflict answer never ran. Patching the rethrow would have fixed the symptom and left the hazard, so one place now maps every SQLSTATE and nothing rethrows: 23P01 (the exclusion constraint) is 409 “this officer already has a shift at that time”, 23505 is 409, 23514 (the locked-pay-period trigger is a check violation) is 409, 22003 stays 400 invalid-hours, and the maker/checker check stays 403. Rejected, then adopted with the traps closed: a catch-all @ExceptionHandler(Exception.class). My first answer to the lead’s question was “no”: Spring Security’s AccessDeniedException is a RuntimeException, so a catch-all advice swallows the 403 and answers 500 — the same class of bug one level up, and Spring’s own web failures (a wrong verb, 405) would have become 500 too. With the lead’s steer I built it anyway, but safely: the security exceptions and Spring’s ErrorResponse exceptions are handled explicitly, and the four advices now carry @Order 10 / 20 / 30 / 40 so the catch-all is consulted last and cannot shadow the rule, assignment or payroll advice. UnexpectedFailureApiTest goes through HTTP with a mocked board service: an unexpected failure answers a 500 problem body with no internals, a wrong verb keeps its 405, and a role refusal keeps its 403 and now has a body at all (before it was empty). What the grep found: the payroll advice was the only one that rethrew; no catch-all existed, so an unexpected error answered Spring Boot’s default 500 body (no message and no stack by default, but not problem+json) and a 403 answered an empty body. Every throw site in the api is handled (the IllegalStateExceptions are startup-only, the NumberFormatException is caught inside the If-Match parser). Run conditions, honestly: the first clean-worktree run was killed by the Docker out-of-memory killer (exit 137, “Killed”, 87 api tests in and no failures) because three other seats were running stacks on the same 7.7 GB Docker VM; the runs were repeated with -DargLine="-Xmx1200m -XX:MaxMetaspaceSize=384m" and passed in both class orders. The tests went in first and failed for the right reason: the HTTP test answered 500 where the contract says 409. The old test called the advice method directly, which is exactly why the wiring was never exercised — a unit test of an advice proves the mapping, never that the live app resolves it that way. Two paths are guarded by the app, not the database, and the tests say so: the overtime confirm path checks the overlap itself and answers 422, and the unique and numeric-overflow SQLSTATEs are unreachable through the current endpoints (the offer path upserts; the actual window is validated before the hours are computed). They are mapped anyway, for defence in depth. |
| 70 | 2026-11-20 | The flaky web vitest suite under load, branch web-stable off d497530 (dev-build2). |
Twenty-one files, 195 tests. Before, at d497530, while the api suite ran in Docker (load average 9–16): three runs, 3 green, but the slowest tests were 1.78/1.81 s (RulesPage R1/R2, the E3 maker/checker walk), 1.52/1.54 s (OvertimePage E2) and 1.24 s (RulesPage R3) — all multiples of the fixtures’ real 120 ms sleep, one per api call, with 15 calls in R1/R2. After, same host, an api suite running in Docker at the same time: three runs under the sc-heavy.lock rule with my own api suite (so no other seat’s run was disturbed) — 3 green, slowest test 404–426 ms, suite 10.5–10.8 s. An earlier three-run round during a busier host was also 3 green (slowest 443–498 ms, 11.8–13.0 s), but it overlapped another seat’s api run, which is the thing the lock now prevents. the test dev-qa named, the fixture move > refuses a move to another officer, went from 244 ms to 1 ms. Suite alone on a quiet host: 195/195, ~11.5 s. A detached clean worktree at this branch’s tip (pnpm install --frozen-lockfile): 195/195, pnpm build and pnpm lint OK, scripts/check-ignored-sources.sh OK, tree clean. pnpm lint clean apart from the two pre-existing set-state-in-effect warnings; pnpm build (tsc + vite) OK; scripts/check-ignored-sources.sh OK. |
Four real causes, none of them “the tests are slow”. (1) Every fixture call slept a real 120 ms (LATENCY_MS), so a 15-call flow owned 1.8 s of timers; on a contended event loop each timer fires late, which is how one test reached the 18.2 s dev-qa saw while its neighbours starved it. The fixtures now take VITE_FIXTURE_LATENCY_MS (default 120 for the demo, 0 in vite.config.ts), and wait(0) returns an already-resolved promise rather than a 0 ms timer. No test asserts a loading state, so nothing lost the pending render it needed. (2) WallDisplayPage.test.tsx’s firstLoad() polled performance.now() for up to 10 s with setImmediate — a hot loop that burns CPU on a loaded host and then fails a test that would pass a moment later. It now loads the lazy page module first (so no file IO is in the loop) and waits a bounded number of event-loop turns with no wall-clock deadline. (3) Two tests asserted on the page h1 that every screen redraws when the answer lands, so the node the find returned was gone: AuditPage “elements newest first” failed in 2 of 3 full runs and MySchedulePage “shows the officer” once, with “element could not be found in the document”. That failure was the test’s, not the screen’s; both now wait on ready content and then read the heading. The same “find a page heading and assert on that node” shape was removed in LoginPage, ReportsPage, RulesPage and TimeAttendancePage. (4) The config assumed a quiet machine: 5 s test timeout, 1 s testing-library poll, one worker per core. Now 30 s test and hook timeouts, maxWorkers: 2, asyncUtilTimeout 5 s. web/README.md has the table and the two rules (no wall-clock deadlines or real sleeps in a test; wait on content, not on a heading a page redraws). Rejected: keeping the 120 ms delay in tests “because the real api is slow” (the delay tests the fixture, not the screen, and findBy already covers the pending render), and raising only the timeout, which hides the slowdown instead of removing it. Playwright, same question: no fixed sleeps anywhere (grep waitForTimeout empty); the one timing construct is move-cancel.spec.ts racing three waitFor at 8 s each, and the config caps workers at 2 with a 10 s expect timeout — it is a bound on how long an answer may take, not a sleep, but on a saturated host 8 s is tight and is worth revisiting if it ever flakes. Process note, said plainly: my first load proof ran the api suite while dev-qa’s own api run was going and my old compose stack was still up; dev-qa’s run was OOM-killed (137). Stacks are down, and the re-run used the sc-heavy.lock rule: one heavy run, mine, held under the lock. |
docs/05-union-rules.md §6), with a practitioner.docs/10-testing.md §3) written or reviewed by a human, not only generated. Waived by the project lead on 2026-11-20 (#24): AI verifiers review them instead; no human review has taken place. Restore for a pilot.docs/08-deployment.md still describes nginx listening on 8080 inside the web containerWeekendRotationProbeTest ran the real engine over eight weeks: advancing 1 gives U-12 WARN (31 h break = 1 day off); advancing 2 gives U-12 WARN (16 h, 0 days) and U-14 WARN (56 h in 168 h, 7 shifts). A fixed pair is clean but pins weekends. The person/lead then asked for a pair moving earlier; the probe showed once per pay period is clean at exactly 80 h every period (the retreat overlaps a day, so 10 workdays remain), while moving every week warns under U-12. | Corrected: made ROTATING_5_2 the 8 h default (weekends rotate, no warnings, 80 h/period), kept 5_ON_2_OFF and 7_ON_3_OFF selectable, and recorded the probe results in ADR-026. Rejected: my own “advance by 2” design (it breaks U-12 and U-14) and a fixed-pair-only default (it does not rotate weekends). |
| 72 | 2026-11-21 | Planner generator and commit path (phase 3, 2a62682) | The Must flow on 100 officers: seven 14-day periods from 4 Jan 2027, a fixed night group per unit (volunteers senior-first, then newest-first), one shift per pattern day, every proposal through RuleCheckService against the draft plus the committed history. Generate takes 1.4 s; PlannerApiTest 9/9 (determinism, whole-draft no-Block and 80 h, newest-first, commit/audit, stale, locked, discard, authz, board read). | Corrected by tests, three times. (1) Preference NONE was passed as a block name, so those officers were skipped in the pattern pass; mapped to DAY. (2) Night fills were assigned to day-pattern officers, whose next day then blocked and lost hours; a fixed night group keeps the 5/2 hours and the newest-first property. (3) The scorecard’s newest-first check counted an officer who was off that day or would fail the engine; it now checks the pattern day and asks the engine. Performance: 1.4 s for 100 officers x 98 days even with per-proposal engine checks, so no solver and no cache were needed. |
| 73 | 2026-11-21 | Planner review fixes after review-r2’s SAFE WITH NOTES at 2a62682 (ec39e43) | Four notes: stale V5 counts, 21,556 scorecard warnings, no 2027 pay periods, weak mutation. | Fixed all four. (1) app_user 8 / roles 10; AuthApi test renamed and 8. (2) Warnings: 21,556 was the seeded history re-counted against each proposal; baseline subtraction leaves 130 U-12, which the all-phase probe traces to the Sun-Mon wrap (40 h = 1 day off). Rotating cannot be both warning-free and 80 h for every phase, so the default became fixed 5_ON_2_OFF with staggered pairs (0 warnings, 80 h, some officers always work weekends, stated in ADR-026); ROTATING_5_2 is selectable with its warning. One fixed block per 8 h officer removed 7,573 U-02 block-switch warnings. (3) Commit creates seven 14-day pay periods and 42 unit schedule periods; a test locks one and a second commit gets 409. (4) A seeded late shift 4 h before an officer’s first draft shift: the draft must not place them within 8 h. Mutation: forcing the verifier to allow made PlannerApiTest red (whole-draft U-01, commit 422), then green after restore. |
| 74 | 2026-11-21 | Rotating default chosen by the person (option F), 7b315be/f6ee8cd | The person chose ROTATING_5_2 with a 3-day wrap break: 72 h changeover, weekends rotate, 80 h otherwise. Implemented with scorecard note, quarter-hours report line and tests (no Block, U-12/U-14 at most one each, hours 72/80, weekends 22). | Correction the stronger test forced: option F’s probe filtered WARN only, but U-08 is a BLOCK. For some phases the pattern creates a seventh consecutive day; the engine refuses that shift, the generator leaves it out, and those officers have a second 72 h period (five or six 80 h periods), and the U-14 count is 38 vs U-12 78. Docs and the scorecard now say one or two 72 h periods instead of claiming one; the stored draft still contains no Block. Rejected: hiding the skipped shift or loosening U-08. |
| 75 | 2026-11-21 | FTE-aware planner pool, eaf4df6 (p3-api-fte) | Person GO on 100 full-time + 50 casual (FTE 0.4-0.8) filling gaps/nights; employee.fte existed but was unused. Implemented full-time pattern + casual fill pass (nights first, newest-first, target FTE x 80/period, engine-verified, fixed iterations), scorecard fteBands and the no-guarantee note. | Numbers: synthetic 100 FT + 50 casuals, requirements fixed, gaps 617 -> 223 of 1,764 (35.0% -> 12.6%), 8,986 assignments, 132 ms; every casual at/under target (bands 560/448/280 quarter hours). The 100-officer default is unchanged (571 gaps, 121 warnings, 549.6 average quarter hours). Rejected: giving casuals a fixed 5/2 pattern (they would lose the fill-pool flexibility and exceed target); loosening U-08/rest to fill more. Dataset integration (reset dataset 150) is dev-build2 and not built here. |
| 76 | 2026-11-21 | dev-design’s planner review: M1 already-committed window and M2 real compare, f3399e1 | M1 was a real refusal (“5624 shifts are now blocked”) with an empty failure list; M2 returned two rows and hard-coded board gaps 0. M1 now answers 409 problem+json, reason ALREADY_COMMITTED_WINDOW, with a plain sentence naming the commit date/author and pointing at Reset the demo data; a genuine Block at commit still lists every failure. M2 computes both sides: coverage gaps, unfilled gap hours, shifts, officers, planned hours, plan-added warnings, preferences met and weekends min/avg/max, each with direction, plus one gap row per unit. Board measures come from the committed shifts through ScheduleQuery (the board’s code); draft measures from plan_draft_assignment/plan_draft_gap. After the commit the columns are identical (576 gaps and the same shifts/officers/hours/weekends). Also fixed the test structure: the locked-period check moved inside the commit test (insert LOCKED period, 409, delete, commit 200) and the seeded late-shift test generates its own base draft instead of depending on a previous test’s. PlannerApiTest 12/12. |
| 77 | 2026-11-21 | Coverage measured in absolute time on the board and in the plan, e003c7b | The board counted a 23:00 shift only in the hour before midnight, so every NIGHT block was short: 588 of 588 unit-nights, board 1,058 short block-days against the plan’s 571. Both now use CoverageCalculator (NIGHT D = 23:00 D to 07:00 D+1). Same committed plan: board 1,058 -> 576 and plan 571 -> 576 (the plan now sees five night block-days the old day-modulo count missed), identical per unit and per block (DAY 158, EVENING 312, NIGHT 106). This is the definition docs/06/07 now state. |
| 78 | 2026-11-21 | Reset lock fixes: ordering and cross-thread release, 78aacf6, 8f9f347 | The first fix released the lock before publishing DONE/FAILED. The deeper bug: DemoOperationLock was a ReentrantLock acquired on the Tomcat request thread and released on the reset’s virtual worker, where isHeldByCurrentThread() is false, so the release did nothing; a second reset only worked if Tomcat reused the same request thread (reentrant). It is now a Semaphore permit with an atomic held flag: release from any thread, a double release cannot add a permit. DemoOperationLockTest 2/2; DemoResetApiTest resets twice (~5.0 s each) with the same checksum. dev-qa reproduced the flake on p3-int a65f6c0; p3-api 6e325e6 carries the fix. |
| 79 | 2026-11-21 | Contradictory time-entry body, 4401c09 | dev-qa’s probe: PUT /time-entries with workedAsScheduled:true and actual times returned 200, recorded the rostered times and silently ignored the pushed end time. It is now 400 problem+json (“Send either workedAsScheduled or the actual times, not both”), checked before anything is written; the test also asserts no time entry was recorded. PayrollApiTest 18/18. The engine still uses the rostered end for rest/U-04/U-05 when an extension is recorded; that remains a documented limit (post-freeze: fact builders use the actual end where an entry exists). |
| 80 | 2026-11-21 | Only 12 h officers work nights, e9f1b10 | Person amendment 13. The generator no longer puts an 8 h officer on N8, and the block grouping only builds DAY/EVENING groups for 8 h staff; 12 h A12 keeps the 100 seed’s nights. An 8 h NIGHT preference is shown unmet with “only 12-hour officers work nights” in /planner/preferences and the scorecard nightPolicy. Honest cost: default 789 gaps of 1,764 (DAY 171, EVENING 30, NIGHT 588 - every unit-night short), warnings 117; the 100 has 14 effective 12 h officers (10 x 12 h + 4 x 16 h planned as 12 h) for 19 night posts a day. The FTE pool no longer enters assignBlocks/rephase (before: adding casuals made the plan worse, 689 -> 784); with 8 h-only casuals it fills all 101 day/evening gaps (689 -> 588) but cannot touch nights, and every casual stays at/under target. PlannerApiTest 12/12, PlanGeneratorFteTest 1/1. |
| 81 | 2026-11-21 | V6: D12/N12 templates and rule-set v2, 8c1f58e | Person GO after the item-20 numbers. V6 adds D12 07-19/N12 19-07 and publishes baseline rule-set v2: U-02 afterShiftKind becomes (D8|E8|N8|A12|P12|D12|N12) (additive), U-10 is “overnight 19-07”; ShiftFact/ConsecutiveRunFactBuilder recognise the kinds. No unit flag changes: ADM/ESC stay allows_12h=false in the 100 seed, and the 150 provider will set them at seed time. Six new boundary tests (U-02 after N12 into D12, U-09 4/5 D12, U-10 4/5 N12, U-14 48/60/68 with midnight crossing, U-05 16/16.25, nominal 720). Green: rules 112/0, drift 1/0, rule API 18/0, reset 2/2 with checksum 3390148255...6539, no D12/N12 in the 100 roster, ADM/ESC flags false, lock test 2/2. Review-r2 starts here. |
| 82 | 2026-11-21 | Separate D12/N12 crews and paired 12 h phases, a803215 | The planner reads rotation_pattern.code through the employee’s crew: N12 is night/evening, D12 day/evening, D8 day only, E8 evening only; an 8 h officer is still never N8; a D12 officer never gets an N12 shift. 12 h phases are paired (j and j+4) and keyed by unit+crew, so a crew of 2p covers exactly p posts every day instead of both on for four and both off for four. That also improved the 100 seed’s A12/P12 day cover: gaps 789 -> 727 (DAY 171 -> 109, EVENING 30, NIGHT 588), quarter hours 550.6 average. PlanGeneratorCrewTest: 4 N12 + 4 D12 + 4 D8 + 2 E8, 196 N12 on 98 nights, 196 D12, no N8/L16/A12/P12, no mixed crews, night gaps empty; scorecard n12Officers=4, n12NightShifts=196. |
| 83 | 2026-11-21 | Docs: night rule, V6, crews and the 16 h wording, 7fb06e2 | ADR-027 records V6 and the isolation; ADR-026 now says only 12 h officers work nights, D12/N12 crews for the 150 and 727 default gaps. docs/05 U-10 is 19-07; docs/06 has the templates, rotation codes and absolute-time coverage; docs/07 documents ALREADY_COMMITTED_WINDOW, the compare rows, nightPolicy/n12* and the 12 h/16 h rules; docs/10 adds the D12/N12 boundary matrix plus night/coverage/compare/reset/time-entry cases. A “16 h shift” is documented as a 12 h shift plus ~4 h overtime extension in ADR-026, docs/10, HANDOFF and the demo script. |
| 84 | 2026-11-21 | dev-qa’s JWT tamper failure diagnosed as a test flake, not a product hole | dev-qa’s p3-int b896e2a run had JwtServiceTest.rejectsATamperedSignature fail once. The test replaced the last two base64 characters of the signature. The final character of a 32-byte HMAC carries only 4 significant bits (2 padding bits), so some replacements decode to the same signature bytes; a correct constant-time verifier then accepts the token. That is about a 1-in-1,000 flake, not a signature bypass. The test now flips the first signature character, which is fully significant, and the comment says why. JwtServiceTest 12/12. No product change; the service still compares decoded HMAC bytes with MessageDigest.isEqual. |
| 85 | 2026-11-21 | Test-container flake fix and the final count, 31fbd3a | review-r2’s full run on p3-actuals hit ‘sorry, too many clients already’ at sc_test_26; an earlier random run hit a Postgres SSL handshake while contexts loaded. PostgresTestSupport gives every Spring context its own database, Spring’s context cache keeps those contexts and their Hikari pools (max 4) alive, and the shared container’s default max_connections=100 was below 26+ contexts x 4. The test server now starts with max_connections=400, and local test URLs set sslmode=disable (production TLS unchanged). No retries, no class-order dependence. Final full clean-worktree runs at 31fbd3a: 393 = 112 rules + 27 infrastructure + 254 api, 0 failures/errors/skipped, default order and random seed 20261121, twice each. Earlier at 64a9bc1 both orders were green as well; the two extra runs are the flake verification. |
| 86 | 2026-11-21 | The committed plan stays readable and compares with the current board, 204cc08 | dev-design’s M-moderate: after commit GET /planner/plan had state: NONE, draft: null and only lastCommitted, so the web lost the scorecard/gaps/warnings tabs. It now reports state: COMMITTED and committedDraft (the same DraftSummary shape: id, version, seed, pattern8h, status, createdAt, createdBy, generatedMs, scorecard); lastCommitted stays. The read-only endpoints gaps/warnings/schedule/coverage/compare already accepted any plan_draft id and are now covered by a test for the committed id (PLANNER only; 401 no token, 403 supervisor). Compare adds draftStatus and basis: for COMMITTED it says the comparison is with the current board including supervisor edits since the commit; for DRAFT it says the last committed plan/seeded roster. The test cancels one committed shift, sees only the board column move (board -1, draft unchanged), restores it. PlannerApiTest 13/13. Exact JSON sent to dev-build2. |
| 87 | 2026-11-21 | V6 governance note and the U-10 wording, b9725f9 | review-r2’s verdict (SAFE WITH NOTES): V6 seeds rule-set v2 directly as PUBLISHED, like v1, with created_by/approved_by NULL, a recorded change_reason and no audit_event row. ADR-027, docs/04 §6 and BUILD_RECORD state that as the baseline-seeding exception; later versions go through maker/checker. U-10’s message is now “overnight (00-12 or 19-07)” because the counter still includes A12 00-12 night-block shifts as in v1; behaviour is unchanged. ReferenceDataMatchesRuleRowsTest 1/1, RuleSentenceTest 2/2. |
| 88 | 2026-11-21 | Dataset selector and the 120 provider, 35c9fdc (p3-api-ds) | Person option B: 100 full-time crews + 20 casual relief officers = 120. The reset now selects a provider: 100 wraps the existing DemoDataGenerator unchanged (checksum 3390148255...6539, payroll golden unchanged), 120 sets ADM/ESC allows_12h=true at seed, writes D12/N12/D8/E8/CASUAL/relief rotation patterns, 38 N12 + 54 D12 + 3 E8 + 5 relief full-timers (newest in N12), 20 casuals (8 N12-capable, 12 8 h, FTE 0.4-0.8), qualifications (all CTL CONTROL, all ESC ESCORT, FIRST_AID first two A/B/C N12/D12 plus E8), deterministic preferences, 35 days of history and periods. Reset 120 twice gives checksum 82b19cf814acde5c5740f9a9aa1162e61d4b7f5598848f99861d2f4ea66732ca in ~1.4-2.7 s; reset 100 restores 3390148255...6539 and the V3 flags. /version lists [100,120], unknown is 400, status/audit carry the dataset. The 120 plan: 38 gaps of 1,764 (2.2%), 7 warnings, ~0.9 s, zero Block. Qualification measurement: 0 failing block-days on 120, 346 on the 100 seed (A/NIGHT 98, B/NIGHT 13, C/NIGHT 13, CTL/DAY 1, CTL/NIGHT 98, ESC/DAY 24, ESC/NIGHT 98, A/EVENING 1) - the planner does not enforce qualifications. Planned leave is now an input (item 23): POST /planner/absences inserts a future absence, the planner skips that officer and reports the absences scorecard line; no leave management. See row 90. Also adds the commit 428/412 assertions and RotatingBreakProbeTest (11 deterministic cases). Evidence: Demo120ResetApiTest 2/2, PlannerApiTest 13/13, RotatingBreakProbeTest 11/11. |
| 89 | 2026-11-21 | Final phase-3 count at 35c9fdc | 407 = 123 rules + 27 infrastructure + 257 api, 0 failures/errors/skipped, default order and random seed 20261121 from a clean worktree. The count adds 11 rotating-probe cases and the two 120 reset tests to the 394 tested at b9725f9. |
| 90 | 2026-11-21 | Fix the 120 commit and the pay-period overlap, abbaaf7 | review-r2 found every 120 commit 409: the provider seeded 28 Dec-10 Jan, overlapping the planner’s first 2027 period 4-17 Jan, so ensurePlanPeriods hit pay_period_no_overlap (23P01). The seed now matches the 100 layout (23 Nov/7 Dec/21 Dec; last ends 3 Jan). ensurePlanPeriods skips only an identical period and refuses any other overlap with 409 PAY_PERIOD_OVERLAP; 23P01 on that constraint maps to .../pay-period-overlap instead of “officer already has a shift”. Real flow: reset 120 -> generate (38 gaps/7 warnings/zero Block) -> commit 200 with 5,103 shifts -> supervisor board 4-10 Jan 77 shift rows; LOCKED first period 409 LOCKED_PERIOD; reset 100 -> commit 200 with 6,586. 120 checksum is now 82b19cf814acde5c5740f9a9aa1162e61d4b7f5598848f99861d2f4ea66732ca (period dates changed), reset twice 1.4-2.7 s. Tests: Demo120ResetApiTest 2/2, PlannerApiTest 13/13 (428/412/overlap), ApiProblemAdviceTest 8/8. |
| 91 | 2026-11-21 | Planned absences are a read-only input (item 23), abbaaf7 | POST /planner/absences {employeeId,date,type} (PLANNER only; SICK/VACATION/OTHER; inside the quarter) inserts a future absence. The next generate loads absences overlapping the quarter and skips that officer on those dates; a relief/casual covers or the gap stays visible. The scorecard absences carries officers/days/coveredByRelief/uncovered and one plain line. Same seed + same absences reproduces the plan; no absences returns the baseline; the 120 seed still seeds no leave, so the checksum is unchanged by this feature. No screens or approval workflow. PlannerAbsenceApiTest 2/2 (skip, coverage, scorecard, determinism, baseline, 401/403/400). |
| 92 | 2026-11-21 | Final phase-3 count at abbaaf7 | 410 = 123 rules + 27 infrastructure + 260 api, 0 failures/errors/skipped, default order and random seed 20261121 from a clean worktree. Adds the 120 commit/lock/board tests, the pay-period overlap mapping, and the two absence tests to the 407 at 35c9fdc. |
| 94 | 2026-11-21 | Candidate-2 API fixes: 120 names, F5/F6/F9, 6a6a667 (p3-api-ds2) | D-1: the 120 provider now draws from DemoNames deterministically without duplicates; no FirstN/LastN on the board/commit dialog. The 120 checksum includes the identities (the 100 roster checksum is names-blind and stays 3390148255...6539): 82b19cf814acde5c5740f9a9aa1162e61d4b7f5598848f99861d2f4ea66732ca, stable across resets. F5: U-14’s warning group is “Week over 48 hours”, not the 60 h Block. F6: Compare preferencesMet now uses the scorecard’s per-criterion definition; the test asserts equality on the same plan. F9: after a commit /planner/preferences evaluates the committed plan and shows MET/PARTLY/NOT_MET with unmet reasons instead of NO_DRAFT. GAPS120 is exactly {ESC, EVENING, 38}: ESC has only D12/N12 and no E8, so its 19-23 evening is deliberately thin; stated in ADR-026/DATASET120-SPEC. Carries the absence idempotency nit and V7 pay-period index from 739aa43. PlannerApiTest 13/13, Demo120ResetApiTest 2/2, PlannerAbsenceApiTest 3/3. |
| 95 | 2026-11-21 | F10: one template classification for preferences, 3124c2e (p3-api-ds3) | PlanGenerator.nominalMinutes/preferenceOf and the PlannerService copies had no D12/N12 case, so 12 h crews scored as 8 h DAY: scorecard preferences.met 68 vs Compare 195 on 120 and every N12 officer appeared unmet in F9. ShiftKinds now maps a template’s duration to 8/12/16 and its start hour to DAY 07, EVENING 12/15, NIGHT otherwise; the generator scorecard, Compare stats and /planner/preferences all use it, and the code lists/copies are gone. D12 is 12 h DAY, N12 is 12 h NIGHT, A12/P12/L16/D8/E8/N8 unchanged. Test first: PlannerPreferenceKindsTest was red (68 vs 195) and is green: scorecard.met == compare.preferencesMet; an N12 officer who asked 12 h NIGHT is MET; a D12 officer who asked 8 h evenings is NOT_MET with plain reasons; nights bands/n12 count/newest-first still valid. Placement is untouched: 120 stays 38 ESC/EVENING gaps, 7 warnings, zero Block, commit 5,103; 100 unchanged. |
| 96 | 2026-11-21 | Phase 3 corrections and rejections, where the work disproved an earlier claim | Re-read ADR-026, the probe outputs and the demo walks against the final code; compared each earlier statement with the evidence and the final counts | Corrected: (1) the lead’s 7 on / 3 off default was replaced by ROTATING_5_2 after the weekend-fairness probe; 7/3 stays selectable and warns honestly, fixed 5/2 pins weekends, and the person chose option F at 01:56Z. (2) The claim that the rotating default is warning-free was wrong: every phase reaches the Sun-Mon wrap, and option F carries about one U-12 and one U-14 warning per officer per quarter plus one or two 72 h periods; the scorecard and ADR-026 now say so. (3) “The gaps are mostly sizing” was wrong: the measured 100 plan is 727 gaps of 1,764, every unit-night short (14 effective 12 h officers for 19 night posts); the 120 plan’s 38 gaps are all ESC evening by construction. (4) The dataset was called 150 in early notes; the person chose 120 (100 full-time + 20 casuals) at 04:19Z, and the provider, checksum and docs now say 120. (5) The phase 3 test counts in README, PROGRESS and traceability went stale (381, 410, 411, 412); the final independent count is 422 = 123 + 27 + 272 at 5d0f810, and the docs now use it. Rejected: adding the two extra patterns to this release (each carries warnings by design and a generator change needs another verification round; decision 15); treating the 60.00 h U-14 boundary as a Block (the code passes at the limit and blocks above it, like every other limit; the docs were reworded, decision 16). |
| 97 | 2026-11-21 | The two extra selectable patterns, measured and not added (decision 15), and the U-14 boundary wording (decision 16) | Probe in a scratch worktree off p3-api-ds3, all phases, 7 periods from 4 Jan 2027, 21-29 Dec history carry; SelectablePatternProbeTest in the rules module (p3-api-pat 3f94937, not merged). Real engine. | (a) 8 h 7on/3off + 7on/4off: U-12 and U-14 in all 21 phases, no Blocks, 56-88 h per period, quarter average 74.67 h/period, weekends 18/18.67/20, about 6.7% fewer shifts than 5/2, so gaps open. The row’s “40 h/week” is 37.33 h/week. (b) 12 h 4on/2off + 4on/3off: U-14 in all 13 phases at exactly 60.00 h in a 168 h window (60.00 is a WARN; the Block is above), no other warnings, 96-108 h per period (16-28 h overtime every period), weekends 16/17.23/18, about 23% more shifts than 4/4. Both are Block-free; neither was added. U-14 boundary: the row has maxHours 60 and the template blocks only when hours are above 60, so exactly 60.00 is a WARN; docs/05 and docs/10 now say “warn above 48 h, block above 60 h”, and the exact-60 case is pinned by HoursAndRunsRulesTest#u14CountsN12AcrossMidnightAndBlocksAboveSixtyHours. |
| 98 | 2026-11-21 | review-r3’s security findings P3-1..P3-5, fixed on p3-sec 74a58c0 | Tests first, run on b6e120a and red there: PlannerDiscardRaceApiTest, ActualTimesInRulesTest#aShortActualCannotRelaxTheRestOrHoursBlock, PlannerAbsenceApiTest#concurrentAbsencesForOneOfficerDayLeaveOneRow, DemoResetFailureTest; P3-4 verified with docker compose config. The four red failures were: discard 200 DISCARDED while commit 200; U-01 NONE after a 1-minute actual; 2 absence rows for one officer-day; reset stuck RUNNING after an Error. All green on p3-sec. | P3-1: discard now takes the demo operation lock, the discard UPDATE is status-guarded, and the commit’s final UPDATE is status-guarded with a rowcount 409 that rolls the transaction back. P3-2: the rule facts use the envelope of roster and actual (earliest start, latest end), so an actual can lengthen but never shorten; one resolver (RuleCheckService.history) serves the board and the planner, and the old aShorterActualAlsoMovesTheRestWindow test was deliberately replaced because that was the bug. P3-3: V8 adds a partial unique index on planned absences with a dedupe keeping the earliest row; the insert uses ON CONFLICT, returning 200 for the same type and 409 for a different one. P3-4: the compose web port is bound to 127.0.0.1, not 0.0.0.0. P3-5: the reset catches Throwable, releases the permit in finally, sets FAILED with a generic message and logs the detail. Full API suite at 74a58c0 (author, clean worktree): 425 = 123 + 27 + 275, 0 failures/errors/skipped, default and random seed 20261121; web 277. Dev-qa verification is pending; the nits were not taken. |
| 99 | 2026-11-21 | Preference multi-select on p3-pref-api ca09b20 (person 2026-11-21) | The person asked for any mix of Days/Evenings/Nights. Tests were written first on c9ac073 and run in a detached worktree: PreferenceMultiSelectApiTest failed because timesOfDay was not part of the request/response at all, and PreferenceTimesMigrationTest failed with column "time_of_day" still present / times_of_day missing. | V9: officer_preference.times_of_day text[] NOT NULL DEFAULT '{}', backfilled from the old single value (NONE/null to {}), element check DAY/EVENING/NIGHT, old column dropped. /me/preferences and /planner/preferences carry timesOfDay only; the old timeOfDay is accepted for one release and timesOfDay wins if both are sent. PreferenceTimes is one shared matcher: canonical order, any-match, night volunteer, ranking by earliest chosen part, the 8 h night block. The generator scores one time criterion per non-empty set and counts it met when every shift matches any chosen part. The 120 seed adds six mixed sets on crews whose placement does not depend on the extra part, so the plan stays 38 gaps / 7 warnings / 5,103 shifts / 107 officers; checksums unchanged. Red evidence: the two classes above on c9ac073; green: the same plus PreferenceTimesTest, PlanGeneratorPreferenceTest and the V9 backfill. |
| 100 | 2026-11-21 | Coverage extraPercent and the Block sentence, d40ee94 and 05c6398 (observations 31 and the rule wording) | Red first on c9ac073: CoverageExtraPercentApiTest got extraPercent = null and RuleSentenceTest#anAcknowledgeBlockSaysItCannotBeSaved still read “must acknowledge it before the change is saved” for U-08. | Coverage: each week carries extraPercent = extraHours / requiredHours * 100 (0 if none), and axisFrom now includes scheduledPercent - extraPercent so the regular segment cannot be clipped. A SQL test sums weekly extraHours and compares it with the non-cancelled EXTRA/overtime-offer assignment hours in scope and range; it is scheduled extra-shift hours, not payroll overtime. Sentence: a Block with ACKNOWLEDGE policy (U-08/U-09/U-14) now says it cannot be saved and has no override; Warn rows keep the acknowledge wording. Wording only; no rule severity changed. Both green after the fix. |
| 101 | 2026-11-21 | Option C: the shift pattern is per officer, 34aec88 on p3-pref-api (person 2026-11-21 17:44Z; web 8c16049, final p3-pref tip at handover) | Red first on the parent: OfficerPatternApiTest found no pattern field on the preference rows, and OfficerPatternMigrationTest failed with column "shift_pattern" does not exist; without the column the generator/roster/scorecard paths could not run. | V10: employee.shift_pattern text NOT NULL DEFAULT 'ROTATING_5_2' with the three 8 h codes checked; plan_draft.pattern8h nullable. The column is the 8 h pattern; a 12 h officer’s 4-on/4-off cycle stays derived from the crew rotation_pattern row, so there is one source and no drift. API: every preference row carries pattern, patternWords, patternEditable; PUT /planner/preferences/{employeeId}/pattern changes an 8 h officer only, with plain 400/404 refusals; a generate with no pattern8h uses each officer’s value and stores null, while the old parameter still overrides for one release. Generator: works() resolves per officer and phases are staggered per pattern cohort, so rotating, fixed and 7/3 officers sit side by side; the same verifier still blocks a bad proposal. Proof: the 120 draft is 5,103 rows e8b29ce6…fe9d31 and the 100 draft 6,586 ec337014…409e1b, both shift-for-shift c9ac073 (38 gaps / 7 warnings / 107 officers on 120; 100 unchanged), pinned in Demo120ResetApiTest; checksums and payroll golden unchanged. Deviations: the optional mixed 120 seed was not added (it would move the gate numbers; mixed cohorts are covered by PlanGeneratorPatternTest); the fixed code stays the existing 5_ON_2_OFF; no draft-staleness flag exists, so a pattern change affects the next generate exactly like a preference change. Author run: 444 = 123 + 27 + 294 in the default order, web 290 (dev-qa runs both orders); gate pending. || 102 | 2026-11-21/22 | Release 3: dated unit closures, relief and staffing, p4-unit code tip ee4020c |
Red on da8f105: the new migration test found no V11 tables/function, the Units/closure/staffing endpoints were 404, and the mid-quarter close could not run. Red-first test files were then written on the branch. |
V11: unit_availability, unit_staffing, staffing_setting 0.20 and unit_active_on(unit, day) as the one source. ActiveUnits: closures/today/closed dates/labels; converted the planner generator, board, roster, draft coverage, coverage report, wall display and unit list; history readers intentionally unchanged. Generator: closed unit skipped per day; full-time closed-unit officers are relief to other units after own staff/casuals, home-unit/seniority/employee order, 12 h only into allows12h, same verifier; closed-unit casuals remain a fill pool. API: units/today/closures/preview/CRUD, flagged future published shifts, staffing periods split at every closure boundary with the 12 h/8 h breakdown, allocated and leave writes, closedReason on the payloads. Identity: 120 5,103 rows e8b29ce6…fe9d31 (38/7/107) and 100 6,586 ec337014…409e1b unchanged with no windows; the mid-quarter Unit C test has no C roster/gap after 2027-02-15, bit-identical days before, relief, no Block, determinism and a reopen. Deviations: no closed-unit casual relief; no qualification check invented; the staffing formula is the design’s mapping, stated in ADR-027. Author run 450 = 123 + 27 + 300 default order, web 304, audit codes 49 agree; dev-qa gate pending. |
| 103 | 2026-11-22 | Dataset 150 (120 FT + 30 PT, 20% leave), p4-unit 81d71f5 |
Read STAFFING-SWEEP.md and its loader; the first provider run gave 195 gaps because the leave timestamps were 06:00 local, which loadLeave counted as two days, so the fix is local-midnight start/end and one day per absence. |
Provider: 120 FT (N12 50, D12 67, E8 3; A25 B24 C22 ADM13 CTL14 ESC22) + 30 PT (12 N12, 18 8 h, five per unit, FTE 0.4-0.8), ADM/ESC 12 h, 35-day history, 20% leave in deterministic blocks. Pinned: checksum 2e6cd938…d7f8, fingerprint a1e093f7…838030, 100 gaps / 1,764 (5.7%), 39 warnings, 5,414 shifts, 150 officers; the sweep’s mean is 88.6 (5.0%), difference reported. Isolation: 100/120 unchanged; the 120 dataset list assertion now includes 150; Unit C close on 150 passes. Rejected: tuning the leave placement to match the sweep’s mean or hiding the 5.7% behind the tile. |
| 104 | 2026-11-22 | Release 4 items #20, #14, #17, #10 and #16 on p5 (API tip ffecd62, web c13a495 then the gate fix e9e9ff3, merged at a23fa47) |
Read the brief and decisions first; #20 checked and found already fixed in release 3 (05c6398), so only a pin over all Block + ACKNOWLEDGE rows was added. Red-first work: the NOT_ROSTERED headline test derived its expected asked count from the database, the U-16 boundary test failed until the fact carried nightShift, and the v3 seed test failed until V12 existed. |
#14: a shift-less officer with a preference reads NOT_ROSTERED; scorecard/Compare count rostered officers only, so 120 is 196/214 (92%), the same in both places; the plan is untouched. #17: the demo lock returns an owner token and only that token releases; the reset keeps the pre-DONE release and the finally is a no-op, so a stale release cannot free the next operation’s permit. N-2 was inspected and deliberately left (clean-then-migrate; About shows FAILED; a retry recovers) because fixing it is not trivial. #10: V12 publishes rule-set v3 (v2 + U-16, WARN/ACKNOWLEDGE) for an 8 h officer on a night shift; the shift-length fact carries the night flag, the template fires on a 480-minute night shift, the validator accepts exactly one of allowed lengths / unit flags / night warning, and v2 stays as history. #16: the last stale web fixture strings moved to “Week over 48 hours” on the web branch; docs already said warn above 48 h, block above 60 h. Rejected/corrected: no code change for #20; N-2 not fixed; one OvertimeApiTest expectation was corrected because an existing N8 now makes that officer a WARN candidate for a later shift (reported, not hidden). Counts: 460 = 127 rules + 27 infrastructure + 306 api, 0 failures/errors/skipped; web 316; audit 49; 100/120/150 checksums, plan fingerprints and payroll golden exact. Dev-qa’s gate then found a pre-existing Rules route shadow: the literal /rules/:version/shift-types route won without a table param, so the Shift types table (and U-16) was unreachable; dev-build2 removed it red-first with a router test, and the merge is part of this handover. |
| 105 | 2026-11-22 | Release 5 #19: retire L16, p6 API tip 0a07bf1 |
Read the L16 impact note and the GO. Red-first work: the seed test expected L16 > 0, the PC-03 self-check expected a 17 h assignment, and the reference test expected eight templates; each failed before the change. Re-measured the whole 100 set on a private stack before re-pinning (milestone (a)). | Seed: the 100 generator no longer makes the 16 h swap (270 -> 0 L16 rows); L16 is removed from the generator maps; PC-03 is P12 12:00-24:00 on 3 Nov + a 5 h actual to 05:00 (17 h) for E-047 Pia Nguyen, still U-05 with the emergency override. V13 sets L16 inactive; old DB rows survive and L16RetirementMigrationTest proves it; new assignments/open shifts get a plain 400; web pickers exclude it while history chips stay. Pins: 100 checksum 01b05436...322e58; golden 9f2d51b3...04ff (1,037 rows, 8,197.60 h); plan fingerprint unchanged ec337014...409e1b (6,586 / 727); warnings 117 -> 135 (U-12 78 + U-14 57) because removing L16 history removed U-14 baseline keys and exposed 18 real plan warnings, measured on old and new images. 120/150 exact. Corrected: the “fingerprints only if the planner used it” assumption was wrong in the impact note for history; measurement showed the 100 plan itself unchanged. Rejected: deleting the template (option c), re-pinning before measuring, and hiding the warning move. Author run: 462 = 127 rules + 28 infrastructure + 307 api, 0 failures/errors/skipped; web 318 at the p6-web merge; audit 49. |
| 106 | 2026-11-22 | Release 5 gate finding 1: restore PC-01 and Tara after L16 removal | dev-qa found the e2e E1 override button and the decline spec’s missing free slot. Re-ran the rule previews against the actual seed: PC-01 blocked only U-01/U-05 (U-14 warn at 52 h), Tara had no block-free D8/E8/N8 in 23-30 Nov. | Seed repair: Nia Thompson Mon 16 E8 -> P12 (+4 h, actual moved to 12 h), Thu 19 E8 added (+8 h), and her previous Sat 14 removed; the saved 168 h window is then 56 h and the Sat 21 D8 is 64 h, so U-01+U-05+U-14 block (U-08 also fires: the proposal connects to an 8-day run). Tara’s Sun 29 D8 removed, restoring a block-free Sun 29 D8 (also Sat 28 E8/N8). Self-check: new checkPc01BlockSet (must contain U-01/U-05/U-14; the real set also has U-08) and checkTaraFreeSlot (Sun 29 D8 must have no Block) run at generation. Pins: 100 checksum 01b05436… -> 4156077d…; golden 9f2d51b3… and plan ec337014…/6,586/727/135 unchanged; 120/150 exact. Audit: self-check covers PC-01..PC-09; full suite covers T1-T14. |
| 107 | 2026-11-22 | Release 6 #6 Option A: qualification coverage card, p7 API tip da08dde |
Read P7-RELEASE6-BRIEF and P6-PLAN-6; the test’s qualification query became the production measurement. Reconciled the requirement count by SQL: 15 rows with min_with_qualification > 0, not 13, so checked = 1,470; measured 150 = 103, not the assumed 0. | New QualificationCoverage: loads active unit_requirement rows with a qualified minimum, the draft assignments and employee_qualification; counts block-days where the qualified on-duty count is below the minimum. PlannerService puts the card on the scorecard after PlanGenerator returns; PlanGenerator and every placement path are untouched. Date-aware closures via ActiveUnits; relief counted in the placed unit with the officer’s qualifications; valid_from not read and stated; qualificationPolicy removed. Sentences: 0/1/N forms from dev-design; from/to sent. Measured: 100 346/1,470, 120 0/1,470, 150 103/1,470. Tests compare the card with an independent SQL count on 100/120/150, close Unit C from 15 Feb 2027 and assert 42 checked days/requirement (1,302 total = 1,470 - 3 x 56 closed days; a closure from 1 Mar gives 1,344 = 1,470 - 3 x 42, as gate 6 saw), and pin the scorecard key. Checksums/golden/fingerprints unchanged. Author run 462 = 127 + 28 + 307; web 325 at the merged tip; audit 49. |
2026-11-21: Rules help (observation 29) rebuilt as a dialog on the existing button. Outcomes and usage are fixed copy; the main rules and their limits/results are read live from getRuleSets/getRuleTable for the six published tables, cached once per page load, and rendered without the api’s sentence (it says “acknowledge” for Block rows). The planner sees only outcomes and usage. Tests: PlanningPage.test.tsx (26).
2026-11-21: Coverage chart (observation 31): the scheduled bar stacks regular shifts and the extra-shift share (extraPercent from the api, same required-hours basis), red with a white hatch, legend, one summary sentence in dev-design’s templates, an ‘of which extra shifts’ table column and the summary in the aria label; the separate overtime bars left the Coverage tab and stay on Overtime. Roster tab (observation 32): the selected unit heads the grid and each picker option counts the visible week’s gaps. Tests: CoverageChart, ReportsPage, PlannerRosterTab, PlannerPage.
2026-11-21: Option C web: the facility 8-hour pattern select is gone and Generate sends only the seed; each officer keeps their own pattern. The PlanGenerator/API side is dev-build’s (p3-pref-api 34aec88). Preferences gained a Pattern picker for 8-hour officers (plain words) and read-only crew words for 12-hour officers; the scorecard gained a Shift patterns table with every officer’s words. Tests red-first in PlannerPage and preferences.
2026-11-21: Release 3 web: the Units screen (close from a date, reopen, remove, allocated headcount, all with reasons and the facility-planner-only gate), the Staffing tile + panel (api periods, breakdown How lines, leave allowance dialog, formula in words), the Shifts in closed units card, and the closed-from notes on the roster, board, coverage and wall display. Distinct from the api: the web formats and never computes staffing numbers or closure dates; a closure is read from the api’s today/closures/periods. Tests cover the Units dialogs and role gate, the tile/panel/flagged card, the notes and the wall card, plus a real-api e2e that closes Unit C and plans without it.
| 108 | 2026-11-22/23 | Release 7 #27: planner hand edits in an uncommitted draft, p8 API tip 5c6e922, merged code tip eb7132c | Read P8-RELEASE7-BRIEF, P8-PLAN-dev-build and P8-SPEC. Red first: a characterization test at 84d0ea0 pinned the 100/120/150 checksums, golden, plan fingerprints, row counts and warning totals before extracting the assessor. The first full runs were OOM-killed in the 8 GB Docker VM after ~45 classes; the cause was 26+ cached Spring contexts, not this test, and a fork per class plus spring.test.context.cache.maxSize=1 made the suite stable. | Service: new PlanDraftEditService (preview/add/move/remove) writes only plan_draft_assignment; PLANNER-only, DRAFT-only, If-Match draft version (428/412), draft row FOR UPDATE, demo lock, one edit_plan_draft audit row (ADD/MOVE/REASSIGN/REMOVE), no migration. Rules: the same RuleCheckService seam: Block 422 saves nothing, Warn 422 until acknowledgeWarnings:true; no EMERGENCY override. Recompute: PlanGenerator.assess rebuilds warnings, gaps and the scorecard from the edited rows; PlannerService.recomputeDraft now adds the same staffing and qualification cards as generate (the first pass dropped both, caught by comparing a no-op edit with the generated scorecard key for key). Assignment now carries ShiftKind, so an EXTRA is scored as EXTRA; generation passes ROSTERED and is byte-identical. Views: DraftSummary gains handEdits/editedAssignmentIds, roster shift items gain edited, all derived from audit rows. Evidence: PlanDraftEditApiTest (preview no-op, remove+add fingerprint and scorecard equality, regenerate == unedited, duplicate 409, stale 412, missing 428, non-planner 403, L16 400, closed 409, REASSIGN audit, Wade ESC D12->N8 Block 422, Bram E8 Warn 422 then 200, commit after edits 200 then 409), GeneratorCharacterizationTest green at the tip. Author run 464 = 127 + 28 + 309, 0 failures, default order; web 341/341, build clean, lint 4, audit 50; dev-build2’s real-api spec 209/1 skip/0. Pins exact. dev-qa gate pending. |
| 109 | 2026-11-23 | GitHub Actions CI and loopback dev ports (PR #1, sc-ci): .github/workflows/ci.yml on pull requests and pushes to main (check scripts, web lint/tsc -b/tests/build, API mvn verify via compose api-test), actions pinned by SHA, persist-credentials: false, Maven cache; docker-compose.dev.yml db and api bound to 127.0.0.1 |
Read README §4 and HANDOFF. Web checks and both scripts run locally (341 web tests); CI run green on the PR. Cross-model review found the manual e2e job could not pass on a Linux runner (no commit guard values; a 127.0.0.1 port is not reachable through host-gateway). |
Rejected: the e2e job. Deleted; e2e stays a local run (README §4) and running it on Actions is a follow-up. Accepted: web build, Maven cache, loopback assertion step, checkout credentials off. |
| 110 | 2026-11-23 | Should-fixes S6 and S8 (PR #7, sc-s6s8). S6: the default Dataset 100 gives a planner draft with about 41% gaps (727 of 1,764, mostly nights). The default stays 100; GET /version gains activeDataset (kept in memory, set when a reset finishes, read once from the last demo_reset audit row after a boot, “100” on a database error) and the Quarter plan shows a notice with a link to About & version when it is 100. S8: the record-actual panel offers Other (FR-51), and the time grid, its key, the employee schedule chip and the audit text name it. Decision: “other” absences keep the existing SICK pay code (no OTHER code in the data model), now written in docs/05 §D and FR-51 |
Web lint (0 errors), tsc -b, Vitest (new tests for the notice on 100 and its absence on 120, recording and reopening Other, the Other chip). API: Demo120ResetApiTest checks activeDataset on a fresh boot, after each reset to 120 and back on 100; DemoActiveDatasetTest checks that a second call does not query again and that a database error answers “100” uncached. E2E on an own fresh Dataset 100 stack (/version read activeDataset:"100" before the run): the new spec’s S6 branch ran, and Other was recorded, reopened and reset; planner and planner-a11y (axe) green. A first full API run was OOM-killed by the loaded host (exit 137), so the touched classes were re-run on their own. |
Cross-model review: APPROVE, 3 shoulds and 5 nits; security PASS with one Low. Accepted: an in-memory activeDataset so the public /version does not scan audit_event on every call and never answers 500 (LOW-1, N3); the pay-code note; Other on the employee schedule chip and the key; this row; the /version doc updates. Not done: a test of the RUNNING branch (the status is private and set only by a running reset). The e2e S6 assertion depends on the dataset when other specs reset in parallel, so the evidence is the fresh-stack run above. |
| 111 | 2026-11-23 (24 Nov UTC) | Docs audit phase 1 (PR #13, sc-pr-f, docs only), starting with a literal clean-clone install: a fresh clone of the public repository at a38e452, its own compose project and port (sc-pr-f, 28460), INSTALL followed step by step |
The stack came up healthy in 31 s on a warm cache, /healthz was ok, /api/v1/version answered (and showed buildTime, which INSTALL’s example lacked), the demo data took 6.7 s (README says about 3 s), and the role matrix was probed with signed tokens. Web lint 0 errors, tsc -b, 368 Vitest tests passed. A full API mvn verify was stopped at its 30-minute limit on a host at load 35 (no result), so 468 is a source count. Whole-suite Playwright was not run (114 tests per viewport listed). |
Review: CHANGES (2 must, 8 should, 6 nit), all fixed in the same PR. The audit found three product gaps (the planner’s Reports item, the supervisors’ Employee view, the publish message overstating FR-06); PR #14 fixed them. |
| 112 | 2026-11-24 | PR-H (sc-pr-h): the owner moved demo §4 from the dormant U-03 to U-02 (12 → 14 h). The release gate had found U-02’s live sentence unusable: “After (d8|e8|…), … has to acknowledge it, and the supervisor has to acknowledge it.” The web composed the live sentence for every table with the rest wording, so an edited U-05/U-08/U-11/U-12 also read as a rest rule. The fix makes composeSentence follow the api’s RuleSentence table by table, and the shift-kind select shows a stored pattern as “D8, E8, N8, A12, P12, D12 or N12” (its value unchanged). E3 (spec, keyboard spec, RulesPage tests), docs/10 E3 and demo §2–4 follow |
Unit tests pin the composed sentence to the api’s sentence for all 20 shipped v3 rows, taken from a fresh stack, and check one edit per editable rule plus every result/override combination (no pattern, no repeated clause): web 517 passed in 52 files, lint 0 errors, tsc -b clean. Playwright desktop-datasets 124 passed on a fresh stack; fixtures-mode E3 + keyboard E3 passed. §1–6 walked on a fresh stack (scripted): every figure as listed, payroll sha256 unchanged, v3 → v4 |
Kept the api’s wording (“a D8, E8, N8, A12, P12, D12 or N12 shift”) rather than a new web-only phrase such as “a day, evening or night shift”, so the sentence does not change wording when Build replaces it with the api’s. No api change |
| 113 | 2026-11-24 | PR-H follow-up: the build checklist printed the api’s dry-run row as if from/to were dates (“1 published shifts in A, PASS – WARN, would now break U-02”). The api sends the unit code and the result before and after, counted per officer, so the line now reads “1 officer in Unit A goes from Pass to Warn under U-02” (plural, unit short name from /units with a fallback from the code, results in sentence case); the fixture build report uses the api’s shape. Stale test counts updated after merging PR #18 |
Unit tests for the line (singular/plural, units, every result, fallbacks): web 523 passed in 53 files, lint 0 errors, tsc -b clean. At bf148e3 on fresh stacks: Playwright desktop-datasets 124 passed (built as b5e1ff8, same tree), tablet-datasets 123 + 1 skipped, fixtures 23 passed / 79 skipped; §1–6 re-walked (scripted), payroll sha256 and v3 → v4 unchanged. API 470 in CI |
The coordinator suggested “1 published shift …”; the api counts officers whose result changes, not shifts, so the line says “officer”. BUILD_RECORD’s gate line was updated to the new SHA and counts without adding words |
| 114 | 2026-11-24 | PR-H review (APPROVE, 2 should, 4 nits). S2: E3 now publishes an effective change, so it joined STACK_SPECS (serial, after the parallel project). S1: E3 on the real api compares the sentence composed while typing with the api’s sentence for the built row. Nits: the 9 self-comparing message-row assertions dropped, the minHours coupling commented, a stale comment fixed |
At 5a38580 on fresh stacks: desktop-datasets 124 passed (108 parallel + 16 serial, E3 among the serial), tablet-datasets 123 + 1 skipped, fixtures 23 / 79 skipped; web 514 in 53 files, lint 0 errors, tsc -b clean; API 470 in CI |
The other 19 sentences stay pinned by the captured v3 snapshot in sentences.test.ts, not by a live check: a known limit; only U-02 is checked against the api end to end |
| 115 | 2026-11-24 | Demo verification of v1.1-submission (three §1–6 walks, one §7 walk, on own stacks) found no blocker, only one gap in how §3 is performed and some cosmetics. Fixes, each a small PR: #22 (D1–D4, D9: My schedule refetches offers when the window regains focus and lists the newest first; no “change in draft” pill without a draft; the publish message reads “Version 4 is live now.” with local-time history; identical rule-check warnings are grouped into one row (“Warn U-16 … ×14”) with the Blocks listed first; the About page no longer says 16-hour shifts; web unit tests now 532 in 54 files), #21 (the demo-script corrections D5–D8 and §7 items S7-1 to S7-5, the new on-screen quotes, the test counts), #20 (install.sh and the Quick install section in README/INSTALL). The §2 banner is unchanged: “Blocked: 4 rules fail”. |
The verification walks used three independent browser runs and a database check per claim; the fixes were re-verified by a final full re-walk on v1.1.1-submission. |
The owner asked for every demo step to work; all findings were fixed, none needed a rule or data change. |
| 116 | 2026-11-24 | PR-N (sc-pr-n, v1.2): tailoring options for the quarter plan. The owner’s brief offered four candidates (staff types, part-time fill, honour preferences, units to plan); the AI read PlanGenerator and PlannerService first, built three, then measured them on its own stack before writing the docs |
Generator unit tests per option, API tests (validation, 403, storage, Dataset 150), the characterization test re-run with the default options sent (100/120/150 fingerprints identical), web unit tests, a Playwright spec, and a walk on Datasets 120 and 150 with screenshots | Rejected two of its own options. Units to plan was not built: the quarter commits once per window, so a partial-unit plan would leave the other units unplannable, and relief crosses units. Honour preferences on/off was built and then removed after measuring: with wishes ignored, Dataset 100’s plan changes (who works days or evenings) but every scorecard figure is identical, and on 120/150 the crews decide placement, so the switch had no visible effect. Part-time and casual became one checkbox because the data has no field that tells them apart (both are CASUAL_* crews below 1.0 FTE). Fill up to FTE is reported as it is: unused capacity on 150 drops 3,515 → 496 h, but the 100 gaps stay and warnings rise 39 → 77 (all Warn) |
| 117 | 2026-11-24 | PR-M (sc-pr-m, v1.2): plan inputs on the Quarter plan: a headline, a collapsible panel, GET /planner/inputs and a per-draft snapshot, built by Claude Opus 5.5 from the generator’s own loaders, with the fill-order words checked against PlanGenerator. Generate on Dataset 150 measured 4.7–6.0 s (5.9 s cold) at host load ~20; the 57 s the UI test saw was contention, and the generate route’s proxy timeout is now 180 s. |
PlanInputsApiTest (counts on 120 and 150, no names, every non-planner role 403 and no token 401, snapshot kept through a hand edit and a staff change, a closure, a forced pattern); the 120 and 150 plan fingerprints unchanged; web unit tests; Playwright desktop, tablet and fixtures on an own stack; CI. |
Corrected by review: the first cut (a) grouped 8 h officers by their own pattern even when the draft forced one, so the card contradicted its options line; (b) took the staffing floor from the first period and called it the quarter, with a silent fallback when closures truncated the list; (c) wrote the 35-day history window a second time. Fixed: the pattern passed through, the busiest stretch with its dates, one HISTORY_DAYS constant, each pinned by a test. Corrected by the re-check: the AI added the Google Fonts origins to the CSP’s connect-src to silence a reported console error; the re-check showed connect-src does not govern stylesheets, fonts or preconnect, the error did not reproduce on the built app, and the change only widened fetch egress, so it was reverted to 'self'. Rejected: splitting part-time from casual in the headline: the data has no casual flag and the generator fills both alike, so the card says “part-time or casual”. |
| 118 | 2026-11-24 | PR-N round 2 (sc-pr-n): the owner asked for a third option, Cover gaps from other units, after Fill up to FTE used part-time hours but closed no gap; plus the cross-model review (6 should, 8 nits) and the UI test (2 medium, 5 low) |
Generator unit tests (eligibility, qualification, a Block refuses, determinism, gaps before the extras, pacing), API test pinning every Dataset 150 figure and committing a draft made with both options, web unit tests, Playwright, and every option combination measured on Datasets 120 and 150 on the author’s own stack | Measured before claiming. The pass records why each gap stays short; that showed the honest answer the owner needed: on 120 cross-unit fill covers nothing (all 38 gaps are Escort evenings and no free officer elsewhere holds Escort), on 150 it covers 28 of 100 and the rest are mostly qualifications, so the docs say the next lever is endorsements, not fill order. The qualification rule is the owner’s strict reading (an away officer must hold the block’s qualification even where the unit needs only one first-aider); a looser “the block already has its qualified minimum” rule was considered and not built, as it needs per-hour qualified counts. Full-time officers are eligible only under FTE × 80 h, so the pass can never create overtime. A new V15 instead of editing V14, so a stack already built from the reviewed head still starts. Review S6 (inequalities) fixed by pinning the exact figures. |
| 119 | 2026-11-24 | PR-N round 2, found by the new commit test (review S3): a draft made with Fill up to FTE or Cover gaps from other units could never be committed | CI mvn verify: the commit answered 409 WARNINGS_CHANGED (114 accepted, 71 re-counted). Fixed, then the both-options draft committed on the author’s stack (71 / 71, 5,769 shifts) and in the API test |
The AI’s own round-1 figures were wrong. Each generator pass de-duplicates warnings only within itself, so the extra passes counted the same officer and rule twice: Dataset 150 Fill up to FTE reported 77 warnings where the commit counts 51 (120: 17 is right). Drafts made with either new option are now scored once, chronologically, by the same assess path a hand edit uses; the default path is untouched, so its pinned figures stand. All docs now carry the corrected numbers (150: up to FTE 51, other units 59, both 71). Lesson recorded: a figure the planner will accept at commit must be tested through commit. |
| 120 | 2026-11-24 | PR-N round 3 (last): the round-2 gates (review APPROVE, 8 should, 8 nits; UI re-test PASS, 1 low) | Generator tests for the order, the 12 h rule, the whole-shift qualification and the no-shift-fits reason; API tests committing each option alone, pinning the Dataset 120 and full-time + other units rows and the inputs with options; web tests for the still-short words, the full-time-only headline and the page; Playwright on the author’s stack | The reviewer was right twice. A gap where a free, qualified officer’s shift simply could not cover the block was labelled no hours left; it is now no shift that fits (9 of 210 on Dataset 150 full-time + other units; the 46/14/12 on the default staff did not move). And a borrowed 12 h shift was checked only against the gap block’s qualification; it is now checked against every block it covers (no change on the demo data, where a unit asks for the same qualification in every block, but a real unit need not). The owner’s question “why are gaps still short” now has an answer on screen: “Still short: 46 not qualified · 14 no hours left · 12 would break a rule”, and on Dataset 120 “No gap could be covered from another unit: no free officer in another unit holds the post’s qualification.” Not changed, with the reason: the commit’s history window also reaches into the quarter (older than PR-N; empty on the demo data). |
| 121 | 2026-11-24 | PR-Q (sc-pr-q, v1.2): the release walk’s six findings. D1, the staffing shortfall never shown since Release 3: the api sends shortfall, the web read short, and the web’s own fixtures and tests used short too, so every test passed against a contract the api never had |
A real /planner/staffing answer (Dataset 120) as a contract sample with tests that failed on the old readers (2 of 3, checked by restoring them); a Playwright check that the headline, the panel and the tile agree with the live api on Datasets 100, 120 and 150; web, desktop and tablet suites on the author’s own stacks; the demo script §1–7 re-walked with the release walk’s harness |
Fixed in the web, not the api: the documented contract (docs/07-api-spec.md, ADR wording) is shortfall, and the submission hotfix on release/v1.1.x made the same choice. Corrected by its own walk: the first D5 fix opened the filled-shifts list after Confirm so the confirmed card stayed visible; the screenshot showed 53 history cards pushing the board down, so the card now keeps its place among the current needs instead. Fixed after review: the web type expected a truncatedNote the api never sends; the api sends a boolean truncated and says the cap in note, which the panel already shows, so the dead field is gone. The sign-in picker’s 404 path (mock sign-in off) no longer says “Loading the demo users…” forever, the retry test pins the backoff, and the e2e finds the staffing panel and tile by test id. |
| 122 | 2026-11-24 | Release v1.3, S1: positions and the SUPERVISION kind (API, schema only), from the owner-approved plan in .factory/plans/v1.2-supervisors.md (the release was split afterwards, so it is v1.3 here). The positions migration (the position table and its two rows, the foreign key from employee.classification, employee.position_since, the SUPERVISION unit kind, unit_supervision with its triggers, the ACTING_SUP qualification), the Position enum in shiftcircle-domain, the new PlanGenerator.Employee/Unit record components with the old constructors kept, and the reads in loadEmployees/loadUnits/MyScheduleQuery//me |
The migration was applied by hand to a scratch PostgreSQL 17 first (an unknown position code is refused 23503, unit.kind = 'SUPERVISION' is accepted, the trigger refuses a link whose parent is not a post 23514), then by Flyway in the test suites. SchemaConstraintsTest and AuthApiTest prove the new constraints and the two reads, PositionTest and PlannerLoadApiTest prove the rank lookup and what the generator reads. No pin moved: GeneratorCharacterizationTest is green with no edits (100/120/150 checksums 4156077d…da6b / 82b19cf8…32ca / 2e6cd938…d7f8, the three plan fingerprints, 6,586 / 5,103 / 5,414 rows, 135 / 7 / 39 warnings, payroll golden 9f2d51b3…04ff) and the three demo reset tests read the same checksums. Author run: API 517 = 127 rules + 36 infrastructure + 354 api; web 591 in 58 files, lint 0 errors, tsc -b clean, build clean; check-ignored-sources.sh OK and check-audit-codes.sh still 50 codes |
The review round changed the work. Sonnet’s review (APPROVE, 0 must, 4 should, 7 nits) and the security gate (PASS, 3 low, 2 info) were folded in: the link trigger now also refuses a post covering a post, a second trigger refuses a unit’s kind changing under a link, position_since cannot be earlier than seniority_date, the trigger functions pin their search_path, and a rank the api does not know is looked up as nothing and falls back to the lowest non-supervisory rank instead of throwing. Rejected: the review’s suggestion to add CHECK (code IN ('CO','CS')) to position — it would make a new rank a migration, which the plan deliberately does not want; the api knows two ranks and treats the rest as non-supervisory until it knows them. Corrected: the docs said a new rank is “a row, not a schema change” and that a post cannot cover a post; the first is now true only with a code change, and the second is now enforced rather than promised. Two failures were the machine’s, not the change’s: the whole api reactor in one JVM was OOM-killed twice (exit 137) on the shared 8 GB Docker VM, so the suite was run in batches, and PlannerApiTest’s wall-clock assertion (the plan in under 120 s) failed once at 149.9 s on a loaded host and passed when the class ran on a quieter machine — its functional assertions (135 warnings, 727 short block-days) passed in both runs |
| 123 | 2026-11-24 | Release v1.3, S2: who can work a post. The POSTS rule table (“Who can work a post”, post-eligibility.drt) with R-01 (an officer on a supervisor post is a Block with no override; with ACTING_SUP a Warn to acknowledge) and R-02 (a supervisor on an officer post is a Warn to acknowledge) as rule rows; PostEligibilityFact and builder built for the proposed shift only; RuleRowsV1, the validator and RuleSentence; RuleCheckService looks up position, qualifications on the date and unit kind, and the planner’s generate, regenerate, commit and draft-edit checks pass them; V18__rule_set_v4_posts.sql publishes v4 = v3 + R-01/R-02; the rules screen gets a ninth tab with its own columns. Built by Claude Opus 5.5 from the owner-approved plan. |
PostEligibilityRulesTest (8), validator (+3), PostEligibilityApiTest (the four owner cases through POST /rule-checks, and a maker/checker edit published and applied), RuleSetV4SeedTest, RuleSentenceTest (+1), web sentences (+7) and rules screen (+2); GeneratorCharacterizationTest unchanged and green. |
Two infrastructure fixtures used version numbers 4/5 and v3’s effective date for synthetic versions; they now use 5/6 and v4’s date. Drools templates drop a line whose column is empty, so “no acting qualification” is passed as -. |
| 124 | 2026-11-24 | Release v1.3, S2 review round (review CHANGES, security PASS, UI test FIX NEEDED), fixed in one push by Claude Opus 5.5: the build’s dry run builds post facts, so a POSTS edit shows its impact; the checklist lists the build’s errors; the Must rows’ On/result/Override are locked in the screen and refused by the build; actingQualification is limited to ACTING_SUP; the planner’s post lookup fails closed; V18 (renamed from V17 when it merged after P1’s proposals migration) derives its base version; the demo script, README, INSTALL, docs/05, roadmap and docs/ui follow a fresh v4 stack. |
PostsMakerCheckerApiTest (dry run reports R-01 Warn → Block, then publish), PlannerPostEligibilityApiTest (generate, draft-edit preview and save, commit against R-01), PostEligibilityApiTest (an override reason cannot save R-01), validator (+2), web rules screen (+2); full mvn verify, web suite, and Playwright desktop and tablet. |
The UI tester’s major (D1) was real: the dry run had no post facts, so a POSTS edit always read “No rule result changes”. The maker/checker test had depended on JUnit’s method order. |
| 125 | 2026-11-24 | Release v1.3, S3: the rank-aware planner (API), stacked on S2 with main (PR-N) merged in. A rank guard in every placement pass (home fill, casual pool, closed-unit relief, PR-N’s cross-unit fill and part-time top-up), seniority inside the rank in every planner sort and the night card, officer-only scorecard cards plus a supervisors card and totals, the rank split in the commit preview, commit, audit and compare, the position dimension in plan inputs, and a 409 for closing a supervisor post |
PlanGeneratorSupervisorTest (6) on a synthetic centre with two posts and ten supervisors, every option on: no cross-rank placement or rule check, officer plan and cards identical with and without supervisors, exact supervisor card; a mutation run with the guard removed failed 5 of 6. PlannerSupervisorApiTest (3), UnitApiTest (+1); GeneratorCharacterizationTest, PlannerApiTest, PlannerOptionsApiTest, PlanDraftEditApiTest green with no edits; web 594 tests, lint 0 errors, tsc -b clean |
S2’s PlannerPostEligibilityApiTest expected the acting officer to be placed on the test post by relief; under the no-cross-cover rule the planner places no officer there, so the test now asserts an empty post and every block-day a gap. A first web run under API test load showed 30 time-outs; an idle re-run passed all 594 |
| 126 | 2026-11-25 | Release v1.3, S4: the supervisor posts in the datasets, the demo supervisors linked, the single re-pin (API), stacked on S3. V19__supervision_posts.sql (SUP-L/SUP-O, 1/1/1, links, scopes); 10/10/12 supervisors in Datasets 100/120/150 from their own seeded streams after every officer row; M. Ellis and J. Chen linked; officer-only self-checks plus a supervisor check; the overtime list kept inside the post’s rank; DemoChecksum.officersOnly. Built by Claude Sonnet 5.5 from the owner-approved plan. |
The officer-only checksums, plan fingerprints, rows and warnings were measured equal to the pre-S4 pins on a fresh stack before any pin was edited, then pinned in GeneratorCharacterizationTest beside the new values; the payroll golden’s 1,038-line prefix was compared byte for byte. Corrected by measurement: a 12 h preference for some Dataset 100 supervisors (to cover the plan quarter’s nights) was tried and left more post block-days short (286 vs 230), so it was reverted. Caught before it shipped: with the posts in both supervisors’ scope, the §3 overtime list would have led with supervisors (no overtime, senior service); the list is now kept inside the post’s rank, and the §3 figures (36: 18 / 10 / 8) were re-read. |
Full API mvn verify, web checks, desktop Playwright and the demo §1–6/§7 figures on a fresh stack; see release notes |
| 127 | 2026-11-25 | Release v1.3, S8 (docs, by a Claude Sonnet 5.5 agent): ADR-031, FR-35 to FR-38, traceability §10, one consistent pass over the README, INSTALL, guides, docs/02–10, HANDOFF and the roadmap; v1.3 made the course submission (owner decision mid-PR), install pin v1.3, BUILD_RECORD for v1.3 | Every count re-measured on the final main on the agent’s own stack (API 624, web 695, both Playwright viewports with 1 worker); every demo-script quote re-read on the real api before any spec ran (none drifted). Corrected in its own pass: docs/04 and docs/05 still said “no supervisors in the datasets yet”; docs/06 named the positions migration without its number and had no V17__proposals.sql row. The BUILD_RECORD page count was measured with a Chromium print to PDF (Letter, 1 in margins, 11 pt Source Sans 3) after calibrating against the previous record (1.95 pages, as recorded) |