@unified-product-graph/core 0.7.4 → 0.8.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.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,39 @@ This project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [0.7.5] - 2026-05-30
13
+
14
+ ### Added — canonical `.upg` serialisation (`upg fmt`) + `$upg` header (UPG-577)
15
+
16
+ **Additive patch release.** The new serialiser, header types, and read path are purely additive
17
+ over 0.7.4 — no exports removed, no breaking changes — so this ships as `0.7.5`. The breaking
18
+ `0.8.0` is reserved for the UPG-574 deprecated-property removal. `UPG_VERSION` (catalogue version)
19
+ stays `'0.7.3'`; the on-disk `format_version` is `'1.0.0'`.
20
+ A single shared serialiser in core, `serializeCanonical(doc) → string`, so the same logical graph
21
+ always produces byte-identical output regardless of which tool wrote it — git then diffs *meaning*,
22
+ not formatting. Anchored on RFC 8785 (JSON Canonicalization Scheme) for object-internal rules, with
23
+ two deliberate deviations for the review lifecycle: pretty-print (2-space, one element per line, LF)
24
+ and semantic sorting of the set-like arrays (`nodes`, `edges`, `cross_edges`, `tags`; `aliases`
25
+ order preserved as append-only history).
26
+
27
+ New exports from `@unified-product-graph/core`: `serializeCanonical`, `parseUpg`,
28
+ `normalizeDocument`, `formatUpgText`, `isCanonical`, `computeBodyChecksum`,
29
+ `UPG_CANONICAL_FORMAT_VERSION` (`'1.0.0'`), plus the `$upg` header types.
30
+
31
+ - **Single-product** files adopt the canonical `$upg`-header envelope: consolidated metadata
32
+ (`format_version`, `spec_version`, product summary, counts, provenance, body integrity) in one
33
+ leading object; `product`/`nodes`/`edges` stay top-level.
34
+ - **Portfolio** files also adopt the canonical `$upg` envelope (`$upg.kind: "portfolio"`);
35
+ organisation + collections stay top-level. The portfolio store (and every MCP portfolio tool
36
+ through it) reads via `normalizeDocument`, accepting both `$upg` and legacy flat portfolios.
37
+ - **Drift repair:** double-encoded JSON in `properties`/`tags` (found in real dogfood graphs) is
38
+ restructured on serialise, or rejected with a precise error.
39
+ - **Read path:** `parseUpg`/`normalizeDocument` accept both the `$upg` and legacy flat envelopes →
40
+ the flat in-memory `UPGDocument`. Wired into the SDK store (load/save/merge), workspace create,
41
+ the MCP server init writes, and the CLI `init`/`import` writers, so every writer is co-canonical.
42
+ - **New CLI command:** `upg fmt [files...]` rewrites to canonical form; `upg fmt --check` is a CI gate.
43
+ - Backward-compatible reads; no catalogue/schema/API removals. `UPG_VERSION` unchanged.
44
+
12
45
  ---
13
46
 
14
47
  ## [0.7.4] - 2026-05-29