Skip to content

chore: auditoria de lifecycle — depreca scripts legados (#90)#592

Open
nikolasdehor wants to merge 1 commit intoSynkraAI:mainfrom
nikolasdehor:chore/deprecate-legacy-scripts
Open

chore: auditoria de lifecycle — depreca scripts legados (#90)#592
nikolasdehor wants to merge 1 commit intoSynkraAI:mainfrom
nikolasdehor:chore/deprecate-legacy-scripts

Conversation

@nikolasdehor
Copy link
Contributor

@nikolasdehor nikolasdehor commented Mar 12, 2026

Summary

  • Audits 9 legacy scripts superseded by Epic 11/12 modules and Task V2.0 migration
  • Adds @deprecated JSDoc headers and console.warn runtime warnings to each script
  • No scripts deleted — all marked for backward compatibility
  • Creates documentation for deprecated scripts and orchestrator hierarchy

Scripts Deprecated

Script Replacement
workflow-state-manager.js session-state.js (Story 11.5)
workflow-navigator.js bob-orchestrator.js (Story 12.3)
command-execution-hook.js session-state.js (Story 11.5)
session-context-loader.js core/session/context-loader (WIS-3)
batch-migrate-phase{1,2,3}.ps1 N/A (migration completed)
validate-phase1.ps1 validate-task-v2.js directly
migrate-framework-docs.sh N/A (migration completed)

Documentation Added

  • docs/deprecated-scripts.md — complete list with replacements and migration paths
  • .aiox-core/core/docs/orchestration-hierarchy.md — documents the 3 orchestrators (Bob, Master, Workflow) coexistence without conflict

Test plan

  • Verify console.warn messages appear when deprecated scripts are loaded
  • Verify no existing imports are broken (scripts still export the same API)
  • Verify orchestration hierarchy documentation matches current architecture

Closes #90

Summary by CodeRabbit

Release Notes

  • Documentation

    • Added comprehensive documentation detailing the orchestration architecture and hierarchy, including responsibilities and relationships between orchestration layers.
    • Added guide for deprecated scripts with migration paths to their recommended successors.
  • Chores

    • Added deprecation notices to legacy modules and scripts, with clear guidance on recommended alternatives for future use.

…eprecated

Audita 9 scripts legados superseded por modulos Epic 11/12 e migracao
de tasks V2.0. Adiciona @deprecated JSDoc headers e console.warn em
runtime para cada script, sem remover nenhum (backward compatibility).

Scripts deprecados:
- workflow-state-manager.js → session-state.js (Story 11.5)
- workflow-navigator.js → bob-orchestrator.js (Story 12.3)
- command-execution-hook.js → session-state.js (Story 11.5)
- session-context-loader.js → core/session/context-loader (WIS-3)
- batch-migrate-phase{1,2,3}.ps1 (migracao V2.0 concluida)
- validate-phase1.ps1 (validacao one-time concluida)
- migrate-framework-docs.sh (migracao de docs concluida)

Documentacao:
- docs/deprecated-scripts.md — lista completa com substitutos
- .aiox-core/core/docs/orchestration-hierarchy.md — hierarquia dos
  3 orquestradores (Bob, Master, Workflow) sem conflito

Closes SynkraAI#90
@vercel
Copy link

vercel bot commented Mar 12, 2026

@nikolasdehor is attempting to deploy a commit to the Pedro Valério Lopez's projects Team on Vercel.

A member of the Team first needs to authorize it.

@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 Mar 12, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

Walkthrough

This pull request introduces deprecation notices across legacy orchestration and migration scripts with runtime warnings, adds comprehensive documentation for orchestrator hierarchy, and updates manifest metadata. No functional logic is altered—only deprecation messaging and documentation are added.

Changes

Cohort / File(s) Summary
Documentation
.aiox-core/core/docs/orchestration-hierarchy.md, docs/deprecated-scripts.md
Added two new documentation files: orchestration-hierarchy details the three-tier orchestrator system (Master, Bob, Workflow) with responsibilities and integration points; deprecated-scripts catalogues 9 deprecated modules and their replacements.
JavaScript Deprecation Notices
.aiox-core/development/scripts/workflow-navigator.js, .aiox-core/development/scripts/workflow-state-manager.js, .aiox-core/scripts/command-execution-hook.js, .aiox-core/scripts/session-context-loader.js
Added runtime deprecation warnings via console.warn() with migration guidance to replacement modules (bob-orchestrator.js, session-state.js). No logic changes.
PowerShell Migration Script Deprecations
.aiox-core/scripts/batch-migrate-phase1.ps1, .aiox-core/scripts/batch-migrate-phase2.ps1, .aiox-core/scripts/batch-migrate-phase3.ps1, .aiox-core/scripts/validate-phase1.ps1
Added deprecation header comments and Write-Warning statements indicating migration completion and directing users to replacement modules. Core migration logic unchanged.
Bash Script Deprecation
.aiox-core/scripts/migrate-framework-docs.sh
Added deprecation annotations and stdout deprecation message indicating migration is complete with docs relocated.
Manifest Update
.aiox-core/install-manifest.yaml
Incremented file_count to 1091, updated generated_at timestamp, added new documentation entry, and refreshed hashes for modified files.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

area: core, area: docs, area: workflows, area: devops

Suggested reviewers

  • 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 accurately describes the main change: marking legacy scripts as deprecated through an audit lifecycle process.
Linked Issues check ✅ Passed All objectives from issue #90 are fulfilled: legacy scripts are audited and marked deprecated with replacements, orchestration hierarchy is documented, and no import conflicts remain.
Out of Scope Changes check ✅ Passed All changes directly support the issue #90 objectives: deprecation notices, documentation, and manifest updates are all in-scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.aiox-core/scripts/command-execution-hook.js 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.aiox-core/install-manifest.yaml (1)

1-13: ⚠️ Potential issue | 🟠 Major

Avoid manual edits to auto-generated manifest file.

The manifest explicitly states "DO NOT EDIT MANUALLY — regenerate with: npm run generate:manifest" on line 3, yet lines 11 and 13 contain manual updates (generated_at and file_count). While the file count is currently correct (1091 entries verified), manual editing creates maintenance risks:

  • The validator checks only the files array and hashes, not metadata fields
  • Future manual edits could silently diverge from actual state without detection
  • The generated_at timestamp should reflect actual generation time, not manual updates

Regenerate the manifest using the official script instead of editing values directly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.aiox-core/install-manifest.yaml around lines 1 - 13, The manifest file
contains manual edits to metadata fields despite the header warning ("DO NOT
EDIT MANUALLY")—specifically the generated_at and file_count entries—so
regenerate the manifest using the official generator
(scripts/generate-install-manifest.js / npm run generate:manifest) instead of
editing .aiox-core/install-manifest.yaml by hand; run the generator to produce a
fresh file where generated_at and file_count are computed automatically and
commit that output, removing any manual timestamp or count changes.
🧹 Nitpick comments (5)
.aiox-core/scripts/command-execution-hook.js (1)

26-26: Avoid the deprecation side effect on require().

This file is documented as a library entrypoint on Lines 19-21, so the top-level console.warn() will now fire for every import, even when a caller is just loading updateSessionAfterCommand(). Please move the warning behind first use and emit it once.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.aiox-core/scripts/command-execution-hook.js at line 26, The top-level
console.warn in command-execution-hook.js causes a deprecation message on every
require; move the warning into the first-use path (e.g., inside
updateSessionAfterCommand() or the initializer that callers invoke) and guard it
with a module-scoped boolean so it logs only once; ensure
updateSessionAfterCommand() (or the exported entrypoint) triggers the lazy
warning before performing work so mere imports no longer print the deprecation.
.aiox-core/development/scripts/workflow-navigator.js (1)

24-24: Avoid emitting the deprecation warning at import time.

tests/core/workflow-navigator-integration.test.js, Lines 18 and 78-100, import this module directly, so the top-level console.warn() now fires on every load and pollutes stderr even when the class is only being required. Prefer warning once on first actual use/constructor invocation instead of during module evaluation.

Possible adjustment
-console.warn('[DEPRECATED] workflow-navigator.js — workflow routing now handled by bob-orchestrator.js (Story 12.3) and session-state.js (Story 11.5)');
+let didWarnDeprecation = false;
+
+function warnDeprecatedOnce() {
+  if (didWarnDeprecation) return;
+  didWarnDeprecation = true;
+  process.emitWarning(
+    'workflow-navigator.js is deprecated; use bob-orchestrator.js and session-state.js instead.',
+    { type: 'DeprecationWarning', code: 'AIOX_WORKFLOW_NAVIGATOR_DEPRECATED' },
+  );
+}
 
 class WorkflowNavigator {
   constructor() {
+    warnDeprecatedOnce();
     this.patterns = this._loadPatterns();
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.aiox-core/development/scripts/workflow-navigator.js at line 24, Remove the
top-level console.warn so the deprecation message is not emitted on import;
instead add a module-scoped flag (e.g., let warned = false) and emit the same
console.warn the first time the WorkflowNavigator is actually used—for example,
check the flag and log inside the WorkflowNavigator constructor (or the exported
initialization method), set warned = true after logging, and keep the original
deprecation text. This ensures the message fires only on first real use rather
than on module evaluation.
.aiox-core/development/scripts/workflow-state-manager.js (1)

23-23: Avoid warning on every import of the module.

tests/unit/workflow-state-manager.test.js, Lines 7-9, require this file at module scope, so the new top-level console.warn() will emit on every test run and any other passive import. Please move the deprecation warning behind first real use and emit it once.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.aiox-core/development/scripts/workflow-state-manager.js at line 23, Remove
the top-level console.warn('[DEPRECATED] ...') and replace it with a
module-scoped boolean flag (e.g., let deprecationWarned = false) and a small
helper function (e.g., emitDeprecation()) that logs the same warning only if
deprecationWarned is false and then sets it to true; then call emitDeprecation()
at the start of the module's exported entry points / real-use functions (i.e.,
wherever the module's public API is invoked) so the warning is emitted lazily on
first real use and only once instead of on every import.
.aiox-core/core/docs/orchestration-hierarchy.md (2)

10-24: Add language specification to fenced code blocks.

The ASCII art diagram lacks a language specification. While this is minor, adding text or plain improves markdown rendering and addresses the markdownlint warning.

📝 Suggested improvement
-```
+```text
 MasterOrchestrator (Epic 0)
   |-- Ativacao de agentes, roteamento de comandos
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.aiox-core/core/docs/orchestration-hierarchy.md around lines 10 - 24, The
fenced ASCII diagram lacks a language tag; update the code fence surrounding the
orchestrator diagram to include a language like "text" or "plain" (e.g., change
``` to ```text) so Markdown renderers/linters recognize it as plain text; modify
the block that contains MasterOrchestrator, BobOrchestrator, and
WorkflowOrchestrator accordingly to eliminate the markdownlint warning.

97-112: Add language specification to relationship diagram.

Similar to the hierarchy diagram, this flow diagram would benefit from a language specification for better rendering.

📝 Suggested improvement
-```
+```text
 Requisicao do usuario
   |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.aiox-core/core/docs/orchestration-hierarchy.md around lines 97 - 112, The
fenced diagram block showing "Requisicao do usuario" -> "MasterOrchestrator"
etc. lacks a language tag; update the markdown fenced code block from plain ```
to a language-specified fence (e.g., ```text) so the flow diagram renders
consistently, i.e., locate the block containing "Requisicao do usuario",
"MasterOrchestrator", "BobOrchestrator", and "WorkflowExecutor" and change its
opening fence to include the language specifier.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.aiox-core/scripts/batch-migrate-phase1.ps1:
- Around line 1-4: Add a guard that prevents the deprecated
batch-migrate-phase1.ps1 from performing any rewrites unless an explicit force
flag is provided: add a param for a [switch]$Force (or check for a -Force/$force
parameter) at the top, update the existing Write-Warning to state the script is
deprecated and requires --Force to proceed, and immediately return/exit when
-Force is not present so the phase-1 rewrite loop below never runs by default;
only continue to the rewrite logic when $Force is set.

In @.aiox-core/scripts/batch-migrate-phase2.ps1:
- Around line 1-4: Add an opt-in guard to the batch-migrate-phase2.ps1
entrypoint: define a switch parameter (e.g. -Force or -RunDeprecatedScript) at
the top via a Param() block and, before the existing migration loop, check if
the switch is present; if not, emit the deprecation Write-Warning and
exit/return immediately so the rest of the script (the migration loop that
rewrites tasks) does not run. Ensure the check is placed before any
file-modifying logic and reference the script name batch-migrate-phase2.ps1 and
the migration loop block when making the change.

In @.aiox-core/scripts/migrate-framework-docs.sh:
- Line 22: Modify migrate-framework-docs.sh to stop execution immediately after
printing the deprecation banner unless the user passed an explicit opt-in flag;
check positional/parsed args for a --force-legacy-run (or similar) flag and only
proceed with the existing migration flow when that flag is present, otherwise
call exit 0 right after the echo "[DEPRECATED] ..." line to prevent any further
actions; update any help/usage text to document the --force-legacy-run opt-in
and reference the script name migrate-framework-docs.sh in your changes so
reviewers can find the guard easily.

In @.aiox-core/scripts/session-context-loader.js:
- Line 18: The deprecation warning string in session-context-loader.js contains
an invalid require path; update the console.warn call that currently references
"require('.aiox-core/core/session/context-loader')" to use the correct Node.js
relative import "require('../core/session/context-loader')" so the message
matches the actual import used on line 21 and avoids a MODULE_NOT_FOUND error.

In @.aiox-core/scripts/validate-phase1.ps1:
- Around line 2-3: The deprecation warning in validate-phase1.ps1 points to the
wrong replacement; update the warning text to reference the actual replacement
script name validate-task-v2.js in its correct location and make the message
unambiguous, and also correct the stale invocation elsewhere in the same
validate-phase1.ps1 file (the existing call to the old path) so both the warning
and the invocation consistently point to the new validate-task-v2.js entrypoint.
- Line 3: The Write-Warning string in validate-phase1.ps1 contains a non-ASCII
em-dash ("Write-Warning \"[DEPRECATED] validate-phase1.ps1 — Phase 1 migration
already validated. Use validate-task-v2.js directly.\"") which triggers
PSUseBOMForUnicodeEncodedFile; fix by either saving validate-phase1.ps1 as UTF-8
with BOM so the em-dash is encoded correctly, or replace/remove the em-dash
(e.g., use a plain hyphen or remove it) in the Write-Warning message to keep the
file ASCII-only.

---

Outside diff comments:
In @.aiox-core/install-manifest.yaml:
- Around line 1-13: The manifest file contains manual edits to metadata fields
despite the header warning ("DO NOT EDIT MANUALLY")—specifically the
generated_at and file_count entries—so regenerate the manifest using the
official generator (scripts/generate-install-manifest.js / npm run
generate:manifest) instead of editing .aiox-core/install-manifest.yaml by hand;
run the generator to produce a fresh file where generated_at and file_count are
computed automatically and commit that output, removing any manual timestamp or
count changes.

---

Nitpick comments:
In @.aiox-core/core/docs/orchestration-hierarchy.md:
- Around line 10-24: The fenced ASCII diagram lacks a language tag; update the
code fence surrounding the orchestrator diagram to include a language like
"text" or "plain" (e.g., change ``` to ```text) so Markdown renderers/linters
recognize it as plain text; modify the block that contains MasterOrchestrator,
BobOrchestrator, and WorkflowOrchestrator accordingly to eliminate the
markdownlint warning.
- Around line 97-112: The fenced diagram block showing "Requisicao do usuario"
-> "MasterOrchestrator" etc. lacks a language tag; update the markdown fenced
code block from plain ``` to a language-specified fence (e.g., ```text) so the
flow diagram renders consistently, i.e., locate the block containing "Requisicao
do usuario", "MasterOrchestrator", "BobOrchestrator", and "WorkflowExecutor" and
change its opening fence to include the language specifier.

In @.aiox-core/development/scripts/workflow-navigator.js:
- Line 24: Remove the top-level console.warn so the deprecation message is not
emitted on import; instead add a module-scoped flag (e.g., let warned = false)
and emit the same console.warn the first time the WorkflowNavigator is actually
used—for example, check the flag and log inside the WorkflowNavigator
constructor (or the exported initialization method), set warned = true after
logging, and keep the original deprecation text. This ensures the message fires
only on first real use rather than on module evaluation.

In @.aiox-core/development/scripts/workflow-state-manager.js:
- Line 23: Remove the top-level console.warn('[DEPRECATED] ...') and replace it
with a module-scoped boolean flag (e.g., let deprecationWarned = false) and a
small helper function (e.g., emitDeprecation()) that logs the same warning only
if deprecationWarned is false and then sets it to true; then call
emitDeprecation() at the start of the module's exported entry points / real-use
functions (i.e., wherever the module's public API is invoked) so the warning is
emitted lazily on first real use and only once instead of on every import.

In @.aiox-core/scripts/command-execution-hook.js:
- Line 26: The top-level console.warn in command-execution-hook.js causes a
deprecation message on every require; move the warning into the first-use path
(e.g., inside updateSessionAfterCommand() or the initializer that callers
invoke) and guard it with a module-scoped boolean so it logs only once; ensure
updateSessionAfterCommand() (or the exported entrypoint) triggers the lazy
warning before performing work so mere imports no longer print the deprecation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9ffbfe6b-0318-4100-8339-ddc5f98170a3

📥 Commits

Reviewing files that changed from the base of the PR and between f74e3e7 and adc7900.

📒 Files selected for processing (12)
  • .aiox-core/core/docs/orchestration-hierarchy.md
  • .aiox-core/development/scripts/workflow-navigator.js
  • .aiox-core/development/scripts/workflow-state-manager.js
  • .aiox-core/install-manifest.yaml
  • .aiox-core/scripts/batch-migrate-phase1.ps1
  • .aiox-core/scripts/batch-migrate-phase2.ps1
  • .aiox-core/scripts/batch-migrate-phase3.ps1
  • .aiox-core/scripts/command-execution-hook.js
  • .aiox-core/scripts/migrate-framework-docs.sh
  • .aiox-core/scripts/session-context-loader.js
  • .aiox-core/scripts/validate-phase1.ps1
  • docs/deprecated-scripts.md

Comment on lines +1 to +4
# @deprecated One-time migration script (Task V2.0 migration, completed).
# All tasks have been migrated to V2.0 format. This script is no longer needed.
# Replacement: tasks are now natively V2.0 — use validate-task-v2.js for validation.
Write-Warning "[DEPRECATED] batch-migrate-phase1.ps1 — migration already completed. Tasks are V2.0 natively."
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Do not keep the legacy write path enabled by default.

This now advertises itself as a completed migration, but a plain run still executes the phase-1 rewrite loop below. That is a risky default for a deprecated script. Please warn and return unless the caller explicitly passes a force flag.

🧰 Tools
🪛 PSScriptAnalyzer (1.24.0)

[warning] Missing BOM encoding for non-ASCII encoded file 'batch-migrate-phase1.ps1'

(PSUseBOMForUnicodeEncodedFile)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.aiox-core/scripts/batch-migrate-phase1.ps1 around lines 1 - 4, Add a guard
that prevents the deprecated batch-migrate-phase1.ps1 from performing any
rewrites unless an explicit force flag is provided: add a param for a
[switch]$Force (or check for a -Force/$force parameter) at the top, update the
existing Write-Warning to state the script is deprecated and requires --Force to
proceed, and immediately return/exit when -Force is not present so the phase-1
rewrite loop below never runs by default; only continue to the rewrite logic
when $Force is set.

Comment on lines +1 to +4
# @deprecated One-time migration script (Task V2.0 migration, completed).
# All tasks have been migrated to V2.0 format. This script is no longer needed.
# Replacement: tasks are now natively V2.0 — use validate-task-v2.js for validation.
Write-Warning "[DEPRECATED] batch-migrate-phase2.ps1 — migration already completed. Tasks are V2.0 natively."
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Make the deprecated entrypoint opt-in before running the migration loop.

The new banner says this migration is already complete, but a normal invocation still proceeds to rewrite the fixed task list below. That makes accidental runs risky on already-migrated files. Safer default: warn and exit unless a -Force/-RunDeprecatedScript flag is passed.

🧰 Tools
🪛 PSScriptAnalyzer (1.24.0)

[warning] Missing BOM encoding for non-ASCII encoded file 'batch-migrate-phase2.ps1'

(PSUseBOMForUnicodeEncodedFile)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.aiox-core/scripts/batch-migrate-phase2.ps1 around lines 1 - 4, Add an
opt-in guard to the batch-migrate-phase2.ps1 entrypoint: define a switch
parameter (e.g. -Force or -RunDeprecatedScript) at the top via a Param() block
and, before the existing migration loop, check if the switch is present; if not,
emit the deprecation Write-Warning and exit/return immediately so the rest of
the script (the migration loop that rewrites tasks) does not run. Ensure the
check is placed before any file-modifying logic and reference the script name
batch-migrate-phase2.ps1 and the migration loop block when making the change.

# --help Show this help message
#

echo "[DEPRECATED] migrate-framework-docs.sh — migration already completed. Docs live natively in docs/ and .aiox-core/docs/."
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Stop after the deprecation banner unless the user explicitly opts in.

After printing this message, the script still executes the full migration flow and can overwrite docs in the target repo. For a one-off script now declared complete, the safe default should be to exit here and require an explicit --force-legacy-run flag for any remaining use.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.aiox-core/scripts/migrate-framework-docs.sh at line 22, Modify
migrate-framework-docs.sh to stop execution immediately after printing the
deprecation banner unless the user passed an explicit opt-in flag; check
positional/parsed args for a --force-legacy-run (or similar) flag and only
proceed with the existing migration flow when that flag is present, otherwise
call exit 0 right after the echo "[DEPRECATED] ..." line to prevent any further
actions; update any help/usage text to document the --force-legacy-run opt-in
and reference the script name migrate-framework-docs.sh in your changes so
reviewers can find the guard easily.


'use strict';

console.warn('[DEPRECATED] session-context-loader.js — use require(\'.aiox-core/core/session/context-loader\') directly (WIS-3)');
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Locate the file
find . -name "session-context-loader.js" -type f

Repository: SynkraAI/aiox-core

Length of output: 166


🏁 Script executed:

# Check if the path exists and read the file around lines 18-21
ls -la ".aiox-core/scripts/session-context-loader.js" 2>/dev/null || find . -path "*aiox-core*" -name "session-context-loader.js"

Repository: SynkraAI/aiox-core

Length of output: 155


🏁 Script executed:

# Search for any configuration that might establish a .aiox-core alias
find . -name "package.json" -o -name "tsconfig.json" | head -20

Repository: SynkraAI/aiox-core

Length of output: 418


🏁 Script executed:

cat -n ".aiox-core/scripts/session-context-loader.js"

Repository: SynkraAI/aiox-core

Length of output: 2101


🏁 Script executed:

# Check the root package.json for any path aliases or resolution config
cat "./.aiox-core/package.json"

Repository: SynkraAI/aiox-core

Length of output: 2557


🏁 Script executed:

# Also check the repo root package.json
cat "./package.json" | head -100

Repository: SynkraAI/aiox-core

Length of output: 4910


🏁 Script executed:

# Verify the path validity by checking what the actual import resolves to
ls -la ".aiox-core/core/session/context-loader.js" 2>/dev/null || echo "File not found at that path"

Repository: SynkraAI/aiox-core

Length of output: 153


🏁 Script executed:

# Double-check the relative path from the script location
cd ".aiox-core/scripts" && ls -la "../core/session/context-loader.js" 2>/dev/null || echo "File not found"

Repository: SynkraAI/aiox-core

Length of output: 145


Fix the replacement require() path in the deprecation warning.

The path in the warning (require('.aiox-core/core/session/context-loader')) is invalid Node.js syntax and will cause a MODULE_NOT_FOUND error at runtime. In Node.js, require paths must start with ./, ../, or be module names—a leading . without a slash is not valid. Update the message to match the actual import on line 21: require('../core/session/context-loader').

Suggested fix
-console.warn('[DEPRECATED] session-context-loader.js — use require(\'.aiox-core/core/session/context-loader\') directly (WIS-3)');
+console.warn('[DEPRECATED] session-context-loader.js — use require(\'../core/session/context-loader\') directly (WIS-3)');
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
console.warn('[DEPRECATED] session-context-loader.js — use require(\'.aiox-core/core/session/context-loader\') directly (WIS-3)');
console.warn('[DEPRECATED] session-context-loader.js — use require(\'../core/session/context-loader\') directly (WIS-3)');
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.aiox-core/scripts/session-context-loader.js at line 18, The deprecation
warning string in session-context-loader.js contains an invalid require path;
update the console.warn call that currently references
"require('.aiox-core/core/session/context-loader')" to use the correct Node.js
relative import "require('../core/session/context-loader')" so the message
matches the actual import used on line 21 and avoids a MODULE_NOT_FOUND error.

Comment on lines +2 to +3
# Migration is complete. Use validate-task-v2.js directly for ongoing validation.
Write-Warning "[DEPRECATED] validate-phase1.ps1 — Phase 1 migration already validated. Use validate-task-v2.js directly."
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Point the warning at the real replacement path.

The new deprecation message tells users to run validate-task-v2.js directly, but the replacement script lives under .aiox-core/development/scripts/validate-task-v2.js in this repo, not .aiox-core/scripts/. As written, the migration guidance is ambiguous and currently disagrees with the stale invocation at Line 26.

Suggested update
-# Migration is complete. Use validate-task-v2.js directly for ongoing validation.
-Write-Warning "[DEPRECATED] validate-phase1.ps1 — Phase 1 migration already validated. Use validate-task-v2.js directly."
+# Migration is complete. Use .aiox-core/development/scripts/validate-task-v2.js directly for ongoing validation.
+Write-Warning "[DEPRECATED] validate-phase1.ps1 — Phase 1 migration already validated. Use .aiox-core/development/scripts/validate-task-v2.js directly."
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Migration is complete. Use validate-task-v2.js directly for ongoing validation.
Write-Warning "[DEPRECATED] validate-phase1.ps1 — Phase 1 migration already validated. Use validate-task-v2.js directly."
# Migration is complete. Use .aiox-core/development/scripts/validate-task-v2.js directly for ongoing validation.
Write-Warning "[DEPRECATED] validate-phase1.ps1 — Phase 1 migration already validated. Use .aiox-core/development/scripts/validate-task-v2.js directly."
🧰 Tools
🪛 PSScriptAnalyzer (1.24.0)

[warning] Missing BOM encoding for non-ASCII encoded file 'validate-phase1.ps1'

(PSUseBOMForUnicodeEncodedFile)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.aiox-core/scripts/validate-phase1.ps1 around lines 2 - 3, The deprecation
warning in validate-phase1.ps1 points to the wrong replacement; update the
warning text to reference the actual replacement script name validate-task-v2.js
in its correct location and make the message unambiguous, and also correct the
stale invocation elsewhere in the same validate-phase1.ps1 file (the existing
call to the old path) so both the warning and the invocation consistently point
to the new validate-task-v2.js entrypoint.

@@ -1,3 +1,7 @@
# @deprecated One-time validation script for Task V2.0 Phase 1 migration.
# Migration is complete. Use validate-task-v2.js directly for ongoing validation.
Write-Warning "[DEPRECATED] validate-phase1.ps1 — Phase 1 migration already validated. Use validate-task-v2.js directly."
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
python - <<'PY'
from pathlib import Path

p = Path(".aiox-core/scripts/validate-phase1.ps1")
data = p.read_bytes()

has_bom = data.startswith(b"\xef\xbb\xbf")
has_non_ascii = any(b > 0x7F for b in data)

print(f"file={p}")
print(f"utf8_bom={has_bom}")
print(f"contains_non_ascii={has_non_ascii}")
PY

Repository: SynkraAI/aiox-core

Length of output: 144


Save this file as UTF-8 with BOM to properly encode the Unicode characters, or remove the em-dash from the warning message.

The file currently contains non-ASCII characters (the em-dash on line 3) but lacks a UTF-8 BOM. This mismatch causes PSScriptAnalyzer to flag PSUseBOMForUnicodeEncodedFile, and Windows PowerShell 5.1 may garble the warning text when loading from disk without the proper encoding marker.

🧰 Tools
🪛 PSScriptAnalyzer (1.24.0)

[warning] Missing BOM encoding for non-ASCII encoded file 'validate-phase1.ps1'

(PSUseBOMForUnicodeEncodedFile)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.aiox-core/scripts/validate-phase1.ps1 at line 3, The Write-Warning string
in validate-phase1.ps1 contains a non-ASCII em-dash ("Write-Warning
\"[DEPRECATED] validate-phase1.ps1 — Phase 1 migration already validated. Use
validate-task-v2.js directly.\"") which triggers PSUseBOMForUnicodeEncodedFile;
fix by either saving validate-phase1.ps1 as UTF-8 with BOM so the em-dash is
encoded correctly, or replace/remove the em-dash (e.g., use a plain hyphen or
remove it) in the Write-Warning message to keep the file ASCII-only.

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.

chore: script lifecycle audit - deprecate legacy orchestration scripts

1 participant