Skip to content

feat(check): add the NPR 7150.2D library, its checks and a demo - #2545

Open
HuiJun wants to merge 21 commits into
developfrom
feature/npr7150-library
Open

HuiJun wants to merge 21 commits into
developfrom
feature/npr7150-library

Conversation

@HuiJun

@HuiJun HuiJun commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Adds NASA NPR 7150.2D (Software Engineering Requirements) support, built the way the NPR 7123.1D library was (#1928).

  • Moves the extension-library pin to ed220a20ea0de754eb60a5353bf3d2a523d34e0b, the merge of feat: add NPR7150, the NASA NPR 7150.2D software-engineering library OpenSysML-Extensions-Library#22, and vendors NPR7150.sysml: the six software classes (A-F), the 130 numbered SWE requirements, the Appendix C Requirements Mapping Matrix (applicability and tailoring authority per class) and the 203 NASA-STD-8739.8B Table 1 software assurance and software safety tasks keyed to the same SWE numbers. The same pin also brings in the QVTS library already on that repository's main, so the vendored copy now holds 19 units.

  • Adds NPR7150Pass (internal/check/passes/npr7150.go) at the constraint tier with five warnings:

    • npr7150-software-missing-classification
    • npr7150-class-e-safety-critical
    • npr7150-mapping-missing-justification
    • npr7150-mapping-matrix-missing-requirement
    • npr7150-safety-critical-requirement-not-applicable

    A model that does not use the library is untouched.

  • Adds examples/npr7150-demo (classification record, mapping matrix and assurance-task register, with one deliberate case per warning), the design page docs/project/npr7150-library.md, the diagnostics reference entries, a changelog fragment and the self-model's pass entry.

  • Re-records what the pin move and the new example shift: the pilot and api-json differentials, the structure differential, the corpus round-trip and agreement ratchets, and the counts in the docs and testing skills.

Specification basis

NPR 7150.2D (chapters 2-5, Appendix C Requirements Mapping Matrix, Appendix D software classifications) and NASA-STD-8739.8B Table 1. These are NASA documents, not OMG clauses; the new compliance-map source is docs/project/spec-compliance/02-detailed-semantic-compliance-map/42-npr7150-extension-library.md.

Where Appendix C words a requirement differently from its chapter (SWE-039, -052, -094, -131, -141, -157), the requirement text follows the chapter. SWE-015 keeps the blank Class F authority Appendix C prints. NASA-STD-8739.8B tasks have no identifiers of their own and are named SWE-134-SA-1 style.

How it was verified

  • internal/check/passes/npr7150_test.go covers each warning, class applicability, the safety-critical rules, matrix completeness and silence without the library.
  • make build, go vet ./..., gofmt -l . (empty), make extension-libraries-pin-check, make docs-counts, make diagnostics-check, make spec-compliance-check, python3 scripts/changelog.py check, python3 scripts/check-doc-ids.py.
  • go test ./... on the branch before the last merge of develop (one stale self-model count found and fixed); after the merge, re-ran ./tests/corpus, ./tests/kpar, ./examples, ./internal/check/..., ./internal/translate/export, ./internal/workspace/..., ./tests/hygiene and the tools module.
  • Not run locally: make lint and the -race tier.

Checklist

  • make test and make lint pass locally
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (compliance rows need nothing: the census is counted at docs build)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

Captain opened this PR for Jason
Implemented in session Implement NPR 7150.2D library like NPR 7123.1
Review with Devin · Open in Devin Desktop


devin-ai-integration Bot and others added 7 commits November 20, 2026 06:46
…cks, demo and docs

Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…o document

The NPR7150 library splits the assurance tasks into AssuranceTaskRegister and
gives the mapping matrix both authority columns of Table 2; the demo renders
both, and the differential baselines follow.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ntials

Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration Bot and others added 4 commits November 23, 2026 06:40
… require a disposition for matrix coverage

Co-Authored-By: jason.han <hanhuijun@gmail.com>
… through an attribute

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…d treat null as none

Co-Authored-By: jason.han <hanhuijun@gmail.com>
… element addresses its matrix row

Co-Authored-By: jason.han <hanhuijun@gmail.com>

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

Devin Review found 8 findings. Devin fixed 7 findings; 1 finding is left for you to triage below.

Fixed by Devin (7)
  • Chained dispositions leave matrix rows missing — Reverted the lookup of the referenced feature's value: any element named by comply (literal or feature, however chained) now addresses the matrix row; chained case added to the test.
  • Quoted names mix up mapping dispositions — The qualified-name lookup is removed, so no other attribute's disposition can be picked up.
  • Cached attributes leave matrix rows missing — The audit no longer reads the referenced attribute's value, so an unopened cached file cannot turn a covered row into a missing one.
  • Blank dispositions satisfy matrix coverage — An entry with no comply value no longer covers its requirement in the matrix; test added.
  • Separate annotations mask mapping warnings — Each @RequirementMapping annotation is now read as its own entry, so one cannot hide another's missing justification or not-applicable disposition; test added.
  • False missing rows for bound dispositions — Matrix coverage now asks whether the annotation binds comply at all, not whether it reads as a literal, so a disposition bound through an attribute counts; test added.
  • Empty dispositions satisfy matrix coverage — Reworked the earlier fix: the disposition is now resolved to its MappingKind literal (directly or through the feature it references), so comply = null states none and does not cover the row, and a bound not-applicable disposition also gets the justification check; tests added.

View findings in Devin Review · Follow Devin's work

Devin Review

Comment on lines +4085 to +4088
WhereMetadata(
source = Descendants(source = root, maxDepth = depth),
'metadata' = "NPR7150::RequirementMapping"
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Reusable definitions become register rows

When a query root contains annotated requirement definitions, RequirementMappingEntries returns them as project mappings. Both mapping registers accept those definitions as rows, but the audit counts only usages. SoftwareClassificationRegister likewise lists reusable software definitions as systems.

Devin left this for you to triage: If it ships as is, an annotated requirement definition (or a SoftwareSystem definition) shows as a register row while the matrix check counts only usages, so a generated matrix can list a row the check does not credit. The queries live in the vendored library, which cannot be edited here; I recommend a follow-up in OpenSysML-Extensions-Library that restricts the three registers to usages, then a pin bump.

Learn more

A definition describes a reusable type; a usage declares a project requirement, task, or system of that type. Descendants walks both because ownedRows returns all owned members. WhereMetadata selects definitions and usages alike, and RequirementMapping explicitly allows both. WhereType accepts definitions that specialize the requested type, so the SWE, assurance, and classification registers do not remove the definitions. The audit excludes definitions from its coverage checks and system inventory.

Example: Run the classification query over the demo's whole project package rather than just softwareInventory. The result includes Analysis Tool, the reusable type, as well as grainSizeEstimator, the actual software system. An annotated project subtype of SWE033 under the mapping root similarly enters the matrix even without a corresponding requirement usage.

Recommended fix: Intersect the mapping query with RequirementUsage before selecting metadata. Intersect the classification query with PartUsage as well as NPR7150::SoftwareSystem. Test each register with definitions and usages under the same root.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@devin-ai-integration devin-ai-integration Bot added the ci:rebaseline Merge develop into this pull request and re-record its generated baselines label Nov 23, 2026
@github-actions github-actions Bot removed the ci:rebaseline Merge develop into this pull request and re-record its generated baselines label Nov 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

ci:rebaseline stopped without pushing (run, failure). Movement seen so far:

(no movement summary was produced; see the run log)

…brary

Re-records the examples digest of both pilot baselines over the merged tree (no figure moved) and
states the 113 bundled library files, NPR7150 among the nineteen extensions, where develop's
documented-count gate now reads them.

Co-Authored-By: jason.han <hanhuijun@gmail.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 finding. It is left for you to triage in Devin Review.

View findings in Devin Review · Follow Devin's work

Devin Review

devin-ai-integration Bot and others added 5 commits November 23, 2026 14:48
…ary and demo

Only the examples root moves: the demo's elements join both columns and the bundled libraries count
nineteen. No served rule joins or leaves the silent list.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…brary

Re-records the api-json differential on the merged tree: the NPR 7150 demo fragment and the
pipeline's new part take develop's member-name rows, and no other bucket moves.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ntials

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…census

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ith the NPR7150 demo

Co-Authored-By: jason.han <hanhuijun@gmail.com>
devin-ai-integration Bot and others added 4 commits November 24, 2026 05:45
…sus and the agreement ratchet

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…NPR7150 library

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ls, the derived census and the agreement ratchet

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…sus and the agreement ratchet

Co-Authored-By: jason.han <hanhuijun@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant