Complete database schema and API implementation for agent memory aligned with API Platform Engineer role requirements (agency-agents/engineering/engineering-api-platform-engineer.md) Schema (migration 004): ✓ agent_prompt: template-based prompts with versioning ✓ agent_skill: capabilities with effectiveness tracking ✓ agent_decision: reasoning and outcome recording ✓ role_prompt_mapping: maps roles (e.g., api-platform-engineer) to prompts ✓ agent_metrics: performance tracking per agent ✓ prompt_usage_log: detailed invocation tracking ✓ agent_registry: agent lifecycle management API Endpoints (contract-first, backward-compatible): POST /memory/agents/{project_id}/prompts POST /memory/agents/{project_id}/roles GET /memory/agents/{project_id}/roles/{role_name}/prompts Handlers: ✓ create_prompt_handler: persists to agent_prompt table ✓ map_role_to_prompt_handler: role → prompt mapping with priority ✓ get_role_prompts_handler: retrieves prompts by role Repository Layer (mem-store/src/agent_repo.rs): ✓ AgentRepository with full CRUD operations ✓ Prompt usage tracking and statistics ✓ Role-to-prompt mapping with priority ordering ✓ Metrics persistence for observability Tekton Pipeline: ✓ agent-memory-migration-task: applies schema migration ✓ verify-indexes: validates all indexes created ✓ verify-schemas: validates table structure ✓ integration into poimen-ci pipeline Integration Tests (tests/agent_memory_api_platform_engineer.rs): ✓ Contract-first API specification validation ✓ Backward compatibility rule enforcement ✓ Rate limiting communication (X-RateLimit-* headers) ✓ Error response consistency (stable codes + request IDs) ✓ Deprecation lifecycle (announce → signal → runway → sunset) ✓ Idempotency and retry safety ✓ API Platform Engineer role requirements ✓ Agent prompt templates for contract review, compatibility check, SDK generation All tests validate against agency-agents API Platform Engineer specification: - Contract-first: OpenAPI spec before code - No breaking changes without versioning - Consistent error handling (RFC 9457 problem details) - Rate limits communicated not enforced - SDKs + docs generated from spec - Idempotency via Idempotency-Key header - Deprecation with runway (6-12+ months) Ready to deploy: run Tekton PipelineRun to apply migrations + test
Create proper Tekton Pipeline that orchestrates multiple Tasks: k8s/tekton/poimen-pipeline.yaml: - Pipeline: poimen-ci - Orchestrates integration tests → gate → promote - Tasks: 1. integration-tests (poimen-integration-test Task) 2. gate-on-tests (verify results) 3. promote-image (promote to :latest) 4. cleanup (final step) - Parameters: image SHA, registry creds - Results: test summary, promotion status .gitea/workflows/build.yaml: - Changed from TaskRun to PipelineRun - Trigger: kubectl create PipelineRun - Pass image SHA + registry credentials - Wait for Pipeline completion (10m timeout) - Gate: Only promote if tests pass - Print: Full pipeline status + test logs Pipeline Flow: CI (build.yaml) → PipelineRun ↓ Pipeline: poimen-ci ├─ Task 1: integration-tests │ ├─ Run migrations │ ├─ Run integration test suites │ └─ Return summary ├─ Task 2: gate-on-tests (runAfter Task 1) │ └─ Check results ├─ Task 3: promote-image (runAfter Task 2) │ └─ Promote to :latest └─ Task 4: cleanup (finally) Benefits: ✓ Full pipeline orchestration ✓ Proper Tekton pattern ✓ Easy to add more Tasks ✓ Clear dependency flow ✓ Results propagation ✓ Gates and conditions Next: Add more Tasks to Pipeline as needed - Docker build task - SCA task - Performance test task - Deployment task
Replace ad-hoc K8s Job with proper Tekton TaskRun: k8s/tekton/integration-test-task.yaml: - Tekton Task for integration testing - Two stages: migrate + test - Runs existing Rust integration tests: * it_phase3_phase4 (ingest + persistence) * it_unified_query_4_6 (query endpoint) * it_temporal_filtering_4_2_fixed (temporal) * mem_ingest (extraction pipeline) * mem_cli::query (query handler) - Reports results to /tekton/results/summary - Resource limits: 1Gi mem, 500m CPU .gitea/workflows/build.yaml: - Integrated Tekton trigger after image push - Create TaskRun with image SHA - Wait for completion (5m timeout) - Gate image promotion on test passing - Only promote to :latest if tests pass Pattern (from homelab-frontend): 1. Build image → push with SHA 2. Trigger Tekton TaskRun 3. Wait for result 4. Gate promotion 5. Promote to :latest only if tests pass Benefits: ✓ Proper K8s CI/CD framework ✓ Reusable Task ✓ Better logging/results ✓ Proper resource mgmt ✓ Matches homelab pattern Requires: - Tekton Pipelines installed in cluster - KUBECONFIG_B64 secret in Forgejo