The chips that choose what a calendar tap declares wrapped their label
over two lines, hid a check that still took room, hatched the text of
the chosen one and left Erase alone on a third row.
Each chip now carries a swatch painted as the calendar paints a declared
day, with the check inside it when chosen. Dated CP chips take a row
each, RTT, Other and Erase share the last one, and four chips make two
rows of two. Reworks the chips added for #379.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3CzBZP96zgTG9hCgLw
Two follow-ups to 9c06516 from its verification.
A deadline reached while searching which reserve to name turned a conflict the first search had already proved into an incomplete calculation. The attribution now gives up at the deadline and the conflict is reported with its generic reason; a cancellation still interrupts.
The alternative-date analysis relied on earned activations, which the path without a final-state snapshot does not have. It now compares the occurrences of reserve-carrying rules satisfied before and after the move, on both paths.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3CzBZP96zgTG9hCgLw
The refusal table and the unknown-fields test had moved to version-2 envelopes only. They now run for version 1 and version 2, since every published envelope version must stay decodable and all or nothing (ADR 0014).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3CzBZP96zgTG9hCgLw
Two findings of the independent verification.
An obligation whose reserve holds for each occurrence alone but not for all together ended in the generic joint-date conflict. When no single occurrence fails and an obligation IF_THEN rule carries a reserve, the conflict path now searches the obligations once more with the obligation reserves ignored, on its own context and stopping at the first solution. Placements are only added along the obligation search, so a solution found there breaks at least one reserve: the conflict names the first occurrence whose reserve does not hold in it. Without such a solution the conflict is reported as before, and requests without a reserve-carrying obligation take the same path with the same steps.
The alternative-date analysis accepted a move that left an earned day in place while its reserve no longer held. A date is now ineligible when an activation of a reserve-carrying rule is no longer satisfied.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3CzBZP96zgTG9hCgLw
The default rules scenario now carries the reserve of five: 2.90 s, 0.85 of the calibration, against a multiplier of 1.25 that did not change. The saved-rules section describes the version-2 envelope and the single migration that gives the supplied Samedi Malin its reserve.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3CzBZP96zgTG9hCgLw
This is the change that makes the reserve reach users: a plan no longer promises a Samedi Malin day when fewer than five CP days would remain on that Saturday (ADR 0015).
- The rule dialog offers the reserve on IF_THEN rules and the rule summary mentions it when it is above zero; a refused reserve has its own translated validation reason.
- A first visit gets the supplied Samedi Malin with a reserve of five. A saved version-1 envelope or legacy list gives five once to the rule with the supplied identity, edited, disabled or untouched, in the existing single write, and is saved as version 2; a version-2 envelope is never migrated again, so a later value, zero included, is kept.
- Share links are produced in a second envelope version carrying the reserve of every IF_THEN rule. A version-1 link still decodes, with five on the supplied Samedi Malin and zero on its other IF_THEN rules; a non-canonical or misplaced reserve refuses the whole import.
- The reserve reaches the planner in the browser and through server-side planning, with a test on each path, and the supplied rules are planned end to end for 9 and 4 CP days on a 2027 horizon.
- The default rules benchmark scenario carries the reserve; no multiplier changed.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3CzBZP96zgTG9hCgLw
A declared CP day may carry the expiry date of the leave balance it was booked from. The planner attributes the day to the balance it names when its date lies within that balance's dates, and otherwise, as for every day that names none, to the matching balance usable on its date that expires first; an IF_THEN reserve then adds back only the days booked from a balance it counts. The field is optional in storage and in planning requests, on every calculation path, and days saved before this change load unchanged.
In declaration entry the CP chip becomes one chip per CP balance expiry date from two balances on, labelled with that date. With zero or one CP balance the controls and the clear-on-same-type behaviour are unchanged and the single balance is recorded automatically; with several, a CP day is cleared only by the chip of its own balance and replaced by another, and the drag preview follows the same rule.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3CzBZP96zgTG9hCgLw
The plan outcome reports each occurrence a reserve prevented, with its rule, date, remaining and required quantities: a pattern in place that earns nothing, or a pattern not placed because the reserve could not hold. In the second case the remaining quantity is the one the displayed plan would leave with the pattern that has the fewest days still to place, funded first by unplaced leave. The field is absent when there is nothing to report, so outcomes without a reserve are unchanged.
The applied rules of the plan explanation show one line per occurrence, also for the plan retained by an incomplete calculation, and the conflict of an obligation whose reserve cannot hold reads as a sentence naming the rule, the occurrence and the missing quantity, in the four interface languages.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3CzBZP96zgTG9hCgLw
A planning request can give an IF_THEN rule reserveDays: a quantity of its requested leave type that must remain on the occurrence date (ADR 0015). An occurrence is satisfied only when its pattern is complete and its reserve holds; one predicate feeds earning, the preference count, obligation validity and the counterfactual analysis.
The measure counts the reported balances of the requested type usable on the occurrence date, deducts their placements dated on or before the last day of the time-off period holding the occurrence, and adds back the declared days dated after it and attributed to those balances (the balance of the day's type usable on its date that expires first).
As a preference, an occurrence whose reserve cannot hold places nothing; behind earlier objectives the IF_THEN stage moves at most the missing days, held only by optimization rules, to free dates after the period, and the leaf check judges the moves. As an obligation, it ends in a planning conflict with reason if-then-reserve carrying the occurrence, the remaining and the required quantities.
An absent or zero reserve runs no new code: the frozen-engine differential check passes without a rebuild.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3CzBZP96zgTG9hCgLw
Adds the #375 record with the comparison before the rebuild (4,953 of 5,000 seeded requests identical, one worse on a real objective, explained), the seven multi-year requests and the benchmark protocol, lists the rebuild from 1e06fe2 in the frozen-engine table, and notes in ADR 0012 that the loss it accepted behind loss prevention is lifted in the rule's own stage.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3CzBZP96zgTG9hCgLw
Built from 1e06fe2 with the command of docs/benchmark/README.md. It carries the two commits of #375: the validity of the earned day (56ba9a7) and the IF_THEN stage that earns its day behind loss prevention (1e06fe2). The differential check passes again: 47 tests, 5,000 seeded requests and the seven multi-year requests.
From here the history of this branch is append-only: 56ba9a7 and 1e06fe2 must keep their hashes.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3CzBZP96zgTG9hCgLw
Search change under ADR 0010. An earned day now expires inside its leave year, so it counts as at risk as soon as it is earned. Behind loss prevention, the IF_THEN stage rejected every candidate that earned a day, and loss prevention stopped putting leave on a pattern, so the supplied rule order earned nothing.
The IF_THEN stage now does two things in its own stage:
- when a finalized candidate is worse than the baseline on an earlier leave-balance objective, it places the leave this rule earned on its first valid date, and keeps the candidate only if the earlier objectives are then no worse than the baseline;
- when earlier objectives already placed all the requested leave, it moves one such placement onto a free pattern date, and the same check judges the move.
A candidate that was already acceptable takes the path it took before. This lifts the loss ADR 0012 accepted for a pattern behind loss prevention; its obligation search is unchanged.
The frozen-engine differential check fails until the frozen engine is rebuilt from this commit.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3CzBZP96zgTG9hCgLw
An earned leave entitlement still becomes available the day after its generating time-off period ends. It now expires on the expiry date of the earliest-expiring reported balance of the rule's requested type that is usable on that availability date, and one year later only when there is none. This applies to every IF_THEN rule that earns leave (ADR 0015).
Usable is date-only: a balance the plan fully consumes still defines the leave year. Earned balances never define another earned balance's expiry. The bounds cache key gains the rule, since two rules with different requested types can share a period.
The frozen-engine differential check fails from this commit until the frozen engine is rebuilt.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3CzBZP96zgTG9hCgLw
ADR 0015 for #374: why the reserve follows the stricter reading of the
staff-representative report of 13 October 2026, which readings were rejected,
and what changes for saved rules and share links.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3CzBZP96zgTG9hCgLw
Samedi Malin gains a reserve of five CP days, taken from the works-council
report of 13 October 2026, and its earned day expires with the CP balance in
use when it is credited. A declared CP day names the balance it was booked from.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3CzBZP96zgTG9hCgLw
Record ADR 0014 and the Rule set glossary term for issue #363: a link
carries the whole ordered rule set in its own versioned envelope,
validated all or nothing, and replaces the recipient's rules after
confirmation without touching balances, declared days or the horizon.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He39ydEEMnJJQHagHvB2
- Keep the planner core unchanged apart from exporting its rule checks:
the link module checks a disabled rule by passing it as enabled.
- Require an earned leave type on every shared IF_THEN rule, as the rule
type does, so an imported rule never lacks one.
- Cancel a link still being decoded when the address changes to one
without a link.
- Restart the two seconds of the copy label on a second copy, and clear
the timer when the panel goes away.
- Name the import statement's days as the rest of the UI now does:
already booked days.
Refs #364, #365, #368.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He39ydEEMnJJQHagHvB2
The rules panel offers "Share my rules" next to the add-rule buttons. The
share link is recomputed whenever the rule set changes and the button stays
disabled until it is ready, so the share sheet and the clipboard are reached
inside the click, without awaiting the compression.
With a share sheet the link is shared with the share title; dismissing the
sheet does nothing and any other share error copies the link. Without one
the link is copied and the button reads "Link copied" or "Copy failed" for
about two seconds. A rule that cannot travel in a link is named in an alert
under the button, which leaves once the rule set can be shared again.
Refs #368
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He39ydEEMnJJQHagHvB2
A rules fragment on the planner page, at startup or on a later
hashchange, is decoded with the link module and offered in a dialog
that lists the incoming rules in order as plain text and states how
many current rules they replace. Replace my rules replaces the whole
rule set through RuleService and saves it, also when the saved rules
were unreadable at startup, so that later edits are saved too. An
invalid link is reported in the same dialog with Close. The fragment
is then removed from the address with history.replaceState, so a
reload does not ask again. The benchmark route ignores the fragment.
Refs #365
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He39ydEEMnJJQHagHvB2
Add the link module of rule-set sharing (#364, parent #363, ADR 0014), with
no UI yet. encodeRuleSetLink turns the rules RuleService exposes into the app
root plus a rules fragment parameter, or names the first rule that cannot be
shared. decodeRuleSetLink turns the fragment value back into a rule set ready
for RuleService, with TIME_WINDOW boundaries as local-midnight dates, or
returns null.
The link carries its own { version: 1, rules } envelope, compressed with raw
deflate and encoded in base64url. Validation is all or nothing on the wire
form: canonical values, known fields only, at most 100 rules and 64 KB
inflated, then the planner core's rule checks for every rule, disabled ones
included. Inflation is fed in small slices so it stops soon after the limit.
The core exports normalizeRules with its skip of disabled rules made
optional; the default behavior and the invalid-input reasons are unchanged.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He39ydEEMnJJQHagHvB2
Review of every French label: sentences that said nothing or repeated a
heading are rewritten or removed, one word is kept per idea (période de
repos, période de travail, planning, le calcul, poser), the optimization
rule editor loses its jargon, and counted labels agree in number.
English, German and Spanish follow the French.
The six supplied optimization rules get names that say what they do. A
saved preset still under its first name takes the new one; a name the
person chose is kept.
Eight unused or redundant keys are removed.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3AJHe4Ey5nTxHMdPcd
The summary tiles and the statistics dialog now show leave days placed out
of those the plan could use, unplaced and lost days, total days off with
the weekends and public holidays as a detail, the number of time-off
periods and the longest, the longest stretch without leave, and bridged
public holidays out of the weekday holidays. Units sit next to the number
instead of in the label, and a tile and the dialog share one label.
The two averages are no longer displayed. Earned leave appears only when a
rule earns some, and names a single rule once. Weeks with one workday,
delivered by #69 on main only, are brought back as a dated warning.
Figures are derived in one tested helper; the planning engine is unchanged.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The retry test recorded document.activeElement right after clicking Retry
and expected the arriving result not to move focus. MatDialog defaults to
delayFocusTrap, so autoFocus 'first-heading' moves focus to the title only
after the 150 ms opening animation timer and the next render. The test
usually finished just before that timer fired, so it compared body with
body. Under load the timer fired while job(2) was being polled, and the
final detectChanges ran the pending afterNextRender. Focus then moved from
body to #counterfactual-title and the assertion failed, even though the
result had not moved focus.
Wait for the title to receive focus, as the first test does, before taking
the snapshot. The assertion now checks that the result leaves the dialog's
settled focus on the title.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The maintainer could not understand several default rule summaries. Each
default optimization rule now states the action and its benefit, in the
four languages, and the automatic placement of an if-then rule reads
"au meilleur moment autour de ce jour".
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Below 75rem only the chosen view is displayed, and a bar fixed to the
bottom of the viewport offers the configuration / plan switch and
Calculate. The page opens on the plan unless there is nothing to plan.
Calculate in the bar shows the plan and focuses its heading. Declared
non-working days are entered on the plan's calendar with the type and
erase choices in the bar. The skip link now shows the plan, and the
"go to your plan" link in the configuration is removed.
Calculate and the declaration controls become shared components, so
that the panel and the bar use the same markup and rules. The bar's
measured height reserves space at the end of the page and as scroll
padding, so that it never covers content or a focused element. The
two-column layout is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The six supplied optimization compositions now say what the planner does
for the person ("Raccourcir la plus longue période travaillée d'affilée")
instead of naming the measure it moves. A rule matches when its elements,
measure, aggregation, direction and conditions equal a supplied rule; the
deficit threshold stays a placeholder, so a custom threshold keeps the
intent. Other compositions keep their generic sentence, and the
public-holiday-week phrases now explain their points per holiday.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adding or editing a planning rule now opens a Material dialog instead of
swapping the list item for an in-place form. One RuleDialog component serves
both, for every rule kind, so the duplicated add/edit template and the state
that only existed for in-place editing (editing class, cdkDragDisabled, the
hidden add buttons) are gone. The list only displays, enables, reorders and
deletes rules, and no longer changes layout while a rule is edited.
The form markup, validation and saved rule shape are moved unchanged; the
dialog returns the rule and the panel hands it to the rule service. The rule
editor tests now drive the real dialog.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add a third disclosure above the calendar, closed by default, listing every
time-off period that contains a leave placement or a declared non-working day:
its date range in the active locale, the leave days per leave type, the declared
days and its duration in days off. Choosing a period scrolls its first leave or
declared day into view (honouring prefers-reduced-motion) and focuses it.
The three disclosures share one row on a wide screen; their summaries drop the
decorative icon when narrow so that the calendar stays above the fold.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Optimization rules now read as a goal ("Réduire la plus longue séquence
de travail") built from per-measure phrases, element nouns and condition
qualifiers, so every valid composition gets a sentence. The technical
composition stays in the calculation details and the audit data.
The placement impact table drops the generic help repeated on every
optimization row. If-then and imposed-period summaries use real plurals,
leave-type phrases and the earned-leave wording of CONTEXT.md; the German
templates, which never filled their placeholders, are rewritten.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At the two-column breakpoint the panel is sticky and scrolls internally, and
the indicative wait with the Calculate button stays pinned at its bottom. The
panel is registered as a CDK scrollable so that dragging a rule still
auto-scrolls it. Single-column layouts are unchanged.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Move the time-window, if-then and declared time-off period blocks into one
closed "applied rules detail" disclosure next to the placement explanation,
so the legend and the first row of months sit under the summary figures.
Put the status and the calculation date on the heading line.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Show the product name VacOptimizer in the header, round plan statistics to one
decimal in the active locale, lay the statistics tiles out in two columns when
the dialog is wide enough, and attach the calculation date to the results
heading and status instead of a free paragraph.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
An absent or unreadable saved list now starts empty; no quantity is
generated. With no leave balance and no declared non-working day there
is nothing to plan: no calculation starts on load, Calculate is disabled
with the reason exposed through aria-describedby, and the results panel
shows the planning horizon's calendar with an invitation. Declared days
alone still calculate, so earned-leave chains keep working.
ADR 0012 records the decision and supersedes the random defaults of
ADR 0005. Tests now state their balances explicitly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The benchmark has eight scenarios since the default-rules one. The #349 record
no longer says the stage ran for hours, which nothing measured, and separates
its rule-order survey from the named requests. The #350 record mentions the
seventh fixed request added later.
Comparing random long requests before the pull request found a request where
a Samedi Malin occurrence can fund an obligation: the obligations stage then
takes 10 of 11.8 seconds and 3.2 GB. It joins the runner's named requests and
the open points of the #347 record.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3Dca4aadeFoaGp2jB7
Four rebuilds in a row had turned the origin of the frozen engine into one
long sentence; it is now a table, latest first. The #347, #348 and #349
records name the runner that holds their requests, and the README shows how
to use it. The #347 record no longer attributes to #349 the question of
whether loss prevention should leave room for a Samedi Malin pattern.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The records time and compare requests by name (347-3y, 348x-2027-1y-default,
349-samedi-first...), but the script that held those requests was not in the
repository. repro-requests.ts is an opt-in runner beside compare-engines.ts,
outside the functional suite and CI: it plans one named request on the current
or the frozen engine with a planning-work budget and prints the outcome, the
time per planning stage, the preference verdicts and the peak resident memory.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Record what the Christmas and holiday-week stages did behind Samedi Malin,
with per-stage passes, candidates and kept improvements for the 2027 year
and the issue's request, the four exact changes and why they keep every
plan, the times before and after, the comparison made before rebuilding the
frozen engine, the new benchmark scenario, and the search changes tried and
not committed. Update the benchmark README for the frozen engine's origin,
the seventh fixed request, the check's run time and the default-rules
scenario; point the #321 finding at the record; describe the reuse and the
new prunes in the planning objectives contract; and note in the planning
duration model that the IF_THEN weight needs a refit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No benchmark scenario enabled Samedi Malin or the Christmas window, so the
cost of the stages after an IF_THEN rule was invisible to the protocol and
its budget. The new scenario plans 2027, which has three Saturday public
holidays, with 25 CP and 12 RTT and the default rules. On the development
laptop it took 9.9 seconds before the exact search changes of #348 (2.8
times the calibration) and 2.9 seconds after (0.82 times); its multiplier
of 1.25 keeps the usual headroom, so the former cost would fail the gate.
The protocol takes about 9 seconds longer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rebuild the frozen engine from 5aa3f39, which reaches the same plans with
less search behind an IF_THEN rule. Compared with the previous bundle
(built from 52059dc) before the rebuild, the 5,000 seeded requests and the
seven multi-year requests planned identically, as did the runner requests
of #347, #348, #349 and #350, but the change removes steps: 20 of the 500
cancelled runs of the differential check differed, ten only in their step
count and ten cancelled at another point. The type declaration still
matches the exports the check imports.
Built with: bun build src/app/services/leave-planner.core.ts --target=node
--external date-holidays, from a clean checkout of 5aa3f39.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Samedi Malin among the default rules, the stages after it searched far
more than they needed to. Four exact changes keep every completed plan,
explanation and final state:
- The generic scan reads no answer from a move, swap, reassignment or
removal: only a candidate that beats the best one so far counts. Such a
candidate is now compared on the objectives that finalizing cannot change
before it is finalized, and dropped when it provably cannot beat the best.
- The holiday-week and time-off-period bundles stop filling a bundle when no
completion can be accepted: each later step only fills the remaining
target dates, so every protected objective has an optimistic value, and a
first difference that is worse rejects every completion. In 2027 the
week of 1 November tried 14,000 to 21,000 allocations in each of four
passes before one was accepted, starting with all those that broke the
complete week of 14 July.
- A later stage reuses a completed generic scan of the same state even with
an IF_THEN rule: once every balance is spent, the scan only accepts
candidates that improve the whole vector, whatever the stage.
- The time-off period holding an earned leave entitlement's pattern is found
by a binary search over the period ranges instead of a scan that built
every period.
The frozen-engine check gains the one-year 2027 request with the default
rules. The changes remove steps, so a cancelled calculation can stop at
another point.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record issue #347 in docs/benchmark/issue-347.md: the cause, the rule, the
times of the runner's requests before and after 52059dc, and the comparison
before the frozen-engine rebuild. The 5,000 seeded requests and the cancelled
comparisons are identical; the multi-year request with a TIME_WINDOW
obligation and three longer runner requests are worse on Samedi Malin, with
every later objective equal or better.
Name 52059dc as the frozen engine's origin and update the check's run time in
the benchmark README, point the #321 finding to the record, and state the
multi-year result and the measuring machines in ADR 0012.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>