@@ -9,6 +9,8 @@ defmodule StackLab.Examples.GEPAPlatformRoundtrip.Receipt do
99 :optimization_fabric_scan ,
1010 :ai_run_lineage_scan ,
1111 :framework_projection ,
12+ :candidate_receipt ,
13+ :appkit_projection ,
1214 :promotion_ref ,
1315 :rollback_ref ,
1416 :trace_refs
@@ -22,6 +24,10 @@ defmodule StackLab.Examples.GEPAPlatformRoundtrip do
2224 Deterministic governed GEPA platform roundtrip proof.
2325 """
2426
27+ alias AppKit.OptimizationSurface
28+ alias GEPAFramework.Runtime
29+ alias Mezzanine.AIExecution.RuntimeDeps
30+ alias Mezzanine.OptimizationEngine
2531 alias StackLab.AIRunLineageScanner
2632 alias StackLab.Examples.GEPAPlatformRoundtrip.Receipt
2733 alias StackLab.ModelInferenceScanner
@@ -31,7 +37,15 @@ defmodule StackLab.Examples.GEPAPlatformRoundtrip do
3137
3238 @ spec run ( ) :: { :ok , Receipt . t ( ) } | { :error , term ( ) }
3339 def run do
34- with { :ok , buildout_result } <- GEPABuildout . run_domain_task ( buildout_input ( ) ) ,
40+ with { :ok , framework_result } <- Runtime . run ( framework_config ( ) , examples: example_refs ( ) ) ,
41+ { :ok , [ candidate_receipt ] } <-
42+ OptimizationEngine . propose_candidates ( optimization_spec ( ) , runtime_deps ( ) ,
43+ examples: example_refs ( )
44+ ) ,
45+ { :ok , appkit_projection } <-
46+ OptimizationSurface . candidate_projection (
47+ appkit_candidate_projection ( candidate_receipt )
48+ ) ,
3549 { :ok , model_scan } <- ModelInferenceScanner . scan ( model_scan_input ( ) ) ,
3650 { :ok , fabric_scan } <- OptimizationFabricScanner . scan ( fabric_scan_input ( ) ) ,
3751 { :ok , lineage_scan } <- AIRunLineageScanner . scan ( lineage_scan_input ( ) ) do
@@ -40,24 +54,104 @@ defmodule StackLab.Examples.GEPAPlatformRoundtrip do
4054 receipt_ref: "gepa-platform-roundtrip://phase-8/mock" ,
4155 fixture_refs: @ fixture_refs ,
4256 status: status ( [ model_scan , fabric_scan , lineage_scan ] ) ,
43- provider_dependency?: buildout_result . framework_result . provider_dependency? ,
57+ provider_dependency?: framework_result . provider_dependency? ,
4458 model_inference_scan: model_scan ,
4559 optimization_fabric_scan: fabric_scan ,
4660 ai_run_lineage_scan: lineage_scan ,
47- framework_projection: buildout_result . projection ,
61+ framework_projection: framework_projection ( framework_result ) ,
62+ candidate_receipt: candidate_receipt ,
63+ appkit_projection: appkit_projection ,
4864 promotion_ref: "promotion://gepa/candidate" ,
4965 rollback_ref: "rollback://gepa/candidate" ,
5066 trace_refs: [ "trace://gepa/roundtrip" , "trace://candidate/eval" ]
5167 } }
5268 end
5369 end
5470
55- defp buildout_input do
71+ defp runtime_deps do
72+ % RuntimeDeps { optimizer_adapter: GEPA.MezzanineOptimizerAdapter }
73+ end
74+
75+ defp example_refs , do: [ "example://gepa/phase-13/1" , "example://gepa/phase-13/2" ]
76+
77+ defp framework_config do
78+ % {
79+ runtime_ref: "run:gepa:phase13" ,
80+ task: % {
81+ task_ref: "target://gepa/role-worker" ,
82+ dataset_ref: "dataset://gepa/phase-13"
83+ } ,
84+ components: [
85+ % {
86+ component_ref: "component:gepa:mezzanine:1" ,
87+ kind: :component ,
88+ content_ref: "prompt-artifact://gepa/instruction/v1"
89+ }
90+ ] ,
91+ evaluator: % {
92+ evaluator_ref: "eval-suite://gepa/phase-13" ,
93+ objective_refs: [ "eval-suite://gepa/phase-13" ]
94+ } ,
95+ proposer: % {
96+ proposer_ref: "proposer:gepa:mezzanine" ,
97+ strategy: :deterministic_reflection
98+ } ,
99+ merge: % {
100+ merge_ref: "merge:gepa:disabled" ,
101+ strategy: :disabled
102+ } ,
103+ tracing: % { trace_refs: [ "trace://gepa/roundtrip" ] } ,
104+ persistence: % { profile: :memory_ephemeral }
105+ }
106+ end
107+
108+ defp optimization_spec do
109+ % {
110+ run_ref: "optimization-run://gepa/phase-13" ,
111+ tenant_ref: "tenant://phase-13" ,
112+ authority_ref: "authority://citadel/optimization/promotion" ,
113+ target_ref: "target://gepa/role-worker" ,
114+ framework_run_ref: "run:gepa:phase13" ,
115+ checkpoint_ref: "checkpoint://gepa/memory" ,
116+ budget_ref: "budget://optimization" ,
117+ eval_suite_ref: "eval-suite://gepa/phase-13" ,
118+ replay_bundle_ref: "replay-bundle://gepa/phase-13" ,
119+ trace_ref: "trace://gepa/roundtrip" ,
120+ memory_ref_set: [ "memory://gepa/promoted/context" ] ,
121+ prompt_ref_set: [ "prompt-artifact://gepa/instruction/v1" ] ,
122+ context_budget_ref: "context-packet://gepa/phase-13" ,
123+ guardrail_ref_set: [ "guardrail://gepa/input" , "guardrail://gepa/output" ] ,
124+ cost_budget_ref_set: [ "cost://optimization" ] ,
125+ drift_ref_set: [ "drift://gepa/window" ] ,
126+ persistence_ref_set: [ "persistence://gepa/memory-ephemeral" ] ,
127+ promotion_ref_set: [ "promotion://gepa/candidate" ] ,
128+ rollback_ref_set: [ "rollback://gepa/candidate" ]
129+ }
130+ end
131+
132+ defp framework_projection ( framework_result ) do
133+ % {
134+ task_ref: "target://gepa/role-worker" ,
135+ run_ref: framework_result . run_ref ,
136+ candidate_refs: framework_result . candidate_refs ,
137+ best_candidate_ref: framework_result . best_candidate_ref ,
138+ checkpoint: GEPAFramework.Persistence . to_projection ( framework_result . checkpoint ) ,
139+ trace_refs: framework_result . trace_refs
140+ }
141+ end
142+
143+ defp appkit_candidate_projection ( candidate_receipt ) do
56144 % {
57- task_ref: "task:gepa:phase-8" ,
58- dataset_ref: "dataset://gepa/phase-8" ,
59- example_refs: [ "example://gepa/phase-8/1" , "example://gepa/phase-8/2" ] ,
60- trace_ref: "trace://gepa/roundtrip"
145+ candidate_ref: candidate_receipt . candidate_ref ,
146+ run_ref: candidate_receipt . gepa_run_ref ,
147+ lineage_refs: candidate_receipt . lineage_refs ,
148+ score_refs: [ candidate_receipt . objective_score_ref ] ,
149+ eval_refs: candidate_receipt . eval_refs ,
150+ replay_refs: [ "replay-bundle://gepa/phase-13" ] ,
151+ budget_refs: [ "budget://optimization" ] ,
152+ trace_refs: [ candidate_receipt . trace_ref ] ,
153+ promotion_refs: candidate_receipt . promotion_refs ,
154+ rollback_refs: candidate_receipt . rollback_refs
61155 }
62156 end
63157
@@ -85,7 +179,9 @@ defmodule StackLab.Examples.GEPAPlatformRoundtrip do
85179 optimization_facts: [
86180 % {
87181 candidate_lineage_refs: [ "lineage://gepa/candidate" ] ,
88- eval_dataset_refs: [ "dataset://gepa/phase-8" ] ,
182+ context_packet_refs: [ "context-packet://gepa/phase-13" ] ,
183+ route_decision_refs: [ "target://gepa/role-worker" ] ,
184+ eval_dataset_refs: [ "eval-suite://gepa/phase-13" ] ,
89185 proposer_model_ref: "model-profile://mock/proposer" ,
90186 promotion_gate_refs: [
91187 "gate://eval" ,
@@ -96,7 +192,10 @@ defmodule StackLab.Examples.GEPAPlatformRoundtrip do
96192 "gate://canary" ,
97193 "gate://human-approval"
98194 ] ,
195+ citadel_authority_refs: [ "authority://citadel/optimization/promotion" ] ,
196+ appkit_projection_refs: [ "appkit://optimization/candidate" ] ,
99197 budget_refs: [ "budget://optimization" ] ,
198+ cost_refs: [ "cost://optimization" ] ,
100199 trace_refs: [ "trace://candidate/eval" ] ,
101200 trace_redaction: :redacted ,
102201 promotion_refs: [ "promotion://gepa/candidate" ] ,
0 commit comments