@reunionstudio/airlock-mcp 0.1.4 → 0.1.6

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.
@@ -227,6 +227,36 @@ as `admin.list_specs`, `admin.describe_role`, `admin.get_spec`, or
227
227
  Use `admin.*` only when the app is intentionally changing Airlock setup or
228
228
  running an admin operation.
229
229
 
230
+ Restricted references are one-record interaction contracts for read-only
231
+ reference specs. If `agent.describe_spec`, `observe.spec`,
232
+ `observe.spec_config`, or `observe.reference_context` shows
233
+ `restricted_reference` or `reference_config.restricted_reference`, do not
234
+ enumerate the protected reference, build a populated picker, or use broad
235
+ `agent.select_reference_data` for that object path. Get the lookup value from
236
+ the user's case/work context, then call `agent.get_reference_record` with the
237
+ configured `object_key`, lookup value, purpose, and role lens. The procedure
238
+ returns at most one `RECORD`, applies reference row filters, checks active
239
+ `action_limit` Expectations before returning data, and records the safe
240
+ `REFERENCE_READ` event used for usage budgeting. Branch on stable codes such
241
+ as `OK`, `NOT_FOUND`, `NON_UNIQUE_LOOKUP_KEY`, `PURPOSE_REQUIRED`,
242
+ `USAGE_LIMIT_BLOCKED`, and `REFERENCE_READ_EVENT_FAILED`; expose
243
+ `USAGE_CONTEXT` fields such as `action_limit_used` and `action_time_period`.
244
+ For read-only planning and audit, use `observe.reference_context`,
245
+ `observe.usage_limits`, `observe.usage_limit`, and
246
+ `observe.explain_access(action => 'get_reference_record', object_key => ...)`
247
+ without querying raw reference rows.
248
+
249
+ Attachments remain governed evidence. Agents should discover and manage them
250
+ through installed Airlock procedures, not by reading Airlock-owned stages or
251
+ generated storage directly. The Streamlit Native App can preview images and
252
+ text inline and can render bounded page-at-a-time PDF previews for files up to
253
+ 100 MB and 2,000 pages. PDFs larger than 12 MB require an explicit open action;
254
+ the selected page and next two pages warm a private session cache. Full-file
255
+ download remains a short-lived Snowflake link when available. Successful PDF
256
+ page previews emit metadata-only `ATTACHMENT_PREVIEW` activity, never document
257
+ content or stage URLs. This UI preview capability does not grant MCP clients
258
+ direct attachment bytes.
259
+
230
260
  Help the app follow the loop:
231
261
 
232
262
  - Observe/read: fetch existing governed data through approved Airlock or
package/README.md CHANGED
@@ -221,6 +221,37 @@ For app-first work against installed Airlock, start with `observe.procedures`,
221
221
  before designing direct SQL helpers. These payloads are intended to be useful
222
222
  to agents as well as humans.
223
223
 
224
+ Restricted references are one-record interaction contracts. When
225
+ `observe.reference_context`, `observe.spec_config`, or `agent.describe_spec`
226
+ shows `restricted_reference` or `reference_config.restricted_reference`, agents
227
+ must not call broad
228
+ `agent.select_reference_data` for that object path and must not enumerate values
229
+ or build a populated picker from the protected reference. The agent should get
230
+ the lookup value from the user's case/work context, then call
231
+ `agent.get_reference_record` with the configured `object_key`, lookup value,
232
+ purpose, and role lens. The procedure applies configured reference row filters,
233
+ checks active `action_limit` Expectations before returning a record, always
234
+ records the safe `REFERENCE_READ` event used for budgeting, and returns at most
235
+ one `RECORD`. Branch on codes such as `OK`, `NOT_FOUND`,
236
+ `NON_UNIQUE_LOOKUP_KEY`, `PURPOSE_REQUIRED`, `USAGE_LIMIT_BLOCKED`, and
237
+ `REFERENCE_READ_EVENT_FAILED`, and report `USAGE_CONTEXT` fields such as
238
+ `action_limit_used` and `action_time_period`. Auditors and planning agents can
239
+ inspect `observe.usage_limits`, `observe.usage_limit`, and
240
+ `observe.explain_access(action => 'get_reference_record', object_key => ...)`
241
+ without reading raw reference rows.
242
+
243
+ Airlock's Streamlit Native App can inspect governed attachment evidence without
244
+ moving it into a separate document service. Images and text preview inline.
245
+ PDFs up to 100 MB and 2,000 pages render one selected page at a time; the
246
+ selected page and next two pages are loaded as one bounded window so ordinary
247
+ forward navigation can use the session cache. PDFs larger than 12 MB require an
248
+ explicit open action. Rendering is bounded by time, dimensions, concurrency,
249
+ output size, session storage, and expiry, while full-file access remains a
250
+ short-lived Snowflake download when available. Successful PDF page previews
251
+ emit metadata-only `ATTACHMENT_PREVIEW` activity. This human-facing capability
252
+ does not permit an MCP agent to bypass attachment procedures or read underlying
253
+ stage objects directly.
254
+
224
255
  For governed Markdown knowledge, use the `okf-knowledge-bundle` pattern. It
225
256
  sets `core_config.payload_adapter` to `okf_knowledge_bundle` so installed
226
257
  Airlock can load locally validated bundles through
@@ -30,6 +30,21 @@ For installed Airlock access, teach the current procedure split:
30
30
  administrative mutation. App-first and audit-style workflows should use
31
31
  observe payloads for discovery, context, health, access explanation, activity,
32
32
  billing events, and governance maps before considering custom SQL helpers.
33
+ When a read-only reference spec declares `restricted_reference` or
34
+ `reference_config.restricted_reference`, agents should avoid broad
35
+ `agent.select_reference_data` reads and use `agent.get_reference_record` for a
36
+ known lookup value and purpose, with `observe.reference_context`,
37
+ `observe.usage_limits`, `observe.usage_limit`, and
38
+ `observe.explain_access(action => 'get_reference_record', object_key => ...)`
39
+ for planning and audit.
40
+
41
+ The installed Streamlit Native App also provides governed attachment
42
+ inspection: inline image/text previews and bounded, page-at-a-time PDF preview
43
+ for documents up to 100 MB and 2,000 pages. The selected PDF page warms the next
44
+ two pages in the session cache; large PDFs require explicit open, and full-file
45
+ access uses Snowflake download links when available. Successful PDF page
46
+ previews emit metadata-only `ATTACHMENT_PREVIEW` activity. This UI capability
47
+ does not grant MCP clients direct stage access.
33
48
 
34
49
  The connector package and MCP server live in `reunionstudio/airlock-mcp`.
35
50
  This workbench provides the spec-building implementation inside that one
package/docs/workflows.md CHANGED
@@ -172,6 +172,32 @@ For app-first work, start with observe payloads such as `observe.procedures`,
172
172
  wrappers such as `admin.list_specs`, `admin.describe_role`, `admin.get_spec`,
173
173
  or `admin.list_events`; use observe list/detail procedures instead.
174
174
 
175
+ Restricted references are one-record interaction contracts for read-only
176
+ reference specs. When `observe.reference_context`, `observe.spec_config`, or
177
+ `agent.describe_spec` shows `restricted_reference` or
178
+ `reference_config.restricted_reference`, do not enumerate the protected
179
+ reference, build a populated picker, or use broad `agent.select_reference_data`
180
+ for that object path. Get the lookup value from the user's case/work context,
181
+ then call `agent.get_reference_record` with the configured `object_key`, lookup
182
+ value, purpose, and role lens. The procedure returns at most one `RECORD`,
183
+ applies reference row filters, checks active `action_limit` Expectations before
184
+ returning data, and records the safe `REFERENCE_READ` event used for usage
185
+ budgeting. Use `observe.reference_context`, `observe.usage_limits`,
186
+ `observe.usage_limit`, and
187
+ `observe.explain_access(action => 'get_reference_record', object_key => ...)`
188
+ for planning and audit without reading raw reference rows.
189
+
190
+ ## Governed Attachment Preview
191
+
192
+ Attachments remain governed evidence. Agents should discover and manage them
193
+ through installed Airlock procedures rather than reading Airlock-owned stages.
194
+ In the Streamlit Native App, images and text can preview inline, and PDFs up to
195
+ 100 MB and 2,000 pages can render one selected page at a time. Airlock renders a
196
+ bounded three-page window so the next two pages are normally session-cache
197
+ hits; PDFs larger than 12 MB require an explicit open action. Full-file download
198
+ remains available through a short-lived Snowflake link when the runtime can
199
+ create one. Preview activity emits metadata-only `ATTACHMENT_PREVIEW` events.
200
+
175
201
  The app should follow the loop:
176
202
 
177
203
  1. Observe/read governed records through approved Airlock or Snowflake surfaces.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reunionstudio/airlock-mcp",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Single-install MCP interface for Airlock agents.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -5,7 +5,7 @@
5
5
  {
6
6
  "post_id": "POST-001",
7
7
  "reply_to_post_id": "",
8
- "submitted_by": "agent.deb",
8
+ "submitted_by": "agent.csmith",
9
9
  "posted_at": "2026-06-13 09:00:00",
10
10
  "body": "Please make reimbursements easier to prepare and submit.",
11
11
  "tags": "#request #finance #reimbursements",
@@ -19,7 +19,7 @@
19
19
  "desired_outcome": "An approved agent can prepare a draft reimbursement with receipt evidence."
20
20
  },
