Skip to content

Extend global config directive to accept pattern specifiers - #1035

Open
juniper-shopify wants to merge 1 commit into
mainfrom
juniper/global-config-specifiers
Open

Extend global config directive to accept pattern specifiers#1035
juniper-shopify wants to merge 1 commit into
mainfrom
juniper/global-config-specifiers

Conversation

@juniper-shopify

@juniper-shopify juniper-shopify commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Extend the global config directive to accept optional pattern specifiers, mirroring the existing support in cog-type blocks (agent, chat, cmd, etc.).

Note: name-specific specifiers are not implemented, only patterns. Cog names must be unique across all cog types, so there's no reason to use a name-specific global block.

Motivation

Currently, global { ... } can be used to apply certain high-level configuration parameters to every cog unconditionally. Regexp matchers can be used to apply configuration to groups of cogs of a single type. But when cogs of multiple different types exist in a logical group, there is no way to apply common configuration to all of them in a single block.

This feature enables:

config do
  global(/^api_/) { abort_on_failure! }          # matches cogs of all types with this pattern
  global { working_directory("/tmp") }           # bare (existing behavior)
end

@juniper-shopify
juniper-shopify force-pushed the juniper/global-config-specifiers branch from eea4c12 to 7885b6c Compare July 17, 2026 21:47

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@juniper-shopify
juniper-shopify force-pushed the juniper/global-config-specifiers branch 3 times, most recently from 6a362d5 to 635c9d5 Compare July 17, 2026 21:54
@juniper-shopify juniper-shopify changed the title 🤖 → feat: extend global config directive to accept name/pattern specifiers Extend global config directive to accept pattern specifiers Jul 17, 2026
@juniper-shopify
juniper-shopify marked this pull request as ready for review July 17, 2026 21:59
@juniper-shopify
juniper-shopify force-pushed the juniper/global-config-specifiers branch from 635c9d5 to b589675 Compare July 17, 2026 22:01
Allow `global(:step_name)` and `global(/pattern/)` in Roast config blocks,
mirroring the existing name/pattern specifier support in cog-type blocks
(agent, chat, cmd, etc.).

This enables targeted cross-cutting configuration like:
  global(:my_step) { async! }
  global(/^api_/) { abort_on_failure! }

The merge cascade expands from 4 tiers to 7:
  1. global (bare)
  2. global (regexp match)
  3. global (exact name)
  4. cog-type general
  5. cog-type regexp match
  6. cog-type exact name
  7. inline YAML

Also cleans up a vestigial `instance_variable_get(:@values)` call
to use the public `.values` accessor instead.
@juniper-shopify
juniper-shopify force-pushed the juniper/global-config-specifiers branch from b589675 to 519635c Compare July 17, 2026 22:02
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.

1 participant