@lcv-ideas-software/cross-review 4.0.0
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/CHANGELOG.md +2568 -0
- package/LICENSE +201 -0
- package/NOTICE +26 -0
- package/README.md +208 -0
- package/SECURITY.md +52 -0
- package/dist/scripts/api-streaming-smoke.d.ts +1 -0
- package/dist/scripts/api-streaming-smoke.js +78 -0
- package/dist/scripts/api-streaming-smoke.js.map +1 -0
- package/dist/scripts/runtime-default-smoke.d.ts +1 -0
- package/dist/scripts/runtime-default-smoke.js +88 -0
- package/dist/scripts/runtime-default-smoke.js.map +1 -0
- package/dist/scripts/runtime-smoke.d.ts +1 -0
- package/dist/scripts/runtime-smoke.js +148 -0
- package/dist/scripts/runtime-smoke.js.map +1 -0
- package/dist/scripts/smoke.d.ts +1 -0
- package/dist/scripts/smoke.js +6156 -0
- package/dist/scripts/smoke.js.map +1 -0
- package/dist/src/core/cache-manifest.d.ts +22 -0
- package/dist/src/core/cache-manifest.js +133 -0
- package/dist/src/core/cache-manifest.js.map +1 -0
- package/dist/src/core/caller-tokens.d.ts +32 -0
- package/dist/src/core/caller-tokens.js +240 -0
- package/dist/src/core/caller-tokens.js.map +1 -0
- package/dist/src/core/config.d.ts +9 -0
- package/dist/src/core/config.js +643 -0
- package/dist/src/core/config.js.map +1 -0
- package/dist/src/core/convergence.d.ts +5 -0
- package/dist/src/core/convergence.js +186 -0
- package/dist/src/core/convergence.js.map +1 -0
- package/dist/src/core/cost.d.ts +59 -0
- package/dist/src/core/cost.js +359 -0
- package/dist/src/core/cost.js.map +1 -0
- package/dist/src/core/file-config.d.ts +316 -0
- package/dist/src/core/file-config.js +490 -0
- package/dist/src/core/file-config.js.map +1 -0
- package/dist/src/core/orchestrator.d.ts +199 -0
- package/dist/src/core/orchestrator.js +3430 -0
- package/dist/src/core/orchestrator.js.map +1 -0
- package/dist/src/core/prompt-parts.d.ts +58 -0
- package/dist/src/core/prompt-parts.js +122 -0
- package/dist/src/core/prompt-parts.js.map +1 -0
- package/dist/src/core/relator-lottery.d.ts +23 -0
- package/dist/src/core/relator-lottery.js +112 -0
- package/dist/src/core/relator-lottery.js.map +1 -0
- package/dist/src/core/reports.d.ts +2 -0
- package/dist/src/core/reports.js +82 -0
- package/dist/src/core/reports.js.map +1 -0
- package/dist/src/core/session-store.d.ts +149 -0
- package/dist/src/core/session-store.js +1923 -0
- package/dist/src/core/session-store.js.map +1 -0
- package/dist/src/core/status.d.ts +61 -0
- package/dist/src/core/status.js +249 -0
- package/dist/src/core/status.js.map +1 -0
- package/dist/src/core/timeouts.d.ts +2 -0
- package/dist/src/core/timeouts.js +3 -0
- package/dist/src/core/timeouts.js.map +1 -0
- package/dist/src/core/types.d.ts +604 -0
- package/dist/src/core/types.js +36 -0
- package/dist/src/core/types.js.map +1 -0
- package/dist/src/dashboard/server.d.ts +2 -0
- package/dist/src/dashboard/server.js +339 -0
- package/dist/src/dashboard/server.js.map +1 -0
- package/dist/src/mcp/server.d.ts +54 -0
- package/dist/src/mcp/server.js +1584 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/observability/logger.d.ts +9 -0
- package/dist/src/observability/logger.js +24 -0
- package/dist/src/observability/logger.js.map +1 -0
- package/dist/src/peers/anthropic.d.ts +14 -0
- package/dist/src/peers/anthropic.js +290 -0
- package/dist/src/peers/anthropic.js.map +1 -0
- package/dist/src/peers/base.d.ts +72 -0
- package/dist/src/peers/base.js +416 -0
- package/dist/src/peers/base.js.map +1 -0
- package/dist/src/peers/deepseek.d.ts +12 -0
- package/dist/src/peers/deepseek.js +246 -0
- package/dist/src/peers/deepseek.js.map +1 -0
- package/dist/src/peers/errors.d.ts +2 -0
- package/dist/src/peers/errors.js +185 -0
- package/dist/src/peers/errors.js.map +1 -0
- package/dist/src/peers/gemini.d.ts +13 -0
- package/dist/src/peers/gemini.js +215 -0
- package/dist/src/peers/gemini.js.map +1 -0
- package/dist/src/peers/grok.d.ts +17 -0
- package/dist/src/peers/grok.js +346 -0
- package/dist/src/peers/grok.js.map +1 -0
- package/dist/src/peers/model-selection.d.ts +4 -0
- package/dist/src/peers/model-selection.js +260 -0
- package/dist/src/peers/model-selection.js.map +1 -0
- package/dist/src/peers/openai.d.ts +14 -0
- package/dist/src/peers/openai.js +299 -0
- package/dist/src/peers/openai.js.map +1 -0
- package/dist/src/peers/perplexity.d.ts +18 -0
- package/dist/src/peers/perplexity.js +375 -0
- package/dist/src/peers/perplexity.js.map +1 -0
- package/dist/src/peers/registry.d.ts +3 -0
- package/dist/src/peers/registry.js +77 -0
- package/dist/src/peers/registry.js.map +1 -0
- package/dist/src/peers/retry.d.ts +2 -0
- package/dist/src/peers/retry.js +36 -0
- package/dist/src/peers/retry.js.map +1 -0
- package/dist/src/peers/stub.d.ts +13 -0
- package/dist/src/peers/stub.js +344 -0
- package/dist/src/peers/stub.js.map +1 -0
- package/dist/src/peers/text.d.ts +18 -0
- package/dist/src/peers/text.js +39 -0
- package/dist/src/peers/text.js.map +1 -0
- package/dist/src/security/redact.d.ts +2 -0
- package/dist/src/security/redact.js +128 -0
- package/dist/src/security/redact.js.map +1 -0
- package/docs/api-keys.md +34 -0
- package/docs/architecture.md +118 -0
- package/docs/caching.md +135 -0
- package/docs/costs.md +40 -0
- package/docs/evidence-preflight.md +88 -0
- package/docs/github-security-baseline.md +32 -0
- package/docs/model-selection.md +105 -0
- package/docs/reports/cross-review-v2-api-capability-smoke-2026-04-30.md +354 -0
- package/docs/reports/cross-review-v2-format-recovery-findings-2026-04-28.md +223 -0
- package/docs/reports/cross-review-v2-official-provider-docs-refresh-2026-05-05.md +60 -0
- package/docs/reports/cross-review-v2-token-streaming-smoke-2026-04-30.md +119 -0
- package/package.json +88 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
function valueOrDash(value) {
|
|
2
|
+
if (value == null || value === "")
|
|
3
|
+
return "-";
|
|
4
|
+
return String(value);
|
|
5
|
+
}
|
|
6
|
+
function costText(session) {
|
|
7
|
+
const total = session.totals.cost.total_cost;
|
|
8
|
+
return total == null ? "unknown" : `$${total.toFixed(6)} ${session.totals.cost.currency}`;
|
|
9
|
+
}
|
|
10
|
+
export function sessionReportMarkdown(session, events = []) {
|
|
11
|
+
const latestRound = session.rounds.at(-1);
|
|
12
|
+
const lines = [
|
|
13
|
+
`# Cross Review Session ${session.session_id}`,
|
|
14
|
+
"",
|
|
15
|
+
"## Summary",
|
|
16
|
+
"",
|
|
17
|
+
`- Version: ${session.version}`,
|
|
18
|
+
`- Created: ${session.created_at}`,
|
|
19
|
+
`- Updated: ${session.updated_at}`,
|
|
20
|
+
`- Caller: ${session.caller}`,
|
|
21
|
+
`- Outcome: ${valueOrDash(session.outcome)}`,
|
|
22
|
+
`- Outcome reason: ${valueOrDash(session.outcome_reason)}`,
|
|
23
|
+
`- Health: ${valueOrDash(session.convergence_health?.state)} - ${valueOrDash(session.convergence_health?.detail)}`,
|
|
24
|
+
`- Rounds: ${session.rounds.length}`,
|
|
25
|
+
`- Cost: ${costText(session)}`,
|
|
26
|
+
`- Total tokens: ${valueOrDash(session.totals.usage.total_tokens)}`,
|
|
27
|
+
"",
|
|
28
|
+
"## Task",
|
|
29
|
+
"",
|
|
30
|
+
session.task,
|
|
31
|
+
"",
|
|
32
|
+
"## Latest Convergence",
|
|
33
|
+
"",
|
|
34
|
+
latestRound
|
|
35
|
+
? [
|
|
36
|
+
`- Converged: ${latestRound.convergence.converged}`,
|
|
37
|
+
`- Reason: ${latestRound.convergence.reason}`,
|
|
38
|
+
`- Ready: ${latestRound.convergence.ready_peers.join(", ") || "-"}`,
|
|
39
|
+
`- Not ready: ${latestRound.convergence.not_ready_peers.join(", ") || "-"}`,
|
|
40
|
+
`- Needs evidence: ${latestRound.convergence.needs_evidence_peers.join(", ") || "-"}`,
|
|
41
|
+
`- Rejected: ${latestRound.convergence.rejected_peers.join(", ") || "-"}`,
|
|
42
|
+
`- Blocking details: ${latestRound.convergence.blocking_details.join("; ") || "-"}`,
|
|
43
|
+
].join("\n")
|
|
44
|
+
: "- No round completed yet.",
|
|
45
|
+
"",
|
|
46
|
+
"## Peer Decisions",
|
|
47
|
+
"",
|
|
48
|
+
];
|
|
49
|
+
if (session.generation_files?.length) {
|
|
50
|
+
lines.push("## Generations", "");
|
|
51
|
+
for (const generation of session.generation_files) {
|
|
52
|
+
const totalTokens = generation.usage?.total_tokens ?? "-";
|
|
53
|
+
const totalCost = generation.cost?.total_cost == null
|
|
54
|
+
? "unknown"
|
|
55
|
+
: `$${generation.cost.total_cost.toFixed(6)} ${generation.cost.currency}`;
|
|
56
|
+
lines.push(`- round ${generation.round} ${generation.peer}/${generation.label}: ${generation.path} (${totalTokens} tokens, ${totalCost})`);
|
|
57
|
+
}
|
|
58
|
+
lines.push("");
|
|
59
|
+
}
|
|
60
|
+
for (const round of session.rounds) {
|
|
61
|
+
lines.push(`### Round ${round.round}`, "");
|
|
62
|
+
for (const peer of round.peers) {
|
|
63
|
+
lines.push(`- ${peer.peer}: ${peer.status ?? "NO_STATUS"} (${peer.decision_quality ?? "unknown"}) - ${peer.structured?.summary ?? "no summary"}`);
|
|
64
|
+
if (peer.parser_warnings.length) {
|
|
65
|
+
lines.push(` - Parser warnings: ${peer.parser_warnings.join("; ")}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
for (const failure of round.rejected) {
|
|
69
|
+
lines.push(`- ${failure.peer}: FAILURE ${failure.failure_class} - ${failure.message}`);
|
|
70
|
+
}
|
|
71
|
+
lines.push("");
|
|
72
|
+
}
|
|
73
|
+
if (events.length) {
|
|
74
|
+
lines.push("## Events", "");
|
|
75
|
+
for (const event of events.slice(-100)) {
|
|
76
|
+
lines.push(`- ${event.seq}. ${event.ts ?? ""} ${event.type}${event.peer ? `/${event.peer}` : ""}: ${event.message ?? ""}`);
|
|
77
|
+
}
|
|
78
|
+
lines.push("");
|
|
79
|
+
}
|
|
80
|
+
return `${lines.join("\n")}\n`;
|
|
81
|
+
}
|
|
82
|
+
//# sourceM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EAAE,CAAC,CAAC;IACjB,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC5B,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;YACvC,KAAK,CAAC,IAAI,CACR,KAAK,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,KAAK,CAAC,IAAI,GAC7C,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAClC,KAAK,KAAK,CAAC,OAAO,IAAI,EAAE,EAAE,CAC3B,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { AppConfig, ConvergenceResult, ConvergenceScope, EvidenceChecklistItem, EvidenceChecklistStatus, EvidenceStatusHistoryEntry, GenerationResult, PeerFailure, PeerId, PeerProbeResult, PeerResult, RuntimeEvent, RuntimeMetrics, SessionDoctorReport, SessionEvent, ReviewRound, ReviewStatus, SessionMeta, JudgmentPrecisionReport, ShadowJudgmentRollup } from "./types.js";
|
|
2
|
+
export declare const SWEEP_MIN_IDLE_MS: number;
|
|
3
|
+
export declare class SessionStore {
|
|
4
|
+
private readonly config;
|
|
5
|
+
private readonly seqCache;
|
|
6
|
+
constructor(config: AppConfig);
|
|
7
|
+
sessionsDir(): string;
|
|
8
|
+
sessionDir(sessionId: string): string;
|
|
9
|
+
metaPath(sessionId: string): string;
|
|
10
|
+
eventsPath(sessionId: string): string;
|
|
11
|
+
assertSessionId(sessionId: string): void;
|
|
12
|
+
private isPathContained;
|
|
13
|
+
private processAlive;
|
|
14
|
+
private sleepSync;
|
|
15
|
+
private totalsFor;
|
|
16
|
+
private withSessionLock;
|
|
17
|
+
init(task: string, caller: PeerId | "operator", snapshot: PeerProbeResult[], reviewFocus?: string): SessionMeta;
|
|
18
|
+
markInFlight(sessionId: string, params: {
|
|
19
|
+
round: number;
|
|
20
|
+
peers: PeerId[];
|
|
21
|
+
started_at: string;
|
|
22
|
+
scope: ConvergenceScope;
|
|
23
|
+
}): SessionMeta;
|
|
24
|
+
read(sessionId: string): SessionMeta;
|
|
25
|
+
private peekNextSeq;
|
|
26
|
+
private commitSeq;
|
|
27
|
+
appendEvent(event: RuntimeEvent): void;
|
|
28
|
+
readEvents(sessionId: string, sinceSeq?: number): SessionEvent[];
|
|
29
|
+
list(): SessionMeta[];
|
|
30
|
+
pruneOldSessions(maxAgeDays?: number): {
|
|
31
|
+
scanned: number;
|
|
32
|
+
pruned: number;
|
|
33
|
+
};
|
|
34
|
+
savePrompt(sessionId: string, round: number, prompt: string): string;
|
|
35
|
+
saveDraft(sessionId: string, round: number, draft: string): string;
|
|
36
|
+
saveGeneration(sessionId: string, round: number, result: GenerationResult, label?: string): string;
|
|
37
|
+
saveFinal(sessionId: string, text: string): string;
|
|
38
|
+
saveReport(sessionId: string, text: string): string;
|
|
39
|
+
savePeerResult(sessionId: string, round: number, result: PeerResult, label?: string): string;
|
|
40
|
+
savePeerFailure(sessionId: string, round: number, failure: PeerFailure): string;
|
|
41
|
+
appendRound(sessionId: string, params: {
|
|
42
|
+
caller_status: ReviewStatus;
|
|
43
|
+
draft_file?: string;
|
|
44
|
+
prompt_file: string;
|
|
45
|
+
peers: PeerResult[];
|
|
46
|
+
rejected: PeerFailure[];
|
|
47
|
+
convergence: ConvergenceResult;
|
|
48
|
+
convergence_scope: ConvergenceScope;
|
|
49
|
+
started_at: string;
|
|
50
|
+
}): ReviewRound;
|
|
51
|
+
markBudgetWarningEmitted(sessionId: string): SessionMeta;
|
|
52
|
+
setCircularState(sessionId: string, state: NonNullable<SessionMeta["circular_state"]>): SessionMeta;
|
|
53
|
+
setSessionTraceability(sessionId: string, traceability: {
|
|
54
|
+
requested_max_rounds: number | null;
|
|
55
|
+
effective_max_rounds: number | null;
|
|
56
|
+
requested_max_cost_usd: number | null;
|
|
57
|
+
effective_cost_ceiling_usd: number | null;
|
|
58
|
+
cost_ceiling_source: "call_arg" | "env_default" | "config_default";
|
|
59
|
+
}): SessionMeta;
|
|
60
|
+
assertNotFinalized(sessionId: string): void;
|
|
61
|
+
finalize(sessionId: string, outcome: NonNullable<SessionMeta["outcome"]>, reason?: string): SessionMeta;
|
|
62
|
+
requestCancellation(sessionId: string, reason?: string, jobId?: string): SessionMeta;
|
|
63
|
+
markCancelled(sessionId: string, reason?: string): SessionMeta;
|
|
64
|
+
isCancellationRequested(sessionId: string): boolean;
|
|
65
|
+
appendFallbackEvent(sessionId: string, event: NonNullable<SessionMeta["fallback_events"]>[number]): SessionMeta;
|
|
66
|
+
appendEvidenceChecklistItems(sessionId: string, round: number, incoming: Array<{
|
|
67
|
+
peer: PeerId;
|
|
68
|
+
ask: string;
|
|
69
|
+
}>): NonNullable<SessionMeta["evidence_checklist"]>;
|
|
70
|
+
static readonly TERMINAL_STATUSES: ReadonlySet<EvidenceChecklistStatus>;
|
|
71
|
+
runEvidenceChecklistAddressDetection(sessionId: string, currentRound: number): {
|
|
72
|
+
not_resurfaced: EvidenceChecklistItem[];
|
|
73
|
+
reopened: EvidenceChecklistItem[];
|
|
74
|
+
peer_resurfaced_terminal: EvidenceChecklistItem[];
|
|
75
|
+
};
|
|
76
|
+
setEvidenceChecklistItemStatus(sessionId: string, itemId: string, status: Exclude<EvidenceChecklistStatus, "addressed" | "not_resurfaced">, options?: {
|
|
77
|
+
note?: string;
|
|
78
|
+
by?: "operator" | "runtime";
|
|
79
|
+
}): {
|
|
80
|
+
item: EvidenceChecklistItem;
|
|
81
|
+
history_entry: EvidenceStatusHistoryEntry;
|
|
82
|
+
};
|
|
83
|
+
markEvidenceItemAddressedByJudge(sessionId: string, itemId: string, params: {
|
|
84
|
+
round: number;
|
|
85
|
+
rationale: string;
|
|
86
|
+
judge_peer: PeerId;
|
|
87
|
+
}): {
|
|
88
|
+
item: EvidenceChecklistItem;
|
|
89
|
+
history_entry: EvidenceStatusHistoryEntry;
|
|
90
|
+
} | null;
|
|
91
|
+
recoverInterruptedSessions(activeSessionIds?: Set<string>): SessionMeta[];
|
|
92
|
+
aggregateShadowJudgments(sessionId?: string): ShadowJudgmentRollup;
|
|
93
|
+
metrics(sessionId?: string): RuntimeMetrics;
|
|
94
|
+
sessionDoctor(limit?: number, includeLegacy?: boolean, repair?: boolean): SessionDoctorReport;
|
|
95
|
+
computeJudgmentPrecisionReport(opts?: {
|
|
96
|
+
peer?: PeerId;
|
|
97
|
+
since?: string;
|
|
98
|
+
session_id?: string;
|
|
99
|
+
}): JudgmentPrecisionReport;
|
|
100
|
+
readEvidenceAttachments(sessionId: string, totalCapChars: number): Array<{
|
|
101
|
+
label: string;
|
|
102
|
+
relative_path: string;
|
|
103
|
+
content: string;
|
|
104
|
+
bytes: number;
|
|
105
|
+
truncated: boolean;
|
|
106
|
+
content_type?: string;
|
|
107
|
+
}>;
|
|
108
|
+
contestVerdict(params: {
|
|
109
|
+
session_id: string;
|
|
110
|
+
reason: string;
|
|
111
|
+
new_task: string;
|
|
112
|
+
new_initial_draft?: string;
|
|
113
|
+
new_caller?: PeerId | "operator";
|
|
114
|
+
}): {
|
|
115
|
+
contested_meta: SessionMeta;
|
|
116
|
+
new_session_id: string;
|
|
117
|
+
};
|
|
118
|
+
attachEvidence(sessionId: string, params: {
|
|
119
|
+
label: string;
|
|
120
|
+
content: string;
|
|
121
|
+
content_type?: string;
|
|
122
|
+
extension?: string;
|
|
123
|
+
}): {
|
|
124
|
+
path: string;
|
|
125
|
+
meta: SessionMeta;
|
|
126
|
+
};
|
|
127
|
+
escalateToOperator(sessionId: string, params: {
|
|
128
|
+
reason: string;
|
|
129
|
+
severity: "info" | "warning" | "critical";
|
|
130
|
+
}): SessionMeta;
|
|
131
|
+
sweepIdle(idleMs: number, outcome?: "aborted" | "max-rounds", reason?: string): SessionMeta[];
|
|
132
|
+
pruneCorruptSessions(minAgeMs: number): {
|
|
133
|
+
scanned: number;
|
|
134
|
+
removed: number;
|
|
135
|
+
kept: number;
|
|
136
|
+
};
|
|
137
|
+
sweepOrphanTmpFiles(): {
|
|
138
|
+
scanned: number;
|
|
139
|
+
removed: number;
|
|
140
|
+
};
|
|
141
|
+
clearStaleInFlight(): {
|
|
142
|
+
scanned: number;
|
|
143
|
+
cleared: number;
|
|
144
|
+
};
|
|
145
|
+
abortStaleSessions(staleHours?: number): {
|
|
146
|
+
scanned: number;
|
|
147
|
+
aborted: number;
|
|
148
|
+
};
|
|
149
|
+
}
|