# Changelog of Philippine Hazards: PAGASA Weather + PHIVOLCS Earthquakes (`a-g-d/ph-hazards`) Actor

- **URL**: https://apify.com/a-g-d/ph-hazards/changelog.md
- **Full Actor documentation**: https://apify.com/a-g-d/ph-hazards.md

## Changelog

All notable changes to this project are documented here. The format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project adheres to
[Semantic Versioning](https://semver.org/).

### \[0.2.3] - 2026-09-26

#### Changed

- The README is now purely the public Apify Store page: build, test and schema notes moved
  to `DEVELOPMENT.md`, and field documentation points to the Store's Output tab instead of
  files in the (private) repository.
- The User-Agent's contact link is the public Store page (https://apify.com/a-g-d/ph-hazards) instead of the
  private repository.

### \[0.2.2] - 2026-09-24

#### Changed

- Earthquakes are stored and charged as one batch with
  `Actor.pushData(items, 'earthquake-record')`: the SDK trims the batch to what the
  spending limit covers, stores it in one request, then charges the stored count in one
  more. 0.2.1 made two API calls per earthquake, so a 63-earthquake cloud run took 16-93 s
  and one capped run stalled on a single call until it timed out; batched, the same run
  takes about 5 s. Billing is unchanged: every stored earthquake is charged, nothing else,
  and a capped run keeps the most recent earthquakes that fit (#7).
- The actor's Console default run options are now 256 MB and a 300 s timeout (they were
  4096 MB and 3600 s). Events-only pricing leaves platform costs with the developer, so
  the defaults stay small.

### \[0.2.1] - 2026-09-24

#### Fixed

- A run stopped by the user's spending limit no longer bills an earthquake it does not
  deliver. Earthquakes were charged before they were pushed, and the run stopped as soon as
  the SDK reported the limit. The SDK reports the limit after a successful charge, so the
  last paid earthquake was never stored. Earthquakes now go through
  `Actor.pushData(item, 'earthquake-record')`, which stores each item before charging it
  (#5).
- A source the spending limit cannot cover is now skipped before it is fetched.

#### Changed

- Run starts are billed by Apify's synthetic `apify-actor-start` event instead of the
  custom `actor-start` event. Apify charges it and covers the first 5 s of compute. The
  code no longer charges `actor-start`, so that event must not be configured in Console.
- SDK wiring moved from `main.ts` to `src/platform.ts` (`createPlatformDependencies`), so a
  test can drive the real SDK charging in its local pay-per-event mode.

### \[0.2.0] - 2026-09-23

#### Added

- Apify output schema (`.actor/output_schema.json`) so the actor is Store-ready, pointing
  agents at the `earthquakes` and `weather` dataset outputs with descriptions written for
  AI consumers.
- Dataset schemas (`.actor/earthquakes_dataset_schema.json`,
  `.actor/weather_dataset_schema.json`) with per-field `title`/`description`/`example` and
  an "Overview" view each. Their `fields` are JSON Schema draft-07 (the draft Apify
  validates dataset items against), generated from the zod schemas via `z.toJSONSchema`
  (`pnpm run schemas:generate`), with tests that fail on drift and that replay Apify's
  `.actor` schema validators and AJV item validation offline.
- `weatherSnapshotSchema` and the `weather` alias dataset for the nested per-run snapshot.

#### Changed

- Split output into two datasets: PHIVOLCS earthquakes stay in the `default` dataset (one
  item per earthquake), while PAGASA now writes exactly one nested snapshot per run to the
  `weather` alias dataset (`Actor.openDataset({ alias: 'weather' })`). The snapshot keeps
  `source`, `fetchedAt` and `sourceUrl` once at the top level and nests the bulletin
  status, tropical cyclones, forecasts, wind/coastal rows, temperature/humidity and
  tides/astronomy instead of repeating provenance per row.
- Extracted the run orchestration into `runActor` (dependency-injected) so dataset routing
  is unit-tested without the network.

Input, the pay-per-event names (`actor-start`, `weather-snapshot`, `earthquake-record`)
and their charge points, `limited` permissions and no-Standby behaviour are unchanged.

### \[0.1.0] - 2026-09-22

#### Added

- PAGASA `/weather` parser producing `tropical_cyclone`, `weather_forecast`,
  `wind_coastal`, `temperature_humidity` and `tides_astronomy` items.
- PAGASA Severe Weather Bulletin status parser producing `tc_bulletin_status`
  (active flag, headline and bulletin PDF URL when present).
- PHIVOLCS earthquake parser producing `earthquake` items with Manila-time
  timestamps, numeric fields and normalised detail links, filtered by
  `minMagnitude`, `sinceHours` and `maxEarthquakes`.
- Bundled GlobalSign RSA OV SSL CA 2018 intermediate so PHIVOLCS verifies without
  disabling TLS checks.
- Pay-per-event charging (`actor-start`, `weather-snapshot`, `earthquake-record`)
  guarded for non-PPE runs.
- zod output schema with exported TypeScript types, fixture-based unit and
  integration tests, CI workflow and pre-commit hook.
