Skip to content

Commit bcb348f

Browse files
authored
v0.9.2: resource dropdown in org view, new library posts, removed unnecessary tests
2 parents ab2fe4a + 0dd4c8d commit bcb348f

5,061 files changed

Lines changed: 138659 additions & 527669 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-block/SKILL.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -902,16 +902,16 @@ Every block declares a one-line prose summary that replaces its card's field row
902902

903903
```
904904
Slack ← header (already names the block)
905-
Posts ⟨Ship it 🚀⟩ to ⟨#eng⟩ ← the sentence; ⟨…⟩ are live value chips
905+
Post ⟨Ship it 🚀⟩ to ⟨#eng⟩ ← the sentence; ⟨…⟩ are live value chips
906906
```
907907

908908
Write one `byOperation` entry per operation dropdown option (or a single `default`
909909
when the block has no operation dropdown).
910910

911-
**The full authoring contract — voice, structure, and the two mistakes that break
911+
**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-column-type/SKILL.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ Registering the *type* is compiler-enforced. Registering its *metadata* is not,
148148
- [ ] Icon added, centered on the family's optical center, exported alphabetically
149149
- [ ] `migrateCellsTo` / `migrateCellsFrom` added if the stored bytes change
150150
- [ ] New metadata keys added to `TYPE_SPECIFIC_COLUMN_KEYS` + `FOREIGN_METADATA_VERB`
151-
- [ ] Unit tests for `coerce` / `isCompatibleWith` round-trips, verified to fail without the code
151+
- [ ] Unit tests for `coerce` / `isCompatibleWith` round-trips only if they pass the `test-audit` authoring gate, verified to fail without the code
152152
- [ ] Docs row added to `apps/docs/content/docs/tables/index.mdx`
153153

154154
## Final Validation (Required)
155155

156156
1. **`cd apps/sim && bun run type-check`** — must be clean. If any file *outside* `column-types/` errors, that file has a hardcoded type list; fix it to read the registry.
157157
2. **Grep for leaks** — `grep -rnE "(===|!==) '{id}'|case '{id}':" apps/sim --include='*.ts' --include='*.tsx' | grep -v column-types/`. (All three forms: a plain `!==` and a `case` are how half of `currency`'s real branches are written.) Hits are expected; judge each. A hit is fine when it mounts a specific React component or encodes a genuinely one-off behavior (`json`'s mono textarea, `date`'s timezone-aware parsing). A hit is a **leak** when it restates something the registry could answer — an icon, a label, a colour, an operator set, a cast, a coercion. Leaks get a registry field, not a new branch.
158-
3. **Run the suite** — `bunx vitest run lib/table 'app/workspace/[workspaceId]/tables' lib/api app/api/table app/api/v1 lib/copilot/tools/server/table`. Existing tests must pass **unchanged**; needing to edit one means you changed behavior for the other types.
159-
4. **`bun run lint:check`, `bun run check:api-validation`, `bun run check:client-boundary`** from the repo root.
158+
3. **Run the suite** — `bun run --cwd apps/sim test lib/table 'app/workspace/[workspaceId]/tables' lib/api app/api/table app/api/v1 lib/copilot/tools/server/table`. Existing tests must pass **unchanged**; needing to edit one means you changed behavior for the other types.
159+
4. **`bun run lint`, `bun run check:api-validation`, `bun run check:client-boundary`** from the repo root.
160160
5. **Exercise it in the running app** on a table with one column of every type: create, edit inline / in the expanded popover / in the row modal, paste from a spreadsheet, filter, sort, convert to and from other types, export CSV, undo a column delete.

‎.agents/skills/add-feature-flag/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ Critically, **none of this is expressible in code** — gating (especially `admi
8383

8484
4. **(Prod) configure in AppConfig.** The infra `feature-flags` profile schema is permissive, so a new flag needs **no infra change**. Operators add the flag to the hosted `feature-flags` document using `enabled` for global rollout or only the selected `workspaceIds`/`orgIds`/`userIds`/`adminEnabled` clauses for scoped rollout, then start a `sim-<env>-fast` deployment (see the AppConfig runbook in the infra README — same flow as `access-control`). The fallback secret only applies when AppConfig is disabled.
8585

86-
5. **Test.** Add a case to `apps/sim/lib/core/config/feature-flags.test.ts` that matches the chosen granularity. For a global flag, exercise `isFeatureEnabled('<flag-name>')` with an AppConfig `enabled` rule and toggle the fallback secret for the off-AppConfig path. For scoped rollout, cover only the selected clauses and mock `isPlatformAdmin` when testing `adminEnabled`.
86+
5. **Test only new evaluation logic.** A flag that reuses the existing clauses is already covered by `apps/sim/lib/core/config/feature-flags.test.ts`; add no per-flag case. When you change how flags evaluate (a new clause kind, a new fallback path), add a case there that passes the `test-audit` authoring gate.
8787

88-
6. **Clean up after rollout.** When the feature ships to everyone, delete the flag's entry from `FEATURE_FLAGS`, the `<FLAG_SECRET>` env entry, the AppConfig document, the call sites, and the test. Leaving dead flags around is the main failure mode of flag systems.
88+
6. **Clean up after rollout.** When the feature ships to everyone, delete the flag's entry from `FEATURE_FLAGS`, the `<FLAG_SECRET>` env entry, the AppConfig document, and the call sites. Leaving dead flags around is the main failure mode of flag systems.
8989

9090
## Notes
9191

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Do not special-case a CLI in those layers unless the registry contract cannot ex
9999

100100
## 6. Test the Addition
101101

102-
Extend tests when the new entry introduces behavior not already covered:
102+
Extend tests only when the new entry introduces behavior not already covered and the test passes the `test-audit` authoring gate:
103103

104104
- For every upgrade, add a regression proving the old ID and recipe remain resolvable but non-selectable, while the replacement ID is selectable.
105105
- Add important executable aliases to the table-driven search assertion.
@@ -110,17 +110,13 @@ Never commit downloaded artifacts or credentials.
110110

111111
## Required Validation
112112

113-
From `apps/sim`:
114-
115113
```bash
116-
bunx vitest run \
114+
bun run --cwd apps/sim test \
117115
lib/execution/remote-sandbox/cli-tools.test.ts \
118116
lib/execution/remote-sandbox/cli-tools-boundary.test.ts \
119117
lib/execution/remote-sandbox/sandbox-spec.test.ts \
120118
lib/execution/remote-sandbox/resolve.test.ts \
121-
lib/api/contracts/sandboxes.test.ts \
122-
'app/workspace/[workspaceId]/settings/components/sandboxes/utils.test.ts' \
123-
'app/workspace/[workspaceId]/settings/components/sandboxes/components/sandbox-editor.test.tsx'
119+
'app/workspace/[workspaceId]/settings/components/sandboxes/utils.test.ts'
124120
```
125121

126122
From the repository root:

‎.agents/skills/add-permission-group-item/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ bun run check:permission-group-enforcement
210210
bun run check:application-graph
211211
bun run check:capability-subject
212212
cd apps/sim && bun run type-check
213-
cd apps/sim && bunx vitest run lib/permission-groups
213+
bun run --cwd apps/sim test lib/permission-groups
214214
```
215215

216216
Also `bun run check:api-validation` if you touched a contract or the group routes. `bun run check:audits` runs all of these; it derives its list from the `check:*` scripts in `package.json`, so a new audit is opted *out* deliberately rather than opted in.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ list, manifest/registry exhaustiveness plus an existing provider primitive test
122122
Run the smallest relevant set, then:
123123

124124
```bash
125-
bunx vitest run <focused selector tests>
125+
bun run --cwd apps/sim test <focused selector tests>
126126
bun run --cwd apps/sim type-check
127127
bun run check:fork-dependent-coverage
128128
bun run check:client-boundary

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ Hard rules:
256256
provider responses, filenames, URLs, and errors remain unchanged when Sim did not resolve a
257257
secret into them.
258258

259-
Add focused tests covering named projection, ordinary identical text without provenance, nested and
259+
Run the `test-audit` authoring gate, then cover these risks at the boundary that owns them: named projection, ordinary identical text without provenance, nested and
260260
serialized shape handling, unchanged ordinary external inputs, malformed/incomplete private metadata
261261
failing closed, headerless legacy requests, and absence of private metadata in the public tool result.
262262
For durable sinks, also cover legacy `NULL` markers, exact-empty new writes, tracked secret writes,

‎.agents/skills/babysit/SKILL.md‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,13 @@ conditions freshly after every push.
121121
```
122122

123123
6. **Before pushing, re-run the full sync check from `/ship` step 2** — not just the log command,
124-
the whole check-and-recover flow (stash WIP if needed, rebase, verify the rebase didn't just
124+
the whole check-and-recover flow (stash WIP pinned by SHA as `/ship` step 2 shows, rebase, verify the rebase didn't just
125125
cleanly replay stray commits, cherry-pick rebuild if it did or if it conflicted). A babysit
126126
loop spanning a long session is exactly the scenario where a branch can drift, and pushing
127127
review fixes on top of undetected drift is how an oversized PR happens even after the branch
128-
was fixed once. Then run the repo's pre-ship checks the same way `/ship` does before
129-
committing — not just lint/typecheck/boundary-validation, but also the conditional `/cleanup`
130-
(if this round's fix touched UI code) and `/db-migrate` (if it touched schema/migrations)
131-
gates from `/ship` steps 4 and 5. A review-fix round is still a code change and can trip
132-
either gate just as easily as the original commit did.
128+
was fixed once. Then run `/ship` steps 4–6 on this round's diff — the cleanup and test gates,
129+
migration safety, and the regenerate + audit phases. A review-fix round is still a code change
130+
and can trip any of them just as easily as the original commit did.
133131

134132
7. **Commit and push** the round's fixes as one commit — `--force-with-lease` whenever step 6's
135133
sync check rewrote history, which includes a plain `git rebase origin/staging` that completed

‎.agents/skills/cleanup/SKILL.md‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: cleanup
3-
description: Run all code quality skills — effects, memo, callbacks, state, React Query, emcn design review, url-state, and comments — analyzing in parallel, then applying fixes sequentially
3+
description: Run all code quality skills — effects, memo, callbacks, state, React Query, emcn design review, url-state, comments, and test-audit — analyzing in parallel, then applying fixes sequentially
44
argument-hint: "[scope] [fix=true|false]"
55
---
66

@@ -16,9 +16,9 @@ User arguments: $ARGUMENTS
1616

1717
Parse `$ARGUMENTS` into `scope` and `fix`: extract the `fix=true|false` token wherever it appears in the string and strip it from `scope`; defaults are the current changes and `fix=true`. `fix` is consumed by Step 3 only — the passes below always run `fix=false`.
1818

19-
Spawn all eight passes concurrently as subagents in a **single message** (multiple Agent tool calls). Each runs its skill on the parsed `scope` with `fix=false` — analysis and proposals ONLY, no edits. Instruct each agent to return its findings as a structured list: for every proposed change, the file path, line range, a one-line description of the change, and the exact before/after so the orchestrator can apply it without re-deriving.
19+
Spawn up to nine passes concurrently as subagents in a **single message** (multiple Agent tool calls); pass 9 runs only when its condition holds. Each runs its skill on the parsed `scope` with `fix=false` — analysis and proposals ONLY, no edits. Instruct each agent to return its findings as a structured list: for every proposed change, the file path, line range, a one-line description of the change, and the exact before/after so the orchestrator can apply it without re-deriving.
2020

21-
Run these eight in parallel on the parsed `scope`:
21+
Run these in parallel on the parsed `scope`:
2222

2323
1. `/you-might-not-need-an-effect <scope> fix=false`
2424
2. `/you-might-not-need-a-memo <scope> fix=false`
@@ -28,35 +28,36 @@ Run these eight in parallel on the parsed `scope`:
2828
6. `/emcn-design-review <scope> fix=false`
2929
7. `/you-might-not-need-url-state <scope> fix=false`
3030
8. `/you-might-not-need-a-comment <scope> fix=false`
31+
9. `/test-audit audit <test paths>` — read-only; only when the scope adds or changes test files (`*.test.ts(x)`, `*.integration.ts`, `**/e2e/**`, `apps/sim/scripts/test-*-e2e.ts`). First resolve a free-form scope to the concrete list of added or changed test paths (`git diff --name-only` against the scope's base) and pass those paths. It applies the authoring gate to every new or changed test and proposes deleting the ones that fail it.
3132

3233
## Step 2 — Converge
3334

34-
Collect all findings into one list, **keeping each proposal tagged with the pass that produced it** — do NOT collapse a file's proposals into a single unlabeled patch, because Step 3 applies in pass order and needs those labels. Detect overlaps where two passes touch the same region (common: a state pass and an effect pass on the same block, or a memo and callback pass on the same component). Reconcile only genuine same-region conflicts, and drop proposals a sibling pass has made moot; a reconciled change inherits the pass label of whichever of its passes comes first in the Step 3 dependency order (effects → state → memo → callback → React Query → url-state → emcn → comments), so it is applied at the earliest safe point. Non-overlapping proposals stay as-is with their own labels. The output is a per-pass list of surviving changes, not a per-file patch.
35+
Collect all findings into one list, **keeping each proposal tagged with the pass that produced it** — do NOT collapse a file's proposals into a single unlabeled patch, because Step 3 applies in pass order and needs those labels. Detect overlaps where two passes touch the same region (common: a state pass and an effect pass on the same block, or a memo and callback pass on the same component). Reconcile only genuine same-region conflicts, and drop proposals a sibling pass has made moot; a reconciled change inherits the pass label of whichever of its passes comes first in the Step 3 dependency order (effects → state → memo → callback → React Query → url-state → emcn → comments → tests), so it is applied at the earliest safe point. Non-overlapping proposals stay as-is with their own labels. The output is a per-pass list of surviving changes, not a per-file patch.
3536

3637
## Step 3 — Sequential apply
3738

3839
If `fix=false`, skip this step — just report the proposals from Step 2.
3940

4041
Otherwise apply the surviving changes yourself (in the main context, not delegated), iterating **pass by pass** in this dependency order so earlier structural changes settle before later passes build on them:
4142

42-
1. effects → 2. state → 3. memo → 4. callback → 5. React Query → 6. url-state → 7. emcn design → 8. comments
43+
1. effects → 2. state → 3. memo → 4. callback → 5. React Query → 6. url-state → 7. emcn design → 8. comments → 9. tests
4344

4445
For each pass in turn, apply all of that pass's changes, then move to the next pass. A file touched by several passes is therefore edited once per pass, in this order — not once as a merged patch. This is what makes the ordering real: a single merged-per-file patch would collapse all passes into one edit and lose it.
4546

46-
Comments apply last, on purpose: that pass operates on whatever the earlier structural passes settled the code into, so it never edits lines a sibling pass is about to delete or rewrite.
47+
Comments apply after every structural pass, on purpose: that pass operates on whatever the earlier passes settled the code into, so it never edits lines a sibling pass is about to delete or rewrite. Tests apply last because they only touch test files; in Step 2, drop any other pass's proposal on a test file the tests pass deletes.
4748

4849
**Treat every Step 1 proposal as snapshot-relative, not authoritative.** All passes analyzed the *original* files in parallel, so a proposal's line ranges and before/after text describe the code as it was *before* any edits — once an earlier pass has run, a later pass's snippet may no longer match. So for each change, before applying:
4950

5051
1. Re-read the file and locate the target by its **content** (the proposal's `old_string` snippet), not by its line number — line numbers from Step 1 are only a hint for where to look, since earlier edits shift them.
5152
2. If the `old_string` still matches verbatim, apply it — a content-anchored edit is safe even if its line moved.
5253
3. If it no longer matches (an earlier pass altered that region), do **not** force the stale patch. Re-derive the change from the current code by re-applying that pass's rule to the construct, or drop it if a prior pass already made it moot. Never apply a proposal against text it wasn't computed from.
5354

54-
After all edits, run `bun run lint:check` (it runs `turbo run lint:check` across the repo — there is no per-file target, so run the full check).
55+
After all edits, run `bun run lint` from the repo root (it autofixes formatting across the repo; there is no per-file target).
5556

5657
## Step 4 — Summary
5758

58-
Output a summary across all eight passes: what each found, what was applied vs. skipped-as-redundant, and any proposals that need a human decision.
59+
Output a summary across all passes that ran: what each found, what was applied vs. skipped-as-redundant, and any proposals that need a human decision.
5960

6061
## Boundary findings
6162

62-
Never resolve a boundary finding by adding a `// boundary-raw-fetch` / `// double-cast-allowed` annotation — fix the call (adopt the contract + `requestJson`, or narrow the type). Annotations are only for the documented exceptions in CLAUDE.md → Boundary annotations.
63+
Never resolve a boundary finding by adding a `// boundary-raw-fetch` / `// double-cast-allowed` annotation — fix the call (adopt the contract + `requestJson`, or narrow the type). Annotations are only for the documented exceptions in `.claude/rules/sim-api-contracts.md` → Boundary annotations.

0 commit comments

Comments
 (0)