@reticlehq/core 2.9.0 → 2.10.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.
@@ -7,6 +7,17 @@ export declare const RETICLE_WS_PATH = "/reticle";
7
7
  /** Agent↔server MCP wire paths — served by the daemon HTTP plane, forwarded by the stdio proxy. */
8
8
  export declare const MCP_SSE_PATH = "/mcp/sse";
9
9
  export declare const MCP_MESSAGE_PATH = "/mcp/message";
10
+ /**
11
+ * The name this MCP server answers to — in its own `serverInfo` handshake, and in the registration
12
+ * an installer writes into an agent's config. Those must be the same string or the agent registers
13
+ * one server and talks to another.
14
+ *
15
+ * It lives here because it is an identity that crosses the wire, not an installer detail. It used to
16
+ * live in `init/`, which made the MCP handshake — squarely on the library path — reach into the
17
+ * install-time surface for a single string, and dragged that whole subtree along behind it for any
18
+ * consumer embedding the engine as a library.
19
+ */
20
+ export declare const MCP_SERVER_NAME = "reticle";
10
21
  /**
11
22
  * SSE event name the daemon writes to every open MCP stream immediately before it shuts itself down.
12
23
  *
package/dist/constants.js CHANGED
@@ -7,6 +7,17 @@ export const RETICLE_WS_PATH = '/reticle';
7
7
  /** Agent↔server MCP wire paths — served by the daemon HTTP plane, forwarded by the stdio proxy. */
8
8
  export const MCP_SSE_PATH = '/mcp/sse';
9
9
  export const MCP_MESSAGE_PATH = '/mcp/message';
10
+ /**
11
+ * The name this MCP server answers to — in its own `serverInfo` handshake, and in the registration
12
+ * an installer writes into an agent's config. Those must be the same string or the agent registers
13
+ * one server and talks to another.
14
+ *
15
+ * It lives here because it is an identity that crosses the wire, not an installer detail. It used to
16
+ * live in `init/`, which made the MCP handshake — squarely on the library path — reach into the
17
+ * install-time surface for a single string, and dragged that whole subtree along behind it for any
18
+ * consumer embedding the engine as a library.
19
+ */
20
+ export const MCP_SERVER_NAME = 'reticle';
10
21
  /**
11
22
  * SSE event name the daemon writes to every open MCP stream immediately before it shuts itself down.
12
23
  *
@@ -141,6 +141,42 @@ export type ContradictionKind = (typeof ContradictionKind)[keyof typeof Contradi
141
141
  export declare const ABSENCE_DERIVED_CONTRADICTIONS: ReadonlySet<ContradictionKind>;
142
142
  /** True when this kind was inferred from absence rather than positively observed. */
143
143
  export declare function isAbsenceDerived(kind: string): boolean;
144
+ /**
145
+ * How much authority a finding carries — the distinction above, said out loud on the finding itself.
146
+ *
147
+ * The rule already turns on this: an OBSERVED contradiction outranks a passing assertion and answers
148
+ * `no`, an ABSENCE_DERIVED one downgrades to `unknown`. But the findings all arrive looking alike, so
149
+ * an agent handed three of them cannot tell which one decided the verdict and which is a note about
150
+ * when Reticle stopped looking. Two facts of very different strength, reported in one voice.
151
+ */
152
+ export declare const FindingTier: {
153
+ /**
154
+ * Positively observed evidence AGAINST the action: a request came back 500 while the UI advanced, a
155
+ * signal fired carrying data the DOM disagrees with, a written field echoed a different value.
156
+ * Something happened, and it is incompatible with the action having worked.
157
+ */
158
+ readonly OBSERVED: "observed";
159
+ /**
160
+ * Inferred from something NOT having happened yet, in a window whose end Reticle chose. It may
161
+ * become true a moment later. It is a statement about our timing at least as much as about the app.
162
+ */
163
+ readonly ABSENCE_DERIVED: "absence-derived";
164
+ };
165
+ export type FindingTier = (typeof FindingTier)[keyof typeof FindingTier];
166
+ /**
167
+ * The tier of a finding, DERIVED from its kind.
168
+ *
169
+ * Deliberately a lookup rather than a field an oracle sets. An oracle that stated its own tier would
170
+ * be grading its own homework, and the one thing every author of a new rule is sure of is that their
171
+ * finding is important. The kind decides, in one place, where the verdict rule already reads it.
172
+ *
173
+ * An unrecognised kind is OBSERVED, and that default is doing real work rather than being a fallback.
174
+ * A rule registered by a consumer emits kinds deliberately absent from this vocabulary — that is what
175
+ * keeps somebody's private finding names out of the free product — and those findings still have to
176
+ * be tierable. OBSERVED is the honest answer: an unknown kind has made no claim about a window whose
177
+ * end Reticle chose, so downgrading it would invent a caveat on its author's behalf.
178
+ */
179
+ export declare function tierOfFinding(kind: string): FindingTier;
144
180
  /**
145
181
  * HTTP methods that CHANGE server state. Several contradiction rules are restricted to these on
146
182
  * purpose: a GET that fires without moving the UI is a prefetch, but a POST that does is a lost
package/dist/findings.js CHANGED
@@ -148,6 +148,43 @@ export const ABSENCE_DERIVED_CONTRADICTIONS = new Set([
148
148
  export function isAbsenceDerived(kind) {
149
149
  return ABSENCE_DERIVED_CONTRADICTIONS.has(kind);
150
150
  }
151
+ /**
152
+ * How much authority a finding carries — the distinction above, said out loud on the finding itself.
153
+ *
154
+ * The rule already turns on this: an OBSERVED contradiction outranks a passing assertion and answers
155
+ * `no`, an ABSENCE_DERIVED one downgrades to `unknown`. But the findings all arrive looking alike, so
156
+ * an agent handed three of them cannot tell which one decided the verdict and which is a note about
157
+ * when Reticle stopped looking. Two facts of very different strength, reported in one voice.
158
+ */
159
+ export const FindingTier = {
160
+ /**
161
+ * Positively observed evidence AGAINST the action: a request came back 500 while the UI advanced, a
162
+ * signal fired carrying data the DOM disagrees with, a written field echoed a different value.
163
+ * Something happened, and it is incompatible with the action having worked.
164
+ */
165
+ OBSERVED: 'observed',
166
+ /**
167
+ * Inferred from something NOT having happened yet, in a window whose end Reticle chose. It may
168
+ * become true a moment later. It is a statement about our timing at least as much as about the app.
169
+ */
170
+ ABSENCE_DERIVED: 'absence-derived',
171
+ };
172
+ /**
173
+ * The tier of a finding, DERIVED from its kind.
174
+ *
175
+ * Deliberately a lookup rather than a field an oracle sets. An oracle that stated its own tier would
176
+ * be grading its own homework, and the one thing every author of a new rule is sure of is that their
177
+ * finding is important. The kind decides, in one place, where the verdict rule already reads it.
178
+ *
179
+ * An unrecognised kind is OBSERVED, and that default is doing real work rather than being a fallback.
180
+ * A rule registered by a consumer emits kinds deliberately absent from this vocabulary — that is what
181
+ * keeps somebody's private finding names out of the free product — and those findings still have to
182
+ * be tierable. OBSERVED is the honest answer: an unknown kind has made no claim about a window whose
183
+ * end Reticle chose, so downgrading it would invent a caveat on its author's behalf.
184
+ */
185
+ export function tierOfFinding(kind) {
186
+ return isAbsenceDerived(kind) ? FindingTier.ABSENCE_DERIVED : FindingTier.OBSERVED;
187
+ }
151
188
  /**
152
189
  * HTTP methods that CHANGE server state. Several contradiction rules are restricted to these on
153
190
  * purpose: a GET that fires without moving the UI is a prefetch, but a POST that does is a lost
package/dist/index.d.ts CHANGED
@@ -35,6 +35,7 @@ export * from './toon.js';
35
35
  export * from './upgrade.js';
36
36
  export * from './telemetry.js';
37
37
  export * from './telemetry-session.js';
38
+ export * from './telemetry-license.js';
38
39
  export * from './telemetry-feedback.js';
39
40
  export * from './impact.js';
40
41
  export * from './impact-savings.js';
package/dist/index.js CHANGED
@@ -39,6 +39,7 @@ export * from './toon.js'; // TOON encoding used by the server's result encoder
39
39
  export * from './upgrade.js'; // self-update policy shared by the CLI
40
40
  export * from './telemetry.js';
41
41
  export * from './telemetry-session.js'; // the session/project rollup payloads
42
+ export * from './telemetry-license.js'; // LicenseActivation — shared by the licence gate and telemetry
42
43
  export * from './telemetry-feedback.js'; // the two things a PERSON writes: feedback + a self-declared identity // anonymous adoption telemetry wire contract (DAU/WAU/MAU/installs)
43
44
  export * from './impact.js'; // the user's own record of what Reticle has done for them (local only)
44
45
  export * from './impact-savings.js'; // the savings model - one file, so every claim is derivable there
@@ -49,7 +49,19 @@ export declare const FeedbackKind: {
49
49
  * would hide the second inside the first, and the second is usually cheaper and higher-impact.
50
50
  */
51
51
  readonly IMPROVEMENT: "improvement";
