Skip to content

Rule book: rules as versioned content published through change sets #2634

Closed

Description

@pournasserian

Part of #2419 (F-RUL). The first slice: the rule aggregate, stored as versioned content and published through change sets (RUL-01, RUL-02, RUL-03). It builds on the change set writes of #2520 (SCH-05).

Scope

  • Core (FluentCMS.Core.Rules):
    • A rule has a slug and a definition: its kind, prose text, scope and severity.
      • Kinds (RUL-02): voice and style, factual, structural, and permission and routing.
      • The scope (RUL-03) names content types and fields, and keeps a locale slot that nothing reads in M1.
      • Severity is block or warn.
    • A rule's status follows its versions (RUL-03):
      • draft until a version is published
      • active while a published version is live
      • retired once a change set retires it
    • IRuleDirectory:
      • read the list, the latest version, the active version, and any earlier version
      • create, revise and retire, each into a ChangeSetTarget
    • Each write stores a version and records it as an operation of its change set, with their audit events in one unit of work. A write never changes what is active; only publishing its change set does.
    • Only a person writes rules (M1: any administrator); an agent and an engine are refused. Agents read the rule book in a later slice.
  • Change sets: publish, revert and the diff handle rule items, as they handle content types.
  • Infrastructure: tables for rules and their versions, with migrations for SQLite and PostgreSQL.
  • CONTRIBUTING.md: rules.

Out of scope

  • Proposing checks from a rule (RUL-04), enforced and advisory labelling and the agent tools (RUL-05, RUL-06), the instruction check on rule text (RUL-07), and proposing a rule from the desk (RUL-08): the epic's next slices.
  • Evaluating permission and routing rules (F-RTE), locale scopes in use (I18-02), and a rule author role (USR-02).

Acceptance

  • A person writes "never claim best in class" as a voice and style rule for product pages into a change set. It is a draft at version 1 until the set is published, then active.
  • A revision stores version 2 and leaves version 1 active until its set is published.
  • Retiring a rule through a change set retires it when the set is published, and reverting that set makes it active again.
  • The change set's diff shows a rule's text and scope before and after.
  • A rule without text, with an unknown kind or severity, or with a slug already taken, is refused with what to change, and nothing is stored.
  • An agent and an engine are refused every rule write.
  • Everything above passes on SQLite and PostgreSQL, with migrations for both and a working Down.

Activity

  1. added a commit that references this issue on Oct 19, 2026
    7fb06d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:rulesRule book (RUL)type:featureNew capabilityv2FluentCMS v2 (v2 branch)

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions