Skip to content

Commit 90c7123

Browse files
committed
Merge origin/staging into refactor/resource-views-tables
Six conflicts, all one cause: staging's unbolding sweep (#6400) landed on code this branch had moved out of the route tree. Resolved by keeping this branch's structure and replaying every one of staging's 21 `font-medium` removals at the element's new home — 16 applied, the rest already absorbed by the auto-merge. Verified none of the strings staging unbolded is still bold anywhere in the tree. One deliberate deviation: staging rewrote the file-preview fallback as `text-[14px]`, which the styling rule forbids (font-size only, inherits the wrong line-height). Took staging's intent — dropping `font-medium` — and kept the named `text-sm`, which is the same 14px. `base.tsx` and `file-viewer.tsx` came back as delete/modify conflicts because they no longer exist here; their changes were ported into `document-list.tsx` and the file-view unit rather than dropped. Suite: 20951 passed. R6/R3c 0, 23 audits green.
2 parents 904bac7 + 457170b commit 90c7123

289 files changed

Lines changed: 16438 additions & 2585 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/add-integration/SKILL.md

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -131,20 +131,24 @@ service's official documentation or an unambiguous local execution path proves t
131131
field is consumed by an AI model. If that cannot be established, preserve existing tool behavior
132132
and leave the field unannotated.
133133

134-
- **Ordinary provider/API input:** leave it unchanged. Do not add blanket result sanitization.
134+
- **Ordinary provider/API input:** leave it unchanged. Explicit `{{...}}` references resolve and are
135+
sent with their normal request semantics. A URL, domain, resource ID, control field, or opaque
136+
payload is not model-visible merely because the provider is AI-backed or may process the
137+
referenced resource later.
135138
- **Text or structured content consumed by an AI model:** declare `request.modelInput` with
136139
`mode: 'project'` and select only the exact model-visible fields. The shared executor replaces
137140
activated Sim secrets with canonical `{{NAME}}` labels before request formatting. For nested or
138141
JSON-string fields, use a small shared selector plus `applyProjected`; verify that selecting the
139142
rebuilt params reproduces the projected selection.
140-
- **Opaque model input sent directly to an external provider** such as a model-read URL or image
141-
payload: declare `request.opaqueModelInput` with `mode: 'reject-resolved-secrets'` and select only
142-
the exact effective value. The shared `executeTool` preflight rejects incomplete or secret-bearing
143-
committed provenance before URL/body formatting or network I/O, preserves safe request bytes,
144-
and sends no provenance metadata to the provider.
145-
- **Opaque model input owned by an authenticated internal route** such as uploaded audio, image,
146-
video, file bytes, or signed URLs: add `privateProvenance` to a projected request, or use
147-
`mode: 'private-provenance'` when there is no textual projection. The route must call
143+
- **Serialized model content sent directly to an external provider:** include the serialized
144+
top-level param in `request.modelInput`. Project the private copy before the existing request
145+
formatter parses it; keep formatter behavior deterministic when a whole-value placeholder is not
146+
valid in the serialized grammar. Do not introduce a second hard-rejection path.
147+
- **Opaque model input owned by an authenticated internal route** such as inline audio, image,
148+
video, or document bytes: add `privateProvenance` to a projected request, or use
149+
`mode: 'private-provenance'` when there is no textual projection. Do not select storage keys,
150+
paths, signed URLs, or ordinary remote URLs as byte provenance; the owning route must authorize
151+
stored bytes independently at model egress. The route must call
148152
`validateOpaqueModelInputProvenance` before downloading or sending content to the model and must
149153
apply the workspace-file provenance guard before reading a persisted workspace file.
150154
- **Sim-owned durable storage or internal execution handoff** that can later enter a workflow/model
@@ -160,9 +164,9 @@ Hard rules:
160164
- Never substitute secret plaintext into source or serialize plaintext provenance.
161165
- Never hand-roll private provenance headers/envelopes; the shared `executeTool` boundary owns
162166
transport and strips private metadata from functional results.
163-
- Never attach private provenance to an external URL or to `directExecution`. Use the centralized
164-
`opaqueModelInput` rejection mode for external/direct opaque model inputs, or an authenticated
165-
internal route when encrypted provenance must cross the boundary.
167+
- Never attach private provenance to an external URL or to `directExecution`. Project proven
168+
model-visible external fields with `request.modelInput`; otherwise preserve ordinary request
169+
semantics. Use an authenticated internal route when encrypted provenance must cross the boundary.
166170
- Never sanitize arbitrary third-party tool results. Projection applies only to secrets activated
167171
by Sim's resolved-secret provenance for that execution/tool call.
168172
- Do not add provenance merely because a value is persisted, returned by a tool, or appears in a
@@ -173,12 +177,11 @@ Hard rules:
173177
provider responses, filenames, URLs, and errors remain unchanged when Sim did not resolve a
174178
secret into them.
175179

176-
Add focused tests covering named projection, ordinary identical text without provenance, nested
177-
shape preservation, malformed/incomplete private metadata failing closed, centralized external
178-
opaque rejection before formatting/I/O without byte changes or metadata transport, headerless
179-
legacy requests, and absence of private metadata in the public tool result. For durable sinks, also
180-
cover legacy `NULL` markers, exact-empty new writes, tracked secret writes, stale/missing sidecars,
181-
and scope isolation.
180+
Add focused tests covering named projection, ordinary identical text without provenance, nested and
181+
serialized shape handling, unchanged ordinary external inputs, malformed/incomplete private metadata
182+
failing closed, headerless legacy requests, and absence of private metadata in the public tool result.
183+
For durable sinks, also cover legacy `NULL` markers, exact-empty new writes, tracked secret writes,
184+
stale/missing sidecars, and scope isolation.
182185

183186
## Step 3: Create Block
184187

@@ -594,8 +597,8 @@ If creating V2 versions (API-aligned outputs):
594597
- [ ] Registered all tools in `tools/registry.ts`
595598
- [ ] Ran `bun run tool-metadata:generate` and committed the regenerated artifacts
596599
- [ ] Classified every model-visible, opaque, Sim-durable, and internal-execution request field
597-
- [ ] Added shared model-input projection, centralized opaque rejection, or private provenance only
598-
where required
600+
- [ ] Added shared model-input projection or private provenance only where required; ordinary
601+
external resource locators and control inputs retain their request semantics
599602
- [ ] Confirmed ordinary third-party tool results are not generically sanitized
600603
- [ ] Added provenance compatibility and fail-closed boundary tests where applicable
601604

.agents/skills/add-tools/SKILL.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,16 @@ export const {serviceName}{Action}Tool: ToolConfig<
150150
- Leave ordinary external API inputs and third-party results unchanged. Add provenance handling only
151151
when an exact field is proven to cross a Sim model, durable-storage, or internal-execution boundary.
152152
- Project AI-consumed text/structured fields with the smallest exact `request.modelInput` selector.
153-
- Reject resolved secrets in opaque model input sent directly to an external provider with
154-
`request.opaqueModelInput`; never attach private metadata to an external URL or `directExecution`.
155-
- For authenticated internal routes, use `privateProvenance` for opaque model input or
156-
`request.secretProvenance` for durable writes and execution handoffs. Authenticate first, validate
157-
the exact selection and scope, strip the private envelope, then import or propagate provenance at
158-
the receiving boundary. Preserve documented headerless legacy behavior.
153+
- Treat URLs, domains, resource IDs, and control fields as ordinary request values unless the exact
154+
field is proven model-visible. For serialized external model content, project the serialized
155+
top-level param through `request.modelInput` before the existing formatter parses it; do not add a
156+
separate hard-rejection mechanism.
157+
- For authenticated internal routes, use `privateProvenance` for actual inline/raw model bytes or
158+
`request.secretProvenance` for durable writes and execution handoffs. Do not treat a storage key,
159+
path, signed URL, or remote URL as provenance for fetched bytes; authorize tracked stored bytes at
160+
the owning model-egress boundary. Authenticate first, validate the exact selection and scope,
161+
strip the private envelope, then import or propagate provenance at the receiving boundary.
162+
Preserve documented headerless legacy behavior.
159163
- Never substitute secret plaintext into source, serialize plaintext provenance, hand-roll private
160164
headers, or blanket-sanitize tool results.
161165
- Add focused tests for named projection, identical unproven public text, malformed/incomplete

.agents/skills/validate-integration/SKILL.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -141,21 +141,25 @@ search, extraction, or "AI-powered" marketing terminology.
141141

