archctx-contracts 0.9.2 → 0.9.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": "archcontext.capabilities/v1",
3
- "package": { "name": "archctx", "version": "0.9.2" },
3
+ "package": { "name": "archctx", "version": "0.9.3" },
4
4
  "protocols": {
5
5
  "projectionRequest": "archcontext.projection-request/v1",
6
6
  "projectionResult": "archcontext.projection-result/v2",
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": "archcontext.product-version-manifest/v1",
3
3
  "product": {
4
4
  "name": "archctx",
5
- "version": "0.9.2",
5
+ "version": "0.9.3",
6
6
  "distribution": "one-package"
7
7
  },
8
8
  "packageManager": "bun@1.4.3",
@@ -12,25 +12,25 @@
12
12
  "surfaces": {
13
13
  "cli": {
14
14
  "packageName": "@archcontext/surfaces",
15
- "version": "0.9.2",
15
+ "version": "0.9.3",
16
16
  "entrypoint": "archctx"
17
17
  },
18
18
  "daemon": {
19
19
  "packageName": "@archcontext/local-runtime",
20
- "version": "0.9.2",
20
+ "version": "0.9.3",
21
21
  "entrypoint": "archctx daemon start",
22
22
  "rpcSchemaVersion": "archcontext.runtime-rpc/v2"
23
23
  },
24
24
  "mcp": {
25
25
  "packageName": "@archcontext/surfaces",
26
- "version": "0.9.2",
26
+ "version": "0.9.3",
27
27
  "entrypoint": "archctx mcp",
28
28
  "transport": "stdio"
29
29
  }
30
30
  },
31
31
  "schemas": {
32
32
  "schemaSetVersion": "2026-06-25.al0-ledger",
33
- "contractsPackageVersion": "0.9.2",
33
+ "contractsPackageVersion": "0.9.3",
34
34
  "reviewChallenge": "archcontext.review-challenge/v2",
35
35
  "attestation": "archcontext.attestation/v2",
36
36
  "deviceIdentity": "archcontext.device-identity/v1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archctx-contracts",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -332,7 +332,7 @@
332
332
  },
333
333
  "sourceStamps": {
334
334
  "type": "object",
335
- "description": "entity-summary targets only: the content digest of every declared source footprint this target documents, by node id. Each footprint belongs to its node's nearest ancestor-or-self with an entity-summary target, so each node is stamped on exactly one row.",
335
+ "description": "entity-summary and runtime topology targets only: the content digest of every declared source footprint this target documents, by node id. A footprint belongs to its node's nearest ancestor-or-self with an entity-summary target, so it is stamped on exactly one entity-summary row; a runtime topology node's footprint is stamped on every runtime topology row instead, and those rows carry identical stamps (ADR-0049).",
336
336
  "additionalProperties": {
337
337
  "$ref": "#/$defs/digest"
338
338
  }
@@ -360,24 +360,37 @@
360
360
  "properties": {
361
361
  "type": {
362
362
  "not": {
363
- "const": "entity-summary"
363
+ "enum": [
364
+ "entity-summary",
365
+ "diagram-runtime-topology",
366
+ "runtime-topology-summary"
367
+ ]
364
368
  }
365
369
  }
366
370
  }
367
371
  },
368
372
  "then": {
369
373
  "not": {
370
- "anyOf": [
371
- {
372
- "required": [
373
- "sourceStamps"
374
- ]
375
- },
376
- {
377
- "required": [
378
- "scale"
379
- ]
374
+ "required": [
375
+ "sourceStamps"
376
+ ]
377
+ }
378
+ }
379
+ },
380
+ {
381
+ "if": {
382
+ "properties": {
383
+ "type": {
384
+ "not": {
385
+ "const": "entity-summary"
380
386
  }
387
+ }
388
+ }
389
+ },
390
+ "then": {
391
+ "not": {
392
+ "required": [
393
+ "scale"
381
394
  ]
382
395
  }
383
396
  }
@@ -1,5 +1,5 @@
1
1
  export const ARCHCONTEXT_PRODUCT_NAME = "archctx";
2
- export const ARCHCONTEXT_PRODUCT_VERSION = "0.9.2";
2
+ export const ARCHCONTEXT_PRODUCT_VERSION = "0.9.3";
3
3
  export const ARCHCONTEXT_PACKAGE_MANAGER = "bun@1.4.3";
4
4
  export const ARCHCONTEXT_NODE_RANGE = ">=22.22 <26";
5
5
  export const LOCAL_RUNTIME_RPC_SCHEMA_VERSION = "archcontext.runtime-rpc/v2";
@@ -36,7 +36,7 @@ export const SUPERSEDED_ARCHITECTURE_DOCS_PROJECTION_MANIFEST_SCHEMA_VERSIONS =
36
36
  export const PROJECTION_MANIFEST_UPGRADE_REQUIRED = "projection-manifest-upgrade-required" as const;
37
37
  /** The reason code of a current-format manifest that fails its contract; restore it from Git. */
38
38
  export const PROJECTION_MANIFEST_INVALID = "projection-manifest-invalid" as const;
39
- /** The reason code of a declared source footprint that no entity-summary target carries a stamp for. */
39
+ /** The reason code of a declared source footprint that no stamping target carries a stamp for. */
40
40
  export const PROJECTION_FOOTPRINT_UNCOVERED = "projection-footprint-uncovered" as const;
41
41
  export const ARCHITECTURE_DOCS_PROJECTION_PROVENANCE_SCHEMA_VERSION = "archcontext.architecture-docs-projection-provenance/v3" as const;
42
42
  export const ARCHITECTURE_DOCS_LAYOUT_VERSION_V1 = "archcontext.docs-layout/v1" as const;
@@ -130,9 +130,11 @@ export interface ArchitectureDocsProjectionManifestTargetV3 {
130
130
  /** `digestJson({ targetId, body })` of the generated body: the region of a `mixed` target, the whole file of a `generated` one. */
131
131
  outputDigest: string;
132
132
  /**
133
- * `entity-summary` targets only: the content digest of every declared source footprint this
134
- * target documents, by node id. A footprint belongs to its node's nearest ancestor-or-self that
135
- * has an entity-summary target, so every declared footprint is stamped on exactly one row.
133
+ * The content digest of every declared source footprint this target documents, by node id. On an
134
+ * `entity-summary` row a footprint belongs to its node's nearest ancestor-or-self that has an
135
+ * entity-summary target, so it is stamped on exactly one such row. A runtime topology node's
136
+ * footprint (ADR-0049) is stamped on every runtime topology row instead, and those rows carry
137
+ * identical stamps. No other target type carries stamps.
136
138
  */
137
139
  sourceStamps?: Record<string, string>;
138
140
  /** Present exactly when `sourceStamps` stamps the target's own node: the scale buckets its document prints (#264). */
@@ -181,6 +183,11 @@ const TARGET_TYPES: Record<ProjectionTargetType, true> = {
181
183
  "runtime-topology-summary": true,
182
184
  "agent-context": true
183
185
  };
186
+ /** The whole-model targets that render the runtime topology and carry its nodes' stamps (ADR-0049). */
187
+ export const RUNTIME_TOPOLOGY_TARGET_TYPES = ["diagram-runtime-topology", "runtime-topology-summary"] as const satisfies readonly ProjectionTargetType[];
188
+ export function isRuntimeTopologyTargetType(type: unknown): type is (typeof RUNTIME_TOPOLOGY_TARGET_TYPES)[number] {
189
+ return typeof type === "string" && (RUNTIME_TOPOLOGY_TARGET_TYPES as readonly string[]).includes(type);
190
+ }
184
191
  const SCOPE_KINDS: Record<ProjectionTargetScopeKind, true> = { repository: true, entity: true, relation: true, decision: true, diagram: true, changelog: true };
185
192
  const OWNERSHIPS: Record<ProjectionTargetOwnership, true> = { generated: true, mixed: true };
186
193
  const FORMATS: Record<ProjectionTargetFormat, true> = { markdown: true, mermaid: true, "structurizr-json": true, likec4: true };
@@ -213,6 +220,7 @@ export function architectureDocsProjectionManifestIssues(value: unknown): string
213
220
  }
214
221
  const paths = new Set<string>();
215
222
  const stampOwners = new Map<string, string>();
223
+ let topologyStamps: { targetId: string; stamps: string } | undefined;
216
224
  for (const [targetId, row] of Object.entries(targets)) {
217
225
  const prefix = `manifest.targets[${JSON.stringify(targetId)}]`;
218
226
  if (!isNonEmptyString(targetId)) issues.push("manifest.targets keys must be non-empty targetIds");
@@ -222,7 +230,20 @@ export function architectureDocsProjectionManifestIssues(value: unknown): string
222
230
  if (paths.has(path)) issues.push(`${prefix}.path is recorded by another target`);
223
231
  paths.add(path);
224
232
  }
225
- for (const nodeId of Object.keys(record(record(row)?.sourceStamps) ?? {})) {
233
+ const stamps = record(record(row)?.sourceStamps) ?? {};
234
+ if (isRuntimeTopologyTargetType(record(row)?.type)) {
235
+ // Every topology row renders the same topology, so all of them carry one stamp set.
236
+ const serialized = JSON.stringify(Object.keys(stamps).sort(compareStrings).map((nodeId) => [nodeId, stamps[nodeId]]));
237
+ if (topologyStamps === undefined) topologyStamps = { targetId, stamps: serialized };
238
+ else if (topologyStamps.stamps !== serialized) issues.push(`${prefix}.sourceStamps must equal the sourceStamps of ${topologyStamps.targetId}`);
239
+ for (const nodeId of Object.keys(stamps)) {
240
+ const owner = stampOwners.get(nodeId);
241
+ if (owner !== undefined && !isRuntimeTopologyTargetType(record(targets[owner])?.type)) issues.push(`${prefix}.sourceStamps.${nodeId} is already stamped on ${owner}`);
242
+ else if (owner === undefined) stampOwners.set(nodeId, targetId);
243
+ }
244
+ continue;
245
+ }
246
+ for (const nodeId of Object.keys(stamps)) {
226
247
  const owner = stampOwners.get(nodeId);
227
248
  if (owner !== undefined) issues.push(`${prefix}.sourceStamps.${nodeId} is already stamped on ${owner}`);
228
249
  else stampOwners.set(nodeId, targetId);
@@ -319,7 +340,10 @@ export function architectureSemanticStateFromCapabilities(capabilities: readonly
319
340
  };
320
341
  }
321
342
 
322
- /** Every stamp the rows record, by node id. A valid manifest stamps each node on one row only. */
343
+ /**
344
+ * Every stamp the rows record, by node id. A valid manifest stamps each node on one entity-summary
345
+ * row, or with one digest on every runtime topology row.
346
+ */
323
347
  export function architectureDocsProjectionManifestSourceStamps(manifest: ArchitectureDocsProjectionManifestV3): Record<string, string> {
324
348
  const stamps: Record<string, string> = {};
325
349
  for (const row of Object.values(manifest.targets)) Object.assign(stamps, row.sourceStamps ?? {});
@@ -502,9 +526,10 @@ function manifestTargetIssues(value: unknown, prefix: string): string[] {
502
526
  if (typeof target.ownership !== "string" || !Object.hasOwn(OWNERSHIPS, target.ownership)) issues.push(`${prefix}.ownership is unsupported`);
503
527
  if (typeof target.format !== "string" || !Object.hasOwn(FORMATS, target.format)) issues.push(`${prefix}.format is unsupported`);
504
528
  if (!isDigest(target.outputDigest)) issues.push(`${prefix}.outputDigest must be a SHA-256 digest`);
505
- if ((target.sourceStamps !== undefined || target.scale !== undefined) && target.type !== "entity-summary") {
506
- issues.push(`${prefix}.sourceStamps and scale are only allowed on entity-summary targets`);
529
+ if (target.sourceStamps !== undefined && target.type !== "entity-summary" && !isRuntimeTopologyTargetType(target.type)) {
530
+ issues.push(`${prefix}.sourceStamps are only allowed on entity-summary and runtime topology targets`);
507
531
  }
532
+ if (target.scale !== undefined && target.type !== "entity-summary") issues.push(`${prefix}.scale is only allowed on entity-summary targets`);
508
533
  if (target.sourceStamps !== undefined) {
509
534
  const stamps = record(target.sourceStamps);
510
535
  if (!stamps || Object.keys(stamps).length === 0) issues.push(`${prefix}.sourceStamps must be a non-empty object keyed by node id`);