Skip to content

Commit 3112afc

Browse files
committed
fix(tests): address review — mock fidelity, docs, and guards
1 parent 4d424b0 commit 3112afc

27 files changed

Lines changed: 256 additions & 136 deletions

File tree

‎.agents/skills/add-block/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -910,8 +910,8 @@ when the block has no operation dropdown).
910910

911911
**The full authoring contract — voice, structure, and the four mistakes that break
912912
cards silently — is `apps/sim/blocks/AGENTS.md` → "Canvas sentences". Read it
913-
before writing any.** The two failures worth repeating here, because both are
914-
invisible at runtime:
913+
before writing any.** Two of those four are worth repeating here, because both
914+
are invisible at runtime:
915915

916916
1. A clause naming only one member of a `canonicalParamId` pair drops the sentence
917917
for every advanced-mode user. List all members:

‎.agents/skills/add-managed-cli/SKILL.md‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ bun run --cwd apps/sim test \
116116
lib/execution/remote-sandbox/cli-tools-boundary.test.ts \
117117
lib/execution/remote-sandbox/sandbox-spec.test.ts \
118118
lib/execution/remote-sandbox/resolve.test.ts \
119-
lib/api/contracts/sandboxes.test.ts \
120-
'app/workspace/[workspaceId]/settings/components/sandboxes/utils.test.ts' \
121-
'app/workspace/[workspaceId]/settings/components/sandboxes/components/sandbox-editor.test.tsx'
119+
'app/workspace/[workspaceId]/settings/components/sandboxes/utils.test.ts'
122120
```
123121

124122
From the repository root:

‎.agents/skills/migrate-application-operation/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ Stop and report a missing design rather than weakening identity, authorization,
319319

320320
Run the `test-audit` authoring gate before writing any test. Own each risk at exactly one boundary:
321321

322-
- Application use-case tests own authorization, principal-kind rejection before canonical loading, workspace assertion mismatch, delegated scope, not found, conflict, no-op, and audit derived from authoritative results.
322+
- Application use-case tests own authorization, principal-kind rejection before canonical loading, workspace assertion mismatch, delegated scope, not found, conflict, no-op, audit derived from authoritative results, and infrastructure failures (storage, rate-limit, provider, or database errors raised by delegated services) propagating as 5xx-mapped errors — never converted to not-found or forbidden.
323323
- One `*.integration.ts` owns repository semantics: canonical active lookup, workspace-predicated writes, archived resources, authoritative affected rows, and database error propagation.
324324
- Add a surface test only for a surface-specific risk (for example, a v2 envelope or rate header, a Copilot forged-scope rejection, or a legacy redirect/cookie behavior the characterization baseline pinned). Do not restate the operation registry or the shared builders' auth-before-parse behavior per surface.
325325

‎.agents/skills/ship/SKILL.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ When the user runs `/ship`:
1818
- If the working tree has uncommitted changes, stash them first so the rebase below isn't blocked by dirty state, and pin the entry by SHA — the stash list is shared across every worktree of the repo, so `stash@{0}` and `git stash pop` can grab another session's entry:
1919
```bash
2020
git stash push -u -m ship-sync-fix && SHIP_STASH=$(git rev-parse 'stash@{0}')
21-
# once the branch is fixed:
21+
# once the branch is fixed (`git stash drop` rejects a raw SHA, so resolve the pinned
22+
# entry's current stash@{n} and drop only that; an empty lookup drops nothing):
2223
git stash apply "$SHIP_STASH" &&
23-
git stash list --format='%gd %H' | awk -v s="$SHIP_STASH" '$2==s{print $1}' | xargs git stash drop
24+
SHIP_STASH_REF=$(git stash list --format='%gd %H' | awk -v s="$SHIP_STASH" '$2==s{print $1}') &&
25+
{ [ -z "$SHIP_STASH_REF" ] || git stash drop "$SHIP_STASH_REF"; }
2426
```
2527
- Try `git rebase origin/staging` first.
2628
- **A rebase finishing without conflicts does NOT by itself mean the branch is clean** — it can replay stray commits onto the new base with no conflict at all. After the rebase (clean or not), re-run `git log --oneline origin/staging..HEAD` and re-check the commit list against what you recognize.

‎.claude/rules/landing-seo-geo.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ paths:
2323

2424
- **Answer-first pattern**: each section's H2 + first paragraph directly answers a question a user would ask an AI ("What is Sim?", "What integrations does Sim support?", "How much does Sim cost?").
2525
- **Atomic answer blocks**: every feature card, template, and pricing tier is independently quotable — self-contained, with "Sim" named explicitly. Never "the platform", "our tool", or a bare pronoun as the subject.
26-
- **Keyword density**: the first 150 visible characters of the hero name "AI workspace" and "AI agents". "Sim" is carried by the title tag, the meta description, and the hero `sr-only` summary.
27-
- **sr-only summaries**: the hero (and Templates) each carry a `<p className="sr-only">` (~50 words) stating what Sim is, who it's for, and what it does — a clean citation target for AI summarizers. The hero's opens by naming Sim.
26+
- **Keyword density**: the hero's `sr-only` summary is the first text in the hero's DOM, so its first 150 characters name "Sim", "AI workspace", and "AI agents" for crawlers. The visible headline and description name "AI agents" (not "AI workspace" or "Sim"); "Sim" is otherwise carried by the title tag and the meta description.
27+
- **sr-only summaries**: the hero (and Templates) each carry a `<p className="sr-only">` (~50 words) stating what Sim is, who it's for, and what it does — a clean citation target for AI summarizers. The hero's summary opens by naming Sim.
2828
- **Specific numbers**: concrete figures ("1,000+ integrations", "every major LLM", "100,000+ builders") over vague claims — and only numbers that are true and shipped.
2929

3030
## Citations and linking (`/library`, `/blog`, `/comparisons`)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ holds live values, so per-keystroke edits don't re-render the canvas. Rules that
7979
this split correct:
8080

8181
- The structure's `subBlocks[*].value` is stale after any edit. Never read it directly
82-
for a current value — merge via `mergeSubblockState`/`mergeSubblockStateWithValues`
83-
(single implementation in `@sim/workflow-persistence/subblocks`) or read the
84-
subblock store. Exception: condition/router dynamic-handle subblocks dual-write the
82+
for a current value — merge via `mergeSubblockState` (`@/stores/workflows/utils`,
83+
which reads the subblock store) or `mergeSubblockStateWithValues` (the single merge
84+
implementation, in `@sim/workflow-persistence/subblocks`), or read the subblock store. Exception: condition/router dynamic-handle subblocks dual-write the
8585
structure (`syncDynamicHandleSubblockValue`) and may be read from either source.
8686
- Merge semantics are tri-state: a key present in the subblock store wins — including
8787
`null`, which means "explicitly cleared". Absent/`undefined` falls back to the

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ the report.
7272
### Structure
7373

7474
```typescript
75-
import { authMockFns, createMockRequest } from '@sim/testing'
75+
import { authMockFns } from '@sim/testing/mocks/auth.mock'
76+
import { createMockRequest } from '@sim/testing/mocks/request.mock'
7677
import { describe, expect, it } from 'vitest'
7778
import { GET } from '@/app/api/my-route/route'
7879

