Skip to content

feat: add Alpha loop orchestrator with Gemini - #40

Merged
atomeam merged 1 commit into
mainfrom
feature/atomeam-stack
May 18, 2026
Merged

feat: add Alpha loop orchestrator with Gemini#40
atomeam merged 1 commit into
mainfrom
feature/atomeam-stack

Conversation

@atomeam

@atomeam atomeam commented May 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Added Alpha loop orchestrator with Gemini API calls
  • Endpoints: POST /api/run/observer, /api/run/evaluator, /api/run/proposer, /api/run/curator
  • Full loop: POST /api/run/alpha-loop
  • Reads homebase-logs.jsonl via GET /api/logs
  • Logs all steps to local file

To test

# With API key
GEMINI_API_KEY=your_key npm run dev

# Without - uses mock
npm run dev

Click Alpha buttons to run steps.

@atomeam can click here to continue refining the PR

Summary by CodeRabbit

Release Notes

  • New Features
    • Added Alpha loop: a multi-step LLM-driven workflow for intelligent analysis and evaluation.
    • Introduced new API endpoints to execute individual loop steps or run the complete sequence.
    • Enhanced logs endpoint to display execution history and results.
    • Integrated Google Gemini API with fallback support for processing.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR introduces an end-to-end "Alpha loop" feature that orchestrates four sequential LLM-driven steps (Observer, Evaluator, Proposer, Curator) using the Google Gemini API. It adds a new orchestrator module that manages step execution, prompt assembly, and logging, and integrates it into the server with new HTTP endpoints for running individual steps or the full pipeline, plus local JSONL log persistence and retrieval.

Changes

Alpha Loop Feature

Layer / File(s) Summary
Alpha Loop Module - Setup & Logging
unified-app/alpha-loop-orchestrator.js
Module imports, step PROMPTS templates, environment config (GEMINI_API_KEY, LOG_FILE paths), and a log() helper that appends timestamped JSON records to the log file.
Gemini API & Step Execution
unified-app/alpha-loop-orchestrator.js
callGemini() invokes the Gemini generateContent endpoint (or returns mock output when the API key is absent); runStep() assembles step prompts, logs progress, calls Gemini, and returns normalized results.
Alpha Loop Orchestration & Exports
unified-app/alpha-loop-orchestrator.js
runAlphaLoop() orchestrates the four steps sequentially (Observer → Evaluator → Proposer → Curator), passes outputs between steps, collects results, and short-circuits on mock responses; module exports both runAlphaLoop and runStep.
Server Integration - Configuration, Endpoints & Logging
unified-app/server.js
Adds filesystem and child_process imports; configures GEMINI_KEY and LOG_FILE paths; implements callGemini and logToFile helpers; adds GET /api/logs (reads JSONL entries), POST /api/run/:step (runs individual step), and POST /api/run/alpha-loop (runs full sequence with logging).

Sequence Diagram

sequenceDiagram
  participant Client
  participant Server
  participant AlphaLoopOrch
  participant GeminiAPI
  participant LogFile
  Client->>Server: POST /api/run/alpha-loop
  Server->>AlphaLoopOrch: Call runAlphaLoop()
  loop Four Steps (Observer→Evaluator→Proposer→Curator)
    AlphaLoopOrch->>AlphaLoopOrch: runStep(step, input)
    AlphaLoopOrch->>GeminiAPI: callGemini(prompt)
    GeminiAPI-->>AlphaLoopOrch: LLM output or mock
    AlphaLoopOrch->>LogFile: logToFile(entry)
  end
  AlphaLoopOrch-->>Server: Return results array
  Server->>LogFile: Optional logging of final status
  Server-->>Client: JSON { results, outputs }
  Client->>Server: GET /api/logs
  Server->>LogFile: Read last 50 lines
  Server-->>Client: JSON { entries, count, file }
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly Related PRs

Poem

🐰 Four steps dancing in the LLM night,
Observer watching, Evaluator sets it right,
Proposer suggests while Curator agrees—
A loop of prompts flowing through Gemini's breeze,
Logged to JSONL, the loop finds its light! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add Alpha loop orchestrator with Gemini' directly and accurately summarizes the main changes—adding a new Alpha loop orchestrator module that integrates Gemini API calls, along with supporting server endpoints.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/atomeam-stack

Comment @coderabbitai help to get the list of available commands and usage tips.

@atomeam
atomeam merged commit c856b7b into main May 18, 2026
1 of 2 checks passed
@atomeam
atomeam deleted the feature/atomeam-stack branch May 18, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant