Create an optional hook system for externally-managed verification

This commit is contained in:
Ohad Livne 2026-02-10 18:52:52 +02:00
parent d8f0429537
commit 185199aaad
Signed by: libohad-dev
GPG key ID: 34FDC68B51191A4D
5 changed files with 99 additions and 9 deletions

View file

@ -83,9 +83,13 @@ Perform each of these checks and record findings:
- If System.tla is newer than verification/matrix.md, flag that verification may be stale
- If design docs are newer than documentation files, flag potential documentation drift
### 3. Run TLC (if spec exists)
### 3. Run verification
If `spec/formal/System.tla` and `spec/formal/System.cfg` exist:
If `spec/hooks/run-checks` exists and is executable, delegate all verification (TLC and language-specific tools) to it (see `/formspec.init` for the hook interface). Build the request from `spec/formal/traceability.md` (TLA+ properties), `spec/plan.md` (verification methods), and detected source files (language-specific checks). The external system runs all checks independently and returns results.
If the hook does not exist or fails, run checks locally:
**TLC** (if `spec/formal/System.tla` and `spec/formal/System.cfg` exist):
```bash
tlc spec/formal/System.tla -config spec/formal/System.cfg -workers auto -metadir /tmp/tlc-states -cleanup
@ -93,7 +97,7 @@ tlc spec/formal/System.tla -config spec/formal/System.cfg -workers auto -metadir
Record pass/fail for each property.
### 4. Run language-specific verification tools (if implementation exists)
**Language-specific verification tools** (if implementation exists):
Detect the project's language(s) from source files and run appropriate tools:
- **Rust**: `cargo test`, `cargo clippy`
@ -104,7 +108,7 @@ Detect the project's language(s) from source files and run appropriate tools:
Only run tools that are available and applicable. Skip gracefully if tooling isn't set up.
### 5. Report
### 4. Report
Produce a structured report organized by severity: