@adcops/autocore-react 3.3.115 → 3.3.118

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.
Files changed (62) hide show
  1. package/dist/components/index.d.ts +10 -2
  2. package/dist/components/index.d.ts.map +1 -1
  3. package/dist/components/index.js +1 -1
  4. package/dist/components/tis/CycleConfigDialog.d.ts +39 -0
  5. package/dist/components/tis/CycleConfigDialog.d.ts.map +1 -0
  6. package/dist/components/tis/CycleConfigDialog.js +1 -0
  7. package/dist/components/tis/CycleConfigForm.d.ts +22 -0
  8. package/dist/components/tis/CycleConfigForm.d.ts.map +1 -0
  9. package/dist/components/tis/CycleConfigForm.js +1 -0
  10. package/dist/components/tis/CycleStatusStrip.d.ts +10 -0
  11. package/dist/components/tis/CycleStatusStrip.d.ts.map +1 -0
  12. package/dist/components/tis/CycleStatusStrip.js +1 -0
  13. package/dist/components/tis/TestDataView.d.ts +4 -0
  14. package/dist/components/tis/TestDataView.d.ts.map +1 -1
  15. package/dist/components/tis/TestDataView.js +1 -1
  16. package/dist/components/tis/TestFieldRow.d.ts +151 -0
  17. package/dist/components/tis/TestFieldRow.d.ts.map +1 -0
  18. package/dist/components/tis/TestFieldRow.js +1 -0
  19. package/dist/components/tis/TestSetupForm.d.ts +15 -51
  20. package/dist/components/tis/TestSetupForm.d.ts.map +1 -1
  21. package/dist/components/tis/TestSetupForm.js +1 -1
  22. package/dist/components/tis/TestSetupView.d.ts.map +1 -1
  23. package/dist/components/tis/TestSetupView.js +1 -1
  24. package/dist/components/tis/TisProvider.d.ts +80 -0
  25. package/dist/components/tis/TisProvider.d.ts.map +1 -1
  26. package/dist/components/tis/TisProvider.js +1 -1
  27. package/dist/components/tis-editor/TisConfigEditor.d.ts.map +1 -1
  28. package/dist/components/tis-editor/TisConfigEditor.js +1 -1
  29. package/dist/components/tis-editor/editor/CycleConfigSection.d.ts +19 -0
  30. package/dist/components/tis-editor/editor/CycleConfigSection.d.ts.map +1 -0
  31. package/dist/components/tis-editor/editor/CycleConfigSection.js +1 -0
  32. package/dist/components/tis-editor/editor/FieldArrayEditor.d.ts.map +1 -1
  33. package/dist/components/tis-editor/editor/FieldArrayEditor.js +1 -1
  34. package/dist/components/tis-editor/editor/MethodFormEditor.d.ts.map +1 -1
  35. package/dist/components/tis-editor/editor/MethodFormEditor.js +1 -1
  36. package/dist/components/tis-editor/editor/TestFieldDialog.d.ts +3 -0
  37. package/dist/components/tis-editor/editor/TestFieldDialog.d.ts.map +1 -1
  38. package/dist/components/tis-editor/editor/TestFieldDialog.js +1 -1
  39. package/dist/components/tis-editor/editor/ViewsEditor.d.ts.map +1 -1
  40. package/dist/components/tis-editor/editor/ViewsEditor.js +1 -1
  41. package/dist/components/tis-editor/types.d.ts +28 -1
  42. package/dist/components/tis-editor/types.d.ts.map +1 -1
  43. package/dist/components/tis-editor/validation.d.ts.map +1 -1
  44. package/dist/components/tis-editor/validation.js +1 -1
  45. package/package.json +1 -1
  46. package/src/components/index.ts +14 -0
  47. package/src/components/tis/CycleConfigDialog.tsx +173 -0
  48. package/src/components/tis/CycleConfigForm.tsx +192 -0
  49. package/src/components/tis/CycleStatusStrip.tsx +84 -0
  50. package/src/components/tis/TestDataView.tsx +19 -3
  51. package/src/components/tis/TestFieldRow.tsx +297 -0
  52. package/src/components/tis/TestSetupForm.tsx +52 -212
  53. package/src/components/tis/TestSetupView.tsx +60 -3
  54. package/src/components/tis/TisProvider.tsx +191 -0
  55. package/src/components/tis-editor/TisConfigEditor.tsx +1 -0
  56. package/src/components/tis-editor/editor/CycleConfigSection.tsx +93 -0
  57. package/src/components/tis-editor/editor/FieldArrayEditor.tsx +10 -0
  58. package/src/components/tis-editor/editor/MethodFormEditor.tsx +38 -6
  59. package/src/components/tis-editor/editor/TestFieldDialog.tsx +22 -2
  60. package/src/components/tis-editor/editor/ViewsEditor.tsx +7 -0
  61. package/src/components/tis-editor/types.ts +34 -1
  62. package/src/components/tis-editor/validation.ts +34 -2
