-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Problem
When the solve pipeline (or hooks like nf-spec-regen.js) regenerates formal verification artifacts under .planning/formal/, the changes are left uncommitted. This creates two problems:
- Drift accumulation — artifacts pile up as unstaged changes, making
git statusnoisy and hiding actual work - Lost context — when a human or
/nf:quickfinally commits, the artifact changes get lumped into an unrelated commit or require a manualchore: sync formal verification artifactsstep
Observed in PR #29
After fixing 8 triage issues and committing the source changes, 31 formal artifacts were left uncommitted (gates, evidence, hazard-model, etc.). These had to be manually staged and committed as a separate step.
Expected Behavior
After any nForma pipeline step that regenerates .planning/formal/ artifacts, auto-commit them with a standardized message like:
chore: sync formal verification artifacts [auto]
Where to hook this
Candidates (pick one or combine):
/nf:solveorchestrator (commands/nf/solve.md) — after remediation completes, before report/nf:execute-phaseend — after all tasks complete, commit any dirty.planning/formal/files/nf:quickend — same- PostToolUse hook — after
Bashcalls that runbin/*.cjsgenerators, detect dirty.planning/formal/and auto-commit - Stop hook (
hooks/nf-stop.js) — before session ends, if.planning/formal/has uncommitted changes, commit them
Option 5 (recommended)
The Stop hook already runs at conversation end. Adding a git add .planning/formal/ && git commit there would catch ALL cases — solve, execute, quick, manual runs — without duplicating logic across multiple skills.
Guardrails
- Only commit if the current branch is NOT
main(avoid accidental main commits) - Only commit
.planning/formal/paths (not source code) - Skip if nothing dirty in
.planning/formal/ - Use
--no-verifyonly if pre-commit hooks would block (e.g., lint on JSON) - Include a
[auto]tag in the commit message so humans can distinguish auto-commits from manual ones
Impact
Every nForma session that runs solve, execute, or generators leaves behind uncommitted artifacts. This is a friction point for every user.