Skip to content

Commit c40cf93

Browse files
committed
merge: synchronize project file core with staging fixes
2 parents c7a8ea9 + 6b0c69e commit c40cf93

195 files changed

Lines changed: 35284 additions & 2266 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.

‎.claude/rules/sim-testing.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ screenshot. Write it to a caller-supplied path (`<SUITE>_REPORT_PATH`) and have
6565
disposable, seeds with SQL, exercises the real HTTP boundary, cleans up its fixtures, and writes
6666
the report.
6767

68+
## Flaky tests
69+
70+
A daily job (`.github/workflows/ci-flakes.yml`) files a `ci-flake` issue for every test or job
71+
that failed on a CI attempt and passed when the same commit was re-run, and reopens it if the
72+
flake recurs after it was closed. Fix the nondeterminism it names: pin the clock
73+
(`vi.useFakeTimers({ toFake: ['Date'] })` + `vi.setSystemTime`), give each test its own ids and
74+
rows, wait on the condition rather than a delay, and keep cold imports out of a test's timeout by
75+
importing statically. Never add a retry, a skip, or a longer timeout to make one pass; raise a
76+
budget only when its run history shows the budget itself is wrong, and record that evidence
77+
beside it.
78+
6879
## Unit test mechanics
6980

7081
### Structure

‎.cursor/rules/sim-testing.mdc‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,17 @@ screenshot. Write it to a caller-supplied path (`<SUITE>_REPORT_PATH`) and have
6363
disposable, seeds with SQL, exercises the real HTTP boundary, cleans up its fixtures, and writes
6464
the report.
6565

66+
## Flaky tests
67+
68+
A daily job (`.github/workflows/ci-flakes.yml`) files a `ci-flake` issue for every test or job
69+
that failed on a CI attempt and passed when the same commit was re-run, and reopens it if the
70+
flake recurs after it was closed. Fix the nondeterminism it names: pin the clock
71+
(`vi.useFakeTimers({ toFake: ['Date'] })` + `vi.setSystemTime`), give each test its own ids and
72+
rows, wait on the condition rather than a delay, and keep cold imports out of a test's timeout by
73+
importing statically. Never add a retry, a skip, or a longer timeout to make one pass; raise a
74+
budget only when its run history shows the budget itself is wrong, and record that evidence
75+
beside it.
76+
6677
## Unit test mechanics
6778

6879
### Structure

‎.github/scripts/http-e2e.sh‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
# The job provides DATABASE_URL, BETTER_AUTH_SECRET and ENCRYPTION_KEY; each group sets the rest of
99
# its app's environment here. Reports and server logs land in $RUNNER_TEMP/e2e.
1010
#
11-
# Under `next dev` the first request cold-compiles the app under Turbopack, which takes 42-150s on
12-
# CI runners, so the readiness deadline only has to catch a hung boot: an exited server fails
13-
# immediately, and either way the server log tail lands in the job log.
11+
# Under `next dev` the first request cold-compiles the app under Turbopack, which takes 60-185s on
12+
# a healthy CI runner and has run past 300s on a degraded one. The readiness deadline, about three
13+
# times the healthy worst case, only has to catch a hung boot: an exited server fails immediately,
14+
# and either way the server log tail lands in the job log.
1415
#
1516
# Each app starts from an empty Turbopack dev cache: a cache written under other NEXT_PUBLIC_*
1617
# values, by a server that `next dev` SIGKILLs 100ms after SIGTERM, can panic Turbopack or wedge a
@@ -21,7 +22,7 @@ set -euo pipefail
2122

2223
group=${1:?usage: http-e2e.sh <scim|cli|stop-after|desktop-inbox|project-files|mobile>}
2324
report_dir="$RUNNER_TEMP/e2e"
24-
ready_timeout_seconds=300
25+
ready_timeout_seconds=600
2526
mkdir -p "$report_dir"
2627

2728
server_pid=''

