chore: prepare Release D (v2.9.1)#25
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds an AliasEngine for event/period alias registration, resolution, and collision detection; wires per-instance alias engines into Tempo state and types; expands tests, docs, and release planning; updates VitePress srcDir, doc cross-links, console-spy test helpers, CI debug step, and bumps package versions + prepublish branch gating. ChangesAlias resolution & Tempo wiring
Release / packaging / site config
Sequence Diagram(s)sequenceDiagram
autonumber
participant Tempo as Tempo Instance
participant Alias as AliasEngine
participant Parent as Parent AliasEngine
participant Logger as Logger/Console
Tempo->>Alias: ensure/create aliasEngine(parent, logger)
Tempo->>Alias: clear('event'|'period')
Tempo->>Alias: registerEvents/registerPeriods(entries)
Note right of Alias: store maps, detect collisions (local + parent)
Alias-->>Logger: warn(...) when collisions found
Tempo->>Alias: resolveEvent/resolvePeriod(name, thisArg)
Alias->>Parent: fallback lookup if not found locally
Parent-->>Alias: return parent mapping (string/number or invoked Function)
Alias-->>Tempo: resolved alias target
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 35 minutes and 8 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@package.json`:
- Line 3: The package.json "version" field is incorrect for this PR; update the
value of the "version" key from "2.9.0" to "2.9.1" so the package.json matches
the intended Release D tag/version (ensure the "version" property is exactly
"2.9.1").
🪄 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: 04b21aae-cdea-48bd-8390-609d5e75c39e
📒 Files selected for processing (3)
package.jsonpackages/library/package.jsonpackages/tempo/package.json
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/tempo/src/engine/engine.alias.ts`:
- Line 8: AliasTarget currently omits number which causes numeric Logic alias
values to be ignored; update the AliasTarget type to include number (export type
AliasTarget = string | number | Function) or, if you want to disallow numbers,
explicitly validate/reject numeric aliases where aliases are parsed. Also update
the alias resolution code that currently only handles Function and String (the
resolver around the block that checks typeof === "function" or === "string") to
handle numeric alias targets: if the alias is a number, return that numeric
value directly (or throw an explicit error if rejecting numbers). Ensure
references to Logic/Tempo types remain compatible with the updated AliasTarget.
- Around line 150-168: The multi-hop lookup flips map type because the code
compares map === this.#eventMap inside the loop; capture the intended map kind
before iterating (e.g., const isEvent = map === this.#eventMap) and then inside
the loop when moving to the parent use that flag to pick the next registry (map
= isEvent ? currentEngine.#eventMap : currentEngine.#periodMap). Update the
`#resolveAlias` method in AliasEngine to initialize isEvent before the while loop
and use it instead of comparing map to this.#eventMap when assigning map for
currentEngine.
🪄 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: 7f27576e-d16b-4af5-a016-9feffae3f828
📒 Files selected for processing (15)
package.jsonpackages/library/package.jsonpackages/tempo/.vitepress/config.tspackages/tempo/archive/tempo.api.mdpackages/tempo/package.jsonpackages/tempo/plan/.WISHLIST.mdpackages/tempo/plan/RELEASE-D.mdpackages/tempo/src/engine/engine.alias.tspackages/tempo/src/engine/engine.layout.resolver.ts.bakpackages/tempo/src/engine/engine.layout.ts.bakpackages/tempo/src/tempo.class.tspackages/tempo/src/tempo.type.tspackages/tempo/test/core/alias-engine.test.tspackages/tempo/test/core/sandbox-factory.test.tspackages/tempo/test/support/setup.console-spy.ts
✅ Files skipped from review due to trivial changes (4)
- packages/tempo/.vitepress/config.ts
- package.json
- packages/tempo/archive/tempo.api.md
- packages/tempo/plan/RELEASE-D.md
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
.github/workflows/ci.yml (1)
43-64: ⚡ Quick winRemove temporary debug step before merging; line 63 dumps the full event payload.
This step appears to be a one-off debugging aid (the step name says "for debug"). Two concerns:
- Cleanup: Debug steps in
main-targeting CI are noisy and add unnecessary log volume. Remove before merge.- Info exposure (line 63):
cat $GITHUB_EVENT_PATHwrites the raw event JSON — including PR body, labels, author details, and any other metadata — to the public workflow log. While not typically a hard secret, it is unnecessary disclosure and should be dropped along with the rest of the step.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/ci.yml around lines 43 - 64, Remove the temporary debug workflow step named "Print GitHub event context (for debug)" from the CI job: delete the entire step block that echoes GITHUB_REF, github.* vars and especially the line that uses GITHUB_EVENT_PATH (cat $GITHUB_EVENT_PATH) to avoid dumping the raw event payload; ensure no other steps depend on those echoed values and commit the trimmed .github/workflows/ci.yml without this debug step.packages/tempo/test/core/alias-engine-protochain.test.ts (1)
7-20: ⚡ Quick winMove describe-level fixture setup into
beforeEachto prevent cross-test mutation.The second test permanently mutates
localShape.aliasEngineat line 42 by registering'globalEvt' → 'localShadow'. Because all fixtures are created once atdescribescope, any test added after the collision test that expects the pre-mutation state oflocalShape.aliasEnginewill silently receive stale data.♻️ Proposed refactor
describe('AliasEngine prototype chain (Global → Sandbox → Instance)', () => { const logger = new Logify({ debug: true }); - // Simulate a global state - const globalShape = {} as { aliasEngine: AliasEngine }; - globalShape.aliasEngine = new AliasEngine({ logger }); - globalShape.aliasEngine.registerEventAlias('globalEvt', 'globalValue'); - - // Simulate a sandbox state inheriting from global - const sandboxShape = Object.create(globalShape); - sandboxShape.aliasEngine = new AliasEngine({ parent: globalShape.aliasEngine, logger }); - sandboxShape.aliasEngine.registerEventAlias('sandboxEvt', 'sandboxValue'); - - // Simulate a local/instance state inheriting from sandbox - const localShape = Object.create(sandboxShape); - localShape.aliasEngine = new AliasEngine({ parent: sandboxShape.aliasEngine, logger }); - localShape.aliasEngine.registerEventAlias('localEvt', 'localValue'); + let globalShape: { aliasEngine: AliasEngine }; + let sandboxShape: { aliasEngine: AliasEngine }; + let localShape: { aliasEngine: AliasEngine }; + + beforeEach(() => { + // Simulate a global state + globalShape = {} as { aliasEngine: AliasEngine }; + globalShape.aliasEngine = new AliasEngine({ logger }); + globalShape.aliasEngine.registerEventAlias('globalEvt', 'globalValue'); + + // Simulate a sandbox state inheriting from global + sandboxShape = Object.create(globalShape); + sandboxShape.aliasEngine = new AliasEngine({ parent: globalShape.aliasEngine, logger }); + sandboxShape.aliasEngine.registerEventAlias('sandboxEvt', 'sandboxValue'); + + // Simulate a local/instance state inheriting from sandbox + localShape = Object.create(sandboxShape); + localShape.aliasEngine = new AliasEngine({ parent: sandboxShape.aliasEngine, logger }); + localShape.aliasEngine.registerEventAlias('localEvt', 'localValue'); + });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/tempo/test/core/alias-engine-protochain.test.ts` around lines 7 - 20, The current test creates shared fixtures (globalShape, sandboxShape, localShape) at describe scope and mutates localShape.aliasEngine via registerEventAlias which causes cross-test pollution; move the fixture creation into a beforeEach block so each test gets a fresh AliasEngine graph: create new instances for globalShape.aliasEngine, sandboxShape.aliasEngine (parent: globalShape.aliasEngine) and localShape.aliasEngine (parent: sandboxShape.aliasEngine) inside beforeEach, and remove or replace the top-level describe-scope initializations to ensure tests do not share or retain mutations across runs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/ci.yml:
- Line 51: The echo currently interpolates the untrusted github.head_ref
directly into the shell which can be shell-injected; instead, pass
github.head_ref into a step environment variable and reference that variable
(properly quoted) in the shell. Update the step so it sets an env like HEAD_REF
from the github.head_ref value and replace the direct interpolation of `${{
github.head_ref }}` in the echo command with a quoted reference to the env var
(e.g., "$HEAD_REF"), keeping the only identifiers changed being github.head_ref
and the echo invocation.
- Around line 94-116: Remove the duplicated CI steps block that repeats "Install
monorepo dependencies", "Run all tests with parse.preFilter", "Run end-to-end
benchmark", "Upload benchmark output", and "Validate benchmark output" (the copy
at lines 94–116); keep the original occurrence and delete the second copy so npm
ci, tests, benchmark, artifact upload (actions/upload-artifact@v4 with name
bench-parse-prefilter-e2e) and validation only run once to avoid double
execution and artifact name collision.
In `@packages/tempo/src/discrete/discrete.format.ts`:
- Around line 69-71: The conditional that builds template uses hasOwn(formats,
fmt as string) which only checks own properties and fails to detect inherited
keys from enums.FORMAT; update the condition in the template assignment to use
the in operator (e.g., fmt as string in formats) so inherited format names like
weekDate/logStamp/display resolve correctly, and remove the now-unused hasOwn
import from the top of the file; ensure you reference the same symbols (formats,
fmt, template, enums.FORMAT) when making the change.
In `@packages/tempo/test/core/alias-engine-protochain.test.ts`:
- Around line 40-47: The test currently only asserts resolution order but never
verifies that collision reporting is invoked; update the test to spy on the
shared Logify logger instance method that AliasEngine uses (e.g., logger.warn)
before calling localShape.aliasEngine.registerEventAlias('globalEvt',
'localShadow'), then assert the spy was called with an appropriate collision
message when the colliding alias is registered; locate the logger used by
AliasEngine (the Logify instance constructed outside the it block) and restore
the spy after the test.
---
Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 43-64: Remove the temporary debug workflow step named "Print
GitHub event context (for debug)" from the CI job: delete the entire step block
that echoes GITHUB_REF, github.* vars and especially the line that uses
GITHUB_EVENT_PATH (cat $GITHUB_EVENT_PATH) to avoid dumping the raw event
payload; ensure no other steps depend on those echoed values and commit the
trimmed .github/workflows/ci.yml without this debug step.
In `@packages/tempo/test/core/alias-engine-protochain.test.ts`:
- Around line 7-20: The current test creates shared fixtures (globalShape,
sandboxShape, localShape) at describe scope and mutates localShape.aliasEngine
via registerEventAlias which causes cross-test pollution; move the fixture
creation into a beforeEach block so each test gets a fresh AliasEngine graph:
create new instances for globalShape.aliasEngine, sandboxShape.aliasEngine
(parent: globalShape.aliasEngine) and localShape.aliasEngine (parent:
sandboxShape.aliasEngine) inside beforeEach, and remove or replace the top-level
describe-scope initializations to ensure tests do not share or retain mutations
across runs.
🪄 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: 4cb44da1-b93e-4fbc-81c6-2af7d718b2c7
📒 Files selected for processing (8)
.github/workflows/ci.ymlpackages/tempo/src/discrete/discrete.format.tspackages/tempo/src/engine/engine.alias.tspackages/tempo/src/plugin/plugin.util.tspackages/tempo/src/support/tempo.init.tspackages/tempo/src/support/tempo.register.tspackages/tempo/src/tempo.class.tspackages/tempo/test/core/alias-engine-protochain.test.ts
✅ Files skipped from review due to trivial changes (1)
- packages/tempo/src/support/tempo.register.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/tempo/src/engine/engine.alias.ts
- packages/tempo/src/tempo.class.ts
|
@coderabbitai please review |
|
Tip For best results, initiate chat on the files or code changes.
[review] |
Summary by CodeRabbit
Chores
New Features
Release Process
Documentation
Tests