Norms
Where a project keeps its rules, principles, defaults, tenets and waivers, their contours, and checks for the form of the norms themselves.
About the package
Where a project keeps its norms and how a rule becomes active. The package brings five collections (rules, principles, defaults, tenets, waivers) and four contours (tenets have no contour). The collections and contours are taken from the old norms layer package, unchanged.
From the old norms package std-norm-system only the norms whose enforcer is a check of this package were taken: NS-R01 (strength words), NS-R03 (a waiver as a record), NS-R04 (the floor, the part about waivers), NS-R05 (review date). The rule NS-R07 "every norm must have an enforcer" was added during assembly. Principles and defaults in std-norm-system have no enforcer check, so they did not come over.
The context action is not a check: it prints the active rules as a list, to put them into an agent's context.
Boundary: the package does not bring the layer page norms.md and the layer ontology, the tenet records themselves (they are in the old package base-tenets) and the rule-map lens. Rule pages of other packages live in /norms/rules/<package>/ and are checked by the same checks.
Norms 5
| ID | Norm | Level | Mode | Enforcer |
|---|---|---|---|---|
| NS-R01 | The level field of a rule is MUST, SHOULD or MAY, and of a default is SHOULD; the words are understood as in RFC 2119 and RFC 8174. |
MUST | blocks | check |
| NS-R03 | Not following a MUST or SHOULD of an installed package is recorded as a Waiver record with the fields rule, where, because, simplerRejected, allowedBy and expires. |
MUST | blocks | check |
| NS-R04 | A norm with floor: true is not overridden by a waiver, a narrower level or the contract; on a conflict with it, work on that point stops and the question goes to the owner. |
MUST | blocks | check |
| NS-R05 | A package and a norm with shelfLife.class: fast have reviewBy filled; a norm whose reviewBy date has passed goes onto the review list. |
SHOULD | warns | check |
| NS-R07 | Every rule has enforcers (paths to the enforcers) filled or, while there is no enforcer, plannedEnforcer; a rule with mode: enforce has a non-empty enforcers field and every path in it exists in the project. |
MUST | blocks | check |
"Blocks": the enforcer stops a violation. "Observes": it only notes it. Level MUST means required; SHOULD means yes by default.
Actions 6
| Name | What it does | File | When |
|---|---|---|---|
| levels | Norm strength is MUST, SHOULD or MAY norm NS-R01 | checks/levels.ts | check |
| waivers | A waiver is written in full and has not expired norm NS-R03 | checks/waivers.ts | check |
| floor | No open waivers from floor norms norm NS-R04 | checks/floor.ts | check |
| review | The norm's review date has not passed norm NS-R05 | checks/review.ts | check |
| enforcers | A norm has an enforcer; for "blocks" the enforcers exist in the project norm NS-R07 | checks/enforcers.ts | check |
| context | Active rules as a list for the agent's context | checks/context.ts | shtuk run |
shtuk check runs the checks; shtuk run norms-core <name> runs any action. "After install" actions run by themselves only if the package comes from a trusted source.
Pages 30
They go into the project at these paths.
- /norms/
- Defaults collection
- Principles collection
- Rules collection
- Tenets collection
- Waivers collection
- /norms/contours/
- Defaults contour
- Principles contour
- Rules contour
- Waivers contour
- /norms/contours/defaults/
- Active contour phase
- Candidate contour phase
- Replaced contour phase
- Retired contour phase
- /norms/contours/principles/
- Accepted contour phase
- Candidate contour phase
- Replaced contour phase
- Retired contour phase
- /norms/contours/rules/
- Active contour phase
- Candidate contour phase
- Paused contour phase
- Rejected contour phase
- /norms/contours/waivers/
- Allowed contour phase
- Closed contour phase
- Refused contour phase
- Requested contour phase
- /norms/rules/norms-core/
- Norm strength is one of the words MUST, SHOULD, MAY NS-R01
- A waiver is only a record with a reason and a deadline NS-R03
- The floor is not weakened NS-R04
- A fast norm has a review date NS-R05
- A norm must have an enforcer NS-R07
Package files 8
They go into .shtukbase/packages/norms-core/; actions run from there.