6e05e0ff7c
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
48 lines
2.7 KiB
Markdown
48 lines
2.7 KiB
Markdown
# felhom.eu — task reports
|
|
|
|
> **Overwrite** this file with a summary of the most recent task only (uniform with the other repos; not cumulative). The cumulative hub history lives in [hub/CHANGELOG.md](hub/CHANGELOG.md).
|
|
|
|
---
|
|
|
|
# REPORT — Hub: ingest agent `storage_targets` (v0.7.2) (2026-06-09)
|
|
|
|
## Outcome
|
|
|
|
**Code committed + pushed (changelogged as `v0.7.2`); image build/deploy deferred.** The
|
|
felhom-agent slice-5 Phase A work populates the host-report's `storage_targets` (previously a
|
|
defined-but-empty stub). This change is the hub half: accept and persist them. Deliberately
|
|
minimal — the authoritative storage manifest (desired class/role/policy/creds) is hub-owned and
|
|
arrives at slice 10; this slice only mirrors what the agent observes.
|
|
|
|
> **Deploy note:** the live hub is **v0.6.3**, behind the changelog (v0.7.0/v0.7.1 were
|
|
> committed but appear undeployed). Building+deploying v0.7.2 would also ship those intervening
|
|
> versions, so the deploy is deferred to an operator decision — flagged, not silently done. The
|
|
> change is backward-compatible (an agent sending `storage_targets: []` is accepted unchanged),
|
|
> so the live hub keeps ingesting host-reports fine until then.
|
|
|
|
## What landed (`hub/internal/api/handler.go`, `host_test.go`, golden)
|
|
|
|
- `hostReportPayload` now parses `storage_targets` via a `hostStorageTarget` mirror struct that
|
|
matches the agent's `hub.StorageTarget` wire contract field-for-field (name/type/durable_id/
|
|
state/reachable/usage/content/mount/class_hint/role/`thin_pool`/`smart`).
|
|
- Persistence: the targets are stored verbatim in the existing `report_json` column (no schema
|
|
change / no migration). The handler counts them and logs a `[WARN]` listing disconnected
|
|
targets — the storage analog of host-down visibility.
|
|
- The shared `testdata/host-report.golden.json` now carries two populated targets (an lvmthin
|
|
with `thin_pool`, a usb) and is **byte-identical** with felhom-agent's copy.
|
|
- Tests: `TestHostStorageTarget_GoldenContract` is the hub half of the bidirectional key-set
|
|
test (round-trips the golden through the mirror, asserts exact key match);
|
|
`TestHostReport_GoldenContract` also asserts the targets persist + parse back. `go test
|
|
./internal/api/ ./internal/store/` is green.
|
|
|
|
## Backward compatibility
|
|
|
|
An older agent that sends `storage_targets: []` (or omits the field) is accepted unchanged.
|
|
The legacy controller report path is untouched (frozen until the slice-10 cutover).
|
|
|
|
## Deploy
|
|
|
|
Standard hub flow (build server 192.168.0.180): `./build.sh v0.7.2 --push` then deploy. If the
|
|
hub deployment is ArgoCD-managed, update the image tag via the managed path rather than a bare
|
|
`kubectl set image` (drift-correction would revert it).
|