# Project Map: insuwiki
> Generated: 2026-04-18 11:44:22
> Path: /home/jay/projects/insuwiki

## Directory Tree (depth: 2)
```
insuwiki/
├── chrome_profile_notebooklm/
│   ├── BrowserMetrics/
│   ├── Crashpad/
│   ├── Default/
│   ├── segmentation_platform/
│   ├── ShaderCache/
│   ├── CrashpadMetrics-active.pma
│   ├── CrashpadMetrics.pma
│   ├── Last Version
│   ├── Local State
│   └── Variations
├── data/
│   ├── batches_20260416_1657/
│   ├── batches_20260416_1947/
│   ├── batches_20260416_2126/
│   ├── chroma_db/
│   ├── dictionaries/
│   ├── insights/
│   ├── graph.json
│   ├── insights_index.json
│   ├── insights_v2_20260413_1734.json
│   ├── insights_v2_20260413_1735.json
│   ├── insights_v2_20260413_1738.json
│   ├── insights_v2_20260413_1804.json
│   ├── insights_v2_20260416_1657.json
│   ├── wiki.db
│   └── wiki.db.bak.pre-march
├── docs/
│   ├── decisions/
│   ├── guides/
│   ├── meetings/
│   ├── plans/
│   ├── reports/
│   ├── reviews/
│   ├── rules/
│   ├── specs/
│   ├── tasks/
│   ├── user-guide/
│   └── walkthroughs/
├── functions/
│   ├── lib/
│   ├── src/
│   ├── deploy-with-creds.ps1
│   ├── package-lock.json
│   ├── package.json
│   ├── run_pipeline.js
│   ├── testLoad.js
│   └── tsconfig.json
├── memory/
│   └── reports/
├── nextapp/
│   ├── public/
│   ├── scripts/
│   ├── src/
│   ├── .gitignore
│   ├── eslint.config.mjs
│   ├── firebase.json
│   ├── firestore-debug.log
│   ├── next-env.d.ts
│   ├── next.config.ts
│   ├── package-lock.json
│   ├── package.json
│   ├── postcss.config.mjs
│   ├── README.md
│   ├── tsconfig.json
│   ├── tsconfig.tsbuildinfo
│   └── vitest.config.ts
├── plans/
│   ├── plan-task-136.1.md
│   ├── plan-task-137.1.md
│   ├── plan-task-141.1.md
│   ├── plan-task-143.1.md
│   ├── plan-task-145.1.md
│   └── plan-task-146.1.md
├── scripts/
│   ├── __tests__/
│   ├── kakao_knowledge/
│   ├── lib/
│   ├── prompts/
│   ├── samples/
│   ├── youtube-pipeline/
│   ├── aggregate-backlinks.ts
│   ├── backfill-authority-tier.ts
│   ├── backfill-custom-claims.ts
│   ├── backfill-links-schema.ts
│   ├── backfill-user-names.ts
│   ├── checkFirestoreState.ts
│   ├── delete-old-youtube-docs.js
│   ├── deploy.sh
│   ├── enable-embedding-config.ts
│   ├── evaluate-embedding-matching.ts
│   ├── evaluate-static-matching.ts
│   ├── evaluation-results-phase1b.json
│   ├── evaluation-results.json
│   ├── fix-author-names.ts
│   ├── fix-broken-underline-tags.ts
│   ├── fix-unknown-reviewers.ts
│   ├── manual-classification-needed.json
│   ├── migrate-links-to-outgoing.ts
│   ├── migrate-review-fields.ts
│   ├── poc-table-parser.ts
│   ├── rollback_wiki_sync.py
│   ├── seed-ai-linking-config.ts
│   ├── seed-and-evaluate-embeddings.ts
│   ├── seed-insurance-metadata.ts
│   ├── seed-normalize-map.ts
│   ├── seed-youtube-channels.ts
│   ├── seedInsuranceTerms.ts
│   ├── strip-underline-tags.ts
│   ├── summary-pipeline.ts
│   ├── task00001-260207-08.00.py
│   ├── task00002-260207-08.30.py
│   ├── task00003-260207-09.00.py
│   ├── task00004-260207-10.00.py
│   ├── triggerStaticMatching.ts
│   ├── tsconfig.json
│   ├── verify-underline-tags.ts
│   ├── youtube-get-pending.ts
│   └── youtube-upload-summary.ts
├── tests/
│   ├── golden/
│   ├── youtube/
│   └── test_e2e_blog_generate.py
├── .firebaserc
├── .gitignore
├── eslint.config.mjs
├── firebase.json
├── firestore-debug.log
├── firestore.indexes.json
├── firestore.rules
├── next.config.ts
├── notebooklm-config.json
├── package-lock.json
├── package.json
├── postcss.config.mjs
├── README.md
├── START.md
├── tsconfig.json
├── tsconfig.tsbuildinfo
└── 프롬프트(노트북LM-안티그래피티 연결).txt
```

## Types & Interfaces
- `functions/src/backlogMonitoring.ts`: `SLALevel`, `BacklogStats`, `SLAAssessment`
- `functions/src/embeddingMatching.ts`: `EmbeddingMatchResult`, `MergedResult`
- `functions/src/pdfIndexing.ts`: `AppendixType`
- `functions/src/regulationChangeDetector.ts`: `RegulationChangeResult`
- `functions/src/reviewerAssignment.ts`: `ReviewerCandidate`
- `functions/src/staticMatching.ts`: `LinkMethod`, `LinkCreatedBy`, `LinkStatus`, `InsuranceTerm`, `AiSuggestion`, `MatchResult`
- `functions/src/types/reliability.ts`: `ReliabilityDimension`, `FreshnessInterval`, `ReliabilityWeightsConfig`, `ReliabilityInput`, `ReliabilityOutput`
- `functions/src/types/report.ts`: `ReportReasonType`, `ErrorReport`
- `functions/src/types/review.ts`: `ReviewDocumentStatus`, `RiskLevel`, `ReviewDecision`, `Review`, `AuditAction`, `AuditLogEntry`
- `functions/src/types/version.ts`: `VersionRetentionConfig`, `VersionInfo`
- `nextapp/src/app/api/ai/search-summary/utils.ts`: `SearchResult`
- `nextapp/src/hooks/useAIPolling.ts`: `AIJobStatus`
- `nextapp/src/hooks/useAudioRecorder.ts`: `RecordingState`
- `nextapp/src/hooks/useDocumentReviewListener.ts`: `DocumentReviewState`
- `nextapp/src/hooks/useDraftAutoSave.ts`: `UseDraftAutoSaveOptions`, `UseDraftAutoSaveReturn`
- `nextapp/src/hooks/useReviewPermission.ts`: `ReviewPermissions`
- `nextapp/src/hooks/useReviewQueueListener.ts`: `ReviewQueueItem`, `UseReviewQueueListenerReturn`
- `nextapp/src/hooks/useVoiceCommand.ts`: `VoiceCommandHandlers`, `VoiceCommandOptions`, `VoiceCommandReturn`
- `nextapp/src/hooks/useWikiFilter.ts`: `WikiCategory`, `WikiSortBy`, `WikiDocument`, `WikiFilterState`, `WikiFilterActions`
- `nextapp/src/hooks/useWikiMap.ts`: `WikiEntry`
- `nextapp/src/lib/ai/answerValidator.ts`: `SimilarityGateResult`, `AnswerSourceType`, `ValidationResult`
- `nextapp/src/lib/ai/queryRouter.ts`: `QueryType`, `QueryContext`
- `nextapp/src/lib/auth-middleware.ts`: `AuthResult`
- `nextapp/src/lib/constants.ts`: `BadgeInfo`, `TrustLevel`, `TrustBadgeInfo`, `VerificationVisualState`, `BannerSeverity`
- `nextapp/src/lib/monitoring/costMonitor.ts`: `ApiUsageDaily`, `UsageType`, `DailyUsageBudget`
- `nextapp/src/lib/security/injectionFilter.ts`: `InjectionCheckResult`
- `nextapp/src/lib/security/rateLimiter.ts`: `RateLimitResult`
- `nextapp/src/lib/tiptap/WikiAutoLink.ts`: `WikiAutoLinkOptions`
- `nextapp/src/shared/types/roles.ts`: `UserRole`
- `nextapp/src/types/firestore.ts`: `User`, `AISettings`, `ApiKeyService`, `ApiKey`, `Visibility`, `DocumentStatus`, `Priority`, `DocumentCategory`, `SourceType`, `VerificationStatus`, `SourceMeta`, `SourceRef`, `DocumentProperties`, `Document`, `DocumentVersion`, `DocumentTag`, `LinkMethod`, `LinkCreatedBy`, `LinkStatus`, `Link`, `AiSuggestion`, `DailyNote`, `Draft`, `AutoSaveDraft`, `WhitelistEntry`, `JobStatus`, `QueryType`, `Job`, `GeminiFileCache`, `GenerationType`, `InsuranceMetadata`, `InsuranceChunk`, `InsuranceChunkArchive`, `InsuranceAppendix`, `IndexLog`, `ApiUsageDaily`, `InsuranceTerm`, `SummaryLevel`, `InsuranceSummary`, `SummaryJobStatus`, `SummaryJob`, `QueryCache`, `RateLimitWindow`, `RateLimitRecord`, `FeedbackRating`, `FeedbackErrorType`, `AiFeedback`, `FeedbackType`, `AnswerFeedback`, `QueryLog`, `ConversationSession`, `YoutubeChannel`, `SummaryStatus`, `YoutubeKnowledge`, `ReviewDecision`, `RiskLevel`, `AuditAction`, `EvidenceType`, `ErrorReportReason`, `SourceAttachment`, `Review`, `ErrorReport`, `AuditLogEntry`
- `nextapp/src/utils/documentLock.ts`: `LockInfo`, `AcquireLockResult`
- `scripts/prompts/summary-prompts.ts`: `SummaryJobItem`

## API Routes
- `POST /api/admin/drive-upload` → `nextapp/src/app/api/admin/drive-upload/route.ts`
- `POST, DELETE /api/admin/fcm-token` → `nextapp/src/app/api/admin/fcm-token/route.ts`
- `POST /api/admin/insurance/reindex` → `nextapp/src/app/api/admin/insurance/reindex/route.ts`
- `POST /api/admin/insurance/reindex/switch` → `nextapp/src/app/api/admin/insurance/reindex/switch/route.ts`
- `GET /api/admin/insurance/terms` → `nextapp/src/app/api/admin/insurance/terms/route.ts`
- `GET /api/admin/insurance/terms/[productId]` → `nextapp/src/app/api/admin/insurance/terms/[productId]/route.ts`
- `GET /api/admin/insurance/terms/[productId]/chunks` → `nextapp/src/app/api/admin/insurance/terms/[productId]/chunks/route.ts`
- `GET /api/admin/insurance/terms/[productId]/history` → `nextapp/src/app/api/admin/insurance/terms/[productId]/history/route.ts`
- `POST /api/admin/insurance/terms/[productId]/search` → `nextapp/src/app/api/admin/insurance/terms/[productId]/search/route.ts`
- `GET /api/admin/insurance/terms/[productId]/summaries` → `nextapp/src/app/api/admin/insurance/terms/[productId]/summaries/route.ts`
- `GET /api/admin/monitoring` → `nextapp/src/app/api/admin/monitoring/route.ts`
- `DELETE /api/admin/purge` → `nextapp/src/app/api/admin/purge/route.ts`
- `GET, POST /api/admin/summary-generate` → `nextapp/src/app/api/admin/summary-generate/route.ts`
- `GET, PATCH /api/admin/summary-jobs` → `nextapp/src/app/api/admin/summary-jobs/route.ts`
- `GET /api/ai/autocomplete` → `nextapp/src/app/api/ai/autocomplete/route.ts`
- `POST, PATCH /api/ai/feedback` → `nextapp/src/app/api/ai/feedback/route.ts`
- `POST /api/ai/index-wiki` → `nextapp/src/app/api/ai/index-wiki/route.ts`
- `POST /api/ai/invalidate-cache` → `nextapp/src/app/api/ai/invalidate-cache/route.ts`
- `POST /api/ai/query` → `nextapp/src/app/api/ai/query/route.ts`
- `POST /api/ai/search-summary` → `nextapp/src/app/api/ai/search-summary/route.ts`
- `POST /api/ai/search-wiki` → `nextapp/src/app/api/ai/search-wiki/route.ts`
- `GET, POST /api/ai/settings` → `nextapp/src/app/api/ai/settings/route.ts`
- `GET /api/ai/status` → `nextapp/src/app/api/ai/status/route.ts`
- `POST /api/ai/summarize` → `nextapp/src/app/api/ai/summarize/route.ts`
- `POST /api/ai/vector-search` → `nextapp/src/app/api/ai/vector-search/route.ts`
- `GET /api/ai/versions` → `nextapp/src/app/api/ai/versions/route.ts`
- `GET /api/drive-image/[fileId]` → `nextapp/src/app/api/drive-image/[fileId]/route.ts`
- `GET /api/share-target` → `nextapp/src/app/api/share-target/route.ts`
- `POST, DELETE /api/upload` → `nextapp/src/app/api/upload/route.ts`
- `POST /api/wiki/entries/[id]/error-report` → `nextapp/src/app/api/wiki/entries/[id]/error-report/route.ts`
- `POST /api/wiki/entries/[id]/report` → `nextapp/src/app/api/wiki/entries/[id]/report/route.ts`
- `POST /api/wiki/entries/[id]/review` → `nextapp/src/app/api/wiki/entries/[id]/review/route.ts`
- `POST /api/wiki/insights/[id]/review` → `nextapp/src/app/api/wiki/insights/[id]/review/route.ts`

## Components
- `ActionTooltip` → `nextapp/src/components/ActionTooltip.tsx`
- `AIEmptyState` → `nextapp/src/components/search/AIEmptyState.tsx`
- `AIResults` → `nextapp/src/components/search/AIResults.tsx`
- `AISettingsModal` → `nextapp/src/components/AISettingsModal.tsx`
- `AISidepanel` → `nextapp/src/components/AISidepanel.tsx`
- `AIWhispers` → `nextapp/src/components/AIWhispers.tsx`
- `AnswerCard` → `nextapp/src/components/search/AnswerCard.tsx`
- `AudioRecorderButton` → `nextapp/src/components/AudioRecorderButton.tsx`
- `BacklinksPanel` → `nextapp/src/components/BacklinksPanel.tsx`
- `ConfirmDialog` → `nextapp/src/components/ConfirmDialog.tsx`
- `ConnectionBanner` → `nextapp/src/components/ConnectionBanner.tsx`
- `DailyNoteButton` → `nextapp/src/components/DailyNoteButton.tsx`
- `DisambiguationPanel` → `nextapp/src/components/search/DisambiguationPanel.tsx`
- `DraftRecoveryModal` → `nextapp/src/components/DraftRecoveryModal.tsx`
- `EditorToolbar` → `nextapp/src/components/EditorToolbar.tsx`
- `ErrorReportButton` → `nextapp/src/components/ErrorReportButton.tsx`
- `FeedbackButtons` → `nextapp/src/components/search/FeedbackButtons.tsx`
- `FloatingTermDetection` → `nextapp/src/components/FloatingTermDetection.tsx`
- `GlobalHeader` → `nextapp/src/components/GlobalHeader.tsx`
- `HubDocuments` → `nextapp/src/components/HubDocuments.tsx`
- `InlineReviewPanel` → `nextapp/src/components/review/InlineReviewPanel.tsx`
- `InsurancePDFQuery` → `nextapp/src/components/search/InsurancePDFQuery.tsx`
- `InsuranceTermsList` → `nextapp/src/components/InsuranceTermsList.tsx`
- `LeaveConfirmModal` → `nextapp/src/components/LeaveConfirmModal.tsx`
- `Level1Card` → `nextapp/src/components/Level1Card.tsx`
- `Level2Accordion` → `nextapp/src/components/Level2Accordion.tsx`
- `Level3Search` → `nextapp/src/components/Level3Search.tsx`
- `MobileAIBar` → `nextapp/src/components/MobileAIBar.tsx`
- `NormalResults` → `nextapp/src/components/search/NormalResults.tsx`
- `QnaRenderer` → `nextapp/src/components/QnaRenderer.tsx`
- `QueryTypePicker` → `nextapp/src/components/search/QueryTypePicker.tsx`
- `RecordingConsentModal` → `nextapp/src/components/RecordingConsentModal.tsx`
- `ReflectEditor` → `nextapp/src/components/ReflectEditor.tsx`
- `RelatedDocsSidebar` → `nextapp/src/components/RelatedDocsSidebar.tsx`
- `ReviewActions` → `nextapp/src/components/review/ReviewActions.tsx`
- `ReviewStatusPopover` → `nextapp/src/components/review/ReviewStatusPopover.tsx`
- `ReviewTimeline` → `nextapp/src/components/review/ReviewTimeline.tsx`
- `RevisionHistoryModal` → `nextapp/src/components/RevisionHistoryModal.tsx`
- `SearchFooter` → `nextapp/src/components/search/SearchFooter.tsx`
- `SearchInput` → `nextapp/src/components/search/SearchInput.tsx`
- `SearchModal` → `nextapp/src/components/SearchModal.tsx`
- `SearchModal` → `nextapp/src/components/search/SearchModal.tsx`
- `SearchSummaryCard` → `nextapp/src/components/search/SearchSummaryCard.tsx`
- `ServiceWorkerRegistrar` → `nextapp/src/components/ServiceWorkerRegistrar.tsx`
- `ShadowIndicator` → `nextapp/src/components/ShadowIndicator.tsx`
- `SourceBadge` → `nextapp/src/components/SourceBadge.tsx`
- `TableOfContents` → `nextapp/src/components/TableOfContents.tsx`
- `TermSummaryView` → `nextapp/src/components/TermSummaryView.tsx`
- `TrustBadge` → `nextapp/src/components/trust/TrustBadge.tsx`
- `UnverifiedBanner` → `nextapp/src/components/trust/UnverifiedBanner.tsx`
- `VerificationTag` → `nextapp/src/components/trust/VerificationTag.tsx`
- `VersionDiff` → `nextapp/src/components/review/VersionDiff.tsx`
- `VoiceCommandProvider` → `nextapp/src/components/VoiceCommandProvider.tsx`
- `WikiLinkList` → `nextapp/src/components/WikiLinkList.tsx`
- `WikiLinkPreview` → `nextapp/src/components/WikiLinkPreview.tsx`

