Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,11 @@ jobs:
run: >-
lockf -k -t 600 /tmp/domus-ci-entry-browser.lock pnpm --filter @domus/frontend exec playwright test
-c playwright.entry.config.ts tests/e2e/administration.spec.ts tests/e2e/tasks.spec.ts tests/e2e/workspace-navigation.spec.ts
- name: Require all sixty-four actual-image household journeys
- name: Require all sixty-six actual-image household journeys
run: >-
uv run python -c "import json; from pathlib import Path;
result=json.loads(Path('frontend/test-results/entry-results.json').read_text());
assert result['stats']['expected']==64 and result['stats']['unexpected']==0
assert result['stats']['expected']==66 and result['stats']['unexpected']==0
and result['stats']['skipped']==0 and result['stats']['flaky']==0"

- name: Retain actual-image browser evidence
Expand Down
21 changes: 21 additions & 0 deletions addon-edge/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 0.0.0-edge.55

- Align barcode HTTP validation and published API schemas with the supported printed GTIN lengths.

## 0.0.0-edge.54

- Continue keyboard focus to the current barcode result after confirmed changes and stale-removal review.
- Focus original-request recovery when an association write has an unconfirmed response.

## 0.0.0-edge.53

- Continue keyboard focus to the barcode result or retry control after a submitted search.
- Preserve focus that has moved to another control while the lookup is running.

## 0.0.0-edge.52

- Find a local household product from its printed GTIN barcode digits.
- Review a product association or removal before confirming, with current conflict recovery.
- Retain entered digits through failed reads and recover original writes after interruption.
- Migrate inventory from supported earlier schemas to schema 35. Keep the previous compatible image and cold data checkpoint for rollback.

## 0.0.0-edge.51

- Refresh the task list and selected detail together after a competing progress update.
Expand Down
19 changes: 18 additions & 1 deletion addon-edge/DOCS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Installation and operation

Edge 0.0.0-edge.51 packages the immutable runtime declared in
Edge 0.0.0-edge.55 packages the immutable runtime declared in
[artifact.json](artifact.json). Overview shows the signed-in member's completed tasks and
posted earned points for the current Family week. Open Family for the full report.
In Household settings, authorized members can preview a manual task proposal and
Expand Down Expand Up @@ -38,6 +38,23 @@ A competing update retains your proposal for **Review current task** and a
separate save. The list and selected detail refresh together after a competing
progress update. **Check saved request** recovers an interrupted progress change.

In Inventory, enter the digits below a barcode and choose **Find product**.
Keep leading zeroes. Supported GTIN values have 8, 12, 13 or 14 digits with a
valid check digit. A match offers **Open product stock**. An inventory manager
can choose a Pantry product, review its code and confirm the association.
Review and remove the current association before choosing a replacement.
Use **Retry barcode lookup** after an unavailable read or **Recover original
request** after an unconfirmed write. A submitted search continues keyboard
focus to its result or retry control when the read finishes. After a confirmed
change, focus continues to the current result. If a write reply is unconfirmed,
focus continues to **Recover original request**.

Edge.55 aligns HTTP validation and the published API shapes with the supported
printed barcode lengths. It retains schema 35 and the compatible Edge.54 data.

Edge.52 uses SQLite schema 35 and is listed in `breaking_versions`.
Keep a compatible image together with its cold schema-34 data for rollback.

