Files
oikos/web/node_modules/graphology/specs/iteration/index.js
dtoro d4d99a7473
Some checks failed
ci / build-test (push) Has been cancelled
ci / docker-build (push) Has been cancelled
feat: Phase 1 — extract the client (web SPA + desktop) to dtoro/oikos-web
Problem: the hexagonal refactor churns the backend tree for nine more
phases; the UI delivery stack (web/ SPA, cmd/desktop Wails wrapper,
compose/web image) must move to its own repo first so doc/layout
rewrites land once on a backend-only tree.

Change:
- New repo git.hubris.network/dtoro/oikos-web (v0.33.0): web/, desktop/
  (updateURL repointed to oikos-web releases), compose/, own CI (web +
  desktop jobs), own deploy script (CI-green gate, TOCTOU guard,
  version-tagged images, prune-to-3), own webhook receiver on :9798 +
  launchd unit, own compose project publishing the same 8091:80.
- Cutover executed on mac-mini in order: oikos stack's web service
  stopped+removed, oikos-web project brought up on 8091; outer Caddy
  untouched (targets the published port) — serving + Authentik flow +
  /wails 404 quirk verified post-cutover.
- Stripped from oikos: web/, cmd/desktop/, compose/web/, desktop CI
  workflow, ci.yml web job, Makefile ui/desktop/desktop-package/install
  targets, the compose web service, oikos-web from deploy.sh's fallback
  prune list; wails + go-keyring dropped from go.mod, vendor synced.
- README / CONTRIBUTING / AGENTS.md / .agents dev+operations docs now
  point at the new repo; mbse + mascot design docs carry a path note.

Risk: production SPA serving depends on the new pipeline now; rollback
is versioned-image re-up of the old web service from a pre-split
checkout (port 8091). Desktop builds installed before the split still
check dtoro/oikos releases — one manual reinstall, noted in the
oikos-web release notes.

Verification: go vet, make test (race), make generate-check, golangci
(no new findings; baseline down 400→365); post-cutover curls —
localhost:8091 200, /wails/runtime.js 404, outer Caddy 302 Authentik.
2026-08-15 22:27:52 +02:00

129 lines
5.2 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = iteration;
var _assert = _interopRequireDefault(require("assert"));
var _nodes = _interopRequireDefault(require("./nodes"));
var _edges = _interopRequireDefault(require("./edges"));
var _neighbors = _interopRequireDefault(require("./neighbors"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/**
* Graphology Iteration Specs
* ===========================
*
* Testing the iteration-related methods of the graph.
*/
function iteration(Graph, checkers) {
return {
Adjacency: {
'#.forEachAdjacencyEntry': {
'it should iterate over the relevant elements.': function it_should_iterate_over_the_relevant_elements() {
function test(multi) {
var graph = new Graph({
multi: multi
});
graph.addNode('John', {
hello: 'world'
});
var _graph$mergeUndirecte = graph.mergeUndirectedEdge('John', 'Mary', {
weight: 3
}),
e1 = _graph$mergeUndirecte[0];
graph.mergeUndirectedEdge('Thomas', 'John');
graph.mergeDirectedEdge('John', 'Thomas');
var count = 0;
graph.forEachAdjacencyEntry(function (node, neighbor, attr, neighborAttr, edge, edgeAttr, undirected) {
count++;
if (node === 'John') {
_assert["default"].deepStrictEqual(attr, {
hello: 'world'
});
} else {
_assert["default"].deepStrictEqual(attr, {});
}
if (neighbor === 'John') {
_assert["default"].deepStrictEqual(neighborAttr, {
hello: 'world'
});
} else {
_assert["default"].deepStrictEqual(neighborAttr, {});
}
if (edge === e1) {
_assert["default"].deepStrictEqual(edgeAttr, {
weight: 3
});
} else {
_assert["default"].deepStrictEqual(edgeAttr, {});
}
_assert["default"].strictEqual(graph.isUndirected(edge), undirected);
});
_assert["default"].strictEqual(count, graph.directedSize + graph.undirectedSize * 2);
graph.addNode('Disconnected');
count = 0;
graph.forEachAdjacencyEntryWithOrphans(function (node, neighbor, attr, neighborAttr, edge, edgeAttr, undirected) {
count++;
if (node !== 'Disconnected') return;
_assert["default"].strictEqual(neighbor, null);
_assert["default"].strictEqual(neighborAttr, null);
_assert["default"].strictEqual(edge, null);
_assert["default"].strictEqual(edgeAttr, null);
_assert["default"].strictEqual(undirected, null);
}, true);
_assert["default"].strictEqual(count, graph.directedSize + graph.undirectedSize * 2 + 1);
}
test(false);
test(true);
}
},
'#.forEachAssymetricAdjacencyEntry': {
'it should iterate over the relevant elements.': function it_should_iterate_over_the_relevant_elements() {
function test(multi) {
var graph = new Graph({
multi: multi
});
graph.addNode('John', {
hello: 'world'
});
graph.mergeUndirectedEdge('John', 'Mary', {
weight: 3
});
graph.mergeUndirectedEdge('Thomas', 'John');
graph.mergeDirectedEdge('John', 'Thomas');
var edges = [];
graph.forEachAssymetricAdjacencyEntry(function (node, neighbor, attr, neighborAttr, edge, edgeAttr, undirected) {
if (undirected) {
_assert["default"].strictEqual(node < neighbor, true);
}
edges.push(edge);
});
_assert["default"].strictEqual(edges.length, graph.directedSize + graph.undirectedSize);
_assert["default"].deepStrictEqual(new Set(edges).size, edges.length);
graph.addNode('Disconnected');
var count = 0;
var nulls = 0;
graph.forEachAssymetricAdjacencyEntryWithOrphans(function (node, neighbor, attr, neighborAttr, edge, edgeAttr, undirected) {
count++;
if (neighbor) return;
nulls++;
_assert["default"].strictEqual(neighbor, null);
_assert["default"].strictEqual(neighborAttr, null);
_assert["default"].strictEqual(edge, null);
_assert["default"].strictEqual(edgeAttr, null);
_assert["default"].strictEqual(undirected, null);
}, true);
_assert["default"].strictEqual(count, graph.directedSize + graph.undirectedSize + 3);
_assert["default"].strictEqual(nulls, 3);
}
test(false);
test(true);
}
}
},
Nodes: (0, _nodes["default"])(Graph, checkers),
Edges: (0, _edges["default"])(Graph, checkers),
Neighbors: (0, _neighbors["default"])(Graph, checkers)
};
}