Skip to content

Commit d67de71

Browse files
dmealingclaude
andcommitted
refactor(metadata): extends the take-core cluster from WizardOutput
TurnLens + CouncilTurn hand-copied WizardOutput's take-core (takeMarkdown/oneLineSummary/confidence/keyClaims/citations) and had DROPPED oneLineSummary's 140 cap and the confidence 0–1 validator on the copies. Point them at the owner via extends: WizardOutput.<field> (keyClaims/citations keep their physical column + jsonb overrides). CouncilTurn's persisted columns are byte-identical (no migration); the copies now correctly inherit .max(140) and the .min(0).max(1) validator child. Regenerated; drift/tsc/build/203 tests green. Surfaced by the metaobjects-audit same-name-field census (drift signature 10). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XeGSV3StPCcJGZNNJ4ZfAb
1 parent 07482ad commit d67de71

4 files changed

Lines changed: 24 additions & 19 deletions

File tree

‎metaobjects/meta-council-turn.yaml‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,27 @@ metadata:
3636
name: stance
3737
extends: wizardStance
3838
required: true
39+
# The take-core is the persisted form of WizardOutput — single-source the
40+
# shape from the owner; keyClaims/citations keep the entity's physical
41+
# column names + jsonb storage as overrides on top of the inherited shape.
3942
- field.string:
4043
name: takeMarkdown
41-
required: true
44+
extends: WizardOutput.takeMarkdown
4245
- field.string:
4346
name: oneLineSummary
44-
required: true
47+
extends: WizardOutput.oneLineSummary
4548
- field.float:
4649
name: confidence
47-
required: true
50+
extends: WizardOutput.confidence
4851
- field.string:
4952
name: keyClaims
53+
extends: WizardOutput.keyClaims
5054
column: key_claims_json
51-
isArray: true
52-
required: true
5355
- field.object:
5456
name: citations
57+
extends: WizardOutput.citations
5558
column: citations_json
56-
objectRef: SourceLens
57-
isArray: true
58-
storage: jsonb # explicit on the persisted column (the default; stated for clarity)
59-
required: false
59+
storage: jsonb
6060
- identity.primary:
6161
fields: [councilId, ordinal]
6262
- identity.reference:

‎metaobjects/meta-turn-lens.yaml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ metadata:
1818
name: stance
1919
extends: wizardStance
2020
required: true
21+
# The take-core is a projection of WizardOutput — single-source its shape
22+
# (oneLineSummary's 140 cap, confidence's 0–1 validator) from the owner.
2123
- field.string:
2224
name: takeMarkdown
23-
required: true
25+
extends: WizardOutput.takeMarkdown
2426
- field.string:
2527
name: oneLineSummary
26-
required: true
28+
extends: WizardOutput.oneLineSummary
2729
- field.float:
2830
name: confidence
29-
required: true
31+
extends: WizardOutput.confidence

‎src/db/generated/CouncilTurn.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ export const CouncilTurnInsertSchema = z.object({
7575
kind: z.enum(["wizard", "error"]),
7676
stance: WizardStanceEnum,
7777
takeMarkdown: z.string().min(1),
78-
oneLineSummary: z.string().min(1),
79-
confidence: z.number(),
78+
oneLineSummary: z.string().min(1).max(140),
79+
confidence: z.number().min(0).max(1),
8080
keyClaims: z.array(z.string()),
8181
citations: z.array(SourceLensInsertSchema).optional(),
8282
});
@@ -90,8 +90,8 @@ export const CouncilTurnUpdateSchema = z.object({
9090
kind: z.enum(["wizard", "error"]).optional(),
9191
stance: WizardStanceEnum.optional(),
9292
takeMarkdown: z.string().min(1).optional(),
93-
oneLineSummary: z.string().min(1).optional(),
94-
confidence: z.number().optional(),
93+
oneLineSummary: z.string().min(1).max(140).optional(),
94+
confidence: z.number().min(0).max(1).optional(),
9595
keyClaims: z.array(z.string()).optional(),
9696
citations: z.array(SourceLensInsertSchema).optional().nullable(),
9797
});
@@ -188,7 +188,10 @@ export const CouncilTurn = {
188188
label: "One Line Summary",
189189
view: "text",
190190
htmlType: "text",
191-
rules: { required: "One Line Summary is required" },
191+
rules: {
192+
required: "One Line Summary is required",
193+
maxLength: { value: 140, message: "Must be 140 characters or fewer" },
194+
},
192195
},
193196
confidence: {
194197
name: "confidence",

‎src/db/generated/TurnLens.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ export const TurnLensInsertSchema = z.object({
1818
wizardName: z.string().min(1).max(128),
1919
stance: WizardStanceEnum,
2020
takeMarkdown: z.string().min(1),
21-
oneLineSummary: z.string().min(1),
22-
confidence: z.number(),
21+
oneLineSummary: z.string().min(1).max(140),
22+
confidence: z.number().min(0).max(1),
2323
});

0 commit comments

Comments
 (0)