@reunionstudio/airlock-mcp 0.1.7 → 0.1.8

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.
@@ -229,6 +229,27 @@ Airlock:
229
229
  - `airlock.admin.*` performs administrative changes and operational mutations.
230
230
  - `airlock.agent.*` performs governed user or agent work in the actor's scope.
231
231
 
232
+ Treat every mutating human or automated agent as an attributable Snowflake
233
+ principal. Direct work uses that principal's Airlock assignments. Work for
234
+ another principal requires explicit Airlock delegation and
235
+ `on_behalf_of_user`; pass `delegation_id` only when Airlock reports more than
236
+ one matching active grant. Snowflake user type and agent-session metadata are
237
+ informational, not authority. Never map workspace roles, channel membership,
238
+ reactions, or chat approval into Airlock permissions.
239
+ A `DELEGATED_ACTION` event records the authorized attempt and actor/principal
240
+ identity; the mutation result and normal file, attachment, or workflow events
241
+ provide commitment evidence.
242
+
243
+ Stored-procedure events may expose
244
+ `EVENT_CONTEXT.snowflake_agent_active` as informational provenance. Never use
245
+ that marker to grant access, infer delegation, classify billing, or replace the
246
+ authenticated Snowflake principal.
247
+
248
+ A read-only channel may use a dedicated observer principal with
249
+ `app_observer`, a distinct Airlock role/assignment, and explicit per-spec
250
+ `observer_access`. Do not reuse that observer principal for mutation, and do
251
+ not share one mutating principal across human or automated actors.
252
+
232
253
  Use `agent.list_my_work` as the actor's single operational inbox for workflow,
233
254
  watcher, deadline, overdue, and exception work. Use `observe.work` for the
234
255
  read-only account-wide current-work projection and `observe.activity` for event
@@ -243,6 +264,19 @@ workflow, attachment, and exact-reference changes. Use `observe.spec_state` and
243
264
  `observe.file_state` only with observer/admin authority for account-wide state.
244
265
  Do not substitute global observer tokens for an agent's scoped token.
245
266
 
267
+ After every supported `agent.*` or intentional `admin.*` mutation, preserve a
268
+ bounded `airlock.commitment-receipt/v1` in the external workspace history.
269
+ Record the procedure and authenticated Snowflake principal; derive any
270
+ represented principal and delegation id from the actual procedure arguments.
271
+ Retain the target spec/path/filename, returned status/code/message and issues,
272
+ and timestamp. After a successful direct file mutation, call `agent.file_state`
273
+ with the returned target and retain its `UPLOAD_ID`, `FILE_STATE_ID`, workflow
274
+ state, attachment count, and reference count. Do not make that direct actor
275
+ state read after delegated work; leave `committed_state` null unless the actor
276
+ performs a separate independently authorized observation. Keep a denied
277
+ mutation as a receipt with no committed state. Never use a chat display name as
278
+ the Snowflake actor or describe workspace approval as an Airlock commitment.
279
+
246
280
  Required source references are exact governed evidence, not filename fields.
247
281
  When an active downstream-to-source link has `min_count > 0`, load the
248
282
  downstream file into Draft, discover eligible sources with
@@ -394,6 +428,8 @@ human decisions remain.
394
428
 
395
429
  - Local checks are not Airlock authority.
396
430
  - Installed Airlock procedures remain the execution contract.
431
+ - Every mutating actor keeps an attributable Snowflake principal; shared
432
+ integration identities and workspace roles are not authorization shortcuts.
397
433
  - Do not write directly to Airlock-owned tables, stages, generated views, or
398
434
  generated tables.
399
435
  - Do not put Airlock workflow state, reviewer comments, approval status, or
