@qontinui/shared-types 2.4.1 → 3.0.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.
Files changed (57) hide show
  1. package/dist/scheduler.d.cts +81 -0
  2. package/dist/scheduler.d.ts +81 -0
  3. package/package.json +1 -1
  4. package/src/generated/ChangeTimeline.d.ts +484 -0
  5. package/src/generated/CriterionVerification.d.ts +11 -0
  6. package/src/generated/DetectedAnimation.d.ts +32 -0
  7. package/src/generated/EarsPattern.d.ts +20 -0
  8. package/src/generated/EdgeTiming.d.ts +156 -0
  9. package/src/generated/ExecutePlaybookStep.d.ts +5 -4
  10. package/src/generated/ExternalRef.d.ts +22 -0
  11. package/src/generated/InterfaceMappingFrontmatter.d.ts +21 -0
  12. package/src/generated/JourneyArrivalDoubt.d.ts +26 -0
  13. package/src/generated/JourneyCoverage.d.ts +91 -0
  14. package/src/generated/JourneyDeadEnds.d.ts +109 -0
  15. package/src/generated/JourneyEdgeObservation.d.ts +3 -2
  16. package/src/generated/JourneyEdgeTimingAnswer.d.ts +88 -0
  17. package/src/generated/JourneyFilter.d.ts +35 -0
  18. package/src/generated/JourneyFrontier.d.ts +51 -0
  19. package/src/generated/JourneyGraph.d.ts +165 -0
  20. package/src/generated/JourneyGraphEdge.d.ts +45 -0
  21. package/src/generated/JourneyPriorKnowledge.d.ts +112 -0
  22. package/src/generated/JourneyReachable.d.ts +64 -0
  23. package/src/generated/JourneySearchFrontier.d.ts +59 -0
  24. package/src/generated/JourneySearchFrontierNode.d.ts +37 -0
  25. package/src/generated/JourneySteps.d.ts +65 -0
  26. package/src/generated/JourneyUnmeasuredDepartures.d.ts +84 -0
  27. package/src/generated/ManagedBy.d.ts +45 -0
  28. package/src/generated/MappingRow.d.ts +23 -0
  29. package/src/generated/MetricDistribution.d.ts +54 -0
  30. package/src/generated/RecurringAgentDispatchRole.d.ts +11 -0
  31. package/src/generated/RecurringAgentExcludedValue.d.ts +20 -0
  32. package/src/generated/RecurringAgentOs.d.ts +11 -0
  33. package/src/generated/RecurringAgentOverride.d.ts +48 -0
  34. package/src/generated/RecurringAgentParamDef.d.ts +100 -0
  35. package/src/generated/RecurringAgentParamKind.d.ts +89 -0
  36. package/src/generated/RecurringAgentParamSchema.d.ts +16 -0
  37. package/src/generated/RecurringAgentSpec.d.ts +91 -0
  38. package/src/generated/RecurringAgentState.d.ts +13 -0
  39. package/src/generated/RecurringAgentStatus.d.ts +79 -0
  40. package/src/generated/RecurringAgentStatusReport.d.ts +48 -0
  41. package/src/generated/RecurringAgentTarget.d.ts +78 -0
  42. package/src/generated/RequestFrontmatter.d.ts +30 -0
  43. package/src/generated/RequirementFrontmatter.d.ts +31 -0
  44. package/src/generated/ScheduledTask.d.ts +15 -0
  45. package/src/generated/ScheduledTaskType.d.ts +21 -0
  46. package/src/generated/SourceCitation.d.ts +25 -0
  47. package/src/generated/SourceCitationKind.d.ts +12 -0
  48. package/src/generated/SpecAcceptanceCriterion.d.ts +28 -0
  49. package/src/generated/SpecFrontmatter.d.ts +36 -0
  50. package/src/generated/SpecLanguage.d.ts +11 -0
  51. package/src/generated/StoryFrontmatter.d.ts +26 -0
  52. package/src/generated/TemplateRef.d.ts +17 -0
  53. package/src/generated/UnknownCode.d.ts +8 -1
  54. package/src/generated/index.ts +45 -3
  55. package/src/generated/CapabilityState.d.ts +0 -25
  56. package/src/generated/CliProfile.d.ts +0 -492
  57. package/src/generated/SessionFailure.d.ts +0 -129
