Skip to content
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

Add documentation re well-formedness and validation. #1169

Conversation

aj-stein-nist
Copy link
Contributor

@aj-stein-nist aj-stein-nist commented Mar 11, 2022

Committer Notes

Publish documentation re well-formedness and validation of OSCAL document instances. This implements part of #1153, but does not complete it. Additional PR to follow.

All Submissions:

  • Have you selected the correct base branch per Contributing guidance?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you squashed any non-relevant commits and commit messages? [instructions]
  • Do all automated CI/CD checks pass?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you included examples of how to use your new feature(s)?
  • Have you updated all OSCAL website and readme documentation affected by the changes you made? Changes to the OSCAL website can be made in the docs/content directory of your branch.

@aj-stein-nist aj-stein-nist added Scope: Website Issues targeted at the OSCAL project website. Scope: Documentation This issue relates to OSCAL documentation. Developer Experience Issues around enhancing and optimizing work for development of NIST OSCAL artifacts labels Mar 11, 2022
There are multiple failure scenarios for OSCAL documents, and JSON, XML, and YAML more generally:

1. The document is well-formed, but is not conformant to the schema and errors are correctly reported.
2. The document is not well-formed, so validation cannot occur.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor observation: lack of well-formed precludes schema validation, so well-formedness should precede schema validation.

Copy link
Contributor Author

@aj-stein-nist aj-stein-nist Mar 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we cover that later in the document?

What OSCAL tools help you check well-formedness?

NIST's OSCAL tools do not explicitly check that JSON, XML, or YAML is well-formed. If you are a tool developer, we expect you to use your language runtime and libraries to parse JSON, XML, and YAML and check for the well-formed data. This must occur before validating an OSCAL document. (Emphasis add here by me for context.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well-formedness is logically prior but not temporally prior; indeed a big reason for grammar-based validation is that it can be performed at (concurrently with) the parse. To parse and then to validate is one way to do it; but there is nothing wrong with attempting validation and seeing what happens in the parse.

Suggest a little tweakage. In a runtime or in a workflow generally, validation may occur early and often, or only at system boundaries. What we are defining here is not how to validate, but what constitutes conformance ("valid to X schema"). We do not define XML, JSON or validation; only the OSCAL schemas.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see your point, but I do not say whether it is logically or temporally before (if we are addressing the snippet where I copied from).

What do you recommend we add or take away?

I only added this bit to address the question in the section header: Q: What OSCAL tools [from NIST] check well-formedness? A: NIST's OSCAL tools do not provide tools to check well-formedness, because if you are a tool developer it is on you to check that before (logically or temporally) using schemas to validate. [This implies: do not report issues back to NIST with problems in schema validation when it is easy to spot the document isn't well-formed. These are not schema issues, it should be obvious but you ought to check the doc is well-formed somewhere in your code.]

So, how can we write that better?

@david-waltermire
Copy link
Contributor

Looks like there is one bad link that is causing the build to fail:

git-content/oscal/docs/content/concepts/layer/_index.md
error: bad link validation at line 137

docs/content/concepts/layer/_index.md Outdated Show resolved Hide resolved
docs/content/concepts/layer/validation/_index.md Outdated Show resolved Hide resolved
docs/content/concepts/layer/validation/_index.md Outdated Show resolved Hide resolved
docs/content/concepts/layer/validation/_index.md Outdated Show resolved Hide resolved
docs/content/concepts/layer/validation/_index.md Outdated Show resolved Hide resolved
docs/content/concepts/layer/validation/_index.md Outdated Show resolved Hide resolved
docs/content/concepts/layer/validation/_index.md Outdated Show resolved Hide resolved
docs/content/concepts/layer/validation/_index.md Outdated Show resolved Hide resolved
@aj-stein-nist aj-stein-nist force-pushed the issue-1153-docs-wf-validation-page branch from 659dacf to f9f53d0 Compare March 14, 2022 14:05
@aj-stein-nist
Copy link
Contributor Author

