Feat v0.9.2 Starlark converter consolidation + snapshot cleanup (#75)
All checks were successful
CI/CD / detect-changes (pull_request) Successful in 4s
CI/CD / test-frontend (pull_request) Has been skipped
CI/CD / test-runners (pull_request) Has been skipped
CI/CD / e2e-smoke (pull_request) Has been skipped
CI/CD / test-go-pg (pull_request) Successful in 2m43s
CI/CD / test-sqlite (pull_request) Successful in 2m52s
CI/CD / build-and-deploy (pull_request) Successful in 2m15s

Consolidate duplicate Go↔Starlark converters into sandbox/convert.go
and snapshot parsers into models/snapshot.go. Standardize snapshot
creation on wrapped format. Net -393 lines across 21 files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-03 14:20:05 +00:00
parent d03dfe502f
commit b8a4c516ff
24 changed files with 362 additions and 479 deletions

View File

@@ -51,7 +51,7 @@ func seedEngineFixture(t *testing.T, slug string) (string, string, string) {
}
}
snapshot, _ := json.Marshal(stages)
snapshot, _ := json.Marshal(map[string]any{"stages": stages})
ver := &models.WorkflowVersion{WorkflowID: wf.ID, VersionNumber: 1, Snapshot: snapshot}
if err := s.Workflows.Publish(ctx, ver); err != nil {
t.Fatalf("publish: %v", err)
@@ -140,7 +140,7 @@ func TestEngine_BranchRouting(t *testing.T) {
for i := range stages {
s.Workflows.CreateStage(ctx, &stages[i])
}
snapshot, _ := json.Marshal(stages)
snapshot, _ := json.Marshal(map[string]any{"stages": stages})
s.Workflows.Publish(ctx, &models.WorkflowVersion{WorkflowID: wf.ID, VersionNumber: 1, Snapshot: snapshot})
// Test: priority=high → escalation
@@ -189,7 +189,7 @@ func TestEngine_PublicEntry(t *testing.T) {
for i := range stages {
s.Workflows.CreateStage(ctx, &stages[i])
}
snapshot, _ := json.Marshal(stages)
snapshot, _ := json.Marshal(map[string]any{"stages": stages})
s.Workflows.Publish(ctx, &models.WorkflowVersion{WorkflowID: wf.ID, VersionNumber: 1, Snapshot: snapshot})
// StartPublic
@@ -259,7 +259,7 @@ func TestEngine_SignoffGate(t *testing.T) {
for i := range stages {
s.Workflows.CreateStage(ctx, &stages[i])
}
snapshot, _ := json.Marshal(stages)
snapshot, _ := json.Marshal(map[string]any{"stages": stages})
s.Workflows.Publish(ctx, &models.WorkflowVersion{WorkflowID: wf.ID, VersionNumber: 1, Snapshot: snapshot})
inst, _ := eng.Start(ctx, wf.ID, json.RawMessage(`{}`), user1)
@@ -313,7 +313,7 @@ func TestEngine_SignoffRejection(t *testing.T) {
for i := range stages {
s.Workflows.CreateStage(ctx, &stages[i])
}
snapshot, _ := json.Marshal(stages)
snapshot, _ := json.Marshal(map[string]any{"stages": stages})
s.Workflows.Publish(ctx, &models.WorkflowVersion{WorkflowID: wf.ID, VersionNumber: 1, Snapshot: snapshot})
inst, _ := eng.Start(ctx, wf.ID, json.RawMessage(`{}`), userID)
@@ -495,7 +495,7 @@ func TestEngine_AutomatedStageContextIncludesStartedBy(t *testing.T) {
for i := range stages {
s.Workflows.CreateStage(ctx, &stages[i])
}
snapshot, _ := json.Marshal(stages)
snapshot, _ := json.Marshal(map[string]any{"stages": stages})
s.Workflows.Publish(ctx, &models.WorkflowVersion{WorkflowID: wf.ID, VersionNumber: 1, Snapshot: snapshot})
// Engine with no runner — automated stage silently skips, instance stays at auto-stage