100 Commits
Author SHA1 Message Date
nessarandClaude Opus 5.5 995866fe5e docs(adr): share rule sets through the URL fragment
CI / build (pull_request) Successful in 21s
CI / security (pull_request) Successful in 1m1s
CI / validate (push) Successful in 31s
CI / build (push) Successful in 22s
CI / security (push) Successful in 58s
CI / required (push) Successful in 1s
CI / validate (pull_request) Successful in 30s
CI / test (pull_request) Successful in 2m48s
CI / images (pull_request) Successful in 52s
CI / required (pull_request) Successful in 1s
CI / benchmark (push) Successful in 1m29s
CI / test (push) Successful in 2m39s
CI / images (push) Successful in 1m17s
CI / policy (pull_request) Successful in 8s
CI / benchmark (pull_request) Successful in 1m31s
CI / policy (push) Successful in 14s
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
2026-11-15 21:21:27 +01:00
nessarandClaude Opus 5.5 a809c3bff5 fix(rules): apply the review of rule-set sharing
CI / build (pull_request) Successful in 24s
CI / security (pull_request) Successful in 1m4s
CI / validate (push) Successful in 34s
CI / build (push) Successful in 23s
CI / security (push) Successful in 1m16s
CI / required (push) Successful in 1s
CI / validate (pull_request) Successful in 28s
CI / test (pull_request) Successful in 2m42s
CI / images (pull_request) Successful in 1m18s
CI / required (pull_request) Successful in 2s
CI / benchmark (push) Successful in 1m30s
CI / test (push) Successful in 2m59s
CI / images (push) Successful in 52s
CI / policy (pull_request) Successful in 22s
CI / benchmark (pull_request) Successful in 1m33s
CI / policy (push) Successful in 18s
- 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
2026-11-15 20:29:21 +01:00
nessarandClaude Fable 5.2 753c8fc234 feat(rules): share my rules from the rules panel
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
2026-11-15 20:23:32 +01:00
nessarandClaude Fable 5.2 ac587aa5d0 feat(rules): import a shared rule set after confirmation
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
2026-11-15 20:23:32 +01:00
nessarandClaude Fable 5.2 c20f0eaad3 feat(rules): encode and validate shared rule sets in a versioned link
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
2026-11-15 20:23:19 +01:00
nessarandClaude Fable 5.2 97e25aa8b7 fix(i18n): reword unclear labels and rename the supplied rules
CI / build (pull_request) Successful in 21s
CI / security (pull_request) Successful in 1m1s
CI / validate (push) Successful in 36s
CI / build (push) Successful in 27s
CI / security (push) Successful in 1m3s
CI / required (push) Successful in 2s
CI / validate (pull_request) Successful in 34s
CI / test (pull_request) Successful in 2m37s
CI / images (pull_request) Successful in 1m17s
CI / required (pull_request) Successful in 2s
CI / benchmark (push) Successful in 1m37s
CI / test (push) Successful in 3m4s
CI / images (push) Successful in 1m17s
CI / policy (pull_request) Successful in 17s
CI / benchmark (pull_request) Successful in 1m32s
CI / policy (push) Successful in 22s
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
2026-11-15 16:35:09 +01:00
nessarandClaude Fable 5.2 f63dfbd9a6 feat(stats): show the figures that inform a decision, with honest labels (#362)
CI / build (pull_request) Successful in 24s
CI / security (pull_request) Successful in 56s
CI / validate (push) Successful in 38s
CI / build (push) Successful in 25s
CI / security (push) Successful in 58s
CI / required (push) Successful in 2s
CI / validate (pull_request) Successful in 34s
CI / images (pull_request) Successful in 1m19s
CI / required (pull_request) Successful in 1s
CI / benchmark (push) Successful in 1m32s
CI / test (push) Successful in 2m58s
CI / images (push) Successful in 1m21s
CI / policy (pull_request) Successful in 15s
CI / benchmark (pull_request) Successful in 1m10s
CI / test (pull_request) Successful in 3m50s
CI / policy (push) Successful in 16s
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>
2026-11-14 16:40:07 +01:00
nessarandClaude Opus 5.5 57521cc28b test(date-comparison): wait for the dialog's initial focus before the retry focus check
CI / build (pull_request) Successful in 23s
CI / security (pull_request) Successful in 1m0s
CI / images (pull_request) Successful in 1m14s
CI / build (push) Successful in 35s
CI / validate (push) Successful in 42s
CI / security (push) Successful in 1m38s
CI / required (push) Successful in 1s
CI / validate (pull_request) Successful in 34s
CI / test (pull_request) Successful in 2m53s
CI / required (pull_request) Successful in 1s
CI / benchmark (push) Successful in 1m42s
CI / test (push) Successful in 3m25s
CI / images (push) Successful in 1m15s
CI / policy (pull_request) Successful in 20s
CI / benchmark (pull_request) Successful in 1m30s
CI / policy (push) Successful in 8s
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>
2026-11-14 16:07:24 +01:00
nessarandClaude Fable 5.2 556fa3fe37 docs(adr): renumber the empty leave balances decision to ADR 0013 (#356)
CI / build (pull_request) Successful in 38s
CI / security (pull_request) Successful in 2m5s
CI / images (pull_request) Successful in 1m13s
CI / validate (pull_request) Successful in 38s
CI / test (pull_request) Successful in 4m26s
CI / required (pull_request) Successful in 2s
CI / policy (pull_request) Successful in 8s
CI / benchmark (pull_request) Successful in 1m31s
develop already records ADR 0012 for obligation solutions.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 15:44:35 +01:00
nessarandClaude Fable 5.2 1e30812bb4 fix(rules): reword the default rule summaries as what the planner does (#357)
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>
2026-11-14 15:44:21 +01:00
nessarandClaude Opus 5.5 aa3ef00341 feat(ui): switch between configuration and plan from a bottom bar on narrow viewports (#359)
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>
2026-11-14 15:44:21 +01:00
nessarandClaude Opus 5.5 bde65fc90e feat(rules): word the supplied optimization rules by their intent (#357)
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>
2026-11-14 15:44:21 +01:00
nessarandClaude Sonnet 5.5 5148274d4d refactor(rules): edit planning rules in a dialog with one shared form (#360)
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>
2026-11-14 15:44:21 +01:00
nessarandClaude Sonnet 5.5 b165245aa0 feat(plan): list the time-off periods of the plan (#358)
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>
2026-11-14 15:44:21 +01:00
nessarandClaude Opus 5.5 897bdefd25 feat(rules): describe planning rules in plain language (#357)
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>
2026-11-14 15:44:21 +01:00
nessarandClaude Fable 5.2 0561a2f9d1 feat(ui): keep the configuration panel in view on wide screens (#355)
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>
2026-11-14 15:44:21 +01:00
nessarandClaude Fable 5.2 9ffd0953d4 feat(ui): show the calendar directly under the plan summary (#354)
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>
2026-11-14 15:44:16 +01:00
nessarandClaude Fable 5.2 a4d7fa326f feat(ui): polish product name, statistics and calculation date (#353)
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>
2026-11-14 15:44:16 +01:00
nessarandClaude Opus 5.5 679a494fae feat(balances): start from an empty leave-balance list instead of random defaults (#356)
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>
2026-11-14 15:44:15 +01:00
nessarandClaude Fable 5.2 a130a4773a docs(benchmark): correct counts and wording after review, and record a costly obligation search left open
CI / build (pull_request) Successful in 37s
CI / security (pull_request) Successful in 1m46s
CI / validate (push) Successful in 32s
CI / build (push) Successful in 38s
CI / security (push) Successful in 1m55s
CI / required (push) Successful in 1s
CI / validate (pull_request) Successful in 43s
CI / test (pull_request) Successful in 3m34s
CI / images (pull_request) Successful in 1m15s
CI / required (pull_request) Successful in 1s
CI / test (push) Successful in 3m40s
CI / benchmark (push) Successful in 1m34s
CI / images (push) Successful in 1m13s
CI / policy (pull_request) Successful in 9s
CI / benchmark (pull_request) Successful in 1m35s
CI / policy (push) Successful in 7s
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
2026-11-12 18:25:14 +01:00
nessarandClaude Fable 5.2 642acc68ba docs(benchmark): point the records at the request runner and tabulate the frozen engine's rebuilds
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>
2026-11-12 11:40:01 +01:00
nessarandClaude Fable 5.2 75db74e10b test(planning): add a runner for the named requests of the #347 to #350 records
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>
2026-11-12 11:40:01 +01:00
nessarandClaude Opus 5.5 13b81abd4d docs(benchmark): record the stages behind an IF_THEN rule and their exact speedup
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>
2026-11-12 11:15:25 +01:00
nessarandClaude Opus 5.5 9d64f43a68 test(benchmark): measure the default rules
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>
2026-11-12 11:09:33 +01:00
nessarandClaude Opus 5.5 23b5ff1fc4 test(planning): rebuild the frozen engine from the exact IF_THEN search changes
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>
2026-11-12 10:58:39 +01:00
nessarandClaude Opus 5.5 5aa3f39363 perf(planning): reach the same plans with less search behind an IF_THEN rule
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>
2026-11-12 10:57:55 +01:00
nessarandClaude Fable 5.2 72e290e8c3 docs(benchmark): record the obligation producer rule and its comparison
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>
2026-11-11 23:05:55 +01:00
nessarandClaude Fable 5.2 d2a20bde7b test(planning): rebuild the frozen engine from the obligation producer rule
Rebuilt from 52059dc with the documented command:

  bun build src/app/services/leave-planner.core.ts --target=node --external date-holidays --outfile src/app/services/frozen-engine/leave-planner.core.frozen.mjs

The search change lets a preference producer join the obligation search only
when it funds an obligation (issue #347, ADR 0012). Before the rebuild, the
5,000 seeded requests and the cancelled comparisons matched, and the
multi-year request of two years of 5 CP with a TIME_WINDOW obligation
differed; the comparison is recorded in docs/benchmark/issue-347.md.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 23:03:16 +01:00
nessarandClaude Fable 5.2 6c8ebbf1d7 docs(planning): record that an obligation solution holds only the preference patterns that fund an obligation
Record the maintainer's decision on issue #347 as ADR 0012 and state, in the
"Obligation solution" entry of CONTEXT.md, the one exception to "before any
preference rule applies": the pattern of an IF_THEN preference occurrence
whose earned leave can fund a later obligation date.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 22:58:52 +01:00
nessarandClaude Fable 5.2 52059dc8e0 perf(planning): let a preference producer join the obligation search only when it funds an obligation
An occurrence of an enabled preference IF_THEN rule that earns leave was an
optional requirement of the obligation search whenever an obligation needed
a placement, and it lifted the obligation solution limit. The search then
enumerated and ranked every obligation solution times every way to place or
skip each pattern: seconds to minutes for one obligation with Samedi Malin,
and minutes before reporting a planning conflict.

Such an occurrence now joins only when its earned leave can fund a compatible
obligation date after the occurrence, directly or through the pattern of
another joining occurrence. Without one, the obligation search is the one of
the request without that preference rule, including its solution limit.

This is a search change under ADR 0010: a pattern that funds no obligation is
no longer pre-placed ahead of higher-priority preferences, which changes plans
(issue #347).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 22:58:48 +01:00
nessarandClaude Fable 5.2 12c0b417be docs(benchmark): name the machine the #350 record was measured on
The record gave the desktop of the earlier records; its comparison and timings
ran on the development laptop, like those of the #349 record.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 22:58:14 +01:00
nessarandClaude Opus 5.5 b37785bbd9 docs(benchmark): record the loss prevention stall and its fix
Record why loss prevention behind another preference searched relocation
chains without end, the exact skip that replaces them, the before and after
times and memory of the requests of #349, and the comparison made before
rebuilding the frozen engine. Update the benchmark README, which said that
one year of 25 CP and 12 RTT with Samedi Malin ahead of loss prevention does
not finish and named ea2feaf as the frozen engine's origin, and note that a
change removing steps needs a rebuild for the cancelled comparisons. Point
the #321 finding at the record and describe the skip in the planning
objectives contract.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 22:50:14 +01:00
nessarandClaude Opus 5.5 b0bd729297 test(planning): rebuild the frozen engine from the loss prevention fix
Rebuild the frozen engine from c86829d, which lets loss prevention skip
relocation chains that cannot improve the protected prefix. Compared with
the previous bundle (built from ea2feaf) before the rebuild, the 5,000
seeded requests and the six multi-year requests planned identically, but
the change removes steps, so five of the 500 cancelled runs of the
differential check differed: two only in their step count, three cancelled
at a later point of the calculation. The bundle also takes up the changes
merged since ea2feaf; that comparison already included them. 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 c86829d.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 22:43:45 +01:00
nessarandClaude Opus 5.5 c86829d295 fix(planning): let loss prevention finish behind another preference
Once every at-risk day is placed, the loss prevention stage still searched
relocation chains for each balance with days left, such as an earned leave
entitlement or a deferred balance. A chain only serves an addition that
strictly improves the protected prefix, and when loss prevention is not the
first preference nothing bounded that prefix, so the stage enumerated every
simple chain through the occupied dates. Its failure memo is keyed on the
visited dates and the whole plan, so it rarely matched and grew without
bound: Samedi Malin ahead of loss prevention over one year of 25 CP and
12 RTT ran past 100 seconds and several gigabytes.

The stage now skips the chains when no chain candidate can improve the
prefix. A chain keeps every occupied date and adds one free date, so an
objective already at its best value cannot improve, and an objective that
depends only on occupied dates can improve only if adding one free date
would improve it, which is probed directly. For calculations that run to
the end, this removes only candidates the stage would have rejected:
outcomes, explanations and final states stay identical. It removes steps,
so a calculation cancelled after a fixed number of steps can stop at
another point.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 22:42:13 +01:00
nessarandClaude Fable 5.2 2d912e8556 docs(benchmark): record the frozen-engine rebuild and the multi-year requests
Add the record of issue #350: the cause of the difference, the comparison over
the 5,000 seeded requests before the rebuild, the four placements that differed
on the request of the issue, the failure of the new test against the previous
bundle and the added run time. Update the benchmark README with the new origin
of the frozen engine and the fixed multi-year requests, and point the issue
#321 findings to the record.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 22:07:04 +01:00
nessarandClaude Fable 5.2 cca4c0ba2a test(planning): compare multi-year default-rule requests against the frozen engine
The seeded requests last at most ten weeks, so the differential check could
not see a plan that differs only on a long horizon, as the frozen engine did
on three years of 5 CP (#350). Add six fixed requests with the default rules,
with explicit calculation dates and Christmas window dates, compared like the
seeded ones: outcome, stable explanation, explanation error and final-state
snapshot strictly deep-equal, with the request printed as JSON on failure.

They cover the request of #350, a TIME_WINDOW obligation with Samedi Malin,
Samedi Malin ahead of loss prevention, a full year of 25 CP and 12 RTT, three
years from 2026 and a horizon starting on 1 September.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 22:03:41 +01:00
nessarandClaude Fable 5.2 eb316a76ae test(planning): rebuild the frozen engine from the weekday-holiday pattern fix
Rebuild the frozen engine from ea2feaf, which stops IF_THEN patterns at a
weekday public holiday and deliberately changed the plans of such patterns.
The bundle was last built for #302 from 8168137, so the differential check
compared the engine with one that predates that change. The comparison over
the 5,000 seeded requests found no difference before the rebuild. 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 checkout of ea2feaf.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 22:02:23 +01:00
nessarandClaude Fable 5.2 2dbd23230c fix(planning-duration): refit the indicative wait and calibrate it from similar calculations
CI / build (pull_request) Successful in 38s
CI / security (pull_request) Successful in 1m43s
CI / images (pull_request) Successful in 1m12s
CI / validate (push) Successful in 28s
CI / build (push) Successful in 33s
CI / security (push) Successful in 1m43s
CI / required (push) Successful in 1s
CI / validate (pull_request) Successful in 33s
CI / test (pull_request) Successful in 3m0s
CI / required (pull_request) Successful in 1s
CI / test (push) Successful in 2m58s
CI / benchmark (push) Successful in 1m21s
CI / images (push) Successful in 1m14s
CI / policy (pull_request) Successful in 9s
CI / benchmark (pull_request) Successful in 1m21s
CI / policy (push) Successful in 9s
After #321 the prior overstated requests without calendar rules. It also
understated the default rules: Samedi Malin made multi-year requests up
to four times slower than the estimate, beyond the top of the displayed
range.

- The prior is refitted to 38 planning times of one to five years on
  Bun, with and without the default calendar rules: a linear horizon
  term, a placement power of 1.4 and a weight of 4 per IF_THEN rule.
  Measured time now lies between 0.59 and 2.26 times the estimate,
  against 0.43 to 4.12.
- The current form is scaled by the median ratio of its similar past
  calculations, those with the same rule weight and an initial estimate
  within a factor of two, before falling back to the median of all
  eight. A slow configuration is therefore predicted from its own wait
  on the next calculation, where the overall median kept
  underestimating it.

The measurements are planning times in the core, not rendered waits; the
fixed 400 ms for transport and rendering is unmeasured since planning
moved to the server. Obligation weights are unchanged and remain
unreliable (#347).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 21:14:55 +01:00
nessarandClaude Fable 5.2 2dfd00175e perf(planning): reduce JavaScriptCore hotspots in candidate scoring
On Bun, the benchmark's loaded year spent 57% of its time scoring
candidate plans. Freezing a 40-element array costs about 50 times the
map that builds it, and a frozen array reads about 12 times slower.

- The lists that plan observations build per candidate plan are no
  longer frozen. Their elements stay frozen and their types readonly;
  work sequences reuse one frozen object per distinct sequence.
- An optimization is scored in one loop, without intermediate arrays.
  Balance and placement observations are built on first read, a
  TIME_WINDOW preference stops counting at its requested quantity, and
  the expiry tie-break sorts without a comparator.
- A finalized candidate's objective vector no longer counts unsatisfied
  obligations again. The retained plan's state key is built once. An
  earned entitlement's merged period is found without materializing
  every period, and its date arithmetic runs once per period.
- A candidate already worse on a protected objective is still rejected
  before finalization when a rule can earn leave, as long as finalizing
  it cannot touch an earned balance. Samedi Malin used to switch this
  pruning off.

Loaded year 6.31 s to 2.70 s, three years 3.55 s to 1.66 s, two years
1.10 s to 0.54 s. Every outcome, stable explanation and final state is
unchanged: the frozen-engine differential check passes, and 26 requests
of one to four years match the previous engine, cancelled runs included.

The benchmark budgets follow at about 1.5 times the new ratios. The
record lists four search behaviors found on the way and left as they
are (#347, #348, #349, #350).

Closes #321

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 21:14:55 +01:00
nessarandClaude Fable 5.2 5810b59284 refactor(planning): apply the findings of the branch review
CI / build (pull_request) Successful in 33s
CI / security (pull_request) Successful in 1m41s
CI / validate (push) Successful in 28s
CI / build (push) Successful in 32s
CI / security (push) Successful in 1m56s
CI / required (push) Successful in 2s
CI / validate (pull_request) Successful in 33s
CI / test (pull_request) Successful in 3m32s
CI / images (pull_request) Successful in 1m12s
CI / required (pull_request) Successful in 2s
CI / test (push) Successful in 3m30s
CI / benchmark (push) Successful in 1m50s
CI / images (push) Successful in 1m16s
CI / policy (pull_request) Successful in 10s
CI / benchmark (pull_request) Successful in 1m49s
CI / policy (push) Successful in 7s
A standards review and a spec review of the ten tickets found no blocking
defect. This applies what they did find.

- A request that is not an object reaches the planner again, which
  reports what it lacks, where the lifecycle answered that it could not
  be cloned.
- The Compare dates button moves into the date-comparison component, so
  the page reads none of its state.
- The numeric changes of a comparison are computed by one function in
  the labels module for the placement explanation and the dialog.
- The explanation error of a calculation is typed as an interruption
  reason up to the page.
- The two new components use OnPush, as every component but the page.
- The page's date helper loses its Date branch, dead since planning
  dates are strings.
- README and the verification notes describe where a calculation is
  created, what the worker entry does and which requests are answered
  before a job starts. A moved comment says planning stage, not phase.

Refs #335

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 19:08:51 +01:00
nessarandClaude Fable 5.2 98685de72f refactor(calendar-year): extract the date comparison dialog into its own component
The calendar-year component held the whole counterfactual date analysis
session: six signals, a version counter, a dialog reference, a retry
selection and about 200 template lines, mixed into its date selection.

- A date-comparison component owns the dialog and its analysis, loading,
  error and selected-date state. Its inputs are the accepted calculation
  and the selected leave placement; it emits the announcements the page
  writes to its live region. The page passes it calendar dates through
  one method and reads none of its state.
- The calculation context alone decides whether an analysis was
  superseded. The component keeps one local guard for what never reaches
  the context: closing, new inputs and destruction. The comparison of
  calculation identities is gone.
- The criteria table and raw data shared by the comparison and the
  placement explanation become a presentational component, and the rules
  both need move to one Sass partial.

No user-visible change: the dialog's labelling, focus, announcements and
the empty body after a stale result are as before.

Refs #345

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 01:54:06 +01:00
nessarandClaude Fable 5.2 1362cca280 refactor(planning): share one request shape across the lifecycle, messages and core
A planning request was described several times with every field typed
unknown: in the worker messages and twice inside the planner core, which
also read the raw request again after validating it. One request type now
serves the lifecycle, all three request-carrying messages and the core.

- The core's entry points still take an unverified value, since the
  planning server forwards client JSON. They validate and normalize it
  once and the planner reads only the result.
- Labels and identities are typed as text records.
- invalidInputFor loses its last caller and is removed.

No outcome, validation reason or reason order changes; 21 tests written
before the core change pin the handling of malformed requests and pass
unchanged. Four labelling details differ for requests the application
never sends, each stated by a test: labels given as an array no longer
match inherited properties, a balance label that is not text no longer
hides the balance name, a disabled rule no longer names an enabled rule
with the same id, and a balance type given as an array is repeated as the
balance's own type.

Refs #342

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 01:51:50 +01:00
nessarandClaude Fable 5.2 4ffd75eeba refactor(planning): carry planning dates as strings and snapshot requests by cloning
A planning date at the calculation interface was `string | Date`, although
production only passed strings below the form adapter, and the lifecycle
copied every request field by hand, with a per-rule-type field list, Date
branches and a date re-encoding for the socket path only.

- A planning date is a string. The form adapter stays the only place that
  converts a Date; the planner core reports a Date as invalid planning
  input through the existing reason of its field.
- The request snapshot is one deeply frozen structured clone without the
  progress callback. The job message and the public snapshot both come
  from it, so the local worker and the planning server receive the same
  request.
- A request that cannot be cloned is reported as invalid input.

Fields no list names now reach the planner, including the legacy balance
aliases the copy used to drop; the core does not read them.

Refs #341

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 22:16:22 +01:00
nessarandClaude Fable 5.2 401665080c refactor(calendar): return the calendar service to calendar projection
The calendar service carried members that have nothing to do with
projecting a calendar: the seam specs used to replace how a planning
calculation is created, a planLeave pass-through, and members only their
own spec cases used.

- The creation seam moves to the planning calculation service, the single
  owner of calculations, and takes the optional job factory. Specs replace
  it there and assert what they asserted before.
- planLeave, monthNames, monthsInYear, the Year type and SelectedDate's
  day-length method are deleted with their two spec cases.
- VacDay moves next to the user input service as LeaveBalance, the
  glossary term.

The calendar service no longer imports the planning lifecycle.

Refs #340

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 21:58:10 +01:00
nessarandClaude Fable 5.2 a81ee641c3 refactor(calendar-year): move planner label logic into a pure labels module
The calendar-year component turned planning outcomes, reasons, planning
stages and objective identifiers into text itself, so each sentence could
only be tested by mounting the whole page. That logic now lives in one
module of plain functions that take the translations and the data, tested
without TestBed. The component keeps thin calls with the same names.

- The optimization and preference identifier prefixes are parsed in one
  place outside the planner core.
- The optimization summary moves with it, since objective copy needs it;
  the translation service delegates.
- The three fixed status headings use the same outcome label as the live
  announcement. No sentence changes in any language.

Refs #344

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 21:40:32 +01:00
nessarandClaude Fable 5.2 80a3c22bba refactor(planning): type interruption reason codes and key their translations
The reason of an incomplete calculation was a plain string, so a mistyped
code or a missing translation showed English at runtime instead of failing
the build. The eight interruption codes are now a union type carried by
incomplete outcomes, the worker's error response and the translation table,
where they are required keys in every language.

A counterfactual failure in the worker now reports `worker-error` instead of
`counterfactual-error`, a code outside the union that nothing read.

Refs #343

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 21:40:32 +01:00
nessarandClaude Fable 5.2 f65f02dd5c refactor(planning): keep one calculation lifecycle
The calculation entry point had three paths: the worker path, one for a
window without a Worker, and an in-process one for no window with its own
cancellation, replacement and explanation flags. Date analysis had a
main-thread fallback too. Only the worker path remains, on the job the
caller passes or the default selection, so every rule of an incomplete
calculation is decided once.

- The lifecycle module no longer checks the window or imports the planner
  core at runtime; browsers load the core only in the worker bundle.
- One registry holds the live supersession callbacks, the latest
  calculation identity and the latest date analysis.
- A browser with a window but no Worker now reports worker-unavailable
  even for an invalid request, where it reported invalid input first.
- The build forces Angular's chunk optimization: with the lazy core chunk
  gone the build fell under Angular's three-lazy-chunk threshold and the
  initial bundle was split and grew.

Refs #339

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 21:39:56 +01:00
nessarandClaude Fable 5.2 c1b4af382b test(planning): stop choosing the planning engine by stubbing window
The remaining twelve specs that stubbed the global window to reach a
planner now say what they run. Planner behaviour specs use the in-process
job, the cancellation spec scripts a job, and the transport specs keep
their Worker and WebSocket fakes and lose only the stub.

The benchmark runner takes an optional job factory so the gate measures
the in-process job; the page still calls it without one.

Two expectations follow the production lifecycle instead of the old
non-worker path: a calculation replaced before its first checkpoint has
no explanation and a stale-calculation explanation error, and a progress
callback that throws is exercised on the planner core directly, since a
job runs that callback outside the planner.

Refs #338

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 21:00:33 +01:00
nessarandClaude Fable 5.2 a8dc58db74 test(planning): script calculation lifecycle specs through jobs
The planning calculation spec chose its engine by stubbing the global
window and scripted lifecycle behaviour with twelve hand-written fake
Worker classes. Planner behaviour tests now run on the in-process job,
lifecycle tests script a job, and the browser that cannot start a worker
is a job factory that throws.

All 170 tests remain and no expectation changed to make a test pass. The
expired-deadline test only checked the outcome kind and passed on
worker-unavailable under the default setup; it now asserts the deadline
reason.

Refs #337

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 20:41:19 +01:00
nessarandClaude Fable 5.2 62df01857c refactor(planning): run planner messages through a swappable job
Prefactoring for a single calculation lifecycle. The job that carries
planner messages becomes a parameter of the calculation entry point, and
a third implementation runs the worker's message handling on the calling
thread, so specs and non-browser callers can use the worker path without
a Worker.

- The worker's message handling moves into a handler with per-instance
  state; the worker entry binds it to its port.
- A passed job factory always takes the worker path, whatever the globals
  say, for the plan, date analyses and the checkpoint explanation.
- The lifecycle registers supersession for every job it starts, so jobs
  implemented outside the module yield to a newer calculation too.
- The in-process job lives in a module the default selection does not
  import: browsers still load the planner core only in the worker bundle.

No calculation path is deleted and no existing spec changes.

Refs #336

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 19:54:41 +01:00
nessarandClaude Opus 5.5 ea2feaf766 fix(planning): stop IF_THEN patterns at a weekday public holiday
CI / build (pull_request) Successful in 34s
CI / security (pull_request) Successful in 1m27s
CI / validate (push) Successful in 32s
CI / build (push) Successful in 38s
CI / security (push) Successful in 1m17s
CI / required (push) Successful in 1s
CI / validate (pull_request) Successful in 30s
CI / images (pull_request) Successful in 1m8s
CI / required (pull_request) Successful in 3s
CI / test (push) Successful in 3m25s
CI / benchmark (push) Successful in 1m48s
CI / images (push) Successful in 1m9s
CI / policy (pull_request) Successful in 8s
CI / test (pull_request) Successful in 3m25s
CI / benchmark (pull_request) Successful in 1m47s
CI / policy (push) Successful in 7s
Pattern days were the nearest working days on each side, so a weekday
public holiday was skipped. For Samedi Malin on Saturday 8 May 2027 the
planner therefore picked Wednesday 5 and Friday 7 May across Ascension,
a pattern the employer does not credit: the answer given at the October
2026 local representatives meeting (Thales group agreement, article 4)
keeps only "one CP day on each side" and "two CP days after" that year.

Each side now takes the nearest Monday-to-Friday dates, skipping only
weekends; a weekday public holiday ends the side, so that split is
unavailable. Fixtures that relied on Wednesday 8 May 2024 reaching across
Ascension, including the chained earned entitlements benchmark scenario,
now place their patterns on the other side of the holiday.

The frozen-engine check is unchanged: its 5,000 generated requests plan
identically, so the frozen bundle is not rebuilt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 10:37:07 +01:00
nessarandClaude Opus 5.5 cfd9a69f33 fix(i18n): translate planner messages and remaining English UI text
CI / build (pull_request) Successful in 38s
CI / security (pull_request) Successful in 1m5s
CI / build (push) Successful in 35s
CI / validate (push) Successful in 42s
CI / security (push) Successful in 1m44s
CI / required (push) Successful in 1s
CI / validate (pull_request) Successful in 43s
CI / test (pull_request) Successful in 2m58s
CI / images (pull_request) Successful in 1m15s
CI / required (pull_request) Successful in 1s
CI / benchmark (push) Successful in 1m31s
CI / test (push) Successful in 2m45s
CI / images (push) Successful in 54s
CI / policy (pull_request) Successful in 11s
CI / benchmark (pull_request) Successful in 1m42s
CI / policy (push) Successful in 6s
French (and German/Spanish) users saw English wherever the UI rendered
planning-engine reason messages or raw identifiers.

- Look up planner reasons by code in planning.reasons and
  planning.validationReasons instead of rendering reason.message; the
  engine keeps its English messages.
- Show calculation stages with their translated labels.
- Translate the Material datepicker labels and the comparison date
  placeholder; add the declared-day comparison reason.
- Keep <html lang> in sync with the loaded translation.
- Generate the registry with English first and `satisfies
  AppTranslations`, and test that every language has en.json's keys.
- Fix fr "Weekend" -> "Week-end".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 13:06:34 +01:00
nessarandClaude Opus 5.5 3175dcc55b feat(planning): report a lost server connection as connection-lost
CI / build (pull_request) Successful in 31s
CI / security (pull_request) Successful in 1m41s
CI / images (pull_request) Successful in 1m14s
CI / validate (push) Successful in 34s
CI / build (push) Successful in 26s
CI / security (push) Successful in 56s
CI / required (push) Successful in 1s
CI / validate (pull_request) Successful in 31s
CI / test (pull_request) Successful in 2m54s
CI / required (pull_request) Successful in 1s
CI / benchmark (push) Successful in 1m45s
CI / test (push) Successful in 2m41s
CI / images (push) Successful in 54s
CI / policy (pull_request) Successful in 8s
CI / benchmark (pull_request) Successful in 1m25s
CI / policy (push) Successful in 20s
A planning socket that closes after the server's first message now gives
a connection-lost incomplete calculation, shown as a warning with the
best valid plan kept, instead of the planner error alert. Closes the
server sends for a failed worker or a protocol violation (1003, 1007,
1008, 1009, 1011) and unparseable messages stay worker-error. Only the
close event decides, since an error event always precedes it and carries
no code. The liveness watchdog is unchanged.

Refs #330

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:10:45 +01:00
nessarandClaude Opus 5.5 99d1b9c2ec docs(context): keep the best valid plan for every incomplete calculation
The glossary limited the retained plan to user cancellation, while the
coordinator keeps it for every interruption and ADR 0011 keeps it after a
lost connection.

Refs #330

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:10:45 +01:00
nessarandClaude Opus 5.5 d018d5c1c3 refactor(planning): share the planning socket's job table with the server
PLANNING_JOBS in leave-planner.worker-messages.ts now lists each job
kind's follow-up messages and terminal responses, checked against
WorkerRequest and WorkerResponse. The server reads it in place of its own
TERMINAL_MESSAGES and cancel check, so a new job request type without an
entry fails the typecheck instead of closing sockets with 1008.

Refs #331

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:10:45 +01:00
nessarandClaude Opus 5.5 3044d507a2 refactor(server): name the planning terminal messages and error handler
Rename TERMINAL to TERMINAL_MESSAGES and the shared error handler to
internalError, which no longer shadows its parameter. Describe the
browser cancellation check for server planning and its local fallback.

Refs #319

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:10:45 +01:00
nessarandClaude Opus 5.5 aea16d29f2 docs(readme): state which planning socket messages close it
Refs #323

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:10:45 +01:00
nessarandClaude Opus 5.5 1df34e4acb docs: point stale planner references at ADR 0011
Mark ADR 0011 as implemented, cite it where docs/statistics.md still
named the client-side planner as a constraint, and say that development
runs calculate locally because they have no build identifier.

Refs #319

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:10:45 +01:00
nessarandClaude Opus 5.5 a12e27bfdc fix(planning): accept one job message and one cancel per planning socket
A socket could send any number of messages after its first: each extra
plan started another calculation in the same worker, and a waiting
socket buffered without limit, so one client could exhaust the server's
memory. A socket now carries its job message and, for a plan, at most
one cancel; anything else closes it with 1008. Only a plan can be
promoted by a cancel, since other jobs ignore it and would run in full
beyond PLANNING_WORKERS.

A worker that exits on its own now closes its socket with 1011 and
frees its slot instead of holding it until the client gives up.

Refs #323, #324

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:10:45 +01:00
nessarandClaude Opus 5.5 6e28939e26 feat(planning): queue server calculations beyond PLANNING_WORKERS
At most PLANNING_WORKERS jobs run at once; the others wait in arrival
order with a heartbeat every second, so the client's liveness timer
keeps running. A socket joins the line with its first message, and the
job's terminal message or the socket closing frees its slot for the
next one, so an idle open socket holds no core. Cancel or a close
removes a waiting job; a cancelled one runs at once and stops at its
first yield with the worker's own cancelled outcome.

PLANNING_WORKERS defaults to half the reported CPU threads. The
production Compose file drops the one-CPU and 512 MB limits, caps
memory at 8 GB and passes PLANNING_WORKERS through.

Closes #323

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:10:45 +01:00
nessarandClaude Opus 5.5 429b18ba64 feat(planning): limit server calculations per client IP
Each client IP, read from CF-Connecting-IP or else the socket's remote
address, may hold five admitted planning sockets. The server closes a
sixth with code 4429 before any message, so that tab calculates locally;
closing a socket frees its place. Incoming messages over 1 MB drop the
socket without running a calculation.

The README states that the limit holds only if the origin accepts
traffic from Cloudflare alone, since anyone else can forge the header.

Closes #324

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:10:45 +01:00
nessarandClaude Opus 5.5 63fc119297 feat(planning): calculate locally when client and server builds differ
`bun run build` now builds the browser and server bundles in one script
that defines a fresh PLANNING_BUILD identifier for both. The client sends
it when it opens a planning socket, and the server closes a socket from
another build, or without one, with code 4409 before any message, so a
tab opened before a deployment calculates with its own engine.

Development and test runs have no identifier: the client skips the
socket and calculates locally, and a server run from source accepts no
planning sockets.

Closes #325

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:10:45 +01:00
nessarandClaude Opus 5.5 e2a5a6f0e8 feat(planning): calculate plans on the server over a WebSocket
Each worker job (a plan, an incomplete-checkpoint explanation or a
counterfactual analysis) opens one same-origin socket at /api/planning
that carries the existing worker protocol as JSON. The Bun server runs
the unchanged planner worker in a Bun Worker per socket and terminates it
when the socket closes. The production build ships the worker as its own
entry point next to server.js.

On the client the socket is a second worker job, so liveness,
cancellation, checkpoints, explanations and supersession are unchanged.
Until the server first answers, a socket that fails, does not open
within 5 seconds or is closed falls back to a local worker and replays
the messages posted so far. A connection lost afterwards gives an
incomplete calculation with the retained plan, without a retry. Request
dates go out as Europe/Paris dates, as the core reads a Date.

Closes #320

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:10:45 +01:00
nessarandClaude Opus 5.5 dbc612336b ci: review pull requests with Claude on @claude comments
CI / build (pull_request) Successful in 38s
CI / security (pull_request) Successful in 1m1s
CI / validate (push) Successful in 36s
CI / build (push) Successful in 34s
CI / security (push) Successful in 1m5s
CI / required (push) Successful in 9s
CI / validate (pull_request) Successful in 32s
CI / images (pull_request) Successful in 1m16s
CI / required (pull_request) Successful in 1s
CI / benchmark (push) Successful in 1m49s
CI / test (push) Successful in 2m36s
CI / images (push) Successful in 1m7s
CI / policy (pull_request) Successful in 12s
CI / test (pull_request) Successful in 2m29s
CI / benchmark (pull_request) Successful in 1m45s
CI / policy (push) Successful in 18s
When the repository owner comments @claude on a PR, run Claude Code
headless with the checked-in code-review skill and post its review as a
PR comment. Claude gets read-only tools and never holds the Gitea token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:02:05 +01:00
nessarandClaude Opus 5.5 8326511dc9 docs(adr): plan on the server for every device
CI / build (pull_request) Successful in 25s
CI / security (pull_request) Successful in 1m0s
CI / validate (push) Successful in 32s
CI / build (push) Successful in 38s
CI / security (push) Successful in 1m2s
CI / required (push) Successful in 1s
CI / validate (pull_request) Successful in 36s
CI / test (pull_request) Successful in 1m55s
CI / images (pull_request) Successful in 1m22s
CI / required (pull_request) Successful in 3s
CI / benchmark (push) Successful in 1m19s
CI / test (push) Successful in 2m27s
CI / images (push) Successful in 1m18s
CI / policy (pull_request) Successful in 18s
CI / benchmark (pull_request) Successful in 1m47s
CI / policy (push) Successful in 13s
Record ADR 0011 for issue #319: the Bun server runs the planner over a
WebSocket carrying the existing worker protocol, with the browser engine
as a fallback. Mark ADR 0002 and ADR 0006's in-browser requirement as
superseded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 19:09:05 +01:00
nessarandClaude Opus 5.5 bc5ee50bd5 fix(planning): plan TIME_WINDOW rules on the picked calendar dates
CI / build (pull_request) Successful in 41s
CI / security (pull_request) Successful in 56s
CI / validate (push) Successful in 26s
CI / build (push) Successful in 30s
CI / security (push) Successful in 55s
CI / required (push) Successful in 1s
CI / validate (pull_request) Successful in 46s
CI / test (pull_request) Successful in 1m55s
CI / images (pull_request) Successful in 53s
CI / required (pull_request) Successful in 1s
CI / benchmark (push) Successful in 1m17s
CI / test (push) Successful in 1m49s
CI / images (push) Successful in 1m13s
CI / policy (pull_request) Successful in 7s
CI / benchmark (pull_request) Successful in 1m16s
CI / policy (push) Successful in 8s
Rule windows reached the planner as local-midnight Date objects, and the
planner read their Europe/Paris date, so east of Paris every window
started and ended one day early. Format them from local components as
YYYY-MM-DD before planning, as balances already are.

Closes #311

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 15:34:33 +02:00
nessarandClaude Opus 5.5 42134284e7 chore(deps): remove deprecated @angular/animations
CI / build (pull_request) Successful in 23s
CI / security (pull_request) Successful in 53s
CI / images (pull_request) Successful in 51s
CI / validate (push) Successful in 27s
CI / build (push) Successful in 32s
CI / security (push) Successful in 58s
CI / required (push) Successful in 6s
CI / validate (pull_request) Successful in 33s
CI / test (pull_request) Successful in 1m53s
CI / required (pull_request) Successful in 1s
CI / benchmark (push) Successful in 1m22s
CI / test (push) Successful in 2m1s
CI / images (push) Successful in 1m12s
CI / policy (pull_request) Successful in 14s
CI / benchmark (pull_request) Successful in 1m48s
CI / policy (push) Successful in 8s
Angular deprecated the package in favour of `animate.enter` and
`animate.leave`. Nothing in the app or in Angular Material imports it,
and `@angular/platform-browser` only lists it as an optional peer, so it
is dropped instead of migrated. Clears the Renovate dashboard warning in #56.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 15:09:18 +02:00
nessarandClaude Opus 5.5 f5d592ea5e chore(deps): automerge minor, patch, digest and pin Renovate updates
CI / build (pull_request) Successful in 31s
CI / security (pull_request) Successful in 58s
CI / validate (push) Successful in 27s
CI / build (push) Successful in 36s
CI / security (push) Successful in 59s
CI / required (push) Successful in 1s
CI / validate (pull_request) Successful in 33s
CI / images (pull_request) Successful in 1m13s
CI / required (pull_request) Successful in 1s
CI / benchmark (push) Successful in 1m23s
CI / test (push) Successful in 1m57s
CI / images (push) Successful in 52s
CI / policy (pull_request) Successful in 13s
CI / benchmark (pull_request) Successful in 1m17s
CI / test (pull_request) Successful in 1m54s
CI / policy (push) Successful in 7s
Renovate merges these updates with a merge commit once the required
check passes, three days after their release. Major updates stay manual.
The develop merge allowlist admits the renovate bot for this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 14:45:16 +02:00
nessarandClaude Opus 5.5 581c637029 ci: run push workflows only on develop, main and release tags
CI / build (pull_request) Successful in 25s
CI / security (pull_request) Successful in 1m5s
CI / validate (push) Successful in 28s
CI / build (push) Successful in 22s
CI / security (push) Successful in 1m6s
CI / required (push) Successful in 1s
CI / validate (pull_request) Successful in 28s
CI / test (pull_request) Successful in 2m31s
CI / images (pull_request) Successful in 1m21s
CI / required (pull_request) Successful in 1s
CI / benchmark (push) Successful in 1m47s
CI / test (push) Successful in 2m7s
CI / images (push) Successful in 1m17s
CI / policy (pull_request) Successful in 8s
CI / benchmark (pull_request) Successful in 1m30s
CI / policy (push) Successful in 11s
Every commit on a branch with an open PR ran the whole pipeline twice, once
for the push and once for the pull_request event, in separate concurrency
groups. Filter the push trigger to develop, main and v* tags so other
branches run CI and publish their images only through their PR. Tags are
listed explicitly because a branch filter alone stops tag pushes.

Update the trigger, benchmark and image prose in the README and the Gitea
Actions guide to match.

Refs #309

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 14:17:04 +02:00
nessarandClaude Opus 5.5 ff6c4d8122 fix(calendar): mark today and past days from the Europe/Paris date
CI / build (pull_request) Successful in 29s
CI / security (pull_request) Successful in 1m3s
CI / validate (push) Successful in 36s
CI / build (push) Successful in 34s
CI / security (push) Successful in 1m8s
CI / required (push) Successful in 1s
CI / validate (pull_request) Successful in 31s
CI / images (pull_request) Successful in 1m10s
CI / required (pull_request) Successful in 1s
CI / benchmark (push) Successful in 1m39s
CI / test (push) Successful in 2m20s
CI / images (push) Successful in 1m1s
CI / policy (pull_request) Successful in 8s
CI / benchmark (pull_request) Successful in 1m34s
CI / test (pull_request) Successful in 2m9s
CI / policy (push) Successful in 8s
The today marker and past styling used the device's local date while the
default planning horizon starts on the Paris date, so outside Paris time
near midnight the horizon's first day was not marked as today (CI in UTC
failed nightly). project() now takes an injectable now, derives today once
with planningDateInParis and returns it; calendar-month styles a day as
past when its date key is before that today.

Delete DateCacheService, monthsInAYearFromNow() and the default year of
getHolidays(), whose only remaining callers were their own specs.

Refs #301

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 14:06:52 +02:00
nessarandClaude Opus 5.5 d089c4670b docs(context): define today as the Europe/Paris calendar date
The today marker and past styling follow the same Paris date that
starts the default planning horizon (#301).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 14:06:52 +02:00
nessarandClaude Opus 5.5 c6af6d45ab feat(planning): warn of an overrun only past the displayed range
CI / build (pull_request) Successful in 34s
CI / security (pull_request) Successful in 55s
CI / validate (push) Successful in 31s
CI / build (push) Successful in 29s
CI / security (push) Successful in 1m31s
CI / required (push) Successful in 3s
CI / validate (pull_request) Successful in 22s
CI / test (pull_request) Successful in 1m45s
CI / images (pull_request) Successful in 53s
CI / required (pull_request) Successful in 2s
CI / benchmark (push) Successful in 1m53s
CI / test (push) Successful in 2m12s
CI / images (push) Successful in 1m15s
CI / policy (pull_request) Successful in 7s
CI / benchmark (pull_request) Successful in 1m9s
CI / policy (push) Successful in 12s
The expected wait sits near the middle of recent waits, so about half of
all runs pass it. Between the expected wait and the top of the range
shown before Calculate, the percentage now holds at 95% with no
remaining-time line; "Taking longer than expected" appears and is
announced only past that top.

Refs #300

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:45:28 +02:00
nessarandClaude Opus 5.5 58be749949 feat(planning): follow the indicative wait in calculation progress
The overlay percentage now rises linearly to 95% at the expected wait
captured at Calculate, holds there, and shows 100% only when the planner
completes. Beneath the status, one line names the current planning stage
(with the rule name for rule stages) and another shows the approximate
remaining time, or "Taking longer than expected" once the wait is
exceeded, announced once through the live status. Cancel freezes the
percentage and hides both lines.

PlanningCalculationService reports the stage and submitted request
instead of fixed per-stage percentages; PlanningDurationService owns the
wait progress on a 250 ms tick.

Closes #300

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:45:28 +02:00
nessarandClaude Opus 5.5 35a63d24c4 docs(context): define planning stage and indicative wait
Both terms are user-visible in the calculation overlay that #300
revises: the stage line names the planning stage, and the remaining
time comes from the indicative wait.

Refs #300.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:45:28 +02:00
nessarandClaude Opus 5.5 8414c02e10 chore: ignore Claude Code local files
CI / build (pull_request) Successful in 23s
CI / security (pull_request) Successful in 1m0s
CI / validate (push) Successful in 38s
CI / build (push) Successful in 36s
CI / security (push) Successful in 56s
CI / required (push) Successful in 2s
CI / validate (pull_request) Successful in 27s
CI / test (pull_request) Successful in 1m54s
CI / images (pull_request) Successful in 55s
CI / required (pull_request) Successful in 1s
CI / benchmark (push) Successful in 1m16s
CI / test (push) Successful in 1m54s
CI / images (push) Successful in 52s
CI / policy (pull_request) Successful in 12s
CI / benchmark (pull_request) Successful in 1m48s
CI / policy (push) Successful in 8s
.claude is a symlink to .agents/, so Claude Code's personal settings
and temporary worktrees land under .agents/. Ignore those paths while
keeping shared settings and skills trackable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:26:33 +02:00
nessar abfbca1d45 test(benchmark): calibrate again after the protocol and judge against the slower value
CI / validate (push) Successful in 33s
CI / build (push) Successful in 23s
CI / security (push) Successful in 57s
CI / required (push) Successful in 2s
CI / test (push) Successful in 1m49s
CI / benchmark (push) Successful in 1m49s
CI / images (push) Successful in 1m21s
CI / policy (push) Successful in 7s
See pull request #308
2026-10-19 10:24:14 +02:00
nessarandClaude Sonnet 5.5 b37101435a test(benchmark): calibrate again after the protocol and judge against the slower value
CI / validate (push) Successful in 30s
CI / build (push) Successful in 36s
CI / security (push) Successful in 1m5s
CI / build (pull_request) Successful in 23s
CI / security (pull_request) Successful in 58s
CI / required (push) Successful in 1s
CI / benchmark (push) Successful in 1m14s
CI / validate (pull_request) Successful in 29s
CI / test (push) Successful in 1m54s
CI / images (push) Successful in 56s
CI / test (pull_request) Successful in 1m49s
CI / images (pull_request) Successful in 1m16s
CI / required (pull_request) Successful in 2s
CI / policy (push) Successful in 8s
CI / policy (pull_request) Successful in 8s
CI / benchmark (pull_request) Successful in 1m46s
The relative gate calibrated once before the scenarios, so load that
started afterwards (the push and pull_request runs of one commit overlap
on the same runner, next to the test, build and image jobs) slowed the
scenarios but not the yardstick. A pull_request run failed `two years`
at 1653.1 ms against a 1648.7 ms budget this way.

The spec now repeats the calibration after the protocol and uses the
slower of the two values. The budgets can only loosen, never tighten,
and the log reprints the table with the budgets actually applied when
they change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-19 10:11:26 +02:00
nessar 7fc3457b63 perf(planning): plan from the best-ranked obligation solution and remove repeated work
CI / validate (push) Successful in 33s
CI / build (push) Successful in 36s
CI / security (push) Successful in 56s
CI / required (push) Successful in 2s
CI / benchmark (push) Successful in 1m10s
CI / test (push) Successful in 2m2s
CI / images (push) Successful in 53s
CI / policy (push) Successful in 7s
close #302

See pull request #303
2026-10-18 23:47:13 +02:00
nessarandClaude Opus 5.5 31cb4a499c fix(planning): recalibrate the duration estimate to the faster engine
CI / validate (push) Successful in 36s
CI / build (push) Successful in 23s
CI / security (push) Successful in 1m10s
CI / build (pull_request) Successful in 23s
CI / security (pull_request) Successful in 1m0s
CI / required (push) Successful in 1s
CI / images (pull_request) Successful in 53s
CI / validate (pull_request) Successful in 25s
CI / benchmark (push) Successful in 1m29s
CI / test (push) Successful in 2m16s
CI / images (push) Successful in 59s
CI / test (pull_request) Successful in 2m6s
CI / required (pull_request) Successful in 1s
CI / policy (push) Successful in 20s
CI / policy (pull_request) Successful in 8s
CI / benchmark (pull_request) Successful in 1m27s
Rendered waits after #302, in throttled headless Chromium, were well
below the shown ranges: two years waited 1.9 s against 3-24 s, three
years 4.5 s against 11-68 s, and the loaded year 4.0 s against 4-26 s.
The prior keeps its structure with refitted, rounded constants,
400 + 250 x (D/365.25)^0.5 x (P/30)^1.5 x R, which stays within about
1.2 times of all six measured configurations. Five years with 30 days
per year now shows 6-37 s instead of 44-265 s. Local refinement is
unchanged.

The 4x CPU throttle slows only the main thread, not the planning
worker, so phones can still wait longer than these desktop samples.

Part of #302.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 23:31:28 +02:00
nessarandClaude Opus 5.5 75320da685 docs(benchmark): compare engines by hand before each frozen-engine rebuild
A standing "no worse than the previous engine" check is not added to
CI: the differential check already fails on unintended changes, and a
fixed acceptance threshold would need renegotiating with every
deliberate change. Instead, the rebuild procedure now runs the
comparison while the frozen engine is still the previous one, and
records it with the change. The runner compares against the frozen
engine by default and takes `calibration` to reproduce the #302 record.

Part of #302.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 22:12:50 +02:00
nessarandClaude Opus 5.5 fe705fe618 fix(planning): keep counterfactual moves off the shared final plan
CI / validate (push) Successful in 46s
CI / build (push) Successful in 25s
CI / security (push) Successful in 1m11s
CI / build (pull_request) Successful in 23s
CI / security (pull_request) Successful in 1m0s
CI / required (push) Successful in 1s
CI / validate (pull_request) Successful in 26s
CI / benchmark (push) Successful in 1m28s
CI / test (push) Successful in 2m27s
CI / images (push) Successful in 1m0s
CI / images (pull_request) Successful in 54s
CI / required (pull_request) Successful in 1s
CI / policy (push) Successful in 28s
CI / policy (pull_request) Successful in 7s
CI / benchmark (pull_request) Successful in 1m33s
CI / test (pull_request) Successful in 2m6s
Since assigning a date shares unchanged activations with the parent
state, counterfactual analysis edited an activation it shared with the
final plan, so a later alternative date could inherit an earlier one's
dates and be judged eligible. It now replaces the moved activation.
Every counterfactual over seeds 280000-289999 matches the engine before
the sharing step again.

When every one of several obligation solutions fails earned-entitlement
chronology, the planner again reports the obligation conflict, as when
every preview failed. No seeded request reaches that path, so the
frozen engine is unchanged.

Also marks the ranking's known limit as a shortcut and fixes stale
documentation found in review.

Part of #302.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 21:49:55 +02:00
nessarandClaude Opus 5.5 676ea24410 test(benchmark): tighten the relative gate to the measured speed
After #302, the development machine's protocol takes about 41 seconds
instead of 232. The budget multipliers now add about 1.5 times headroom
to the new ratios (0.1 for typed obligations, which leaves room for
runner jitter), and the hang guard drops from 600 to 240 seconds, with
a 210-second test timeout: about three times the expected run on
srvhome, which is about 1.9 times slower than nessar-desktop.

Part of #286 and #302. The gate still needs a passing CI benchmark on
two runners.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 21:36:37 +02:00
nessarandClaude Opus 5.5 6c9ff4ae34 test(planning): rebuild the frozen engine from the obligation ranking
The frozen engine of the differential check is rebuilt from 8168137,
which plans from the best-ranked obligation solution, with the
documented build command. The check passes again, including its
cancelled asynchronous comparisons and generator-coverage assertions.
The calibration engine stays at a871f8f.

Part of #302.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 21:18:40 +02:00
nessarandClaude Opus 5.5 8168137cd5 perf(planning): plan from the best-ranked obligation solution
With several obligation solutions, the planner ran the whole preference
chain on candidate solutions as previews: every solution after a
complete enumeration, or the eight best-ranked after a truncated window
search. It now orders all solutions by the existing pre-preference
ranking (active objectives, then tie-breaks, of each obligation-only
plan; equal ranks keep enumeration order) and runs the preference
stages once, on the first. If that run ends with earned leave available
only after its final merged time-off period, the stages restart on the
next solution, so a request that planned before never becomes a
conflict.

The loaded year drops from 43 to 5.5 seconds and typed obligations from
3.3 to 0.1 seconds, with byte-identical benchmark plans. Over the 5,000
seeded requests, 23 plans become worse (9 on a real objective) and 1
better; over 50 loaded-year-sized requests, 4 become worse on a real
objective. ADR 0010 records the decision; docs/benchmark/issue-302.md
records the comparison and the opt-in runner that reproduces it.

The frozen-engine check fails until the frozen engine is rebuilt from
this commit in the next one.

Part of #302.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 21:18:06 +02:00
nessarandClaude Opus 5.5 aa6a0c6f1b perf(planning): copy only the debited balance when assigning a date
Assigning a date copied every balance and every earned activation.
Balances and activations are only edited right after a state copies
them, so the new state now shares them with its parent, except the
balance it debits. Placement copying is unchanged.

Part of #302.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 20:08:12 +02:00
nessarandClaude Opus 5.5 9d9404c3db perf(planning): validate each optimization configuration once
Every objective evaluation revalidated its optimization configuration.
Rule normalization already validates each configuration once per
calculation and keeps its own copy, the presets are constant, and the
summed variant of a valid configuration stays valid, so the core now
scores them without revalidating. evaluateOptimization still validates
for other callers.

Part of #302.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 20:03:22 +02:00
nessarandClaude Opus 5.5 b7ec411c92 perf(planning): yield between asynchronous slices without a timer
Each slice of the asynchronous adapter waited for a zero-delay timer:
about 1.1 ms in Bun, and at least 4 ms in browsers once timers nest.
Browsers now yield through a message-channel task. Bun runs port
messages ahead of timers and incoming worker messages, which starved
cancellation and heartbeats, so it yields with setImmediate. Both still
let queued cancellation and heartbeat tasks run between slices.

Part of #302.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 19:58:40 +02:00
nessarandClaude Opus 5.5 2fcba758c8 perf(planning): retain the best valid plan more cheaply
Retaining a better valid plan reconciled its optimization provenance,
which evaluated every active objective once per credited placement with
that placement released. Only the credited objectives are compared, so
the released plan now evaluates just those and skips observing the
others. Retention also stops computing quality metrics that nothing
read. The retained plan and what Cancel returns are unchanged.

Part of #302.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 19:50:58 +02:00
nessarandClaude Opus 5.5 0b0bb8f9a8 perf(planning): reuse the donor ranking across public-holiday weeks
The holiday-week stage ranked every placement as a donor once per
public-holiday week, although the ranking depends only on the plan. The
weeks of one plan now share each placement's released objectives; each
week still skips its own dates and walks the placements in the same
order with the same yields.

Part of #302.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 19:45:21 +02:00
nessarandClaude Opus 5.5 b356117263 test(benchmark): keep the a871f8f engine as a fixed calibration engine
The differential check's frozen bundle will be rebuilt for #302; the
relative gate keeps timing the unchanged a871f8f bundle so its ratios
stay comparable with the recorded history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 19:14:28 +02:00
nessar ba05fe88b3 chore(deps): update node.js to v24.22.0
CI / build (push) Successful in 34s
CI / validate (push) Successful in 2m4s
CI / security (push) Successful in 1m33s
CI / required (push) Successful in 1s
CI / benchmark (push) Successful in 4m34s
CI / test (push) Successful in 4m49s
CI / images (push) Successful in 2m19s
CI / policy (push) Successful in 10s
2026-10-18 13:32:24 +02:00
nessarandClaude Opus 5.5 cc3664454a docs(ci): note the Node 24.22.0 job containers
CI / validate (push) Successful in 32s
CI / security (push) Successful in 57s
CI / build (push) Successful in 2m57s
CI / security (pull_request) Successful in 1m37s
CI / build (pull_request) Successful in 4m55s
CI / required (push) Successful in 1s
CI / test (push) Successful in 3m29s
CI / benchmark (push) Successful in 5m4s
CI / test (pull_request) Successful in 3m26s
CI / validate (pull_request) Successful in 7m13s
CI / images (push) Successful in 1m8s
CI / images (pull_request) Successful in 1m23s
CI / required (pull_request) Successful in 2s
CI / policy (push) Successful in 8s
CI / policy (pull_request) Successful in 9s
CI / benchmark (pull_request) Successful in 7m33s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 13:15:53 +02:00
nessar 711c9e00c3 chore(deps): update https://gitea.com/actions/checkout action to v7
CI / build (push) Successful in 35s
CI / security (push) Successful in 1m46s
CI / validate (push) Successful in 4m19s
CI / required (push) Successful in 5s
CI / test (push) Successful in 3m44s
CI / benchmark (push) Successful in 5m15s
CI / images (push) Successful in 1m25s
CI / policy (push) Successful in 8s
2026-10-18 13:15:21 +02:00
nessar 5ee95fe9ca chore(deps): update https://gitea.com/actions/upload-artifact action to v7
CI / validate (push) Successful in 34s
CI / security (push) Successful in 55s
CI / build (push) Successful in 3m22s
CI / required (push) Failing after 2s
CI / test (push) Failing after 4m57s
CI / benchmark (push) Successful in 8m0s
CI / images (push) Skipped
CI / policy (push) Successful in 16s
2026-10-18 00:07:18 +02:00
nessar 880efe4e90 chore(deps): update angular-cli monorepo to v22.2.3
CI / validate (push) Successful in 36s
CI / security (push) Successful in 55s
CI / build (push) Successful in 6m46s
CI / required (push) Successful in 3s
CI / benchmark (push) Successful in 7m56s
CI / test (push) Successful in 12m52s
CI / images (push) Successful in 2m4s
CI / policy (push) Successful in 17s
2026-10-17 23:44:49 +02:00
nessarandClaude Opus 5.5 c59d75e526 chore(deps): update angular-cli monorepo to v22.2.3
CI / validate (push) Successful in 49s
CI / security (push) Successful in 1m0s
CI / build (push) Successful in 4m45s
CI / build (pull_request) Successful in 1m6s
CI / security (pull_request) Successful in 1m4s
CI / required (push) Successful in 3s
CI / test (push) Successful in 3m7s
CI / validate (pull_request) Successful in 1m56s
CI / benchmark (push) Successful in 7m57s
CI / test (pull_request) Successful in 5m23s
CI / images (push) Successful in 1m17s
CI / images (pull_request) Successful in 2m8s
CI / required (pull_request) Successful in 1s
CI / policy (push) Successful in 10s
CI / policy (pull_request) Successful in 8s
CI / benchmark (pull_request) Successful in 5m30s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 23:31:52 +02:00
nessar b086f1ffc8 fix(deps): update angular monorepo to v22.2.3
CI / build (push) Successful in 33s
CI / validate (push) Successful in 1m17s
CI / security (push) Successful in 1m48s
CI / required (push) Successful in 2s
CI / test (push) Successful in 3m12s
CI / benchmark (push) Successful in 5m54s
CI / images (push) Successful in 1m39s
CI / policy (push) Successful in 13s
2026-10-17 23:27:45 +02:00
nessar 9158966982 chore(deps): update docker docker tag to v29.9.1
CI / validate (push) Successful in 1m58s
CI / build (push) Successful in 2m31s
CI / security (push) Successful in 1m3s
CI / required (push) Successful in 3s
CI / benchmark (push) Successful in 5m5s
CI / test (push) Successful in 8m8s
CI / images (push) Successful in 1m0s
CI / policy (push) Successful in 11s
2026-10-17 23:05:22 +02:00
nessarandClaude Opus 5.5 d9c7f72461 docs(ci): note the Docker 29.9.1 image
CI / build (push) Successful in 40s
CI / security (push) Successful in 1m44s
CI / build (pull_request) Successful in 1m33s
CI / security (pull_request) Successful in 1m1s
CI / validate (push) Successful in 11m34s
CI / required (push) Successful in 5s
CI / test (push) Successful in 3m6s
CI / validate (pull_request) Successful in 39s
CI / benchmark (push) Successful in 9m44s
CI / images (pull_request) Successful in 2m42s
CI / required (pull_request) Successful in 1s
CI / images (push) Successful in 1m25s
CI / policy (push) Successful in 8s
CI / policy (pull_request) Successful in 10s
CI / test (pull_request) Successful in 5m18s
CI / benchmark (pull_request) Successful in 7m56s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 21:24:11 +02:00
nessar 85fc4561fd build: run the project on Bun 1.4.3
CI / validate (push) Successful in 38s
CI / build (push) Successful in 24s
CI / security (push) Successful in 1m42s
CI / required (push) Successful in 1s
CI / test (push) Successful in 2m48s
CI / benchmark (push) Successful in 4m48s
CI / images (push) Successful in 58s
CI / policy (push) Successful in 19s
close #289, close #291, close #292

See pull request #299
2026-10-17 18:28:42 +02:00