• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
Downchuck

Downchuck

con-juan

Public
Like
con-juan
Home
Code
10
frontend
1
src
6
tests
4
AUTOBOT.md
EXAMPLES.md
README.md
H
chat-api.ts
database.ts
H
power-abuse-analyzer.ts
H
static-file-server.ts
Branches
1
Pull requests
Remixes
History
Environment variables
1
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
5/24/2025
Viewing readonly version of main branch: v71
View latest version
README.md

Power Abuse Analyzer

A conversational AI tool that identifies covert or subtle abuse from powerful people in books, messages, or public statements.

Overview

This tool uses advanced language models to analyze text for subtle patterns of abuse, manipulation, and problematic language that might be overlooked in everyday communication, especially from people in positions of power.

Features

  • Text Analysis: Analyze any text for subtle forms of abuse and manipulation

  • Pattern Recognition: Identifies 14 different patterns of subtle abuse

  • Severity Assessment: Rates identified patterns as subtle, moderate, or overt

  • Confidence Scoring: Provides confidence levels for each identified pattern

  • Example Extraction: Highlights specific examples from the analyzed text

  • Response Suggestions: Offers constructive ways to address problematic language

  • Known Figure Analysis: Pre-configured examples for analyzing statements from known powerful figures (e.g., Steve Jobs, Ray Dalio)

  • Privacy-First Session Management: Choose how your sessions are stored with privacy as the default

    • Temporary Sessions (Default): No data saved anywhere - maximum privacy
    • Local Storage: Sessions saved only in your browser - private and secure
    • Server Storage: Full AI analysis with persistent sessions saved to database
  • Data Management: Clear saved data with one click

    • Delete individual sessions
    • Clear all local browser data
    • Clear all server data
    • Real-time privacy status indicators
  • Pattern Examples: Add your own examples to identified patterns

  • Threaded Conversations: Continue conversations about specific patterns

  • Export Functionality: Export analysis results for sharing or archiving

Abuse Patterns Detected

  1. Subtle threats or intimidation - Implied consequences without explicit threats
  2. Minimization of harm - Downplaying the negative impact of actions or decisions
  3. Shifting blame to victims - Making those harmed responsible for their own suffering
  4. Appeals to authority or expertise to silence criticism - Using position or credentials to avoid accountability
  5. False equivalencies - Comparing unrelated situations to normalize problematic behavior
  6. Dehumanizing language - Subtle ways of reducing people to objects, functions, or stereotypes
  7. Plausible deniability tactics - Crafting statements that can be defended as innocent if challenged
  8. Coded language that signals to specific groups - Using terms with special meaning to certain audiences
  9. Misuse of institutional power - Leveraging organizational structures to enable abuse
  10. Intellectual intimidation - Using complex frameworks or jargon to make others feel inferior
  11. Benevolent authoritarianism - Framing controlling behavior as being "for your own good"
  12. Selective meritocracy - Claiming decisions are based on merit when they actually favor those who conform
  13. Institutional shield - Using organizational policies or culture as a shield for personal abusive behavior

Project Structure

├── src/                    # Source code
│   ├── analyzer/           # Core text analysis functionality
│   │   └── index.ts        # Main analyzer module
│   ├── api/                # HTTP API endpoints
│   │   ├── chat-api.ts     # Chat sessions and pattern examples API
│   │   ├── power-abuse-analyzer.ts # Text analysis API
│   │   └── static-file-server.ts # Static file server
│   ├── database/           # Database operations
│   │   └── index.ts        # SQLite database operations
│   ├── utils/              # Utility functions
│   │   ├── error-handler.ts # Error handling and response formatting
│   │   └── logger.ts       # Logging utility
│   ├── index.ts            # Main entry point
│   └── README.md           # Source code documentation
├── tests/                  # Test files
│   ├── analyzer.test.ts    # Tests for text analysis
│   ├── chat-api.test.ts    # Tests for chat API
│   ├── database.test.ts    # Tests for database operations
│   └── README.md           # Test documentation
├── frontend/               # Frontend files
│   └── index.html          # Main HTML file
├── AUTOBOT.md              # Development conversation history
└── README.md               # Main documentation

Database Schema

