Nhật ký thay đổi

Những gì mỗi bản phát hành đã thêm, sửa và giới hạn.

Sửa trang này trên GitHub · Nguồn: CHANGELOG.md

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased#

[1.17.0] - 2026-11-27#

The agentic layer is complete. Agents now hand work to staff, plan the season, and can run approved kinds of work on their own inside hard limits, with a stop button and a full audit trail. A manager can ask for a new mini-app in chat and an AI builds it behind seven gates. Everything a role can do on the web can now be done through the Telegram bot: in chat, by voice, or in the Mini App.

Added#

  • Agentic layer milestone M10: staff tasks (platform/agent, apps/web, apps/staff-desktop):
  • 05:50 tasks. Agent A8 proposes up to 10 staff tasks from the work approved in the last 24 hours: picking after an approved harvest, a disease inspection, watering when the soil is dry. It suggests the person with the fewest open tasks and uses no model.
  • Hand-over. An approved task waits as "Đã gửi app nhân sự". The staff app pulls it every minute, creates the task and reports its id back.
  • Head count. The staff app reports who is present today, and the daily campaign uses that number for its people limit.
  • One client per cooperative. ./dxos staff enable <HTX> creates the client and prints what to enter in the staff app. Staff desktop 1.4.0.
  • Agentic layer milestone M6: Telegram Mini App (apps/web, platform/telegram):
  • Mở ứng dụng. The bot's menu button opens the web inside Telegram when the web has an HTTPS address (DXOS_WEB_PUBLIC_URL). Without HTTPS the button is not set and chat works as before.
  • Sign-in. A person signs in with Keycloak inside Telegram once. The web then ties the Telegram account to the session only when initData has a valid signature, is under 24 hours old and names the linked account.
  • Buttons in chat. Sửa on a farmer's journal card opens the form already filled in, and Mở chi tiết opens a high-risk proposal.
  • Agentic layer milestone M12: autonomous mode (apps/web, platform/agent, platform/telegram):
  • Off by default. A manager turns it on in the AI settings after signing in again within 5 minutes and accepting responsibility. The screen shown at that moment is stored in the audit log.
  • Veto window. An eligible proposal is scheduled, then runs after a wait by risk: the next cycle for low, 15 minutes for medium, 2 hours for high. Anyone who could decide it can press Chặn meanwhile.
  • Same checks. The web runs the proposal through the same use case as a human approval, under the name of the person who turned the mode on, with the channel autopilot.
  • Stops. /dung on Telegram or Dừng ngay on the web stops it. It also stops by itself when the enabler loses the manager role, when no manager has interacted for 7 days, or when a brake trips (3 failed runs in an hour, the daily cap, more than 30% blocked, or 3 times the usual number of proposals).
  • Shadow runs. In normal mode every proposal records whether it would have run, and the enable screen shows the 30-day match rate of each kind.
  • Farmers. A message sent by an automatic run says "(Tin do AI của HTX gửi)", and a household gets at most 2 automatic messages a day.
  • Agentic layer milestone M9: mini-app actions (platform/cli, platform/agent, apps/web, miniapps/tea-shop):
  • agent block in app.yaml. A mini-app declares a suggestions path and up to 10 actions. dxos validate checks the block.
  • Suggestions become proposals. The agent asks each enabled app every 30 minutes and files its suggestions as app.<app>.<action> proposals, decided like every other kind.
  • Execution. The web calls the app through the internal gateway with the client dxos-apps-actor and three headers naming the approver. The gateway strips those headers on every other route.
  • tea-shop promotions. The shop suggests a promotion for stock of 20 packs or more unsold for 21 days. promotion.create involves money, so it runs on its own only when unlocked, after a 2-hour window.
  • Agentic layer milestone M11: season plan (platform/agent, apps/web):
  • Quarterly draft. Agent A11 drafts the quarter's plan on its first day at 06:15. Targets follow fixed rules against the same quarter last year; the model only writes priorities.
  • Adoption. A manager adopts it with strategy.adopt. The daily campaign then puts work that serves a target first, and the Monday report compares real figures with last year.
  • Low targets. A plan with a target below last year carries a warning and never runs on its own.
  • Agentic layer milestone M13: mini-app factory (platform/builder, platform/agent, apps/web, platform/cli):
  • Request. A manager asks in chat ("cần app …") or at /manager/ai/apps. Agent A12 picks the cheapest answer: enable an existing app, draft a book in Sổ tự tạo, or ask up to 5 questions and write a spec for the manager to approve.
  • Build. ./dxos builder builds from the approved spec in single-use containers. The build container sees only its workspace, reaches the network through an allowlist proxy and holds no core secret. The gate container has no network.
  • Seven gates. Manifest, markup (no script, no inline style), kit, tests, dependencies, files, and a trial run with screenshots. An app gets at most 3 repair rounds.
  • Install. A passing app is tagged in its own git repository, listed in the store as "App do AI xây" for the requesting cooperative only, and installed after the manager approves miniapp.install. It runs on a private network that reaches only the gateway and the database.
  • Agentic layer milestone M15: voice messages (platform/telegram, apps/web, new service dxos-stt):
  • On the cooperative's server. A voice message of up to 60 seconds is turned into text by whisper.cpp (make up-voice). The audio stays in memory and is dropped once the text exists.
  • Confirm first. The bot answers "Em nghe được: “…”" with Đúng, Sửa and Huỷ. Only Đúng sends the sentence on, as if typed, so a write still needs its confirmation card.
  • Model choice. make stt-measure measures the word error rate of each model on the cooperative's own recordings.
  • The rest of the Telegram chat operations (apps/web, platform/telegram, Keycloak, gateway, #80):
  • Every in-chat row is served. Ten more read tools (search, certificate, soil, photo, households, members, disease reports, profile, documents, partners) and sixteen more actions with a confirmation card. Deletes, announcements, member approval and QR export take two cards. Inviting a member stays in the app, because it makes an account with a password.
  • Disease photo in chat. A farmer picks a parcel and sends a photo. The web calls the disease API with the token of its own client dxos-web-service, on a route that exists only on the internal gateway port. An officer still confirms the result.
  • Nghe. The bulletin has a Nghe button: the web reads it with Piper and the relay sends the audio file ban-tin.wav.
  • Captions and photos. A photo's caption is read as text. The photos of cancelled, replaced or expired cards are deleted.

Changed#

  • ./dxos telegram enable now also creates the client dxos-web-service and writes its secret, next to the Mini App key, into the web's roles.env. ./dxos telegram disable removes them.

Fixed#

  • A farmer with no household (apps/web). GET /api/journal answers an empty list for a farmer whose account has no household, instead of every entry the role can read.
  • Tests on the real clock (apps/web). Proposal fixtures no longer expire on a fixed date, which made the unit tests fail from 2026-11-27.
  • Throwaway test databases (platform/cli). The CLI tests remove their Postgres container with its volume, so a test run no longer leaves a volume behind.

[1.16.0] - 2026-11-26#

The agentic layer starts to plan and learn. Every morning an agent turns the open proposals into one daily campaign that a manager approves with one button. Every Monday another agent looks at how the agents did and proposes improvements, which are measured again weeks later. Outside AI clients can now connect through MCP with a person's own account, the public lot page shows when an AI decision is verified in the audit chain, and a public benchmark compares models on the agents' scenarios.

Added#

  • Agentic layer milestone M7: daily campaign (platform/agent, apps/web):
  • 06:00 campaign. At 06:00 agent A9 groups the cooperative's open proposals into one campaign of at most 15 actions, each with a measurable goal.
    • Fixed rules order the items and drop conflicts: no harvest on a parcel still in its withdrawal period, no spraying before rain, and no more work than the people available.
    • The model only writes the summary.
  • Deciding. Managers receive the campaign on Telegram (Duyệt cả chiến dịch, Xem từng mục, Bỏ chiến dịch, and /chiendich) and in a new "Chiến dịch hôm nay" panel above the AI inbox.
    • Approving the whole campaign runs every item the approver may decide.
    • High-risk items still wait for their own confirmation, and items for another role are forwarded.
  • 18:00 report. The report shows target against actual for each goal.
  • Schedule. The harvest and disease agents now run at 05:30 and 05:40, so their warnings are ready before 06:00.
  • Agentic layer milestone M8: weekly improvements and the AI tab (platform/agent, apps/web, miniapps/htx-dashboard, Hasura):
  • Weekly rules. Every Monday agent A10 looks for:
    • a warning that managers keep rejecting;
    • journal entries returned for missing information;
    • slow decisions;
    • campaign goals that keep slipping.
  • Proposals. It proposes at most five improvements as ordinary proposals:
    • agent.settings.update changes a threshold within fixed ranges, marking whether it tightens or loosens;
    • improvement.adopt covers a process note or a Monday reminder.
  • Measurement. Adopted improvements are measured again after two and four weeks, and the Monday report says whether they helped.
  • AI tab. htx-dashboard 0.3.0 adds an AI tab with each agent's approval rate, waiting time, failures and cost, read with the manager's own rights.
  • Agentic layer milestone M14: MCP, lot verification and the public benchmark (apps/web, platform/mcp, platform/agent, Keycloak, gateway):
  • MCP. A person can connect any MCP client with their own Keycloak account, through the device-login bridge platform/mcp/dxos_mcp.py and the new client dxos-mcp.
    • The client gets the assistant's read tools and one write tool, which creates a proposal that a person still has to approve.
  • Lot verification. The public lot page shows "AI đề xuất, đã duyệt ngày …, kiểm chứng trong sổ audit" only when the decision is in an intact audit chain with a matching evidence hash. It never shows a name.
  • Benchmark. make benchmark runs every agent scenario suite with a chosen model, and the results are published in docs/benchmark.md.

Fixed#

  • Proposal deletes in a campaign (platform/postgres). Deleting a proposal also removes it from campaign items, so cleanup and retention jobs no longer fail on proposals that a campaign listed.

[1.15.0] - 2026-11-26#

The agentic layer goes to work in the field and in the chat. Four new agents watch sensors and weather, disease reports, harvest readiness and the market, and propose warnings, inspections, harvest approvals and a bulletin that a person approves. The Telegram bot becomes an assistant: farmers, officers and managers ask questions, share a location, and record a journal entry with a photo from the chat, with a confirmation card before anything is written.

Added#

  • Agentic layer milestone M4: field, disease, harvest and bulletin agents (platform/agent, apps/web, Hasura): four agents per cooperative propose, and a person approves on the web or in Telegram. field-watch (every 30 minutes) warns officers about a sensor silent for 6 hours and households about dry soil, heat, frost and heavy rain forecast after a recent spraying. disease-watch (daily and on new reports) asks officers to inspect when 3 reports of one disease fall within 2 km in 7 days, and warns the households around them. harvest-ready (each morning) proposes approving the harvest of parcels past their withdrawal period and due for picking. bulletin (each morning) writes a market bulletin for the cooperative with the provider chosen in the settings. Messages to households use fixed templates with typed slots: an agent cannot add text of its own, and only the approver can add a note (spec test 32). A warning that was approved or rejected is not proposed again within 24 hours. Bulletins gain a status and a cooperative, and readers show only published ones. Thresholds are per-cooperative settings, with defaults in docs/rules-and-limits.md §3.10.

  • Agentic layer milestone M5: Telegram chat assistant (apps/web, platform/agent, platform/telegram): a linked farmer, officer or manager now uses the bot as an assistant in a private chat. A button menu by role and typed commands (/menu, /nhatky, /cho, /tomtat, /hoi, /huy) open 11 read tools (today, pending approvals, weather, market, bulletin, notifications, journal, harvest schedule, parcels, lots, and the nearest parcel from a shared location); answers come from the web's own use cases with the asker's scope, so a farmer sees only their household, and each answer names its source. Writes go through a confirmation card that expires after 10 minutes: a farmer records a journal entry with a photo using only Telegram, an officer or manager approves the pending journal backlog, and a harvest approval takes two cards. Nothing is written without Confirm. Free sentences the web's keyword router cannot place go to the new agent A7, which picks a tool or action with the cooperative's provider; the model sees only the sentence and the list of tools, never business data. The relay forwards photos and locations, each user may send 60 messages an hour, and every web route is classified for Telegram in one table checked by a test (spec test 17). Sending a disease photo from chat, the read-aloud button and the remaining chat operations follow in #80.

Fixed#

  • Random sign-outs right after sign-in (apps/web, #75): the session no longer keeps the Keycloak id token, so it fits in one cookie (3593 characters for the CI user, under the 3936 Auth.js chunk size). With two cookies, responses arriving a few milliseconds apart could leave the browser with mismatched halves and the next requests sent the user to the login page. Sign-out ends the Keycloak session with a back-channel logout using the refresh token. Sessions made before this change drop the id token on their next request.

[1.14.0] - 2026-11-25#

The agentic layer arrives. One AI agent per cooperative reviews pending journal entries and proposes; a manager or officer approves on the web or from Telegram, and every step is in the audit chain. A cooperative can switch an agent to Claude or OpenAI within a monthly budget, with personal data masked first. Staff work gains automation and AI-ranked suggestions, and a sensor station simulator joins the repository.

Added#

  • Agentic layer milestone M3: external LLM providers (platform/agent, apps/web, docker): a manager can switch each agent of the cooperative (A1 journal review, A6 digest) from the local Ollama to Claude (Anthropic) or OpenAI on a new settings page (/manager/ai/settings, read only for officers), with a confirmation that lists what leaves the server; only providers whose key the agent container holds are offered, and every change is audited. The agent calls both APIs over plain HTTP from the standard library, masks phone numbers, e-mails and identity numbers before any external call, and falls back to Ollama, then to the rules, on any failure (cut network, 5xx, timeout, refusal, malformed output; a 429 pauses the provider for at least 60 s). Runs report provider, model, tokens and estimated cost; a run that called an external provider writes one agent.external_call audit event without content. A monthly budget per cooperative warns the managers at 80% and stops external calls at 100% until the Vietnam month ends (Telegram message once per threshold and month, banner in the inbox). A6 sends the daily report at the cooperative's report time. The keys (ANTHROPIC_API_KEY, OPENAI_API_KEY, optional DXOS_ANTHROPIC_MODEL, DXOS_OPENAI_MODEL) reach only dxos-agent; a test-only LLM stub (profile llm-test) and platform/tests/smoke-llm.sh cover the path in CI.
  • Agentic layer milestone M2: Telegram (platform/telegram, apps/web, platform/agent, workflows): dxos-telegram relays Telegram updates to the web and sends what the web queues (long polling, no public address needed; idle when no bot token is set). People link their account from their profile page with a one-time code (/start <code>, /stop); a manager can link the cooperative's group for reports. Proposals reach linked approvers with Approve and Reject buttons signed by the web (callback_data HMAC, private chats only, roles re-checked with Keycloak at the moment of the tap); a rejection asks for a reason; every message of a proposal is edited to show who decided. The agent posts daily (18:00) and weekly (Monday 07:00) figures that the web renders and sends; health alerts cover stale agent or relay heartbeats, repeated agent failures and n8n failures, recorded by the new workflows/system-error-alert.json (set as errorWorkflow of every workflow). New: ./dxos telegram enable|disable, realm role telegram, tables in platform/postgres/init/09-telegram.sql, a stub Bot API and platform/tests/smoke-telegram.sh. Set TELEGRAM_BOT_TOKEN, TELEGRAM_BOT_USERNAME and, for a release, DXOS_TELEGRAM_CALLBACK_KEY in docker/.env.local.
  • Tea IoT Station (apps/tea-iot): a WPF sensor station simulator for tea hills that publishes soil moisture, soil and air temperature, air humidity and rainfall to the core broker (htx/<HTX>/plot/<parcel>/<sensor>, QoS 1, store and forward while offline), with drought, heavy rain, frost and faulty-sensor scenarios. Field alerts (dry soil, frost, heat) become task suggestions in Tea Staff Manager. apps/tea-iot/docker/mqtt-port.override.yml publishes the broker on 127.0.0.1 for local development.
  • Tea Staff Manager 1.3.0: Automation page (recurring work, cover for rejected work and approved leave, forgotten check-outs, overdue warnings, draft payroll), an explainable ranking of who fits a task shown with its facts, POST /api/iot/alerts, and Tea Work sign-in with the shared Keycloak account. Tea Work 1.2.0 documents the shared account on its sign-in screen.
  • Agentic layer milestone M1c (platform/agent, APISIX, docker/docker-compose.yml): implemented stdlib-only dxos-agent runtime modules: cross-language canonical JSON + SHA-256 evidence.py, schema-validated LLM provider abstraction with 1-retry JSON repair (ReplayProvider and OllamaProvider with >= 60s HTTP 429 backoff over dedicated APISIX route /api/internal/agent/llm/v1/chat/completions), Keycloak/Hasura/internal-API client, Agent A1 journal-review with deterministic farming hard rules (WITHDRAWAL_PERIOD, MISSING_INFO, DOSAGE, INCONSISTENT), prompt-injection resistance, rule-based fallback on LLM outage, and platform/agent/tests/scenarios/a1_journal_review.json scenario tests.
  • Agentic layer milestone M1b (dxos, Keycloak, Hasura, APISIX, apps/web): added realm role agent and ./dxos agent enable|disable <HTX> to provision/revoke per-cooperative Keycloak client-credentials clients (dxos-agent-<htx> with mode-600 runtime env files), read-only zero-PII Hasura agent permissions across cooperative tables, internal-only APISIX :9081 route /api/internal/agent/* injecting X-Dxos-Gateway after claim validation, RS256 JWKS verification + internal run/proposal ingestion routes in apps/web, Jest unit/route tests, and platform/tests/smoke-agent.sh boundary smoke checks.
  • Agentic layer milestone M1a (apps/web, platform/postgres/init/08-agent.sql): added platform.agent_runs, platform.agent_proposals (with agent_proposals_one_open partial unique index), and platform.agent_settings with row-level audit triggers; typed action catalogue (journal.approve, journal.reject), canonical evidence hashing, proposal creation and single-execution claim/decision use cases with audit trail, HTTP routes (/api/agent/proposals, /api/agent/proposals/[id]/decision, /api/journal/[id]/review), journal_entries.review_note migration, and the ProposalInbox UI at /manager/ai and /officer/ai.
  • Agentic layer milestone M0 skeletons (platform/agent, platform/telegram): stdlib-only heartbeat skeleton containers (dxos-agent, dxos-telegram) added to docker/docker-compose.yml, docker/docker-compose.release.yml, Makefile (make up-agent, stop-extras, platform-up), CI unit test jobs, and release/edge image matrices. They start and report health without running agents or connecting to Telegram yet.
  • Architecture Decision Records: ADR 0003 (agentic layer with human approval and trust-zone separation) and ADR 0004 (optional external LLM providers with local-first fallback).
  • Mini-app hub-mobile (miniapps/hub-mobile): a card in the app store and an open page (/public/<htxCode>) with the download link of the Android APK and the steps to add the web build to an iPhone home screen. Links come from HUB_APK_URL and HUB_WEB_URL; the app stores and reads nothing. The 67 MB APK itself is not in the repository.

Changed#

  • Web package version 1.14.0.
  • Agent credentials (./dxos agent enable|disable, docker/docker-compose.yml): the per-cooperative credentials now live in the dxos-agent-env volume, written by a short-lived root helper that receives them on stdin and stores them as uid 10001, so the agent can read them on Linux. Upgrade note: run ./dxos agent enable <HTX> once for every cooperative that had the agent enabled; the old files under docker/runtime/<project>/agent/ are no longer read. enable now refuses a cooperative that does not exist.
  • Agent evidence version 2 (apps/web, platform/agent): proposals carry every column the rules read (journal entry, its activities and the crop cycles compared), hashed with one canonical JSON shared by TypeScript and Python (platform/agent/tests/fixtures/evidence-vectors.json). Open proposals made with version 1 answer stale on decision.
  • Agent schedule (platform/agent): journal review runs on the first cycle, when the pending entries change, or hourly between 06:00 and 20:00 Vietnam time; an empty queue no longer writes a run row. Out-of-range dosage and a missing withdrawal period now ask for a correction (REQUEST_CHANGES) instead of a rejection. Thresholds are documented in docs/rules-and-limits.md §3.8.
  • Proposal dedupe (apps/web, 08-agent.sql): duplicates are judged by the journal entries a proposal acts on (subject_ids), not by the key the agent sends.
  • Release override: the web and APISIX refuse to start when DXOS_INTERNAL_GATEWAY_SECRET is missing or still the public development value.
  • docs/rules-and-limits.md: amended §1.1 (AI Principle Invariant) and §1.2 (MNM Invariant) per milestone M0 to permit typed catalogue action proposals (with human approval in normal mode, or manager-enabled bounded autonomous mode) and optional per-cooperative external LLM providers while keeping local Ollama as the zero-key default.

Fixed#

  • Telegram messages for proposals, reports and alerts (PrismaTelegramRepository): the link and outbox column lists were plain strings inside $queryRaw templates, so Prisma sent them as a bound value; recipients came back without a chat id and queuing a message failed. They are SQL fragments now, checked by a unit test and against a real Postgres.
  • Mosquitto restart loop: on kernels with fs.protected_regular (including WSL 2) a restarted broker container failed with "can't create /tmp/mosquitto.passwd: Permission denied"; the entrypoint now removes the old password file first.
  • The PostgreSQL scripts of the staff app (apps/staff-desktop/database/postgres) were hidden by the root *.sql ignore rule.
  • Withdrawal checks fail closed (approve-harvest, CreateLotUseCase, lot trace, farmer dashboard): spraying recorded in a rejected, returned or pending journal entry still blocks harvest approval, lot creation and QR export; only drafts are ignored. Without this, rejecting a journal through the new review flow would have hidden a real spray from the withdrawal period.
  • Agent A1 withdrawal rule: compares Vietnam calendar days (a harvest on the spraying day is a violation, a harvest on the safe day is allowed) instead of UTC timestamps; the invented 7-day minimum is removed; Vietnamese numbers such as "1.200 ml" and "0,5 kg" are read correctly.
  • Agent tokens limited to their routes (APISIX): tokens of the agent role are refused on the workflow, disease and chat LLM routes; the internal agent route is rate-limited per token.
  • Proposal creation checks: evidence values must match their hashes, referenced rows must belong to the caller's cooperative, at most 50 rows, known agent names only, bounded body size.
  • Journal review races: review and batch approval change only entries that are still pending and record the reviewer; a returned or rejected entry can be edited and goes back to pending.
  • Agent containers: dxos-agent and dxos-telegram run read-only, without capabilities, with process and CPU limits; 08-agent.sql is mounted for fresh databases.
  • Agent resilience: provider failures of any kind fall back to rule-only reasons, HTTP 429 no longer blocks the agent loop, and one malformed credentials file or journal entry no longer stops the others.

  • Journal reject/request-changes flow (officer-journal-approval.tsx, POST /api/journal/[id]/review): officer "Từ chối" / "Yêu cầu sửa" actions previously posted ignored isApproved / rejectionReason fields to /api/journal/batch-approve and approved the entry; they now invoke the dedicated review endpoint, record review_note, and keep rejected entries out of APPROVED.

Upgrade notes#

  • Set DXOS_INTERNAL_GATEWAY_SECRET and DXOS_TELEGRAM_CALLBACK_KEY in docker/.env.local to long random values. With the release override the web does not start while either is missing or still the development value, and APISIX does not start without the first.
  • make platform-up, then make web-up: the first creates the agent and Telegram tables (08-agent.sql, 09-telegram.sql), applies the database migrations and starts dxos-agent and dxos-telegram; the second rebuilds the web app at 1.14.0. No data migration.
  • AI layer: ./dxos agent enable <HTX> for each cooperative that should get it; the running agent picks it up on its next cycle, and the command creates the realm role agent when it is missing (on a smaller stack, make up-agent starts the agent). A cooperative enabled from main before this release runs enable once more: the credentials moved to the dxos-agent-env volume.
  • Telegram (optional): set TELEGRAM_BOT_TOKEN and TELEGRAM_BOT_USERNAME from BotFather, run ./dxos telegram enable, then link a phone from the profile page.
  • External LLM providers (optional): set ANTHROPIC_API_KEY (and DXOS_ANTHROPIC_MODEL to change the default claude-haiku-5-5) or OPENAI_API_KEY with DXOS_OPENAI_MODEL, restart dxos-agent, then choose the provider for an agent on /manager/ai/settings. Without a key everything runs on Ollama as before.
  • n8n: import the workflows again (n8n import:workflow, see docs/dev-setup.md); every workflow now names workflows/system-error-alert.json as its error workflow, so failures reach managers.
  • Withdrawal checks now count every journal entry that is not a draft: a harvest or a lot that passed before because the spraying entry was rejected, returned or pending is blocked until the withdrawal period ends. Open AI proposals made before the upgrade answer stale when decided.
  • Tea Staff Manager's shared sign-in needs a Keycloak client created by hand: see apps/staff-desktop/docs/core-integration.md.

Known limits#

  • The withdrawal checks read at most 100 journal entries of a parcel (issue #67).
  • A farmer cannot yet edit a returned journal entry from the web form (issue #68).
  • Telegram delivery is at least once: a message can arrive twice if the relay stops between Telegram's answer and reporting it.
  • With an external provider, names a farmer writes inside a note are not masked; the confirmation on the settings page says so. Costs are estimated from a small price table in code; a model not in the table counts as 0.
  • The browser checks of app-kit.spec.ts can fail on a frame that is still navigating (issue #44); a failed Platform Smoke Test job on that spec is re-run.

1.13.0 - 2026-11-22#

A cooperative manager gets a chart dashboard over the core's data and sensor readings, and three client apps join the repository: the multi-role Flutter app hub-mobile and the staff management pair staff-desktop and staff-mobile.

Added#

  • Project site (site/, published with GitHub Pages by .github/workflows/pages.yml): a static, dependency-free landing page in Vietnamese (/) and English (/en/) with real screenshots from the mini-apps and staff apps, a three-tier diagram, light and dark themes, and the known limits from this changelog. scripts/build-site.sh assembles the publishable folder with the screenshots taken from their repository paths. Self-hosted Be Vietnam Pro (OFL-1.1) is listed in DEPENDENCIES.md.

  • App hub-mobile (apps/hub-mobile): one Flutter (Dart) app for Android, iOS and the web demo with roles chosen from the token claims after sign-in: guest, customer, farmer, HTX manager (officer read-only) and tour guide (guide, a staff account of an HTX). Tours belong to the HTX: the manager creates and edits tours (with a briefing for the guides), adds or removes guides, reads the member list of each tour and checks groups in; a guide sees only the tours an HTX assigned, with the HTX that assigned it, the schedule (Lộ trình), the itinerary, the groups with phone numbers and a check-in; a customer's ticket shows the guides of the tour. Guest browses news, tours and products; customer books tours, buys products, pays by VietQR, and keeps orders and tickets on the device (open offline). Leaf diagnosis sends a photo (gallery or live camera) to the web classifier with the app token. AI assistant pages per role (market, technical, shop, tour topics) with a local keyword answerer for guests and the web POST /api/chatbot stream for signed-in users. Reels: short videos with a For-you and Following feed, hearts, comments, share and follow, posted from the phone gallery (own videos on a page opened from the + button of Reels). Runs on a mock HubRepository and a demo AuthService or, with an issuer configured, on Keycloak OIDC PKCE (client dxos-mobile) and the web API through HttpHubRepository; storefront, tours and Reels still use sample data. No Google Play services, Firebase, Maps or analytics. Build: apps/hub-mobile/tool/build.sh. Not yet built as a release APK or run on iOS, and the VietQR code has not been scanned by a real banking app. See apps/hub-mobile/README.md.

  • Staff management clients (apps/staff-desktop, apps/staff-mobile): Tea Staff Manager, a C# .NET 10 WPF app (MVVM) where the HTX owner manages employee records, teams, task assignment, a monthly timesheet, leave approval and payroll (prorated monthly salary or daily wage, overtime, allowance, bonus, compulsory insurance, advances; Draft, Approved, Paid), and Tea Work, a Kotlin Jetpack Compose app (MVVM) where staff accept and report tasks, check in and out, request leave and read payslips. The desktop app serves the phones over a small REST API (docs/mobile-api.md), stores data in SQLite or in the core schema app_staff_work (every table has htx_code), and signs in with a local owner account or the shared Keycloak account (realm agrimarket, role manager). Both follow DESIGN.md. Tests: xUnit for payroll and the task state machine, a Robolectric walkthrough of every mobile screen and an API contract test between the two apps.

  • Staff apps 1.1 (apps/staff-desktop, apps/staff-mobile): leave requests carry evidence (photo or PDF, checked by content, required for sick leave of two days or more); a Reports page with KPI tiles and charts and a Kanban board for tasks; toasts, sound and red counters on the desktop when staff act on their phones; phone connection self-test, one-click firewall rule and a DX-OS core connection check in Settings; quiet 30-second refresh and an offline-demo banner on the phone.

  • Keycloak client dxos-mobile: a public PKCE client (S256; no password grant, no service account) for mobile apps, with the same scopes and roles as nextjs-web and the redirect URIs of the Android tour app and of the Flutter hub-mobile app (docker/keycloak/realm-agrimarket.json). make mobile-client adds it to a running realm and does nothing if it exists. Covered by platform/tests/test_realm_policy.py.

  • View telemetry.sensor_daily (platform/postgres/init/07-telemetry-views.sql): read-only daily summary of telemetry.sensor_readings per (htx_code, parcel_code, sensor, Vietnam day) with reading_count, min_value, max_value, avg_value, first_ts, last_ts. Tracked in Hasura as telemetry_sensor_daily with the same htx_code filter as the raw table for manager and officer; farmer has no access. Covered by platform/tests/smoke-dataops.sh.

  • Mini-app htx-dashboard ("Bảng điều hành HTX", 0.1.0): a read-only overall view of a cooperative for its manager, with no database of its own. Tổng quan lists what needs attention (journals waiting more than 3 days, disease reports waiting, sensors silent for 6 hours, harvests due or overdue, failed transfers to the cold store) over a strip of figures, a grid of parcels, journals per week, lots and the newest tea prices; the tabs Sản xuất, Vùng trồng, Sức khoẻ cây, Lô chè and Dữ liệu have a CSV file and a print page; each parcel has a page with the newest reading and the daily chart of each sensor, the crop round, weather, journal, disease reports and lots. Every figure is read from the core through Hasura with the viewer's own token, so a manager sees only their cooperative. Lists ask for at most 5,000 rows and say when cut; sensor charts cover at most 30 days. Requires core 1.13.0. Covered by the app's pytest suite, a block of make apps-smoke (every tab against the real core, the figures of seeded readings, the gateway's refusal of other roles, the view's permissions asked from Hasura), a browser story and the screens at 1280 and 390 px in light and dark.

Changed#

  • make platform-smoke gives 131 PASS (was 124): five checks for the daily view and two for the officer role. The daily-view readings are dated yesterday and today instead of March 2026, so the lifecycle job cannot archive them between the insert and the query.
  • Web package version 1.13.0.
  • htx-dashboard 0.2.0, a chart dashboard: the app draws its figures as charts instead of tiles, with a server-side SVG toolkit of its own (line and area, stacked and grouped columns, donut, sparkline, gauge, ring, calendar and matrix heatmaps, funnel, timeline, scatter) and one palette for both themes. The overview has a KPI strip with the change against the previous period, cooperative-wide sensor charts, a sensor freshness matrix and a harvest timeline; every other tab gains charts of its own. A rejected disease report is no longer listed as a kind of disease. Still no JavaScript and no new dependency. Upgrade an installed copy with ./dxos upgrade miniapps/htx-dashboard; a preview with sample data runs with python tests/preview.py in the app's folder.

Upgrade notes#

  • make platform-up, then make web-up: the first creates the view telemetry.sensor_daily and restarts Hasura so it loads the new metadata; the second rebuilds the web app at 1.13.0. No data migration.
  • ./dxos install miniapps/htx-dashboard (or install "Bảng điều hành HTX" from the App Store with a worker running). A copy of 0.1.0 installed from main before this release is replaced with ./dxos upgrade miniapps/htx-dashboard.
  • A realm that already exists gets the mobile client with make mobile-client; a new realm has it from the realm file.
  • apps/hub-mobile, apps/staff-desktop and apps/staff-mobile are built from source with their own toolchains (Flutter, .NET, Gradle); see the README of each. The release workflow does not publish them as images.

Known limits#

  • htx-dashboard shows the core's data only: figures of other mini-apps and of the staff apps are not included. Its charts are drawn on the server, so they do not update while the page is open. Sensor charts cover at most the 30 days the hot store keeps. Rainfall is shown as the average of a day's readings.
  • The staff apps keep their data in a schema of their own and are not installed through ./dxos.
  • What hub-mobile reads from a real server and what it still shows from sample data is listed in apps/hub-mobile/README.md.
  • The browser checks of app-kit.spec.ts can fail on a frame that is still navigating (issue #44); a failed Platform Smoke Test job on that spec is re-run.

1.12.0 - 2026-11-14#

The v1.11.0 tag has no GitHub Release, images or bundle: its release run failed twice on a race in a browser test (the test typed into a frame that was still navigating), fixed here. v1.12.0 contains everything in 1.11.0.

Added#

  • Manifest feed (platform/apps/manifest.schema.json, dxos validate): an app may name a protected path that returns, for the calling user, a JSON list of sub-apps (entries and an optional create link). The web menu shows them after the app's own items in each role's sidebar, and the App Store shows a section "Ứng dụng do HTX tự tạo". The web validates the feed (30 entries, label 60, path ^/[a-z0-9_-]+(/[a-z0-9_-]+)*$, icon allowlist, 64 KB, 1.5 s, cached 15 s) and a broken feed leaves the menu intact. GET /api/app-store gains created. The icon map moved to lib/apps/app-icons.tsx. See docs/miniapps.md.

  • Mini-app custom-books ("Sổ tự tạo", 0.1.0): the HTX manager designs record-keeping books without code. Eight templates (picking attendance, spraying, fertilising, cashbook, meeting minutes, supply hand-over, pest tracking, visitors) and a blank book; a form-based designer (name, description, menu icon, fields of eight types, which fields show in the list or are summed, access of officers and farmers: none, view, own rows, all rows; optional approval of each row); preview, publish, archive and publish again. Each published book appears in the menu of the roles allowed to use it and in the App Store section "Ứng dụng do HTX tự tạo", with a form, a filtered list with search and paging, a summary with totals and charts, a CSV download and a print page. With approval on, a row waits for the manager, who approves or rejects it on a page with a reason; the author corrects a rejected row, an approved row is locked, and the summary counts approved rows only. A user at level "own" never reads another user's row (list, edit, CSV, print, summary). Requires core 1.12.0.

  • Smaller dev stack: make up-core (postgres, keycloak, hasura, apisix, web) and one target per optional group (up-docs, up-sensors, up-ai, up-voice, up-workflow, up-chat) start only their own containers; make stop-extras stops (never removes) every optional container. make up and make platform-up are unchanged. See the README.
  • Designer table (dxos-app.css): a form-table modifier gives the input columns of a table of inputs a share of its width, the name column the largest (about 230 px at 1280 px), and the table stays inside its card with any system font.
  • Tests: the app smoke installs custom-books, drives a book from the picking template through publish, feed per role, rows at level own, rejection, approval, CSV, print, archive and purge; a browser story installs it from the App Store, designs and publishes a book, checks that the officer and farmer menus gain the entry on their own, a farmer row at 390 px, approval, summary, CSV, print and archive, and that the shell still renders when the app is stopped; screens for the books list, template chooser, designer, list, summary, print and farmer list at 1280 and 390 px, light and dark.

Changed#

  • Keycloak heap cap in the dev stack (docker/docker-compose.yml): JAVA_OPTS_KC_HEAP defaults to -Xms64m -Xmx512m (override with KEYCLOAK_HEAP_OPTS); Keycloak used about 1.1 GiB before and about 360 MiB after for the same activity.
  • The sidebar lights only the most specific menu item, so a feed entry no longer lights its app's own item as well.

Upgrade notes#

  • The Keycloak cap applies when the keycloak container is next recreated (make up-core or make platform-up after pulling); recreating it also restarts web.
  • Run make platform-up and make web-up (new menu feed, store section and designer CSS), then ./dxos install miniapps/custom-books or install "Sổ tự tạo" from the App Store (a worker must be running). No migration of existing apps; keep every docker_* volume.
  • ./dxos validate now accepts the feed key; an app that declares it should require core >=1.12.0.

Known limits#

  • No photo or file fields (mini-apps have no object storage access).
  • No formulas or calculated fields: the summary only totals number and money fields.
  • Approval is one step, by the manager.
  • The designer is a form, not a drag-and-drop canvas; a field's type cannot change once the book has rows, and a choice field that has rows cannot lose options.
  • A book's menu entry shows on the next page load, up to 15 seconds after publishing (the feed is cached 15 s per app, HTX and role, 5 s after a failure).
  • The menu entry cap is 30 books per role; an HTX has at most 50 books; CSV and print hold at most 5000 rows.
  • A second household field in one book shows "Nông hộ khác" for households a farmer may not see; only the first household field's name is stored.

1.11.0 - 2026-11-13#

Added#

  • Shared mini-app kit (platform/appkit/): CSS components in dxos-app.css (header, tabs, stats, SVG bar chart, toolbar, pagination, cards, steps, empty state, field errors, disclosure, row actions, print sheet), Jinja macros (kit.html), Python helpers (appkit.py: paging, safe date and integer parameters, ILIKE escaping, Vietnamese money, number and date formats, CSV with BOM and formula escaping, chart widths) and a showcase page. make appkit-sync copies the two files into the four apps; make lint fails when a copy differs.
  • Mini-apps can offer downloads: the app frame sandbox gains allow-downloads and the proxy keeps a content-disposition header when it starts with attachment. Scripts stay blocked and the CSP is unchanged.
  • ./dxos upgrade <dir> gives an installed mini-app new code in place: it validates the manifest, applies only pending migrations (same role and password), rewrites the route and compose file, rebuilds and restarts the container, then stores the new name, version, menu and manifest. Enablements are never touched; a failed build or health check leaves the registry on the old version. The App Store card and detail show Có bản mới when the running version differs from the catalogue.

  • The four business apps rebuilt on the kit (version 0.2.0): leaf-purchase (overview, ticket list with filters and search, print of a weighing slip and a payout sheet, CSV of tickets and payouts, month filter for farmers, inline field errors), tea-shop (overview with revenue chart and best sellers, order and product lists, delivery note, order CSV, tracking steps), farm-supply (overview, round list, item and household CSV, delivery sheet with a signature column, inline item errors, round cards for farmers) and tea-tour (overview, tour and booking lists, guest CSV, group list with check-in boxes, public cards). Status pills carry tones (amber waiting, red cancelled, grey closed). Existing paths, form fields, status codes and redirects are unchanged.

  • Tests: the app smoke checks a list, a CSV download (text/csv, attachment, BOM) and a print page for each app, wildcard and out-of-range page values, role refusals on exports, and ./dxos upgrade (installed app: exit 0, version, same enablement rows, still answering; not installed: refused). A new browser story (app-kit.spec.ts) writes sample data through each app and checks tabs, a second page, CSV download inside the frame, the print page in the top window and the way back, inline errors and the stored theme; screens cover the overview, one list and one print page of every app at 1280 and 390 px, light and dark. The five store screenshots are recaptured from the new pages (the tea-shop picture is now manager-orders.png).

Upgrade notes#

  • Run make platform-up and make web-up (rebuilds the web image: new dxos-app.css, allow-downloads on the app frame, "Có bản mới" in the store), then ./dxos upgrade miniapps/<id> for each installed app (leaf-purchase, tea-shop, farm-supply, tea-tour). Enablements are kept; until you upgrade, an installed app keeps its 0.1.0 code and pages. The new leaf-purchase route /overview reaches an installed app only after its upgrade. Restart ./dxos worker if one runs.
  • No database migration; keep every docker_* volume.

Known limits#

  • Search in the apps is accent-sensitive (Nguyen does not find Nguyễn): the app roles cannot create the unaccent extension.
  • No notifications: nothing tells a manager that a new order or booking arrived; the overview shows the count when opened.
  • Printing goes through the browser's own print command (Ctrl+P); the pages only prepare the sheet. No script may call print().
  • CSV files hold every row of the current filter, with no row cap.
  • farm-supply prints inside a section rather than on the body, so its print page keeps the page background in dark mode.

Fixed#

  • Flaky crash-recovery check in make apps-smoke: the check of the leftover container and gateway route now waits (up to 60 s) for the worker to undo the half install, which it does after marking the request FAILED.

1.10.1 - 2026-11-13#

Added#

  • make web-up and make gateway-up: web-up rebuilds or starts web and disease-api on the generated route file (it replaces the hand-typed docker compose up for web, in the README, docs/miniapps.md and CI); gateway-up puts the gateway back on that file after a hand-typed compose command recreated it on the base one.

Fixed#

  • ./dxos install and ./dxos worker refuse to run while the gateway reads the base route file: after a hand-typed docker compose up without DXOS_GATEWAY_FILE recreated apisix, every mini-app route answered 404 and an install still ended "Đã cài". They now stop with a message naming make gateway-up; the check never blocks when docker cannot be asked.

1.10.0 - 2026-11-13#

Added#

  • App Store detail page (/manager/app-store/<id>, web version 1.10.0): header with the Cài, Gỡ, Thử lại and Mở ứng dụng buttons, a step progress while an install runs (Đã gửi yêu cầu, Chuẩn bị, Dựng và khởi động, Đăng ký), a strip of screenshots that open at full size, the "Giới thiệu" text, a preview "Khi cài, ứng dụng sẽ" of what the install does for the HTX ("Ứng dụng đã thêm vào HTX" once the HTX uses the app), the data and personal data the app declares, version information, the full address of the app's public page with a "Chép địa chỉ" button, and the history of the app.
  • Richer store page: accent-insensitive search, filters by status and category, cards that link to the detail page, and a "Lịch sử" tab with the 50 newest install and removal requests of the HTX and the name of who asked. The history only holds requests of the caller's HTX.
  • Optional store block in the mini-app manifest (category, icon from an allowlist, about, data, personal data, core reads, up to 4 screenshots of at most 400 KB, PNG, WebP or JPEG detected from the first bytes). Text from a manifest is shown as plain text only. ./dxos validate also checks the screenshot files (inside the app directory, size, type); catalog-sync stores the block (platform.app_catalog.store, requires_core, has_database) and the screenshots (platform.app_catalog_screenshots) in the platform database.
  • Install phases: while the worker installs an app it sets platform.app_requests.phase to prepare, build and register through the new ./dxos worker-progress, so the page can show the step; a failed install keeps the phase that failed. A hand ./dxos install never writes a request or a phase.
  • Store text and screenshots for the five apps: leaf-purchase, tea-shop, farm-supply (two screenshots each), tea-tour (one) and hello carry a store block in Vietnamese; the screenshots come from the real apps with sample data and are retaken with apps/web/tests/e2e/tools/store-screenshots.spec.ts (E2E_STORE_SHOTS=1).
  • Tests: the app smoke checks the synced store block, the phases seen during a queued install, the build phase of a failed install, that a hand install writes no request, and that validate refuses a text file declared as a screenshot; the App Store story now searches, opens the detail page, installs from it, opens the app and finds the history row; the screens add the history tab and the detail page at 1280 and 390 px, light and dark.

Upgrade notes#

  • make platform-up applies the new columns and tables without recreating postgres (06-app-store.sql is extended in place and stays idempotent). Keep every docker_* volume.
  • Rebuild the web image (make web-up from v1.10.1; before that the full command of the v1.8.0 note, with DXOS_GATEWAY_FILE) and restart ./dxos worker, otherwise the page works but no install phase is reported.
  • Apps that carry a store block declare requires.core: ">=1.10.0"; app versions are unchanged.

Known limits#

  • The declared data is not enforced: what an app says it stores or reads is the publisher's statement, shown as such; nothing checks it against the app's real behaviour.
  • There is no update flow: an installed app is not upgraded from the store, and its version does not change for a metadata-only edit.
  • The install steps show only what the worker reports (three phases); building and starting the container are one step.

1.9.0 - 2026-11-13#

Added#

  • Optional description in the mini-app manifest (1-200 characters), shown by the upcoming app store; hello and tea-tour now declare one. docs/miniapps.md documents it and the rule that public pages live under /public/<htxCode>/... (from v1.9.0 the web proxy serves a public page only when that HTX has enabled the app). Web package version is now 1.9.0
  • App Store: install mini-apps per cooperative (the manifest description above feeds it). A manager opens "Kho ứng dụng" (/manager/app-store) and installs or removes an app for their own HTX; the card shows Chưa cài, Đang cài…, Đã cài, Đang gỡ…, Lỗi (with Thử lại) or "Đã cài cho mọi HTX (quản trị máy chủ)", and polls every 3 s only while something is in progress, then refreshes the sidebar menu of the manager who pressed the button (other signed-in users of the HTX see the change at their next page load). A mini-app is now served, and listed in the menu, only to the HTXs that enabled it: the proxy answers 404 to any other HTX on protected and public paths, and a public page names its HTX in /public/<htxCode>/.... New tables in schema platform (platform/postgres/init/06-app-store.sql, applied by platform-init): app_catalog (synced from miniapps/*/app.yaml by make platform-up and by the worker; an installed app keeps its card when its directory is gone), app_enablements (* means every HTX), app_requests (one open request per app and HTX, enforced by a unique index) and app_worker (heartbeat); requests and enablements are audited. ./dxos worker is the host process that claims requests one at a time (ENABLE installs the app when needed, DISABLE removes the container once no HTX is left, and keeps the data), takes a lock in docker/runtime/<project>/worker.lock, fails requests a crashed worker left running (undoing the half install) and logs one line per job; without it the page warns that requests wait for the administrator. ./dxos install <dir> is unchanged and enables the app for *. New API: GET /api/app-store, POST /api/app-store/requests (docs/api-contract.md)
  • Mini-app leaf-purchase (Thu mua búp tươi): officers and managers write fresh-leaf weighing tickets (household, date, grade, kg with one decimal, price copied from the grade when written; money is integer VND shown as 9.000 ₫) and can edit or void a ticket until its period closes; managers set the price per grade (/prices), close a payment period over a date range (/periods: every non-voided ticket in the range joins it and gets one payout per household) and mark each payout paid; a farmer sees their own tickets and payouts at /mine. The household lists come from Hasura with the caller's own token and role, so a farmer sees only their household. Periods of one HTX never overlap (checked in a transaction under an advisory lock, since the app role cannot create btree_gist), and a ticket cannot be written or moved into a closed period's dates. Menu: "Thu mua búp tươi" (officer, manager), "Kỳ thanh toán" (manager), "Phiếu cân của tôi" (farmer). Schema app_leaf_purchase
  • Mini-app tea-shop (Cửa hàng chè): managers list products (name, pack, price, stock, optional trace lot code) and process orders (Mới → Đã xác nhận → Đang giao → Hoàn tất, or cancel, which gives the stock back); guests order without an account at /apps/tea-shop/public/<htxCode> (cash on delivery), get an 8-character order code and look the order up with code and phone together. Stock is locked per order in a fixed product order, so concurrent orders never oversell and never deadlock; an order keeps the product name and price it was placed with; a manager's stock edit is an adjustment (+/-), never an overwrite. Personal data (name, phone, address, note) is shown only to the HTX's manager and never on a public page. Menu: "Cửa hàng chè" (manager). Schema app_tea_shop
  • Mini-app farm-supply (Vật tư mua chung): managers open a group-buying round with a deadline and add items (name, unit, price) while it is open; each farmer registers quantities for their own household (the household comes from Hasura with the farmer's token, never from the form) until the round closes; closing creates one settlement per registered household, and the manager marks each delivered and paid and sees totals per item and per household. Menu: "Vật tư mua chung" (manager), "Đăng ký vật tư" (farmer). Schema app_farm_supply
  • Tests for the store and the three apps: make apps-smoke now also installs, calls through the gateway (200 with the right role, 404 on the published port, the gateway's refusal for a wrong role, including /tickets/* and /periods/* of leaf-purchase), reads the real Hasura household lists as officer, manager and farmer, makes one write per app (a ticket, a closed period and a payout, a public order, a registration) and purges each app; through the queue it enables tea-shop for TC, checks that the web proxy answers 404 for LB when the web container runs, disables it, enables it again and checks that the product created before is still there. It refuses to start when one of the five apps is installed, and starts its own ./dxos worker. Browser: tests/e2e/story/app-store.spec.ts (TC installs the shop from the page and sees Đang cài… then Đã cài; LB does not see it and gets 404; a guest orders on a 390 px phone; the manager advances the order, presses Gỡ, installs again and finds the order) and business-apps.spec.ts (the leaf-purchase and farm-supply stories); screens.spec.ts adds the store page and one screen per app and role at 1280 and 390 px, light and dark. CI runs the pytest suites of the three apps next to tea-tour's and, in platform-smoke, a ./dxos worker for the store stories

Upgrade notes#

  • First make platform-up recreates postgres once: it mounts the new platform/postgres/init/06-app-store.sql. The data in docker_pgdata is kept, and platform-init creates the store tables on the existing database. Never delete the docker_* volumes
  • Apps installed before the upgrade stay enabled for every HTX: the platform-init run that creates platform.app_enablements enables each already-installed app for * once (enabled_by = 'dxos-upgrade'), so nothing disappears from the menu. Later runs never do it again: an installed app with no enablement is a valid state (every HTX turned it off) and is not handed back to everyone
  • Start ./dxos worker: the store only queues a request until a worker runs. Start it from the repo root (README, "Kho ứng dụng và ./dxos worker", has a systemd unit); until it runs, the page warns "Trình cài đặt chưa chạy". ./dxos install and ./dxos remove work without it
  • The web image must be rebuilt (make web-up from v1.10.1; before that the full command of the v1.8.0 note, with DXOS_GATEWAY_FILE): the proxy, the menu and the store page read platform.app_enablements; the package version is now 1.9.0, which the new manifests require
  • Demo: build the images of the three new apps ahead (install each once, then ./dxos remove <id> --purge) and start the worker before the demo; the first Cài otherwise builds an image, which takes minutes

Known limits#

  • Apps still trust each other (ruling R24, unchanged): enabling an app per HTX only decides who sees it; every installed app shares dxos-apps-net and decodes the token without verifying it, so another installed app can read or change the data of leaf-purchase, tea-shop and farm-supply. Install only apps of this repository. Real per-app isolation is deferred
  • The worker is a host process, not a container (the web app must never hold the Docker socket): it must be started and kept alive by the operator, and one worker serves one compose project
  • The farm-supply item form shows a rejected item (empty name, bad price) as a plain error page (heading and one message, no form and no link back; the browser's Back button returns to the round) instead of an inline error; nothing is stored
  • The gateway can answer 503 for up to about 30 seconds after a core service restarts (for example Hasura): its DNS client caches the "name not found" answer it got while the service was down, and apisix.dns_resolver_valid only shortens the cache of valid answers. Unchanged from earlier releases

1.8.1 - 2026-11-12#

The v1.8.0 tag has no GitHub Release, images or bundle: the release workflow's smoke gate failed on the flaky restart fixed below. v1.8.1 is the same product with that fix and is the first published build of the mini-app platform.

Fixed#

  • make platform-up no longer recreates containers whose build inputs did not change: BuildKit attached a provenance attestation with a new digest to every build, so rebuilding an unchanged image (up --build, run --build migrate, the web step) produced a new image ID and Compose recreated agrimarket-postgres (and its dependents) under a running Keycloak. Keycloak then answered 500 on its next admin call, which failed make apps-smoke on main and in the release gate (FAIL: keycloak admin PUT .../default-client-scopes/..., Error 22). The Makefile, ./dxos and the CI platform-smoke job now set BUILDX_NO_DEFAULT_ATTESTATIONS=1, so the same inputs give the same image ID. First-start behaviour is unchanged
  • make apps-smoke waits for Keycloak after make platform-up: it now asserts that the postgres container is the same one as before, then waits (bounded, 120 s for the admin API, 60 s for the user token) before using Keycloak, so a legitimate restart no longer fails the run. New helper kc_ready in platform/tests/tokens.sh; no assertion was removed

1.8.0 - 2026-11-12#

Added#

  • Mini-app manifest and dxos validate: a mini-app is described by app.yaml (apiVersion: dxos/v1), published as the JSON Schema platform/apps/manifest.schema.json with additionalProperties: false everywhere. ./dxos validate <dir>... refuses a manifest with a schema error, an id already installed, a licence outside the CLI's OSI list, a requires.core the core (version in apps/web/package.json) does not satisfy, an image not pinned by @sha256: digest, a route or menu path with .., // or characters outside [a-z0-9/_-], a role other than farmer, officer and manager, a prefix listed as both public and protected, or a protected prefix nested under a public one (the web proxy would never send it a token). The developer guide is docs/miniapps.md; the decision is recorded in docs/adr/0002-miniapp-architecture.md
  • ./dxos install, remove and list: ./dxos at the repo root runs the dxos-cli container (profile tools, no host port, no docker socket) for the manifest, database, gateway, install journal and registry work, and starts or stops the app container itself with docker compose. Install validates the manifest, prepares the database (when declared), writes the app's APISIX routes under /apps/<id>/ and the app's compose file, starts the container with up -d --build --wait, then records the app in platform.installed_apps (id, name, version, menu, manifest, install time; created by platform-init from platform/postgres/init/05-apps.sql). A failure at any step, a failing health check, Ctrl-C or TERM undoes the earlier steps in reverse order from the journal docker/runtime/<project>/apps/<id>.pending.json; installing an installed app only makes sure its container runs. remove <id> stops the container, removes the routes and the registry row and keeps the data; --purge also drops it. list prints id, version, install time and container state. Protected routes use openid-connect bearer_only with a claim_schema check on realm_access.roles; a token without one of the manifest's roles gets 401 from the gateway. The routes are merged with the tracked platform/gateway/apisix.yaml into docker/runtime/<project>/gateway/apisix.yaml, which APISIX reloads in place within about a second; with no app installed that file is identical to the base, and the tracked file is never modified. make platform-up and make up run gateway-sync first, so installed apps keep their routes and containers across a restart. App routes match only on the gateway's internal listener 9081 (vars: [["server_port", "==", "9081"]]), so the published 9080 answers 404 under /apps/ and every outside request goes through the web proxy; gateway-sync refuses an app route without that condition
  • Hardened app containers: the generated compose file runs service app-<id> as user 10001:10001 with a read-only root filesystem and a /tmp tmpfs, cap_drop: [ALL], no-new-privileges, 256 MB of memory and 0.5 CPU, no host port, and only on the new network dxos-apps-net. That network is internal: true (no egress) and holds only apisix and postgres besides the apps. Every installed app shares it, so apps can reach each other (see Known limits). The manifest cannot change any of this
  • App database: for a manifest with database.migrations, install creates the login role and schema app_<id> (- becomes _): no superuser, database, role, replication or RLS-bypass right, CONNECTION LIMIT 10, a random password sent to the server only as a SCRAM verifier, and rights on its own schema only. Migrations (*.sql, in file-name order, one transaction per file) run on a connection logged in as the app role with search_path set to its schema, never on the superuser connection, and are recorded in app_<id>.schema_migrations. Every app table must have htx_code text NOT NULL, checked after each file and again from a fresh session. The app reads DXOS_APP_DB_URL from docker/runtime/<project>/apps/<id>.env (mode 600, git-ignored). A failed install drops a schema and role it created and keeps ones that existed before. --purge drops the schema (refused, dropping nothing, when an object outside it depends on it), then DROP OWNED BY and the role, and deletes the env file
  • Mini-app hello: about 80 lines of standard-library Python with no database. It greets the user with the name, HTX and role from the token, on one menu item for every role, and its README is the walkthrough for a first mini-app
  • Mini-app web proxy: /apps/<id>/... on the web app forwards to installed mini-apps through the gateway, only for ids in platform.installed_apps (read on every request, so a removed app answers 404 at once, and 503 when the list cannot be read). Protected paths get the user's access token and answer 401 with a sign-in link when the session has expired; public manifest paths get no token and are limited to 10 requests a minute per client IP across every app (429 with a Vietnamese message), with new IPs sharing one bucket once the 10,000-IP table is full. Paths with empty or dot segments or encoded separators answer 400; only content-type, accept and content-length (plus the token) are forwarded, so the browser's cookie, authorization and x-hasura-* headers never reach the app; only content-type and location come back, so the app's set-cookie is dropped, and a redirect that leaves the app answers 502. Every response carries Content-Security-Policy with script-src 'none' and X-Content-Type-Options: nosniff. The per-IP limiter of /api/register now lives in apps/web/src/lib/ip-rate-limit.ts, unchanged
  • DXOS_APP_PUBLIC_LIMIT: the public mini-app limit per minute and IP for the web container, read by Compose interpolation, default 10; a value that is not a positive integer keeps 10. The CI Start Web step raises it (to 1000), so a Playwright retry cannot hit 429. A demo machine on Docker Desktop should raise it too (for example 300), because Docker Desktop shows every client as one IP and the limit becomes shared by the whole room. Production and the compose default keep 10
  • Cross-site form posts to mini-apps refused: the web proxy answers 403, without forwarding, to a non-GET request under /apps/ whose Origin header is neither <scheme>://<Host> of the request nor the AUTH_URL origin (Origin: null included), or that has no Origin but Sec-Fetch-Site: cross-site, since the proxy attaches the signed-in user's token
  • Mini-apps in the app shell: each role's menu lists the installed mini-apps whose manifest menu names that role (read on every page load; when the list cannot be read the menu shows no app and the other items stay). /<role>/apps/<id>/... shows the app in an <iframe sandbox="allow-forms allow-same-origin allow-top-navigation-by-user-activation"> (no allow-scripts) on /apps/<id>/..., passes the page query through, adds ?theme=light|dark from the stored theme choice, and answers 404 when the app is not installed, has no menu entry for the role, or the path has an unsafe segment; when the app list cannot be read the page shows "Dịch vụ dữ liệu đang tạm gián đoạn" with "Thử lại". The service worker never answers /apps/ from its cache
  • /dxos-app.css: the shared stylesheet for mini-apps, served without a session. It holds the core tokens (same values as globals.css, checked by a test) for light, dark and data-theme, plus styles for text, tables, forms, buttons and button.secondary, .notice, .error, .pill. Tables span their card, header row included. Below 640 px each row is stacked as a card: a cell with data-label shows that column name next to its value, and a cell without one keeps the card's full width. Apps set data-theme on <html> from ?theme= and keep it across their links and forms, as hello and tea-tour do
  • Mini-app tea-tour (Đặt tour đồi chè): ./dxos install miniapps/tea-tour adds "Tour đồi chè" to the manager menu and "Lịch dẫn tour" to the farmer menu. Managers create tours (title, Vietnam-time start, meeting point, 1–50 seats, price in VND shown as 250.000 ₫, description) with a guide picked from their HTX's households, read through the gateway with the user's own token (the tour list stays usable when the core does not answer within 5 s), edit an open, upcoming tour (seats never below those booked, checked under the tour's row lock), see each tour's bookings with phone numbers, confirm (only while the tour is open; the confirm locks only that booking's tour) or cancel them, and cancel tours; a confirm or cancel that changes nothing says so. Guests book without signing in at /apps/tea-tour/public/<htx> (name, Vietnamese phone, 1–10 people, note), get an 8-character code and look the booking up with code and phone together; public pages never show another guest's name or phone. A booking locks the tour row, so concurrent bookings never oversell; past, cancelled and other-HTX tours are refused with a Vietnamese message and nothing stored. The guide farmer sees their tours with confirmed guest counts. Its tables carry ARIA table roles and data-label on every cell, so they keep their meaning when stacked on phones. Data lives in schema app_tea_tour (tours, bookings, both with htx_code; a booking's foreign key includes its HTX). The app holds at most 8 database connections and answers 503 "Hệ thống đang bận" when none frees within 2 s; it never holds one while waiting for the core
  • Mini-app tests and CI: make apps-smoke installs and removes hello, tea-tour and the CLI fixtures on a seeded stack (it purges their data, so it refuses to start, with exit 1, when ./dxos list shows tea-tour or hello installed): routes 200 with a token and 401 without on the internal port 9081, 404 on the published 9080, the gateway's 401 for the wrong role, a tour booked end to end, idempotent re-install, rollback of a failing health check, routes kept across make platform-up, 404 after removal, --purge, and finally make platform-smoke on the app-free stack. tests/e2e/story/tea-tour.spec.ts runs the tour story in the browser (the manager creates a tour with a TC household as guide, a guest books on a 390 px phone, the manager confirms, the guide sees 2 guests) and, with E2E_TEA_TOUR=removed, checks that the menu item is gone and the public page answers 404; screens.spec.ts adds the tea-tour manager, public and guide screens at 1280 and 390 px in light and dark, and also checks overflow and overlap inside the app frame. CI runs the CLI, hello and tea-tour tests, validates every manifest under miniapps/, and in the platform-smoke job installs tea-tour, runs the story and the screens, removes it, runs the removal check, then make apps-smoke

Changed#

  • Version: apps/web/package.json is 1.8.0, the core version the mini-app manifests require (ruling R7)
  • APISIX route file: apisix now mounts ${DXOS_GATEWAY_FILE:-../platform/gateway/apisix.yaml}. The Makefile and ./dxos set DXOS_GATEWAY_FILE to the generated ../docker/runtime/<project>/gateway/apisix.yaml; without it (release bundle, a bare docker compose up) apisix reads the tracked base file and serves no app route
  • Compose: postgres also mounts platform/postgres/init/05-apps.sql and, like apisix, joins dxos-apps-net; the dxos-cli service is added under profile tools

Fixed#

  • make platform-smoke re-run on a seeded stack: two checks of smoke-dataops.sh counted every LB reading, including the ones [lifecycle] backfills for the seeded LB parcels in the first run, so any second run failed. They now count only the fixture parcel P-LB-001, whose rows the section deletes first
  • The gateway could send one mini-app's requests to another after a reinstall: Docker's DNS answers app names with a 600 s TTL and gives a removed app's IP to the next container, and APISIX kept the old answer. After ./dxos remove tea-tour, ./dxos install miniapps/hello and a reinstall of tea-tour, tea-tour's requests, with the user's token, reached hello (CI run 43178558735: creating a tour got hello's 404). platform/gateway/config.yaml now sets apisix.dns_resolver_valid: 1, so the gateway resolves app names again every second. make apps-smoke first replays that sequence and checks that 30 requests on new connections all reach tea-tour

Upgrade notes#

  • Routes written before the internal-port fix: an app installed from a pre-release build of this branch has a route file without the 9081 condition, and gateway-sync refuses it. Run ./dxos remove <id> (it deletes that route file), then ./dxos install miniapps/<id> again
  • Start the stack with make: make platform-up (or make up) creates docker/runtime/<project>/gateway/apisix.yaml and sets DXOS_GATEWAY_FILE. When starting web on its own, pass the same variable (DXOS_GATEWAY_FILE=../docker/runtime/docker/gateway/apisix.yaml docker compose -f docker/docker-compose.yml up -d --build --wait web disease-api), or Compose recreates apisix on the base file and the app routes disappear until the next make platform-up
  • First make platform-up recreates postgres and apisix: their mounts changed (the new init file, the generated route file) and both join dxos-apps-net. The data in docker_pgdata is kept, and platform-init creates platform.installed_apps on the existing database. Never delete the docker_* volumes
  • Runtime state per compose project: generated files live under docker/runtime/<project>/ (git-ignored), where <project> is the COMPOSE_PROJECT_NAME environment variable, default docker. Set the project with that variable; ./dxos and the Makefile do not read -p or docker/.env. No app was installed before this release, so nothing needs moving
  • Release bundle: v1.8.0 does not install mini-apps from the release bundle (no dxos-cli image is published); the release stack starts apisix on the base route file as before, with no change to the release steps
  • Demo: build the tea-tour image ahead (install it once, then ./dxos remove tea-tour --purge), so ./dxos install miniapps/tea-tour takes about 11–12 seconds. On Docker Desktop, start web for the demo with a higher DXOS_APP_PUBLIC_LIMIT (for example 300), since every phone shares one IP (README, "Chuẩn bị demo")

Known limits#

  • Cross-app trust (ruling R24): every installed app shares dxos-apps-net, and an app decodes the token's claims without verifying the signature (the gateway verifies user requests). Another installed app can therefore call it directly with a forged token, with any HTX and role, and read or change its data. Install only trusted apps. Real per-app isolation (JWT verification or a network per app) is deferred to v1.9
  • npm run dev outside Docker cannot reach mini-apps: app routes match only on apisix:9081, which the host cannot reach; work on mini-apps with the web container
  • Public limit and X-Forwarded-For: the public mini-app limit trusts the first X-Forwarded-For element and counts per web process, like /api/register; a client can forge the header to get a new bucket. It must move to the gateway or a shared store when web runs more than one instance
  • PUBLIC keeps CONNECT on the other databases (keycloak, postgres, template1) in v1.8.0 (ruling R17): an app role can connect there, and default privileges an app leaves there make --purge fail (the env file is kept) until an admin runs DROP OWNED BY app_<id> in that database
  • The --purge dependency guard covers table, type and function dependencies only: an object outside the schema that depends on another kind of app object (for example a core column using an app collation) is dropped by DROP SCHEMA ... CASCADE
  • Migrations are recorded by file name only, with no checksum: editing an applied file has no effect on an existing install, and an unpurged dev install keeps the old version. A COMMIT inside a migration file breaks its one-transaction-per-file rule (the app's schema only)
  • Re-installing over an existing app role logs in as that role: a stale env-file password or 10 connections already held make the install fail, safely, with nothing changed
  • Soft 404 on a missing app's shell page (ruling R15): /<role>/apps/<missing> renders the 404 page with HTTP 200, because the role layouts stream their loading state first, like the existing /lot, /q and /htx pages. The proxy /apps/<id>/... answers a real 404, so a removed app is unreachable
  • A bare docker compose up has no app routes: without DXOS_GATEWAY_FILE, apisix serves only the base routes, which fails closed
  • /apps/<id> without a trailing slash answers 404 at the gateway; the web proxy always sends /apps/<id>/...
  • Behind a TLS proxy the proxy's own scheme is http, so the Origin check relies on AUTH_URL naming the public URL, as the documented deployment already sets it

1.7.0 - 2026-11-11#

Added#

  • Tea leaf disease model: ai-models/tea_leaf_model.keras (MobileNetV2 transfer learning, 224×224, 8 classes listed in ai-models/tea_class_names.txt, 9.2 MB) with Vietnamese labels in tea_class_names_vi.json, each marked for officer review. ai-models/tea/ holds the reproducible pipeline (train.py, datasets.json with DOIs, download URLs and SHA-256, pinned requirements.txt) that runs in python:3.12.15-slim-bookworm. It is trained on three CC BY 4.0 Mendeley datasets (Kimutai and Förster, Kenya; Islam, Bangladesh; Billah et al., Bangladesh), credited in ai-models/ATTRIBUTION.md; no image is committed. ai-models/tea/MODEL_CARD.md reports the measured numbers: test accuracy 0.8683 on 1,025 images and confidence threshold 0.60, but only 0.12 to 0.35 when one source is held out, and a random-noise image is called healthy at 0.988. Accuracy on Thái Nguyên photos is not measured; every result goes to an officer
  • Tea disease model served: POST /predict?model=tea on disease-api uses the tea leaf model next to the general one (still the default; any other model name answers 400). Responses gain model and uncertain; a tea result below TEA_CONFIDENCE_THRESHOLD (default 0.60, rejected at startup outside (0, 1]) has null names and keeps top3. /health adds models with each model's state
  • Tea disease flow in the web app: a parcel whose crop names chè/tea is diagnosed with the tea model, any other with the general one. An uncertain result is stored as Không xác định, and every result still goes to the officers; the farmer screen says Đã gửi cán bộ kỹ thuật xem instead of presenting a final diagnosis. A 503 from the tea model is an outage (503 AI_UNAVAILABLE), never a fallback to the general model
  • Officer's confirmed diagnosis: the review form has a Tên bệnh đã xác nhận field, pre-filled with the AI name (empty when uncertain). PUT /api/officer/diseases/[id]/review takes confirmed_diagnosis, required when approving, and stores it in confirmed_diagnosis; the farmer history, officer lists, soil-health screen, notification and archived report show it over the AI name
  • Tea harvest rounds: POST /api/parcels/[id]/start-round (officer only, TenantGuard.parcel) moves a HARVESTED parcel to TENDING and opens the cycle Lứa <n>/<year>, numbered within the year in Vietnam time. The status check and the new cycle are one transaction, so a second start, or a start on any other status, is refused with 422 and creates nothing. The officer's household screen has a Bắt đầu lứa mới button on harvested parcels
  • Journal photo upload: POST /api/journal/upload (farmer and officer) returns a presigned upload URL valid for 900 seconds and the key para/<htxCode>/Areas/Journal/<yyyy>/<uuid>-<safe name>, which POST /api/journal accepts as photo_minio_key. Only image/jpeg, image/png and image/webp are accepted; the name is reduced to its last segment without Vietnamese marks or unsafe characters, capped at 100 characters. The farmer journal form's photo upload called this route before it existed; the A3 browser story uploads a photo through it to storage and opens it again
  • Withdrawal on the farmer dashboard: Thửa <mã> còn <N> ngày cách ly for each parcel of the farmer's household whose latest safe harvest date (from journal entries not rejected) is still ahead; N is whole days, rounded up
  • Tea demo data: npm run seed (new script, runs prisma db seed) creates the Tân Cương (TC) and La Bằng (LB) cooperatives with made-up households and tea parcels (Trung du, LDP1, Kim Tuyên). Parcel TC-A3 has, relative to the seed run, a fertiliser entry, a spraying entry still under its 7-day withdrawal, a harvested previous round whose lot TC-CHE-A3-001 is already exported with a public trace page, and one pending tea disease report. Re-running it changes only TC and LB rows (plus the shared market, bulletin and partner rows); the history of the seeded parcels is rebuilt with fresh dates. platform/tests/seed-test.sh checks this on a throwaway database
  • Tea demo accounts in the realm: manager_tc, officer_tc, farmer_tc, manager_lb, officer_lb, farmer_lb (password Test1234!; managers and officers must set up TOTP). The farmers have fixed ids, which the seed uses to link them to their household
  • Tea market data: comtrade_export_sync also fetches HS 0902 and stores it as Tea; vietnam_market_sync adds a simulated dried tea bud price (Tea, VND/kg). Every price that workflow simulates is now written under the source Mô phỏng (Toàn quốc) instead of naming a ministry or market portal, and the dashboard price list, the market widget and the chatbot's market context label such prices giá mô phỏng; the chatbot and the bulletin prompt must say so too, and the chatbot's context no longer calls its market data "thực tế". The market widget names no source when it has no data. Prices already stored under the old source names are not relabelled
  • Design system and dark mode: DESIGN.md (google-labs-code/design.md format) documents the tokens of apps/web/src/styles/globals.css, which now has a dark value for every colour token, applied under prefers-color-scheme: dark unless the viewer picked light, or under data-theme="dark". A theme button (Sáng → Tối → Theo hệ thống, stored in localStorage key opentea-theme) sits in the top bar and on the home and login pages; an inline script sets the stored theme before first paint and does nothing if storage is blocked. Tailwind's dark: variant follows the same choice, and semantic tokens (bg-danger-subtle, text-ink-secondary, ...) are available as Tailwind colours. Tests check that every light token has a dark value, that text/background pairs reach WCAG AA 4.5:1 in both themes, and that DESIGN.md matches globals.css. A colour guard fails on hard-coded colours in *.module.css and *.tsx; its baseline of files still to convert (74 when it was added) was emptied by the move to tokens below
  • A3 story and priority screens in the browser: tests/e2e/story/tea-a3.spec.ts runs "Một ngày của lô chè A3" on the seeded stack with real Keycloak logins: the farmer sees A3's withdrawal and adds a journal entry with a photo uploaded to storage; a tea photo diagnosis goes through the gateway to the tea model (checked in the disease-api access log) and into the officer queue, where the officer confirms it with a name the farmer then sees; harvest approval and a lot of A3 are refused during the withdrawal; the officer creates and exports a lot of TC-A2; the public pages /q/<code> of that lot and of TC-CHE-A3-001 show their withdrawal status. tests/e2e/visual/screens.spec.ts saves the priority screens of spec §6.4 (9 pages: the disease review is both the queue and the review form) at 1280×800 and 390×844 in light and dark (36 screenshots under test-results/screens/) and fails on page-level horizontal overflow, on overlapping visible text, and on a theme button missing from or crowded in the phone top bar. The platform-smoke CI job now seeds the demo data, starts disease-api with web, runs both specs after the core tenant spec and uploads the screenshots as the priority-screens artifact. make platform-smoke also creates smoke_officer_tc, because the demo officers must set up TOTP first
  • Home page: / is now public for signed-out visitors, with a short introduction, a sign-in button and a lot code field that opens the public trace page /q/<code> (signed-in users are still sent to their dashboard). The PWA icons are real 192 and 512 px tea-leaf icons and are served without a session

Changed#

  • disease-api dependencies pinned: every package in apps/disease-api/requirements.txt has an exact version, and tensorflow-cpu (unpinned, no arm64 wheel) is replaced by tensorflow==2.21.0 with keras==3.15.1, so the image also builds on arm64; it is larger than before. The 46-class general model gives the same prediction as with the previously resolved versions. A pytest suite (requirements-dev.txt: pytest, httpx2) covers model selection, the threshold and the general model, and the CI job "Lint FastAPI" now runs it with -W error
  • Brand: the product is named OpenTea DX-OS everywhere (page titles via one title template, sidebar, top bar, login, register and PIN pages, trace pages, PWA manifest and the Keycloak login theme's title), from apps/web/src/lib/brand.ts. The Keycloak theme directory and realm keep the name agrimarket
  • Colours: the accent is now amber (#b45309, was orange #EA580C); the status, feedback and tertiary text colours are darkened where white or coloured text missed 4.5:1; --font-family-sans uses Be Vietnam Pro instead of an Inter font that was never loaded. The login page uses tokens only
  • Tea vocabulary: the app no longer speaks of rice. Placeholders, chat suggestions, mock bulletins, the soil-health warning and the seeded market, bulletin and partner rows use tea; the seed no longer attributes made-up figures to real bodies (its FAOSTAT rows and the bulletin's WTO and Sở NN&PTNT sources are gone, and its one demo price is simulated); the menu item Lịch vụ mùa is now Lịch thu hái; a new zone's season defaults to Lứa 1/<year>; the default commodity of the bulletin, market widget and market API is Chè/Tea (the farmer bulletin page now looks it up by its English name, as the workflows store it, and GET /api/bulletin without ?commodity reads Tea for any tea crop of the HTX, such as Chè Trung du). The manager dashboard's price list shows the 3 newest tea prices, topped up with the newest other commodities only when fewer than 3 exist. A test fails when a rice word is back in the web source or the seed; its only exceptions are the commodity name maps for Comtrade rice and wheat rows
  • Demo data and accounts: the MD2 rice cooperative is no longer seeded, the old seed's backfill of households without an HTX is gone, and weather rows are seeded only for the seeded parcels. manager1, officer1 and farmer1 are removed from the realm
  • Smoke and browser tests use their own smoke_ accounts (smoke_manager_tc, smoke_manager_lb, smoke_manager_none, smoke_farmer_tc, smoke_officer_tc); ensure_user refuses any other name, so tests never reset a demo user's password or TOTP. The A3 story and the screenshots also sign in as farmer_tc, which has no TOTP step; a login does not change the account. The two-htx.sql fixture shares the TC/LB profiles with the seed instead of deleting them, and the household checks are scoped to the fixture rows plus an every-row HTX check
  • Colour tokens everywhere: every *.module.css and *.tsx under apps/web/src takes its colours from globals.css, so all screens follow the dark theme, and the colour guard's baseline is empty. Text on primary fills uses --color-primary-foreground and on success or danger fills --color-ink-inverse; the always-dark surfaces (sidebar, bulletin header) use the sidebar tokens. The guard's exceptions name the exact fixed colours a file may keep, each with a reason and the number of times it may occur: parcel colours drawn on map tiles, and text in Leaflet popups and controls, which leaflet.css keeps white. The lot page's decorative QR preview follows the theme. About 80 variables that globals.css never declared (--color-surface-border, --text-secondary, --radius-lg, ...) now point at real tokens, so borders, muted text and rounded corners that had fallen back to nothing render as designed; @theme names count as undeclared because Tailwind emits them only when a utility needs them. A test fails on any var(--…) that globals.css does not declare, apart from four variables set at runtime
  • QR export rule: every parcel of the lot needs a crop cycle harvested on or before the lot's harvest date (same day counts, in Vietnam time) instead of being in HARVESTED, TENDING or HARVEST_APPROVED. A lot of the previous round can be exported while the next round runs, and a parcel harvested only after the lot date is refused. The withdrawal block is unchanged

Upgrade#

  • Realm: Keycloak imports the realm only when it is missing, and the Admin Console cannot set a user id, which farmer_tc and farmer_lb need. On an existing stack either (a) delete the realm (Realm settings > Action > Delete) and run docker compose -f docker/docker-compose.yml restart keycloak so --import-realm imports it again, which also drops users created at runtime; or (b) delete manager1, officer1 and farmer1, then Realm settings > Action > Partial import of docker/keycloak/realm-agrimarket.json with only Users and Overwrite, which replaces the manager_tc, manager_lb and farmer_tc the old smoke created and keeps the fixed ids. Overwrite also resets the six demo users' passwords and TOTP, so do it before setting up TOTP for a demo. Never delete docker_pgdata: the realm lives in its keycloak database next to all app data
  • Demo data: run npm run seed only on a demo database: it rebuilds the history of the TC and LB parcels with fresh dates. Re-run it before each demo so A3's withdrawal is active again
  • TOTP: managers and officers set up TOTP at their first login; set it up on the demo phone before the demo (README, "Cài TOTP trước buổi demo")
  • Disease diagnosis needs the disease-api container (docker compose -f docker/docker-compose.yml up -d --build --wait web disease-api); make platform-up does not start it
  • Never down -v on the main stack: earlier upgrade notes (1.3.0) suggested recreating the Postgres volume or running docker compose down -v once for n8n. Both delete docker_pgdata, which holds the Keycloak realm and all app data. Use REINDEX DATABASE for the collation change and let n8n create its tables in the n8n schema (README, "Nâng cấp môi trường dev cũ")
  • Storage: no change to docker/.env.local is needed. MINIO_ENDPOINT may be minio or minio:9000

Fixed#

  • web image on arm64: npm install in the Dockerfile could leave out @next/swc-linux-*-musl without an error (npm skips an optional download that fails), and BuildKit then reused that broken layer, so next build failed on arm64 with "Failed to load SWC binary". The install step now fails when the musl SWC binary is missing
  • Photo uploads from the web app: the storage adapters used MINIO_ENDPOINT as a host name while docker/.env.local.example sets minio:9000, so every request of web that touched storage failed with Invalid endPoint: journal photo upload, diagnosis, the farmer's diagnosis history, the officer's disease screens, documents and QR export. Both adapters now accept host or host:port. The browser's presigned PUT to SeaweedFS needed no CORS change
  • Pages hanging after a few clicks in the installed app: the PWA service worker cached every same-origin /api/ GET with NetworkFirst, including the /api/notifications/stream event stream, which never ends. Each page left an open connection behind, and after a few pages the browser's 6 connections per host were taken: requests hung, then came from the cache after 10 seconds, and form posts never went out. The stream now bypasses the cache (NetworkOnly). Found by the A3 browser story, which failed about one run in six before
  • Vietnamese status labels on the demo screens: the trace page that the printed QR opens (/lot/<code>) showed the raw QR_EXPORTED (or READY) pill and now shows Đã xuất QR, Sẵn sàng or Bản nháp; the officer disease queue and review showed PENDING and now show Chờ duyệt; the farmer's diagnosis history mapped a status the reports never take (RESOLVED) and showed CONFIRMED/REJECTED raw, and now shows Chờ duyệt, Đã xác nhận or Bị từ chối. The lot form and the QR export show a refusal without its machine code (WITHDRAWAL_NOT_PASSED:), which the API still returns
  • Market sources on the manager dashboard: the source box counted price rows instead of sources, called a simulated price "nguồn đã kiểm chứng", and with no data named USDA, WTO and Sở NN&PTNT. It now counts distinct real sources only, names simulated sources on their own line ("Nguồn mô phỏng: …"), and names none when there is no data
  • Farmer dashboard weather showed the stored WMO code (for example 3) and now shows its Vietnamese name (U ám)
  • Phone top bar: the product name broke after the hyphen ("OpenTea DX-" / "OS"); it now stays on one line, slightly smaller at 400 px and below
  • Demo lot grade: the seeded lot TC-CHE-A3-001 is graded Loại 1 instead of Grade 1
  • disease-api health check allows 60 seconds for both TensorFlow models to load before failed checks count, so up --wait does not give up on a cold machine
  • Missing report photos: a disease report whose photo is not in storage (the seeded A3 report, or one quarantined by the scanner) now shows "Không tải được ảnh" in the officer queue, the officer review and the farmer's history instead of a broken image
  • e2e session harness: the specs that forge an Auth.js cookie signed it with a fallback secret the Playwright dev server never had, and without htxCode, so 20 of them landed on /login or the NO_HTX notice. playwright.config.ts sets an e2e-only AUTH_SECRET for the dev server and the specs, and one helper (tests/e2e/helpers/forged-session.ts, HTX TC) replaces the 12 copies
  • Chatbot market context: its header said the data covered 48 hours while the query reads 30 days; it now says 30 days
  • Sidebar profile menu: it sat on --card with white text, so in light mode its links were white on white. It now uses the overlay surface and ink tokens
  • Journal reject button: the officer's "Từ chối nhật ký" button set its fill from an undefined variable, so it was transparent and its white text was invisible on the white dialog. It is now a danger fill with --color-ink-inverse text
  • Exported lot status on the public trace page: the snapshot stored at QR export was read before the export, so it kept status: 'READY' and the lot's earlier QR image (normally none); the public page then showed a READY pill and no "locked" banner for every lot exported in the app. The snapshot now stores QR_EXPORTED and the generated QR image. Snapshots already stored with READY are not rewritten, so lots exported before this fix still show READY on their public page (an exported lot cannot be exported again)
  • Journal photo keys: POST /api/journal accepted any photo_minio_key inside para/<htxCode>/, so a farmer could attach any document of their HTX, a manager-only one for example, and receive a signed download URL for it from GET /api/journal. It now accepts only a file key under para/<htxCode>/Areas/Journal/ (400 otherwise), and the journal list signs only such keys; a row stored with another key comes back without a photo. No legitimate photo is lost: the upload route did not exist before this release
  • Farmer diagnosis confidence: the result and history showed the 0–1 confidence as a percentage without scaling (0.988 as 1.0%), and the low-confidence warning always showed. They now show 98.8% and warn only below 70%

1.6.0 - 2026-11-10#

Added#

  • Identity-aware core access: the web app keeps the Keycloak access and refresh tokens server-side in the encrypted session cookie and refreshes them in the middleware when under 30 seconds remain; a failed refresh sends the user to /login. /api/auth/session exposes neither token
  • Tenant isolation: requireTenant() resolves the caller's HTX from the htx_code claim, answering 403 NO_HTX when it is missing or unknown; TenantGuard answers 404 before any write by ID on a record of another HTX. Notifications sent to a whole HTX now carry htx_profile_id
  • Gateway read adapters: parcels, households, lots, journal entries and disease reports are read through Hasura with the user's token. A core outage gives 503 CORE_UNAVAILABLE and a Vietnamese error page, never a fallback to Prisma
  • Internal gateway port 9081 for the web container: not limited per IP, JWT and permissions as on 9080
  • Browser test tests/e2e/tenant/core-tenant.spec.ts (E2E_CORE=1), run in the platform-smoke CI job against a real web container and real Keycloak: isolation between two HTXs, no token in the session endpoint, a live refresh of an expired token, and a Hasura outage

Changed#

  • Disease detection and the local LLM go through the gateway with the user's token; the Groq path is unchanged when a key is set. The LLM route is limited per bearer token
  • Sessions: ssoSessionIdleTimeout and ssoSessionMaxLifespan are 8 hours, matching the app session
  • Accounts: registration and invitations write htx_code; invited managers and officers must set up TOTP (#18)
  • docker/.env.local.example, .env.example: removed DISEASE_API_URL and OLLAMA_BASE_URL, which no service reads. docker/.env.local.example also drops the KEYCLOAK_ISSUER that Compose overrides and adds AUTH_URL; .env.example has no AUTH_URL
  • Documents are namespaced by HTX: keys are para/<htxCode>/.... The list, URL and upload routes derive the namespace from the session and answer 404 for anything outside it, including .. traversal; certificate_keys outside it answer 400. The one exception is para/Archives/Market_Reports/, written by the n8n workflow and holding no tenant data: the list and URL routes may read it, and the document screen shows it without upload

Fixed#

  • Migration drift (#7): migrations now produce the database described by schema.prisma, without dropping any column
  • Login from the Docker image: web built the redirect_uri from HOSTNAME (0.0.0.0) and Keycloak refused it; Compose now sets AUTH_URL
  • Account attributes: Keycloak 24 silently dropped fullName, phone and htxId; the realm now declares them as admin-only
  • HTX assumed to be the first one: every htxProfile.findFirst() now reads the caller's HTX
  • Cross-HTX reads: schedule/harvest, schedule/unscheduled, weather/forecast and the officer soil-health page returned data of every HTX; they now filter by the caller's HTX
  • Role frozen at sign-in: the role is read again from each refreshed access token, and is cleared when no recognised role remains
  • Keycloak admin credentials on a release: the web app also reads KEYCLOAK_ADMIN and KEYCLOAK_ADMIN_PASSWORD, and refuses to fall back to admin/admin in production
  • Self-registration: the middleware no longer answers 401 to the anonymous POST /api/register; new accounts stay disabled until a manager approves them
  • Pre-upgrade sessions: in production a session without a refresh token goes to login instead of showing the no-HTX notice
  • Silent load failures: the officer journal approval and manager farm-zone screens now say when loading failed
  • Anonymous POST /api/register: limited to 5 requests per IP per 10 minutes (429), and anything other than a validation error answers a generic message instead of the raw error text
  • Rejected registrations: the household is unlinked before the Keycloak account is deleted, so a failed unlink can be retried and never leaves the phone taken
  • Object keys from clients: POST /api/journal answers 400 for a photo_minio_key outside the caller's document root, and the journal list signs a stored key only when it is inside that root; other entries come back without a photo. The public certificate route signs a key only inside the document root of the lot's HTX

Upgrade notes#

  • Run migrate (two new migrations: 20261109120000_sync_schema_drift and 20261109130000_notifications_htx), then platform-init, as in the deploy section.
  • On a running release, after up -d --no-build run docker compose --env-file docker/.env.local -f docker/docker-compose.yml -f docker/docker-compose.release.yml restart hasura apisix. Their compose config is unchanged, so they are not recreated: APISIX keeps listening on 9080 only and Hasura lacks the new relationships, and every list answers 503.
  • Keycloak imports the realm only on a new database. On a running realm, set SSO Session Idle and SSO Session Max to 8 hours (Realm settings > Sessions) and declare fullName, phone and htxId as admin-only attributes (Realm settings > User profile).
  • Assign the htx_code attribute to existing accounts in Keycloak, or they receive NO_HTX.
  • Old notifications with neither a recipient nor an HTX are no longer shown; n8n system alerts remain visible.
  • Rows with a null htx_profile_id (households, lots) become invisible and unwritable and must be assigned to an HTX (see scripts/backfill-htx-profile-id.sql).
  • Documents written before this release stay under para/Projects/, para/Areas/, para/Resources/ and para/Archives/. They are no longer listed and are not moved automatically; copy them to para/<htxCode>/... to use them again.
  • Certificates of exported lots whose keys are outside para/<htxCode>/ of the lot's HTX now answer 403 on the public page, and such journal photos stop showing. Copy the object into that folder and update the key to use it again.
  • Set KEYCLOAK_ADMIN as well as KEYCLOAK_ADMIN_PASSWORD in docker/.env.local, or the admin routes answer 500 in production.
  • Set AUTH_URL in docker/.env.local when the web app is not served from http://localhost:3000, and add that URL to the redirect URIs of the nextjs-web client.
  • Known limits: 9081 must stay unpublished, because it is not rate limited per IP; workflows/mattermost-push.json posts disease and harvest events of all HTXs to one webhook; in production, pre-upgrade cookies go to login; /api/dev-login cookies carry no access token, so core reads fail closed; the write path is protected in the application, not in the database; the POST /api/register limit is per process and trusts X-Forwarded-For, clients behind one proxy or NAT share it and a value that is not a valid IP goes to one shared unknown bucket, so it must move to the gateway or a shared store when web runs more than one instance.

1.5.0 - 2026-11-09#

Added#

  • MQTT sensor ingest: mosquitto (no host port, per-HTX device accounts restricted to their own topics) and dxos-ingest validate every message and store it in telemetry.sensor_readings; rejected messages are kept with a reason in telemetry.ingest_rejects. dxos-simulator (profile demo) publishes demo readings
  • Data lifecycle and lineage: dxos-lifecycle moves readings older than 30 days to Parquet (ZSTD) in the dxos-lake bucket in whole UTC days (the cutoff is floored to midnight UTC, so a row can stay hot for up to about one extra day), verifies SHA-256 and row count before deleting the hot rows, and records each export in telemetry.lifecycle_runs and audit.events. python -m dxos_dataops query reads the cold data through the sensor_readings_cold view. Hasura exposes both telemetry tables to managers and officers (scoped by htx_code)
  • In-house LLM: ollama serves qwen2.5:0.5b (Apache-2.0) behind the gateway at POST /api/ai/llm/v1/chat/completions (JWT with the dx-os-core audience, 30 requests per minute); the Ollama management API is not routed. ollama-init pulls the model and checks its ID
  • Dataops image: published to GHCR as opentea-dx-os-dataops (6 images per release with migrate); CI runs the dataops unit tests
  • Dependencies: Mosquitto (EPL-2.0), Ollama (MIT), paho-mqtt (EPL-2.0 OR BSD-3-Clause), duckdb (MIT)

Changed#

  • Deploy order: postgres -> platform-init -> migrate -> platform-init -> the rest -> ollama-init. make platform-up runs it end to end, and the release flow is identical (--profile tools run --rm ollama-init last)
  • migrate moved into docker/docker-compose.yml (profile tools), so the same service is used in dev and release

Fixed#

  • Hasura started before migrations (#17): it is no longer restarted by the smoke test; platform-up migrates first
  • Prebuilt migrate image (#15): apps/web/prisma/Dockerfile ships prisma@5.22.0, the schema and the migrations; the entrypoint URL-encodes POSTGRES_PASSWORD when it builds DATABASE_URL
  • LLM smoke check retries on HTTP 429 and reports failures instead of exiting silently

Upgrade notes#

  • Add DXOS_MQTT_DEVICES (comma list of HTX_CODE:password) and DXOS_MQTT_INGEST_PASSWORD to docker/.env.local (see docker/.env.local.example). The release override makes the broker refuse to start while any of these passwords begins with change_me.
  • Re-run migrate and platform-init (the postgres image gains 04-telemetry.sql); create the mosquitto, dxos-ingest, dxos-lifecycle and ollama containers, then run --profile tools run --rm ollama-init.
  • Release flow: every docker compose command now takes --env-file docker/.env.local before -f; without it Compose used the defaults published in this repo. SeaweedFS refuses to start while MINIO_ACCESS_KEY or MINIO_SECRET_KEY is empty or a placeholder, and Keycloak refuses to start while KEYCLOAK_ADMIN_PASSWORD is empty, admin or begins with change_me. Keycloak reads that value only on a new database, so on a running system also change the admin password inside Keycloak. On existing volumes, POSTGRES_PASSWORD, KEYCLOAK_DB_PASSWORD and N8N_ENCRYPTION_KEY in that file must match the values the volumes were initialised with (until now the docker-compose.yml defaults).
  • On a running release stack, restart hasura and apisix after up -d --no-build (docker compose --env-file docker/.env.local -f docker/docker-compose.yml -f docker/docker-compose.release.yml restart hasura apisix): Hasura loads metadata only at start and APISIX keeps the old inode of its route file. make platform-up does this in dev when the stack is already running.
  • Known limits: the cold view keeps the first-ingested copy of a duplicated key; Mosquitto saves its state every 60 seconds (autosave_interval 60), so messages queued in the last 60 seconds can be lost if the broker crashes; a cold make platform-up is slow because of the Ollama image and the 397 MB model pull; dxos-ingest and dxos-lifecycle share the agrimarket database account (a least-privilege role is Tier 2).

1.4.0 - 2026-11-09#

Added#

  • File quarantine: ClamAV (clamav) and the dxos-scanner service scan new objects in agrimarket-docs and agrimarket-private; infected or unscannable (> 50 MiB) objects are copied to dxos-quarantine/<bucket>/<key> and removed, with verdicts in audit.file_scans. The scanner image is published to GHCR as opentea-dx-os-scanner
  • Audit log: hash-chained, append-only audit.events fed by row triggers on 9 business tables; verify with select * from audit.verify_chain()

Security#

  • ClamAV fails closed on archives: encrypted archives and archives exceeding a scan limit (nesting depth, size, scan time 25 s) are reported as FOUND and quarantined instead of OK. Encrypted documents (for example password-protected PDFs) are still allowed
  • Scanner re-scans replaced objects: a clean row is only trusted while the object's LastModified is unchanged, so an MD5 (etag) collision cannot hide a replacement; the source object is removed only if its etag still equals the scanned one
  • Audit chain head can only advance; verify_chain() proves chain integrity, not capture coverage (a superuser can disable triggers)

Changed#

  • Deploy order: postgres -> platform-init -> migrate -> platform-init (attaches audit triggers to the migrated tables) -> the rest
  • SeaweedFS starts with -volume.max=100

Fixed#

  • SeaweedFS: a PUT to a second bucket returned HTTP 500 (default limit of 8 volumes, 7 per bucket)

Upgrade notes#

  • Re-run platform-init after prisma migrate deploy (the postgres image did not change); recreate the seaweedfs, clamav and dxos-scanner containers.
  • On an upgraded stack, existing objects over 50 MiB in the watched buckets are moved to dxos-quarantine during the first scan rounds.

1.3.0 - 2026-11-08#

Added#

  • Contribution tooling: Bilingual issue templates (bug report, feature request), pull request template and SECURITY.md with a private vulnerability reporting policy
  • Tier 1 API gateway: APISIX on :9080 with JWT validation for /api/data/graphql, /api/workflow/* and /api/ai/disease/*
  • Hasura data API: read-only GraphQL with row-level permissions scoped by the htx_code claim
  • PostGIS and pgvector: the Postgres image now ships both extensions and is published to GHCR as opentea-dx-os-postgres
  • Platform smoke CI job: make platform-up + make platform-smoke run in CI (platform-smoke)
  • Release migrate service: --profile tools run --rm migrate applies Prisma migrations inside the compose network

Security#

  • Gateway: strips the client-supplied x-hasura-admin-secret header on the GraphQL route (it previously let any authenticated user act as Hasura admin); /api/workflow/* and /api/ai/disease/* now require the dx-os-core audience
  • Release override: Hasura refuses to start while HASURA_GRAPHQL_ADMIN_SECRET is empty or a change_me* placeholder

Changed#

  • Gateway CORS: allows the x-hasura-role request header and exposes X-Request-Id
  • Release ports: SeaweedFS S3 :9000 stays published (browsers use presigned URLs on it) until storage moves behind the gateway
  • Hasura JWT issuer is configurable through KC_PUBLIC_ISSUER
  • Object storage: MinIO replaced by SeaweedFS S3 on :9000 (network alias minio kept)
  • Keycloak: TOTP required for staff, tokens carry the dx-os-core audience and the admin-only htx_code claim; the nextjs-web password grant is disabled
  • n8n: tables moved to the Postgres schema n8n
  • Images: all service images are pinned to exact tags
  • Release override: only apisix:9080, web:3000, keycloak:8080 and SeaweedFS :9000 publish host ports; deploy order is postgres, platform-init, migrate, then the rest

Upgrade notes#

  • Dev environments: recreate the Postgres volume (or run REINDEX DATABASE agrimarket; after the alpine to bookworm switch), recreate the Keycloak realm (it is imported only on a fresh database), run docker compose down --remove-orphans, and (dev only — never on production data) docker compose down -v once for n8n. MinIO data is not migrated to SeaweedFS.

1.2.0 - 2026-11-08#

Added#

  • Tag-driven release pipeline: Pushing a vX.Y.Z tag runs the full CI quality gate, publishes versioned web and api images to GHCR and creates a GitHub Release with CHANGELOG notes and a deployment bundle
  • Release compose override: docker/docker-compose.release.yml runs web and disease-api from prebuilt GHCR images instead of building from source
  • Container images on GHCR: web and api images are published to GitHub Container Registry
  • Build-from-source guide and dependency register: Documented building without Docker and added DEPENDENCIES.md with third-party licenses

Changed#

  • Project identity: Renamed the project to OpenTea DX-OS; copyright, contacts and repository links now point to OpenTea Developers
  • README: Rewritten with an architecture diagram, feature overview, setup, testing, release and documentation sections
  • Docker edge images: docker-publish.yml now publishes edge and sha-<commit> images only after the CI Quality Gate passes on main, using lowercase GHCR image names
  • License headers: Added MIT license headers to remaining source files

Removed#

  • BMAD tooling: Removed .agent/, .agents/, _bmad/, _bmad-output/ and docs/bmad-workflow-guide.md; project rules now live in the root AGENTS.md

Fixed#

  • Hexagonal architecture: Resolved layer-boundary violations reported in code review
  • Use case tests: Fixed TypeScript errors caused by newly injected dependencies
  • Git ignore rules: Rewrote a UTF-16 encoded *.tar.gz entry that made git ignore every new file

1.1.0 - 2026-09-15#

Added#

  • Harvest Schedule Calendar: Interactive calendar for scheduling and viewing expected harvest dates
  • Vietnamese Localization (Auth): Translated Keycloak login interface labels to Vietnamese for farmers
  • Soil Health Dashboard: Soil analysis and pest risk visualization with interactive charts
  • Docker Publish CI: Automated Docker image publishing to GitHub Container Registry (GHCR)

Changed#

  • Streamlined user onboarding: removed mandatory email requirement for agricultural profiles
  • Improved QR traceability public page with snapshot immutability and safety guards

Fixed#

  • NextAuth TypeScript compilation issues with generic Route Handlers
  • Leaflet SSR hydration mismatches in Map components

1.0.0 - 2026-09-15#

Added#

  • Farm Zone Map: GIS mapping with Leaflet.js for digitizing agricultural parcels
  • Smart Journal: Farming log tracking with approval workflow and withdrawal days calculation
  • QR Lot Traceability: Full lifecycle tracking from seed to harvest with public QR pages
  • Disease AI Assistant: Computer vision for crop disease diagnosis via FastAPI
  • Audio Bulletin: Automated agricultural news synthesis via n8n and Piper TTS
  • Market Chatbot: LLM-powered market intelligence assistant (Groq Llama-3.1)
  • Keycloak SSO: Role-based authentication (Manager/Officer/Farmer)
  • n8n Data Pipelines: Automated FAOSTAT, Open-Meteo, Frankfurter FX, NASA POWER data sync
  • CI/CD Pipeline: GitHub Actions with lint, test, build, Docker smoke test
  • DEPENDENCIES.md: Full third-party library listing with license information
  • CODE_OF_CONDUCT.md and CONTRIBUTING.md for open-source community

Security#

  • All API routes protected with server-side auth checks (getServerSession)
  • MinIO access via pre-signed URLs only (no client-side SDK exposure)

0.1.0-alpha - 2026-08-11#

Added#

  • Hexagonal Architecture scaffold — Domain / Application / Infrastructure / Presentation layers with sample profile slice (#91)
  • Hybrid AI architecture — Migration to Groq cloud API with Ollama local fallback (#52)
  • PR Deep Review skill — Adversarial code review automation for CI

Fixed#

  • CI: restore package-lock.json, add Zod dependency
  • CI: remove BOM from package.json causing Prisma generate JSON parse error
  • Remove redundant CREATE DATABASE agrimarket to fix CI pipeline

0.0.4-alpha - 2026-08-10#

Added#

  • Design System — CSS custom properties (design tokens), Google Fonts integration (#89)
  • Shared UI components — Button, Badge, Card, Modal, Skeleton with CSS Modules
  • Layout shell — AppShell, Sidebar, TopBar, BottomNav responsive components
  • Unit tests — Jest config + tests for tokens, Button, Badge, Skeleton, Sidebar

Changed#

  • Refactored design system components based on code review findings

Fixed#

  • CI: resolve lint, build, and docker-compose errors

0.0.3-alpha - 2026-08-08#

Added#

  • n8n data pipelines — FAOSTAT commodity sync, Open-Meteo weather cache, Frankfurter FX rates, market bulletin generation (#87)
  • CI/CD workflow for n8n JSON linting
  • HTX profile and Lot public pages

0.0.2-alpha - 2026-08-06#

Added#

  • Full Prisma schema — All 15+ tables with JSONB multi-currency support (#86)
  • Keycloak SSO integration — NextAuth.js v5 + Keycloak OIDC with role-based routing (Manager/Officer/Farmer) (#84)

Fixed#

  • Auth: correct relative import paths, remove unused variables
  • Routing: remove route groups for role directories to fix build conflict
  • CI: update env validation, use npm install for cross-platform lockfile

0.0.1-alpha - 2026-08-04#

Added#

  • Monorepo structure — apps/web (Next.js 14) + apps/disease-api (FastAPI)
  • Docker Compose stack — PostgreSQL 16, Keycloak 24, n8n, Piper TTS, MinIO, Disease API
  • CI/CD pipeline (GitHub Actions) — Lint, build, Docker smoke test
  • Environment validation script (scripts/validate-env.sh)
  • Structure validation script (scripts/validate-structure.sh)

Fixed#

  • Add missing public/ directory for Next.js Docker build
  • Docker Compose healthchecks and initial Next.js page

0.0.0 - 2026-07-09#

Added#

  • Initial project scaffold
  • Business Analysis Document (BA) with HPDI architecture
  • MIT License
  • BMAD Method AI-Native Agile framework initialization
  • Story splitting, testing strategy, and dependency mapping for Epics 1–6
  • Complete project documentation (PRD, Architecture Spine, UX Design, API Contract)

Ghi chú: Dự án DX-AgriMarket đang trong giai đoạn phát triển ban đầu (pre-release). Phiên bản đầu tiên sẽ chính thức được đánh số v1.0.0 khi hệ thống được triển khai hoàn chỉnh với đầy đủ các tính năng MVP theo PRD.