1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// Copyright (c) 2026 2youg1 and the sprawling contributors
//! The model seam (seam registry ARCHITECTURE 3).
//! Every provider call carries a `BuildingPolicy` value; the policy is
//! *defined* here (kernel cannot name outer crates) and *evaluated* by
//! `city::policy` — dependency inversion, same as the ledger seam.
//! The part `crates/kernel/spec/Model.lean` specifies this module.
pub use ;
pub use ;
pub use ;
pub use ;
pub use Window;
pub use ;
use crateAxError;
use crateToolCall;
/// Text arriving from a provider before the call has finished.
///
/// One argument and no return value, because an increment is not a
/// decision: nothing downstream may branch on it, and a sink that could
/// refuse would make a display detail able to fail a call.
///
/// **What arrives here is not history.** The record of what the model
/// said is written once, from [`ModelReturn`], after the call settles.
/// Increments are a thing to look at while waiting, and the two can
/// disagree — a provider may revise, and a cut stream leaves increments
/// behind that no `ModelReturn` ever confirms. Where they disagree the
/// settled text wins, and that rule is held on the far side of the wire
/// by the client.
pub type Increments<'a> = &'a mut dyn FnMut;
/// A tool call handed over the moment its block is complete, before the
/// call it belongs to has settled.
///
/// Separate from [`Increments`] because a caller acts on it: it may start
/// a read-only tool while the model is still generating. **What arrives
/// here is not history either.** The ledger records tool calls from
/// [`ModelReturn`] after the call settles; when the call fails, a caller
/// discards whatever it derived from these. What a caller may start, and
/// in which order it records the results, is fixed by
/// `crates/runtime/spec/Turn/Speculation.lean`.
pub type EarlyCalls<'a> = &'a mut dyn FnMut;
/// The model port. Production adapter: gateway::endpoint;
/// second adapter: citysim scripted model. Implementations never sample
/// clocks or read global state.