Skip to content

Conversation

@valentin0h
Copy link
Collaborator

scazan and others added 14 commits January 6, 2026 12:28
This is a PR related to our movement to a new system for decisions that
is more flexible and more production ready. This was effectively a
prototype of decision making.

Moving encoders where names would overlap with the new system to
legacyXXX for clarity and deprecating a few methods that might need to
stick around for the results screens to still work (we only need to
support the results screen at this point).

Follow up PRs coming to put the new schemas in place, update the
frontend, and start using the new system.

PRs stacked onto this PR:
#432 
#408
## Summary
- Add new `decisionSchemas` module with phase-based schema types
- Add `PhaseDefinition`, `PhaseRules`, `DecisionSchemaDefinition` types
- Add `createInstanceDataFromTemplate` helper
- Add `@rjsf/utils` dependency for JSON Schema types

All legacy items will be cleaned up and removed after we successfully
ship the new system.
## Summary
- Fix hydration mismatch on landing page feed by prefetching data on the
server
- Add `@op/api/server` export with `createServerUtils()` for server-side
tRPC query prefetching
- Use `HydrationBoundary` to pass prefetched data to client's React
Query cache

## Test plan
- [ ] Visit landing page - no hydration errors in console
- [ ] Infinite scroll still works correctly
## Summary
- Add `DELETE /organization/{organizationProfileId}` endpoint for
deleting organizations
- Requires admin profile DELETE permission to delete
- Invalidates organization and orgUser caches after deletion

## Tests included
- [x] Tests for successful deletion as admin
- [x] Tests for unauthorized access (non-member, member without admin
role)
- [x] Tests for not found and invalid UUID cases
This consolidates some of the decisions functionality into a single
service and removes some no longer necessary code.
This is preparation for more changes to these files.

There should be no "changes" in logic here but instead some
organization.
This transitions us from "stateId" naming over to "phaseId" naming for
decision making v2. To avoid breaking changes, we also process our state
IDs into phase Ids temporarily so we can migrate the data later.

In preparation for #441
## Summary
- Remove redundant `if (!user)` checks from service functions where the
`User` type is already non-nullable
- Removing them also prevents AI assistants from learning this as a
pattern to replicate in the codebase
This adds in the API for decision instances to be created. It also
defines some of the key ideas around decision making schemas with the
idea that we should be able to support most possibilities in terms of
decision processes. While the schema should be generally open and
flexible it is entirely possible that we will impose "business logic"
restrictions on top for simplicity.
## Summary

Moves query and mutation channel registration from HTTP headers to the
response body.

## Why

HTTP headers don't work with request batching - headers are shared
across all operations in a batch, so channel info from multiple
procedures gets merged incorrectly.

This approach:
- Embeds channels per-procedure in the response body (`_meta.channels`)
- Works with regular batching (each item has its own channels)
- Works with stream batching (channels arrive with each streamed result)
- Middleware wraps, client link unwraps - transparent to app code

## Changes

- `withChannelMeta` middleware wraps responses with `{ _data, _meta: {
channels } }`
- Client link extracts channels and unwraps before data reaches React
Query
- Removed header-based channel logic from route handler
- Removed `QUERY_CHANNELS_HEADER` and `MUTATION_CHANNELS_HEADER`
constants
…451)

This adds skip logic in our migrations to avoid changing the preview
deployment's DB while working on a branch (since our preview deployments
use a single database for now until we get DB branching in). Allows us
to use preview deployments for 90% of our branches.


https://vercel.com/docs/environment-variables/system-environment-variables#VERCEL_ENV
Improves our log handling for edge functions since OTel tools generally
don't work well on edge. This one updates the RecordProcessor to the
simpler one to use in edge which is compatible.
Adds an exception for running migrations on the dev branch in CD which
is a `preview` deployment.
## Summary
- Upgrade Storybook from 8.6.2 to 10.1.11
- Update import paths from `@storybook/react` to `@storybook/react-vite`
- Consolidate addons and remove unused packages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants