feat: Add aspect composition support (gt-8tmz.5)

- Add Aspects field to ComposeRules for listing aspect formulas
- Apply aspects during cooking after expansions
- Aspects are loaded by name and their advice rules are applied

Usage in formula:
  "compose": {
    "aspects": ["security-audit", "logging"]
  }

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-25 12:15:12 -08:00
parent de1a9559fa
commit 516c62e543
3 changed files with 27 additions and 3 deletions

View File

@@ -210,6 +210,12 @@ type ComposeRules struct {
// Map applies an expansion template to all steps matching a pattern.
// Each matching step is replaced by the expanded template steps.
Map []*MapRule `json:"map,omitempty"`
// Aspects lists aspect formula names to apply to this formula.
// Aspects are applied after expansions, adding before/after/around
// steps to matching targets based on the aspect's advice rules.
// Example: ["security-audit", "logging"]
Aspects []string `json:"aspects,omitempty"`
}
// ExpandRule applies an expansion template to a single target step.