Server: dry runs charged to the plan budget and slot, create-from-source answers 429 when slots are full, the Code tab has its own slot lane, staged blobs count against the payer's storage quota (consumed on apply, never renewed by reads), file deletes carry a revision precondition, row limits refuse only growth, joined table transactions keep their timeouts, and blocks/edges/subflows load in a stable created_at,ctid order. DX: group help for the source loop, a primer covering renames, failures and test runs, JSON-only output, run errors mapped back to source file and line, --stop-after/--from-block by name, webhook URLs after deploy, GitHub Actions annotations and step summary, exit 15 for a partial write, table names on every table route, status that agrees with the dry run, and quieter output. Flaky tests fixed at the root (keep-alive races, sleep-based waits). Migration 0469 adds a nullable staged_blob.consumed_at.
* chore(redis): require Redis and remove the configuration fallbacks
* chore(redis): remove the remaining no-Redis paths across the app, realtime, setup and deploy config
* fix(redis): resolve rate-limit storage lazily and address review findings
* improvement(redis): address review threads and simplify the leftovers of the fallback removal
* fix(redis): keep unit tests off a real Redis and update integration tests for lazy channels
* chore(redis): drop stale fallback references after rebasing
* fix(billing): re-read the usage gate often once a payer nears its limit
The usage gate cached a within-limit admission for five minutes, so a payer
who crossed the limit kept running executions and copilot steps for up to
that long. On a free plan that is unbilled spend; on a capped plan it bills
past the cap. An admission is now held for 10s when the payer or the acting
member has less headroom than the larger of $25 and 20% of the limit (every
free-plan payer), and for the full five minutes otherwise. The direct-v1
account verdict cache follows the same rule.
* test(billing): drive the gate-cache clock with faked timers instead of real waits
* improvement(naming): rename sandbox-tasks to sandboxes and drop folder-name stutter in execution files
* improvement(naming): standardize file names to the folder and role conventions
Renames every check:file-names baseline entry (stutter and redundant-suffix) so the
baseline is empty, plus the same rule's uncaught cases: grandparent-domain prefixes in
application/ and orchestration/ folders, loose stores moved to stores/<feature>/store.ts,
non-hook files dropped from the use-* prefix, and application context/errors outliers.
* improvement(naming): resolve rename ambiguities and stale file references from review
* chore(tests): ratchet real wall-clock waits in unit tests (check:test-patterns real-wait)
New `real-wait` rule in scripts/check-test-patterns.ts flags a unit test that
waits on the wall clock with no fake timers in scope:
- `sleep`/`interruptibleSleep` resolved through their `@sim/utils/helpers`
import binding (aliases included; skipped when the file mocks that module),
- `setTimeout` from `node:timers/promises`,
- `new Promise((resolve) => setTimeout(resolve, ms))` and variants whose timer
callback resolves the promise (reject-only timeout guards are not waits).
Zero or omitted delays are macrotask flushes and are not flagged. Fake timers
cover a wait when an earlier `vi.useFakeTimers()` in an enclosing function or
the module, or a `beforeEach`/`beforeAll` of an enclosing describe or the
module, fakes `setTimeout` (`toFake: ['Date']` and `shouldAdvanceTime: true`
do not). Integration and *.live.test.ts files are exempt: their waits are on
real services. Each occurrence is a numbered entry, capping the count per file.
`--update --init-rule <rule>` admits the one-time baseline for a rule the
baseline does not track yet; `--update` stays shrink-only. Baseline: 121
real-wait entries across 46 files (72 -> 193 total).
* fix(tests): keep a real-wait flagged before the fake-timer install in its own hook
A beforeEach/beforeAll that installs fake timers covered its whole suite,
including waits earlier in the same hook body, which run on the real clock.
Only waits after the install in that hook are exempt now; tests and other
hooks in the suite keep the exemption.
* fix(tests): make real-wait's fake-timer exemption exact and drop --init-rule
- Remove `--update --init-rule`: it admitted entries for any rule with no
remaining baseline entries. `--update` is strictly shrink-only again; the
real-wait entries enter once, in this PR's baseline diff.
- `vi.useRealTimers()` ends the exemption from where it runs, including a
nested suite restoring real timers after an outer hook faked them.
- A clock installed in `beforeEach` no longer covers `beforeAll`/`afterAll`
or earlier sibling `beforeEach` hooks; `beforeAll` no longer covers earlier
sibling `beforeAll` hooks.
- Only `vi.useFakeTimers()` with no config, or a literal config proven to fake
setTimeout without shouldAdvanceTime, exempts a wait.
- Namespace imports (`helpers.sleep`, `timers.setTimeout`) are flagged.
* chore(tests): make the wait-export table read-only
* fix(tests): let a module-scope fake-timer install cover helper functions declared above it
Functions run only after the module loads, so a module-scope vi.useFakeTimers()
(or vi.useRealTimers()) applies to every function body regardless of source
order; module-scope waits still follow source order.
* fix(tests): exempt helpers from a module-scope fake-timer install only when nothing ran before it
A helper called at module scope before vi.useFakeTimers() waits on the real
clock. A module-scope install now reaches function bodies only when every
earlier module-scope statement is load-safe (imports, function/class
declarations, type-only statements, vi.mock/doMock/hoisted, and variables
whose initializers call nothing); otherwise source order applies. A
module-scope vi.useRealTimers() still reaches every function body.
* fix(tests): skip only helpers called before a module-scope fake-timer install
Any unrelated module-scope call (const run = vi.fn()) used to drop the
helper exemption. Now a module-scope vi.useFakeTimers() covers every function
body except a helper (function declaration or variable bound to a function)
that earlier module-scope code calls directly by name; calls through other
helpers are not traced. WAIT_EXPORTS and HOOK_KINDS are as const.
* fix(tests): recognize module-scope helpers whose initializer is wrapped in a type assertion
helperName now unwraps as/satisfies/non-null/parenthesized initializers with
the shared unwrap helper, so a wrapped arrow called before a module-scope
vi.useFakeTimers() stays flagged.
- readTestRedisUrl throws when CI is set and TEST_REDIS_URL is missing, so
Redis-gated integration suites can no longer pass by skipping
- start the postgres:16 service only on integration (push, 1/4), the one job
whose step uses it
- move the two env-gated smoke files that no workflow enables to *.live.test.ts
and shrink the test-patterns baseline accordingly
* chore(tests): tighten check:test-patterns and shrink its baseline
- Exempt *.live.test.ts from global-remock and local-factory: live suites bind
real boundaries (real Postgres via a re-mocked @sim/db).
- Fail when a central mock vi.mocks an @/ module id that no longer resolves;
repoint copilot-http to @/lib/mothership/request/http (renamed in #8208)
and drop executor.mock's mocks of deleted modules. The check also scans
vitest.setup.ts, whose mock and alias of the deleted @/stores/console/store
are removed.
- Gate local-helper on the workspace depending on @sim/testing.
- redundant-hook inspects every afterEach statement and the leading run of a
beforeEach (a later reset can deliberately discard setup's own calls).
- New module-scope-stub rule: module-scope vi.stubGlobal/stubEnv/spyOn is
undone before the first test; delete the six dead fetch stubs.
- Rewrite @sim/testing @example barrel imports to direct paths.
- Replace real sleeps with fake timers in file-doc-store and update-cost.
- Convert table-constants and sim-search-connectors local factories to the
central mocks; fold v1-route's subscription/rate-limiter duplicates into
billingSubscriptionMock/rateLimiterMock.
Baseline: 140 -> 92 entries.
* fix(tests): catch exported and type-asserted module-scope stubs, and cover the stub and hook rules with fixtures
* fix(settings): decouple access settings from usage analytics
* fix(billing): refuse expired reads and recover transaction timeouts
* chore(settings): simplify ledger fixture and correct plan documentation
* fix(settings): use neutral read-error feedback consistently
* refactor(settings): share the named plan and seat response type
* chore(tests): consolidate test patterns — shared Vitest base, central @sim/testing mocks, check:test-patterns, lean agent docs
* fix(tests): discover central mocks from their declarations and accept the async-import form
* fix(tests): address review — mock fidelity, docs, and guards
* docs(tests): restore the heavy-graph, global-mock and permanent-implementation rules and small doc pointers