## Configuration Summary
### package.json
- **Name**: nextapp
- **Version**: 0.1.0
- **Scripts**: dev, build, start, lint
- **Dependencies**: @google/generative-ai, dotenv, next, react, react-dom
- **DevDependencies**: @tailwindcss/postcss, @types/node, @types/react, @types/react-dom, eslint, eslint-config-next, firebase-admin, tailwindcss, typescript

### functions/package.json
- **Name**: functions
- **Version**: (unknown)
- **Scripts**: build, serve, shell, start, deploy, logs, test
- **Dependencies**: @google-cloud/firestore, @google/generative-ai, @opendataloader/pdf, firebase-admin, firebase-functions, googleapis
- **DevDependencies**: typescript

### nextapp/package.json
- **Name**: nextapp
- **Version**: 0.1.0
- **Scripts**: dev, build, start, lint, test, test:watch, test:coverage
- **Dependencies**: @google/generative-ai, @tailwindcss/typography, @tiptap/extension-image, @tiptap/extension-link, @tiptap/extension-placeholder, @tiptap/extension-underline, @tiptap/pm, @tiptap/react, @tiptap/starter-kit, @tiptap/suggestion, @types/diff, diff, es-hangul, firebase, firebase-admin, fuse.js, googleapis, hangul-js, next, react, react-dom, react-markdown, rehype-raw, remark-gfm, sonner, tippy.js, tiptap-markdown
- **DevDependencies**: @tailwindcss/postcss, @testing-library/jest-dom, @testing-library/react, @testing-library/user-event, @types/node, @types/react, @types/react-dom, @vitest/coverage-v8, @vitest/ui, eslint, eslint-config-next, jsdom, tailwindcss, typescript, vitest

### functions/tsconfig.json
- **target**: es2017
- **module**: commonjs
- **strict**: True
- **outDir**: lib

### scripts/tsconfig.json
- **target**: ES2017
- **module**: commonjs
- **moduleResolution**: node
- **strict**: True
- **baseUrl**: ../nextapp
- **esModuleInterop**: True
- **noEmit**: True
- **paths**:
  - `firebase-admin` → `node_modules/firebase-admin/lib/index.d.ts`
  - `firebase-admin/*` → `node_modules/firebase-admin/lib/*`
  - `dotenv` → `node_modules/dotenv/lib/main.d.ts`

## Recently Modified Files (Top 20)
1. `tests/test_e2e_blog_generate.py` (2026-04-18)
2. `scripts/kakao_knowledge/tests/test_knowledge_extractor_v2.py` (2026-04-17)
3. `data/batches_20260416_1657/batch_001.json` (2026-04-17)
4. `data/batches_20260416_1657/batch_002.json` (2026-04-17)
5. `data/batches_20260416_1657/batch_003.json` (2026-04-17)
6. `data/batches_20260416_1657/batch_004.json` (2026-04-17)
7. `data/batches_20260416_1657/batch_005.json` (2026-04-17)
8. `data/batches_20260416_1947/batch_001.json` (2026-04-17)
9. `data/batches_20260416_1947/batch_002.json` (2026-04-17)
10. `data/batches_20260416_1947/batch_003.json` (2026-04-17)
11. `data/batches_20260416_1947/batch_004.json` (2026-04-17)
12. `data/batches_20260416_1947/batch_005.json` (2026-04-17)
13. `data/batches_20260416_2126/batch_001.json` (2026-04-17)
14. `data/batches_20260416_2126/batch_002.json` (2026-04-17)
15. `data/batches_20260416_2126/batch_003.json` (2026-04-17)
16. `data/batches_20260416_2126/batch_004.json` (2026-04-17)
17. `data/batches_20260416_2126/batch_005.json` (2026-04-17)
18. `data/batches_20260416_2126/batch_006.json` (2026-04-17)
19. `data/insights_v2_20260416_1657.json` (2026-04-17)
20. `scripts/kakao_knowledge/knowledge_extractor_v2.py` (2026-04-17)