21
21
  "agent": {
22
- "name": "Deb"
22
+ "name": "csmith"
23
23
  }
24
24
  }
25
25
  }
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.4",
30
+ version="0.1.6",
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.4"
3
+ __version__ = "0.1.6"
@@ -44,6 +44,24 @@ timeline. For `alter_spec` activity, use `CHANGED_SECTIONS` and
44
44
  Do not use retired admin read wrappers such as `admin.list_specs`,
45
45
  `admin.describe_role`, or `admin.list_events`; use the matching observe procedure.
46
46
 
47
+ Restricted references are one-record interaction contracts. If a reference
48
+ spec declares `restricted_reference` or `reference_config.restricted_reference`,
49
+ do not enumerate values or use broad `agent.select_reference_data` for that
50
+ object path. Get the lookup value from the user's case/work context and call
51
+ `agent.get_reference_record` with the configured `object_key`, lookup value,
52
+ purpose, and role lens. Use `observe.reference_context`,
53
+ `observe.usage_limits`, `observe.usage_limit`, and
54
+ `observe.explain_access(action => 'get_reference_record', object_key => ...)`
55
+ for planning and audit without reading raw reference rows.
56
+
57
+ Attachments remain governed evidence. Agents should discover and manage them
58
+ through installed Airlock procedures, not by reading Airlock-owned stages.
59
+ The Streamlit Native App can preview images and text inline and can render
60
+ bounded page-at-a-time PDF previews for files up to 100 MB and 2,000 pages.
61
+ PDFs larger than 12 MB require explicit open; successful page previews emit
62
+ metadata-only `ATTACHMENT_PREVIEW` activity and do not grant MCP clients direct
63
+ attachment bytes.
64
+
47
65
  Do not store credentials here. Do not write directly to Airlock-owned tables,
48
66
  stages, generated views, or generated tables. Use approved Airlock/Snowflake
49
67
  access paths and submit governed decisions or actions through spec contracts.
@@ -85,6 +103,18 @@ Installed Airlock procedure grammar:
85
103
  - `agent.*` is governed agent work in the actor's scope.
86
104
  - `admin.*` is administrative mutation. Do not use retired admin read wrappers;
87
105
  use observe list/detail procedures instead.
