Skip to content

fix(core): migrate error serialization surfaces#703

Merged
rafaelscosta merged 1 commit intomainfrom
feature/issue-621-error-normalizer-migration
May 8, 2026
Merged

fix(core): migrate error serialization surfaces#703
rafaelscosta merged 1 commit intomainfrom
feature/issue-621-error-normalizer-migration

Conversation

@rafaelscosta
Copy link
Copy Markdown
Collaborator

@rafaelscosta rafaelscosta commented May 8, 2026

Summary

  • migrates BuildStateManager failure/log serialization to the canonical error serializer while preserving the legacy error message field
  • adds canonical errorDetails to Synapse PipelineMetrics layer failures
  • updates focused compatibility tests, IDS registry, install manifest, and the Error Governance story ledger

Validation

  • git diff --check
  • npm test -- --runTestsByPath tests/core/build-state-manager.test.js tests/synapse/engine.test.js tests/core/errors/aiox-error.test.js tests/core/errors/serializer.test.js --runInBand
  • npx eslint .aiox-core/core/execution/build-state-manager.js .aiox-core/core/synapse/engine.js tests/core/build-state-manager.test.js tests/synapse/engine.test.js --no-warn-ignored
  • npm run generate:manifest && npm run validate:manifest
  • npm run typecheck
  • npm run lint (0 errors, 114 existing warnings)
  • npm test -- --runInBand --forceExit --silent

Refs #621

Summary by CodeRabbit

  • New Features

    • Improved registry population to resolve relative imports to directory-index IDs and richer module metadata.
  • Bug Fixes

    • Failures and pipeline errors now include structured canonical error details while preserving legacy error messages; stack exposure is configurable.
  • Improvements

    • Registry updater selectively refreshes derived dependency fields and classifies dependencies as internal/external/planned with lifecycle defaults.
  • Tests

    • Expanded coverage for structured error details, nested causes, and relative-import/index resolution.
  • Documentation

    • Added/updated epic and story docs for error-governance migration.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 8, 2026

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 2:35pm

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
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR implements AIOX-ERROR.2: BuildStateManager and PipelineMetrics.errorLayer now normalize errors to a canonical Error Governance contract, storing structured errorDetails while keeping legacy error messages. Registry population/updater, manifests, tests, and documentation were updated accordingly.

Changes

Error Governance: Serialization-Sensitive Migration

