Skip to content

v1.4 — AI Workforce

Five autonomous AI employees run on schedule, produce reviewable artifacts, and — after human approval — ship them to GitHub, Mailtrap, or Slack, with a brand-voice post-filter gate, scoped MCP tools, persistent memory, and budget caps.

Summary

The core operational thesis: Objectuve already had ~40 Claude Code skills that a human operator ran manually (content drafting, metrics reports, alerts, moderation assistance, outreach). That's 8–12 hours/week of supervised LLM work. v1.4 turned those skills into scheduled autonomous employees.

Five "employees" shipped — Cori (Content Drafter), Emi (Email Sender), Scout (Metrics Reporter), Dash (Incident Responder), and Ally (Outreach) — each with a declared set of MCP tools (GitHub, Mailtrap, Sentry, PostHog, Slack via REST clients), a monthly budget cap, a cron schedule, and persistent memory injected into every run. A dedicated TypeScript Cloud Run service, agent_runner/, wraps the @anthropic-ai/claude-agent-sdk query() loop with safety guards (maxTurns, maxBudgetUsd, cancel), OIDC auth to Rails and LiteLLM, and an HMAC-signed webhook back to Rails.

Every artifact produced passes a mandatory brand-voice post-filter (a second query() call using tightening-brand-voice skill) before it can enter the operator's Review Queue. Auto-rejected artifacts surface rejection reasons into the employee's memory for the next run. Approval-triggered delivery handlers ship approved artifacts to the right destination (GitHub PR, Mailtrap send, Slack post). Autonomy progresses in three levels — supervised → semi-autonomous → autonomous — gated by approval-rate validations (80% over 4 weeks, 95% over 8 weeks).

All five employees launched in shadow mode (supervised) on 2026-04-13.

Goal

Turn Objectuve's existing Claude Code skills into autonomous AI employees that run on schedule, produce reviewable artifacts, and ship approved outputs — reducing 8–12 hours/week of operational work while maintaining brand-voice fidelity through mandatory post-filters and human oversight.

Scope — What Shipped

Rails platform (Phase 13):

  • Four PublicRecord + soft-delete models: AiEmployee, AiRun, AiArtifact, AiEmployeeMemory — 51 passing specs, Rubocop clean.
  • Four GraphQL types, two query resolvers, three mutations, two interactions — complete admin-gated API.
  • Approval workflow: ApproveArtifact, RejectArtifact mutations + HMAC-authenticated webhook at POST /webhooks/ai-workforce.
  • ExecuteRunJob background worker; ScheduleRunsJob Crono cron dispatches runs on each employee's schedule.
  • Seeded 5 employees with role keys, budgets, schedules.

Agent Runner service (Phase 14):

  • New TypeScript Express app at agent_runner/ deployed to Cloud Run.
  • Endpoints: POST /runs, GET /runs/:id/status, POST /runs/:id/cancel, GET /health.
  • @anthropic-ai/claude-agent-sdk@0.2.104 query() loop with maxTurns (30), maxBudgetUsd (default $1), and cancel safety guards.
  • OIDC token fetcher for service-to-service calls (Rails + LiteLLM).
  • HMAC-SHA256 webhook sender posts run results back to Rails.

MCP + memory + brand-voice gate (Phase 15):

  • GitHub MCP via stdio subprocess; PostHog, Sentry, Mailtrap, Slack via REST clients.
  • MCP access is scoped per employee via the mcp_servers column.
  • Persistent memory: AiEmployeeMemory records merged into system prompt per run (~2000 token cap).
  • Brand-voice post-filter: a second query() call using the tightening-brand-voice skill runs after every artifact is produced; artifacts that fail are auto-rejected with reason captured in memory for next run.

Delivery + autonomy + monitoring (Phase 16):

  • DeliverArtifactJob dispatches approved artifacts: GitHub PR creation, Mailtrap send, Slack post.
  • Autonomy promotion: DB validation on AiEmployee enforces 80% approval rate over 4 weeks (semi-auto) and 95% over 8 weeks (auto); confirm_promotion_at records operator confirmation.
  • Budget alerts: AiWorkforce::BudgetAlertJob hits Slack at 80% + 100% of monthly cap (dedup via Rails.cache 45-day TTL).
  • Stale-run timeout: TimeoutStaleRunsJob every 15 min.
  • Edit-distance tracking: if an operator edits an artifact before approving, edit_distance is computed (Levenshtein ratio) and stored for autonomy gating.
  • Admin dashboard views: AIWorkforceView, ReviewQueueView, EmployeeDetailView, RunDetailView — full operator surface for the five employees.

Phases

PhaseNameStatusPlansHighlights
13Rails Platform InfrastructureShipped54 models, 4 GraphQL types, 3 mutations, approval + webhook, seeded employees
14Agent Runner ScaffoldShipped3TypeScript Cloud Run service, query() loop, OIDC, HMAC webhook
15MCP + Memory + Brand VoiceShipped3MCP tool scoping, persistent memory, mandatory brand-voice post-filter, all 5 employees live
16Delivery + AutonomyShipped3GitHub/Mailtrap/Slack delivery, autonomy gates, budget alerts, detailed run views

Key Decisions

  • Claude Agent SDK over CrewAI/LangGraph — same mental model as Claude Code, low learning curve. Package renamed from @anthropic-ai/claude-code to @anthropic-ai/claude-agent-sdk; do not use the old name.
  • Separate TypeScript Cloud Run serviceagent_runner/ is stateless, has no DB access, communicates with Rails only via OIDC HTTP + HMAC webhook. Clean blast-radius isolation.
  • Brand-voice filter is a separate query() call, not a loaded skill — keeping it out of the main run's skill context prevents context dilution. It's a gate, not an advisor.
  • MCP scoping via mcp_servers column — an employee without 'github' in its mcp_servers array cannot invoke GitHub tools. Enforced at MCP config assembly time, not at prompt level.
  • Autonomy promotion is a DB validation, not a UI warningvalidate :promotion_requirements_met on AiEmployee enforces promotion criteria at the model level. Manipulating the UI cannot advance an employee past the gates.
  • Memory injected into system prompt, not fetched mid-run — deterministic, measurable token cost. Capped at ~2000 tokens.
  • Rails is the source of truth for runs, not agent_runner/ — the Agent Runner's in-memory runMap is lost on restart; Rails persists every run + artifact + delivery status.
  • Every AI Workforce mutation requires require_admin! — regular users cannot access the surface.

Requirements Coverage

45 / 45 requirements satisfied. Audit status: tech_debt (14 INFO-level items, no blockers).

CategoryCountStatus
Platform (PLAT)6All satisfied
Agent Runner (AGENT)7All satisfied
Scheduling (SCHED)3All satisfied
Approval (APPR)6All satisfied
Delivery (DELIV)5All satisfied
Employee Config (EMP)5All satisfied
Memory (MEM)4All satisfied
MCP (MCP)6All satisfied
Dashboard (DASH)5All satisfied
Cost (COST)5All satisfied
Autonomy (AUTO)5All satisfied

Full list: v1.4-REQUIREMENTS.md.

E2E Flows

All four target flows complete end-to-end:

  • Employee → Run → Artifact → Approve → Deliver — operator can trigger a manual run, receive the artifact in Review Queue, approve, and see delivery succeed.
  • Run → brand-voice filter → auto-reject → memory — failing artifacts never reach the operator; rejection reason is captured in the employee's memory for the next run.
  • Review history → approval rate → promote autonomy — approval-rate chart drives the promotion validation; operator can confirm promotion once gates pass.
  • Budget threshold → Slack alertAiWorkforce::BudgetAlertJob posts to Slack at 80% and 100% with dedup.

Tech Debt

From the audit (v1.4-MILESTONE-AUDIT.md):

  • (phase 13) Visual verification of admin dashboard deferred (VERIFICATION.md status: human_needed).
  • (phase 14) Some verification items deferred during autonomous run (gaps_found).
  • (phase 15) EmployeeDetailView / RunDetailView visual check deferred.
  • (phase 15, 16) OpenStruct used for resolver return values — prefer Data.define (IN-01).
  • (phase 15, 16) relativeTime helper duplicated across 3 views — extract to composable (IN-04).
  • (phase 15) N+1 risk on last_run resolver in list views (IN-02).
  • (phase 16) Top-level constants in job spec may conflict in parallel tests (IN-03).
  • (phase 16) Missing artifact nil from public_find silently swallowed (IN-05).

All INFO-level; no blockers.

  • 51a902a92feat: v1.4 AI Workforce — 5 autonomous employees in shadow mode (#313)
  • e21b30515chore: complete v1.4 AI Workforce milestone
  • 62590715ddocs(v1.4): milestone audit report
  • 5b84cea03docs: comprehensive AI Workforce documentation for v1.4
  • 99a78b860docs: create milestone v1.4 roadmap (4 phases)

Last updated: 2026-05-22

Loading…