feat: remove false Anthropic guardrails, add How It Works page#10
Merged
Conversation
…e docs Round 18 prompt tuning: after manual verification confirmed that all "suspicious" Anthropic output (interview prep, business metrics, career advice) was actually present in the transcript, removed the unnecessary guardrails that were suppressing legitimate content. Changes: - Delete prompts/anthropic-exclusions.xml (XML exclusion block) - Remove exclusion loading code from llm-api-helpers.ts - Raise Anthropic temperature from 0.1 to 0.7 - Remove Rule 6 "EXCLUDED TOPICS" from all 3 prompt templates - Add interactive How It Works page (public/how-it-works.html) - Add How It Works links to UrlInput, Footer, and all docs - Create docs/SETUP.md, docs/API.md, docs/INFRASTRUCTURE.md - Update README.md and prompts/README.md for accuracy - Add Round 18 test results (9/9 pass, 0 hallucinations) - Add ai_summary/ANALYSIS_REPORT.md with full quality analysis Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
shrimpy8
added a commit
that referenced
this pull request
May 13, 2026
…20) * fix: resolve all 22 code quality issues across security, correctness, and maintainability CRITICAL: - Gemini API key moved from URL query param to x-goog-api-key header (#1) - Fix regex .test() with g flag causing alternating highlight failures (#2) - Consolidate fragile string error classification into error-mapper.ts (#3) - Add missing .catch() on fetchProviderConfig promise in useProviderConfig (#4) HIGH: - Fix setInterval leak in channel/playlist caches with stored interval IDs (#5) - Extract mapEpisodes() helper to eliminate triple-duplicated episode mapping (#6) - Re-export extractVideoId from youtube-validator as single source of truth (#7) - Guard against empty sanitized channel name producing invalid URL (#8) - Replace console.warn with structured logger in api-client (#9) - Add lazy eviction to rate limiter map to prevent unbounded growth (#10) MEDIUM: - Add typed response interfaces (AnthropicResponse/GeminiResponse/PerplexityResponse) replacing any (#11) - Move LLM limits and channel fetch constants to constants.ts (#12) - Wrap request.json() in try/catch returning 400 across all 5 routes (#13) - Replace transcript/route.ts outer catch with handleApiError (#14) - Add success:false to all createErrorResponse shapes (#15) - Fix extractChannelIdFromUrl to return null instead of full URL (#16) - Set hasGenerated:true in generateSummary catch block (#17) LOW: - Read Anthropic API version from ANTHROPIC_API_VERSION env var (#18) - Add JSDoc to safeJsonParse in api-client (#19) - Create generic TtlCache<T> class; refactor channel/playlist caches to use it (#20) - Use average segment duration for last transcript segment instead of 0 (#21/#22) ADDITIONAL FIXES: - JSON parse guards added to discover/ytdlp/channel routes (A1) - Replace console.error with logger in url-type-helpers, useCachedData, useProcessingOptions (A2) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore: untrack ISSUES-AND-FIXES.md and add to .gitignore Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: HaHa <642975+shrimpy8@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
shrimpy8
added a commit
that referenced
this pull request
May 13, 2026
* fix: resolve all 22 code quality issues across security, correctness, and maintainability CRITICAL: - Gemini API key moved from URL query param to x-goog-api-key header (#1) - Fix regex .test() with g flag causing alternating highlight failures (#2) - Consolidate fragile string error classification into error-mapper.ts (#3) - Add missing .catch() on fetchProviderConfig promise in useProviderConfig (#4) HIGH: - Fix setInterval leak in channel/playlist caches with stored interval IDs (#5) - Extract mapEpisodes() helper to eliminate triple-duplicated episode mapping (#6) - Re-export extractVideoId from youtube-validator as single source of truth (#7) - Guard against empty sanitized channel name producing invalid URL (#8) - Replace console.warn with structured logger in api-client (#9) - Add lazy eviction to rate limiter map to prevent unbounded growth (#10) MEDIUM: - Add typed response interfaces (AnthropicResponse/GeminiResponse/PerplexityResponse) replacing any (#11) - Move LLM limits and channel fetch constants to constants.ts (#12) - Wrap request.json() in try/catch returning 400 across all 5 routes (#13) - Replace transcript/route.ts outer catch with handleApiError (#14) - Add success:false to all createErrorResponse shapes (#15) - Fix extractChannelIdFromUrl to return null instead of full URL (#16) - Set hasGenerated:true in generateSummary catch block (#17) LOW: - Read Anthropic API version from ANTHROPIC_API_VERSION env var (#18) - Add JSDoc to safeJsonParse in api-client (#19) - Create generic TtlCache<T> class; refactor channel/playlist caches to use it (#20) - Use average segment duration for last transcript segment instead of 0 (#21/#22) ADDITIONAL FIXES: - JSON parse guards added to discover/ytdlp/channel routes (A1) - Replace console.error with logger in url-type-helpers, useCachedData, useProcessingOptions (A2) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore: untrack ISSUES-AND-FIXES.md and add to .gitignore Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: replace `as any` cast in test setup with typed assertion Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: HaHa <642975+shrimpy8@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
shrimpy8
added a commit
that referenced
this pull request
May 13, 2026
* fix: resolve all 22 code quality issues across security, correctness, and maintainability CRITICAL: - Gemini API key moved from URL query param to x-goog-api-key header (#1) - Fix regex .test() with g flag causing alternating highlight failures (#2) - Consolidate fragile string error classification into error-mapper.ts (#3) - Add missing .catch() on fetchProviderConfig promise in useProviderConfig (#4) HIGH: - Fix setInterval leak in channel/playlist caches with stored interval IDs (#5) - Extract mapEpisodes() helper to eliminate triple-duplicated episode mapping (#6) - Re-export extractVideoId from youtube-validator as single source of truth (#7) - Guard against empty sanitized channel name producing invalid URL (#8) - Replace console.warn with structured logger in api-client (#9) - Add lazy eviction to rate limiter map to prevent unbounded growth (#10) MEDIUM: - Add typed response interfaces (AnthropicResponse/GeminiResponse/PerplexityResponse) replacing any (#11) - Move LLM limits and channel fetch constants to constants.ts (#12) - Wrap request.json() in try/catch returning 400 across all 5 routes (#13) - Replace transcript/route.ts outer catch with handleApiError (#14) - Add success:false to all createErrorResponse shapes (#15) - Fix extractChannelIdFromUrl to return null instead of full URL (#16) - Set hasGenerated:true in generateSummary catch block (#17) LOW: - Read Anthropic API version from ANTHROPIC_API_VERSION env var (#18) - Add JSDoc to safeJsonParse in api-client (#19) - Create generic TtlCache<T> class; refactor channel/playlist caches to use it (#20) - Use average segment duration for last transcript segment instead of 0 (#21/#22) ADDITIONAL FIXES: - JSON parse guards added to discover/ytdlp/channel routes (A1) - Replace console.error with logger in url-type-helpers, useCachedData, useProcessingOptions (A2) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore: untrack ISSUES-AND-FIXES.md and add to .gitignore Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: resolve 6 second-review issues (SR-1 through SR-6) - SR-4: path traversal error no longer silently swallowed — re-thrown with structured log - SR-1: fragile string-based 404 detection replaced with typed ChannelNotFoundError + mapChannelError - SR-5: createSuccessResponse spread order fixed so data cannot override success:true - SR-2: rateLimitResponse now includes type:'RATE_LIMIT' for API consistency - SR-3: duplicated time range injection string extracted to formatTimeRangeSection helper - SR-6: extractNameFromUrl returns 'Unknown Channel' instead of raw URL as fallback Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: HaHa <642975+shrimpy8@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
npx tsc --noEmit— pre-existing test file errors only, no new errorsnpm test -- --run— 339/339 tests passai_summary/ANALYSIS_REPORT.md🤖 Generated with Claude Code