mirror of
https://github.com/morluto/rea.git
synced 2026-11-09 16:26:36 +00:00
chore(deps): finish toolchain upgrades and drop dead weight (#644)
* chore(deps): finish toolchain upgrades and drop dead weight pino 9 to 10, @types/node 24 to 26, oxlint 1.73 to 1.87, knip 6.26 to 6.39, turbo 2.10 to 2.11. Narrow engines to supported majors (22/24/26; vitest 5 refuses Node 25). Scope no-var-requires off for Electron CJS hooks and fixtures. Remove TypeDoc: incompatible with TypeScript 7 at install and runtime, used by nothing in any gate. Drop the dep, docs:api workflow, typedoc.json, CI artifact step, and related docs. Replace graphology with a local call-graph adjacency plus BFS: the only consumer is call-path search, and graphology-types ships no types entry for TS7 NodeNext resolution. Delete both graphology dependencies. Remove dead re-exports newly flagged by knip 6.39. * chore: drop stale typedoc and replay references Remove the docs:api release-checklist step, the orphaned docs/api ignore entry, and the nonexistent replay glob from the adapters project.
This commit is contained in:
1 parent
5f27e02fae
commit
9b392bb2f8
16 files changed
+552
-542
No files matched your search
@@ -69,7 +69,6 @@ export {
|
||||
changedBehaviorInputSchema,
|
||||
closeBinaryInputSchema,
|
||||
functionComparisonInputSchema,
|
||||
jsonValueSchema,
|
||||
openBinaryInputSchema,
|
||||
processScenarioSchema,
|
||||
reconstructionVerificationInputSchema,
|
||||
|
||||
@@ -10,18 +10,7 @@ import { OFFICIAL_TOOL_CONTRACTS } from "./officialToolContracts.js";
|
||||
import { ENHANCED_TOOL_CONTRACTS } from "./enhancedToolContracts.js";
|
||||
import { SESSION_TOOL_CONTRACTS } from "./sessionToolContracts.js";
|
||||
|
||||
export {
|
||||
addressContextInputSchema,
|
||||
binarySessionInputSchema,
|
||||
importEvidenceBundleInputSchema,
|
||||
listUnknownsInputSchema,
|
||||
navigationContextInputSchema,
|
||||
processComparisonInputSchema,
|
||||
getEvidenceBundleInputSchema,
|
||||
verifyUnknownResolutionInputSchema,
|
||||
} from "./sessionToolSchemas.js";
|
||||
|
||||
export type { ToolContract, ToolExample } from "./toolContractTypes.js";
|
||||
export type { ToolContract } from "./toolContractTypes.js";
|
||||
|
||||
/** Complete ordered public inventory used by registration and verification. */
|
||||
export const TOOL_CONTRACTS = [
|
||||
|
||||
@@ -14,9 +14,6 @@ import {
|
||||
} from "./browserScenarioValues.js";
|
||||
|
||||
export {
|
||||
browserScenarioActionSchema,
|
||||
browserScenarioUrlSchema,
|
||||
browserScenarioValueSchema,
|
||||
type BrowserScenarioAction,
|
||||
type BrowserScenarioUrl,
|
||||
type BrowserScenarioValue,
|
||||
|
||||
@@ -8,11 +8,9 @@ import {
|
||||
|
||||
export {
|
||||
classifyBrowserScenarioCompleteness,
|
||||
browserScenarioCompletenessSchema,
|
||||
browserScenarioEventSchema,
|
||||
browserScenarioStepSchema,
|
||||
browserStepArtifactsSchema,
|
||||
captureStateSchema,
|
||||
type BrowserScenarioCompleteness,
|
||||
type BrowserScenarioCompletenessSection,
|
||||
type BrowserScenarioEvent,
|
||||
|
||||
+61
-14
@@ -1,6 +1,3 @@
|
||||
import { DirectedGraph } from "graphology";
|
||||
import { bidirectional } from "graphology-shortest-path/unweighted.js";
|
||||
|
||||
import {
|
||||
callPathInputSchema,
|
||||
callPathResultSchema,
|
||||
@@ -17,8 +14,58 @@ import {
|
||||
export { callPathInputSchema, callPathResultSchema };
|
||||
export type { CallPathInput, CallPathResult };
|
||||
|
||||
/** Minimal directed caller-to-callee adjacency for call-path search. */
|
||||
class CallGraph {
|
||||
private readonly successors = new Map<string, Set<string>>();
|
||||
|
||||
mergeNode(node: string): void {
|
||||
if (!this.successors.has(node)) this.successors.set(node, new Set());
|
||||
}
|
||||
|
||||
mergeDirectedEdge(source: string, target: string): void {
|
||||
this.mergeNode(source);
|
||||
this.mergeNode(target);
|
||||
this.successors.get(source)?.add(target);
|
||||
}
|
||||
|
||||
hasNode(node: string): boolean {
|
||||
return this.successors.has(node);
|
||||
}
|
||||
|
||||
outDegree(node: string): number {
|
||||
return this.successors.get(node)?.size ?? 0;
|
||||
}
|
||||
|
||||
outNeighbors(node: string): string[] {
|
||||
return [...(this.successors.get(node) ?? [])];
|
||||
}
|
||||
}
|
||||
|
||||
/** Breadth-first shortest depth from start to goal, or null when unreachable. */
|
||||
const shortestPathDepth = (
|
||||
graph: CallGraph,
|
||||
start: string,
|
||||
goal: string,
|
||||
): number | null => {
|
||||
if (start === goal) return 0;
|
||||
const depth = new Map<string, number>([[start, 0]]);
|
||||
const queue = [start];
|
||||
for (let index = 0; index < queue.length; index += 1) {
|
||||
const node = queue[index] ?? "";
|
||||
const next = (depth.get(node) ?? 0) + 1;
|
||||
for (const neighbor of graph.outNeighbors(node)) {
|
||||
if (neighbor === goal) return next;
|
||||
if (!depth.has(neighbor)) {
|
||||
depth.set(neighbor, next);
|
||||
queue.push(neighbor);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
interface SearchState {
|
||||
readonly graph: DirectedGraph;
|
||||
readonly graph: CallGraph;
|
||||
readonly snapshots: ReadonlyMap<string, FunctionSnapshot>;
|
||||
readonly reached: ReadonlyMap<string, number>;
|
||||
readonly exhaustive: boolean;
|
||||
@@ -35,18 +82,18 @@ export const buildCallPath = (input: CallPathInput): CallPathResult => {
|
||||
start: parsed.start.address,
|
||||
goal: parsed.goal.address,
|
||||
});
|
||||
const shortest =
|
||||
const shortestDepth =
|
||||
graph.hasNode(parsed.start.address) && graph.hasNode(parsed.goal.address)
|
||||
? bidirectional(graph, parsed.start.address, parsed.goal.address)
|
||||
? shortestPathDepth(graph, parsed.start.address, parsed.goal.address)
|
||||
: null;
|
||||
const paths =
|
||||
shortest === null
|
||||
shortestDepth === null
|
||||
? []
|
||||
: enumeratePaths({
|
||||
graph,
|
||||
start: parsed.start.address,
|
||||
goal: parsed.goal.address,
|
||||
shortestDepth: shortest.length - 1,
|
||||
shortestDepth,
|
||||
}).paths.map((path) => citePath(path, snapshots));
|
||||
const shortestHops = paths[0]?.hops;
|
||||
const found = shortestHops !== undefined;
|
||||
@@ -80,7 +127,7 @@ export const buildCallPath = (input: CallPathInput): CallPathResult => {
|
||||
};
|
||||
|
||||
const summarizeSearch = (
|
||||
graph: DirectedGraph,
|
||||
graph: CallGraph,
|
||||
reached: ReadonlyMap<string, number>,
|
||||
) => ({
|
||||
nodes: reached.size,
|
||||
@@ -141,8 +188,8 @@ const assertCompatible = (
|
||||
|
||||
const createGraph = (
|
||||
snapshots: ReadonlyMap<string, FunctionSnapshot>,
|
||||
): DirectedGraph => {
|
||||
const graph = new DirectedGraph({ allowSelfLoops: true, multi: false });
|
||||
): CallGraph => {
|
||||
const graph = new CallGraph();
|
||||
for (const [address, snapshot] of snapshots) {
|
||||
graph.mergeNode(address);
|
||||
for (const callee of snapshot.collections.callees.items) {
|
||||
@@ -155,7 +202,7 @@ const createGraph = (
|
||||
};
|
||||
|
||||
interface SearchInput {
|
||||
readonly graph: DirectedGraph;
|
||||
readonly graph: CallGraph;
|
||||
readonly snapshots: ReadonlyMap<string, FunctionSnapshot>;
|
||||
readonly start: string;
|
||||
readonly goal: string;
|
||||
@@ -211,7 +258,7 @@ const inspectSearch = ({
|
||||
};
|
||||
|
||||
interface EnumerationInput {
|
||||
readonly graph: DirectedGraph;
|
||||
readonly graph: CallGraph;
|
||||
readonly start: string;
|
||||
readonly goal: string;
|
||||
readonly shortestDepth: number;
|
||||
@@ -238,7 +285,7 @@ const enumeratePaths = ({
|
||||
};
|
||||
|
||||
interface EnumerationState {
|
||||
readonly graph: DirectedGraph;
|
||||
readonly graph: CallGraph;
|
||||
readonly goal: string;
|
||||
readonly path: string[];
|
||||
readonly visited: Set<string>;
|
||||
|
||||
@@ -396,9 +396,3 @@ export {
|
||||
PROCESS_COMPARISON_DIMENSIONS,
|
||||
processCaptureComparisonSchema,
|
||||
} from "./processComparison.js";
|
||||
export {
|
||||
compareProcessTraces,
|
||||
processTraceComparisonResultSchema,
|
||||
processTraceSourceSchema,
|
||||
processTraceSpecificationSchema,
|
||||
} from "./processTraceComparison.js";
|
||||
@@ -12,12 +12,9 @@ import {
|
||||
export {
|
||||
processTraceComparisonResultSchema,
|
||||
type ProcessTraceComparisonResult,
|
||||
type ProcessTraceLocation,
|
||||
} from "./processTraceEvaluation.js";
|
||||
export {
|
||||
processTraceSourceSchema,
|
||||
processTraceSpecificationSchema,
|
||||
type ProcessTraceSource,
|
||||
type ProcessTraceSpecification,
|
||||
} from "./processTraceSpecification.js";
|
||||
|
||||
|
||||
Reference in new issue
Block a user