Bow Tie Kreative Writing System

The model

Boolean and Decision Logic

Conditions are Boolean trees over named facts. Branches are explicit. Exceptions are declared, not implied.

Condition trees

combinators
all
AND: every child condition must be true.
any
OR: at least one child condition must be true.
not
NOT: invert one child condition.
predicates
  • exists
  • missing
  • eq
  • neq
  • gt
  • gte
  • lt
  • lte
  • in
  • not_in
  • contains
  • not_contains
  • matches
  • count_gt
  • count_gte
  • count_lt
  • count_lte
  • ratio_gt
  • ratio_lt
  • changed
  • unchanged
path convention
Dot notation addresses an analyzed text model, such as sentence.voice or document.audience.knowledge_level.

Decision shape

if
when
then
ordered actions applied when the condition is true
else
ordered actions applied when the condition is false
and
all
or
any
not
not
exception
unless

Action vocabulary

The 25 verbs a rule may call for. The engine groups them by what they demand of you: change the text, check something, or ask for context.

  • retain
  • flag
  • annotate
  • replace
  • delete
  • insert
  • move
  • split
  • merge
  • reorder
  • align
  • convert
  • define
  • expand
  • compress
  • qualify
  • cite
  • verify
  • request_evidence
  • request_context
  • select_template
  • measure
  • test_with_reader
  • escalate_review
  • block_publication

Evaluation order

  1. validate_input
  2. apply_hard_constraints
  3. apply_context_defaults
  4. evaluate_exceptions
  5. rank_heuristics
  6. choose_smallest_sufficient_intervention
  7. run_regression_checks

Conflict resolution

When two rules disagree, these decide which wins.

If

  • ALL
    • rule_a.strength eq "hard_constraint"
    • rule_b.strength neq "hard_constraint"

Then

rule_a

If

  • ALL
    • rule_a.strength eq "hard_constraint"
    • rule_b.strength eq "hard_constraint"

Then

request_context_or_escalate

If

  • ALL
    • rules.strength eq "default"
    • context.genre in [dialogue, poetry, experimental_prose]

Then

allow_documented_exception

If

  • ANY
    • change.damages_accuracy eq true
    • change.damages_accessibility eq true
    • change.damages_safety eq true

Then

reject_change

The rule schema

Every rule record validates against this JSON Schema (Draft 2020-12).

05-rule-schema.json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://bowtiekreative.com/schemas/laka-writing-rule.schema.json",
  "title": "LAKA Writing Rule",
  "type": "object",
  "required": [
    "id",
    "name",
    "domain",
    "layer",
    "strength",
    "human_logic",
    "when",
    "then",
    "else",
    "because",
    "source_ids",
    "laka"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Z]{2,5}-[0-9]{3}$"
    },
    "name": {
      "type": "string",
      "minLength": 3
    },
    "domain": {
      "type": "string"
    },
    "layer": {
      "enum": [
        "signal",
        "grapheme",
        "morpheme",
        "word",
        "phrase",
        "clause",
        "sentence",
        "paragraph",
        "section",
        "document",
        "content_system"
      ]
    },
    "strength": {
      "enum": [
        "hard_constraint",
        "context_default",
        "heuristic",
        "creative_option"
      ]
    },
    "human_logic": {
      "type": "string"
    },
    "when": {
      "$ref": "#/$defs/condition"
    },
    "then": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/action"
      },
      "minItems": 1
    },
    "else": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/action"
      },
      "minItems": 1
    },
    "unless": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/condition"
      }
    },
    "because": {
      "type": "string"
    },
    "diagnostics": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "examples": {
      "type": "object"
    },
    "source_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 1
    },
    "laka": {
      "type": "object"
    }
  },
  "$defs": {
    "condition": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "all"
          ],
          "properties": {
            "all": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/condition"
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "any"
          ],
          "properties": {
            "any": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/condition"
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "not"
          ],
          "properties": {
            "not": {
              "$ref": "#/$defs/condition"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "path",
            "operator"
          ],
          "properties": {
            "path": {
              "type": "string"
            },
            "operator": {
              "type": "string"
            },
            "value": {}
          }
        }
      ]
    },
    "action": {
      "type": "object",
      "required": [
        "action",
        "target"
      ],
      "properties": {
        "action": {
          "type": "string"
        },
        "target": {
          "type": "string"
        }
      },
      "additionalProperties": true
    }
  }
}