Skip to content

test: recover orchestration coverage from PR 426 - #789

Closed
bendogabriel wants to merge 2 commits into
SynkraAI:mainfrom
bendogabriel:recover/pr-426-orchestration-tests
Closed

test: recover orchestration coverage from PR 426#789
bendogabriel wants to merge 2 commits into
SynkraAI:mainfrom
bendogabriel:recover/pr-426-orchestration-tests

Conversation

@bendogabriel

@bendogabriel bendogabriel commented Jun 10, 2026

Copy link
Copy Markdown

Summary

  • Recover the useful orchestration test coverage from closed PR test: add unit tests for orchestration modules #426.
  • Keep the newer context-manager.test.js and tech-stack-detector.test.js versions already present on main instead of overwriting them.
  • Update recovered tests for the current AIOX naming, Windows path handling, and current fail-safe condition behavior.

Validation

  • npm run lint passed
  • npm run typecheck passed
  • Focused recovered-suite validation passed: 16 test files, 818 tests
  • CodeRabbit CLI passed: 0 findings against origin/main

Full test note

npm test was also run, but existing environment-dependent tests failed outside this change:

  • tests/core/terminal-spawner.test.js: missing .aiox-core/scripts/pm.sh under Bash path
  • tests/packages/aiox-install/integration.test.js: uses || true, which fails under Windows cmd
  • packages/installer/tests/unit/pro-setup-machine-id.test.js: Windows MachineGuid lookup failed in this environment

Summary by CodeRabbit

  • Tests
    • Added comprehensive test coverage across core orchestration modules: circuit breaker, agent invocation, checklist runner, CLI commands, condition evaluator, dashboard integration, execution profiles, executor assignment, gate evaluator, parallel executor, recovery handler, skill dispatcher, prompt builder, and surface checker.
    • Strengthened verification of lifecycle flows, validations, error handling, eventing, and integration behaviours.

@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

@bendogabriel is attempting to deploy a commit to the SINKRA - AIOX Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown
Contributor

Welcome to aiox-core! Thanks for your first pull request.

What happens next?

  1. Automated checks will run on your PR
  2. A maintainer will review your changes
  3. Once approved, we'll merge your contribution!

PR Checklist:

Thanks for contributing!

@github-actions github-actions Bot added type: test Test coverage and quality area: docs Documentation (docs/) labels Jun 10, 2026
@coderabbitai

coderabbitai Bot commented Jun 10, 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: e4219cf9-a928-4375-9d93-86f4923e2762

📥 Commits

Reviewing files that changed from the base of the PR and between 562f0eb and 92f7477.

📒 Files selected for processing (3)
  • tests/core/ids/circuit-breaker.test.js
  • tests/core/orchestration/agent-invoker.test.js
  • tests/core/orchestration/skill-dispatcher.test.js
🚧 Files skipped from review as they are similar to previous changes (3)
  • tests/core/orchestration/skill-dispatcher.test.js
  • tests/core/ids/circuit-breaker.test.js
  • tests/core/orchestration/agent-invoker.test.js

Walkthrough

Adds 15 new Jest test suites (~6,187 lines) covering orchestration, execution, validation, recovery, dashboard/CLI, prompt building, surface checking, and circuit breaker behavior; tests only, no production API changes.

Changes

Comprehensive Jest Test Suites for Orchestration & ID Management

Layer / File(s) Summary
ChecklistRunner
tests/core/orchestration/checklist-runner.test.js
Checklist loading/parsing, item normalization, validation execution, run orchestration, and summary aggregation tests.
CLI commands
tests/core/orchestration/cli-commands.test.js
Command exports and handlers: orchestrate, orchestrateStatus, orchestrateStop, orchestrateResume flows with state file I/O and exit-code/error paths.
ConditionEvaluator
tests/core/orchestration/condition-evaluator.test.js
Built-in conditions, logical operators, dot-notation access, QA/phase outputs, and phase applicability APIs.
DashboardIntegration
tests/core/orchestration/dashboard-integration.test.js
Lifecycle start/stop, updateStatus/write errors, buildStatus shape, history/notifications management, status file helpers, and progress delegation.
Execution profile resolver
tests/core/orchestration/execution-profile-resolver.test.js
Profile/context normalization, validation constants, and resolution precedence with policy reasons.
Executor assignment
tests/core/orchestration/executor-assignment.test.js
Story-type detection, executor/quality-gate assignment, assignment validation, and mapping helpers.
GateEvaluator
tests/core/orchestration/gate-evaluator.test.js
Gate config loading, per-epic checks (spec/plan/QA), min-coverage wiring, verdict/scoring logic, helpers, and result/log copy semantics.
ParallelExecutor
tests/core/orchestration/parallel-executor.test.js
Parallel phase execution, concurrency/options, status/duration computation, wait/cancel/clear, concurrency clamping, and summary aggregation.
RecoveryHandler
tests/core/orchestration/recovery-handler.test.js
Error classification, strategy selection, handleEpicFailure lifecycle, execution/escalation flows, suggestion generation, attempt tracking, and logging.
SubagentPromptBuilder
tests/core/orchestration/subagent-prompt-builder.test.js
Agent/task loading, checklist/template extraction from overrides/frontmatter, extension probing, context formatting, and prompt assembly.
SurfaceChecker
tests/core/orchestration/surface-checker.test.js
Criteria loading/validation, condition evaluation operators, message interpolation, shouldSurface logic, and helpers/factories.
CircuitBreaker
tests/core/ids/circuit-breaker.test.js
CircuitBreaker constants, constructor, isAllowed gating, recordSuccess/recordFailure transitions, stats, reset, and full lifecycle tests.
AgentInvoker
tests/core/orchestration/agent-invoker.test.js
SUPPORTED_AGENTS/InvocationStatus, invokeAgent flows, agent/task parsing, transient-error detection, output validation, and invocation audit APIs.
SkillDispatcher
tests/core/orchestration/skill-dispatcher.test.js
Agent→skill mapping, payload assembly, parseSkillOutput variants, logging/formatting, and agent validation helpers.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • SynkraAI/aiox-core#689: Previous expansion of GateEvaluator test coverage with overlapping scenarios for config loading and verdict/score behavior.
  • SynkraAI/aiox-core#673: Related Jest coverage for CircuitBreaker and ConditionEvaluator behaviors and lifecycle timing.

Suggested labels

area: core, area: workflows

Suggested reviewers

  • Pedrovaleriolopez
  • oalanicolas
🚥 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: recover orchestration coverage from PR 426' is concise and clearly summarizes the main change—recovering test coverage for orchestration modules from a previous PR.
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 unit tests (beta)
  • Create PR with unit tests

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.

@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: 10

🧹 Nitpick comments (2)
tests/core/ids/circuit-breaker.test.js (1)

89-89: ⚡ Quick win

Replace hardcoded 61000 with DEFAULT_RESET_TIMEOUT_MS + delta.

These timeout checks are currently tied to a magic number, which makes tests brittle if the default timeout constant changes. Since DEFAULT_RESET_TIMEOUT_MS is already imported, compute from it directly.

Proposed diff
-      breaker._lastFailureTime = Date.now() - 61000;
+      breaker._lastFailureTime = Date.now() - (DEFAULT_RESET_TIMEOUT_MS + 1000);
...
-      breaker._lastFailureTime = Date.now() - 61000;
+      breaker._lastFailureTime = Date.now() - (DEFAULT_RESET_TIMEOUT_MS + 1000);

Also applies to: 229-229

🤖 Prompt for 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.

In `@tests/core/ids/circuit-breaker.test.js` at line 89, Replace the magic number
61000 used to set breaker._lastFailureTime with a value computed from
DEFAULT_RESET_TIMEOUT_MS plus a small delta (e.g., DEFAULT_RESET_TIMEOUT_MS +
1000) so the test remains stable if the default changes; update both occurrences
that set breaker._lastFailureTime (line using breaker._lastFailureTime =
Date.now() - 61000 and the second occurrence around line 229) to compute
Date.now() - (DEFAULT_RESET_TIMEOUT_MS + delta) instead, ensuring
DEFAULT_RESET_TIMEOUT_MS is used directly and the delta is declared clearly in
the test.
tests/core/orchestration/agent-invoker.test.js (1)

18-18: ⚡ Quick win

Consolidated root cause: import-style policy drift across recovered test suites.

All three files use relative requires for core orchestration modules, conflicting with the repository’s absolute-import rule. Applying the project alias/path convention consistently here will keep lint/style contracts aligned and prevent future churn.

🤖 Prompt for 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.

In `@tests/core/orchestration/agent-invoker.test.js` at line 18, The test
currently imports the orchestration module using a relative require
(require('../../../.aiox-core/core/orchestration/agent-invoker')), which
violates the project's absolute-import/alias convention; update the import to
use the repository's absolute alias for the agent-invoker module (e.g.
require('`@aiox-core/core/orchestration/agent-invoker`') or the configured alias
used elsewhere) so the destructured symbols from agent-invoker are loaded via
the canonical path and align with the repo import policy.

Source: Coding guidelines

🤖 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/ids/circuit-breaker.test.js`:
- Line 16: Replace the relative
require('../../../.aiox-core/core/ids/circuit-breaker') in the test with the
project's absolute import form used elsewhere (i.e., swap the require call that
references '../../../.aiox-core/core/ids/circuit-breaker' for the repo's
absolute module path for the same module); update the require/import in
tests/core/ids/circuit-breaker.test.js so it uses the canonical absolute module
identifier for the circuit-breaker module.

In `@tests/core/orchestration/agent-invoker.test.js`:
- Around line 128-135: The test 'returns failure when task not found' currently
allows multiple failure reasons; change the mocks to simulate a successful agent
load but with the task missing: set fs.pathExists.mockResolvedValue(true) (so
the agent file is considered present), mock whatever module-loading used by
invoker.invokeAgent (e.g., the dynamic require/loader or invoker._loadAgent /
invoker.loadAgent stub) to return an agent object that does not contain
'nonexistent-task', then call invoker.invokeAgent('dev','nonexistent-task') and
assert that result.success is false and that result.error or result.message
specifically indicates "task not found" (or the exact missing-task error string
returned by invokeAgent) to ensure you exercise the missing-task branch.

In `@tests/core/orchestration/cli-commands.test.js`:
- Around line 11-20: Replace the relative require imports with absolute module
imports: change the require of
'../../../.aiox-core/core/orchestration/master-orchestrator' to the project's
absolute package/module path that exports MasterOrchestrator, and change the
destructured require for orchestrate, orchestrateStatus, orchestrateStop,
orchestrateResume, and commands from
'../../../.aiox-core/core/orchestration/cli-commands' to its absolute import
path; ensure the imported symbols (MasterOrchestrator, orchestrate,
orchestrateStatus, orchestrateStop, orchestrateResume, commands) remain
unchanged so existing tests reference the same identifiers.

In `@tests/core/orchestration/condition-evaluator.test.js`:
- Line 8: Replace the relative require for the ConditionEvaluator module with
the repository's absolute module alias; find the line importing
ConditionEvaluator in the test and change the path to the absolute package
import (e.g., the '`@aiox-core/core/orchestration/condition-evaluator`' style
alias used by the project), making sure it matches the configured module
resolution/aliases used in the codebase and test runtime so the test imports
resolve without relative traversal.

In `@tests/core/orchestration/dashboard-integration.test.js`:
- Line 21: The test imports DashboardIntegration and NotificationType using a
relative path; update the require to use the project's absolute module
path/alias instead (so the module import for DashboardIntegration and
NotificationType comes from the absolute package name or configured alias for
.aiox-core, e.g. replace the
'../../../.aiox-core/core/orchestration/dashboard-integration' require with the
project's absolute import like
'aiox-core/core/orchestration/dashboard-integration' or the configured alias
'`@aiox-core/core/orchestration/dashboard-integration`') to comply with the
absolute-import guideline.

In `@tests/core/orchestration/execution-profile-resolver.test.js`:
- Around line 8-15: The test file imports execution-profile-resolver with a
relative path; replace that require with an absolute module import of the
package that exports VALID_PROFILES, VALID_CONTEXTS, PROFILE_POLICIES,
normalizeProfile, normalizeContext, and resolveExecutionProfile (keep the same
symbols) so the line requiring
'../../../.aiox-core/core/orchestration/execution-profile-resolver' becomes an
absolute require/import of the package's module name (preserving the exact
exported identifiers) and run the tests to verify resolution.

In `@tests/core/orchestration/executor-assignment.test.js`:
- Around line 8-18: The require call using a relative path for the module that
exports detectStoryType, assignExecutor, assignExecutorFromContent,
validateExecutorAssignment, getStoryTypes, getStoryTypeConfig,
getExecutorWorkTypes, EXECUTOR_ASSIGNMENT_TABLE, and DEFAULT_ASSIGNMENT should
be replaced with an absolute import; update the require(...) to use the absolute
package/module path that exposes the same exports (e.g., the project-level
module name or alias that maps to
.aiox-core/core/orchestration/executor-assignment) so tests import those symbols
via an absolute path instead of '../../../.aiox-core/...'.

In `@tests/core/orchestration/parallel-executor.test.js`:
- Line 14: The test uses a relative require for ParallelExecutor; replace the
relative path
require('../../../.aiox-core/core/orchestration/parallel-executor') with an
absolute import per project guidelines (e.g.,
require('aiox-core/core/orchestration/parallel-executor') or the project's
configured package alias) so the test imports the ParallelExecutor module via
its absolute module name; update the require in
tests/core/orchestration/parallel-executor.test.js where ParallelExecutor is
referenced.

In `@tests/core/orchestration/recovery-handler.test.js`:
- Around line 12-16: Replace the relative require of the recovery-handler module
with an absolute import as per guidelines: update the require that currently
pulls '../../../.aiox-core/core/orchestration/recovery-handler' so the test
imports RecoveryHandler, RecoveryStrategy, and RecoveryResult via the project’s
absolute module path instead of a relative path; locate the line importing these
symbols in tests/core/orchestration/recovery-handler.test.js and change it to
use the repository’s configured absolute import root (keeping the same exported
symbols RecoveryHandler, RecoveryStrategy, RecoveryResult).

In `@tests/core/orchestration/skill-dispatcher.test.js`:
- Line 365: Replace the incorrect "AIOS" prefix in the test fixtures' skill
string literals with "AIOX": find the occurrences of the skill property value
"AIOS:agents:architect" (and the other three similar "AIOS:..." entries) in
tests/core/orchestration/skill-dispatcher.test.js and update them to
"AIOX:agents:architect" so the assertions use the correct AIOX prefix.

---

Nitpick comments:
In `@tests/core/ids/circuit-breaker.test.js`:
- Line 89: Replace the magic number 61000 used to set breaker._lastFailureTime
with a value computed from DEFAULT_RESET_TIMEOUT_MS plus a small delta (e.g.,
DEFAULT_RESET_TIMEOUT_MS + 1000) so the test remains stable if the default
changes; update both occurrences that set breaker._lastFailureTime (line using
breaker._lastFailureTime = Date.now() - 61000 and the second occurrence around
line 229) to compute Date.now() - (DEFAULT_RESET_TIMEOUT_MS + delta) instead,
ensuring DEFAULT_RESET_TIMEOUT_MS is used directly and the delta is declared
clearly in the test.

In `@tests/core/orchestration/agent-invoker.test.js`:
- Line 18: The test currently imports the orchestration module using a relative
require (require('../../../.aiox-core/core/orchestration/agent-invoker')), which
violates the project's absolute-import/alias convention; update the import to
use the repository's absolute alias for the agent-invoker module (e.g.
require('`@aiox-core/core/orchestration/agent-invoker`') or the configured alias
used elsewhere) so the destructured symbols from agent-invoker are loaded via
the canonical path and align with the repo import policy.
🪄 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: e022fa30-f8ee-443a-9b08-8c880dca2c7a

📥 Commits

Reviewing files that changed from the base of the PR and between 77265d5 and 562f0eb.

📒 Files selected for processing (14)
  • tests/core/ids/circuit-breaker.test.js
  • tests/core/orchestration/agent-invoker.test.js
  • tests/core/orchestration/checklist-runner.test.js
  • tests/core/orchestration/cli-commands.test.js
  • tests/core/orchestration/condition-evaluator.test.js
  • tests/core/orchestration/dashboard-integration.test.js
  • tests/core/orchestration/execution-profile-resolver.test.js
  • tests/core/orchestration/executor-assignment.test.js
  • tests/core/orchestration/gate-evaluator.test.js
  • tests/core/orchestration/parallel-executor.test.js
  • tests/core/orchestration/recovery-handler.test.js
  • tests/core/orchestration/skill-dispatcher.test.js
  • tests/core/orchestration/subagent-prompt-builder.test.js
  • tests/core/orchestration/surface-checker.test.js

DEFAULT_FAILURE_THRESHOLD,
DEFAULT_SUCCESS_THRESHOLD,
DEFAULT_RESET_TIMEOUT_MS,
} = require('../../../.aiox-core/core/ids/circuit-breaker');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Use an absolute import path instead of a relative traversal.

Line 16 uses a relative import (../../../...), which violates the repo rule requiring absolute imports for JS/TS-family files. Please switch this to the project’s absolute import form used in this codebase.

As per coding guidelines, "**/*.{js,jsx,ts,tsx}: Use absolute imports instead of relative imports in all code".

🤖 Prompt for 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.

In `@tests/core/ids/circuit-breaker.test.js` at line 16, Replace the relative
require('../../../.aiox-core/core/ids/circuit-breaker') in the test with the
project's absolute import form used elsewhere (i.e., swap the require call that
references '../../../.aiox-core/core/ids/circuit-breaker' for the repo's
absolute module path for the same module); update the require/import in
tests/core/ids/circuit-breaker.test.js so it uses the canonical absolute module
identifier for the circuit-breaker module.

Source: Coding guidelines

Comment thread tests/core/orchestration/agent-invoker.test.js
Comment on lines +11 to +20
const fs = require('fs-extra');
const MasterOrchestrator = require('../../../.aiox-core/core/orchestration/master-orchestrator');

const {
orchestrate,
orchestrateStatus,
orchestrateStop,
orchestrateResume,
commands,
} = require('../../../.aiox-core/core/orchestration/cli-commands');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use absolute imports instead of relative paths.

Both require statements use relative paths ('fs-extra' is fine, but '../../../.aiox-core/...' should be absolute). According to the coding guidelines, all JavaScript files must use absolute imports rather than relative paths.

As per coding guidelines: "Use absolute imports instead of relative imports in all code" for **/*.{js,jsx,ts,tsx}.

🤖 Prompt for 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.

In `@tests/core/orchestration/cli-commands.test.js` around lines 11 - 20, Replace
the relative require imports with absolute module imports: change the require of
'../../../.aiox-core/core/orchestration/master-orchestrator' to the project's
absolute package/module path that exports MasterOrchestrator, and change the
destructured require for orchestrate, orchestrateStatus, orchestrateStop,
orchestrateResume, and commands from
'../../../.aiox-core/core/orchestration/cli-commands' to its absolute import
path; ensure the imported symbols (MasterOrchestrator, orchestrate,
orchestrateStatus, orchestrateStop, orchestrateResume, commands) remain
unchanged so existing tests reference the same identifiers.

Source: Coding guidelines

* based on detected tech stack profile.
*/

const ConditionEvaluator = require('../../../.aiox-core/core/orchestration/condition-evaluator');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use absolute imports instead of relative paths.

The require statement uses a relative path '../../../.aiox-core/...'. According to the coding guidelines, all JavaScript files should use absolute imports.

As per coding guidelines: "Use absolute imports instead of relative imports in all code" for **/*.{js,jsx,ts,tsx}.

🤖 Prompt for 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.

In `@tests/core/orchestration/condition-evaluator.test.js` at line 8, Replace the
relative require for the ConditionEvaluator module with the repository's
absolute module alias; find the line importing ConditionEvaluator in the test
and change the path to the absolute package import (e.g., the
'`@aiox-core/core/orchestration/condition-evaluator`' style alias used by the
project), making sure it matches the configured module resolution/aliases used
in the codebase and test runtime so the test imports resolve without relative
traversal.

Source: Coding guidelines

}));

const fs = require('fs-extra');
const { DashboardIntegration, NotificationType } = require('../../../.aiox-core/core/orchestration/dashboard-integration');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use absolute imports instead of relative paths.

The require statement uses a relative path '../../../.aiox-core/...'. The coding guidelines require absolute imports for all JavaScript files.

As per coding guidelines: "Use absolute imports instead of relative imports in all code" for **/*.{js,jsx,ts,tsx}.

🤖 Prompt for 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.

In `@tests/core/orchestration/dashboard-integration.test.js` at line 21, The test
imports DashboardIntegration and NotificationType using a relative path; update
the require to use the project's absolute module path/alias instead (so the
module import for DashboardIntegration and NotificationType comes from the
absolute package name or configured alias for .aiox-core, e.g. replace the
'../../../.aiox-core/core/orchestration/dashboard-integration' require with the
project's absolute import like
'aiox-core/core/orchestration/dashboard-integration' or the configured alias
'`@aiox-core/core/orchestration/dashboard-integration`') to comply with the
absolute-import guideline.

Source: Coding guidelines

Comment on lines +8 to +15
const {
VALID_PROFILES,
VALID_CONTEXTS,
PROFILE_POLICIES,
normalizeProfile,
normalizeContext,
resolveExecutionProfile,
} = require('../../../.aiox-core/core/orchestration/execution-profile-resolver');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use absolute imports instead of relative paths.

The coding guidelines require absolute imports for all JavaScript files. Replace the relative path '../../../.aiox-core/...' with an absolute import.

As per coding guidelines: "Use absolute imports instead of relative imports in all code" for **/*.{js,jsx,ts,tsx}.

🤖 Prompt for 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.

In `@tests/core/orchestration/execution-profile-resolver.test.js` around lines 8 -
15, The test file imports execution-profile-resolver with a relative path;
replace that require with an absolute module import of the package that exports
VALID_PROFILES, VALID_CONTEXTS, PROFILE_POLICIES, normalizeProfile,
normalizeContext, and resolveExecutionProfile (keep the same symbols) so the
line requiring
'../../../.aiox-core/core/orchestration/execution-profile-resolver' becomes an
absolute require/import of the package's module name (preserving the exact
exported identifiers) and run the tests to verify resolution.

Source: Coding guidelines

Comment on lines +8 to +18
const {
detectStoryType,
assignExecutor,
assignExecutorFromContent,
validateExecutorAssignment,
getStoryTypes,
getStoryTypeConfig,
getExecutorWorkTypes,
EXECUTOR_ASSIGNMENT_TABLE,
DEFAULT_ASSIGNMENT,
} = require('../../../.aiox-core/core/orchestration/executor-assignment');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use absolute imports instead of relative paths.

The coding guidelines mandate that all JavaScript files use absolute imports rather than relative imports. This require statement uses a relative path '../../../.aiox-core/...' which should be replaced with an absolute import path.

As per coding guidelines: "Use absolute imports instead of relative imports in all code" for **/*.{js,jsx,ts,tsx}.

🤖 Prompt for 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.

In `@tests/core/orchestration/executor-assignment.test.js` around lines 8 - 18,
The require call using a relative path for the module that exports
detectStoryType, assignExecutor, assignExecutorFromContent,
validateExecutorAssignment, getStoryTypes, getStoryTypeConfig,
getExecutorWorkTypes, EXECUTOR_ASSIGNMENT_TABLE, and DEFAULT_ASSIGNMENT should
be replaced with an absolute import; update the require(...) to use the absolute
package/module path that exposes the same exports (e.g., the project-level
module name or alias that maps to
.aiox-core/core/orchestration/executor-assignment) so tests import those symbols
via an absolute path instead of '../../../.aiox-core/...'.

Source: Coding guidelines

gray: (s) => s,
}));

const ParallelExecutor = require('../../../.aiox-core/core/orchestration/parallel-executor');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use absolute imports instead of relative paths.

The require statement on line 14 uses a relative path. The coding guidelines mandate absolute imports for all JavaScript files.

As per coding guidelines: "Use absolute imports instead of relative imports in all code" for **/*.{js,jsx,ts,tsx}.

🤖 Prompt for 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.

In `@tests/core/orchestration/parallel-executor.test.js` at line 14, The test uses
a relative require for ParallelExecutor; replace the relative path
require('../../../.aiox-core/core/orchestration/parallel-executor') with an
absolute import per project guidelines (e.g.,
require('aiox-core/core/orchestration/parallel-executor') or the project's
configured package alias) so the test imports the ParallelExecutor module via
its absolute module name; update the require in
tests/core/orchestration/parallel-executor.test.js where ParallelExecutor is
referenced.

Source: Coding guidelines

Comment on lines +12 to +16
const {
RecoveryHandler,
RecoveryStrategy,
RecoveryResult,
} = require('../../../.aiox-core/core/orchestration/recovery-handler');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use absolute imports instead of relative paths.

The require statement uses a relative path '../../../.aiox-core/...'. Replace with an absolute import as required by the coding guidelines.

As per coding guidelines: "Use absolute imports instead of relative imports in all code" for **/*.{js,jsx,ts,tsx}.

🤖 Prompt for 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.

In `@tests/core/orchestration/recovery-handler.test.js` around lines 12 - 16,
Replace the relative require of the recovery-handler module with an absolute
import as per guidelines: update the require that currently pulls
'../../../.aiox-core/core/orchestration/recovery-handler' so the test imports
RecoveryHandler, RecoveryStrategy, and RecoveryResult via the project’s absolute
module path instead of a relative path; locate the line importing these symbols
in tests/core/orchestration/recovery-handler.test.js and change it to use the
repository’s configured absolute import root (keeping the same exported symbols
RecoveryHandler, RecoveryStrategy, RecoveryResult).

Source: Coding guidelines

Comment thread tests/core/orchestration/skill-dispatcher.test.js Outdated
@bendogabriel

Copy link
Copy Markdown
Author

Addressed the valid CodeRabbit findings in commit 92f7477:

  • Replaced hardcoded reset timeout values with DEFAULT_RESET_TIMEOUT_MS + RESET_TIMEOUT_DELTA_MS.
  • Tightened the missing-task test so it exercises the task-not-found branch specifically.
  • Updated remaining AIOS: skill fixture strings to AIOX:.

Validation rerun locally:

  • npm run lint passed
  • npm run typecheck passed
  • Focused recovered suite passed: 16 files, 818 tests

I intentionally did not convert the relative .aiox-core imports to aliases in this PR. The current test suite already uses this relative import pattern broadly for core modules, and changing only these recovered files would introduce inconsistency rather than align with an enforced local convention.

@bendogabriel

Copy link
Copy Markdown
Author

Closing: this recovery PR was opened against the upstream org repo by mistake. We are focusing on the personal repository instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Documentation (docs/) type: test Test coverage and quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant