Skip to content

Add per-field metadata to apl-feed apply and feed.meta.json sidecar#77

Merged
d4rken merged 2 commits into
devfrom
feat/apl-feed-apply-per-field-metadata
May 12, 2026
Merged

Add per-field metadata to apl-feed apply and feed.meta.json sidecar#77
d4rken merged 2 commits into
devfrom
feat/apl-feed-apply-per-field-metadata

Conversation

@d4rken

@d4rken d4rken commented May 12, 2026

Copy link
Copy Markdown
Member

apl-feed apply --json now accepts an object-form value {value, edited_at, edited_by} alongside the existing bare-string form. When provided, the tuple is atomically written to /etc/airplanes/feed.meta.json under the same lock as feed.env, for LATITUDE, LONGITUDE, ALTITUDE, MLAT_USER, MLAT_ENABLED, and MLAT_PRIVATE. Bare-string writes to those fields default-stamp edited_by=feeder; a bootstrap migration seeds the sidecar with edited_by=legacy on existing installs.

The wire contract is additive — every existing caller continues to work without sending the new shape; metadata stamping is opt-in per request.

d4rken added 2 commits May 12, 2026 23:39
apl-feed apply --json gains an additive object-form value: {value, edited_at, edited_by}. When provided, the tuple is atomically written to /etc/airplanes/feed.meta.json under the same lock as feed.env, for the six remote-config fields (LATITUDE, LONGITUDE, ALTITUDE, MLAT_USER, MLAT_ENABLED, MLAT_PRIVATE). Bare-string writes to those fields default-stamp edited_by=feeder. A bootstrap migration seeds the sidecar with edited_by=legacy on existing installs.
…subset

Reject .updates keys containing non-[A-Za-z0-9_] characters before splitting to KEY=value pairs (a crafted key with an embedded newline or '=' could have injected a second pair). Reject sidecar writes when feed.meta.json already exists as a directory (mv -f would otherwise silently move the temp file into it). Refuse INCOMING_META entries whose key is not in the payload, so a stale global cannot rewrite metadata for an unrelated field. Tailor the sidecar-write failure warning to whether feed.env was updated.
@d4rken d4rken merged commit b05cf57 into dev May 12, 2026
12 checks passed
@d4rken d4rken deleted the feat/apl-feed-apply-per-field-metadata branch May 12, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant