@bastani/atomic 0.8.29-alpha.2 → 0.8.29-alpha.3

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.
@@ -115,79 +115,34 @@ type ExportGateDecision = {
115
115
  readonly blocking_findings: readonly ExportGateFinding[];
116
116
  };
117
117
 
118
- const refinementDecisionSchema = {
119
- type: "object",
120
- additionalProperties: false,
121
- required: ["ready_for_export", "rationale", "required_changes"],
122
- properties: {
123
- ready_for_export: { type: "boolean" },
124
- rationale: { type: "string" },
125
- required_changes: { type: "array", items: { type: "string" } },
118
+ const refinementDecisionSchema = Type.Object(
119
+ {
120
+ ready_for_export: Type.Boolean(),
121
+ rationale: Type.String(),
122
+ required_changes: Type.Array(Type.String()),
126
123
  },
127
- } as const;
124
+ { additionalProperties: false },
125
+ );
128
126
 
129
- const refinementDecisionTool = {
130
- name: "refinement_decision",
131
- label: "Refinement Decision",
132
- description: "Emit the structured design refinement decision.",
133
- promptSnippet: "Emit the final refinement decision as structured data",
134
- promptGuidelines: [
135
- "Call refinement_decision after inspecting the preview and deciding whether another refinement iteration is needed.",
136
- "This is a terminating structured-output tool; do not emit another assistant response after calling it.",
137
- ],
138
- parameters: refinementDecisionSchema,
139
- async execute(_toolCallId: string, params: RefinementDecision) {
140
- return {
141
- content: [{ type: "text" as const, text: JSON.stringify(params, null, 2) }],
142
- details: params,
143
- terminate: true,
144
- };
145
- },
146
- };
147
-
148
- const exportGateDecisionSchema = {
149
- type: "object",
150
- additionalProperties: false,
151
- required: ["has_blocking_findings", "rationale", "blocking_findings"],
152
- properties: {
153
- has_blocking_findings: { type: "boolean" },
154
- rationale: { type: "string" },
155
- blocking_findings: {
156
- type: "array",
157
- items: {
158
- type: "object",
159
- additionalProperties: false,
160
- required: ["finding", "evidence", "why_blocking", "must_fix_action", "severity"],
161
- properties: {
162
- finding: { type: "string" },
163
- evidence: { type: "string" },
164
- why_blocking: { type: "string" },
165
- must_fix_action: { type: "string" },
166
- severity: { type: "string", enum: ["P0"] },
167
- },
168
- },
169
- },
127
+ const exportGateFindingSchema = Type.Object(
128
+ {
129
+ finding: Type.String(),
130
+ evidence: Type.String(),
131
+ why_blocking: Type.String(),
132
+ must_fix_action: Type.String(),
133
+ severity: Type.Literal("P0"),
170
134
  },
171
- } as const;
135
+ { additionalProperties: false },
136
+ );
172
137
 
173
- const exportGateDecisionTool = {
174
- name: "export_gate_decision",
175
- label: "Export Gate Decision",
176
- description: "Emit the structured pre-export gate decision.",
177
- promptSnippet: "Emit the final export gate decision as structured data",
178
- promptGuidelines: [
179
- "Call export_gate_decision after auditing the preview for blocking findings.",
180
- "This is a terminating structured-output tool; do not emit another assistant response after calling it.",
181
- ],
182
- parameters: exportGateDecisionSchema,
183
- async execute(_toolCallId: string, params: ExportGateDecision) {
184
- return {
185
- content: [{ type: "text" as const, text: JSON.stringify(params, null, 2) }],
186
- details: params,
187
- terminate: true,
188
- };
138
+ const exportGateDecisionSchema = Type.Object(
139
+ {
140
+ has_blocking_findings: Type.Boolean(),
141
+ rationale: Type.String(),
142
+ blocking_findings: Type.Array(exportGateFindingSchema),
189
143
  },
190
- };
144
+ { additionalProperties: false },
145
+ );
191
146
 
192
147
  function parseRefinementDecision(text: string): RefinementDecision {
193
148
  const parsed = JSON.parse(text) as Partial<RefinementDecision>;
@@ -481,13 +436,13 @@ export default defineWorkflow("open-claude-design")
481
436
  };
482
437
  const refinementDecisionConfig = {
483
438
  ...designModelConfig,
484
- tools: [...READ_ONLY_TOOLS, refinementDecisionTool.name],
485
- customTools: [refinementDecisionTool],
439
+ tools: [...READ_ONLY_TOOLS],
440
+ schema: refinementDecisionSchema,
486
441
  };
487
442
  const exportGateDecisionConfig = {
488
443
  ...designModelConfig,
489
- tools: [...READ_ONLY_TOOLS, exportGateDecisionTool.name],
490
- customTools: [exportGateDecisionTool],
444
+ tools: [...READ_ONLY_TOOLS],
445
+ schema: exportGateDecisionSchema,
491
446
  };
492
447
 
493
448
  let designSystem: string;
@@ -850,7 +805,7 @@ export default defineWorkflow("open-claude-design")
850
805
  [
851
806
  "1. If a previous `preview-display-*` step captured annotated user feedback or notes, honor them as the primary signal.",
852
807
  "2. Otherwise, you may inspect the HTML file at preview_path directly (read it from disk) and run an impeccable `critique` against it.",
853
- "3. Decide whether the current design is ready for export using the refinement_decision structured-output tool.",
808
+ "3. Decide whether the current design is ready for export using the schema-backed structured_output tool.",
854
809
  "4. If refinement is still needed, put specific changes in required_changes ordered by user value and implementation risk.",
855
810
  "5. Never request changes that contradict DESIGN.md unless you explicitly identify and explain the conflict.",
856
811
  ].join("\n"),
@@ -858,7 +813,7 @@ export default defineWorkflow("open-claude-design")
858
813
  [
859
814
  "output_format",
860
815
  [
861
- "Call the refinement_decision tool after your inspection.",
816
+ "Call structured_output after your inspection.",
862
817
  "Set ready_for_export=true only when the current preview needs no further refinement before export.",
863
818
  "Set ready_for_export=false and populate required_changes when another polish iteration is needed.",
864
819
  ].join("\n"),
@@ -1058,14 +1013,14 @@ export default defineWorkflow("open-claude-design")
1058
1013
  "1. Read the HTML at preview_path and score it across all five audit dimensions.",
1059
1014
  "2. Scan for banned anti-patterns, accessibility blockers, severe visual regressions, missing critical states, and handoff gaps.",
1060
1015
  "3. Only mark findings as blocking when they would materially harm implementation or user experience (impeccable P0 severity).",
1061
- "4. Decide whether export is blocked using the export_gate_decision structured-output tool.",
1016
+ "4. Decide whether export is blocked using the schema-backed structured_output tool.",
1062
1017
  "5. Every blocking finding must include selector-level evidence and a must-fix action.",
1063
1018
  ].join("\n"),
1064
1019
  ],
1065
1020
  [
1066
1021
  "output_format",
1067
1022
  [
1068
- "Call the export_gate_decision tool after the audit.",
1023
+ "Call structured_output after the audit.",
1069
1024
  "Set has_blocking_findings=true only when one or more P0 findings block export.",
1070
1025
  "Populate blocking_findings with every blocking P0 issue; leave it empty when export is safe.",
1071
1026
  ].join("\n"),
@@ -20,6 +20,8 @@ export type RalphWorkflowOutputs = WorkflowOutputValues & {
20
20
  readonly result?: string;
21
21
  readonly plan?: string;
22
22
  readonly plan_path?: string;
23
+ readonly research?: string;
24
+ readonly research_path?: string;
23
25
  readonly implementation_notes_path?: string;
24
26
  readonly pr_report?: string;
25
27
  readonly approved?: boolean;