@treeseed/sdk 0.13.0-rc.61 → 0.13.0-rc.63
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"completedAt":"2026-08-
|
|
1
|
+
{"completedAt":"2026-08-31T11:48:08.628Z"}
|
|
@@ -186,13 +186,13 @@ export declare const sandboxAssignmentSchema: z.ZodObject<{
|
|
|
186
186
|
allowedServices: string[];
|
|
187
187
|
connectedDevelopmentSessionId?: string | undefined;
|
|
188
188
|
};
|
|
189
|
+
profile: string;
|
|
189
190
|
outputs: {
|
|
190
191
|
path: string;
|
|
191
192
|
id: string;
|
|
192
193
|
mediaType: string;
|
|
193
194
|
maxBytes: number;
|
|
194
195
|
}[];
|
|
195
|
-
profile: string;
|
|
196
196
|
guestImage: string;
|
|
197
197
|
guestImageDigest: string;
|
|
198
198
|
runnerId: string;
|
|
@@ -254,13 +254,13 @@ export declare const sandboxAssignmentSchema: z.ZodObject<{
|
|
|
254
254
|
allowedServices: string[];
|
|
255
255
|
connectedDevelopmentSessionId?: string | undefined;
|
|
256
256
|
};
|
|
257
|
+
profile: string;
|
|
257
258
|
outputs: {
|
|
258
259
|
path: string;
|
|
259
260
|
id: string;
|
|
260
261
|
mediaType: string;
|
|
261
262
|
maxBytes: number;
|
|
262
263
|
}[];
|
|
263
|
-
profile: string;
|
|
264
264
|
guestImage: string;
|
|
265
265
|
guestImageDigest: string;
|
|
266
266
|
runnerId: string;
|
|
@@ -485,7 +485,7 @@ export declare const hostComponentSchema: z.ZodObject<{
|
|
|
485
485
|
storageBytes?: number | undefined;
|
|
486
486
|
};
|
|
487
487
|
enabled: boolean;
|
|
488
|
-
track: "
|
|
488
|
+
track: "development" | "stable";
|
|
489
489
|
aliases: Record<string, string>;
|
|
490
490
|
configuration: Record<string, unknown>;
|
|
491
491
|
connections: Record<string, {
|
|
@@ -516,7 +516,7 @@ export declare const hostComponentSchema: z.ZodObject<{
|
|
|
516
516
|
profile?: string | undefined;
|
|
517
517
|
}, {
|
|
518
518
|
enabled: boolean;
|
|
519
|
-
track: "
|
|
519
|
+
track: "development" | "stable";
|
|
520
520
|
resources?: {
|
|
521
521
|
cpuCores?: number | undefined;
|
|
522
522
|
memoryBytes?: number | undefined;
|
|
@@ -630,6 +630,9 @@ export declare const hostConfigurationSchema: z.ZodObject<{
|
|
|
630
630
|
pollSeconds: 60;
|
|
631
631
|
}>;
|
|
632
632
|
}, "strict", z.ZodTypeAny, {
|
|
633
|
+
development: {
|
|
634
|
+
pollSeconds: 60;
|
|
635
|
+
};
|
|
633
636
|
stable: {
|
|
634
637
|
metadataPollSeconds: number;
|
|
635
638
|
maintenanceWindow: {
|
|
@@ -638,11 +641,11 @@ export declare const hostConfigurationSchema: z.ZodObject<{
|
|
|
638
641
|
jitterMinutes: number;
|
|
639
642
|
};
|
|
640
643
|
};
|
|
644
|
+
defaultTrack: "development" | "stable";
|
|
645
|
+
}, {
|
|
641
646
|
development: {
|
|
642
647
|
pollSeconds: 60;
|
|
643
648
|
};
|
|
644
|
-
defaultTrack: "stable" | "development";
|
|
645
|
-
}, {
|
|
646
649
|
stable: {
|
|
647
650
|
metadataPollSeconds: number;
|
|
648
651
|
maintenanceWindow: {
|
|
@@ -651,10 +654,7 @@ export declare const hostConfigurationSchema: z.ZodObject<{
|
|
|
651
654
|
jitterMinutes: number;
|
|
652
655
|
};
|
|
653
656
|
};
|
|
654
|
-
|
|
655
|
-
pollSeconds: 60;
|
|
656
|
-
};
|
|
657
|
-
defaultTrack: "stable" | "development";
|
|
657
|
+
defaultTrack: "development" | "stable";
|
|
658
658
|
}>;
|
|
659
659
|
components: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
660
660
|
enabled: z.ZodBoolean;
|
|
@@ -841,7 +841,7 @@ export declare const hostConfigurationSchema: z.ZodObject<{
|
|
|
841
841
|
storageBytes?: number | undefined;
|
|
842
842
|
};
|
|
843
843
|
enabled: boolean;
|
|
844
|
-
track: "
|
|
844
|
+
track: "development" | "stable";
|
|
845
845
|
aliases: Record<string, string>;
|
|
846
846
|
configuration: Record<string, unknown>;
|
|
847
847
|
connections: Record<string, {
|
|
@@ -872,7 +872,7 @@ export declare const hostConfigurationSchema: z.ZodObject<{
|
|
|
872
872
|
profile?: string | undefined;
|
|
873
873
|
}, {
|
|
874
874
|
enabled: boolean;
|
|
875
|
-
track: "
|
|
875
|
+
track: "development" | "stable";
|
|
876
876
|
resources?: {
|
|
877
877
|
cpuCores?: number | undefined;
|
|
878
878
|
memoryBytes?: number | undefined;
|
|
@@ -1461,7 +1461,7 @@ export declare const hostConfigurationSchema: z.ZodObject<{
|
|
|
1461
1461
|
storageBytes?: number | undefined;
|
|
1462
1462
|
};
|
|
1463
1463
|
enabled: boolean;
|
|
1464
|
-
track: "
|
|
1464
|
+
track: "development" | "stable";
|
|
1465
1465
|
aliases: Record<string, string>;
|
|
1466
1466
|
configuration: Record<string, unknown>;
|
|
1467
1467
|
connections: Record<string, {
|
|
@@ -1507,6 +1507,9 @@ export declare const hostConfigurationSchema: z.ZodObject<{
|
|
|
1507
1507
|
generation: number;
|
|
1508
1508
|
configurationId: string;
|
|
1509
1509
|
updates: {
|
|
1510
|
+
development: {
|
|
1511
|
+
pollSeconds: 60;
|
|
1512
|
+
};
|
|
1510
1513
|
stable: {
|
|
1511
1514
|
metadataPollSeconds: number;
|
|
1512
1515
|
maintenanceWindow: {
|
|
@@ -1515,10 +1518,7 @@ export declare const hostConfigurationSchema: z.ZodObject<{
|
|
|
1515
1518
|
jitterMinutes: number;
|
|
1516
1519
|
};
|
|
1517
1520
|
};
|
|
1518
|
-
|
|
1519
|
-
pollSeconds: 60;
|
|
1520
|
-
};
|
|
1521
|
-
defaultTrack: "stable" | "development";
|
|
1521
|
+
defaultTrack: "development" | "stable";
|
|
1522
1522
|
};
|
|
1523
1523
|
fleet: {
|
|
1524
1524
|
rolloutGroup: string;
|
|
@@ -1595,7 +1595,7 @@ export declare const hostConfigurationSchema: z.ZodObject<{
|
|
|
1595
1595
|
};
|
|
1596
1596
|
components: Record<string, {
|
|
1597
1597
|
enabled: boolean;
|
|
1598
|
-
track: "
|
|
1598
|
+
track: "development" | "stable";
|
|
1599
1599
|
resources?: {
|
|
1600
1600
|
cpuCores?: number | undefined;
|
|
1601
1601
|
memoryBytes?: number | undefined;
|
|
@@ -1647,6 +1647,9 @@ export declare const hostConfigurationSchema: z.ZodObject<{
|
|
|
1647
1647
|
generation: number;
|
|
1648
1648
|
configurationId: string;
|
|
1649
1649
|
updates: {
|
|
1650
|
+
development: {
|
|
1651
|
+
pollSeconds: 60;
|
|
1652
|
+
};
|
|
1650
1653
|
stable: {
|
|
1651
1654
|
metadataPollSeconds: number;
|
|
1652
1655
|
maintenanceWindow: {
|
|
@@ -1655,10 +1658,7 @@ export declare const hostConfigurationSchema: z.ZodObject<{
|
|
|
1655
1658
|
jitterMinutes: number;
|
|
1656
1659
|
};
|
|
1657
1660
|
};
|
|
1658
|
-
|
|
1659
|
-
pollSeconds: 60;
|
|
1660
|
-
};
|
|
1661
|
-
defaultTrack: "stable" | "development";
|
|
1661
|
+
defaultTrack: "development" | "stable";
|
|
1662
1662
|
};
|
|
1663
1663
|
fleet: {
|
|
1664
1664
|
rolloutGroup: string;
|
|
@@ -3552,7 +3552,7 @@ export declare const componentReleaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
3552
3552
|
requiresBackup: boolean;
|
|
3553
3553
|
};
|
|
3554
3554
|
componentId: string;
|
|
3555
|
-
track: "
|
|
3555
|
+
track: "development" | "stable";
|
|
3556
3556
|
applicationVersion: string;
|
|
3557
3557
|
revision: number;
|
|
3558
3558
|
stableBase: {
|
|
@@ -3681,7 +3681,7 @@ export declare const componentReleaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
3681
3681
|
requiresBackup: boolean;
|
|
3682
3682
|
};
|
|
3683
3683
|
componentId: string;
|
|
3684
|
-
track: "
|
|
3684
|
+
track: "development" | "stable";
|
|
3685
3685
|
applicationVersion: string;
|
|
3686
3686
|
revision: number;
|
|
3687
3687
|
stableBase: {
|
|
@@ -3810,7 +3810,7 @@ export declare const componentReleaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
3810
3810
|
requiresBackup: boolean;
|
|
3811
3811
|
};
|
|
3812
3812
|
componentId: string;
|
|
3813
|
-
track: "
|
|
3813
|
+
track: "development" | "stable";
|
|
3814
3814
|
applicationVersion: string;
|
|
3815
3815
|
revision: number;
|
|
3816
3816
|
stableBase: {
|
|
@@ -3939,7 +3939,7 @@ export declare const componentReleaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
3939
3939
|
requiresBackup: boolean;
|
|
3940
3940
|
};
|
|
3941
3941
|
componentId: string;
|
|
3942
|
-
track: "
|
|
3942
|
+
track: "development" | "stable";
|
|
3943
3943
|
applicationVersion: string;
|
|
3944
3944
|
revision: number;
|
|
3945
3945
|
stableBase: {
|
|
@@ -4113,7 +4113,7 @@ export declare const integrationReleaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
4113
4113
|
commit: string;
|
|
4114
4114
|
};
|
|
4115
4115
|
generation: number;
|
|
4116
|
-
track: "
|
|
4116
|
+
track: "development" | "stable";
|
|
4117
4117
|
compatibilityId: string;
|
|
4118
4118
|
deployment: {
|
|
4119
4119
|
repository: "treeseed-ai/deployment";
|
|
@@ -4153,7 +4153,7 @@ export declare const integrationReleaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
4153
4153
|
commit: string;
|
|
4154
4154
|
};
|
|
4155
4155
|
generation: number;
|
|
4156
|
-
track: "
|
|
4156
|
+
track: "development" | "stable";
|
|
4157
4157
|
compatibilityId: string;
|
|
4158
4158
|
deployment: {
|
|
4159
4159
|
repository: "treeseed-ai/deployment";
|
|
@@ -4193,7 +4193,7 @@ export declare const integrationReleaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
4193
4193
|
commit: string;
|
|
4194
4194
|
};
|
|
4195
4195
|
generation: number;
|
|
4196
|
-
track: "
|
|
4196
|
+
track: "development" | "stable";
|
|
4197
4197
|
compatibilityId: string;
|
|
4198
4198
|
deployment: {
|
|
4199
4199
|
repository: "treeseed-ai/deployment";
|
|
@@ -4233,7 +4233,7 @@ export declare const integrationReleaseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
4233
4233
|
commit: string;
|
|
4234
4234
|
};
|
|
4235
4235
|
generation: number;
|
|
4236
|
-
track: "
|
|
4236
|
+
track: "development" | "stable";
|
|
4237
4237
|
compatibilityId: string;
|
|
4238
4238
|
deployment: {
|
|
4239
4239
|
repository: "treeseed-ai/deployment";
|
|
@@ -5240,7 +5240,7 @@ export declare const releaseCatalogSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5240
5240
|
requiresBackup: boolean;
|
|
5241
5241
|
};
|
|
5242
5242
|
componentId: string;
|
|
5243
|
-
track: "
|
|
5243
|
+
track: "development" | "stable";
|
|
5244
5244
|
applicationVersion: string;
|
|
5245
5245
|
revision: number;
|
|
5246
5246
|
stableBase: {
|
|
@@ -5369,7 +5369,7 @@ export declare const releaseCatalogSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5369
5369
|
requiresBackup: boolean;
|
|
5370
5370
|
};
|
|
5371
5371
|
componentId: string;
|
|
5372
|
-
track: "
|
|
5372
|
+
track: "development" | "stable";
|
|
5373
5373
|
applicationVersion: string;
|
|
5374
5374
|
revision: number;
|
|
5375
5375
|
stableBase: {
|
|
@@ -5498,7 +5498,7 @@ export declare const releaseCatalogSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5498
5498
|
requiresBackup: boolean;
|
|
5499
5499
|
};
|
|
5500
5500
|
componentId: string;
|
|
5501
|
-
track: "
|
|
5501
|
+
track: "development" | "stable";
|
|
5502
5502
|
applicationVersion: string;
|
|
5503
5503
|
revision: number;
|
|
5504
5504
|
stableBase: {
|
|
@@ -5627,7 +5627,7 @@ export declare const releaseCatalogSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5627
5627
|
requiresBackup: boolean;
|
|
5628
5628
|
};
|
|
5629
5629
|
componentId: string;
|
|
5630
|
-
track: "
|
|
5630
|
+
track: "development" | "stable";
|
|
5631
5631
|
applicationVersion: string;
|
|
5632
5632
|
revision: number;
|
|
5633
5633
|
stableBase: {
|
|
@@ -5761,7 +5761,7 @@ export declare const releaseCatalogSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5761
5761
|
requiresBackup: boolean;
|
|
5762
5762
|
};
|
|
5763
5763
|
componentId: string;
|
|
5764
|
-
track: "
|
|
5764
|
+
track: "development" | "stable";
|
|
5765
5765
|
applicationVersion: string;
|
|
5766
5766
|
revision: number;
|
|
5767
5767
|
stableBase: {
|
|
@@ -5785,7 +5785,7 @@ export declare const releaseCatalogSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5785
5785
|
}[];
|
|
5786
5786
|
createdAt: string;
|
|
5787
5787
|
generation: number;
|
|
5788
|
-
track: "
|
|
5788
|
+
track: "development" | "stable";
|
|
5789
5789
|
compatibilityId: string;
|
|
5790
5790
|
catalogDigest: string;
|
|
5791
5791
|
stableBase: {
|
|
@@ -5903,7 +5903,7 @@ export declare const releaseCatalogSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5903
5903
|
requiresBackup: boolean;
|
|
5904
5904
|
};
|
|
5905
5905
|
componentId: string;
|
|
5906
|
-
track: "
|
|
5906
|
+
track: "development" | "stable";
|
|
5907
5907
|
applicationVersion: string;
|
|
5908
5908
|
revision: number;
|
|
5909
5909
|
stableBase: {
|
|
@@ -5927,7 +5927,7 @@ export declare const releaseCatalogSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5927
5927
|
}[];
|
|
5928
5928
|
createdAt: string;
|
|
5929
5929
|
generation: number;
|
|
5930
|
-
track: "
|
|
5930
|
+
track: "development" | "stable";
|
|
5931
5931
|
compatibilityId: string;
|
|
5932
5932
|
catalogDigest: string;
|
|
5933
5933
|
stableBase: {
|
|
@@ -6045,7 +6045,7 @@ export declare const releaseCatalogSchema: z.ZodEffects<z.ZodObject<{
|
|
|
6045
6045
|
requiresBackup: boolean;
|
|
6046
6046
|
};
|
|
6047
6047
|
componentId: string;
|
|
6048
|
-
track: "
|
|
6048
|
+
track: "development" | "stable";
|
|
6049
6049
|
applicationVersion: string;
|
|
6050
6050
|
revision: number;
|
|
6051
6051
|
stableBase: {
|
|
@@ -6069,7 +6069,7 @@ export declare const releaseCatalogSchema: z.ZodEffects<z.ZodObject<{
|
|
|
6069
6069
|
}[];
|
|
6070
6070
|
createdAt: string;
|
|
6071
6071
|
generation: number;
|
|
6072
|
-
track: "
|
|
6072
|
+
track: "development" | "stable";
|
|
6073
6073
|
compatibilityId: string;
|
|
6074
6074
|
catalogDigest: string;
|
|
6075
6075
|
stableBase: {
|
|
@@ -6187,7 +6187,7 @@ export declare const releaseCatalogSchema: z.ZodEffects<z.ZodObject<{
|
|
|
6187
6187
|
requiresBackup: boolean;
|
|
6188
6188
|
};
|
|
6189
6189
|
componentId: string;
|
|
6190
|
-
track: "
|
|
6190
|
+
track: "development" | "stable";
|
|
6191
6191
|
applicationVersion: string;
|
|
6192
6192
|
revision: number;
|
|
6193
6193
|
stableBase: {
|
|
@@ -6211,7 +6211,7 @@ export declare const releaseCatalogSchema: z.ZodEffects<z.ZodObject<{
|
|
|
6211
6211
|
}[];
|
|
6212
6212
|
createdAt: string;
|
|
6213
6213
|
generation: number;
|
|
6214
|
-
track: "
|
|
6214
|
+
track: "development" | "stable";
|
|
6215
6215
|
compatibilityId: string;
|
|
6216
6216
|
catalogDigest: string;
|
|
6217
6217
|
stableBase: {
|
|
@@ -6293,12 +6293,12 @@ export declare const hostBootstrapSchema: z.ZodObject<{
|
|
|
6293
6293
|
}, "strict", z.ZodTypeAny, {
|
|
6294
6294
|
repository: string;
|
|
6295
6295
|
origin: "TreeSeed Deployment";
|
|
6296
|
-
suite: "
|
|
6296
|
+
suite: "development" | "stable";
|
|
6297
6297
|
keyFingerprint: string;
|
|
6298
6298
|
}, {
|
|
6299
6299
|
repository: string;
|
|
6300
6300
|
origin: "TreeSeed Deployment";
|
|
6301
|
-
suite: "
|
|
6301
|
+
suite: "development" | "stable";
|
|
6302
6302
|
keyFingerprint: string;
|
|
6303
6303
|
}>;
|
|
6304
6304
|
packages: z.ZodArray<z.ZodObject<{
|
|
@@ -6352,7 +6352,7 @@ export declare const hostBootstrapSchema: z.ZodObject<{
|
|
|
6352
6352
|
apt: {
|
|
6353
6353
|
repository: string;
|
|
6354
6354
|
origin: "TreeSeed Deployment";
|
|
6355
|
-
suite: "
|
|
6355
|
+
suite: "development" | "stable";
|
|
6356
6356
|
keyFingerprint: string;
|
|
6357
6357
|
};
|
|
6358
6358
|
credentialPolicy: {
|
|
@@ -6376,7 +6376,7 @@ export declare const hostBootstrapSchema: z.ZodObject<{
|
|
|
6376
6376
|
apt: {
|
|
6377
6377
|
repository: string;
|
|
6378
6378
|
origin: "TreeSeed Deployment";
|
|
6379
|
-
suite: "
|
|
6379
|
+
suite: "development" | "stable";
|
|
6380
6380
|
keyFingerprint: string;
|
|
6381
6381
|
};
|
|
6382
6382
|
credentialPolicy: {
|
|
@@ -6436,7 +6436,7 @@ export declare const hostUpdateSchema: z.ZodObject<{
|
|
|
6436
6436
|
eligibleAt: string;
|
|
6437
6437
|
jitterSeconds: number;
|
|
6438
6438
|
};
|
|
6439
|
-
track: "
|
|
6439
|
+
track: "development" | "stable";
|
|
6440
6440
|
updateId: string;
|
|
6441
6441
|
fromCatalogDigest: string;
|
|
6442
6442
|
toCatalogDigest: string;
|
|
@@ -6454,7 +6454,7 @@ export declare const hostUpdateSchema: z.ZodObject<{
|
|
|
6454
6454
|
eligibleAt: string;
|
|
6455
6455
|
jitterSeconds: number;
|
|
6456
6456
|
};
|
|
6457
|
-
track: "
|
|
6457
|
+
track: "development" | "stable";
|
|
6458
6458
|
updateId: string;
|
|
6459
6459
|
fromCatalogDigest: string;
|
|
6460
6460
|
toCatalogDigest: string;
|
|
@@ -2,11 +2,72 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { existsSync, lstatSync, readFileSync } from "node:fs";
|
|
3
3
|
import { extname, relative, resolve } from "node:path";
|
|
4
4
|
import { execFileSync } from "node:child_process";
|
|
5
|
+
import { parse } from "yaml";
|
|
6
|
+
import { hostTemplateSchema, integrationLockSchema } from "./contracts.js";
|
|
7
|
+
import { inventorySchema, profileSchema } from "./schemas.js";
|
|
5
8
|
const allowedRoots = /* @__PURE__ */ new Set([".github", "config", "docs", "profiles", "seeds", "templates"]);
|
|
6
|
-
const allowedFiles = /* @__PURE__ */ new Set([".gitignore", "AGENTS.md", "LICENSE", "LICENSE.md", "README.md", "treeseed.site.yaml"]);
|
|
9
|
+
const allowedFiles = /* @__PURE__ */ new Set([".gitignore", "AGENTS.md", "LICENSE", "LICENSE.md", "README.md", "skills-lock.json", "treeseed.site.yaml"]);
|
|
7
10
|
const allowedExtensions = /* @__PURE__ */ new Set([".md", ".yaml", ".yml", ".json", ".lock", ".toml"]);
|
|
8
11
|
const forbiddenExtensions = /* @__PURE__ */ new Set([".js", ".jsx", ".mjs", ".cjs", ".ts", ".tsx", ".py", ".sh", ".go", ".rs", ".java"]);
|
|
9
12
|
const personalPath = /(?:^|[\s'"`:=])(?:\/home\/[^/\s]+|\/Users\/[^/\s]+|[A-Za-z]:\\Users\\[^\\\s]+)/u;
|
|
13
|
+
function semanticDiagnostics(root, tracked) {
|
|
14
|
+
const diagnostics = [];
|
|
15
|
+
const document = (path) => parse(readFileSync(resolve(root, path), "utf8"));
|
|
16
|
+
const report = (code, path, message) => diagnostics.push({ code, path, message });
|
|
17
|
+
const safe = (path, load) => {
|
|
18
|
+
try {
|
|
19
|
+
return load();
|
|
20
|
+
} catch (error) {
|
|
21
|
+
report("declaration_invalid", path, error instanceof Error ? error.message : String(error));
|
|
22
|
+
return void 0;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const profiles = /* @__PURE__ */ new Map();
|
|
26
|
+
for (const path of [...tracked].filter((value) => /^profiles\/[^/]+\.ya?ml$/u.test(value))) {
|
|
27
|
+
const profile = safe(path, () => profileSchema.parse(document(path)));
|
|
28
|
+
if (profile) profiles.set(profile.id, profile);
|
|
29
|
+
}
|
|
30
|
+
const sitePath = "treeseed.site.yaml";
|
|
31
|
+
if (!tracked.has(sitePath)) return diagnostics;
|
|
32
|
+
const site = safe(sitePath, () => document(sitePath));
|
|
33
|
+
if (!site) return diagnostics;
|
|
34
|
+
const development = site.development;
|
|
35
|
+
const inventoryPath = development?.local?.inventory?.path;
|
|
36
|
+
let projectSlugs = /* @__PURE__ */ new Set();
|
|
37
|
+
if (development?.local?.inventory?.source !== "seed" || !inventoryPath || !tracked.has(inventoryPath)) {
|
|
38
|
+
report("inventory_reference_invalid", sitePath, "The local inventory must reference a tracked seed declaration.");
|
|
39
|
+
} else {
|
|
40
|
+
const inventory = safe(inventoryPath, () => inventorySchema.parse(document(inventoryPath)));
|
|
41
|
+
if (inventory) projectSlugs = new Set(inventory.resources.projects.map((project) => project.slug));
|
|
42
|
+
}
|
|
43
|
+
for (const [id, profile] of profiles) {
|
|
44
|
+
for (const project of profile.sources.projects) if (!projectSlugs.has(project)) report("profile_project_unknown", `profiles/${id}.yaml`, `Profile project ${project} is absent from the portable inventory.`);
|
|
45
|
+
for (const parent of profile.extends) if (!profiles.has(parent)) report("profile_parent_unknown", `profiles/${id}.yaml`, `Profile parent ${parent} does not exist.`);
|
|
46
|
+
}
|
|
47
|
+
const integrations = site.integrations;
|
|
48
|
+
const integrationDigests = /* @__PURE__ */ new Map();
|
|
49
|
+
for (const path of Object.values(integrations ?? {}).filter((value) => value.includes("/integrations/"))) {
|
|
50
|
+
if (!tracked.has(path)) {
|
|
51
|
+
report("integration_reference_invalid", sitePath, `Integration lock ${path} is not tracked.`);
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const lock = safe(path, () => integrationLockSchema.parse(document(path)));
|
|
55
|
+
if (!lock) continue;
|
|
56
|
+
const digest = `sha256:${createHash("sha256").update(JSON.stringify(lock.components)).digest("hex")}`;
|
|
57
|
+
if (digest !== lock.digest) report("integration_digest_mismatch", path, "Integration lock digest does not bind its exact component list.");
|
|
58
|
+
integrationDigests.set(lock.release.replace(/-\d+$/u, ""), lock.digest);
|
|
59
|
+
}
|
|
60
|
+
for (const path of [...tracked].filter((value) => /^config\/hosts\/[^/]+\.ya?ml$/u.test(value))) {
|
|
61
|
+
const host = safe(path, () => hostTemplateSchema.parse(document(path)));
|
|
62
|
+
if (!host) continue;
|
|
63
|
+
for (const profile of host.profiles) if (!profiles.has(profile)) report("host_profile_unknown", path, `Host template profile ${profile} does not exist.`);
|
|
64
|
+
if (![...integrationDigests.values()].includes(host.integration.digest)) report("host_integration_unknown", path, "Host template integration digest is not present in a referenced integration lock.");
|
|
65
|
+
}
|
|
66
|
+
const production = site.production;
|
|
67
|
+
if (production && production.mutation !== "blocked") report("production_not_fail_closed", sitePath, "Production mutation must remain blocked until promotion gates pass.");
|
|
68
|
+
if (production?.topology && !tracked.has(production.topology)) report("topology_reference_invalid", sitePath, "Production topology must reference a tracked declaration.");
|
|
69
|
+
return diagnostics;
|
|
70
|
+
}
|
|
10
71
|
function verifyPlatformRepository(root = process.cwd()) {
|
|
11
72
|
const absoluteRoot = resolve(root);
|
|
12
73
|
const listed = execFileSync("git", ["ls-files", "-z"], { cwd: absoluteRoot, encoding: "utf8" }).split("\0").filter(Boolean).sort();
|
|
@@ -14,7 +75,15 @@ function verifyPlatformRepository(root = process.cwd()) {
|
|
|
14
75
|
const hash = createHash("sha256");
|
|
15
76
|
for (const path of listed) {
|
|
16
77
|
const fullPath = resolve(absoluteRoot, path);
|
|
17
|
-
if (!fullPath.startsWith(`${absoluteRoot}/`)
|
|
78
|
+
if (!fullPath.startsWith(`${absoluteRoot}/`)) {
|
|
79
|
+
diagnostics.push({ code: "path_not_portable", path, message: "Tracked paths must stay beneath the repository and cannot be symbolic links." });
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (!existsSync(fullPath)) {
|
|
83
|
+
diagnostics.push({ code: "tracked_file_missing", path, message: "Tracked Platform files must exist in the working tree." });
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (lstatSync(fullPath).isSymbolicLink()) {
|
|
18
87
|
diagnostics.push({ code: "path_not_portable", path, message: "Tracked paths must stay beneath the repository and cannot be symbolic links." });
|
|
19
88
|
continue;
|
|
20
89
|
}
|
|
@@ -23,12 +92,11 @@ function verifyPlatformRepository(root = process.cwd()) {
|
|
|
23
92
|
if (!allowedFiles.has(path) && !allowedRoots.has(rootSegment)) diagnostics.push({ code: "content_root_forbidden", path, message: "Platform may contain only declarations, documentation, locks, and GitHub configuration." });
|
|
24
93
|
if (forbiddenExtensions.has(extension)) diagnostics.push({ code: "implementation_forbidden", path, message: "Executable implementation belongs in its owning package." });
|
|
25
94
|
if (!allowedFiles.has(path) && !allowedExtensions.has(extension)) diagnostics.push({ code: "file_type_forbidden", path, message: "This tracked file type is outside the declarative Platform boundary." });
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (personalPath.test(source.toString("utf8"))) diagnostics.push({ code: "personal_path_forbidden", path, message: "Committed home-directory paths are forbidden." });
|
|
30
|
-
}
|
|
95
|
+
const source = readFileSync(fullPath);
|
|
96
|
+
hash.update(relative(absoluteRoot, fullPath)).update("\0").update(source);
|
|
97
|
+
if (personalPath.test(source.toString("utf8"))) diagnostics.push({ code: "personal_path_forbidden", path, message: "Committed home-directory paths are forbidden." });
|
|
31
98
|
}
|
|
99
|
+
diagnostics.push(...semanticDiagnostics(absoluteRoot, new Set(listed)));
|
|
32
100
|
return { schemaVersion: "treeseed.platform-verification/v1", root: absoluteRoot, digest: `sha256:${hash.digest("hex")}`, ok: diagnostics.length === 0, diagnostics };
|
|
33
101
|
}
|
|
34
102
|
export {
|