@@ -0,0 +1,14 @@
1
+ # Airlock MCP activation
2
+
3
+ Use the bundled Airlock skill when a task concerns Airlock specs, governed
4
+ Snowflake work, read-only governance observation, delegation, expectations,
5
+ attachments, workflow, state polling, or commitment receipts.
6
+
7
+ Before acting, preserve the authenticated Snowflake principal. Workspace roles
8
+ and chat identity are not Airlock authority. Use `airlock.agent.*` for governed
9
+ work, `airlock.observe.*` for read-only observation, and `airlock.admin.*` only
10
+ for intentional administration. Use explicit Airlock delegation when the
11
+ connected principal acts for another principal.
12
+
13
+ Never store credentials in this plugin or its workspace files. Configure the
14
+ Airlock MCP connection through the supported environment or connection setup.
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "airlock-mcp",
3
+ "description": "Governed Airlock spec, observation, and commitment guidance for Snowflake principals.",
4
+ "version": "0.1.8",
5
+ "author": {
6
+ "name": "Reunion Studio",
7
+ "url": "https://github.com/reunionstudio/airlock-mcp"
8
+ },
9
+ "skills": [
10
+ "./.agents/skills"
11
+ ],
12
+ "mcpServers": {
13
+ "airlock": {
14
+ "type": "stdio",
15
+ "command": "npx",
16
+ "args": [
17
+ "-y",
18
+ "@reunionstudio/airlock-mcp@0.1.8",
19
+ "server"
20
+ ]
21
+ }
22
+ }
23
+ }
package/README.md CHANGED
@@ -28,15 +28,25 @@ Airlock MCP gives agents four kinds of Airlock help:
28
28
  procedures to inspect setup, access, activity, billing events, health,
29
29
  context packets, and governance maps before deciding what an app or agent
30
30
  should do.
31
+ 5. Workspace interoperability: preserve principal identity, poll scoped state,
32
+ commit only through installed procedures, and retain portable Airlock
33
+ receipts in external workspace history.
31
34
 
32
35
  ## Installed Airlock Contract
33
36
 
34
37
  Current Airlock separates procedure intent:
35
38
 
36
39
  - `airlock.observe.*` is the read-only governance observation surface. It is
37
- available to `app_admin` and `app_observer` and is the preferred path for
38
- discovery, health checks, access explanation, governance maps, activity,
39
- billing event context, and list/detail context packets.
40
+ available at the Snowflake object layer to `app_admin` and `app_observer`.
41
+ Airlock assignments and per-spec `observer_access` rules scope ordinary
42
+ observers; account-wide surfaces require `app_admin` or the locked Airlock
43
+ role `global_observer`. That reserved role is observation-only: it cannot own
44
+ specs, receive guest/reviewer grants, or manage child roles.
45
+ Account-wide auditors should use `airlock.observe.observers(...)` for a flat
46
+ user, assignment, observer-role, spec/path/workflow, and license inventory.
47
+ `active_seat_observer_only` means the identity is observer-only now but still
48
+ has a billable seat that must be explicitly unassigned; role changes never
49
+ silently rewrite billing history.
40
50
  - `airlock.admin.*` is for admin changes and operational actions such as
41
51
  creating specs, changing roles, loading OKF bundles, rerunning setup, or
42
52
  deleting purge candidates.
@@ -44,22 +54,83 @@ Current Airlock separates procedure intent:
44
54
  specs, validating/loading data, workflow actions, attachments, delegations,
45
55
  and references.
46
56
 
57
+ Every mutating human or automated agent should connect as its own attributable
58
+ Snowflake principal. When it acts for another principal, use explicit Airlock
59
+ delegation. Snowflake user type, chat identity, channel membership, workspace
60
+ roles, and reactions do not create Airlock authority. A read-only channel may
61
+ use a distinct scoped observer principal, but that principal must not be reused
62
+ for mutation.
63
+
64
+ Stored-procedure activity includes the informational
65
+ `EVENT_CONTEXT.snowflake_agent_active` marker when Snowflake exposes it. The
66
+ marker identifies execution context for observation; it never changes Airlock
67
+ access, workflow, expectations, billing, or receipt identity.
68
+ A `DELEGATED_ACTION` event records an authorized attempt, not proof that its
69
+ mutation committed. Commitment receipts derive delegation identity from the
70
+ actual call arguments, and only successful direct file mutations are hydrated
71
+ through `agent.file_state`; delegated work leaves `committed_state` null unless
72
+ the actor performs a separate independently authorized observation.
73
+
47
74
  Use `airlock.agent.list_my_work(...)` for the current actor's unified workflow,