OK, @david-waltermire-nist, pulled in all your feedback and squashed all the commits. Let me know what you want to do with the last comment, that is the only thing that requires further discussion and not immediate editorial changes.

@aj-stein-nist
Copy link
Contributor Author

@david-waltermire-nist and @wendellpiez, I added some content and a suggestion from Wendell around using a SVG-based Venn diagram to clarify things. Colors, orientation, size (pre-render or during layout with stylesheet), any feedback, let me know.

image

Wrap in Dave's suggestions for layer index page summary.

Co-authored-by: David Waltermire <david.waltermire@nist.gov>

Wrap in Dave's suggestion to tweak target audience callout.

Co-authored-by: David Waltermire <david.waltermire@nist.gov>

Wrap in Dave's suggestion in audience callout: clarify some not all terminology.

Co-authored-by: David Waltermire <david.waltermire@nist.gov>

Wrap in Dave's suggestion in why are concepts important section.

Co-authored-by: David Waltermire <david.waltermire@nist.gov>

Wrap in Dave's clean up for wf/validity paragraph.

Co-authored-by: David Waltermire <david.waltermire@nist.gov>

Wrap in Dave's clean up for wf/validity definition lead-in paragraph.

Co-authored-by: David Waltermire <david.waltermire@nist.gov>

Wrap in Dave's cleanup for what is valid OSCAL section.

Co-authored-by: David Waltermire <david.waltermire@nist.gov>

Wrap in Dave's suggestion in section about OSCAL schemas.

Co-authored-by: David Waltermire <david.waltermire@nist.gov>

Fix path to validation page.

Slash should be trailing for relative paths, prefixing is absolute, woops!

More link fixup.

determines->determine for plural in why concepts important section.

More touchups from Wendell and AJ, after Dave's feedback.

Add Venn diagram for feedback from Dave based on rec from Wendell.

Add Venn diagram links for feedback from Dave based on rec from Wendell.

Small touchups and excellent SVG from @wendellpiez.
@aj-stein-nist aj-stein-nist force-pushed the issue-1153-docs-wf-validation-page branch from a63f295 to c975ad6 Compare March 16, 2022 14:53
@aj-stein-nist
Copy link
Contributor Author

OK, now with more touchups and a much simpler and prettier SVG thanks to @wendellpiez. Demo from localhost below.

image

Copy link
Contributor

@david-waltermire david-waltermire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the feedback!

@david-waltermire david-waltermire merged commit ade0dd7 into usnistgov:release-1.0 Mar 17, 2022
@david-waltermire david-waltermire added this to the OSCAL 1.0.2 milestone Mar 18, 2022
david-waltermire added a commit that referenced this pull request Mar 18, 2022
Added information about content well-formedness and validation to the website.

Co-authored-by: David Waltermire <david.waltermire@nist.gov>
Co-authored-by: Wendell Piez <wendell.piez@nist.gov>
Co-authored-by: Alexander Stein <alexander.stein@nist.gov>
iMichaela pushed a commit to iMichaela/OSCAL that referenced this pull request Apr 7, 2022
Added information about content well-formedness and validation to the website.

Co-authored-by: David Waltermire <david.waltermire@nist.gov>
Co-authored-by: Wendell Piez <wendell.piez@nist.gov>
Co-authored-by: Alexander Stein <alexander.stein@nist.gov>
@aj-stein-nist aj-stein-nist mentioned this pull request Apr 19, 2022
9 tasks
Rene2mt pushed a commit to Rene2mt/OSCAL that referenced this pull request May 17, 2022
Added information about content well-formedness and validation to the website.

Co-authored-by: David Waltermire <david.waltermire@nist.gov>
Co-authored-by: Wendell Piez <wendell.piez@nist.gov>
Co-authored-by: Alexander Stein <alexander.stein@nist.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Experience Issues around enhancing and optimizing work for development of NIST OSCAL artifacts Scope: Documentation This issue relates to OSCAL documentation. Scope: Website Issues targeted at the OSCAL project website.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants