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

Semantic markup and ICS table generation #402

Open
wants to merge 51 commits into
base: master
Choose a base branch
from

Conversation

PaulMartinsen
Copy link
Collaborator

@PaulMartinsen PaulMartinsen commented Mar 6, 2025

📑 Description

This PR provides document processing support to:

  • extend semantic markup of requirements for generation of rich JSON extracts for the SDPi requirements core model,
  • prototype semantic markup of use-cases to generate JSON extracts,
  • insertion of automatically generated implementation conformance statement changes,
  • copy links to SDPi requirements to the system clipboard clipboard from the published sdpi-profile web-document.
    image

This slide show PDF provides a high-level overview.

This PR does not include the changes to the AsciiDoc source required to use the new processing features. Instead it is nearly 100% backwards compatible producing html output functionally identical as before.

Additional markup is needed in the source document, once this PR is done, to take advantage of these new features. I just don't want to make changes to the document source until everyone's had a chance to provide feedback at this stage. The goal of this PR is to get the processing and markup roughly right then I can start incorporating new features into the source files and get further feedback on how it works in practice.

Refer to the cookbook for documentation of the new markup and the test cases for examples.

Most of the document processing has been shifted from block processors to a tree processor. This mainly enables cross-referencing the bibliograph from sdpi_requirement_ref_standard requirements, and simplifies tagging use-case requirements with the related use-case. It may reduce the amount of work needed to extend the processor further (extracting transactions, for example).

Testing:

  • unit-tests were added to the processing tool to check output generation for each requirement and use-case.
  • html output documents generated from the master branch and this PR were compared to check the output was (materially) identical. See backwards compatiblity for differences.

☑ Mandatory Tasks

The following aspects have been respected by the pull request assignee and at least one reviewer:

  • Changelog update (necessity checked and entry added or not added respectively)
    • Pull Request Assignee
    • Reviewer

Separated block processing and semantic information extraction.
Added tree-processor to dump document tree for diagnostics.
Created polymorphic requirement classes for each kind of requirement.
Added semantic blocks for requirement parts.
Added basic support to extract use cases.
Cleanup output trace.
Added reference information to ref_ics requirement.
Changes for backwards compatibility with current formatting:
* use local requirement id,
* default to SDPi for requirement source,
* treat unstyled content as normative,
* support note paragraphs,
* default to "tech_feature" requirement if type not specified.
Requirement link fallback to local ids.
Fixed tests:
* normalize compared strings to use the system line-ending character.
* removed ':' in expected output (it isn't included in output anymore)
* added `sdpi_offset` to input documents as is done in supplement text.
Added backwards compatibility info.
@PaulMartinsen PaulMartinsen self-assigned this Mar 6, 2025
@d-gregorczyk
Copy link
Collaborator

I must say - this is too many features in one branch.

  • It contains ICS functionality and requirements interop in one PR, plus there are side features such as the "clipboard copy"
  • I also saw macros dispatching to different output formats, which I do not understand why we need it
  • Does it resonate with the requirements interoperability approach and has this approach been validated by anyone?

My gut feeling is that we are drowning in complexity here and would have needed to discuss the interop approach and clean up my tainted code in advance.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this graphic freely available or drawn by yourself? We otherwise need to reference sources or include licenses in SDPi. Is this graphic really needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was part of the copy to clipboard fragment, which has a Mozzilla public license and the source is referenced in the fragment

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please note that the image itself is listed under MIT license, and the license information gets lost once we export to PDF. That's just my concern.

@PaulMartinsen
Copy link
Collaborator Author

PaulMartinsen commented Mar 11, 2025

I must say - this is too many features in one branch.

  • It contains ICS functionality and requirements interop in one PR, plus there are side features such as the "clipboard copy"
  • I also saw macros dispatching to different output formats, which I do not understand why we need it
  • Does it resonate with the requirements interoperability approach and has this approach been validated by anyone?

My gut feeling is that we are drowning in complexity here and would have needed to discuss the interop approach and clean up my tainted code in advance.

Yes, there is a lot to unpack here.

  • By 'interop', i think you mean the JSON export for external tooling... otherwise i got the wrong idea
  • I see ICS functionality as the short-term payoff for the SDPi document; exporting to JSON is useful for external tooling but as far as I know that tooling doesn't exist and isn't being worked on yet. So it may be useful to consider how interoperability support can benefit the document itself. ICS tables are a good example IMHO & one of the use cases @ToddCooper highlighted at the last SDPi workshop. Anyway, they are trivial after gathering all the requirements.
  • It is intended to resonate with the requirements interoperability approach @ToddCooper shared at the last SDPi workshop. Or at least as far as I understood it. There's been a few practical difficulties with further discourse, to date. Github provides a way to do this collaboratively and asynchronously at least.
  • I stuck with JSON as the interop medium, but refined the format to separate content after I found original format with normative statements, notes, examples etc all smashed together didn't really work for me. Is anyone using the JSON extracts currently? Could we get input from them?
  • I don't think there was any tainted code to cleanup; without the prior version I wouldn't have had anything to build off and the barrier to learning Kotlin would have been too great.
  • I'm not sure what you mean by macro dispatch? Guessing:
    ** in ascii doc source I exclude some javascript content when generating PDFs. Otherwise it just shows up as text in the PDF
    ** there are macro extension in the processor for generating reference and use-case cross references. This support using oids for permalinks if we want to do that in the future.
  • Clipboard copy was to make this worthwhile for me; I find the SDPi document really hard to work as a user. For example, I regularly need to create references to requirements which is very difficult. I plan to make a suggestion around the "table of contents" if I get time to figure out how that works too.

As I understand it, interop is important but not urgent; we have the time to learn to swim here.

To cut through the complexity, a key outcome here tree-processor extensions lets us extract the information needed using roles. It isn't necessary to create block processors for interop features. And, this lets the tree processor work with the entire document; we aren't limited to source order.

@PaulMartinsen
Copy link
Collaborator Author

SDPi requirements export.pdf provides a higher-level overview .

@d-gregorczyk
Copy link
Collaborator

d-gregorczyk commented Mar 12, 2025

I must say - this is too many features in one branch.

  • It contains ICS functionality and requirements interop in one PR, plus there are side features such as the "clipboard copy"
  • I also saw macros dispatching to different output formats, which I do not understand why we need it
  • Does it resonate with the requirements interoperability approach and has this approach been validated by anyone?

My gut feeling is that we are drowning in complexity here and would have needed to discuss the interop approach and clean up my tainted code in advance.

Yes, there is a lot to unpack here.

  • By 'interop', i think you mean the JSON export for external tooling... otherwise i got the wrong idea
  • I see ICS functionality as the short-term payoff for the SDPi document; exporting to JSON is useful for external tooling but as far as I know that tooling doesn't exist and isn't being worked on yet. So it may be useful to consider how interoperability support can benefit the document itself. ICS tables are a good example IMHO & one of the use cases @ToddCooper highlighted at the last SDPi workshop. Anyway, they are trivial after gathering all the requirements.
  • It is intended to resonate with the requirements interoperability approach @ToddCooper shared at the last SDPi workshop. Or at least as far as I understood it. There's been a few practical difficulties with further discourse, to date. Github provides a way to do this collaboratively and asynchronously at least.
  • I stuck with JSON as the interop medium, but refined the format to separate content after I found original format with normative statements, notes, examples etc all smashed together didn't really work for me. Is anyone using the JSON extracts currently? Could we get input from them?
  • I don't think there was any tainted code to cleanup; without the prior version I wouldn't have had anything to build off and the barrier to learning Kotlin would have been too great.
  • I'm not sure what you mean by macro dispatch? Guessing:
    ** in ascii doc source I exclude some javascript content when generating PDFs. Otherwise it just shows up as text in the PDF
    ** there are macro extension in the processor for generating reference and use-case cross references. This support using oids for permalinks if we want to do that in the future.
  • Clipboard copy was to make this worthwhile for me; I find the SDPi document really hard to work as a user. For example, I regularly need to create references to requirements which is very difficult. I plan to make a suggestion around the "table of contents" if I get time to figure out how that works too.

As I understand it, interop is important but not urgent; we have the time to learn to swim here.

To cut through the complexity, a key outcome here tree-processor extensions lets us extract the information needed using roles. It isn't necessary to create block processors for interop features. And, this lets the tree processor work with the entire document; we aren't limited to source order.

Ok, I would like to see this approach being double-checked by Todd so he can drop his remarks from a high level design perspective (so he should not look at the Kotlin code :-) ).