‎.github/workflows/ci-flakes.yml‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: ci-flakes
2+
3+
# Files one `ci-flake` issue per CI check that failed and then passed on a re-run of the same
4+
# commit, and reopens a closed one when its flake recurs (scripts/report-ci-flakes.ts). The
5+
# three-day lookback overlaps the daily schedule on purpose: the script skips occurrences an issue
6+
# already lists, so a missed or repeated run neither drops nor double-counts one.
7+
8+
on:
9+
schedule:
10+
- cron: '23 7 * * *'
11+
workflow_dispatch:
12+
inputs:
13+
days:
14+
description: Look back this many days of CI runs (the script's default is 3).
15+
required: false
16+
dry_run:
17+
description: Print the issues it would file or update without changing them.
18+
type: boolean
19+
required: false
20+
default: false
21+
22+
permissions:
23+
actions: read
24+
contents: read
25+
issues: write
26+
27+
concurrency:
28+
group: ci-flakes
29+
cancel-in-progress: false
30+
31+
jobs:
32+
report:
33+
name: report
34+
# GitHub-hosted: a pure API client with no dependencies, so it needs no install or cache.
35+
runs-on: ubuntu-latest
36+
timeout-minutes: 15
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
40+
with:
41+
persist-credentials: false
42+
- name: Setup Bun
43+
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
44+
with:
45+
bun-version: 1.4.2
46+
- name: Report flaky checks
47+
env:
48+
GITHUB_TOKEN: ${{ github.token }}
49+
DAYS: ${{ inputs.days }}
50+
DRY_RUN: ${{ inputs.dry_run }}
51+
run: |
52+
args=()
53+
if [ -n "$DAYS" ]; then args+=(--days "$DAYS"); fi
54+
if [ "$DRY_RUN" = true ]; then args+=(--dry-run); fi
55+
bun scripts/report-ci-flakes.ts "${args[@]}"

‎apps/docs/app/llms.txt/route.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Sim is the open-source AI workspace where teams build, deploy, and manage AI age
3737
3838
## Calling the Sim API
3939
40-
- Base URL: \`${SIM_SITE_URL}\`. Every endpoint is under \`/api\`; there is no \`api.sim.ai\` host.
40+
- Sim Cloud base URL: \`${SIM_SITE_URL}\`. For self-hosted deployments, use your deployment's origin instead, including in the example below. Every endpoint is under \`/api\`; there is no \`api.sim.ai\` host.
4141
- Run a deployed workflow: \`POST ${SIM_SITE_URL}/api/v2/workflows/{workflowId}/execute\` with a JSON body like \`{ "input": { "fieldName": "value" } }\`.
4242
- Authenticate API keys with the \`X-API-Key\` header. \`Authorization: Bearer\` accepts only Sim OAuth access tokens, never API keys.
4343
- Responses wrap the payload in \`data\`. A synchronous run returns \`200 { "data": { "runId", "status", "output", ... } }\`; with \`"async": true\` in the body it returns \`202 { "data": { "runId", "statusUrl" } }\` and you poll \`statusUrl\`.

‎apps/docs/components/ui/tabs.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function Tabs({ className, ...props }: TabsProps) {
1616
<FumadocsTabs
1717
{...props}
1818
className={cn(
19-
'min-w-0 scroll-mt-[calc(var(--fd-docs-row-3,0px)+1rem)] border-[var(--border)] [&>[role=tablist]>button]:font-normal! max-sm:[&>[role=tablist]>button]:min-h-11 [&>[role=tablist]]:min-w-0 [&>[role=tablist]]:[scrollbar-width:thin]! max-sm:[&>[role=tablist]]:min-h-14',
19+
'min-w-0 scroll-mt-[calc(var(--fd-docs-row-3,0px)+1rem)] border-[var(--border)] [&>[role=tablist]>button]:font-normal! max-sm:[&>[role=tablist]>button]:min-h-11 [&>[role=tablist]]:min-w-0 [&>[role=tablist]]:[scrollbar-width:thin] max-sm:[&>[role=tablist]]:min-h-14',
2020
className
2121
)}
2222
/>

‎apps/docs/components/workflow-preview/workflow-preview.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ const SELECT_TITLES = new Set([
109109
'Operation',
110110
'Method',
111111
'Unit',
112+
'Event',
112113
'Event type',
113114
'Validation',
114115
'Account',

‎apps/docs/content/docs/integrations/file.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ Apply one precise edit to an existing text file without rewriting it. Use search
198198
| `anchor` | string | No | For insert_after, the complete line after which content is inserted. |
199199
| `startAnchor` | string | No | For delete_between, the complete first line to delete. The start anchor is removed. |
200200
| `endAnchor` | string | No | For delete_between, the complete ending boundary line. The end anchor remains in the file. |
201-
| `occurrence` | number | No | For anchored edits, which matching anchor occurrence to use, starting at 1. Defaults to 1. |
201+
| `occurrence` | number | No | For anchored edits, which start or insert anchor match to use, starting at 1. Defaults to 1. The end anchor is the first match after it. |
202202
| `expectedRevision` | string | No | Refuse the edit unless the file still holds the content this revision names, as returned by Get File or an earlier write. Use it so an edit computed from what you read cannot overwrite someone else’s change. |
203203

204204
#### Output

‎apps/docs/content/docs/knowledgebase/connectors.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ Images smaller than **2 KiB**, SVG, HEIC, and AVIF files are not indexed through
200200

201201
New knowledge-base Confluence connections enable image reading by default. Connections created before image support keep it off until you choose **Read with AI**; their next sync then indexes images.
202202

203-
The default admission limit is **500 new or changed images per sync**. Remaining images wait for another sync. Self-hosted operators can configure `KB_IMAGE_EXTRACTIONS_PER_SYNC`. Unchanged images reuse their extraction, including during a full resync; transient or malformed responses can cause additional model requests.
203+
The default admission limit is **500 new or changed images per sync**. Remaining images wait for another sync. With **Member accounts**, each run that continues a sync can read up to 500. Self-hosted operators can configure `KB_IMAGE_EXTRACTIONS_PER_SYNC`. Unchanged images reuse their extraction, including during a full resync; transient or malformed responses can cause additional model requests.
204204

205205
Image extraction follows [model billing](/platform/costs): BYOK usage is billed by the provider, while platform-key usage follows the deployment's Sim billing policy. Choose **Don't index** to stop image indexing; the next sync removes indexed images. Switching back processes them again and incurs the applicable model usage.
206206

‎apps/docs/content/docs/platform/self-hosting/environment-variables.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ For Ollama on the Docker host, use `OLLAMA_URL=http://host.docker.internal:11434
124124
| Variable | Description |
125125
|----------|-------------|
126126
| `KB_IMAGE_EXTRACTION_MODEL` | Gemini model that reads Confluence image attachments into searchable text. Defaults to `gemini-3.8-flash`; a value that is not a Gemini 3 or later model in the catalog falls back to the default. Needs `GEMINI_API_KEY` (or a workspace Gemini key); without one, image attachments are left out of syncs |
127-
| `KB_IMAGE_EXTRACTIONS_PER_SYNC` | New or changed images one connector sync sends for reading, at least `1`. Defaults to `500`; the rest wait for the next sync, which reports as partial |
127+
| `KB_IMAGE_EXTRACTIONS_PER_SYNC` | New or changed images one connector sync run sends for reading, at least `1`. Defaults to `500`; the rest wait for the next sync, which reports as partial. With member accounts, each continuation run can read up to this many |
128128
| `KB_CONFIG_VISION_REQUESTS_PER_MINUTE` | Image reads per minute per Gemini key, shared by every sync on the deployment. Defaults to `300`; lower it to match a key with a smaller Gemini quota |
129129
| `KB_EMBEDDING_MODEL` | Embedding model for new knowledge bases. Defaults to `text-embedding-3-small`; use `ollama/<model>` for a model on your own Ollama. An unrecognised hosted model id falls back to the default, but an `ollama/` id is taken at face value — if that model is not on the server, knowledge-base creation fails rather than falling back |
130130
| `EMBEDDING_OUTPUT_DIMS` | Stored vector width: `384`, `768`, `1024`, `1536`, or `3072`. Hosted models default to `1536` when supported, otherwise their largest storable width. Invalid hosted widths fall back with a warning; Ollama can infer its actual width when unset |

0 commit comments

Comments
 (0)