DRAFT CLUE-610: make classWide the kind, move slot identity to a variant - #2963
Closed
scytacki wants to merge 1 commit into
Closed
DRAFT CLUE-610: make classWide the kind, move slot identity to a variant#2963scytacki wants to merge 1 commit into
scytacki wants to merge 1 commit into
Conversation
…nt [CLUE-610] Every class-wide document now shares the built-in classWide kind, which carries the axis values they all have. A new stored `variant` says which one a document is: it labels the canonical slot, hooks the stylesheet, and names the document when nothing else can. Kinds are all written in code again, so the registry resolves the same in every session and getKindDefinitionFor has nothing left to scope. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## CLUE-610-store-class-wide-titles #2963 +/- ##
====================================================================
- Coverage 69.98% 69.96% -0.03%
====================================================================
Files 973 973
Lines 55838 55839 +1
Branches 14736 14738 +2
====================================================================
- Hits 39076 39065 -11
- Misses 16728 16740 +12
Partials 34 34
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
collaborative-learning
|
||||||||||||||||||||||||||||
| Project |
collaborative-learning
|
| Branch Review |
CLUE-610-class-wide-kind-variant
|
| Run status |
|
| Run duration | 03m 38s |
| Commit |
|
| Committer | Scott Cytacki |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
4
|
| View all changes introduced in this branch ↗︎ | |
This was referenced Aug 14, 2026
Member
Author
|
We decided not to go in this direction. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft, stacked on #2962 (which is stacked on #2949) — not meant to merge. It answers the second half of the review question: if
classWidewere the kind and a new field held each document's identity, what would actually change?It is stacked on the stored-titles PR deliberately. Both changes delete some of the same code, so measuring each against #2949 would let them both claim the same savings.
The change
classWideis a built-in kind carrying the axis values every class-wide document shares (class owner, classUnit container, concurrent). A new storedvariantsays which one a document is. The unit config declares{ variant, title }instead of{ kind, title }.What actually gets simpler
Real, and worth naming precisely: the registry stops being dynamic. Kinds are all written in code, so a kind name resolves the same in every session and for every document.
registerClassWideDocumentKindis gone, along with the try/catch-and-skip registration path at startup.getKindDefinitionForandIDocumentKindInfo.unitare gone. With one definition that is always present, there is no question of which definition applies.getDocumentOwner's rule that a document may only be created for a kind the current unit defines is gone, along with its rationale.That is a genuine reduction in conceptual load, more than in code.
What does not get simpler
The dynamic string survives with its constraints intact. Everything the authored
kindhad to satisfy,variantnow satisfies:isValidDocumentKind's camelCase check before a document is created from it.seenset.Two sites were forced to move from
kindtovariant, because the kind no longer distinguishes anything:getDocumentKindLabel(kind)would render every untitled class-wide document as "Class Wide".A new stored field costs plumbing:
IDocumentMetadata,DocumentMetadataModel,DocumentModeland its metadata view, the create path, and the open path.Net
+194 / −238 across 17 files. The deletions are real, and concentrated in the registry and its documentation. The additions are the variant and its plumbing.
The honest summary is that this relocates the dynamism rather than removing it. A unit config still declares an open-ended set of runtime strings; they are just called variants and no longer key a registry. What is removed is the registry's dynamism — one definition, always present, centrally enumerable — which is a genuine benefit, and the one the "confidence that all axis combinations are supported" argument actually rests on.
What did not happen
No axis-based read was forced to become a kind lookup.
hasClassOwner,concurrent,isInClassUnitContainer, andisAboutUnitOnlyall still answer their questions from stored fields, and Sort Work's sectioning and the edit gate are untouched.But
doc.kind === "classWide"is now a correct, cheap, registry-free one-liner at the two Sort Work sectioning sites that currently askhasClassOwner, and at the edit gate that composesconcurrentwithisInClassUnitContainer. Nothing forces the substitution; nothing discourages it either. Whether that matters depends on how much weight the axes design puts onkindnever being branched on.Not included
kind: "<slot>"and no variant. They would needkindrewritten toclassWideandvariantset from the old kind. It is a straightforward script — the documents are selectable bytype == "group" && !groupId, the same way the existing backfill selects them — but it is worth noting that this migration is exactly the kind of thing the "it would be hard to migrate class-wide documents" argument was concerned about, and it is not hard.canonicalfield, and never look atkind.