142142
- [ ] AI-consumed text/structured fields use `request.modelInput` with `mode: 'project'` and a
143143
minimal exact selector; nested/JSON-string adapters preserve shape through `applyProjected`
144-
- [ ] Opaque AI-consumed values sent directly to an external provider or `directExecution` use
145-
`request.opaqueModelInput` with `mode: 'reject-resolved-secrets'` and an exact effective-value
146-
selector; the central executor rejects incomplete/secret-bearing committed provenance before
147-
formatting or I/O, leaves safe bytes unchanged, and sends no provenance metadata externally
148-
- [ ] Opaque AI-consumed files/bytes/URLs owned by an authenticated internal route use
144+
- [ ] Ordinary external URLs, domains, resource IDs, and control fields retain normal request
145+
semantics unless the exact field is proven model-visible; an AI-backed provider or later model
146+
processing of the referenced resource is not sufficient evidence
147+
- [ ] Serialized content proven to be sent directly to an external model is selected by
148+
`request.modelInput`, projected before the existing formatter parses it, and has deterministic
149+
formatter behavior when a whole-value placeholder is invalid for the serialized grammar
150+
- [ ] Actual inline/raw AI-consumed bytes owned by an authenticated internal route use
149151
`privateProvenance` (or `mode: 'private-provenance'`), and the route validates
150-
`validateOpaqueModelInputProvenance` before any download or model call
152+
`validateOpaqueModelInputProvenance` before model egress; storage keys, paths, signed URLs,
153+
and ordinary remote URLs are not treated as byte provenance, while tracked stored bytes are
154+
authorized independently at the owning model-egress boundary
151155
- [ ] Persisted workspace-file contents are checked with the shared provenance guard only when
152156
their bytes or decoded content cross into a model/tool-result boundary; ordinary file APIs
153157
remain unchanged. Unsupported secret-bearing file paths are rejected at `file_write`
154158
- [ ] Sim-owned durable writes and internal execution handoffs that can enter workflows/models use
155159
field-scoped `request.secretProvenance`; authenticated receivers validate the exact selection
156160
and scope, strip private metadata, and persist, import, or propagate it at the owning boundary
157-
- [ ] Private provenance is never attached to external URLs or `directExecution`; those paths use
158-
centralized `opaqueModelInput` rejection when their opaque values are model-bound
161+
- [ ] Private provenance is never attached to external URLs or `directExecution`; proven
162+
model-visible external fields use projection, while other external inputs remain unchanged
159163
- [ ] No tool performs raw secret plaintext/source substitution or serializes plaintext provenance
160164
- [ ] No `transformResponse` or tool-local helper blanket-sanitizes ordinary third-party results;
161165
only execution-scoped, activated Sim provenance is projected at shared model/log boundaries
@@ -166,10 +170,9 @@ search, extraction, or "AI-powered" marketing terminology.
166170
metadata, provider results, or API payloads
167171
- [ ] Diagnostic projection is applied only to values carrying execution-scoped provenance;
168172
ordinary provider responses, filenames, URLs, and errors are unchanged
169-
- [ ] Tests cover named `{{NAME}}` projection, unproven identical public text, nested shape
170-
preservation, malformed/incomplete metadata, centralized opaque rejection before formatting
171-
or I/O with safe-byte preservation, headerless legacy requests, metadata stripping, and
172-
durable legacy/stale/scope cases when applicable
173+
- [ ] Tests cover named `{{NAME}}` projection, unproven identical public text, nested and serialized
174+
shape handling, unchanged ordinary external inputs, malformed/incomplete metadata, headerless
175+
legacy requests, metadata stripping, and durable legacy/stale/scope cases when applicable
173176

174177
Treat a missing or bypassed model, durable, or internal-execution provenance boundary as
175178
**critical**. Do not fix it with a tool-specific string replacer or by sanitizing every provider
@@ -348,8 +351,7 @@ Group findings by severity:
348351
- Service-account metadata disagrees with the canonical OAuth service configuration
349352
- `tools.config.tool` returning wrong tool ID for an operation
350353
- Type coercions in `tools.config.tool` instead of `tools.config.params`
351-
- AI-consumed request fields bypass the shared projection, centralized opaque rejection, or
352-
private-provenance boundary
354+
- Proven model-visible request fields bypass the shared projection or private-provenance boundary
353355
- Opaque model input is downloaded or sent before provenance and workspace-file checks
354356
- A Sim-owned durable sink or internal execution handoff drops encrypted provenance or breaks
355357
legacy headerless/`NULL` data

.claude/commands/add-integration.md

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -130,20 +130,24 @@ service's official documentation or an unambiguous local execution path proves t
130130
field is consumed by an AI model. If that cannot be established, preserve existing tool behavior
131131
and leave the field unannotated.
132132

133-
- **Ordinary provider/API input:** leave it unchanged. Do not add blanket result sanitization.
133+
- **Ordinary provider/API input:** leave it unchanged. Explicit `{{...}}` references resolve and are
134+
sent with their normal request semantics. A URL, domain, resource ID, control field, or opaque
135+
payload is not model-visible merely because the provider is AI-backed or may process the
136+
referenced resource later.
134137
- **Text or structured content consumed by an AI model:** declare `request.modelInput` with
135138
`mode: 'project'` and select only the exact model-visible fields. The shared executor replaces
136139
activated Sim secrets with canonical `{{NAME}}` labels before request formatting. For nested or
137140
JSON-string fields, use a small shared selector plus `applyProjected`; verify that selecting the
138141
rebuilt params reproduces the projected selection.
139-
- **Opaque model input sent directly to an external provider** such as a model-read URL or image
140-
payload: declare `request.opaqueModelInput` with `mode: 'reject-resolved-secrets'` and select only
141-
the exact effective value. The shared `executeTool` preflight rejects incomplete or secret-bearing
142-
committed provenance before URL/body formatting or network I/O, preserves safe request bytes,
143-
and sends no provenance metadata to the provider.
144-
- **Opaque model input owned by an authenticated internal route** such as uploaded audio, image,
145-
video, file bytes, or signed URLs: add `privateProvenance` to a projected request, or use
146-
`mode: 'private-provenance'` when there is no textual projection. The route must call
142+
- **Serialized model content sent directly to an external provider:** include the serialized
143+
top-level param in `request.modelInput`. Project the private copy before the existing request
144+
formatter parses it; keep formatter behavior deterministic when a whole-value placeholder is not
145+
valid in the serialized grammar. Do not introduce a second hard-rejection path.
146+
- **Opaque model input owned by an authenticated internal route** such as inline audio, image,
147+
video, or document bytes: add `privateProvenance` to a projected request, or use
148+
`mode: 'private-provenance'` when there is no textual projection. Do not select storage keys,
149+
paths, signed URLs, or ordinary remote URLs as byte provenance; the owning route must authorize
150+
stored bytes independently at model egress. The route must call
147151
`validateOpaqueModelInputProvenance` before downloading or sending content to the model and must
148152
apply the workspace-file provenance guard before reading a persisted workspace file.
149153
- **Sim-owned durable storage or internal execution handoff** that can later enter a workflow/model
@@ -159,9 +163,9 @@ Hard rules:
159163
- Never substitute secret plaintext into source or serialize plaintext provenance.
160164
- Never hand-roll private provenance headers/envelopes; the shared `executeTool` boundary owns
161165
transport and strips private metadata from functional results.
162-
- Never attach private provenance to an external URL or to `directExecution`. Use the centralized
163-
`opaqueModelInput` rejection mode for external/direct opaque model inputs, or an authenticated
164-
internal route when encrypted provenance must cross the boundary.
166+
- Never attach private provenance to an external URL or to `directExecution`. Project proven
167+
model-visible external fields with `request.modelInput`; otherwise preserve ordinary request
168+
semantics. Use an authenticated internal route when encrypted provenance must cross the boundary.
165169
- Never sanitize arbitrary third-party tool results. Projection applies only to secrets activated
166170
by Sim's resolved-secret provenance for that execution/tool call.
167171
- Do not add provenance merely because a value is persisted, returned by a tool, or appears in a
@@ -172,12 +176,11 @@ Hard rules:
172176
provider responses, filenames, URLs, and errors remain unchanged when Sim did not resolve a
173177
secret into them.
174178

175-
Add focused tests covering named projection, ordinary identical text without provenance, nested
176-
shape preservation, malformed/incomplete private metadata failing closed, centralized external
177-
opaque rejection before formatting/I/O without byte changes or metadata transport, headerless
178-
legacy requests, and absence of private metadata in the public tool result. For durable sinks, also
179-
cover legacy `NULL` markers, exact-empty new writes, tracked secret writes, stale/missing sidecars,
180-
and scope isolation.
179+
Add focused tests covering named projection, ordinary identical text without provenance, nested and
180+
serialized shape handling, unchanged ordinary external inputs, malformed/incomplete private metadata
181+
failing closed, headerless legacy requests, and absence of private metadata in the public tool result.
182+
For durable sinks, also cover legacy `NULL` markers, exact-empty new writes, tracked secret writes,
183+
stale/missing sidecars, and scope isolation.
181184

182185
## Step 3: Create Block
183186

@@ -593,8 +596,8 @@ If creating V2 versions (API-aligned outputs):
593596
- [ ] Registered all tools in `tools/registry.ts`
594597
- [ ] Ran `bun run tool-metadata:generate` and committed the regenerated artifacts
595598
- [ ] Classified every model-visible, opaque, Sim-durable, and internal-execution request field
596-
- [ ] Added shared model-input projection, centralized opaque rejection, or private provenance only
597-
where required
599+
- [ ] Added shared model-input projection or private provenance only where required; ordinary
600+
external resource locators and control inputs retain their request semantics
598601
- [ ] Confirmed ordinary third-party tool results are not generically sanitized
599602
- [ ] Added provenance compatibility and fail-closed boundary tests where applicable
600603

0 commit comments

Comments
 (0)