v0.257.0: the app catalog can speak English (R-560, slice 5 Part A)
gates / gates (push) Successful in 25s

The READ PATH for a second language in `.felhom.yml`. An `i18n: {en: …}` sibling
block inside the same file; `Metadata.For(lang)` merges it FIELD BY FIELD over the
Hungarian, so a missing or blank English field shows the Hungarian one and a
half-translated app is a legal, shippable state.

`For("hu")` is the parsed struct with `I18n` cleared and nothing else — measured
against all 53 real catalog files, copied into `internal/stacks/testdata/catalog/`.
Lists replace whole; every other list is matched by its own key, never by position.
`For` never writes through the receiver: the metadata is the stack manager's, shared
by concurrent requests, and an in-place merge would leak one household's language
into another household's page.

Pages reach catalog copy only through `LocalizeStacks`/`LocalizeStackPtr`/`MetaFor`,
and `TestNoDirectMetaCopyReadOnPages` keeps a named, reasoned allow-list of every
direct `.Meta.<copy>` read in `internal/web` so the NEXT page to read one fails the
suite instead of quietly rendering Hungarian to an English household.

Eight red-proofs. Two of them convicted a hollow TEST rather than the code: a struct
copy shares its slices' backing arrays, so the obvious DeepEqual mutation check
passed a deliberately broken merge; and a one-entry fixture cannot tell key matching
from position matching. Both rewritten, both then seen to fail.

MinAgent: 0.131.0 (unchanged). Older controllers are unaffected — `LoadMetadata`
uses non-strict `yaml.Unmarshal`, so a pre-0.257.0 box drops the whole block.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
2026-09-20 14:31:52 +02:00
parent e81ad613ae
commit 60f0a86bd4
60 changed files with 5318 additions and 6 deletions
@@ -0,0 +1,91 @@
# =============================================================================
# .felhom.yml - App metadata for felhom-controller
# =============================================================================
display_name: "SparkyFitness"
description: "Táplálkozás- és edzéskövető"
category: "home"
subdomain: "sparky"
slug: "sparkyfitness"
# catalog_since: the date THIS repo last changed this app's pinned images. Any commit that
# changes an image: line must set this to the same day (see CLAUDE.md).
catalog_since: "2026-07-18"
resources:
mem_request: "400M"
# Sum of compose limits: db 512M + server 1024M + frontend 256M = 1792M
mem_limit: "1792M"
pi_compatible: false
needs_hdd: false
deploy_fields:
- env_var: DOMAIN
label: "Domain"
type: domain
description: "A szerver domain neve"
locked_after_deploy: true
- env_var: SUBDOMAIN
label: "Aldomain"
type: subdomain
default: "sparky"
required: true
locked_after_deploy: true
description: "Az alkalmazás aldomainje"
- env_var: DB_PASSWORD
label: "Adatbázis jelszó"
type: secret
generate: "password:24"
locked_after_deploy: true
- env_var: APP_DB_PASSWORD
label: "Alkalmazás adatbázis jelszó"
type: secret
generate: "password:24"
locked_after_deploy: true
- env_var: API_ENCRYPTION_KEY
label: "Adattitkosítási kulcs"
type: secret
generate: "hex:32"
locked_after_deploy: true
# Encrypts stored data (e.g. external-integration credentials). Must NEVER be
# regenerated after first boot — that would make existing encrypted data
# unrecoverable. At restore the controller RECOVERS (never regenerates) it.
data_key: true
- env_var: BETTER_AUTH_SECRET
label: "Munkamenet aláíró kulcs"
type: secret
generate: "hex:32"
locked_after_deploy: true
# Signs sessions and encrypts 2FA/TOTP secrets. Must NEVER change after first
# boot — changing it locks out any user who enabled two-factor auth.
data_key: true
app_info:
tagline: "Táplálkozási napló, kalóriaszámláló és edzéskövető – önállóan üzemeltetve"
docs_url: "https://github.com/CodeWithCJ/SparkyFitness"
use_cases:
- 'Napi étkezések és kalóriabevitel naplózása'
- 'Testsúly és testméretek követése grafikonokkal'
- 'Edzések és mozgás rögzítése'
- 'Tápanyag-célok (fehérje, szénhidrát, zsír) beállítása és követése'
- 'Haladás áttekintése idővonalon és statisztikákon'
first_steps:
- 'Nyisd meg a sparky.DOMAIN címet a böngészőben'
- 'Regisztrálj egy fiókot e-mail címmel és jelszóval'
- 'Állítsd be a profilodat és a napi céljaidat'
- 'Kezdd el naplózni az étkezéseidet és edzéseidet'
prerequisites:
- 'Az első indításkor a szerver lefuttatja az adatbázis-migrációkat – ez akár 1-2 percig is eltarthat, mire az alkalmazás elérhetővé válik'
# --- Controller-side health probe (same form as wger) ---
healthcheck:
checks:
- type: http
port: 80