From 7b29dbff7e43e87741476f47df17ad1582b16546 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Mon, 21 Sep 2026 00:58:15 +0800 Subject: feat(pipeline): add runnable artifact pipeline increment [Change Nature] - This commit adds the first runnable increment of the F# artifact pipeline: CLI, server, frontend bundle, stage fixture, and tests. It is feature work, not a bug fix. [New Capability] - CLI `run` executes the three-step Blender fixture through the process bridge and writes GLBs, step logs, events, and a manifest; `verify` validates a manifest without Blender. - Server exposes run start, run-scoped SSE, artifact manifest/file routes, and serves the Fable frontend from its build output. - Frontend starts runs, follows run-scoped SSE progress, and links the artifact manifest on completion. [Implementation] - Shared layer holds domain, run state, replay, and artifact contracts; Modeling holds the pipeline, 120s bridge timeout, and result-file protocol; stage/blender/fixture.py owns geometry in Python (bpy owns geometry, F# owns orchestration). - Fable bundle is regenerated into public/ and copied by the server project; solution includes all projects with warnings-as-errors. - README documents build, Fable, server, interpreter/env, fixture limitations, and current verification status. [Impact] - Verified: 40/40 solution tests pass; Release build 0 warnings/errors; real CLI run with bpy 5.0.1 produced 3 GLBs, 3 logs, and a verify-clean manifest; isolated-port server smoke flow succeeded. - Not yet verified: browser end-to-end behavior and production fidelity. Artifacts and caches are gitignored. --- tests/SomhairlesDream.Cli.Tests/ArgumentsTests.fs | 70 ++++++++++++++++++++++ .../SomhairlesDream.Cli.Tests.fsproj | 21 +++++++ 2 files changed, 91 insertions(+) create mode 100644 tests/SomhairlesDream.Cli.Tests/ArgumentsTests.fs create mode 100644 tests/SomhairlesDream.Cli.Tests/SomhairlesDream.Cli.Tests.fsproj (limited to 'tests/SomhairlesDream.Cli.Tests') diff --git a/tests/SomhairlesDream.Cli.Tests/ArgumentsTests.fs b/tests/SomhairlesDream.Cli.Tests/ArgumentsTests.fs new file mode 100644 index 0000000..f55762e --- /dev/null +++ b/tests/SomhairlesDream.Cli.Tests/ArgumentsTests.fs @@ -0,0 +1,70 @@ +module SomhairlesDream.Cli.Tests.ArgumentsTests + +open Xunit +open SomhairlesDream.Cli + +let private expectOk = function + | Ok value -> value + | Error message -> failwith message + +let private expectError = function + | Error message -> message + | Ok _ -> failwith "expected an error" + +[] +let ``run command applies documented defaults`` () = + match Arguments.parse [| "run" |] |> expectOk with + | Run options -> + Assert.Equal("heritage-001", options.Ids.ProjectId) + Assert.Equal("run-001", options.Ids.RunId) + Assert.Equal("base-000", options.Ids.BaseId) + Assert.Equal("target-003", options.Ids.TargetId) + Assert.Equal(".artifacts", options.OutputRoot) + Assert.Equal("stage", options.StageRoot) + Assert.False(options.Render) + Assert.NotEmpty(options.Python) + | Verify _ + | Help -> failwith "expected run command" + +[] +let ``run command parses explicit ids and render flag`` () = + match + Arguments.parse + [| "run" + "--project-id" + "project-x" + "--run-id" + "run-x" + "--base-id" + "base-x" + "--target-id" + "target-x" + "--output-root" + "out" + "--stage-root" + "fixtures" + "--python" + "/tmp/python" + "--render" |] + |> expectOk with + | Run options -> + Assert.Equal("project-x", options.Ids.ProjectId) + Assert.Equal("run-x", options.Ids.RunId) + Assert.Equal("base-x", options.Ids.BaseId) + Assert.Equal("target-x", options.Ids.TargetId) + Assert.Equal("out", options.OutputRoot) + Assert.Equal("fixtures", options.StageRoot) + Assert.Equal("/tmp/python", options.Python) + Assert.True(options.Render) + | Verify _ + | Help -> failwith "expected run command" + +[] +let ``verify command requires exactly one manifest path`` () = + match Arguments.parse [| "verify"; "run"; "extra" |] |> expectError with + | message -> Assert.Contains("manifest", message) + +[] +let ``arguments reject unsafe resource ids`` () = + match Arguments.parse [| "run"; "--project-id"; "../escape" |] |> expectError with + | message -> Assert.Contains("resource id", message) diff --git a/tests/SomhairlesDream.Cli.Tests/SomhairlesDream.Cli.Tests.fsproj b/tests/SomhairlesDream.Cli.Tests/SomhairlesDream.Cli.Tests.fsproj new file mode 100644 index 0000000..461d5eb --- /dev/null +++ b/tests/SomhairlesDream.Cli.Tests/SomhairlesDream.Cli.Tests.fsproj @@ -0,0 +1,21 @@ + + + net8.0 + false + true + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + -- cgit v1.2.3