?
JewelConfig
TypeThe three functions you author for a jewel: `subject`, `propose`, and an optional `grade`.
What you pass to defineJewel. Declare subject before propose: the subject type is inferred from the projection and flows into propose's parameter. subject projects the method input to what identifies the work and never the decision; propose returns the input to submit or null to abstain; grade is optional and defaults to a deep-equal on the method input. grade receives { proposed, actual } and may be async, so a generative verb can grade with a model-run rubric.
JewelConfig.ts
interface JewelConfig<M, S> { subject: (input: MethodInput) => S propose: (subject: S) => JewelProposal | Promise<JewelProposal> grade?: (ctx: { proposed, actual }) => JewelVerdict | Promise<JewelVerdict> }
Fields
subject
(input) => S
Projects the method input to what identifies the work, never the decision. Its return type flows into propose.
propose
(subject) => JewelProposal
Returns the input to submit, or null to abstain. Arbitrary TypeScript; plain imports for context, runTask for judgment.
grade
(ctx) => JewelVerdict
Optional. Receives { proposed, actual }; omit for a deep-equal on the method input. May be async.