{"modulePath":"github.com/Open-MBEE/OpenSysML","version":"v0.8.1","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package main\n\nCommand pilot-diff compares this implementation's diagnostics against the OMG SysML v2 Pilot Implementation over a corpus of models, and reports, per file, the diagnostics both agree on, the ones only we report (candidate false positives) and the ones only the pilot reports (candidate gaps).\n\nIt is advisory: nothing in the build or the test suite depends on it, and it never touches internal/core/model/testdata/training\\_examples\\_expected.txt. Provision the reference validator with scripts/download-pilot-sysml-validator.sh, then run \\`go run ./cmd/pilot-diff\\`. See docs/project/pilot-differential.md.\n\n## Types\n\n```go\ntype Category string\n```\nCategory is the coarse classification the two implementations are compared on. Message wording never matches between them, so the comparison is made on this plus file, line and severity.\n\n```go\nconst (\n\tCategoryUnresolved   Category = \"unresolved-reference\"\n\tCategoryKindMismatch Category = \"kind-mismatch\"\n\tCategoryMultiplicity Category = \"multiplicity\"\n\tCategoryUnits        Category = \"units\"\n\tCategorySyntax       Category = \"syntax\"\n\t// CategoryUnmapped is for a diagnostic no rule below claims. It is\n\t// deliberately never merged into another category: an unmapped diagnostic\n\t// must show up as a disagreement rather than as accidental agreement.\n\t// Specialization cycles stay here by adjudication: the pilot has no such\n\t// check, and no category above describes one (F4 in\n\t// docs/project/pilot-differential.md).\n\tCategoryUnmapped Category = \"unmapped\"\n)\n```\n\n```go\ntype Entry struct {\n\tLine     int      `json:\"line\"`\n\tSeverity string   `json:\"severity\"`\n\tCategory Category `json:\"category\"`\n\tCount    int      `json:\"count\"`\n\tExamples []string `json:\"examples,omitempty\"`\n}\n```\nEntry is a compared tuple with how many diagnostics carry it. Examples hold message text for human adjudication only; they are never compared.\n\n```go\ntype ErrataEntry struct {\n\tID         string `json:\"id\"`\n\tPath       string `json:\"path\"`\n\tLine       int    `json:\"line\"`\n\tCitation   string `json:\"citation\"`\n\tCorrected  bool   `json:\"corrected\"`\n\tDerivation string `json:\"derivation\"`\n}\n```\nErrataEntry is one declared entry with the provenance the report must carry.\n\n```go\ntype ErrataFinding struct {\n\tID              string `json:\"id\"`\n\tRoot            string `json:\"root\"`\n\tPath            string `json:\"path\"`\n\tLine            int    `json:\"line\"`\n\tOursPublished   int    `json:\"openSysMLAsPublished\"`\n\tOursCorrected   int    `json:\"openSysMLWithErrata\"`\n\tPilotPublished  int    `json:\"pilotAsPublished\"`\n\tPilotCorrected  int    `json:\"pilotWithErrata\"`\n\tPilotVerdictNew bool   `json:\"pilotVerdictChanged\"`\n\tNote            string `json:\"note\"`\n}\n```\nErrataFinding is what a correction did to the two implementations at its own line. A correction that clears our diagnostic while the pilot still reports there is a finding, not a fix, so it is stated rather than folded into totals.\n\n```go\ntype ErrataReport struct {\n\t// Registry and Corrections count the declared entries and the substituting\n\t// ones; Documented are the defects recorded without a correction.\n\tRegistry    int `json:\"registryEntries\"`\n\tCorrections int `json:\"corrections\"`\n\tDocumented  int `json:\"documentedWithoutCorrection\"`\n\t// Applied are the corrections that lie inside this run's corpora.\n\tApplied int           `json:\"correctionsApplied\"`\n\tEntries []ErrataEntry `json:\"entries\"`\n\t// Totals is the whole run with the errata applied; Report.Totals stays the\n\t// as-published headline.\n\tTotals   Totals          `json:\"totals\"`\n\tFindings []ErrataFinding `json:\"findings\"`\n}\n```\nErrataReport is the second figure of the run: the same comparison over the corpus with the declared corrections applied. The published corpus is never written to; the corrected text lives in a copy under the output directory.\n\n```go\ntype FileReport struct {\n\tPath             string          `json:\"path\"`\n\tAgreement        []Entry         `json:\"agreement\"`\n\tSeverityMismatch []SeverityEntry `json:\"severityMismatch\"`\n\tOpenSysMLOnly    []Entry         `json:\"openSysMLOnly\"`\n\tPilotOnly        []Entry         `json:\"pilotOnly\"`\n\tSyside           *SysideFile     `json:\"syside,omitempty\"`\n}\n```\nFileReport holds one file's buckets. Files where both implementations are silent are omitted.\n\n```go\ntype Report struct {\n\tValidator string `json:\"validator\"`\n\tPilot     string `json:\"pilotRelease\"`\n\t// Provenance identifies the inputs this run measured, so a committed\n\t// baseline can be checked against the repository without the validators.\n\tProvenance baseline.Record `json:\"provenance\"`\n\tTotals     Totals          `json:\"totals\"`\n\tRoots      []RootReport    `json:\"roots\"`\n\tUnmapped   []UnmappedRow   `json:\"unmapped\"`\n\t// Syside is the optional third implementation's column, additive in every\n\t// respect: absent, the report is byte-identical to a two-way run.\n\tSyside *SysideInfo `json:\"syside,omitempty\"`\n\t// Errata is the same run over the corpus with the declared corrections\n\t// applied; Totals above stays the as-published headline.\n\tErrata *ErrataReport `json:\"errata,omitempty\"`\n}\n```\nReport is the machine-readable result. It holds the compared tuples and their counts, but no message text, so two runs diff cleanly.\n\n```go\ntype RootReport struct {\n\tName   string        `json:\"name\"`\n\tDir    string        `json:\"dir\"`\n\tTotals Totals        `json:\"totals\"`\n\tFiles  []FileReport  `json:\"files\"`\n\tSyside *SysideTotals `json:\"syside,omitempty\"`\n\t// ErrataTotals is this root compared again with its corrections applied,\n\t// present only for a root some correction lies in.\n\tErrataTotals *Totals `json:\"errataTotals,omitempty\"`\n}\n```\n\n```go\ntype SeverityEntry struct {\n\tLine      int      `json:\"line\"`\n\tCategory  Category `json:\"category\"`\n\tOpenSysML string   `json:\"openSysMLSeverity\"`\n\tPilot     string   `json:\"pilotSeverity\"`\n\tCount     int      `json:\"count\"`\n\tExamples  []string `json:\"examples,omitempty\"`\n}\n```\nSeverityEntry is a (line, category) both implementations flag with different severities. Kept apart so such a pair is neither counted as agreement nor double-counted as two independent disagreements.\n\n```go\ntype SysideFile struct {\n\tDiagnostics int             `json:\"sysideDiagnostics\"`\n\tEntries     []ThreeWayEntry `json:\"entries,omitempty\"`\n}\n```\nSysideFile is one file's three-way partition.\n\n```go\ntype SysideInfo struct {\n\tValidator string       `json:\"validator\"`\n\tVersion   string       `json:\"version\"`\n\tLibrary   string       `json:\"standardLibrary\"`\n\tPilot     string       `json:\"pilotRelease\"`\n\tScope     string       `json:\"scope\"`\n\tTotals    SysideTotals `json:\"totals\"`\n}\n```\nSysideInfo is the third implementation's provenance and its aggregate three-way tallies. Absent from the report when SysIDE is not provisioned.\n\n```go\ntype SysideTotals struct {\n\tFiles                   int `json:\"files\"`\n\tFilesAgreeing           int `json:\"filesAllThreeAgreeing\"`\n\tDiagnostics             int `json:\"sysideDiagnostics\"`\n\tAllThree                int `json:\"allThree\"`\n\tWithOpenSysML           int `json:\"withOpenSysMLAgainstPilot\"`\n\tWithPilot               int `json:\"withPilotAgainstOpenSysML\"`\n\tSysideOnly              int `json:\"sysideOnly\"`\n\tOpenSysMLUncorroborated int `json:\"openSysMLOnlyUncorroborated\"`\n\tPilotUncorroborated     int `json:\"pilotOnlyUncorroborated\"`\n\tAgreedWithoutSyside     int `json:\"openSysMLAndPilotOnly\"`\n}\n```\nSysideTotals counts compared tuples by which implementations reported them. The two-way totals are untouched by design: this is a second, independent partition of the same tuples, not a re-adjudication of the first.\n\n```go\ntype ThreeWayEntry struct {\n\tLine     int      `json:\"line\"`\n\tSeverity string   `json:\"severity\"`\n\tCategory Category `json:\"category\"`\n\tCount    int      `json:\"count\"`\n\tSides    string   `json:\"sides\"`\n\tExamples []string `json:\"examples,omitempty\"`\n}\n```\nThreeWayEntry is a compared tuple plus which implementations reported it, so a reader can always see which tool said what.\n\n```go\ntype Totals struct {\n\tFiles            int `json:\"files\"`\n\tFilesAgreeing    int `json:\"filesFullyAgreeing\"`\n\tAgreement        int `json:\"agreement\"`\n\tSeverityMismatch int `json:\"severityMismatch\"`\n\tOpenSysMLOnly    int `json:\"openSysMLOnly\"`\n\tPilotOnly        int `json:\"pilotOnly\"`\n\tOpenSysMLTotal   int `json:\"openSysMLDiagnostics\"`\n\tPilotTotal       int `json:\"pilotDiagnostics\"`\n}\n```\n\n```go\ntype UnmappedRow struct {\n\tSide    string `json:\"side\"`\n\tMessage string `json:\"message\"`\n\tCount   int    `json:\"count\"`\n}\n```\nUnmappedRow records a message that no category rule claimed, so the report shows what the categorisation still owes rather than hiding it.\n\n","path":"github.com/Open-MBEE/OpenSysML/cmd/pilot-diff","name":"main","synopsis":"Command pilot-diff compares this implementation's diagnostics against the OMG SysML v2 Pilot Implementation over a corpus of models, and reports, per file, the diagnostics both agree on, the ones only we report (candidate false positives) and the ones only the pilot reports (candidate gaps).","isRedistributable":true}