Edge.47 completes explicit runtime cleanup when Home Assistant requests Stop.
Workers finish before identity disposal and installation-lease release. Standalone
shutdown reports its bounded delegated-grant cleanup result in the server log.
Expand Down
8 changes: 4 additions & 4 deletions addon-edge/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# The Supervisor builds this folder. Fetch only the reviewed immutable runtime and UI.
FROM ghcr.io/astral-sh/uv:0.11.29@sha256:eb2843a1e56fd9e30c7276ce1a52cba86e64c7b385f5e3279a0e08e02dd058fc AS uv
FROM python:3.14.6-slim-trixie@sha256:7bec7ddcddeff7975d6ba9b4be7dd6f6b2f55e7491539145e2978f7f97ce9144 AS source
ARG DOMUS_SOURCE_COMMIT=4f79b75d65835037a51b51e3742cd372bc45edfe
ARG DOMUS_SOURCE_SHA256=b57247ac5e62686f8ff42b1ac71cbcde5e47ea54ff873b543077db0102e865dc
ARG DOMUS_SOURCE_COMMIT=e8e93fe892babc0263808848c3bd24c8aea9d2c2
ARG DOMUS_SOURCE_SHA256=eca392d17f93d6eb25006b78a5690f25680b09f8c625feb0ec8093dbb7bbc4a5
ADD https://codeload.github.com/vypdev/domus/tar.gz/${DOMUS_SOURCE_COMMIT} /tmp/source.tar.gz
RUN printf '%s /tmp/source.tar.gz\n' "$DOMUS_SOURCE_SHA256" | sha256sum --check - \
&& mkdir /app \
Expand All @@ -24,9 +24,9 @@ RUN uv sync --frozen --no-dev --package domus-server --no-editable
RUN .venv/bin/python -c "from pathlib import Path; import domus; from domus.entrypoints.ui_bundle import load_bundle; assert load_bundle(Path(domus.__file__).parent / 'ui') is not None"

FROM python:3.14.6-slim-trixie@sha256:7bec7ddcddeff7975d6ba9b4be7dd6f6b2f55e7491539145e2978f7f97ce9144
ARG BUILD_VERSION=0.0.0-edge.51
ARG BUILD_VERSION=0.0.0-edge.55
ARG BUILD_ARCH
ARG DOMUS_SOURCE_COMMIT=4f79b75d65835037a51b51e3742cd372bc45edfe
ARG DOMUS_SOURCE_COMMIT=e8e93fe892babc0263808848c3bd24c8aea9d2c2
LABEL io.hass.type="app" \
io.hass.version="${BUILD_VERSION}" \
io.hass.arch="${BUILD_ARCH}" \
Expand Down
17 changes: 15 additions & 2 deletions addon-edge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,20 @@ explicit conflict review and recovery of the original progress request.
Edge.51 refreshes both the list and detail after a competing progress update and
keeps the mobile task layout within the available width.

This candidate uses SQLite schema 34. Keep a
Edge.52 finds household products from manually entered barcode digits. Inventory
managers review a local product association or its removal before confirming.
Original-request recovery and current conflict review retain the entered code.

Edge.53 continues keyboard focus to the barcode result or retry control after a
submitted search.

Edge.54 continues keyboard focus after confirmed barcode changes and moves it to
original-request recovery when a write response is unconfirmed.

Edge.55 aligns barcode HTTP validation and published API schemas with the same
supported printed lengths.

