Comparisons (synastry) of the own chart and persons
CI / test (push) Successful in 45s
CI / build (push) Successful in 4m19s
CI / deploy (push) Skipped

/osszevetesek compares any two of the user's charts (own and persons); the
person card and the person's chart page have "Összevetés velem". The
comparison page shows a double wheel (first person inside with houses, second
outside, aspects between them), the aspects by character, and tabs: paid
relationship analysis (synastry unit), the cross aspect grid, house overlays,
composite and the full aspect list.

Correcting a person within the hour now deletes the user's own comparisons
with them instead of being refused; still refused after a paid analysis or
when someone else's comparison uses the chart.

The relationship analysis prompt is editable on /admin/promptok too, and can be
tried on one of the admin's comparisons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-17 16:04:44 +00:00
co-authored by Claude Opus 5.5
parent b77dafdb26
commit 0bd5c39080
27 changed files with 1541 additions and 146 deletions
+20
View File
@@ -0,0 +1,20 @@
import type { ChartListItem, Synastry, SynastrySide } from "./types";
/** Short name of one side of a comparison: "Én" for the own chart. */
export function sideName(side: { label: string; is_primary?: boolean }): string {
return side.is_primary ? "Én" : side.label;
}
/** Whether a side's birth time is known (another user's chart has fewer fields). */
export function sideTimeKnown(side: SynastrySide): boolean {
const chart = side.chart as SynastrySide["chart"] & { time_known?: boolean };
return side.highlights?.time_known ?? chart.time?.time_known ?? chart.time_known ?? false;
}
/** Name of a chart in the comparison list, from the user's chart list. */
export function listName(ref: { id: string; label: string }, charts: ChartListItem[]): string {
const chart = charts.find((c) => c.id === ref.id);
return chart ? sideName(chart) : ref.label;
}
export type { Synastry };
+64 -2
View File
@@ -124,6 +124,67 @@ export interface ChartListItem {
created_at: string;
}
/** An aspect between a point of the first chart and one of the second. */
export interface InterAspect {
person1: string;
person2: string;
aspect: string;
nature: "harmonious" | "challenging" | "neutral";
major: boolean;
orb: number;
max_orb: number;
}
export interface HouseOverlay {
point: string;
sign: string;
house: number;
}
export interface SynastryResult {
aspects: InterAspect[];
house_overlays: {
/** The first person's points in the second person's houses (null: second time unknown). */
person1_in_person2: HouseOverlay[] | null;
person2_in_person1: HouseOverlay[] | null;
};
summary: {
aspect_count: number;
by_nature: { harmonious: number; challenging: number; neutral: number };
by_aspect: Record<string, number>;
};
composite: {
method: string;
points: ChartPoint[];
angles: Record<string, Position> | null;
houses: { cusps: (Position & { house: number })[] } | null;
aspects: Aspect[];
};
warnings: string[];
}
/** One side of a comparison: the full chart when it is the viewer's own. */
export type SynastrySide = Chart & { owned: true };
export interface Synastry {
id: string;
owned: boolean;
chart1: SynastrySide;
chart2: SynastrySide;
synastry: SynastryResult;
created_at: string;
}
/** A comparison in the list (`GET /v1/synastries`). */
export interface SynastryListItem {
id: string;
owned: boolean;
chart1: { id: string; label: string; owned: boolean };
chart2: { id: string; label: string; owned: boolean };
summary: SynastryResult["summary"] | null;
created_at: string;
}
export interface Analysis {
id: string;
kind: "natal" | "synastry" | "summary";
@@ -149,7 +210,7 @@ export interface AdminUser {
analyses_left: UnitBalance;
}
export type PromptKind = "summary" | "natal";
export type PromptKind = "summary" | "natal" | "synastry";
export interface PromptRevision {
id: number;
@@ -179,7 +240,8 @@ export interface AdminPrompt {
export interface PromptPreview {
id: string;
kind: PromptKind;
chart_id: string;
chart_id: string | null;
synastry_id: string | null;
language: string;
model: string;
status: "pending" | "running" | "done" | "failed";