RSS Amplifier

Ash Chronicle · May 30, 2025

Ash Chronicle: Issue #18

0
Sign in to vote or save

Zach Daniel · Ash Chronicle

Welcome to Ash Chronicle — your quick, informal digest of what’s new and notable in the world of Ash Framework. Got something cool? Drop it in the #showcase channel on Discord!

Boy do we have a lot of stuff for you today.

Now when there are files pending code generation, you’re presented with a button to generate code and run migrations. Super nice DX improvement. This is set up for all newly generated projects. TO set it up for your existing project place `plug AshPhoenix.Plug.CheckCodegenStatus` just after `plug Phoenix.CodeReloader` in your endpoint.

Here it is in action!

This powers the plug shown above! Ash’s migration generator is very convenient, but it does come with its own set of challenges. One interesting one is that often, while developing, we want to just make some migrations and not worry about naming them, or how “good” or “right” they are. We’re just going to throw them away and consolidate a nice migration at the end. This working pattern has now been codified with the `--dev` option, which tells us to just give it an auto incrementing name. Then later, you can run `mix ash.codegen finish_some_feature` and we’ll delete those dev migrations, roll them back in your local database, and create one new migration with all the changes for your feature.

IMPORTANT: You should make sure that you have `mix ash.codegen --check` in your CI pipeline to ensure you don’t commit any dev migrations.

Ash.Scope is inspired (very directly) from Phoenix’s introduction of `MyApp.Scope`. It is a protocol to take a module containing, actor, tenant, context etc. and providing it all at once to Ash actions. Read the docs for more.

A common request has been a way to set some piece of context (context is a freeform map on `Ash.Changeset`, `Ash.Query`, and `Ash.ActionInput`) in a way that will be automatically provided to “nested” action calls. You can now do this by setting context into the `shared` key. This is added to the current query, and retained for nested action calls. Read the docs for more.

UsageRules is a development tool for Elixir projects that helps gather and consolidate usage rules from dependencies. The package provides Mix tasks to collect documentation from dependencies that have usage-rules.md files and combine them into a single rules file for your project.

Folks often have trouble pairing Elixir & Ash with LLMs. usage-rules.md is the answer to this! Now, you can get the rules from your packages into your own rules file. We’ve seen this make a *massive* impact on the performance of LLM agents.

If you’re on the latest version of your Ash packages, try it out!

The original version of `ash_ai.gen.chat` did not store tool calls and their results. This means your agents have a sort of “amnesia” about why they did what they did, and what the results were. Now, we store these tool calls and their results, and keep them in the agent’s chat history. You’ll find this to be *significantly* more useful and to make a much more compelling demo. Remember, `ash_ai.gen.chat` is just a starting point/demo, you’re meant to build on it, or build your own. We’ve also made it look much better visually.

Igniter tasks are really cool, but we often need to make sure that we have manual guides that are kept up to date to align with our installation functions. `Igniter.Scribe` is a suite of tools to help with that, from within your igniter task itself. When you run the task with `—scribe` it will generate a markdown file explaining the changes. The new manual installation guide was generated directly from the igniter task! See the Igniter.Scribe docs for mor

  • `Ash.Type.String`, `Ash.Type.CiString` and the built in `match` validation all now warn on the use

    of regexes. OTP 28 no longer supports building regexes at compile time. You’ll see a warning when using them. Now, you provide the regex as a `”string”` or as a tuple in the form of `{“string”, “flags”}`.

  • Introduced `Ash.Scope`, see above for more.

  • Introduced `:shared` context, see above for more.

  • Added `precision` and `scale` constraints to the `:decimal` type.

  • Added `Ash.Error.Framework.PendingCodegen` error, used for the new `AshPhoenix.Plug.CheckCodegenStatus`

  • Support upsert & upsert_identity options in `Ash.Generator.changeset_genereator`

  • Improved `usage-rules.md`

  • Introduced a builtin `:duration` type, with custom functions & operators to go with it

  • Support a `debug?: true` option on `manage_relationship`, which prints out additional information about what is created/updated/destroyed

  • Added a `strict_load` option to `Ash.Query.build`, which loads the provided statement with `strict?: true` set.

  • Add support for recursive sub-reactors

  • Add usage-rules.md

  • Overhaul `ash_ai.gen.chat` visually

  • Store tool calls in `ash_ai.gen.chat`

  • Allow configuring the dev MCP path

  • Add usage-rules.md for AshAi itself

  • Introduce `Igniter.Scribe` and `--scribe` option.

  • Track the task name and parent as keys in the igniter

  • Add `quite_on_no_changes?` assign

  • Add usage-rules.md

  • Added `igniter.init_library` for setupp

  • Add `:number` type that allows integers or floats

  • Make compiled DSL modules (resources, domains etc.) much smaller via under-the-hood optimizations

  • Add various additional fields to pagination metadata

  • Support new codegen tooling from ash upgrade

  • Add support for serializing decimals

  • Add a builtin Argon2 password hashing strategy

  • Improve validation of the results of secret module callbacks

  • handle more formats of params in magic link token endpoints

  • Support the new --dev flag for codegen

  • Support the new scale & precision consstraints for decimal types

  • Support strict tables DSL option

  • Support the new --dev flag for codegen

  • Add `on_error_fails_job?` option for triggers

  • Add usage-rules.md

  • Support `Ash.Scope` in forms

  • Add `AshPhoenix.Plug.CheckCodegenStatus`

  • add usage-rules.md

No posts

Read the original on ashchronicle.substack.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.