@eir-labs/coltrane 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents/bandleader.json +54 -0
- package/agents/bill.json +4 -2
- package/agents/change-verifier.json +2 -1
- package/agents/code-implementer.json +7 -4
- package/agents/john.json +5 -3
- package/agents/lineage-scout-external.json +19 -6
- package/agents/lineage-scribe.json +20 -9
- package/agents/lineage-weaver.json +26 -11
- package/agents/miles.json +2 -1
- package/agents/players/bandleader.md +70 -0
- package/agents/pr-publisher.json +4 -2
- package/agents/red-spec-drafter.json +12 -6
- package/agents/room-prober.json +29 -0
- package/agents/source-walker.json +1 -1
- package/charts/room-probe-chart-v1.json +14 -0
- package/charts/worker-contract-docker-v2.json +135 -0
- package/charts/worker-contract-v3.json +206 -0
- package/dist/src/boundary_check.d.ts +18 -0
- package/dist/src/boundary_check.js +70 -0
- package/dist/src/boundary_check.js.map +1 -0
- package/dist/src/boundary_scan.d.ts +62 -0
- package/dist/src/boundary_scan.js +93 -0
- package/dist/src/boundary_scan.js.map +1 -0
- package/dist/src/chart.js +34 -1
- package/dist/src/chart.js.map +1 -1
- package/dist/src/claude_invoker.d.ts +2 -13
- package/dist/src/claude_invoker.js +242 -18
- package/dist/src/claude_invoker.js.map +1 -1
- package/dist/src/cli.d.ts +1 -1
- package/dist/src/cli.js +115 -27
- package/dist/src/cli.js.map +1 -1
- package/dist/src/drain_preflight.d.ts +33 -0
- package/dist/src/drain_preflight.js +97 -0
- package/dist/src/drain_preflight.js.map +1 -0
- package/dist/src/genome_schema.d.ts +390 -9
- package/dist/src/genome_schema.js +163 -8
- package/dist/src/genome_schema.js.map +1 -1
- package/dist/src/genome_store.js +9 -0
- package/dist/src/genome_store.js.map +1 -1
- package/dist/src/genome_writer.d.ts +1 -1
- package/dist/src/genome_writer.js +10 -2
- package/dist/src/genome_writer.js.map +1 -1
- package/dist/src/gig_conformance.d.ts +66 -0
- package/dist/src/gig_conformance.js +153 -0
- package/dist/src/gig_conformance.js.map +1 -0
- package/dist/src/gig_tracker.js +8 -0
- package/dist/src/gig_tracker.js.map +1 -1
- package/dist/src/grounding.d.ts +44 -0
- package/dist/src/grounding.js +127 -0
- package/dist/src/grounding.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/institution_loader.d.ts +29 -5
- package/dist/src/institution_loader.js +67 -6
- package/dist/src/institution_loader.js.map +1 -1
- package/dist/src/lineage_adoption.d.ts +82 -0
- package/dist/src/lineage_adoption.js +82 -0
- package/dist/src/lineage_adoption.js.map +1 -0
- package/dist/src/lineage_persist.d.ts +34 -0
- package/dist/src/lineage_persist.js +60 -0
- package/dist/src/lineage_persist.js.map +1 -0
- package/dist/src/loader.d.ts +13 -0
- package/dist/src/loader.js +43 -2
- package/dist/src/loader.js.map +1 -1
- package/dist/src/local_queue.d.ts +105 -0
- package/dist/src/local_queue.js +380 -0
- package/dist/src/local_queue.js.map +1 -0
- package/dist/src/mcp.js +37 -4
- package/dist/src/mcp.js.map +1 -1
- package/dist/src/org_hire.d.ts +23 -0
- package/dist/src/org_hire.js +42 -0
- package/dist/src/org_hire.js.map +1 -0
- package/dist/src/outputs.d.ts +17 -0
- package/dist/src/outputs.js +86 -1
- package/dist/src/outputs.js.map +1 -1
- package/dist/src/player_to_claude_code.js +26 -2
- package/dist/src/player_to_claude_code.js.map +1 -1
- package/dist/src/registry.d.ts +3 -1
- package/dist/src/registry.js +43 -3
- package/dist/src/registry.js.map +1 -1
- package/dist/src/repo_index.d.ts +58 -0
- package/dist/src/repo_index.js +232 -0
- package/dist/src/repo_index.js.map +1 -0
- package/dist/src/residency.d.ts +149 -0
- package/dist/src/residency.js +283 -0
- package/dist/src/residency.js.map +1 -0
- package/dist/src/reuse.d.ts +44 -4
- package/dist/src/reuse.js +0 -0
- package/dist/src/reuse.js.map +1 -1
- package/dist/src/runtime.d.ts +82 -0
- package/dist/src/runtime.js +254 -25
- package/dist/src/runtime.js.map +1 -1
- package/dist/src/server.d.ts +37 -0
- package/dist/src/server.js +422 -11
- package/dist/src/server.js.map +1 -1
- package/dist/src/server_relay.d.ts +40 -2
- package/dist/src/server_relay.js +186 -19
- package/dist/src/server_relay.js.map +1 -1
- package/dist/src/tool_providers.d.ts +27 -0
- package/dist/src/tool_providers.js +48 -0
- package/dist/src/tool_providers.js.map +1 -1
- package/dist/src/venue_credential.d.ts +41 -0
- package/dist/src/venue_credential.js +57 -0
- package/dist/src/venue_credential.js.map +1 -0
- package/dist/src/venue_realize.d.ts +23 -0
- package/dist/src/venue_realize.js +43 -3
- package/dist/src/venue_realize.js.map +1 -1
- package/dist/src/venue_realizer.d.ts +224 -0
- package/dist/src/venue_realizer.js +889 -0
- package/dist/src/venue_realizer.js.map +1 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/worker.d.ts +57 -0
- package/dist/src/worker.js +155 -24
- package/dist/src/worker.js.map +1 -1
- package/dist/src/worker_env.d.ts +79 -0
- package/dist/src/worker_env.js +322 -0
- package/dist/src/worker_env.js.map +1 -0
- package/dist/src/workspace.d.ts +12 -1
- package/dist/src/workspace.js +10 -3
- package/dist/src/workspace.js.map +1 -1
- package/domain_types/change-context.json +59 -13
- package/domain_types/lineage-adoption-target.json +22 -0
- package/domain_types/lineage-map.json +7 -2
- package/domain_types/lineage-record.json +55 -5
- package/domain_types/prior-art-hit.json +16 -1
- package/domain_types/red-spec.json +5 -3
- package/domain_types/woodshed-record.json +149 -0
- package/evals/gist-present.json +7 -0
- package/institutions/coltrane.json +178 -6
- package/package.json +6 -3
- package/skills/non-vacuity-probe/fixtures/fixture-001.json +17 -0
- package/skills/non-vacuity-probe/meta.json +12 -0
- package/skills/non-vacuity-probe/skill.md +27 -0
- package/skills/non-vacuity-probe/skill.mjs +81 -0
- package/standards/lineage-adopt-v0.json +37 -0
- package/standards/room-probe-v1.json +28 -0
- package/standards/software-change-pr-v1.json +15 -15
- package/standards/software-change-red-first-v0.json +183 -0
- package/standards/spec-review-and-sequence-v0.json +112 -0
- package/standards/studio-session-v0.json +101 -0
- package/tours/coltrane.json +72 -0
- package/venues/engine-room-v1.json +32 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
// Residency enforcement — a genome agent LIVING in a room, not a gig that runs and ends. `coltrane
|
|
2
|
+
// work` is the floor (workOnce); what `reside` adds is what separates doing a unit of work from
|
|
3
|
+
// being someone who lives here: a party-constrained status, a cursor that moves only on a seal, a
|
|
4
|
+
// reflex that touches no model, a lease + fence that hold the seat singly, and a reaper that reads
|
|
5
|
+
// the one death hibernation cannot hide.
|
|
6
|
+
//
|
|
7
|
+
// This module is authored to the surface declared in tests/spec_reside_fixtures.ts and is loaded by
|
|
8
|
+
// that fixture at RUNTIME (new URL("../src/residency.js", …)) so the shared build survives its
|
|
9
|
+
// absence. The 40 laws in tests/spec_reside_*.test.ts are the specification.
|
|
10
|
+
//
|
|
11
|
+
// applyResidencyOp follows the applyCommitmentOp shape (src/committed_work.ts:214, Singh, Chopra &
|
|
12
|
+
// Desai 2009, doi:10.1109/MC.2009.347): a TOTAL (rec, op) -> {ok:true,next} | {ok:false,reason}
|
|
13
|
+
// that never throws once the record is built, with who-may-act as a constitutive gate.
|
|
14
|
+
// reside and work agree on what a gig means because there is only ONE function behind both fronts.
|
|
15
|
+
// This is the SAME symbol as workOnce — a re-export, never a wrapper or a copy — so the surface law
|
|
16
|
+
// (I12) that compares residencyGigPath to workOnce by referential identity (===) holds, and a second
|
|
17
|
+
// gig implementation fails BY EXISTING.
|
|
18
|
+
export { workOnce as residencyGigPath } from "./worker.js";
|
|
19
|
+
export const RESIDENCY_STATES = [
|
|
20
|
+
"seated",
|
|
21
|
+
"listening",
|
|
22
|
+
"playing",
|
|
23
|
+
"hibernated",
|
|
24
|
+
"drained",
|
|
25
|
+
"unseated",
|
|
26
|
+
];
|
|
27
|
+
// Live = non-terminal. drained and unseated are the two terminal states.
|
|
28
|
+
export const LIVE_STATES = new Set([
|
|
29
|
+
"seated",
|
|
30
|
+
"listening",
|
|
31
|
+
"playing",
|
|
32
|
+
"hibernated",
|
|
33
|
+
]);
|
|
34
|
+
export const RESIDENCY_OPS = [
|
|
35
|
+
"claim",
|
|
36
|
+
"listen",
|
|
37
|
+
"play",
|
|
38
|
+
"wake_seal",
|
|
39
|
+
"ack",
|
|
40
|
+
"heartbeat",
|
|
41
|
+
"hibernate",
|
|
42
|
+
"thaw",
|
|
43
|
+
"drain",
|
|
44
|
+
"unseat",
|
|
45
|
+
"reap",
|
|
46
|
+
];
|
|
47
|
+
// The party-constrained legal-transition table — the contract's law, as data. Order MATCHES the
|
|
48
|
+
// fixture verbatim: the surface law asserts R.LEGAL_TRANSITIONS.toEqual(LEGAL_TRANSITIONS), a deep,
|
|
49
|
+
// order-sensitive equality.
|
|
50
|
+
export const LEGAL_TRANSITIONS = [
|
|
51
|
+
{ from: "unseated", op: "claim", to: "seated" },
|
|
52
|
+
{ from: "seated", op: "listen", to: "listening" },
|
|
53
|
+
{ from: "playing", op: "listen", to: "listening" },
|
|
54
|
+
{ from: "seated", op: "play", to: "playing" },
|
|
55
|
+
{ from: "listening", op: "play", to: "playing" },
|
|
56
|
+
{ from: "listening", op: "wake_seal", to: "listening" },
|
|
57
|
+
{ from: "playing", op: "wake_seal", to: "listening" },
|
|
58
|
+
{ from: "seated", op: "ack", to: "seated" },
|
|
59
|
+
{ from: "listening", op: "ack", to: "listening" },
|
|
60
|
+
{ from: "playing", op: "ack", to: "playing" },
|
|
61
|
+
{ from: "hibernated", op: "ack", to: "hibernated" },
|
|
62
|
+
{ from: "seated", op: "heartbeat", to: "seated" },
|
|
63
|
+
{ from: "listening", op: "heartbeat", to: "listening" },
|
|
64
|
+
{ from: "playing", op: "heartbeat", to: "playing" },
|
|
65
|
+
{ from: "hibernated", op: "heartbeat", to: "hibernated" },
|
|
66
|
+
{ from: "seated", op: "hibernate", to: "hibernated" },
|
|
67
|
+
{ from: "listening", op: "hibernate", to: "hibernated" },
|
|
68
|
+
{ from: "playing", op: "hibernate", to: "hibernated" },
|
|
69
|
+
{ from: "hibernated", op: "thaw", to: "listening" },
|
|
70
|
+
{ from: "seated", op: "drain", to: "drained" },
|
|
71
|
+
{ from: "listening", op: "drain", to: "drained" },
|
|
72
|
+
{ from: "playing", op: "drain", to: "drained" },
|
|
73
|
+
{ from: "hibernated", op: "drain", to: "drained" },
|
|
74
|
+
{ from: "seated", op: "unseat", to: "unseated" },
|
|
75
|
+
{ from: "listening", op: "unseat", to: "unseated" },
|
|
76
|
+
{ from: "playing", op: "unseat", to: "unseated" },
|
|
77
|
+
{ from: "hibernated", op: "unseat", to: "unseated" },
|
|
78
|
+
{ from: "hibernated", op: "reap", to: "unseated" },
|
|
79
|
+
];
|
|
80
|
+
// The residency row shape, as data. The venue is the SOLE hands surface: the row carries venue_slug
|
|
81
|
+
// and channel_id (a distinct voice axis) and NO second hands/tools list.
|
|
82
|
+
export const RESIDENCY_ROW_FIELDS = [
|
|
83
|
+
"agent_slug",
|
|
84
|
+
"org",
|
|
85
|
+
"venue_slug",
|
|
86
|
+
"channel_id",
|
|
87
|
+
"soul_output_id",
|
|
88
|
+
"status",
|
|
89
|
+
"session_id",
|
|
90
|
+
"cursor",
|
|
91
|
+
"host",
|
|
92
|
+
"lease_until",
|
|
93
|
+
"heartbeat_at",
|
|
94
|
+
"fence",
|
|
95
|
+
];
|
|
96
|
+
// The reflex budget is a STATED finite number of SIMULATED ticks, not an unmeasured wall-clock 250ms
|
|
97
|
+
// — a latency law without measurement conditions passes on a laptop and fails on a loaded box.
|
|
98
|
+
export const REFLEX_BUDGET_TICKS = 8;
|
|
99
|
+
// ── The transition function — total, party-constrained (I4, I5, I6, I7, I8, I9, I13, I1, I3) ──────
|
|
100
|
+
// Ops reserved to a single party. hibernate/thaw/unseat are the holder's graceful acts; reap is the
|
|
101
|
+
// reaper's alone. The constraint is a GATE, not a lock: the reserved actor IS accepted.
|
|
102
|
+
const RESERVED_PARTY = {
|
|
103
|
+
hibernate: "holder",
|
|
104
|
+
thaw: "holder",
|
|
105
|
+
unseat: "holder",
|
|
106
|
+
reap: "reaper",
|
|
107
|
+
};
|
|
108
|
+
function legalTarget(from, op) {
|
|
109
|
+
return LEGAL_TRANSITIONS.find((t) => t.from === from && t.op === op)?.to;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Apply one residency op under its party constraint. TOTAL: for any (state, op) pair in the closed
|
|
113
|
+
* domain it never throws — a refusal is a decision, always a discriminated {ok:false,reason}. Every
|
|
114
|
+
* pair outside LEGAL_TRANSITIONS is refused AND leaves state unchanged (the caller keeps `rec`).
|
|
115
|
+
*/
|
|
116
|
+
export function applyResidencyOp(rec, op) {
|
|
117
|
+
const refuse = (reason) => ({ ok: false, reason });
|
|
118
|
+
const withPatch = (patch) => ({
|
|
119
|
+
ok: true,
|
|
120
|
+
next: { ...rec, ...patch },
|
|
121
|
+
});
|
|
122
|
+
// Single activation (I8): a claim on a residency ALREADY held live is a compare-and-set failure,
|
|
123
|
+
// checked before legality so the refusal names the real fault (double_activation, not the generic
|
|
124
|
+
// illegal_transition claim-from-a-live-state would otherwise yield).
|
|
125
|
+
if (op.kind === "claim" && LIVE_STATES.has(rec.status))
|
|
126
|
+
return refuse("double_activation");
|
|
127
|
+
// Legality (I5): only declared transitions are reachable; every other pair is refused unchanged.
|
|
128
|
+
const target = legalTarget(rec.status, op.kind);
|
|
129
|
+
if (target === undefined)
|
|
130
|
+
return refuse("illegal_transition");
|
|
131
|
+
// Party (I6): who-may-act is constitutive. The wrong actor on a reserved op is refused; the
|
|
132
|
+
// reserved actor passes through.
|
|
133
|
+
const reserved = RESERVED_PARTY[op.kind];
|
|
134
|
+
if (reserved !== undefined && op.by !== reserved)
|
|
135
|
+
return refuse("wrong_party");
|
|
136
|
+
// Fencing (I9): a write below the highest-seen token is a resurrected host — rejected. The token
|
|
137
|
+
// gates, it does not freeze: current-or-higher is admitted.
|
|
138
|
+
if (op.fence !== undefined && op.fence < rec.fence)
|
|
139
|
+
return refuse("stale_fence");
|
|
140
|
+
// Immutable identity (I7): once seated, the identity columns cannot be re-pointed. An op that
|
|
141
|
+
// CARRIES a differing agent_slug / org / channel_id is refused.
|
|
142
|
+
if (op.agent_slug !== undefined && op.agent_slug !== rec.agent_slug)
|
|
143
|
+
return refuse("immutable_identity");
|
|
144
|
+
if (op.org !== undefined && op.org !== rec.org)
|
|
145
|
+
return refuse("immutable_identity");
|
|
146
|
+
if (op.channel_id !== undefined && op.channel_id !== rec.channel_id)
|
|
147
|
+
return refuse("immutable_identity");
|
|
148
|
+
// Cortex liveness (I13): every heartbeat carries a cortex-alive proof; a false proof fails visibly
|
|
149
|
+
// (dead_cortex) rather than leaving a presence that looks healthy while it cannot answer. An
|
|
150
|
+
// hour-six death surfaces on the next heartbeat exactly as an hour-zero one would.
|
|
151
|
+
if (op.kind === "heartbeat" && op.cortex_alive === false)
|
|
152
|
+
return refuse("dead_cortex");
|
|
153
|
+
// The monotone fence carried forward on any successful write.
|
|
154
|
+
const nextFence = op.fence !== undefined ? Math.max(rec.fence, op.fence) : rec.fence;
|
|
155
|
+
// The seal (I1, I3): the cursor advances ONLY as a consequence of a sealed utterance, in the SAME
|
|
156
|
+
// write. A consumed-but-unanswered message is unrepresentable.
|
|
157
|
+
if (op.kind === "wake_seal") {
|
|
158
|
+
// Re-host replay (I3): a wake whose message_index is below the cursor was already consumed. Even
|
|
159
|
+
// a resurrected/re-hosted box cannot re-answer it — the cursor stays monotonic.
|
|
160
|
+
if (op.message_index !== undefined && op.message_index < rec.cursor)
|
|
161
|
+
return refuse("illegal_transition");
|
|
162
|
+
const sha = op.sealed_output_sha;
|
|
163
|
+
// A wake with no utterance NEVER advances the cursor: refuse so the consumed-but-unanswered
|
|
164
|
+
// state cannot be represented at all.
|
|
165
|
+
if (sha === null || sha === undefined || sha === "")
|
|
166
|
+
return refuse("cursor_without_seal");
|
|
167
|
+
// Bundled, one atomic fact: cursor +1 AND the sha that moved it, recorded together.
|
|
168
|
+
return withPatch({
|
|
169
|
+
status: target,
|
|
170
|
+
cursor: rec.cursor + 1,
|
|
171
|
+
last_sealed_sha: sha,
|
|
172
|
+
fence: nextFence,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
// claim seats a live residency onto the claiming host; thaw resumes the same life on its host.
|
|
176
|
+
const patch = { status: target, fence: nextFence };
|
|
177
|
+
if (op.kind === "claim" || op.kind === "thaw") {
|
|
178
|
+
if (op.host !== undefined)
|
|
179
|
+
patch.host = op.host;
|
|
180
|
+
}
|
|
181
|
+
// ONLY claim may set the session. A thaw RESUMES the stored one — that is what "the same life"
|
|
182
|
+
// means, and it is the whole difference between hibernation and a slower death (I15). A thaw op
|
|
183
|
+
// may well carry a session_id (the canonical op does), but it is not authoritative: the durable
|
|
184
|
+
// heap outlives the discarded cortex, and relighting reads session_id off the ROW. Applying the
|
|
185
|
+
// op's value here silently started a fresh life on every thaw while every other field survived,
|
|
186
|
+
// which reads as a working hibernate right up until someone checks continuity.
|
|
187
|
+
if (op.kind === "claim" && op.session_id !== undefined)
|
|
188
|
+
patch.session_id = op.session_id;
|
|
189
|
+
if (op.kind === "heartbeat" && op.now !== undefined)
|
|
190
|
+
patch.heartbeat_at = op.now;
|
|
191
|
+
return withPatch(patch);
|
|
192
|
+
}
|
|
193
|
+
// ── The reflex ack — touches NO model, bounded by a deterministic budget (I10, I11) ───────────────
|
|
194
|
+
/**
|
|
195
|
+
* Ack an inbound message in reflex: dumb by design. Invokes the model-invoker EXACTLY zero times
|
|
196
|
+
* (even when one is present) and completes within REFLEX_BUDGET_TICKS SIMULATED ticks on the
|
|
197
|
+
* injected clock — never a wall-clock read, so the budget holds identically on any machine.
|
|
198
|
+
*/
|
|
199
|
+
export function reflexAck(_msg, deps) {
|
|
200
|
+
const start = deps.clock.now();
|
|
201
|
+
// One simulated tick to register the ack; the model is never on this path.
|
|
202
|
+
deps.clock.tick(1);
|
|
203
|
+
const elapsed = deps.clock.now() - start;
|
|
204
|
+
return { acked: true, elapsed_ticks: elapsed };
|
|
205
|
+
}
|
|
206
|
+
// ── The reaper — reads the one death hibernation cannot hide (I14) ─────────────────────────────────
|
|
207
|
+
/**
|
|
208
|
+
* The named reader for a dead-hibernated residency: a hibernated seat whose lease has lapsed is
|
|
209
|
+
* forced to `unseated`. It reaps the DEAD and not the living — a hibernated seat still inside its
|
|
210
|
+
* lease, or any non-hibernated record, is left untouched (a refusal, so "nothing reaped" is
|
|
211
|
+
* unambiguous). `hibernated` is a valid state, so without this reader a dead hibernated residency
|
|
212
|
+
* would read as healthy because nothing queries it.
|
|
213
|
+
*/
|
|
214
|
+
export function reapResidency(rec, now) {
|
|
215
|
+
if (rec.status === "hibernated" && now > rec.lease_until) {
|
|
216
|
+
return { ok: true, next: { ...rec, status: "unseated", host: null, session_id: null } };
|
|
217
|
+
}
|
|
218
|
+
return { ok: false, reason: "illegal_transition" };
|
|
219
|
+
}
|
|
220
|
+
// ── The rolodex split — a presence cannot witness itself (I16) ─────────────────────────────────────
|
|
221
|
+
/**
|
|
222
|
+
* A presence cannot read its OWN impressions as content: sealing an impression as evidence would let
|
|
223
|
+
* it witness itself. The self-read is scoped out — no impression content is ever returned.
|
|
224
|
+
*/
|
|
225
|
+
export function readOwnImpressions(_rec) {
|
|
226
|
+
return { content: null, scoped_out: true };
|
|
227
|
+
}
|
|
228
|
+
// ── The venue is the sole hands surface (I17, I18) ─────────────────────────────────────────────────
|
|
229
|
+
/**
|
|
230
|
+
* Admit a credential class only if the venue explicitly declares it in its credential_surface. The
|
|
231
|
+
* venue is the SOLE hands contract; a class it does not declare — including a channel token, which
|
|
232
|
+
* belongs to the distinct voice axis — is a breach.
|
|
233
|
+
*/
|
|
234
|
+
export function admitVenueCredential(venue, credentialClass) {
|
|
235
|
+
if (venue.credential_surface.includes(credentialClass))
|
|
236
|
+
return { ok: true };
|
|
237
|
+
return { ok: false, reason: "credential_breach" };
|
|
238
|
+
}
|
|
239
|
+
// ── Boot — fail closed with typed refusals BEFORE any side effect (I19) ────────────────────────────
|
|
240
|
+
/**
|
|
241
|
+
* Seat a residency, fail-closed. Three preflight checks run IN ORDER before seatRow ever runs, so a
|
|
242
|
+
* refused boot writes no row: an unresolvable agent → no_such_agent, an unresolvable venue →
|
|
243
|
+
* no_such_venue, an absent cortex → no_cortex. Cortex liveness is not a one-shot boot assertion — it
|
|
244
|
+
* also surfaces on every subsequent heartbeat (applyResidencyOp's dead_cortex path).
|
|
245
|
+
*/
|
|
246
|
+
export function bootResidency(spec, deps) {
|
|
247
|
+
if (deps.resolveAgent(spec.agent_slug) == null)
|
|
248
|
+
return { ok: false, refusal: "no_such_agent" };
|
|
249
|
+
if (deps.resolveVenue(spec.venue_slug) == null)
|
|
250
|
+
return { ok: false, refusal: "no_such_venue" };
|
|
251
|
+
if (!deps.cortexPresent())
|
|
252
|
+
return { ok: false, refusal: "no_cortex" };
|
|
253
|
+
const rec = {
|
|
254
|
+
agent_slug: spec.agent_slug,
|
|
255
|
+
org: spec.org,
|
|
256
|
+
venue_slug: spec.venue_slug,
|
|
257
|
+
channel_id: spec.channel_id,
|
|
258
|
+
soul_output_id: null,
|
|
259
|
+
status: "seated",
|
|
260
|
+
session_id: null,
|
|
261
|
+
cursor: 0,
|
|
262
|
+
host: null,
|
|
263
|
+
lease_until: 0,
|
|
264
|
+
heartbeat_at: 0,
|
|
265
|
+
fence: 0,
|
|
266
|
+
last_sealed_sha: null,
|
|
267
|
+
};
|
|
268
|
+
deps.seatRow(rec);
|
|
269
|
+
return { ok: true, rec };
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* The `reside` verb REUSES work's gig path — it does not fork the drain's five-variable env contract.
|
|
273
|
+
* Missing COLTRANE_STORE_URL / COLTRANE_STORE_ANON is a usage refusal (exit 2), the same door work
|
|
274
|
+
* uses (src/cli.ts:241-248). The gig itself is workOnce, re-exported above as residencyGigPath; the
|
|
275
|
+
* store/channel wiring is a deployment seam the laws inject rather than assert here.
|
|
276
|
+
*/
|
|
277
|
+
export async function runReside(_argv, io) {
|
|
278
|
+
const env = io?.env ?? {};
|
|
279
|
+
if (!env["COLTRANE_STORE_URL"] || !env["COLTRANE_STORE_ANON"])
|
|
280
|
+
return 2;
|
|
281
|
+
return 0;
|
|
282
|
+
}
|
|
283
|
+
//# sourceMappingURL=residency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"residency.js","sourceRoot":"","sources":["../../src/residency.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,gGAAgG;AAChG,kGAAkG;AAClG,mGAAmG;AACnG,yCAAyC;AACzC,EAAE;AACF,oGAAoG;AACpG,+FAA+F;AAC/F,6EAA6E;AAC7E,EAAE;AACF,mGAAmG;AACnG,gGAAgG;AAChG,uFAAuF;AAEvF,mGAAmG;AACnG,oGAAoG;AACpG,qGAAqG;AACrG,wCAAwC;AACxC,OAAO,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAY3D,MAAM,CAAC,MAAM,gBAAgB,GAA8B;IACzD,QAAQ;IACR,WAAW;IACX,SAAS;IACT,YAAY;IACZ,SAAS;IACT,UAAU;CACX,CAAC;AAEF,yEAAyE;AACzE,MAAM,CAAC,MAAM,WAAW,GAAgC,IAAI,GAAG,CAAiB;IAC9E,QAAQ;IACR,WAAW;IACX,SAAS;IACT,YAAY;CACb,CAAC,CAAC;AAeH,MAAM,CAAC,MAAM,aAAa,GAA+B;IACvD,OAAO;IACP,QAAQ;IACR,MAAM;IACN,WAAW;IACX,KAAK;IACL,WAAW;IACX,WAAW;IACX,MAAM;IACN,OAAO;IACP,QAAQ;IACR,MAAM;CACP,CAAC;AAUF,gGAAgG;AAChG,oGAAoG;AACpG,4BAA4B;AAC5B,MAAM,CAAC,MAAM,iBAAiB,GAA+B;IAC3D,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE;IAC/C,EAA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,EAAE,CAAC;IACxC,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,qBAAqB,CAAC;QAAE,OAAO,CAAC,CAAC;IACxE,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/dist/src/reuse.d.ts
CHANGED
|
@@ -37,8 +37,14 @@ export declare function typeShapeFingerprint(def: {
|
|
|
37
37
|
* agent's type surface, so a resume across an edited pipeline cannot happen. The rest close
|
|
38
38
|
* the holes genome_hash does not cover:
|
|
39
39
|
*
|
|
40
|
-
* - `gig_input_sha` — the
|
|
41
|
-
*
|
|
40
|
+
* - `gig_input_sha` — the sha256 of the CANONICAL dispatch payload, and ONLY that hash: the
|
|
41
|
+
* payload itself is NEVER stored in a checkpoint (nor in the ledger). A later reader must not
|
|
42
|
+
* try to "recover the input from the checkpoint" — there is nothing to recover; the hash is a
|
|
43
|
+
* fingerprint, not a copy. Phases 1..4 derived from payload A followed by phase 5 consuming
|
|
44
|
+
* payload B is the same splice as a genome change, one layer down. (#20: because the payload is
|
|
45
|
+
* absent, a resume that OMITS --input cannot re-derive it; when every remaining chair is human
|
|
46
|
+
* the resume gate INHERITS this recorded hash instead — see the runtime resume gate and the
|
|
47
|
+
* inheritance-vs-waiver note on `runIdentityMismatch` below.)
|
|
42
48
|
* - `model_version` — a run whose first half was produced by one model and second half by
|
|
43
49
|
* another gets ONE `run_fingerprint`, carrying only the final model. That fingerprint then
|
|
44
50
|
* misdescribes the outputs it covers. Cheap to check; usually "unknown" on both sides, so
|
|
@@ -91,7 +97,32 @@ export declare function producersSha(input: {
|
|
|
91
97
|
code_hash: string;
|
|
92
98
|
}>;
|
|
93
99
|
}): string;
|
|
94
|
-
|
|
100
|
+
/**
|
|
101
|
+
* `waiveProducers` skips ONLY the `producers_sha` comparison; every other field still compares
|
|
102
|
+
* and still enters the returned set. It defaults OFF, so an unadorned call is byte-for-byte the
|
|
103
|
+
* old behaviour. The one caller that sets it (the resume gate) has first proven that every chair
|
|
104
|
+
* left to run is human — and a producing agent's definition cannot change what a person is being
|
|
105
|
+
* asked to decide about work that is already sealed and hashed. That is the sole justification;
|
|
106
|
+
* genome_hash, gig_input_sha, model_version, depth and canonical_form_version are NEVER waived,
|
|
107
|
+
* because they can still describe something the remaining human chair is being asked to approve.
|
|
108
|
+
*
|
|
109
|
+
* That NEVER-WAIVED rule is about a STATED mismatch, and neither #19 nor #20 touches it. Waiving
|
|
110
|
+
* skips a comparison that WOULD have failed; INHERITING substitutes the checkpoint's own recorded
|
|
111
|
+
* value for a field the operator left unstated, so the comparison a resume runs is between the
|
|
112
|
+
* checkpoint and a value it does not contradict. Two fields inherit, at the runtime resume-gate
|
|
113
|
+
* call site, never here:
|
|
114
|
+
* - depth (#19): a resume that omits --depth compares against the depth the CHECKPOINT recorded.
|
|
115
|
+
* - gig_input_sha (#20): a resume whose every remaining chair is human and that omits --input
|
|
116
|
+
* compares against the gig_input_sha the CHECKPOINT recorded — because the payload is never
|
|
117
|
+
* stored (see RunIdentity.gig_input_sha) and the remaining human chairs consume no payload.
|
|
118
|
+
* Both stay never-waived: an EXPLICIT --depth or --input that disagrees still drives a refusal, and
|
|
119
|
+
* gig_input_sha keeps gating in full the moment any remaining chair is a model chair. Inheriting a
|
|
120
|
+
* value nobody contradicted is a different act from skipping a comparison that would have failed,
|
|
121
|
+
* so reading #19 or #20 as a hole in this rule is a mistake.
|
|
122
|
+
*/
|
|
123
|
+
export declare function runIdentityMismatch(a: RunIdentity, b: RunIdentity, opts?: {
|
|
124
|
+
waiveProducers?: boolean;
|
|
125
|
+
}): string[];
|
|
95
126
|
/**
|
|
96
127
|
* The composite identity of one checkpointed seat: `(chart_slug, movement_id, role)`.
|
|
97
128
|
*
|
|
@@ -142,6 +173,13 @@ export interface CheckpointRole {
|
|
|
142
173
|
export interface GigCheckpoint {
|
|
143
174
|
schema_version: number;
|
|
144
175
|
gig_id: string;
|
|
176
|
+
/**
|
|
177
|
+
* The run identity a resume must match. NOTE what this does NOT contain: the dispatch payload.
|
|
178
|
+
* `identity.gig_input_sha` is a sha256 of the canonical payload and nothing else — the checkpoint
|
|
179
|
+
* stores the HASH, never the bytes. A later reader must not attempt to "recover the input from
|
|
180
|
+
* the checkpoint"; that recovery is structurally impossible. On a human-only resume that omits
|
|
181
|
+
* --input, the gate inherits this hash rather than reconstructing a payload it never kept (#20).
|
|
182
|
+
*/
|
|
145
183
|
identity: RunIdentity;
|
|
146
184
|
/**
|
|
147
185
|
* The engine build (COLTRANE_VERSION) that WROTE this checkpoint.
|
|
@@ -151,7 +189,9 @@ export interface GigCheckpoint {
|
|
|
151
189
|
* producers_sha) legitimately drifts between two builds that both write `schema_version` 1.
|
|
152
190
|
* When a resume then refuses on that drift, the raw before/after hashes alone do not tell an
|
|
153
191
|
* operator WHICH build would have matched — they have to guess the producing version. Recording
|
|
154
|
-
* it here
|
|
192
|
+
* it here lets the refusal, when the versions genuinely DIFFER, turn "these two 64-hex strings
|
|
193
|
+
* disagree" into "resume from a <version> build". When this version equals the current one the
|
|
194
|
+
* refusal names the drifted fields instead, since the version is not what moved.
|
|
155
195
|
*
|
|
156
196
|
* Optional for BACK-COMPAT: a checkpoint written before this field existed has none, and a
|
|
157
197
|
* resume of it refuses/succeeds exactly as before, naming "(engine version unrecorded)" in
|
package/dist/src/reuse.js
CHANGED
|
Binary file
|
package/dist/src/reuse.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reuse.js","sourceRoot":"","sources":["../../src/reuse.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,0FAA0F;AAC1F,6FAA6F;AAC7F,wFAAwF;AACxF,2FAA2F;AAC3F,yFAAyF;AACzF,4FAA4F;AAC5F,gCAAgC;AAChC,EAAE;AACF,6FAA6F;AAC7F,2FAA2F;AAC3F,wFAAwF;AACxF,6FAA6F;AAC7F,2FAA2F;AAC3F,0FAA0F;AAC1F,6DAA6D;AAC7D,EAAE;AACF,oFAAoF;AACpF,2FAA2F;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C,MAAM,CAAC,GAAG,IAAI,GAAG,EAAkB,CAAC;IACpC,OAAO;QACL,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE;YACT,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACrB,OAAO,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAgB,CAAC;QACzE,CAAC;QACD,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KACvD,CAAC;AACJ,CAAC"}
|
package/dist/src/runtime.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { Standard, Agent, Chair } from "./composition.js";
|
|
2
2
|
import { type ToolProviderRegistry } from "./tool_providers.js";
|
|
3
3
|
import { type Realization } from "./venue_realize.js";
|
|
4
|
+
import type { VenueRealizer, CredentialResolver } from "./venue_realizer.js";
|
|
4
5
|
import type { Venue } from "./chart.js";
|
|
5
6
|
export declare const CORE_TO_PRIMITIVE: Record<string, Agent["primitives"][number]>;
|
|
6
7
|
import { type CheckpointStore, type ReuseStore, type PriorBudgetState } from "./reuse.js";
|
|
7
8
|
import type { OutputStore, OutputRecord } from "./outputs.js";
|
|
9
|
+
import { type GigConformanceResult } from "./gig_conformance.js";
|
|
8
10
|
import { type Ledger, type GigUsage } from "./ledger.js";
|
|
9
11
|
import type { Depth } from "./pricing.js";
|
|
10
12
|
import type { SkillRecord, EvalRecord } from "./loader.js";
|
|
@@ -22,6 +24,11 @@ export interface AgentInvocationContext {
|
|
|
22
24
|
depth?: Depth | undefined;
|
|
23
25
|
realization?: Realization | undefined;
|
|
24
26
|
venue?: Venue | undefined;
|
|
27
|
+
substrateMcpConfigs?: Readonly<Record<string, unknown>> | undefined;
|
|
28
|
+
seatExec?: {
|
|
29
|
+
container: string;
|
|
30
|
+
workspace: string;
|
|
31
|
+
} | undefined;
|
|
25
32
|
turn_budget?: number | undefined;
|
|
26
33
|
turn_reserve?: number | undefined;
|
|
27
34
|
}
|
|
@@ -67,6 +74,19 @@ export type GigProgressEvent = {
|
|
|
67
74
|
role: string;
|
|
68
75
|
agent: string;
|
|
69
76
|
missing: string[];
|
|
77
|
+
} | {
|
|
78
|
+
type: "lineage_adoption";
|
|
79
|
+
phase: string;
|
|
80
|
+
role: string;
|
|
81
|
+
/** true only when the verdict passed, was signed, and named a record. */
|
|
82
|
+
adopt: boolean;
|
|
83
|
+
/** content_sha of the lineage-record the institution would be grounded in. */
|
|
84
|
+
record_ref?: string;
|
|
85
|
+
/** WHICH institution it grounds. Absent on a refusal. */
|
|
86
|
+
institution_slug?: string;
|
|
87
|
+
approved_by?: string;
|
|
88
|
+
/** every applicable refusal, not just the first — see lineageAdoption. */
|
|
89
|
+
refusals?: string[];
|
|
70
90
|
} | {
|
|
71
91
|
type: "agent_event";
|
|
72
92
|
phase: string;
|
|
@@ -230,6 +250,19 @@ export interface RunDeps {
|
|
|
230
250
|
* away; noticing a silent $6 is not.
|
|
231
251
|
*/
|
|
232
252
|
resume_from?: string | undefined;
|
|
253
|
+
/**
|
|
254
|
+
* #20 — the caller supplied NO --input on this (resume) dispatch. Default-false semantics:
|
|
255
|
+
* absent or false means "a value WAS supplied" (even an explicit `{}`); true means "the caller
|
|
256
|
+
* stated no payload at all". It exists for the same reason `depth?: Depth | undefined` does —
|
|
257
|
+
* an omitted value must be distinguishable from a stated one. The dispatch payload is never
|
|
258
|
+
* carried in a checkpoint (only its hash is; see src/reuse.ts RunIdentity.gig_input_sha), so an
|
|
259
|
+
* omitted --input cannot be reconstructed. Instead, on a resume whose every remaining chair is
|
|
260
|
+
* human, the gate INHERITS the checkpoint's recorded gig_input_sha rather than refusing on the
|
|
261
|
+
* drift to sha256('{}'). A SUPPLIED value is never inherited, so a disagreeing --input still
|
|
262
|
+
* gates; and while any remaining chair is a MODEL chair the gate is unchanged. worker.ts passes
|
|
263
|
+
* the real claim input and never sets this, so the gate stays fully active for worker runs.
|
|
264
|
+
*/
|
|
265
|
+
gig_input_omitted?: boolean | undefined;
|
|
233
266
|
/**
|
|
234
267
|
* The chair-level reuse cache. Presence IS the opt-in — the runtime never constructs one —
|
|
235
268
|
* and it enables BOTH reads and writes.
|
|
@@ -277,6 +310,44 @@ export interface RunDeps {
|
|
|
277
310
|
* any class present but NOT declared by the venue's `credential_surface` is a breach that fails
|
|
278
311
|
* the gig closed. Absent = none present (deny-by-default: an empty surface admits nothing). */
|
|
279
312
|
credentialsPresent?: string[] | undefined;
|
|
313
|
+
/**
|
|
314
|
+
* The SUBSTRATE seam (substrate → dispatch wiring). When supplied AND the resolved venue declares
|
|
315
|
+
* `mcp_servers`, runGig realizes the substrate (a real room) alongside the policy `realization`:
|
|
316
|
+
* it calls `venueRealizer.realize(venue, credentialResolver, { gigId })`, threads the returned
|
|
317
|
+
* handle's `mcpServerConfigs` onto every chair's `AgentInvocationContext.substrateMcpConfigs` so
|
|
318
|
+
* the spawn reaches the servers running inside the room, and tears the handle down in the same
|
|
319
|
+
* finally block that tears down the policy realization.
|
|
320
|
+
*
|
|
321
|
+
* ABSENT = the substrate is skipped entirely: a venue-named gig still runs the policy gauntlet and
|
|
322
|
+
* confines its chairs by construction, exactly as before this wire existed — the room is opt-in on
|
|
323
|
+
* the deployment supplying an implementation, never mandatory. The engine ships the interface
|
|
324
|
+
* (src/venue_realizer.ts); the deployment supplies `dockerComposeRealizer()`/`localProcessRealizer()`
|
|
325
|
+
* and tests supply the daemon-free substitute (a realizer with an injected `run` seam).
|
|
326
|
+
*/
|
|
327
|
+
venueRealizer?: VenueRealizer | undefined;
|
|
328
|
+
/**
|
|
329
|
+
* How the substrate realizer binds credentials into the room. Passed as the required positional
|
|
330
|
+
* `credentialResolver` argument to `venueRealizer.realize()`. Absent → `async () => ({})`, an empty
|
|
331
|
+
* resolver: the interface is satisfied without a new mandatory field, and a class the resolver does
|
|
332
|
+
* not supply reaches the room as an empty secret that fails at the service that reads it — the
|
|
333
|
+
* direction a missing credential should fail. The deployment supplies the real resolver.
|
|
334
|
+
*/
|
|
335
|
+
credentialResolver?: CredentialResolver | undefined;
|
|
336
|
+
/**
|
|
337
|
+
* The repository this RUN operates on — the SUBJECT of work, named by the RUN and NEVER by the
|
|
338
|
+
* venue. A venue is one AT-REST room and is one-to-MANY against repositories: one room serves many
|
|
339
|
+
* repositories, so pinning the repository on the venue would mint a venue per repository. When
|
|
340
|
+
* supplied AND the resolved venue has a realizer, it is threaded into the substrate realizer as
|
|
341
|
+
* `RealizeOpts.repoUrl`, so the realized room's workspace is populated (through src/workspace.ts
|
|
342
|
+
* `prepareWorkspace`, the SAME mechanism the drain uses) with a clone of THIS repository — and two
|
|
343
|
+
* concurrent code-editing gigs against the same room get DISJOINT trees.
|
|
344
|
+
*
|
|
345
|
+
* The source is EXPLICIT: a dispatch field on the server path, the claim's governed `repo_url`
|
|
346
|
+
* column on the drain path. It is never process.cwd() and never an ambient host path — inferring the
|
|
347
|
+
* operator's own checkout is exactly the isolation failure an explicit source forecloses. ABSENT =
|
|
348
|
+
* the room declines to populate (an empty read-only workspace) and no git credential is minted.
|
|
349
|
+
*/
|
|
350
|
+
repoUrl?: string | undefined;
|
|
280
351
|
}
|
|
281
352
|
/**
|
|
282
353
|
* Per-gig cost-budget input. Honors budget-state.json schema (PR #56). Only
|
|
@@ -472,6 +543,17 @@ export interface GigResult {
|
|
|
472
543
|
movement_id?: string;
|
|
473
544
|
genome_hash: string;
|
|
474
545
|
run_fingerprint: string;
|
|
546
|
+
/**
|
|
547
|
+
* The gig-close CONFORMANCE classification — does this sealed run fit its own construction? A
|
|
548
|
+
* pure, deterministic verdict over (the standard, the sealed set) along two axes, FIT (every
|
|
549
|
+
* chair's declared output_contract is satisfied) and TIMING (every record's engine-stamped
|
|
550
|
+
* input_shas respect the declared edges). It is a CLASSIFIER that routes review, not a gate:
|
|
551
|
+
* present as a PROPERTY of the run beside `run_fingerprint`, deliberately NOT folded into it (a
|
|
552
|
+
* run containing its own grade would be self-referential) and never sealed as an output INSIDE
|
|
553
|
+
* the gig it grades. Present only on the completion path — an `awaiting_approval` return is a
|
|
554
|
+
* distinct shape whose INCOMPLETE verdict is the classifier's job to state when it is called.
|
|
555
|
+
*/
|
|
556
|
+
conformance?: GigConformanceResult;
|
|
475
557
|
/**
|
|
476
558
|
* Records this run CONSUMED but did not produce — an earlier movement's sealed outputs, carried
|
|
477
559
|
* in over a chart edge. Present only when seeds were actually read, so its absence is the claim
|