@@ -31,6 +31,15 @@ export interface TestField {
31
31
  * non-excluded runs sharing this test's sample_id. When set, the field
32
32
  * is NOT supplied by the analysis script — the server computes it. */
33
33
  aggregate?: AggregateSpec;
34
+ /** cycle_fields only: operator-correctable after recording. Measured
35
+ * columns must stay unflagged. cycle_config_fields don't need it —
36
+ * they're annotation and are always correctable. */
37
+ editable?: boolean;
38
+ /** cycle_config_fields only: clear the operator's entry once a row has
39
+ * recorded it, so the next row can't inherit a stale annotation. Pair
40
+ * it with `required` — on its own it turns stale data into silently
41
+ * missing data. */
42
+ autoclear?: boolean;
34
43
  }
35
44
 
36
45
  export type AggFn = 'avg' | 'min' | 'max' | 'stddev' | 'count';
@@ -113,11 +122,30 @@ export interface TestConfiguration {
113
122
  defaults?: Record<string, unknown>;
114
123
  }
115
124
 
125
+ /**
126
+ * Which boundary an operator annotates `cycle_config_fields` at.
127
+ *
128
+ * 'run' one latch per Start — the same values stamp every cycle of the
129
+ * run and clear when it closes. Default; correct for a machine
130
+ * that records many cycles from one Start.
131
+ * 'cycle' one latch per cycle — values clear after each recorded row and
132
+ * the gate re-arms, so every row is annotated separately.
133
+ */
134
+ export type CycleConfigScope = 'run' | 'cycle';
135
+
116
136
  export interface TestMethod {
117
137
  label?: string;
118
138
  description?: string;
119
139
  project_fields?: TestField[];
120
140
  config_fields?: TestField[];
141
+ /** Operator-entered per-row annotation, recorded as the first Cycle Data
142
+ * columns after the row index. */
143
+ cycle_config_fields?: TestField[];
144
+ /** Boundary at which cycle_config_fields latch and autoclear. */
145
+ cycle_config_scope?: CycleConfigScope;
146
+ /** Open the Cycle Configuration dialog at the boundary rather than
147
+ * relying on the operator having filled the Cycle tab. */
148
+ prompt_before_cycle?: boolean;
121
149
  cycle_fields?: TestField[];
122
150
  results_fields?: TestField[];
123
151
  raw_data?: RawDataShape | null;
@@ -128,4 +156,9 @@ export interface TestMethod {
128
156
  [key: string]: unknown; // tolerate unknown server-side fields
129
157
  }
130
158
 
131
- export type FieldArrayKey = 'project_fields' | 'config_fields' | 'cycle_fields' | 'results_fields';
159
+ export type FieldArrayKey =
160
+ | 'project_fields'
161
+ | 'config_fields'
162
+ | 'cycle_config_fields'
163
+ | 'cycle_fields'
164
+ | 'results_fields';
@@ -10,7 +10,22 @@ import type {
10
10
  TestField, TestMethod, ChartAxis, ChartSeries,
11
11
  } from './types';
12
12
 
13
- const FIELD_ARRAY_KEYS = ['project_fields', 'config_fields', 'cycle_fields', 'results_fields'] as const;
13
+ const FIELD_ARRAY_KEYS = [
14
+ 'project_fields', 'config_fields', 'cycle_config_fields', 'cycle_fields', 'results_fields',
15
+ ] as const;
16
+
17
+ /**
18
+ * Columns TIS writes onto every cycle row itself, in `add_cycle`. Never
19
+ * declared in a field array — the author can't add them and the control
20
+ * program doesn't supply them — but every recorded row carries them, so a
21
+ * chart view may plot against one. `x.field: "cycle_index"` is the
22
+ * canonical "value by cycle" chart.
23
+ *
24
+ * Mirrors `SERVER_ASSIGNED_CYCLE_COLUMNS` in autocore-tis `main.rs`. Keep
25
+ * the two in step: this list being short by one is what made a valid method
26
+ * unsaveable (gen4_ac, 2026-08-12).
27
+ */
28
+ const SERVER_ASSIGNED_CYCLE_COLUMNS = ['cycle_index', 'timestamp', 'checksum'] as const;
14
29
 
15
30
  export interface ValidationError {
16
31
  /** Dotted path: "<arrayKey>.<index>.<sub>" or "views.<viewId>.x" etc. */
@@ -49,7 +64,7 @@ export function validateMethod(methodId: string, m: TestMethod): ValidationError
49
64
  const resultTypes = new Map<string, string>(
50
65
  ((m.results_fields as TestField[] | undefined) ?? []).map((f) => [f.name, String(f.type)])
51
66
  );
52
- for (const key of ['project_fields', 'config_fields', 'cycle_fields'] as const) {
67
+ for (const key of ['project_fields', 'config_fields', 'cycle_config_fields', 'cycle_fields'] as const) {
53
68
  ((m[key] as TestField[] | undefined) ?? []).forEach((f, i) => {
54
69
  if (f.aggregate) {
55
70
  errs.push({ path: `${key}.${i}.aggregate`, message: `${methodId}.${key}.${f.name}: aggregate is only valid on results_fields` });
@@ -74,12 +89,29 @@ export function validateMethod(methodId: string, m: TestMethod): ValidationError
74
89
  }
75
90
  });
76
91
 
92
+ // A cycle_config_field and a cycle_field share one row namespace in
93
+ // cycles.jsonl — the same name in both means the operator's annotation
94
+ // and a measured value would fight over one column. Mirrors the
95
+ // server-side check in validate_method.
96
+ const cycleFieldNames = new Set<string>(
97
+ ((m.cycle_fields as TestField[] | undefined) ?? []).map(f => f.name).filter(Boolean),
98
+ );
99
+ ((m.cycle_config_fields as TestField[] | undefined) ?? []).forEach((f, i) => {
100
+ if (f.name && cycleFieldNames.has(f.name)) {
101
+ errs.push({
102
+ path: `cycle_config_fields.${i}.name`,
103
+ message: `${methodId}: "${f.name}" is declared as both a cycle_config_field and a cycle_field. They share one row namespace; rename one.`,
104
+ });
105
+ }
106
+ });
107
+
77
108
  // Build sets for axis-reference resolution.
78
109
  const knownFields = new Set<string>();
79
110
  for (const key of FIELD_ARRAY_KEYS) {
80
111
  const arr = (m[key] as TestField[] | undefined) ?? [];
81
112
  arr.forEach((f) => f.name && knownFields.add(f.name));
82
113
  }
114
+ for (const name of SERVER_ASSIGNED_CYCLE_COLUMNS) knownFields.add(name);
83
115
  const knownColumns = new Set<string>(
84
116
  Object.keys(((m.raw_data as any)?.columns ?? {}) as Record<string, unknown>)
85
117
  );