Jido.AI.Quality.Checkpoint (Jido AI v2.2.0)

Copy Markdown View Source

Final stable quality checkpoint helpers.

The checkpoint runs fast/full gate command sets, captures timing metrics, and verifies traceability closure between story matrix rows and story commits.

Summary

Functions

Canonical fast gate command set.

Canonical full gate command set.

Sums command timings into fast/full gate totals.

Returns missing story IDs from traceability after accounting for commit IDs and allowed gaps.

Validates story ID format and returns normalized IDs.

Reads and parses story IDs from local git commit subjects.

Reads and parses story IDs from a traceability matrix file.

Runs a single command and captures elapsed milliseconds.

Runs each command in order and returns timing records.

Parses story IDs from git subject lines matching feat(story): ST-....

Parses story IDs from traceability matrix markdown content.

Verifies traceability closure and returns result details.

Types

command_failure()

@type command_failure() :: %{
  gate: gate(),
  label: String.t(),
  cmd: String.t(),
  args: [String.t()],
  status: non_neg_integer(),
  elapsed_ms: non_neg_integer()
}

command_spec()

@type command_spec() :: %{
  gate: gate(),
  label: String.t(),
  cmd: String.t(),
  args: [String.t()]
}

command_timing()

@type command_timing() :: %{
  gate: gate(),
  label: String.t(),
  elapsed_ms: non_neg_integer()
}

gate()

@type gate() :: :fast | :full

traceability_result()

@type traceability_result() :: %{
  traceability_story_ids: [String.t()],
  commit_story_ids: [String.t()],
  missing_story_ids: [String.t()]
}

Functions

fast_gate_commands()

@spec fast_gate_commands() :: [command_spec()]

Canonical fast gate command set.

full_gate_commands()

@spec full_gate_commands() :: [command_spec()]

Canonical full gate command set.

gate_totals(timings)

@spec gate_totals([command_timing()]) :: %{
  fast: non_neg_integer(),
  full: non_neg_integer()
}

Sums command timings into fast/full gate totals.

missing_story_ids(traceability_story_ids, commit_story_ids, opts \\ [])

@spec missing_story_ids([String.t()], [String.t()], keyword()) :: [String.t()]

Returns missing story IDs from traceability after accounting for commit IDs and allowed gaps.

normalize_story_ids(story_ids)

@spec normalize_story_ids([String.t()]) ::
  {:ok, [String.t()]} | {:error, [String.t()]}

Validates story ID format and returns normalized IDs.

read_story_commit_ids(repo_path \\ ".")

@spec read_story_commit_ids(String.t()) :: {:ok, [String.t()]} | {:error, term()}

Reads and parses story IDs from local git commit subjects.

read_traceability_story_ids(path)

@spec read_traceability_story_ids(String.t()) ::
  {:ok, [String.t()]} | {:error, term()}

Reads and parses story IDs from a traceability matrix file.

run_command(command, opts \\ [])

@spec run_command(
  command_spec(),
  keyword()
) :: {:ok, command_timing()} | {:error, command_failure()}

Runs a single command and captures elapsed milliseconds.

run_commands(commands, opts \\ [])

@spec run_commands(
  [command_spec()],
  keyword()
) :: {:ok, [command_timing()]} | {:error, command_failure()}

Runs each command in order and returns timing records.

story_ids_from_git_log(log_output)

@spec story_ids_from_git_log(String.t()) :: [String.t()]

Parses story IDs from git subject lines matching feat(story): ST-....

story_ids_from_traceability(markdown)

@spec story_ids_from_traceability(String.t()) :: [String.t()]

Parses story IDs from traceability matrix markdown content.

verify_traceability(traceability_story_ids, commit_story_ids, opts \\ [])

@spec verify_traceability([String.t()], [String.t()], keyword()) ::
  {:ok, traceability_result()} | {:error, traceability_result()}

Verifies traceability closure and returns result details.