Skip to content

Commit cdd4d0c

Browse files
committed
fix(agent): close canonical guidance routing gaps
1 parent 231cfb7 commit cdd4d0c

6 files changed

Lines changed: 24 additions & 7 deletions

File tree

β€Ž.cursor/rules/001-core-security.mdcβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Protect secrets, logging, CSP, and privacy boundaries on executable and security-sensitive paths
3-
globs: app/**/*.ts,app/**/*.tsx,components/**/*.ts,components/**/*.tsx,config/**/*,features/**/*.ts,features/**/*.tsx,hooks/useLanguageToolCheck.ts,hooks/useWorldScriptAI.ts,hooks/useFactoryReset.ts,hooks/useIdbUnlockStartupGuard.ts,hooks/useSettingsView.ts,App.tsx,index.tsx,register-sw.ts,index.html,package.json,packages/**/*.ts,packages/**/*.tsx,public/sw.js,scripts/**/*.mjs,scripts/**/*.ts,services/**/*.ts,services/**/*.tsx,vercel.json,vite.config.ts,workers/**/*,wrangler.toml,.github/**/*,src-tauri/**/*,crates/**/*
3+
globs: app/**/*.ts,app/**/*.tsx,components/**/*.ts,components/**/*.tsx,config/**/*,features/**/*.ts,features/**/*.tsx,hooks/useLanguageToolCheck.ts,hooks/useWorldScriptAI.ts,hooks/useFactoryReset.ts,hooks/useIdbUnlockStartupGuard.ts,hooks/useSettingsView.ts,App.tsx,index.tsx,register-sw.ts,index.html,nginx.conf,package.json,packages/**/*.ts,packages/**/*.tsx,public/_headers,public/sw.js,scripts/**/*.mjs,scripts/**/*.ts,services/**/*.ts,services/**/*.tsx,vercel.json,vite.config.ts,workers/**/*,wrangler.toml,.github/**/*,src-tauri/**/*,crates/**/*
44
alwaysApply: false
55
---
66

@@ -16,6 +16,7 @@ alwaysApply: false
1616
## Tauri / CSP / Integrationen
1717

1818
- Neue externe Endpunkte (KI, LanguageTool, Signaling): `src-tauri` **CSP** `connect-src` prΓΌfen/erweitern β€” nicht nur Web-`fetch`.
19+
- CSP-Surfaces werden durch `scripts/sync-csp.mjs` synchronisiert; Γ„nderungen mΓΌssen alle von diesem Script definierten Deployment-FlΓ€chen konsistent halten.
1920
- LanguageTool und Γ€hnliche Dienste: nur **nutzerkonfigurierte URL** + Privacy-Gating (`integrations.languageTool*`).
2021
- Community-Templates: Zod + `pnpm run content:guard` β€” keine eingebetteten Secrets oder `eval`-Γ€hnliche Payloads.
2122

β€Ž.cursor/rules/100-ai-providers-and-storage.mdcβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Apply hybrid AI, persistence, and privacy patterns on AI and storage boundaries
3-
globs: app/listenerMiddleware.ts,app/persistenceCoordinator.ts,app/persistedStateFlush.ts,components/ApiKeySection.tsx,components/BinderPanel.tsx,components/CharacterView.tsx,components/ManuscriptResearchSplit.tsx,components/WelcomePortal.tsx,components/WorldView.tsx,components/dashboard/BackupQuickActionsCard.tsx,components/settings/AiProviderCard.tsx,components/settings/GeneralSections.tsx,components/settings/OpenRouterSection.tsx,features/lora/loraThunks.ts,features/project/projectSchemaVersion.ts,features/project/projectSchemaVersionShadow.ts,features/project/thunks/**/*.ts,features/settings/settingsSlice.ts,hooks/useCharacterInterviewsView.ts,hooks/useCharacterView.ts,hooks/useFactoryReset.ts,hooks/useIdbUnlockStartupGuard.ts,hooks/useSettingsView.ts,hooks/useWorldView.ts,hooks/useWorldScriptAI.ts,App.tsx,index.tsx,services/ai/**/*.ts,services/aiProviderService.ts,services/appBootstrap.ts,services/cloudSync/cloudSyncBackend.ts,services/codexService.ts,services/crossProjectIndexService.ts,services/crossProjectSearchService.ts,services/dbMigration.ts,services/dbService.ts,services/diagnostics/logSinks.ts,services/factoryResetService.ts,services/fs/**/*.ts,services/geminiService.ts,services/keyboard/shortcutActions.ts,services/libraryBackupService.ts,services/localAiFacade.ts,services/localFirst/docPersistence.ts,services/localRag*.ts,services/lora/**/*.ts,services/loraAdapterService.ts,services/pluginRegistry.ts,services/projectDocument.ts,services/projectImportSchema.ts,services/proForge/adapters/nodeProForgeCapability.ts,services/proForge/proForgeHistoryStore.ts,services/proForge/proForgeMemoryBank.ts,services/proForge/proForgeOrchestrator.ts,services/rag*.ts,services/sceneRevisionService.ts,services/settingsExchange.ts,services/startupRecovery.tsx,services/startupRecoveryPolicy.ts,services/storage/**/*.ts,services/storageBackend.ts,services/storageService.ts,services/duckdb/**/*.ts,services/logger.ts,packages/ai-core/**/*.ts
3+
globs: app/listenerMiddleware.ts,app/persistenceCoordinator.ts,app/persistedStateFlush.ts,components/ApiKeySection.tsx,components/BinderPanel.tsx,components/CharacterView.tsx,components/ManuscriptResearchSplit.tsx,components/WelcomePortal.tsx,components/WorldView.tsx,components/dashboard/BackupQuickActionsCard.tsx,components/settings/AiProviderCard.tsx,components/settings/GeneralSections.tsx,components/settings/OpenRouterSection.tsx,features/lora/loraThunks.ts,features/project/projectSchemaVersion.ts,features/project/projectSchemaVersionShadow.ts,features/project/thunks/**/*.ts,features/settings/settingsSlice.ts,hooks/useCharacterInterviewsView.ts,hooks/useCharacterView.ts,hooks/useFactoryReset.ts,hooks/useIdbUnlockStartupGuard.ts,hooks/useSettingsView.ts,hooks/useWorldView.ts,hooks/useWorldScriptAI.ts,App.tsx,index.tsx,services/ai/**/*.ts,services/aiProviderService.ts,services/appBootstrap.ts,services/cloudSync/cloudSyncBackend.ts,services/codexService.ts,services/crossProjectIndexService.ts,services/crossProjectSearchService.ts,services/dbInitialization.ts,services/dbMigration.ts,services/dbService.ts,services/diagnostics/logSinks.ts,services/factoryResetService.ts,services/fs/**/*.ts,services/geminiService.ts,services/keyboard/shortcutActions.ts,services/libraryBackupService.ts,services/localAiFacade.ts,services/localFirst/docPersistence.ts,services/localRag*.ts,services/lora/**/*.ts,services/loraAdapterService.ts,services/pluginRegistry.ts,services/projectDocument.ts,services/projectImportSchema.ts,services/proForge/adapters/nodeProForgeCapability.ts,services/proForge/proForgeHistoryStore.ts,services/proForge/proForgeMemoryBank.ts,services/proForge/proForgeOrchestrator.ts,services/rag*.ts,services/sceneRevisionService.ts,services/settingsExchange.ts,services/startupRecovery.tsx,services/startupRecoveryPolicy.ts,services/storage/**/*.ts,services/storageBackend.ts,services/storageService.ts,services/duckdb/**/*.ts,services/logger.ts,services/collaborationService.ts,packages/ai-core/**/*.ts,packages/collab-transport/**/*
44
alwaysApply: false
55
---
66

@@ -29,7 +29,7 @@ alwaysApply: false
2929
- Zugriff ΓΌber `dbService.ts`, `storageService.ts`, **`storageBackend.ts`** (`saveEnvelopeFromProjectData` β€” kein roher Cast im Listener).
3030
- Record-Keys/Migrationen nicht willkΓΌrlich umbenennen; Scene-Revisions β†’ `sceneRevisionService.ts` (eigener Store).
3131
- `checkStorageHealth()` in `services/dbInitialization.ts` β€” liefert `StorageHealth`; wird beim App-Start ausgefΓΌhrt (Low-Storage-Toast).
32-
- Kollaboration: nur **eine** CRDT-Schicht (`collaborationService.ts` + Yjs). RTCDataChannel-VerschlΓΌsselung lΓ€uft ΓΌber den y-webrtc-Patch (`patches/y-webrtc@10.3.0.patch`) β€” nicht erneut implementieren.
32+
- Kollaboration: nur **eine** CRDT-Schicht (`collaborationService.ts` + Yjs). RTCDataChannel-VerschlΓΌsselung lebt in `packages/collab-transport`; Γ„nderungen folgen `VENDOR-FORKS.md` und `pnpm run verify:vendor` β€” keine parallele Schicht implementieren.
3333

3434
## Privacy
3535

β€Ž.cursor/rules/200-architecture-limits.mdcβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Keep files small and reuse logic via services,hooks,and feature slices
3-
globs: App.tsx,app/**/*.ts,components/**/*.tsx,contexts/**/*.ts,contexts/**/*.tsx,features/**/*.ts,hooks/**/*.ts,services/**/*.ts,packages/**/*.ts,packages/**/*.tsx
3+
globs: App.tsx,app/**/*.ts,components/**/*.tsx,contexts/**/*.ts,contexts/**/*.tsx,features/**/*.ts,hooks/**/*.ts,services/**/*.ts,packages/**/*.ts,packages/**/*.tsx,vite.config.ts
44
alwaysApply: false
55
---
66