48
- watcher, deadline, overdue, and exception inbox. Use `airlock.observe.work(...)`
49
- for the read-only account-wide projection of current work, and
75
+ read-only observation, deadline, overdue, and exception inbox. Use
76
+ `airlock.observe.work(...)` for the read-only assignment-scoped projection of
77
+ current work, and
50
78
  `airlock.observe.activity(...)` for historical events. The older split work
51
79
  procedures are retired.
52
80
 
53
- Watcher agents should poll `airlock.agent.spec_state(...)` before retrieving a
81
+ Polling agents should call `airlock.agent.spec_state(...)` before retrieving a
54
82
  complete descriptor, file list, or governed dataset. Cache the
55
83
  authorization-scoped `STATE_TOKEN` and perform the heavier read only when it
56
84
  changes. Poll `airlock.agent.list_my_work(...)` independently because deadlines
57
85
  and expectation windows can change with time without rotating a spec token.
58
86
  After selecting a logical file, compare
59
87
  `airlock.agent.file_state(...).FILE_STATE_ID`; that UUID rotates when its data,
60
- workflow, attachments, or exact source references change. Observer clients use
61
- the account-wide read-only `observe.spec_state(...)` and
62
- `observe.file_state(...)` equivalents.
88
+ workflow, attachments, exact source references, or retained version history
89
+ change. Observer clients use
90
+ the authorization-scoped, read-only `observe.spec_state(...)` and
91
+ `observe.file_state(...)` equivalents. A missing object or revoked observer
92
+ grant returns no row, which is the terminal polling signal; authorized query
93
+ failures remain procedure errors.
94
+
95
+ ### Observer Access And Seats
96
+
97
+ An observe-only integration does not claim or consume a named Airlock seat.
98
+ `airlock.agent.*` and the built-in Streamlit app remain seat-gated. Moving an
99
+ existing identity to observe-only does not silently remove a seat that was
100
+ previously assigned or claimed; an administrator should explicitly call
101
+ `airlock.admin.unassign_license(...)` after confirming the identity no longer
102
+ uses those surfaces.
103
+
104
+ Specs grant read-only visibility with canonical `observer_access` config:
105
+
106
+ ```json
107
+ {
108
+ "observer_access": {
109
+ "enabled": true,
110
+ "observer_roles": [
111
+ {
112
+ "role_name": "finance_observer",
113
+ "path_filter": "finance",
114
+ "workflow_states": ["Approved"]
115
+ }
116
+ ]
117
+ }
118
+ }
119
+ ```
120
+
121
+ Grant the integration Snowflake application role `app_observer`, create or
122
+ reuse the Airlock observer role, and assign the integration's Snowflake
123
+ username to it. Use a distinct observer principal per channel so attribution,
124
+ scope, and revocation remain independent. Observe procedures return governance
125
+ metadata only, never governed payload rows or attachment bytes.
126
+
127
+ Set up an observer in four explicit steps: grant the observer principal's Snowflake role
128
+ `<APP_NAME>.app_observer`, create and assign a distinct Airlock role, publish
129
+ that role in each intended spec's `observer_access`, then verify the result with
130
+ `observe.observers(...)`. Audit assignment creation, changes, and removal with
131
+ `observe.admin_activity(..., action_family => 'assignments')`; its structured
132
+ event context includes before/after state. See [docs/workflows.md](docs/workflows.md)
133
+ for the operating checklist and billing cleanup boundary.
63
134
 
64
135
  When building an app or workflow, prefer `observe.*` for read-only setup and
65
136
  monitoring questions, `agent.*` for governed submissions in the actor's scope,
@@ -115,6 +186,19 @@ Install from npm:
115
186
  npx @reunionstudio/airlock-mcp install
