This commit is contained in:
Markus Alexander Kuppe 2024-03-28 02:31:26 -07:00 коммит произвёл GitHub
Родитель 81c8b79d68
Коммит 8ace4aa604
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
6 изменённых файлов: 10 добавлений и 6 удалений

4
.github/workflows/tlaplus.yml поставляемый
Просмотреть файл

@ -144,7 +144,7 @@ jobs:
## Identify git diff: $(git diff --name-only HEAD^ | grep '.tla')
## Install genaiscript runtime: https://microsoft.github.io/genaiscript/reference/cli/
## Output LLM response in SARIF format: https://microsoft.github.io/genaiscript/reference/scripts/annotations/ (redirect other output to /dev/null for GH not to also show the annotations)
run: npx --yes genaiscript run scripts/TLAi-linter.genai.js $(git diff --name-only HEAD^ | grep '\.tla') --max-tokens 2000 --out-annotations results.sarif > /dev/null
run: npx --yes genaiscript run scripts/TLAi-linter.genai.js $(git diff --name-only HEAD^ | grep '\.tla') --max-tokens 2000 --out-annotations results.sarif > /dev/null && jq '.runs |= map(.results |= map(select(.level != "note")))' results.sarif > filtered.sarif
- name: Upload SARIF file
if: (success() || failure()) && steps.git_commit.outputs.contains_tla == 'true'
@ -152,4 +152,4 @@ jobs:
## https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
sarif_file: filtered.sarif

Просмотреть файл

@ -14,6 +14,7 @@ def(
// use $ to output formatted text to the prompt
$`You are an expert at TLA+/TLAPLUS. Your task is to check if the prose comments and their TLA+ declarations and definitions are syntactically and semantically consistent!!!
However, you may assume that that a parser has already checked the syntax of the TLA+ code.
Explain any consistencies and inconsistencies you may find. Report inconsistent and consistent pairs in a single ANNOTATION section.
## TLA+ Syntax Hints
@ -30,4 +31,7 @@ Explain any consistencies and inconsistencies you may find. Report inconsistent
## Formal and informal math Hints
- Take into account that humans may write informal math that is syntactically different from the formal math, yet semantically equivalent. For example, humans may write \`N > 3T\` instead of \`N > 3 * T\`.
## Natural language Hints
- Unless a built-in TLA+ declaration or definition like an operator in the TLA+ standard library dictates otherwise, the prose comments should follow British English spelling conventions.
`;

Просмотреть файл

@ -16,7 +16,7 @@ WriteStatsFile ==
/\ Serialize(<<TLCGet("stats")>>, StatsFilename, [format |-> "NDJSON", charset |-> "UTF-8", openOptions |-> <<"WRITE", "CREATE", "APPEND">>])
\* Append TLC coverage in ndJson format to file identified by CoverageFilename. Create CoverageFilename if it does not exist.
SerialiseCoverage ==
SerializeCoverage ==
Serialize(<<TLCGet("spec")>>, CoverageFilename, [format |-> "NDJSON", charset |-> "UTF-8", openOptions |-> <<"WRITE", "CREATE", "APPEND">>])
====

Просмотреть файл

@ -16,7 +16,7 @@ ls -tr <spec>_coverage.json | xargs cat | python3 actions.py
The spec needs to have constraint like:
SerialiseCoverage ==
SerializeCoverage ==
Serialize(<<TLCGet("spec")>>, CoverageFilename, [format |-> "NDJSON", charset |-> "UTF-8", openOptions |-> <<"WRITE", "CREATE", "APPEND">>])
"""

Просмотреть файл

@ -93,4 +93,4 @@ INVARIANTS
RetirementCompletedAreRetirementCompletedInv
_PERIODIC
SerialiseCoverage
SerializeCoverage

Просмотреть файл

@ -92,4 +92,4 @@ INVARIANTS
RetirementCompletedAreRetirementCompletedInv
_PERIODIC
SerialiseCoverage
SerializeCoverage