@shapeshift-labs/frontier-loom-ui 0.1.15 → 0.1.16
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/server.js +44 -3
- package/dist/server.js.map +1 -1
- package/package.json +2 -2
package/dist/server.js
CHANGED
|
@@ -9,6 +9,8 @@ import { FRONTIER_SEMANTIC_LEASE_EVENT_KIND, FRONTIER_SEMANTIC_LEASE_RECORD_KIND
|
|
|
9
9
|
import { FRONTIER_SWARM_GIT_APPLY_LEDGER_KIND, FRONTIER_SWARM_GIT_LINK_REPAIR_KIND, FRONTIER_SWARM_GIT_WORKSPACE_MANIFEST_KIND, FRONTIER_SWARM_GIT_WORKSPACE_PROOF_KIND } from '@shapeshift-labs/frontier-swarm-git';
|
|
10
10
|
import { estimateCodexModelCost, readCodexDashboardSnapshot } from '@shapeshift-labs/frontier-swarm-codex';
|
|
11
11
|
import { FRONTIER_TEST_GATE_EXECUTION_KIND } from '@shapeshift-labs/frontier-test';
|
|
12
|
+
const FRONTIER_SWARM_CODEX_RUN_SYNC_KIND = 'frontier.swarm-codex.run-sync';
|
|
13
|
+
const FRONTIER_RUN_JSONL_STORE_SYNC_EVIDENCE_KIND = 'frontier.run.jsonl-store-sync-evidence';
|
|
12
14
|
const packageDir = path.dirname(fileURLToPath(import.meta.url));
|
|
13
15
|
const HEALTH_JSON_PARSE_MAX_BYTES = 16 * 1024 * 1024;
|
|
14
16
|
const TASK_DETAIL_PATCH_MAX_BYTES = 512 * 1024;
|
|
@@ -1390,6 +1392,8 @@ async function findDashboardSubstrateFiles(root, input) {
|
|
|
1390
1392
|
function dashboardSubstrateFileNameMatches(name) {
|
|
1391
1393
|
return name === 'run-events.jsonl'
|
|
1392
1394
|
|| name === LIVE_RUN_GRAPH_EVENTS_FILE
|
|
1395
|
+
|| name === 'run-sync-evidence.json'
|
|
1396
|
+
|| name === 'run-sync-history.jsonl'
|
|
1393
1397
|
|| name === 'apply-ledger.json'
|
|
1394
1398
|
|| name === 'workspace-proof.json'
|
|
1395
1399
|
|| name === 'workspace-manifest.json'
|
|
@@ -1444,6 +1448,10 @@ function dashboardSubstrateRecordKind(record) {
|
|
|
1444
1448
|
return kind;
|
|
1445
1449
|
if (kind === 'frontier.run.dashboard' && numberValue(record.version) === FRONTIER_RUN_VERSION)
|
|
1446
1450
|
return kind;
|
|
1451
|
+
if (kind === FRONTIER_SWARM_CODEX_RUN_SYNC_KIND)
|
|
1452
|
+
return kind;
|
|
1453
|
+
if (kind === FRONTIER_RUN_JSONL_STORE_SYNC_EVIDENCE_KIND)
|
|
1454
|
+
return kind;
|
|
1447
1455
|
if (kind === FRONTIER_SEMANTIC_LEASE_STATE_KIND)
|
|
1448
1456
|
return kind;
|
|
1449
1457
|
if (kind === FRONTIER_SEMANTIC_LEASE_RECORD_KIND)
|
|
@@ -1474,6 +1482,7 @@ function summarizeDashboardSubstrateRecords(cwd, records) {
|
|
|
1474
1482
|
sourceFiles,
|
|
1475
1483
|
sourceCount: sourceFiles.length,
|
|
1476
1484
|
run: { eventCount: 0, dashboardCount: 0, runIds: [], eventTypeCounts },
|
|
1485
|
+
sync: { evidenceCount: 0, exchangeCount: 0, peerCount: 0, pulledEventCount: 0, pushedEventCount: 0, acceptedEventCount: 0, skippedDuplicateEventCount: 0, conflictCount: 0 },
|
|
1477
1486
|
leases: { stateCount: 0, recordCount: 0, eventCount: 0, activeCount: 0, grantedCount: 0, deniedCount: 0, releasedCount: 0, expiredCount: 0, scopeCount: 0 },
|
|
1478
1487
|
gates: { executionCount: 0, passedCount: 0, failedCount: 0, warningCount: 0, requiredFailedCount: 0, durationMs: 0, kindCounts: gateKindCounts },
|
|
1479
1488
|
git: { workspaceManifestCount: 0, workspaceProofCount: 0, applyLedgerCount: 0, linkRepairCount: 0, appliedCount: 0, committedCount: 0, failedCount: 0, skippedCount: 0, changedPathCount: 0 }
|
|
@@ -1491,6 +1500,10 @@ function summarizeDashboardSubstrateRecords(cwd, records) {
|
|
|
1491
1500
|
if (textValue(record.runId, ''))
|
|
1492
1501
|
runIds.add(textValue(record.runId, ''));
|
|
1493
1502
|
break;
|
|
1503
|
+
case FRONTIER_SWARM_CODEX_RUN_SYNC_KIND:
|
|
1504
|
+
case FRONTIER_RUN_JSONL_STORE_SYNC_EVIDENCE_KIND:
|
|
1505
|
+
summarizeRunSync(summary, record);
|
|
1506
|
+
break;
|
|
1494
1507
|
case FRONTIER_SEMANTIC_LEASE_STATE_KIND:
|
|
1495
1508
|
summary.leases.stateCount += 1;
|
|
1496
1509
|
summarizeLeaseRecords(summary, recordArray(record.leases));
|
|
@@ -1572,6 +1585,31 @@ function summarizeGateExecution(summary, execution) {
|
|
|
1572
1585
|
summary.gates.warningCount += 1;
|
|
1573
1586
|
}
|
|
1574
1587
|
}
|
|
1588
|
+
function summarizeRunSync(summary, record) {
|
|
1589
|
+
summary.sync.evidenceCount += 1;
|
|
1590
|
+
if (dashboardSubstrateRecordKind(record) === FRONTIER_RUN_JSONL_STORE_SYNC_EVIDENCE_KIND) {
|
|
1591
|
+
const local = recordValue(record.local);
|
|
1592
|
+
const remote = recordValue(record.remote);
|
|
1593
|
+
const pulled = numberValue(local.acceptedEventCount);
|
|
1594
|
+
const pushed = numberValue(remote.acceptedEventCount);
|
|
1595
|
+
summary.sync.exchangeCount += 1;
|
|
1596
|
+
summary.sync.peerCount += 1;
|
|
1597
|
+
summary.sync.pulledEventCount += pulled;
|
|
1598
|
+
summary.sync.pushedEventCount += pushed;
|
|
1599
|
+
summary.sync.acceptedEventCount += pulled + pushed;
|
|
1600
|
+
summary.sync.skippedDuplicateEventCount += numberValue(local.skippedDuplicateEventCount) + numberValue(remote.skippedDuplicateEventCount);
|
|
1601
|
+
summary.sync.conflictCount += recordArray(record.conflicts).length;
|
|
1602
|
+
return;
|
|
1603
|
+
}
|
|
1604
|
+
const syncSummary = recordValue(record.summary);
|
|
1605
|
+
summary.sync.exchangeCount += numberValue(syncSummary.exchangeCount);
|
|
1606
|
+
summary.sync.peerCount += numberValue(syncSummary.peerCount);
|
|
1607
|
+
summary.sync.pulledEventCount += numberValue(syncSummary.pulledEventCount);
|
|
1608
|
+
summary.sync.pushedEventCount += numberValue(syncSummary.pushedEventCount);
|
|
1609
|
+
summary.sync.acceptedEventCount += numberValue(syncSummary.acceptedEventCount);
|
|
1610
|
+
summary.sync.skippedDuplicateEventCount += numberValue(syncSummary.skippedDuplicateEventCount);
|
|
1611
|
+
summary.sync.conflictCount += numberValue(syncSummary.conflictCount);
|
|
1612
|
+
}
|
|
1575
1613
|
function summarizeGitApplyLedger(summary, ledger) {
|
|
1576
1614
|
summary.git.applyLedgerCount += 1;
|
|
1577
1615
|
const ledgerSummary = recordValue(ledger.summary);
|
|
@@ -1586,6 +1624,7 @@ function summarizeGitApplyLedger(summary, ledger) {
|
|
|
1586
1624
|
function substrateDashboardGraphSummary(substrate) {
|
|
1587
1625
|
const nodeCount = substrate.run.eventCount
|
|
1588
1626
|
+ substrate.run.dashboardCount
|
|
1627
|
+
+ substrate.sync.exchangeCount
|
|
1589
1628
|
+ substrate.leases.recordCount
|
|
1590
1629
|
+ substrate.leases.eventCount
|
|
1591
1630
|
+ substrate.gates.executionCount
|
|
@@ -1596,7 +1635,7 @@ function substrateDashboardGraphSummary(substrate) {
|
|
|
1596
1635
|
if (!nodeCount)
|
|
1597
1636
|
return undefined;
|
|
1598
1637
|
const gateFailedCount = substrate.gates.failedCount;
|
|
1599
|
-
const blockerCount = substrate.gates.requiredFailedCount + substrate.git.failedCount + substrate.leases.deniedCount;
|
|
1638
|
+
const blockerCount = substrate.gates.requiredFailedCount + substrate.git.failedCount + substrate.leases.deniedCount + substrate.sync.conflictCount;
|
|
1600
1639
|
return {
|
|
1601
1640
|
sourceFile: substrate.sourceFiles[0],
|
|
1602
1641
|
sourceFiles: substrate.sourceFiles,
|
|
@@ -1611,7 +1650,7 @@ function substrateDashboardGraphSummary(substrate) {
|
|
|
1611
1650
|
humanQuestionCount: 0,
|
|
1612
1651
|
openHumanQuestionCount: 0,
|
|
1613
1652
|
safeMergeCandidateCount: substrate.git.appliedCount + substrate.git.committedCount,
|
|
1614
|
-
decisionCount: substrate.leases.eventCount,
|
|
1653
|
+
decisionCount: substrate.leases.eventCount + substrate.sync.exchangeCount,
|
|
1615
1654
|
terminalDecisionCount: 0,
|
|
1616
1655
|
terminalAcceptedCount: substrate.git.appliedCount + substrate.git.committedCount,
|
|
1617
1656
|
terminalRejectedCount: substrate.git.failedCount,
|
|
@@ -1625,7 +1664,7 @@ function substrateDashboardGraphSummary(substrate) {
|
|
|
1625
1664
|
openRerunCount: 0,
|
|
1626
1665
|
staleRerunCleanupCount: 0,
|
|
1627
1666
|
status: blockerCount ? 'blocked' : gateFailedCount ? 'review' : substrate.git.appliedCount || substrate.git.committedCount ? 'ready' : 'clear',
|
|
1628
|
-
summaryLine: `${nodeCount} substrate records, ${substrate.gates.executionCount} gate executions, ${substrate.leases.activeCount} active leases.`,
|
|
1667
|
+
summaryLine: `${nodeCount} substrate records, ${substrate.gates.executionCount} gate executions, ${substrate.leases.activeCount} active leases, ${substrate.sync.exchangeCount} run sync exchanges.`,
|
|
1629
1668
|
recentEvents: []
|
|
1630
1669
|
};
|
|
1631
1670
|
}
|
|
@@ -1633,6 +1672,8 @@ function dashboardSubstrateSourceKinds(substrate) {
|
|
|
1633
1672
|
const kinds = [];
|
|
1634
1673
|
if (substrate.run.eventCount || substrate.run.dashboardCount)
|
|
1635
1674
|
kinds.push('frontier-run');
|
|
1675
|
+
if (substrate.sync.exchangeCount || substrate.sync.evidenceCount)
|
|
1676
|
+
kinds.push('frontier-run-sync');
|
|
1636
1677
|
if (substrate.leases.recordCount || substrate.leases.eventCount || substrate.leases.stateCount)
|
|
1637
1678
|
kinds.push('frontier-lease');
|
|
1638
1679
|
if (substrate.gates.executionCount)
|