uidex 0.10.0 → 0.11.0

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.
@@ -34,19 +34,39 @@ interface StateDecl {
34
34
  name: string;
35
35
  /** Canonical kind for the state-matrix axis (defaults to `variant`). */
36
36
  kind?: StateKind;
37
- /** Acceptance criteria that only this state can evidence. */
38
- acceptance?: string[];
37
+ /**
38
+ * Acceptance criteria that only this state can evidence. Normalized into the
39
+ * same `{ id, rev, text }` regime as entity-level `acceptance` (one
40
+ * criterion-id namespace per entity), so per-state criteria are claimable by
41
+ * `uidexCovers` and visible to every acceptance gate.
42
+ */
43
+ acceptance?: AcceptanceCriterion[];
39
44
  description?: string;
40
45
  }
46
+ /**
47
+ * A normalized acceptance criterion. Authored either as a bare string (sugar:
48
+ * `id` is a deterministic kebab slug of the text, `rev` is 1) or as an object
49
+ * `{ id, rev?, text }`; parse-time normalization means everything downstream —
50
+ * audit, scaffold, the devtools — always sees this object shape. `rev` is the
51
+ * pin flows cover against (`uidexCovers("entity", "id@rev")`): bumping it when
52
+ * the criterion's meaning changes is what makes outdated-coverage detectable.
53
+ */
54
+ interface AcceptanceCriterion {
55
+ id: string;
56
+ rev: number;
57
+ text: string;
58
+ }
41
59
  interface Metadata {
42
60
  name?: string;
43
61
  description?: string;
44
- acceptance?: string[];
62
+ acceptance?: AcceptanceCriterion[];
45
63
  notes?: string;
46
64
  composes?: EntityRef[];
47
65
  flows?: readonly string[];
48
66
  features?: string[];
49
67
  widgets?: string[];
68
+ /** Page ids a feature declares it must be mounted on (feature kind only). */
69
+ surfaces?: string[];
50
70
  /** Declared render states (see StateDecl); the capture-completeness gate. */
51
71
  states?: StateDecl[];
52
72
  /**
@@ -84,12 +104,25 @@ interface FlowStep {
84
104
  entityId: string;
85
105
  action?: string;
86
106
  }
107
+ /**
108
+ * A per-criterion coverage claim a flow makes via
109
+ * `uidexCovers("<entityId>", "<criterionId>@<rev>")`. The rev is REQUIRED at
110
+ * the claim site — a rev-less claim could never go stale, which would defeat
111
+ * the outdated-detection the pin exists for.
112
+ */
113
+ interface FlowCover {
114
+ entity: string;
115
+ criterion: string;
116
+ rev: number;
117
+ }
87
118
  interface Flow {
88
119
  kind: "flow";
89
120
  id: string;
90
121
  loc: Location;
91
122
  touches: string[];
92
123
  steps: FlowStep[];
124
+ /** Acceptance-criterion coverage claims made inside this flow's describe. */
125
+ covers?: FlowCover[];
93
126
  }
94
127
  interface Page extends EntityWithMetaBase {
95
128
  kind: "page";
@@ -34,19 +34,39 @@ interface StateDecl {
34
34
  name: string;
35
35
  /** Canonical kind for the state-matrix axis (defaults to `variant`). */
36
36
  kind?: StateKind;
37
- /** Acceptance criteria that only this state can evidence. */
38
- acceptance?: string[];
37
+ /**
38
+ * Acceptance criteria that only this state can evidence. Normalized into the
39
+ * same `{ id, rev, text }` regime as entity-level `acceptance` (one
40
+ * criterion-id namespace per entity), so per-state criteria are claimable by
41
+ * `uidexCovers` and visible to every acceptance gate.
42
+ */
43
+ acceptance?: AcceptanceCriterion[];
39
44
  description?: string;
40
45
  }
46
+ /**
47
+ * A normalized acceptance criterion. Authored either as a bare string (sugar:
48
+ * `id` is a deterministic kebab slug of the text, `rev` is 1) or as an object
49
+ * `{ id, rev?, text }`; parse-time normalization means everything downstream —
50
+ * audit, scaffold, the devtools — always sees this object shape. `rev` is the
51
+ * pin flows cover against (`uidexCovers("entity", "id@rev")`): bumping it when
52
+ * the criterion's meaning changes is what makes outdated-coverage detectable.
53
+ */
54
+ interface AcceptanceCriterion {
55
+ id: string;
56
+ rev: number;
57
+ text: string;
58
+ }
41
59
  interface Metadata {
42
60
  name?: string;
43
61
  description?: string;
44
- acceptance?: string[];
62
+ acceptance?: AcceptanceCriterion[];
45
63
  notes?: string;
46
64
  composes?: EntityRef[];
47
65
  flows?: readonly string[];
48
66
  features?: string[];
49
67
  widgets?: string[];
68
+ /** Page ids a feature declares it must be mounted on (feature kind only). */
69
+ surfaces?: string[];
50
70
  /** Declared render states (see StateDecl); the capture-completeness gate. */
51
71
  states?: StateDecl[];
52
72
  /**
@@ -84,12 +104,25 @@ interface FlowStep {
84
104
  entityId: string;
85
105
  action?: string;
86
106
  }
107
+ /**
108
+ * A per-criterion coverage claim a flow makes via
109
+ * `uidexCovers("<entityId>", "<criterionId>@<rev>")`. The rev is REQUIRED at
110
+ * the claim site — a rev-less claim could never go stale, which would defeat
111
+ * the outdated-detection the pin exists for.
112
+ */
113
+ interface FlowCover {
114
+ entity: string;
115
+ criterion: string;
116
+ rev: number;
117
+ }
87
118
  interface Flow {
88
119
  kind: "flow";
89
120
  id: string;
90
121
  loc: Location;
91
122
  touches: string[];
92
123
  steps: FlowStep[];
124
+ /** Acceptance-criterion coverage claims made inside this flow's describe. */
125
+ covers?: FlowCover[];
93
126
  }
94
127
  interface Page extends EntityWithMetaBase {
95
128
  kind: "page";