@vectros-ai/blueprints 0.5.0 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -159,11 +159,36 @@ var BlueprintServicePrincipalSchema = z.object({
159
159
  externalId: z.string().min(1),
160
160
  displayName: z.string().min(1)
161
161
  }).strict();
162
- var BlueprintSeedRecordSchema = z.object({
162
+ var SeedCommonShape = {
163
+ /** The schema typeName this seed instantiates (should match a declared schema). */
163
164
  typeName: z.string().min(1),
164
- externalId: z.string().min(1),
165
+ /**
166
+ * Stable, caller-supplied id — the loader's idempotency key AND the value other
167
+ * seeds resolve a `reference` against (across surfaces: a record seed may
168
+ * reference a document seed by its externalId, and vice versa).
169
+ */
170
+ externalId: z.string().min(1)
171
+ };
172
+ var RecordSeedSchema = z.object({
173
+ surface: z.literal("record"),
174
+ ...SeedCommonShape,
175
+ /** The record payload, validated against the bound schema. */
165
176
  fields: z.record(z.unknown())
166
177
  }).strict();
178
+ var DocumentSeedSchema = z.object({
179
+ surface: z.literal("document"),
180
+ ...SeedCommonShape,
181
+ /** Human-readable document title — REQUIRED by the text-ingest path. */
182
+ title: z.string().min(1),
183
+ /** Raw text content to ingest + index — REQUIRED and non-empty (the platform rejects a blank ingest). */
184
+ text: z.string().min(1),
185
+ /** Optional structured payload bound to the schema (the document's `fields`). */
186
+ fields: z.record(z.unknown()).optional()
187
+ }).strict();
188
+ var BlueprintSeedRecordSchema = z.discriminatedUnion("surface", [
189
+ RecordSeedSchema,
190
+ DocumentSeedSchema
191
+ ]);
167
192
  var SELF_TOKEN_RE = /\$\{\{\s*self\.[A-Za-z_]\w*\s*\}\}/;
168
193
  function lintSelfTokenPlacement(value, ctx) {
169
194
  const walk = (node, path, inRoleDataScope) => {
@@ -219,6 +244,23 @@ function lintIdentityRefsDeclared(value, ctx) {
219
244
  };
220
245
  walk(value, []);
221
246
  }
247
+ function lintSeedSurfaces(value, ctx) {
248
+ const bp = value;
249
+ if (!Array.isArray(bp.seed)) return;
250
+ const byType = new Map((bp.schemas ?? []).map((s) => [s.typeName, s]));
251
+ bp.seed.forEach((seed, i) => {
252
+ const schema = byType.get(seed.typeName);
253
+ if (!schema) return;
254
+ const allowed = schema.allowedSurfaces ?? ["record"];
255
+ if (!allowed.includes(seed.surface ?? "record")) {
256
+ ctx.addIssue({
257
+ code: z.ZodIssueCode.custom,
258
+ path: ["seed", i, "surface"],
259
+ message: `seed '${seed.externalId}' uses surface '${seed.surface ?? "record"}', but schema '${seed.typeName}' allows only [${allowed.join(", ")}]`
260
+ });
261
+ }
262
+ });
263
+ }
222
264
  var BlueprintSchema = z.object({
223
265
  /** Stable blueprint id (the `--blueprint <name>` selector + idempotency key). */
224
266
  name: z.string().min(1),
@@ -241,6 +283,7 @@ var BlueprintSchema = z.object({
241
283
  }).strict().superRefine((bp, ctx) => {
242
284
  lintSelfTokenPlacement(bp, ctx);
243
285
  lintIdentityRefsDeclared(bp, ctx);
286
+ lintSeedSurfaces(bp, ctx);
244
287
  });
245
288
  function formatIssuePath(path) {
246
289
  let out = "";
@@ -719,6 +762,7 @@ var taskManagement = {
719
762
  },
720
763
  seed: [
721
764
  {
765
+ surface: "record",
722
766
  typeName: "task",
723
767
  externalId: "seed-welcome",
724
768
  fields: {
@@ -948,6 +992,7 @@ var codingAgentMemory = {
948
992
  // Seeded FIRST so the convention below resolves its reference to it — the
949
993
  // loader creates seeds in array order, and a reference target must exist when
950
994
  // the referencing record is written.
995
+ surface: "record",
951
996
  typeName: "decision",
952
997
  externalId: "seed-use-vectros-for-memory",
953
998
  fields: {
@@ -963,6 +1008,7 @@ var codingAgentMemory = {
963
1008
  // Demonstrates a live typed link at bootstrap: this convention references the
964
1009
  // decision above by its externalId, so "open the decision behind this rule"
965
1010
  // works the moment the blueprint is applied.
1011
+ surface: "record",
966
1012
  typeName: "convention",
967
1013
  externalId: "seed-record-the-why",
968
1014
  fields: {
@@ -978,6 +1024,703 @@ var codingAgentMemory = {
978
1024
  };
979
1025
  var coding_agent_memory_default = codingAgentMemory;
980
1026
 
1027
+ // src/blueprints/agentic-sdlc.ts
1028
+ var DATA_PLANE_ACTIONS = [
1029
+ "records:r",
1030
+ "records:c",
1031
+ "records:u",
1032
+ "search:r",
1033
+ "schemas:r",
1034
+ "inference:r",
1035
+ "documents:r",
1036
+ "documents:c",
1037
+ "folders:r",
1038
+ "folders:c"
1039
+ ];
1040
+ var agenticSdlc = {
1041
+ name: "agentic-sdlc",
1042
+ version: "1.0.0",
1043
+ description: "A whole-SDLC system of record for an AI development team \u2014 decisions, designs, references, runbooks, post-mortems (as documents) plus controls, conventions, gotchas, and a glossary (as records), cross-linked and recalled by meaning.",
1044
+ contextId: "agentic-sdlc",
1045
+ contextName: "Agentic SDLC Knowledge Base",
1046
+ schemas: [
1047
+ // ============================ DOCUMENTS ============================
1048
+ // Content-dominant: the markdown body is the artifact; fields are metadata.
1049
+ // Each binds the `document` surface and is ingested via `document_ingest`.
1050
+ {
1051
+ // An architecture/product DECISION (an ADR). The body is the prose —
1052
+ // Context / Decision / Consequences — and is what `rag_ask` answers over;
1053
+ // the fields below are filter/sort metadata + the supersede chain. The
1054
+ // anchor of the graph: most other types link back to a decision.
1055
+ typeName: "decision",
1056
+ displayName: "Decision (ADR)",
1057
+ indexMode: "HYBRID",
1058
+ allowedSurfaces: ["document"],
1059
+ // A document carries an INTRINSIC title (the ingest title) + body; the schema
1060
+ // declares only the metadata BEYOND those. (No typed `title` field — that
1061
+ // would duplicate the document's own title.)
1062
+ fields: [
1063
+ {
1064
+ fieldId: "summary",
1065
+ fieldType: "string",
1066
+ searchable: true,
1067
+ description: "A one-paragraph abstract of the decision. The full reasoning is the document body.",
1068
+ renderHints: { label: "Summary", widget: "textarea", order: 2 }
1069
+ },
1070
+ {
1071
+ fieldId: "status",
1072
+ fieldType: "enum",
1073
+ filterable: true,
1074
+ enumValues: ["proposed", "accepted", "superseded", "deprecated"],
1075
+ renderHints: { label: "Status", widget: "select", order: 3 }
1076
+ },
1077
+ {
1078
+ fieldId: "area",
1079
+ fieldType: "string",
1080
+ filterable: true,
1081
+ description: 'Subsystem the decision applies to (e.g. "search", "auth", "billing").',
1082
+ renderHints: { label: "Area", widget: "text", order: 4 }
1083
+ },
1084
+ {
1085
+ fieldId: "tags",
1086
+ fieldType: "array",
1087
+ filterable: true,
1088
+ description: 'Freeform labels (e.g. "security", "schema"). Search-side filter.',
1089
+ renderHints: { label: "Tags", order: 5 }
1090
+ },
1091
+ {
1092
+ // Self-reference (document → document): the decision this one supersedes.
1093
+ fieldId: "supersedes",
1094
+ fieldType: "reference",
1095
+ targetTypeName: "decision",
1096
+ targetSurface: "document",
1097
+ targetField: "externalId",
1098
+ cardinality: "one",
1099
+ description: "The decision this one supersedes (by externalId).",
1100
+ renderHints: { label: "Supersedes", order: 6 }
1101
+ },
1102
+ {
1103
+ fieldId: "date",
1104
+ fieldType: "date",
1105
+ description: "ISO-8601 decision date. Range-queryable / sortable.",
1106
+ renderHints: { label: "Date", widget: "date", order: 7 }
1107
+ }
1108
+ ],
1109
+ lookupFields: ["status", "area", "supersedes", { fieldName: "date", rangeEnabled: true }]
1110
+ },
1111
+ {
1112
+ // A DESIGN doc or spec — the exploration that drives a decision. Distinct
1113
+ // from `decision` (a different browse genre + it links to the decision it
1114
+ // informs). Body = the design narrative.
1115
+ typeName: "design",
1116
+ displayName: "Design",
1117
+ indexMode: "HYBRID",
1118
+ allowedSurfaces: ["document"],
1119
+ // Intrinsic title + body; schema = metadata beyond those (no typed `title`).
1120
+ fields: [
1121
+ {
1122
+ fieldId: "summary",
1123
+ fieldType: "string",
1124
+ searchable: true,
1125
+ description: "A one-paragraph abstract. The full design is the document body.",
1126
+ renderHints: { label: "Summary", widget: "textarea", order: 2 }
1127
+ },
1128
+ {
1129
+ fieldId: "status",
1130
+ fieldType: "enum",
1131
+ filterable: true,
1132
+ enumValues: ["draft", "active", "implemented", "superseded"],
1133
+ renderHints: { label: "Status", widget: "select", order: 3 }
1134
+ },
1135
+ {
1136
+ fieldId: "area",
1137
+ fieldType: "string",
1138
+ filterable: true,
1139
+ renderHints: { label: "Area", widget: "text", order: 4 }
1140
+ },
1141
+ {
1142
+ fieldId: "tags",
1143
+ fieldType: "array",
1144
+ filterable: true,
1145
+ renderHints: { label: "Tags", order: 5 }
1146
+ },
1147
+ {
1148
+ // Cross-document edge: the decision this design informs/produces.
1149
+ fieldId: "relatedDecision",
1150
+ fieldType: "reference",
1151
+ targetTypeName: "decision",
1152
+ targetSurface: "document",
1153
+ targetField: "externalId",
1154
+ cardinality: "one",
1155
+ description: "The decision this design informs (by externalId).",
1156
+ renderHints: { label: "Related decision", order: 6 }
1157
+ },
1158
+ {
1159
+ // Self-reference: a design supersedes an earlier design/spec.
1160
+ fieldId: "supersedes",
1161
+ fieldType: "reference",
1162
+ targetTypeName: "design",
1163
+ targetSurface: "document",
1164
+ targetField: "externalId",
1165
+ cardinality: "one",
1166
+ description: "The design this one supersedes (by externalId).",
1167
+ renderHints: { label: "Supersedes", order: 7 }
1168
+ },
1169
+ {
1170
+ fieldId: "updatedOn",
1171
+ fieldType: "date",
1172
+ description: "ISO-8601 \u2014 when last revised. Range-queryable.",
1173
+ renderHints: { label: "Updated on", widget: "date", order: 8 }
1174
+ }
1175
+ ],
1176
+ lookupFields: ["status", "area", "relatedDecision", "supersedes", { fieldName: "updatedOn", rangeEnabled: true }]
1177
+ },
1178
+ {
1179
+ // A REFERENCE doc — maintained "how it works / how to": guides, onboarding,
1180
+ // API docs, process docs. Body = the prose. Distinct shape: a `category`
1181
+ // (DRY sub-labels — onboarding/api/process are same shape) and `lastReviewed`
1182
+ // (freshness is the whole game for reference material).
1183
+ typeName: "reference",
1184
+ displayName: "Reference",
1185
+ indexMode: "HYBRID",
1186
+ allowedSurfaces: ["document"],
1187
+ // Intrinsic title + body; schema = metadata beyond those (no typed `title`).
1188
+ fields: [
1189
+ {
1190
+ fieldId: "summary",
1191
+ fieldType: "string",
1192
+ searchable: true,
1193
+ description: "A one-paragraph abstract. The full reference is the document body.",
1194
+ renderHints: { label: "Summary", widget: "textarea", order: 2 }
1195
+ },
1196
+ {
1197
+ // The sub-kind, as a filterable field (not a separate schema — these are
1198
+ // the same shape, differing only by label, so a field is the DRY choice).
1199
+ fieldId: "category",
1200
+ fieldType: "enum",
1201
+ filterable: true,
1202
+ enumValues: ["guide", "onboarding", "api", "process", "other"],
1203
+ renderHints: { label: "Category", widget: "select", order: 3 }
1204
+ },
1205
+ {
1206
+ fieldId: "area",
1207
+ fieldType: "string",
1208
+ filterable: true,
1209
+ renderHints: { label: "Area", widget: "text", order: 4 }
1210
+ },
1211
+ {
1212
+ fieldId: "tags",
1213
+ fieldType: "array",
1214
+ filterable: true,
1215
+ renderHints: { label: "Tags", order: 5 }
1216
+ },
1217
+ {
1218
+ fieldId: "status",
1219
+ fieldType: "enum",
1220
+ filterable: true,
1221
+ enumValues: ["active", "superseded"],
1222
+ renderHints: { label: "Status", widget: "select", order: 6 }
1223
+ },
1224
+ {
1225
+ // Optional cross-document edge: the decision behind this reference.
1226
+ fieldId: "relatedDecision",
1227
+ fieldType: "reference",
1228
+ targetTypeName: "decision",
1229
+ targetSurface: "document",
1230
+ targetField: "externalId",
1231
+ cardinality: "one",
1232
+ description: "The decision behind this reference, if any (by externalId).",
1233
+ renderHints: { label: "Related decision", order: 7 }
1234
+ },
1235
+ {
1236
+ // Freshness — "references not reviewed since X". The reference-doc signal.
1237
+ fieldId: "lastReviewed",
1238
+ fieldType: "date",
1239
+ description: "ISO-8601 \u2014 when this reference was last verified current. Range-queryable.",
1240
+ renderHints: { label: "Last reviewed", widget: "date", order: 8 }
1241
+ }
1242
+ ],
1243
+ lookupFields: ["category", "area", "status", "relatedDecision", { fieldName: "lastReviewed", rangeEnabled: true }]
1244
+ },
1245
+ {
1246
+ // A RUNBOOK — a step-by-step operational procedure (deploy, release, recover).
1247
+ // Body = the procedure. Distinct browse genre, and often BORN FROM a
1248
+ // post-mortem (its resolution, codified) — a cross-document edge.
1249
+ typeName: "runbook",
1250
+ displayName: "Runbook",
1251
+ indexMode: "HYBRID",
1252
+ allowedSurfaces: ["document"],
1253
+ // Intrinsic title + body; schema = metadata beyond those (no typed `title`).
1254
+ fields: [
1255
+ {
1256
+ fieldId: "summary",
1257
+ fieldType: "string",
1258
+ searchable: true,
1259
+ description: "When to use this runbook \u2014 the trigger. The steps are the document body.",
1260
+ renderHints: { label: "Summary", widget: "textarea", order: 2 }
1261
+ },
1262
+ {
1263
+ fieldId: "area",
1264
+ fieldType: "string",
1265
+ filterable: true,
1266
+ renderHints: { label: "Area", widget: "text", order: 3 }
1267
+ },
1268
+ {
1269
+ fieldId: "tags",
1270
+ fieldType: "array",
1271
+ filterable: true,
1272
+ renderHints: { label: "Tags", order: 4 }
1273
+ },
1274
+ {
1275
+ fieldId: "status",
1276
+ fieldType: "enum",
1277
+ filterable: true,
1278
+ enumValues: ["active", "retired"],
1279
+ renderHints: { label: "Status", widget: "select", order: 5 }
1280
+ },
1281
+ {
1282
+ // Cross-document edge: the post-mortem whose resolution this runbook codifies.
1283
+ fieldId: "bornFrom",
1284
+ fieldType: "reference",
1285
+ targetTypeName: "postmortem",
1286
+ targetSurface: "document",
1287
+ targetField: "externalId",
1288
+ cardinality: "one",
1289
+ description: "The post-mortem this runbook was codified from (by externalId).",
1290
+ renderHints: { label: "Born from (post-mortem)", order: 6 }
1291
+ },
1292
+ {
1293
+ fieldId: "relatedDecision",
1294
+ fieldType: "reference",
1295
+ targetTypeName: "decision",
1296
+ targetSurface: "document",
1297
+ targetField: "externalId",
1298
+ cardinality: "one",
1299
+ description: "A decision this runbook implements, if any (by externalId).",
1300
+ renderHints: { label: "Related decision", order: 7 }
1301
+ },
1302
+ {
1303
+ fieldId: "updatedOn",
1304
+ fieldType: "date",
1305
+ description: "ISO-8601 \u2014 when last revised. Range-queryable.",
1306
+ renderHints: { label: "Updated on", widget: "date", order: 8 }
1307
+ }
1308
+ ],
1309
+ lookupFields: ["area", "status", "bornFrom", "relatedDecision", { fieldName: "updatedOn", rangeEnabled: true }]
1310
+ },
1311
+ {
1312
+ // A POST-MORTEM — what broke and the durable lesson. Body = the writeup
1313
+ // (impact / root cause / resolution / lesson). Distinct shape: `severity` +
1314
+ // `occurredOn` (the incident timeline). "Have we hit this before?" lives here.
1315
+ typeName: "postmortem",
1316
+ displayName: "Post-mortem",
1317
+ indexMode: "HYBRID",
1318
+ allowedSurfaces: ["document"],
1319
+ // Intrinsic title + body; schema = metadata beyond those (no typed `title`).
1320
+ fields: [
1321
+ {
1322
+ fieldId: "summary",
1323
+ fieldType: "string",
1324
+ searchable: true,
1325
+ description: "What happened, in brief. The full analysis (impact/root cause/resolution/lesson) is the body.",
1326
+ renderHints: { label: "Summary", widget: "textarea", order: 2 }
1327
+ },
1328
+ {
1329
+ fieldId: "severity",
1330
+ fieldType: "enum",
1331
+ filterable: true,
1332
+ enumValues: ["low", "medium", "high", "critical"],
1333
+ renderHints: { label: "Severity", widget: "select", order: 3 }
1334
+ },
1335
+ {
1336
+ fieldId: "status",
1337
+ fieldType: "enum",
1338
+ filterable: true,
1339
+ enumValues: ["open", "mitigated", "resolved"],
1340
+ renderHints: { label: "Status", widget: "select", order: 4 }
1341
+ },
1342
+ {
1343
+ fieldId: "area",
1344
+ fieldType: "string",
1345
+ filterable: true,
1346
+ renderHints: { label: "Area", widget: "text", order: 5 }
1347
+ },
1348
+ {
1349
+ fieldId: "tags",
1350
+ fieldType: "array",
1351
+ filterable: true,
1352
+ renderHints: { label: "Tags", order: 6 }
1353
+ },
1354
+ {
1355
+ fieldId: "relatedDecision",
1356
+ fieldType: "reference",
1357
+ targetTypeName: "decision",
1358
+ targetSurface: "document",
1359
+ targetField: "externalId",
1360
+ cardinality: "one",
1361
+ description: "A decision implicated in or addressed by this incident (by externalId).",
1362
+ renderHints: { label: "Related decision", order: 7 }
1363
+ },
1364
+ {
1365
+ fieldId: "occurredOn",
1366
+ fieldType: "date",
1367
+ description: 'ISO-8601 \u2014 when it happened. Range-queryable \u2014 "incidents this month".',
1368
+ renderHints: { label: "Occurred on", widget: "date", order: 8 }
1369
+ }
1370
+ ],
1371
+ lookupFields: ["severity", "status", "area", "relatedDecision", { fieldName: "occurredOn", rangeEnabled: true }]
1372
+ },
1373
+ // ============================= RECORDS =============================
1374
+ // Structure-dominant: the typed fields are the artifact. Short, exact-queryable.
1375
+ {
1376
+ // A governance CONTROL — a policy/standard/control the codebase must satisfy,
1377
+ // WITH its evidence. The compliance instrument: it records what enforces it
1378
+ // (`evidence`), the runbook that VERIFIES it (cross-surface → document), and
1379
+ // the decision that mandates it. "Which critical controls are active, and how
1380
+ // is each proven?"
1381
+ typeName: "control",
1382
+ displayName: "Control",
1383
+ indexMode: "HYBRID",
1384
+ fields: [
1385
+ {
1386
+ fieldId: "title",
1387
+ fieldType: "string",
1388
+ required: true,
1389
+ searchable: true,
1390
+ validation: { minLength: 1, maxLength: 200 },
1391
+ renderHints: { label: "Title", widget: "text", order: 1, displayField: true }
1392
+ },
1393
+ {
1394
+ fieldId: "statement",
1395
+ fieldType: "string",
1396
+ searchable: true,
1397
+ description: "The requirement \u2014 what must always hold.",
1398
+ renderHints: { label: "Statement", widget: "textarea", order: 2 }
1399
+ },
1400
+ {
1401
+ fieldId: "rationale",
1402
+ fieldType: "string",
1403
+ searchable: true,
1404
+ description: "Why the control exists \u2014 the risk it prevents.",
1405
+ renderHints: { label: "Rationale", widget: "textarea", order: 3 }
1406
+ },
1407
+ {
1408
+ // The policy → implementation spectrum in one filterable field.
1409
+ fieldId: "kind",
1410
+ fieldType: "enum",
1411
+ filterable: true,
1412
+ enumValues: ["policy", "standard", "control"],
1413
+ renderHints: { label: "Kind", widget: "select", order: 4 }
1414
+ },
1415
+ {
1416
+ // Ordinal, but EQUALITY (range/prefix order is lexical, so low<critical
1417
+ // would sort alphabetically). Enumerate "all critical controls" by equality.
1418
+ fieldId: "criticality",
1419
+ fieldType: "enum",
1420
+ filterable: true,
1421
+ enumValues: ["low", "medium", "high", "critical"],
1422
+ renderHints: { label: "Criticality", widget: "select", order: 5 }
1423
+ },
1424
+ {
1425
+ fieldId: "evidence",
1426
+ fieldType: "string",
1427
+ searchable: true,
1428
+ description: "What enforces or proves the control inline (e.g. an architecture test or gate).",
1429
+ renderHints: { label: "Evidence", widget: "textarea", order: 6 }
1430
+ },
1431
+ {
1432
+ fieldId: "status",
1433
+ fieldType: "enum",
1434
+ filterable: true,
1435
+ enumValues: ["draft", "active", "retired"],
1436
+ renderHints: { label: "Status", widget: "select", order: 7 }
1437
+ },
1438
+ {
1439
+ fieldId: "area",
1440
+ fieldType: "string",
1441
+ filterable: true,
1442
+ renderHints: { label: "Area", widget: "text", order: 8 }
1443
+ },
1444
+ {
1445
+ fieldId: "tags",
1446
+ fieldType: "array",
1447
+ filterable: true,
1448
+ renderHints: { label: "Tags", order: 9 }
1449
+ },
1450
+ {
1451
+ // Cross-surface edge (record → document): the runbook that proves the control.
1452
+ fieldId: "verifiedBy",
1453
+ fieldType: "reference",
1454
+ targetTypeName: "runbook",
1455
+ targetSurface: "document",
1456
+ targetField: "externalId",
1457
+ cardinality: "one",
1458
+ description: "The runbook that verifies this control (by externalId).",
1459
+ renderHints: { label: "Verified by (runbook)", order: 10 }
1460
+ },
1461
+ {
1462
+ // Cross-surface edge (record → document): the decision that mandates it.
1463
+ fieldId: "relatedDecision",
1464
+ fieldType: "reference",
1465
+ targetTypeName: "decision",
1466
+ targetSurface: "document",
1467
+ targetField: "externalId",
1468
+ cardinality: "one",
1469
+ description: "The decision that mandates this control (by externalId).",
1470
+ renderHints: { label: "Related decision", order: 11 }
1471
+ },
1472
+ {
1473
+ fieldId: "reviewedOn",
1474
+ fieldType: "date",
1475
+ description: "ISO-8601 last-reviewed date. Range-queryable.",
1476
+ renderHints: { label: "Reviewed on", widget: "date", order: 12 }
1477
+ }
1478
+ ],
1479
+ lookupFields: [
1480
+ "kind",
1481
+ "criticality",
1482
+ "status",
1483
+ "area",
1484
+ "verifiedBy",
1485
+ "relatedDecision",
1486
+ { fieldName: "reviewedOn", rangeEnabled: true }
1487
+ ]
1488
+ },
1489
+ {
1490
+ // A CONVENTION — a must-follow operating rule the team teaches its agents. The
1491
+ // durable, shareable operating-memory. Distinct fields capture how we actually
1492
+ // write these: the `rule` (imperative), the `why` (rationale), and `howToApply`
1493
+ // (the concrete application) are SEPARATE fields, not one blob — so an agent can
1494
+ // recall the rule, the reasoning, and the how independently.
1495
+ typeName: "convention",
1496
+ displayName: "Convention",
1497
+ indexMode: "HYBRID",
1498
+ fields: [
1499
+ {
1500
+ fieldId: "title",
1501
+ fieldType: "string",
1502
+ required: true,
1503
+ searchable: true,
1504
+ validation: { minLength: 1, maxLength: 200 },
1505
+ renderHints: { label: "Title", widget: "text", order: 1, displayField: true }
1506
+ },
1507
+ {
1508
+ fieldId: "rule",
1509
+ fieldType: "string",
1510
+ searchable: true,
1511
+ description: "The convention itself, stated as an imperative.",
1512
+ renderHints: { label: "Rule", widget: "textarea", order: 2 }
1513
+ },
1514
+ {
1515
+ fieldId: "why",
1516
+ fieldType: "string",
1517
+ searchable: true,
1518
+ description: "Why it matters \u2014 the trade-off / the antipattern it prevents.",
1519
+ renderHints: { label: "Why", widget: "textarea", order: 3 }
1520
+ },
1521
+ {
1522
+ fieldId: "howToApply",
1523
+ fieldType: "string",
1524
+ searchable: true,
1525
+ description: "How to comply in practice \u2014 the concrete application steps.",
1526
+ renderHints: { label: "How to apply", widget: "textarea", order: 4 }
1527
+ },
1528
+ {
1529
+ fieldId: "area",
1530
+ fieldType: "string",
1531
+ filterable: true,
1532
+ renderHints: { label: "Area", widget: "text", order: 5 }
1533
+ },
1534
+ {
1535
+ fieldId: "status",
1536
+ fieldType: "enum",
1537
+ filterable: true,
1538
+ enumValues: ["active", "retired"],
1539
+ renderHints: { label: "Status", widget: "select", order: 6 }
1540
+ },
1541
+ {
1542
+ fieldId: "tags",
1543
+ fieldType: "array",
1544
+ filterable: true,
1545
+ renderHints: { label: "Tags", order: 7 }
1546
+ },
1547
+ {
1548
+ // Cross-surface edge (record → document): the decision that established it.
1549
+ fieldId: "establishedBy",
1550
+ fieldType: "reference",
1551
+ targetTypeName: "decision",
1552
+ targetSurface: "document",
1553
+ targetField: "externalId",
1554
+ cardinality: "one",
1555
+ description: "The decision that established this convention (by externalId).",
1556
+ renderHints: { label: "Established by (decision)", order: 8 }
1557
+ },
1558
+ {
1559
+ fieldId: "updatedOn",
1560
+ fieldType: "date",
1561
+ description: "ISO-8601 \u2014 when last revised. Range-queryable.",
1562
+ renderHints: { label: "Updated on", widget: "date", order: 9 }
1563
+ }
1564
+ ],
1565
+ lookupFields: ["area", "status", "establishedBy", { fieldName: "updatedOn", rangeEnabled: true }]
1566
+ },
1567
+ {
1568
+ // A GOTCHA / sharp edge: a symptom, its cause, and the fix. A tight typed
1569
+ // triple — found by meaning (semantic search on the symptom) + area/status.
1570
+ // The most standalone type; no typed edge.
1571
+ typeName: "gotcha",
1572
+ displayName: "Gotcha",
1573
+ indexMode: "HYBRID",
1574
+ fields: [
1575
+ {
1576
+ fieldId: "symptom",
1577
+ fieldType: "string",
1578
+ required: true,
1579
+ searchable: true,
1580
+ validation: { minLength: 1, maxLength: 500 },
1581
+ renderHints: { label: "Symptom", widget: "textarea", order: 1, displayField: true }
1582
+ },
1583
+ {
1584
+ fieldId: "cause",
1585
+ fieldType: "string",
1586
+ searchable: true,
1587
+ renderHints: { label: "Cause", widget: "textarea", order: 2 }
1588
+ },
1589
+ {
1590
+ fieldId: "fix",
1591
+ fieldType: "string",
1592
+ searchable: true,
1593
+ renderHints: { label: "Fix", widget: "textarea", order: 3 }
1594
+ },
1595
+ {
1596
+ fieldId: "area",
1597
+ fieldType: "string",
1598
+ filterable: true,
1599
+ renderHints: { label: "Area", widget: "text", order: 4 }
1600
+ },
1601
+ {
1602
+ fieldId: "status",
1603
+ fieldType: "enum",
1604
+ filterable: true,
1605
+ enumValues: ["active", "resolved"],
1606
+ renderHints: { label: "Status", widget: "select", order: 5 }
1607
+ },
1608
+ {
1609
+ fieldId: "tags",
1610
+ fieldType: "array",
1611
+ filterable: true,
1612
+ renderHints: { label: "Tags", order: 6 }
1613
+ },
1614
+ {
1615
+ fieldId: "discoveredOn",
1616
+ fieldType: "date",
1617
+ description: "ISO-8601 \u2014 when first hit. Range-queryable.",
1618
+ renderHints: { label: "Discovered on", widget: "date", order: 7 }
1619
+ }
1620
+ ],
1621
+ lookupFields: ["area", "status", { fieldName: "discoveredOn", rangeEnabled: true }]
1622
+ },
1623
+ {
1624
+ // A glossary TERM — a definition keyed by the term itself. Structure-dominant:
1625
+ // `term` is a UNIQUE exact-lookup key (the showcase of a uniqueness constraint),
1626
+ // `definition` is the RAG body, `aliases` catch alternate names. Links to the
1627
+ // decision that defines/establishes the concept where there is one.
1628
+ typeName: "term",
1629
+ displayName: "Glossary term",
1630
+ indexMode: "HYBRID",
1631
+ fields: [
1632
+ {
1633
+ fieldId: "term",
1634
+ fieldType: "string",
1635
+ required: true,
1636
+ searchable: true,
1637
+ validation: { minLength: 1, maxLength: 200 },
1638
+ renderHints: { label: "Term", widget: "text", order: 1, displayField: true }
1639
+ },
1640
+ {
1641
+ fieldId: "definition",
1642
+ fieldType: "string",
1643
+ searchable: true,
1644
+ description: "What the term means \u2014 the RAG-able body.",
1645
+ renderHints: { label: "Definition", widget: "textarea", order: 2 }
1646
+ },
1647
+ {
1648
+ fieldId: "aliases",
1649
+ fieldType: "array",
1650
+ filterable: true,
1651
+ description: "Alternate names / abbreviations for the same concept.",
1652
+ renderHints: { label: "Aliases", order: 3 }
1653
+ },
1654
+ {
1655
+ fieldId: "area",
1656
+ fieldType: "string",
1657
+ filterable: true,
1658
+ renderHints: { label: "Area", widget: "text", order: 4 }
1659
+ },
1660
+ {
1661
+ fieldId: "tags",
1662
+ fieldType: "array",
1663
+ filterable: true,
1664
+ renderHints: { label: "Tags", order: 5 }
1665
+ },
1666
+ {
1667
+ fieldId: "relatedDecision",
1668
+ fieldType: "reference",
1669
+ targetTypeName: "decision",
1670
+ targetSurface: "document",
1671
+ targetField: "externalId",
1672
+ cardinality: "one",
1673
+ description: "A decision that defines or establishes this term (by externalId).",
1674
+ renderHints: { label: "Related decision", order: 6 }
1675
+ },
1676
+ {
1677
+ fieldId: "updatedOn",
1678
+ fieldType: "date",
1679
+ description: "ISO-8601 \u2014 when last revised. Range-queryable.",
1680
+ renderHints: { label: "Updated on", widget: "date", order: 7 }
1681
+ }
1682
+ ],
1683
+ // `term` is a UNIQUE equality lookup — exact "define X" + a one-per-term
1684
+ // guarantee. `area`/`relatedDecision` enumerate; `updatedOn` is the range row.
1685
+ lookupFields: [
1686
+ { fieldName: "term", unique: true },
1687
+ "area",
1688
+ "relatedDecision",
1689
+ { fieldName: "updatedOn", rangeEnabled: true }
1690
+ ]
1691
+ }
1692
+ ],
1693
+ // Least-privilege, data-plane only. The scope of the `ssk_*` key the bootstrap
1694
+ // mints for THIS blueprint's service principal (the MCP/API runtime). See
1695
+ // DATA_PLANE_ACTIONS above for the action set + rationale.
1696
+ accessProfile: {
1697
+ allowedActions: DATA_PLANE_ACTIONS
1698
+ },
1699
+ // A reusable `editor` role for the HUMAN owner — DISTINCT from `accessProfile`
1700
+ // (which scopes only the service-principal key). `bootstrap` provisions this
1701
+ // role in the context but binds it to no one; the owner joins themselves so the
1702
+ // data-plane app (app.vectros.ai) shows their KB — its switcher lists only
1703
+ // contexts the signed-in user holds an active access profile in, and bootstrap
1704
+ // grants the human none by default. Bind it after bootstrap with:
1705
+ // vectros access grant --principal usr_<your-user-id> --context agentic-sdlc --role editor
1706
+ // (or the admin app's Access > Contexts > agentic-sdlc > Profiles > Create).
1707
+ // Editor PARITY with the service key (same DATA_PLANE_ACTIONS) so a human
1708
+ // curator can browse AND write/correct the KB; still no :d and no control-plane
1709
+ // action, so the scope gate accepts it exactly like the accessProfile.
1710
+ roles: {
1711
+ editor: [{ allowedActions: DATA_PLANE_ACTIONS }]
1712
+ },
1713
+ servicePrincipal: {
1714
+ externalId: "agentic-sdlc",
1715
+ displayName: "Agentic SDLC Knowledge Base"
1716
+ }
1717
+ // No bundled seed in this version: the content artifacts live on the document
1718
+ // surface and the cross-surface graph is populated by the ingest agent
1719
+ // (document_ingest / record_create), not the bootstrap seed step. Production
1720
+ // contexts provision with `vectros bootstrap --no-seed` regardless.
1721
+ };
1722
+ var agentic_sdlc_default = agenticSdlc;
1723
+
981
1724
  // src/blueprints/second-brain.ts
982
1725
  var secondBrain = {
983
1726
  name: "second-brain",
@@ -1074,6 +1817,7 @@ var secondBrain = {
1074
1817
  },
1075
1818
  seed: [
1076
1819
  {
1820
+ surface: "record",
1077
1821
  typeName: "note",
1078
1822
  externalId: "seed-welcome",
1079
1823
  fields: {
@@ -1207,6 +1951,7 @@ var clinicalIntake = {
1207
1951
  },
1208
1952
  seed: [
1209
1953
  {
1954
+ surface: "record",
1210
1955
  typeName: "intake",
1211
1956
  externalId: "seed-synthetic-intake",
1212
1957
  fields: {
@@ -1230,6 +1975,7 @@ var clinical_intake_default = clinicalIntake;
1230
1975
  var BUNDLED_BLUEPRINTS = [
1231
1976
  task_management_default,
1232
1977
  coding_agent_memory_default,
1978
+ agentic_sdlc_default,
1233
1979
  second_brain_default,
1234
1980
  clinical_intake_default
1235
1981
  ];