Skip to content

Add ability to update package definitions + auto-propagate to dependents#5594

Merged
StachuDotNet merged 4 commits intodarklang:mainfrom
OceanOak:edit-code-2
Feb 17, 2026
Merged

Add ability to update package definitions + auto-propagate to dependents#5594
StachuDotNet merged 4 commits intodarklang:mainfrom
OceanOak:edit-code-2

Conversation

@OceanOak
Copy link
Copy Markdown
Collaborator

@OceanOak OceanOak commented Feb 3, 2026

In this PR:

  • fn, type, and val commands now detect updates to existing definitions, creates a new version with a new UUID and repoints the location (package manager is immutable)
  • When updating, auto-propagates to all dependents (and their dependents, transitively) so they reference the new version
  • Signature/definition change warnings: if a function's parameter types or return type changed (or a type's definition changed), prints
    a warning with old vs new and lists affected dependents for manual review
  • Added undo command to step back one version at a time, reverting the associated propagation (with confirmation when dependents are affected)
  • New PropagateUpdate and RevertPropagation ops to record what changed so it can be undone
  • Added AstTransformer.fs to rewrite ASTs, swapping old UUIDs for new ones
  • Added Propagation.fs for the core propagation algorithm (discovery, UUID mapping, transitive chain handling, mutual recursion)
  • Handles edge cases: self-recursion, mutual recursion, diamond dependencies, cross-item propagation (type change affects fn), overlapping propagations during undo

@OceanOak OceanOak force-pushed the edit-code-2 branch 7 times, most recently from ea003fc to 616938d Compare February 11, 2026 21:10
@OceanOak OceanOak marked this pull request as ready for review February 14, 2026 18:44
@OceanOak OceanOak mentioned this pull request Feb 16, 2026
Copy link
Copy Markdown
Member

@StachuDotNet StachuDotNet left a comment

Choose a reason for hiding this comment

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

Good work. I still have a general feeling/concern that the solution here is susceptible to sync-centric race conditions, and generally might be more complicated than we'd like. And it's a bit further committing to doing things in F#-land rather than Darklang land. But, it's a step in the right direction solving for a problem. We'll iterate here over time, for sure.

Comment thread backend/src/LibExecution/ProgramTypes.fs
Comment thread backend/src/LibPackageManager/AstTransformer.fs
@StachuDotNet StachuDotNet merged commit ee70822 into darklang:main Feb 17, 2026
0 of 3 checks passed
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