Skip to content

Commit 0d0bac2

Browse files
committed
Add product-safe agent intake projections
1 parent 794a553 commit 0d0bac2

13 files changed

Lines changed: 832 additions & 28 deletions

File tree

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ redaction, and tenant-scoped checks.
9595
The workspace currently exposes these product-facing families:
9696

9797
- **Work and runtime:** `AppKit.WorkControl`, `AppKit.WorkSurface`,
98-
`AppKit.HeadlessSurface`, `AppKit.RuntimeSurface`, and
98+
`AppKit.HeadlessSurface`, `AppKit.AgentIntake`, `AppKit.RuntimeSurface`, and
9999
`AppKit.RunGovernance` provide governed run start/control, runtime
100-
projections, headless state/readback, live-effect receipts, and product-safe
101-
runtime profile application.
100+
projections, agent run start/turn/cancel/cursor catch-up/pending summaries,
101+
headless state/readback, live-effect receipts, and product-safe runtime
102+
profile application.
102103
- **Operator and review:** `AppKit.OperatorSurface` and
103104
`AppKit.ReviewSurface` provide queue/detail/review readbacks, review
104105
decisions, lower-read leases, stream-attach leases, and operator-visible
@@ -134,6 +135,15 @@ refs, dispatch refs, receipt refs, evidence refs, and trace summary hashes
134135
without exposing Mezzanine, Citadel, Jido Integration, Execution Plane, or
135136
AITrace internals to product code.
136137

138+
The native agent foundation uses `AppKit.AgentIntake` as the product-safe
139+
surface for agent runs. Products may submit an `AgentRunRequest`, submit a
140+
`TurnSubmission`, cancel a run, catch up from an `AgentRunCursor`, and list
141+
`AgentPendingInteraction` summaries. Those DTOs carry refs, summaries, bounded
142+
kinds, and cursors only. Product code must not import AgentInterop contracts,
143+
runtime receipts, lower ledger truth, generated protocol modules, raw
144+
endpoints, provider payloads, credentials, raw prompts, AX runtime names, or
145+
A2A names.
146+
137147
The dedicated Synapse conformance command is owned by StackLab:
138148

139149
```bash

bridges/mezzanine_bridge/lib/app_kit/bridges/mezzanine_bridge.ex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,16 @@ defmodule AppKit.Bridges.MezzanineBridge do
471471
AgentIntakeAdapter.await_agent_outcome(context, run_ref, request, opts)
472472
end
473473

474+
@impl AppKit.Core.Backends.AgentIntakeBackend
475+
def catch_up_agent_events(%RequestContext{} = context, cursor, opts) do
476+
AgentIntakeAdapter.catch_up_agent_events(context, cursor, opts)
477+
end
478+
479+
@impl AppKit.Core.Backends.AgentIntakeBackend
480+
def list_pending_interactions(%RequestContext{} = context, request, opts) do
481+
AgentIntakeAdapter.list_pending_interactions(context, request, opts)
482+
end
483+
474484
@impl AppKit.EffectSurface
475485
def propose_effect(%RequestContext{} = context, effect_params, opts) do
476486
EffectAdapter.propose_effect(context, effect_params, opts)

bridges/mezzanine_bridge/lib/app_kit/bridges/mezzanine_bridge/agent_intake_adapter.ex

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ defmodule AppKit.Bridges.MezzanineBridge.AgentIntakeAdapter do
1010
RuntimeReadbackMapping
1111
}
1212

13-
alias AppKit.Core.AgentIntake.RunOutcomeFuture
13+
alias AppKit.Core.AgentIntake.{AgentRunEventPage, RunOutcomeFuture}
1414
alias AppKit.Core.RequestContext
1515
alias AppKit.Core.RuntimeReadback.CommandResult
1616

@@ -89,4 +89,26 @@ defmodule AppKit.Bridges.MezzanineBridge.AgentIntakeAdapter do
8989
{:error, :agent_turn_runtime_not_available}
9090
end
9191
end
92+
93+
@impl true
94+
def catch_up_agent_events(%RequestContext{}, cursor, opts) do
95+
if RuntimeMapping.runtime_available?(RuntimeMapping.agent_runtime(opts)) do
96+
AgentRunEventPage.new(%{
97+
cursor: cursor,
98+
events: [],
99+
has_more?: false
100+
})
101+
else
102+
{:error, :agent_turn_runtime_not_available}
103+
end
104+
end
105+
106+
@impl true
107+
def list_pending_interactions(%RequestContext{}, _request, opts) do
108+
if RuntimeMapping.runtime_available?(RuntimeMapping.agent_runtime(opts)) do
109+
{:ok, []}
110+
else
111+
{:error, :agent_turn_runtime_not_available}
112+
end
113+
end
92114
end

bridges/mezzanine_bridge/test/app_kit/bridges/mezzanine_bridge_contract_characterization_test.exs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ defmodule AppKit.Bridges.MezzanineBridgeContractCharacterizationTest do
174174
start_agent_run: 3,
175175
submit_agent_turn: 3,
176176
cancel_agent_run: 3,
177-
await_agent_outcome: 4
177+
await_agent_outcome: 4,
178+
catch_up_agent_events: 3,
179+
list_pending_interactions: 3
178180
]
179181
},
180182
%{

core/app_kit_core/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Current contract groups:
2727
suppression visibility projection
2828
- runtime projection DTOs for source binding, workspace, execution, lower
2929
receipt, evidence, review, operator-command, and runtime-event facts
30+
- native agent intake DTOs for agent run requests, turn submissions, cursor
31+
catch-up, event pages, pending interaction summaries, and pending queries
3032
- extension supply-chain DTOs for pack integrity posture, pack bundle schema,
3133
and connector-admission projection
3234
- northbound backend behaviours for work queries, reviews, and installations
@@ -112,6 +114,15 @@ retention disabled without changing provider-effect or readback semantics.
112114
`AppKit.Core.Result` and `AppKit.Core.RunRef` remain part of the current
113115
northbound contract set and are not treated as temporary coexistence shims.
114116

117+
`AppKit.AgentIntake` is the product-facing native agent boundary. Product code
118+
uses AppKit DTOs for run start, turn submission, cancellation, cursor catch-up,
119+
and pending interaction summaries. These DTOs expose opaque refs and bounded
120+
summary fields only. They reject lower selectors, raw transport endpoints,
121+
generated protocol module names, provider payloads, credential fields, raw
122+
prompt shortcut fields, AX runtime vocabulary, and A2A vocabulary. AgentInterop
123+
descriptors, runtime receipts, and ledger truth are lower-owner concepts and
124+
are not AppKit product APIs.
125+
115126
Default runtime backend configuration for the surface packages belongs under
116127
the `:app_kit_core` OTP application. The workspace no longer uses a synthetic
117128
`:app_kit` config namespace for surface backends.

0 commit comments

Comments
 (0)