116
187
  ```
117
188
 
189
+ Install the bundled Cortex Code plugin from GitHub:
190
+
191
+ ```bash
192
+ cortex plugin install reunionstudio/airlock-mcp
193
+ ```
194
+
195
+ The `.cortex-plugin/plugin.json` manifest loads the same Airlock skill and pins
196
+ the stdio MCP server to this package version. Keep Snowflake and MCP credentials
197
+ outside the manifest. When the Cortex Code CLI is available locally, validate a
198
+ checkout with `cortex plugin validate` before distributing it. Account-local
199
+ Cortex Extension sharing remains subject to Snowflake's current preview and
200
+ RBAC requirements.
201
+
118
202
  Today this package is a small installer and MCP launcher. For Codex, install
119
203
  registers a local stdio server with:
120
204
 
@@ -133,6 +217,10 @@ person through process discovery, and entering the bundled spec-building
133
217
  workbench when a first spec is ready to draft. It also guides agents building
134
218
  apps or workflows that use specs the user already has access to.
135
219
 
220
+ See [principal and workspace interoperability](docs/principal-workspace-interoperability.md)
221
+ for the identity matrix, state-polling contract, and portable commitment
222
+ receipt.
223
+
136
224
  Workspace summaries are structured spec cards. They present the current spec
137
225
  core, file rules, attachment policy, guest access, column rules, sample record
138
226
  shape, note-file status, and local check status so Codex can reflect the draft
@@ -273,8 +361,8 @@ before designing direct SQL helpers. These payloads are intended to be useful
273
361
  to agents as well as humans.
274
362
 
275
363
  For operational queues, call `agent.list_my_work` in the actor's scope. An
276
- observer may call `observe.work` for all current work; historical questions
277
- belong to `observe.activity`.
364
+ observer may call `observe.work` for current work in its assigned scope;
365
+ historical questions belong to `observe.activity`.
278
366
 
279
367
  Required source references are a governed submission contract. When a
280
368
  downstream spec has an active source link with `min_count > 0`, load the file
@@ -0,0 +1,101 @@
1
+ # Principal and workspace interoperability
2
+
3
+ Airlock treats a workspace as a place for discussion, drafts, monitoring, and
4
+ automation. It does not treat workspace roles, channel membership, reactions,
5
+ or chat approvals as Snowflake authority.
6
+
7
+ ## Required identity model
8
+
9
+ - Every mutating human or automated agent connects as its own attributable
10
+ Snowflake principal.
11
+ - Direct work uses that principal's Airlock assignments.
12
+ - Work for another principal uses an explicit Airlock delegation and
13
+ `on_behalf_of_user`; pass `delegation_id` only when Airlock reports multiple
14
+ matching active grants.
15
+ - Snowflake user type and agent-session metadata are informational. They do not
16
+ create Airlock authority or change policy, workflow, expectations, or
17
+ billing.
18
+ - Stored-procedure activity exposes `event_context.snowflake_agent_active` when
19
+ Snowflake supplies the execution-context marker. Use it for observation only;
20
+ the authenticated principal remains the authoritative actor.
21
+ - A read-only channel may use a dedicated observer principal with
22
+ `<APP_NAME>.app_observer` and explicit per-spec `observer_access`. Never reuse
23
+ that principal for mutation.
24
+
25
+ ## Polling
26
+
27
+ Use state tokens before larger reads:
28
+
29
+ - `agent.spec_state(...).STATE_TOKEN` for the actor's visible contract, data,
30
+ and access state;
31
+ - `agent.file_state(...).FILE_STATE_ID` for one visible file's data, workflow,
32
+ attachment, reference, and retained-version state;
33
+ - `observe.spec_state` and `observe.file_state` for a scoped observer principal;
34
+ and
35
+ - `agent.list_my_work` or `observe.work` on a separate cadence for deadlines
36
+ and current work.
37
+
38
+ A missing state row is the terminal result for that cursor. Return to discovery
39
+ instead of inferring whether the object was deleted, retired, or became
40
+ inaccessible.
41
+
42
+ ## Commitment receipts
43
+
44
+ After every supported `agent.*` or intentional `admin.*` mutation, store a
45
+ bounded receipt in the workspace event history:
46
+
47
+ ```json
48
+ {
49
+ "schema": "airlock.commitment-receipt/v1",
50
+ "procedure": "airlock.agent.load_data",
51
+ "actor": {
52
+ "snowflake_principal": "CSMITH",
53
+ "on_behalf_of": "ASMITH",
54
+ "delegation_id": null
55
+ },
56
+ "target": {
57
+ "spec_name": "reimbursements",
58
+ "path": "asmith",
59
+ "filename": "expense_2026_08_08"
60
+ },
61
+ "outcome": {
62
+ "status": "ok",
63
+ "code": "LOADED",
64
+ "message": null,
65
+ "issues": []
66
+ },
67
+ "committed_state": null,
68
+ "operation_identity": {},
69
+ "recorded_at": "2026-08-08T12:00:00Z"
70
+ }
71
+ ```
72
+
73
+ Bind `actor.snowflake_principal` to the authenticated connection identity, not
74
+ a chat display name. Preserve the procedure's stable status, code, message,
75
+ and issues. Derive `on_behalf_of` and `delegation_id` from the actual procedure
76
+ arguments and reject conflicting receipt metadata.
77
+
78
+ After a successful direct file mutation, call `agent.file_state` with the
79
+ returned spec, path, and filename to populate `committed_state`. Do not make
80
+ that direct actor state read after delegated work because `agent.file_state`
81
+ has no delegated call shape. Leave `committed_state` null unless the actor
82
+ performs a separate independently authorized observation. For attachment
83
+ mutations, retain the returned `ATTACHMENT_ID` in `operation_identity`.
84
+
85
+ A `DELEGATED_ACTION` event records the authorized delegated attempt and its
86
+ actor/principal identity. It does not by itself prove that the requested
87
+ mutation committed; use the procedure outcome and normal mutation events as
88
+ commitment evidence.
89
+
90
+ Denied mutations are receipts too. Preserve the denial code and issues, omit
91
+ committed state, and never describe workspace approval as an Airlock
92
+ commitment.
93
+
94
+ ## Cortex Code plugin
95
+
96
+ This repository includes `.cortex-plugin/plugin.json`, which loads the bundled
97
+ Airlock skill and starts the pinned Airlock MCP package over stdio. Install from
98
+ the Git repository with Cortex Code's plugin command, inspect the version, and
99
+ keep credentials outside the plugin manifest. Account-local Cortex Extension
100
+ sharing may be used where enabled; follow Snowflake's current preview and RBAC
101
+ requirements.
package/docs/workflows.md CHANGED
@@ -175,9 +175,39 @@ Use the installed Airlock procedure grammar:
175
175
  - `airlock.admin.*` is for administrative mutation and operational changes.
176
176
 
177
177
  For work discovery, use `agent.list_my_work` as the current actor's unified
178
- inbox. Observers use `observe.work` for account-wide current work and
179
- `observe.activity` for historical events. Do not recreate separate workflow
180
- and expectation inbox calls in app code.
178
+ inbox. Observers use `observe.work` for current work within their assignment and
179
+ spec scope, and `observe.activity` for scoped historical events. `app_admin`
180
+ and the locked Airlock role `global_observer` receive the account-wide forms.
181
+ Do not recreate separate workflow and expectation inbox calls in app code.
182
+
183
+ For an account-wide observer audit, call `observe.observers(...)`. It flattens
184
+ the current user assignment, effective observer role, spec/path/workflow scope,
185
+ and named-license posture. Treat `active_seat_observer_only` as an explicit
186
+ administrative cleanup state: observer calls are free, but a previously claimed
187
+ seat remains billable until `admin.unassign_license(...)` is called.
188
+
189
+ When asked to set up an observer principal for a channel, keep these controls
190
+ separate and apply them in order:
191
+
192
+ 1. Grant a dedicated Snowflake account role the installed app's
193
+ `<APP_NAME>.app_observer` application role.
194
+ 2. Create a distinct Airlock role with `admin.create_roles(...)`, then assign
195
+ the observer principal's Snowflake username with
196
+ `admin.create_assignments(...)`.
197
+ 3. Add that role to each intended spec's `observer_access.observer_roles`, using
198
+ `path_filter` and `workflow_states` when narrower visibility is required.
199
+ 4. As `app_admin` or `global_observer`, verify the result with
200
+ `observe.observers(...)` and audit the setup through
201
+ `observe.admin_activity(procedure_name => 'create_assignments', action_family
202
+ => 'assignments', ...)`.
203
+
204
+ Assignment create, alter, and drop activity includes structured
205
+ `EVENT_CONTEXT.before`, `EVENT_CONTEXT.after`, and
206
+ `EVENT_CONTEXT.changed_fields`. Expect `free_observer_only` when the principal
207
+ has no agent access or active seat. If it reports `active_seat_observer_only`,
208
+ confirm the principal no longer needs `agent.*` or Streamlit before calling
209
+ `admin.unassign_license(...)`. Never share one Snowflake username across
210
+ channels merely to simplify setup; that collapses attribution and revocation.
181
211
 
182
212
  Watcher loops should call `agent.spec_state` before larger reads. Cache its
183
213
  authorization-scoped `STATE_TOKEN` and retrieve descriptors, file lists, or
@@ -185,9 +215,35 @@ governed data only when it changes. Poll `agent.list_my_work` independently
185
215
  because deadlines and expectation windows can change without rotating the spec
186
216
  token. Once the app tracks one logical file,
187
217
  compare `agent.file_state(...).FILE_STATE_ID` to detect data replacement,
188
- workflow movement, attachment changes, or exact-reference changes. Observer
189
- services may use the global read-only `observe.spec_state` and
190
- `observe.file_state` equivalents.
218
+ workflow movement, attachment changes, exact-reference changes, or retained
219
+ version-history changes. Observer principals use the authorization-scoped,
220
+ read-only `observe.spec_state` and `observe.file_state` equivalents. A missing
221
+ object or revoked grant returns no row as the terminal polling signal;
222
+ authorized query failures remain procedure errors.
223
+
224
+ Every mutating human or automated agent should connect as an attributable
225
+ Snowflake principal. When it acts for another principal, use explicit Airlock
226
+ delegation and `on_behalf_of_user`; pass `delegation_id` only when multiple
227
+ active grants match. Workspace roles, channel membership, reactions, and chat
228
+ approvals remain collaboration context, not Airlock authority.
229
+ A `DELEGATED_ACTION` event records the authorized attempt and actor/principal
230
+ identity; it does not by itself prove that the requested mutation committed.
231
+
232
+ When activity includes `EVENT_CONTEXT.snowflake_agent_active`, treat it as
233
+ informational execution provenance. It does not grant authority, prove
234
+ delegation, or change policy and billing.
235
+
236
+ After each supported `agent.*` or intentional `admin.*` mutation, store an
237
+ `airlock.commitment-receipt/v1` in workspace history. Preserve the authenticated
238
+ Snowflake actor and derive any represented principal and delegation id from the
239
+ actual call arguments. Retain the target, stable status/code/message/issues,
240
+ and timestamp. For a successful direct file mutation, follow with
241
+ `agent.file_state` and retain `UPLOAD_ID`, `FILE_STATE_ID`, workflow state,
242
+ attachment count, and reference count. Do not make that direct actor state read
243
+ after delegated work; leave `committed_state` null unless the actor performs a
244
+ separate independently authorized observation. A denied call is still a
245
+ receipt, but it has no committed state. See
246
+ `docs/principal-workspace-interoperability.md` for the complete shape.
191
247
 
192
248
  For downstream work that requires governed source evidence, use the installed
193
249
  source-reference sequence: load the downstream Draft, call
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reunionstudio/airlock-mcp",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Single-install MCP interface for Airlock agents.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -30,6 +30,7 @@
30
30
  "src/*.mjs",
31
31
  "src/airlock_mcp/*.py",
32
32
  ".agents",
33
+ ".cortex-plugin",
33
34
  "patterns",
34
35
  "schemas",
35
36
  "workspaces",
package/setup.py CHANGED
@@ -27,7 +27,7 @@ def data_files():
27
27
 
28
28
  setup(
29
29
  name="airlock-mcp",
30
- version="0.1.7",
30
+ version="0.1.8",
31
31
  description="Codex-first workbench and CLI for drafting Airlock specs.",
32
32
  packages=find_packages("src"),
33
33
  package_dir={"": "src"},
@@ -1,3 +1,3 @@
1
1
  """Airlock MCP CLI package."""
2
2
 
3
- __version__ = "0.1.7"
3
+ __version__ = "0.1.8"
package/src/mcp.mjs CHANGED
@@ -44,7 +44,7 @@ export function handleMcpRequest(message) {
44
44
  },
45
45
  serverInfo: {
46
46
  name: "airlock",
47
- version: "0.1.7",
47
+ version: "0.1.8",
48
48
  },
49
49
  instructions:
50
50
  "Airlock MCP helps agents improve processes with Airlock specs and build apps or workflows that use existing specs. Use airlock_start for orientation or the airlock_* tools to bootstrap, draft, check, summarize, export, and render specs.",
package/src/text.mjs CHANGED
@@ -62,14 +62,47 @@ administrative mutation. Prefer observe payloads such as
62
62
  \`observe.activity\`, \`observe.admin_activity\`, \`observe.spec_admin_activity\`,
63
63
  and \`observe.billing_events\` before inventing custom read paths. For \`alter_spec\`
64
64
  activity, use \`CHANGED_SECTIONS\` and \`CHANGED_FIELDS\` to triage what changed
65
- before fetching version snapshots. For watcher loops, cache the role-scoped
65
+ before fetching version snapshots. For polling loops, cache the role-scoped
66
66
  \`agent.spec_state(...).STATE_TOKEN\` and do larger reads only when it changes.
67
67
  After selecting one logical file, compare
68
68
  \`agent.file_state(...).FILE_STATE_ID\` to detect data, workflow, attachment,
69
- or exact-reference changes. Observer services may use the account-wide
70
- \`observe.spec_state\` and \`observe.file_state\` equivalents. Offer to run \`airlock-mcp init-app-context\`
69
+ exact-reference, or retained version-history changes. Observer principals may use
70
+ the authorization-scoped \`observe.spec_state\` and \`observe.file_state\`
71
+ equivalents. A missing object or revoked observer grant returns no row as the
72
+ terminal polling signal; authorized query failures remain errors. Holding
73
+ \`app_observer\` opens only the read-only procedure family; Airlock
74
+ assignments plus \`observer_access.observer_roles\` determine spec visibility,
75
+ and account-wide observation requires \`app_admin\` or the locked Airlock role
76
+ \`global_observer\`. That reserved role cannot own specs, receive guest/reviewer
77
+ grants, or manage child roles. Observe-only calls do not consume a named seat, while
78
+ \`agent.*\` and Streamlit remain seat-gated. Use a distinct Snowflake username
79
+ per observer channel principal. For account-wide audits, call
80
+ \`observe.observers(...)\` to join observer assignment/scope with agent-access
81
+ and license posture. \`active_seat_observer_only\` means the identity remains
82
+ billable until an administrator explicitly calls \`admin.unassign_license\`;
83
+ never infer billing from role names alone. When asked to configure an observer
84
+ principal, apply four explicit controls: grant its dedicated Snowflake role
85
+ \`<APP_NAME>.app_observer\`, create and assign a distinct Airlock role, publish
86
+ that role through each spec's \`observer_access\`, then verify scope and billing
87
+ with \`observe.observers(...)\`. Audit assignment create, alter, and drop
88
+ through \`observe.admin_activity(..., action_family => 'assignments')\`; use
89
+ the structured \`EVENT_CONTEXT.before\`, \`after\`, and \`changed_fields\`
90
+ instead of parsing descriptions. Offer to run \`airlock-mcp init-app-context\`
71
91
  in the app repo to seed \`airlock/specs.manifest.json\`, spec snapshots, sample records, and
72
92
  generated helper folders. Help code the app using approved Airlock/Snowflake access paths.
93
+ Treat every mutating human or automated agent as an attributable Snowflake
94
+ principal. Direct work uses that principal's assignments; work for another
95
+ principal uses explicit Airlock delegation and \`on_behalf_of_user\`. Workspace
96
+ roles, channel membership, reactions, and chat identity do not create Airlock
97
+ authority. Treat \`EVENT_CONTEXT.snowflake_agent_active\` as informational
98
+ provenance only. A \`DELEGATED_ACTION\` event records an authorized attempt, not
99
+ proof that its mutation committed. After each supported mutation, retain an
100
+ \`airlock.commitment-receipt/v1\` with the authenticated actor, delegation
101
+ identity derived from the actual call arguments, target, stable result, and
102
+ timestamp. Hydrate successful direct file mutations with \`agent.file_state\` so
103
+ the receipt includes \`UPLOAD_ID\`, \`FILE_STATE_ID\`, and current workflow state.
104
+ Leave delegated \`committed_state\` null unless the actor performs a separate
105
+ independently authorized observation.
73
106
  Treat Airlock's built-in Streamlit app as a generic operating and fallback
74
107
  surface, not a universal domain app. When a repeated, high-value decision needs
75
108
  domain-specific summaries, calculations, evidence layout, terminology, or
@@ -131,7 +164,7 @@ Airlock MCP will offer:
131
164
  - spec design with the bundled workbench
132
165
  - Airlock operating patterns for OODA loops and separation of duties
133
166
  - read-only observe procedures for governance maps, health, access explanation, activity, billing events, and context packets
134
- - scoped spec and file state tokens for efficient watcher polling
167
+ - scoped spec and file state tokens for efficient polling
135
168
  - app context seeding with spec snapshots and manifests
136
169
  - app and workflow coding against existing Airlock specs
137
170
  - observe specs for controlled interface ingestion
@@ -225,11 +258,38 @@ read-side discovery with observe payloads such as \`observe.procedures\`,
225
258
  \`observe.explain_access\`, \`observe.health\`, \`observe.activity\`,
226
259
  \`observe.admin_activity\`, \`observe.spec_admin_activity\`, and \`observe.billing_events\`;
227
260
  for \`alter_spec\` activity, use \`CHANGED_SECTIONS\` and \`CHANGED_FIELDS\` to
228
- triage what changed before fetching version snapshots. For watcher loops, poll
261
+ triage what changed before fetching version snapshots. For polling loops, poll
229
262
  \`agent.spec_state\` and compare its scoped \`STATE_TOKEN\` before larger reads;
230
263
  compare \`agent.file_state(...).FILE_STATE_ID\` for one selected file. Observer
231
- services use \`observe.spec_state\` and \`observe.file_state\` for account-wide
232
- read-only state. Do not use retired admin
264
+ principals use \`observe.spec_state\` and \`observe.file_state\` for
265
+ authorization-scoped read-only state. File-state UUIDs include retained
266
+ version-history changes. A missing object or revoked grant returns no row as
267
+ the terminal polling signal; authorized query failures remain errors.
268
+ \`app_observer\` grants access to the
269
+ read-only procedure family; Airlock assignments and
270
+ \`observer_access.observer_roles\` grant spec visibility. Observe-only calls do
271
+ not consume a named seat. Account-wide access requires \`app_admin\` or the
272
+ locked \`global_observer\` Airlock role, which cannot own specs, receive
273
+ guest/reviewer grants, or manage child roles. Account-wide auditors should call
274
+ \`observe.observers(...)\` for flattened observer scope and license posture;
275
+ \`active_seat_observer_only\` requires explicit \`admin.unassign_license\` to
276
+ stop future seat billing. Observer setup should use a dedicated Snowflake
277
+ username and account role, the \`<APP_NAME>.app_observer\` application role, a
278
+ distinct Airlock role/assignment, and explicit per-spec \`observer_access\`.
279
+ Verify it with \`observe.observers\` and audit structured assignment before/after
280
+ evidence with \`observe.admin_activity(..., action_family => 'assignments')\`.
281
+ Every mutating human or automated agent must keep an attributable Snowflake
282
+ principal. Use explicit Airlock delegation when it acts for someone else; never
283
+ turn workspace membership or chat approval into Airlock authority. Treat
284
+ \`EVENT_CONTEXT.snowflake_agent_active\` as informational provenance only. A
285
+ \`DELEGATED_ACTION\` event records an authorized attempt, not proof of commitment.
286
+ Store each supported mutation as an \`airlock.commitment-receipt/v1\`, preserving
287
+ the authenticated actor, delegation identity derived from the actual call
288
+ arguments, stable status/code/issues, target, and timestamp. Follow successful
289
+ direct file mutations with \`agent.file_state\` to retain \`UPLOAD_ID\`,
290
+ \`FILE_STATE_ID\`, and workflow state. Leave delegated \`committed_state\` null
291
+ unless the actor performs a separate independently authorized observation.
292
+ Do not use retired admin
233
293
  read wrappers such as \`admin.list_specs\`, \`admin.describe_role\`, or
234
294
  \`admin.list_events\`. If a reference spec declares \`restricted_reference\` or
235
295
  \`reference_config.restricted_reference\`, do not enumerate the protected