@miadi/inquiry-weave 0.13.1 → 0.13.2
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/lineage-edge.d.ts
CHANGED
|
@@ -24,6 +24,13 @@
|
|
|
24
24
|
* for an edge that demonstrably exists in `GET /api/edges`. So the preflight
|
|
25
25
|
* must list and scan; asking for the edge by its own id always says absent,
|
|
26
26
|
* which would make every run re-POST.
|
|
27
|
+
* 3. A bare `GET /api/edges` answers the first 100 rows, and `POST /api/edges`
|
|
28
|
+
* REPLACES the edge of a pair it already holds (`replaced: true`). A scan of
|
|
29
|
+
* the first page missed every edge past row 100 and re-posted it, which
|
|
30
|
+
* rewrote whatever relation someone had set there. Measured 2026-09-24:
|
|
31
|
+
* 322 edges on the chronicle wheel. So the scan asks for `?limit=all`, an
|
|
32
|
+
* existing edge of another type for the same pair is reported and left
|
|
33
|
+
* alone, and a replace the scan did not foresee is reported (jgwill/Miadi#682).
|
|
27
34
|
*/
|
|
28
35
|
export type LineageEdgeState = "created" | "already-present" | "skipped" | "pending";
|
|
29
36
|
export interface LineageEdgeInput {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineage-edge.d.ts","sourceRoot":"","sources":["../src/lineage-edge.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lineage-edge.d.ts","sourceRoot":"","sources":["../src/lineage-edge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,iBAAiB,GACjB,SAAS,GACT,SAAS,CAAA;AAEb,MAAM,WAAW,gBAAgB;IAC/B,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAA;IAClB,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,CAAA;IAChB,kFAAkF;IAClF,gBAAgB,EAAE,MAAM,CAAA;IACxB,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,gBAAgB,CAAA;IACvB,OAAO,EAAE,MAAM,CAAA;IACf,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;IACxB,iDAAiD;IACjD,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAkCD,wBAAgB,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAE7D;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,gBAAgB,EACvB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,kBAAkB,CAAC,CA0F7B"}
|
package/dist/lineage-edge.js
CHANGED
|
@@ -24,6 +24,13 @@
|
|
|
24
24
|
* for an edge that demonstrably exists in `GET /api/edges`. So the preflight
|
|
25
25
|
* must list and scan; asking for the edge by its own id always says absent,
|
|
26
26
|
* which would make every run re-POST.
|
|
27
|
+
* 3. A bare `GET /api/edges` answers the first 100 rows, and `POST /api/edges`
|
|
28
|
+
* REPLACES the edge of a pair it already holds (`replaced: true`). A scan of
|
|
29
|
+
* the first page missed every edge past row 100 and re-posted it, which
|
|
30
|
+
* rewrote whatever relation someone had set there. Measured 2026-09-24:
|
|
31
|
+
* 322 edges on the chronicle wheel. So the scan asks for `?limit=all`, an
|
|
32
|
+
* existing edge of another type for the same pair is reported and left
|
|
33
|
+
* alone, and a replace the scan did not foresee is reported (jgwill/Miadi#682).
|
|
27
34
|
*/
|
|
28
35
|
function describeFailure(error) {
|
|
29
36
|
return error instanceof Error ? error.message : String(error);
|
|
@@ -68,7 +75,7 @@ export async function projectLineageEdge(mwUrl, input, options = {}) {
|
|
|
68
75
|
const edge_id = lineageEdgeId(input);
|
|
69
76
|
let listing;
|
|
70
77
|
try {
|
|
71
|
-
listing = await fetchImpl(`${base}/api/edges`);
|
|
78
|
+
listing = await fetchImpl(`${base}/api/edges?limit=all`);
|
|
72
79
|
}
|
|
73
80
|
catch (error) {
|
|
74
81
|
return {
|
|
@@ -96,11 +103,17 @@ export async function projectLineageEdge(mwUrl, input, options = {}) {
|
|
|
96
103
|
error: `GET ${base}/api/edges returned unreadable JSON: ${describeFailure(error)}`,
|
|
97
104
|
};
|
|
98
105
|
}
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
String(edge.relationship_type) === input.relationshipType);
|
|
102
|
-
if (present)
|
|
106
|
+
const pair = existing.find((edge) => String(edge.from_id) === input.fromNodeId && String(edge.to_id) === input.toNodeId);
|
|
107
|
+
if (pair && String(pair.relationship_type) === input.relationshipType)
|
|
103
108
|
return { state: "already-present", edge_id };
|
|
109
|
+
if (pair) {
|
|
110
|
+
// One ordered pair is one edge: posting would replace the relation already there.
|
|
111
|
+
return {
|
|
112
|
+
state: "pending",
|
|
113
|
+
edge_id,
|
|
114
|
+
error: `the wheel already holds a '${String(pair.relationship_type)}' edge ${edge_id}; one pair is one edge, so '${input.relationshipType}' was not written over it`,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
104
117
|
if (options.dryRun)
|
|
105
118
|
return { state: "skipped", edge_id };
|
|
106
119
|
let response;
|
|
@@ -123,8 +136,19 @@ export async function projectLineageEdge(mwUrl, input, options = {}) {
|
|
|
123
136
|
error: `medicine-wheel unreachable at ${base}: ${describeFailure(error)}`,
|
|
124
137
|
};
|
|
125
138
|
}
|
|
126
|
-
if (response.ok)
|
|
139
|
+
if (response.ok) {
|
|
140
|
+
let replaced = false;
|
|
141
|
+
try {
|
|
142
|
+
replaced = (await response.json())?.replaced === true;
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
replaced = false;
|
|
146
|
+
}
|
|
147
|
+
if (replaced) {
|
|
148
|
+
return { state: "pending", edge_id, error: `the wheel replaced an edge ${edge_id} the listing did not show; check it by hand` };
|
|
149
|
+
}
|
|
127
150
|
return { state: "created", edge_id };
|
|
151
|
+
}
|
|
128
152
|
const detail = await readErrorBody(response);
|
|
129
153
|
if (response.status === 409 || /already exists/i.test(detail)) {
|
|
130
154
|
return { state: "already-present", edge_id };
|
package/dist/lineage-edge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineage-edge.js","sourceRoot":"","sources":["../src/lineage-edge.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lineage-edge.js","sourceRoot":"","sources":["../src/lineage-edge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAgCH,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC/D,CAAC;AAED,KAAK,UAAU,aAAa,CAAC,QAAkB;IAC7C,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAwB,CAAA;QAC3D,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC,KAAK,CAAA;IAC/D,CAAC;IAAC,MAAM,CAAC;QACP,wDAAwD;IAC1D,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC;AAQD,gFAAgF;AAChF,SAAS,SAAS,CAAC,OAAgB;IACjC,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,OAAuB,CAAA;IAC1D,IAAI,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC3C,MAAM,MAAM,GAAG,OAAkC,CAAA;QACjD,KAAK,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;YAC7C,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,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"@miadi/inquiry-weave",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"description": "Relate and sync IAIP inquiry artefacts, their GitHub issues, and miadi-chronicle episodes. Creates vessels and relations only — never inquiry content.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|