Make `PromptNode` and `PromptElement` types more React-like #4
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.46) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 125 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.289
Shallow Review Depth
shallow_review_depth
0.289
Self Review
self_review
0.140
Real PR Conversation Timeline
1 comments
"Review active on #4"
general
weight: 0.35
unknown
This PR makes
PromptNodeandPromptElementtypes more similar toReact.ReactNodeandReact.ReactElement, respectively. That is, thePromptElementtype now encapsulates all the internal object representations of elements created throughPrompt.createElementand JSX transpilation, andPromptNodenow encapsulates all types that can be rendered (thePromptElementtype in addition to literal types like strings and numbers).Fixing these types allows some
Array.prototype.flat()calls that were used to wrangle with Typescript to be removed.NOTE: This change may require changing the return types of Priompt components from
PromptElementtoPromptNode. For example, the following would cause a type error because thePromptElementtype does not include strings, even thoughExamplePromptis a renderable component.Changing the
PromptElementtype toPromptNodewould fix this type error.