52
- /** A human's overall take on using Reticle (carries `rating`). */
52
+ /**
53
+ * "This worked, and here is what it did." An overall take on using Reticle, carrying `rating`.
54
+ *
55
+ * Filed by a human at a terminal OR by an agent mid-task, and the agent case is the one that was
56
+ * missing: every other kind an agent can file is a complaint, so the corpus could only ever grow
57
+ * into a defect list. Nothing in it said which parts were worth protecting when we changed them,
58
+ * which is the question a refactor actually needs answered.
59
+ *
60
+ * A score alone is close to worthless here and the tool says so: a model asked for a number will
61
+ * produce an agreeable one, and an agreeable number is indistinguishable from an earned one once
62
+ * both are in the same column. What makes a report usable is the `text` naming the concrete
63
+ * moment, which is also the only part that can be quoted or acted on.
64
+ */
53
65
  readonly EXPERIENCE: "experience";
54
66
  };
55
67
  export type FeedbackKind = (typeof FeedbackKind)[keyof typeof FeedbackKind];
@@ -146,7 +158,19 @@ export declare const FeedbackSchema: z.ZodObject<{
146
158
  * would hide the second inside the first, and the second is usually cheaper and higher-impact.
147
159
  */
148
160
  readonly IMPROVEMENT: "improvement";
149
- /** A human's overall take on using Reticle (carries `rating`). */
161
+ /**
162
+ * "This worked, and here is what it did." An overall take on using Reticle, carrying `rating`.
163
+ *
164
+ * Filed by a human at a terminal OR by an agent mid-task, and the agent case is the one that was
165
+ * missing: every other kind an agent can file is a complaint, so the corpus could only ever grow
166
+ * into a defect list. Nothing in it said which parts were worth protecting when we changed them,
167
+ * which is the question a refactor actually needs answered.
168
+ *
169
+ * A score alone is close to worthless here and the tool says so: a model asked for a number will
170
+ * produce an agreeable one, and an agreeable number is indistinguishable from an earned one once
171
+ * both are in the same column. What makes a report usable is the `text` naming the concrete
172
+ * moment, which is also the only part that can be quoted or acted on.
173
+ */
150
174
  readonly EXPERIENCE: "experience";
151
175
  }>;
152
176
  /** The author's account. For an agent: what failed and why (its RCA). For a human: their words. */
@@ -48,7 +48,19 @@ export const FeedbackKind = {
48
48
  * would hide the second inside the first, and the second is usually cheaper and higher-impact.
49
49
  */
50
50
  IMPROVEMENT: 'improvement',
51
- /** A human's overall take on using Reticle (carries `rating`). */
51
+ /**
52
+ * "This worked, and here is what it did." An overall take on using Reticle, carrying `rating`.
53
+ *
54
+ * Filed by a human at a terminal OR by an agent mid-task, and the agent case is the one that was
55
+ * missing: every other kind an agent can file is a complaint, so the corpus could only ever grow
56
+ * into a defect list. Nothing in it said which parts were worth protecting when we changed them,
57
+ * which is the question a refactor actually needs answered.
58
+ *
59
+ * A score alone is close to worthless here and the tool says so: a model asked for a number will
60
+ * produce an agreeable one, and an agreeable number is indistinguishable from an earned one once
61
+ * both are in the same column. What makes a report usable is the `text` naming the concrete
62
+ * moment, which is also the only part that can be quoted or acted on.
63
+ */
52
64
  EXPERIENCE: 'experience',
53
65
  };
54
66
  /** Which shell the verified app runs in. Mirrors the SDK's own `PAGE_HEALTH` runtime report. */
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Enterprise activation, as the wire reports it.
3
+ *
4
+ * Its own file rather than another block in `telemetry.ts`: this vocabulary is shared by the LICENCE
5
+ * GATE (`describeLicense` types its report against it) and by the telemetry that reports the gate's
6
+ * outcome, and those are the two sides a copied enum silently drifts between. Keeping it at the bottom
7
+ * of the graph is what lets both import the same list instead of each keeping their own.
8
+ */
9
+ /**
10
+ * How enterprise activation resolved on the machine that sent an event. The closed list, defined HERE
11
+ * so the license gate and the telemetry that reports it cannot drift apart: `describeLicense` in the
12
+ * server types its report against this rather than re-listing the strings (rule 4 — a copied
13
+ * vocabulary is a correctness hazard the moment it is a number somebody reads).
14
+ *
15
+ * This is a STATUS, never an identity. It says whether a key verified, not whose key it is; the
16
+ * separate `licenseId` carries the opaque id, and the organisation NAME never goes on the wire at all.
17
+ */
18
+ export declare const LicenseActivation: {
19
+ /** A valid, unexpired, correctly-signed key covering this build. */
20
+ readonly ACTIVE: "active";
21
+ /** An issuer key is baked but no license key is set — an unlicensed install of a release build. */
22
+ readonly MISSING: "missing";
23
+ /** A key was present and rejected: malformed, wrong issuer, or a tampered payload. */
24
+ readonly INVALID: "invalid";
25
+ /**
26
+ * A key that verified but whose expiry has passed. The renewal signal: this arriving from a machine
27
+ * that used to report `active` is a lapse we can see BEFORE the customer reports it, and it is the
28
+ * whole reason status is reported separately from identity — a lapsed customer stops sending
29
+ * `licenseId`, so on identity alone a lapse and a churn look identical.
30
+ */
31
+ readonly EXPIRED: "expired";
32
+ /** No issuer key configured at all: a source build or a dev checkout, where features run free. */
33
+ readonly EVAL: "eval";
34
+ };
35
+ export type LicenseActivation = (typeof LicenseActivation)[keyof typeof LicenseActivation];
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Enterprise activation, as the wire reports it.
3
+ *
4
+ * Its own file rather than another block in `telemetry.ts`: this vocabulary is shared by the LICENCE
5
+ * GATE (`describeLicense` types its report against it) and by the telemetry that reports the gate's
6
+ * outcome, and those are the two sides a copied enum silently drifts between. Keeping it at the bottom
7
+ * of the graph is what lets both import the same list instead of each keeping their own.
8
+ */
9
+ /**
10
+ * How enterprise activation resolved on the machine that sent an event. The closed list, defined HERE
11
+ * so the license gate and the telemetry that reports it cannot drift apart: `describeLicense` in the
12
+ * server types its report against this rather than re-listing the strings (rule 4 — a copied
13
+ * vocabulary is a correctness hazard the moment it is a number somebody reads).
14
+ *
15
+ * This is a STATUS, never an identity. It says whether a key verified, not whose key it is; the
16
+ * separate `licenseId` carries the opaque id, and the organisation NAME never goes on the wire at all.
17
+ */
18
+ export const LicenseActivation = {
19
+ /** A valid, unexpired, correctly-signed key covering this build. */
20
+ ACTIVE: 'active',
21
+ /** An issuer key is baked but no license key is set — an unlicensed install of a release build. */
22
+ MISSING: 'missing',
23
+ /** A key was present and rejected: malformed, wrong issuer, or a tampered payload. */
24
+ INVALID: 'invalid',
25
+ /**
26
+ * A key that verified but whose expiry has passed. The renewal signal: this arriving from a machine
27
+ * that used to report `active` is a lapse we can see BEFORE the customer reports it, and it is the
28
+ * whole reason status is reported separately from identity — a lapsed customer stops sending
29
+ * `licenseId`, so on identity alone a lapse and a churn look identical.
30
+ */
31
+ EXPIRED: 'expired',
32
+ /** No issuer key configured at all: a source build or a dev checkout, where features run free. */
33
+ EVAL: 'eval',
34
+ };
@@ -311,6 +311,7 @@ export declare const VerificationSchema: z.ZodObject<{
311
311
  readonly ALREADY_TRUE: "already_true";
312
312
  readonly UNCLEAN_CAPTURE: "unclean_capture";
313
313
  readonly VACUOUS_GRADE: "vacuous_grade";
314
+ readonly NOTHING_DECLARED: "nothing_declared";
314
315
  readonly OUTCOME_PENDING: "outcome_pending";
315
316
  readonly OUTCOME_UNREAD: "outcome_unread";
316
317
  readonly UNSETTLED: "unsettled";
@@ -341,7 +342,7 @@ export declare const VerificationSchema: z.ZodObject<{
341
342
  passed: boolean;
342
343
  falseGreenCaught: boolean;
343
344
  durationMs?: number | undefined;
344
- reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "evidence_incomplete" | "proved" | "absence_blind_spot" | undefined;
345
+ reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "nothing_declared" | "outcome_pending" | "outcome_unread" | "unsettled" | "evidence_incomplete" | "proved" | "absence_blind_spot" | undefined;
345
346
  brand?: "other" | "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | undefined;
346
347
  browser?: string | undefined;
347
348
  uncleanLoss?: "buffer_loss" | "transport_gap" | "blind_spot" | "other" | undefined;
@@ -351,7 +352,7 @@ export declare const VerificationSchema: z.ZodObject<{
351
352
  passed: boolean;
352
353
  falseGreenCaught: boolean;
353
354
  durationMs?: number | undefined;
354
- reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "evidence_incomplete" | "proved" | "absence_blind_spot" | undefined;
355
+ reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "nothing_declared" | "outcome_pending" | "outcome_unread" | "unsettled" | "evidence_incomplete" | "proved" | "absence_blind_spot" | undefined;
355
356
  brand?: "other" | "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | undefined;
356
357
  browser?: string | undefined;
357
358
  uncleanLoss?: "buffer_loss" | "transport_gap" | "blind_spot" | "other" | undefined;
@@ -501,7 +502,7 @@ export declare const CrashSchema: z.ZodObject<{
501
502
  message?: string | undefined;
502
503
  errorType?: string | undefined;
503
504
  tool?: string | undefined;
504
- port?: "other" | "reticle" | undefined;
505
+ port?: "reticle" | "other" | undefined;
505
506
  fingerprint?: string | undefined;
506
507
  machine?: {
507
508
  rssMb: number;
@@ -524,7 +525,7 @@ export declare const CrashSchema: z.ZodObject<{
524
525
  message?: string | undefined;
525
526
  errorType?: string | undefined;
526
527
  tool?: string | undefined;
527
- port?: "other" | "reticle" | undefined;
528
+ port?: "reticle" | "other" | undefined;
528
529
  fingerprint?: string | undefined;
529
530
  machine?: {
530
531
  rssMb: number;
@@ -692,7 +693,7 @@ export declare const BugFoundSchema: z.ZodObject<{
692
693
  }, "strip", z.ZodTypeAny, {
693
694
  kind: string;
694
695
  source: "replay" | "contradiction" | "crawl" | "assertion";
695
- attribution: "app" | "reticle" | "request" | "unclassified";
696
+ attribution: "reticle" | "app" | "request" | "unclassified";
696
697
  falseGreen: boolean;
697
698
  repeat: boolean;
698
699
  tool?: string | undefined;
@@ -700,7 +701,7 @@ export declare const BugFoundSchema: z.ZodObject<{
700
701
  }, {
701
702
  kind: string;
702
703
  source: "replay" | "contradiction" | "crawl" | "assertion";
703
- attribution: "app" | "reticle" | "request" | "unclassified";
704
+ attribution: "reticle" | "app" | "request" | "unclassified";
704
705
  falseGreen: boolean;
705
706
  repeat: boolean;
706
707
  tool?: string | undefined;
@@ -1777,6 +1778,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1777
1778
  readonly ALREADY_TRUE: "already_true";
1778
1779
  readonly UNCLEAN_CAPTURE: "unclean_capture";
1779
1780
  readonly VACUOUS_GRADE: "vacuous_grade";
1781
+ readonly NOTHING_DECLARED: "nothing_declared";
1780
1782
  readonly OUTCOME_PENDING: "outcome_pending";
1781
1783
  readonly OUTCOME_UNREAD: "outcome_unread";
1782
1784
  readonly UNSETTLED: "unsettled";
@@ -1807,7 +1809,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1807
1809
  passed: boolean;
1808
1810
  falseGreenCaught: boolean;
1809
1811
  durationMs?: number | undefined;
1810
- reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "evidence_incomplete" | "proved" | "absence_blind_spot" | undefined;
1812
+ reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "nothing_declared" | "outcome_pending" | "outcome_unread" | "unsettled" | "evidence_incomplete" | "proved" | "absence_blind_spot" | undefined;
1811
1813
  brand?: "other" | "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | undefined;
1812
1814
  browser?: string | undefined;
1813
1815
  uncleanLoss?: "buffer_loss" | "transport_gap" | "blind_spot" | "other" | undefined;
@@ -1817,7 +1819,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1817
1819
  passed: boolean;
1818
1820
  falseGreenCaught: boolean;
1819
1821
  durationMs?: number | undefined;
1820
- reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "evidence_incomplete" | "proved" | "absence_blind_spot" | undefined;
1822
+ reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "nothing_declared" | "outcome_pending" | "outcome_unread" | "unsettled" | "evidence_incomplete" | "proved" | "absence_blind_spot" | undefined;
1821
1823
  brand?: "other" | "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | undefined;
1822
1824
  browser?: string | undefined;
1823
1825
  uncleanLoss?: "buffer_loss" | "transport_gap" | "blind_spot" | "other" | undefined;
@@ -1945,7 +1947,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1945
1947
  message?: string | undefined;
1946
1948
  errorType?: string | undefined;
1947
1949
  tool?: string | undefined;
1948
- port?: "other" | "reticle" | undefined;
1950
+ port?: "reticle" | "other" | undefined;
1949
1951
  fingerprint?: string | undefined;
1950
1952
  machine?: {
1951
1953
  rssMb: number;
@@ -1968,7 +1970,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1968
1970
  message?: string | undefined;
1969
1971
  errorType?: string | undefined;
1970
1972
  tool?: string | undefined;
1971
- port?: "other" | "reticle" | undefined;
1973
+ port?: "reticle" | "other" | undefined;
1972
1974
  fingerprint?: string | undefined;
1973
1975
  machine?: {
1974
1976
  rssMb: number;
@@ -2149,7 +2151,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
2149
2151
  }, "strip", z.ZodTypeAny, {
2150
2152
  kind: string;
2151
2153
  source: "replay" | "contradiction" | "crawl" | "assertion";
2152
- attribution: "app" | "reticle" | "request" | "unclassified";
2154
+ attribution: "reticle" | "app" | "request" | "unclassified";
2153
2155
  falseGreen: boolean;
2154
2156
  repeat: boolean;
2155
2157
  tool?: string | undefined;
@@ -2157,7 +2159,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
2157
2159
  }, {
2158
2160
  kind: string;
2159
2161
  source: "replay" | "contradiction" | "crawl" | "assertion";
2160
- attribution: "app" | "reticle" | "request" | "unclassified";
2162
+ attribution: "reticle" | "app" | "request" | "unclassified";
2161
2163
  falseGreen: boolean;
2162
2164
  repeat: boolean;
2163
2165
  tool?: string | undefined;
@@ -2322,6 +2324,30 @@ export declare const TelemetryEventSchema: z.ZodObject<{
2322
2324
  /** No marker, or one this list does not name. The honest answer, and expected to dominate. */
2323
2325
  readonly UNKNOWN: "unknown";
2324
2326
  }>>;
2327
+ /**
2328
+ * Enterprise activation, on EVERY event. Two scalars rather than a block, for the same reason
2329
+ * `installSource` is one: they describe the install, not any single event, and they have to be
2330
+ * present on the events that show whether a licensed customer got anywhere.
2331
+ *
2332
+ * `licenseId` is the signed license id — an opaque uuid that resolves to a company only against the
2333
+ * issuance ledger we hold locally, so the analytics backend never learns a customer list. The
2334
+ * organisation NAME is deliberately absent: it is free text somebody typed at signing time, and
2335
+ * rule 3 is names-never-values.
2336
+ *
2337
+ * `licenseId` is present only when activation is `active`; `licenseStatus` rides whenever an issuer
2338
+ * key is baked, including the failure states, which is what makes a lapse distinguishable from a
2339
+ * churn. The PLAN is deliberately not here: the issuance ledger already holds it against this same
2340
+ * id, so it would be a per-event cost for something the join that resolves the id resolves anyway.
2341
+ */
2342
+ licenseId: z.ZodOptional<z.ZodString>;
2343
+ /** How activation resolved. Absent on a build with no issuer key baked, i.e. every OSS install. */
2344
+ licenseStatus: z.ZodOptional<z.ZodNativeEnum<{
2345
+ readonly ACTIVE: "active";
2346
+ readonly MISSING: "missing";
2347
+ readonly INVALID: "invalid";
2348
+ readonly EXPIRED: "expired";
2349
+ readonly EVAL: "eval";
2350
+ }>>;
2325
2351
  }, "strip", z.ZodTypeAny, {
2326
2352
  event: "reticle_installed" | "cli_command_run" | "daemon_started" | "daemon_stopped" | "session_progress" | "verification_completed" | "project_profiled" | "version_changed" | "runtime_crashed" | "feedback_submitted" | "identified" | "mcp_client_connected" | "app_instrumented" | "instrumentation_stalled" | "mcp_connection_lost" | "init_completed" | "bug_found" | "tool_refused";
2327
2353
  version: string;
@@ -2336,7 +2362,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
2336
2362
  bug?: {
2337
2363
  kind: string;
2338
2364
  source: "replay" | "contradiction" | "crawl" | "assertion";
2339
- attribution: "app" | "reticle" | "request" | "unclassified";
2365
+ attribution: "reticle" | "app" | "request" | "unclassified";
2340
2366
  falseGreen: boolean;
2341
2367
  repeat: boolean;
2342
2368
  tool?: string | undefined;
@@ -2452,7 +2478,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
2452
2478
  passed: boolean;
2453
2479
  falseGreenCaught: boolean;
2454
2480
  durationMs?: number | undefined;
2455
- reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "evidence_incomplete" | "proved" | "absence_blind_spot" | undefined;
2481
+ reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "nothing_declared" | "outcome_pending" | "outcome_unread" | "unsettled" | "evidence_incomplete" | "proved" | "absence_blind_spot" | undefined;
2456
2482
  brand?: "other" | "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | undefined;
2457
2483
  browser?: string | undefined;
2458
2484
  uncleanLoss?: "buffer_loss" | "transport_gap" | "blind_spot" | "other" | undefined;
@@ -2468,7 +2494,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
2468
2494
  message?: string | undefined;
2469
2495
  errorType?: string | undefined;
2470
2496
  tool?: string | undefined;
2471
- port?: "other" | "reticle" | undefined;
2497
+ port?: "reticle" | "other" | undefined;
2472
2498
  fingerprint?: string | undefined;
2473
2499
  machine?: {
2474
2500
  rssMb: number;
@@ -2526,6 +2552,8 @@ export declare const TelemetryEventSchema: z.ZodObject<{
2526
2552
  msWaited: number;
2527
2553
  } | undefined;
2528
2554
  installSource?: "unknown" | "skill_file" | "npx_skill" | "plugin" | "docs_site" | "readme" | "cli_direct" | undefined;
2555
+ licenseId?: string | undefined;
2556
+ licenseStatus?: "active" | "missing" | "invalid" | "expired" | "eval" | undefined;
2529
2557
  }, {
2530
2558
  event: "reticle_installed" | "cli_command_run" | "daemon_started" | "daemon_stopped" | "session_progress" | "verification_completed" | "project_profiled" | "version_changed" | "runtime_crashed" | "feedback_submitted" | "identified" | "mcp_client_connected" | "app_instrumented" | "instrumentation_stalled" | "mcp_connection_lost" | "init_completed" | "bug_found" | "tool_refused";
2531
2559
  version: string;
@@ -2540,7 +2568,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
2540
2568
  bug?: {
2541
2569
  kind: string;
2542
2570
  source: "replay" | "contradiction" | "crawl" | "assertion";
2543
- attribution: "app" | "reticle" | "request" | "unclassified";
2571
+ attribution: "reticle" | "app" | "request" | "unclassified";
2544
2572
  falseGreen: boolean;
2545
2573
  repeat: boolean;
2546
2574
  tool?: string | undefined;
@@ -2656,7 +2684,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
2656
2684
  passed: boolean;
2657
2685
  falseGreenCaught: boolean;
2658
2686
  durationMs?: number | undefined;
2659
- reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "evidence_incomplete" | "proved" | "absence_blind_spot" | undefined;
2687
+ reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "nothing_declared" | "outcome_pending" | "outcome_unread" | "unsettled" | "evidence_incomplete" | "proved" | "absence_blind_spot" | undefined;
2660
2688
  brand?: "other" | "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | undefined;
2661
2689
  browser?: string | undefined;
2662
2690
  uncleanLoss?: "buffer_loss" | "transport_gap" | "blind_spot" | "other" | undefined;
@@ -2672,7 +2700,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
2672
2700
  message?: string | undefined;
2673
2701
  errorType?: string | undefined;
2674
2702
  tool?: string | undefined;
2675
- port?: "other" | "reticle" | undefined;
2703
+ port?: "reticle" | "other" | undefined;
2676
2704
  fingerprint?: string | undefined;
2677
2705
  machine?: {
2678
2706
  rssMb: number;
@@ -2730,5 +2758,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
2730
2758
  msWaited: number;
2731
2759
  } | undefined;
2732
2760
  installSource?: "unknown" | "skill_file" | "npx_skill" | "plugin" | "docs_site" | "readme" | "cli_direct" | undefined;
2761
+ licenseId?: string | undefined;
2762
+ licenseStatus?: "active" | "missing" | "invalid" | "expired" | "eval" | undefined;
2733
2763
  }>;
2734
2764
  export type TelemetryEvent = z.infer<typeof TelemetryEventSchema>;
package/dist/telemetry.js CHANGED
@@ -20,6 +20,7 @@ import { MachineSnapshotSchema, ProjectProfileSchema, SessionSummarySchema, } fr
20
20
  import { BrowserBrand, FeedbackSchema } from './telemetry-feedback.js';
21
21
  import { CaptureLoss, VerifiedReason } from './verified-constants.js';
22
22
  import { IdentitySchema } from './telemetry-feedback.js';
23
+ import { LicenseActivation } from './telemetry-license.js';
23
24
  /** Bump when the event shape changes so the analytics side can segment old senders. */
24
25
  export const TELEMETRY_EVENT_VERSION = 3;
25
26
  /**
@@ -916,4 +917,22 @@ export const TelemetryEventSchema = z.object({
916
917
  * common, and because there is exactly one fact to carry. Absent on every other kind.
917
918
  */
918
919
  installSource: z.nativeEnum(InstallSource).optional(),
920
+ /**
921
+ * Enterprise activation, on EVERY event. Two scalars rather than a block, for the same reason
922
+ * `installSource` is one: they describe the install, not any single event, and they have to be
923
+ * present on the events that show whether a licensed customer got anywhere.
924
+ *
925
+ * `licenseId` is the signed license id — an opaque uuid that resolves to a company only against the
926
+ * issuance ledger we hold locally, so the analytics backend never learns a customer list. The
927
+ * organisation NAME is deliberately absent: it is free text somebody typed at signing time, and
928
+ * rule 3 is names-never-values.
929
+ *
930
+ * `licenseId` is present only when activation is `active`; `licenseStatus` rides whenever an issuer
931
+ * key is baked, including the failure states, which is what makes a lapse distinguishable from a
932
+ * churn. The PLAN is deliberately not here: the issuance ledger already holds it against this same
933
+ * id, so it would be a per-event cost for something the join that resolves the id resolves anyway.
934
+ */
935
+ licenseId: z.string().min(1).max(64).optional(),
936
+ /** How activation resolved. Absent on a build with no issuer key baked, i.e. every OSS install. */
937
+ licenseStatus: z.nativeEnum(LicenseActivation).optional(),
919
938
  });
@@ -19,6 +19,20 @@ export declare const Verified: {
19
19
  readonly NO: "no";
20
20
  /** Not determinable from this evidence — vacuous grade, dirty capture, or never settled. */
21
21
  readonly UNKNOWN: "unknown";
22
+ /**
23
+ * The engine saw the whole window, ran every oracle, and found nothing wrong — but nothing was
24
+ * declared to prove, so this is not verification.
25
+ *
26
+ * Distinct from `unknown`, which used to carry both this and "I could not see". The two need
27
+ * opposite responses: this one says ASSERT SOMETHING, the other says LOOK AGAIN WITH BETTER
28
+ * COVERAGE, and collapsing them into one word sent people to fix the wrong thing.
29
+ *
30
+ * Two properties keep it honest, and both are enforced rather than documented: it requires a
31
+ * SETTLED window, so it cannot be earned by returning early, and it is never `yes`, so it cannot be
32
+ * mistaken for proof. Without the first it would be the green-forever button that an
33
+ * always-available "nothing was wrong" always becomes.
34
+ */
35
+ readonly NO_FAULT: "no-fault";
22
36
  };
23
37
  export type Verified = (typeof Verified)[keyof typeof Verified];
24
38
  /**
@@ -62,8 +76,13 @@ export declare const VerifiedReason: {
62
76
  readonly ALREADY_TRUE: "already_true";
63
77
  /** The capture was not clean, so a green would only describe what happened to be observed. */
64
78
  readonly UNCLEAN_CAPTURE: "unclean_capture";
65
- /** Nothing was asserted at a real grade — the assertion could not have failed. */
79
+ /**
80
+ * Nothing was asserted at a real grade — the assertion could not have failed — AND the window did
81
+ * not settle, so the engine cannot even say it looked at the whole thing.
82
+ */
66
83
  readonly VACUOUS_GRADE: "vacuous_grade";
84
+ /** Nothing was asserted at a real grade, but the window settled and no channel reported a problem. */
85
+ readonly NOTHING_DECLARED: "nothing_declared";
67
86
  /** A write answered 202 Accepted: the outcome does not exist yet. */
68
87
  readonly OUTCOME_PENDING: "outcome_pending";
69
88
  /** A 2xx whose body was never recorded, so the one channel that could disagree was closed. */
@@ -19,6 +19,20 @@ export const Verified = {
19
19
  NO: 'no',
20
20
  /** Not determinable from this evidence — vacuous grade, dirty capture, or never settled. */
21
21
  UNKNOWN: 'unknown',
22
+ /**
23
+ * The engine saw the whole window, ran every oracle, and found nothing wrong — but nothing was
24
+ * declared to prove, so this is not verification.
25
+ *
26
+ * Distinct from `unknown`, which used to carry both this and "I could not see". The two need
27
+ * opposite responses: this one says ASSERT SOMETHING, the other says LOOK AGAIN WITH BETTER
28
+ * COVERAGE, and collapsing them into one word sent people to fix the wrong thing.
29
+ *
30
+ * Two properties keep it honest, and both are enforced rather than documented: it requires a
31
+ * SETTLED window, so it cannot be earned by returning early, and it is never `yes`, so it cannot be
32
+ * mistaken for proof. Without the first it would be the green-forever button that an
33
+ * always-available "nothing was wrong" always becomes.
34
+ */
35
+ NO_FAULT: 'no-fault',
22
36
  };
23
37
  /**
24
38
  * WHY a verdict came out the way it did — the deciding clause of the rule, named.
@@ -61,8 +75,13 @@ export const VerifiedReason = {
61
75
  ALREADY_TRUE: 'already_true',
62
76
  /** The capture was not clean, so a green would only describe what happened to be observed. */
63
77
  UNCLEAN_CAPTURE: 'unclean_capture',
64
- /** Nothing was asserted at a real grade — the assertion could not have failed. */
78
+ /**
79
+ * Nothing was asserted at a real grade — the assertion could not have failed — AND the window did
80
+ * not settle, so the engine cannot even say it looked at the whole thing.
81
+ */
65
82
  VACUOUS_GRADE: 'vacuous_grade',
83
+ /** Nothing was asserted at a real grade, but the window settled and no channel reported a problem. */
84
+ NOTHING_DECLARED: 'nothing_declared',
66
85
  /** A write answered 202 Accepted: the outcome does not exist yet. */
67
86
  OUTCOME_PENDING: 'outcome_pending',
68
87
  /** A 2xx whose body was never recorded, so the one channel that could disagree was closed. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reticlehq/core",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "description": "The Reticle foundation: the shared wire contract — types, zod schemas, constants, messages, and the isomorphic kernel that every Reticle package (browser SDK, server, kits, test harness) imports. Depends only on zod.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",