@@ -17,6 +17,7 @@ alwaysApply: false
1717
- **Redux** fΓΌr persistierten App-State; **Zustand** nur transient (`app/transientUiStore.ts`).
1818
- **Undo:** `redux-undo` am Projekt-Slice; Plot-Board-**Viewport** lokal β€” Verbindungen/Subplots im `projectSlice` wenn undo-relevant.
1919
- Schwere Views: `React.lazy` in `App.tsx`; Plot-Board-Subchunks, ForceGraph, Collaboration lazy; `listenerMiddleware` + `aiApi` dynamic import fΓΌr DuckDB/RAG/Provider.
20+
- Neue schwere optionale Chunks mΓΌssen in `vite.config.ts` gemeinsam in `manualChunks` und PWA-`globIgnores` gepflegt werden; siehe ADR 0002, damit sie nicht service-worker-vorinstalliert werden.
2021
- ProForge orchestration stays behind `hooks/useProForgeOrchestrator.ts`; do not instantiate it in components.
2122
- Voice uses the existing engine abstractions and `VoiceCommandService`; honor its feature/settings gates.
2223

β€ŽAGENTS.mdβ€Ž

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ needs their detail. Dynamic facts belong in `package.json`, `.nvmrc`, scripts, o
4545
- User-visible copy uses the i18n system. Add keys to canonical `locales/*` sources and run
4646
the repository i18n generator/check; do not hardcode UI strings or stale locale counts.
4747
- Do not use Tailwind `dark:` classes. Themes are body-class and semantic CSS-token driven.
48-
- `components/ui/**` must remain platform-neutral: do not import `@tauri-apps/api` there;
49-
use the existing service/platform abstractions.
48+
- First-party TS/TSX must not import `@tauri-apps/*` directly. Route desktop capabilities through
49+
`desktopPlatform` / `@domain/desktop-contracts`; the approved boundary and exceptions are
50+
defined by `scripts/check-tauri-import-boundary.mjs`. `components/ui/**` remains platform-neutral.
5051
- New feature flags need the repository’s relevant E2E coverage, but heavy E2E execution is
5152
CI-only on this machine. Do not invent scattered `if (true)` feature gates.
5253
- For non-trivial TypeScript/TSX/CSS changes, add one short physical-line `QNBS-v3:` rationale
@@ -67,6 +68,9 @@ For persistence, AI, filesystem, or encryption work, inspect the relevant source
6768
path-scoped Cursor/nested Claude rule first. Deep references include `docs/CI.md`,
6869
`docs/BEST-PRACTICES.md`, `docs/IDB-ENCRYPTION.md`, and the native ledger.
6970

71+
Vendor-fork edits under `packages/collab-transport` follow `VENDOR-FORKS.md` and
72+
`pnpm run verify:vendor`; do not recreate the removed upstream patch or a parallel fork.
73+
7074
## PR, review, signing, and merge work
7175

7276
When a task enters commit/push/PR/CI/review/merge work, read and follow

β€ŽCLAUDE.mdβ€Ž

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,14 @@ verified specialist mappings:
1212
- `hooks/useVoice.ts` β†’ `services/voice/CLAUDE.md`
1313
- `hooks/useGlobalCopilot.ts` β†’ `services/copilot/CLAUDE.md`
1414
- `features/project/thunks/plotBoardAiThunks.ts` β†’ `features/plotBoard/CLAUDE.md`
15+
- Plot Board external callers: `services/plotBoardService.ts`, `hooks/usePlotBoardAi.ts`,
16+
`components/scene-board/PlotMinimap.tsx` β†’ `features/plotBoard/CLAUDE.md`
17+
- Voice external callers: `hooks/usePushToTalk.ts`, `hooks/useVoiceDictation.ts`,
18+
`hooks/useVoiceAccessibility.ts` β†’ `services/voice/CLAUDE.md`
19+
- Copilot external callers: `features/copilot/copilotSlice.ts`, `components/copilot/**/*`,
20+
`App.tsx` β†’ `services/copilot/CLAUDE.md`
21+
- ProForge external callers: `features/proForge/proForgeSlice.ts`, `features/proForge/types.ts`,
22+
`hooks/useProForgeOrchestrator.ts`, `app/storeRef.ts` β†’ `services/proForge/CLAUDE.md`
23+
- Service integration callers: `features/sceneComments/sceneCommentsSlice.ts`,
24+
`features/progressTracker/progressTrackerSlice.ts`, `hooks/useLanguageToolCheck.ts`,
25+
`config/csp-connect-src.json` β†’ `services/CLAUDE.md`

β€Ždocs/CI.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ coverage ratchet remains informational.
5656
1. Push the commit β†’ CI starts automatically.
5757
2. `gh run watch $(gh run list --limit 1 --json databaseId -q '.[0].databaseId')` β€” stream the live run.
5858
3. When `quality` job completes, read the coverage summary from the CI logs or Codecov badge.
59-
4. Update `README.md` badges (`Tests-NNN_%2F_NNN_files`) and the `AUDIT.md` quality-gate line if the test count changed significantly; do not put dynamic metrics in agent adapters.
59+
4. Whenever the test-case or test-file count changes, run `node scripts/sync-readme-metrics.mjs` to update README metrics and update the `AUDIT.md` quality-gate line separately when its documented count changes; do not put dynamic metrics in agent adapters.
6060
5. Commit the doc update: `chore(docs): update metrics from CI vX.Y.Z`.
6161

6262
---

0 commit comments

Comments
Β (0)