Skip to content

feat(core): release @passiveintent/core v1.2.0 with IntentManager API#92

Merged
purushpsm147 merged 2 commits intomainfrom
core-fixes
Mar 23, 2026
Merged

feat(core): release @passiveintent/core v1.2.0 with IntentManager API#92
purushpsm147 merged 2 commits intomainfrom
core-fixes

Conversation

@purushpsm147
Copy link
Copy Markdown
Collaborator

@purushpsm147 purushpsm147 commented Mar 23, 2026

This pull request introduces a new minor version (1.2.0) of @passiveintent/core with significant changes to the browser integration API, as well as related documentation, changelog, and test updates. The most important change is that createBrowserIntent() now returns a full IntentManager (with the complete public API) instead of the limited IntentEngine microkernel, and URL tracking is now always explicit via engine.track(pathname). Several other improvements and clarifications have been made to the bigram separator, error handling, and documentation.

Core API and Behavior Changes:

  • createBrowserIntent() now returns an IntentManager with the full 13-method public API (e.g., getTelemetry, predictNextStates, counters, exportGraph, etc.), instead of the previous limited IntentEngine. This is additive and backward-compatible at runtime, but the TypeScript return type widens. ([[1]](https://github.com/passiveintent/core/pull/92/files#diff-7eb5f05e9df8fd39bfe2e12fec9151ad1eac23e9e7a4dd7891f4b2d1d450faf2R15-R33), [[2]](https://github.com/passiveintent/core/pull/92/files#diff-af0c08d6f291aa75c55d4ad3ec19fd4b728edcf43a39c80d566f661b3b311c44L177-R179), [[3]](https://github.com/passiveintent/core/pull/92/files#diff-af0c08d6f291aa75c55d4ad3ec19fd4b728edcf43a39c80d566f661b3b311c44L656-R656), [[4]](https://github.com/passiveintent/core/pull/92/files#diff-097350575d712f33b11767cc33913621617a28bf23a16fbf7d59384503128c54L11-R15), [[5]](https://github.com/passiveintent/core/pull/92/files#diff-097350575d712f33b11767cc33913621617a28bf23a16fbf7d59384503128c54L26-R34), [[6]](https://github.com/passiveintent/core/pull/92/files#diff-097350575d712f33b11767cc33913621617a28bf23a16fbf7d59384503128c54L45-R56), [[7]](https://github.com/passiveintent/core/pull/92/files#diff-097350575d712f33b11767cc33913621617a28bf23a16fbf7d59384503128c54L84-L105), [[8]](https://github.com/passiveintent/core/pull/92/files#diff-097350575d712f33b11767cc33913621617a28bf23a16fbf7d59384503128c54L135-L146), [[9]](https://github.com/passiveintent/core/pull/92/files#diff-23ae42edc4683bfb6c2b26dea93de94504b8334c1cd7f9ecffbd088fea5c1317L16-R18), [[10]](https://github.com/passiveintent/core/pull/92/files#diff-23ae42edc4683bfb6c2b26dea93de94504b8334c1cd7f9ecffbd088fea5c1317R54-R62), [[11]](https://github.com/passiveintent/core/pull/92/files#diff-3df99b0cbd1ab7c7f98cc7abf556aa248867200f6ae86001ed58fa60f17e1f13L13-R19), [[12]](https://github.com/passiveintent/core/pull/92/files#diff-3df99b0cbd1ab7c7f98cc7abf556aa248867200f6ae86001ed58fa60f17e1f13L29-R28), [[13]](https://github.com/passiveintent/core/pull/92/files#diff-3df99b0cbd1ab7c7f98cc7abf556aa248867200f6ae86001ed58fa60f17e1f13L41-R43), [[14]](https://github.com/passiveintent/core/pull/92/files#diff-0b810c38f3c138a3d5e44854edefd5eb966617ca84e62f06511f60acc40546c7L3-R3))
  • The MouseKinematicsAdapter is no longer part of the factory; URL tracking must now always be explicit via engine.track(pathname), aligning with the React SDK's useRouteTracker. ([[1]](https://github.com/passiveintent/core/pull/92/files#diff-7eb5f05e9df8fd39bfe2e12fec9151ad1eac23e9e7a4dd7891f4b2d1d450faf2R15-R33), [[2]](https://github.com/passiveintent/core/pull/92/files#diff-af0c08d6f291aa75c55d4ad3ec19fd4b728edcf43a39c80d566f661b3b311c44L177-R179), [[3]](https://github.com/passiveintent/core/pull/92/files#diff-097350575d712f33b11767cc33913621617a28bf23a16fbf7d59384503128c54L45-R56), [[4]](https://github.com/passiveintent/core/pull/92/files#diff-23ae42edc4683bfb6c2b26dea93de94504b8334c1cd7f9ecffbd088fea5c1317R54-R62), [[5]](https://github.com/passiveintent/core/pull/92/files#diff-3df99b0cbd1ab7c7f98cc7abf556aa248867200f6ae86001ed58fa60f17e1f13L13-R19), [[6]](https://github.com/passiveintent/core/pull/92/files#diff-3df99b0cbd1ab7c7f98cc7abf556aa248867200f6ae86001ed58fa60f17e1f13L29-R28))

Algorithm & Data Handling:

  • The BigramPolicy separator is changed from the Unicode arrow () to the NUL character (\x00), making bigram edge keys collision-resistant even for custom state labels. Existing bigram edges in persisted graphs will be ignored and relearned. ([[1]](https://github.com/passiveintent/core/pull/92/files#diff-7eb5f05e9df8fd39bfe2e12fec9151ad1eac23e9e7a4dd7891f4b2d1d450faf2R15-R33), [[2]](https://github.com/passiveintent/core/pull/92/files#diff-3f606d4257b5416fb9d3fcd223d2b0d9f99beaefeb2b7bc09dc91994d3aad630L19-R21), [[3]](https://github.com/passiveintent/core/pull/92/files#diff-3f606d4257b5416fb9d3fcd223d2b0d9f99beaefeb2b7bc09dc91994d3aad630L41-R42))

Bug Fixes & Error Handling:

  • The guard in incrementCounter() is unified to a single check (typeof by !== 'number' || !Number.isFinite(by)) to prevent multiple error emissions for invalid input. ([[1]](https://github.com/passiveintent/core/pull/92/files#diff-7eb5f05e9df8fd39bfe2e12fec9151ad1eac23e9e7a4dd7891f4b2d1d450faf2R15-R33), [[2]](https://github.com/passiveintent/core/pull/92/files#diff-73c296c200d92fe89a1b1cb6fcca77442eb8413c91969db2bd0ba83a48c99588R639), [[3]](https://github.com/passiveintent/core/pull/92/files#diff-73c296c200d92fe89a1b1cb6fcca77442eb8413c91969db2bd0ba83a48c99588L648-L656))

Documentation & Testing:

  • All relevant documentation, architecture diagrams, changelogs, and Cypress E2E tests have been updated to reflect the new API, explicit route tracking, and broader public API surface. ([[1]](https://github.com/passiveintent/core/pull/92/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR15-R29), [[2]](https://github.com/passiveintent/core/pull/92/files#diff-7eb5f05e9df8fd39bfe2e12fec9151ad1eac23e9e7a4dd7891f4b2d1d450faf2R15-R33), [[3]](https://github.com/passiveintent/core/pull/92/files#diff-af0c08d6f291aa75c55d4ad3ec19fd4b728edcf43a39c80d566f661b3b311c44L177-R179), [[4]](https://github.com/passiveintent/core/pull/92/files#diff-af0c08d6f291aa75c55d4ad3ec19fd4b728edcf43a39c80d566f661b3b311c44L656-R656), [[5]](https://github.com/passiveintent/core/pull/92/files#diff-097350575d712f33b11767cc33913621617a28bf23a16fbf7d59384503128c54L11-R15), [[6]](https://github.com/passiveintent/core/pull/92/files#diff-097350575d712f33b11767cc33913621617a28bf23a16fbf7d59384503128c54L26-R34), [[7]](https://github.com/passiveintent/core/pull/92/files#diff-097350575d712f33b11767cc33913621617a28bf23a16fbf7d59384503128c54L45-R56), [[8]](https://github.com/passiveintent/core/pull/92/files#diff-097350575d712f33b11767cc33913621617a28bf23a16fbf7d59384503128c54L84-L105), [[9]](https://github.com/passiveintent/core/pull/92/files#diff-097350575d712f33b11767cc33913621617a28bf23a16fbf7d59384503128c54L135-L146), [[10]](https://github.com/passiveintent/core/pull/92/files#diff-941203926b9764ef11068cb054376832351e5d9ca0c8d56e9c46272ac8c77b83L1300-R1300), [[11]](https://github.com/passiveintent/core/pull/92/files#diff-941203926b9764ef11068cb054376832351e5d9ca0c8d56e9c46272ac8c77b83L1341-R1343), [[12]](https://github.com/passiveintent/core/pull/92/files#diff-23ae42edc4683bfb6c2b26dea93de94504b8334c1cd7f9ecffbd088fea5c1317L16-R18), [[13]](https://github.com/passiveintent/core/pull/92/files#diff-23ae42edc4683bfb6c2b26dea93de94504b8334c1cd7f9ecffbd088fea5c1317R54-R62), [[14]](https://github.com/passiveintent/core/pull/92/files#diff-3df99b0cbd1ab7c7f98cc7abf556aa248867200f6ae86001ed58fa60f17e1f13L13-R19), [[15]](https://github.com/passiveintent/core/pull/92/files#diff-3df99b0cbd1ab7c7f98cc7abf556aa248867200f6ae86001ed58fa60f17e1f13L29-R28), [[16]](https://github.com/passiveintent/core/pull/92/files#diff-3df99b0cbd1ab7c7f98cc7abf556aa248867200f6ae86001ed58fa60f17e1f13L41-R43))

These changes make the browser integration more powerful and explicit, improve collision safety in graph storage, and clarify the API for both vanilla JS and framework users.- createBrowserIntent() now returns IntentManager, exposing the full public API.

  • Removed MouseKinematicsAdapter; URL tracking is now explicit via engine.track(pathname).
  • Changed BigramPolicy separator to NUL (\x00) for collision safety.
  • Unified guard in incrementCounter() to prevent multiple error calls.

feat(react): release @passiveintent/react v1.3.0 with useRouteTracker hook

  • Added useRouteTracker(pathname) hook for syncing route changes in push-state SPAs.
  • Requires @passiveintent/core@^1.2.0 for compatibility with the new IntentManager.

docs: update CHANGELOG.md for core and react packages

  • Documented changes and new features in both @passiveintent/core and @passiveintent/react.

Description

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor / chore

Checklist

  • My code follows the project's style guidelines
  • I have run npm run lint and npm run typecheck locally
  • I have added/updated tests that prove my fix or feature works
  • All existing tests pass (npm run test:unit -w @passiveintent/core)
  • I have updated documentation where applicable

Summary by CodeRabbit

  • New Features

    • Added React hook useRouteTracker to sync SPA route changes into the engine.
    • createBrowserIntent now exposes the full public API (telemetry, predictions, counters, etc.).
  • Breaking Changes

    • URL tracking is no longer automatic—call track(pathname) (or useRouteTracker) for SPA navigation.
    • BigramPolicy storage format changed; previously persisted bigrams will be ignored and relearned.
  • Bug Fixes

    • incrementCounter silently rejects non-finite/non-number increments and returns 0.

- `createBrowserIntent()` now returns `IntentManager`, exposing the full public API.
- Removed `MouseKinematicsAdapter`; URL tracking is now explicit via `engine.track(pathname)`.
- Changed `BigramPolicy` separator to NUL (`\x00`) for collision safety.
- Unified guard in `incrementCounter()` to prevent multiple error calls.

feat(react): release @passiveintent/react v1.3.0 with useRouteTracker hook

- Added `useRouteTracker(pathname)` hook for syncing route changes in push-state SPAs.
- Requires `@passiveintent/core@^1.2.0` for compatibility with the new IntentManager.

docs: update CHANGELOG.md for core and react packages

- Documented changes and new features in both @passiveintent/core and @passiveintent/react.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 23, 2026

📝 Walkthrough

Walkthrough

createBrowserIntent() now returns IntentManager instead of IntentEngine, removing MouseKinematicsAdapter factory wiring and requiring explicit engine.track(pathname) for URL tracking. BigramPolicy encoding switched from arrow to NUL separator. Counter validation unified, and a new React useRouteTracker() hook syncs SPA navigation to the engine.

Changes

Cohort / File(s) Summary
Version Updates
packages/core/package.json, packages/react/package.json
Bump versions to core 1.2.0 and react 1.3.0.
Changelogs & Docs
CHANGELOG.md, packages/core/CHANGELOG.md, packages/core/README.md, packages/core/docs/architecture.md, packages/core/src/index.ts, packages/react/CHANGELOG.md, packages/react/README.md
Updated documentation/changelogs to reflect createBrowserIntent() returning IntentManager, removal of automatic MouseKinematics URL wiring, BigramPolicy separator change, unified counter validation, and new useRouteTracker() hook.
Factory & Public Return Type
packages/core/src/factory.ts, packages/core/src/index.ts
createBrowserIntent() now constructs/returns an IntentManager (signature updated); factory no longer instantiates MouseKinematicsAdapter and delegates browser adapter behavior to the manager.
Engine: IntentManager
packages/core/src/engine/intent-manager.ts, packages/core/src/engine/policies/bigram-policy.ts
incrementCounter() now early-returns 0 when by is not a finite number via a unified guard. BigramPolicy keys now use NUL (\x00) as separator instead of U+2192.
Tests (Core)
packages/core/tests/microkernel.test.mjs, packages/core/tests/policies.test.mjs, packages/core/tests/unit-fast.test.mjs
Updated tests to expect synchronous track() emission, expanded API exposure assertions, replaced arrow-based bigram assertions with \x00, and adjusted incrementCounter invalid-by expectations to return 0 without onError.
Sandbox & E2E
packages/core/sandbox/browser-intent/app.ts, packages/core/cypress/e2e/browser-intent.cy.ts
Exposed window.__engine as IntentManagerLike, added explicit engine.track(window.location.pathname) on init, removed pushState/popstate interception tests, and added getTelemetry() assertions.
React: Route Tracking Hook
packages/react/src/hooks.ts, packages/react/src/index.ts, packages/react/tests/hooks.test.ts
Added exported useRouteTracker(currentRoute: string): void hook (reads context, throws when provider absent, calls ctx.track on route changes, uses debug label) and comprehensive tests verifying provider guard, initial mount, change detection, and idempotency.

Sequence Diagram(s)

sequenceDiagram
    participant Component as React Component
    participant Hook as useRouteTracker Hook
    participant Provider as PassiveIntentProvider
    participant Engine as IntentManager

    Component->>Hook: render with currentRoute
    Hook->>Hook: store prev route (useRef)
    Hook->>Hook: useEffect detects route change
    Hook->>Provider: read PassiveIntentContext
    Provider-->>Hook: returns ctx (track method)
    Hook->>Engine: ctx.track(newRoute)
    Engine->>Engine: emit state_change event
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

Poem

🐰 I hopped through code with curious cheer,
I swapped arrows for quiet NUL near,
Managers now full, no mouse to spy,
Routes tracked by hooks when routes go by.
A rabbit's refactor — tidy and spry!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately and specifically describes the main change: releasing @passiveintent/core v1.2.0 with the IntentManager API, which is the primary objective of this multi-file changeset affecting the core library version, API return types, documentation, and tests.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 core-fixes

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/react/package.json (1)

68-72: ⚠️ Potential issue | 🟠 Major

Update peerDependency to require @passiveintent/core@^1.2.0.

The CHANGELOG at packages/react/CHANGELOG.md explicitly states that version 1.3.0 "Requires @passiveintent/core@^1.2.0", but the peerDependencies still declares ^1.1.0. This mismatch could cause consumers using core@1.1.x to encounter unexpected behavior or type errors, since the new useRouteTracker hook and updated API surface depend on the IntentManager changes introduced in core 1.2.0.

🔧 Proposed fix
   "peerDependencies": {
-    "@passiveintent/core": "^1.1.0",
+    "@passiveintent/core": "^1.2.0",
     "react": ">=18.0.0",
     "react-dom": ">=18.0.0"
   },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/react/package.json` around lines 68 - 72, Update the peerDependency
for `@passiveintent/core` in packages/react's package.json from ^1.1.0 to ^1.2.0
to match the CHANGELOG and ensure compatibility with the new useRouteTracker
hook and IntentManager API changes; locate the peerDependencies block in
package.json and change the `@passiveintent/core` version string to "^1.2.0".
packages/core/docs/architecture.md (1)

2758-2758: ⚠️ Potential issue | 🟠 Major

Bigram encoding separator docs are stale ( vs \x00).

This section still documents Unicode arrow encoding, but the PR changes the separator to NUL. Keeping this stale will mislead users implementing interop/migrations.

✏️ Suggested doc correction
-**Encoding:** Bigram states are encoded as `"prev→current"` strings (using the Unicode arrow `\u2192`). They share the same `MarkovGraph` with unigram states, inheriting LFU pruning under `maxStates`.
+**Encoding:** Bigram states are encoded using a NUL separator (`"prev\x00current"`). This avoids delimiter collisions in user-provided state labels. They share the same `MarkovGraph` with unigram states, inheriting LFU pruning under `maxStates`.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/docs/architecture.md` at line 2758, The docs still state bigram
states are encoded as "prev→current" (Unicode arrow) but the implementation now
uses a NUL separator ("\x00"); update the Architecture docs text that describes
Bigram encoding to reflect the NUL separator (e.g., replace the quoted example
"prev→current" with "prev\x00current" and mention that MarkovGraph
bigram/unigram states share LFU pruning under maxStates), ensuring any
references to the Unicode arrow are removed so interop/migration guidance
matches the actual implementation.
🧹 Nitpick comments (2)
packages/react/src/hooks.ts (1)

1000-1001: Consider updating JSDoc reference to removed adapter.

The comment references MouseKinematicsAdapter which is being removed in this release. While the explanation is technically accurate (explaining why the hook exists), it may confuse readers who won't find this adapter in the codebase. Consider rephrasing to focus on the behavior rather than the removed component.

📝 Suggested documentation update
 /**
  * `useRouteTracker` — manually syncs route changes into the engine for
  * push-state SPAs (Next.js App Router, React Router v6, Vue Router, etc.)
- * where `history.pushState` is not intercepted by `MouseKinematicsAdapter`.
+ * where `history.pushState` navigation does not automatically trigger tracking.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/react/src/hooks.ts` around lines 1000 - 1001, The JSDoc mentions the
now-removed symbol MouseKinematicsAdapter which will confuse readers; update the
comment to remove that adapter name and instead describe the behavior (e.g.,
single-page app navigation via history.pushState not being intercepted by
mouse/kinematics listeners) and why the hook exists, keeping examples like
Next.js App Router / React Router v6 for context; locate the JSDoc that
references MouseKinematicsAdapter in packages/react/src/hooks.ts and replace the
adapter name with a short description of the behavior that triggers the hook
fallback.
packages/core/cypress/e2e/browser-intent.cy.ts (1)

96-101: Optionally harden telemetry assertions for stronger signal.

You already check shape/type; consider also asserting non-empty sessionId and finite, non-negative transitionsEvaluated to catch subtle regressions.

✅ Suggested test hardening
   it('getTelemetry() returns a valid telemetry snapshot', () => {
     cy.window().then((win) => {
       const telemetry = win.__engine.getTelemetry();
-      expect(telemetry).to.have.property('sessionId').that.is.a('string');
-      expect(telemetry).to.have.property('transitionsEvaluated').that.is.a('number');
+      expect(telemetry).to.have.property('sessionId').that.is.a('string').and.not.be.empty;
+      expect(telemetry).to.have.property('transitionsEvaluated').that.is.a('number');
+      expect(Number.isFinite(telemetry.transitionsEvaluated)).to.equal(true);
+      expect(telemetry.transitionsEvaluated).to.be.at.least(0);
     });
   });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/cypress/e2e/browser-intent.cy.ts` around lines 96 - 101, The
test for getTelemetry() currently only checks types; improve assertions in the
it('getTelemetry() returns a valid telemetry snapshot') block by asserting that
telemetry.sessionId (from win.__engine.getTelemetry()) is a non-empty string and
that telemetry.transitionsEvaluated is a finite integer >= 0 (e.g.,
Number.isFinite and >= 0 or other appropriate checks) to ensure stronger,
non-empty/valid values are returned; update the expect assertions accordingly
inside the cy.window().then callback.
🤖 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/core/CHANGELOG.md`:
- Around line 19-23: Update the changelog entry to explicitly mention that
removing MouseKinematicsAdapter also removed the old deferred initial pathname
auto-track: callers upgrading from createBrowserIntent() (which now returns
IntentManager) must explicitly call engine.track(window.location.pathname) (or
equivalent) on startup to reproduce the previous initial-path emit; reference
createBrowserIntent(), MouseKinematicsAdapter, and engine.track() in the note so
readers know exactly what to add during migration.

In `@packages/core/docs/architecture.md`:
- Around line 1300-1301: Update the Layer 3 description (the sentence about
"Returns a fully configured IntentManager with browser defaults") to explicitly
state that SPA route synchronization is not automatic: add a short note that
applications must call track(pathname) (or use the framework hook equivalent)
whenever the client-side route changes to sync routes with the IntentManager;
mention IntentManager and track(pathname) by name so readers know which function
to invoke.
- Around line 1341-1343: Update the phrasing that suggests web adapters in
src/plugins/web/ are usable for React Native; clarify that the four concrete
implementations for the microkernel IntentEngine are browser-specific and that
platforms like React Native (and other non-browser hosts such as Electron when
using native shells) require custom adapter implementations or platform-specific
wiring rather than the existing web/* adapters.

In `@packages/core/src/factory.ts`:
- Around line 151-159: The factory createBrowserIntent should preserve the
legacy default storage key instead of passing undefined to IntentManager; update
the storageKey assignment in createBrowserIntent to use config.storageKey if
provided, otherwise fall back to the legacy string "passive-intent-engine"
(i.e., use a nullish/coalesce check) so existing browser models continue to be
persisted under the original key.

In `@packages/core/src/index.ts`:
- Around line 124-125: Update the doc comment for the IntentManager export to
explicitly state that route tracking is not automatic and requires explicit
calls to the IntentManager.track(pathname) method; mention that browser adapters
are wired in but route changes must be reported via track(pathname) rather than
being auto-detected so callers know to migrate to explicit tracking.

In `@packages/react/CHANGELOG.md`:
- Line 23: Update the changelog sentence to clearly separate the two behaviors:
state that useRouteTracker throws a descriptive error when invoked outside
PassiveIntentProvider, and that it only skips the initial track() call in SSR or
when the Provider exists but the engine is not yet live (not when the Provider
is missing). Reference useRouteTracker, PassiveIntentProvider, and track() in
the revised wording so the changelog accurately matches the hook contract.

In `@packages/react/README.md`:
- Around line 215-221: The example RootLayout passes storageKey directly to
PassiveIntentProvider but the component expects a config prop; update RootLayout
to pass a config object (e.g., config={{ storageKey: "my-app" }}) to
PassiveIntentProvider so it matches the documented API used by useRouteTracker
and the API table; locate the PassiveIntentProvider usage in the RootLayout
function and replace the storageKey prop with a single config prop containing
storageKey.

---

Outside diff comments:
In `@packages/core/docs/architecture.md`:
- Line 2758: The docs still state bigram states are encoded as "prev→current"
(Unicode arrow) but the implementation now uses a NUL separator ("\x00"); update
the Architecture docs text that describes Bigram encoding to reflect the NUL
separator (e.g., replace the quoted example "prev→current" with
"prev\x00current" and mention that MarkovGraph bigram/unigram states share LFU
pruning under maxStates), ensuring any references to the Unicode arrow are
removed so interop/migration guidance matches the actual implementation.

In `@packages/react/package.json`:
- Around line 68-72: Update the peerDependency for `@passiveintent/core` in
packages/react's package.json from ^1.1.0 to ^1.2.0 to match the CHANGELOG and
ensure compatibility with the new useRouteTracker hook and IntentManager API
changes; locate the peerDependencies block in package.json and change the
`@passiveintent/core` version string to "^1.2.0".

---

Nitpick comments:
In `@packages/core/cypress/e2e/browser-intent.cy.ts`:
- Around line 96-101: The test for getTelemetry() currently only checks types;
improve assertions in the it('getTelemetry() returns a valid telemetry
snapshot') block by asserting that telemetry.sessionId (from
win.__engine.getTelemetry()) is a non-empty string and that
telemetry.transitionsEvaluated is a finite integer >= 0 (e.g., Number.isFinite
and >= 0 or other appropriate checks) to ensure stronger, non-empty/valid values
are returned; update the expect assertions accordingly inside the
cy.window().then callback.

In `@packages/react/src/hooks.ts`:
- Around line 1000-1001: The JSDoc mentions the now-removed symbol
MouseKinematicsAdapter which will confuse readers; update the comment to remove
that adapter name and instead describe the behavior (e.g., single-page app
navigation via history.pushState not being intercepted by mouse/kinematics
listeners) and why the hook exists, keeping examples like Next.js App Router /
React Router v6 for context; locate the JSDoc that references
MouseKinematicsAdapter in packages/react/src/hooks.ts and replace the adapter
name with a short description of the behavior that triggers the hook fallback.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3cb63362-70a8-4863-ac32-c2625a686cb8

📥 Commits

Reviewing files that changed from the base of the PR and between bb0d68e and 781f11d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (20)
  • CHANGELOG.md
  • packages/core/CHANGELOG.md
  • packages/core/README.md
  • packages/core/cypress/e2e/browser-intent.cy.ts
  • packages/core/docs/architecture.md
  • packages/core/package.json
  • packages/core/sandbox/browser-intent/app.ts
  • packages/core/src/engine/intent-manager.ts
  • packages/core/src/engine/policies/bigram-policy.ts
  • packages/core/src/factory.ts
  • packages/core/src/index.ts
  • packages/core/tests/microkernel.test.mjs
  • packages/core/tests/policies.test.mjs
  • packages/core/tests/unit-fast.test.mjs
  • packages/react/CHANGELOG.md
  • packages/react/README.md
  • packages/react/package.json
  • packages/react/src/hooks.ts
  • packages/react/src/index.ts
  • packages/react/tests/hooks.test.ts

Comment thread packages/core/CHANGELOG.md Outdated
Comment thread packages/core/docs/architecture.md
Comment thread packages/core/docs/architecture.md Outdated
Comment thread packages/core/src/factory.ts
Comment thread packages/core/src/index.ts Outdated
Comment thread packages/react/CHANGELOG.md Outdated
Comment thread packages/react/README.md
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/core/CHANGELOG.md (1)

23-23: Tighten wording for readability at Line 23.

“outside of the initial page-load emit” reads cleaner as “outside the initial page-load emit.”

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/CHANGELOG.md` at line 23, Update the phrasing in the CHANGELOG
entry referencing MouseKinematicsAdapter: replace “outside of the initial
page-load emit” with “outside the initial page-load emit.” inside the paragraph
that mentions MouseKinematicsAdapter, IntentManager, IInputAdapter,
createBrowserIntent, engine.track, and useRouteTracker so the sentence reads
more cleanly while keeping the same meanings and references.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/core/CHANGELOG.md`:
- Line 23: Update the phrasing in the CHANGELOG entry referencing
MouseKinematicsAdapter: replace “outside of the initial page-load emit” with
“outside the initial page-load emit.” inside the paragraph that mentions
MouseKinematicsAdapter, IntentManager, IInputAdapter, createBrowserIntent,
engine.track, and useRouteTracker so the sentence reads more cleanly while
keeping the same meanings and references.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0a5ca964-223b-4ee7-897e-e1ad0bfa150e

📥 Commits

Reviewing files that changed from the base of the PR and between 781f11d and 003b20f.

📒 Files selected for processing (6)
  • packages/core/CHANGELOG.md
  • packages/core/docs/architecture.md
  • packages/core/src/factory.ts
  • packages/core/src/index.ts
  • packages/react/CHANGELOG.md
  • packages/react/README.md
✅ Files skipped from review due to trivial changes (2)
  • packages/core/src/index.ts
  • packages/react/README.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/core/docs/architecture.md
  • packages/react/CHANGELOG.md
  • packages/core/src/factory.ts

@purushpsm147 purushpsm147 merged commit 79d2df1 into main Mar 23, 2026
24 checks passed
@purushpsm147 purushpsm147 deleted the core-fixes branch March 23, 2026 05:42
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