Commit Graph
73 Commits
Author SHA1 Message Date
nessarandClaude Fable 5.2 7ebc87be33 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-13 18:41:55 +01:00
nessarandClaude Fable 5.2 2dbd23230c fix(planning-duration): refit the indicative wait and calibrate it from similar calculations
CI / validate (pull_request) Successful in 33s
CI / build (pull_request) Successful in 38s
CI / security (pull_request) Successful in 1m43s
CI / images (pull_request) Successful in 1m12s
CI / required (pull_request) Successful in 1s
CI / validate (push) Successful in 28s
CI / test (push) Successful in 2m58s
CI / benchmark (push) Successful in 1m21s
CI / build (push) Successful in 33s
CI / security (push) Successful in 1m43s
CI / required (push) Successful in 1s
CI / policy (pull_request) Successful in 9s
CI / test (pull_request) Successful in 3m0s
CI / benchmark (pull_request) Successful in 1m21s
CI / policy (push) Successful in 9s
CI / images (push) Successful in 1m14s
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 / validate (pull_request) Successful in 33s
CI / build (pull_request) Successful in 33s
CI / security (pull_request) Successful in 1m41s
CI / images (pull_request) Successful in 1m12s
CI / required (pull_request) Successful in 2s
CI / validate (push) Successful in 28s
CI / test (push) Successful in 3m30s
CI / benchmark (push) Successful in 1m50s
CI / build (push) Successful in 32s
CI / security (push) Successful in 1m56s
CI / required (push) Successful in 2s
CI / policy (pull_request) Successful in 10s
CI / test (pull_request) Successful in 3m32s
CI / benchmark (pull_request) Successful in 1m49s
CI / policy (push) Successful in 7s
CI / images (push) Successful in 1m16s
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 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 Opus 5.5 3175dcc55b feat(planning): report a lost server connection as connection-lost
CI / validate (pull_request) Successful in 31s
CI / build (pull_request) Successful in 31s
CI / security (pull_request) Successful in 1m41s
CI / images (pull_request) Successful in 1m14s
CI / required (pull_request) Successful in 1s
CI / validate (push) Successful in 34s
CI / build (push) Successful in 26s
CI / security (push) Successful in 56s
CI / benchmark (push) Successful in 1m45s
CI / test (push) Successful in 2m41s
CI / required (push) Successful in 1s
CI / policy (pull_request) Successful in 8s
CI / benchmark (pull_request) Successful in 1m25s
CI / test (pull_request) Successful in 2m54s
CI / policy (push) Successful in 20s
CI / images (push) Successful in 54s
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 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 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 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 / images (pull_request) Successful in 1m16s
CI / required (pull_request) Successful in 1s
CI / validate (push) Successful in 36s
CI / build (push) Successful in 34s
CI / security (push) Successful in 1m5s
CI / benchmark (push) Successful in 1m49s
CI / test (push) Successful in 2m36s
CI / required (push) Successful in 9s
CI / policy (pull_request) Successful in 12s
CI / validate (pull_request) Successful in 32s
CI / test (pull_request) Successful in 2m29s
CI / benchmark (pull_request) Successful in 1m45s
CI / policy (push) Successful in 18s
CI / images (push) Successful in 1m7s
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 / images (pull_request) Successful in 1m22s
CI / required (pull_request) Successful in 3s
CI / validate (push) Successful in 32s
CI / benchmark (push) Successful in 1m19s
CI / build (push) Successful in 38s
CI / security (push) Successful in 1m2s
CI / test (push) Successful in 2m27s
CI / required (push) Successful in 1s
CI / policy (pull_request) Successful in 18s
CI / validate (pull_request) Successful in 36s
CI / benchmark (pull_request) Successful in 1m47s
CI / test (pull_request) Successful in 1m55s
CI / policy (push) Successful in 13s
CI / images (push) Successful in 1m18s
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 581c637029 ci: run push workflows only on develop, main and release tags
CI / validate (pull_request) Successful in 28s
CI / build (pull_request) Successful in 25s
CI / security (pull_request) Successful in 1m5s
CI / images (pull_request) Successful in 1m21s
CI / required (pull_request) Successful in 1s
CI / validate (push) Successful in 28s
CI / build (push) Successful in 22s
CI / security (push) Successful in 1m6s
CI / benchmark (push) Successful in 1m47s
CI / test (push) Successful in 2m7s
CI / required (push) Successful in 1s
CI / policy (pull_request) Successful in 8s
CI / benchmark (pull_request) Successful in 1m30s
CI / test (pull_request) Successful in 2m31s
CI / policy (push) Successful in 11s
CI / images (push) Successful in 1m17s
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 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 / images (pull_request) Successful in 53s
CI / required (pull_request) Successful in 2s
CI / validate (push) Successful in 31s
CI / build (push) Successful in 29s
CI / benchmark (push) Successful in 1m53s
CI / security (push) Successful in 1m31s
CI / test (push) Successful in 2m12s
CI / required (push) Successful in 3s
CI / policy (pull_request) Successful in 7s
CI / validate (pull_request) Successful in 22s
CI / benchmark (pull_request) Successful in 1m9s
CI / test (pull_request) Successful in 1m45s
CI / policy (push) Successful in 12s
CI / images (push) Successful in 1m15s
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 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 / benchmark (push) Successful in 1m14s
CI / security (push) Successful in 1m5s
CI / test (push) Successful in 1m54s
CI / build (pull_request) Successful in 23s
CI / security (pull_request) Successful in 58s
CI / required (push) Successful in 1s
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 / validate (pull_request) Successful in 29s
CI / images (push) Successful in 56s
CI / benchmark (pull_request) Successful in 1m46s
CI / test (pull_request) Successful in 1m49s
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
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 / validate (pull_request) Successful in 25s
CI / benchmark (push) Successful in 1m29s
CI / security (push) Successful in 1m10s
CI / build (pull_request) Successful in 23s
CI / test (push) Successful in 2m16s
CI / security (pull_request) Successful in 1m0s
CI / required (push) Successful in 1s
CI / images (pull_request) Successful in 53s
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
CI / images (push) Successful in 59s
CI / test (pull_request) Successful in 2m6s
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 / benchmark (push) Successful in 1m28s
CI / security (push) Successful in 1m11s
CI / build (pull_request) Successful in 23s
CI / test (push) Successful in 2m27s
CI / security (pull_request) Successful in 1m0s
CI / required (push) Successful in 1s
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 / validate (pull_request) Successful in 26s
CI / benchmark (pull_request) Successful in 1m33s
CI / images (push) Successful in 1m0s
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
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 / test (push) Successful in 3m29s
CI / build (push) Successful in 2m57s
CI / benchmark (push) Successful in 5m4s
CI / security (pull_request) Successful in 1m37s
CI / build (pull_request) Successful in 4m55s
CI / required (push) Successful in 1s
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 / test (pull_request) Successful in 3m26s
CI / validate (pull_request) Successful in 7m13s
CI / images (push) Successful in 1m8s
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
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 / test (push) Successful in 3m6s
CI / benchmark (push) Successful in 9m44s
CI / build (pull_request) Successful in 1m33s
CI / security (pull_request) Successful in 1m1s
CI / validate (push) Successful in 11m34s
CI / images (pull_request) Successful in 2m42s
CI / required (pull_request) Successful in 1s
CI / required (push) Successful in 5s
CI / policy (push) Successful in 8s
CI / policy (pull_request) Successful in 10s
CI / validate (pull_request) Successful in 39s
CI / test (pull_request) Successful in 5m18s
CI / benchmark (pull_request) Successful in 7m56s
CI / images (push) Successful in 1m25s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 21:24:11 +02:00
nessarandClaude Opus 5.5 282d9c6787 fix: report line-only coverage honestly and tighten Bun test helpers
CI / validate (push) Successful in 41s
CI / build (push) Successful in 36s
CI / validate (pull_request) Successful in 32s
CI / security (push) Successful in 1m3s
CI / test (push) Successful in 3m3s
CI / build (pull_request) Successful in 23s
CI / security (pull_request) Successful in 57s
CI / benchmark (push) Successful in 5m19s
CI / required (push) Successful in 3s
CI / images (pull_request) Successful in 54s
CI / required (pull_request) Successful in 1s
CI / policy (push) Successful in 7s
CI / policy (pull_request) Successful in 10s
CI / test (pull_request) Successful in 3m25s
CI / benchmark (pull_request) Successful in 4m48s
CI / images (push) Successful in 1m20s
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>
2026-10-17 16:10:29 +02:00
nessarandClaude Opus 5.5 ac69a41fc8 ci: run development, quality checks and CI on Bun 1.4.3
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>
2026-10-17 14:25:46 +02:00
nessarandClaude Opus 5.5 f74d744f9b feat(server): serve the client-only build with Bun
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>
2026-10-17 13:50:05 +02:00
nessarandClaude Opus 5.5 94d57add2c test: run the suite and benchmark with Bun's native test runner
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>
2026-10-17 13:40:42 +02:00
nessarandClaude Opus 5.5 558c70aa24 docs(adr): record Bun 1.4.3 verification results and decisions
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>
2026-10-17 12:49:17 +02:00
nessarandClaude Opus 5.5 c949480e49 docs(adr): propose Bun runtime and native tooling
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>
2026-10-17 12:01:42 +02:00
nessarandClaude Opus 5.5 5cb0b93339 refactor(planning): give planning calculations one state owner
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>
2026-10-17 11:11:37 +02:00
nessarandClaude Opus 5.5 3bbe989eca test(benchmark): print a readable summary table
CI / validate (push) Successful in 1m5s
CI / build (push) Successful in 1m38s
CI / security (push) Successful in 1m19s
CI / test (push) Successful in 3m29s
CI / validate (pull_request) Successful in 1m42s
CI / benchmark (push) Successful in 4m13s
CI / security (pull_request) Successful in 56s
CI / build (pull_request) Successful in 1m42s
CI / required (push) Successful in 1s
CI / images (pull_request) Successful in 1m11s
CI / required (pull_request) Successful in 1s
CI / policy (push) Successful in 7s
CI / policy (pull_request) Successful in 10s
CI / test (pull_request) Successful in 3m8s
CI / images (push) Successful in 1m15s
CI / benchmark (pull_request) Successful in 3m37s
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>
2026-10-17 02:09:54 +02:00
nessarandClaude Opus 5.5 cfdb28c90a ci(benchmark): size the hang guard for the slowest runner
CI / validate (push) Successful in 53s
CI / build (push) Successful in 1m18s
CI / security (push) Successful in 1m12s
CI / benchmark (push) Successful in 3m56s
CI / test (push) Successful in 4m6s
CI / build (pull_request) Successful in 36s
CI / security (pull_request) Successful in 1m5s
CI / required (push) Successful in 1s
CI / images (pull_request) Successful in 1m50s
CI / required (pull_request) Successful in 1s
CI / policy (push) Successful in 6s
CI / policy (pull_request) Successful in 9s
CI / validate (pull_request) Successful in 1m18s
CI / test (pull_request) Successful in 3m2s
CI / images (push) Successful in 1m15s
CI / benchmark (pull_request) Successful in 7m18s
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>
2026-10-17 01:40:41 +02:00
nessarandClaude Opus 5.5 63b50c4311 docs(benchmark): record the remaining gap to the speed target
CI / validate (push) Successful in 1m1s
CI / build (push) Successful in 1m27s
CI / security (push) Successful in 1m16s
CI / validate (pull_request) Successful in 1m34s
CI / benchmark (push) Successful in 4m31s
CI / test (push) Successful in 4m36s
CI / build (pull_request) Successful in 39s
CI / security (pull_request) Successful in 1m11s
CI / required (push) Successful in 1s
CI / images (pull_request) Skipped
CI / required (pull_request) Failing after 2s
CI / policy (push) Successful in 6s
CI / policy (pull_request) Successful in 9s
CI / test (pull_request) Successful in 3m24s
CI / images (push) Successful in 1m16s
CI / benchmark (pull_request) Failing after 6m0s
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>
2026-10-17 00:45:28 +02:00
nessarandClaude Opus 5.5 acdb19352a ci(benchmark): gate scenario speed relative to the runner
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>
2026-10-17 00:45:28 +02:00
nessarandClaude Opus 5.5 68a9e33de6 perf(planning): prune candidates that cannot beat the protected prefix
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>
2026-10-17 00:45:28 +02:00
nessarandClaude Opus 5.5 7890a03a74 perf(planning): update plan observations incrementally
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>
2026-10-17 00:45:28 +02:00
nessarandClaude Opus 5.5 87d72064be refactor(planning): consolidate plan observations in one module
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>
2026-10-16 23:47:34 +02:00
nessarandClaude Opus 5.5 4d26e65672 test(planning): compare the engine against a frozen engine on random requests
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>
2026-10-16 23:30:30 +02:00
nessarandClaude Opus 5.5 1711bc570c docs(benchmark): record PR #278 benchmark headroom
CI / validate (push) Successful in 1m13s
CI / build (push) Successful in 1m0s
CI / security (push) Successful in 1m43s
CI / validate (pull_request) Successful in 54s
CI / test (push) Successful in 3m21s
CI / build (pull_request) Successful in 1m29s
CI / security (pull_request) Successful in 1m42s
CI / benchmark (push) Failing after 5m50s
CI / required (push) Failing after 2s
CI / images (pull_request) Successful in 1m54s
CI / required (pull_request) Successful in 4s
CI / policy (push) Successful in 8s
CI / policy (pull_request) Successful in 7s
CI / test (pull_request) Successful in 2m19s
CI / images (push) Skipped
CI / benchmark (pull_request) Successful in 4m58s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 22:24:22 +02:00
nessarandClaude Opus 5.5 c6610cd633 perf(planning): reject impossible mandatory moves before copying
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 22:04:28 +02:00
nessar 433a8b0ade perf(planning): reuse immutable non-working date counts 2026-10-16 21:19:58 +02:00
nessar c7e7abcd24 perf(planning): build placement date keys directly 2026-10-16 21:03:36 +02:00
nessar cbde23f572 perf(planning): restore the integrated benchmark gate
CI / validate (push) Successful in 1m23s
CI / test (push) Successful in 3m17s
CI / benchmark (push) Failing after 5m52s
CI / build (push) Successful in 1m31s
CI / security (push) Successful in 1m39s
CI / build (pull_request) Successful in 1m30s
CI / security (pull_request) Successful in 1m40s
CI / images (pull_request) Skipped
CI / required (push) Failing after 2s
CI / required (pull_request) Failing after 1s
CI / policy (push) Successful in 7s
CI / images (push) Skipped
CI / policy (pull_request) Successful in 7s
CI / validate (pull_request) Successful in 1m11s
CI / test (pull_request) Successful in 3m17s
CI / benchmark (pull_request) Failing after 5m57s
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.
2026-10-16 14:01:32 +02:00
nessar 26a8b076ba ci: use reachable Trivy database mirror
CI / validate (push) Successful in 1m11s
CI / test (push) Successful in 3m20s
CI / benchmark (push) Failing after 5m57s
CI / build (push) Successful in 1m20s
CI / security (push) Successful in 3m29s
CI / validate (pull_request) Successful in 1m13s
CI / build (pull_request) Successful in 1m26s
CI / security (pull_request) Successful in 5m57s
CI / required (push) Successful in 4s
CI / images (pull_request) Successful in 3m25s
CI / required (pull_request) Successful in 1s
CI / policy (push) Successful in 7s
CI / policy (pull_request) Successful in 7s
CI / test (pull_request) Successful in 3m23s
CI / benchmark (pull_request) Failing after 6m10s
CI / images (push) Successful in 2m46s
2026-10-15 23:23:22 +02:00