Yearly forecast: solar return, transits, progressions, profection, eclipses
- astro-engine: forecast module (solar return moment, slow-planet transits
with exact dates and periods, natal house ingresses, secondary
progressions, annual profection, eclipses via Swiss Ephemeris)
- horoscope-api: POST /v1/forecast, solar return chart cast for the place
of the birthday
- backend: forecasts table, /v1/charts/{id}/forecasts, /v1/forecasts/{id}
and its analyses using a new 'forecast' unit; current year of life open,
the next one 30 days before the birthday
- packages: Páros and Család include forecasts (6 000 / 11 000 Ft),
+1 éves előrejelzés add-on 2 500 Ft; Egy elemzés unchanged
- worker and prompt: forecast kind with five sections and forecast rules
(trends, no event predictions); no birth data, place or exact age sent
- frontend: /kepletek/{id}/elorejelzes with the solar return wheel, the
keys of the year, a monthly timeline, transit list and detailed forecast
- data export: forecasts added, model name removed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -34,6 +34,7 @@ pub struct Job {
|
||||
pub kind: String,
|
||||
pub chart_id: Option<Uuid>,
|
||||
pub synastry_id: Option<Uuid>,
|
||||
pub forecast_id: Option<Uuid>,
|
||||
pub language: String,
|
||||
pub model: String,
|
||||
pub prompt_version: String,
|
||||
@@ -78,7 +79,7 @@ impl Analyzer {
|
||||
"UPDATE analyses SET status = 'running', started_at = now(), attempts = attempts + 1 \
|
||||
WHERE id = (SELECT id FROM analyses WHERE status = 'pending' AND next_attempt_at <= now() \
|
||||
ORDER BY next_attempt_at LIMIT 1 FOR UPDATE SKIP LOCKED) \
|
||||
RETURNING id, kind, chart_id, synastry_id, language, model, prompt_version, attempts",
|
||||
RETURNING id, kind, chart_id, synastry_id, forecast_id, language, model, prompt_version, attempts",
|
||||
)
|
||||
.fetch_optional(&self.db)
|
||||
.await?;
|
||||
@@ -95,6 +96,7 @@ impl Analyzer {
|
||||
let text = match kind {
|
||||
Kind::Natal | Kind::Summary => self.natal_text(job.chart_id).await?,
|
||||
Kind::Synastry => self.synastry_text(job.synastry_id).await?,
|
||||
Kind::Forecast => self.forecast_text(job.forecast_id).await?,
|
||||
};
|
||||
let (base, revision) = prompt::split_version(&job.prompt_version);
|
||||
if base != PROMPT_VERSION {
|
||||
@@ -138,6 +140,19 @@ impl Analyzer {
|
||||
Ok(compact::synastry(&chart1, &chart2, &result))
|
||||
}
|
||||
|
||||
/// The compact text of a stored forecast with its natal chart.
|
||||
async fn forecast_text(&self, forecast_id: Option<Uuid>) -> Result<String, LlmError> {
|
||||
let (result, chart): (Value, Value) = sqlx::query_as(
|
||||
"SELECT f.result, c.result FROM forecasts f JOIN charts c ON c.id = f.chart_id WHERE f.id = $1",
|
||||
)
|
||||
.bind(forecast_id)
|
||||
.fetch_optional(&self.db)
|
||||
.await
|
||||
.map_err(|e| LlmError::Transient(format!("database: {e}")))?
|
||||
.ok_or_else(|| LlmError::Permanent("the forecast was deleted".into()))?;
|
||||
Ok(compact::forecast(&chart, &result))
|
||||
}
|
||||
|
||||
/// Takes the oldest waiting prompt test run, if any.
|
||||
pub async fn claim_preview(&self) -> Result<Option<PreviewJob>, sqlx::Error> {
|
||||
let job: Option<PreviewJob> = sqlx::query_as(
|
||||
|
||||
Reference in New Issue
Block a user