Layer / File(s) Summary
Error Normalization Helper
.aiox-core/core/execution/build-state-manager.js
New normalizeFailureError(error, context) helper standardizes error payloads using normalizeError and serializeError with configurable stack exposure via shouldExposeLogErrorStack() and aliases shared sanitizer.
Log Sanitization Refactor
.aiox-core/core/execution/build-state-manager.js
sanitizeLogValue simplified to delegate JSON-safe conversion to sanitizeErrorValue, respecting stack exposure, replacing prior custom recursive sanitizer.
BuildStateManager Failure Recording
.aiox-core/core/execution/build-state-manager.js
recordFailure now stores canonical message in failure.error and structured serialized details in failure.errorDetails, and includes errorDetails in attempt logging.
Synapse Engine Error Imports
.aiox-core/core/synapse/engine.js
Adds imports for normalizeError and serializeError to support canonical error normalization in layer failure handling.
PipelineMetrics Error Layer Recording
.aiox-core/core/synapse/engine.js
PipelineMetrics.errorLayer normalizes thrown errors with fixed code AIOX_SYNAPSE_LAYER_FAILED and synapse.layer metadata, storing normalized message and serialized structured errorDetails instead of raw stringification.
Populate Registry: Index Resolution & Helpers
.aiox-core/development/scripts/populate-entity-registry.js
Adds INDEX_RESOLUTION_EXTENSIONS, findScanConfigForPath, resolveRelativeDependencyId; updates detectDependencies(content, entityId, verbose, currentFilePath) to resolve relative specifiers to scoped entity IDs and exports new helpers.
Registry Updater Edits
.aiox-core/core/ids/registry-updater.js
Tracks changedEntities during batches, calls detectDependencies(..., absPath) on create/modify, initializes externalDeps/plannedDeps/lifecycle:'experimental', updates dependencies conditionally on checksum/diff, and adds _refreshDerivedDependencyFields to partition and dedupe dependencies and set lifecycle.
Entity Registry & Install Manifest Updates
.aiox-core/data/entity-registry.yaml, .aiox-core/install-manifest.yaml
Registry metadata and checksums updated; added synapse-engine module and errors-index dependency for build-state-manager; usedBy cross-references refreshed; install-manifest hashes/sizes and timestamp regenerated.
BuildStateManager Test Coverage
tests/core/build-state-manager.test.js
Extends tests to assert failure.errorDetails is an AIOXError-shaped object (redacted stack), preserves nested cause and extra error properties, and verifies attempt-log serialization includes nested cause.
Synapse Engine Test Coverage
tests/synapse/engine.test.js
Expands PipelineMetrics.errorLayer() tests to validate errorDetails for Error and non-Error inputs, ensure legacy error message preservation, and confirm embedded canonical metadata/cause preservation.
Populate Registry Tests
tests/core/ids/populate-entity-registry.test.js
Adds tests ensuring relative directory requires resolve to the directory index entity ID (e.g., errors-index) and findScanConfigForPath matches at directory boundaries.
Story & Epic Documentation
docs/stories/epic-error-governance/*
Adds STORY-AIOX-ERROR.2 documenting acceptance criteria and migration notes; updates EPIC metadata and story table to mark progress and include source issues.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • SynkraAI/aiox-core#694: Both PRs modify .aiox-core/core/execution/build-state-manager.js to change how attempt/failure logging serializes and redacts errors; related.
  • SynkraAI/aiox-core#702: Related — introduces error-governance utilities (normalizeError, serializeError, sanitizer/stack controls) that this PR consumes.
  • SynkraAI/aiox-core#699: Related — earlier Synapse engine error handling changes that intersect with this PR’s error-layer serialization.

Suggested reviewers

  • Pedrovaleriolopez
  • oalanicolas
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(core): migrate error serialization surfaces' accurately describes the main objective of migrating error serialization in core modules while preserving backward compatibility.
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/issue-621-error-normalizer-migration

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
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

📊 Coverage Report

Coverage report not available

📈 Full coverage report available in Codecov


Generated by PR Automation (Story 6.1)

@rafaelscosta rafaelscosta force-pushed the feature/issue-621-error-normalizer-migration branch from 85066b5 to f3f6e26 Compare May 8, 2026 13:57
@rafaelscosta rafaelscosta force-pushed the feature/issue-621-error-normalizer-migration branch from f3f6e26 to 4170e74 Compare May 8, 2026 13:59
Copy link
Copy Markdown

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

🤖 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 @.aiox-core/data/entity-registry.yaml:
- Line 8714: The registry lists a dependency key "errors" that doesn't exist
(the defined key is "errors-index"), which breaks dependency resolution; update
the dependency entry that references "errors" to use the correct module/entity
key "errors-index" at both occurrences (the ones noted in the review), or
alternatively add a new entity definition named "errors" if the alias was
intentional, ensuring the dependency names match exactly with the keys defined
in the registry.
- Around line 12922-12941: The synapse-engine registry entry is missing the
standard module fields expected by validators; update the synapse-engine record
to include externalDeps (e.g., an empty list or the actual external package
names), plannedDeps (e.g., [] or any planned internal dependencies), and
lifecycle (e.g., an object with status, created/updated timestamps or the same
structure used by other module entries) so the entry matches the schema used by
other modules; modify the .aiox-core/data/entity-registry.yaml synapse-engine
entry to add externalDeps, plannedDeps, and lifecycle keys with sensible default
values consistent with other module records.
🪄 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: 0c8d90d5-3bcc-40a1-a526-2e91c3320927

📥 Commits

Reviewing files that changed from the base of the PR and between 7f22246 and 85066b5.

📒 Files selected for processing (8)
  • .aiox-core/core/execution/build-state-manager.js
  • .aiox-core/core/synapse/engine.js
  • .aiox-core/data/entity-registry.yaml
  • .aiox-core/install-manifest.yaml
  • docs/stories/epic-error-governance/EPIC-AIOX-ERROR-GOVERNANCE.md
  • docs/stories/epic-error-governance/STORY-AIOX-ERROR.2-SERIALIZATION-SENSITIVE-MIGRATION.md
  • tests/core/build-state-manager.test.js
  • tests/synapse/engine.test.js

Comment thread .aiox-core/data/entity-registry.yaml Outdated
Comment thread .aiox-core/data/entity-registry.yaml Outdated
@rafaelscosta rafaelscosta force-pushed the feature/issue-621-error-normalizer-migration branch from 4170e74 to 63e3b6e Compare May 8, 2026 14:09
Copy link
Copy Markdown

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

Caution

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

⚠️ Outside diff range comments (1)
.aiox-core/data/entity-registry.yaml (1)

11459-11464: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

context-builder lifecycle conflicts with new active usage.

context-builder now has synapse-engine in usedBy (Line 11459), but lifecycle is still orphan (Line 11464). That inconsistency can mislead tooling that treats orphaned entries as removable/inactive.

💡 Proposed minimal fix
     context-builder:
       path: .aiox-core/core/synapse/context/context-builder.js
       layer: L1
       type: module
       purpose: Entity at .aiox-core/core/synapse/context/context-builder.js
       keywords:
         - context
         - builder
       usedBy:
         - synapse-engine
       dependencies: []
       externalDeps: []
       plannedDeps: []
-      lifecycle: orphan
+      lifecycle: experimental
🤖 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 @.aiox-core/data/entity-registry.yaml around lines 11459 - 11464, The
registry entry for context-builder is inconsistent: it lists synapse-engine
under usedBy but retains lifecycle: orphan; update the lifecycle value for the
context-builder entry from "orphan" to the appropriate active state (e.g.,
"active" or "in-use") so the usedBy relationship is reflected correctly,
ensuring you edit the same context-builder block that contains the usedBy: -
synapse-engine and lifecycle fields.
🤖 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 @.aiox-core/core/ids/registry-updater.js:
- Around line 345-347: The code currently only backfills defaults for
externalDeps, plannedDeps, and lifecycle instead of recomputing them after
dependencies change; after any place that refreshes the dependencies array (the
blocks that assign/update dependencies around the existing refresh points),
rederive externalDeps, plannedDeps and lifecycle from the new dependencies
rather than setting static defaults—i.e., replace the default assignments for
externalDeps/plannedDeps/lifecycle with calls to the existing
dependency-derivation logic (or implement a small helper) so these fields are
recalculated whenever dependencies is updated (apply this fix at both update
points where dependencies is refreshed).

In @.aiox-core/development/scripts/populate-entity-registry.js:
- Around line 115-117: findScanConfigForPath currently uses simple prefix
matching which can misidentify siblings (e.g., ".aiox-core/corex" matching
".aiox-core/core"); normalize config.basePath and relPath (trim trailing
slashes, replace backslashes) and change the test to accept either exact
equality or a directory-bound prefix (i.e., relPath === basePath OR
relPath.startsWith(basePath + '/')) when iterating SCAN_CONFIG to return the
correct config.

---

Outside diff comments:
In @.aiox-core/data/entity-registry.yaml:
- Around line 11459-11464: The registry entry for context-builder is
inconsistent: it lists synapse-engine under usedBy but retains lifecycle:
orphan; update the lifecycle value for the context-builder entry from "orphan"
to the appropriate active state (e.g., "active" or "in-use") so the usedBy
relationship is reflected correctly, ensuring you edit the same context-builder
block that contains the usedBy: - synapse-engine and lifecycle fields.
🪄 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: 97506711-f3d9-4131-8618-52ba428484c0

📥 Commits

Reviewing files that changed from the base of the PR and between 4170e74 and 63e3b6e.

📒 Files selected for processing (11)
  • .aiox-core/core/execution/build-state-manager.js
  • .aiox-core/core/ids/registry-updater.js
  • .aiox-core/core/synapse/engine.js
  • .aiox-core/data/entity-registry.yaml
  • .aiox-core/development/scripts/populate-entity-registry.js
  • .aiox-core/install-manifest.yaml
  • docs/stories/epic-error-governance/EPIC-AIOX-ERROR-GOVERNANCE.md
  • docs/stories/epic-error-governance/STORY-AIOX-ERROR.2-SERIALIZATION-SENSITIVE-MIGRATION.md
  • tests/core/build-state-manager.test.js
  • tests/core/ids/populate-entity-registry.test.js
  • tests/synapse/engine.test.js
✅ Files skipped from review due to trivial changes (2)
  • docs/stories/epic-error-governance/EPIC-AIOX-ERROR-GOVERNANCE.md
  • .aiox-core/install-manifest.yaml
🚧 Files skipped from review as they are similar to previous changes (4)
  • .aiox-core/core/synapse/engine.js
  • tests/synapse/engine.test.js
  • .aiox-core/core/execution/build-state-manager.js
  • tests/core/build-state-manager.test.js

Comment thread .aiox-core/core/ids/registry-updater.js
Comment thread .aiox-core/development/scripts/populate-entity-registry.js Outdated
@rafaelscosta rafaelscosta force-pushed the feature/issue-621-error-normalizer-migration branch from 63e3b6e to 8bbb7d2 Compare May 8, 2026 14:21
Copy link
Copy Markdown

@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.

Caution

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

⚠️ Outside diff range comments (1)
.aiox-core/core/ids/registry-updater.js (1)

301-313: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Lifecycle values become stale when entities are deleted due to unmutated changedEntities.

When _handleFileDelete removes an entity, it filters that entity's ID from usedBy across all referencing entities (lines 434–440, 452–458). However, those referencing entities are not added to changedEntities because the action !== 'unlink' guard at line 280 excludes deletes. Since _refreshDerivedDependencyFields only recomputes lifecycle for entities in changedEntities, and detectLifecycle depends on usedBy length (line 576–578 in populate-entity-registry.js), their lifecycle values will not update. This causes persisted lifecycles to drift on delete-only batches: an entity might remain marked "production" even after its last consumer is deleted.

Consider adding deleted entity IDs to changedEntities or running a full lifecycle recomputation after delete operations.

🤖 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 @.aiox-core/core/ids/registry-updater.js around lines 301 - 313, The delete
path is leaving lifecycle values stale because _handleFileDelete removes IDs
from usedBy but the deleted references aren't added to changedEntities due to
the action !== 'unlink' guard, so _refreshDerivedDependencyFields (which calls
detectLifecycle in populate-entity-registry.js) never recomputes those
consumers; fix by ensuring deleted entity IDs (or the referencing entity IDs)
are added to changedEntities when processing unlink/deletes in
_handleFileDelete, or alternatively trigger a full lifecycle recompute after
deletes by invoking _refreshDerivedDependencyFields for all affected entities
(or the whole registry) after _applyCodeIntelEnrichments/_resolveAllUsedBy;
update the logic around the action !== 'unlink' check and references to
changedEntities accordingly.
🧹 Nitpick comments (2)
.aiox-core/core/ids/registry-updater.js (2)

278-291: ⚡ Quick win

Avoid recomputing entityId in the batch loop.

resolveEntityId is already invoked inside _handleFileCreate (L350) and _handleFileModify (L390) and is recomputed here a third time per mutation. For batches with many files this duplicates non-trivial path resolution work. Consider returning { mutated, category, entityId } from the handlers and using that directly.

♻️ Sketch
-            let mutated = false;
+            let result = { mutated: false };
             switch (action) {
               case 'add':
-                mutated = this._handleFileCreate(registry, abs);
+                result = this._handleFileCreate(registry, abs);
                 break;
               case 'change':
-                mutated = this._handleFileModify(registry, abs);
+                result = this._handleFileModify(registry, abs);
                 break;
               case 'unlink':
-                mutated = this._handleFileDelete(registry, abs);
+                result = this._handleFileDelete(registry, abs);
                 break;
               default:
                 console.warn(`[IDS-Updater] Unknown action: ${action}`);
             }
-            if (mutated) {
+            if (result.mutated) {
               updated++;
-              if (action !== 'unlink') {
-                const relPath = path.relative(this._repoRoot, abs).replace(/\\/g, '/');
-                const config = this._detectCategory(relPath);
-                if (config) {
-                  const category = config.category;
-                  const entityId = resolveEntityId(abs, config, registry.entities[category] || {}, this._repoRoot);
-                  if (registry.entities[category]?.[entityId]) {
-                    changedEntities.push({ category, entityId });
-                  }
-                }
-              }
+              if (action !== 'unlink' && result.category && result.entityId) {
+                changedEntities.push({ category: result.category, entityId: result.entityId });
+              }
             }

(Handlers would return their already-known category/entityId along with mutated.)

🤖 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 @.aiox-core/core/ids/registry-updater.js around lines 278 - 291, The batch
loop is recomputing entityId with resolveEntityId even though _handleFileCreate
and _handleFileModify already compute it; change those handlers to return an
object like { mutated, category, entityId } (or null/false when not mutated) and
update the batch-processing code that currently inspects mutated to consume the
returned category and entityId directly instead of calling resolveEntityId
again, then push { category, entityId } to changedEntities when present; refer
to _handleFileCreate, _handleFileModify, resolveEntityId, mutated, category,
entityId, and changedEntities when making the change.

411-418: 💤 Low value

Order-sensitive comparison may over-trigger writes.

Two concerns on L416:

  1. JSON.stringify is order-sensitive — re-ordered (but semantically equal) dependency arrays from detectDependencies will be treated as different.
  2. After the first batch, existing.dependencies is stripped to internal-only by _refreshDerivedDependencyFields, while nextDependencies here is the full unclassified list from detectDependencies. For any entity with external or planned deps, this comparison is effectively always !==, so the branch always runs and re-triggers a refresh on every unchanged-checksum touch.

Functionally fine (the immediate refresh re-classifies), but on busy watchers this is needless churn. A Set-based equality on the post-classified internal subset would be more accurate:

♻️ Suggested direction
-    } else if (JSON.stringify(existing.dependencies || []) !== JSON.stringify(nextDependencies)) {
-      existing.dependencies = nextDependencies;
-    }
+    } else {
+      const prev = new Set(existing.dependencies || []);
+      const next = new Set(nextDependencies);
+      const same = prev.size === next.size && [...prev].every((d) => next.has(d));
+      if (!same) existing.dependencies = nextDependencies;
+    }

(Even cleaner: compare against the union of existing.dependencies + externalDeps + plannedDeps so post-classified entities don't always look "changed".)

🤖 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 @.aiox-core/core/ids/registry-updater.js around lines 411 - 418, The
dependency comparison currently uses JSON.stringify on existing.dependencies vs
nextDependencies which is order-sensitive and compares unclassified vs
post-classified lists; change the check in the block that updates dependencies
to compute and compare normalized sets instead: derive the internal-only
dependency IDs from nextDependencies (or compute the union of existing.internal
+ external + planned if preferred), build Sets for existing.dependencies (after
_refreshDerivedDependencyFields normalization) and for the normalized
nextDependencies, and only assign existing.dependencies = nextDependencies (or
the normalized internal subset) when the Sets differ; this removes
order-sensitivity and avoids always-triggering updates for entities where only
external/planned deps differ (use Set.has and size equality to test set
equality).
🤖 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.

Outside diff comments:
In @.aiox-core/core/ids/registry-updater.js:
- Around line 301-313: The delete path is leaving lifecycle values stale because
_handleFileDelete removes IDs from usedBy but the deleted references aren't
added to changedEntities due to the action !== 'unlink' guard, so
_refreshDerivedDependencyFields (which calls detectLifecycle in
populate-entity-registry.js) never recomputes those consumers; fix by ensuring
deleted entity IDs (or the referencing entity IDs) are added to changedEntities
when processing unlink/deletes in _handleFileDelete, or alternatively trigger a
full lifecycle recompute after deletes by invoking
_refreshDerivedDependencyFields for all affected entities (or the whole
registry) after _applyCodeIntelEnrichments/_resolveAllUsedBy; update the logic
around the action !== 'unlink' check and references to changedEntities
accordingly.

---

Nitpick comments:
In @.aiox-core/core/ids/registry-updater.js:
- Around line 278-291: The batch loop is recomputing entityId with
resolveEntityId even though _handleFileCreate and _handleFileModify already
compute it; change those handlers to return an object like { mutated, category,
entityId } (or null/false when not mutated) and update the batch-processing code
that currently inspects mutated to consume the returned category and entityId
directly instead of calling resolveEntityId again, then push { category,
entityId } to changedEntities when present; refer to _handleFileCreate,
_handleFileModify, resolveEntityId, mutated, category, entityId, and
changedEntities when making the change.
- Around line 411-418: The dependency comparison currently uses JSON.stringify
on existing.dependencies vs nextDependencies which is order-sensitive and
compares unclassified vs post-classified lists; change the check in the block
that updates dependencies to compute and compare normalized sets instead: derive
the internal-only dependency IDs from nextDependencies (or compute the union of
existing.internal + external + planned if preferred), build Sets for
existing.dependencies (after _refreshDerivedDependencyFields normalization) and
for the normalized nextDependencies, and only assign existing.dependencies =
nextDependencies (or the normalized internal subset) when the Sets differ; this
removes order-sensitivity and avoids always-triggering updates for entities
where only external/planned deps differ (use Set.has and size equality to test
set equality).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 285cb2f2-ceb0-49d5-8ce2-58f377a4a63b

📥 Commits

Reviewing files that changed from the base of the PR and between 63e3b6e and 8bbb7d2.

📒 Files selected for processing (11)
  • .aiox-core/core/execution/build-state-manager.js
  • .aiox-core/core/ids/registry-updater.js
  • .aiox-core/core/synapse/engine.js
  • .aiox-core/data/entity-registry.yaml
  • .aiox-core/development/scripts/populate-entity-registry.js
  • .aiox-core/install-manifest.yaml
  • docs/stories/epic-error-governance/EPIC-AIOX-ERROR-GOVERNANCE.md
  • docs/stories/epic-error-governance/STORY-AIOX-ERROR.2-SERIALIZATION-SENSITIVE-MIGRATION.md
  • tests/core/build-state-manager.test.js
  • tests/core/ids/populate-entity-registry.test.js
  • tests/synapse/engine.test.js
✅ Files skipped from review due to trivial changes (2)
  • .aiox-core/install-manifest.yaml
  • docs/stories/epic-error-governance/EPIC-AIOX-ERROR-GOVERNANCE.md
🚧 Files skipped from review as they are similar to previous changes (7)
  • .aiox-core/core/synapse/engine.js
  • tests/core/ids/populate-entity-registry.test.js
  • tests/synapse/engine.test.js
  • .aiox-core/development/scripts/populate-entity-registry.js
  • .aiox-core/core/execution/build-state-manager.js
  • tests/core/build-state-manager.test.js
  • .aiox-core/data/entity-registry.yaml

coderabbitai[bot]
coderabbitai Bot previously approved these changes May 8, 2026
@rafaelscosta rafaelscosta force-pushed the feature/issue-621-error-normalizer-migration branch from 8bbb7d2 to 2ffe410 Compare May 8, 2026 14:35
@rafaelscosta rafaelscosta merged commit 106bb34 into main May 8, 2026
39 of 40 checks passed
@rafaelscosta rafaelscosta deleted the feature/issue-621-error-normalizer-migration branch May 8, 2026 14:40
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.

1 participant