Skip to content

allium skills: document invariant+@guidance pattern for complex semantics #8

@markaddleman

Description

@markaddleman

Context

When Allium behaviors are too complex to express as trigger/ensures rules (e.g., concurrent iteration, parallel merge, heterogeneous collection processing), there's a useful workaround pattern that isn't documented in the allium skills.

Pattern

Use invariant Name { true } with an @guidance block for prose:

invariant ParallelMerge { true }
@guidance """
All parallel branches execute concurrently.
Results are merged into the parent entity when all branches complete.
"""

The checker accepts this; the meaningful content lives in the guidance annotation.

Request

Document this pattern in the allium skills (likely allium:tend or a new "Spec Authoring Patterns" section) explaining:

  • When to use formal rules vs invariant+@guidance
  • Reserve formal rules for entity state transitions and attribute causality
  • Use invariants+@guidance for behaviors involving collection processing or multi-phase concurrency

Source

Discovered during wemble issue #109 — parallel/iterate/cond semantics couldn't be expressed cleanly with Allium rule syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions