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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
The generated HTML and Cobertura reports no longer show unmeasured
branch and function coverage as 100%. Poll and waitFor deadlines use
performance.now so frozen dates cannot make them loop forever, the
malformed-configuration test covers undefined again next to the empty
array, compose health checks honor PORT, and the migration spec lists
only what is still open.
Refs #291, #292, #293
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pin Bun 1.4.3 with packageManager, and force every bun run script onto
the Bun runtime through bunfig so ng, ESLint and Prettier never fall
back to an installed Node. Type checking uses bun check for the
application and test projects, next to the Angular build.
CI jobs install the pinned release from a checksum-verified download
instead of npm and run project steps in a shell without Node on PATH,
which stays available only for the checkout and upload actions. The
image test's fake docker runs on Bun.
Refs #290, #293
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Angular's server build needs Node loader hooks that Bun does not apply,
and every route is client-rendered, so Angular now builds a client-only
bundle and a small Bun.serve server delivers it: hashed assets with the
one-year cache, index.html revalidated, extension-less routes falling
back to index.html, missing assets 404, traversal and malformed paths
rejected, and other methods 405. Express, @angular/ssr and the unused
hydration provider are removed. Both Docker stages use the pinned
oven/bun:1.4.3-alpine image without Node, and the health checks use
Bun's fetch.
Refs #292
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace Vitest with bun test across the whole suite. A preload compiles
components through Angular's JIT transform with inlined templates, sets
up jsdom, TestBed and zoneless change detection, and a small shim covers
the Vitest APIs bun:test lacks. Files run isolated, real-worker specs
spawn the running Bun, and line coverage from lcov is converted to the
existing HTML and Cobertura reports. The CI benchmark replaces its heap
cap with a container memory limit. Vitest, Jest, Nx and their Vite
configuration are removed.
Refs #291
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stable Bun 1.4.3 runs installs, the development server, standalone type
checks, the native test runner and a Bun.serve static server. Native
lint/fmt are canary-only, and Angular's server build needs Node loader
hooks Bun does not apply, so the spec now keeps ESLint/Prettier until a
stable release, builds Angular client-only behind a Bun static server,
converts line coverage from lcov, and replaces the heap cap with a
container memory limit.
Refs #289
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record the proposed decision to run project-owned JavaScript under Bun
with its native test runner, linter, formatter, type checker and HTTP
server, keeping Angular's standard build pipeline, plus the development
spec for the migration tickets.
Refs #289
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PlanningCalculationService now builds the submitted request, owns the
pending and accepted calculation state, and delivers explanations for
the accepted calculation only. The duration estimator reads the same
request. The calendar and leave-balance summary consume the accepted
outcome instead of coordinating writable state on the input service.
Refs #275
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Print the calibration and a Markdown table with one aligned row per
scenario as soon as it finishes: both planning times, mean, budget, ratio,
multiplier, outcome, placements, determinism and budget status. Write
directly to stdout so Vitest adds no per-line headers. The complete TSV
report still follows the table.
Refs #281, #285
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first PR run landed on srvhome, about 1.9 times slower than
nessar-desktop. The fixed 300-second timeout killed its protocol during the
loaded year, although every completed scenario was within its relative
budget. Raise the CI timeout to 600 seconds and the test timeout to 570
seconds so they only guard against hangs, and record the first CI-runner
ratios.
Refs #285
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The exact optimizations bring the loaded year from 66.0 s to 44.1 s, but the
target of 10 s for the loaded year and 3 s for the other scenarios is not
reached for the loaded year, typed obligations and three years. Record the
gap and the remaining profile, keep the relative-gate multipliers and the
300-second hang guard unchanged, and note that ADR 0003's five-second target
should be revisited together with a decision on search changes.
Refs #286
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Before the protocol, time the frozen engine on the two-year scenario, best
of three, and fail any scenario whose mean planning time exceeds its
multiplier times that calibration. Multipliers come from development-machine
ratios with about 1.5x headroom until #286 tightens them. The 300-second
timeout stays only as a hang guard. The benchmark keeps running on push and
pull_request events because the push run gates image publication.
This replaces the absolute 300-second acceptance protocol named in #78.
Refs #285
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Finalizing a candidate never moves or retypes a placement, so preference
results and calendar optimizations already have their final values before
it, and leave-balance optimizations do too when nothing can be earned.
Reject a candidate before finalizing when the first differing such
objective of the protected prefix is worse than the baseline. Leave-placement
objectives and earning contexts stop the walk.
The frozen-engine check now also compares cancelled asynchronous runs,
including checkpoints and retained incumbents. The loaded year drops from
48.5 s to 44.3 s; outcomes, explanations and final states are unchanged.
Refs #284
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cache an immutable occupancy per placements map and derive a candidate's
time-off period groups, holiday-week completeness and placement tie key
from its parent when one date is added or removed. The from-scratch
computation stays as the test oracle and an opt-in shadow mode. A
fast-check property test compares both after every operation.
The loaded year drops from 66.5 s to 48.5 s and the protocol from 262.0 s
to 193.7 s. Outcomes, explanations and final states stay identical.
Refs #283
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move time-off periods, work sequences, public-holiday weeks, balance
observations, the placement list and both tie keys into
plan-observations.ts. The code moves without behavior changes; all seven
benchmark scenarios produce byte-identical outcomes, explanations and final
states, and the frozen-engine check passes. Benchmark timings stay within
noise.
Refs #282
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bundle the planning core at a871f8f (develop after PR #278) as a frozen
fixture and compare it with the current engine on 5,000 seeded random
requests. Outcomes, stable explanations, explanation errors and final-state
snapshots must be strictly deep-equal. Requests cover obligations,
preferences, IF_THEN and TIME_WINDOW rules, earned entitlements, composed
optimization rules, declared days, year boundaries and public holidays.
Refs #280
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reduce objective evaluation and calendar allocation work while preserving planner outcomes and deterministic explanations. Restore required benchmark gating and record the unchanged protocol, differential checks, and browser evidence for #78.