Improve schema and user input type documentation#3357
Conversation
🗄️ Schema Change: No Changes ✅ |
|
Size Change: 0 B Total Size: 486 kB ℹ️ View Unchanged
|
🛠️ Item Splitting: No Changes ✅ |
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (def849b) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR3357If you are working in Khan Academy's frontend, you can run the below command. ./dev/tools/bump_perseus_version.ts -t PR3357If you are working in Khan Academy's webapp, you can run the below command. ./dev/tools/bump_perseus_version.js -t PR3357 |
## Summary: In #3357 the Schema Check [triggered](#3357 (comment)) but the changes were all in code comments. None of these would alter the structure of any Perseus schema types and so it's a false positive and clutters the PR. This PR changes the `tsc` command to strip comments so that the resulting comparison files are only code/types. This should eliminate these types of false positives, but retain type/schema safety. Issue: LEMS-3949 ## Test plan: I added a change that should affect the schema and the schema check triggered. <img width="672" height="552" alt="image" src="https://github.com/user-attachments/assets/250546f5-4365-4feb-8eef-ad01af68cfd3" /> I removed above change, added a comment-only change and the schema check cleared. <img width="880" height="183" alt="image" src="https://github.com/user-attachments/assets/1068da1e-a309-45bd-9083-a80049a6b40b" /> Click the "Edited" button on the Schema Change comment to see earlier runs of the check (as well as its output). <img width="646" height="211" alt="image" src="https://github.com/user-attachments/assets/2a84b441-ea3d-439e-a1c0-98f219ebf5f4" /> Success! Author: jeremywiebe Reviewers: claude[bot], anakaren-rojas Required Reviewers: Approved By: anakaren-rojas Checks: ⏭️ 1 check has been skipped, ✅ 10 checks were successful Pull Request URL: #3359
| * A dictionary of {[imageUrl]: PerseusImageDetail}. | ||
| * A dictionary of {[imageUrl]: {@link PerseusImageDetail}}. | ||
| * | ||
| * @deprecated Use of inline images is deprecated in Perseus. Please use an |
There was a problem hiding this comment.
@nishasy @ivyolamit this is correct right? Inline image use is deprecated (thinking to dissuade AI agents that might see this field and want to use inline images)
There was a problem hiding this comment.
Yes, that's correct! We don't want markdown images in content anymore, just image widgets.
Note: We still need markdown images in nested widget content, like radio.
|
@claude review |
…chema and user-input types
|
This looks great! Should we add this as a repo rule or a short doc so we’re consistent on when to use JSDoc vs regular comments? |
benchristel
left a comment
There was a problem hiding this comment.
Thanks for improving these doc comments! I left a few suggestions inline, but LGTM overall!
| /** | ||
| * The user might benefit from using a Scientific Calculator. | ||
| * | ||
| * Provided on Khan Academy when true. |
There was a problem hiding this comment.
These comments ("Provided on Khan Academy when true.") imply that the ItemExtras is a record with defined keys, but it's actually a tuple of constants that is used to generate that record type.
No action needed on this PR, since you're just improving formatting.
| inexact?: boolean; | ||
| /** | ||
| * The maximum allowable deviation from the correct value when | ||
| * `inexact` is true. |
There was a problem hiding this comment.
Is there any reason to set a string for maxError, or is that deprecated?
There was a problem hiding this comment.
This is historical data fun. There are items in our published content where this value is a string-encoded number, not an actual JSON number.
I wonder if this is something we could resolve in the parser so we can type this as simply number?
Right now the parser is:
maxError: optional(union(number).or(string).parser),
But perhaps we could simply parse the string to a floating point number and fix this?
There was a problem hiding this comment.
We can try that! I suspect the reason I didn't do it the first time around is that there are some non-numeric maxError string values in our data. But if we can figure out how the existing code handles that case, then we can fix the data in the parser to be consistent with that.
There was a problem hiding this comment.
I'll look at that in a separate PR, but a quick search of (at least en) published content shows we don't have any string values that aren't parsable numbers:
rg '"type"\s*:\s*"input-number"' -l | xargs jq '.. | objects | select(has("type") and .type == "input-number" and ((.options.maxError | type) == "string")) | {file: input_filename, maxError: .options.maxError, isValid: .options.maxError | try (tonumber | true) catch false } | select(.isValid == false)'
# No rows printed!Co-authored-by: Ben Christel <benchristel@users.noreply.github.com>
Co-authored-by: Ben Christel <benchristel@users.noreply.github.com>
Co-authored-by: Ben Christel <benchristel@users.noreply.github.com>
Co-authored-by: Ben Christel <benchristel@users.noreply.github.com>
Co-authored-by: Ben Christel <benchristel@users.noreply.github.com>
Co-authored-by: Ben Christel <benchristel@users.noreply.github.com>
Co-authored-by: Ben Christel <benchristel@users.noreply.github.com>
Co-authored-by: Ben Christel <benchristel@users.noreply.github.com>
Co-authored-by: Ben Christel <benchristel@users.noreply.github.com>
|
@claude review |
Co-authored-by: Ben Christel <benchristel@users.noreply.github.com>
| /** Options for the numeric-input widget. Accepts a single numeric answer. */ | ||
| export type PerseusNumericInputWidgetOptions = { | ||
| // A list of all the possible correct and incorrect answers | ||
| /** A list of all the possible correct and incorrect answers */ |
There was a problem hiding this comment.
🟡 Nit: The JSDoc for PerseusNumericInputWidgetOptions.answers in data-schema.ts still says "A list of all the possible correct and incorrect answers" but the corresponding PerseusNumericInputRubric.answers in validation.types.ts was updated per benchristel's review feedback to drop "all the possible" (since the list is not exhaustive). Consider aligning this description to match.
Extended reasoning...
What the bug is
The JSDoc for PerseusNumericInputWidgetOptions.answers at data-schema.ts:1447 reads:
/** A list of all the possible correct and incorrect answers */Meanwhile, the corresponding field PerseusNumericInputRubric.answers in validation.types.ts:486 was updated (per reviewer benchristel's feedback in PR comment #12: "All possible correct and incorrect answers is a strong claim") to:
/**
* A list of correct and incorrect answers. Each answer can have a
* message explaining why it is correct/incorrect. There may be
* multiple correct answers if multiple formats are accepted. For
* example, some questions might accept either a fraction or a
* decimal as correct.
*
* The first answer that matches (correct or incorrect) is the scoring
* result (so order of answers is very important).
*/How this inconsistency was introduced
The PR converted existing // comments to /** */ JSDoc comments in data-schema.ts. The old // comment already said "all the possible", and it was promoted to JSDoc verbatim. When benchristel flagged the same phrasing in validation.types.ts, the author updated only that file, leaving data-schema.ts with the stale wording.
Why the phrase is inaccurate
As benchristel noted, the answers array does not contain an exhaustive enumeration of every possible correct and incorrect answer. It typically contains common answers with explanatory messages — for instance, a few specific wrong answers that learners commonly give, along with explanations of why they're wrong. The phrase "all the possible" overstates what the field contains.
Impact
This is a minor documentation inconsistency. Since the PR's explicit goal is improving documentation for both human developers and AI agents, having divergent descriptions of the same concept across the two canonical type files undermines that goal. An AI agent reading the data-schema.ts JSDoc would form a different (and less accurate) understanding of the field than one reading validation.types.ts.
Suggested fix
Update data-schema.ts:1447 to align with the corrected validation.types.ts wording, e.g.:
/**
* A list of correct and incorrect answers. Each answer can have a
* message explaining why it is correct/incorrect.
*/
answers: PerseusNumericInputAnswer[];| } | ||
| | { | ||
| /** | ||
| * A periodic wave of the form y = a·sin(bx + c) + d. |
There was a problem hiding this comment.
🟡 The sinusoid and tangent JSDoc formulas say y = a*sin(bx + c) + d and y = a*tan(bx + c) + d, but the implementation uses subtraction: a * Math.sin(b * x - c) + d and a * Math.tan(b * x - c) + d. Both formulas should use bx - c to match the code.
Extended reasoning...
What the bug is
The new JSDoc comments for the sinusoid variant (line 751) and tangent variant (line 762) of GrapherAnswerTypes in data-schema.ts describe the function forms as y = asin(bx + c) + d and y = atan(bx + c) + d respectively. However, the actual implementation uses subtraction (- c), not addition (+ c).
The specific code paths
The implementation in grapher-util.ts consistently uses - c:
- canonicalSineCoefficients (line 24) documents the form as f(x) = a * Sin(b * x - c) + d
- getFunctionForCoeffs for sinusoid (line 238) computes a * Math.sin(b * x - c) + d
- getEquationString for sinusoid (line 260) displays sin(bx - c)
- canonicalTangentCoefficients (line 59) documents the form as f(x) = a * Tan(b * x - c) + d
- getFunctionForCoeffs for tangent (line 304) computes a * Math.tan(b * x - c) + d
- getEquationString for tangent (line 318) displays tan(bx - c)
Why existing code does not prevent it
This is purely a documentation error introduced by this PR. The runtime behavior is correct - the implementation consistently uses - c. The JSDoc simply has the wrong sign.
Step-by-step proof
Consider a sinusoid with coefficients [a=1, b=1, c=pi/2, d=0]. The implementation computes Math.sin(x - pi/2), which equals -cos(x) (a rightward phase shift of pi/2). The JSDoc formula sin(x + pi/2) would instead equal cos(x) (a leftward phase shift of pi/2) - a completely different function. The sign of c determines the phase shift direction: - c shifts right, + c shifts left.
Impact
Since this PR is specifically a documentation improvement aimed at helping developers and AI agents understand the types, the wrong sign in the formula could lead to incorrect reasoning about phase shifts. An AI agent reading this JSDoc would compute the wrong function when trying to match parameters to graph coordinates.
Fix
Change both formulas from bx + c to bx - c:
- Sinusoid: y = a*sin(bx - c) + d
- Tangent: y = a*tan(bx - c) + d
…fter I had already landed it
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @khanacademy/perseus-editor@30.0.0 ### Major Changes - [#3332](#3332) [`604b3a6c25`](604b3a6) Thanks [@benchristel](https://github.com/benchristel)! - The `options` parameter of the `serialize` method of `EditorPage` and `Editor` has been removed. - [#3386](#3386) [`7e76fbbc2f`](7e76fbb) Thanks [@benchristel](https://github.com/benchristel)! - The `serialize` methods of classes in `@khanacademy/perseus-editor` no longer use arrow function syntax. Callers should not unbind them from the class instance. Additionally, the `Editor` component no longer accepts a `replace` prop (used for hints), and its serialize method no longer returns `replace`. The `replace` prop was only used in `serialize`. Users of the `Editor` component should manage hints' `replace` setting themselves. ### Minor Changes - [#3395](#3395) [`97223334ea`](9722333) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Implementation of Editor support for Exponential Graph - [#3352](#3352) [`b681e00a4f`](b681e00) Thanks [@handeyeco](https://github.com/handeyeco)! - Add editor support for AbsoluteValue - [#3348](#3348) [`b1557c2a73`](b1557c2) Thanks [@handeyeco](https://github.com/handeyeco)! - Add schema for AbsoluteValue graph - [#3345](#3345) [`dde985f3b5`](dde985f) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Add tangent type definitions, this is the initial implementation for supporting Tangent graph in Interactive Graph - [#3358](#3358) [`8c503171b1`](8c50317) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Add tangent graph option in the Interactive Graph Editor - [#3376](#3376) [`8aa0a77886`](8aa0a77) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Creation of new Types, Schema, and Kmath utilities for Exponential Graph ### Patch Changes - [#3396](#3396) [`35fa9133db`](35fa913) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (CX) | Add a linter warning for images with no size - [#3390](#3390) [`d22c50dc2a`](d22c50d) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (CX) | Make the 125 character alt text warning less aggressive - [#3372](#3372) [`3cdb09813d`](3cdb098) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (UX) | Upscale Graphies within Explore Image Modal - [#3391](#3391) [`2f285ee161`](2f285ee) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (CX) | Add character counter to alt text field - [#3374](#3374) [`cd73c99ba3`](cd73c99) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Remove incorrect usage of the feature flag setting in one of the test - Updated dependencies \[[`f18c0d9b6f`](f18c0d9), [`a022e751d6`](a022e75), [`35fa9133db`](35fa913), [`54db3fd4bd`](54db3fd), [`97223334ea`](9722333), [`027a5edbda`](027a5ed), [`ae0538d0a7`](ae0538d), [`005e13d784`](005e13d), [`3cdb09813d`](3cdb098), [`afcff9f96f`](afcff9f), [`75f184e5a7`](75f184e), [`4b2a7c85db`](4b2a7c8), [`5e1acd01f8`](5e1acd0), [`b681e00a4f`](b681e00), [`d99f1c0259`](d99f1c0), [`54eee35d65`](54eee35), [`b1557c2a73`](b1557c2), [`dde985f3b5`](dde985f), [`56e7dbe9a2`](56e7dbe), [`85f9cd46fc`](85f9cd4), [`8c503171b1`](8c50317), [`3aca3dcdf4`](3aca3dc), [`9f29bc7161`](9f29bc7), [`7034844845`](7034844), [`8aa0a77886`](8aa0a77), [`003aca7612`](003aca7)]: - @khanacademy/perseus-linter@4.9.0 - @khanacademy/perseus-score@8.4.0 - @khanacademy/perseus-core@23.7.0 - @khanacademy/perseus@76.1.0 - @khanacademy/kmath@2.3.0 - @khanacademy/keypad-context@3.2.40 - @khanacademy/math-input@26.4.10 ## @khanacademy/kmath@2.3.0 ### Minor Changes - [#3351](#3351) [`005e13d784`](005e13d) Thanks [@handeyeco](https://github.com/handeyeco)! - Add scoring for AbsoluteValue - [#3347](#3347) [`d99f1c0259`](d99f1c0) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Add the tangent math utilities to kmath for supporting Tangent graph in Interactive Graph - [#3376](#3376) [`8aa0a77886`](8aa0a77) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Creation of new Types, Schema, and Kmath utilities for Exponential Graph ### Patch Changes - Updated dependencies \[[`54db3fd4bd`](54db3fd), [`ae0538d0a7`](ae0538d), [`005e13d784`](005e13d), [`b1557c2a73`](b1557c2), [`dde985f3b5`](dde985f), [`8aa0a77886`](8aa0a77)]: - @khanacademy/perseus-core@23.7.0 ## @khanacademy/perseus@76.1.0 ### Minor Changes - [#3350](#3350) [`75f184e5a7`](75f184e) Thanks [@handeyeco](https://github.com/handeyeco)! - Implement AbsoluteValue rendering - [#3354](#3354) [`4b2a7c85db`](4b2a7c8) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Created the tangent graph visual component, add Storybook coverage, SR strings, and equation string for supporting Tangent graph in Interactive Graph - [#3353](#3353) [`5e1acd01f8`](5e1acd0) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Add tangent graph state management and reducer for supporting Tangent graph in Interactive Graph - [#3352](#3352) [`b681e00a4f`](b681e00) Thanks [@handeyeco](https://github.com/handeyeco)! - Add editor support for AbsoluteValue - [#3348](#3348) [`b1557c2a73`](b1557c2) Thanks [@handeyeco](https://github.com/handeyeco)! - Add schema for AbsoluteValue graph - [#3345](#3345) [`dde985f3b5`](dde985f) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Add tangent type definitions, this is the initial implementation for supporting Tangent graph in Interactive Graph - [#3349](#3349) [`56e7dbe9a2`](56e7dbe) Thanks [@handeyeco](https://github.com/handeyeco)! - Add state management for AbsoluteValue - [#3377](#3377) [`85f9cd46fc`](85f9cd4) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Implementation of state management logic for new Exponential graph - [#3358](#3358) [`8c503171b1`](8c50317) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Add tangent graph option in the Interactive Graph Editor - [#3393](#3393) [`9f29bc7161`](9f29bc7) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Rendering logic for new Exponential Graph - [#3376](#3376) [`8aa0a77886`](8aa0a77) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Creation of new Types, Schema, and Kmath utilities for Exponential Graph ### Patch Changes - [#3329](#3329) [`027a5edbda`](027a5ed) Thanks [@Myranae](https://github.com/Myranae)! - Fix image bug by batching setState calls in setupGraphie - [#3372](#3372) [`3cdb09813d`](3cdb098) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (UX) | Upscale Graphies within Explore Image Modal - [#3365](#3365) [`afcff9f96f`](afcff9f) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Improve ordering of Props type for `Renderer` component - [#3367](#3367) [`54eee35d65`](54eee35) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (UX) | Show image in explore modal even when size is undefined - [#3407](#3407) [`3aca3dcdf4`](3aca3dc) Thanks [@Myranae](https://github.com/Myranae)! - Improve a11y with graded group set - [#3385](#3385) [`003aca7612`](003aca7) Thanks [@Myranae](https://github.com/Myranae)! - Small fix to prevent pip duplication in Graded Group Sets - Updated dependencies \[[`f18c0d9b6f`](f18c0d9), [`a022e751d6`](a022e75), [`35fa9133db`](35fa913), [`54db3fd4bd`](54db3fd), [`97223334ea`](9722333), [`ae0538d0a7`](ae0538d), [`005e13d784`](005e13d), [`d99f1c0259`](d99f1c0), [`b1557c2a73`](b1557c2), [`dde985f3b5`](dde985f), [`7034844845`](7034844), [`8aa0a77886`](8aa0a77)]: - @khanacademy/perseus-linter@4.9.0 - @khanacademy/perseus-score@8.4.0 - @khanacademy/perseus-core@23.7.0 - @khanacademy/kmath@2.3.0 - @khanacademy/keypad-context@3.2.40 - @khanacademy/math-input@26.4.10 ## @khanacademy/perseus-core@23.7.0 ### Minor Changes - [#3405](#3405) [`54db3fd4bd`](54db3fd) Thanks [@benchristel](https://github.com/benchristel)! - `@khanacademy/perseus-core` now exports a `removeOrphanedWidgetsFromPerseusItem` function, which removes unreferenced widgets from a `PerseusItem`'s question and hints. - [#3351](#3351) [`005e13d784`](005e13d) Thanks [@handeyeco](https://github.com/handeyeco)! - Add scoring for AbsoluteValue - [#3348](#3348) [`b1557c2a73`](b1557c2) Thanks [@handeyeco](https://github.com/handeyeco)! - Add schema for AbsoluteValue graph - [#3345](#3345) [`dde985f3b5`](dde985f) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Add tangent type definitions, this is the initial implementation for supporting Tangent graph in Interactive Graph - [#3376](#3376) [`8aa0a77886`](8aa0a77) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Creation of new Types, Schema, and Kmath utilities for Exponential Graph ### Patch Changes - [#3357](#3357) [`ae0538d0a7`](ae0538d) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Improve code documentation for all data-schema and user-input types ## @khanacademy/perseus-linter@4.9.0 ### Minor Changes - [#3381](#3381) [`f18c0d9b6f`](f18c0d9) Thanks [@anakaren-rojas](https://github.com/anakaren-rojas)! - Adds new linters for parsed objects - [#3395](#3395) [`97223334ea`](9722333) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Implementation of Editor support for Exponential Graph ### Patch Changes - [#3396](#3396) [`35fa9133db`](35fa913) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (CX) | Add a linter warning for images with no size - Updated dependencies \[[`54db3fd4bd`](54db3fd), [`ae0538d0a7`](ae0538d), [`005e13d784`](005e13d), [`d99f1c0259`](d99f1c0), [`b1557c2a73`](b1557c2), [`dde985f3b5`](dde985f), [`8aa0a77886`](8aa0a77)]: - @khanacademy/perseus-core@23.7.0 - @khanacademy/kmath@2.3.0 ## @khanacademy/perseus-score@8.4.0 ### Minor Changes - [#3356](#3356) [`a022e751d6`](a022e75) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Add tangent graph scoring to support the Tangent graph in Interactive Graph - [#3351](#3351) [`005e13d784`](005e13d) Thanks [@handeyeco](https://github.com/handeyeco)! - Add scoring for AbsoluteValue - [#3394](#3394) [`7034844845`](7034844) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Implementation of new scoring logic for Exponential Graph ### Patch Changes - Updated dependencies \[[`54db3fd4bd`](54db3fd), [`ae0538d0a7`](ae0538d), [`005e13d784`](005e13d), [`d99f1c0259`](d99f1c0), [`b1557c2a73`](b1557c2), [`dde985f3b5`](dde985f), [`8aa0a77886`](8aa0a77)]: - @khanacademy/perseus-core@23.7.0 - @khanacademy/kmath@2.3.0 ## @khanacademy/keypad-context@3.2.40 ### Patch Changes - Updated dependencies \[[`54db3fd4bd`](54db3fd), [`ae0538d0a7`](ae0538d), [`005e13d784`](005e13d), [`b1557c2a73`](b1557c2), [`dde985f3b5`](dde985f), [`8aa0a77886`](8aa0a77)]: - @khanacademy/perseus-core@23.7.0 ## @khanacademy/math-input@26.4.10 ### Patch Changes - Updated dependencies \[[`54db3fd4bd`](54db3fd), [`ae0538d0a7`](ae0538d), [`005e13d784`](005e13d), [`b1557c2a73`](b1557c2), [`dde985f3b5`](dde985f), [`8aa0a77886`](8aa0a77)]: - @khanacademy/perseus-core@23.7.0 - @khanacademy/keypad-context@3.2.40
## Summary: In #3357 the Schema Check [triggered](#3357 (comment)) but the changes were all in code comments. None of these would alter the structure of any Perseus schema types and so it's a false positive and clutters the PR. This PR changes the `tsc` command to strip comments so that the resulting comparison files are only code/types. This should eliminate these types of false positives, but retain type/schema safety. Issue: LEMS-3949 ## Test plan: I added a change that should affect the schema and the schema check triggered. <img width="672" height="552" alt="image" src="https://github.com/user-attachments/assets/250546f5-4365-4feb-8eef-ad01af68cfd3" /> I removed above change, added a comment-only change and the schema check cleared. <img width="880" height="183" alt="image" src="https://github.com/user-attachments/assets/1068da1e-a309-45bd-9083-a80049a6b40b" /> Click the "Edited" button on the Schema Change comment to see earlier runs of the check (as well as its output). <img width="646" height="211" alt="image" src="https://github.com/user-attachments/assets/2a84b441-ea3d-439e-a1c0-98f219ebf5f4" /> Success! Author: jeremywiebe Reviewers: claude[bot], anakaren-rojas Required Reviewers: Approved By: anakaren-rojas Checks: ⏭️ 1 check has been skipped, ✅ 10 checks were successful Pull Request URL: #3359
## Summary: This PR is strictly comment changes. We have decent coverage of comments in `data-schema.ts`, but they are not JSDoc comments, and so many tools don't display these comments with the type where it's used. This PR converts all relevant `// ...` comments to true JSDoc comments `/** ... */`. We also add/enhance JSDoc comments for all user input, validation, and rubric types in `validation.types.ts`. This should help human authors as they work with these types, but we anticipate it also helping AI agents to understand the types much better. ~NOTE: The Schema Change check [triggered](#3357 (comment)) but as you can see in the diff, it's only comment changes so it's a false report. Eventually we should probably filter comments out from that diff.~ EDIT: The schema change check has been fixed to ignore comments! Issue: LEMS-3949 ## Test plan: This is strictly documentation, so reading new comments would be helpful. Author: jeremywiebe Reviewers: jeremywiebe, nishasy, benchristel, claude[bot], anakaren-rojas Required Reviewers: Approved By: benchristel Checks: ⏭️ 1 check has been skipped, ✅ 10 checks were successful Pull Request URL: #3357
Summary:
This PR is strictly comment changes.
We have decent coverage of comments in
data-schema.ts, but they are not JSDoc comments, and so many tools don't display these comments with the type where it's used. This PR converts all relevant// ...comments to true JSDoc comments/** ... */.We also add/enhance JSDoc comments for all user input, validation, and rubric types in
validation.types.ts.This should help human authors as they work with these types, but we anticipate it also helping AI agents to understand the types much better.
NOTE: The Schema Change check triggered but as you can see in the diff, it's only comment changes so it's a false report. Eventually we should probably filter comments out from that diff.EDIT: The schema change check has been fixed to ignore comments!
Issue: LEMS-3949
Test plan:
This is strictly documentation, so reading new comments would be helpful.