Skip to content

Release/v3.0.x#38

Merged
magmacomputing merged 13 commits into
mainfrom
release/v3.0.x
Jun 11, 2026
Merged

Release/v3.0.x#38
magmacomputing merged 13 commits into
mainfrom
release/v3.0.x

Conversation

@magmacomputing

@magmacomputing magmacomputing commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Release v3.0.1; exposes Tempo.version, per-sandbox license state, safe license snapshots, and sandbox-aware plugin isolation (ScopedSet).
    • New browser/headless test configs and distribution bundle tests.
  • Bug Fixes

    • Tightened term scope isolation to registered/queryable terms.
    • Fixed background license validation teardown and suppressed unhandled pledge rejections.
  • Documentation

    • Installation/CDN/import-map and Node/Temporal runtime guidance updated for v3.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f1b9bbce-1b57-4f1a-b75c-d2cf530716b0

📥 Commits

Reviewing files that changed from the base of the PR and between c827aaf and 3c566e7.

📒 Files selected for processing (10)
  • packages/tempo/doc/tempo.term.md
  • packages/tempo/src/plugin/term/term.season.ts
  • packages/tempo/src/plugin/term/term.timeline.ts
  • packages/tempo/src/plugin/term/term.util.ts
  • packages/tempo/src/plugin/term/term.zodiac.ts
  • packages/tempo/test/core/discovery.getters.test.ts
  • packages/tempo/test/engine/functional_alias_chaining.test.ts
  • packages/tempo/test/plugins/slick.verification.test.ts
  • packages/tempo/test/plugins/term-shorthand.test.ts
  • packages/tempo/test/plugins/term.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/tempo/src/plugin/term/term.zodiac.ts

📝 Walkthrough

Walkthrough

Scopes plugin/term registries per Internal.State, extracts per-state license management and validation, makes Tempo sandbox-aware (licenses/plugins per-state), stamps TEMPO_VERSION=3.0.1, and updates build, test, import-map, docs, and CI wiring for the new license/plugin layout.

Changes

Plugin Database Refactoring and Release

