Skip to content

Commit ad89acd

Browse files
authored
v0.9.61: slack and gitlab search results, resume loop fix
2 parents 1aa8c20 + afa8df6 commit ad89acd

20 files changed

Lines changed: 425 additions & 79 deletions

File tree

‎.github/CI.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ The `changes` job runs Turborepo 2.11.10's `affectedTasks` query before installi
44

55
A PR compares the checked-out GitHub merge commit with its first parent: the actual target revision tested by that merge. The PR event's base SHA can become stale when the target advances. Scoping requires a matching GitHub merge ref and SHA, exactly two merge parents, and a usable target parent; otherwise every check runs. This works with the existing depth-two checkout without fetching older ancestry. Main/staging pushes execute all checks; the parent `ci` workflow skips checks on `dev` pushes, while PRs targeting `dev` still run checks. A manual `checks` run executes all checks unless supplied a full base commit SHA to reproduce a scoped plan. Missing history, an empty diff, unknown files outside the workspace graph, root script/CI changes, or a planner error run every check. Missing selection outputs fail the aggregate gate. The gate also rejects an omitted dependency, any failed/cancelled job, and any skip that its explicit selection flag did not authorize.
66

7+
Changes exclusively to the reviewed library-content or utils-enforcement audit scripts and their adjacent tests run the always-on lint/audit job and a separate job for the complete root script test suite. The lint job defaults to Blacksmith; the root test job uses one GitHub runner. They do not change application runtime. Mixed changes, deleted inputs, unknown scripts, and CI or generator changes retain full fallback. The attribution artifact records this explicit audit-only owner.
8+
79
Dedicated docs verification uses the same planner, comparing pushes with their previous commit and PRs with the tested merge's first parent. Site acceptance follows `docs#build` and its transitive package dependencies. The app's docs-consumer task depends on server runtime and that docs build: backend-only changes run the platform consumer against the docs app, while site changes also run corpus and browser checks. Standalone package and unit-only edits skip those production jobs. The required `docs HTTP` gate verifies explicit site/platform selections before accepting any skip.
810

911
Docs production builds run once and publish an artifact to isolated HTTP, corpus, Chromium, and WebKit jobs. Source checks keep their own checkout because generator verification mutates inputs. Content caches use separate lint/source/build namespaces; generation validates every restore, repairs missing declarations, and removes obsolete modules. The Next build cache keeps its supported incremental behavior. Content and Next caches have size limits, and Next cache files expire after seven days; successful content eviction happens after all consumers finish.

‎apps/sim/app/(landing)/comparisons/utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export function buildComparisonFaqs(competitor: CompetitorProfile): ComparisonFa
164164
},
165165
{
166166
question: `Can I migrate from ${name} to Sim?`,
167-
answer: `There is no automated one-click migration tool between ${name} and Sim. Workflows and automations need to be rebuilt in Sim's visual builder, natural-language Chat surface, or API. Most teams start by recreating their highest-value automation first to validate the switch before migrating the rest.`,
167+
answer: `There is no automated one-click migration tool between ${name} and Sim. Workflows and automations need to be rebuilt in Sim's visual builder, natural-language Chat surface, or API. Most teams start by recreating their highest-value automation first to validate the switch before migrating the rest.${competitor.migrationSteps ? ` ${competitor.migrationSteps}` : ''}`,
168168
},
169169
]
170170

‎apps/sim/executor/utils/subflow-node-id-codec.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,13 @@ export function normalizeLookupId(id: string): string {
247247
return id.replace(BRANCH.SUFFIX_GLOBAL, '').replace(LOOP_DIGEST.STRIP, '')
248248
}
249249

250+
/**
251+
* Strips loop digests (`_loopN`) from an ID, e.g. a pause context ID scoped to a loop iteration.
252+
*/
253+
export function stripLoopDigest(id: string): string {
254+
return id.replace(LOOP_DIGEST.STRIP, '')
255+
}
256+
250257
/**
251258
* Returns the leading branch subscript (`₍N₎`) of a node ID, or '' when absent.
252259
*/

‎apps/sim/lib/compare/data/competitors/langchain.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export const langchainProfile: CompetitorProfile = {
88
mentions: ['LangChain', 'LangGraph'],
99
website: 'https://www.langchain.com',
1010
isWorkflowBuilder: false,
11+
migrationSteps:
12+
'Start with one representative agent. Write down its inputs, model calls, tools, and decision points. Map the chain or agent logic into a Sim workflow, then compare its output with the existing prototype. Add a Human in the Loop block wherever a person must approve an action, use run logs to inspect each step, and choose Sim cloud or self-hosting once the workflow behaves as expected.',
1113
brand: {
1214
icon: LangChainIcon,
1315
selfFramed: false,

‎apps/sim/lib/compare/data/sim.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,14 +472,14 @@ export const simProfile: CompetitorProfile = {
472472
},
473473
humanInTheLoop: {
474474
value:
475-
'Yes: dedicated approval block that pauses a run and waits for a human-submitted "Resume Form," with durable pause/resume via persisted execution snapshots and notification hooks (e.g. Slack, email) carrying the resume link',
475+
'Yes: dedicated approval block that pauses a run and waits for a human-submitted "Resume Form," with durable pause/resume via persisted execution snapshots. Reviewers can be notified through Slack, Gmail, Microsoft Teams, Twilio SMS, or a webhook carrying the approval link, and approve in the Sim approval portal or through the resume API, after which the run continues',
476476
shortValue: 'Approval block with durable pause/resume and notifications',
477477
confidence: 'verified',
478478
sources: [
479479
{
480480
url: 'https://docs.sim.ai/workflows/blocks/human-in-the-loop',
481481
label: 'Sim Docs: Human in the Loop Block',
482-
asOf: '2026-07-02',
482+
asOf: '2026-11-16',
483483
},
484484
{
485485
url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/executor/execution/snapshot.ts',

‎apps/sim/lib/compare/data/types.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,11 @@ export interface CompetitorProfile {
305305
* products so it can be quoted on its own.
306306
*/
307307
faqs?: Array<{ question: string; answer: string }>
308+
/**
309+
* Concrete evaluation steps appended to the generated "Can I migrate from {name} to Sim?"
310+
* answer, for a competitor whose teams switch by rebuilding a prototype rather than importing it.
311+
*/
312+
migrationSteps?: string
308313
/**
309314
* Replaces the generated `Sim vs {name} | Sim, the AI Workspace` search title, at most 60
310315
* characters. Set it when buyers search this competitor for one time-sensitive reason, such

‎apps/sim/lib/knowledge/__integration__/gitlab-group.integration.ts‎

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ describe('GitLab group Search permission boundary', () => {
5555
let moved = false
5656
let failedDiscovery = false
5757
let added = false
58+
let aliceLegacyResult: { documentId: string } | undefined
5859
let confidential = false
5960
let providerState = 'healthy'
6061
const checks: string[] = []
@@ -259,7 +260,7 @@ describe('GitLab group Search permission boundary', () => {
259260
boundary:
260261
'Application use cases, real PostgreSQL and HTTP GitLab API fixture; TLS/SSRF transport substituted',
261262
checks,
262-
passed: checks.length === 10,
263+
passed: checks.length === 11,
263264
},
264265
null,
265266
2
@@ -433,9 +434,8 @@ describe('GitLab group Search permission boundary', () => {
433434
input: { organizationId: ids.organizationId, sourceId: legacyId },
434435
})
435436
expect(legacyRevision).toEqual({ revision: 1 })
436-
expect(
437-
(await search(ids.aliceId, '11', undefined, 20, legacyId)).results.length
438-
).toBeGreaterThan(0)
437+
aliceLegacyResult = (await search(ids.aliceId, '11', undefined, 20, legacyId)).results[0]
438+
expect(aliceLegacyResult).toBeDefined()
439439
await replaceSearchSourcePermissions.execute({
440440
principal: principal(ids.aliceId),
441441
input: {
@@ -461,6 +461,33 @@ describe('GitLab group Search permission boundary', () => {
461461
checks.push('Atomic group refresh, revocation and existing source preservation')
462462
})
463463

464+
it('leaves a source out of the searches of a reader its uploaded permissions no longer grant', async () => {
465+
const accounts = async (userId: string) =>
466+
(
467+
await searchLiveKnowledge.execute({
468+
principal: principal(userId),
469+
input: {
470+
organizationId: ids.organizationId,
471+
query: 'Atlas',
472+
topK: 20,
473+
filters: { source: 'gitlab' },
474+
resultSecretRegistry: new ResolvedSecretTraceRegistry(),
475+
},
476+
})
477+
).live?.accounts ?? []
478+
const alice = await accounts(ids.aliceId)
479+
expect(alice.map((account) => account.accountId)).toEqual([`gitlab-source:${sourceId}`])
480+
expect(alice.every((account) => account.status === 'ok')).toBe(true)
481+
expect(new Set((await accounts(ids.bobId)).map((account) => account.accountId))).toEqual(
482+
new Set([`gitlab-source:${sourceId}`, `gitlab-source:${legacyId}`])
483+
)
484+
if (!aliceLegacyResult) throw new Error('Missing result found before revocation')
485+
await expect(read(ids.aliceId, aliceLegacyResult.documentId)).rejects.toThrow(
486+
'This GitLab source is not available to your account.'
487+
)
488+
checks.push('Sources granting the reader nothing are left out of their searches')
489+
})
490+
464491
it('preserves all grants on discovery failure and admits only one concurrent revision', async () => {
465492
failedDiscovery = true
466493
await expect(replace(2)).rejects.toMatchObject({ code: 'validation' })

‎apps/sim/lib/knowledge/connectors/permission-store.ts‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,28 @@ export async function hasConnectorPermissionGrant(
3737
return Boolean(grant)
3838
}
3939

40+
/** The connectors among `connectorIds` that grant the reader's subject at least one collection. */
41+
export async function connectorsGrantingSubject(
42+
connectorIds: readonly string[],
43+
subjectToken: string
44+
): Promise<Set<string>> {
45+
const table = knowledgeConnectorPermissionGrant
46+
const granted = new Set<string>()
47+
for (let offset = 0; offset < connectorIds.length; offset += 1000) {
48+
const rows = await db
49+
.selectDistinct({ connectorId: table.connectorId })
50+
.from(table)
51+
.where(
52+
and(
53+
eq(table.subjectToken, subjectToken),
54+
inArray(table.connectorId, connectorIds.slice(offset, offset + 1000))
55+
)
56+
)
57+
for (const row of rows) granted.add(row.connectorId)
58+
}
59+
return granted
60+
}
61+
4062
/** Returns grants only for the bounded, canonical collections requested by the authorized caller. */
4163
export async function readConnectorPermissionGrants(
4264
connectorId: string,

‎apps/sim/lib/sim-search/live/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This describes the live enterprise-search path. Credential Groups and ordinary k
77
- **Sources** controls integration availability and account mode per integration.
88
- **Member accounts** has no resource configuration. A member connects their own account under Integrations, and searches content that account can access through the provider API. A member can add several accounts of one provider, such as Google Drive in two tenants; each is searched and cited separately, and every search counts them toward its account limit. Old member resource filters are ignored and cleared when settings are saved.
99
- **Service account** selects an admin-managed source. Its connection owns the resource settings; Sources does not duplicate them. GitHub uses one GitHub App source per repository instead of a single selected source. A member still connects their own account, except for GitLab. Search returns the intersection of the member's provider permissions and the source's current resource boundary.
10-
- GitLab is always service-account mode. Slack and Jira currently support member mode only.
10+
- GitLab is always service-account mode. A source whose uploaded CSV permissions grant the member no project is left out of their searches rather than reported unavailable on each one; a source checked against GitLab itself stays listed and its session decides. Slack and Jira currently support member mode only.
1111
- Removing a source integration prevents subsequent account resolution, searches, and reads. Paused, archived, deleted, wrong-organization, wrong-provider, and unapproved service sources cannot authorize search.
1212

1313
The Search assistant exposes the dedicated search/read tools. It cannot discover or execute integration tools through `search_integration_tools`, `call_integration_tool`, or direct provider-tool names. The broader assistant outside Search retains its integration tools.
@@ -58,7 +58,7 @@ Each event must exist under the source's delegated token, be in an allowed calen
5858

5959
### Slack
6060

61-
Member mode only. Search uses the connected user's Slack real-time search grant and provider search syntax. Date bounds are sent as numeric provider timestamps; date ordering selects keyword retrieval and timestamp sort, because Slack semantic retrieval uses relevance ordering. Channels, messages, direct messages, and files are limited by that grant and provider scopes; there is no admin channel filter in member mode. Missing required search scopes produce a reconnect status. Thread/file reads use the same connected identity. A file read downloads the full text of a canvas (HTML), text snippet, PDF or DOCX from `files.slack.com` only, using `url_private_download` when present (Slack redirects a PDF's `url_private` to a viewer on another domain), never a remote file's own URL (redirects are followed only within that host; a hop elsewhere, such as a sign-in page, keeps the preview), within the shared response-size limit; when Slack will not serve it, the read returns the `files.info` preview. Real-time Search returns at most 20 results a call and counts every page against the member's rate limit, so a search across every source reads one page; a Slack-scoped or native Slack search follows the cursor for up to three pages to fill its limit, and a later page that fails keeps the earlier pages and returns the unread cursor.
61+
Member mode only. Search uses the connected user's Slack real-time search grant and provider search syntax. Date bounds are sent as numeric provider timestamps; date ordering selects keyword retrieval and timestamp sort, because Slack semantic retrieval uses relevance ordering. Channels, messages, direct messages, and files are limited by that grant and provider scopes; there is no admin channel filter in member mode. Missing required search scopes produce a reconnect status. Thread/file reads use the same connected identity. Real-time Search returns only a file's title for a file hit, so the hit names the file's type and size and whether a read can return its text. A file read downloads the full text of a canvas (HTML), text snippet, PDF or DOCX from `files.slack.com` only, using `url_private_download` when present (Slack redirects a PDF's `url_private` to a viewer on another domain), never a remote file's own URL (redirects are followed only within that host; a hop elsewhere, such as a sign-in page, keeps the preview), within the shared response-size limit; when Slack will not serve it, the read returns the `files.info` preview. Real-time Search returns at most 20 results a call and counts every page against the member's rate limit, so a search across every source reads one page; a Slack-scoped or native Slack search follows the cursor for up to three pages to fill its limit, and a later page that fails keeps the earlier pages and returns the unread cursor.
6262

6363
### GitHub
6464

‎apps/sim/lib/sim-search/live/accounts.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const hoisted = vi.hoisted(() => ({
2222
}))
2323
vi.mock('@/lib/knowledge/search/integration-policy', () => knowledgeSearchIntegrationPolicyMock)
2424
vi.mock('@/lib/sim-search/live/gitlab-admin', () => ({
25+
isAdminGitLabAccountId: (accountId: string) => accountId.startsWith('gitlab-source:'),
2526
listAdminGitLabAccounts: hoisted.admin,
2627
resolveAdminGitLabAccount: hoisted.resolveAdmin,
2728
}))

0 commit comments

Comments
 (0)