Skip to content

[Arch] Determine Competency ID field strategy for taxonomy competency data #625

Description

@mgwozdz-unicon

Architecture Spike: Determine Competency ID field strategy for taxonomy competency data

Use Case

As a Platform Administrator, I want a stable, human-readable Competency ID visible for each competency in the Competency Management UI and on the assignment workflow, so that I can reference and communicate specific competencies using a meaningful identifier that my institution recognizes.

Description

Current behavior

The existing tag/taxonomy data model exposes several identifier fields per tag: an internal PK (id, never user-visible), a stable external reference (uuid), and a client-meaningful key (_key / key). None of these is designed for use as a human-readable Competency ID in a management UI or assignment workflow. No such field currently exists.

Requested change

Determine the ID field strategy for competency taxonomies: which field or fields represent the Competency ID, how the ID is assigned, and how it behaves across import, re-import, API retrieval, and UI display. This spike produces a documented recommendation for the data model implementation ticket — not code.

Key constraints the recommendation must respect:

  • This is an internal identifier. If CASE IDs or CTDL IDs are added in the future, they are separate fields with their own semantics — this ID is not a CASE ID.
  • Changes to the data model are additive; existing identifier fields are not replaced.
  • The recommendation must be approved by the engineering team and the Open edX community.

Acceptance Criteria

This is an architecture spike. The deliverable is a documented technical recommendation, not working code. There is no Gherkin and no QA path.

  • Recommendation document published (see Open Questions for format).
  • Recommendation specifies whether a new field is added or an existing field is repurposed, and justifies the choice.
  • ID assignment strategy decided and documented (see Open Questions).
  • Uniqueness scope decided: within a taxonomy, globally, or advisory only.
  • Import and re-import behavior specified: whether the ID is preserved, overwritten from the import file, or conflict-flagged.
  • API serialization specified: which field is exposed and under what name.
  • Backward compatibility and migration implications documented.
  • Recommendation reviewed and approved by the engineering team and Open edX community.
  • All Open Questions resolved before this ticket is closed.

Open Questions

  1. ID assignment strategy (architect, blocking): Two options:

    • Option A (auto-generate with override): derive a default from the competency name — initials of each word plus a hierarchical position suffix (e.g., PK-1, PK-1.2, PK-1.2.3 for root / second level / third level). User can override. The exact format of the suffix is part of what this spike defines.
    • Option B (user-entered only): field is blank until the operator supplies a value. No auto-generation.

    Option B is simpler to implement and avoids the edge case where a name change silently invalidates a previously meaningful auto-generated ID. Which fits the operator use case better?

  2. Uniqueness scope (architect): Must the Competency ID be unique within a taxonomy, unique globally across all competency taxonomies, or is it advisory (displayed but not enforced)?

  3. Re-import behavior (architect): On re-import, is the stored Competency ID preserved, overwritten if the import file includes an ID column, or always preserved (import file ID column ignored)? What import file column, if any, maps to this field?

  4. Recommendation format (architect): ADR under docs/decisions/, a GitHub discussion for community comment, or both? The community approval requirement suggests at minimum a public discussion before the ADR is finalized.

Context for the Architect

Existing data model identifiers (see src/openedx_tagging/core/tagging/models/):

  • id — internal PK, never user-visible
  • uuid — stable external reference
  • _key / key — client-meaningful, the DB field used in tagging operations

UX context: The existing UX designs for the Competency Management page and the assignment workflow show a visible Competency ID per competency. This ID appears on the control used to apply a competency to an assignment. The exact field this maps to is what this spike must determine.

Architect's current position (starting point, not a decision):

The Competency ID should be an internal identifier. CASE IDs and CTDL IDs, if added, are separate fields — conflating them (as has been suggested in the past) mixes internal and external identifier semantics and will cause problems when institutions want both.

The natural auto-generation scheme is: initials of each word in the competency name plus a hierarchical depth/position suffix. However, Option B (user-entered only) is likely simpler and avoids name-change invalidation. This is the core design question the spike should resolve with team and community input.

Activity

  1. moved this from Todo to Needs additional details in Competency Criteria and Student Progresson Jul 2, 2026
  2. mgwozdz-unicon commented on Jul 3, 2026

    @mgwozdz-unicon
    ContributorAuthor

    Posting the coordination notes that came out of drafting docs/openedx_tagging/decisions/0010-tag-code-field.rst in #637 (the recommendation this issue asks for) — these don't belong in the ADR itself, but need to be tracked somewhere.

    Dependency direction with #613 (not #614). ADR 0010 adds a tag_code_required property to the base Taxonomy class in openedx_tagging, defaulting to false. The CompetencyTaxonomy model that #613 builds needs to override that property to return True. That means ADR 0010's property should land before or alongside #613, not after it — #613 depends on this ADR, not the other way around. #614 (the taxonomy_type endpoint field) is a sibling to this ADR; neither blocks the other.

    Open risk: #634. "Taxonomy subclasses: embrace or deprecate?" is an unresolved architecture discussion that questions the proxy-subclass / Taxonomy.cast() pattern this ADR's tag_code_required mechanism relies on (it's the same pattern already used for system-defined taxonomies). If that discussion concludes subclassing should be deprecated, this ADR's enforcement mechanism needs to be redesigned. Worth resolving #634 before or alongside this ADR.

    Pre-existing bug found, needs its own ticket. While designing the completeness rule, we found that import_export/api.py's _import_validations() casts a taxonomy to its concrete subclass locally but discards the result, so the caller's original (possibly uncast) taxonomy instance keeps flowing through the rest of the import. No shipped taxonomy subclass has exercised this path before, so it's never surfaced — but this ADR's completeness check depends on reading the taxonomy's true type, so it needs a small fix (return and use the cast instance) before or alongside implementing this ADR. Filing as a separate bug ticket rather than folding into the ADR.

    Ticket sequence this ADR corresponds to. This issue (#625) is "Determine..."; ADR 0010's Decision section is the spec for the next ticket in the planned sequence (add Tag.code + the completeness rule to the data model). The remaining tickets (expose on GET endpoints, add to import, add to export, display in the Competency Management UI, docs/release notes) aren't filed yet.

  3. moved this from Needs additional details to Ready for Community Review in Competency Criteria and Student Progresson Jul 3, 2026
  4. mgwozdz-unicon commented on Jul 8, 2026

    @mgwozdz-unicon
    ContributorAuthor

    This has been addressed in this ADR PR: #637

    The ADR can now be read on the main branch today from here: https://github.com/openedx/openedx-core/blob/main/docs/openedx_tagging/decisions/0010-mutable-tag-external-id.rst

  5. thelmick-unicon commented on Jul 8, 2026

    @thelmick-unicon

    Hi @ormsbee . This has been addressed via the ADR PR: #637 . Can you review and comment to approve this issue so we can complete the approval process? Thanks!

  6. moved this from Ready for Community Review to Final Axim Review in Competency Criteria and Student Progresson Jul 8, 2026
  7. ormsbee commented on Jul 10, 2026

    @ormsbee
    Contributor

    Looks great, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions