@treeseed/sdk 0.13.0-rc.42 → 0.13.0-rc.44
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.
|
@@ -83,11 +83,15 @@ export interface AccountIdentity {
|
|
|
83
83
|
linkedAt: string;
|
|
84
84
|
canUnlink: boolean;
|
|
85
85
|
}>;
|
|
86
|
+
/** Exact account revision supplied as If-Match for concurrent identity mutations. */
|
|
87
|
+
updatedAt?: string;
|
|
86
88
|
}
|
|
87
89
|
export interface AccountPreferences {
|
|
88
90
|
timeZone: string;
|
|
89
91
|
realTimeUpdates: boolean;
|
|
90
92
|
realTimePollingIntervalSeconds: 2 | 5 | 15 | 30;
|
|
93
|
+
/** Exact preference revision supplied as If-Match for concurrent preference mutations. */
|
|
94
|
+
updatedAt?: string;
|
|
91
95
|
}
|
|
92
96
|
export type AccountPreferencesUpdate = Partial<AccountPreferences>;
|
|
93
97
|
export interface AccountWebSession {
|
|
@@ -130,6 +134,8 @@ export interface NotificationPreferences {
|
|
|
130
134
|
emailCadence: NotificationEmailCadence;
|
|
131
135
|
globalContentTypes: string[];
|
|
132
136
|
projectOverrides: NotificationProjectOverride[];
|
|
137
|
+
/** Exact notification-preference revision supplied as If-Match for concurrent updates. */
|
|
138
|
+
updatedAt?: string;
|
|
133
139
|
}
|
|
134
140
|
export interface AccountNotification {
|
|
135
141
|
id: string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { GuaranteeDiagnostic, GuaranteeVerifierResult } from './index.js';
|
|
2
|
+
export interface UiEvidenceTrustInput {
|
|
3
|
+
requestedDevice: {
|
|
4
|
+
id: string;
|
|
5
|
+
viewport: {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
9
|
+
isMobile: boolean;
|
|
10
|
+
hasTouch: boolean;
|
|
11
|
+
};
|
|
12
|
+
actualDevice: {
|
|
13
|
+
id: string;
|
|
14
|
+
viewport: {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
isMobile: boolean;
|
|
19
|
+
hasTouch: boolean;
|
|
20
|
+
};
|
|
21
|
+
consoleErrors?: Array<{
|
|
22
|
+
message: string;
|
|
23
|
+
asserted?: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
networkErrors?: Array<{
|
|
26
|
+
status?: number;
|
|
27
|
+
message: string;
|
|
28
|
+
asserted?: boolean;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
export declare function validateUiEvidenceTrust(input: UiEvidenceTrustInput): GuaranteeDiagnostic[];
|
|
32
|
+
export declare function runUiEvidenceTrustVerifier(): GuaranteeVerifierResult;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
function validateUiEvidenceTrust(input) {
|
|
2
|
+
const diagnostics = [];
|
|
3
|
+
const requested = input.requestedDevice, actual = input.actualDevice;
|
|
4
|
+
if (requested.id !== actual.id || requested.viewport.width !== actual.viewport.width || requested.viewport.height !== actual.viewport.height || requested.isMobile !== actual.isMobile || requested.hasTouch !== actual.hasTouch) {
|
|
5
|
+
diagnostics.push({ severity: "error", code: "guarantee.scene_device_mismatch", message: `Requested ${requested.id}, but evidence recorded ${actual.id}.` });
|
|
6
|
+
}
|
|
7
|
+
for (const error of input.consoleErrors ?? []) if (!error.asserted) diagnostics.push({
|
|
8
|
+
severity: "error",
|
|
9
|
+
code: "guarantee.scene_unexpected_console_error",
|
|
10
|
+
message: error.message
|
|
11
|
+
});
|
|
12
|
+
for (const error of input.networkErrors ?? []) if (!error.asserted) diagnostics.push({
|
|
13
|
+
severity: "error",
|
|
14
|
+
code: "guarantee.scene_unexpected_network_error",
|
|
15
|
+
message: error.message
|
|
16
|
+
});
|
|
17
|
+
return diagnostics;
|
|
18
|
+
}
|
|
19
|
+
function runUiEvidenceTrustVerifier() {
|
|
20
|
+
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
21
|
+
const mismatch = validateUiEvidenceTrust({
|
|
22
|
+
requestedDevice: { id: "mobile_chromium", viewport: { width: 390, height: 844 }, isMobile: true, hasTouch: true },
|
|
23
|
+
actualDevice: { id: "desktop_chromium", viewport: { width: 1600, height: 900 }, isMobile: false, hasTouch: false },
|
|
24
|
+
consoleErrors: [{ message: "ReferenceError", asserted: false }],
|
|
25
|
+
networkErrors: [{ status: 500, message: "HTTP 500", asserted: false }]
|
|
26
|
+
});
|
|
27
|
+
const required = /* @__PURE__ */ new Set(["guarantee.scene_device_mismatch", "guarantee.scene_unexpected_console_error", "guarantee.scene_unexpected_network_error"]);
|
|
28
|
+
const observed = new Set(mismatch.map((entry) => entry.code));
|
|
29
|
+
const ok = [...required].every((code) => observed.has(code));
|
|
30
|
+
return {
|
|
31
|
+
schemaVersion: "treeseed.guarantee-verifier-result/v1",
|
|
32
|
+
verifierId: "@treeseed/sdk/ui-evidence-trust",
|
|
33
|
+
startedAt,
|
|
34
|
+
completedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
35
|
+
ok,
|
|
36
|
+
checks: [{
|
|
37
|
+
id: "sdk.ui.evidence-trust",
|
|
38
|
+
status: ok ? "passed" : "failed",
|
|
39
|
+
durationMs: 0,
|
|
40
|
+
diagnostics: ok ? [] : [{ severity: "error", code: "guarantee.ui_evidence_trust_incomplete", message: "UI evidence trust did not reject every invalid vector." }]
|
|
41
|
+
}]
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
runUiEvidenceTrustVerifier,
|
|
46
|
+
validateUiEvidenceTrust
|
|
47
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { runUiEvidenceTrustVerifier, validateUiEvidenceTrust } from './evidence-trust.js';
|
|
1
2
|
export type GuaranteeRunStatus = 'passed' | 'failed' | 'skipped' | 'blocked';
|
|
2
3
|
export type GuaranteeFilter = Record<string, unknown>;
|
|
3
4
|
export interface GuaranteeDiagnostic {
|
|
@@ -67,6 +68,40 @@ export interface GuaranteeRunReport {
|
|
|
67
68
|
diagnostics?: GuaranteeDiagnostic[];
|
|
68
69
|
[key: string]: unknown;
|
|
69
70
|
}
|
|
71
|
+
export interface ArtifactGuaranteeVerifier {
|
|
72
|
+
kind: 'artifact';
|
|
73
|
+
ownerPackage: string;
|
|
74
|
+
artifactId: string;
|
|
75
|
+
entrypoint: string;
|
|
76
|
+
exportName?: string;
|
|
77
|
+
caseId: string;
|
|
78
|
+
description?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface CatalogOperationGuaranteeVerifier {
|
|
81
|
+
kind: 'catalogOperation';
|
|
82
|
+
ownerPackage: string;
|
|
83
|
+
operationId: string;
|
|
84
|
+
caseId: string;
|
|
85
|
+
description?: string;
|
|
86
|
+
}
|
|
87
|
+
export type GuaranteeVerifierDefinition = ArtifactGuaranteeVerifier | CatalogOperationGuaranteeVerifier;
|
|
88
|
+
export interface GuaranteeVerifierCheck {
|
|
89
|
+
id: string;
|
|
90
|
+
status: 'passed' | 'failed';
|
|
91
|
+
durationMs: number;
|
|
92
|
+
diagnostics?: GuaranteeDiagnostic[];
|
|
93
|
+
error?: string;
|
|
94
|
+
evidence?: string[];
|
|
95
|
+
}
|
|
96
|
+
export interface GuaranteeVerifierResult {
|
|
97
|
+
schemaVersion: 'treeseed.guarantee-verifier-result/v1';
|
|
98
|
+
verifierId: string;
|
|
99
|
+
startedAt: string;
|
|
100
|
+
completedAt: string;
|
|
101
|
+
ok: boolean;
|
|
102
|
+
checks: GuaranteeVerifierCheck[];
|
|
103
|
+
[key: string]: unknown;
|
|
104
|
+
}
|
|
70
105
|
interface GuaranteeManifest {
|
|
71
106
|
id: string;
|
|
72
107
|
journey: string;
|
|
@@ -93,4 +128,3 @@ export declare function discoverGuarantees(input: {
|
|
|
93
128
|
total: number;
|
|
94
129
|
};
|
|
95
130
|
};
|
|
96
|
-
export {};
|
package/dist/guarantees/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
2
2
|
import { relative, resolve } from "node:path";
|
|
3
3
|
import { parse } from "yaml";
|
|
4
|
+
import { runUiEvidenceTrustVerifier, validateUiEvidenceTrust } from "./evidence-trust.js";
|
|
4
5
|
function walk(root, out = []) {
|
|
5
6
|
if (!existsSync(root)) return out;
|
|
6
7
|
for (const name of readdirSync(root)) {
|
|
@@ -37,5 +38,7 @@ function discoverGuarantees(input) {
|
|
|
37
38
|
return { ok: diagnostics.every((entry) => entry.severity !== "error"), guarantees, diagnostics, counts: { total: guarantees.length } };
|
|
38
39
|
}
|
|
39
40
|
export {
|
|
40
|
-
discoverGuarantees
|
|
41
|
+
discoverGuarantees,
|
|
42
|
+
runUiEvidenceTrustVerifier,
|
|
43
|
+
validateUiEvidenceTrust
|
|
41
44
|
};
|