@bitmagic/asset-core 0.2.7-dev.0 → 0.2.7-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -17,6 +17,10 @@ export { generateAnimationAsset, animationParamsSchema, getConfiguredAnimationMo
17
17
  export type { AnimationParams, AnimationResult } from './generators/animation.js';
18
18
  export { fetchContentLength } from './http.js';
19
19
  export { PIXAR_VOXEL_STYLE, MAX_COVER_DESIGN_CHARS, buildCoverArtPrompt } from './cover-prompt.js';
20
+ export { JUDGE_DIMENSIONS, judgeScorecardSchema } from './judge-scorecard.js';
21
+ export type { JudgeDimension, JudgeScorecard } from './judge-scorecard.js';
22
+ export { JUDGE_GENRE_HINTS, JUDGE_RUBRIC, MAX_JUDGE_DESIGN_CHARS, MAX_JUDGE_SCENE_FACTS_CHARS, MAX_JUDGE_VERIFY_CHARS, buildJudgeRubric, } from './judge-prompt.js';
23
+ export type { JudgeRubricInput } from './judge-prompt.js';
20
24
  export { TERMINAL_FAILURE_CODES, TERMINAL_FAILURE_VERSION, buildTerminalFailure, isTerminalFailureCode, legacyErrorTypeFor, parseTerminalFailure, } from './terminal-failure.js';
21
25
  export type { BuildTerminalFailureInput, LegacyErrorType, TerminalFailure, TerminalFailureCode, TerminalFailureDetail, } from './terminal-failure.js';
22
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,UAAU,EACV,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,UAAU,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,iBAAiB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qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAM1D,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,yBAAyB,EACzB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC"}
package/dist/index.js CHANGED
@@ -9,6 +9,8 @@ export { generateProp, propParamsSchema } from './generators/prop.js';
9
9
  export { generateAnimationAsset, animationParamsSchema, getConfiguredAnimationModel, ANIMATION_MODEL_TEXT_TO_MOTION_3, ANIMATION_MODEL_TEXT_TO_MOTION_2, ANIMATION_MODEL_OLDER, } from './generators/animation.js';
10
10
  export { fetchContentLength } from './http.js';
11
11
  export { PIXAR_VOXEL_STYLE, MAX_COVER_DESIGN_CHARS, buildCoverArtPrompt } from './cover-prompt.js';
12
+ export { JUDGE_DIMENSIONS, judgeScorecardSchema } from './judge-scorecard.js';
13
+ export { JUDGE_GENRE_HINTS, JUDGE_RUBRIC, MAX_JUDGE_DESIGN_CHARS, MAX_JUDGE_SCENE_FACTS_CHARS, MAX_JUDGE_VERIFY_CHARS, buildJudgeRubric, } from './judge-prompt.js';
12
14
  // The agent↔client terminal-failure contract. Also published as the
13
15
  // `@bitmagic/asset-core/terminal-failure` subpath: this barrel eagerly pulls in
14
16
  // the generators (and therefore zod, the forger client, and node http helpers),
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5E,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAE5F,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEnF,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAErF,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,gCAAgC,EAChC,gCAAgC,EAChC,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEnG,oEAAoE;AACpE,gFAAgF;AAChF,gFAAgF;AAChF,oEAAoE;AACpE,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,GACr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,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Quality-judge rubric composition for `bitmagic judge`. Like cover-prompt.ts
3
+ * this module composes strings only — no network, no credentials — and lives
4
+ * here so any lane that judges a game frame grades against the same rubric.
5
+ *
6
+ * Split of responsibilities: the CLI composes everything project-derived (the
7
+ * design excerpt, the genre hint, the verify summary) via buildJudgeRubric;
8
+ * the api-server owns the fixed judge instructions and the output-schema
9
+ * directive, so the instructions and judgeScorecardSchema cannot drift apart.
10
+ */
11
+ /** How much of GAME-DESIGN.md reaches the judge; the rest is dropped. */
12
+ export declare const MAX_JUDGE_DESIGN_CHARS = 4000;
13
+ /** How much verify context (run state + console tail) reaches the judge. */
14
+ export declare const MAX_JUDGE_VERIFY_CHARS = 4000;
15
+ /** How much engine scene inventory reaches the judge. */
16
+ export declare const MAX_JUDGE_SCENE_FACTS_CHARS = 2500;
17
+ /**
18
+ * The generic rubric: every dimension with concrete anchors for what a low and
19
+ * a high score look like, so two runs of a small model land near each other.
20
+ * Keep anchors about what is VISIBLE IN A FRAME — the judge sees screenshots,
21
+ * not gameplay.
22
+ */
23
+ export declare const JUDGE_RUBRIC = "Score each dimension from 1 to 10:\n\n- visual-quality: Does the frame look like a finished game? 3 = flat default\n materials, untextured primitives, harsh unshadowed lighting. 8 = cohesive\n palette, deliberate lighting, materials and shapes that read as one art style.\n- readability: Could a new player tell from this frame alone what to do and\n where to go? 3 = player, goals and hazards blend into the background. 8 = the\n player character, the route and the interactive elements pop at a glance.\n- design-fidelity: Does the frame match the game the design document describes?\n 3 = generic scene that could be any game. 8 = the described setting, mood and\n core mechanic are recognizably on screen.\n- polish: 3 = placeholder blocks, floating or intersecting props, empty default\n skybox, raw default HUD. 8 = grounded objects, dressed edges of the world,\n HUD that belongs to this game.";
24
+ /**
25
+ * Genre-specific bullets, keyed loosely on the engine's mechanic recipe names
26
+ * (mechanic-platformer.md and friends). Deliberately short: these steer the
27
+ * judge's attention, they do not restate the recipes — the full recipes are
28
+ * engine implementation docs and never reach the model.
29
+ */
30
+ export declare const JUDGE_GENRE_HINTS: Record<string, string>;
31
+ export interface JudgeRubricInput {
32
+ /** GAME-DESIGN.md content; empty when the project has none. */
33
+ designText: string;
34
+ /** Optional genre key; unknown keys are ignored. */
35
+ genre?: string;
36
+ /** One-paragraph verify summary: run state plus a console tail. */
37
+ verifySummary?: string;
38
+ /**
39
+ * A deterministic inventory of the scene (object counts and spread, assets,
40
+ * world settings), composed in code from world.json. The frame shows one
41
+ * camera angle; this is the whole world — the rubric tells the judge to
42
+ * trust it over inference from pixels, which is what stops findings like
43
+ * "the world is empty" when the content is simply behind the camera.
44
+ */
45
+ sceneFacts?: string;
46
+ }
47
+ /**
48
+ * Compose the project-derived half of the judge prompt. The result is sent as
49
+ * the text part alongside the screenshot(s); the server prepends its fixed
50
+ * judging instructions and appends the JSON output directive.
51
+ */
52
+ export declare function buildJudgeRubric({ designText, genre, verifySummary, sceneFacts }: JudgeRubricInput): string;
53
+ //# sourceMappingURL=judge-prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judge-prompt.d.ts","sourceRoot":"","sources":["../src/judge-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,yEAAyE;AACzE,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C,4EAA4E;AAC5E,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C,yDAAyD;AACzD,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,i5BAaQ,CAAC;AAElC;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAmBpD,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAOD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,EAAE,gBAAgB,GAAG,MAAM,CAmC3G"}
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Quality-judge rubric composition for `bitmagic judge`. Like cover-prompt.ts
3
+ * this module composes strings only — no network, no credentials — and lives
4
+ * here so any lane that judges a game frame grades against the same rubric.
5
+ *
6
+ * Split of responsibilities: the CLI composes everything project-derived (the
7
+ * design excerpt, the genre hint, the verify summary) via buildJudgeRubric;
8
+ * the api-server owns the fixed judge instructions and the output-schema
9
+ * directive, so the instructions and judgeScorecardSchema cannot drift apart.
10
+ */
11
+ import { JUDGE_DIMENSIONS } from './judge-scorecard.js';
12
+ /** How much of GAME-DESIGN.md reaches the judge; the rest is dropped. */
13
+ export const MAX_JUDGE_DESIGN_CHARS = 4000;
14
+ /** How much verify context (run state + console tail) reaches the judge. */
15
+ export const MAX_JUDGE_VERIFY_CHARS = 4000;
16
+ /** How much engine scene inventory reaches the judge. */
17
+ export const MAX_JUDGE_SCENE_FACTS_CHARS = 2500;
18
+ /**
19
+ * The generic rubric: every dimension with concrete anchors for what a low and
20
+ * a high score look like, so two runs of a small model land near each other.
21
+ * Keep anchors about what is VISIBLE IN A FRAME — the judge sees screenshots,
22
+ * not gameplay.
23
+ */
24
+ export const JUDGE_RUBRIC = `Score each dimension from 1 to 10:
25
+
26
+ - visual-quality: Does the frame look like a finished game? 3 = flat default
27
+ materials, untextured primitives, harsh unshadowed lighting. 8 = cohesive
28
+ palette, deliberate lighting, materials and shapes that read as one art style.
29
+ - readability: Could a new player tell from this frame alone what to do and
30
+ where to go? 3 = player, goals and hazards blend into the background. 8 = the
31
+ player character, the route and the interactive elements pop at a glance.
32
+ - design-fidelity: Does the frame match the game the design document describes?
33
+ 3 = generic scene that could be any game. 8 = the described setting, mood and
34
+ core mechanic are recognizably on screen.
35
+ - polish: 3 = placeholder blocks, floating or intersecting props, empty default
36
+ skybox, raw default HUD. 8 = grounded objects, dressed edges of the world,
37
+ HUD that belongs to this game.`;
38
+ /**
39
+ * Genre-specific bullets, keyed loosely on the engine's mechanic recipe names
40
+ * (mechanic-platformer.md and friends). Deliberately short: these steer the
41
+ * judge's attention, they do not restate the recipes — the full recipes are
42
+ * engine implementation docs and never reach the model.
43
+ */
44
+ export const JUDGE_GENRE_HINTS = {
45
+ platformer: `- Is the traversal route readable — can you see where to jump next?
46
+ - Do platforms and hazards contrast with the backdrop?
47
+ - Does the camera frame the player with room in the direction of travel?`,
48
+ racing: `- Is the track boundary unmistakable at speed?
49
+ - Do track, walls and scenery separate visually?
50
+ - Is there a sense of direction — where the next corner goes?`,
51
+ shooter: `- Are potential targets visible against the environment?
52
+ - Is there a usable crosshair/aim affordance and ammo/health HUD?
53
+ - Does the scene offer readable cover and sightlines?`,
54
+ combat: `- Do combatants stand out from the arena?
55
+ - Are health/stamina affordances present and legible?
56
+ - Does the arena read as a bounded fighting space?`,
57
+ driving: `- Is the drivable surface clearly distinct from off-road?
58
+ - Does the vehicle sit convincingly on the ground?
59
+ - Are speed cues (road markings, scenery density) present?`,
60
+ 'tower-defense': `- Is the creep path readable end to end?
61
+ - Do buildable spots and built towers read differently?
62
+ - Is the economy/wave HUD legible?`,
63
+ };
64
+ /** A section's text, trimmed and capped — empty when there is nothing to send. */
65
+ function excerpt(text, maxChars) {
66
+ return text?.trim().slice(0, maxChars) ?? '';
67
+ }
68
+ /**
69
+ * Compose the project-derived half of the judge prompt. The result is sent as
70
+ * the text part alongside the screenshot(s); the server prepends its fixed
71
+ * judging instructions and appends the JSON output directive.
72
+ */
73
+ export function buildJudgeRubric({ designText, genre, verifySummary, sceneFacts }) {
74
+ const sections = [JUDGE_RUBRIC];
75
+ const genreKey = genre?.trim().toLowerCase() ?? '';
76
+ const genreHints = JUDGE_GENRE_HINTS[genreKey];
77
+ if (genreHints) {
78
+ sections.push(`Genre-specific checks (${genreKey}):\n${genreHints}`);
79
+ }
80
+ const design = excerpt(designText, MAX_JUDGE_DESIGN_CHARS);
81
+ sections.push(design
82
+ ? `The game's design document (judge design-fidelity against this):\n${design}`
83
+ : 'No design document was provided; score design-fidelity on internal coherence — does the frame look like one deliberate game rather than assorted parts?');
84
+ const facts = excerpt(sceneFacts, MAX_JUDGE_SCENE_FACTS_CHARS);
85
+ if (facts) {
86
+ sections.push('Ground truth from the engine — the frame shows ONE camera angle of this world. Trust these '
87
+ + 'facts over anything you infer from the frame, and never report a finding they '
88
+ + `contradict (e.g. "the world is empty" when objects exist off-camera):\n${facts}`);
89
+ }
90
+ const verify = excerpt(verifySummary, MAX_JUDGE_VERIFY_CHARS);
91
+ if (verify) {
92
+ sections.push(`Context from the automated boot check of this exact build:\n${verify}`);
93
+ }
94
+ sections.push(`Findings must be specific, visible in the frame, and actionable by a developer — name the object or region and say what to change. Report at most 3, most severe first. Dimensions to score: ${JUDGE_DIMENSIONS.join(', ')}.`);
95
+ return sections.join('\n\n');
96
+ }
97
+ //# sourceMappingURL=judge-prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judge-prompt.js","sourceRoot":"","sources":["../src/judge-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,yEAAyE;AACzE,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAE3C,4EAA4E;AAC5E,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAE3C,yDAAyD;AACzD,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;iCAaK,CAAC;AAElC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,UAAU,EAA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C;QACX,QAAQ,CAAC,IAAI,CAAC,+DAA+D,MAAM,EAAE,CAAC,CAAC;IACzF,CAAC;IAED,QAAQ,CAAC,IAAI,CACX,gMAAgM,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC/N,CAAC;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,69 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The quality-judge scorecard contract, shared by the api-server judge route
4
+ * (which validates what the vision model returned) and the CLI (which
5
+ * validates the terminal frame before writing `.bitmagic/judge.json`). It
6
+ * lives here so the two sides can never drift: a scorecard the server accepts
7
+ * is by construction one the CLI can record and render.
8
+ *
9
+ * Dimension names are a fixed enum, not free text, so scores stay comparable
10
+ * run over run — "readability: 4 → 7" only means something if both runs were
11
+ * grading the same axis.
12
+ */
13
+ export declare const JUDGE_DIMENSIONS: readonly ["visual-quality", "readability", "design-fidelity", "polish"];
14
+ export type JudgeDimension = (typeof JUDGE_DIMENSIONS)[number];
15
+ export declare const judgeScorecardSchema: z.ZodObject<{
16
+ overall: z.ZodNumber;
17
+ dimensions: z.ZodArray<z.ZodObject<{
18
+ name: z.ZodEnum<["visual-quality", "readability", "design-fidelity", "polish"]>;
19
+ score: z.ZodNumber;
20
+ note: z.ZodString;
21
+ }, "strip", z.ZodTypeAny, {
22
+ name: "visual-quality" | "readability" | "design-fidelity" | "polish";
23
+ score: number;
24
+ note: string;
25
+ }, {
26
+ name: "visual-quality" | "readability" | "design-fidelity" | "polish";
27
+ score: number;
28
+ note: string;
29
+ }>, "many">;
30
+ topFindings: z.ZodArray<z.ZodObject<{
31
+ title: z.ZodString;
32
+ detail: z.ZodString;
33
+ severity: z.ZodEnum<["high", "medium", "low"]>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ title: string;
36
+ detail: string;
37
+ severity: "high" | "medium" | "low";
38
+ }, {
39
+ title: string;
40
+ detail: string;
41
+ severity: "high" | "medium" | "low";
42
+ }>, "many">;
43
+ }, "strip", z.ZodTypeAny, {
44
+ overall: number;
45
+ dimensions: {
46
+ name: "visual-quality" | "readability" | "design-fidelity" | "polish";
47
+ score: number;
48
+ note: string;
49
+ }[];
50
+ topFindings: {
51
+ title: string;
52
+ detail: string;
53
+ severity: "high" | "medium" | "low";
54
+ }[];
55
+ }, {
56
+ overall: number;
57
+ dimensions: {
58
+ name: "visual-quality" | "readability" | "design-fidelity" | "polish";
59
+ score: number;
60
+ note: string;
61
+ }[];
62
+ topFindings: {
63
+ title: string;
64
+ detail: string;
65
+ severity: "high" | "medium" | "low";
66
+ }[];
67
+ }>;
68
+ export type JudgeScorecard = z.infer<typeof judgeScorecardSchema>;
69
+ //# sourceMappingURL=judge-scorecard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judge-scorecard.d.ts","sourceRoot":"","sources":["../src/judge-scorecard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,gBAAgB,yEAKnB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuB/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The quality-judge scorecard contract, shared by the api-server judge route
4
+ * (which validates what the vision model returned) and the CLI (which
5
+ * validates the terminal frame before writing `.bitmagic/judge.json`). It
6
+ * lives here so the two sides can never drift: a scorecard the server accepts
7
+ * is by construction one the CLI can record and render.
8
+ *
9
+ * Dimension names are a fixed enum, not free text, so scores stay comparable
10
+ * run over run — "readability: 4 → 7" only means something if both runs were
11
+ * grading the same axis.
12
+ */
13
+ export const JUDGE_DIMENSIONS = [
14
+ 'visual-quality',
15
+ 'readability',
16
+ 'design-fidelity',
17
+ 'polish',
18
+ ];
19
+ export const judgeScorecardSchema = z.object({
20
+ overall: z.number().min(1).max(10),
21
+ dimensions: z
22
+ .array(z.object({
23
+ name: z.enum(JUDGE_DIMENSIONS),
24
+ score: z.number().min(1).max(10),
25
+ note: z.string().max(300),
26
+ }))
27
+ .min(1)
28
+ .max(JUDGE_DIMENSIONS.length),
29
+ topFindings: z
30
+ .array(z.object({
31
+ title: z.string().max(120),
32
+ // The detail must say what to CHANGE, not just what is wrong; the
33
+ // prompt enforces the intent, the length cap enforces the discipline.
34
+ detail: z.string().max(500),
35
+ severity: z.enum(['high', 'medium', 'low']),
36
+ }))
37
+ .max(3),
38
+ });
39
+ //# sourceMappingURL=judge-scorecard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judge-scorecard.js","sourceRoot":"","sources":["../src/judge-scorecard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;GAUG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,gBAAgB;IAChB,aAAa;IACb,iBAAiB;IACjB,QAAQ;CACA,CAAC;AAIX,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,UAAU,EAAE,CAAC;SACV,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;QAC9B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QAChC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC;KAC1B,CAAC,CACH;SACA,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,gBAAgB,CAAC,MAAM,CAAC;IAC/B,WAAW,EAAE,CAAC;SACX,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC;QAC1B,kEAAkE;QAClE,sEAAsE;QACtE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC;QAC3B,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;KAC5C,CAAC,CACH;SACA,GAAG,CAAC,CAAC,CAAC;CACV,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitmagic/asset-core",
3
- "version": "0.2.7-dev.0",
3
+ "version": "0.2.7-dev.2",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "author": "Bitmagic Oy",
6
6
  "type": "module",