Skip to content

test: add deep coverage for orchestration modules - #689

Merged
rafaelscosta merged 3 commits into
mainfrom
devops/pr-468-orchestration-coverage-current-20260507
May 8, 2026
Merged

test: add deep coverage for orchestration modules#689
rafaelscosta merged 3 commits into
mainfrom
devops/pr-468-orchestration-coverage-current-20260507

Conversation

@rafaelscosta

@rafaelscosta rafaelscosta commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Port test: add deep coverage for orchestration modules (P2 priority) #468 orchestration coverage onto current main in SynkraAI/aiox-core.
  • Add deeper GateEvaluator coverage for config loading, verdict edge cases, scoring, logging, and MasterOrchestrator integration.
  • Add BobOrchestrator coverage for routing, educational mode, session edge cases, handlers, and constructor dependencies.
  • Replace stale .aios-core temp fixture paths with .aiox-core.

Validation

  • npm test -- tests/core/gate-evaluator.test.js tests/core/orchestration/bob-orchestrator.test.js --runInBand --forceExit
  • npm run lint (passes with the existing 114 warnings, 0 errors)
  • npm run typecheck
  • git diff --check origin/main...HEAD && git diff --check

Supersedes #468.

Summary by CodeRabbit

  • Tests
    • Expanded test coverage for evaluation and orchestration flows, adding deep edge-case, error-handling, scoring, logging, and configuration-validation scenarios.
    • Added extensive session, routing, delegation, path-resolution, and constructor/initialization checks to improve robustness of workflow orchestration.

nikolasdehor and others added 2 commits May 7, 2026 22:33
Extends gate-evaluator.test.js with 45 new tests covering:
- _loadConfig() filesystem loading with YAML parsing and fallback
- _getGateKey() and _getDefaultChecks() for all epic transitions
- _determineVerdict() edge cases (allowMinorIssues, severity levels)
- Config-based checks (min_score, require_tests, min_coverage)
- Check-specific edge cases (artifacts, codeChanges, testResults)
- Error handling, logging, and score calculation

Extends bob-orchestrator.test.js with 30 new tests covering:
- _resolveStoryPath() path resolution (active dir, root, normalization)
- handleBrownfieldDecision() delegation
- handleBrownfieldPhaseFailure() delegation
- handlePostDiscoveryChoice() delegation
- handleGreenfieldSurfaceDecision() delegation
- handleGreenfieldPhaseFailure() delegation
- _routeByState() unknown state handling
- _checkExistingSession() elapsed time formatting edge cases
- Constructor initialization of all Story 12.x dependencies

Refs #52
@vercel

vercel Bot commented May 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aiox-core Ready Ready Preview, Comment May 8, 2026 1:42am

Request Review

@github-actions github-actions Bot added area: agents Agent system related area: workflows Workflow system related squad mcp type: test Test coverage and quality area: core Core framework (.aios-core/core/) area: installer Installer and setup (packages/installer/) area: synapse SYNAPSE context engine area: cli CLI tools (bin/, packages/aios-pro-cli/) area: pro Pro features (pro/) area: health-check Health check system area: docs Documentation (docs/) area: devops CI/CD, GitHub Actions (.github/) labels May 8, 2026
@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 398bb3cb-9533-416e-8716-41a450a37a2c

📥 Commits

Reviewing files that changed from the base of the PR and between b9de3cb and 480f803.

📒 Files selected for processing (1)
  • tests/core/orchestration/bob-orchestrator.test.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/core/orchestration/bob-orchestrator.test.js

Walkthrough

Adds 942 lines of new tests expanding GateEvaluator and BobOrchestrator coverage: config loading, verdict logic, check evaluation, error/logging handling, scoring summaries, story path resolution, handler delegation, routing, session edge cases, and constructor initialization.

Changes

GateEvaluator Test Coverage

Layer / File(s) Summary
Existing Test Baseline
tests/core/gate-evaluator.test.js
Preserves existing tests for verdict enums, constructor, evaluate behavior, gate verdicts, result storage, and strict mode handling.
Configuration & Key Methods
tests/core/gate-evaluator.test.js
Tests _loadConfig for custom config precedence, YAML parsing/merge and safe fallback; tests _getGateKey formatting and _getDefaultChecks per epic transition.
Verdict Determination Logic
tests/core/gate-evaluator.test.js
Tests verdict selection based on issue severity, blocking/non-blocking modes, allowMinorIssues flag, and minScore thresholds.
Check Evaluation & Configuration
tests/core/gate-evaluator.test.js
Tests config-driven check generation (min_score, require_tests, min_coverage) and check evaluation across alternate input shapes, skipped/empty inputs, critical error detection, test pass/fail scenarios, and unknown check handling.
Error Handling & Logging
tests/core/gate-evaluator.test.js
Tests error capture when _runGateChecks throws and verification that evaluation logs include timestamp, level, and message fields (including warn-level capture).
Score Calculation & Summary
tests/core/gate-evaluator.test.js
Tests score calculation for fully passing, fully failing, partial, and empty gate scenarios; validates summary correctness for averageScore, allPassed, and zero-count cases.
Integration with MasterOrchestrator
tests/core/gate-evaluator.test.js
Verifies MasterOrchestrator constructs and exposes GateEvaluator, and that strictGates flag reflects strict mode on the evaluator instance.

BobOrchestrator Test Coverage

Layer / File(s) Summary
Story Path Resolution
tests/core/orchestration/bob-orchestrator.test.js
Tests _resolveStoryPath for active directory lookup, root-directory discovery, story ID normalization, and fallback path construction when files do not exist.
Handler Delegation
tests/core/orchestration/bob-orchestrator.test.js
Tests delegation to brownfield and greenfield handlers for user decisions, phase-failure actions, and surface decisions, ensuring correct argument passing and context merging.
Routing & State Handling
tests/core/orchestration/bob-orchestrator.test.js
Tests _routeByState error handling for invalid/unknown states, verifying unknown_state action and error message generation.
Session Management
tests/core/orchestration/bob-orchestrator.test.js
Tests _checkExistingSession for elapsed-time formatting (hours, singular/plural grammar), null session handling, and fallback epic/story/phase strings when fields are missing.
Constructor & Initialization
tests/core/orchestration/bob-orchestrator.test.js
Tests constructor debug option support and initialization of handlers, observability panel, status writer, dashboard emitter, and message formatter.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

type: test, area: core, area: workflows

Suggested reviewers

  • oalanicolas
  • Pedrovaleriolopez
🚥 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 'test: add deep coverage for orchestration modules' accurately summarizes the main change—expanding test coverage for orchestration modules (GateEvaluator and BobOrchestrator) with deep internal and edge-case tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 devops/pr-468-orchestration-coverage-current-20260507

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage Report

Coverage report not available

📈 Full coverage report available in Codecov


Generated by PR Automation (Story 6.1)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/core/orchestration/bob-orchestrator.test.js`:
- Around line 1291-1316: The test for singular "1 hour" uses a 90-minute fixture
(oneHourAgo) which is ambiguous; change the fixture so oneHourAgo is exactly 60
minutes (or exactly one hour) in the past (e.g., subtract 1 hour from now
instead of 90 minutes) so that orchestrator._checkExistingSession's
elapsedString is clearly testing the 1-hour singular boundary; update the setup
that sets oneHourAgo (the oneHourAgo variable in this test) to an unambiguous
one-hour offset and keep the rest of the mocks (sessionState.exists,
loadSessionState, detectCrash, getResumeSummary) unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1bd85152-ef62-4767-b4ee-71d1ce7f373e

📥 Commits

Reviewing files that changed from the base of the PR and between 8a8ea56 and b9de3cb.

📒 Files selected for processing (2)
  • tests/core/gate-evaluator.test.js
  • tests/core/orchestration/bob-orchestrator.test.js

Comment thread tests/core/orchestration/bob-orchestrator.test.js
@rafaelscosta
rafaelscosta merged commit af5fb76 into main May 8, 2026
67 of 71 checks passed
@rafaelscosta
rafaelscosta deleted the devops/pr-468-orchestration-coverage-current-20260507 branch May 8, 2026 01:49
tuanmedeiros pushed a commit to tuanmedeiros/aios-core-synkraay that referenced this pull request Jun 2, 2026
Validated replacement for legacy PR SynkraAI#468. Adds current-main coverage for GateEvaluator and BobOrchestrator, fixes stale .aios-core fixture paths, and clarifies the 1-hour elapsed-time fixture after review.\n\nValidation:\n- npm test -- tests/core/gate-evaluator.test.js tests/core/orchestration/bob-orchestrator.test.js --runInBand --forceExit\n- npm run lint\n- npm run typecheck\n- git diff --check origin/main...HEAD && git diff --check\n- npm test -- --runInBand --forceExit\n- GitHub checks rerun green on PR SynkraAI#689
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: agents Agent system related area: cli CLI tools (bin/, packages/aios-pro-cli/) area: core Core framework (.aios-core/core/) area: devops CI/CD, GitHub Actions (.github/) area: docs Documentation (docs/) area: health-check Health check system area: installer Installer and setup (packages/installer/) area: pro Pro features (pro/) area: synapse SYNAPSE context engine area: workflows Workflow system related mcp squad type: test Test coverage and quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants