ShtukbaseStandard
package page→ /norms/rules.md

pages/norms/rules.md

162 lines, 5.7 KB. As a page.

  1. ---
  2. type: Collection
  3. title: Rules
  4. icon: "📏"
  5. description: One checkable phrase at level MUST, SHOULD or MAY. A rule has an enforcer; a rule without an enforcer is a wish.
  6. itemType: Rule
  7. items: {mode: path, path: /norms/rules, recursive: true}
  8. writeTo: /norms/rules
  9. properties:
  10. ruleId:
  11. kind: text
  12. label: "Number"
  13. pinned: true
  14. requirement:
  15. kind: text
  16. label: "What must hold"
  17. level:
  18. kind: select
  19. label: "Level"
  20. options:
  21. - {name: MUST, label: "Must (MUST)", color: red}
  22. - {name: SHOULD, label: "Should (SHOULD)", color: blue}
  23. - {name: MAY, label: "May (MAY)", color: gray}
  24. floor:
  25. kind: checkbox
  26. label: "Law and safety"
  27. status:
  28. kind: phase
  29. contour: /norms/contours/rules
  30. label: "State"
  31. sphere:
  32. kind: text
  33. label: "Sphere"
  34. appliesTo:
  35. kind: text
  36. label: "Applies to"
  37. enforcers:
  38. kind: text
  39. label: "Enforcers (paths)"
  40. plannedEnforcer:
  41. kind: text
  42. label: "What the enforcer will be"
  43. enforcerKind:
  44. kind: select
  45. label: "Enforcer kind"
  46. options:
  47. - {name: gate, label: "Gate (check)", color: green}
  48. - {name: sensor, label: "Sensor", color: brown}
  49. - {name: hook, label: "Hook", color: orange}
  50. - {name: automation, label: "Automation", color: blue}
  51. - {name: judge, label: "Judge", color: purple}
  52. - {name: instruction, label: "Instruction", color: gray}
  53. mode:
  54. kind: select
  55. label: "Enforcer mode"
  56. options:
  57. - {name: observe, label: "Watches", color: gray}
  58. - {name: warn, label: "Warns", color: yellow}
  59. - {name: enforce, label: "Blocks", color: red}
  60. followsFrom:
  61. kind: text
  62. label: "Follows from"
  63. because:
  64. kind: text
  65. label: "Why"
  66. baseline:
  67. kind: text
  68. label: "Known violations"
  69. reviewBy:
  70. kind: date
  71. label: "Review by"
  72. overrides:
  73. kind: text
  74. label: "Overrides (norm number of a package)"
  75. pack:
  76. kind: text
  77. label: "Package"
  78. rail:
  79. kind: text
  80. label: "Line for the agent"
  81. evidence:
  82. kind: text
  83. label: "Where it comes from"
  84. states:
  85. hold:
  86. provider: rule.hold
  87. words:
  88. - {name: holder-down, label: "Enforcer is broken", tone: trouble}
  89. - {name: leaking, label: "Leaking", tone: trouble}
  90. - {name: noisy, label: "Noisy", tone: attention}
  91. - {name: by-nothing, label: "No enforcer", tone: attention}
  92. - {name: only-asked, label: "Only a request", tone: calm}
  93. - {name: held, label: "Holds", tone: good}
  94. views:
  95. - id: rules--table
  96. name: All rules
  97. layout: table
  98. fields: {}
  99. sorting:
  100. - {propertyId: ruleId, direction: ascending}
  101. properties:
  102. - {name: ruleId, visible: true}
  103. - {name: title, visible: true, width: 380}
  104. - {name: level, visible: true}
  105. - {name: floor, visible: true}
  106. - {name: status, visible: true}
  107. - {name: enforcerKind, visible: true}
  108. - {name: enforcers, visible: true}
  109. - {name: pack, visible: true}
  110. - id: rules--board
  111. name: By state
  112. layout: board
  113. fields: {}
  114. board:
  115. preview: page-content
  116. cardSize: small
  117. wrap: true
  118. grouping:
  119. by: status
  120. colorBy: status
  121. sorting:
  122. - {propertyId: ruleId, direction: ascending}
  123. properties:
  124. - {name: ruleId, visible: true}
  125. - {name: title, visible: true}
  126. - {name: level, visible: true}
  127. - {name: pack, visible: true}
  128. - id: rules--by-level
  129. name: By level
  130. layout: board
  131. fields: {}
  132. board:
  133. preview: page-content
  134. cardSize: small
  135. wrap: true
  136. grouping:
  137. by: level
  138. colorBy: level
  139. sorting:
  140. - {propertyId: ruleId, direction: ascending}
  141. properties:
  142. - {name: ruleId, visible: true}
  143. - {name: title, visible: true}
  144. - {name: enforcerKind, visible: true}
  145. - {name: status, visible: true}
  146. ---
  147. A rule is one checkable phrase: "sending anything outside to third parties only after the owner's yes". The title is short; the phrase itself goes in the "What must hold" field (`requirement`).
  148. This is the native Shtukbase type `Rule`: the node reads `requirement`, `status`, `sphere`, `appliesTo` and `enforcers`, and computes by itself whether the rule holds (`rule.hold`). Packages add to it a number, a level, a floor mark, the enforcer's kind and mode, and a line for the agent.
  149. - **Level** (`level`): MUST is mandatory; SHOULD can be departed from with a written decision; MAY is permitted.
  150. - **Law and safety** (`floor`): such a rule cannot be weakened by a waiver or by a project decision.
  151. - **Enforcers** (`enforcers`): links to whatever watches the rule. An enforcer comes in different kinds: a check (an action with `check: true`), a sensor, a hook, a judge; there are also an automation, a skill and an instruction. Only a link, not text. While there is no enforcer, `plannedEnforcer` says what it will be. `enforcerKind` says which kind of enforcer it is.
  152. - **Mode** (`mode`): a new enforcer first watches (`observe`), then warns (`warn`), then blocks (`enforce`).
  153. - **Known violations** (`baseline`): what is already violated and tolerated for now; this number only goes down.
  154. A MUST with no enforcer, at the steps "structure, rights, gates, tests, judge, audit", is really a SHOULD: `package norms-audit` will show it. "Holds" is not a state that is set by hand: the node computes it from the enforcers.
  155. Contour: candidate → active → paused; rejected on the side. Making a rule active or pausing it is the owner's decision.
  156. A project's own norm that refines or replaces a package norm names it in the "Overrides" field (`overrides`): a number, for example `AUT-R01`. It can only be overridden with a stricter norm. If the own norm is weaker than a norm marked "Law and safety" (a lower level, or paused), `package norms-audit` will show it as a floor violation.