@qontinui/shared-types 0.3.0 → 0.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qontinui/shared-types",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Shared TypeScript types for the Qontinui ecosystem",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -5,13 +5,13 @@
5
5
  * `qontinui-runner/src-tauri/scripts/generate_types.sh`.
6
6
  */
7
7
 
8
- import type { Confidence } from './Confidence';
8
+ import type { SpecCheckConfidence } from './SpecCheckConfidence';
9
9
 
10
10
  /**
11
11
  * The single state the matcher recommends the caller treat as "current".
12
12
  */
13
13
  export interface RecommendedState {
14
- confidence: Confidence;
14
+ confidence: SpecCheckConfidence;
15
15
  /**
16
16
  * Free-form explanation (e.g. "highest match rate among all states").
17
17
  */
@@ -0,0 +1,85 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated.
4
+ * DO NOT MODIFY IT BY HAND. Regenerate with `just generate-types` or
5
+ * `qontinui-runner/src-tauri/scripts/generate_types.sh`.
6
+ */
7
+
8
+ /**
9
+ * Tagged sum-type for every event broadcast on the Spec API channel.
10
+ *
11
+ * Serialization uses `serde(tag = "type", rename_all = "kebab-case")` so
12
+ * the wire discriminator is exactly the SSE event name (e.g.
13
+ * `"spec-changed"`, `"spec-check-invoked"`).
14
+ */
15
+ export type SpecApiEvent =
16
+ | (SpecChanged & {
17
+ type: "spec-changed";
18
+ })
19
+ | {
20
+ at_ms: number;
21
+ /**
22
+ * "http" | "mcp" | "workflow-step"
23
+ */
24
+ invoked_via: string;
25
+ page_ids: string[];
26
+ snapshot_id: string;
27
+ type: "spec-check-invoked";
28
+ [k: string]: unknown;
29
+ }
30
+ | {
31
+ at_ms: number;
32
+ eval_error_count: number;
33
+ no_match_count: number;
34
+ overall_match_rate: number;
35
+ page_count: number;
36
+ partial_match_count: number;
37
+ perfect_match_count: number;
38
+ snapshot_id: string;
39
+ total_duration_ms: number;
40
+ type: "spec-check-completed";
41
+ [k: string]: unknown;
42
+ }
43
+ | {
44
+ at_ms: number;
45
+ conjunct_name: string;
46
+ /**
47
+ * Small scalar/struct — NOT the full result.
48
+ */
49
+ observed: {
50
+ [k: string]: unknown;
51
+ };
52
+ page_id: string;
53
+ /**
54
+ * serde-tagged variant name of `ConjunctRule`
55
+ */
56
+ rule_kind: string;
57
+ snapshot_id: string;
58
+ type: "spec-check-policy-violation";
59
+ [k: string]: unknown;
60
+ }
61
+ | {
62
+ at_ms: number;
63
+ /**
64
+ * Expected 2 per design §6.4.
65
+ */
66
+ consecutive_greens: number;
67
+ page_id: string;
68
+ proposal_id: string;
69
+ /**
70
+ * The snapshot that produced the second green.
71
+ */
72
+ snapshot_id: string;
73
+ type: "flywheel-proposal-promoted";
74
+ [k: string]: unknown;
75
+ }
76
+ | {
77
+ at_ms: number;
78
+ failing_assertion_id: string;
79
+ failing_state_id: string;
80
+ page_id: string;
81
+ proposal_id: string;
82
+ snapshot_id: string;
83
+ type: "flywheel-proposal-demoted";
84
+ [k: string]: unknown;
85
+ };
@@ -12,4 +12,4 @@
12
12
  * cross-repo schema registry; registered as `SpecCheckConfidence` in
13
13
  * `schema_export.rs`. See module docs.
14
14
  */
15
- export type Confidence = "high" | "medium" | "low";
15
+ export type SpecCheckConfidence = "high" | "medium" | "low";
@@ -11,12 +11,12 @@ import type { AssertionResult } from './AssertionResult';
11
11
  import type { AssertionSeverityCounts } from './AssertionSeverityCounts';
12
12
  import type { BridgeFingerprint } from './BridgeFingerprint';
13
13
  import type { CandidateMiss } from './CandidateMiss';
14
- import type { Confidence } from './Confidence';
15
14
  import type { FieldDiff } from './FieldDiff';
16
15
  import type { MatchOutcome } from './MatchOutcome';
17
16
  import type { MatchedElement } from './MatchedElement';
18
17
  import type { MissReason } from './MissReason';
19
18
  import type { RecommendedState } from './RecommendedState';
19
+ import type { SpecCheckConfidence } from './SpecCheckConfidence';
20
20
  import type { SpecCheckSummary } from './SpecCheckSummary';
21
21
  import type { StateMatchResult } from './StateMatchResult';
22
22
 
@@ -6,9 +6,9 @@
6
6
  */
7
7
 
8
8
  import type { AssertionSeverityCounts } from './AssertionSeverityCounts';
9
- import type { Confidence } from './Confidence';
10
9
  import type { MatchOutcome } from './MatchOutcome';
11
10
  import type { RecommendedState } from './RecommendedState';
11
+ import type { SpecCheckConfidence } from './SpecCheckConfidence';
12
12
 
13
13
  /**
14
14
  * Aggregate summary across all evaluated states.
@@ -19,6 +19,15 @@ export interface SpecCheckSummary {
19
19
  * Mean of per-state match rates, weighted equally.
20
20
  */
21
21
  overallMatchRate: number;
22
+ /**
23
+ * Diagnostic explaining why `recommended_state` is `None`. Set when
24
+ * the matcher *deliberately* withholds a recommendation (e.g. the
25
+ * spec failed distinctness validation per §5.12); absent otherwise
26
+ * (e.g. when every state simply scored below the confidence floor).
27
+ * Free-form for forward-compat; current values:
28
+ * `"spec_validation_failed"`.
29
+ */
30
+ recommendationReason?: string | null;
22
31
  /**
23
32
  * The single state (if any) the matcher recommends the caller treat
24
33
  * as "current". `None` when the matcher has no preference.
@@ -326,6 +326,7 @@ export type { SearchResultItem } from './SearchResultItem';
326
326
  export type { SearchStrategy } from './SearchStrategy';
327
327
  export type { SemanticSearchRequest } from './SemanticSearchRequest';
328
328
  export type { SemanticSearchResponse } from './SemanticSearchResponse';
329
+ export type { SpecApiEvent } from './SpecApiEvent';
329
330
  export type { SpecCheckConfidence } from './SpecCheckConfidence';
330
331
  export type { SpecCheckPolicy } from './SpecCheckPolicy';
331
332
  export type { SpecCheckResult } from './SpecCheckResult';