Skip to content

heronin: the place model and species table (K2a0) - #4

Merged
foxnne merged 5 commits into
mainfrom
heronin/model-places
Nov 9, 2026
Merged

foxnne merged 5 commits into
mainfrom
heronin/model-places

Conversation

@fizzy-publish

@fizzy-publish fizzy-publish Bot commented Nov 8, 2026

Copy link
Copy Markdown

model: recognize saved places near bird photos

In plain words

Bird photos can carry their own location while keeping a separate record of where the phone was during import. Saved places now have names and boundaries, so nearby photos can be associated with a familiar place. A starter list describes twelve bird species.

What changes

  • Saved places carry a name, location, and radius.
  • Photos keep their own GPS separate from the phone position recorded during import.
  • Location labels use the nearest saved place covering the photo, or “Unnamed place” when none covers it.
  • Twelve species are available through one lookup.
pub fn placeLabel(photo: model.Photo, saved: []const model.Place) ?[]const u8 {
    const point = photo.place orelse return null;
    return if (namedPlace(point, saved)) |place| place.name else "Unnamed place";
}

What you will notice

Nothing visible: internal. This prepares named photo locations and species information for later screens and import work.

How we know it works

Tests check measured distances, crossing the date line, radius boundaries, nearest-place selection, all three location-label outcomes, JSON preservation, and twelve unique species. All 12 model/theme tests and all 3 public-rule tests pass. Formatting, native build, web build, and public-content checks also pass.

How this serves fizzy

Phones and tablets: keeping photo locations separate from phone positions prepares accurate location labels for mobile use.

For agents: technical summary

Goal

Provide saved named places, independent import fixes, distance and labeling helpers, and the twelve-species lookup without changing app behavior.

What changed and why

The named model module is available to the app and model tests. Place is now a saved location with an ID, name, and default 150 m radius. Photo GPS remains optional and gains an independent optional Fix. Haversine distance clamps rounding error before the inverse sine. Species lookup returns a matching value or null. New behavioral tests live in model/places_tests.zig and are imported by model/model_tests.zig.

How it was verified

All five requested gates passed. Direct execution of the generated test executables confirmed 12 model/theme tests, including the five new places/species cases, and 3 public-rule tests passed. git diff --check passed. Code changes total 62 added/deleted non-test lines against the starting HEAD, including untracked source files.

Not done / follow-ups

No views, imports, stores, network, or cluster work. The requested origin/main size comparison could not run because that ref is absent; report.md records the fallback count. This checkout contains no docs/VISION.md, so the required upstream vision anchor could not be validated locally.

Part of fizzyedit/work#1045

Signed-off-by: fizzy pop-os-codex-1 <slot+pop-os-codex-1@fizzy.invalid>
@fizzy-windows

fizzy-windows Bot commented Nov 8, 2026

Copy link
Copy Markdown

Follow-ups:
[
{
"id": "N1",
"severity": "nit",
"file": "model/places.zig",
"line": 4,
"added": true,
"text": "distanceM, namedPlace and placeLabel have no doc comments. The rest of model/ documents units and semantics: say metres, that haversine uses R = 6371008.8, that a radius is inclusive and the nearer place wins, and that the fallback label is "Unnamed place"."
}
]

Signed-off-by: fizzy pop-os-codex-4 <slot+pop-os-codex-4@fizzy.invalid>
@fizzy-windows

fizzy-windows Bot commented Nov 8, 2026

Copy link
Copy Markdown

Follow-ups:
[
{
"id": "N1",
"severity": "nit",
"file": "model/model.zig",
"line": 1,
"added": false,
"text": "The file header still says 'Types and doc comments only: no logic beyond the md5 JSON hooks'. It now re-exports places, which has logic, so the header should mention that."
},
{
"id": "N2",
"severity": "nit",
"file": "model/model.zig",
"line": 6,
"added": true,
"text": "The Fix doc comment could say that K3 fills it, as the spec does. Currently it says only 'fixtures leave this null'."
}
]

fizzy-pm Bot and others added 3 commits November 8, 2026 12:42
@foxnne
foxnne merged commit 81dc876 into main Nov 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant