Skip to content

fix(agera): sync with alien-signals v3.2.1#160

Merged
dangreen merged 12 commits into
mainfrom
feat-agera-sync-alien-signals
Jul 11, 2026
Merged

fix(agera): sync with alien-signals v3.2.1#160
dangreen merged 12 commits into
mainfrom
feat-agera-sync-alien-signals

Conversation

@dangreen

@dangreen dangreen commented Jul 11, 2026

Copy link
Copy Markdown
Member

Ports upstream alien-signals changes since the last sync point (836130c, v3.1.2) up to c00e639 (v3.2.1 + 2 commits). Each upstream change was analyzed, reproduced where applicable, and either ported or deliberately skipped. Full report: packages/agera/history/v3.2.1-c00e639.md.

Ported

Upstream What it fixes
fb17aed refactor: hoist trigger sub flag reset out of propagate loop
ad52894 + b83cf94 + fbabdbd crash + disposed-effect resurrection when user code disposes effects/scopes during checkDirty update (alien-signals#109, alien-signals#115) — reproduced in agera before the port
c28a596 effect not responding to computed changes read through effectScope (alien-signals#105) — reproduced
cf75b33 + 4b15362 stack overflow when destroy calls own stop() + effect resurrection when destroy disposes it (alien-signals#113) — reproduced
9daa5c3 + c00e639 flush crash when writing a signal inside trigger after reading it (alien-signals#122) — reproduced

Skipped deliberately

  • 7e53655 + d4d0449 (runDepth/innerWrite, alien-signals#112) — the alien-signals#99 bug class is already covered by agera's flushDepth mechanism, which additionally fixes lost notifications that upstream still has at HEAD. Porting was prototyped: zero observable effect. Regression tests added instead.
  • 713a1c6 (LIFO disposal, alien-signals#116) — redefines cleanup ordering; agera keeps its own contract (own destroy first, children FIFO). Accepted divergences documented in the history report.

History

  • New sync snapshot packages/agera/history/v3.2.1-c00e639.diff (flattened upstream vs src/internals) and sync report v3.2.1-c00e639.md.

Tests

  • agera: 97 passed + 2 expected fail (was 77), 20 new regression tests, oxlint/tsc clean.
  • size-limit: green across the whole monorepo, per-package builds verified for agera/kida/store (sizes actually shrank thanks to the walk-up removal in the effectScope port).
  • kida: 61 passed.

dangreen added 7 commits July 11, 2026 21:31
Port of alien-signals commits ad52894, b83cf94 and fbabdbd (issues #109, #115).
Port of alien-signals commit c28a596 (issue #105).
Regression coverage for the alien-signals issue #99 scenario, which is
already handled in agera by the flushDepth mechanism. Upstream commits
7e53655 and d4d0449 (runDepth-based fix) are intentionally not ported:
the bug does not reproduce here and the port showed no observable effect.
… disposes it

Port of alien-signals commits cf75b33 and 4b15362 semantics (#113).
…after reading it

Port of alien-signals commits 9daa5c3 and c00e639 (issue #122).
New sync point is c00e639: flattened upstream diff snapshot plus a sync
report with ported commits, deliberate skips and accepted divergences.
@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.79%. Comparing base (1410c97) to head (02b42ea).

Files with missing lines Patch % Lines
packages/agera/src/internals/system.ts 96.77% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #160      +/-   ##
==========================================
- Coverage   83.81%   83.79%   -0.03%     
==========================================
  Files         137      137              
  Lines        2966     2962       -4     
  Branches      555      558       +3     
==========================================
- Hits         2486     2482       -4     
  Misses        340      340              
  Partials      140      140              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates agera’s internal reactive runtime to match upstream alien-signals v3.2.1 behavior (plus two additional commits), primarily addressing several edge-case crashes/resurrection scenarios involving trigger, checkDirty, effectScope, and effect destroy/stop semantics.

Changes:

  • Ports upstream runtime fixes into packages/agera/src/internals/system.ts (trigger flush crash prevention, resilient dirty-checking under graph mutation, effect destroy recursion/resurrection handling, and effectScope participation in propagation).
  • Adds a substantial set of regression tests covering the newly-ported behaviors and prior crash cases.
  • Updates size-limit thresholds for agera, kida, and store based on the new bundle output, plus adds a new sync snapshot + report under packages/agera/history/.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/agera/src/internals/system.ts Ports alien-signals v3.2.1 runtime semantics and multiple bug fixes into agera’s core reactive system.
packages/agera/src/effect.spec.ts Adds regression tests for effect cleanup/disposal edge cases, checkDirty mutation resilience, and effectScope propagation behavior.
packages/agera/src/signal.spec.ts Adds regression tests for writing a signal inside trigger after reading it.
packages/agera/history/v3.2.1-c00e639.md Adds a sync report documenting what was ported vs deliberately skipped and why.
packages/agera/history/v3.2.1-c00e639.diff Adds a flattened upstream-vs-agera snapshot diff for auditability of the sync point.
packages/agera/.size-limit.json Updates agera bundle size limits to reflect reduced output size after the port.
packages/kida/.size-limit.json Updates kida bundle size limits to reflect reduced output size after the port.
packages/store/.size-limit.json Updates store bundle size limits to reflect reduced output size after the port.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dangreen dangreen merged commit d943a8d into main Jul 11, 2026
11 checks passed
@dangreen dangreen deleted the feat-agera-sync-alien-signals branch July 11, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants