@stalfh233/omc-cli 0.5.4 → 0.5.5
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/cli.js +4 -0
- package/dist/graph.js +19 -1
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -1073,6 +1073,10 @@ async function cmdGraphPull(environment, concurrency, transport) {
|
|
|
1073
1073
|
status: "ok",
|
|
1074
1074
|
environment: data.meta.environmentName,
|
|
1075
1075
|
applicationCode: data.meta.applicationCode,
|
|
1076
|
+
// The index covers ONE application. Echo where it came from, so a
|
|
1077
|
+
// zero-hit query against a 1-of-N slice cannot read as tenant-wide
|
|
1078
|
+
// absence (same contract as model.list / rule.references).
|
|
1079
|
+
...(data.meta.applicationResolution ? { applicationResolution: data.meta.applicationResolution } : {}),
|
|
1076
1080
|
identityFingerprint: data.meta.identityFingerprint,
|
|
1077
1081
|
pulledAtIso: data.meta.pulledAtIso,
|
|
1078
1082
|
scope: data.meta.scope,
|
package/dist/graph.js
CHANGED
|
@@ -380,6 +380,18 @@ export async function pullRuleGraph(session, concurrency = DEFAULT_PULL_CONCURRE
|
|
|
380
380
|
timings: { listMs, readMs, totalMs: Date.now() - totalStart },
|
|
381
381
|
};
|
|
382
382
|
}
|
|
383
|
+
/** Parse the persisted `applicationResolution` meta row; a malformed row degrades to undefined. */
|
|
384
|
+
function parseApplicationResolution(raw) {
|
|
385
|
+
try {
|
|
386
|
+
const parsed = JSON.parse(raw);
|
|
387
|
+
if (typeof parsed.code !== "string" || typeof parsed.source !== "string")
|
|
388
|
+
return undefined;
|
|
389
|
+
return parsed;
|
|
390
|
+
}
|
|
391
|
+
catch {
|
|
392
|
+
return undefined;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
383
395
|
function ensureGraphDir() {
|
|
384
396
|
const dir = dirname(graphDbPath());
|
|
385
397
|
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
@@ -480,8 +492,11 @@ export async function publishGraphPull(session, concurrency = DEFAULT_PULL_CONCU
|
|
|
480
492
|
CREATE TABLE gaps (kind TEXT NOT NULL, ref TEXT NOT NULL, note TEXT);
|
|
481
493
|
`);
|
|
482
494
|
const insertMeta = db.prepare("INSERT INTO meta (key, value) VALUES (?, ?)");
|
|
495
|
+
// `applicationResolution` is an object; String(value) would persist
|
|
496
|
+
// "[object Object]" (2026-10-30: the field was written and unreadable).
|
|
497
|
+
// JSON-encode structured values, keep scalars verbatim.
|
|
483
498
|
for (const [key, value] of Object.entries(data.meta))
|
|
484
|
-
insertMeta.run(key, String(value));
|
|
499
|
+
insertMeta.run(key, typeof value === "object" && value !== null ? JSON.stringify(value) : String(value));
|
|
485
500
|
const insertRule = db.prepare("INSERT INTO rules (schema_code, rule_code, name, enabled, status, default_rule, row_id, graph_sha256) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
|
|
486
501
|
for (const rule of data.rules)
|
|
487
502
|
insertRule.run(rule.schemaCode, rule.ruleCode, rule.name, rule.enabled === null ? null : rule.enabled ? 1 : 0, rule.status, rule.defaultRule === null ? null : rule.defaultRule ? 1 : 0, rule.rowId, rule.graphSha256);
|
|
@@ -545,6 +560,9 @@ function openGraphIndex() {
|
|
|
545
560
|
summary: {
|
|
546
561
|
environmentName: meta.environmentName ?? "",
|
|
547
562
|
applicationCode: meta.applicationCode ?? "",
|
|
563
|
+
// Persisted as JSON by the writer; a legacy index (pre-0.5.4) has no
|
|
564
|
+
// such key, so this stays optional rather than failing the read.
|
|
565
|
+
...(meta.applicationResolution ? { applicationResolution: parseApplicationResolution(meta.applicationResolution) } : {}),
|
|
548
566
|
identityFingerprint: meta.identityFingerprint ?? "",
|
|
549
567
|
pulledAtIso: meta.pulledAtIso ?? "",
|
|
550
568
|
freshness: gapCount === 0 ? "complete" : "partial",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@stalfh233/omc-fake-platform": "0.5.
|
|
55
|
+
"@stalfh233/omc-fake-platform": "0.5.5",
|
|
56
56
|
"commander": "14.0.3",
|
|
57
|
-
"omc-core": "0.5.
|
|
57
|
+
"omc-core": "0.5.5",
|
|
58
58
|
"proper-lockfile": "4.1.2",
|
|
59
59
|
"write-file-atomic": "6.0.0",
|
|
60
60
|
"zod": "^3.23.8",
|