Files
sim/package.json
T
Vikhyath MondretiandClaude Fable 5 5112b0711d improvement(db): stop declaring retired usage columns ahead of their drop (#7134)
* improvement(db): stop declaring retired usage columns ahead of their drop

Contract-prep for the legacy usage-column drop. Removes the drizzle
declarations for 19 retired user_stats counters,
organization.departed_member_usage, and workflow_execution_logs.cost, so
generated SELECT lists stop referencing them, plus the last incidental
references: the cycle-close departed_member_usage resets, the v1 admin
exposure of departedMemberUsage/currentPeriodCopilotCost (both serving
dead values since the ledger cutover), the testing schema mirror, and a
lock-order fixture. The DROP COLUMN migration ships separately once this
is the deployed production app; contract-pending markers in schema.ts
track it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(db): reserve the drop migration as a journaled no-op for schema parity

CI requires drizzle-kit generate to be a no-op on every PR, so the
declaration removal cannot ship without its migration. Committing the
generated 0309 with every DROP commented out (a SELECT 1 no-op) keeps
the parity gate and future generates clean while deferring the
destructive half until this change is part of an already-deployed
production release; the file documents the follow-up procedure.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* improvement(db): keep declarations, route reads through live-column maps

Restructures the contract prep per review: the no-op 0309 migration is
gone and schema.ts keeps the deprecated declarations (with the
contract-pending markers on the columns), so the follow-up PR ships the
declaration removal and the real generated DROP migration together. What
makes that safe is that no deployed query names the doomed columns
anymore: every argless select()/returning()/relational read of
user_stats, organization, and workflow_execution_logs (29 sites) now
goes through omit(getTableColumns(...)) live-column maps, following the
workspaceFileColumns precedent. scripts/check-pending-drop-tables.ts
enforces this — it derives the guarded tables from the contract-pending
markers themselves (picking up workspace_files' pending size drop too)
and fails CI on any argless read, so the invariant holds between the two
PRs and retires itself when the markers are deleted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(db): backfill residual cost_total projections before the cost drop

The 0220 procedure projected every then-existing legacy cost json into
cost_total, but a transition-window writer added 23 rows (all 2026-05-30,
verified on the prod replica) carrying a numeric json total with no
projection. Script migration 0009 re-runs 0220's exact candidate filter
and projection in bounded batches at deploy time, so the pending cost
DROP abandons nothing cost_total should hold. The contract PR that drops
the column must deregister the script in the same change — it reads the
column; the contract-pending marker says so.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(ci): validate live-column builders and inline aliases in the pending-drop audit

Hardens check-pending-drop-tables per review: the audit now derives each
guarded table's doomed columns from schema.ts (@deprecated tags and
column-level contract-pending markers), so a sanctioned
omit(getTableColumns(t), [...]) or destructure-omit must name every
doomed column away — an unrelated or incomplete key list is reported
with the columns it misses, and schema.ts itself is no longer skipped,
so the <table>Columns helpers fail the audit if a later deprecation is
not added to their omit lists. Inline alias(t, ...) expressions passed
directly to from()/getTableColumns()/insert/update/delete now resolve to
their canonical table instead of escaping the checks. The testing
mirror's *Columns aliases now omit the same doomed keys as the real
helpers (and gain the missing proPeriodCostSnapshotAt entry), so tests
cannot keep passing against doomed-column references the app no longer
serves.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(ci): derive pending-drop columns from the AST, and align the mock schema

The doomed-column derivation matched `@deprecated` with a line regex, so a
column documented with a multiline TSDoc block was never marked doomed and
the live-column helpers were free to omit nothing for it. Derivation now
runs off the parsed schema: guarded tables are pgTable calls whose enclosed
comments carry a drop-flavored contract-pending marker, and doomed columns
come from each property's own leading TSDoc block, so single-line and
multiline forms read alike. Verified by mutation: making a deprecated
column's TSDoc multiline and dropping it from the helper's omit list now
fails with the column named, where the previous version reported clean.

Also fills the seven live columns the testing mirror was missing
(user_stats.limit_notifications, four organization settings columns,
workflow_execution_logs.cost_total/models_used) so mock-derived selections
have the same shape as production ones.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(ci): resolve namespace and renamed imports in the pending-drop audit

Table references were matched by bare identifier only, so an argless read
reached through `import * as schema` — a live pattern here, e.g.
`db.insert(schema.userStats)` in lib/auth/anonymous.ts — or through a
renamed import was invisible to the audit. Resolution now runs over the
file's schema-module import bindings (named, renamed, and namespace) as
well as alias() bindings, at every position the audit inspects. Verified
by probe: argless select() via `schema.userStats`, via a renamed import,
and an argless .returning() on `db.insert(schema.userStats)` are all
reported now, where the previous version reported none of the three.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(ci): close the pending-drop resolver under variable assignment

A table parked in an ordinary binding (`const t = userStats`) escaped the
audit, since only alias() results were re-bound. Binding collection now
resolves any declarator whose right side names a table — the table
itself, a namespace member, an earlier binding, or an alias() call — and
repeats to a fixpoint so declaration order does not matter. Verified by
probe: argless reads through a direct assignment, a namespace-member
assignment, and a chained binding are all reported now, where the
previous version reported none; the repo stays clean, including a file
where a local array shadows a pending table's name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(ci): match relational reads by table name, not by a literal query chain

An argless findFirst/findMany reached through a binding that holds
db.query escaped the audit, because the check required the receiver to be
a literal `<x>.query` member. Drizzle's relational API is keyed by table
name however the root is reached, so the check now keys on the
table-named property itself, closing the whole class rather than the one
aliasing form. Verified by probe: an aliased root (`const q = db.query`)
is reported now where it previously was not, `tx.query` still is, a read
that passes `columns` still is not, and the repo stays clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-26 19:11:38 -07:00

156 lines
8.8 KiB
JSON

{
"name": "simstudio",
"packageManager": "bun@1.3.14",
"version": "0.0.0",
"private": true,
"license": "Apache-2.0",
"workspaces": [
"apps/*",
"packages/*"
],
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev",
"dev:sockets": "cd apps/realtime && bun run dev",
"dev:full": "bunx concurrently -n \"App,Realtime\" -c \"cyan,magenta\" \"cd apps/sim && bun run dev\" \"cd apps/realtime && bun run dev\"",
"dev:full:capped": "bunx concurrently -n \"App,Realtime\" -c \"cyan,magenta\" \"cd apps/sim && bun run dev:capped\" \"cd apps/realtime && bun run dev\"",
"test": "bun run test:setup && bun run test:npm-package-versions && bun run test:icon-path-precision && bun run test:tool-registry-boundary && bun run test:tool-request-boundary && bun run test:migrations-safety && bun run test:generators && turbo run test",
"test:setup": "bun run --cwd packages/sim-setup test",
"test:npm-package-versions": "bunx vitest run scripts/bump-npm-package-versions.test.ts",
"test:icon-path-precision": "bunx vitest run scripts/check-icon-path-precision.test.ts",
"test:tool-registry-boundary": "bunx vitest run scripts/check-tool-registry-boundary.test.ts",
"test:tool-request-boundary": "bunx vitest run scripts/check-tool-request-boundary.test.ts",
"test:migrations-safety": "bunx vitest run scripts/check-migrations-safety.test.ts",
"test:generators": "bunx vitest run scripts/generate-v2-cli-api.test.ts scripts/generate-cli-docs.test.ts scripts/generate-docs.test.ts",
"format": "turbo run format",
"format:check": "turbo run format:check",
"lint": "turbo run lint",
"lint:check": "turbo run lint:check",
"lint:helm": "helm lint ./helm/sim --strict --values ./helm/sim/test/values-lint.yaml",
"lint:all": "turbo run lint && bun run lint:helm",
"check": "turbo run format:check",
"check:boundaries": "bun run scripts/check-monorepo-boundaries.ts",
"check:api-validation": "bun run scripts/check-api-validation-contracts.ts --check",
"check:fork-dependent-coverage": "bun run scripts/check-fork-dependent-coverage.ts",
"generate:openapi": "bun run scripts/generate-openapi.ts",
"check:openapi": "bun run scripts/check-openapi.ts",
"generate:cli-api": "bun run scripts/generate-v2-cli-api.ts",
"check:cli-api": "bun run scripts/generate-v2-cli-api.ts --check",
"generate:cli-docs": "bun run scripts/generate-cli-docs.ts",
"check:cli-docs": "bun run scripts/generate-cli-docs.ts --check",
"check:canonical-index": "bun run scripts/check-canonical-index-surface.ts",
"check:cron-parity": "bun run scripts/check-cron-parity.ts",
"check:api-validation:strict": "bun run scripts/check-api-validation-contracts.ts --check --enforce-boundary-baseline",
"check:realtime-prune": "bun run scripts/check-realtime-prune-graph.ts",
"check:tool-request-boundary": "bun run scripts/check-tool-request-boundary.ts",
"check:tool-registry-boundary": "bun run scripts/check-tool-registry-boundary.ts --check",
"check:trigger-block-cycle": "bun run scripts/check-trigger-block-cycle.ts",
"check:import-specifiers": "bun run scripts/check-import-specifiers.ts",
"check:sql-date-binding": "bun run scripts/check-sql-date-binding.ts",
"check:pending-drop-tables": "bun run scripts/check-pending-drop-tables.ts",
"check:zustand-v5": "bun run scripts/check-zustand-v5-selectors.ts",
"check:react-query": "bun run scripts/check-react-query-patterns.ts --check",
"check:client-boundary": "bun run scripts/check-client-boundary-imports.ts --check",
"check:utils": "bun run scripts/check-utils-enforcement.ts",
"check:canvas-sentences": "bun run apps/sim/scripts/check-canvas-sentences.ts --require-coverage",
"check:bare-icons": "bun run scripts/check-bare-icons.ts",
"check:icon-paths": "bun run scripts/check-icon-paths.ts",
"check:icon-path-precision": "bun run scripts/check-icon-path-precision.ts",
"check:migrations": "bun run scripts/check-migrations-safety.ts",
"check:native-typecheck": "bun run scripts/check-native-typecheck.ts",
"check:source-text": "bun run scripts/check-source-text.ts",
"check:spec-example-ids": "bun run scripts/check-spec-example-ids.ts",
"check:script-tests": "bun run scripts/check-script-test-coverage.ts",
"check:audits": "bun run scripts/run-audits.ts",
"check:skills": "bun run scripts/sync-skills.ts --check",
"check:desktop-bridge": "bun run scripts/check-desktop-bridge-contract.ts --check",
"check:desktop-ipc": "bun run scripts/check-desktop-ipc-contract.ts",
"check:route-verbs": "bun run scripts/check-route-verbs.ts",
"desktop-bridge-contract:update": "bun run scripts/check-desktop-bridge-contract.ts --update",
"mship-contracts:generate": "bun run scripts/sync-mothership-stream-contract.ts",
"mship-contracts:check": "bun run scripts/sync-mothership-stream-contract.ts --check",
"billing-protocol-contract:generate": "bun run scripts/sync-billing-protocol-contract.ts",
"billing-protocol-contract:check": "bun run scripts/sync-billing-protocol-contract.ts --check",
"tool-metadata:generate": "bun run scripts/sync-tool-metadata.ts",
"tool-metadata:check": "bun run scripts/sync-tool-metadata.ts --check",
"deployment-config:generate": "bun run scripts/generate-deployment-config.ts",
"deployment-config:check": "bun run scripts/generate-deployment-config.ts --check",
"integration-catalog:check": "bun run scripts/check-integration-catalog.ts",
"docs:check": "bun run scripts/generate-docs.ts --check",
"mship-tools:generate": "bun run scripts/sync-tool-catalog.ts",
"mship-tools:check": "bun run scripts/sync-tool-catalog.ts --check",
"trace-spans-contract:generate": "bun run scripts/sync-trace-spans-contract.ts",
"trace-spans-contract:check": "bun run scripts/sync-trace-spans-contract.ts --check",
"trace-attributes-contract:generate": "bun run scripts/sync-trace-attributes-contract.ts",
"trace-attributes-contract:check": "bun run scripts/sync-trace-attributes-contract.ts --check",
"trace-attribute-values-contract:generate": "bun run scripts/sync-trace-attribute-values-contract.ts",
"trace-attribute-values-contract:check": "bun run scripts/sync-trace-attribute-values-contract.ts --check",
"trace-events-contract:generate": "bun run scripts/sync-trace-events-contract.ts",
"trace-events-contract:check": "bun run scripts/sync-trace-events-contract.ts --check",
"metrics-contract:generate": "bun run scripts/sync-metrics-contract.ts",
"metrics-contract:check": "bun run scripts/sync-metrics-contract.ts --check",
"vfs-snapshot-contract:generate": "bun run scripts/sync-vfs-snapshot-contract.ts",
"vfs-snapshot-contract:check": "bun run scripts/sync-vfs-snapshot-contract.ts --check",
"docs-manifest:generate": "bun run scripts/sync-docs-manifest.ts",
"docs-manifest:check": "bun run scripts/sync-docs-manifest.ts --check",
"mship:generate": "bun run scripts/generate-mship-contracts.ts",
"mship:check": "bun run scripts/generate-mship-contracts.ts --check",
"library:covers": "bun run scripts/generate-library-covers.tsx",
"library:covers:check": "bun run scripts/generate-library-covers.tsx --check",
"skills:sync": "bun run scripts/sync-skills.ts",
"bump:npm-packages": "bun run scripts/bump-npm-package-versions.ts",
"sim": "bun run packages/sim-cli/src/index.ts",
"sim-setup": "bun run packages/sim-setup/src/index.ts",
"agent-stream-docs:generate": "bun run scripts/sync-agent-stream-docs.ts",
"agent-stream-docs:check": "bun run scripts/sync-agent-stream-docs.ts --check",
"prepare": "bun husky",
"type-check": "turbo run type-check",
"release": "bun run scripts/create-single-release.ts"
},
"overrides": {
"react": "19.2.4",
"react-dom": "19.2.4",
"next": "16.3.1",
"@next/env": "16.3.1",
"drizzle-orm": "^0.45.2",
"postgres": "^3.4.5",
"minimatch": "^10.2.5",
"mermaid": "11.16.1",
"zod": "4.3.6",
"e2b": "^2.36.1"
},
"optionalDependencies": {
"@next/swc-darwin-arm64": "16.3.1",
"@next/swc-darwin-x64": "16.3.1",
"@next/swc-linux-arm64-gnu": "16.3.1",
"@next/swc-linux-x64-gnu": "16.3.1"
},
"devDependencies": {
"@babel/parser": "7.29.2",
"@biomejs/biome": "2.0.0-beta.5",
"@clack/prompts": "1.7.0",
"@octokit/rest": "^21.0.0",
"@types/opentype.js": "1.3.10",
"@typescript/native": "npm:typescript@^7.0.2",
"@vercel/og": "0.6.8",
"chalk": "5.6.2",
"glob": "13.0.0",
"gray-matter": "4.0.3",
"husky": "9.1.7",
"json-schema-to-typescript": "15.0.4",
"lint-staged": "16.0.0",
"opentype.js": "1.3.4",
"sharp": "0.35.3",
"turbo": "2.9.14"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,json,css,scss}": [
"biome check --write --no-errors-on-unmatched --files-ignore-unknown=true"
]
},
"trustedDependencies": [
"isolated-vm",
"sharp"
]
}