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