Skip to content

Commit c6c2f63

Browse files
committed
Merge remote-tracking branch 'origin/staging' into fix/openai-live-tool-stream
# Conflicts: # apps/docs/content/docs/en/workflows/blocks/agent.mdx
2 parents dfb906c + f0f9870 commit c6c2f63

23 files changed

Lines changed: 665 additions & 45 deletions

File tree

.agents/skills/ship/SKILL.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,47 @@ When the user runs `/ship`:
3535
5. **Run migration safety** — only if the diff touches `packages/db/migrations/**` or `packages/db/schema.ts`:
3636
- Run `/db-migrate` to review the migration for zero-downtime safety (expand/contract phasing, backward-compatibility with the deployed app version).
3737
- `bun run check:migrations origin/staging` must pass (staging is the PR base). Do not silence a flagged statement with a `-- migration-safe:` annotation unless `/db-migrate` confirmed the old code no longer depends on it; otherwise split the destructive change into a later deploy.
38-
6. **Run pre-ship checks** from the repo root before staging:
39-
- `bun run lint` to fix formatting issues
40-
- `bun run check:api-validation:strict` to catch boundary contract failures before CI
41-
7. **Stage and commit** the changes with the generated message
38+
6. **Run pre-ship checks** from the repo root before staging. This has two phases: first **regenerate** every committed artifact so generated files never drift into a CI failure (this is what catches things like `agent-stream-docs` going stale after a `models.ts` edit), then run the **full audit suite** CI's `Lint and Test` job enforces. Both phases parallelize — but only across commands that write **disjoint** outputs — and a bare `wait` swallows child exit codes, so both phases below explicitly collect each job's status and abort ship if any failed.
39+
40+
**Phase A — regenerate the always-in-repo committed artifacts (parallel), then let step 7 stage whatever changed.** Regenerate only the generators whose inputs live entirely in this repo and that any ordinary code change can drift — `agent-stream-docs:generate` (derives from the provider model registry) and `skills:sync` (derives from `.agents/skills/**`). They write disjoint trees (`apps/docs/…/agent.mdx` vs the `.claude`/`.cursor` command projections), so they parallelize safely, and each is idempotent (a no-op when already in sync):
41+
```bash
42+
rm -f /tmp/ship-gen-results
43+
for g in agent-stream-docs:generate skills:sync; do
44+
( bun run "$g" >"/tmp/ship-gen-${g//:/-}.log" 2>&1; echo "$? $g" >>/tmp/ship-gen-results ) &
45+
done
46+
wait
47+
# any non-zero line is a FAILED generator — read /tmp/ship-gen-<name>.log and fix before shipping;
48+
# a silently-failed generate leaves a stale artifact that Phase B / CI then rejects.
49+
# The `exit 1` makes this block itself exit non-zero on failure, so anything gating on the
50+
# command's status (an agent, or a wrapping script) actually stops — do NOT collapse it to
51+
# `grep … && echo ❌ || echo ✅`, which always exits 0 and silently lets ship continue.
52+
if grep -vE '^0 ' /tmp/ship-gen-results; then echo "❌ generator(s) failed — do not ship"; exit 1; fi
53+
echo "✅ artifacts regenerated"
54+
```
55+
Then `git status --short` to see what regenerated — those files must be staged in step 7 alongside your own changes.
56+
57+
**Do NOT blanket-run the domain generators here.** `mship:generate` (`generate-mship-contracts.ts`) is an **umbrella** that drives all nine mothership contract generators (`mship-contracts`, `billing-protocol-contract`, `mship-tools`, the four `trace-*`, `metrics-contract`, `vfs-snapshot-contract`) and biome-formats `apps/sim/lib/copilot/generated/` — never run it *and* its constituents (they write the same files and corrupt each other in parallel), and never run it on an ordinary ship: it reads an **external** copilot-contract source that isn't checked out in most worktrees, so it hard-fails with `ENOENT` and would abort ship for an unrelated reason. `generate:pi-model-catalog` (under `apps/sim`) likewise regenerates from the installed Pi package, not repo source. Only when **this PR's diff actually touches** a domain generator's input do you regenerate it deliberately and run its matching `:check` (`bun run mship:check` / the individual `*:check`) — with the external source present.
58+
59+
**Phase B — run lint + every audit CI enforces, in parallel, and abort ship if any fails.** `bun run lint` first (it autofixes formatting and mutates files, so don't parallelize it with the read-only audits), then fan the rest out and collect exit codes. This is exactly the read-only audit set from CI's `Lint and Test` job (all in-repo, runnable in any worktree):
60+
```bash
61+
# autofix formatting first (mutating; not parallel-safe with the audits). Gate its exit too —
62+
# a non-zero lint (unfixable errors) must abort before the audits run, not be ignored.
63+
bun run lint || { echo "❌ lint failed — do not ship"; exit 1; }
64+
rm -f /tmp/ship-audit-results
65+
for s in check:boundaries check:api-validation:strict check:utils check:zustand-v5 \
66+
check:react-query check:client-boundary check:bare-icons check:icon-paths \
67+
check:realtime-prune skills:check agent-stream-docs:check; do
68+
( bun run "$s" >"/tmp/ship-audit-${s//:/-}.log" 2>&1; echo "$? $s" >>/tmp/ship-audit-results ) &
69+
done
70+
wait
71+
# any non-zero line is a failing audit — read its /tmp/ship-audit-<name>.log and fix before shipping.
72+
# `exit 1` on failure preserves the original sequential checks' semantics (their non-zero exit is
73+
# what an agent gates on); never use `grep … && echo ❌ || echo ✅` here — it always exits 0.
74+
if grep -vE '^0 ' /tmp/ship-audit-results; then echo "❌ audit(s) failed — do not ship"; exit 1; fi
75+
echo "✅ all audits passed"
76+
```
77+
If Phase A regenerated a file, its matching `:check` in Phase B now passes trivially — that parity is the point. Do not ship with any generator or audit failing; fix the cause (never silence it) and re-run. `check:migrations` and `type-check` are covered by steps 5 and CI respectively and are not repeated here.
78+
7. **Stage and commit** the changes with the generated message — including any files Phase A regenerated in step 6
4279
8. **Push to origin** using the current branch name — `--force-with-lease` if step 2's sync
4380
check did any history rewrite (a clean rebase or a cherry-pick rebuild) on a branch that had
4481
already been pushed once; a plain push would be rejected in exactly the polluted-remote case

.claude/commands/ship.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,47 @@ When the user runs `/ship`:
3434
5. **Run migration safety** — only if the diff touches `packages/db/migrations/**` or `packages/db/schema.ts`:
3535
- Run `/db-migrate` to review the migration for zero-downtime safety (expand/contract phasing, backward-compatibility with the deployed app version).
3636
- `bun run check:migrations origin/staging` must pass (staging is the PR base). Do not silence a flagged statement with a `-- migration-safe:` annotation unless `/db-migrate` confirmed the old code no longer depends on it; otherwise split the destructive change into a later deploy.
37-
6. **Run pre-ship checks** from the repo root before staging:
38-
- `bun run lint` to fix formatting issues
39-
- `bun run check:api-validation:strict` to catch boundary contract failures before CI
40-
7. **Stage and commit** the changes with the generated message
37+
6. **Run pre-ship checks** from the repo root before staging. This has two phases: first **regenerate** every committed artifact so generated files never drift into a CI failure (this is what catches things like `agent-stream-docs` going stale after a `models.ts` edit), then run the **full audit suite** CI's `Lint and Test` job enforces. Both phases parallelize — but only across commands that write **disjoint** outputs — and a bare `wait` swallows child exit codes, so both phases below explicitly collect each job's status and abort ship if any failed.
38+
39+
**Phase A — regenerate the always-in-repo committed artifacts (parallel), then let step 7 stage whatever changed.** Regenerate only the generators whose inputs live entirely in this repo and that any ordinary code change can drift — `agent-stream-docs:generate` (derives from the provider model registry) and `skills:sync` (derives from `.agents/skills/**`). They write disjoint trees (`apps/docs/…/agent.mdx` vs the `.claude`/`.cursor` command projections), so they parallelize safely, and each is idempotent (a no-op when already in sync):
40+
```bash
41+
rm -f /tmp/ship-gen-results
42+
for g in agent-stream-docs:generate skills:sync; do
43+
( bun run "$g" >"/tmp/ship-gen-${g//:/-}.log" 2>&1; echo "$? $g" >>/tmp/ship-gen-results ) &
44+
done
45+
wait
46+
# any non-zero line is a FAILED generator — read /tmp/ship-gen-<name>.log and fix before shipping;
47+
# a silently-failed generate leaves a stale artifact that Phase B / CI then rejects.
48+
# The `exit 1` makes this block itself exit non-zero on failure, so anything gating on the
49+
# command's status (an agent, or a wrapping script) actually stops — do NOT collapse it to
50+
# `grep … && echo ❌ || echo ✅`, which always exits 0 and silently lets ship continue.
51+
if grep -vE '^0 ' /tmp/ship-gen-results; then echo "❌ generator(s) failed — do not ship"; exit 1; fi
52+
echo "✅ artifacts regenerated"
53+
```
54+
Then `git status --short` to see what regenerated — those files must be staged in step 7 alongside your own changes.
55+
56+
**Do NOT blanket-run the domain generators here.** `mship:generate` (`generate-mship-contracts.ts`) is an **umbrella** that drives all nine mothership contract generators (`mship-contracts`, `billing-protocol-contract`, `mship-tools`, the four `trace-*`, `metrics-contract`, `vfs-snapshot-contract`) and biome-formats `apps/sim/lib/copilot/generated/` — never run it *and* its constituents (they write the same files and corrupt each other in parallel), and never run it on an ordinary ship: it reads an **external** copilot-contract source that isn't checked out in most worktrees, so it hard-fails with `ENOENT` and would abort ship for an unrelated reason. `generate:pi-model-catalog` (under `apps/sim`) likewise regenerates from the installed Pi package, not repo source. Only when **this PR's diff actually touches** a domain generator's input do you regenerate it deliberately and run its matching `:check` (`bun run mship:check` / the individual `*:check`) — with the external source present.
57+
58+
**Phase B — run lint + every audit CI enforces, in parallel, and abort ship if any fails.** `bun run lint` first (it autofixes formatting and mutates files, so don't parallelize it with the read-only audits), then fan the rest out and collect exit codes. This is exactly the read-only audit set from CI's `Lint and Test` job (all in-repo, runnable in any worktree):
59+
```bash
60+
# autofix formatting first (mutating; not parallel-safe with the audits). Gate its exit too —
61+
# a non-zero lint (unfixable errors) must abort before the audits run, not be ignored.
62+
bun run lint || { echo "❌ lint failed — do not ship"; exit 1; }
63+
rm -f /tmp/ship-audit-results
64+
for s in check:boundaries check:api-validation:strict check:utils check:zustand-v5 \
65+
check:react-query check:client-boundary check:bare-icons check:icon-paths \
66+
check:realtime-prune skills:check agent-stream-docs:check; do
67+
( bun run "$s" >"/tmp/ship-audit-${s//:/-}.log" 2>&1; echo "$? $s" >>/tmp/ship-audit-results ) &
68+
done
69+
wait
70+
# any non-zero line is a failing audit — read its /tmp/ship-audit-<name>.log and fix before shipping.
71+
# `exit 1` on failure preserves the original sequential checks' semantics (their non-zero exit is
72+
# what an agent gates on); never use `grep … && echo ❌ || echo ✅` here — it always exits 0.
73+
if grep -vE '^0 ' /tmp/ship-audit-results; then echo "❌ audit(s) failed — do not ship"; exit 1; fi
74+
echo "✅ all audits passed"
75+
```
76+
If Phase A regenerated a file, its matching `:check` in Phase B now passes trivially — that parity is the point. Do not ship with any generator or audit failing; fix the cause (never silence it) and re-run. `check:migrations` and `type-check` are covered by steps 5 and CI respectively and are not repeated here.
77+
7. **Stage and commit** the changes with the generated message — including any files Phase A regenerated in step 6
4178
8. **Push to origin** using the current branch name — `--force-with-lease` if step 2's sync
4279
check did any history rewrite (a clean rebase or a cherry-pick rebuild) on a branch that had
4380
already been pushed once; a plain push would be rejected in exactly the polluted-remote case

.cursor/commands/ship.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,47 @@ When the user runs `/ship`:
2929
5. **Run migration safety** — only if the diff touches `packages/db/migrations/**` or `packages/db/schema.ts`:
3030
- Run `/db-migrate` to review the migration for zero-downtime safety (expand/contract phasing, backward-compatibility with the deployed app version).
3131
- `bun run check:migrations origin/staging` must pass (staging is the PR base). Do not silence a flagged statement with a `-- migration-safe:` annotation unless `/db-migrate` confirmed the old code no longer depends on it; otherwise split the destructive change into a later deploy.
32-
6. **Run pre-ship checks** from the repo root before staging:
33-
- `bun run lint` to fix formatting issues
34-
- `bun run check:api-validation:strict` to catch boundary contract failures before CI
35-
7. **Stage and commit** the changes with the generated message
32+
6. **Run pre-ship checks** from the repo root before staging. This has two phases: first **regenerate** every committed artifact so generated files never drift into a CI failure (this is what catches things like `agent-stream-docs` going stale after a `models.ts` edit), then run the **full audit suite** CI's `Lint and Test` job enforces. Both phases parallelize — but only across commands that write **disjoint** outputs — and a bare `wait` swallows child exit codes, so both phases below explicitly collect each job's status and abort ship if any failed.
33+
34+
**Phase A — regenerate the always-in-repo committed artifacts (parallel), then let step 7 stage whatever changed.** Regenerate only the generators whose inputs live entirely in this repo and that any ordinary code change can drift — `agent-stream-docs:generate` (derives from the provider model registry) and `skills:sync` (derives from `.agents/skills/**`). They write disjoint trees (`apps/docs/…/agent.mdx` vs the `.claude`/`.cursor` command projections), so they parallelize safely, and each is idempotent (a no-op when already in sync):
35+
```bash
36+
rm -f /tmp/ship-gen-results
37+
for g in agent-stream-docs:generate skills:sync; do
38+
( bun run "$g" >"/tmp/ship-gen-${g//:/-}.log" 2>&1; echo "$? $g" >>/tmp/ship-gen-results ) &
39+
done
40+
wait
41+
# any non-zero line is a FAILED generator — read /tmp/ship-gen-<name>.log and fix before shipping;
42+
# a silently-failed generate leaves a stale artifact that Phase B / CI then rejects.
43+
# The `exit 1` makes this block itself exit non-zero on failure, so anything gating on the
44+
# command's status (an agent, or a wrapping script) actually stops — do NOT collapse it to
45+
# `grep … && echo ❌ || echo ✅`, which always exits 0 and silently lets ship continue.
46+
if grep -vE '^0 ' /tmp/ship-gen-results; then echo "❌ generator(s) failed — do not ship"; exit 1; fi
47+
echo "✅ artifacts regenerated"
48+
```
49+
Then `git status --short` to see what regenerated — those files must be staged in step 7 alongside your own changes.
50+
51+
**Do NOT blanket-run the domain generators here.** `mship:generate` (`generate-mship-contracts.ts`) is an **umbrella** that drives all nine mothership contract generators (`mship-contracts`, `billing-protocol-contract`, `mship-tools`, the four `trace-*`, `metrics-contract`, `vfs-snapshot-contract`) and biome-formats `apps/sim/lib/copilot/generated/` — never run it *and* its constituents (they write the same files and corrupt each other in parallel), and never run it on an ordinary ship: it reads an **external** copilot-contract source that isn't checked out in most worktrees, so it hard-fails with `ENOENT` and would abort ship for an unrelated reason. `generate:pi-model-catalog` (under `apps/sim`) likewise regenerates from the installed Pi package, not repo source. Only when **this PR's diff actually touches** a domain generator's input do you regenerate it deliberately and run its matching `:check` (`bun run mship:check` / the individual `*:check`) — with the external source present.
52+
53+
**Phase B — run lint + every audit CI enforces, in parallel, and abort ship if any fails.** `bun run lint` first (it autofixes formatting and mutates files, so don't parallelize it with the read-only audits), then fan the rest out and collect exit codes. This is exactly the read-only audit set from CI's `Lint and Test` job (all in-repo, runnable in any worktree):
54+
```bash
55+
# autofix formatting first (mutating; not parallel-safe with the audits). Gate its exit too —
56+
# a non-zero lint (unfixable errors) must abort before the audits run, not be ignored.
57+
bun run lint || { echo "❌ lint failed — do not ship"; exit 1; }
58+
rm -f /tmp/ship-audit-results
59+
for s in check:boundaries check:api-validation:strict check:utils check:zustand-v5 \
60+
check:react-query check:client-boundary check:bare-icons check:icon-paths \
61+
check:realtime-prune skills:check agent-stream-docs:check; do
62+
( bun run "$s" >"/tmp/ship-audit-${s//:/-}.log" 2>&1; echo "$? $s" >>/tmp/ship-audit-results ) &
63+
done
64+
wait
65+
# any non-zero line is a failing audit — read its /tmp/ship-audit-<name>.log and fix before shipping.
66+
# `exit 1` on failure preserves the original sequential checks' semantics (their non-zero exit is
67+
# what an agent gates on); never use `grep … && echo ❌ || echo ✅` here — it always exits 0.
68+
if grep -vE '^0 ' /tmp/ship-audit-results; then echo "❌ audit(s) failed — do not ship"; exit 1; fi
69+
echo "✅ all audits passed"
70+
```
71+
If Phase A regenerated a file, its matching `:check` in Phase B now passes trivially — that parity is the point. Do not ship with any generator or audit failing; fix the cause (never silence it) and re-run. `check:migrations` and `type-check` are covered by steps 5 and CI respectively and are not repeated here.
72+
7. **Stage and commit** the changes with the generated message — including any files Phase A regenerated in step 6
3673
8. **Push to origin** using the current branch name — `--force-with-lease` if step 2's sync
3774
check did any history rewrite (a clean rebase or a cherry-pick rebuild) on a branch that had
3875
already been pushed once; a plain push would be rejected in exactly the polluted-remote case

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,3 @@ package.json @simstudioai/deps
3737
bun.lock @simstudioai/deps
3838
**/bun.lock @simstudioai/deps
3939
bunfig.toml @simstudioai/deps
40-
.npmrc @simstudioai/deps

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

apps/docs/content/docs/en/platform/enterprise/verified-domains.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ Go to **Settings → Security → Verified domains** in your organization settin
2323
3. Add that TXT record at your DNS provider.
2424
4. Click **Verify**. Sim looks up the record; on success the domain is marked **Verified**.
2525

26-
DNS changes can take up to 48 hours to propagate — if verification does not succeed immediately, wait and retry. You can remove the TXT record after the domain is verified; the verification persists.
26+
<Callout type="warning">
27+
Some DNS providers — GoDaddy, Namecheap, Hover, and most cPanel panels — append your zone to whatever you type in the host field. If yours does, enter the host with the trailing zone removed, or you will end up with `_sim-challenge.acme.com.acme.com` and verification will never succeed. Managing the `acme.com` zone, `_sim-challenge.acme.com` becomes `_sim-challenge`; verifying the subdomain `eng.acme.com` from that same zone, `_sim-challenge.eng.acme.com` becomes `_sim-challenge.eng`. Cloudflare and Route 53 take the full host as shown.
28+
</Callout>
29+
30+
DNS changes can take up to 48 hours to propagate — if verification does not succeed immediately, wait and retry. Keep the TXT record published: leaving it in place means the domain stays verifiable if you ever need to verify it again.
2731

2832
Add each domain you own separately. Subdomains (`eng.acme.com`) are verified independently of the apex.
2933

0 commit comments

Comments
 (0)