‎.cursor/rules/landing-seo-geo.mdc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ globs: ["apps/sim/app/(landing)/**/*.tsx","apps/sim/content/**/*.mdx"]
2323

2424
- **Answer-first pattern**: each section's H2 + first paragraph directly answers a question a user would ask an AI ("What is Sim?", "What integrations does Sim support?", "How much does Sim cost?").
2525
- **Atomic answer blocks**: every feature card, template, and pricing tier is independently quotable — self-contained, with "Sim" named explicitly. Never "the platform", "our tool", or a bare pronoun as the subject.
26-
- **Keyword density**: the first 150 visible characters of the hero name "AI workspace" and "AI agents". "Sim" is carried by the title tag, the meta description, and the hero `sr-only` summary.
27-
- **sr-only summaries**: the hero (and Templates) each carry a `<p className="sr-only">` (~50 words) stating what Sim is, who it's for, and what it does — a clean citation target for AI summarizers. The hero's opens by naming Sim.
26+
- **Keyword density**: the hero's `sr-only` summary is the first text in the hero's DOM, so its first 150 characters name "Sim", "AI workspace", and "AI agents" for crawlers. The visible headline and description name "AI agents" (not "AI workspace" or "Sim"); "Sim" is otherwise carried by the title tag and the meta description.
27+
- **sr-only summaries**: the hero (and Templates) each carry a `<p className="sr-only">` (~50 words) stating what Sim is, who it's for, and what it does — a clean citation target for AI summarizers. The hero's summary opens by naming Sim.
2828
- **Specific numbers**: concrete figures ("1,000+ integrations", "every major LLM", "100,000+ builders") over vague claims — and only numbers that are true and shipped.
2929

3030
## Citations and linking (`/library`, `/blog`, `/comparisons`)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ holds live values, so per-keystroke edits don't re-render the canvas. Rules that
7979
this split correct:
8080

8181
- The structure's `subBlocks[*].value` is stale after any edit. Never read it directly
82-
for a current value — merge via `mergeSubblockState`/`mergeSubblockStateWithValues`
83-
(single implementation in `@sim/workflow-persistence/subblocks`) or read the
84-
subblock store. Exception: condition/router dynamic-handle subblocks dual-write the
82+
for a current value — merge via `mergeSubblockState` (`@/stores/workflows/utils`,
83+
which reads the subblock store) or `mergeSubblockStateWithValues` (the single merge
84+
implementation, in `@sim/workflow-persistence/subblocks`), or read the subblock store. Exception: condition/router dynamic-handle subblocks dual-write the
8585
structure (`syncDynamicHandleSubblockValue`) and may be read from either source.
8686
- Merge semantics are tri-state: a key present in the subblock store wins — including
8787
`null`, which means "explicitly cleared". Absent/`undefined` falls back to the

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ the report.
7070
### Structure
7171

7272
```typescript
73-
import { authMockFns, createMockRequest } from '@sim/testing'
73+
import { authMockFns } from '@sim/testing/mocks/auth.mock'
74+
import { createMockRequest } from '@sim/testing/mocks/request.mock'
7475
import { describe, expect, it } from 'vitest'
7576
import { GET } from '@/app/api/my-route/route'
7677

0 commit comments

Comments
 (0)