Skip to content

feat(monorepo): domain-driven package split foundation — @gt/core + boundary guard (approach 3 of 3)#192

Open
genesiscz wants to merge 2 commits into
masterfrom
feat/monorepo-3
Open

feat(monorepo): domain-driven package split foundation — @gt/core + boundary guard (approach 3 of 3)#192
genesiscz wants to merge 2 commits into
masterfrom
feat/monorepo-3

Conversation

@genesiscz

@genesiscz genesiscz commented May 31, 2026

Copy link
Copy Markdown
Owner

Monorepo foundation — Approach 3: Domain-driven package split (enforced boundaries)

One of three competing monorepo designs (feat/monorepo-1 / -2 / -3). Each was independently designed, implemented, and verified by a separate agent. Pick one; close the other two. This is the clean-architecture / long-term-maintainability option.

What it does

  • Bun workspaces, no build step (exports → raw .ts). Keeps the @app/* → ./src/* alias forever; every moved file leaves a pure export * from "@gt/..." re-export shim.
  • Designs a full layered 25-package architecture (L0 @gt/core → L1 cli-core/logger/prompts/storage/fs/process → L2 database/net/search → L3 ai/macos/github/claude/agents/markdown/audio/notifications → L4 ui/tui/cmux/tmux), with documented cycle-breaks (e.g. ai ↔ macos via @gt/ai/contracts, notifications → @app/telegram-bot via a NotifierChannel interface). See MONOREPO-SPEC.md.
  • Foundation milestone implemented: extracts the import-closed leaf set into @gt/core (packages/core/): json/SafeJSON, date, date-locale, format, string, array, object, math, hash, tokens, Stopwatch. Migrates 6 tools (timer, last-changes, files-to-prompt, usage, json, benchmark).
  • Adds scripts/ci/check-package-boundaries.ts (repo-idiomatic, like the existing logging-guard / palette checks): fails on layer back-edges / package → @app/<tool> imports / tool↔tool imports; currently warns on the 205 known reverse-dep backlog sites (flip warn→fail per phase).

Green bar (independently verified)

  • whole-repo tsgo --noEmit = 0 errors (== master baseline)
  • boundary guard exits 0 (real negative test: injecting @app/logger into @gt/core makes it fail); logging-guard + biome clean
  • 171 package tests pass; ./tools + all 6 tools functional smoke-run (caught a date → date-locale runtime require() trap that static analysis/tsgo miss)

Trade-offs vs the other two

Cleanest long-term architecture, explicit ownership, enforced dependency direction. Largest eventual change and most upfront design; foundation extracts only @gt/core (the rest is a documented, layered roadmap).

Full design on the branch: MONOREPO-SPEC.md + MONOREPO-PLAN.md.

Note: cold bun install hits the same pre-existing puppeteer postinstall failure (environmental, not branch-caused); PUPPETEER_SKIP_DOWNLOAD=1 bun install is clean.

🤖 Generated via a multi-agent design→implement→verify workflow.

Summary by CodeRabbit

  • New Features

    • Established monorepo structure with shared @gt/core utility package containing formatting, date/time, hashing, JSON parsing, and string manipulation utilities.
    • Added package boundary enforcement to CI pipeline.
  • Documentation

    • Added monorepo architecture specification and migration plan documents.

genesiscz added 2 commits May 31, 2026 17:24
Extract the import-closed leaf set (json/SafeJSON, date, date-locale, format,
string, array, object, math, hash, tokens, Stopwatch) into a no-build Bun
workspace package @gt/core whose exports point at raw .ts. Every old
@app/utils/<mod> path keeps working via a pure re-export shim, so the 70+
unmigrated tools compile unchanged. Migrate 6 representative tools (timer,
last-changes, files-to-prompt, usage, json, benchmark) to import @gt/core
directly. Add scripts/ci/check-package-boundaries.ts (fails on @gt/core
impurity, warns on the §0.3 reverse-dep backlog).
Whole-repo tsgo --noEmit = 0 errors (== master baseline); boundary + logging
guards green; moved tests pass (171) in their new home; ./tools + all 6 tools
smoke-run.
date-locale.ts moved alongside date.ts: date.ts lazy-requires ./date-locale
at runtime — invisible to a static-import audit and to tsgo; caught by the
functional last-changes smoke run.
@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR extracts a foundational @gt/core monorepo package from existing shared utilities in src/utils, sets up Bun workspaces, adds re-export shims to preserve backward compatibility, migrates 6 representative tools, and introduces a CI-enforced package boundary guard. The change is documented in two new architecture specifications.

Changes

Monorepo Foundation Setup

Layer / File(s) Summary
Monorepo migration plan and target architecture
MONOREPO-PLAN.md, MONOREPO-SPEC.md
Documents the domain-driven approach defining foundation scope (core extraction + representative tools + shims), layered package catalog (L0–L4), phased follow-ups, cutover sequence, and acceptance criteria. Specifies empirical constraints, tooling strategy, and boundary enforcement rules.
Workspace setup and package scaffolding
package.json, packages/core/package.json, packages/core/tsconfig.json, tsconfig.json
Enables Bun workspaces with packages/* glob; creates @gt/core manifest with subpath exports mapping to src/*.ts entry files; adds @gt/core and @gt/core/* path aliases; expands TypeScript include to cover packages/*/src/**/*.
Core utility module implementations
packages/core/src/array.ts, packages/core/src/date.ts, packages/core/src/date-locale.ts, packages/core/src/format.ts, packages/core/src/hash.ts, packages/core/src/json.ts, packages/core/src/math.ts, packages/core/src/object.ts, packages/core/src/string.ts, packages/core/src/tokens.ts, packages/core/src/Stopwatch.ts, packages/core/src/index.ts
Implements locale-aware date/time formatting, duration and number formatters, JSON safety wrapper, token estimation/truncation, string utilities (slugify, ANSI stripping, escaping, fuzzy matching), array/object/hash helpers, and a Stopwatch timer class backed by performance.now(). Barrel entrypoint re-exports all public APIs.
Re-export shims in src/utils to preserve @app/utils paths
src/utils/Stopwatch.ts, src/utils/array.ts, src/utils/date.ts, src/utils/date-locale.ts, src/utils/format.ts, src/utils/hash.ts, src/utils/json.ts, src/utils/math.ts, src/utils/object.ts, src/utils/string.ts, src/utils/tokens.ts
Replaces local implementations with single re-export statements pointing to @gt/core/*, maintaining backward compatibility for unmigrated tools that still import from @app/utils/*.
Migrate 6 representative tools to @gt/core imports
src/benchmark/commands/history.ts, src/benchmark/commands/show.ts, src/benchmark/lib/display.ts, src/benchmark/lib/results.ts, src/benchmark/lib/runner.ts, src/files-to-prompt/index.ts, src/json/index.ts, src/last-changes/index.ts, src/timer/index.ts, src/usage/index.ts
Updates benchmark suite, files-to-prompt, json, last-changes, timer, and usage tools to import format/date/json utilities directly from @gt/core/*, demonstrating the target import pattern.
Package boundary guard and CI scope expansion
scripts/ci/check-package-boundaries.ts, scripts/ci/logging-guard.sh
Introduces check-package-boundaries.ts to enforce layered dependency rules: hard-fails on @gt/core impurity and package-to-tool imports; warns (warn-only during foundation) for known reverse-dependency backlog and tool-to-tool internal imports. Expands logging-guard.sh to scan both src and packages for logger safety violations.

Sequence Diagram(s)

A sequence diagram would not add clarity here; the changes are primarily architectural (file structure, re-exports, config) and documentation rather than multi-component interaction flows.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • genesiscz/GenesisTools#118: Introduces locale-aware formatDateTime and system-locale detection in src/utils/date.ts that this PR extracts and relocates to @gt/core/date and @gt/core/date-locale.
  • genesiscz/GenesisTools#140: Adds benchmark command modules (history/show/display/results/runner) that this PR directly updates to use the new @gt/core/* import paths.
  • genesiscz/GenesisTools#19: Consolidates shared utility logic into src/utils/* (format, string, array modules) that this PR continues to consolidate by extracting into packages/core and re-exporting shims.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely summarizes the primary change: implementing a domain-driven monorepo foundation with @gt/core package extraction and boundary guard enforcement, and correctly identifies this as 'approach 3 of 3' competing designs.
Docstring Coverage ✅ Passed Docstring coverage is 85.25% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 feat/monorepo-3

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

@socket-security

Copy link
Copy Markdown

@socket-security

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm ioredis is 96.0% likely obfuscated

Confidence: 0.96

Location: Package overview

From: ?npm/ioredis@5.9.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/ioredis@5.9.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request implements the foundation milestone of a domain-driven monorepo migration. It enables Bun workspaces, scaffolds the @gt/core package, moves several leaf utility modules to the new package, and leaves re-export shims at their original paths to maintain backward compatibility. Additionally, six representative tools are migrated to consume @gt/core directly, and a package-boundary guard script is introduced to enforce dependency layers. Feedback suggests adding a defensive length check in the cosineDistance utility to prevent out-of-bounds access and NaN calculations.

Comment thread packages/core/src/math.ts
Comment on lines +9 to +27
export function cosineDistance(a: Float32Array, b: Float32Array): number {
let dot = 0;
let normA = 0;
let normB = 0;

for (let i = 0; i < a.length; i++) {
dot += a[i] * b[i];
normA += a[i] * a[i];
normB += b[i] * b[i];
}

const denom = Math.sqrt(normA) * Math.sqrt(normB);

if (denom === 0) {
return 2;
}

return 1 - dot / denom;
}

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.

medium

Add a defensive check to ensure both input vectors have the same length. If their lengths differ, accessing elements beyond the shorter vector's bounds will result in NaN calculations without throwing a clear error.

export function cosineDistance(a: Float32Array, b: Float32Array): number {
    if (a.length !== b.length) {
        throw new RangeError(`Vector lengths must match (got ${a.length} and ${b.length})`);
    }
    let dot = 0;
    let normA = 0;
    let normB = 0;

    for (let i = 0; i < a.length; i++) {
        dot += a[i] * b[i];
        normA += a[i] * a[i];
        normB += b[i] * b[i];
    }

    const denom = Math.sqrt(normA) * Math.sqrt(normB);

    if (denom === 0) {
        return 2;
    }

    return 1 - dot / denom;
}

@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: 12

🤖 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 `@MONOREPO-PLAN.md`:
- Line 19: Replace the machine-specific hardcoded command "cd
/Users/Martin/Tresors/Projects/GenesisTools-monorepo-3" in MONOREPO-PLAN.md with
a repo-relative instruction telling contributors to run the following steps from
the repository root (e.g., “From the repo root, run …”) or to change directory
using a generic method (e.g., determine the repo root with git) so the plan is
portable; locate the exact hardcoded string in the file and update the line to a
generic, non-machine-specific instruction.

In `@MONOREPO-SPEC.md`:
- Around line 297-310: The unlabeled code fence containing the ASCII dependency
graph (the block that starts with the tree showing L0 through L4 and modules
like `@gt/core`, `@gt/cli-core`, `@gt/logger`, `@gt/ai`, `@gt/ui`, etc.) needs a language
identifier to satisfy markdownlint; update the opening fence from ``` to a
labeled fence such as ```text (or ```txt) so the graph block is recognized as
plain text.

In `@packages/core/src/date-locale.ts`:
- Line 49: The locale precedence is wrong: the envLocale const currently prefers
LANG before LC_ALL; update the lookup so LC_ALL takes highest precedence (e.g.,
check process.env.LC_ALL first, then process.env.LC_TIME, then process.env.LANG)
to ensure LC_ALL overrides other locale variables — change the envLocale
assignment in this file (the const envLocale) accordingly.

In `@packages/core/src/format.ts`:
- Line 405: The JSDoc in packages/core/src/format.ts that references the
Stopwatch module with the stale path "`@app/utils/Stopwatch`" needs to be updated
to the new module path "`@gt/core`"; locate the comment mentioning "Stopwatch"
(the line reading "For a full-featured stopwatch with laps/stamps, use Stopwatch
class from `@app/utils/Stopwatch`.") and change the import path text to "`@gt/core`"
so documentation points to the correct module (leave the rest of the JSDoc and
the "Stopwatch" identifier unchanged).

In `@packages/core/src/index.ts`:
- Around line 1-10: The root barrel (packages/core/src/index.ts) is missing a
re-export for the date-locale module; update the barrel to expose the
date-locale module by adding a re-export entry for "./date-locale" so consumers
can import date-locale from the package root (ensure the new export line matches
the style used for the other modules like "./date" and "./string").

In `@packages/core/src/math.ts`:
- Around line 14-27: Validate that the input vectors have the same length before
the loop in the cosine-distance computation: add a check that a.length ===
b.length at the top of the function (the function that computes cosine distance
using arrays a and b) and handle the mismatch by throwing a clear Error (e.g.
"Vectors must have same length: a.length=..., b.length=...") or returning a
defined value per project convention; this prevents out-of-range reads from b
inside the for loop and avoids NaN results.

In `@packages/core/src/object.ts`:
- Around line 8-10: The current isObject/deepMerge logic treats non-plain
objects as mergeable and uses for...in which can iterate prototype keys and
corrupt values (e.g., Date) or allow prototype pollution; update isObject to
only return true for plain objects (e.g., typeof value === "object" && value !==
null && (Object.getPrototypeOf(value) === Object.prototype ||
Object.getPrototypeOf(value) === null)) so Dates/RegExps/instances are excluded,
then change deepMerge to iterate only own property keys (use Object.keys and
Object.getOwnPropertySymbols if needed) instead of for...in, and explicitly skip
unsafe keys like "__proto__", "prototype", and "constructor" before merging;
reference functions: isObject and deepMerge and replace for...in usage with
own-key iteration and plain-object checks.

In `@packages/core/src/tokens.ts`:
- Around line 37-42: Validate and normalize maxTokens before performing
truncation in limitToTokens: coerce maxTokens to an integer via Math.floor,
treat non-positive values as a request to return an empty truncated result
(return { text: '', tokens: 0, truncated: true } when maxTokens <= 0), and then
use the normalized integer to compute slicing so tokens/counts cannot become
negative; apply the same validation/normalization to the other truncation blocks
in this file (the blocks around the original function and the sections noted at
47-51 and 55-60) so all truncation code consistently floors the value and
handles zero/negative inputs safely.

In `@scripts/ci/check-package-boundaries.ts`:
- Around line 70-71: The import scanner only matches "from '...'" forms, missing
side-effect imports like import "pkg"; update the regex in the pattern variable
to also capture bare imports (for example use a combined regex such as
(?:from\s+["']([^"']+)["']|import\s+["']([^"']+)["'])) and adjust the code that
consumes the match (the place that reads the capture groups from raw) to take
the non-null capture (group1 || group2); apply the same change to the other
occurrence referenced (the similar pattern around lines 87-88) so both scanners
collect side-effect imports.
- Line 51: The TOOL_IMPORT_RE currently requires a trailing "/" or quote which
misses bare imports like "`@app/logger`"; update the regex used for tool import
detection (TOOL_IMPORT_RE) to allow the end-of-string (or a closing quote) after
the captured tool name instead of requiring a slash, and apply the same fix to
the other occurrences referenced around lines 111-114 so bare specifiers like
"`@app/`<tool>" are matched and subject to Rule 3/4/5 checks.

In `@src/json/index.ts`:
- Line 6: The import in src/json/index.ts pulls SafeJSON from the wrong module;
replace the import of SafeJSON from "`@gt/core/json`" with the repo-mandated path
"`@app/utils/json`" so that SafeJSON used in this file (and any exports/functions
here) come from the canonical source; update the import statement that
references SafeJSON accordingly and ensure subsequent uses still call
SafeJSON.parse()/SafeJSON.stringify().

In `@src/usage/index.ts`:
- Line 7: Replace the incorrect import of SafeJSON from "`@gt/core/json`" with the
mandated module "`@app/utils/json`" in the file that imports SafeJSON; update the
import statement to reference "`@app/utils/json`" and ensure all usages within the
file continue to call SafeJSON.parse() and SafeJSON.stringify() as required by
the src/** guideline.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d6ede303-4775-4006-bbeb-dc68663924db

📥 Commits

Reviewing files that changed from the base of the PR and between 581f71f and a3105dd.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (49)
  • MONOREPO-PLAN.md
  • MONOREPO-SPEC.md
  • package.json
  • packages/core/package.json
  • packages/core/src/Stopwatch.ts
  • packages/core/src/array.test.ts
  • packages/core/src/array.ts
  • packages/core/src/date-locale.ts
  • packages/core/src/date.test.ts
  • packages/core/src/date.ts
  • packages/core/src/format.test.ts
  • packages/core/src/format.ts
  • packages/core/src/hash.ts
  • packages/core/src/index.ts
  • packages/core/src/json.test.ts
  • packages/core/src/json.ts
  • packages/core/src/math.test.ts
  • packages/core/src/math.ts
  • packages/core/src/object.test.ts
  • packages/core/src/object.ts
  • packages/core/src/string.test.ts
  • packages/core/src/string.ts
  • packages/core/src/tokens.test.ts
  • packages/core/src/tokens.ts
  • packages/core/tsconfig.json
  • scripts/ci/check-package-boundaries.ts
  • scripts/ci/logging-guard.sh
  • src/benchmark/commands/history.ts
  • src/benchmark/commands/show.ts
  • src/benchmark/lib/display.ts
  • src/benchmark/lib/results.ts
  • src/benchmark/lib/runner.ts
  • src/files-to-prompt/index.ts
  • src/json/index.ts
  • src/last-changes/index.ts
  • src/timer/index.ts
  • src/usage/index.ts
  • src/utils/Stopwatch.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • src/utils/date.ts
  • src/utils/format.ts
  • src/utils/hash.ts
  • src/utils/json.ts
  • src/utils/math.ts
  • src/utils/object.ts
  • src/utils/string.ts
  • src/utils/tokens.ts
  • tsconfig.json
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test (ubuntu-latest, 4)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Never add a file-path comment as the first line of files (e.g., // src/path/to/file.ts)
Do not add comments that restate what the code already says; avoid obvious comments like // Build initial context before buildContext()

Files:

  • packages/core/src/hash.ts
  • packages/core/src/array.ts
  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • packages/core/src/index.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • packages/core/src/object.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • packages/core/src/Stopwatch.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • packages/core/src/math.ts
  • scripts/ci/check-package-boundaries.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • packages/core/src/tokens.ts
  • src/utils/format.ts
  • packages/core/src/date-locale.ts
  • packages/core/src/json.ts
  • src/utils/Stopwatch.ts
  • packages/core/src/string.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
  • packages/core/src/date.ts
  • packages/core/src/format.ts
src/**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

src/**/*.ts: Always import and use SafeJSON from @app/utils/json instead of the global JSON object; use SafeJSON.parse() and SafeJSON.stringify() everywhere
Use logger (from @app/logger) for diagnostics; write to day-stamped file always and to stderr only when log level permits; use out.result() as the only writer to stdout
Log enough context to triage issues from logs alone without re-running the tool; log key decision branches, external-resource access, mode/config resolution, and result counts
Prefer error: err over error: err instanceof Error ? err.message : String(err) when the error field accepts unknown type

