Implements AWS AssumeRole-like pattern for Poimen: - User/service requests temporary access with identity + scope - AssumeRoleActivity exchanges credentials with OAuth2 auth server - Returns JWT token valid for limited time (default: 1hr, max: 24hrs) - Token used in all subsequent LLM API calls to api.riotpiao.com Key features: - Credentials from vault/K8s secrets (never hardcoded) - Scope-based access control (llm:read, llm:read llm:write, llm:admin) - Automatic token expiration tracking - Retry support for transient auth failures (2x, 1.5s backoff) - Configurable auth server endpoint Usage pattern: 1. AssumeRoleActivity(identity, scope) → JWT token 2. LLMRouter uses token in LLMAuth config 3. All activity calls validated against token + scopes 4. Workflow optionally refreshes token before expiry Security: - No credentials in code/logs (env or vault only) - Short-lived tokens (1hr default, 24hr max) - Server-enforced scope validation - Token revocation support Activity registered: #10 (authentication category) Knowledge base updated with full activity spec New file: action/assume_role.go (5.2 KB)
- Add RoutingWorkflow: generic state machine executor for WorkflowSpec - Add LLM Router: natural language → WorkflowSpec generation - Add RetrieveMemoryActivity: query poimen-memory for context - Add activities: AnalyzeCode, SecurityScan, GenerateReport, Notify, etc. - Add agent-prompts/router: LLM prompt documentation - Extend starter with --route flag for routing workflows - Remove orchestrator job (trigger via API/message instead) - Clean up: move docs to Desktop, add .gitignore for *.md
Task 1.2 & 1.3 COMPLETE ✅ Core knowledge base infrastructure: - activity_knowledge_base.json: Catalog of 8 activities with metadata - CloneRepoActivity: Clone Git repo (stable, 1 retry) - AnalyzeCodeActivity: AST analysis (flaky, 3 retries) - SecurityScanActivity: SAST scanning (2 retries) - GenerateReportActivity: Report generation (1 retry) - DeploymentPreCheckActivity: Pre-deployment validation (flaky, 2 retries) - NotifyStatusActivity: Slack/email notifications (flaky, 3 retries) - ApproveWorkflowActivity: Human approval (120m timeout) - ArchiveResultsActivity: Cloud storage archival (flaky, 2 retries) - knowledge_base.go: KnowledgeBase loader with methods: - LoadKnowledgeBase(path) - Load from JSON file - LoadKnowledgeBaseFromDefaultPath() - Auto-discover file - GetActivity(name) - Lookup single activity - GetActivityNames() - List all activity names - HasActivity(name) - Check existence - GetTimeoutForActivity(name) - Get timeout from KB - GetRetryPolicyForActivity(name) - Get retry config - IsFlaky(name) - Check if flaky - GetDependencies(name) - Get activity dependencies - ListActivitiesByCategory(category) - Filter by category - Validate() - Check for circular dependencies - PrintSummary() - Human-readable summary - knowledge_base_test.go: 14 unit tests - Test loading, lookup, filtering, dependencies - Test timeout/retry extraction - Test validation logic - All tests PASS ✅ (22/22 total) Acceptance criteria met: ✅ Knowledge base loads successfully ✅ All 8 activities properly defined ✅ Flaky/stable flags correctly set ✅ Dependencies validate with no cycles ✅ Timeout/retry extraction works ✅ Unit tests pass (14/14 KB tests) ✅ Ready for validator (Task 1.4) Effort: 5 hours (estimated 3+2) Files: activity_knowledge_base.json (10.3KB) knowledge_base.go (246 lines) knowledge_base_test.go (324 lines)