@unified-product-graph/core 0.11.3 → 0.11.4
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 +14 -0
- package/dist/index.cjs +18 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +18 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,20 @@ This project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [0.11.4] - 2026-06-14
|
|
11
|
+
|
|
12
|
+
**`get_tree` now linearises a DAG into a tree deterministically: no double-counted node, children in canonical order.** Field-testing the `journey` pattern on a fully-wired forest surfaced two structural defects, both Tier-1 (truth, not presentation — two competent agents must get the identical tree). A step reachable both directly (`user_journey -> journey_step`) and through its phase (`-> journey_phase -> journey_step`) rendered twice: once in full, once as a hollow `shared` reference — the exact mirror of the 0.9.17 silent-drop fix (G5), now silent *duplication* (J1). And children came back in storage order, ignoring the `*_order` scalars they carry, so every client had to re-sort (J2). Both are fixed by two declarative slot fields on the pattern child-map; the assembler does the linearisation once, server-side. No new tools (131); a behaviour fix on a young tool = a patch.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- **`order_by` on a tree pattern child slot.** Names the node scalar `get_tree` sorts the slot's children by (ascending, nodes lacking it last). Wired on the `journey` pattern: `journey_phase -> phase_order`, `journey_step -> step_order`, `journey_action -> action_order`, `screen_state -> state_order` (the UPG-663 sequence convention). Surfaced on `get_tree_pattern` introspection rows. Ordering is a property of the data, not the viewer — so the server returns children pre-sorted rather than leaving every client to re-sort (J2).
|
|
16
|
+
- **`prefer_via` on a tree pattern child slot.** Names the sibling type whose path is the canonical spine when a slot reaches the same node redundantly by two declared paths. The `journey` pattern's direct `user_journey -> journey_step` slot declares `prefer_via: journey_phase`: a step also reachable through a phase renders under the phase only. A step in no phase still renders directly (the direct path is the fallback, never a silent drop). Surfaced on `get_tree_pattern` rows (J1).
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- **`get_tree` returns children in canonical order across every pattern.** Children are grouped by their declared slot position, then sorted by the slot's `order_by` scalar (stable within ties). Previously edge/storage order. A pattern with no `order_by` slots is unaffected beyond the now-deterministic slot grouping.
|
|
20
|
+
- **`get_tree` collapses a redundant DAG path instead of double-counting it.** A node reachable from one parent by two declared paths renders once, under the `prefer_via` spine. Genuine multi-parent sharing (a node under two *different* parents) is unchanged — it still renders once in full and as a `shared` reference elsewhere (the 0.9.17 G5 behaviour). Verified on the saturated journey forest: every redundant direct-plus-phase step now renders once; legitimate cross-parent shares preserved.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
10
24
|
## [0.11.3] - 2026-06-14
|
|
11
25
|
|
|
12
26
|
**A reclassification now supersedes the prior value instead of leaving a stale edge.** 0.11.0 recorded a competitor's move in the reclassification history but kept the old same-axis classify edge, so after a move the competitor was classified as BOTH the old and the new value — `get_portfolio_tree` double-counted it (Data's brief, confirmed live on 0.11.1). This release retires the prior edge as part of the move, keyed off a new axis cardinality field so a genuinely multi-select axis is never collapsed. Property add + behaviour fix = a patch.
|
package/dist/index.cjs
CHANGED
|
@@ -20152,8 +20152,8 @@ function buildTypeAliases() {
|
|
|
20152
20152
|
var UPG_TYPE_ALIASES = buildTypeAliases();
|
|
20153
20153
|
|
|
20154
20154
|
// src/presentation/tree-patterns.ts
|
|
20155
|
-
var req = (type) =>
|
|
20156
|
-
var opt = (type) =>
|
|
20155
|
+
var req = (type, order_by) => order_by ? { type, required: true, order_by } : { type, required: true };
|
|
20156
|
+
var opt = (type, order_by) => order_by ? { type, order_by } : { type };
|
|
20157
20157
|
var UPG_TREE_PATTERNS = [
|
|
20158
20158
|
{
|
|
20159
20159
|
id: "ost",
|
|
@@ -20339,11 +20339,18 @@ var UPG_TREE_PATTERNS = [
|
|
|
20339
20339
|
anchor_type: "user_journey",
|
|
20340
20340
|
fallback_anchors: ["user_flow"],
|
|
20341
20341
|
child_map: {
|
|
20342
|
-
|
|
20343
|
-
|
|
20344
|
-
|
|
20342
|
+
// The phase is the grouping layer: a step reachable through a phase
|
|
20343
|
+
// renders under the phase, not twice (J1). `prefer_via` collapses the
|
|
20344
|
+
// redundant direct path; a step in NO phase still renders here. Children
|
|
20345
|
+
// are returned in `*_order` sequence (J2), not storage order.
|
|
20346
|
+
user_journey: [
|
|
20347
|
+
opt("journey_phase", "phase_order"),
|
|
20348
|
+
{ type: "journey_step", prefer_via: "journey_phase", order_by: "step_order" }
|
|
20349
|
+
],
|
|
20350
|
+
journey_phase: [opt("journey_step", "step_order")],
|
|
20351
|
+
journey_step: [opt("journey_action", "action_order"), opt("screen")],
|
|
20345
20352
|
user_flow: [opt("screen")],
|
|
20346
|
-
screen: [opt("screen_state")]
|
|
20353
|
+
screen: [opt("screen_state", "state_order")]
|
|
20347
20354
|
},
|
|
20348
20355
|
natural_depth: 3
|
|
20349
20356
|
},
|
|
@@ -20381,7 +20388,10 @@ function resolveTreePatternEdges(pattern) {
|
|
|
20381
20388
|
for (const [parent, children] of Object.entries(pattern.child_map)) {
|
|
20382
20389
|
for (const c of children) {
|
|
20383
20390
|
const e = resolvePatternEdge(parent, c.type);
|
|
20384
|
-
|
|
20391
|
+
const row = { parent, child: c.type, via: e?.via ?? null, kind: e?.kind ?? null, required: !!c.required };
|
|
20392
|
+
if (c.order_by) row.order_by = c.order_by;
|
|
20393
|
+
if (c.prefer_via) row.prefer_via = c.prefer_via;
|
|
20394
|
+
out.push(row);
|
|
20385
20395
|
}
|
|
20386
20396
|
}
|
|
20387
20397
|
return out;
|
|
@@ -28768,7 +28778,7 @@ function isCanonical(text) {
|
|
|
28768
28778
|
}
|
|
28769
28779
|
|
|
28770
28780
|
// src/index.ts
|
|
28771
|
-
var UPG_VERSION = "0.11.
|
|
28781
|
+
var UPG_VERSION = "0.11.4";
|
|
28772
28782
|
var UPG_FORMAT_VERSION = "0.4.0";
|
|
28773
28783
|
var MARKDOWN_FORMAT_VERSION = "0.1";
|
|
28774
28784
|
var UPG_TYPES = getTypes();
|