@@ -11,6 +11,11 @@ import type { VerificationCategoryKind } from "./VerificationCategoryKind";
11
11
  /**
12
12
  * Drive a state machine through recorded transitions from a playbook.
13
13
  *
14
+ * The playbook travels inline in `content`, the only body the runner's
15
+ * executor reads. There is no path form: a `playbookPath` key on a stored
16
+ * step is ignored when it is decoded and dropped when the step is written
17
+ * back.
18
+ *
14
19
  * Wire tag: `"execute_playbook"`.
15
20
  */
16
21
  export interface ExecutePlaybookStep {
@@ -50,10 +55,6 @@ export interface ExecutePlaybookStep {
50
55
  * Display name for the step. Absent or `null` reads as `""`.
51
56
  */
52
57
  name: string;
53
- /**
54
- * Path to a playbook file.
55
- */
56
- playbookPath?: string | null;
57
58
  /**
58
59
  * Whether this step is required (default: `true` on consumer side).
59
60
  */
@@ -0,0 +1,22 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated.
4
+ * DO NOT MODIFY IT BY HAND. Regenerate with
5
+ * `qontinui-runner/src-tauri/scripts/generate_types.sh`.
6
+ */
7
+
8
+ /**
9
+ * The same item in an external system (a Jira issue, say).
10
+ */
11
+ export interface ExternalRef {
12
+ /**
13
+ * The item's key in that system, e.g. `PAY-123`.
14
+ */
15
+ key: string;
16
+ /**
17
+ * The external system, e.g. `jira`.
18
+ */
19
+ system: string;
20
+ url?: string | null;
21
+ [k: string]: unknown;
22
+ }
@@ -0,0 +1,21 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated.
4
+ * DO NOT MODIFY IT BY HAND. Regenerate with
5
+ * `qontinui-runner/src-tauri/scripts/generate_types.sh`.
6
+ */
7
+
8
+ import type { MappingRow } from "./MappingRow";
9
+ import type { TemplateRef } from "./TemplateRef";
10
+
11
+ /**
12
+ * A field-level mapping between two systems.
13
+ */
14
+ export interface InterfaceMappingFrontmatter {
15
+ id: string;
16
+ rows?: MappingRow[];
17
+ source_system: string;
18
+ target_system: string;
19
+ template?: TemplateRef | null;
20
+ [k: string]: unknown;
21
+ }
@@ -0,0 +1,26 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated.
4
+ * DO NOT MODIFY IT BY HAND. Regenerate with
5
+ * `qontinui-runner/src-tauri/scripts/generate_types.sh`.
6
+ */
7
+
8
+ /**
9
+ * Trusted affordance or `pop` rows, excluded from the graph, that ARRIVE at
10
+ * a node from a different node with outcome `changed`. Any of them may be a
11
+ * way in that the user did not need a URL for, so
12
+ * [`requires_prior_knowledge`] cannot list the node as settled. An excluded
13
+ * row that closed `error` or `settle_timeout` (or has no `toNode`) is not
14
+ * here: its recorded destination may be an intermediate state, so it routes
15
+ * to the graph-wide [`JourneyGraph::unknown_destination_arrivals`].
16
+ */
17
+ export interface JourneyArrivalDoubt {
18
+ /**
19
+ * Arrivals the request's filter excluded.
20
+ */
21
+ filtered: number;
22
+ /**
23
+ * Withdrawn arrivals.
24
+ */
25
+ withdrawn: number;
26
+ }
@@ -0,0 +1,91 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated.
4
+ * DO NOT MODIFY IT BY HAND. Regenerate with
5
+ * `qontinui-runner/src-tauri/scripts/generate_types.sh`.
6
+ */
7
+
8
+ import type { JourneyLedgerHealth } from "./JourneyLedgerHealth";
9
+
10
+ /**
11
+ * What a graph was built over — the resolution and freshness of every answer
12
+ * read from it. Rides inside the runner's `provenance.coverage`.
13
+ */
14
+ export interface JourneyCoverage {
15
+ /**
16
+ * Distinct `appVersion`s among the edges observed, sorted, `null`
17
+ * (= not reported) first.
18
+ */
19
+ appVersions: (string | null)[];
20
+ /**
21
+ * Valid, live edge rows the filter excluded.
22
+ */
23
+ edgesFilteredOut: number;
24
+ /**
25
+ * Withdrawn edge rows (`invalidatedAt` set), excluded.
26
+ */
27
+ edgesInvalidated: number;
28
+ /**
29
+ * Edge rows the graph was built from (after exclusions), INCLUDING
30
+ * `to_node_unobserved` rows.
31
+ */
32
+ edgesObserved: number;
33
+ /**
34
+ * How many of `edgesObserved` closed as `to_node_unobserved`.
35
+ */
36
+ edgesToNodeUnobserved: number;
37
+ /**
38
+ * Edges observed that reported no `runId`.
39
+ */
40
+ edgesWithoutRunId: number;
41
+ /**
42
+ * Open frontier entries per reason — every reason present, zeros
43
+ * included.
44
+ */
45
+ frontierByReason: {
46
+ [k: string]: number;
47
+ };
48
+ /**
49
+ * Nodes with at least one open frontier entry.
50
+ */
51
+ frontierNodes: number;
52
+ /**
53
+ * Open frontier entries across the graph.
54
+ */
55
+ frontierOpen: number;
56
+ /**
57
+ * Whether the ledger these rows were read from is being written — the
58
+ * runner's `/journey/health` block, repeated here so a graph that
59
+ * stopped growing (`schemaAbsent` / `writeFailing`) can never read as a
60
+ * finished one in any query response.
61
+ */
62
+ ledger: JourneyLedgerHealth;
63
+ /**
64
+ * Latest `observedAt` among the edges observed; `null` = no edges.
65
+ */
66
+ newestEdgeAt?: string | null;
67
+ /**
68
+ * Distinct nodes (by key) seen as an edge endpoint, as the from-node of
69
+ * an unobserved departure, or as a frontier node.
70
+ */
71
+ nodesObserved: number;
72
+ /**
73
+ * How many of those are unmodelled (`modelled: false`) — the graph's
74
+ * resolution, as a number.
75
+ */
76
+ nodesUnmodelled: number;
77
+ /**
78
+ * Earliest `observedAt` among the edges observed; `null` = no edges.
79
+ */
80
+ oldestEdgeAt?: string | null;
81
+ /**
82
+ * ENTRIES in [`JourneyGraph::rejected`] — one per `(kind, row,
83
+ * reason)`. The sum of their `rows` gives the number of distinct
84
+ * rejected rows (by full content).
85
+ */
86
+ rowsRejected: number;
87
+ /**
88
+ * Distinct reported `runId`s among the edges observed.
89
+ */
90
+ runs: number;
91
+ }
@@ -0,0 +1,109 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated.
4
+ * DO NOT MODIFY IT BY HAND. Regenerate with
5
+ * `qontinui-runner/src-tauri/scripts/generate_types.sh`.
6
+ */
7
+
8
+ import type { FrontierEntry } from "./FrontierEntry";
9
+ import type { JourneyCoverage } from "./JourneyCoverage";
10
+ import type { JourneyFilter } from "./JourneyFilter";
11
+ import type { JourneyLedgerHealth } from "./JourneyLedgerHealth";
12
+ import type { JourneyNode } from "./JourneyNode";
13
+ import type { JourneySearchFrontier } from "./JourneySearchFrontier";
14
+ import type { JourneySearchFrontierNode } from "./JourneySearchFrontierNode";
15
+ import type { JourneyUnmeasuredDepartures } from "./JourneyUnmeasuredDepartures";
16
+
17
+ /**
18
+ * The answer of [`dead_ends`].
19
+ */
20
+ export interface JourneyDeadEnds {
21
+ /**
22
+ * The graph's coverage.
23
+ */
24
+ coverage: JourneyCoverage;
25
+ /**
26
+ * Nodes with no navigation edge to a DIFFERENT node, an empty frontier,
27
+ * no unobserved departure and no unmeasured NAVIGATION departure (an
28
+ * excluded back arrival only makes `backOnly` unknown), sorted by key.
29
+ */
30
+ deadEnds: JourneyDeadEnd[];
31
+ /**
32
+ * The graph's filter.
33
+ */
34
+ filterEcho: JourneyFilter;
35
+ /**
36
+ * What the whole graph did not look at.
37
+ */
38
+ frontier: JourneySearchFrontier;
39
+ /**
40
+ * Nodes with no navigation edge to a different node that still have an
41
+ * open frontier, an unobserved departure or an unmeasured navigation
42
+ * departure — or whose arrival is unconfirmed (`unconfirmedDestination`:
43
+ * no arrival from another node closed `changed` / `no_change`, so it may
44
+ * be an intermediate state), or that the graph as a whole cannot settle
45
+ * (`unsettledByGraph`) — never dead ends. Sorted.
46
+ */
47
+ unexplored: JourneyUnexploredNode[];
48
+ }
49
+ /**
50
+ * A node a user cannot leave by any affordance.
51
+ */
52
+ export interface JourneyDeadEnd {
53
+ /**
54
+ * `true` when a kept `pop` edge with outcome `changed` leaves this node
55
+ * for a different node — the only way out is the browser's back button,
56
+ * a journey finding rather than an exit. `null` = unknown: no such edge
57
+ * was kept, but a `pop` row from this node was filtered or withdrawn, a
58
+ * kept `pop` edge to another node ended `error` / `settle_timeout`, or a
59
+ * kept `pop` self-loop ended `settle_timeout`
60
+ * (`unmeasuredDepartures.excludedBackArrivals > 0`). `false` otherwise.
61
+ * (A rejected `pop`-claiming row is untrusted and counts in
62
+ * `JourneyGraph::unplaced_rejected_rows`, which lists no node as a dead
63
+ * end at all.)
64
+ */
65
+ backOnly?: boolean | null;
66
+ /**
67
+ * The node.
68
+ */
69
+ nodeKey: string;
70
+ }
71
+ /**
72
+ * A node with no observed affordance exit that was NOT fully looked at, so
73
+ * it cannot be called a dead end.
74
+ */
75
+ export interface JourneyUnexploredNode {
76
+ /**
77
+ * The node.
78
+ */
79
+ nodeKey: string;
80
+ /**
81
+ * Its open frontier entries per reason (only reasons present).
82
+ */
83
+ openByReason: {
84
+ [k: string]: number;
85
+ };
86
+ /**
87
+ * `true` when no observed arrival at the node closed `changed` or
88
+ * `no_change` (they were all `settle_timeout` / `error`), so nothing
89
+ * confirms it is a real destination rather than an intermediate state
90
+ * ([`JourneyGraphNode::unconfirmed_destination`]).
91
+ */
92
+ unconfirmedDestination: boolean;
93
+ /**
94
+ * Departures from it the navigation edge set left out (filtered,
95
+ * withdrawn, `settle_timeout` / `error` to another node, `settle_timeout`
96
+ * self-loops, rejected frontier rows with a valid node).
97
+ */
98
+ unmeasuredDepartures: JourneyUnmeasuredDepartures;
99
+ /**
100
+ * Departures from it whose destination was never observed.
101
+ */
102
+ unobservedDepartures: number;
103
+ /**
104
+ * `true` when the node itself was fully explored but the GRAPH cannot
105
+ * support a dead-end verdict: an unplaced untrusted row (edge or
106
+ * frontier) may belong to it, or the ledger is not `writing`.
107
+ */
108
+ unsettledByGraph: boolean;
109
+ }
@@ -17,8 +17,9 @@ import type { JourneyTrigger } from "./JourneyTrigger";
17
17
  * [`EdgeOutcome::ToNodeUnobserved`]; `no_change` joins nodes with equal
18
18
  * keys (a `changed` edge may also join equal keys).
19
19
  *
20
- * The ledger's `timeline` column is deliberately unrepresented until
21
- * Phase 4; readers select explicit columns rather than `*`.
20
+ * The ledger's `timeline` column is not a field here: it holds a
21
+ * `qontinui-vision-core` `ChangeTimeline::for_ledger()` projection (see the
22
+ * module's PRIVACY note); readers select explicit columns rather than `*`.
22
23
  */
23
24
  export interface JourneyEdgeObservation {
24
25
  /**
@@ -0,0 +1,88 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated.
4
+ * DO NOT MODIFY IT BY HAND. Regenerate with
5
+ * `qontinui-runner/src-tauri/scripts/generate_types.sh`.
6
+ */
7
+
8
+ import type { CacheProvenance } from "./CacheProvenance";
9
+ import type { EdgeTiming } from "./EdgeTiming";
10
+ import type { JourneyFilter } from "./JourneyFilter";
11
+ import type { JourneyLedgerHealth } from "./JourneyLedgerHealth";
12
+ import type { MetricDistribution } from "./MetricDistribution";
13
+ import type { Observation } from "./Observation";
14
+ import type { ObservationCoverage } from "./ObservationCoverage";
15
+ import type { Producer } from "./Producer";
16
+ import type { Provenance } from "./Provenance";
17
+ import type { UnknownCode } from "./UnknownCode";
18
+ import type { UnknownInfo } from "./UnknownInfo";
19
+ import type { UnmeasuredDimension } from "./UnmeasuredDimension";
20
+
21
+ /**
22
+ * The answer value of `GET /apps/{app_id}/journey/edge-timing`.
23
+ *
24
+ * **Samples POOL every trigger and outcome of the `(from, to)` pair**:
25
+ * affordance clicks and typed URLs alike, and `changed`, `settle_timeout`
26
+ * and `error` closes alike. Keeping only `affordance` + `changed` would drop
27
+ * exactly the slow and failing interactions (a `settle_timeout` close is the
28
+ * slowest sample there is) and bias every percentile fast. The pooled
29
+ * composition is reported in `samplesByOutcome` / `samplesByTrigger`, so a
30
+ * reader who wants one slice can see whether the pool is dominated by
31
+ * another.
32
+ */
33
+ export interface JourneyEdgeTimingAnswer {
34
+ /**
35
+ * Live (not withdrawn) observations of this edge the filter removed.
36
+ */
37
+ edgesFilteredOut: number;
38
+ /**
39
+ * Withdrawn observations of this edge, excluded.
40
+ */
41
+ edgesInvalidated: number;
42
+ /**
43
+ * The filter the observations were narrowed by.
44
+ */
45
+ filterEcho: JourneyFilter;
46
+ /**
47
+ * The from-node key asked about.
48
+ */
49
+ fromKey: string;
50
+ /**
51
+ * The ledger the rows were read from.
52
+ */
53
+ ledger: JourneyLedgerHealth;
54
+ /**
55
+ * Untrusted EDGE rows anywhere in the read (an edge row that fails
56
+ * `validate()` or whose `observedAt` is not RFC 3339) — the edge rows
57
+ * the graph routes list as `rejected` (that list also holds frontier
58
+ * rows; this count does not). Their node keys cannot be trusted, so none is matched
59
+ * to this edge, and any of them may be one of its observations; never
60
+ * samples, never "filtered out".
61
+ */
62
+ rowsRejected: number;
63
+ /**
64
+ * Samples per edge outcome (wire string), pooled into `timing`.
65
+ */
66
+ samplesByOutcome: {
67
+ [k: string]: number;
68
+ };
69
+ /**
70
+ * Samples per navigation trigger (wire string), pooled into `timing`.
71
+ */
72
+ samplesByTrigger: {
73
+ [k: string]: number;
74
+ };
75
+ /**
76
+ * Observations whose stored timeline did not parse (counted in `timing`
77
+ * as without a timeline).
78
+ */
79
+ timelinesUnparseable: number;
80
+ /**
81
+ * The distribution, with its sample size.
82
+ */
83
+ timing: EdgeTiming;
84
+ /**
85
+ * The to-node key asked about.
86
+ */
87
+ toKey: string;
88
+ }
@@ -0,0 +1,35 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated.
4
+ * DO NOT MODIFY IT BY HAND. Regenerate with
5
+ * `qontinui-runner/src-tauri/scripts/generate_types.sh`.
6
+ */
7
+
8
+ /**
9
+ * Narrows the EDGE set a graph is built from. Staleness is a filter, not a
10
+ * verdict: the caller decides what window to ask about, and every result
11
+ * echoes the filter it was computed under (`filterEcho`).
12
+ *
13
+ * The frontier is never filtered: an open frontier entry is current state,
14
+ * and hiding one behind an edge filter would turn "not looked at" into
15
+ * "nothing there".
16
+ *
17
+ * `since` is a `chrono::DateTime<Utc>` (serialized RFC 3339), an exception
18
+ * to the crate's string-timestamp convention for the same reason as
19
+ * `page::KeysetPosition`: it is compared, not merely carried.
20
+ */
21
+ export interface JourneyFilter {
22
+ /**
23
+ * Keep edges whose `appVersion` equals this; `None` = every version.
24
+ * An edge that reported no version never matches a set filter.
25
+ */
26
+ appVersion: string | null;
27
+ /**
28
+ * Keep edges of this run kind; `None` = every kind.
29
+ */
30
+ runKind: ("agent_action" | "explorer" | "passive_session") | null;
31
+ /**
32
+ * Keep edges with `observedAt >= since`; `None` = no lower bound.
33
+ */
34
+ since: string | null;
35
+ }
@@ -0,0 +1,51 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated.
4
+ * DO NOT MODIFY IT BY HAND. Regenerate with
5
+ * `qontinui-runner/src-tauri/scripts/generate_types.sh`.
6
+ */
7
+
8
+ import type { FrontierEntry } from "./FrontierEntry";
9
+ import type { JourneyCoverage } from "./JourneyCoverage";
10
+ import type { JourneyFilter } from "./JourneyFilter";
11
+ import type { JourneyLedgerHealth } from "./JourneyLedgerHealth";
12
+ import type { JourneyNode } from "./JourneyNode";
13
+ import type { JourneySearchFrontier } from "./JourneySearchFrontier";
14
+ import type { JourneySearchFrontierNode } from "./JourneySearchFrontierNode";
15
+ import type { JourneyUnmeasuredDepartures } from "./JourneyUnmeasuredDepartures";
16
+
17
+ /**
18
+ * The answer of [`frontier`] — the open frontier of one node, or of the
19
+ * whole graph.
20
+ */
21
+ export interface JourneyFrontier {
22
+ /**
23
+ * The graph's coverage.
24
+ */
25
+ coverage: JourneyCoverage;
26
+ /**
27
+ * The open, listable frontier entries, sorted by `(nodeKey,
28
+ * affordanceFingerprint)`.
29
+ */
30
+ entries: FrontierEntry[];
31
+ /**
32
+ * The graph's filter.
33
+ */
34
+ filterEcho: JourneyFilter;
35
+ /**
36
+ * Everything not looked at in the part asked about — including rows
37
+ * that could not be listed (`rejected_frontier`). An EMPTY `entries` is
38
+ * a real "nothing left to explore" only when this is settled and
39
+ * [`JourneySearchFrontier::unsettled_because`] returns `None`.
40
+ */
41
+ frontier: JourneySearchFrontier;
42
+ /**
43
+ * The node asked about; `null` = the whole graph.
44
+ */
45
+ nodeKey?: string | null;
46
+ /**
47
+ * Whether that node was observed (always `true` for the whole graph).
48
+ * `false` means "never seen", never "nothing open there".
49
+ */
50
+ nodeObserved: boolean;
51
+ }
@@ -0,0 +1,165 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated.
4
+ * DO NOT MODIFY IT BY HAND. Regenerate with
5
+ * `qontinui-runner/src-tauri/scripts/generate_types.sh`.
6
+ */
7
+
8
+ import type { FrontierEntry } from "./FrontierEntry";
9
+ import type { JourneyArrivalDoubt } from "./JourneyArrivalDoubt";
10
+ import type { JourneyCoverage } from "./JourneyCoverage";
11
+ import type { JourneyFilter } from "./JourneyFilter";
12
+ import type { JourneyGraphEdge } from "./JourneyGraphEdge";
13
+ import type { JourneyLedgerHealth } from "./JourneyLedgerHealth";
14
+ import type { JourneyNode } from "./JourneyNode";
15
+ import type { JourneyTrigger } from "./JourneyTrigger";
16
+ import type { JourneyUnmeasuredDepartures } from "./JourneyUnmeasuredDepartures";
17
+
18
+ /**
19
+ * The journey graph derived from ledger rows under one filter.
20
+ */
21
+ export interface JourneyGraph {
22
+ /**
23
+ * What the graph was built over.
24
+ */
25
+ coverage: JourneyCoverage;
26
+ /**
27
+ * Aggregated edges, sorted by `(fromKey, toKey, trigger, outcome)`.
28
+ */
29
+ edges: JourneyGraphEdge[];
30
+ /**
31
+ * The filter the edge set was narrowed by.
32
+ */
33
+ filterEcho: JourneyFilter;
34
+ /**
35
+ * Observed nodes, sorted by key.
36
+ */
37
+ nodes: JourneyGraphNode[];
38
+ /**
39
+ * Unmeasured departures (filtered, withdrawn, rejected frontier with a
40
+ * valid node, excluded back and URL arrivals) placed at a node key that
41
+ * is NOT in
42
+ * `nodes`. No component query can reach such a node, but a graph-wide
43
+ * question (`dead_ends`, `requires_prior_knowledge`, the whole frontier)
44
+ * counts them.
45
+ */
46
+ offGraphDepartures: JourneyUnmeasuredDepartures;
47
+ /**
48
+ * Rows left out as contract violations, live or withdrawn (a withdrawn one
49
+ * is also counted in `coverage.edgesInvalidated`), sorted.
50
+ */
51
+ rejected: JourneyRejectedRow[];
52
+ /**
53
+ * Rejected frontier rows counted at TWO node keys (their `nodeKey`
54
+ * column and their valid node's own key disagree). Per-node counts
55
+ * include both placements; graph-wide totals subtract this, so a
56
+ * graph-wide `rejectedFrontier` plus `unplacedRejectedFrontier` is the
57
+ * number of DISTINCT rejected frontier rows by full content. (`rejected`
58
+ * lists rows by `(kind, row, reason)`, so two rows differing only in
59
+ * their node JSON share one entry there but are both counted.)
60
+ */
61
+ rejectedFrontierDoublePlaced: number;
62
+ /**
63
+ * Affordance or `pop` rows whose real destination is unknown: kept or
64
+ * trusted-excluded ones with no `toNode` (`to_node_unobserved`), ones
65
+ * that closed `settle_timeout` or `error` to a DIFFERENT node (that node
66
+ * may be an intermediate state), and ones that closed `settle_timeout`
67
+ * on the SAME node (the destination may not have rendered yet). Each
68
+ * may arrive at any node, so `requires_prior_knowledge` lists no node as
69
+ * settled while this is non-zero.
70
+ */
71
+ unknownDestinationArrivals: number;
72
+ /**
73
+ * Distinct rejected frontier rows whose node fails `validate()`.
74
+ * Nothing in such a row is trusted, its `nodeKey` column included, so it
75
+ * is placed at NO node: each may be an open affordance anywhere, and
76
+ * EVERY negative answer counts it (dimension
77
+ * `unplaced_rejected_frontier`).
78
+ */
79
+ unplacedRejectedFrontier: number;
80
+ /**
81
+ * Distinct UNTRUSTED edge rows — live or withdrawn rows that fail
82
+ * [`trusted_edge_row`] (a failed `validate()` or an unparseable
83
+ * `observedAt`). Nothing in such a row is trusted, its `fromNode` and
84
+ * trigger included, so it is placed at NO node: it may be a click from
85
+ * and to anywhere, and EVERY negative answer counts it, component and
86
+ * graph-wide alike (dimension `unplaced_rejected_rows`). While it is
87
+ * non-zero, `dead_ends` lists no dead end and `requires_prior_knowledge`
88
+ * lists no settled node.
89
+ */
90
+ unplacedRejectedRows: number;
91
+ }
92
+ /**
93
+ * One observed vertex.
94
+ */
95
+ export interface JourneyGraphNode {
96
+ /**
97
+ * Excluded affordance / pop rows arriving here from another node.
98
+ */
99
+ arrivalDoubt: JourneyArrivalDoubt;
100
+ /**
101
+ * Open frontier entries seen at this node, sorted by
102
+ * `affordanceFingerprint`.
103
+ */
104
+ frontier: FrontierEntry[];
105
+ /**
106
+ * [`JourneyNode::key`] — the node's identity.
107
+ */
108
+ key: string;
109
+ /**
110
+ * A representative node for the key (the smallest by its fields when
111
+ * rows disagree on non-identity detail such as `pageLabel`).
112
+ */
113
+ node: JourneyNode;
114
+ /**
115
+ * `true` when the node has at least one kept arrival (an edge from a
116
+ * DIFFERENT node whose `toNode` is this node — a self-loop is not an
117
+ * arrival), and NONE of them closed `changed` or
118
+ * `no_change`, whatever its trigger. Only those two outcomes confirm the
119
+ * node is a real destination: a `settle_timeout` or `error` arrival's
120
+ * observed node may be an intermediate state (a spinner, an error
121
+ * render). Such a node is never a settled dead end, nor a settled
122
+ * requires-prior-knowledge node.
123
+ */
124
+ unconfirmedDestination: boolean;
125
+ /**
126
+ * Departures from this node the navigation edge set leaves out but that
127
+ * may still lead somewhere (see [`JourneyUnmeasuredDepartures`]).
128
+ */
129
+ unmeasuredDepartures: JourneyUnmeasuredDepartures;
130
+ /**
131
+ * How many edges left this node with `outcome: to_node_unobserved` —
132
+ * actions whose destination was never seen.
133
+ */
134
+ unobservedDepartures: number;
135
+ }
136
+ /**
137
+ * A ledger row that broke the edge-observation contract and was left out of
138
+ * the graph — reported, never silently dropped.
139
+ */
140
+ export interface JourneyRejectedRow {
141
+ /**
142
+ * Edge or frontier row.
143
+ */
144
+ kind: "edge" | "frontier";
145
+ /**
146
+ * The contract violation, as `JourneyContractError` renders it (or the
147
+ * timestamp parse failure).
148
+ */
149
+ reason: string;
150
+ /**
151
+ * The edge's `id`, or `"<nodeKey> <affordanceFingerprint>"` for a
152
+ * frontier row.
153
+ */
154
+ row: string;
155
+ /**
156
+ * How many DISTINCT rows (by full serialized content) this entry stands
157
+ * for. Two rows that share `(kind, row, reason)` but differ anywhere
158
+ * else — a live and a withdrawn copy, or two fromNodes under one id —
159
+ * are one entry here with `rows: 2`. The same full-row identity is the
160
+ * one `JourneyGraph::unplaced_rejected_rows` and
161
+ * `unplaced_rejected_frontier` count by, so for edges the `rows` of the
162
+ * edge entries sum to `unplaced_rejected_rows`.
163
+ */
164
+ rows: number;
165
+ }