This candidate uses SQLite schema 35. Keep a
compatible image and cold data backup before upgrading a previous preview.
See [installation and operation](https://github.com/vypdev/domus/blob/ac843a9a5c23d411ff11dcbd83d32256af2f5daa/addon-edge/DOCS.md) for the source pin and rollback
See [installation and operation](https://github.com/vypdev/domus/blob/develop/addon-edge/DOCS.md) for the source pin and rollback
instructions.
36 changes: 18 additions & 18 deletions addon-edge/artifact.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"schemaVersion": 1,
"version": "0.0.0-edge.51",
"sourceCommit": "4f79b75d65835037a51b51e3742cd372bc45edfe",
"sourceArchiveSHA256": "b57247ac5e62686f8ff42b1ac71cbcde5e47ea54ff873b543077db0102e865dc",
"storageSchema": 34,
"wheelSHA256": "3fe64c5c5d4d21d6c65538f276bf18805c44d04d084db57d964599b36d48ff0f",
"version": "0.0.0-edge.55",
"sourceCommit": "e8e93fe892babc0263808848c3bd24c8aea9d2c2",
"sourceArchiveSHA256": "eca392d17f93d6eb25006b78a5690f25680b09f8c625feb0ec8093dbb7bbc4a5",
"storageSchema": 35,
"wheelSHA256": "35262f4448e6ddeee76882e6096b5f8fb666a1cbd043bdce1068f24574d284fb",
"pythonFiles": {
"domus/__init__.py": "7182c88b92234b4328f94497f4e70222d4390d8093e4b62893dfa78ac5530ac6",
"domus/application/__init__.py": "1e8c0c87bf2a8ca947112543070583c0cc55d9d40b56eab0d86ed59a4ec1e82c",
Expand Down Expand Up @@ -38,9 +38,9 @@
"domus/application/household_queries.py": "d68db5e792eaeaac07bb1dcb232f84ee573be42c071ae2e3567b32482bb4e27d",
"domus/application/household_roster.py": "32ff065c1aa94086aa0390b5c4f3834a5a2e5319f2c26bd8f20af887bf051928",
"domus/application/identity_ports.py": "aebf50fc433fa1c77bacf2bb9e35fdde8c746069b567154de01eaf9980c49075",
"domus/application/inventory.py": "0723c4697ca7668b1d3a66b33aa2fba65c0bf5179faee918b5f4a073ddfe5dc1",
"domus/application/inventory_ports.py": "b0a04487925b2714702ce2737051b334949d7df09baa1e2ae29931b4c7df3d68",
"domus/application/inventory_queries.py": "016ebd6b8d4e6db7ec2cdf478d7e71cfdc575608f4fabe7393ddc695742a2b99",
"domus/application/inventory.py": "de20d26996c091f19f96ec4b306c3395a5a4f853820b8866902c8ef8016e8c3b",
"domus/application/inventory_ports.py": "504917eaa74987f880b20402bc549832b55c440767d581e36e829390a0e3f208",
"domus/application/inventory_queries.py": "6af01b6860c1a73176bae59817b3d9e50cb9e8f6b980f6cdc8818cfae60a2ae8",
"domus/application/member_commands.py": "d3e93982d2e42d9a57771269ec0ccd4692fcd196189922bb09e7b0398b924649",
"domus/application/member_profile_access.py": "c3af66244b9b10a43848e2422f9d662390f4ffd557440d9eae0e0a45d6e4b8a4",
"domus/application/member_profile_commands.py": "cee8b699d2774056fe8620c22befb369193c2e3acec7fe861c4555540ffdbcc8",
Expand Down Expand Up @@ -112,7 +112,7 @@
"domus/domain/fold_policy.py": "fb938ee4cfae747b569a074d2be4e29ed3024012e09ef7645909a7f86122b2c4",
"domus/domain/generations.py": "bd8d665c7b6e832f881784c07475d2b8911c08d0894cf8e125681a9f27e1ba97",
"domus/domain/identity.py": "3f30a61e1de77a7457f131e8e8371b86ac2ccd3e589060429d091624ee1e75ed",
"domus/domain/inventory.py": "d2e559cfc75fbe2557b0112cd7e2b75b05ac8b8b54dff8bbea7131d7d0b98c0c",
"domus/domain/inventory.py": "2413be298a6c6d0c4413f73cf3e9fc27bc6c6a79711d352742fcd47fd36b3a8c",
"domus/domain/member_profiles.py": "2790ca55a7b37a390d006165a44520085e1ff513783b9cf1a7b681435b8ae4d2",
"domus/domain/member_sources.py": "b5e9d19d501d3d5dd5caf5b4ce945d4c3ff71b1967e92bd8933f26661a416c01",
"domus/domain/nominal_recurrence.py": "2c3678f220a311b8b08e6cad0d146a1a68135b5fd2a5c0d8ab9ed809fe47d8c1",
Expand Down Expand Up @@ -162,11 +162,11 @@
"domus/entrypoints/household_http.py": "37e948848115bfa8714c9cccc50058389114f2e665cad965a66964b0dcd098c8",
"domus/entrypoints/http.py": "5fe33029b7ca04aae3f41fde9e8e7c517f48cff65d3cc3ac5dcb08b25a26a42b",
"domus/entrypoints/http_contract.py": "613be310d4ff6a6c7e2a699c20f1c4a142d0b34073629884e58e973c4b040039",
"domus/entrypoints/http_errors.py": "76c3905115553a1702eb7cd911a5f8ca0b2ed1c8a7b42b6ba0420ca96752e36f",
"domus/entrypoints/http_errors.py": "c4f3d19889750bca29a13aee7528299883782e50a5ae3378e691d79e8faf7ded",
"domus/entrypoints/ingress_boundary.py": "1aa1d684b8625464b5d36d272f71d94b4cd32b84819ff8765a821c9a722f8f28",
"domus/entrypoints/ingress_http.py": "f6557eb5481d132131f66ad7691e30c223c63a66a6f0ae5754c9fba3bc7f3626",
"domus/entrypoints/inventory_http.py": "a58e114de6ff684f6d7d1a93f7f4cb316b8ffa60b0c662733df2c1fd70c2ab6e",
"domus/entrypoints/native_http.py": "75a7d8c15afaa9ce82e627daa561a76e216546f627319563e032a770dc8d7fdc",
"domus/entrypoints/inventory_http.py": "719e2c3a0d70a42cb4b3c42f8941841ea8e87ca5745c3fba94657226390142b3",
"domus/entrypoints/native_http.py": "6c4471c6468b64d9f38e1c74e0338fae9eaf0dbbf73ba8b93a9f868317a220fc",
"domus/entrypoints/openapi.py": "01a3fab9e5890ebcc1fb9c70bce9ced43d45b9190afd134db7dd45e0c5eb28f1",
"domus/entrypoints/point_allocation_http.py": "7339c88c083206c0778885b55793c80af219b15af7004c5a51d34dbc28f4da5c",
"domus/entrypoints/recurrence_dto.py": "094e6f64e1f963bfb053e830b214eed1189258e4f0eb8ff15ddba1f059649a1a",
Expand Down Expand Up @@ -197,15 +197,15 @@
"domus/infrastructure/recurrence_worker.py": "23f76be62ed3ce5ddd557338d7e553d818001f1b3083e6e2f17b1e53723297b0",
"domus/infrastructure/restore_source.py": "71917a2db52f5f6794504fd8caa7fd23b0732e8328760c728ea3f082acd2d203",
"domus/infrastructure/session_access.py": "1e8bc8d44b60d985da7b44d7bb75fd21bb05f3a45ec38dc7031eff1a2709197d",
"domus/infrastructure/sqlite.py": "25b78ac319fc05f089b87a2484120a57cfc9aaff227a35557895bd9db6893729",
"domus/infrastructure/sqlite.py": "fe8fc5fb8bf95bf11940302b91ed314e622c9e0ba60c2f8806403f43af6ebc1e",
"domus/infrastructure/sqlite_activation.py": "eabd490e86eab9dec76104d7d65c687133b8768a0ec8679e6cca97ba8616ded2",
"domus/infrastructure/sqlite_automation_controls.py": "8f783d8475a1a16d470ad7c15cb3576e1b60e2176724ecba68634bee8e68366c",
"domus/infrastructure/sqlite_automation_drafts.py": "5d56d727bc1653110944946a5159b72ea6310ad993427fbe6667667ec71d3986",
"domus/infrastructure/sqlite_calendar.py": "ad71b0ee9398131664662531b262da00ec6be312e068a97ef9c3a92172c7c80e",
"domus/infrastructure/sqlite_calendar_preferences.py": "0e10804e9571a885518868b5bcbb69ad4eb1d006cafc33bf8b563e7067e69a4e",
"domus/infrastructure/sqlite_history.py": "e7f8d4f2b79aed851a4056364f67d1c7806c52d011b46c597968bea86dd1d144",
"domus/infrastructure/sqlite_identity.py": "2c07453984455a45f0ef6cd7bac775e1ad3673b8e8a3e450d419df5591f2beeb",
"domus/infrastructure/sqlite_inventory.py": "ca2166eb4c8f5cdf6c0ffbf2a3dd2518af2df2842299355fadefe25b172d6fbe",
"domus/infrastructure/sqlite_inventory.py": "df5f764b7fbcb4ee4f5e6742a8b34e1207063e1003418daf696abf14876a7fe3",
"domus/infrastructure/sqlite_member_profile_schema.py": "88ed7ea8572f3e625d1ca8f114a750fbea02fc4ffe165fe12bc4d68307f7764c",
"domus/infrastructure/sqlite_member_profiles.py": "db7be5e4209d408f2fd780f684ba3a0a76267347fd2cbc0521a33c06e5453ec5",
"domus/infrastructure/sqlite_point_allocations.py": "e1aa5075544bf5faf16dac92fc0655c82fc65a3b5495fc916dc33769168c8bd5",
Expand All @@ -223,7 +223,7 @@
"domus/infrastructure/sqlite_restoration.py": "2f28207974082bdee48d72afdca08956e077b957377b1a2894b3eb6f4e6c224a",
"domus/infrastructure/sqlite_rewards.py": "91a9d549198d523d5cd12beefa31cc2d947dc9fe55af245c8cb12017ff1cad5d",
"domus/infrastructure/sqlite_shopping.py": "521e335ae6419f6cd1ee8286c3c6689932ae06330ef370a666581ec915b29688",
"domus/infrastructure/sqlite_snapshots.py": "f500fd2566010fc52168a5482fd9c496ffe758e75e7f4a953bb4bef11d91eedf",
"domus/infrastructure/sqlite_snapshots.py": "54c0499faa5bef6d2230c26760e1a8e09a7c9ab75fe50370ff28b23d0f049eda",
"domus/infrastructure/sqlite_task_categories.py": "88adfacc0cbb4408ae902f0dceb4db8cf138073e98314a92fb85d881184e2e3d",
"domus/infrastructure/sqlite_task_history.py": "d701c2ce24f8116976b524130dfd6406f0419144b9b68fed7341f18929f77aaf",
"domus/infrastructure/sqlite_task_integrity.py": "982435ff6b6742506c98204292893744aff7b1d64645762eba131e7951e4d09c",
Expand All @@ -239,9 +239,9 @@
"domus/infrastructure/task_materials.py": "d5d2934e36f290c7bf44b473392f014eab8749f1f3b3d26a3402079e65d2818f"
},
"uiFiles": {
".vite/manifest.json": "5cc6cb5d72390640c8e281eba20c9ff8c782c7f5c6e103ff39a6257fde28b74b",
".vite/manifest.json": "d0c30babfcbb32c3d008981d04c56745d8be171fdfff8724137a3bed98732ba8",
"assets/index-CjJnHZzV.css": "0f2c8c2e31576c0b64fe60373150f09390dafb896df6c07777b2a220ad430e48",
"assets/index-lAPOs-kN.js": "1696cc56f023da1760f9147d175e64caa65baa08be89024a85761776b88b38ff",
"index.html": "c9110bf2ef5b3294a64e67513f27b7f5baee3a999344590d479c5b15ff95ac33"
"assets/index-DOg1mB8K.js": "d6231483e8ba95c3eecfd923c04c8abafadcd7c15ce146cbb50bdcadcededfd6",
"index.html": "9a0eb467ea4afb8ab10d3df9ffcf4d2b31b188c6ec6e5d3c20206d86224ee9b7"
}
}
3 changes: 2 additions & 1 deletion addon-edge/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Domus Edge
version: "0.0.0-edge.51"
version: "0.0.0-edge.55"
slug: domus_edge
description: Development preview of the local Domus household application
url: https://github.com/vypdev/domus
Expand All @@ -19,6 +19,7 @@ breaking_versions:
- "0.0.0-edge.33"
- "0.0.0-edge.38"
- "0.0.0-edge.42"
- "0.0.0-edge.52"
init: true
timeout: 30
backup: cold
Expand Down
32 changes: 32 additions & 0 deletions backend/src/domus/application/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
MAX_NAMED_LOCATIONS,
MAX_STOCK_UNITS,
PANTRY,
BarcodeAssociation,
BaseUnit,
CatalogProduct,
EffectKind,
Expand All @@ -26,6 +27,7 @@
StockMovement,
StockTransfer,
StorageLocation,
canonical_gtin,
stock_quantity,
stock_units,
validate_location_name,
Expand Down Expand Up @@ -141,6 +143,8 @@ def settle(self, request: MaterialPostingRequest) -> InventoryMaterialResult:

class CatalogAction(StrEnum):
REGISTER = "inventory.register-product"
LINK_BARCODE = "inventory.link-barcode"
REMOVE_BARCODE = "inventory.remove-barcode"
ADD_LOCATION = "inventory.add-location"
TRANSFER = "inventory.transfer"
INTAKE = "inventory.intake"
Expand Down Expand Up @@ -328,6 +332,34 @@ def apply(unit: UnitOfWork, member: str, command: CommandKey) -> JsonDocument:

return self._execute(CatalogAction.ADD_LOCATION.value, key, payload, apply)

def link_barcode(self, key: str, barcode: str, product_id: str) -> Receipt:
canonical = canonical_gtin(barcode)
validate_identifier(product_id)
payload = JsonDocument.from_value({"barcode": canonical, "product_id": product_id})

def apply(unit: UnitOfWork, member: str, command: CommandKey) -> JsonDocument:
stock = unit.inventory
self._product(stock, product_id)
if stock.barcode(self.household_id, canonical) is not None:
raise Conflict("inventory_barcode_linked")
association = BarcodeAssociation(canonical, self.identifiers.new(), product_id)
stock.link_barcode(self.household_id, association)
return JsonDocument.from_value(asdict(association))

return self._execute(CatalogAction.LINK_BARCODE.value, key, payload, apply)

def remove_barcode(
self, key: str, barcode: str, product_id: str, association_id: str
) -> Receipt:
association = BarcodeAssociation(canonical_gtin(barcode), association_id, product_id)
payload = JsonDocument.from_value(asdict(association))

def apply(unit: UnitOfWork, member: str, command: CommandKey) -> JsonDocument:
unit.inventory.remove_barcode(self.household_id, association)
return payload

return self._execute(CatalogAction.REMOVE_BARCODE.value, key, payload, apply)

def transfer(
self, key: str, product_id: str, source: str, destination: str, quantity: MaterialQuantity
) -> Receipt:
Expand Down
4 changes: 4 additions & 0 deletions backend/src/domus/application/inventory_ports.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Protocol

from domus.domain.inventory import (
BarcodeAssociation,
CatalogProduct,
InventoryEffect,
ReplenishmentPolicy,
Expand All @@ -23,6 +24,9 @@ class LedgerEntry:


class InventoryRecords(Protocol):
def barcode(self, home: str, barcode: str) -> BarcodeAssociation | None: ...
def link_barcode(self, home: str, value: BarcodeAssociation) -> None: ...
def remove_barcode(self, home: str, value: BarcodeAssociation) -> None: ...
def add_product(self, home: str, product: CatalogProduct) -> None: ...
def product(self, home: str, product_id: str) -> CatalogProduct | None: ...
def products(self, home: str, after: str, limit: int) -> tuple[CatalogProduct, ...]: ...
Expand Down
Loading