Layer / File(s) Summary
Library primitives & Pledge tests
packages/library/src/common/scopedset.class.ts, packages/library/src/common/pledge.class.ts, packages/library/test/common/pledge.class.test.ts
Adds ScopedSet, adjusts Pledge disposal to avoid unhandled rejections, and adds a test ensuring dispose doesn't trigger unhandled rejections.
State contract & runtime
packages/tempo/src/tempo.type.ts, packages/tempo/src/support/support.runtime.ts, packages/tempo/src/support/support.init.ts, packages/tempo/src/support/support.register.ts
Introduce Internal.State.pluginsDb, remove runtime-level pluginsDb, hydrate/clone pluginsDb in init, and update reset/registry clearing to operate on state.pluginsDb.
State-threaded plugin/term & parse/mutate flows
packages/tempo/src/plugin/term/term.util.ts, packages/tempo/src/plugin/plugin.util.ts, packages/tempo/src/module/module.parse.ts, packages/tempo/src/module/module.mutate.ts, packages/tempo/src/engine/engine.term.ts
findTermPlugin/registerTerm/registerPlugin accept optional state; parser and mutator now read state.pluginsDb.terms; standalone parse wiring uses constructor-internal state when available.
Tempo class sandbox integration
packages/tempo/src/tempo.class.ts
Tempo is sandbox-aware: extend/create apply and validate licenses into instance state, plugin/term registration uses instance state, Tempo.terms synthesizes licensed stubs only for missing keys, and Tempo.version exposes stamped version.
License manager & validator
packages/tempo/src/plugin/license/license.manager.ts, packages/tempo/src/plugin/license/license.validator.ts, packages/tempo/test/plugins/*
Extract per-state license caching, snapshots, set/validate/warn helpers; wire dynamic validator imports; update tests to use hoisted mocks and await background license JWS where needed.
Build/versioning & alias wiring
package.json, packages/tempo/package.json, packages/library/package.json, packages/tempo/bin/update-version.mjs, packages/tempo/src/tempo.version.ts, packages/tempo/rollup.config.js, packages/tempo/bin/resolve-types.ts, packages/tempo/src/tsconfig*.json, packages/tempo/vitest.config.ts
Bump versions to 3.0.1, add build:version and prebuild to generate TEMPO_VERSION, and rewire Rollup/tsconfig/vitest/type-resolution aliases to plugin/license/license.validator.
Tests, browser config, and setup
packages/tempo/vitest.browser.config.ts, packages/tempo/test/*, packages/tempo/test/support/*
Add Vitest browser config and browser tests, extend vitest aliases/excludes, update test lifecycle to reset runtime between tests, and add sandbox isolation/licensing browser tests.
Docs, importmap, changelog
packages/tempo/doc/installation.md, packages/tempo/importmap.json, packages/tempo/CHANGELOG.md, packages/tempo/CONTRIBUTING.md
Update installation docs and import map for Tempo v3 CDN usage, adjust Node/Temporal guidance and CONTRIBUTING test instructions, and add 3.0.1 changelog entries.

Sequence Diagram

sequenceDiagram
  participant App as App
  participant Tempo as Tempo.extend/create
  participant LicenseMgr as plugin/license/license.manager
  participant State as Internal.State
  participant Validator as `#tempo/license`
  App->>Tempo: provide license key
  Tempo->>LicenseMgr: setLicense(State, key)
  LicenseMgr->>State: set Pending + install jws Pledge
  Tempo->>LicenseMgr: validateLicenseState(license, jws)
  LicenseMgr->>Validator: verify(license.key)
  Validator-->>LicenseMgr: verification result
  LicenseMgr-->>State: resolve/reject and update status/scopes
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • magmacomputing/magma#30: Related licensing plumbing and discovery changes that overlap with this PR’s license manager extraction and wiring.
  • magmacomputing/magma#18: Related parse-engine internals and state-threading work touching module.parse paths.
  • magmacomputing/magma#17: Related runtime/registry refactor that moves plugin/term registry responsibilities toward a centralized runtime/state bridge.

"I hop and stamp a tiny seed—
version three, a fruitful breed.
State keeps plugins in their place,
licenses check, then find their grace.
Hooray for tests that run in chrome!"

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/v3.0.x

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/tempo/bin/update-version.mjs (1)

11-11: Node JSON import attributes work with repo CI (Node 22/24); add engines.node to prevent older local runtimes.

packages/tempo/bin/update-version.mjs:11 uses import pkg from '../package.json' with { type: 'json' };. Repo CI runs on Node 22 (.github/workflows/ci.yml) and Node 24 (.github/workflows/deploy-docs.yml), and Node’s with { type: 'json' } syntax is supported/stable in these versions—so build pipelines in CI shouldn’t break. Since no engines.node is declared, consider adding it to align local/off-CI usage.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/tempo/bin/update-version.mjs` at line 11, The import line "import
pkg from '../package.json' with { type: 'json' }" relies on Node >=22/24 JSON
import support; add an "engines" field to the package.json that encloses this
script (set "engines": { "node": ">=22.0.0" } or similar) so local runtimes that
are older will be prevented from running the script; update the package.json
adjacent to the script (the one being imported) to include this engines.node
constraint and commit the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/tempo/vitest.config.ts`:
- Around line 85-86: The alias entry in vitest.config.ts currently maps the .ts
support file but not the .js path the test mocks (licenseModulePath); update the
aliasing so that when not running in dist mode you add a second resolve alias
for './src/support/support.license.js' that uses the same replacement value
(isPremiumAvailable ? licensePremium : licenseDefault) as the existing
'./src/support/support.license.ts' mapping so imports from tempo.class.ts
(import('./support/support.license.js')) and the test mock path both resolve to
the same replacement module.

---

Nitpick comments:
In `@packages/tempo/bin/update-version.mjs`:
- Line 11: The import line "import pkg from '../package.json' with { type:
'json' }" relies on Node >=22/24 JSON import support; add an "engines" field to
the package.json that encloses this script (set "engines": { "node": ">=22.0.0"
} or similar) so local runtimes that are older will be prevented from running
the script; update the package.json adjacent to the script (the one being
imported) to include this engines.node constraint and commit the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d536602d-c8cc-48a9-a0e5-f44a1d1421d6

📥 Commits

Reviewing files that changed from the base of the PR and between b43bc90 and 03685f6.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (18)
  • package.json
  • packages/library/package.json
  • packages/tempo/CHANGELOG.md
  • packages/tempo/bin/update-version.mjs
  • packages/tempo/doc/installation.md
  • packages/tempo/importmap.json
  • packages/tempo/package.json
  • packages/tempo/src/module/module.parse.ts
  • packages/tempo/src/plugin/plugin.util.ts
  • packages/tempo/src/plugin/term/term.util.ts
  • packages/tempo/src/support/support.init.ts
  • packages/tempo/src/support/support.register.ts
  • packages/tempo/src/support/support.runtime.ts
  • packages/tempo/src/tempo.class.ts
  • packages/tempo/src/tempo.type.ts
  • packages/tempo/src/tempo.version.ts
  • packages/tempo/test/plugins/licensing.full.test.ts
  • packages/tempo/vitest.config.ts

Comment thread packages/tempo/vitest.config.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (3)
packages/tempo/test/plugins/licensing.full.test.ts (1)

7-38: 💤 Low value

getVerifyFn and setVerifyFn appear unused.

setVerifyFn is defined on line 29 and getVerifyFn on line 28, but the tests override behavior via vi.mocked(Validator).mockImplementation() instead. These exports are returned from vi.hoisted() but never invoked in this file.

If these are intended for future use or debugging, consider adding a brief comment. Otherwise, they can be removed to reduce confusion.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/tempo/test/plugins/licensing.full.test.ts` around lines 7 - 38, The
hoisted block defines getVerifyFn and setVerifyFn (and setVerifyFn assigns
currentVerify) but those functions are never used in this test file; either
remove their definitions and their inclusion in the vi.hoisted() return value to
avoid dead/confusing code, or keep them but add a concise comment above
getVerifyFn/setVerifyFn explaining they exist for external test
overrides/debugging; locate them inside the vi.hoisted() closure (referencing
currentVerify, mockFactory and the vi.hoisted return) and update the return
object accordingly.
packages/tempo/src/tempo.class.ts (1)

394-396: 💤 Low value

Remove commented-out code.

This commented block is dead code that was intentionally removed. Consider deleting it to avoid confusion.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/tempo/src/tempo.class.ts` around lines 394 - 396, Delete the dead
commented-out block that references passing a license key to extendState (the
commented lines checking discovery.license and merging into opts) to avoid
confusion; remove the two commented lines containing "// // 1f. Pass license key
through to extendState..." and "// if (discovery.license) opts = { ...opts,
license: discovery.license }" in tempo.class.ts so only active code remains.
packages/tempo/vitest.config.ts (1)

64-65: Potentially redundant dist self-alias in Vitest config (lines 64–65)

In packages/tempo/vitest.config.ts (when TEST_DIST=true), the #tempo/license alias already maps to dist/plugin/license/license.validator.js (line 64). The additional entry at line 65 self-aliases that same resolved dist path to itself, but the current tests mock only vi.mock('#tempo/license', ...) and an absolute src path (.../src/plugin/license/license.validator.ts), not the dist absolute path (no dist/plugin/license/license.validator.js in tests). This makes line 65 look unnecessary for the present mocking strategy; remove it unless there’s an external/other-test need to vi.mock(<absolute dist path>). If it must stay, add a comment stating that specific use case.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/tempo/vitest.config.ts` around lines 64 - 65, The duplicate
self-alias entry that maps the resolved dist path to itself in vitest.config.ts
is redundant given the existing { find: /^`#tempo`\/license$/, replacement:
resolve(... './dist/plugin/license/license.validator.js') } mapping and current
tests only mock '`#tempo/license`' and the src path; remove the second alias ({
find: resolve(... 'dist/plugin/license/license.validator.js'), replacement:
resolve(... 'dist/plugin/license/license.validator.js') }) to avoid unnecessary
entries, or if you intentionally need tests to vi.mock the absolute dist path
keep the entry and add a clarifying comment above it stating that it exists to
allow vi.mock() calls using the resolved dist absolute path.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 5-7: The package.json engines.node constraint (engines.node:
">=22.0.0") must be clarified or justified: either relax it to ">=20.0.0" and
require loading `@js-temporal/polyfill` when globalThis.Temporal is missing, or
keep ">=22.0.0" and explicitly document why (native Temporal + Node 22 caveats).
Update package.json accordingly and add/adjust documentation in
packages/library/src/common/temporal.polyfill.ts to clearly state the runtime
requirement and fallback instructions, and update packages/tempo/CONTRIBUTING.md
and packages/tempo/CHANGELOG.md to reflect the supported Node versions and note
the engines bump and the Node 22.0.x instability warning so the runtime
constraint and migration steps are unambiguous.

In `@packages/tempo/bin/resolve-types.ts`:
- Line 68: The licReplacement value is missing the "plugin/" segment which
causes incorrect paths; update the construction of licReplacement (the variable
named licReplacement that uses prefix) to include "plugin/" before
"license/license.validator.js" so it resolves to e.g. `${prefix ||
'./'}plugin/license/license.validator.js`, ensuring the path matches the built
module location used by the vitest configuration.

In `@packages/tempo/test/discrete/standalone.test.ts`:
- Around line 7-20: Save and restore the entire runtime state (not just
state.config) and call init with the saved state as the baseState so init
doesn't early-return; e.g., replace prevState = { ...getRuntime().state?.config
} with prevState = getRuntime().state (or fullState), and in afterAll call
init(prevState?.config ?? {}, true, prevState) (or init(undefined, true,
prevState) if you prefer) so the original runtime.state is applied as baseState
and the previous configuration is actually restored (references: init(),
getRuntime(), runtime.state, prevState, afterAll).

---

Nitpick comments:
In `@packages/tempo/src/tempo.class.ts`:
- Around line 394-396: Delete the dead commented-out block that references
passing a license key to extendState (the commented lines checking
discovery.license and merging into opts) to avoid confusion; remove the two
commented lines containing "// // 1f. Pass license key through to
extendState..." and "// if (discovery.license) opts = { ...opts, license:
discovery.license }" in tempo.class.ts so only active code remains.

In `@packages/tempo/test/plugins/licensing.full.test.ts`:
- Around line 7-38: The hoisted block defines getVerifyFn and setVerifyFn (and
setVerifyFn assigns currentVerify) but those functions are never used in this
test file; either remove their definitions and their inclusion in the
vi.hoisted() return value to avoid dead/confusing code, or keep them but add a
concise comment above getVerifyFn/setVerifyFn explaining they exist for external
test overrides/debugging; locate them inside the vi.hoisted() closure
(referencing currentVerify, mockFactory and the vi.hoisted return) and update
the return object accordingly.

In `@packages/tempo/vitest.config.ts`:
- Around line 64-65: The duplicate self-alias entry that maps the resolved dist
path to itself in vitest.config.ts is redundant given the existing { find:
/^`#tempo`\/license$/, replacement: resolve(...
'./dist/plugin/license/license.validator.js') } mapping and current tests only
mock '`#tempo/license`' and the src path; remove the second alias ({ find:
resolve(... 'dist/plugin/license/license.validator.js'), replacement:
resolve(... 'dist/plugin/license/license.validator.js') }) to avoid unnecessary
entries, or if you intentionally need tests to vi.mock the absolute dist path
keep the entry and add a clarifying comment above it stating that it exists to
allow vi.mock() calls using the resolved dist absolute path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6f7bfa5f-7f64-4c30-9e24-13bef99a3220

📥 Commits

Reviewing files that changed from the base of the PR and between 03685f6 and ced799f.

📒 Files selected for processing (29)
  • package.json
  • packages/library/src/common/pledge.class.ts
  • packages/library/src/common/scopedset.class.ts
  • packages/library/test/common/pledge.class.test.ts
  • packages/tempo/bench/tsconfig.json
  • packages/tempo/bin/resolve-types.ts
  • packages/tempo/doc/installation.md
  • packages/tempo/package.json
  • packages/tempo/rollup.config.js
  • packages/tempo/src/engine/engine.term.ts
  • packages/tempo/src/module/module.format.ts
  • packages/tempo/src/module/module.mutate.ts
  • packages/tempo/src/module/module.parse.ts
  • packages/tempo/src/plugin/license/license.manager.ts
  • packages/tempo/src/plugin/license/license.validator.ts
  • packages/tempo/src/plugin/plugin.util.ts
  • packages/tempo/src/support/support.init.ts
  • packages/tempo/src/support/support.runtime.ts
  • packages/tempo/src/tempo.class.ts
  • packages/tempo/src/tempo.type.ts
  • packages/tempo/src/tsconfig.json
  • packages/tempo/src/tsconfig.repl.json
  • packages/tempo/test/core/sandbox_isolation.test.ts
  • packages/tempo/test/discrete/standalone.test.ts
  • packages/tempo/test/plugins/licensing.full.test.ts
  • packages/tempo/test/plugins/licensing.sandbox.test.ts
  • packages/tempo/test/support/setup.console-spy.ts
  • packages/tempo/test/tsconfig.json
  • packages/tempo/vitest.config.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/library/src/common/scopedset.class.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/tempo/src/tempo.type.ts
  • packages/tempo/src/plugin/plugin.util.ts

Comment thread package.json
Comment thread packages/tempo/bin/resolve-types.ts Outdated
Comment thread packages/tempo/test/discrete/standalone.test.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/library/src/common/temporal.polyfill.ts`:
- Around line 14-16: The error string in temporal.polyfill.ts currently
recommends "Node 22+, Deno, Bun" but then warns Node 22.0.x is unstable; update
that message to align with the CHANGELOG and docs by recommending "Node 20+ with
a polyfill (e.g. `@js-temporal/polyfill`) is highly recommended" and note that
native Temporal is fully reliable only on Node 26+ (while Node 22 may have
instabilities), so replace the existing message text in the file's
Temporal/polyfill error string to reflect: Node 20+ with polyfill recommended,
mention Node 22 instability, and indicate Node 26+ ships Temporal fully enabled.
Ensure you modify the literal error message constant/string in
temporal.polyfill.ts (the message used when Temporal is unavailable).

In `@packages/tempo/test/browser/licensing.browser.test.ts`:
- Around line 23-25: Replace the brittle provider-specific text check against
'verify' on the test result object `res`: instead of asserting
expect(res.error).toContain('verify'), assert stable semantics such as the
validation status and non-empty error message — e.g. verify `res.status` equals
'invalid' (expect(res.status).toBe('invalid')) and keep the existing checks that
`res.error` is defined and does not contain 'Community Build'.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a9f2b24f-c91d-4a77-b89b-fc524601743a

📥 Commits

Reviewing files that changed from the base of the PR and between ced799f and c926f6a.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (13)
  • package.json
  • packages/library/src/common/temporal.polyfill.ts
  • packages/tempo/CHANGELOG.md
  • packages/tempo/CONTRIBUTING.md
  • packages/tempo/bin/resolve-types.ts
  • packages/tempo/package.json
  • packages/tempo/src/tempo.class.ts
  • packages/tempo/test/browser/bundle.browser.test.ts
  • packages/tempo/test/browser/licensing.browser.test.ts
  • packages/tempo/test/discrete/standalone.test.ts
  • packages/tempo/test/plugins/licensing.full.test.ts
  • packages/tempo/vitest.browser.config.ts
  • packages/tempo/vitest.config.ts
💤 Files with no reviewable changes (1)
  • packages/tempo/src/tempo.class.ts
✅ Files skipped from review due to trivial changes (3)
  • packages/tempo/CONTRIBUTING.md
  • packages/tempo/vitest.browser.config.ts
  • packages/tempo/CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/tempo/bin/resolve-types.ts
  • packages/tempo/test/discrete/standalone.test.ts
  • packages/tempo/package.json

Comment thread packages/library/src/common/temporal.polyfill.ts Outdated
Comment thread packages/tempo/test/browser/licensing.browser.test.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/tempo/src/plugin/term/term.zodiac.ts (1)

115-115: ⚡ Quick win

Consider tightening the yinYang type to match runtime constraints.

Line 85 in getChineseZodiac computes yinYang as year % 2 === 0 ? 'Yang' : 'Yin', so the value is always one of these two literals. The current type yinYang: string is safe but overly permissive.

🔧 Suggested refinement
 			CN?: {
 				animal: string;
 				traits: string;
 				element: string;
-				yinYang: string;
+				yinYang: 'Yang' | 'Yin';
 			};
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/tempo/src/plugin/term/term.zodiac.ts` at line 115, The yinYang
property is typed too broadly as string even though getChineseZodiac computes it
as either 'Yang' or 'Yin'; tighten the type to the literal union 'Yin' | 'Yang'
on the yinYang property and any related return/interface/type declarations
(e.g., the return type of getChineseZodiac and the object shape that contains
yinYang) so the type system reflects the actual runtime values.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/tempo/src/plugin/term/term.timeline.ts`:
- Around line 42-46: The period object returned by getTermRange for the timeline
term only ever contains hour (and minute for “afternoon”) and therefore the
TempoTermRegistry.period typing is misleading; update the
TempoTermRegistry.period type to reflect the actual shape returned by
term.timeline.ts (e.g., define a specific TimelinePeriod interface with only
hour?: number and minute?: number or a union for entries that only have hour) or
add a clear doc comment on TempoTermRegistry.period stating sub-second fields
(second, millisecond, microsecond, nanosecond) will not be present for the
timeline term; locate the timeline groups in term.timeline.ts and the
getTermRange usage to ensure the typing change aligns with the runtime shape.

---

Nitpick comments:
In `@packages/tempo/src/plugin/term/term.zodiac.ts`:
- Line 115: The yinYang property is typed too broadly as string even though
getChineseZodiac computes it as either 'Yang' or 'Yin'; tighten the type to the
literal union 'Yin' | 'Yang' on the yinYang property and any related
return/interface/type declarations (e.g., the return type of getChineseZodiac
and the object shape that contains yinYang) so the type system reflects the
actual runtime values.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f106f577-c01a-4752-a1f2-bab8778a07b4

📥 Commits

Reviewing files that changed from the base of the PR and between c926f6a and c827aaf.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (9)
  • .github/workflows/ci.yml
  • packages/library/src/common/temporal.polyfill.ts
  • packages/tempo/src/plugin/term/term.quarter.ts
  • packages/tempo/src/plugin/term/term.season.ts
  • packages/tempo/src/plugin/term/term.timeline.ts
  • packages/tempo/src/plugin/term/term.zodiac.ts
  • packages/tempo/src/tempo.class.ts
  • packages/tempo/test/browser/bundle.browser.test.ts
  • packages/tempo/test/browser/licensing.browser.test.ts
💤 Files with no reviewable changes (2)
  • packages/tempo/test/browser/licensing.browser.test.ts
  • packages/tempo/test/browser/bundle.browser.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/library/src/common/temporal.polyfill.ts
  • packages/tempo/src/tempo.class.ts

Comment thread packages/tempo/src/plugin/term/term.timeline.ts Outdated
@magmacomputing magmacomputing merged commit 12c1b21 into main Jun 11, 2026
2 checks passed
@magmacomputing magmacomputing deleted the release/v3.0.x branch June 11, 2026 07:03
@coderabbitai coderabbitai Bot mentioned this pull request Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant