HF-307: warn once when a typed key enters its notice window (5/8) - #1736
Open
marcin-kordas-hoc wants to merge 2 commits into
Open
HF-307: warn once when a typed key enters its notice window (5/8)#1736marcin-kordas-hoc wants to merge 2 commits into
marcin-kordas-hoc wants to merge 2 commits into
Conversation
Contributor
|
Task linked: HF-307 Implement feature packages and add-ons in HF |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
hyperformula-docs | aa835bf | Commit Preview URL Branch Preview URL |
Aug 20 2026, 12:57 PM |
marcin-kordas-hoc
force-pushed
the
spike/hf307-notice-window
branch
from
August 18, 2026 06:17
c1cce95 to
cbe23f0
Compare
Performance comparison of head (aa835bf) vs base (e9863f2) |
marcin-kordas-hoc
marked this pull request as ready for review
August 18, 2026 07:32
marcin-kordas-hoc
force-pushed
the
hf-307-entitlement-gating-pr4
branch
from
August 18, 2026 08:57
5d67b5d to
46ac32d
Compare
The key's `notice` field was parsed into LicenseExpiry and read by nothing. Now a VALID typed key whose usage_until lies within `notice` days of the current UTC instant prints a single console warning naming the expiry date (UTC marker included). The warn-once identity is the key string, not the process — two engines built with two different keys each get their own warning. release_until-axis keys never warn (rev 5: notice/grace have no effect there), the key's silent flags suppress it, and blocking at/after expiry is byte-identical to before (Kuba's D5-A: hard stop stays in 3.5.0, the full rev 5 §4.1 window model is a follow-up). Trials made this concrete: a trial is just a key with grace=0 and notice>0 whose warnings must surface in the console (packages meeting 12.08). Implemented by a prep-ship lane (task HF-307-notice-window); verified here: license suite 165/165 under Jest, tsc --noEmit clean, eslint clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PdHPZAjciZFWqGa19Yf7it
marcin-kordas-hoc
force-pushed
the
spike/hf307-notice-window
branch
from
August 19, 2026 09:55
cbe23f0 to
7b5398d
Compare
Collaborator
Author
|
Paired tests PR: handsontable/hyperformula-tests#37 — merge it BEFORE this one (fetch-tests pairs by branch name). |
Four findings from the spec-to-ship re-review (each cross-confirmed by at least two independent review angles): 1. Message wording: the notice now uses rev 5 section 3.2's own subscription clause - "is valid until <last covered day> (UTC)" - instead of "will expire on". The pre-existing expired message names the first day NOT covered (+1 day, frozen convention), so "expires on Aug 25" followed by "expired on Aug 26" printed two different days for one boundary. 2. The notice read is gated on the key SHAPE (rev 5), not on the field's presence: on the shipped shape the terms come off the LICENSED product's entry - for a dual-product key, Handsontable's - so a stray `notice` field there must not switch HyperFormula's console output on. The expiryWithinNoticeWindow doc also no longer claims kind='usage' implies the date came from usage_until (the envelope-exp fallback is real and documented as accepted standalone; the entitlement re-port removes it). 3. rebuildWithConfig's transient serialization-only Config no longer prints license messages: replacing keyA with keyB used to print keyA's notice in the very call that discards keyA. Config gains an internal-defaulted notifyLicenseMessages parameter, same pattern as showDeprecatedWarns. 4. The warn-once identity is now trim + the trailing 128 chars (the key's own checksum): extractTypedKeyData trims, so 'KEY' and 'KEY\n' are one license and must be one identity; truncation bounds a long-lived process's memory to 128 chars per distinct warned key. CHANGELOG entry gains its PR link. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PdHPZAjciZFWqGa19Yf7it
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## hf-307-entitlement-gating-pr4 #1736 +/- ##
==============================================================
Coverage 97.38% 97.38%
==============================================================
Files 204 204
Lines 16214 16236 +22
Branches 3487 3493 +6
==============================================================
+ Hits 15790 15812 +22
Misses 424 424
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consumes the license key's
noticefield: a VALID typed key whoseusage_untillies withinnoticedays of the current UTC instant prints a single console warning naming the expiry date (with a(UTC)marker). Stacks on #1731; rebased onto its current head on 19.08 (the base moved during PR3/PR4's review passes, which had left this PR conflicting).Why now
Per Kuba's D5-A (ClickUp, 12.08): hard blocking at/after expiry stays in 3.5.0 and the full rev 5 §4.1 window model is a follow-up — but trials made the notice warning concrete for this release: a trial is technically just a key with
grace=0andnotice>0whose warnings must surface in the console (packages meeting 12.08), and the trial mechanism lands in August.What changed
licenseResolution.ts:expiryWithinNoticeWindow()— usage-axis only (rev 5: notice/grace have no effect on therelease_untilaxis), window ends exactly where the soft-stop phase would begin, blind tograceDaysby design.licenseKeyValidator.ts:notifyLicenseKeyNotice()with per-key warn-once accounting (_noticedKeyskeyed by the raw key string) — deliberately not the process-lifetime boolean the state messages use: two engines built with two different keys each get their own warning.Verification
Paired tests:
hyperformula-tests@spike/hf307-notice-window(authored RED-first, 8 assertions: inside/outside window, release_until never warns, expired still hard-blocks, silent suppresses, per-key warn-once across two engines). Full license suite 212/212 under Jest (12 suites,unit/license+unit/helpers/licenseKeyValidator), re-measured after the 19.08 rebase onto the current #1731 (e9863f27) — the earlier 165/165 predated PR3's and PR4's review fixes,tsc --noEmitclean,eslint --quietclean on changed files.🤖 Generated with Claude Code
Note
Low Risk
Console-only notice on the typed-key path; expiry blocking and entitlement logic are unchanged aside from the new warning hook.
Overview
Adds a one-time console warning when a still-valid typed license key’s usage-based expiry (
usage_until) falls inside its configured notice period. The message names the expiry date with a(UTC)marker.expiryWithinNoticeWindowinlicenseResolution.tsapplies only to the usage axis (notrelease_until), ends the window at the usage-until day boundary (ignores grace), and is wired fromresolveLicensewhen the key is valid and not silent.notifyLicenseKeyNoticeinlicenseKeyValidator.tstracks warn-once per raw key string (_noticedKeys), separate from the existing once-per-page invalid/expired messaging. Test reset clears both flags.Blocking at/after expiry is unchanged; silent flags suppress the new warning. CHANGELOG updated.
Reviewed by Cursor Bugbot for commit 7b5398d. Bugbot is set up for automated code reviews on this repo. Configure here.