Problem
recipe.contract.ts and pantry.contract.ts both include comments noting "user ref omitted, no UserContract yet." The ref() FK primitive exists in the package but cannot be used for user ownership links until a canonical UserContract is defined and exported.
This affects every entity in the FoodFiles schema — all top-level resources are user-scoped. Without UserContract, contracts that model ownership relationships must either:
- Leave the FK untyped (losing referential integrity at the contract layer)
- Define a one-off local user shape, fragmenting the contract graph
Acceptance Criteria
Context
FoodFiles is the phase-0 consumer. All seven of its entity contracts need a user_id FK once UserContract is available. This is a blocking primitive for making contracts the authoritative source-of-truth for the FoodFiles data model.
Ref: CONTRACT-3 gap analysis (phase-0 integration audit)
Problem
recipe.contract.tsandpantry.contract.tsboth include comments noting "user ref omitted, no UserContract yet." Theref()FK primitive exists in the package but cannot be used for user ownership links until a canonicalUserContractis defined and exported.This affects every entity in the FoodFiles schema — all top-level resources are user-scoped. Without
UserContract, contracts that model ownership relationships must either:Acceptance Criteria
UserContractis exported from@stackbilt/contracts(or a@stackbilt/contracts/usersub-path)UserContractincludes at minimum:id(uuid),email(string),created_at(timestamp)ref(UserContract)resolves correctly ingenerateSQLto a FK column (user_id UUID REFERENCES users(id))ref(UserContract)ingenerateRoutes/ typed output preserves theuserIdfield in the inferred TypeScript surface typerecipe,pantry,organization) can be updated to useref(UserContract)without a breaking schema changeContext
FoodFiles is the phase-0 consumer. All seven of its entity contracts need a
user_idFK onceUserContractis available. This is a blocking primitive for making contracts the authoritative source-of-truth for the FoodFiles data model.Ref: CONTRACT-3 gap analysis (phase-0 integration audit)