Home / Market / weather data lifecycle management

weather data lifecycle management

Manage ownership, retention, and cleanup of downloaded weather data across one-shot jobs, interactive viewers, caches, failures, and cancellation.

skill★ 508430 dlgithubCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

--- name: weather-data-lifecycle-management description: "Manage ownership, retention, and cleanup of downloaded weather data across one-shot jobs, interactive viewers, caches, failures, and cancellation." category: data risk: safe source: self source_type: self date_added: "2026-09-24" author: ShianMike tags: [weather, data-lifecycle, cleanup, caching, desktop-apps] tools: [claude, cursor, gemini, codex]

---

Weather Data Lifecycle Management

Overview

Keep downloaded and derived weather data for exactly as long as its consumer needs it. Make ownership explicit so one-shot jobs clean promptly, interactive views retain their inputs until close, and shared caches are never deleted as request cleanup.

This skill governs lifetime and ownership. It does not choose a provider, decode scientific data, or define a cache eviction policy by itself.

When to Use This Skill

stage.

Classify Every Path

Assign each file or directory one owner and one lifetime:

| Class | Owner | Delete when | | --- | --- | --- | | Request workspace | One operation | Operation finishes or fails after durable outputs are saved | | Interactive-session data | Viewer or session | Final consumer closes or display creation fails | | Shared cache | Cache manager | Explicit eviction policy permits it | | User export | User | Never as automatic request cleanup | | Partial file | Active writer | Failure, cancellation, or successful atomic promotion |

If ownership cannot be stated, do not delete the path. Resolve ownership first.

One-Shot Workflow

Use a request-specific temporary directory, keep all transient downloads and intermediate products inside it, and copy or atomically move only the requested artifact to its durable destination.

from pathlib import Path
from tempfile import TemporaryDirectory


def render_once(destination):
    destination = Path(destination)
    destination.parent.mkdir(parents=True, exist_ok=True)

    with TemporaryDirectory(prefix="weather-job-") as workspace:
        workspace = Path(workspace)
        source = fetch_into(workspace)
        temporary_output = render(source, workspace / "result.png")
        temporary_output.replace(destination)

    return destination

The final artifact must live outside the temporary directory. If replacement across filesystems is not atomic, copy to a temporary file beside the final destination, verify it, then replace locally.

Interactive Workflow

An interactive consumer outlives the worker that created its data. Transfer ownership only after the viewer or session is successfully created:

  1. The worker owns the request workspace during acquisition.
  2. If acquisition or display creation fails, the worker cleans it immediately.
  3. On successful display, attach one idempotent cleanup callback to the real

consumer close or destroyed event.

  1. The consumer becomes the owner; the worker must not also delete the data in

its ordinary finally path.

  1. If multiple consumers share the same data, release it only after the final

lease closes.

Do not tie cleanup to a temporary dialog, local variable, or signal that can fire before the actual consumer is finished.

Failure and Cancellation Rules

be mistaken for valid data.

was successfully transferred.

work.

parent directories.

Shared Cache Boundary

filename guesswork inside request code.

other.

Verification Checklist

Security & Safety Notes

selected directory as a computed fallback.

when its approved lifetime ends.

Common Pitfalls

one-shot finally path or data was written outside the request workspace.

after emitting the viewer. Transfer ownership to the viewer close event.

request-owned intermediates share a directory. Separate them.

Delegate eviction to the cache manager.

every consumer before cleanup.

Limitations

count.

inventory those outputs before promising complete cleanup.

validate the scientific contents of retained data.