Files:

  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • src/utils/format.ts
  • src/utils/Stopwatch.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

src/**/*.{ts,tsx}: Do not use as any type assertions; use proper type narrowing, type guards, or explicit interfaces instead
When working with union types, use discriminant checks (e.g. entity.className === "User") instead of type assertions
Never use bare catch {} blocks; at minimum log the caught error with context using logger.debug() or logger.warn()
For functions with 3+ parameters or optional parameters, use an object parameter instead of positional parameters
Do not use one-line if statements, even for early returns; always use block form with braces
Add an empty line before if statements unless the preceding line is a variable declaration used by that if
Add an empty line after closing } unless followed by else, catch, finally, or another }
Always check isInteractive() from @app/utils/cli before showing prompts; provide sensible defaults or error with suggestCommand() in non-interactive mode

Files:

  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • src/utils/format.ts
  • src/utils/Stopwatch.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
src/utils/

📄 CodeRabbit inference engine (CLAUDE.md)

When creating a new tool, check if helper functions are general-purpose and usable by other tools; if so, place them in src/utils/ instead of inside the tool directory

Files:

  • src/utils/math.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • src/utils/object.ts
  • src/utils/tokens.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • src/utils/format.ts
  • src/utils/Stopwatch.ts
src/**/index.ts

📄 CodeRabbit inference engine (CLAUDE.md)

src/**/index.ts: Tool entry points must use a TypeScript file with shebang that shows an interactive tool selector when run without arguments, and executes the specified tool via bun run when given arguments
Tool entry points must end with await runTool(program, { tool }) from @app/utils/cli, which owns -v/--readme/help registration and console-level resolution

Files:

  • src/usage/index.ts
  • src/files-to-prompt/index.ts
  • src/json/index.ts
  • src/last-changes/index.ts
  • src/timer/index.ts
src/*/index.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Tool directories must contain either index.ts/index.tsx or standalone .ts/.tsx files; tool name is derived from directory name or filename without extension

Files:

  • src/usage/index.ts
  • src/files-to-prompt/index.ts
  • src/json/index.ts
  • src/last-changes/index.ts
  • src/timer/index.ts
src/**/commands/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Commands should be thin wrappers that parse arguments and delegate to business logic in src/<tool>/lib/ files; keep command files lean

Files:

  • src/benchmark/commands/history.ts
  • src/benchmark/commands/show.ts
🧠 Learnings (23)
📚 Learning: 2026-02-24T15:32:44.925Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 54
File: src/github/lib/review-output.ts:18-20
Timestamp: 2026-02-24T15:32:44.925Z
Learning: In TypeScript files, do not require a blank line between the opening brace of a function and the first statement if the first statement is the if statement immediately after the signature. The blank-line rule applies to separating an if from unrelated preceding code within the same block, not to spacing after the function opening brace. Apply this rule to all TS functions across the codebase.

Applied to files:

  • packages/core/src/hash.ts
  • packages/core/src/array.ts
  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • packages/core/src/index.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • packages/core/src/object.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • packages/core/src/Stopwatch.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • packages/core/src/math.ts
  • scripts/ci/check-package-boundaries.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • packages/core/src/tokens.ts
  • src/utils/format.ts
  • packages/core/src/date-locale.ts
  • packages/core/src/json.ts
  • src/utils/Stopwatch.ts
  • packages/core/src/string.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
  • packages/core/src/date.ts
  • packages/core/src/format.ts
📚 Learning: 2026-03-12T01:26:03.611Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 95
File: src/ask/lib/ChatSessionManager.ts:0-0
Timestamp: 2026-03-12T01:26:03.611Z
Learning: Use SafeJSON.parse(text, { strict: true }) for strict RFC 8259 validation in all non-config boundaries (API responses, JSONL, cache, subprocess output). The 3-arg form SafeJSON.parse(text, null, { strict: true }) is invalid and should not be used. Only lenient default (no options) is appropriate for user-authored config files that may contain comments/trailing commas. Apply this guideline across TypeScript files (src/**/*.ts) wherever SafeJSON.parse is used.

Applied to files:

  • packages/core/src/hash.ts
  • packages/core/src/array.ts
  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • packages/core/src/index.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • packages/core/src/object.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • packages/core/src/Stopwatch.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • packages/core/src/math.ts
  • scripts/ci/check-package-boundaries.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • packages/core/src/tokens.ts
  • src/utils/format.ts
  • packages/core/src/date-locale.ts
  • packages/core/src/json.ts
  • src/utils/Stopwatch.ts
  • packages/core/src/string.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
  • packages/core/src/date.ts
  • packages/core/src/format.ts
📚 Learning: 2026-03-12T01:26:18.985Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 95
File: src/claude/lib/history/search.ts:0-0
Timestamp: 2026-03-12T01:26:18.985Z
Learning: When using SafeJSON.parse in TypeScript code, prefer the two-argument form SafeJSON.parse(text, { strict: true }) to enable strict RFC 8259 validation via the native JSON.parse. Do NOT use the three-argument form SafeJSON.parse(text, null, { strict: true }). Apply strict parsing at remote/third-party API boundaries, JSONL parsing points, and subprocess output. Fall back to the lenient/default form only for user-authored config files that may legitimately contain comments or trailing commas. This pattern keeps strict validation where appropriate and preserves leniency for internal/config data.

Applied to files:

  • packages/core/src/hash.ts
  • packages/core/src/array.ts
  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • packages/core/src/index.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • packages/core/src/object.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • packages/core/src/Stopwatch.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • packages/core/src/math.ts
  • scripts/ci/check-package-boundaries.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • packages/core/src/tokens.ts
  • src/utils/format.ts
  • packages/core/src/date-locale.ts
  • packages/core/src/json.ts
  • src/utils/Stopwatch.ts
  • packages/core/src/string.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
  • packages/core/src/date.ts
  • packages/core/src/format.ts
📚 Learning: 2026-03-12T01:26:27.000Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 95
File: src/debugging-master/commands/tail.ts:0-0
Timestamp: 2026-03-12T01:26:27.000Z
Learning: In the genesiscz/GenesisTools repository, prefer using SafeJSON.parse(text, { strict: true }) (2-argument form) at all non-config JSON boundaries such as API responses, JSONL parsers, cache files, and subprocess stdout. Reserve the lenient default (SafeJSON.parse(text) with no options) only for user-authored config files that may legitimately contain comments or trailing commas.

Applied to files:

  • packages/core/src/hash.ts
  • packages/core/src/array.ts
  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • packages/core/src/index.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • packages/core/src/object.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • packages/core/src/Stopwatch.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • packages/core/src/math.ts
  • scripts/ci/check-package-boundaries.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • packages/core/src/tokens.ts
  • src/utils/format.ts
  • packages/core/src/date-locale.ts
  • packages/core/src/json.ts
  • src/utils/Stopwatch.ts
  • packages/core/src/string.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
  • packages/core/src/date.ts
  • packages/core/src/format.ts
📚 Learning: 2026-03-12T01:26:24.859Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 95
File: src/azure-devops/commands/history-sync.ts:0-0
Timestamp: 2026-03-12T01:26:24.859Z
Learning: In GenesisTools, ensure SafeJSON.parse is called with exactly two arguments. Use SafeJSON.parse(text, { strict: true }) for strict RFC 8259 validation, or pass a reviver function as the second argument. Do not call SafeJSON.parse(text, null, { strict: true }) since the function signature does not support a three-argument form. Apply this guideline to all TypeScript files that use SafeJSON.parse (e.g., src/utils/json.ts) and other related code.

Applied to files:

  • packages/core/src/hash.ts
  • packages/core/src/array.ts
  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • packages/core/src/index.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • packages/core/src/object.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • packages/core/src/Stopwatch.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • packages/core/src/math.ts
  • scripts/ci/check-package-boundaries.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • packages/core/src/tokens.ts
  • src/utils/format.ts
  • packages/core/src/date-locale.ts
  • packages/core/src/json.ts
  • src/utils/Stopwatch.ts
  • packages/core/src/string.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
  • packages/core/src/date.ts
  • packages/core/src/format.ts
📚 Learning: 2026-03-17T01:30:56.939Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 107
File: src/utils/macos/tts.ts:130-139
Timestamp: 2026-03-17T01:30:56.939Z
Learning: In genesiscz/GenesisTools, do not suggest converting two-argument functions with an optional second parameter (for example setMute(muted: boolean, app?: string)) to an object-parameter form. The project prefers simple positional parameters for short utility functions, even when an optional argument is present. The object-parameter guideline should only apply when a function has 3 or more parameters.

Applied to files:

  • packages/core/src/hash.ts
  • packages/core/src/array.ts
  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • packages/core/src/index.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • packages/core/src/object.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • packages/core/src/Stopwatch.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • packages/core/src/math.ts
  • scripts/ci/check-package-boundaries.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • packages/core/src/tokens.ts
  • src/utils/format.ts
  • packages/core/src/date-locale.ts
  • packages/core/src/json.ts
  • src/utils/Stopwatch.ts
  • packages/core/src/string.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
  • packages/core/src/date.ts
  • packages/core/src/format.ts
📚 Learning: 2026-03-22T22:19:49.876Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 119
File: src/indexer/index.ts:41-56
Timestamp: 2026-03-22T22:19:49.876Z
Learning: When using Bun projects, treat `import.meta.dir` as an absolute directory path provided by Bun. If you build paths by concatenating with `import.meta.dir` (e.g., `import.meta.dir + "/file.ts"`), do not require `path.resolve()` as it would be redundant. Only apply `path.resolve()` guidance when the base path is relative (not when the base is already an absolute `import.meta.dir`).

Applied to files:

  • packages/core/src/hash.ts
  • packages/core/src/array.ts
  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • packages/core/src/index.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • packages/core/src/object.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • packages/core/src/Stopwatch.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • packages/core/src/math.ts
  • scripts/ci/check-package-boundaries.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • packages/core/src/tokens.ts
  • src/utils/format.ts
  • packages/core/src/date-locale.ts
  • packages/core/src/json.ts
  • src/utils/Stopwatch.ts
  • packages/core/src/string.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
  • packages/core/src/date.ts
  • packages/core/src/format.ts
📚 Learning: 2026-03-12T03:48:42.474Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 104
File: src/darwinkit/index.ts:146-156
Timestamp: 2026-03-12T03:48:42.474Z
Learning: In TypeScript files that use Commander subcommands and exit after showing help, replace code after Command.help() with the pattern: call sub.outputHelp(); (returns void) followed by process.exit(0) or process.exit(1). This avoids TS7027 unreachable-code because Command.help() returns never. Apply this pattern in all src/**/*.ts files where subcommands need to display help before exiting.

Applied to files:

  • packages/core/src/hash.ts
  • packages/core/src/array.ts
  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • packages/core/src/index.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • packages/core/src/object.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • packages/core/src/Stopwatch.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • packages/core/src/math.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • packages/core/src/tokens.ts
  • src/utils/format.ts
  • packages/core/src/date-locale.ts
  • packages/core/src/json.ts
  • src/utils/Stopwatch.ts
  • packages/core/src/string.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
  • packages/core/src/date.ts
  • packages/core/src/format.ts
📚 Learning: 2026-05-05T11:58:33.420Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 163
File: src/indexer/lib/sources/mail-source.dateSent.probe.test.ts:0-0
Timestamp: 2026-05-05T11:58:33.420Z
Learning: This repo uses Biome 2.x. The console lint rule is `noConsole` (located at `lint/suspicious/noConsole`), not `noConsoleLog`. In this codebase, `noConsole` is disabled in `biome.json`, so adding a `// biome-ignore lint/suspicious/noConsole:<...>` suppression comment is a no-op and should be avoided (CI flags it as having no effect). When reviewing, do not suggest adding Biome suppression comments for console usage; if a `console.*` call must remain, leave it without a `biome-ignore` comment.

Applied to files:

  • packages/core/src/hash.ts
  • packages/core/src/array.ts
  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • packages/core/src/index.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • packages/core/src/object.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • packages/core/src/Stopwatch.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • packages/core/src/math.ts
  • scripts/ci/check-package-boundaries.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • packages/core/src/tokens.ts
  • src/utils/format.ts
  • packages/core/src/date-locale.ts
  • packages/core/src/json.ts
  • src/utils/Stopwatch.ts
  • packages/core/src/string.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
  • packages/core/src/date.ts
  • packages/core/src/format.ts
📚 Learning: 2026-05-18T14:02:30.445Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 171
File: src/utils/ui/layouts/AuthLayout.tsx:34-34
Timestamp: 2026-05-18T14:02:30.445Z
Learning: When reviewing a PR, before leaving any comment on a specific file and hunk, verify that the file (and the relevant lines) actually exist in the PR’s current diff. For example, use `git diff --name-only <base>...<head>` (or the PR’s file list) to confirm the file is part of the diff, since pre-rebase/stale hunk references can lead to incorrect or outdated comments.

Applied to files:

  • packages/core/src/hash.ts
  • packages/core/src/array.ts
  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • packages/core/src/index.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • packages/core/src/object.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • packages/core/src/Stopwatch.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • packages/core/src/math.ts
  • scripts/ci/check-package-boundaries.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • packages/core/src/tokens.ts
  • src/utils/format.ts
  • packages/core/src/date-locale.ts
  • packages/core/src/json.ts
  • src/utils/Stopwatch.ts
  • packages/core/src/string.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
  • packages/core/src/date.ts
  • packages/core/src/format.ts
