Skip to content

feat: remove false Anthropic guardrails, add How It Works page#10

Merged
shrimpy8 merged 1 commit into
mainfrom
feat/round-18-remove-anthropic-guardrails
Jan 31, 2026
Merged

feat: remove false Anthropic guardrails, add How It Works page#10
shrimpy8 merged 1 commit into
mainfrom
feat/round-18-remove-anthropic-guardrails

Conversation

@shrimpy8
Copy link
Copy Markdown
Owner

Summary

  • Remove unnecessary Anthropic guardrails (XML exclusion block, temperature 0.1, Rule 6 EXCLUDED TOPICS) after manual verification confirmed all "suspicious" content was actually in the transcript
  • Add interactive How It Works architecture overview page with links from UI and docs
  • Create docs/SETUP.md, docs/API.md, docs/INFRASTRUCTURE.md; update README.md and prompts/README.md for accuracy
  • Full 9-combination test (3 providers x 3 styles) passed with 0 hallucinations — Anthropic is now chore(deps): Bump vitest from 4.0.14 to 4.0.15 #1 across all modes

Test plan

  • npx tsc --noEmit — pre-existing test file errors only, no new errors
  • npm test -- --run — 339/339 tests pass
  • Manual UI test: all 9 LLM combinations generated successfully
  • TXT exports verified for all 9 combinations
  • Zero hallucinations across all outputs
  • Analysis report created at ai_summary/ANALYSIS_REPORT.md

🤖 Generated with Claude Code

…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 shrimpy8 merged commit b04224e into main Jan 31, 2026
@shrimpy8 shrimpy8 deleted the feat/round-18-remove-anthropic-guardrails branch February 2, 2026 02:25
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>
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