Skip to content

Auto-commit regenerated formal artifacts after solve pipeline runs #30

@jobordu

Description

@jobordu

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:

  1. Drift accumulation — artifacts pile up as unstaged changes, making git status noisy and hiding actual work
  2. Lost context — when a human or /nf:quick finally commits, the artifact changes get lumped into an unrelated commit or require a manual chore: sync formal verification artifacts step

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):

  1. /nf:solve orchestrator (commands/nf/solve.md) — after remediation completes, before report
  2. /nf:execute-phase end — after all tasks complete, commit any dirty .planning/formal/ files
  3. /nf:quick end — same
  4. PostToolUse hook — after Bash calls that run bin/*.cjs generators, detect dirty .planning/formal/ and auto-commit
  5. 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-verify only 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions