Skip to content

Commit cfaa54b

Browse files
committed
Phase 36: add chassis evolution proof tag
1 parent e37b76f commit cfaa54b

5 files changed

Lines changed: 45 additions & 1 deletion

File tree

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
defmodule StackLab.ChassisBridge do
22
@moduledoc "StackLab proof catalog bridge for Chassis."
33

4+
alias Chassis.Evolution.Conformance.Evidence, as: EvolutionEvidence
45
alias Chassis.StackLab.Bridge.RunConformance
56

67
@spec run(atom() | String.t()) :: {:ok, map()} | {:error, term()}
@@ -9,13 +10,15 @@ defmodule StackLab.ChassisBridge do
910
end
1011

1112
def run(tag) when tag in ["chassis_evolution", :chassis_evolution],
12-
do: {:error, {:not_implemented, :chassis_evolution_conformance}}
13+
do: Chassis.Evolution.Conformance.stacklab_report()
1314

1415
def run(tag) when tag in ["chassis_model_asset", :chassis_model_asset],
1516
do: {:error, {:not_implemented, :chassis_model_asset_conformance}}
1617

1718
def run(tag), do: {:error, {:unknown_tag, tag}}
1819

1920
@spec jsonable_report(map()) :: map()
21+
def jsonable_report(%{tag: :chassis_evolution} = report), do: EvolutionEvidence.jsonable(report)
22+
2023
def jsonable_report(report), do: RunConformance.jsonable_report(report)
2124
end

bridges/stacklab_chassis_bridge/mix.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ defmodule StackLab.ChassisBridge.MixProject do
1919

2020
defp deps do
2121
[
22+
{:chassis_evolution_conformance,
23+
path: "../../../chassis/proof/chassis_evolution_conformance"},
2224
{:chassis_stacklab_bridge, path: "../../../chassis/proof/chassis_stacklab_bridge"},
2325
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
2426
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},

bridges/stacklab_chassis_bridge/mix.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@
1111
"makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"},
1212
"makeup_erlang": {:hex, :makeup_erlang, "1.1.0", "835f7e60792e08824cda445639555d7bf1bbbddb1b60b306e33cb6f6db24dc74", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "1cd6780fb1dd1a03979abaed0fe82712b0625118fd5257d3ebbf73f960c73c3c"},
1313
"nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"},
14+
"telemetry": {:hex, :telemetry, "1.4.2", "a0cb522801dffb1c49fe6e30561badffc7b6d0e180db1300df759faa22062855", [:rebar3], [], "hexpm", "928f6495066506077862c0d1646609eed891a4326bee3126ba54b60af61febb1"},
1415
}

bridges/stacklab_chassis_bridge/test/chassis_bridge_test.exs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,27 @@ defmodule StackLab.ChassisBridgeTest do
2929
assert Enum.all?(report.proofs, &(is_map(&1.evidence) and map_size(&1.evidence) > 0))
3030
end
3131

32+
test "runs chassis evolution proof catalog with scenario evidence" do
33+
assert {:ok, report} = StackLab.ChassisBridge.run(:chassis_evolution)
34+
35+
assert report.tag == :chassis_evolution
36+
assert report.passed == 21
37+
assert report.failed == 0
38+
assert report.skipped == 0
39+
40+
names = Enum.map(report.proofs, & &1.name)
41+
assert "chassis.evolution.source_level_patch_success.v1" in names
42+
assert "chassis.evolution.receipt_redaction.v1" in names
43+
assert "chassis.evolution.mezzanine_projections_reduced.v1" in names
44+
45+
source =
46+
Enum.find(report.proofs, &(&1.name == "chassis.evolution.source_level_patch_success.v1"))
47+
48+
assert source.status == :pass
49+
assert source.evidence.final_state == :committed
50+
assert length(source.evidence.spans) == 16
51+
end
52+
3253
test "unknown tags fail closed instead of returning a zero-success report" do
3354
assert {:error, {:unknown_tag, :missing}} = StackLab.ChassisBridge.run(:missing)
3455
end

test/stack_lab/run_task_test.exs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,21 @@ defmodule StackLab.RunTaskTest do
3030
assert decoded["skipped"] == 0
3131
assert Enum.map(decoded["proofs"], & &1["name"]) == @proof_names
3232
end
33+
34+
test "stack_lab.run emits structural JSON for chassis evolution tag" do
35+
output =
36+
capture_io(fn ->
37+
Mix.Tasks.StackLab.Run.run(["--tag", "chassis_evolution", "--json"])
38+
end)
39+
40+
assert {:ok, decoded} = Jason.decode(output)
41+
assert decoded["tag"] == "chassis_evolution"
42+
assert decoded["passed"] == 21
43+
assert decoded["failed"] == 0
44+
45+
assert Enum.any?(
46+
decoded["proofs"],
47+
&(&1["name"] == "chassis.evolution.source_level_patch_success.v1")
48+
)
49+
end
3350
end

0 commit comments

Comments
 (0)