Skip to content

chore: Phase 0 INV resolutions + MS-001/002/004 quick-wins#2020

Open
qvidal01 wants to merge 2 commits into
AndyMik90:developfrom
qvidal01:chore/audit-pipeline-phase0-and-quick-wins
Open

chore: Phase 0 INV resolutions + MS-001/002/004 quick-wins#2020
qvidal01 wants to merge 2 commits into
AndyMik90:developfrom
qvidal01:chore/audit-pipeline-phase0-and-quick-wins

Conversation

@qvidal01
Copy link
Copy Markdown

@qvidal01 qvidal01 commented May 12, 2026

Summary

Two commits from the audit→ideate→roadmap pipeline run on cba7a027. Documentation of Phase-0 investigation outcomes plus the unblocked Phase-1 quick-win cleanup batch.

  • docs: — Records four Phase-0 investigation decisions (INV-004 through INV-007) in CLAUDE.md, RELEASE.md, apps/desktop/CONTRIBUTING.md, and the misleading comment in electron.vite.config.ts. Surfaces a real finding: SERPER_API_KEY is embedded at build time but never supplied by any CI workflow — Serper search ships effectively disabled in CI release builds today (corrected in the comment + documented in RELEASE.md).
  • chore: — Ships three Phase-1 milestones in one batch: MS-001 (vitest alias align + .bk removal + empty pnpm-lock.yaml removal), MS-002 (17 caret-to-tilde pins on native + AI-SDK + Sentry-Electron + electron-updater deps), and the deletion portion of MS-004 (card_data.txt, run.py/, libs/* workspace declaration).

Validation

Check Result
npm run lint 0 errors, 831 pre-existing warnings (unchanged)
npm run typecheck 0 errors
npm test 4602 passing; 1 pre-existing failure in src/renderer/components/github-issues/utils/__tests__/github-error-parser.test.ts (verified against the pre-change state — same failure exists, unrelated to this PR)

Pipeline traceability

Each change traces back to an audit-pipeline artifact (all in .claude/pipeline/, gitignored):

Artifact Touches
audit-2026-05-12.md RISK-007, RISK-008, RISK-009, RISK-010, RISK-011, RISK-012, RISK-015 + UNK-001/002/003/004/005/007/008
ideas-2026-05-12.md IDEA-004, IDEA-008, IDEA-010, IDEA-013, IDEA-014, IDEA-015, IDEA-016 (+ IDEA-002 and IDEA-005 closed by policy in Phase 0)
roadmap-2026-05-12.md INV-004/005/006/007 (Phase 0 resolved), MS-001/002/004 (cleanups portion shipped here)

What's not in this PR

  • INV-001, INV-002, INV-003 decisions are captured in commit messages (the deletion commits reference each ID). The full resolution log lives in .claude/pipeline/inv-resolutions-2026-05-12.md locally.
  • The rest of MS-004 — adding a filename pattern like (card|payment|ssn|tax_id)_data\.* to apps/desktop/src/main/ai/security/secret-scanner.ts plus a pre-commit hook (the secret-scanner hardening half of IDEA-008) — deferred to a follow-up.
  • MS-005 — the electron.vite.config.ts build-time-key guardrail (ALLOW_LOCAL_KEY_EMBED switch + non-CI refusal) is documented in RELEASE.md but not yet implemented.
  • A new dead-instruction issue found during INV-002: apps/desktop/prompts/{planner,followup_planner}.md and source comments still instruct generated agents to run python auto-claude/run.py --spec ... — that path doesn't exist post-Python→TS migration. Will become an IDEA on the next /audit cycle.

Test plan

  • CI lint passes
  • CI typecheck passes
  • CI unit tests pass (expect the same 1 pre-existing github-error-parser failure on develop)
  • Spot-check the renamed vitest aliases by running any test that imports via @/, @shared/, @preload/, @features/, @components/, @hooks/, or @lib/ (or trust the typecheck + lint passes)
  • Confirm apps/desktop/.gitignore still suppresses .bk/.bak/.orig/~ files on subsequent commits

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Updated .gitignore to ignore common backup and swap file patterns.
    • Adjusted dependency version constraints for improved stability.
    • Streamlined workspace configuration structure.
  • Documentation

    • Enhanced release documentation with API key embedding details and build process information.
    • Added test coverage strategy guidelines.
  • Refactor

    • Removed changelog functionality module from the desktop application.

qvidal01 and others added 2 commits May 12, 2026 11:49
Records four audit-pipeline Phase-0 investigation decisions in the
operator-facing docs. Full rationale and supporting evidence for each
INV is captured in .claude/pipeline/inv-resolutions-2026-05-12.md
(gitignored), generated from .claude/pipeline/roadmap-2026-05-12.md.

INV-004 / UNK-004 — Coverage thresholds in vitest.config.ts are
regression floors (set by d958fa6), not targets. Documented as such
in apps/desktop/CONTRIBUTING.md; ratchet plan tracked by IDEA-011 /
MS-008.

INV-005 / UNK-005 — services/profile/profile-service.ts imports
@anthropic-ai/sdk solely for typed-exception API-key validation when
users add a profile. Decision: document the exception in CLAUDE.md
rather than refactor; new code outside this file still forbidden from
using @anthropic-ai/sdk.

INV-006 / UNK-007 — SERPER_API_KEY is embedded at build time by
electron.vite.config.ts but is not supplied by any CI workflow, so
the Serper search provider ships effectively disabled in CI release
builds. Corrected the misleading "search works out of the box"
comment; documented all four build-time embedded constants and their
CI-secret sources in RELEASE.md. Guardrail tracked by IDEA-007 /
MS-005.

INV-007 / UNK-008 — main/platform/ and shared/platform.{ts,cjs} are
complementary (main-process path/executable utilities vs. typed
cross-process platform detection), not duplicates. CLAUDE.md's
"Platform abstraction" rule amended to acknowledge both layers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bundles three audit-pipeline Phase-1 milestones into one clean
commit. Each change is independently safe; together they close the
unblocked low-risk items so the larger Phase-1 work (MS-003 logger,
MS-005 build-key guardrail) has a tidier baseline.

MS-001 — Tidy the repo surface (alias + cruft cleanup)
  IDEA-004 / RISK-015 — apps/desktop/vitest.config.ts aliases now
  mirror apps/desktop/tsconfig.json exactly (@ → src/renderer, plus
  the @preload/@features/@components/@hooks/@lib aliases that
  tsconfig defines). 0 tests used the old broader @/ mapping, so no
  test refactors needed.

  IDEA-014 / RISK-010 — Removed the 264-line
  apps/desktop/src/main/ipc-handlers/changelog-handlers.ts.bk backup
  file. Added *.bk, *.bak, *.orig, *~ patterns to .gitignore so the
  pattern doesn't reappear.

  IDEA-016 / RISK-007 — Removed the 114-byte empty pnpm-lock.yaml
  stub at the repo root. The project actively maintains
  package-lock.json; the empty pnpm stub was swinging package-manager
  auto-detection in tools like Renovate.

MS-002 — Tighten pinning on native + security-critical dependencies
  IDEA-010 / RISK-008 — Converted 17 caret ranges to tilde ranges in
  apps/desktop/package.json: the Vercel AI SDK group (ai +
  @ai-sdk/{amazon-bedrock,anthropic,azure,google,groq,mcp,mistral,
  openai,openai-compatible,xai}), the @anthropic-ai/sdk holdout
  (kept per INV-005), and the native + Electron-runtime deps
  (@libsql/client, @lydell/node-pty, @sentry/electron, electron-log,
  electron-updater). electron itself was already exact-pinned at
  40.0.0. package-lock.json regenerated via
  `npm install --package-lock-only`; no version drift.

MS-004 deletions only (cleanup portion)
  IDEA-008 / RISK-009 + INV-001 — Deleted card_data.txt (zero
  references in the codebase; filename invited future accidental
  paste of real card data). Filename-pattern addition to
  secret-scanner.ts + pre-commit hook deferred to the rest of MS-004.

  IDEA-013 / RISK-011 + INV-002 — Deleted /run.py/agent.py and its
  parent directory (orphan from the Python→TS migration; 0-byte
  file, no references). Separate dead-instruction problem in
  apps/desktop/prompts/{planner,followup_planner}.md and source
  comments — referencing auto-claude/run.py — is filed for the next
  /audit cycle (not in scope here).

  IDEA-015 / RISK-012 + INV-003 — Removed "libs/*" from the root
  package.json workspaces array (no libs/ directory exists and no
  planned split was documented). package-lock.json reflects the
  change.

Validation:
  - apps/desktop $ npm run lint     → 0 errors (831 pre-existing
    warnings unchanged)
  - apps/desktop $ npm run typecheck → 0 errors
  - apps/desktop $ npm test         → 4602 passing, 1 pre-existing
    failure in src/renderer/components/github-issues/utils/__tests__/
    github-error-parser.test.ts (verified against pre-change state;
    same failure exists; unrelated to this PR)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

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 updates project documentation, refines dependency versioning, and adjusts test configurations. Key changes include adding documentation for build-time embedded keys and coverage strategies, pinning several AI-related dependencies to tilde versions in apps/desktop/package.json, and updating Vitest path aliases to match the renderer's configuration. Feedback suggests extending the tilde pinning to other AI stack dependencies for consistency and re-adding a @main alias in the Vitest configuration to avoid brittle relative imports in main-process tests.

Comment thread apps/desktop/package.json
Comment on lines 69 to 70
"@modelcontextprotocol/sdk": "^1.27.1",
"@openrouter/ai-sdk-provider": "^2.3.1",
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

For consistency with the other AI-related and volatile dependencies pinned in this PR (MS-002), consider also pinning @modelcontextprotocol/sdk and @openrouter/ai-sdk-provider to tilde (~) versions. This helps prevent unexpected breaking changes in the AI stack during minor version updates, which is the stated goal of this batch of changes.

Suggested change
"@modelcontextprotocol/sdk": "^1.27.1",
"@openrouter/ai-sdk-provider": "^2.3.1",
"@modelcontextprotocol/sdk": "~1.27.1",
"@openrouter/ai-sdk-provider": "~2.3.1",

Comment on lines +35 to +41
'@': resolve(__dirname, 'src/renderer'),
'@shared': resolve(__dirname, 'src/shared'),
'@preload': resolve(__dirname, 'src/preload'),
'@features': resolve(__dirname, 'src/renderer/features'),
'@components': resolve(__dirname, 'src/renderer/shared/components'),
'@hooks': resolve(__dirname, 'src/renderer/shared/hooks'),
'@lib': resolve(__dirname, 'src/renderer/shared/lib')
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

The removal of the @main alias (previously pointing to src/main) and the redirection of @ to src/renderer significantly changes the import resolution strategy for tests. While this aligns with the renderer's tsconfig.json, it leaves the main process without a convenient alias, forcing the use of relative paths in main-process tests. To maintain a consistent developer experience and avoid brittle relative imports, consider adding a @main alias that points to src/main in both tsconfig.json and this Vitest configuration.

      '@': resolve(__dirname, 'src/renderer'),
      '@main': resolve(__dirname, 'src/main'),
      '@shared': resolve(__dirname, 'src/shared'),
      '@preload': resolve(__dirname, 'src/preload'),
      '@features': resolve(__dirname, 'src/renderer/features'),
      '@components': resolve(__dirname, 'src/renderer/shared/components'),
      '@hooks': resolve(__dirname, 'src/renderer/shared/hooks'),
      '@lib': resolve(__dirname, 'src/renderer/shared/lib')

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

📝 Walkthrough

Walkthrough

This PR consolidates documentation clarifications about build-time API key embedding, updates desktop app test and dependency configurations, and includes general repository cleanup by removing workspace patterns and orphaned files.

Changes

API Key Embedding & SDK Documentation

Layer / File(s) Summary
SDK usage exceptions and platform abstraction guidance
CLAUDE.md
Documented exception allowing profile-service.ts to import @anthropic-ai/sdk for typed errors; expanded platform-abstraction rule to name three specific modules (main/platform/, shared/platform.ts, shared/platform.cjs) and their runtime vs. build-script purposes.
Build-time key injection and CI defaults
RELEASE.md, apps/desktop/electron.vite.config.ts
New section detailing which Vite define constants map to environment variables and which CI workflows provide them; clarified that SERPER_API_KEY is not supplied in CI (embedding empty string in shipped builds); documented ALLOW_LOCAL_KEY_EMBED=1 guardrail for non-CI local builds; updated electron.vite.config comment to match.

Desktop Application Configuration

Layer / File(s) Summary
Test import path resolution
apps/desktop/vitest.config.ts
Aligned Vitest resolve.alias configuration with production tsconfig.json paths, replacing generic aliases (@main, @renderer) with renderer-specific keys (@features, @components, @hooks, @lib, @preload).
Test coverage thresholds and strategy
apps/desktop/CONTRIBUTING.md
Introduced "Coverage Strategy" section documenting Vitest coverage thresholds as regression floors and referencing roadmap entries for future per-module threshold hardening.
Dependency version pinning
apps/desktop/package.json
Changed version specifiers from caret (^) to tilde (~) across @ai-sdk/*, @anthropic-ai/sdk, @dnd-kit/*, @libsql/client, @lydell/node-pty, @sentry/electron, ai, electron-log, and electron-updater to enforce tighter version constraints.

Repository Cleanup & Workspace Reorganization

Layer / File(s) Summary
Backup file patterns and workspace consolidation
.gitignore, package.json, card_data.txt, apps/desktop/src/main/ipc-handlers/changelog-handlers.ts.bk
Added ignore patterns for backup artifacts (*.bk, *.bak, *.orig, *~); removed libs/* from root workspace configuration; deleted orphaned changelog-handlers backup file and empty card_data.txt.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • AndyMik90/Aperant#1963: Modifies apps/desktop/package.json with overlapping AI SDK and dependency version specification changes.

Suggested labels

area/frontend, docs, chore

Poem

🐰 With backups backed up and configs aligned,
The desktop dances with paths refined—
Keys embedded bright at build-time's call,
Tilde versions taming dependencies tall,
Our garden grows cleaner, tests sing clear! 🌱

🚥 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 title concisely describes the main changes: Phase 0 investigation resolutions and quick-win implementations (MS-001/002/004), which directly align with the documented objectives of the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 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 @.gitignore:
- Around line 35-38: Remove the duplicate ignore pattern '*.bak' from the
repository's .gitignore by keeping it only in the logical "IDE & Editors"
section and removing the second occurrence in the "Misc" section; locate the two
entries by searching for the literal pattern '*.bak' and delete the redundant
one so the pattern appears just once.

In `@apps/desktop/CONTRIBUTING.md`:
- Around line 110-112: Update the "### Coverage Strategy (INV-004 / UNK-004)"
header to make the internal codes explicit to readers: either append " (internal
tracking)" after the codes or remove the codes from the visible header and move
them into an inline doc comment directly below the header mentioning they are
internal references; also add a short parenthetical note after the
`.claude/pipeline/roadmap-2026-05-12.md` reference stating that this roadmap is
an internal, gitignored file and may be inaccessible to external contributors so
they should file issues/PRs against the public docs instead.

In `@apps/desktop/vitest.config.ts`:
- Around line 32-33: Remove the internal audit tracking codes "(IDEA-004 /
RISK-015)" from the inline comment that begins "Mirrors
apps/desktop/tsconfig.json paths..." in vitest.config.ts; either delete the
parenthetical codes or move them to an external audit log/commit message per
policy so the committed source contains only the descriptive comment about test
import resolution.
- Around line 32-42: The alias map in vitest.config.ts declares four aliases
that point to non-existent directories (keys '@features', '@components',
'@hooks', '@lib') which will break imports during tests; fix by either (A)
creating the missing directories under src/renderer/shared or
src/renderer/features to match those alias targets so the paths resolve at
runtime, or (B) remove those four alias entries from the alias object in
vitest.config.ts and mirror the same removals in tsconfig.json paths so both
test resolver and TypeScript config stay consistent; locate the alias object in
vitest.config.ts and update the keys '@features', '@components', '@hooks', and
'@lib' (and mirror changes in tsconfig.json) accordingly.

In `@RELEASE.md`:
- Line 203: The RELEASE.md line points to a gitignored roadmap
`.claude/pipeline/roadmap-2026-05-12.md`; replace that reference with a durable,
committed tracker (e.g., a committed docs file or a GitHub issue/PR link) so
maintainers can find the guardrail tracking; update the phrase that currently
says "tracked by `IDEA-007` / `MS-005` in
`.claude/pipeline/roadmap-2026-05-12.md`" to instead reference the chosen
durable identifier (for example "tracked in ISSUE-123" or "tracked in
docs/roadmap.md#IDEA-007 / MS-005") and ensure the rest of the sentence about
wiring `SERPER_API_KEY` remains unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 01874fb8-2192-4e7a-9bc2-723b6dee6133

📥 Commits

Reviewing files that changed from the base of the PR and between cba7a02 and a508447.

⛔ Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json, !**/package-lock.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • .gitignore
  • CLAUDE.md
  • RELEASE.md
  • apps/desktop/CONTRIBUTING.md
  • apps/desktop/electron.vite.config.ts
  • apps/desktop/package.json
  • apps/desktop/src/main/ipc-handlers/changelog-handlers.ts.bk
  • apps/desktop/vitest.config.ts
  • card_data.txt
  • package.json
  • run.py/agent.py
💤 Files with no reviewable changes (2)
  • card_data.txt
  • apps/desktop/src/main/ipc-handlers/changelog-handlers.ts.bk

Comment thread .gitignore
Comment on lines +35 to +38
*.bk
*.bak
*.orig
*~
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

Duplicate pattern: *.bak appears twice in the file.

The pattern *.bak is already present on line 128 in the "Misc" section. Having duplicate ignore patterns creates unnecessary maintenance burden and can confuse future contributors.

🧹 Proposed fix to remove the duplicate

Remove the duplicate *.bak from line 128 since it's already covered here in the IDE & Editors section where backup patterns logically belong:

 # ===========================
 # Misc
 # ===========================
 *.local
-*.bak
 *.tmp
 *.temp
🤖 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 @.gitignore around lines 35 - 38, Remove the duplicate ignore pattern '*.bak'
from the repository's .gitignore by keeping it only in the logical "IDE &
Editors" section and removing the second occurrence in the "Misc" section;
locate the two entries by searching for the literal pattern '*.bak' and delete
the redundant one so the pattern appears just once.

Comment on lines +110 to +112
### Coverage Strategy (INV-004 / UNK-004)

The Vitest coverage thresholds in `vitest.config.ts` (`lines: 22, branches: 17, functions: 19, statements: 22`) are **regression floors**, not targets. They were set by commit `d958fa65` (*"harden CI/CD with coverage enforcement"*) as the post-Python-elimination baseline. PRs must not drop coverage below these floors. Raising the floors and adding per-module thresholds for high-risk paths (`ai/security`, `ai/tools`, `ai/agent`, `ipc-handlers`) is tracked by `IDEA-011` / `MS-008` in `.claude/pipeline/roadmap-2026-05-12.md`.
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.

🧹 Nitpick | 🔵 Trivial | 💤 Low value

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify that commit d958fa65 exists in the repository

git cat-file -t d958fa65 2>/dev/null || echo "Commit not found"
git log --oneline -1 d958fa65 2>/dev/null

Repository: AndyMik90/Aperant

Length of output: 165


Consider clarifying internal tracking codes in the section header.

The section header includes internal audit codes (INV-004 / UNK-004) in public-facing contributor documentation. While harmless, external contributors won't understand these references. Consider adding a brief note like "(internal tracking)" or relocating them to a doc comment if they're only for team reference.

The reference to .claude/pipeline/roadmap-2026-05-12.md is also inaccessible to external contributors since this directory is gitignored. This is acceptable for now but worth noting when the roadmap is updated.

🤖 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 `@apps/desktop/CONTRIBUTING.md` around lines 110 - 112, Update the "###
Coverage Strategy (INV-004 / UNK-004)" header to make the internal codes
explicit to readers: either append " (internal tracking)" after the codes or
remove the codes from the visible header and move them into an inline doc
comment directly below the header mentioning they are internal references; also
add a short parenthetical note after the
`.claude/pipeline/roadmap-2026-05-12.md` reference stating that this roadmap is
an internal, gitignored file and may be inaccessible to external contributors so
they should file issues/PRs against the public docs instead.

Comment on lines +32 to +33
// Mirrors apps/desktop/tsconfig.json paths exactly so tests resolve
// imports the same way production builds do (audit: IDEA-004 / RISK-015).
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.

🧹 Nitpick | 🔵 Trivial | 💤 Low value

Internal audit codes in code comments.

Similar to the CONTRIBUTING.md file, this comment includes internal audit tracking codes (IDEA-004 / RISK-015) that reference gitignored pipeline artifacts. While useful for team traceability, consider whether these belong in the committed codebase or if they should be documented elsewhere (e.g., commit message, separate audit log).

🤖 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 `@apps/desktop/vitest.config.ts` around lines 32 - 33, Remove the internal
audit tracking codes "(IDEA-004 / RISK-015)" from the inline comment that begins
"Mirrors apps/desktop/tsconfig.json paths..." in vitest.config.ts; either delete
the parenthetical codes or move them to an external audit log/commit message per
policy so the committed source contains only the descriptive comment about test
import resolution.

Comment on lines +32 to 42
// Mirrors apps/desktop/tsconfig.json paths exactly so tests resolve
// imports the same way production builds do (audit: IDEA-004 / RISK-015).
alias: {
'@': resolve(__dirname, 'src'),
'@main': resolve(__dirname, 'src/main'),
'@renderer': resolve(__dirname, 'src/renderer'),
'@shared': resolve(__dirname, 'src/shared')
'@': resolve(__dirname, 'src/renderer'),
'@shared': resolve(__dirname, 'src/shared'),
'@preload': resolve(__dirname, 'src/preload'),
'@features': resolve(__dirname, 'src/renderer/features'),
'@components': resolve(__dirname, 'src/renderer/shared/components'),
'@hooks': resolve(__dirname, 'src/renderer/shared/hooks'),
'@lib': resolve(__dirname, 'src/renderer/shared/lib')
}
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 | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify alias target directories exist
echo "=== Checking alias paths exist ==="
for dir in "src/renderer" "src/shared" "src/preload" "src/renderer/features" "src/renderer/shared/components" "src/renderer/shared/hooks" "src/renderer/shared/lib"; do
  if [ -d "apps/desktop/$dir" ]; then
    echo "$dir exists"
  else
    echo "$dir NOT FOUND"
  fi
done

echo -e "\n=== Comparing with tsconfig.json paths ==="
cat apps/desktop/tsconfig.json | jq '.compilerOptions.paths' 2>/dev/null || echo "Could not parse tsconfig.json paths"

echo -e "\n=== Checking for removed `@main/`@renderer imports in tests ==="
rg -n --type ts --glob '**/*.test.ts' --glob '**/*.spec.ts' -e 'from ["\x27]@main' -e 'from ["\x27]@renderer' apps/desktop/src/ || echo "No references to removed aliases found"

Repository: AndyMik90/Aperant

Length of output: 805


Fix alias configuration: four alias paths point to non-existent directories.

The aliases do mirror apps/desktop/tsconfig.json exactly, but verification reveals a critical issue: four of the seven alias paths don't exist in the codebase:

  • @featuressrc/renderer/features (missing)
  • @componentssrc/renderer/shared/components (missing)
  • @hookssrc/renderer/shared/hooks (missing)
  • @libsrc/renderer/shared/lib (missing)

The existing directories (src/renderer, src/shared, src/preload) are present and correctly configured. No test files currently reference the removed @main or @renderer aliases. However, tests attempting to use the missing alias paths will fail at import time. Either create these directories or remove the aliases from both vitest.config.ts and tsconfig.json to match actual structure.

🤖 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 `@apps/desktop/vitest.config.ts` around lines 32 - 42, The alias map in
vitest.config.ts declares four aliases that point to non-existent directories
(keys '@features', '@components', '@hooks', '@lib') which will break imports
during tests; fix by either (A) creating the missing directories under
src/renderer/shared or src/renderer/features to match those alias targets so the
paths resolve at runtime, or (B) remove those four alias entries from the alias
object in vitest.config.ts and mirror the same removals in tsconfig.json paths
so both test resolver and TypeScript config stay consistent; locate the alias
object in vitest.config.ts and update the keys '@features', '@components',
'@hooks', and '@lib' (and mirror changes in tsconfig.json) accordingly.

Comment thread RELEASE.md

**Current state of Serper search in shipped builds.** Because no CI workflow supplies `SERPER_API_KEY`, the `WebSearch` tool's Serper provider effectively ships **disabled** in CI release builds: the build embeds an empty string and `serper-search.ts` returns the "missing key" error path. Local builds with a populated `apps/desktop/.env` will bundle the developer's key.

A guardrail that refuses to embed any `__*_API_KEY__` constant in non-CI builds (unless `ALLOW_LOCAL_KEY_EMBED=1` is explicitly set) is tracked by `IDEA-007` / `MS-005` in `.claude/pipeline/roadmap-2026-05-12.md`. Wiring `SERPER_API_KEY` into the release-workflow secrets is **not** currently planned; if you want Serper search to work in shipped builds, add `SERPER_API_KEY: ${{ secrets.SERPER_API_KEY }}` to the build steps in `release.yml`, `beta-release.yml`, and `build-prebuilds.yml`.
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 gitignored roadmap reference with a durable tracker link.

Pointing release docs to .claude/pipeline/roadmap-2026-05-12.md is not portable for most maintainers/readers. Please reference a committed doc or GitHub issue 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 `@RELEASE.md` at line 203, The RELEASE.md line points to a gitignored roadmap
`.claude/pipeline/roadmap-2026-05-12.md`; replace that reference with a durable,
committed tracker (e.g., a committed docs file or a GitHub issue/PR link) so
maintainers can find the guardrail tracking; update the phrase that currently
says "tracked by `IDEA-007` / `MS-005` in
`.claude/pipeline/roadmap-2026-05-12.md`" to instead reference the chosen
durable identifier (for example "tracked in ISSUE-123" or "tracked in
docs/roadmap.md#IDEA-007 / MS-005") and ensure the rest of the sentence about
wiring `SERPER_API_KEY` remains unchanged.

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