📚 Learning: 2026-02-24T15:32:37.494Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 54
File: src/github/lib/output.ts:109-113
Timestamp: 2026-02-24T15:32:37.494Z
Learning: In TypeScript files under src/, do not require a leading blank line before an if statement that is the first statement inside a function body (immediately after the function signature). The blank line rule should only apply to if statements that come after other statements within the function body. Apply this guideline consistently across TS files in src to reduce unnecessary vertical whitespace and keep concise function bodies.

Applied to files:

  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • src/utils/format.ts
  • src/utils/Stopwatch.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
📚 Learning: 2026-03-09T13:13:58.786Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 81
File: src/github/commands/get.ts:209-212
Timestamp: 2026-03-09T13:13:58.786Z
Learning: In the GenesisTools repo (genesiscz/GenesisTools), do not treat CI formatter warnings as enforceable formatting rules for TypeScript files under src/. Focus reviews on logical correctness and consistency with existing code patterns. For files under src (e.g., src/github/commands/get.ts), prioritize code structure, readability, naming, correctness, and adherence to project conventions over automated formatting warnings from CI tools.

Applied to files:

  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • src/utils/format.ts
  • src/utils/Stopwatch.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
📚 Learning: 2026-03-12T01:26:31.610Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 95
File: src/timely/utils/entry-processor.ts:0-0
Timestamp: 2026-03-12T01:26:31.610Z
Learning: In code paths where JSON is consumed, prefer strict RFC 8259 validation by using SafeJSON.parse(text, { strict: true }) instead of the lenient default. Apply this at non-config boundaries (e.g., API responses, JSONL, cache outputs, subprocess outputs). Reserve the lenient comment-json behavior only for user-authored config files that may legitimately contain comments or trailing commas. For src/timely/utils/entry-processor.ts and similar modules, replace or wrap JSON parsing with SafeJSON.parse(text, { strict: true }) unless you are explicitly handling config files that require comments.

Applied to files:

  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • src/utils/format.ts
  • src/utils/Stopwatch.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
📚 Learning: 2026-03-12T01:58:27.831Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 103
File: src/port/index.ts:137-144
Timestamp: 2026-03-12T01:58:27.831Z
Learning: In GenesisTools, apply a no-obvious-comments rule: do not add inline comments for well-known POSIX patterns or standard idioms (e.g., a process.kill(pid, 0) probe) when surrounding code is self-documenting through descriptive function/variable names. This guidance applies to TypeScript files under src (src/**/*.ts). Only include comments if they add non-obvious rationale, edge-case behavior, or explain complex logic that cannot be inferred from code alone.

Applied to files:

  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • src/utils/format.ts
  • src/utils/Stopwatch.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
📚 Learning: 2026-03-22T22:19:44.520Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 119
File: src/indexer/commands/graph.ts:34-34
Timestamp: 2026-03-22T22:19:44.520Z
Learning: In genesiscz/GenesisTools, when using `SafeJSON.parse` in `src/**/*.ts`, it is acceptable to omit `{ strict: true }` if (and only if) the JSON being parsed is internal cache/state written by the same codebase (e.g., data saved by one internal writer and later read from a corresponding cached file). Do not require strict mode for these internal, machine-generated cache files. Require `{ strict: true }` at external/untrusted boundaries instead (e.g., API responses, third-party JSONL, subprocess output, or any JSON whose contents may not have been produced by trusted internal code).

Applied to files:

  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • src/utils/format.ts
  • src/utils/Stopwatch.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
📚 Learning: 2026-03-25T19:55:27.917Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 129
File: src/utils/search/stores/vector-store.ts:19-23
Timestamp: 2026-03-25T19:55:27.917Z
Learning: When reviewing this codebase’s “3+ parameters → object parameter” guideline, only suggest object-parameter refactoring when the function’s parameters are ambiguous or include optional/unclear semantics. Do not flag tightly-defined utility/helper functions where (1) all parameters are required, (2) meanings are semantically clear from parameter names, and (3) the ordering is well-ordered and obvious. For example, functions like bruteForceVectorSearch(memoryIndex, queryVector, limit) should be allowed to keep positional parameters because the intent is clear.

Applied to files:

  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • src/utils/format.ts
  • src/utils/Stopwatch.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
📚 Learning: 2026-05-05T03:52:21.057Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 163
File: src/debugging-master/core/dashboard-server.ts:115-127
Timestamp: 2026-05-05T03:52:21.057Z
Learning: When reviewing Bun.serve fetch handlers in this repo, don’t treat `req.signal` as possibly `undefined` at runtime. Bun guarantees an `AbortSignal` on every incoming Request, so `req.signal?.addEventListener(...)` is unnecessary for runtime safety and is only a TypeScript narrowing artifact (e.g., the type might be `AbortSignal | null`). Therefore, don’t raise concerns about SSE/subscription cleanup being skipped because `req.signal` could be missing; cleanup decisions should be based on the actual handler lifecycle, not an imagined runtime absence of `req.signal`.

Applied to files:

  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • src/utils/format.ts
  • src/utils/Stopwatch.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
📚 Learning: 2026-03-25T21:01:55.569Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 129
File: src/utils/string.ts:104-111
Timestamp: 2026-03-25T21:01:55.569Z
Learning: For GenesisTools utilities under src/utils/**, Windows path support is required. When reviewing files in src/utils, treat POSIX-only path handling as a CRITICAL issue—e.g., code that searches for only "/" as the path separator or ignores "\\". Ensure path utility functions correctly handle both separators ("/" and "\\"), for example by using regex patterns like /[\\/]/ when parsing or splitting paths.

Applied to files:

  • src/utils/math.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • src/utils/object.ts
  • src/utils/tokens.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • src/utils/format.ts
  • src/utils/Stopwatch.ts
📚 Learning: 2026-03-26T00:12:19.016Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 129
File: src/utils/string.ts:100-103
Timestamp: 2026-03-26T00:12:19.016Z
Learning: In this repo’s utility files (src/utils/**/*.ts), prefer minimal JSDoc for functions like truncatePath(path, maxLength). Do not add “obvious” implementation details (e.g., explicitly listing handled path separators such as / and \\) when the function/parameter names are self-documenting. Only expand JSDoc when there is non-obvious rationale, important design constraints, or edge-case behavior that would otherwise be unclear to reviewers.

Applied to files:

  • src/utils/math.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • src/utils/object.ts
  • src/utils/tokens.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • src/utils/format.ts
  • src/utils/Stopwatch.ts
📚 Learning: 2026-05-18T15:39:25.103Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 173
File: src/question/commands/log.ts:0-0
Timestamp: 2026-05-18T15:39:25.103Z
Learning: In genesiscz/GenesisTools, when implementing colored terminal/CLI output in TypeScript code under src/, use `picocolors` imported as `pc` (e.g., `import pc from 'picocolors'`). Do not propose `chalk` for CLI coloring. For chained styling (e.g., what chalk would express as `bold` + `blue`), compose picocolors calls by nesting, such as `pc.bold(pc.blue(text))`. Treat any mention of chalk in outdated docs (e.g., CLAUDE.md) as non-authoritative for this guideline.

Applied to files:

  • src/utils/math.ts
  • src/usage/index.ts
  • src/benchmark/lib/display.ts
  • src/utils/array.ts
  • src/utils/date-locale.ts
  • src/utils/object.ts
  • src/files-to-prompt/index.ts
  • src/benchmark/lib/runner.ts
  • src/benchmark/commands/history.ts
  • src/utils/tokens.ts
  • src/json/index.ts
  • src/last-changes/index.ts
  • src/utils/json.ts
  • src/utils/date.ts
  • src/benchmark/lib/results.ts
  • src/utils/string.ts
  • src/utils/hash.ts
  • src/utils/format.ts
  • src/utils/Stopwatch.ts
  • src/benchmark/commands/show.ts
  • src/timer/index.ts
📚 Learning: 2026-05-19T18:33:15.211Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 176
File: src/telegram/index.ts:25-28
Timestamp: 2026-05-19T18:33:15.211Z
Learning: When reviewing legacy CLI entrypoint files (e.g., src/**/index.ts) that call `await runTool(program, { tool: "..." })`, allow the `.catch()` handler to keep `console.error(err); process.exit(1)` without requiring a switch to `logger.error` **only** for minimal-touch migrations that were done solely to satisfy the “no-default-import” gate and that add no new feature/behavior code. If the PR introduces any new feature logic or expands the catch-handling beyond that migration, prefer `logger.error` (and follow the repo’s normal logging conventions).

Applied to files:

  • src/usage/index.ts
  • src/files-to-prompt/index.ts
  • src/json/index.ts
  • src/last-changes/index.ts
  • src/timer/index.ts
📚 Learning: 2026-02-25T23:00:07.620Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 56
File: plugins/genesis-tools/commands/github-pr.md:131-131
Timestamp: 2026-02-25T23:00:07.620Z
Learning: Adopt the style: use lowercase 'markdown' (not 'Markdown') in the GenesisTools documentation. Apply this consistently across all Markdown files in the repository (any .md file), including generated docs and READMEs.

Applied to files:

  • MONOREPO-PLAN.md
  • MONOREPO-SPEC.md
📚 Learning: 2026-05-22T18:53:48.562Z
Learnt from: genesiscz
Repo: genesiscz/GenesisTools PR: 183
File: scripts/benchmarks/clones/microbenches/README.md:4-4
Timestamp: 2026-05-22T18:53:48.562Z
Learning: In GenesisTools markdown docs, do not treat `macos` (lowercase) inside backticks as a capitalization error. When `macos` is used as a literal CLI subcommand token (e.g., `tools macos clones ...`) corresponding to the `src/macos/` command implementation, keep it lowercase and ignore capitalization suggestions such as LanguageTool rule `MAC_OS` (it would document the wrong command). Only capitalize `MacOS`/`macOS` when it is clearly prose about the operating system, not when it’s a code-formatted command token.

Applied to files:

  • MONOREPO-PLAN.md
  • MONOREPO-SPEC.md
🪛 ast-grep (0.42.3)
packages/core/src/string.ts

[warning] 123-123: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(^${escaped}$, "i")
Note: [CWE-1333] Inefficient Regular Expression Complexity [REFERENCES]
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
- https://cwe.mitre.org/data/definitions/1333.html

(regexp-from-variable)

🪛 LanguageTool
MONOREPO-PLAN.md

[uncategorized] ~273-~273: Do not mix variants of the same word (‘co-locate’ and ‘colocate’) within a single text.
Context: ...logger or a @gt/core log contract, OR co-locate logger+prompts+cli-core into o...

(EN_WORD_COHERENCY)


[uncategorized] ~285-~285: The operating system from Apple is written “macOS”.
Context: ...ns (cycle-breaking work) - **@gt/ai + @gt/macos (break the ai↔macos cycle, SPEC §0.3/§...

(MAC_OS)


[uncategorized] ~285-~285: The operating system from Apple is written “macOS”.
Context: ... @gt/ai + @gt/macos (break the ai↔macos cycle, SPEC §0.3/§2.1): define `@gt...

(MAC_OS)


[uncategorized] ~287-~287: The operating system from Apple is written “macOS”.
Context: ...e the macOS-backed implementations into @gt/macos which depends on @gt/ai. @gt/ai ...

(MAC_OS)


[uncategorized] ~288-~288: The operating system from Apple is written “macOS”.
Context: ...on @gt/ai. @gt/ai must never import @gt/macos. Verify with the guard (flip ai↔maco...

(MAC_OS)


[uncategorized] ~290-~290: The official name of this software platform is spelled with a capital “H”.
Context: ... to fail). - @gt/github: move the @app/github/* helpers that `utils/github/url-parse...

(GITHUB)


[uncategorized] ~291-~291: The official name of this software platform is spelled with a capital “H”.
Context: ...ls/github/utilsreach into *down* into@gt/github` (they were mis-located); reverse the...

(GITHUB)


[uncategorized] ~303-~303: The official name of this popular video platform is spelled with a capital “T”.
Context: ...er. - **@gt/ui+ youtube fix:** moveui/components/youtube/*` (8 files) into the youtube tool (o...

(YOUTUBE)


[uncategorized] ~330-~330: The operating system from Apple is written “macOS”.
Context: ...test` collected-count; SPEC §3.6 | | ai↔macos / logger→cli cycles re-introduced durin...

(MAC_OS)

MONOREPO-SPEC.md

[style] ~16-~16: Consider removing “of” to be more concise
Context: ...cal findings that shape every decision All of the following were measured in this worktre...

(ALL_OF_THE)


[uncategorized] ~24-~24: The operating system from Apple is written “macOS”.
Context: ... (json, ui, cli, ai, prompts, macos, format, storage, claude, `githu...

(MAC_OS)


[uncategorized] ~25-~25: The official name of this software platform is spelled with a capital “H”.
Context: ...macos, format, storage, claude, github, database, search, audio, `cmu...

(GITHUB)


[uncategorized] ~49-~49: The operating system from Apple is written “macOS”.
Context: ... inside utils:** src/utils/ai imports src/utils/macos (5 files: LanguageDetector, `AIDar...

(MAC_OS)


[uncategorized] ~51-~51: The operating system from Apple is written “macOS”.
Context: ...oSpeechProvider, Translator) **and** src/utils/macos/tts.ts importssrc/utils/ai`. Naive...

(MAC_OS)


[uncategorized] ~52-~52: The operating system from Apple is written “macOS”.
Context: ...ils/ai. Naively splitting @gt/aiand@gt/macos` into separate packages would be **ci...

(MAC_OS)


[style] ~58-~58: Try using a descriptive adverb here.
Context: ...rs), decide how to break > each cycle on purpose, and then gate them in CI so they can...

(ON_PURPOSE_DELIBERATELY)


[uncategorized] ~232-~232: The operating system from Apple is written “macOS”.
Context: ...grations, Migrator, base accessor), src/utils/macos/MacDatabase base. Depends on `@gt/core...

(MAC_OS)


[uncategorized] ~245-~245: The operating system from Apple is written “macOS”.
Context: ... macOS-backed implementations move to @gt/macos, which depends on @gt/ai (one dire...

(MAC_OS)


[uncategorized] ~246-~246: The operating system from Apple is written “macOS”.
Context: ...ne direction). @gt/ai never imports @gt/macos. (Alternative considered: merge ai+m...

(MAC_OS)


[uncategorized] ~249-~249: The operating system from Apple is written “macOS”.
Context: ...wnership boundary.) - @gt/macossrc/utils/macos/* (darwinkit, MailDatabase, calendar, ...

(MAC_OS)


[uncategorized] ~252-~252: The official name of this software platform is spelled with a capital “H”.
Context: ...gt/ai/contracts). - **@gt/github** — src/utils/github/*` (octokit, url-parser). Depends on ...

(GITHUB)


[uncategorized] ~255-~255: The official name of this software platform is spelled with a capital “H”.
Context: ...se tool-side helpers move down into @gt/github (they were mis-located) so the edge po...

(GITHUB)