106
+
107
+ For restricted reference specs, do not enumerate protected object paths or use
108
+ broad `agent.select_reference_data`. Use `agent.get_reference_record` for a
109
+ known lookup value and purpose, and use `observe.reference_context`,
110
+ `observe.usage_limits`, `observe.usage_limit`, and
111
+ `observe.explain_access(action => 'get_reference_record', object_key => ...)`
112
+ for planning and audit.
113
+
114
+ For attachments, use installed Airlock procedures and governed UI surfaces.
115
+ The Streamlit Native App can preview images/text and bounded PDF pages, but
116
+ `ATTACHMENT_PREVIEW` activity is metadata-only and MCP clients must not read
117
+ Airlock-owned stages directly.
88
118
  """
89
119
 
90
120
 
@@ -144,6 +174,8 @@ def _manifest(mode: str, entries: list[dict[str, Any]]) -> dict[str, Any]:
144
174
  "observe": "read-only governance observation, context, activity, health, billing events, and access explanation",
145
175
  "agent": "governed agent work in the actor scope",
146
176
  "admin": "administrative mutation and operational changes",
177
+ "restricted_reference": "one-record reference lookup through agent.get_reference_record; do not enumerate protected reference paths",
178
+ "attachment_preview": "governed Streamlit preview emits metadata-only ATTACHMENT_PREVIEW; MCP clients do not get direct stage access",
147
179
  },
148
180
  "specs": entries,
149
181
  "tracks": {
@@ -127,6 +127,27 @@ activity, use `CHANGED_SECTIONS` and `CHANGED_FIELDS` to triage what changed
127
127
  before fetching version snapshots. Do not call retired admin read wrappers such as `admin.list_specs`, `admin.describe_role`,
128
128
  or `admin.list_events`; use the matching observe list/detail procedure.
129
129
 
130
+ Restricted references are one-record interaction contracts for read-only
131
+ reference specs. If `agent.describe_spec`, `observe.spec_config`, or
132
+ `observe.reference_context` shows `restricted_reference` or
133
+ `reference_config.restricted_reference`, do not enumerate the protected
134
+ reference, build a populated picker, or use broad `agent.select_reference_data`
135
+ for that object path. Get the lookup value from the user's case/work context,
136
+ then call `agent.get_reference_record` with the configured `object_key`, lookup
137
+ value, purpose, and role lens. Use `observe.usage_limits`,
138
+ `observe.usage_limit`, and
139
+ `observe.explain_access(action => 'get_reference_record', object_key => ...)`
140
+ for planning and audit without reading raw reference rows.
141
+
142
+ Attachments remain governed evidence. Agents should discover and manage them
143
+ through installed Airlock procedures, not by reading Airlock-owned stages
144
+ directly. The Streamlit Native App can preview images and text inline and can
145
+ render bounded page-at-a-time PDF previews for files up to 100 MB and 2,000
146
+ pages. PDFs larger than 12 MB require an explicit open action; the selected
147
+ page and next two pages warm a private session cache. Successful PDF page
148
+ previews emit metadata-only `ATTACHMENT_PREVIEW` activity and do not grant MCP
149
+ clients direct attachment bytes.
150
+
130
151
  The app may orient the user with summaries, comparisons, rankings, exception
131
152
  queues, proposals, or dashboards. It should submit governed choices back
132
153
  through an Airlock spec contract. Do not write directly to Airlock-owned tables,
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.4",
47
+ version: "0.1.6",
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
@@ -65,6 +65,27 @@ activity, use \`CHANGED_SECTIONS\` and \`CHANGED_FIELDS\` to triage what changed
65
65
  before fetching version snapshots. Offer to run \`airlock-mcp init-app-context\`
66
66
  in the app repo to seed \`airlock/specs.manifest.json\`, spec snapshots, sample records, and
67
67
  generated helper folders. Help code the app using approved Airlock/Snowflake access paths.
68
+ When a reference spec declares \`restricted_reference\` or
69
+ \`reference_config.restricted_reference\`, do not enumerate values, build a
70
+ populated picker, or call broad \`agent.select_reference_data\`. Get the lookup
71
+ value from the user's case/work context and call
72
+ \`agent.get_reference_record\` for the configured \`object_key\`, purpose, and
73
+ role lens. It returns at most one record, applies reference row filters, checks
74
+ \`action_limit\` before returning data, and always records the safe
75
+ \`REFERENCE_READ\` event used for budgeting. Branch on \`OK\`, \`NOT_FOUND\`,
76
+ \`NON_UNIQUE_LOOKUP_KEY\`, \`PURPOSE_REQUIRED\`, \`USAGE_LIMIT_BLOCKED\`, and
77
+ \`REFERENCE_READ_EVENT_FAILED\`; report \`USAGE_CONTEXT\` fields such as
78
+ \`action_limit_used\` and \`action_time_period\`. Use
79
+ \`observe.reference_context\`, \`observe.usage_limits\`, \`observe.usage_limit\`,
80
+ and \`observe.explain_access(action => 'get_reference_record', object_key => ...)\`
81
+ for read-only planning and audit.
82
+ Attachments remain governed evidence. Agents should discover and manage them
83
+ through installed Airlock procedures, not by reading Airlock-owned stages.
84
+ The Streamlit Native App can preview images/text and bounded page-at-a-time
85
+ PDFs up to 100 MB and 2,000 pages; PDFs larger than 12 MB require explicit
86
+ open. Successful page previews emit metadata-only \`ATTACHMENT_PREVIEW\`
87
+ activity and do not grant MCP clients direct attachment bytes.
88
+
68
89
  Do not use retired admin read wrappers such as
69
90
  \`admin.list_specs\`, \`admin.describe_role\`, or \`admin.list_events\`; use
70
91
  the matching observe procedure. Do not write directly to Airlock-owned tables
@@ -185,7 +206,13 @@ read-side discovery with observe payloads such as \`observe.procedures\`,
185
206
  for \`alter_spec\` activity, use \`CHANGED_SECTIONS\` and \`CHANGED_FIELDS\` to
186
207
  triage what changed before fetching version snapshots. Do not use retired admin
187
208
  read wrappers such as \`admin.list_specs\`, \`admin.describe_role\`, or
188
- \`admin.list_events\`. It can
209
+ \`admin.list_events\`. If a reference spec declares \`restricted_reference\` or
210
+ \`reference_config.restricted_reference\`, do not enumerate the protected
211
+ reference; use \`agent.get_reference_record\` for a known lookup value and
212
+ \`observe.usage_limits\` / \`observe.usage_limit\` for budget visibility. It can
213
+ also explain governed attachment preview: Streamlit can preview images/text and
214
+ bounded PDF pages, while \`ATTACHMENT_PREVIEW\` remains metadata-only and agents
215
+ must use Airlock procedures instead of direct stage reads. Airlock MCP can
189
216
  seed an app repo with \`airlock/specs.manifest.json\`, spec snapshots, sample
190
217
  records, and generated helper folders. The app should submit decisions,
191
218
  approvals, actions, comments, or follow-ups through Airlock spec contracts, not