Skip to content

Commit ecb8bb9

Browse files
committed
Add Context ABI roundtrip proof
1 parent 992a836 commit ecb8bb9

23 files changed

Lines changed: 1617 additions & 1 deletion

File tree

.blitz/test_state_v1/indexes/task_states.ndjson

Lines changed: 100 additions & 0 deletions
Large diffs are not rendered by default.

build_support/weld.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ defmodule StackLab.Build.WeldContract do
1414
"support/optimization_fabric_scanner",
1515
"support/coordination_fabric_scanner",
1616
"support/cost_budget_scanner",
17+
"support/context_abi_scanner",
1718
"support/adaptive_control_scanner",
1819
"support/ai_run_lineage_scanner",
1920
"support/persistence_matrix_scanner",
@@ -32,6 +33,7 @@ defmodule StackLab.Build.WeldContract do
3233
"examples/guardrail_roundtrip",
3334
"examples/replay_roundtrip",
3435
"examples/cost_roundtrip",
36+
"examples/context_abi_roundtrip",
3537
"examples/gepa_platform_roundtrip",
3638
"examples/trinity_platform_roundtrip",
3739
"examples/adaptive_control_roundtrip",

build_support/workspace_contract.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ defmodule StackLab.Build.WorkspaceContract do
1313
"support/optimization_fabric_scanner",
1414
"support/coordination_fabric_scanner",
1515
"support/cost_budget_scanner",
16+
"support/context_abi_scanner",
1617
"support/adaptive_control_scanner",
1718
"support/ai_run_lineage_scanner",
1819
"support/persistence_matrix_scanner",
@@ -37,6 +38,7 @@ defmodule StackLab.Build.WorkspaceContract do
3738
"examples/guardrail_roundtrip",
3839
"examples/replay_roundtrip",
3940
"examples/cost_roundtrip",
41+
"examples/context_abi_roundtrip",
4042
"examples/toy_document_review",
4143
"examples/synapse_product_acceptance",
4244
"examples/gepa_platform_roundtrip",

docs/gn_ten_proof_matrix.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ not claim authoritative audit truth or production deployment proof.
4545
| 000 repo contracts | docs + repo owners | documentation complete | copy reviewed repo-agent instructions into repo roots |
4646
| 100 development process | `stack_lab`, `AITrace` | StackLab development loop and local trace fixtures implemented | keep trace fixtures current with proof loop changes |
4747
| 200 refactoring | repo owners | refactoring deletion backlog proof implemented with inventory, deletion campaign links, and retention/no-op receipts | keep inventory current and open concrete deletion campaigns when active candidates appear |
48-
| 300 architecture | docs + `stack_lab` | manifest, artifact ledger, and product no-bypass fixtures implemented | keep product fixture proof wired into CI and expand fixtures as product shapes change |
48+
| 300 architecture | docs + `stack_lab` | manifest, artifact ledger, product no-bypass, and Context ABI roundtrip fixtures implemented | keep product and Context ABI fixture proofs wired into CI and expand fixtures as product shapes change |
4949
| 400 agent patterns | `outer_brain`, `citadel`, `jido_integration`, `execution_plane` | connector provider-free, budget, and agent-turn runtime pattern proofs implemented | add live runtime drills only when release claims require them |
5050
| 500 governance | `citadel`, `mezzanine`, `jido_integration` | tenant isolation, connector secret lease, prompt-injection fixtures, and governed connector compliance export fixture implemented | add incident export and production compliance-retention fixtures only when release claims require them |
5151
| 600 deployment | `stack_lab`, `mezzanine`, `AITrace` | local single-node deployment rehearsal implemented | convert local rehearsals into clean-host operator drills once deploy scripts are repo-owned |
@@ -129,6 +129,11 @@ path, and run GitHub or Linear live commands by prefixing them with
129129
with mock route selection, role injection, provider pool readiness, verifier
130130
refs, handoff scope refs, AppKit coordination projections, coordination
131131
fabric scanner receipts, trace refs, and replay refs.
132+
- `context_abi_roundtrip`: runs the deterministic fugu Context ABI proof from
133+
AppKit context-surface input through OuterBrain packet compile and render
134+
refs, Citadel authority, Mezzanine admission/routing/render handoff, Jido
135+
fake model invocation, AITrace bounded evidence, AppKit projections, and
136+
StackLab context/model/cost/lineage/tenant/memory scanner receipts.
132137
- `cost_budget_scanner`: verifies adaptive token, provider request,
133138
self-hosted GPU minute, endpoint startup, eval batch, replay, optimization
134139
search, provider pool turn, role budget, promotion, failed retry, budget

docs/layout.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ The workspace is organized as:
2525
- `support/cost_budget_scanner/`
2626
- adaptive token, model, GPU, eval, replay, optimization, provider pool,
2727
role, promotion, retry, exhaustion, projection, span, and receipt checks
28+
- `support/context_abi_scanner/`
29+
- Context ABI packet, authority, admission, route, render, model invocation,
30+
AppKit projection, tenant, and AITrace linkage checks
2831
- `support/adaptive_control_scanner/`
2932
- TRINITY trace, dataset, GEPA target, gate, promotion, rollback, stale
3033
rejection, AppKit projection, and receipt checks
@@ -39,6 +42,7 @@ The workspace is organized as:
3942
- `restart_authority_drill`
4043
- `atom_cleanup_harness`
4144
- `pressure_failover_drill`
45+
- `context_abi_roundtrip`
4246
- `gepa_platform_roundtrip`
4347
- `trinity_platform_roundtrip`
4448
- `adaptive_control_roundtrip`
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[
2+
inputs: ["{mix,.formatter}.exs", "{lib,test}/**/*.{ex,exs}"]
3+
]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# StackLab Context ABI Roundtrip
2+
3+
Deterministic fugu Context ABI proof app.
4+
5+
The roundtrip enters through AppKit, compiles a Context ABI packet in
6+
OuterBrain, authorizes it in Citadel, admits it in Mezzanine, renders prompt
7+
and provider payload refs through the Mezzanine AI execution handoff, invokes
8+
the Jido Integration fake runtime, emits bounded AITrace facts, and projects
9+
product-safe AppKit summaries.
10+
11+
The proof is provider-free and ref-only. It does not prove live provider
12+
behavior, production persistence, or distributed node placement.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
defmodule Mix.Tasks.StackLab.ContextAbi.Roundtrip do
2+
@moduledoc "Runs the deterministic Context ABI roundtrip proof."
3+
@shortdoc "Runs the deterministic Context ABI roundtrip proof"
4+
5+
use Mix.Task
6+
7+
alias StackLab.Examples.ContextABIRoundtrip
8+
9+
@impl true
10+
def run(args) do
11+
Mix.Task.run("app.start")
12+
13+
json? = "--json" in args
14+
15+
case ContextABIRoundtrip.run() do
16+
{:ok, receipt} when json? ->
17+
Mix.shell().info(ContextABIRoundtrip.to_json!(receipt))
18+
19+
{:ok, receipt} ->
20+
Mix.shell().info("status=#{receipt.status}")
21+
Mix.shell().info("receipt_ref=#{receipt.receipt_ref}")
22+
Mix.shell().info("context_packet_ref=#{receipt.context_packet_ref}")
23+
Mix.shell().info("model_receipt_ref=#{receipt.model_receipt_ref}")
24+
25+
{:error, reason} ->
26+
Mix.raise("context ABI roundtrip failed: #{inspect(reason)}")
27+
end
28+
end
29+
end

0 commit comments

Comments
 (0)