Split bot runtime and tooling#62
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the iCKB bot by modularizing its core logic into a private @ickb/bot package and transitioning the apps/bot package into a CLI adapter. It introduces a new production launcher and an incident collector script, while updating the rebalancing policy to use a 180-epoch ring model for pool inventory management, excess withdrawals, and reserve recovery. Feedback on the changes suggests preventing precision loss in the incident collector's time-bound parsing by validating safe integers using BigInt first, and using the in operator for cleaner type narrowing when extracting custom properties from Error objects.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the iCKB bot by extracting its core runtime, rebalancing policy, and observability logic into a new private packages/bot package, leaving apps/bot as a CLI adapter. It also introduces a production launcher with run-slot retention, an incident collector script, and updates to packages/node-utils for better transaction validation and error handling. Feedback on the changes suggests restoring Date object serialization in the stringifyBigInt helper within packages/sdk to prevent potential runtime errors and maintain compatibility with previous behavior.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request restructures the repository by moving the core bot implementation into a private packages/bot package and refactoring apps/bot as a CLI adapter. It also updates documentation, introduces new launcher and incident collection scripts, and refines the rebalancing policy to use a ring-based model. The code review feedback focuses on improving robustness and efficiency: making temporary file cleanup and log pruning deletions best-effort to prevent critical failures, replacing manual timestamp scanning with a regular expression, and explicitly handling Date objects in the custom JSON serialization helper to avoid data loss.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the iCKB bot architecture by extracting the core bot runtime, rebalancing policy, and observability logic from apps/bot into a new private workspace package packages/bot. The apps/bot package is renamed to @ickb/bot-cli and updated to run directly from TypeScript source (Node 22.19+) as a CLI adapter. The rebalancing policy has been updated to replace the future inventory and non-standard cleanup logic with a ring bucket seeding model, excess withdrawals, and reserve recovery. Additionally, the launcher now manages log retention across 16 fixed run slots with best-effort quota pruning, and ring segment diagnostics are written as content-addressed artifacts. The changes are well-structured, successfully modularizing the bot's core logic into a reusable package while simplifying the CLI adapter to run directly from source. Since there are no review comments, no feedback on reviewer comments is provided.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request restructures the iCKB bot by extracting its core logic, rebalancing policy, and harness into a private @ickb/bot package, leaving apps/bot as a CLI adapter (@ickb/bot-cli). The rebalancing policy is updated to use a ring bucket model and enhanced reserve recovery logic. Additionally, minor refactorings and safety checks are introduced across packages/node-utils and packages/sdk. A review comment identifies an issue in packages/sdk/src/client/sdk_error.ts where the removal of explicit Date handling in the custom JSON serialization helper could lead to data loss or serialization errors.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request restructures the bot architecture by moving the core bot logic, loop, state, policy, and observability features from apps/bot into a new private package @ickb/bot under packages/bot, while renaming the CLI app to @ickb/bot-cli. It also refactors transient RPC/transport error retry logic and updates TypeScript configurations. In packages/sdk, several explicit error-throwing checks were replaced with non-null assertions (!). The review feedback advises against using these non-null assertions, recommending instead that explicit errors be thrown to ensure that any invariant breaks are made visible rather than failing silently at runtime.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the bot application into a CLI-focused structure, introducing a new @ickb/bot package for core runtime logic, updating deployment scripts to use systemd with encrypted credentials, and improving observability with content-addressed artifacts. My feedback highlights a critical issue in the canonicalJson implementation where the JSON.stringify replacer is misused for deep sorting and serialization, and provides a corrected implementation to ensure consistent, recursive sorting and proper handling of Date and BigInt types.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request restructures the iCKB bot by extracting its core logic into a new private package, @ickb/bot, and refactoring the bot application as a CLI adapter, @ickb/bot-cli. The rebalancing policy has been updated to support ring bucket seeding, excess withdrawals, and reserve recovery. The update also refactors the logging, launcher, and incident collection scripts, improves error handling and transaction validation in the SDK and node utilities, and updates the systemd deployment configuration and documentation. No review comments were provided, so there is no feedback to address.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
LGTM Phroi %364 |
Why
The bot slice now depends on the split SDK and protocol packages. Moving bot runtime policy, transaction planning, and observability into a private package keeps
apps/botas a small CLI adapter and makes the production launcher and incident tools match the source-run deployment model. This PR also carries forward the remaining lower-level package fixes from earlier slices so the bot work lands on the same package contracts as the live migration candidate.Changes
@ickb/botwith bot loop, state reads, rebalancing policy, transaction planning, observability, artifact output, and focused package tests.apps/botinto private@ickb/bot-clisource-run wiring around the bot package..mjsscripts with typedscripts/bot/**modules plus Node test coverage underscripts/test/bot/**.pnpm lintandpnpm bot:check, while preserving the existing root test path for legacy.mjsscript tests.--experimental-default-type=modulelaunch flag from bot scripts, docs, systemd units, and tests for Node 24 CI.