Skip to content

Latest commit

 

History

History
53 lines (46 loc) · 1.71 KB

File metadata and controls

53 lines (46 loc) · 1.71 KB

Implementation Guide

Step-by-Step Instructions for Coding Agent

Phase 1: Backend Foundations

  1. Initialize Elixir project with Ash and Ash Postgres.
  2. Install and configure Ash Encryption.
  3. Add Oban and Oban Web.

Phase 2: Domain Modeling

  1. Create Ash resource: Environment.
  2. Create Ash resource: Variable.
    • Attributes: name, encrypted_value, environment_id.
  3. Create Ash resource: Command.
    • Attributes: name, shell_command, cron_expression, environment_id.
  4. Create Ash resource: CommandExecutionEvent.
    • Attributes: command_id, status, started_at, finished_at, duration_ms, stdout, stderr.

Phase 3: Scheduling Integration

  1. Configure Oban with crontab support.
  2. Implement Ash action to sync Command.cron_expression to Oban crontab.
  3. Ensure updates re-register schedules dynamically.

Phase 4: Job Execution

  1. Implement Oban Worker:
    • Load Command by ID.
    • Resolve variables for environment.
    • Interpolate $VARIABLE references.
    • Execute shell command using System.cmd or Port.
    • Capture stdout and stderr separately.
    • Measure execution time.
    • Emit CommandExecutionEvent records for:
      • started
      • succeeded
      • failed

Phase 5: Frontend

  1. Initialize React app with shadcn/ui.
  2. Integrate Ash TypeScript client.
  3. Build UI screens:
    • Environments
    • Variables / Secrets
    • Commands + Schedule Editor
    • Execution History

Phase 6: Validation & Hardening

  1. Ensure secrets never logged.
  2. Add retry and timeout handling in workers.
  3. Verify Oban Web visibility.
  4. Add indexes on execution events.

Phase 7: Agent Automation

  1. Encode all steps as tasks for coding agent.
  2. Enforce no REST endpoints — Ash resources only.