From what I understand, RI and ICS tables do not have anything in common. RI being a means to relate requirements with other - partly external - requirements, and ICS tables being the means to provide conformity statements to sets of requirements.

Anyway, I still think the pull request is way too complex and should be decomposed and discussed. However, if reviewed and understood thoroughly by our stakeholders, I do not have any objection to merge it eventually.

And please do not get me wrong: I am totally advocating the idea of tweaking the SDPi input, I am just concerned that this might be overwhelming to the authors of the document (including me ;-) ).

… forks to run most of processing without the secret to upstream repository.
@PaulMartinsen
Copy link
Collaborator Author

@ToddCooper , when we discussed gathering requirements for the profiles (such as SDPi-P), I had the idea that there would be a bunch of requirements defined in §1:2.3.10, for example. And we wanted to make a list of those. Looking closer, I see that section doesn't actually define requirements. Instead, it references transactions, use-cases and content modules.

So my new idea, is we want to gather all the requirements in referenced use-cases, transactions and content-modules to make a list of requirements for each profile. Is that correct?

Assuming it is correct, in which direction do you imagine these relationships are best defined in the AsciiDoc source? "Best" really means, what's most logical for how everyone thinks about the document or which is most natural easiest for editors? In other words, do you prefer:

  1. when editing a use-case/transaction/content module we want to assign it to a profile, or
  2. we want to select relevant use-cases, transactions, content-modules that belong to a profile in the profile section of the source document.

To me, the second option makes more sense. That is, there's a smorgasbord of use-cases/transactions/content-modules that profiles pick and choose from.

Of course, the document processor will be able to figure out the relationship in both directions with either option.

Finally, there is a third option. The processor could discover actors and may be able to build relationships based on where actors are used. For example, SDPi-P defines the SOMDS Provider. So "membership" in SDPi-P could include any use-case/transaction/content-module that refers to this actor. Its possible this will work magically, but it may also be frustrating to figure out why relationships are being created because there isn't really much in the way of diagnostic tooling. Could be fun to try though :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants