-
Notifications
You must be signed in to change notification settings - Fork 0
Validate MJSON configuration files and inheritance #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
thibaultzanini
wants to merge
2
commits into
main
Choose a base branch
from
claude/validate-mjson-configs-lz2nO
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+153
−4
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,9 +23,6 @@ | |
| "variable": { | ||
| "object": "./variable" | ||
| }, | ||
| "variablePrototype": { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused |
||
| "object": "./variable" | ||
| }, | ||
| "modVariableObjectDescriptor": { | ||
| "object": "mod/data/model/variable.mjson" | ||
| }, | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| # MJSON Configuration Files Validation Report | ||
|
|
||
| **Directory:** `data/model/questionnaire` | ||
| **Date:** 2026-01-08 | ||
| **Total Files Processed:** 8 | ||
|
|
||
| --- | ||
|
|
||
| ## Inventory | ||
|
|
||
| The following MJSON files were discovered and analyzed: | ||
|
|
||
| 1. `answer.mjson` | ||
| 2. `question.mjson` | ||
| 3. `questionnaire.mjson` | ||
| 4. `questionnaire-question.mjson` | ||
| 5. `respondent-questionnaire.mjson` | ||
| 6. `respondent-questionnaire-answer.mjson` | ||
| 7. `respondent-questionnaire-variable-value.mjson` | ||
| 8. `variable.mjson` | ||
|
|
||
| --- | ||
|
|
||
| ## Issues Report | ||
|
|
||
| ### 1. answer.mjson | ||
| **Status:** ✅ **Valid** | ||
|
|
||
| - **Syntax:** Valid JSON | ||
| - **Inheritance:** Properly defined (`parent: {"@": "objectDescriptor"}` → `mod/data/model/data-object.mjson`) | ||
| - **Property Descriptors:** All 15 properties have matching definitions | ||
| - **References:** All internal references are valid | ||
|
|
||
| --- | ||
|
|
||
| ### 2. question.mjson | ||
| **Status:** ✅ **Valid** | ||
|
|
||
| - **Syntax:** Valid JSON | ||
| - **Inheritance:** Properly defined (`parent: {"@": "objectDescriptor"}` → `mod/data/model/data-object.mjson`) | ||
| - **Property Descriptors:** All 7 properties have matching definitions | ||
| - **References:** All internal references are valid | ||
|
|
||
| --- | ||
|
|
||
| ### 3. questionnaire.mjson | ||
| **Status:** ✅ **Valid** | ||
|
|
||
| - **Syntax:** Valid JSON | ||
| - **Inheritance:** Properly defined (`parent: {"@": "objectDescriptor"}` → `mod/data/model/data-object.mjson`) | ||
| - **Property Descriptors:** All 11 properties have matching definitions | ||
| - **References:** All internal references are valid | ||
|
|
||
| --- | ||
|
|
||
| ### 4. questionnaire-question.mjson | ||
| **Status:** ⚠️ **Issue Detected** | ||
|
|
||
| - **Syntax:** Valid JSON | ||
| - **Inheritance:** Properly defined (`parent: {"@": "objectDescriptor"}` → `mod/data/model/data-object.mjson`) | ||
| - **Property Descriptors:** All 8 declared properties have matching definitions | ||
|
|
||
| **Issue:** Orphaned Property Definition | ||
| - **Lines 123-131:** The property `"notes"` is fully defined but **NOT included** in the `propertyDescriptors` array | ||
| - **Impact:** This property exists in the schema but is not exposed/registered, making it effectively unusable | ||
| - **Recommendation:** Either add `{"@": "notes"}` to the `propertyDescriptors` array or remove the definition if not needed | ||
|
|
||
| ```json | ||
| // Missing from propertyDescriptors array: | ||
| {"@": "notes"} | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ### 5. respondent-questionnaire.mjson | ||
| **Status:** ✅ **Valid** | ||
|
|
||
| - **Syntax:** Valid JSON | ||
| - **Inheritance:** Properly defined (`parent: {"@": "objectDescriptor"}` → `mod/data/model/data-object.mjson`) | ||
| - **Property Descriptors:** All 9 properties have matching definitions | ||
| - **References:** All internal references are valid | ||
|
|
||
| --- | ||
|
|
||
| ### 6. respondent-questionnaire-answer.mjson | ||
| **Status:** ✅ **Valid** | ||
|
|
||
| - **Syntax:** Valid JSON | ||
| - **Inheritance:** Properly defined (`parent: {"@": "objectDescriptor"}` → `mod/data/model/data-object.mjson`) | ||
| - **Property Descriptors:** All 5 properties have matching definitions | ||
| - **References:** All internal references are valid | ||
|
|
||
| --- | ||
|
|
||
| ### 7. respondent-questionnaire-variable-value.mjson | ||
| **Status:** ✅ **Valid** | ||
|
|
||
| - **Syntax:** Valid JSON | ||
| - **Inheritance:** Properly defined (`parent: {"@": "objectDescriptor"}` → `mod/data/model/data-object.mjson`) | ||
| - **Property Descriptors:** All 3 properties have matching definitions | ||
| - **References:** All internal references are valid | ||
|
|
||
| --- | ||
|
|
||
| ### 8. variable.mjson | ||
| **Status:** ⚠️ **Issue Detected** | ||
|
|
||
| - **Syntax:** Valid JSON | ||
| - **Inheritance:** Properly defined (`parent: {"@": "modVariableObjectDescriptor"}` → `mod/data/model/variable.mjson`) | ||
| - **Property Descriptors:** All 3 properties have matching definitions | ||
|
|
||
| **Issue:** Unused Definition | ||
| - **Lines 26-28:** The key `"variablePrototype"` is defined with `"object": "./variable"` but is **never referenced** anywhere in the file | ||
| - **Impact:** Dead code that clutters the configuration | ||
| - **Recommendation:** Remove this unused definition or identify where it should be used | ||
|
|
||
| ```json | ||
| // Unused definition that can be removed: | ||
| "variablePrototype": { | ||
| "object": "./variable" | ||
| } | ||
| ``` | ||
|
|
||
| **Note:** The file already has a `"variable"` key (lines 23-25) that serves the same purpose and is properly referenced by `root.values.object`. | ||
|
|
||
| --- | ||
|
|
||
| ## Summary | ||
|
|
||
| | File | Status | Issues | | ||
| |------|--------|--------| | ||
| | answer.mjson | ✅ Valid | None | | ||
| | question.mjson | ✅ Valid | None | | ||
| | questionnaire.mjson | ✅ Valid | None | | ||
| | questionnaire-question.mjson | ⚠️ Issue | Orphaned property definition (`notes`) | | ||
| | respondent-questionnaire.mjson | ✅ Valid | None | | ||
| | respondent-questionnaire-answer.mjson | ✅ Valid | None | | ||
| | respondent-questionnaire-variable-value.mjson | ✅ Valid | None | | ||
| | variable.mjson | ⚠️ Issue | Unused definition (`variablePrototype`) | | ||
|
|
||
| **Total Issues Found:** 2 | ||
|
|
||
| --- | ||
|
|
||
| ## Recommendations | ||
|
|
||
| 1. **questionnaire-question.mjson:** Add the `notes` property to the `propertyDescriptors` array to make it accessible, or remove the definition if it's not needed. | ||
|
|
||
| 2. **variable.mjson:** Remove the unused `variablePrototype` definition to clean up the configuration file. | ||
|
|
||
| Both issues are non-critical but should be addressed to maintain clean, consistent MJSON configurations. |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing LGTM