Skip to content

Commit 61381cb

Browse files
docs: clarify copy semantics vs taxonomy identity in ADR 0011
Distinguishes CompetencyCriteria/CompetencyCriteriaGroup/ObjectTag recreation (copied by value, re-keyed to new object/course ids) from Taxonomy/Tag identity (never duplicated, resolved by reference via export_id). Also defines competency criterion in plain terms with a reference to ADR 0002, and ties "course" to CourseRun (openedx_catalog), reconciling with ADR 0002's course_id.
1 parent a781ec4 commit 61381cb

1 file changed

Lines changed: 41 additions & 13 deletions

File tree

docs/openedx_tagging/decisions/0011-cross-instance-taxonomy-identity.rst

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,23 @@ Proposed
1111
Context
1212
-------
1313

14-
Competency Based Education (CBE) will bring about the use case where, when course content is
15-
copied by any of the three supported mechanisms, a new course run, course export/import, or
16-
course/library copy, any competency criteria attached to that content should be copied along with
17-
it. Competency criteria (``CompetencyCriteria``, ``CompetencyCriteriaGroup``) are versioned via
18-
``django-simple-history`` per :ref:`openedx-learning-adr-0003`, but the taxonomies and tags they
19-
reference are deliberately non-evaluative, unversioned display metadata. Copying a criterion
20-
therefore also means resolving the taxonomy and tags it points to on the target.
14+
Competency Based Education (CBE) introduces ``CompetencyCriteria``: see
15+
:ref:`openedx-learning-adr-0002` for the full model, but in brief, a competency criterion asserts
16+
that a piece of course content demonstrates a specific competency, which it identifies by pointing
17+
at a Tag in a Taxonomy. Criteria are grouped into a ``CompetencyCriteriaGroup`` tree, also defined
18+
in ADR 0002, that combines them with AND/OR logic and may be scoped to a specific course run
19+
(``CourseRun`` in ``openedx_catalog``, identified by the same ``course_key`` that identifies the
20+
corresponding legacy modulestore course; "course" throughout this decision means that same
21+
course-run identity, the one ADR 0002's ``course_id`` references).
22+
23+
When course content is copied by any of the three supported mechanisms, a new course run, course
24+
export/import, or course/library copy, any competency criteria attached to that content should be
25+
copied along with it. Criteria themselves are versioned via ``django-simple-history`` per
26+
:ref:`openedx-learning-adr-0003`, but the taxonomy and tags they reference are deliberately not:
27+
they're non-evaluative display metadata that can change independently without creating a new
28+
version of the criteria pointing at them. Copying a criterion therefore also means resolving the
29+
taxonomy and tags it points to on the target, since the copy has to have a corresponding tag for it
30+
to reference.
2131

2232
No stable, cross-instance identity exists for a ``Tag`` today: ``Tag.external_id`` is an editable,
2333
instance-scoped identifier designed for import-file bookkeeping (see :ref:`openedx-tagging-adr-0006`).
@@ -30,8 +40,10 @@ The three copy mechanisms differ significantly in current maturity:
3040

3141
- **Course export/import** (legacy XBlock/modulestore course): already works, via a ``tags.csv``
3242
sibling file resolved by ``export_id`` at import time.
33-
- **New course run**: always same-instance/same-database. ``copy_tags()`` exists in
34-
``openedx_tagging.api`` but is not wired into the course-rerun flow.
43+
- **New course run**: always same-instance/same-database, so no taxonomy/tag resolution is ever
44+
needed; what's missing is recreating the ``ObjectTag``, ``CompetencyCriteria``, and
45+
``CompetencyCriteriaGroup`` rows for the new run (see Copy semantics, below). ``copy_tags()``
46+
exists in ``openedx_tagging.api`` but is not wired into the course-rerun flow yet.
3547
- **Library copy**: always same-instance today; no cross-instance transport exists in
3648
``content_libraries``, and none is planned.
3749

@@ -74,14 +86,30 @@ no reconciliation applies to them.
7486
Copy semantics
7587
~~~~~~~~~~~~~~
7688

77-
Competency criteria are copied **by reference**: the target's criteria are bound to a taxonomy
78-
sharing the source's ``export_id``, not to an independent duplicate. This is a larger commitment than a
79-
by-value copy, but a by-value copy would leave the target's competency evaluation permanently
80-
disconnected from the taxonomy it depends on, undermining the goal of this use case.
89+
Competency criteria are recreated on the target, not moved. For any of the three mechanisms, the
90+
``ObjectTag``, ``CompetencyCriteria``, and ``CompetencyCriteriaGroup`` rows attached to the copied
91+
content are duplicated and re-keyed to the new object and course ids, using an old-id-to-new-id
92+
mapping built during the copy. A recreated ``CompetencyCriteriaGroup`` shares a parent group with
93+
the original, so the two are combined by ``OR`` by default.
94+
95+
The ``Taxonomy``/``Tag`` rows a recreated ``ObjectTag`` points to are handled differently: they are
96+
never duplicated, only referenced, and it's this taxonomy/tag relationship the rest of this
97+
decision means by **by reference**. For a same-instance mechanism (new course run, library copy),
98+
source and target already share the identical taxonomy row, so no resolution is needed at all. For
99+
a cross-instance mechanism (course export/import), the reference is resolved to whichever taxonomy
100+
on the target shares the source's ``export_id``, per Resolution on import, below. This is a larger
101+
commitment than a by-value taxonomy copy, but a by-value copy would leave the target's competency
102+
evaluation permanently disconnected from the taxonomy it depends on, undermining the goal of this
103+
use case.
81104

82105
Resolution on import
83106
~~~~~~~~~~~~~~~~~~~~~
84107

108+
This section, and Reconciliation on repeat import, below, apply specifically to course
109+
export/import: it is the only mechanism where a matching taxonomy might not already exist on the
110+
target. New course run and library copy need no taxonomy-side resolution at all, per Copy
111+
semantics, above.
112+
85113
On import, whether the source and target are the same deployment or two different organizations'
86114
instances, the behavior is uniform:
87115

0 commit comments

Comments
 (0)