The application uses SQLite with the following tables:

  • Sessions: Stores chat sessions with titles and timestamps
  • Messages: Stores messages within sessions, with support for threaded conversations
  • Patterns: Stores identified abuse patterns with severity and confidence ratings
  • Examples: Stores examples of patterns, including user-provided examples

The database uses recursive common table expressions (CTEs) to handle threaded conversations about specific patterns.

Usage

  1. Visit the web interface
  2. Privacy Notice: By default, nothing is saved for maximum privacy
  3. Choose your privacy mode:
    • 🔒 Temporary (Default): No data saved anywhere - maximum privacy
    • 💾 Local Storage: Sessions saved only in your browser - private and secure
    • ☁️ Server Storage: Full AI-powered analysis with sessions saved to the database
  4. Create a new analysis session
  5. Enter text to analyze or ask a question about power abuse patterns
  6. Review the analysis results (full analysis available in server mode)
  7. Click on "Add examples or ask about this pattern" to continue a conversation about a specific pattern
  8. Add your own examples of patterns you've observed
  9. Save and export your analysis sessions
  10. Data Management: Use the data management tools to delete saved data:
    • Delete individual sessions with the 🗑️ button
    • Clear all local data with "Clear all local data"
    • Clear all server data with "Clear all server data"

Privacy Modes Explained

  • 🔒 Temporary Sessions (Default): No data is saved anywhere. This provides maximum privacy but sessions are lost when the page is refreshed. Analysis capabilities are limited (no AI processing). This is the default for privacy protection.

  • 💾 Local Storage: Sessions are saved only in your browser's local storage. This provides privacy as data never leaves your device, but with limited analysis capabilities (no AI processing). Sessions are only available on the device where they were created.

  • ☁️ Server Storage: Sessions are saved to the SQLite database on the server. This provides full AI-powered analysis using OpenAI's models, persistent sessions that can be accessed from any device, and complete pattern recognition capabilities.

Prompts Used

Analysis Prompt

The system uses a carefully crafted prompt to guide the AI in identifying subtle forms of abuse:

You are an expert in identifying subtle forms of abuse, manipulation, and problematic language from powerful people. 
Your task is to analyze the provided text and identify patterns that may indicate:

[List of 14 abuse patterns]

Focus on SUBTLE and COVERT forms of these patterns that might not be immediately obvious.
For each identified pattern, provide:
- A clear explanation of the pattern
- The severity (subtle, moderate, or overt)
- Your confidence level (0.0-1.0)
- Specific examples from the text

If no problematic patterns are found, state so clearly.
Provide an overall assessment of the text.
If appropriate, suggest constructive responses or ways to address the problematic language.

Pattern Follow-Up Prompt

For handling follow-up questions about specific patterns:

You are an expert in identifying and explaining patterns of subtle abuse, manipulation, and problematic language from powerful people.
  
A user has previously identified the following pattern in some text:

Pattern: [pattern_type]
Explanation: [explanation]
Severity: [severity]
Confidence: [confidence]

Examples of this pattern:
[examples]

The user is now asking a follow-up question or providing additional information about this pattern.
If they are providing a new example, acknowledge it and explain how it fits the pattern.
If they are asking a question, provide a detailed, educational response about this specific pattern.
Focus on being helpful, informative, and sensitive to the nuances of power dynamics.

Development

Running Tests

To run the tests, use the following command:

deno test tests/

API Endpoints

  • /power-abuse-analyzer: Analyzes text for subtle forms of abuse
  • /chat-api: Manages chat sessions, messages, and pattern examples
  • /static-file-server: Serves the frontend files

Chat API Actions

  • create_session: Creates a new chat session
  • get_session: Gets a session by ID
  • get_all_sessions: Gets all sessions
  • send_message: Sends a message in a session
  • add_example: Adds an example to a pattern
  • get_pattern: Gets a pattern by ID
  • search_patterns: Searches for patterns by type
  • update_session_title: Updates a session's title
  • delete_session: Deletes a session

Limitations

This tool provides analysis based on AI pattern recognition and should be used as one input among many when evaluating communication. It is not a definitive judgment of a person's character or intentions.

Future Improvements

  • Add more pre-configured examples of powerful figures
  • Improve pattern detection accuracy
  • Enhance the user interface with visualization of abuse patterns
  • Add historical context for better analysis
  • Implement user accounts to save and compare analyses
  • Add collaborative analysis features for group discussions
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.