Skip to content

Commit bde718b

Browse files
docs: clarify rule_payload json
1 parent 6f0d2cc commit bde718b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/decisions/0022-competency-criteria-model.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Decision
121121
3. `course_id`: The `course_id` of the course that this competency rule profile is scoped to. Null if it is not scoped to a specific course.
122122
4. `competency_taxonomy_id`: The `oel_competency_taxonomy.taxonomy_ptr_id` of the competency taxonomy that this competency rule profile is scoped to.
123123
5. `rule_type`: “View”, “Grade”, “MasteryLevel” (Only “Grade” will be supported for now)
124-
6. `rule_payload`: JSON payload keyed by `rule_type` to avoid freeform strings. Examples:
124+
6. `rule_payload`: JSON payload keyed by `rule_type` to avoid freeform strings. It is structured JSON (not arbitrary freeform data): each `rule_type` defines the allowed payload shape and required keys, and validation enforces this contract. JSON is used instead of fixed columns like `op`, `value`, and `scale` so that future rule types (for example, `MasteryLevel` thresholds or plugin-defined evaluators such as CEL-based rules) can add their own fields without repeated schema migrations or many nullable columns. Examples:
125125

126126
1. `Grade`: `{"op": "gte", "value": 75, "scale": "percent"}`
127127

@@ -142,7 +142,7 @@ Decision
142142
3. `oel_tagging_objecttag_id`: Tag/Object Association id
143143
4. `competency_rule_profile_id`: Nullable FK to the `CompetencyRuleProfile` applied to this criterion. If null, evaluate using fallback lookup order: taxonomy-scoped profile, then course-scoped profile, then organization-scoped profile, then system default.
144144
5. `rule_type_override`: Nullable enumerated rule type: “View”, “Grade”, “MasteryLevel” (Only “Grade” will be supported for now). When set, this overrides the `rule_type` in the associated `CompetencyRuleProfile` for this criterion.
145-
6. `rule_payload_override`: Nullable JSON payload keyed by `rule_type` to avoid freeform strings. When set, this overrides the `rule_payload` in the associated `CompetencyRuleProfile` for this criterion. Examples:
145+
6. `rule_payload_override`: Nullable JSON payload keyed by `rule_type` to avoid freeform strings. When set, this overrides the `rule_payload` in the associated `CompetencyRuleProfile` for this criterion. The same typed/validated payload contract as `rule_payload` applies. Examples:
146146

147147
1. `Grade`: `{"op": "gte", "value": 75, "scale": "percent"}`
148148

0 commit comments

Comments
 (0)