Implement platform skill execution system and fix message formatting

Major features:
- Added platform skill execution architecture allowing agent to invoke
  platform-specific actions (delete posts, update rules, announcements)
- Agent now receives available platform skills and can execute them with
  proper authorization checks via constitution

Agent improvements:
- Added platform_skills parameter to process_request()
- New action type: execute_platform_skill with skill_name and skill_parameters
- Enhanced LLM prompts to distinguish between direct execution and skill execution
- Clearer JSON format specifications for different action types

Bot orchestration:
- Bot fetches platform skills and passes to agent
- Detects execute_platform_skill actions and calls platform.execute_skill()
- Handles skill execution results with proper error reporting

Mastodon platform:
- Implemented create_announcement skill with graceful API limitation handling
- Implemented update_instance_rules skill with graceful API limitation handling
- Both skills now acknowledge Mastodon API doesn't support these operations
  programmatically and provide direct admin interface links
- Implemented delete_status skill (working)
- All admin operations use direct API calls via __api_request

Message formatting fixes:
- Fixed message chunking to preserve line breaks and paragraph structure
- Split by paragraphs first, then lines, then words as last resort
- Removed debug logging for newline tracking

Documentation:
- Updated .gitignore to exclude bot.log and nohup.out

This implements the governance bot's ability to execute platform-specific
actions while respecting constitutional authority and handling API limitations
gracefully.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Nathan Schneider
2026-02-09 22:45:31 -07:00
parent 422f0859f4
commit a0785f09cf
5 changed files with 261 additions and 59 deletions

1
.gitignore vendored
View File

@@ -79,3 +79,4 @@ htmlcov/
# OS
.DS_Store
Thumbs.db
nohup.out