[uncategorized] ~273-~273: The official name of this popular video platform is spelled with a capital “T”.
Context: ...ds on @gt/core. Violation to fix: ui/components/youtube/* (8 files) → @app/youtube; these ar...

(YOUTUBE)


[uncategorized] ~274-~274: The official name of this popular video platform is spelled with a capital “T”.
Context: ... ui/components/youtube/* (8 files) → @app/youtube; these are youtube feature compone...

(YOUTUBE)


[uncategorized] ~274-~274: The official name of this popular video platform is spelled with a capital “T”.
Context: ... (8 files) → @app/youtube; these are youtube feature components mis-placed in sha...

(YOUTUBE)


[uncategorized] ~275-~275: The official name of this popular video platform is spelled with a capital “T”.
Context: ...laced in shared UI — they move into the youtube tool (or a @gt/youtube-ui feature p...

(YOUTUBE)


[uncategorized] ~311-~311: The operating system from Apple is written “macOS”.
Context: ...ndency direction (toward lower layers). @gt/macos → @gt/ai`` is the inverted edge that bre...

(MAC_OS)


[uncategorized] ~312-~312: The operating system from Apple is written “macOS”.
Context: ...is the inverted edge that breaks the ai↔macos cycle; @gt/logger → @gt/cli-core`` is t...

(MAC_OS)


[uncategorized] ~368-~368: Do not mix variants of the same word (‘colocate’ and ‘co-locate’) within a single text.
Context: ...s bun test is unchanged in mechanism. Colocated *.test.ts move with their source ...

(EN_WORD_COHERENCY)


[uncategorized] ~410-~410: The operating system from Apple is written “macOS”.
Context: ...mains with their cycle-breaks (ai/macos inversion, github/notifications ...

(MAC_OS)


[uncategorized] ~410-~410: The official name of this software platform is spelled with a capital “H”.
Context: ... cycle-breaks* (ai/macos inversion, github/notifications edge fixes) → L4 UI/...

(GITHUB)


[uncategorized] ~427-~427: The operating system from Apple is written “macOS”.
Context: ...ighest — must decide and break the ai↔macos cycle, the logger→cli coupling, and 48 ...

(MAC_OS)

🪛 markdownlint-cli2 (0.22.1)
MONOREPO-PLAN.md

[warning] 52-52: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 63-63: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 70-70: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 77-77: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 85-85: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 105-105: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 113-113: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 120-120: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 140-140: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 152-152: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 155-155: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 170-170: Blank line inside blockquote

(MD028, no-blanks-blockquote)


[warning] 190-190: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 193-193: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 230-230: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 232-232: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 256-256: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 260-260: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 279-279: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 284-284: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 298-298: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 309-309: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

MONOREPO-SPEC.md

[warning] 20-20: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 28-28: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 36-36: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 62-62: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 69-69: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 91-91: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 109-109: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 119-119: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 134-134: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 153-153: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 165-165: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 297-297: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 310-310: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 319-319: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 331-331: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 347-347: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 353-353: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 358-358: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 367-367: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

🔇 Additional comments (27)
packages/core/src/Stopwatch.ts (1)

1-61: LGTM!

packages/core/src/hash.ts (1)

1-7: LGTM!

packages/core/src/json.ts (1)

1-82: LGTM!

packages/core/src/array.ts (1)

1-15: LGTM!

packages/core/src/date.ts (1)

1-443: LGTM!

packages/core/src/string.ts (1)

1-199: LGTM!

src/utils/Stopwatch.ts (1)

1-1: LGTM!

src/utils/date-locale.ts (1)

1-1: LGTM!

src/utils/date.ts (1)

1-1: LGTM!

src/utils/format.ts (1)

1-1: LGTM!

src/utils/json.ts (1)

1-1: LGTM!

src/last-changes/index.ts (1)

6-7: LGTM!

src/timer/index.ts (1)

10-10: LGTM!

src/utils/array.ts (1)

1-1: LGTM!

src/utils/hash.ts (1)

1-1: LGTM!

src/utils/math.ts (1)

1-1: LGTM!

src/files-to-prompt/index.ts (1)

8-8: LGTM!

src/usage/index.ts (1)

6-6: LGTM!

scripts/ci/logging-guard.sh (1)

37-37: LGTM!

src/utils/object.ts (1)

1-1: LGTM!

src/utils/string.ts (1)

1-1: LGTM!

src/utils/tokens.ts (1)

1-1: LGTM!

src/benchmark/commands/history.ts (1)

3-3: LGTM!

src/benchmark/commands/show.ts (1)

2-2: LGTM!

src/benchmark/lib/display.ts (1)

3-3: LGTM!

src/benchmark/lib/results.ts (1)

4-4: LGTM!

src/benchmark/lib/runner.ts (1)

4-4: LGTM!

Comment thread MONOREPO-PLAN.md
ever in doubt.

```bash
cd /Users/Martin/Tresors/Projects/GenesisTools-monorepo-3

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Replace machine-specific absolute path with repo-relative setup steps.

Line 19 hardcodes a local path (/Users/Martin/...), which makes the plan non-portable for other contributors. Use repo-relative instructions (e.g., “from repo root”) instead.

🤖 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 `@MONOREPO-PLAN.md` at line 19, Replace the machine-specific hardcoded command
"cd /Users/Martin/Tresors/Projects/GenesisTools-monorepo-3" in MONOREPO-PLAN.md
with a repo-relative instruction telling contributors to run the following steps
from the repository root (e.g., “From the repo root, run …”) or to change
directory using a generic method (e.g., determine the repo root with git) so the
plan is portable; locate the exact hardcoded string in the file and update the
line to a generic, non-machine-specific instruction.

Comment thread MONOREPO-SPEC.md
Comment on lines +297 to +310
```
tools (src/<tool>/) — thin entrypoints
│ (depend on @gt/* only; never on another tool)
┌──────────────┬──────────┴───────────┬───────────────┬──────────────┐
L4 @gt/ui @gt/tui @gt/cmux/@gt/tmux (feature UIs)
│ │ │
L3 @gt/ai ◀──── @gt/macos @gt/github @gt/claude ─ @gt/agents @gt/markdown @gt/audio @gt/notifications
│ │ │ │ │
L2 @gt/database @gt/net @gt/search
│ │ │
L1 @gt/logger ──▶ @gt/cli-core ◀── @gt/prompts @gt/storage @gt/fs @gt/process
L0 ─────────────── @gt/core ───────────────────────────────────────────────
```

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a language identifier to the dependency graph code fence.

The fence starting at Line 297 is unlabeled. Add a language tag (e.g., text) to satisfy markdownlint and improve tooling consistency.

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 297-297: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 310-310: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

🤖 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 `@MONOREPO-SPEC.md` around lines 297 - 310, The unlabeled code fence containing
the ASCII dependency graph (the block that starts with the tree showing L0
through L4 and modules like `@gt/core`, `@gt/cli-core`, `@gt/logger`, `@gt/ai`, `@gt/ui`,
etc.) needs a language identifier to satisfy markdownlint; update the opening
fence from ``` to a labeled fence such as ```text (or ```txt) so the graph block
is recognized as plain text.

}
}

const envLocale = process.env.LC_TIME || process.env.LANG || process.env.LC_ALL;

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix locale env precedence to honor LC_ALL override.

Line 49 currently prefers LANG before LC_ALL, which can resolve an incorrect locale when both are set.

Suggested patch
-    const envLocale = process.env.LC_TIME || process.env.LANG || process.env.LC_ALL;
+    const envLocale = process.env.LC_ALL || process.env.LC_TIME || process.env.LANG;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const envLocale = process.env.LC_TIME || process.env.LANG || process.env.LC_ALL;
const envLocale = process.env.LC_ALL || process.env.LC_TIME || process.env.LANG;
🤖 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/core/src/date-locale.ts` at line 49, The locale precedence is wrong:
the envLocale const currently prefers LANG before LC_ALL; update the lookup so
LC_ALL takes highest precedence (e.g., check process.env.LC_ALL first, then
process.env.LC_TIME, then process.env.LANG) to ensure LC_ALL overrides other
locale variables — change the envLocale assignment in this file (the const
envLocale) accordingly.


/**
* Create a simple stopwatch function that returns formatted elapsed time.
* For a full-featured stopwatch with laps/stamps, use Stopwatch class from @app/utils/Stopwatch.

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix stale import path in docs.

The JSDoc points users to @app/utils/Stopwatch, but this module now lives in @gt/core. Keeping this stale path will drive incorrect imports.

Suggested fix
- * For a full-featured stopwatch with laps/stamps, use Stopwatch class from `@app/utils/Stopwatch`.
+ * For a full-featured stopwatch with laps/stamps, use Stopwatch from `@gt/core/Stopwatch`.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* For a full-featured stopwatch with laps/stamps, use Stopwatch class from @app/utils/Stopwatch.
* For a full-featured stopwatch with laps/stamps, use Stopwatch from `@gt/core/Stopwatch`.
🤖 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/core/src/format.ts` at line 405, The JSDoc in
packages/core/src/format.ts that references the Stopwatch module with the stale
path "`@app/utils/Stopwatch`" needs to be updated to the new module path
"`@gt/core`"; locate the comment mentioning "Stopwatch" (the line reading "For a
full-featured stopwatch with laps/stamps, use Stopwatch class from
`@app/utils/Stopwatch`.") and change the import path text to "`@gt/core`" so
documentation points to the correct module (leave the rest of the JSDoc and the
"Stopwatch" identifier unchanged).

Comment on lines +1 to +10
export * from "./array";
export * from "./date";
export * from "./format";
export * from "./hash";
export * from "./json";
export * from "./math";
export * from "./object";
export * from "./Stopwatch";
export * from "./string";
export * from "./tokens";

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Barrel is missing date-locale re-export.

date-locale is part of the extracted core utility set, but it is not exposed from the root barrel. This leaves the package surface incomplete and can break root-level imports.

Suggested fix
 export * from "./array";
 export * from "./date";
+export * from "./date-locale";
 export * from "./format";
 export * from "./hash";
 export * from "./json";
🤖 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/core/src/index.ts` around lines 1 - 10, The root barrel
(packages/core/src/index.ts) is missing a re-export for the date-locale module;
update the barrel to expose the date-locale module by adding a re-export entry
for "./date-locale" so consumers can import date-locale from the package root
(ensure the new export line matches the style used for the other modules like
"./date" and "./string").

Comment on lines +37 to +42
export function limitToTokens(text: string, maxTokens?: number): { text: string; tokens: number; truncated: boolean } {
const tokens = countTokens(text);

if (maxTokens == null || tokens <= maxTokens) {
return { text, tokens, truncated: false };
}

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Validate maxTokens before truncation.

Negative or non-integer maxTokens currently produces invalid outputs (e.g., negative tokens metadata and unintended slicing).

Suggested patch
 export function limitToTokens(text: string, maxTokens?: number): { text: string; tokens: number; truncated: boolean } {
     const tokens = countTokens(text);
 
-    if (maxTokens == null || tokens <= maxTokens) {
+    if (maxTokens == null) {
         return { text, tokens, truncated: false };
     }
 
+    if (!Number.isInteger(maxTokens) || maxTokens < 0) {
+        throw new Error(`maxTokens must be a non-negative integer, got: ${maxTokens}`);
+    }
+
+    if (tokens <= maxTokens) {
+        return { text, tokens, truncated: false };
+    }
+
+    if (maxTokens === 0) {
+        return { text: "", tokens: 0, truncated: text.length > 0 };
+    }
+
     try {
         const { encode, decode } = require("gpt-3-encoder");
         const encoded = encode(text);

Also applies to: 47-51, 55-60

🤖 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/core/src/tokens.ts` around lines 37 - 42, Validate and normalize
maxTokens before performing truncation in limitToTokens: coerce maxTokens to an
integer via Math.floor, treat non-positive values as a request to return an
empty truncated result (return { text: '', tokens: 0, truncated: true } when
maxTokens <= 0), and then use the normalized integer to compute slicing so
tokens/counts cannot become negative; apply the same validation/normalization to
the other truncation blocks in this file (the blocks around the original
function and the sections noted at 47-51 and 55-60) so all truncation code
consistently floors the value and handles zero/negative inputs safely.

};

/** Tool dirs/files under src/ that are NOT shared packages (for tool->tool detection). */
const TOOL_IMPORT_RE = /@app\/([a-zA-Z0-9._-]+)(?:\/|")/;

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Boundary detection misses bare @app/<tool> imports.

The regex requires / or " after the tool segment, so specifiers like @app/logger are not matched and can bypass Rule 3/4/5 checks.

Suggested fix
-const TOOL_IMPORT_RE = /@app\/([a-zA-Z0-9._-]+)(?:\/|")/;
+const TOOL_IMPORT_RE = /^`@app`\/([a-zA-Z0-9._-]+)(?:\/|$)/;

Also applies to: 111-114

🤖 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 `@scripts/ci/check-package-boundaries.ts` at line 51, The TOOL_IMPORT_RE
currently requires a trailing "/" or quote which misses bare imports like
"`@app/logger`"; update the regex used for tool import detection (TOOL_IMPORT_RE)
to allow the end-of-string (or a closing quote) after the captured tool name
instead of requiring a slash, and apply the same fix to the other occurrences
referenced around lines 111-114 so bare specifiers like "`@app/`<tool>" are
matched and subject to Rule 3/4/5 checks.

Comment on lines +70 to +71
const pattern = "from\\s+[\"']([^\"']+)[\"']";
const raw = await $`rg -n --no-heading -g ${excludeNodeModules} -g ${globTs} -g ${globTsx} ${pattern} ${scope}`

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Import scanner ignores side-effect imports, allowing boundary bypass.

Rules are enforced only for from "..." imports. import "@app/x" and import "@gt/x" are not collected, so violations can slip through CI.

Suggested fix
-    const pattern = "from\\s+[\"']([^\"']+)[\"']";
+    const pattern = "(?:from\\s+[\"']([^\"']+)[\"']|^\\s*import\\s+[\"']([^\"']+)[\"'])";
...
-        const specMatch = rest.match(/from\s+["']([^"']+)["']/);
+        const specMatch =
+            rest.match(/from\s+["']([^"']+)["']/) ??
+            rest.match(/^\s*import\s+["']([^"']+)["']/);

Also applies to: 87-88

🤖 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 `@scripts/ci/check-package-boundaries.ts` around lines 70 - 71, The import
scanner only matches "from '...'" forms, missing side-effect imports like import
"pkg"; update the regex in the pattern variable to also capture bare imports
(for example use a combined regex such as
(?:from\s+["']([^"']+)["']|import\s+["']([^"']+)["'])) and adjust the code that
consumes the match (the place that reads the capture groups from raw) to take
the non-null capture (group1 || group2); apply the same change to the other
occurrence referenced (the similar pattern around lines 87-88) so both scanners
collect side-effect imports.

Comment thread src/json/index.ts
import { runTool } from "@app/utils/cli";
import { SafeJSON } from "@app/utils/json";
import { handleReadmeFlag } from "@app/utils/readme";
import { SafeJSON } from "@gt/core/json";

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use the repo-mandated SafeJSON import path in src/**.

SafeJSON in src/json/index.ts should come from @app/utils/json, not @gt/core/json, to keep the enforced source-of-truth contract in src/**.

Suggested fix
-import { SafeJSON } from "`@gt/core/json`";
+import { SafeJSON } from "`@app/utils/json`";
As per coding guidelines: “`src/**/*.ts`: Always import and use `SafeJSON` from `@app/utils/json` instead of the global `JSON` object; use `SafeJSON.parse()` and `SafeJSON.stringify()` everywhere”.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { SafeJSON } from "@gt/core/json";
import { SafeJSON } from "`@app/utils/json`";
🤖 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 `@src/json/index.ts` at line 6, The import in src/json/index.ts pulls SafeJSON
from the wrong module; replace the import of SafeJSON from "`@gt/core/json`" with
the repo-mandated path "`@app/utils/json`" so that SafeJSON used in this file (and
any exports/functions here) come from the canonical source; update the import
statement that references SafeJSON accordingly and ensure subsequent uses still
call SafeJSON.parse()/SafeJSON.stringify().

Comment thread src/usage/index.ts
import { formatDateTime } from "@app/utils/date";
import { SafeJSON } from "@app/utils/json";
import { formatDateTime } from "@gt/core/date";
import { SafeJSON } from "@gt/core/json";

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Switch SafeJSON back to the mandated @app/utils/json source in src/**.

This import path breaks the repository rule for src/**/*.ts and should use @app/utils/json.

Suggested fix
-import { SafeJSON } from "`@gt/core/json`";
+import { SafeJSON } from "`@app/utils/json`";
As per coding guidelines: “`src/**/*.ts`: Always import and use `SafeJSON` from `@app/utils/json` instead of the global `JSON` object; use `SafeJSON.parse()` and `SafeJSON.stringify()` everywhere”.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { SafeJSON } from "@gt/core/json";
import { SafeJSON } from "`@app/utils/json`";
🤖 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 `@src/usage/index.ts` at line 7, Replace the incorrect import of SafeJSON from
"`@gt/core/json`" with the mandated module "`@app/utils/json`" in the file that
imports SafeJSON; update the import statement to reference "`@app/utils/json`" and
ensure all usages within the file continue to call SafeJSON.parse() and
SafeJSON.stringify() as required by the src/** guideline.

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