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#
Added#
- AHV primary LLM gateway, centralized chat session memory & multi-turn conversational intake v2 (OpenCoop DX-OS v2.5 Wave 1, Batch 1).
- Anthropic-compatible AHV primary provider (
dxos-agent&apps/web):dxos-agentsupportsDXOS_AGENT_PROVIDER(ollamadefault, oranthropic/openai),ANTHROPIC_BASE_URL/OPENAI_BASE_URLtrailing-/v1normalization,"stream": false, explicitUser-Agent, default modelminimax/MiniMax-M3onahvchat.com, and unblocked execution whenbudget.monthly_limit_usdisnull(budget_has_limit=False).docker-compose.yml(webnon-secretDXOS_AGENT_PROVIDER,dxos-agentbase URLs,dxos-builder-proxyallowlistauto.ahvchat.com) and.env.local.examplekeep real API keys out of git and out of the web container.AgentSettingsUseCase.readselectsdefaultAgentProviderwhen unconfigured per agent and the agent container heartbeat reports the external key. - Centralized chat session persistence & rolling Vietnamese summary:
platform/postgres/init/08-agent.sqladdsplatform.chat_sessionsandplatform.chat_messages(idempotent, without audit triggers so high-frequency turns do not bloat the hash chain);09-telegram.sqladdssession_idandsession_contextonplatform.assistant_requests(cleared toNULLon finish/expiry).PostgresChatSessionRepositoryuses transactional$queryRawqueries, preserving the Prisma core ratchet (27).ChatSessionServicecaps prompt context (summary<= 800 chars, up to 6recent_turns<= 240 chars) and works with internal routeGET/POST /api/internal/agent/sessions/summariesplusdxos_agent/agents/session_summarizer.py(4-point Vietnamese summary once(turn_count - summarized_turn) >= 8). - Multi-Turn Conversational Intake v2:
dxos_agent/agents/assistant.py(PROMPT_VERSION = "m5-a7-v3") adds boundedsessioncontext fencing, natural slot merging, mid-flow natural cancellation (reset: true), and concisereply_vireplies.ChatEngineandZaloIntakeEnginesupport free-form multi-turn slot filling and card edits viasubmitFollowUpwhile preserving deterministic fast paths,guardrails.bounds(boundsReasonVi) enforcement on both typed and AI-extracted out-of-range numbers, and seamless offline fallback. - Mini-app
dragon-fruit, part 5 (PR 5 of 5): events forcoop-financeandcoop-ledger. The plugin now announces, through the core's event box (POST /events, serviceevents),app.dragon-fruit.intake.confirmedwhen a ticket passes the PHI gate and is saved,app.dragon-fruit.intake.voidedwhen it is voided, andapp.dragon-fruit.lighting.advancedwhen the cooperative advanced the electricity of a night-lighting log. Payloads hold identifiers and quantities only (ticket, orchard, household, market, grade, date, weight, nights, kWh), never money or names, as the event contract asks. Migration005_events.sqladdspending_events: each event is written in the same transaction as what it announces, once per (topic, subject), sent right after the commit and, when the core is down, over its limit or answers 5xx, sent again by theorchard-and-cold-watchworker in order; after 12 refusals an event stops and the overview card "Sự kiện lõi chưa nhận" shows it. The manifest declareseventsand now asks for core>=1.36.0, the release that hasPUT/GET /files/content, which the certificate pages already use.coop-financeandcoop-ledgerstill take these records by hand; the operator subscribes a receiver with./dxos events subscribe. - Realistic dev data: generator scaffold, common layer, tea sector and the
demo-datacommand (dev and CI only).python -m dxos_cli demo-data [HTX ...] [--reset] [--seed N] [--anchor YYYY-MM-DD], also./dxos demo data ...andmake demo-data(DEMO_DATA_ARGS=--resetto remove), builds a year of history (the 365 days before the anchor, default today in Vietnam) for the demo cooperatives by writing SQL directly, one transaction per cooperative, with triggers off for the run (so history has noaudit.eventsrows). Packageplatform/cli/dxos_cli/demo_data/:common.py(seededRngper<HTX>:<seed>, Vietnam-day helpers, weather loader with a year-earlier fallback, price series interpolated between dated reference points with seasonal shape and bounded noise, fictional names from parts lists, therd_<HTX>_<table>_<n>key convention, the in-memoryPlanwith foreign-key validation, the parameterised writer, reset and the per-cooperative "already generated" check), a registry of sectors in__init__.py, andtea.pyforTC(60 households) andLB(45): parcels, flushes, daily leaf prices per grade, weighing tickets that respect the pesticide waiting period, journal, input advances, monthly settlement with ledger, roasting batches at the fresh/dry ratio, lots with trace snapshots, certificates (VietGAP; organic at LB), partners, sales and payments, weather cache.platform/demo/reference/tea/defaults.jsonholds every value the research left open, each with why and confidence. A cooperative that is missing or already generated is skipped with the reason. Tests:platform/cli/tests/test_demo_data_common.py,test_demo_data_tea.py(no database). - Shrimp sector for
ST(shrimp.py, pluginshrimp-farm). 24 households with 2 to 4 ponds each (3,000 to 4,700 m2, six canalsK03toK08, pond codesC01,D01, ... by canal letter), two to three crops a year inside the 10 Jan - 30 Sep stocking window (at most 90 days, harvest size and yield from the days of culture and the reference band), the stocking plans (no overlapping intake on a canal), hatcheries with quarantine certificates and seed batches, a daily feeding log whose total is the harvested biomass times an FCR of 1.17 to 1.37 (a few corrected lines), the pond log with doxycycline and iodine lines that keep their withdrawal days (no schedule, weigh ticket or harvest lot inside one), disease reports that lock the pond (no water out while one is open) with canal advisories (a blocked canal takes no water in), harvest schedules, joint lots with three buyers' quotes by size band, confirmed weigh tickets and harvest lots (ST-<yyyymmdd>-<n>from 2, clear of seed-demo's lots), and, in the telemetry tables, the ponds as assets and 21 days of hourly dissolved oxygen, pH, salinity and temperature (dissolved oxygen under 4 mg/L only after 20 mm rain days).platform/demo/reference/shrimp/defaults.jsonholds every value the research left open. Tests:platform/cli/tests/test_demo_data_shrimp.py. - Dragon fruit sector for
BT(dragon_fruit.py, plugindragon-fruit). 35 households with 47 orchards (0.5 to 2 ha, about 1,100 pillars a hectare, codesV01toV47), growing-area codesBT-HTN-003on, two packing facilities, natural and lighting flowering cycles with the lighting logs (kWh from the reference), nine registered pesticides with an interval for each of the six markets (15 days, 21 for the EU:defaults.json, low confidence), a cultivation log in which sprays stay out of the interval before every pick (a few lines corrected), daily prices for every market and grade from the dated reference series, intake tickets, packing batches (one market each, mass balance, a reason above the 8% threshold, the 400 Gy dose in the box spec of US batches), export lots behind the growing-area and packing-facility gate with their day counters, two cold roomsKL-02andKL-03and 21 days of hourly temperature and humidity (out of the 5 to 8 C range only on afternoons of 34 C or more). The plugin's event box (pending_events, migration 005) is filled by its code, not by a trigger, and the generator never writes it, so the history announces nothing. Tests:platform/cli/tests/test_demo_data_dragon_fruit.py. - Realism fixes: at BT every non-void ticket older than three days is in a packing batch of its own market (domestic included), only the last three days stay unpacked; when the anchor is today (the default) the ST pond and BT cold-room readings run up to the current hour (
common.vn_now()), a fixed past anchor stays deterministic. - Common layer, backward compatible:
TableSpec.reset_where(a whole SQL condition for tables keyed by a natural code or a marker uuid, with or without the prefix parameter),marker_prefix,marker_uuid,marker_where(uuid primary keys found again by their text form), andPlan.validateaccepts marker uuids. The tea runner test fixture pins the registry to tea so registering more sectors does not change it. - Realistic dev data: safety fixes after the review of PR #191.
./dxos demo datanow refuses unlessDXOS_ALLOW_DEMO_DATA=1given by the caller on the command line (make demo-dataand the CI smoke set it; the compose file defaults to0, because./dxosuses only the dev compose file, also on a release stack), refuses a database with a cooperative outside the six samples (--allow-other-htxto override) and an anchor in the future, prints the database and host, takes an advisory lock per cooperative, and stops without superuser. The writer and--resetcount the orphans of every foreign key before they commit and roll back on a new one.--resetdeletes exactly what the generator wrote (a key, a full-shape marker uuid, a marker time on sensor readings and BT prices), only for a cooperative that was generated (--force-resetotherwise); catalogue rows (shrimp canals, hatcheries, drugs, BT markets, grades, cold rooms, telemetry assets, lychee products, rice seasons) are added if absent and never deleted, and the BT day counter is no longer written (generated lots are numbered from 501). An error in one cooperative no longer stops the others, a reset still removes the core rows when a plugin was removed, no row is dated on or after a past anchor, tea no longer publishes today's price, the smoke checks more invariants (shrimp, BT lot gate, rice stage order), compares every table on the rerun, fails under CI when a sector it installs is missing, and passes on a fresh database (the MX reset compares only what reset deletes). Invented buyers and irradiation facilities carry invented names. - Realistic dev data: CI smoke and notes.
platform/tests/smoke-demo-data.sh(withdemo-data-fk-orphans.sql) is the new step "Demo Data Smoke" of the jobsector-acceptance, after the rice seed and before the browser stories: it generates, checks row minimums per cooperative, the sector invariants as SQL (lychee PHI, one rice reading per plot and day, BT interval per market, tea PHI, household cooperative), every foreign key for orphans, the second run ("đã có, không thêm gì") and--resetof MX; a sector whose plugin is not installed is skipped with a message.docs/dev-setup.mdgives the measured figures and says shrimp-farm must be 0.7.0 or later; the spec has a status line and "Ghi chú sau triển khai". - Realistic dev data: lychee sector for
LN(pluginlychee-orchard).demo_data/lychee.pybuilds 40 households with 1-3 blocks each, ten spray products (PHI of at least 15 days, a stop-spray policy inplatform/demo/reference/lychee/defaults.json), sprays by pest window (mites, downy blight, stink bug, fruit borer) and harvest lots in May-July (early varieties from 25 May, main crop from 10 June). The PHI gate holds by construction: a spray is only made when its date plus its PHI is not after the block's first harvest, so no lot is flagged and a voided spray never counts. Closed export batches of at most 40 lots for China, Japan, the United States, Australia and the EU (GlobalGAP lots only); US and Australia batches, and a part of the Japan ones, carry the irradiation record at 0.4 kGy or more (the plugin stores kGy). Test:platform/cli/tests/test_demo_data_lychee.py. - Realistic dev data: rice sector for
MX(pluginrice-coop).demo_data/rice.pybuilds 30 households with 1-2 plots, two seasons (the closedLT2526, harvested December to March and closed on 15 April, and the open, mid-cropLT2627), plantings of ST25 sown September to November with the six stages as the plugin'sstageDatesgives them (SOWING done at planting), inputs (seed, basal, urea, panicle fertiliser, blast and leaf-folder products that stay out of their waiting period), daily AWD readings on the enrolled plots (one per plot per day, down to -15 cm then re-flooded, flooded from panicle initiation to ripening) and lots only after the ripening stage.TableSpecgets an optionalreset_wherefor a table with no key column (the stages are deleted with the plantings of a generated household); the other sectors are unaffected. Test:platform/cli/tests/test_demo_data_rice.py.
Fixed#
- A container restart no longer leaves
/tmpread-only for the non-root user. A tmpfs mounted on a path the image does not have (FROM scratch:dxos-outboxand the Go plugins) is created 1777 on the first start but comes back0755 rootafterdocker restartor a Docker restart, sodxos-outboxcould no longer write its heartbeat and stayed unhealthy (seen on a dev stack after Docker Desktop restarted;make platform-upandmake up-corethen stop on it), and a Go plugin could not spill a large upload to/tmp. Every/tmptmpfs indocker/docker-compose.ymland in the app compose written by./dxos installnow setsmode=1777. Existing containers keep the old mount until they are recreated:make platform-uprecreates the core services, and./dxos upgrade <dir>or a reinstall the apps. make up-chatstarts Mattermost. It never could: no script created themattermostdatabase (onlykeycloak), so the container restarted forever ondatabase "mattermost" does not exist, and on an arm64 host (Apple Silicon) the pull failed first because Mattermost publishes amd64 images only.docker/postgres-init.sqlnow creates the database on a fresh volume,make up-chatcreates it on an existing one (idempotent), and themattermostservice setsplatform: linux/amd64(Docker Desktop runs it under emulation; no effect on amd64 hosts).
[1.42.0] - 2026-12-01#
Added#
- Demo cooperative
MX, rice smoke and story, four-sector check (Phase 4, task 7).platform/demo/mx-htx.sqladds "HTX Lúa Tôm Mỹ Xuyên" (htx_mx, phone0900600000, cropLúa ST25, no pack) and the householdshh_mx_1(linked tofarmer_mx),hh_mx_2,hh_mx_3; the realm getsmanager_mx,officer_mxandfarmer_mx(fixed id…0000000000d1, passwordTest1234!, attributehtx_code MX) and./dxos demo accountsaccepts them by name (DEMO_USERS_MX, the default list is unchanged).platform/demo/seed-rice.sh(make demo-seed-rice, called bymake demo-upafter the lychee seed and before the shrimp one) loads the SQL, creates the accounts, installsrice-coopforMXand runsseed-demo MX.platform/tests/smoke-sectors.shgets a[rice-coop acceptance]section (install, health, seed totals and rerun, isolation, a second AWD reading for the same plot and day 409,farmer_mxon another household's plot 403, a lot for the closed season 409, a new lot with anRICE_LOT_RECORDEDaudit row and anapp.rice-coop.harvest_lot.recordedevent ofMX,--purgekeeping every earlier audit and outbox row), and the cleanup purgesrice-cooptoo. New browser storyapps/web/tests/e2e/story/rice-coop.spec.ts(E2E_RICE_COOP=installed; desktop and phone: no "chè" in the sidebar,R3"Luân canh với ao A1", the tillering stage ofR2inDX2627due tomorrow; desktop: an AWD reading forR1today accepted, a second refused). The jobsector-acceptanceseeds MX, runs the rice story and ends on a "Four Sector Check" step (shrimp-farmonly onST,lychee-orchardonly onLN,rice-cooponly onMX,TCandLBkeeptea-core). Static tests inplatform/tests/test_sector_demos.pyandtest_realm_policy.py. Docs:README.md,docs/miniapps.md,docs/dev-setup.md. The smoke, the story and the check run in CI only. - Mini-app
rice-coop, part 1 (v2.0 phase 4, task 6a): schema, store and rules. A Go plugin in theshrimp-farmshape (FROM scratch,pgx/v5 v5.13.0, own schema, nopack). Migration001_init.sqladdsplots,seasons,plantings,stages,input_logs,water_readingsandharvest_lots, every table withhtx_code; the rotation CHECK keeps a pond offRICE_ONLY, andwater_readingsis unique per plot and day. TheStore(pgx implementation plus an in-memory fake for the handler tests) keeps the date windows in the Vietnam day (AWD reading 3 days back, inputs and lots 7), refuses plantings, inputs and lots in aCLOSEDseason but not AWD readings, creates the six crop-calendar stages with the planting, and numbers lots<plot>-<YYMMDD>-<n>. The pure rules (stageDates,dueStages,awdVerdict,rotationValid,harvestEvent) have unit tests; the Postgres tests run inscripts/db-integration.sh(RICE_TEST_DB_URL). No server, manifest or menu yet: parts 2 and 3 add them. - Mini-app
rice-coop0.1.0, part 2 (v2.0 phase 4, task 6b): server, pages, AWD evidence with photo, audit and events. Routes for plots, seasons (plantings with the six-stage calendar, stage edits, close), inputs, AWD water readings and harvest lots, as Go templates with no script (CSPscript-src 'none'), farmers writing only on plots of their own household (checked again under the plot lock). An AWD reading takes an optional JPEG, PNG or WebP photo of at most 10 MB (size and magic bytes checked, then sent through the corefilesservice; the photo page says "Đang quét" or "Bị cách ly" until the scanner has found it clean). Every reading writes the audit entryAWD_RECORDEDand every lotRICE_LOT_RECORDEDplus the eventharvest_lot.recordedinside the transaction, with their own 2 s deadline: the core not taking them means 502 and nothing stored. A change of a plot's household is audited asPLOT_HOUSEHOLD_CHANGED; saving a plot copies the household's account whenever the core answers. Manifestapp.yaml(servicesaudit, files, notify, events), README. Also: the readings list counts its days from the route's Vietnam day, a plot stopped mid-season still takes inputs and lots (not AWD readings or new plantings), and dates before the year 2000 are a rule error. The agent keys, worker, checks, dashboard andMXdemo come in part 3. rice-cooprequires core>=1.38.0(fix of the part 2 review). The AWD photo upload usesPUT /files/content, which the core has had since 1.38.0; the manifest floor was>=1.36.0, so on an older core the plugin would install and every reading with a photo would fail. Spec section 4.5 and the plan state the new floor.- Mini-app
rice-coop0.1.0, part 3 (v2.0 phase 4, task 6c): agent actions, worker, check, dashboard and demo; plus the part 2 review fixes. Actionsrecord_water_level(a message such as "ruộng R1 nước âm 12 cm": the sender is the recorder, the approver isapproved_by_sub, sameAddReadingas the form, so the unique key of the day decides) andnotify_stage_due(household first, office second), bothrisk: low,money: false, nofood_safety(rice has no pre-harvest gate in 0.1.0). Workerseason-watch(undone stages planned in the next 2 days, at most 10), checkplot_awd(judged on the Vietnam day ofRequested-At, window enforced, a farmer sender held to the plot owner), dashboardoverview(four cards) andrice-coop seed-demo MX(refuses any other code; a rerun on any day adds nothing). Review fixes: editing a plot keeps its household unless "Bỏ gắn hộ" is chosen, the form can be preloaded with?edit=<code>, the stage done day is validated before it is compared, the photo upload has its own 30 s client timeout (the hook calls keep 2 s), and the README documents that a stopped plot refuses new plantings and the one remaining orphan-photo case. Review minors of part 3:season-watchsuggests a stage only until its reminder was sent (migration002_stage_reminders.sqladdsstages.reminded_on, cleared when the planned day moves), the dashboard stages card counts active plots only, the demo no longer marksSOWINGdone on the open season, and the README says onlynotify_stage_duecan auto-run. Audit entries and events are written in app mode (Caller{Htx}), not with the forwarded user token that the web accepts only from its own client; the person is named by id (recorded_by_sub,changed_by_sub).
Changed#
- CI:
sector-acceptancenow hastimeout-minutes: 25(it was 45). Measured on the green run 46634870798 (last head of PR #186): 15 minutes 15 seconds from the first step to the last (stack 10:30, smoke 2:13, the three demo seeds 2:01, both stories 0:30); 25 is 1.5 times that, rounded up to a multiple of 5. The total is under 35 minutes, so the job is not split. Spec section 4.6,docs/dev-setup.mdand the roadmap (Epics 4.1 and 4.2 done) carry the measured numbers; the spec has the acceptance map for section 7.
Fixed#
dxos init --template node: a malformed request target no longer kills the process.new URL(req.url)threw on a target such as//[before anything else; the template now answers 400 and keeps serving (its own test sends the request and then/healthz). The Python template only drops that one connection and the Go one is unaffected.- Tenant test for
PUT /api/farm/households/[id]: a household of another cooperative answers 404 and nothing is written (the route was already correct; the case was untested). lychee-orchard: NaN and Inf are refused as spray doses and irradiation doses (they parsed without error and passed the range checks, so a US batch could close with "NaN kGy"); doses that round to 0 at the column scale,area_m2andtree_countabove int4, and an irradiation date before 2000 or after 2100 now give the form message instead of a 500; a block is validated beforeBLOCK_HOUSEHOLD_CHANGEDis audited. A breach found on a lot of a closed export batch now names the batch (batch_code,batch_status) in the audit entry and notifies the officers and managers once per batch.SPRAY_PRODUCT_CHANGED(new product, or a changedphi_daysor approval, with old and new values) andIRRADIATION_RECORDEDare audited in the transaction hook. The README now says the hook deadline is 2 s and that the audit and event reach the core before the plugin commits.rice-coop: the photo upload, the status check and the photo download are made in app mode (the files service accepts the app key and the cooperative), so a client other thannextjs-webworks; a core 4xx on a photo is no longer told to "retry later" and offers a reading without the photo;smoke-sectors.shrecords one reading with a 1x1 PNG forR2today and reads the photo back once the scanner cleared it. Planting a sowing on or before today marks theSOWINGstage done on that day (the seed does the same), so the season page no longer shows it overdue; the dashboard card "Mốc thời vụ trong 7 ngày" counts the undone stages from today to today + 6 and leavesSOWINGout, as the worker does.- Rollback docs: every rollback line to a version before a plugin existed now says to remove that plugin first (
lychee-orchardbefore 1.41.0,rice-coopbefore 1.42.0), inREADME.mdanddocs/dev-setup.md.
Upgrade notes#
- No core database migration and no service change. Compared with 1.41.0,
docker/changes onlydocker/keycloak/realm-agrimarket.json(three demo users), andapps/web/prisma/does not change; there is no new table, column, service, image or init script change. The web image only carries the new version number.make platform-up/make demo-up(or the release steps in the README, "Nâng cấp một cài đặt đang chạy") are enough. - New plugin
miniapps/rice-coop0.1.0 (Go), not installed by default. Nothing changes on a stack until you install it:./dxos install miniapps/rice-coop --htx <CODE>(MXis whatplatform/demo/seed-rice.shruns; use your own cooperative's code otherwise). Its own schemaapp_rice_coopis created by its migrations001_init.sqland002_stage_reminders.sqlat install; the core schemas are untouched. It needs./dxos workerlike every app, and core>=1.38.0(the AWD photo usesPUT /files/content). - Demo:
make demo-seed-riceandmake demo-upnow seed the rice cooperativeMX(demo-upruns it after the lychee seed and before the shrimp one). It adds the cooperative "HTX Lúa Tôm Mỹ Xuyên" and three households (only when missing, fromplatform/demo/mx-htx.sql), creates the accountsmanager_mx,officer_mxandfarmer_mx, installsrice-coopforMXonly and runsseed-demo MX. It needspostgresandwebrunning, and it is safe to repeat. On an existing Keycloak realm the accounts are created by the script through./dxos demo accounts manager_mx officer_mx farmer_mx(set a password with--passwordorDEMO_PASSWORD; without one a missing user has no password). - Not verified on a clean stack:
make demo-upwith all nine_st,_ln,_mxaccounts logging in was not run before this release (CI proves the seeds and themanager_lnandmanager_mxlogins). Also not verified: the pre-harvest lock oflychee-orchardunder real concurrent load outside the Postgres test, the agronomic stage coefficients ofrice-coop, and irradiation dose limits (the plugin checks that the record is complete, not the dose). - Rolling back to 1.41.x needs no script: nothing in the core database or the stack changed. If you installed the plugin, remove it first from the 1.42.0 checkout with
./dxos remove rice-coop --purge: it removes the app, its route and the schemaapp_rice_coop, and keeps the audit history andcore.outbox(omit--purgeto keep the app's data;./dxos remove rice-coopalone leaves the schema). TheMXcooperative, its households and the three Keycloak accounts stay and are harmless on 1.41.x.
[1.41.0] - 2026-12-01#
Added#
- Demo cooperative
LN, jobsector-acceptance, lychee smoke and story (Phase 4, task 5).platform/demo/ln-htx.sqladds the cooperative "HTX Vải thiều Lục Ngạn" (htx_ln, phone0900500000, no pack) and the householdshh_ln_1(linked tofarmer_ln),hh_ln_2,hh_ln_3; the realm getsmanager_ln,officer_lnandfarmer_ln(fixed id…0000000000c1, passwordTest1234!, attributehtx_code LN) and./dxos demo accountsaccepts them by name (DEMO_USERS_LN, the default list is unchanged).platform/demo/seed-lychee.sh(make demo-seed-lychee, called bymake demo-upbefore the shrimp seed) loads the SQL, creates the accounts, installslychee-orchardforLNand runsseed-demo LN; there is no MQTT step. Newplatform/tests/smoke-sectors.sh(households section:POST /api/farm/householdson a no-pack cooperative, the tea search still 403PACK_NOT_ENABLED, accountantPUT403, linked phone 409HOUSEHOLD_PHONE_LOCKED, the unchanged phone 200; lychee section: install, seed totals, isolation, the PHI gate 409 and the 400 window through the gateway, a farmer on another household's block 403, theUSbatch refused without irradiation then closed with anEXPORT_BATCH_CLOSEDaudit row and acore.outboxevent ofLN,--purgekeeping the audit) and the storyapps/web/tests/e2e/story/lychee-orchard.spec.ts(desktop and phone) run in a new CI jobsector-acceptance(timeout-minutes: 45, budget table indocs/dev-setup.md);apps-smokeandbrowser-storeare not changed. The households section needs the shared household page of 1.39.0 (PR #182), so it passes only on a branch that has it. Static testplatform/tests/test_sector_demos.py;test_realm_policy.pyhas three more accounts. lychee-orchard: audit entries and events are written in app mode. Forwarding the user's token made the web answer 401 whenever the token came from a client other than its own (nextjs-web), which failed the first audited write of thesector-acceptancesmoke (token of thedxos-smokeclient). The plugin now calls the core for audit and events asCaller{Htx}with the app's key, asdragon-fruitdoes; the person is named by id in the details (recorded_by_sub,voided_by_sub,changed_by_sub,closed_by_sub). The household list is still read with the user's token (Hasura needs it).lychee-orchard, review fixes of part 3: thephi_clearcheck now also refuses a farmer's draft for a block that is not the sender's household's and a draft dated outside [today - 3, today] (so the sender hears it before approval);notify_phi_endingtells the household first and the office second;seed-demoaccepts onlyLN; the audit entry ofrecord_harvest_lotcarries the ids of the recorder and the approver; the preview ofnotify_phi_endingshows the day as dd/mm/yyyy (labelphi_until_vinext to the ISOphi_until).lychee-orchard0.1.0, part 3 (Phase 4, task 4c): agent actions,phi-watch, check, dashboard andseed-demo. Actionsrecord_harvest_lot(from a message,food_safety: true,risk: medium: never auto-run, bounds 10 t, checkphi_clear) andnotify_phi_ending; the first goes through the sameRecordLotas the form, withsource = message, the sender as recorder, the approver inapproved_by_sub, and for a farmer sender the block must belong to their household (judged under the block lock). Workerphi-watch(every 1440 minutes, at most 10 blocks whose interval ends tomorrow and that have no lot dated tomorrow), checkphi_clear(judged on the Vietnam day ofRequested-At, else today), dashboardoverviewwith four cards, andlychee-orchard seed-demo <HTX>(the demo of LN; a rerun on any day adds nothing). Fix round of 4b: the household account is copied again at every block save while the core answers, a change of household is audited (BLOCK_HOUSEHOLD_CHANGED), the core call inside a transaction hook has its own 2 s deadline and a deadline error is a 502, the db-integration step counts theTestPGtests of the package instead of a fixed number. The plugin is complete as a plugin; the demo accounts, install and smoke come in task 5, the release step stays with the controller.lychee-orchard0.1.0, part 2 (Phase 4, task 4b): server, pages, audit and export events. Routes/blocks,/products,/sprays,/lots,/batches(Go templates, no script, light and dark by/dxos-app.css), gateway guard and claims copied fromshrimp-farm,app.yaml(requires.core >=1.36.0, servicesaudit,notify,events; the agent keys, dashboard and demo data come in task 4c). Every write runs in one transaction with the block lock and its audit entries:HARVEST_LOT_RECORDED,SPRAY_VOIDED,PHI_BREACH_FOUND,PHI_BREACH_CLEARED,EXPORT_BATCH_CLOSED, and the eventexport_batch.closed(output by household, no names, no money).TxHooknow receives what was written (spray id, lot code, lots newly flagged or cleared). A farmer writes sprays only on a block whose household account is theirs, judged on the locked block row (OwnerSub). Today is always the Vietnam day. When the core does not take the audit entry or the event the page answers 502 and nothing is stored. CI: thedb-integrationjob now runs the lychee Postgres tests against its throwaway database. Review fixes of part 1: dose and kGy capped under the column types, lots locked in lot-code order on the spray path, indexes onharvest_lots(export_batch_code)and(harvested_on), READ COMMITTED pinned, the Postgres test guard reads the parsed DSN.lychee-orchard, part 1 (Phase 4, task 4a): schema, store and rules, not yet a runnable app. New Go pluginminiapps/lychee-orchardin theshrimp-farmshape (pgx/v5 v5.13.0,FROM scratch): migration001_init.sql(orchard blocks, spray catalogue, spray log, harvest lots, export batches; every table hashtx_code; no CHECK for the PHI gate, because a CHECK cannot readspray_logs), aStoreinterface with the pgx implementation, and pure rules inrules.go. Rules: harvest date within [today - 3, today] and spray date within [today - 7, today] in the Vietnam day; a lot is allowed only whenharvested_on >= max(sprayed_on + phi_days)over every non-void spray of the block, whatever its date; a spray recorded later flags the lots it covers (phi_breach) and a void recomputes the flags; the lot, spray and void paths lock the block row (SELECT ... FOR UPDATE) before reading sprays or lots; export batches hold at most 40 lots, need no breached lot, and need a full irradiation record forUSandAU. Unit tests, a fake store for the next tasks, and a PostgreSQL test (setLYCHEE_TEST_DB_URL; refuses hosts other than127.0.0.1andlocalhost) that runs a spray and a lot on one block at once 50 times. The server, pages, manifest and actions come in the next tasks, so the plugin is not installable yet and the release step stays with the controller.
Upgrade notes#
- No core database migration and no service change. Compared with 1.40.0,
docker/changes onlydocker/keycloak/realm-agrimarket.json(three demo users), andapps/web/prisma/does not change; there is no new table, column, service, image or init script change. The web image only carries the new version number.make platform-up/make demo-up(or the release steps in the README, "Nâng cấp một cài đặt đang chạy") are enough. - New plugin
miniapps/lychee-orchard0.1.0 (Go), not installed by default. Nothing changes on a stack until you install it:./dxos install miniapps/lychee-orchard --htx LN(whatplatform/demo/seed-lychee.shruns), or for another cooperative the same command with its code. Its own schemaapp_lychee_orchardis created by its migration001_init.sqlat install; the core schemas are untouched. It needs./dxos workerlike every app, and core>=1.36.0. - Demo:
make demo-seed-lycheeandmake demo-upnow seed the lychee cooperativeLN(demo-upruns it between the TC seed and the shrimp seed). It adds the cooperative "HTX Vải thiều Lục Ngạn" and three households (only when missing, fromplatform/demo/ln-htx.sql), creates the accountsmanager_ln,officer_lnandfarmer_ln, installslychee-orchardforLNonly and runsseed-demo LN. It needspostgresandwebrunning, and it is safe to repeat. The realm filedocker/keycloak/realm-agrimarket.jsonis imported only into an empty Keycloak, so on an existing realm the accounts do not appear by themselves: the script creates them by calling./dxos demo accounts manager_ln officer_ln farmer_ln(with--password "$DEMO_PASSWORD"when you set it; without it a missing user is created with no password, so set one with./dxos demo accounts --password ... manager_ln officer_ln farmer_ln). No realm reimport is needed. - CI: new job
sector-acceptance(smokeplatform/tests/smoke-sectors.sh, the demo seeds and the lychee browser story;timeout-minutes: 45), and thedb-integrationjob now also runs the lychee Postgres tests (scripts/db-integration.sh).apps-smokeandbrowser-storeare unchanged. - Rolling back to 1.40.x needs no script: nothing in the core database or the stack changed. If you installed the plugin, remove it first from the 1.41.0 checkout with
./dxos remove lychee-orchard --purge: it removes the app, its route and the schemaapp_lychee_orchard, and keeps the audit history andcore.outbox(omit--purgeto keep the app's data). TheLNcooperative, its households and the three Keycloak accounts stay and are harmless on 1.40.x.
[1.40.0] - 2026-12-01#
Added#
dxos-clipip package withdxos init,validateandreuse(Phase 4, SDK).platform/cliis now installable (pyproject.toml, namedxos-cli, version read fromdxos_cli/sdk_data/core-version.txt, Python 3.11+, compatible dependency ranges; the operator commands keeppsycopgbehind theoperatorextra). Thedxoscommand of the package has only the SDK commands:init <id> --template python|node|gowrites a runnable plugin (greeting page from the token claims, openGET /healthz, the gateway key check, a test and a Dockerfile; the listen address comes fromDXOS_APP_LISTEN, default:8080) and then runsvalidateandreuse;validateis the formercmd_validate(moved todxos_cli/sdk.py,./dxos validatestill goes through Docker and is unchanged);reuseis an approximate per-file SPDX header check that does not replacereuse lint. Outside the repository the commands use the schema,dxos-app.cssand core version packaged insdk_data/(copies kept equal by the newscripts/sdk-sync.sh,make sdk-sync,make lintand the CI step "SDK Data Check"); inside it, or withDXOS_REPO_ROOT, they use the repo files.REUSE.tomlgets an override entry for the template files, whose headers hold the__YEAR__ __PUBLISHER__placeholders.dxos dev <dir>runs the plugin and stands in front of it as a loopback-only (127.0.0.1) gateway and login simulator, for development only: an unsigned token with the claims the plugins read, a random gateway key per run, routes matched with the manifest rules, a foreignHostorOriginandSec-Fetch-Site: cross-siterefused, the whole process group stopped on exit. It does not simulate the agent, the actor, the core services (answered 501CORE_NOT_SIMULATED) or Hasura. CI jobsdk-quickstart(templates python, node, go on Python 3.12, python also on 3.11) installs the package from the repo path outside the repository and runs init, validate, the template test, dev and a health check under a 300 second limit, then builds each template image and checks/healthzof the running container; it does not need the stack.docs/miniapps.mdsection 9 is now "Năm phút vớidxos" and the Go skeleton block points to the Go template;docs/dev-setup.mdhas the post-release check of the pip install.
Upgrade notes#
- No database migration and no service change. No new table, column, service, image or init script change; only the web image carries the new version number, and
platform/cliis a separate pip package that is not part of any image.make platform-up/make demo-up(or the release steps in the README, "Nâng cấp một cài đặt đang chạy") are enough. - New CLI package for plugin authors. Install it outside the repository with
pipx install "dxos-cli @ git+https://github.com/maiychrus25/[email protected]#subdirectory=platform/cli"(Python 3.11 or later; not on PyPI), or withpip install -e platform/cliinside a clone. The commands (dxos init,validate,reuse,dev) are listed inplatform/cli/README.mdand indocs/miniapps.mdsections 9 and 11; the root README has a short block that points there. psycopgmoved to theoperatorextra. A plainpip install dxos-clino longer installs it. Only the operator commands (python -m dxos_cli, which thedxosbash script runs inside the CLI image) need it; the CLI image still installspsycopgfromplatform/cli/requirements.txt, so nothing changes for./dxos. Installdxos-cli[operator]yourself only if you run those commands on the host.- The bash
./dxosis unchanged, including./dxos validate, which still goes through Docker. The pipdxoscommand is a different, SDK-only entry point. - Rolling back to 1.39.x needs no script: nothing in the database or the stack changed.
[1.39.0] - 2026-12-01#
Added#
- Household page and API for every cooperative (spec
2026-12-01-v2-phase4-sectors-and-sdk-design.md§4.1, Phase 4 Task 1)./manager/householdsis new (menu "Nông hộ" for managers, after "Quản lý thành viên");/officer/householdsnow shows the same shared list to every cooperative. A cooperative withouttea-coresees members and contacts only: no parcel, area, share bar or detail link, and the "Quản lý thành viên" list has no parcel or area columns (table and CSV). Each household has a Sửa button that edits owner name, phone and address in place. The paths/manager/households,/officer/households,/api/farm/householdsand/api/farm/households/<id>are core inpack-paths.ts; the tea household detail pages stay tea. The Telegramhousehold.addaction admits managers as well as officers.
Changed#
POST /api/farm/householdsadmitsmanageras well asofficer(other roles still 403).PUT /api/farm/households/[id]admitsofficer,managerandfarmer(own household only);accountantgets 403 (it used to be able to edit). Changing the phone of a household linked to an account answers 409HOUSEHOLD_PHONE_LOCKED; the chathousehold.editaction is refused with the same rule.- Form controls of the households page are at least 44 px tall (tap target).
Upgrade notes#
- No database migration. No new table, column, service or init script change, so
make platform-up/make demo-up(or the release steps in the README, "Nâng cấp một cài đặt đang chạy") only need the new web image. The web image must be rebuilt or pulled: the households page, the two household routes and the menus are web code. - The household list page and API are core for every cooperative.
/manager/households,/officer/households,/api/farm/householdsand/api/farm/households/<id>no longer needtea-core, so a cooperative of any sector (for exampleST, with no pack) reads the shared list. A cooperative withouttea-coresees members and contacts only; the tea household detail pages stay tea.GET /api/households(the tea route) still answers 403PACK_NOT_ENABLEDthere. - Managers can create households.
POST /api/farm/householdsadmitsmanageras well asofficer;accountantandfarmerstill get 403. The Telegramhousehold.addaction is open toofficerandmanagerfor the same reason. - Accountants can no longer PUT a household.
PUT /api/farm/households/<id>admitsofficer,managerandfarmer(own household only);accountantgets 403 where it used to be able to edit. Tell any accountant who edited households that the page is now read-only for them (Hasura read access from 1.38.0 is unchanged). - A linked household's phone is locked. Changing
phoneof a household that has akeycloak_user_idanswers 409HOUSEHOLD_PHONE_LOCKED(the chathousehold.editaction is refused the same way); owner name and address of that household can still be changed. - Members lists hide the parcel columns for non-tea cooperatives. "Quản lý thành viên" (table and CSV export) has no parcel or area columns when the cooperative lacks
tea-core; a script that reads those CSV columns for a non-tea cooperative must stop expecting them. - Rolling back to 1.38.x needs no script (README, "Lùi về bản trước",
PREV=1.38.0). Nothing in the database changed, so the web goes back and nothing else; the households page of a non-tea cooperative is then gone again.
[1.38.0] - 2026-12-01#
Added#
- Phase 3 acceptance map and the upgrade path 1.33.0 to 1.38.0 (v2.0 phase 3, task 8): the 13 acceptance items of the Phase 3 spec are mapped to the CI assertions that prove them (
## Ghi chú sau triển khaiofdocs/specs/2026-12-01-v2-phase3-agentic-workshop-design.md; item 8 of the Zalo flow is deferred until the Zalo API is confirmed).docs/dev-setup.mdgets the 1.38.0 row of the upgrade table and the section "Chưa kiểm với API Zalo thật". CI:browser-coreseeds one decided and three open proposals (platform/tests/seed-command-center.sh) and runstests/e2e/agent/command-center-v2.spec.tson desktop and mobile, light and dark. PUT /files/content?key=for plugins (app core API, servicefiles): a plugin ondxos-apps-net(internal, onlyapisixandpostgres) cannot reach theupload_urlofPOST /files, which is signed for the public S3 address, and its pages run without script, so neither the app nor the browser could upload a file. The app now sends the bytes through the gateway: the key must be onePOST /filesgave the same app and cooperative (403KEY_NOT_OWNED), is written once (409FILE_EXISTS, so bytes the scanner judged are never replaced), the body is at most 10 MB (413FILE_TOO_LARGE, checked onContent-Lengthand again while reading), and its first bytes must match the declared type (400). The object lands inagrimarket-privateand waits fordxos-scannerlike any upload, soGET /files/statussayspendinguntil it is scanned. Needed byshrimp-farmfor the quarantine certificate of a seed batch (spec 2026-11-30, PR 2).GET /files/content?key=is its pair for reading: the bytes of a clean file (409FILE_NOT_CLEANwhile pending, quarantined, missing or replaced during the read; 413 over 10 MB), withnosniffandno-store. A plugin page cannot redirect to the presigned URL ofPOST /files/download-url(the web answers 502 for a redirect out of/apps/<id>/), soshrimp-farmstreams quarantine certificates and incident photos back itself as an attachment.shrimp-farm0.7.0 — canal routes and stocking plans (spec2026-11-30-shrimp-farm-v1-and-coop-plugins-design.md, PR 1, Q0 and Q1). Migration002_canals_and_plans.sqladdscanal_routes(code, name, tide zone,water_intake_statusOPEN/ADVISORY/BLOCKED_DISEASE), six columns onponds(household_id,canal_route_code,farming_modeTHAM_CANH/QCCT,aquaculture_reg_no,vietgap_certified,disease_lock,withdrawal_until; every one nullable or with a default, so the ponds of 0.1.0 stay valid as intensive ponds without a canal) andcrop_plans. New pages/canals(manager, officer) and/plans(all three roles read; manager and officer plan and cancel). Two PLANNED plans on one canal route may not share a water intake day (both ends count); the check holds a row lock on the canal, so plans saved at the same moment are checked one after the other. The plan page sums the planned seed per season. The household of a pond is read from Hasura with the user's token and must be one the user can see; a pond with open plans cannot change canal.seed-demoadds canalsK1(A1, A2) andK2(B1).shrimp-farm0.7.0 — hatcheries, quarantine certificates and seed batches with the Seed Gate (spec PR 2, Q2). Migration003_seed_batches.sqladdshatcheries,quarantine_certsandseed_batches; the batch's foreign keys to its certificate, plan, hatchery and pond all carryhtx_code. New pages/hatcheries(only the manager approves a hatchery),/certificates(the photo or PDF goes to the core's file store throughPOST /filesandPUT /files/content, at most 10 MB, type decided from the bytes; the list asks the core for each scan result and opens clean files throughGET /files/content) and/seed-batches. A batch is saved only when the core says its certificate's file iscleanat that moment (422 whilependingorquarantined, 502 when the core cannot say), from an approved hatchery, with a certificate of that hatchery. End-of-season survival scores the hatchery. The manifest declares thefilesservice (requires.core >= 1.36.0).shrimp-farm0.7.0 — drug catalogue, pond log, disease reports and canal advisories (spec PR 3, Q4 to Q6). Migration004_pond_health.sqladdsaquaculture_drugs,pond_events(never changed, one correcting line each; a DRUG line keeps the drug's withdrawal days),disease_incidents,water_advisoriesandponds.household_user_id. Pages/drugs(only the manager approves),/pond-log(a farmer writes only for their own household's ponds; an officer's line for a household is marked on behalf) and/incidents(up to three photos through the core's file store), and an advisory form on/canals. Gates: a DRUG line setswithdrawal_untilagain from every uncorrected DRUG line, and a lot cannot be closed until the withdrawal has passed (409, the lot point of the Triple Red-Lock); an open disease report locks the pond and refuses letting water out (409); a canal blocked for disease refuses taking water in (409). A report tells the manager and the officer the pond, and the households of the other ponds on the canal only that their canal has a suspected pond; a farmer sees only the reports of their own ponds. An advisory sets the canal's intake state and tells its households.shrimp-farm0.7.0 — harvest schedules, joint lots, size-banded quotes and weigh tickets with the Dual-Confirm Gate (spec PR 4, Q7). Migration005_harvest_sales.sqladdsharvest_schedules,lot_rfqs,lot_rfq_items(a schedule in one lot only),buyer_quotes,weigh_tickets(whole grams and dong; net and amount rounded half up) andharvests.rfq_idwith a unique index per joint lot and pond. Pages/harvest-schedulesand/lots(only the manager awards a buyer), and a public page per ticket where the buyer, who has no account, confirms through a 128-bit address shown as a QR code at the pond bank. The Triple Red-Lock now refuses a schedule inside the withdrawal, a weigh ticket while today is inside it, and closing while today or the day the lot is dated is inside it (so a harvest cannot be dated back into the withdrawal, on the Harvests page too). Making a joint lot checks again, under a share lock of the pond row: a pond drugged after its schedule cannot be offered for a harvest day inside the withdrawal. Closing needs every live ticket confirmed by the member (or by the office on their behalf, recorded) and the buyer, then makes one traceable, audited lot per pond; closing again after an audit failure makes no second lot. A farmer sees the lots and tickets of their own ponds; quotes are public to the lot's members. The menu keeps "Thu hoạch" before "Lịch thu hoạch", which the browser story finds by text.shrimp-farm0.7.0 — pond-watch reminders (spec section 4). After the oxygen alerts (while keeping event-driven oxygen threshold alerts and Telegramrecord_feedingintake from 0.2.0/0.3.0), the scheduled worker suggestsnotify_pond_reminderon the first day of the 20 to 45 and 60 to 65 day watch windows after the newest stocking of a pond (subject per pond, batch and window, so each window is announced once), and for a harvest in the next 14 days that falls inside a drug withdrawal written after it was scheduled. The approved action checks the reason again, tells the manager and the officer, then the pond's household when it has an account on file. A failure to read the reminders does not drop the oxygen alerts.coop-finance0.1.0: joint purchase and internal lending for every cooperative (spec2026-11-30-shrimp-farm-v1-and-coop-plugins-design.md, PR 5, Q3). A horizontal Go plugin (FROM scratch, nopack). The manager sets the lending pool and its two caps (default 5 %, at most 5 %, also a database CHECK); the manager and the accountant make one contract per household and season (household read from Hasura with the user's token) and record repayments; joint purchases compare supplier prices and the manager picks one; deliveries on credit become disbursements only when the member themself confirms receipt, written to the core's audit chain (LOAN_DISBURSED,LOAN_REPAID) before they count. Gates, run under a row lock on the cooperative's pool: a household's principal plus pending deliveries may not pass the member cap; no new delivery or confirmation anywhere while overdue principal is above the overdue cap; a pending delivery is never debt. Money is whole dong, shares basis points. The legal reading of the caps is not yet confirmed (README). CI runs itsgo vetandgo test.coop-ledger0.1.0: the cooperative's ledger, season settlements and the yearly distribution (spec2026-11-30-shrimp-farm-v1-and-coop-plugins-design.md, PR 6, Q8 and Q9). A horizontal Go plugin (nopack). Postings split INTERNAL (with a member) and EXTERNAL, carry the member's use of services, are idempotent per voucher and never changed. A season settlement is sales less principal, interest and fee (a database CHECK), issued with a due day exactly seven days later and audited; a negative net stays owed (issued, never marked paid: no button, and the update requiresnet_vnd >= 0). The yearly distribution keeps a fund share of the internal result, never shares a loss or the external result, and divides the rest by use of services with the largest remainder method so the lines add up to the dong; a supervisory-board member named in the app (the core has no supervisor role yet), never the preparer (also a CHECK) nor a manager, checks it, then the manager records the general assembly's approval, audited. Issuing a settlement and recording the approval write their audit event inside the transaction, before the commit (asConfirmDeliveryincoop-finance): when the core does not take the event, nothing changes and the page answers 502. Members see their own issued settlements and approved benefit slips. Untilcore.outbox, amounts are entered by hand. The legal reading is not yet confirmed (README). CI runs itsgo vetandgo test.- Hasura:
accountantreads the households of its cooperative (core_households.yaml:id,name,keycloak_user_id,htx_profile_id;core_htx_profiles.yaml:id,name,htx_code), filtered onhtx_codewith thehtx_code <> ''guard.coop-financeandcoop-ledgerqueryhouseholdswith the accountant's own token andX-Hasura-Role: accountant; before this the query failed and the pages answered 502. Pinned byplatform/tests/test_hasura_accountant_permissions.py. - Mini-app
dragon-fruit0.1.0, part 1 (specdocs/specs/2026-11-30-dragon-fruit-plugin-design.md, PR 1 of 5): a Go plugin for a dragon fruit cooperative that exports, built on theshrimp-farmpattern (FROM scratch, uid 10001, pgx, no script in the pages) and on the plugin contract only, with its tables in schemaapp_dragon_fruit(migration001_init.sql): export markets and what each asks of a lot (growing-area code, packing facility code), growing-area codes (PUC) with markets and validity, packing facilities (PHC), orchards with pillar count, variety and growing-area code, flowering cycles (several open at once on one orchard: natural and lighting overlap, moving one way from open to harvesting to closed) and night-lighting logs (pillars lit capped by the orchard's pillars; only a manager or officer marks electricity the cooperative paid in advance). Every table hashtx_codeand every foreign key is the pair(htx_code, id). Certificate scans (VietGAP, PUC, PHC) are sniffed from their bytes (PDF, JPEG, PNG, WebP, up to 10 MB), stored through the core'sfilesservice (POST /filesandPUT /files/content) and streamed back as attachments throughGET /files/contentonly when the scanner found them clean. Household names come from Hasura with the user's own token, for managers and officers only. The manifest declares thecold_roomasset type (AgriWarehouse, temperature and humidity) and an overview dashboard. CI runs itsgo vetandgo test. - Mini-app
dragon-fruit, part 2 (PR 2 of 5): the multi-market PHI gate and intake tickets. Migration002_intake_phi.sqladds the pesticide catalogue (markets that ban a product), the pre-harvest interval of each product per market, the cultivation log, fruit grades, daily prices and intake tickets. The log is append-only: a trigger refusesUPDATEandDELETE, and a wrong line is replaced once by a correcting line. Before a ticket is saved, the store locks the orchard (SELECT ... FOR UPDATE, which writing a log line also takes), reads every spray of the last 365 days up to the harvest date (a correction stands for the line it replaces) and the pureCheckPHIrefuses with 409 when a product is banned for the market, has no interval declared for it (fail closed), or the harvest date is before the spray date plus the interval; the Vietnamese message names the product, the market and the first date allowed ("còn 11 ngày"), and the same orchard still delivers to a market whose interval has passed. The unit price is copied from the day's price list into the ticket; a missing price is also a 409. Voiding a ticket needs a reason. Two more overview cards: today's intake in kilograms and tickets. - Mini-app
dragon-fruit, part 3 (PR 3 of 5): packing batches, export lots, the public trace page and labels. Migration003_packing_lots.sqladds the cooperative's settings (shrinkage threshold, default 8%), packing batches, the tickets of each batch (UNIQUE (htx_code, ticket_id)), export lots (one per batch) and a per-day lot counter. A batch holds tickets of one market only (market segregation gate, 409), its input weight is the sum of its tickets and its output may not exceed it (mass-balance gate, 422; also aCHECK); a shrinkage above the threshold needs a reason and notifies the managers. A ticket that went into a batch can no longer change or be voided (trigger), and batches and lots are append-only. A lot is made behind the PUC & PHC gate: for a market that requires them, every orchard of the batch needs a growing-area code listing the market and valid on the export day, and the facility a code listing the market and not expired; one orchard failing blocks the whole lot (409) and the message names every orchard that fails. Lots are numberedDF-<HTX>-<YYYYMMDD>-<n>in the same transaction that writesEXPORT_LOT_CREATEDinto the core's SHA-256 audit chain, so no lot exists without its event. The public page/public/<HTX>/lot/<token>(a random 128-bit token) shows growing-area codes, flowering cycles, harvest dates, sprays with their interval for the lot's market, the packing facility, certificates on file and the chain verdict, never a household, a person or a price; a printable label carries the lot and the QR code of that page. - Mini-app
dragon-fruit, part 4 (PR 4 of 5): cold rooms, theorchard-and-cold-watchworker and the BT demo. Migration004_cold_watch.sqladds cold rooms (each registered as a core entity of kindcold_room, so its temperature and humidity sensors publish over MQTT) andwatch_alerts, which keeps the worker from suggesting the same alert twice a day. Lots name an active cold room, and the public trace page shows the room's temperature range since packing (read in app mode, cached for a minute). The worker, every 30 minutes, only suggests: a cold room outside its range (default 5 to 8 °C) on a current reading, the orchards to harvest within 7 days whose interval for CN or EU has passed (and whose growing-area code allows the market), and growing-area or packing facility codes that expire within 30 days; three approved actions (notify_cold_room,notify_harvest_ready,notify_code_expiry) read the data again and notify through the core, and a 429 of the core becomes a 424 with a Vietnamese explanation.dragon-fruit seed-demo <HTX>andmake demo-seed-dragon-fruit(platform/demo/seed-dragon-fruit.sh, called bymake demo-upafter the shrimp step) make the scene of spec section 5 for cooperative BT: four orchards on two growing-area codes, overlapping cycles, a lighting advance, a fungicide sprayed 10 days before, the usual markets, grades and prices, and 24 hours of cold room readings ending above 8 °C. New demo cooperative BT (demo-cooperatives.ts,platform/demo/bt-htx.sql), realm usersmanager_bt,officer_bt,farmer_bt(./dxos demo accountsaccepts them by name), aBTbroker account indocker/.env.local.example, and a CI step that seeds BT and runs the storyapps/web/tests/e2e/story/dragon-fruit.spec.ts. The finance part (PR 5:core.outboxtocoop-financeandcoop-ledger) follows in a separate PR. - Mini-app
dragon-fruit, review fixes of #161 and #173: a farmer writes cultivation log lines and night lighting only for the orchards of their own household (checked through Hasura with the farmer's own token; no answer from the core writes nothing, 502; another household's orchard or one with no household is 403), and corrects only lines they wrote themselves, so no farmer can lift another household's PHI wait by correcting a spray to watering. Certificate uploads and downloads now go through the core gateway routesPUT /files/content?key=andGET /files/content?key=(streaming attachments instead of redirecting out of/apps/dragon-fruit/). The dragon fruit palette moved from an inline<style>(which the web proxy'sstyle-src 'self'drops) to the app's stylesheetstatic/dragon-fruit.css, served at/field/dragon-fruit.cssfor signed-in pages and/public/<HTX>/dragon-fruit.cssfor the public trace page, and the Playwright story waits for each iframe formPOSTand frame navigation before reading gate alerts. The specdocs/specs/2026-11-30-dragon-fruit-plugin-design.mdis now in the branch. - Trung tâm duyệt v2 trên
/manager/aivà/officer/ai: làn «Cần duyệt» nhóm theo rủi ro, duyệt theo lô (tối đa 50, cùng loại), chip luật từ verdict đã lưu, ảnh bằng chứng, làn «Tự chạy» với nút Chặn và liên kết?proposal=<id>mở đúng thẻ. - Trang
/platform/zalocó ô App ID và khoá ký webhook (khoá chỉ ghi).
Upgrade notes#
- No migration and no new core table or column. The release has no new service and no init script change. Build or pull the new web; the usual
make platform-up/make demo-up(or the release steps in the README) is enough. - Restart Hasura. The metadata gives the
accountantrole read access tohouseholdsandhtx_profilesof its own cooperative (coop-financeandcoop-ledgerread them with the accountant's token). Hasura reads metadata only at start:make platform-up/make demo-uprestart it, a release package needsrestart hasura apisix. - New core route for apps.
PUT /files/content(servicefiles) lets a plugin on the internal app network upload a file it got a key for.shrimp-farm0.7.0 uses it for certificates, so its manifest requires core>=1.38.0: upgrade the core first, then run./dxos upgrade miniapps/shrimp-farm. The app migrations002to005belong to the app and run on that upgrade;coop-financeandcoop-ledgerare new apps that nobody has installed until./dxos install. shrimp-farm0.7.0 needs core 1.38.0 or later (requires.core >=1.38.0; it was>=1.36.0while the file upload route did not exist yet)../dxos upgraderefuses it on an older core.coop-finance0.1.0 andcoop-ledger0.1.0 need core 1.38.0 or later (requires.corewas>=1.27.0): they read households with the accountant's own token, which Hasura allows only with this release's metadata.- The command center is UI only.
/manager/aiand/officer/aishow the two lanes, batch approval, rule chips and evidence photos from data 1.34.0 to 1.37.0 already store. Nothing in Zalo changes: inbound stays closed (ZALO_INBOUND_VERIFIED = false,CS_API_VERIFIED = False), seedocs/dev-setup.md, "Chưa kiểm với API Zalo thật". - Rolling back to 1.37.0 needs no script (README, "Lùi về bản trước",
PREV=1.37.0). The web goes back; the Hasura metadata goes back with its restart. Ifshrimp-farm0.7.0 is installed it keeps running, but certificate uploads answer 404 until the web is 1.38.0 again, and the household reads ofcoop-financeandcoop-ledgeranswer 502 on the old metadata. The app tables stay; app migrations are not reversed.
[1.37.0] - 2026-12-01#
Added#
- Zalo inbound: signed webhook seam, replay and duplicate guard, one-time link codes, image relay (v2.0 phase 3, task 6a):
POST /api/public/zalo/webhook(public; APISIX routezalo-webhook: 120 requests per 60 s per source IP, 64 KB body cap, also enforced in the web with413). Order of answers: 413, 503ZALO_INBOUND_NOT_VERIFIED, 401 (bad signature, timestamp more than 5 minutes off), then200 {}for every accepted, duplicate or ignored event. Onemsg_idis one row inplatform.zalo_inbound; rows older than 7 days are deleted on each insert.- Not confirmed from Zalo's official documentation: the signature formula and header, the event JSON shapes and the image hosts (the
developers.zalo.mepages render with JavaScript and could not be read automatically; a third-party formula was deliberately not used). Everything else is built behind one function,verifyAndParseZaloEvent, which refuses every request with503 ZALO_INBOUND_NOT_VERIFIEDuntil the formula is read from the official page.ZALO_MEDIA_HOSTSstays empty for the same reason, so no image is downloaded yet. - Linking:
POST|DELETE /api/zalo/link,GET /api/zalo/link/status, a "Kết nối Zalo" card on the three profile pages. A 96-bit code (the Telegram generator), valid 10 minutes, single use, hash only; a text equal to a live code links the sender; an unlinked sender gets the instructions. Text of a linked sender reaches theZaloIntakeseam, which task 6b connected to the text chat (below). - Relay
dxos-zalo:GET /api/internal/zalo/media/pendingandPOST /api/internal/zalo/media;media.pydownloads only from the host list, at most 5 MB, JPEG or PNG by magic bytes, no redirect to another host; the stub image host serves a PNG, a JPEG, a GIF and an over-size JPEG. - Database (additive,
10-zalo.sql,09-telegram.sql):zalo_links(audited),zalo_link_codes,zalo_inbound,zalo_conversations;zalo_credentials.app_idandwebhook_secret_enc(set withPUT /api/platform/zalo/credentials, the key is never returned);assistant_requests.channelandzalo_user_idwithtelegram_user_idandchat_idnow nullable under a CHECK that keeps exactly one identity per channel. - Until the seam is confirmed (
ZALO_INBOUND_VERIFIED = false, next toverifyAndParseZaloEvent) or while the app id and key are not set,GET /api/zalo/link/statusanswersavailable: false, the "Kết nối Zalo" cards (farmer, officer, manager and accountant profile pages) render nothing andPOST /api/zalo/linkanswers409 ZALO_INBOUND_UNAVAILABLE. The copy names "Zalo OA của nền tảng" (one platform OA). - Gateway:
platform/gateway/config.yamlnow loadsclient-control(itsplugins:list replaces APISIX's default, so thezalo-webhookroute was dropped without it). A test checks that every plugin named inapisix.yamland in the routesgateway-syncgenerates is in that list. -
Relay: the media loop starts only when the host list is not empty and polls every 10 s when idle (the outbox shares the same per-token rate limit); the relay has no environment setting for the host list or for plain http. An event with a
msg_idover 128 characters is ignored; the webhook stops reading a body at 65 537 bytes even without aContent-Length. The app id is any[A-Za-z0-9_-]{1,64}(its shape is not confirmed). -
Zalo replies, text chat, plugin channel
zalo(v2.0 phase 3, task 6b): platform.zalo_cs_outbox(additive,10-zalo.sql; not audited): kindschat,result,plugin_notify; text 1 to 2000 characters; at most 6 attempts, thenfailed; the backoff of the template outbox (retry_after_seconds, else 5 s doubling to 15 min); no quiet hours. The relay leases withGET /api/internal/zalo/cs-outbox?limit=1..20and reports withPOST /api/internal/zalo/cs-outbox/{id}/result {ok, zalo_msg_id?, error?, retry_after_seconds?, permanent?, out_of_window?};out_of_windowmakes the rowskipped, and for aresultthe requester also gets an in-app notification with the same text.- A user draft with
reply_channel = zalois answered on Zalo through that queue (to the sender's active Zalo link in the same cooperative), and in the app when there is no link; never for an agent proposal or an auto-run. ZaloIntakeEngine: text-only chat for the plugin actions that take user drafts (originshasuser, the sender's role instarters); the built-in tea flows stay Telegram-only and A7 gets the plugin actions only for a Zalo request (assistant_requests.channel = 'zalo', newcreateForZalo; a Zalo request that expires is answered through the same queue). Choices are numbered (1. …; Có/Không for booleans), an answer is the number or the exact label, a number outside the list repeats the question, numbers and text are checked like on Telegram (the plugin'sreason_vion a bound), the card ends with "Gửi" / "Huỷ" (with or without marks). State is kept inzalo_conversationsfor 15 minutes; the draft is namedzalo:<msg_id of the first message>; the live role is read again on every message (roles.read). The engine has no way to decide a proposal: approving stays on Telegram and the web. A checked image answers a required photo step, anything else gets "Mình chưa cần ảnh lúc này." (the image is not stored).- Plugin
POST /notificationsacceptschannels: ["zalo"]next toin_appandtelegram: only members with an active Zalo link of the cooperative are reached (rows of kindplugin_notify), inside the same 30 calls an hour;queued.zaloappears only when the channel was asked for. While nobody can link, it queues nothing. - The webhook queues its own replies into
zalo_cs_outbox: the link instructions for an unlinked sender (kind = link_help, no cooperative, at most one per Zalo user in 10 minutes) and the "linked" confirmation (kind = link_done, under the link's cooperative).htx_codeis nullable only for those two kinds (CHECK); the relay's claim route hands them out like any row. The DDL moves a 1.37.0 table made by an earlier build (idempotent). - The CS lease route expires only the Zalo assistant requests (
expire(now, 'zalo')); the Telegram expiry and its timeout reply stay on the Telegram outbox route. An answer of the assistant starts a flow only while it is still the request the member waits for (carried inzalo_conversations.state.__request_id); after "Huỷ" or a newer sentence it is dropped silently. - A failure inside the intake removes the dedupe row of the event, so Zalo's retry is processed (the 6a known limit for the intake step).
- Not confirmed from Zalo's official documentation: the consultation (CS) message API (URL, body, response field, the error code of "outside the interaction window"). The page "Gửi tin Tư vấn dạng văn bản" (
https://developers.zalo.me/docs/official-account/tin-nhan/tin-tu-van/gui-tin-tu-van-dang-van-ban) renders with JavaScript and an automated fetch returned only its title. The relay's one functionsend_cs_message(platform/zalo/dxos_zalo/cs_api.py) therefore refuses without any network call whileCS_API_VERIFIED = False, and the relay does not lease the rows at all, so replies staypending(no attempt is spent, nothing is marked failed). The endpoint written there is the shape the code expects, not a confirmed one. - Zalo end-to-end smoke deferred. It needs a signed event, so it waits for
verifyAndParseZaloEvent. To turn the whole Zalo path on: (1) fillverifyAndParseZaloEventand setZALO_INBOUND_VERIFIED = true; (2) fillZALO_MEDIA_HOSTS; (3) confirm the CS API and setCS_ENDPOINT, the body,CS_OUT_OF_WINDOW_CODES, the permanent error codes (none is reported permanent yet, so a user who does not follow the OA would be retried 6 times) andCS_API_VERIFIED = True; (4) writesmoke-zalosteps: linkfarmer_st, send the shrimp sentence, answer the numbered steps and "Gửi", approve on Telegram, check thefeedingsrow and the "Đã ghi: …" CS message at the stub, and the link instructions for an unlinked sender. Unit and integration tests cover the pieces (engine, outbox, reply, channel, relay against the stub, real-Postgres repositories). - Database (additive):
platform.zalo_cs_outbox. Stub:POST /v3.0/oa/message/cs(same fail-next queue as the template call).
Upgrade notes#
- Run the init scripts before the new web starts.
make platform-up/make demo-upapplyplatform/postgres/init/09-telegram.sqland10-zalo.sql. The web selectszalo_credentials.app_idandwebhook_secret_enc, so until the columns exist the Zalo relay's token fetch and the platform admin's credentials page fail. All changes are additive (new tables, nullable columns,assistant_requests.telegram_user_idandchat_idloseNOT NULLunder a CHECK that existing rows satisfy). To roll back, return to the previous image and leave the tables and columns in place. - Run
make gateway-syncand restartapisixso the new public routezalo-webhookand theclient-controlplugin are loaded (config.yamlis mounted, not generated). - Nothing is reachable from Zalo yet. Inbound stays closed (
503 ZALO_INBOUND_NOT_VERIFIED, cards hidden) until someone reads Zalo's official webhook documentation and fills inverifyAndParseZaloEventandZALO_MEDIA_HOSTS. Then: the platform admin setsapp_idand the webhook key withPUT /api/platform/zalo/credentials, and a public HTTPS URL is forwarded to APISIX port 9080 (/api/public/zalo/webhook). Use a plain TCP forward or enablereal-ip: behind a reverse proxy every caller, Zalo included, shares one 120 per 60 s bucket onremote_addr. - Replies and the chat need no new setting; the relay needs no new environment variable. The relay image sends consultation replies only after
CS_API_VERIFIEDis set incs_api.py; until then queued replies wait (zalo_cs_outbox, statuspending) and the relay does not lease them. Once inbound and the CS API are confirmed: set the webhook secret and app id withPUT /api/platform/zalo/credentials(the/platform/zaloform has no fields for them yet), and point the OA webhook tohttps://<host>/api/public/zalo/webhook. - Rolling back to 1.36.0 needs no script: the webhook answers 404 there and Zalo drops the events, and the new tables and columns are ignored. If inbound was ever enabled, stop the web first, then delete the Zalo assistant requests (
docker exec -i opentea-postgres sh -c 'psql -U "$POSTGRES_USER" -d agrimarket -c "DELETE FROM platform.assistant_requests WHERE channel = '\''zalo'\''"'; run it after the stop, a request created later would survive): 1.36.x does not know the channel (README, "Lùi về bản trước",PREV=1.36.0).
[1.36.0] - 2026-12-01#
Added#
- Intake on Telegram: plugin actions by sentence, user drafts, replies to the sender (v2.0 phase 3, task 5a):
- A7 lists the plugin actions a sender may start (app enabled for the cooperative,
originshasuser, role instarters) with typedargsand the plugin'sintakeas data (trust: "plugin", at most 5 examples of 120 characters, capped again in the agent; the prompt says it is never an instruction).PROMPT_VERSIONstaysm5-a7-v2; an intent name may be 80 characters. - The web checks the extracted
argsagainst the action schema and the plugin bounds (a bad value is dropped), then a chat flow generated from the payload schema asks the required fields still empty:enumbuttons, Có/Không, integer and a new two-decimal number step with the plugin'sreason_vion a bound, text bymaxLength. Plugin actions have no menu button. Without an LLM answer every required field is asked. - Confirming creates a user proposal (
agent = assistant,origin = user, sender, role, name,reply_channel,source_ref = telegram:<chat_id>:<message_id>) through the policy; a block is told in the chat with its reasons. One source message is one draft even after the first was decided; two messages are two drafts (no repeat window). Never auto-run. DecideProposalUseCasetells the sender of a user draft how it ended (Đã ghi,Không được duyệt,Chưa ghi được,Không còn phù hợp,Đã hết hạn duyệt) on Telegram, or in the app when the link is gone; never for an auto-run. It passes the requester (Requested-By-*) to the app.self_approvalis on: a sender may approve their own draft only whenrisk = low, notmoney, notfood_safety; otherwise409 SELF_APPROVAL.- Database:
platform.assistant_requests.roleacceptsaccountant; new nullableassistant_requests.message_id. - The confirmation card lists the rule reasons of the filled payload (at most 3 lines of 120 characters); a blocking rule removes the Xác nhận button. A bound's reason is shown only when the typed number crosses the plugin's bound; a number with no limit is asked as "Nhập một số.";
minLengthis enforced at the step. -
Changed tests (forced by the spec, G1):
evaluate-policy.test.ts(self_approvalno longer always allows),agent-proposal-policy-postgres.integration.test.ts(a second row with onesource_refanswersnullinstead of throwing),jest.config.jsignores*.fixture.tsas test files. -
Photo evidence,
shrimp-farm0.3.0record_feeding, the Telegram end-to-end smoke (v2.0 phase 3, task 5b): - A plugin action with
photoother thannonegets a photo step after its fields only when it isrequired(and not when the photo came with the sentence); anoptionalphoto is never asked for, it is kept when it comes with the sentence. A photo with a caption outside a flow is now the sentence A7 reads and the photo rides with the request (assistant_requests.photo_key, nullable), then answers the photo step; this only happens in a cooperative that has a plugin action taking a photo from the sender's role, so a tea cooperative's captioned photo behaves as before. A photo no flow holds (the intent started something else, the sender is no longer linked, the draft was refused, repeated, cancelled or the request expired) is deleted. - Photos live under
intake/<htx>/<uuid>.jpg|png(intakePhotoKey) inagrimarket-private, wheredxos-scanneralready looks. The draft cites the photo as an evidence row of tablefile(id= key,values={sha256 of the bytes, content_type, size_bytes}). The newfileevidence loader accepts only a key under the proposal's ownintake/<htx>/, hashes the object again at each decision (the plugin action's staleness check runs it over the proposal'sfilerows): a missing, quarantined or replaced photo makes the proposalstalewith the reason "Ảnh đính kèm đã bị xoá, bị cách ly hoặc đã thay đổi."; a storage failure is "could not check" (503 POLICY_CHECK_UNAVAILABLEat create and decide, the proposal staysproposedand the decision can be tried again; a read that takes longer than 3 s counts as a failure), never "missing". - New
GET /api/agent/proposals/{id}/evidence-file?key=(manager, officer):302to a presigned URL valid 60 s once the scan is clean,409 FILE_PENDING_SCAN,410 FILE_QUARANTINED,404 NOT_FOUNDfor another cooperative's key, a key the proposal does not cite or an unknown proposal. It has a row in the Telegram coverage table. shrimp-farm0.3.0 (requires.core >=1.36.0,agent.checks_path: /agent/checks): actionrecord_feeding("Ghi nhật ký cho ăn",risk: low,money: false, approvers officer and manager,origins: [user], starters farmer, officer, manager,editable: [amount_kg],photo: optional) withpond_code1-40,feed_type1-60 andamount_kgan integer from 1;guardrails.bounds.amount_kg.max = 200with its reason,guardrails.checks: [pond_active]and the example "ao A1 cho ăn 12 kg thức ăn số 2" (plus a description for each field, which the chat asks with).POST /agent/actions/record-feedingwrites afeedingsrow recorded by the sender (Requested-By-*, not the approver) on the Vietnam day ofRequested-At; no sender is400 "Thiếu người ghi nhật ký."and an inactive pond is400, and so is anamount_kgover the 200 kg bound (the app re-checks it and answers with the bound'sreason_vi, in case a caller bypasses the web policy).GET /agent/checks/pond_active?pond_code=answers{ok, reason_vi}for any starter role. No migration.- CI:
platform/tests/smoke-intake.sh, sourced last bysmoke-agentic.sh(so it adds no PASS line toplatform-smoke, andsmoke-apps.shkeeps its count), runs the done-when on Telegram for the ST farmer: the sentence through A7 and the LLM stub, the card, the signed approve button of the ST manager, afeedingsrow recorded by the farmer on today's Vietnam date,audit.verify_chain(), and "Đã ghi:" in the farmer's chat. Then: the same message again (still one proposal), 250 kg refused with the reason of the bound and no proposal, a manager's own low draft sent and approved, and a captioned photo that becomes afileevidence row and executes.stub_llm.pyalso reads the sentence "ao A1 cho ăn 12 kg thức ăn số 2" (pond, amount and feed type). - Database: new nullable
platform.assistant_requests.photo_key(additive,09-telegram.sql). - Changed tests (forced by the spec, G1):
platform/cli/tests/test_manifest.pytest_shrimp_farm_stays_validloads the manifest at core 1.36.0 (0.3.0 requires it) and checks 1.35.0 is refused;worker_test.gono longer pins the oldversion/corelines (feeding_action_test.gopins the 0.3.0 ones);agent-proposal-policy-postgres.integration.test.tsandtest_smoke_scripts.pygained cases.
Changed#
self_approvalalso applies to proposals created through MCP (origin = user): a requester cannot approve their own medium, high,moneyorfood_safetyproposal. Proposals without areply_channel(MCP, web) get no result notice.
Fixed#
- Model download in CI:
download-model.shretries every failed download (5 tries, 5 s apart,--retry-all-errors); GitHub release assets answered HTTP 618 several times on 2026-12-01 and failed whole CI jobs, which the old--retry 3did not retry.
Upgrade notes#
- Run the init scripts before the new web starts.
make platform-up/make demo-upapplyplatform/postgres/init/09-telegram.sql. The web selectsassistant_requests.message_idandphoto_key, so until the columns exist every A7 claim fails. The change is additive (two nullable columns and a widerroleCHECK); to roll back, return to the previous image and leave the columns in place. shrimp-farm0.3.0 needs core 1.36.0. An installedshrimp-farmstays at 0.2.0 until you run./dxos upgrade miniapps/shrimp-farm(after the web is on 1.36.0; the upgrade refuses an older core). It rebuilds and recreates the app's container (no migration) and writes its routes, including the new check routeGET /apps/shrimp-farm/agent/checks/pond_active; if the gateway was down at that moment, runmake gateway-syncand thenmake apps-recreate(it recreates only the appsgateway-syncflagged). On a stack that never ran it, run./dxos apps actor enableonce: the web needs thedxos-apps-actorclient to carry out an approved action and to ask a check, and without it a draft cannot be approved. After the upgrade a farmer ofSTcan send "ao A1 cho ăn 12 kg thức ăn số 2" to the Telegram bot; a cooperative withoutshrimp-farmsees no change.- Photos of drafts live under
intake/<htx>/inagrimarket-private. Nothing to set;dxos-scanneralready scans the bucket. A photo sent to a draft that is never decided stays there (the draft expires, the photo is kept with it). - Rolling back to 1.35.x needs no script, but first put
shrimp-farmback to 0.2.0 (./dxos upgrade miniapps/shrimp-farmfrom the 1.35.0 checkout, while the web is still 1.36.0): an openorigin = userdraft can still be approved on the old web, which sends noRequested-By-*headers, so 0.3.0 would answer400and mark it failed (README, "Lùi về bản trước",PREV=1.35.0).
[1.35.0] - 2026-12-01#
Added#
- Low-risk autopilot out of labs, agents by pack, neutral A7 prompt (v2.0 phase 3, task 3):
- The autopilot no longer needs
DXOS_LABS:GET /api/agent/autopilot,enable,stop, the internal tick route, the agent's tick call,/tuvanhanhand the autopilot section of the manager and officer AI settings pages answer with labs off. A8, A11, A12, MCP and the app workshop tab stay frozen. The mode stays off by default for each cooperative; a manager turns it on as before (sign-in at most 5 minutes old, probation still a hard block). autoEligibility(the one place): only anorigin = agentproposal of alow,autokind that is notmoney, notfood_safetyand has no storedrequire_humanverdict runs on its own. Reasonsnot_low,money,food_safety,require_humanare new;unlockableis never eligible;windowForis 0 for every eligible proposal (the medium, high, money andstrategy.adoptwindows are gone). Today that meansnotification.internaland the low actions of the cooperative's apps.- The enable screen lists only those kinds (
AppActionCatalog.listFor(htxCode)adds the apps' actions);POST /api/agent/autopilot/enableignoresunlocked_kinds;GET /api/agent/autopilotgainstoday.items(each auto-run: kind, title, one-line preview, time, status) and the manager settings page lists them with a link to/manager/ai?proposal=<id>. - Tick: a total budget of 8 s (
budgetMs,clock); items not reached are released (releaseClaims,run_claimed_at = NULL,run_atkept) and run on the next tick, none twice. A policy block clears the window and returns the proposal to a person; a check that did not answer keeps the window. - New
POST /api/agent/proposals/{id}/block: Chặn on the web for any approver of the kind (blocked|already_ran|not_scheduled|not_found). dxos-agent: A1 to A5 and A13 run only for a cooperative whosehtx_profiles.enabled_packshastea-core(CoreGatewayClient.get_enabled_packs, fail closed when unreadable); A6, A7, A9 and A10 run for every cooperative. Leaf-ticket events are still acknowledged without it.- A7:
PROMPT_VERSION = "m5-a7-v2". The system prompt names no sector; the web sendshtx_nameandpackswith each request and lists the tea tools and chat actions (pack: 'tea-core') only for a cooperative with the pack. - CI: a
No-Labs Smokestep (platform/tests/smoke-nolabs.sh), last inplatform-smoke, restarts the web withDXOS_LABSempty, checks that the autopilot answers and thatPOST /api/agent/app-requestsandGET /api/mcp/toolsstill answer 404, and restarts the web as it was. - Docs: the freeze row of
docs/product-roadmap.md, §3.17 ofdocs/rules-and-limits.md,docs/api-contract.mdand a post-release note in the agentic layer spec. - Review fixes: the 18:00 Telegram report lists each auto-run in a trailing block outside its 8-line cap (time, title, preview cut at 80 characters; at most 5, then
và N việc khác; the link fromDXOS_WEB_PUBLIC_URLonly for a manager in a direct chat; a failed read of the runs keeps the report; the report is marked sent after it is built); the Telegram menu, typed tools, assistant intents and open flows refuse tea work for a cooperative withouttea-core(HTX của bạn chưa dùng gói có tính năng: …, and the menu hides those buttons); an unreadable pack list leaves the agent's events unacked; the agent waits up to 30 s for the tick; the enable screen lists only kinds a manager may approve; re-enabling keeps the oldunlocked_kindsdata; the officer sees the run list as plain text;smoke-nolabs.shasks the web with a session cookie and checks its own 404 body;smoke-autopilot.shblocks a low notice through the web and checks/dungclears a pendingrun_at. -
Changed tests (forced by the spec, G1):
eligibility.test.ts(medium kinds,unlockableand money/food-safety reasons; windows are all 0),create-hook.test.ts,autopilot-service.test.ts,tick.test.ts(the medium, unlocked-kind and household-cap cases now expect a person to decide; the real-decide cases use the low notice),agent-autopilot-routes.test.ts,internal-autopilot-tick.test.ts,autopilot-telegram.test.ts,autopilot-section.test.tsx,manager-ai-settings-labs.test.tsx,labs-frozen-routes.test.ts(the four autopilot rows leave the frozen table),assistant-requests.test.ts(the fifth argument),platform/agent/tests/test_labs.py(the tick runs without labs), theget_enabled_packsmethod of the fake gateway intest_main.py,smoke-autopilot.sh(a medium proposal gets no window, so the Chặn-button step is gone) andtest_smoke_scripts.py. -
Event workers, threshold events,
shrimp-farm0.2.0 (v2.0 phase 3, task 4): dxos-ingestemitstelemetry.reading.threshold_crossedintocore.outbox(subject<asset_type>:<asset_code>, payloadasset_type,asset_code,sensor,value,bound,direction,reading_at) when a stored plugin reading is belowalert.belowor abovealert.aboveof its sensor. The reading and the event commit together; the event runs in a savepoint, so a failure keeps the reading and writesevent_failedtotelemetry.ingest_rejects. One event per (asset, sensor, direction) in 15 minutes, kept in the newtelemetry.alert_state; a duplicate reading emits nothing.dxos-agentruns the newrun_event_dispatchfirst in every cycle, for every cooperative, before A1: A13 on a leaf ticket (tea cooperatives only, now recorded withtrigger = 'event', which wasschedule) anddispatch_event_workersfor the workers whoseonmatches (GET /apps/<id><path>?event_id=&topic=&subject=, 10 s). At most 20 calls per page of events, the rest logged as skipped; a failing call leaves a failed run and the page is still acknowledged; an event run does not move the interval schedule. A threshold event goes only to an app that declares the asset type of its subject;onis checked like the CLI (allowed_on). A worker withonand noevery_minutesis no longer "malformed": it has no schedule.dxos validateand./dxos installread a bareon:key of a worker (YAML 1.1 turns it intotrue).shrimp-farm0.2.0 (requires.core >=1.35.0):dissolved_oxygenhasalert: {below: 4}andpond-watchhason: [telemetry.reading.threshold_crossed]. Withsubject=pond:<code>it judges the newest reading of the last 60 minutes of that pond; without it, the 60-minute average as before. The approval preview readsao {pond_code} thiếu oxy ({avg_do} mg/L)for both.- CI:
smoke-app-actions.shpublisheshtx/ST/pond/A1/dissolved_oxygen= 3.2 and waits up to 90 s for an open proposal whose run hastrigger = 'event'. - Changed tests (forced by the spec, G1):
platform/cli/tests/test_manifest.pytest_shrimp_farm_0_1_0_stays_validis nowtest_shrimp_farm_stays_validand loads the manifest at core 1.35.0 (0.2.0 requires it); theFakeDbofplatform/dataops/tests/test_ingest.pygainedtransaction()and the fake gateway ofplatform/agent/tests/test_main.pyget_app_workerandapps.
Upgrade notes#
- New table, created by the usual init run:
make platform-up/make demo-uprunplatform-init(13-registered-assets.sql), which addstelemetry.alert_state. There is no migration, no new service and no manual step for the core, but the init run must come before the newdxos-ingeststarts (the order of the README blocks already does that); an ingest that starts first still stores every reading and filesevent_failedintelemetry.ingest_rejectsuntil the table exists. shrimp-farm0.2.0 needs core 1.35.0. An installedshrimp-farmstays at 0.1.0 until you run./dxos upgrade miniapps/shrimp-farm(after the web is on 1.35.0; the upgrade refuses an older core). From then on a dissolved-oxygen reading under 4 mg/L reaches the app within about 90 seconds instead of the next 30-minute run. Other apps are not affected: an event is sent only to a worker that declareson.- The autopilot is out of labs and off by default. It is reachable without
DXOS_LABS, but still off for every cooperative until a manager turns it on. Only low-risk proposals run on their own and only low-risk kinds are listed; a manager who enabled it under labs sees the narrower list, and proposals of other kinds that already had a window go back to a person on the next tick. - A cooperative without
tea-coreno longer runs A1 to A5 and A13. Nothing changes for the tea cooperatives. Events are read for every cooperative, so the outbox never backs up. - Rolling back to 1.34.x needs no script: the old ingest does not emit threshold events and nothing reads
telemetry.alert_state(README, "Lùi về bản trước",PREV=1.34.0). Do not setDXOS_LABSafter the rollback. An installedshrimp-farm0.2.0 keeps running on its 30-minute schedule. The path from 1.29.0 is indocs/dev-setup.md, section "Nâng cấp từ 1.29.0 lên 1.35.0".
[1.34.0] - 2026-12-01#
Added#
- Manifest v2 and actor contract v2 (v2.0 phase 3, task 1; the contract the next tasks build on, nothing new runs yet):
agent.actions[]gainseditable,food_safety,guardrails.bounds,guardrails.checks(floor 1.34.0) andorigins,starters,intake,photo(floor 1.36.0);agentgainschecks_path(1.34.0);agent.workers[]gainson(andevery_minutesbecomes optional whenonis present) andsensors[]gainsalert(1.35.0)../dxos validatechecks each rule and refuses a manifest whoserequires.coreis below the floor of a key it uses;shrimp-farm0.1.0 and every existing app stay valid.- The gateway removes the four
X-DXOS-Requested-By-*/X-DXOS-Requested-Atheaders on every app route but the actor and check routes, and adds oneGETrouteapp-<id>-check-<n>(internal port only,azp = dxos-apps-actor, Acting headers kept) per distinct check name.dxos syncalso strips the new headers from fragments written before this change. ActionDefinitiongainsfoodSafety,starters,guardrails,photo,intake;execute(payload, approver, ctx?)takes the requester andAppsActorClient.callsends the four Requested-By headers (name percent-encoded).AppsActorClient.checkruns a plugin check (GET, 3 s, no redirect) and throwsAppCheckUnavailableErroron anything but a clean{ok: boolean}.- App kit:
read_claims(authorization, headers, check=False)andClaims.requested_by; withcheck=Trueany role of the manifest may act. The ten vendored copies are synced.shrimp-farm:checkRouteandClaims.RequestedBywith the same rules. - Review fixes:
agent.checks_pathmay not end with/(schema, CLI; gateway and client also strip it); a generated check uri may not equal another agent path; an emptyguardrailsblock needs the 1.34.0 floor; sync's actor/check exemption matches the exact route id; the app kit refuses a malformed%escape in the requester name like the Go helper. - Changed tests (forced): the
ACTINGheader lists inplatform/cli/tests/test_gateway.pyandplatform/tests/test_app_gateway_routes.pynow hold the seven headers the gateway removes; the threereadClaimscalls inminiapps/shrimp-farm/server_test.gopass the route kind. - Policy layer (v2.0 phase 3, task 2):
apps/web/src/application/agent/policy/:evaluateProposalPolicy(rbac,food_safety,money,bounds,plugin_checks,self_approval; no LLM),isBatchEligibleandpolicyDigest. It runs when a proposal is created (CreateProposalUseCase; the plugin check only for a user draft) and again insideDecideProposalUseCasefor every channel (web, Telegram, batch, campaign, tick), after the stale check and before the claim: a block answers409 POLICY_BLOCKED(or409 SELF_APPROVAL), a cleanok: falseof a plugin check makes the proposalstalewith the app's reason, and a check that gives no clean answer answers503 POLICY_CHECK_UNAVAILABLEand leaves the proposalproposed. At creation a block is400 POLICY_BLOCKEDwithreasonsand nothing is created. A rejection is never judged.self_approvalalways allows until the draft lane turns it on.foodSafety: trueonharvest.approveandjournal.approve.- A plugin action with
food_safety: trueisautonomy: never, likemoney, andautoEligibilityrefuses anyfoodSafetyormoneykind and any storedrequire_humanverdict, so none of them auto-runs under the labs autopilot. platform.agent_proposalsgainspolicy,reply_channel,source_ref(unique per cooperative),requested_by_nameandrequested_by_role(all nullable); the verdicts and their digest are stored at creation, and the audit events of the approval and the execution carrypolicy: {rules, digest}. A proposal made before 1.34.0 haspolicyNULL and is read as having no verdicts.GET /api/agent/proposalsitems gainpolicy,batchEligible,foodSafety,money,requestedByName,requestedByRole,replyChannel,runAt; newGET /api/agent/proposals/[id]andPOST /api/agent/proposals/batch-decision(at most 50 ids of one kind, decided one by one through the same use case within 25 s; the results saynot_found,not_eligible,not_processedand the policy outcomes per id).- Telegram: the card shows one line per stored
require_humanverdict; the three new outcomes have their own texts. The autopilot tick hands a policy block back to a person; for a check that did not answer it frees the claim (the window stays), so the next tick tries again. A refused decision no longer moves a draft campaign topartial. - Tests: unit tests for every rule and stage, the decide order, a check error never marking a proposal stale,
isBatchEligible, the campaign and batch use cases, the three routes, andagent-proposal-policy-postgres.integration.test.ts(columns, index, stale reason and audit details on a real Postgres;db-integration.shsetsPROPOSAL_POLICY_TEST_DATABASE_URL).
Changed#
- "Duyệt cả chiến dịch" narrowed on purpose: an item that is not batch-eligible (
money,food_safetysuch asjournal.approve, or a storedrequire_humanverdict) is no longer decided by it. It staysproposed, is counted in the newwaitingSingle, and the campaign becomespartialwhenwaitingHigh + forwarded + waitingSingle > 0. An item the policy refuses at decision time is counted there too, not as failed. The Telegram result line adds the count. - Changed tests (forced):
campaign-decisions.test.ts(the results carrywaitingSingle; itsjournal.approveitem now waits one by one, and the officer case uses a lownotification.internalitem so it still pins the forwarding), thecampaign-panel.test.tsxresult fixture (type only) and the web route table ofapplication/telegram/coverage.ts(the two new routes).
Upgrade notes#
- New columns arrive with the usual init run:
make platform-up/make demo-uprunplatform-init(08-agent.sql) twice; the five nullable columns and the unique indexagent_proposals_source_refare added idempotently. There is no migration, no new service and no manual step. Open proposals keep theirpolicyNULL and decide as before. - "Duyệt cả chiến dịch" now leaves
moneyandfood_safetyitems for one-by-one decisions (waitingSingle; in a campaign this includesjournal.approve, which used to run from it). Tell managers who relied on it. - Plugin keys of 1.34.0: an app may now declare
editable,food_safety,guardrails.bounds,guardrails.checksandagent.checks_pathwithrequires.core >= 1.34.0. A plugin that touches pesticides, harvest or withdrawal must declarefood_safety: true: the core cannot check it. A check answers{ok: boolean}within 3 s; anything else is "could not check" (503), never a pass../dxos sync/make platform-upwrite the-check-gateway routes. - Rolling back to 1.33.x needs no script: the old web ignores the new columns (README, "Lùi về bản trước",
PREV=1.33.0). Do not setDXOS_LABSafter the rollback. The path from 1.29.0 is indocs/dev-setup.md, section "Nâng cấp từ 1.29.0 lên 1.34.0".
[1.33.0] - 2026-12-01#
Added#
- Core reads through the gateway (v2.0 phase 2, task 6):
GatewayNotificationReader,GatewayBulletinReaderandGatewayHtxProfileReader(apps/web/src/infrastructure/core/) read with the signed-in user's token, so the Hasura permissions decide what each role sees. Moved reads:GET /api/notifications(every role butaccountant), the unread count of the farmer menu, the bulletin lists of the farmer, manager and officer pages,GET /api/bulletin(bulletins and the default crop), and the manager's cooperative profile. A page whose gateway call fails shows its error state; it never falls back to Prisma. There is no Prisma read ofhtx_membershipsto move (the member list comes from Keycloak), so only its Hasura permission ships. - Hasura permissions:
htx_membershipsis tracked (core_htx_memberships.yaml):managerandofficerread the rows of their cooperative, afarmeronly its own row, theagentnothing; four columns (id,keycloak_user_id,htx_profile_id,roles), no*. Every new cooperative filter carries the house guardhtx_code <> '', so a token with nohtx_codematches no cooperative.notificationsgets the object relationshiphtx_profile:farmer,officerandmanagerread the rows addressed to them or the broadcasts of their cooperative, without the columnshtx_profile_id,pushed_to_mattermost,sender_idandtts_text; onlyfarmermay aggregate (the unread badge). - Ratchet test
src/__tests__/architecture/core-model-access.test.ts: countsprisma.<core model>call sites outsidesrc/infrastructureand a short allow-list, and fails when the count differs from the record (30 before this change, 27 after; lower the record when you move a read). - Tests:
platform/tests/test_hasura_farmer_permissions.py;smoke-platform.shchecks that two farmers of two cooperatives each see only their own membership row, notifications and bulletins (15 more PASS lines: 167, insmoke-apps.shtoo; memberships are insertedon conflict do nothingbecauserequireTenantkeeps one row per user and cooperative, so the platform smoke can run again on a used database; an LB farmer with no household and a token with nohtx_codeare checked too). - Acceptance of phase 2 (v2.0 phase 2, task 7): the ten items of spec section 7 are mapped to the checks that run in CI (table in the spec's "Ghi chú sau triển khai"); the only new check is
database-layout-postgres.integration.test.ts, which now pins the exact table set ofpublic(_prisma_migrationsand PostGIS'sspatial_ref_sys),core(the eight tables and the fouroutbox*tables) andapp_tea(28 tables). Docs: the three schemas and how to write SQL against them (docs/database-schema.md), event topics, emitting and subscribing (docs/miniapps.md), the limits (docs/rules-and-limits.md) and the path from 1.29.0 to 1.33.0 (docs/dev-setup.md).
Changed#
- Behaviour narrowed on purpose (owner's rules): a notification of the n8n kind (
SYSTEM, no recipient, no cooperative) no longer shows in the notification list of the roles read through Hasura (it did before), nor in the live stream of the bell (/api/notifications/stream, still Prisma, now with the same rule; the accountant keeps both as before). AfilterofGET /api/notificationsthat names no notification type is now a 400 instead of an error; the mobile app now also sees the broadcasts of its cooperative. Theaccountanthas no Hasura permission, so its notification list stays on Prisma, unchanged. - Existing tests that pinned a Prisma call for a read that moved now pin the gateway request; the others only gained the mock of
@/lib/auth/core-tokenthat the gateway client imports (list in the spec's "Ghi chú sau triển khai", item 2).
Fixed#
- Bulletins: the cooperative branch of the
farmer,managerandofficerfilters (core_bulletins.yaml) now carries the house guardhtx_code <> '', so a token with nohtx_codenever matches a bulletin whose code is empty (shared bulletins,htx_codenull, stay visible). Pinned intest_hasura_farmer_permissions.py. - The web loads Be Vietnam Pro from files in the image:
apps/webusesnext/font/localwith woff2 files inapps/web/src/app/fonts, sonext buildno longer downloads Google Fonts (a DNS miss onfonts.googleapis.comfailedmake web-up). - Keycloak login font: the sign-in page loads Be Vietnam Pro from the theme's own
resources/fontsfiles, with no request to Google Fonts. - Zalo smoke at night:
platform/tests/smoke-zalo.shset the quiet window to 00:00-01:00, which delays three message kinds between 00:00 and 01:00 Vietnam time and failed the four-template-ids check; the window is now one hour, two hours ahead of Vietnam time, so it never covers the present. - Notification limit:
GET /api/notificationsignoredlimitwhen nofilterwas given (a missingfilterreached the schema asnull), so the inbox's "all" view and "load more" stayed at 5 rows and the 4-row dashboard lists got 5; a missing query value is now read as absent, andlimitis capped at 100.
Upgrade notes#
- Release bundle (kind C) has no
make up-workflow, so n8n was never subscribed there since 1.32.0 and Mattermost pushes only every 15 minutes. After importing and publishing the newmattermost-pushand restarting n8n, run from the bundle folder:$COMPOSE --profile tools build --quiet dxos-cli && $COMPOSE --profile tools run --rm -T dxos-cli events subscribe n8n-notifications core.notification.created http://n8n:5678/webhook/outbox-notification(README, "Lùi về bản trước", has the check to make first). A rollback below 1.32.0 leaves the 1.32.0 copy ofmattermost-pushin n8n; re-import the older file to get the one-minute push back. - Behaviour narrowed on purpose: the bell (list and live stream) no longer shows n8n
SYSTEMalerts to managers, afilterwith no notification type is a 400, and the mobile app sees the broadcasts of its cooperative; read "Changed: Behaviour narrowed on purpose" above before upgrading. - From 1.29.0: the whole path (1.30.0, 1.31.0, 1.32.0, 1.33.0) with the manual steps of each version is in
docs/dev-setup.md, section "Nâng cấp từ 1.29.0 lên 1.33.0"; the commands are in the README ("Nâng cấp một cài đặt đang chạy"). 1.33.0 itself adds no database migration, so the way back to 1.32.x needs no SQL (README, "Lùi về bản trước"). - Hasura must load the new metadata:
make platform-upandmake demo-uprestarthasuraafter migrate (true since 1.30.0). Pages moved to the gateway need Hasura running; it is a core service, so a normal start already has it. Without a restart Hasura would answer these pages with an error until it is restarted.
[1.32.0] - 2026-11-30#
Added#
- Event box
core.outbox(v2.0 phase 2, task 4; producing side only):platform/postgres/init/15-core-outbox.sqlcreatescore.outbox(append-only: triggers refuseUPDATE,DELETEandTRUNCATE),core.outbox_subscriptions,core.outbox_cursors,core.outbox_failuresand the functioncore.emit_event(topic, htx_code, subject, payload), which checks the topic (^[a-z][a-z0-9_-]*(\.[a-z][a-z0-9_-]*){1,3}$) and the payload (at most 4096 bytes of jsonb text), inserts, callspg_notify('core_outbox', id)and returns the id. The file does nothing until the first Prisma migration has run (schemacoreis one of Prisma's schemas, and tables in it beforemigrate deploymake Prisma stop with P3005);platform-initapplies it again aftermigrate. Delivery isdxos-outbox, below. - Eight topics emitted by the web, in the transaction of the change they announce (an event of a rolled-back change does not exist):
core.notification.created(one per notification row, in one statement per batch; its cooperative is the one of the write's own context, never guessed from the recipients),core.proposal.created,core.proposal.decided(approved or rejected),tea.leaf_ticket.created,tea.journal_entry.created(when an entry is written as recorded, and when a draft such as the disease review's draft spraying is resubmitted),tea.disease_report.created,tea.batch.closed,tea.lot.created(both lot paths). Payloads hold identifiers and classification fields only; keys are listed indocs/miniapps.md. - Plugins emit events:
POST /api/internal/apps/core/eventswith{ topic, subject?, payload? }(serviceevents,requires.core >= 1.32.0; user mode and app mode like the other core routes). The stored topic is forced toapp.<id>.<topic>(the app's part has one or two segments), the cooperative comes from the caller's context and never from the body, at most 300 events an hour for one app and cooperative (429RATE_LIMITED), payload at most 4096 bytes.platform/apps/manifest.schema.jsonacceptseventsinrequires.servicesand./dxos validaterequiresrequires.core >= 1.32.0for it. Documented indocs/miniapps.md,docs/api-contract.mdanddocs/database-schema.md. - Integration test and script:
outbox-postgres.integration.test.ts(variableOUTBOX_TEST_DATABASE_URL, exported byscripts/db-integration.sh). dxos-outbox, the dispatcher (v2.0 phase 2, task 5): a small Go service (platform/outbox,scratchimage, user 10001,go.modwithpgx/v5only; containeropentea-outbox, 64 MB) that pushes the events ofcore.outboxto the subscriptions ofcore.outbox_subscriptions. One goroutine per enabled subscription,LISTEN core_outboxplus a 5 s poll, in(txid, id)order (see the next entry), at least once (the cursor moves only after a 2xx or a recorded failure), body{id, occurred_at, htx_code, topic, subject, payload}with the headerX-Dxos-Event-Id, 10 s timeout, no redirect followed. The retry rule: a transient error (network error, timeout, any5xx,408,429) backs off 5 s doubling to 5 min, at most 12 attempts; a permanent error (every other4xx, and a3xx) gets two retries 2 s apart; when the attempts run out, one transaction insertscore.outbox_failures(status code, class), inserts aplatform.system_alertsrow (sourceoutbox) and moves the cursor. So one bad event of one cooperative holds the others for at most four seconds. Retry state lives incore.outbox_cursors, so a restart keeps it. Heartbeat inplatform.service_heartbeats(dxos-outbox);dxos-outbox healthcheckis the container health check.- Commit-safe order, not id order (
core.outbox.txid): ids come from a sequence and commits land out of id order, so a reader that moved its cursor past id 6 while the transaction of id 5 was still open would never see 5.core.outboxgetstxid xid8 DEFAULT pg_current_xact_id()andcore.outbox_cursorsgetslast_txid; a consumer (the dispatcher, the agent API) reads only rows withtxid < pg_snapshot_xmin(pg_current_snapshot()), which means every transaction that could still add an older row has ended, in(txid, id)order, and keeps its position as that pair. A long-running writer delays delivery; it can no longer lose an event. Delivery order per subscription is therefore(txid, id): the order in which the transactions started, then the order of the rows inside one. Indexes(txid, id)and(htx_code, txid, id)replace(htx_code, id). An earlier draft used a one-second age window; it compared withoccurred_at, the START of the transaction, and could lose an event. - Allow-list for targets: only
http://n8n...andhttp://web...(no credentials), checked when./dxos events subscribewrites a subscription and again before every send; a row written by hand with another host is refused, alerted once and never sent. The list isDXOS_OUTBOX_ALLOWED_HOSTSof thedxos-outboxanddxos-cliservices (operator-only, defaultn8n,web; only the platform smoke widens it). ./dxos events subscribe <name> <topic-pattern> <url> | unsubscribe <name> | list(platform/cli/dxos_cli/outbox.py): name[a-z][a-z0-9-]{1,40}, pattern an exact topic or a prefix ending in.*;subscribeis idempotent (updates the row, keeps the cursor) and a new subscription starts after the newest event (no history replay);unsubscriberemoves the row and its cursor.- Events API for the agent of a cooperative:
GET /api/internal/agent/events?limit=<1..100>returns the events of the token's cooperative after the cursor of consumeragent:<htx_code>(never another cooperative's, never one withouthtx_code) in(txid, id)order, andPOST /api/internal/agent/events/ack{last_id}moves that cursor to that event, never backwards;last_idmust be a readable event of that cooperative (anything else: 400INVALID_LAST_ID). The agent acknowledges the LAST event of a page, which is not always the highest id.dxos-agentreads it each cycle, runscross_check(A13) at once, at most once per cycle, when atea.leaf_ticket.createdarrived (the daily schedule stays; in that cycle it waits for the next one) and acknowledges a page only after what it triggered succeeded; a failure of the events API stops nothing else. mattermost-pushreacts tocore.notification.created: a webhook trigger (POSToutbox-notification) pushes the notification named by the event'ssubjectat once; the schedule goes from every minute to every 15 minutes and stays as the safety net (seven n8n workflows insert notifications by raw SQL without an event).make up-workflowsubscribes n8n (n8n-notifications) only once the newmattermost-pushis imported and published, checked through the n8n CLI without running it (n8n gives 404 for the webhook until then; otherwise it prints how to import it and subscribes nothing);make stop-extrasremoves that subscription with n8n.platform/tests/smoke-outbox.sh(jobplatform-smoke, aftermake web-up; not part of the agentic smoke): a leaf ticket written through the web is an outbox row within 5 s; a stub receiver subscribed with the CLI gets two tickets once each and in order, gets the backlog after being stopped, and for a 422 on TC gets three attempts, a row incore.outbox_failuresand an alert while an event of LB arrives within 10 s; a hand-written subscription to a host outside the list is refused and alerted; the agent of TC reads its events, the agent of LB none of them, nobody reads an event without a cooperative. CI also runsgo vetandgo testofplatform/outbox(jobplatform-units), andscripts/db-integration.shruns the Go store test against the real tables.- Image
…-outboxin the publish and release matrices, in the release override and in the README pull lists.
Changed#
- The layout test's drift check names four tolerated statements:
DROP TABLE "core"."outbox",outbox_cursors,outbox_failuresandoutbox_subscriptions. They sit in schemacore, which Prisma covers, but are made by SQL and have no model; nothing else is tolerated. Do not accept these drops into a migration ifprisma migrate devproposes them. - Notification writes are transactional:
PrismaNotificationRepositorywrites a row and its event in one transaction (createManybecamecreateManyAndReturnso each row has an id for its event). platform.system_alerts.sourceacceptsoutbox:09-telegram.sql(the owner of the table) replaces the check constraint (n8n,agent,web,outbox) with an idempotent drop and add.- Alerts of the dispatcher: the text carries the subscription, the event id, the topic, the class and the status code, never the raw error (that stays in
core.outbox_failures.last_errorand the log). An alert of an event reaches the managers of that event's cooperative; one without a cooperative (a refused subscription, an event withouthtx_code) is stored as already notified, becauseTelegramNotifierwould send a NULL-cooperative alert to the managers of every cooperative, and no platform-admin route exists. dxos-cliand the compose files getDXOS_OUTBOX_ALLOWED_HOSTS;make platform-upandmake up-corestartdxos-outbox(a core service, never stopped bymake stop-extras);RELEASE_IMAGESlists it.- Existing unit tests whose mocks needed the new dependency, or whose pinned call arguments gained the cooperative of the write (
broadcastAnnouncement,notifyRecipients,sendDirectNotificationnow take it): see the task report.
Fixed#
- CI stability (browser stories): a mini-app frame whose document request Chromium aborts with
net::ERR_NETWORK_CHANGED(a host interface changed while Docker started or stopped a container) is loaded again once; no Playwright retry is enabled and no assertion or timeout is loosened. The helperapps/web/tests/e2e/helpers/network-changed.tsis attached through the sharedtestthat the frame-opening specs import. - The manager's "Bán hàng" page no longer crashes when it loads the receivables (since 1.21.0):
SalesListPanelstored the whole answer of/api/sales/receivablesinstead of itsdatakey.
Upgrade notes#
- The event-box tables are created by the second
platform-init.15-core-outbox.sqldoes nothing until the first migration has run (see Added), so the tablescore.outbox*andcore.emit_eventexist only after theplatform-initthat followsmigrate.make platform-upandmake demo-upalready run it (postgres,platform-init,migrate,platform-init), and so does the release block of the README (platform-init, migrate, platform-init again). - Rebuilding only the web is not enough. An operator who starts a web of this branch with
make web-upon a database that never saw the secondplatform-init(nomake platform-up) gets HTTP 500 on every write of the eight producers (notifications, proposals, leaf tickets, journal entries, disease reports, batch close, lot creation): their events needcore.emit_event. The fix ismake platform-up(or the same three steps by hand). - New core service.
make platform-upandmake demo-upstartdxos-outbox;make up-corestarts it too. Release bundle (kind C): adddxos-outboxto thepulllist (README updated). It needs the secondplatform-init(the tables) like the web's producers. - Re-import
mattermost-pushinto n8n, as forweather-syncin 1.31.0: n8n keeps its workflows in its own storage and nothing imports this one. The copy in n8n has no webhook and still runs every minute; import the new file and publish it from the CLI:docker cp workflows/mattermost-push.json opentea-n8n:/tmp/,docker exec opentea-n8n n8n import:workflow --input=/tmp/mattermost-push.json,docker exec opentea-n8n n8n publish:workflow --id=mattermost-push-wf, then restart n8n (docker compose -f docker/docker-compose.yml restart n8n): n8n registers a published webhook only when it starts. Then runmake up-workflow, which subscribes n8n; without the subscription the schedule (every 15 minutes) still pushes. - Check deliveries.
./dxos events list(position, attempts, number of events given up on),select * from core.outbox_failures order by failed_at descandselect * from platform.system_alerts where source = 'outbox'. A subscription whose target is down retries each event for about 30 minutes before the alert;make stop-extrasremoves the n8n subscription for that reason. - On stacks started with
make platform-upormake demo-up, n8n is not subscribed untilmake up-workflowruns (and it subscribes only when the n8n CLI shows the newmattermost-pushpublished, with its webhook path; it reads the stored workflow, not what the running n8n registered, which is why the restart above comes first; it never calls the webhook). Until then Mattermost pushes wait for the schedule, up to 15 minutes instead of one. - Known limits.
core.outboxhas no retention (it only grows; the table is append-only and nothing deletes from it yet). A transaction that stays open delays delivery of every later event until it ends (no event is lost). The dispatcher readsDXOS_DB_URLas the owner role, like the web; its pool is three connections unless the URL sayspool_max_conns. - Going back to 1.31.x needs no SQL: the new tables and the wider
sourceconstraint do not disturb it; remove the container (docker rm -f opentea-outbox) and start 1.31.x.
[1.31.0] - 2026-11-30#
Added#
- The twenty-eight tea tables move to schema
app_tea(v2.0 phase 2, task 3, wave 2):parcels,parcel_crop_cycles,journal_entries,journal_activities,pesticide_products,htx_pesticide_labels,lots,lot_parcels,disease_reports,disease_labels,weather_cache,partners,leaf_grades,daily_leaf_prices,fresh_leaf_tickets,input_items,input_advances,settlement_periods,member_settlements,member_ledger_entries,processing_batches,processing_batch_outputs,lot_batch_sources,htx_certificates,lot_certificates,sales_orders,sales_order_linesandsales_paymentsleavepublicthrough migration20261130120000_app_tea_schema(ALTER TABLE ... SET SCHEMA, no row is copied; indexes, foreign keys, triggers, sequences and grants go with the table, and the audit and append-only triggers andtelemetry.registered_assetsfollow by OID). The migration repeats the wave-1search_pathstatement unchanged and revokesPUBLIConapp_tea. After this versionpublicholds only the enum types, the two*_refuse_changefunctions,_prisma_migrationsand what the PostGIS extension keeps there (spatial_ref_sys, its types and functions); the new layout assertion ofdatabase-layout-postgres.integration.test.tsallows no other table. Table names, columns and the Prisma model API do not change (schemas = ["public", "core", "app_tea"], every model has@@schema). - GraphQL contract unchanged: the thirteen tracked tea tables are tracked from schema
app_teawithconfiguration.custom_nameequal to the bare table name (filesapp_tea_<table>.yaml), and every relationship that names one of them (including those ofhtx_profilesandhouseholdsincore) follows.platform/tests/test_hasura_root_fields.pypasses unchanged. - Reversible:
scripts/schema-move-rollback-tea.sql(shipped in the release bundle) moves the twenty-eight tables back topublicand deletes the migration's row from_prisma_migrations, in one transaction; it leaves thesearch_pathof the role alone because 1.30.x still needs it. A fullbash scripts/db-integration.shnow proves both waves on every CI run: it gives each of the thirty-six moved tables at least one row, snapshots count and md5 per table, rolls back wave 2, compares, rolls back wave 1, compares, migrates again and compares; it also checks that the wave-1 script refuses whileapp_teaholds tables and that the wave-2 script fails when run twice.
Changed#
- Explicit
public.references to tea tables becameapp_tea.:platform/dataops/dxos_dataops/simulate.pyandplatform/tests/smoke-dataops.sh. The init scripts and every other statement name tea tables without a schema and keep working through the role'ssearch_path. - The
weather-syncworkflow no longer names a schema: its "Upsert Weather" node (the only n8n node that setschema: public) is replaced by one parameterisedINSERT ... ON CONFLICT (parcel_id, recorded_at) DO UPDATEwith the same columns and values, so it works before the move, after it and after a rollback. Without the import described in the upgrade notes the old node fails every hourly run once the table has moved.platform/tests/test_workflow_schema_names.pyfails when any Postgres node ofworkflows/*.jsonsets a schema or namespublic.,core.orapp_tea.before one of the 36 moved tables (list read fromschema.prisma). docs/database-schema.mdstates**Schema:**app_tea` in the section of each tea table;scripts/check-schema-doc.pycompares it with@@schema`.
Fixed#
make apps-recreateand./dxosfind a stopped web container: both readAUTH_URLfrom the web container withcompose ps -q web, which lists only running containers, so aftermake web-stopa recreated app got the default address. They now useps -aq.
Upgrade notes#
- From 1.29.x, read the 1.30.0 notes too. Going straight to 1.31.0 skips 1.30.0, so its notes apply as well (the n8n credential's role,
?schema=inDATABASE_URL, restarting every service aftermigrate). - Import the corrected
weather-syncworkflow into n8n. n8n keeps its workflows in its own storage, and nothing in this repository importsweather-sync(the Makefile,dxosand the CLI import only mini-app workflows;docs/dev-setup.mdlists three other workflows). The copy in n8n still has thepublicupsert and fails every run after the migration. Import it the way you installed it: in the n8n UI (Workflows, Import from file,workflows/weather-sync.json), ordocker cp workflows/weather-sync.json opentea-n8n:/tmp/ && docker exec opentea-n8n n8n import:workflow --input=/tmp/weather-sync.json; the file has the idweather-sync-id, so it replaces the existing workflow. Import it before or right aftermigrate, then check that it is still active (an import by id can leave a workflow unpublished:docker exec opentea-n8n n8n publish:workflow --id=weather-sync-id). The corrected workflow also works on 1.30.x, so importing it early is safe. - Commands. The step-by-step commands for the three kinds of install (A: source clone with images built from source; B: source clone with release images,
make demo-up; C: release bundle, no Makefile) are inREADME.md, subsections "Nâng cấp một cài đặt đang chạy" and "Lùi về bản trước". They are right for an upgrade from 1.30.x and from 1.29.x straight to 1.31.0 (onemigrateapplies both migrations); this list holds only what is specific to 1.31.0. - The old web must not run during
migrate, and now it matters for the whole tea product. From the moment the migration commits, a 1.30.x (or 1.29.x) web fails on every page and API route that reads parcels, lots, journals, leaf tickets, the ledger, processing batches, certificates or sales (its Prisma client asks for"public"."<tea table>"), which is nearly all of the product of a tea cooperative; only the pages that read the core tables keep working. The migration changes no row. Stop the web first (make web-stop, or$COMPOSE stop web n8nin a bundle) and start the new one aftermigrate. - Restart every service after
migrate, as for 1.30.0:make platform-upandmake demo-uprestarthasura,apisixandn8nwhen they were running; Hasura must load the new metadata (thirteen more tables underapp_tea). The role'ssearch_pathalready listsapp_teasince 1.30.0, so no connection setting changes in this version. A role that is notPOSTGRES_USER(for example an n8n credential that logs in as another user) must nameapp_tea.<table>or carry the samesearch_pathandGRANT USAGE ON SCHEMA app_tea. - If
migratefails: the migration is atomic, so nothing moved, but Prisma records it as failed and the next deploy stops with P3009. Clear it as in the 1.30.0 notes with the name20261130120000_app_tea_schemainstead of20261130110000_core_schema; for kind B useOPENTEA_VERSION=1.31.0(the 1.30.0 note shows 1.30.0), for kinds A and C nothing else changes. Then runmigrateagain. - Roll back.
scripts/schema-move-rollback-tea.sqlships in the release bundle: run it throughdocker exec -i opentea-postgres sh -c 'psql -U "$POSTGRES_USER" -d agrimarket -v ON_ERROR_STOP=1' < scripts/schema-move-rollback-tea.sqlwith the web and n8n stopped, then start 1.30.x from its own directory and restart Hasura. To go on to 1.29.x runscripts/schema-move-rollback-core.sqlafter it (it refuses whileapp_teaholds tables), then start 1.29.x. The README subsection "Lùi về bản trước" has the commands per kind of install.
[1.30.0] - 2026-11-30#
Added#
- The eight core tables move to schema
core(v2.0 phase 2, task 2, wave 1):htx_profiles,htx_memberships,households,notifications,bulletins,chat_history,fx_ratesandmarket_dataleavepublicthrough migration20261130110000_core_schema(ALTER TABLE ... SET SCHEMA: no row is copied; indexes, foreign keys, triggers, sequences and grants go with the table, and the audit triggers andtelemetry.registered_assetsfollow by OID). The migration also setssearch_path = "$user", public, core, app_teaon the migrating role in this database (ALTER ROLE ... IN DATABASE ... SET, never on the database, so theapp_<id>roles of mini-apps inherit nothing) and revokesPUBLIConcore, so every statement of the core services that names a table without a schema (web raw SQL, n8n, scripts, smokes,./dxos) still finds it. Enums, the two append-only trigger functions and_prisma_migrationsstay inpublic. Table names, columns and the Prisma model API do not change (multiSchemais on, every model and enum has@@schema). - GraphQL contract unchanged: the seven tracked tables are tracked from schema
corewithconfiguration.custom_nameequal to the bare table name (filescore_<table>.yaml), sohtx_profiles,households_by_pk,notifications_aggregate, ... keep their names;htx_membershipsis still not tracked.platform/tests/test_hasura_root_fields.pypins every bare name and every relationship target. make platform-upandmake demo-uprestart what was already running (hasura, apisix and n8n) after migrate, so their connections are made after the migration; both targets share one block and still start the platform's services as before (a stopped n8n is started by them, with new connections).make web-stopstops the web before a migration that moves tables.- Reversible:
scripts/schema-move-rollback-core.sql(shipped in the release bundle) moves the eight tables back, resets the role'ssearch_pathand deletes the migration's row from_prisma_migrations, in one transaction. A fullbash scripts/db-integration.shproves it on every CI run: it snapshots rows and md5 of each moved table, rolls back, compares, migrates again and compares. scripts/check-schema-doc.pycompares schemas:docs/database-schema.mdstates**Schema:**core` in the section of each core table (no line meanspublic) and the check fails when it disagrees with@@schema`.- Database integration tests in CI (v2.0 phase 2, task 1):
bash scripts/db-integration.sh [jest args]starts a throwaway Postgres fromplatform/postgres(unique name,127.0.0.1, free port), applies the init scripts,prisma migrate deploy, the init scripts again andprisma db seed(the order ofmake platform-up, plus the seed the demo-seed suite needs), exports the thirteen test URLs and runsjest src/__tests__/db --runInBand(or only the file pattern the caller gives); a skipped or pending test fails the run; the container is removed on every exit path. The CI job "Database Integration Tests" (db-integration) runs it with--ci, gated on the stack scope like the smokes, so the release gate includes it.scripts/ci-change-scope.shcountsapps/web/src/__tests__/db/as stack. The new suitedatabase-layout-postgres.integration.test.tspins every model's table in its schema, thedxos_audit_rowtriggers of03-audit-triggers.sql, the append-only triggers of the ledger and sales payments,telemetry.registered_assets(a plot and a batch) and thatprisma migrate diffshows no table or column drift. Details indocs/dev-setup.md. - Platform smoke: three assertions (every table of
03-audit-triggers.sqlhasdxos_audit_row;telemetry.registered_assetsreadsparcelsandprocessing_batches; Hasura reports no inconsistent metadata). The PASS count thatapps-smokecompares goes from 149 to 152. - Reserved app schemas:
RESERVED_SCHEMAS = {core, app_tea}in the CLI;./dxos validate,installand the store catalogue sync refuse an app whoseschema_name(id)is reserved (idtea).tea-shop,tea-tourand an id that maps toapp_corestay valid.
Changed#
- The init scripts find a table in
core, thenapp_tea, thenpublic:03-audit-triggers.sqlputsdxos_audit_rowon the table wherever it is and13-registered-assets.sqlbuilds the tea part oftelemetry.registered_assetsfrom the resolved names, so both are right beforemigrate, after it, and on every laterplatform-up. - A
schemaparameter inDATABASE_URLis ignored by the web (it is removed once at start-up with a warning): Prisma would pinsearch_pathto that schema and hide the tables incorefrom raw SQL.apps/web/.env.exampleno longer has?schema=public. The three schedule routes use the shared Prisma client instead of their own. - Explicit
public.references to core tables becamecore.:PrismaZaloRepository.ts,platform/dataops/dxos_dataops/simulate.py,platform/tests/smoke-dataops.sh;smoke-platform.shfinds the audit trigger of a table by its unqualified name.
Removed#
scripts/init_n8n_tables.sql: a legacy script (a mockuserstable and unqualifiedmarket_dataandfx_rateswithIF NOT EXISTS) that nothing in the repository, Makefile, compose files, CI or docs referenced. Run against a database it would create apublic.market_datathat shadowscore.market_datafor unqualified SQL (the role'ssearch_pathlistspublicfirst).
Fixed#
- The agent respects industry packs:
get_enabled_apps()drops an app whose manifestpackis not in the cooperative'shtx_profiles.enabled_packs(the rule the web applies); the Hasuraagentrole may readenabled_packsonhtx_profiles.
Upgrade notes#
- Commands. The step-by-step commands for the three kinds of install (A: source clone with images built from source; B: source clone with release images,
make demo-up; C: release bundle, no Makefile) are inREADME.md, subsections "Nâng cấp một cài đặt đang chạy" and "Lùi về bản trước". Read them before upgrading; this list holds only what is specific to 1.30.0. - The old web must not run during
migrate. From the moment the migration commits until the new web starts, every request of the 1.29.x web that touches one of the eight tables fails (that image asks for"public"."<table>"). The migration copies and changes no row. An operation made of several separate writes can stop half-way while the old web runs against the moved tables, which is the reason to stop the web first. - Which services reconnect.
make platform-upandmake demo-upstart the platform's services as always (n8n included) and additionally restarthasura,apisixandn8nwhen they were already running before the target started, so their connections and metadata are fresh. Neither target's restart touches the web: on kind A the next stepmake web-upbuilds and starts it, on kind Bmake demo-upitself recreates it (itsup -d --no-builduses the new image tag), and in a bundle (kind C)up -d --no-buildrecreates it. A release bundle has no Makefile: its sequence stopswebandn8nbeforemigrate, starts every service without a profile afterwards (optional ones too) and restartshasuraandapisix(n8n reconnects because it was stopped and started).dxos-agent,dxos-telegramanddxos-zaloread through Hasura or the web API and need nothing. On ademo-upinstall the target also re-runs the demo seeds after the restart. - n8n's Postgres credential (
creds_postgres_new) is created by hand in n8n; it is not in this repository. It must log in as the database owner role (POSTGRES_USER), the role that carries the newsearch_path. If yours logs in as another role, either change the credential's user, or give that role the same setting and access:ALTER ROLE <role> IN DATABASE <db> SET search_path = "$user", public, core, app_tea;andGRANT USAGE ON SCHEMA core TO <role>;(plus the table privileges that role already had on the moved tables, which went with them). schemaparameter inDATABASE_URL: the web drops it at start-up and logs one warning, so the web is safe either way. Remove it from your env file anyway:psqland any other libpq client reject a URI with an unknownschemaparameter, and a Prisma client built elsewhere (for example a script that does not use the web's shared client) pinssearch_pathto that schema and cannot see the tables incore. The same holds foroptions=-c search_path=...in the URL, which the web does not touch.- If
migratefails (for example schemacorealready exists and belongs to a role that did not grantCREATEto the migrating role): the migration is atomic, so nothing moved, but Prisma records it as failed and the next deploy stops with P3009. Fix the cause, then clear the record with themigrateservice, which buildsDATABASE_URLitself (its image runsDATABASE_URL="$(node /app/database-url.js)" prisma migrate deployby default, fromPOSTGRES_USERandPOSTGRES_PASSWORDof the service), so the override repeats that step. Kind A (dev compose, from the clone):docker compose -f docker/docker-compose.yml --profile tools run --rm --build migrate sh -c 'DATABASE_URL="$(node /app/database-url.js)" exec prisma migrate resolve --rolled-back 20261130110000_core_schema --schema /app/schema.prisma'. Kind B (from the clone, release images):OPENTEA_VERSION=1.30.0 docker compose --env-file docker/.env.local -f docker/docker-compose.yml -f docker/docker-compose.release.yml --profile tools run --rm migrate sh -c '<same command>'. Kind C (bundle):$COMPOSE --profile tools run --rm migrate sh -c '<same command>'withCOMPOSEandOPENTEA_VERSIONset as in the README. Then runmigrateagain. These commands were written fromapps/web/prisma/Dockerfile,database-url.jsand the compose files, not run on an install. - Roll back. The script
scripts/schema-move-rollback-core.sqlships in the release bundle: one transaction that moves the eight tables back, resets the role'ssearch_pathand removes the migration's row somigratecan apply it again. It refuses while schemaapp_teaholds tables. Run it throughdocker exec -i opentea-postgres sh -c 'psql -U "$POSTGRES_USER" -d agrimarket -v ON_ERROR_STOP=1' < scripts/schema-move-rollback-core.sql(no hostpsql). The order (stop what writes, run the script, start the previous version from its own directory, because Hasura reads its metadata from there, and restart Hasura, because it reads it only at start) and the commands per kind of install are in the README subsection "Lùi về bản trước". On kind B never use the dev targetsmake platform-up/make web-upfor this: they recreate containers from the dev compose file. - Restart
hasuraafter pulling this change so it reloads the metadata (theagentrole readsenabled_packsonhtx_profiles); the agent's app list uses that column and is empty of pack apps until then.
[1.29.0] - 2026-11-30#
Added#
- Neutral dashboards and app cards (v2.0 phase 1, step 3): a cooperative without
tea-coregets one core dashboard for all four roles (CoreDashboard: greeting and cooperative name, newest notices, weather, and the cards of its apps) instead of the tea blocks. A cooperative withtea-corekeeps its four dashboards exactly and gains the cards block below them only when an app has a card. An app declares its cards in the manifest keydashboards; the web callsGET /apps/<id><path>with the user's token through the same gateway reader as the feed (createGatewayReader: waits 1.5 s at most, reads 64 KB at most, caches a good answer 15 s and a failure 5 s per app, path, cooperative and role) and checks every card (12 at most,label_vi1-40,value1-20,unitat most 16,statusok/warn/alert,hrefa path inside the app); a card that breaks the contract, or an app that answers badly, only loses itself. Cards render as plain text, show the status as a word and an icon as well as a colour, and are links only with anhref. Without a card a manager is pointed to the Kho ứng dụng and the other roles are told only that no app has sent a figure yet (a role can have an app in its menu and no card of its own). miniapps/shrimp-farm0.1.0, the first industry plugin after tea and the first Go code in the repository: pond management for a shrimp cooperative, using only the plugin contract. Ponds are registered as assets of kindpond(NGSI-LD typeFishContainment; sensorsdissolved_oxygen0 to 20 mg/L,ph0 to 14,salinity0 to 50 ppt,water_temp0 to 45 °C), so devices publish onhtx/<htx>/pond/<code>/<sensor>; the pond page shows the newest readings and the latest 100 of each sensor from the last 24 hours, dissolved oxygen under 4 mg/L is an alert and pH outside 7.5 to 8.5 a warning. A feeding log (editable on the day it was written in Vietnam time, afterwards only a correcting line), harvest lots<HTX>-<YYYYMMDD>-<n>that each writeHARVEST_RECORDEDinto the audit chain, and a public trace page/public/<HTX>/lot/<code>(pond, date, weight, feedings of the 30 days before, the event hash, whether the chain is intact, a QR code of the page's own address; no person's name). Workerpond-watch(every 30 minutes) suggestsnotify_low_oxygenwhen the 60-minute average oxygen of a pond is under 4 mg/L; it only suggests, and the action notifies managers and officers through the core after a person approved. A dashboard/dashboards/overviewdeclares four cards. Roles are enforced in the handlers as well as inroutes.protected: manager and officer do everything, a farmer views ponds and writes feeding entries. Dependencies:pgx/v5andrsc.io/qronly. The image isgolang:1.27-alpinebuilding intoFROM scratch(no shell, uid 10001, health check by the binary's ownhealthcheck).shrimp-farm seed-demo <HTX>fills the demo data idempotently. Harvest lots are saved in one transaction with their audit event (no event, no lot); a feeding line can be corrected once; readings older than 60 minutes are shown as old and not judged; every request has a deadline and the worker answers 502 when it could read no pond. The CI jobplatform-unitsnow sets up Go and runsgo vetandgo testin the plugin. It requires core>=1.29.0.- Demo cooperative
ST("HTX Nuôi Tôm Sóc Trăng") and its demo (v2.0 phase 1, step 6):prisma/seed.tscreatesSTwithcrop_types: ['Tôm thẻ chân trắng']and no industry pack (the profiles ofTC,LBandSTare inprisma/demo-cooperatives.ts;TCandLBkeeptea-core, and a jest test andplatform/tests/seed-test.shassert it). The Keycloak realm hasmanager_st,officer_standfarmer_stin the form of the_tcusers, and./dxos demo accountsaccepts the three_stnames (it creates them on a realm that was imported before); its default list stays the five accounts of TC.make demo-seed-shrimp(platform/demo/seed-shrimp.sh) createsSTif the database has none, sets up its three accounts, installsshrimp-farmwith--htx ST, runsshrimp-farm seed-demo ST(3 ponds, 14 days of feeding, 2 lots) and publishes 24 hourly readings per sensor per pond over MQTT with the broker accountST; pondB1ends under 4 mg/L of dissolved oxygen so the pond-watch worker has a case. Besides the hourly history it publishes one point per sensor stamped "now", withB1under 4 mg/L in its last three readings, because the worker and the pond page judge only the last 60 minutes (so the case lasts an hour after the run); a rerun in the same hour adds only one new "now" point per sensor. Without anSTbroker account (or when the broker refuses it) the readings are skipped with a message that says how to add it (see Upgrade notes), and the command exits 0. It needs the web running (make web-up) and stops with a message naming it when it is not; it never turns the AI layer on, and prints how (./dxos agent enable ST,./dxos apps actor enable) whenplatform.agent_settingshas no enabled row forST.DEMO_PASSWORDis forwarded to the three accounts.make demo-upruns it after the TC demo. The script reads only theDXOS_MQTT_DEVICESline ofdocker/.env.localand never runs that file as shell. - Acceptance of the phase 1 spec (§7): the section
[shrimp-farm acceptance]ofplatform/tests/smoke-apps.sh(a fixture createsSTwhen the seed has not, install forST, enablement,DXOS_PUBLIC_BASE_URLequal to the web'sAUTH_URL, the platform admin switchingtea-coreofLBoff and on,git statusoutside the app,seed-demoand its rerun, ponds intelemetry.registered_assets, an MQTT reading intelemetry.asset_readings, the audit event of a lot with sourceapp:shrimp-farm, the public trace page through the gateway saying "Chuỗi kiểm toán còn nguyên" with a QR code, 403 for app mode withX-Dxos-Htx: TC,--purge), the chain of the agent forSTinsmoke-app-actions.sh(a low reading, the proposalapp.shrimp-farm.notify_low_oxygen, approval through the web, the notification to the manager) and the browser storyapps/web/tests/e2e/story/shrimp-farm.spec.ts(no "chè" in the sidebar, bottom navigation and dashboard ofmanager_st,officer_standfarmer_st; the app cards; a tea page lands on the dashboard; pond, feeding line, lot and the public trace page;manager_tckeeps the 23-entry menu). CI installsshrimp-farmforSTbefore the story. - Apps scoped by industry pack (v2.0 phase 1, task 7): a manifest can declare
pack(^[a-z][a-z0-9-]{1,30}$, needsrequires.core: ">=1.29.0", refused forgenerated: trueapps). An installed app with a pack is visible to a cooperative only when the pack is inhtx_profiles.enabled_packs, in one place per query:PrismaInstalledAppRepository.list(menus, dashboard cards, the store's created apps) andisEnabledFor(the/apps/<id>/proxy, the internal app API, the season figures),PrismaAppStoreRepository.snapshot(store listing, detail, install requests;platform.app_catalog.packis new) andPrismaAppActionRepository.listAgentApps(an app with a pack is named only for the cooperatives that have it). A cooperative with no profile row sees only apps without a pack.leaf-purchase,tea-cupping,tea-shop,tea-tour,workshop-hygiene,htx-dashboardandocop-dossierdeclarepack: tea-core(patch version bumps,requires.core >=1.29.0);TCandLBsee them as before. The sweepexpireOrphanedexpires open proposals of a pack app for a cooperative that lacks the pack (app_disabled).isEnabledFornow answers false for an enablement row whose app is not installed (it used to answer true). A guarded Prisma migration20261130100000_app_catalog_packaddsplatform.app_catalog.packaftermigrateas well as afterplatform-init.
Changed#
- Core pages say "chè" only for a cooperative with
tea-core: the farmer account page (parcel stats and list, subtitle), the farmer bulletin subtitle, the crop placeholder of Hồ sơ HTX and the disease-model consent switch of Hồ sơ HTX use neutral wording or are hidden without the pack; with the pack they are unchanged. DXOS_PUBLIC_BASE_URLfor every app container: the compose file./dxoswrites for an app now hasenvironment: DXOS_PUBLIC_BASE_URL: ${AUTH_URL:-http://localhost:3000}, the web's own public address and default (./dxosandmake apps-recreatetake it from the running web container, so a release stack'sAUTH_URLreaches the app without an env file), so a plugin can draw an absolute address (shrimp-farm draws the QR code of its trace page). No secret is copied. An app installed before gets it on the nextmake gateway-syncormake platform-up(they add the line and flag the container,make apps-recreaterecreates it) or./dxos upgrade <app>. Documented indocs/miniapps.md, section 10.miniapps/shrimp-farmrequires core>=1.29.0.make demo-upexample names 1.29.0; its shrimp step needs that release or later.
Fixed#
- A proposal of an app installed a moment ago was refused with
UNKNOWN_KIND: the agent's catalogue of app actions is kept for 60 s and./dxos installruns in another process, so it could not know a fresh app. A miss for anapp.kind now reloads the catalogue once when its entries are older than 5 s and looks again (at most one reload per 5 s; a known kind never reloads). - The farmer account menu shows "Hướng dẫn sử dụng" (the tea handbook) only for a cooperative with
tea-core; in 1.28.0 it was shown to every farmer.
Upgrade notes#
- Tea apps need
./dxos upgrade miniapps/<app>. The web readspackfrom the installed manifest, which only./dxos installand./dxos upgraderewrite; no Make target reinstalls apps. Run it forleaf-purchase,tea-cupping,tea-shop,tea-tour,workshop-hygiene,htx-dashboardandocop-dossier(and any other installed tea app). Until then they behave as apps without a pack for every cooperative that enabled them, while the store already hides them from a cooperative without the pack. - Broker account for
ST. AddST:<password>toDXOS_MQTT_DEVICESindocker/.env.local(comma-separated withTCandLB; the example file has it). The broker takes it up when it is recreated: on a dev stack runmake up-sensors; on a release stack runmake demo-up OPENTEA_VERSION=<same version>again (make up-sensorsuses the dev compose file). Without itmake demo-seed-shrimpskips the readings and exits 0. - Every installed app is rebuilt and recreated once. The next
make platform-up(ormake gateway-syncthenmake apps-recreate) addsDXOS_PUBLIC_BASE_URLto the compose file of each installed app and recreates its container;./dxos upgrade <app>does the same for one app. - The three
_staccounts on a realm imported before v1.29.0../dxos demo accounts --password <password> manager_st officer_st farmer_stcreates them; without--passworda missing account has no password.
[1.28.0] - 2026-11-30#
Added#
- Industry packs per cooperative (v2.0 phase 1, step 1):
htx_profiles.enabled_packs(migration20261130090000_htx_enabled_packs: every existing cooperative getstea-core, a cooperative created later has none), the pack cataloguedomain/packs(onlytea-corefor now),enabledPackson the profile the web loads, andPUT /api/platform/htx/[code]/packs(platform_adminonly; a pack outside the catalogue or a repeated one is 400). The platform page of cooperatives has a "Gói chè (tea-core)" checkbox per cooperative. Nothing is hidden yet: the tea menus, pages and APIs behave exactly as before.TCandLBare seeded withtea-core. - One menu source, pack-scoped pages and APIs (v2.0 phase 1, step 2): the four role menus live in
lib/navigation/role-menus.tswith apackmark per entry and are filtered by the cooperative's packs (menuFor); a cooperative withouttea-coresees only the core entries, and "Thửa chè của tôi" shows only with the tea pack. The middleware setsx-dxos-pathname(overwriting any client value); the role layouts send a cooperative without the pack from a tea page to/<role>/dashboard, andrequireTenantanswers a tea API with 403PACK_NOT_ENABLED, without a new database query. The login and register pages say "hợp tác xã" instead of "hợp tác xã chè"./api/searchreturns nothing for a cooperative without the pack, and the farmer profile shows the Zalo opt-out only with it. A user with no cooperative now sees the core-only menu instead of the full tea menu.TCandLBsee and do exactly what they did before. - Audit read API for plugins:
GET /api/internal/app-core/[appId]/audit/events?subject=&limit=(serviceaudit) returns the app's own events for one subject in the cooperative of the context, newest first (limit1 to 100, default 20), withchain_intactfrom the existing chain check of the public lot page. Another app's events and another cooperative's are never returned;subjectandlimitare bound parameters. The chain verdict is kept for 30 s. ./dxos install <dir> --htx CODE[,CODE...]: enables the app only for the named cooperatives instead of every one. A bad value (a code, a space, a newline) is a usage error before anything is prepared, and a cooperative missing fromhtx_profilesis refused; an app already installed gets the missing cooperatives added (or nothing changes, and it says so). Newdxos-clipieces:commit --enable-forandenable <id> <CODES>. Without--htxinstall behaves as before.miniapps/hello-node0.2.0, the acceptance plugin of the plugin protocol: it uses nothing but the Node.js standard library and needs no change outside its own folder.POST /tanks(manager) registers asample_tankthrough the core in user mode (the user's token is forwarded, the cooperative comes from it) and writes aTANK_REGISTEREDaudit event;callCorealso speaks app mode. Thesample_tankkind has one sensorlevel(0 to 300 cm), so the ingest worker acceptshtx/<htx_code>/sample_tank/<code>/level. A migration creates the app's schema and ahook_callstable (the sample stays free of dependencies and does not query it); a workflowping(webhookapp-hello-node/pingcalling the public route/hooks/ping) is counted in memory and read at/hooks/count.- Acceptance smoke of the nine items of the phase 0 spec (§7): the section
[hello-node acceptance]ofplatform/tests/smoke-apps.shinstalls hello-node, calls the core in app mode with the app's own key, publishes MQTT readings (stored,out_of_range, aplotand abatchreading still in their old tables), checks the isolation cases (an HTX the app is not enabled for, a wrong or empty key, the app-core path of another app), then removes it (container, route, compose file gone; webhook 404; kind inactive;unknown_kind; no row oftelemetry.asset_readingsoraudit.eventslost; chain intact), reinstalls it and checks thatgit statusshows nothing outsideminiapps/hello-node/. The user-mode flow is a browser story,apps/web/tests/e2e/story/hello-node.spec.ts, which thebrowser-storejob runs after installing the app (a smoke token cannot reach user mode: the core takes a forwarded user token only from the web's client). - "Viết plugin bằng ngôn ngữ bất kỳ" in
docs/miniapps.md(§10): the whole contract in one place (headers, the two modes, error codes, limits, the MQTT topic, the healthcheck for an image without a shell, workflow rules, the removal guarantees) and a Go skeleton, enough to write a plugin without the Python helpers. A schedule trigger of a plugin workflow should not fire more often than once a minute (no validation rule yet). - Asset kinds and sensors declared by a plugin: the new manifest key
telemetry.asset_types(1 to 5 kinds, 1 to 12 sensors each withunit,min < max;plotandbatchare reserved; needsrequires.core: ">=1.27.0", not allowed for AI-generated apps)../dxos installregisters the kinds intelemetry.asset_kindsin a new journaledtelemetrystep (a failed install puts a kind that already existed back exactly as it was,upgradedeactivates a dropped kind,removeand--purgeonly deactivate and delete nothing). A kind belongs to one app; a second app declaring it is refused. - General MQTT topic
htx/<htx_code>/<asset_kind>/<asset_code>/<sensor>: the ingest worker listens tohtx/+/+/+/+and the broker ACL lets a device writehtx/%u/+/+/+(still only under its own HTX). A kind the plugin declared is checked againsttelemetry.asset_kinds(cached for 30 s) and stored intelemetry.asset_readings; new reject reasonsunknown_kindandunknown_asset.plotandbatchkeep their ranges, reasons and tables. - Asset API for plugins (needs
telemetry.asset_types):PUTandDELETE/api/internal/app-core/[appId]/assets/[kind]/[code](register or update, deactivate; never deletes),GET .../assets,GET .../assets/[kind]/[code]/readingsandGET .../ngsi-ld/entities(normalized NGSI-LD,urn:ngsi-ld:<type>:<htx>:<code>). The cooperative comes only from the caller context; at most 1,000 active assets per app and cooperative. - n8n workflows shipped by a plugin: the new manifest key
workflows(1 to 5 entries ofnameand a.jsonfileof at most 256 KB; needsrequires.core: ">=1.27.0", not allowed for AI-generated apps). Only one shape is accepted, a schedule or a webhook that calls back into the app's own public route: five node types (scheduleTrigger,webhook,respondToWebhook,httpRequest,noOp), nocredentials, no=expression at any depth,httpRequesturls fixed tohttp://apisix:9081/apps/<id>/...under a prefix ofroutes.public, webhook paths underapp-<id>/, nopinDataorstaticData../dxos validatechecks every file before anything reaches n8n. A new journaledworkflowsstep (last) normalises each workflow (app-<id>-<name>, inactive, settings reduced toexecutionOrder) intodocker/runtime/<project>/n8n/apps/<id>/;./dxos installimports and publishes them once the app is healthy and before it is registered (a failed install unpublishes and archives them),upgradeimports and publishes again and archives a dropped workflow,removeand--purgeunpublish and archive them first and keep the app if n8n refuses. With n8n stopped,./dxosuses a one-off n8n container and says so. An app withoutworkflowsnever calls n8n. Workflow nodes never follow redirects (followRedirects: falseis forced on everyhttpRequest; a file that turns it on is rejected). A failedupgradeafter n8n was touched puts the previous set back. New subcommandsworkflows-archive <id>andworkflows-rollback <id>. - File and notification API for plugins (needs
requires.servicesfilesornotify):POST /api/internal/app-core/[appId]/files(a presigned upload URL, valid 300 s, into the private bucketdxos-scannerpolls; keyapps/<id>/<htx>/<uuid>/<clean name>built by the core; JPEG, PNG, WebP, PDF, CSV, XLSX up to 50 MB),GET .../files/status(pending,clean,quarantinedfromaudit.file_scans) andPOST .../files/download-url(only for a file the scanner found clean, else 409FILE_NOT_CLEAN); a key outside the caller's app and cooperative is 403 before storage is touched.POST .../notificationsnotifies roles or up to 20 named members of the caller's cooperative in the app and, optionally, on Telegram through the existing outbox;linkmust stay in the app's own area; at most 30 a cooperative and app an hour (429), counted under an advisory lock in the newplatform.app_notifications(platform/postgres/init/14-app-core.sql). - Background workers for plugins: the new manifest key
agent.workers(1 to 5 named routes withevery_minutes30 to 1440;agentnow needsactionsand at least one ofsuggestionsorworkers; needsrequires.core: ">=1.27.0", not allowed for AI-generated apps).dxos-agentcalls each worker of an enabled app with the cooperative's agent token on its own interval (checked every 30 minutes), reads the same answer assuggestions(at most 10 items) and files each as anapp.<id>.<action>proposal through the existing approval path; a worker never runs anything itself, and a failing worker is retried next cycle without stopping the others. The gateway adds an agent-only routeapp-<id>-agent-<n>per worker (thesuggestionsroute keepsagent-1). The web treatsagent.suggestionsas optional. - Reserved sensor names: a sensor of
telemetry.asset_typesmay not be namedid,typeorname, since it would overwrite the NGSI-LD entity's own key. dashboardsdeclaration: the new manifest keydashboards(1 to 6 card sources withid,title_vi,pathunder a protected prefix androlesthat prefix allows). Declaration and validation only; the response contract ({"cards": [...]}, at most 12) is documented, nothing is rendered yet.
Fixed#
- Pages and app frames no longer hang after a few idle seconds. The web server closed an idle connection after 5 s (Node's default). A browser that reused the connection at that moment, through Docker's port proxy, got no answer and no reset, so a few requests of one page never finished (seen as a failed browser test in two release runs). The web container now sets
KEEP_ALIVE_TIMEOUTto 310 s, longer than a browser keeps an idle connection.
[1.27.0] - 2026-11-30#
Added#
miniapps/workshop-hygiene0.1.0 (Sổ vệ sinh xưởng): a five-item hygiene checklist per shift (start and end), quick scale checks against a reference weight, scale calibration and machine maintenance logs with green/amber/red due states, an A4 print copy, CSV and OCOP metrics JSON for VietGAP and food-safety inspections. Ledger rows are append-only (database triggers); a mistake is fixed by a correction row with a reason, and new rows can only be dated today or the two days before. The agent suggestsfollowup.createtasks before calibration and maintenance deadlines and when the core shows lots, leaf tickets or roasting batches with no start-of-shift log; it never writes a log. Farmers can see the purchase scales' calibration state when the manager turns it on.- App identity and the audit API for plugins: a mini-app that declares the new
requires.services(audit,files,notify; needsrequires.core: ">=1.27.0", not allowed for AI-generated apps) can call the core. The app sends its own gateway secret inX-Dxos-App-Gateway;./dxoswrites a per-appapp-<id>-core-1gateway route that checks it, rewrites the path to/api/internal/app-core/<id>/...and rate-limits the app to 300 requests per minute.sync_gatewayrebuilds that route on every run and refuses a fragment whose core route names another uri or another app. POST /api/internal/app-core/[appId]/audit/eventsappends an event to the SHA-256 audit chain with sourceapp:<id>. The cooperative comes only from the verified user token or fromX-Dxos-Htxchecked against the app's enablements, never from the body../dxos remove --purgestill deletes no audit row.
Fixed#
- The improvement smoke passes at any hour. A weekly agent is not due on a Monday before 06:30 (Vietnam), so the smoke failed in CI runs started in that window. The agent reads an optional
DXOS_AGENT_IMPROVEMENT_AT(HH:MM) and the smoke starts it with00:00.
[1.26.4] - 2026-11-29#
Changed#
-
Updated the manager lot register, members, partner map, cooperative profile, bulletin and notifications to use the illustrated manager layout.
-
The manager certificate page places the register beside the upload form and shows an illustrated empty state.
-
The manager workshop groups batch planning, selection and processing results above the two-week forecast. The seasonal report picker uses smaller type.
-
The manager report picker groups the annual shortcuts and custom date range in two illustrated panels.
-
Managers can select a date range on the illustrated settlement page and review it before creating a draft period.
-
The manager input-supplies page groups the catalogue, household advances, daily total and bank details in a responsive illustrated workspace.
-
The manager weighing-ticket page groups date, status and household filters above the filtered weight and amount, with daily CSV export and locally scrollable ticket details.
-
The manager purchase-price page groups daily price editing by grade and reserves a clearly disabled panel for price history.
-
The manager pesticide catalogue adds an illustrated header and a compact table showing product targets, linked material units and the source of the effective withdrawal period.
-
The manager growing-zones page pairs the interactive parcel map with area, status and crop filters, a filtered summary, and CSV export for visible or selected parcels.
-
The manager journal approval page pairs four status filters with the review table, CSV export and bulk approval on an illustrated tea landscape.
-
The manager overview and harvest schedule use illustrated tea landscapes. The overview groups six operational figures with notices, weather and pending journals. The harvest calendar pairs the selected day with its planned work and lists parcels awaiting a date.
Fixed#
-
Manager journal approval shows the child holding a checklist at the same height and position as the tea picker on overview and harvest schedule. The pending journal panel aligns with the overview panels above it.
-
The sidebar keeps the same width and menu spacing when switching between manager overview, harvest schedule and journal approval.
[1.26.3] - 2026-11-29#
The 1.26.2 fixes, released. The v1.26.2 tag stays, but its release gate failed and nothing was published under it.
Fixed#
- The platform smoke waits 180 s for the agent's first TC journal-review run. Credentials load in sorted order, so LB's agents call the CPU Ollama before TC runs; one slow LB round kept TC past the old 90 s and failed the v1.26.2 release gate twice.
[1.26.2] - 2026-11-29#
Fixed#
- The cooperative chat answers the dry tea stock with the right number. The snapshot the model reads listed all five grades, most at "0,0 kg", and the small local model answered with the first zero. It now gives one total and only the grades in stock, or says none is left.
- A fresh install without a Groq key has a working chat. Both example env files set
OLLAMA_MODEL=openai/gpt-oss-20b, a Groq model; withoutGROQ_API_KEYthe chat went to the local Ollama, which answered 404, and showed "Dịch vụ AI hiện không khả dụng". The default is nowqwen2.5:0.5b, the model the platform pulls; the comments say to name a Groq model only with a Groq key.
[1.26.1] - 2026-11-29#
Fixed#
- The PWA service worker no longer caches API calls or page data requests. Cached
/api/*calls and Next.js router data requests (RSC) could hold the browser's six connections per host, so pages and mini-app frames hung. They now go straight to the network; static assets and HTML pages keep their cache, and the offline journal queue (IndexedDB) is unchanged. - Browser tests block the PWA service worker. Two CI runs hung on a mini-app frame while
sw.jsand other requests stayed pending: the service worker can hold the browser's six connections per host. No spec tests the service worker. - After signing in, a person lands on their role's home, not the public lookup page. The home page
/is prerendered, so Next.js served a bare/without running the middleware's role redirect. Auth.js now returns to/?from=auth, which the middleware sends to the role home (src/lib/auth/sign-in-redirect.ts). - The platform smoke no longer stops silently after the concurrent audit writers. Its watchdog cleanup failed under
set -ewhen the watchdog had already exited, which ended the smoke with no FAIL line (a flake since 2026-11-08, hit by the v1.26.0 release gate).
[1.26.0] - 2026-11-29#
Added#
accountantrole for mini-apps: the manifest schema,appkit.ROLES(synced into every app), the webAppRoleand a new/accountant/apps/<id>/...page work as the manager's do. The accountant menu has an "Ứng dụng" group that lists only the apps with an accountant menu entry.runtime.healthcheck: an optional exec-form command (["CMD", ...]) for the Docker healthcheck, so an image without Python can be a mini-app. Without it the compose file is unchanged.miniapps/hello-node: a Node.js sample mini-app (standard library only, no npm package) with the gateway-secret check, the identity page, a read-only non-root container and its own healthcheck.node --testruns in CI andmake apps-smokeinstalls it.
Changed#
- CI skips the stack smokes for light pull requests. A PR that only touches docs, the site, n8n workflow exports, licence metadata or web unit tests runs lint, type-check, unit tests, build and REUSE in a few minutes.
scripts/ci-change-scope.shdecides; a push to main and a release still run everything. - Containers are named
opentea-*(opentea-postgres,opentea-web, ...) instead ofagrimarket-*. Volumes and networks keep their names, so data stays. On an existing stack,make platform-upandmake web-uprecreate the containers under the new names;docker execcommands use the new names (docs/dev-setup.md).
Fixed#
- n8n
officer-reminder: its error log wrote the literal{{$workflow.name}}. The workflow name and execution id now go in as query parameters, with commas in the name replaced. Contributed by @jay23606 (PR #118, issue #69).
Upgrade notes#
- Containers are renamed
opentea-*. Runmake platform-upandmake web-up: they recreate every container under its new name. Data stays, because volumes and networks keep their names. Scripts of your own that calldocker exec agrimarket-...need the new names. - Mini-apps can declare
runtime.healthcheckand anaccountantmenu entry. Such an app needsrequires.core: ">=1.26.0".
[1.25.0] - 2026-11-29#
Added#
docker/docker-compose.public.ymlfor a public host behind a reverse proxy. It pins every published port to127.0.0.1, because Docker's ports bypass the host firewall, and it sets Keycloak's public URL fromKC_PUBLIC_URLwith forwarded headers. A test fails when a new published port is not pinned.- H-P-D-I share radar on the manager board: the maturity card now splits 100% into H, P, D and I from real records (P from weighings that passed the withdrawal gate, D from sensor parcels with a reading in 24 hours, I from AI proposals a person approved; each capped at 30%, H is the rest) and draws it as a plain SVG radar with the evidence under it.
- Headless Tier 1:
make up-headlessstarts the platform withoutwebor any UI;- MQTT ingest now checks
telemetry.registered_assets, a platform view over the newtelemetry.assetstable (any domain registers assets there) and the tea parcels and batches, so it no longer reads tea tables; - existing stacks get both with
make platform-up. - Non-tea book template:
custom-booksgainscraftlog, a production log for a bamboo and rattan craft village. - One-click backward lineage from a lot:
GET /api/lineage?kind=lot&code=...&direction=backwardwalks lot, processing batches, fresh leaf tickets, crop cycles and journal entries (legacy lots go parcel to cycle to journal), each node with the SHA-256 of its latest audit row, in one batched read per level. A "Truy hồi" button on every lot row on/manager/lotsand/officer/lotsopens the recall panel with the trace and the line "Chuỗi kiểm toán: N/M bản ghi có dấu SHA-256". The default forward drill and the signed evidence bundle are unchanged. make demo-up OPENTEA_VERSION=X.Y.Z [DEMO_PASSWORD=...]: one command for a stage demo from the published images. It fetches and checks the model files, pulls the release, starts the stack in the README order, seeds the base sample data on a fresh database only, prepares the five demo accounts and loads the TC demo story.- REUSE 3.3 compliance:
REUSE.tomlandLICENSES/(MIT, Apache-2.0, CC-BY-4.0, OFL-1.1) cover every file;- third-party material is named: the ICTU-OpenAgri model, the Piper voice, the Be Vietnam Pro font and the Gradle wrapper;
- CI runs
reuse lintand a gitleaks scan of the whole history. - GS1 Digital Link, EPCIS 2.0 and NGSI-LD:
/01/{gtin}/10/{lot}checks the GTIN check digit, then redirects to/q/{lot}; withAccept: application/ld+jsonor?format=epcisit returns EPCIS 2.0 JSON-LD for lots whose QR was exported. The GTIN is not stored.GET /api/ngsi-ld/v1/entitieslists the cooperative's parcels and processing batches as NGSI-LD, read only, for manager and officer.GET /api/iot/ngsi-ld/parcels/{code}is one parcel's digital twin: location, current cycle and the latest value of each sensor with itsobservedAt.- Workshop roasting telemetry: MQTT topic
htx/<HTX>/batch/<batch_code>/<sensor>(roast_temp,dry_temp,dry_humidity) intotelemetry.batch_readings;/qshows "Mẻ sao đạt chuẩn nhiệt" for a verified curve, and a flat stream never earns it. Existing stacks get the table withmake platform-up. - Lineage, recall drill and signed evidence:
GET /api/lineageruns a read-only recall drill from a parcel, a pesticide, a batch or a lot, down to the orders it reached.GET /api/lineage/bundledownloads a lot's evidence bundle, signed with Ed25519;GET /api/public/verify-keypublishes the key that checks it.- The "Truy vết và thu hồi thử" panel is on the lots pages of the head and the officer.
- Production needs
DXOS_EVIDENCE_SIGNING_KEY; without it the bundle answers 503. - Chat mode "Vận hành HTX" (
type: cooperative) for the manager, officer and accountant, with a new/accountant/chatpage. - It answers from the HTX's own board figures; a sentence with a number outside them is dropped, and with the model down the figures themselves answer.
- The accountant gets this mode only;
marketandtechnicalstay 403 for that role. - H-P-D-I self-assessment card below the six manager board blocks, with an honest empty state under 5 records and the source of every figure.
- Wind tunnel on the cross-check thresholds:
GET /api/agent/settings/cross-check?preview_*returns the alerts the last 30 days would raise now and with the previewed values. Read only. - One-click handoffs between existing screens: no schema change.
- Cross-check notices (A13) show their evidence in plain Vietnamese (kg, day, parcel code, household) and link to the screen where the person acts. An officer can now decide internal staff notices (A2, A9, A13) as well as a manager, and gets their Telegram prompts; notices to households stay manager-only.
- Price board: "Giữ nguyên giá kỳ trước cho hôm nay" publishes the latest earlier price of each grade not priced today, through the existing publish use case, after a confirmation that names the grades with no earlier price. The board shows the date of that price, and the weighing form shows a banner while nothing is published today.
- A finished processing batch links to "Đóng lô từ mẻ này →", which preselects the batch in the lot-from-batches form. Nothing is created until the person confirms.
- The farmer diagnosis result links to a new spraying entry for the parcel that was diagnosed.
/officer/journalshows the open A1 verdict per entry ("AI A1: Đạt quy tắc" or "AI A1: Cần kiểm tra") from one batched read,GET /api/journal/review-status.
Changed#
- CI: the 56-minute platform job is five parallel jobs.
- Platform Unit Tests (about 3 min) needs no stack.
- The other four each start their own stack: Platform Smoke Test (smokes and agentic, about 24 min), Browser Smoke (Core), Browser Smoke (Store & Apps), and Mini-app Smoke.
apps-smokechecks the platform after removing the apps without the web checks: 149 PASS. The Platform Smoke Test job runs those 42 web checks.- The project site moved to https://opencoop.ailearn.website and the live demo is https://app.ailearn.website. The site has a "Dùng thử bản demo" button. GitHub Pages now only redirects the old
maiychrus25.github.io/OpenTea-DX-OS/<path>links to the same path on the new site (scripts/build-pages-redirect.sh). audit.eventsgets an index on(table_name, row_id, id DESC). The backward lineage reads the newest event of given rows; without the index it would scan the whole append-only log.make platform-upadds it.- The three model files left the Git tree (about 80 MB:
leaf_disease_model.keras,tea_leaf_model.keras,vi_VN-vais1000-medium.onnx). - They live on the release
models-2026.11. download-model.shanddownload-model.ps1fetch them and check each SHA-256 againstmodels.sha256.- A file that is already in place with another hash is reported and kept.
- The release bundle drops from about 80 MB to under 1 MB.
- Seven scratch scripts were removed from
apps/web. They held a hard-coded Keycloakadmin/adminlogin and test phone numbers. - The autopilot probation is a hard block: a kind is opened and runs on its own only with at least 10 human decisions in 30 days and a match rate of 90% or more. Before, 90% was only a warning.
Fixed#
GET /api/seed-farmeranswers 404 in production. It is a development helper that let any signed-in user create a household linked to their own account.- Telegram: once a proposal is decided from its card, the card turns into the result and loses the Duyệt and Từ chối buttons.
Upgrade notes#
- Run
make platform-up, thenmake web-up. platform-upapplies12-batch-telemetry.sql,13-registered-assets.sqland the newaudit.eventsindex.web-uprebuilds the web.- Set
DXOS_EVIDENCE_SIGNING_KEYindocker/.env.local: a PKCS#8 PEM fromopenssl genpkey -algorithm ed25519, on one line with\nbetween the PEM lines. Without it, a production web answers 503 on the evidence bundle and 404 on/api/public/verify-key. - A public host behind a reverse proxy adds
-f docker/docker-compose.public.ymland setsAUTH_URL,KC_PUBLIC_ISSUER,KC_PUBLIC_URLandMINIO_PUBLIC_ENDPOINT(README, "Bản phát hành"). - After pulling, run
bash download-model.sh(Windows:.\download-model.ps1). Git removes the three model files from your working tree when you pull, because they are no longer tracked; until you run it,disease-apiandpiperhave no model.
[1.24.0] - 2026-11-29#
Added#
- Stage demo data for HTX Tân Cương:
make demo-seed(ornpm run demo-seedinapps/web) runs afterseedand builds one connected story, with no new business feature. It covers: - today's leaf prices;
- recent weighing tickets;
- TC-A3 still in withdrawal, so the weighing station shows the red block;
- a finished processing batch at 4.75 : 1;
- lot
TC-CHE-A3-001with all four layers on/qand a sample VietGAP certificate; - a closed settlement with an advance offset and a VietQR on the slip;
- the inputs that make the cross-check agent raise both alerts.
A second run adds nothing. The closed settlement is never touched again, because the ledger is append-only.
- ./dxos demo accounts [--reset-otp] [--password <p>] prepares the five demo accounts (platform_admin, manager_tc, accountant_tc, officer_tc, farmer_tc):
- it creates a missing one with its role and htx_code;
- it clears stuck required actions such as TOTP setup;
- it removes OTP only with --reset-otp.
Any other username is refused.
- python -m dxos_agent --once cross-check --htx TC runs the cross-check agent once, on the same code path as the daily schedule.
- scripts/check-schema-doc.py fails CI when docs/database-schema.md and schema.prisma disagree on a table or column.
Changed#
- Mini-apps accept only requests that came through the gateway.
- Each installed app gets its own secret in its env file.
- APISIX sends it as
X-Dxos-App-Gatewayon every route of that app, public routes included. - The app kit,
helloandhub-mobilerefuse anything else with 403, exceptGET /healthz. Without the secret they refuse every request. - This closes the cross-app spoofing limit on
dxos-apps-net(R24). - The app store hides
htx-dashboardandhub-mobileunlessDXOS_LABSis on, likeleaf-purchaseandfarm-supply, so the store matches the README and the site. They show "Đang đóng băng" and cannot be installed. The board's "Phân tích chi tiết" link still works for an HTX that already hashtx-dashboard. - README and site are rewritten for v1.23, centred on the OSI-licensed core.
n8n(Sustainable Use License) and the Groq, OpenAI and Anthropic APIs are optional integrations.- They cover five roles with role switching,
dxos-zaloin the release images, and the advertised mini-apps only:tea-shop0.4.0,tea-tour,custom-books0.3.0 andhello. - The site screens and the social card are real screenshots of the demo data. No frozen app is shown.
docs/database-schema.mdmatchesschema.prismacolumn by column:chat_historyis added, and the olduserstable is removed. DEV-016 is fixed. DEV-015 is updated for v1.23.0.
Fixed#
make apps-recreaterebuilds the app image. It only recreated the container, so an app installed before v1.24 kept its old image, whose code ignores the gateway secret, and still answered direct requests ondxos-apps-net.- The cross-check agent (A13) never reached Hasura (since 1.22.0). It declared its spraying and ticket filters as
timestamptz, whilejournal_entries.entry_dateandfresh_leaf_tickets.weighed_ataretimestampcolumns. Hasura refused the query, and the run only logged an error. The filters now usetimestamp, from Vietnam midnight written in UTC. Its read of its own earlier proposals also filtered on a column the agent role cannot see; the Hasura permission already limits it to cross-check proposals. A test now checks every field it reads against the agent role's columns.
Upgrade notes#
- Run
make platform-upafter pulling. It creates a gateway secret for every installed mini-app, then rebuilds and recreates those apps so they check it. Until it runs, an app installed before this release still accepts requests that did not come through the gateway. - Demo stage:
1.
./dxos demo accounts(add--reset-otpif an account still asks for TOTP); 2.npm run seedonce on a fresh database; 3.make demo-seed.
Do not run seed again on the same database after demo-seed; rebuild the database instead.
- The cross-check alerts for the demo appear after python -m dxos_agent --once cross-check --htx TC, run in the agent container.
Known limits#
hub-mobile(frozen) has no gateway check.make demo-seedneeds network fornpm ciin the migrate image (about 30 s).
[1.23.0] - 2026-11-28#
Added#
- One label list for tea pests and diseases (
apps/web): officers confirm a disease report with a label fromdisease_labels, 14 codes, with the five targets first: Rầy xanh, Bọ cánh tơ, Nhện đỏ, Phồng lá chè, Bọ xít muỗi. - The free-text name stays.
- Telegram asks for the label too.
- Older reports are labelled only on an exact name match.
- Training consent (
apps/web): the head can let the cooperative's confirmed photos be used to train the tea model. It is off by default, needs a confirm step to turn on, and is audited. - Field photo manifest:
GET /api/platform/disease-dataset(platform_adminonly) lists the confirmed, labelled photos of the cooperatives that agreed. - It carries no names, phones or household ids; each photo has a one-way
household_key, its sha256 and a download link that lives 15 minutes. - It is paged (500 per page,
next_cursor), andfetch-fieldfollows the pages. ai-models/tea: training can now use the cooperatives' confirmed field photos, with stricter checks before a model ships.train.py fetch-fielddownloads the photos, checks their sha256 and strips every EXIF and GPS tag.- A class without public photos needs at least 150 field photos.
- A
not_tea_leafclass is always included. - Stricter quality gates: accuracy 0.80, recall 0.70 per target, field accuracy 0.75 on photos held out by cooperative, or by household while only one cooperative has agreed (recorded as
field_splitin the registry). A model that fails, or a class with too few households to split, printsBLOCKEDwith the reason and writes nothing. - Model registry:
ai-models/tea/registry.jsonpins the tea model's version and sha256. disease-apirefuses a model file that does not match it:/healthshows why, and the general model keeps working.- Every tea prediction reports
model_version, and the web stores it on the report. - CI checks that the sha256 matches.
- Care steps (no medicine) for the four new targets, and a "chụp lại" step when the photo is not a tea leaf.
Changed#
- Zalo errors: the relay follows the real ZNS error codes.
- -124 and -216 refresh the OA token and resend.
- Template errors (-109, -111, -112, -117, -131), a wrong phone (-108), no Zalo account (-118) and no balance or quota (-115, -126, -211) stop at once, with a Vietnamese reason.
- Chatbot sources: the technical chatbot names the files of the passages it used as sources when the model writes none.
- Scientific names: Rầy xanh and Bọ cánh tơ use the names of Vietnamese tea references: Empoasca flavescens and Physothrips setiventris.
Fixed#
make up-voicefailed on Apple Silicon because the whisper.cpp image is amd64 only. The two whisper services now ask forlinux/amd64, which Docker Desktop runs emulated.
Upgrade notes#
make platform-up, thenmake web-up: the first applies two migrations (20261128180000_disease_labelsand20261128180100_disease_training_consent), the second rebuildswebanddisease-api.disease-apinow loads the tea model only when its sha256 matchesai-models/tea/registry.json.- Field data is not collected until a cooperative's head turns on "Cho phép dùng ảnh đã xác nhận để huấn luyện mô hình nhận diện sâu bệnh".
Known limits#
- With photos from a single cooperative, the field test holds out whole households, not cooperatives, so its score may flatter the model on a new cooperative. The registry says which split was used.
not_tea_leafis trained on synthetic noise only.- The officer disease list needs the core gateway. It cannot be checked on a stack without it.
[1.22.0] - 2026-11-28#
Added#
- Cross-check agent (A13): every morning at 05:45 the agent raises two alerts for officers and the head, as proposals with evidence; it never changes data.
- Pesticide advanced to a household, but no spraying logged on any of its parcels within 10 days.
- Leaf weighed on a parcel in one flush above 1,800 kg per hectare × 1.35. It is raised again only after a further 20% of that limit.
The head changes the four thresholds on /manager/ai/settings. The agent reads advances, tickets and batches without any money, name or phone column.
- 14-day forecast (apps/web): /officer/processing and /manager/processing show the fresh and dry tea expected over the next 14 days, by week and by parcel.
- A parcel's figure is the median of its last three flushes, or its area times the norm when it has none (marked "Theo định mức").
- Dry tea is fresh ÷ 4.75. The director board's dry stock block adds the 14-day figure.
- Technical chatbot reads PDFs: text PDFs in the cooperative library are read, and the answer is built from the four passages that best match the question, each citing its file.
- A question with or without Vietnamese diacritics finds the same passage.
- Scanned PDFs are named as unreadable and never used.
- Files marked ai: false, or in a folder with .ai-ignore, are never read.
- New dependency unpdf 1.6.2 (MIT).
- "Nghe" for farmers: a listen button on today's prices and picking dates, the journal guidance, the diagnosis care plan and the ledger balance. It never reads a bank account. Spoken audio is cached for 7 days.
- Zalo messages for members (platform OA): members who agreed get four ZNS messages, through one platform Zalo OA and the new dxos-zalo relay:
- today's leaf price;
- a weighing receipt;
- "withdrawal ended" for their parcel;
- their settlement result, with a link to the slip.
The details:
- Each cooperative turns Zalo on, picks the kinds, sets quiet hours (default 21:00–06:00) and a monthly quota (default 2,000) on /manager/zalo, which also lists deliveries with the reason a message was not sent.
- Officers record consent on the household page. A farmer can turn messages off for their own household from the profile. A household without consent is never sent anything.
- The platform admin enters the OA token and the approved ZNS template ids on /platform/zalo. Tokens are stored encrypted and never shown again.
- A ZNS stub (dxos-zalo-stub, profile zalo-test, port 8084) lets the smoke run every message end to end without an OA.
- Tea handbook template (docs/templates/para-tea-cooperative): 66 notes and 5 tables on cultivation, pests and diseases, processing and sales, food safety, cooperative law, finance and regional data, ported from the resource survey by Nguyễn Bá Quyến (PR #99) into English kebab-case folders, each file crediting the author and its own sources. The officer pesticide reference carries ai: false. ./dxos para seed <HTX> [--dry-run] copies the template into para/<HTX>/ through the web document API, only files that do not exist yet.
Changed#
POST /api/ttsnow enforces 20 requests per minute per person (429RATE_LIMITED).
Upgrade notes#
- Set
DXOS_ZALO_TOKEN_KEYindocker/.env.localto 32 random bytes (64 hex characters, for exampleopenssl rand -hex 32) before saving an OA token; the web refuses to store a token without it. make platform-up, thenmake web-up: the first creates the Zalo tables (10-zalo.sql), restarts Hasura so the agent can read the new tables, and startsdxos-zalo, which waits healthy until a token exists; the second rebuilds the web app at1.22.0. No data migration.- Cross-check agent: it runs for each cooperative that already has the agent enabled. Review the thresholds on
/manager/ai/settings. - Zalo (optional):
./dxos zalo enablecreates the Keycloak clientdxos-zalo. SetZALO_APP_IDandZALO_APP_SECRETso the relay can refresh the token. Asplatform_admin, enter the OA token and the four ZNS template ids on/platform/zalo. Then turn Zalo on per cooperative on/manager/zaloand record consent.
Known limits#
- The ZNS error codes in
platform/zalo/dxos_zalo/zns_api.pyhave not been checked against Zalo's documentation; check them before going live. - The TTS limit is per web process.
- Text is pulled from a PDF the first time the chatbot reads it, not when it is uploaded.
- The forecast does not use the weather.
[1.21.0] - 2026-11-28#
Added#
- Director board (
apps/web):/manager/dashboardanswers the six morning questions on one screen: - fresh leaf weighed today against yesterday;
- today's leaf prices, or a button to publish them;
- what the cooperative owes its members;
- dry tea in stock by grade;
- what traders still owe;
- red alerts: parcels in withdrawal, off-band batches, batches left open, old stock, a draft settlement, members unpaid for more than 7 days, no price after 7:00, and overdue wholesale orders.
Each block loads on its own. /accountant/dashboard shows the money blocks.
- Sales drawn from lot stock (apps/web): the head and the accountant record wholesale orders to a partner from QR-exported lots, in kilograms with one decimal at a price per kg.
- Stock is counted in grams, and an order larger than what is left is refused.
- Payments are recorded against the order and can never exceed it.
- The default due date is 30 days after the order and can be changed per order.
- Trader receivables and overdue orders show on the board and in "Công nợ thương lái". Nothing is sent to traders.
- Only the head cancels an order, and only before any payment.
- Core Action API for mini-apps: /api/internal/apps/*, reachable only on the internal gateway port. A mini-app calls it with the manager's own token, which the core checks again.
- tea-shop 0.4.0: a product can be linked to a QR-exported lot, with the net weight of one pack.
- Confirming an order records it in the core, so retail and wholesale draw from the same lot stock.
- If the lot is short or the core cannot be reached, the order is not confirmed.
- It needs core 1.21.0.
- Season and year report (apps/web): /manager/reports builds a report for the members' assembly over a year or chosen dates. It covers members and area, leaf bought by month and grade, member payments and advances, processing, lots and valid certificates, sales and receivables, and safety. It prints on A4, and each section downloads as CSV.
Changed#
- The cooperative head's home page is the director board. The world tea price and the area cards moved off it.
- The accountant can read the partner list, to pick the buyer of a wholesale order.
[1.20.0] - 2026-11-28#
Added#
- Processing batches (
apps/web): - Officers and heads open a roasting and drying batch, add whole weighing tickets that are not in another batch, and record the dry tea out by grade (Đinh, Tôm nõn, Móc câu, Bồm, Cám).
- The fresh to dry ratio is checked against 4.50–5.00 : 1. A batch outside that range finishes only with a written explanation.
- A ticket in a batch cannot be voided.
- Lots from batches (
apps/web): a lot is closed from the dry tea stock of finished batches, one grade at a time. Its weight is the stock drawn, never more than what is left. - Its parcels and flushes come from the batches' tickets.
- Each ticket is checked against withdrawal on its own weigh day.
- Certificates (
apps/web): - The cooperative stores VietGAP, OCOP, organic and other certificates with number, issuer, dates and the original file (PDF, JPG or PNG up to 10 MB) in the stack's SeaweedFS store.
- A QR export attaches the certificates valid that day.
- The head can revoke a certificate, and the public page then shows it as revoked.
- One public QR page (
apps/web): /q/<lot code>shows four layers: origin, withdrawal safety ticket by ticket, the processing batches with their ratio, and certificates.- Names of people are hidden unless the head allows them in the cooperative profile.
- Old labels pointing at
/lot/<lot code>are redirected with a 308. - A label page prints QR labels at 50×30, 40×30 or 60×40 mm, one label per page.
Changed#
- Creating a lot straight from parcels (
POST /api/lotsand the chat action) and exporting a lot that has no batch behind it now needDXOS_LABS; lots already exported keep their pages. - Lot codes are numbered under a lock, so two lots made at the same moment no longer collide.
[1.19.0] - 2026-11-28#
Added#
- Flushes and the pesticide catalogue (
apps/web): - Journals, weighing tickets and lots belong to a flush (
cycle_id). After a harvest, the next care entry opens a new flush. Pruning is a journal activity. - Farmers and officers pick sprays from a catalogue of 20 products with a minimum withdrawal period by group: 7 days for botanical, microbial and biological products, 14 for chemical ones and for "Thuốc khác". Each floor is flagged "Mức sàn mặc định — cần đối chiếu nhãn thực tế". The platform admin sets the label period for the catalogue, and the cooperative can set its own label above the floor.
- The journal form shows only the fields of the chosen activity. A harvest records "Sản lượng búp tươi (kg)".
- Farmers can fix a journal sent back with "Sửa lại", and journals written offline are queued and sent once.
- A disease prescription creates a draft spraying journal for the farmer.
- Several roles on one account (
apps/web): - New roles
accountant(kế toán, bàn cân) andplatform_admin. - One account can hold several roles of its cooperative and switch between them from the menu.
- The platform admin manages cooperatives, the pesticide catalogue and each cooperative's AI settings and budget. These settings left the cooperative head's screens.
- Sign-in codes (TOTP) are optional for heads and officers, and an invitation no longer needs an email.
- Weighing station and daily leaf price (
apps/web): - The cooperative head publishes today's price per leaf grade on one screen, with yesterday's prices filled in.
- The accountant writes a ticket per household, parcel and grade, with a rain and impurity deduction. The server computes net kg and amount, and a receipt prints at 80 mm.
- A parcel inside its withdrawal period cannot be weighed, with no override for anyone.
- Tickets can be voided with a reason until they are settled. Farmers see today's price and their tickets.
- Input advances, member ledger and settlement (
apps/web): - The accountant records inputs (fertiliser, pesticide, other) advanced to a household. The amount is quantity × price, rounded half up to whole dong.
- The cooperative head closes a settlement period after a confirmation that shows the totals. Each household gets
Tiền búp − Nợ vật tư = Thực lĩnh, and a debt left over carries into the next period. - Each line prints as an A5 slip with a VietQR code for the transfer, and a payout is recorded once.
- Farmers see their balance, unsettled tickets and advances, and their slips with the account number masked.
- The ledger is append-only: corrections are adjustment rows.
Changed#
- The
leaf-purchaseandfarm-supplymini-apps are hidden from the app store unlessDXOS_LABSis on; their work now lives in the core. - Lot traces and lot export use the date rules for withdrawal:
- An open parcel on day D is blocked by every spraying done by D whose safe date is after D, whatever its flush.
- A lot line harvested on day H counts a spraying of its flush, or one done by H, whose safe date is after H.
Security#
- Household bank details are visible in full only to the head and the accountant. They are not sent to Telegram, agents or logs, and are left out of the Hasura household columns. A change of payout account records who made it in the audit trail.
- New core tables (pesticides, memberships, leaf grades and prices, tickets, input items and advances, settlement periods and lines, ledger entries) are covered by the audit hash chain.
[1.18.0] - 2026-11-28#
Added#
- Farmer pages (
apps/web): overview, journal grouped by date, harvest calendar with withdrawal periods and day details, farming handbook linking to real articles, a bulletin page with article pages, account page, disease diagnosis with a care plan after the AI names a disease (the product and dose stay with the officer), and a side menu with counts, an account menu and a folded rail - Maps (
apps/web): street and labelled satellite layers centred on Tân Cương, clearer partner, parcel and parcel-drawing maps - Sign-in and registration (
apps/web): new two-panel layout; the name typed on the sign-in page pre-fills Keycloak, which still takes the password - Sample content, such as the camera watch, tea prices and handbook counts, is marked "Mẫu" until a data source exists
- Cooperative head pages follow the new design (
apps/web): journal approval gains headline figures (waiting, overdue, approved this month, to be corrected), filters, a detail view and CSV export. Members lists join requests first, with land columns and export; lots show the chosen lot beside the list; the calendar lists unscheduled parcels; farm zones add a parcel table and GeoJSON export; the inbox separates today; the dashboard adds notices, the coming days' weather and approval of chosen journals. Where there is no data yet (weekly yield, partners, apps, notices, parcel positions) the design's example is shown with a "Mẫu" tag. - Officer web design (
apps/web): the officer pages take the new look (path line, underlined page headers, striped tables, grouped menu), with new Products, Orders, Revenue, Tours and Tour bookings screens. These five show fixed sample content and cannot be edited; they do not read from the shop or tour mini-apps. The headline figures on each officer page can be pressed to filter or order the list below, and the dashboard figures open the list behind them. - Weather in the farmer's greeting banner (
apps/web): the dashboard banner shows the live temperature, humidity and rainfall over the parcels, rain falls across it when it is raining there, and it replaces the separate weather panel. - Reels on the web (
apps/web): farmers, officers and managers have a "Reels" page with sample clips: like, save, follow, comment, reply, share, auto-advance, playback speed, and posting a clip from the computer. There is no video service yet, so everything done there stays in the browser and is gone after a reload. - Live weather on the bulletin pages (
apps/web): managers and farmers see the weather where the cooperative's parcels are, read from Open-Meteo throughGET /api/weather/live: temperature, rain chance, humidity, wind, a 24 hour strip and a 10 day forecast. Parcels about 5 km apart share one card, and parcels without coordinates are left out. The card animates rain when the forecast says it is raining, and stays still for people who ask for reduced motion.
Changed#
- Officer overview (
apps/web): compact, tenant-scoped dashboard with live weather, withdrawal conflicts, six-row journal pagination and approval, disease photos, upcoming harvest safety, a tagged schematic, real weekly activity and approval metrics, household journal coverage and tagged shop/tour samples; farmer weather defaults stay unchanged. - Officer summaries and cards (
apps/web): shared icon summary strips derived from loaded data, hill-decorated headers and reference-style household/lot/disease cards; preserve existing actions and tables, scope journal/document counts to visible results, and leave manager/farmer styling unchanged. - Farmer web screens follow the new design, with the handbook showing fixed placeholder content until the feature exists. Farmers' Q&A uses the same full-window chat as staff; the AI is not open to farmers yet and says so.
- New web interface (
apps/web): new colour tokens, a grouped sidebar, a breadcrumb top bar and a bottom bar for farmers on phones; new dashboards for the three roles; page headers, filters, tables and cards restyled across the role pages; a rebuilt login page and cooperative profile page. The profile page now shows the cooperative's own parcel and household figures instead of fixed sample numbers.
Removed#
- Sample screens and blocks (
apps/web): the Reels pages of all three roles; the officer shop and tour pages (Products, Orders, Revenue, Tours, Tour bookings) and the "Trợ lý TT" market assistant, so the officer keeps one chatbot; the farmer camera watch, sample detections, sample tasks, sample pest report, sample bulletin prices and articles, and the farmer chatbot page; the manager sample yield chart, sample apps, sample partners, sample notices and the in-memory certificate manager; the demo/forgot-pinflow, which now sends a signed-out visitor to/loginwith a line telling the member to ask the cooperative officer to reset the PIN. A bookmark to a removed page shows the normal 404 page. This replaces the earlier "Mẫu"-tagged sample content listed above. - Simulated and off-domain market data: the workflows
vietnam_market_sync,worldbank_sync,faostat_sync,nasa_power_syncandwto_tariffsand the simulated-price label.comtrade_export_synckeeps only tea (HS0902). The migration20261128110000_purge_market_datadeletes the rows those workflows wrote and the non-tea Comtrade rows frommarket_data; it is not reversible and has not been run on any running stack. custom-books0.3.0: the four templates that duplicate core records (picking,spraying,fertilising,pest). Books already made from them keep working; an openbook.createproposal that names a removed template is rejected when approved.
Fixed#
- Withdrawal period (
apps/web,platform/agent): aREJECTEDspraying journal no longer counts toward the withdrawal period, so it no longer blocks harvest approval or lot creation.DRAFTandREJECTEDare left out;PENDING_APPROVAL,APPROVEDandREQUEST_CHANGESstill count. One shared rule serves harvest approval, lot creation, the harvest calendar, the farmer dashboard, the campaign candidates, the lot trace and theharvest-readyagent. - Public trace page (
apps/web):/q/[lot_code]no longer reads?status=from the URL, so a link cannot show a lot as revoked or valid; the status comes from the lot. - Dashboards (
apps/web,miniapps/htx-dashboard0.3.1): market blocks show tea prices only, or an empty state; documents and bulletin pages show an error or empty state instead of sample files and articles. - Wording: rice terms are replaced by tea terms ("Trồng mới" instead of "Gieo sạ", "nương chè" instead of "thửa ruộng", the sample address is in Tân Cương). The content test
no-rice-copynow also rejects those words. Some mis-encoded Badge labels are repaired.
Changed#
- Frozen features behind
DXOS_LABS(ADR 0005): the mini-app factory, autopilot, strategy agent, MCP and staff sync run only whenDXOS_LABSis1ortrue. The default is off. When off, 21 routes answer 404, their pages and tabs are hidden, the Telegram/tuvanhanhcommand and theapp.requestchat intent answer "chưa mở" (/dungstill stops), anddxos-agentdoes not schedule those jobs. The code is kept. The compose file passes the variable towebanddxos-agent;.env.exampledocuments it. Mini-apps already built and installed keep running. - Food safety and money stay with people:
harvest.approve,journal.approveand every app action markedmoneyare nownever, so no switch lets autopilot run them. The init script08-agent.sqldrops those kinds from stored unlocked kinds. - Search (
apps/web): invented suggestions are gone and each result links to the page of the searcher's role.
Security#
GET /api/membersandGET /api/searchanswer 403 to farmers; the global search box is hidden for farmers.members/inviteandmembers/[id]stay manager only.- Partners belong to a cooperative: the migration
20261128100000_partners_tenantaddspartners.htx_profile_id, every read and write is scoped to the caller's cooperative, managers and officers read, only managers write, and a row of another cooperative answers 404. Existing demo partners go to cooperativeTC, or to the only cooperative if there is one. - Known follow-up: the store screenshots of
custom-books(miniapps/custom-books/store/*.png) still show a removed template and must be re-shot with a running stack (seedocs/dev-setup.md).
[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
initDatahas a valid signature, is under 24 hours old and names the linked account. - Buttons in chat.
Sửaon a farmer's journal card opens the form already filled in, andMở chi tiếtopens 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ặnmeanwhile. - 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.
/dungon Telegram orDừng ngayon 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): agentblock inapp.yaml. A mini-app declares a suggestions path and up to 10 actions.dxos validatechecks 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-actorand three headers naming the approver. The gateway strips those headers on every other route. tea-shoppromotions. The shop suggests a promotion for stock of 20 packs or more unsold for 21 days.promotion.createinvolves 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 builderbuilds 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 servicedxos-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ửaandHuỷ. OnlyĐúngsends the sentence on, as if typed, so a write still needs its confirmation card. - Model choice.
make stt-measuremeasures 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 aNghebutton: the web reads it with Piper and the relay sends the audio fileban-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 enablenow also creates the clientdxos-web-serviceand writes its secret, next to the Mini App key, into the web'sroles.env../dxos telegram disableremoves them.
Fixed#
- A farmer with no household (
apps/web).GET /api/journalanswers 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.updatechanges a threshold within fixed ranges, marking whether it tightens or loosens;improvement.adoptcovers 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-dashboard0.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.pyand the new clientdxos-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 benchmarkruns every agent scenario suite with a chosen model, and the results are published indocs/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 indocs/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 oneagent.external_callaudit 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, optionalDXOS_ANTHROPIC_MODEL,DXOS_OPENAI_MODEL) reach onlydxos-agent; a test-only LLM stub (profilellm-test) andplatform/tests/smoke-llm.shcover the path in CI. - Agentic layer milestone M2: Telegram (
platform/telegram,apps/web,platform/agent,workflows):dxos-telegramrelays 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_dataHMAC, 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 newworkflows/system-error-alert.json(set aserrorWorkflowof every workflow). New:./dxos telegram enable|disable, realm roletelegram, tables inplatform/postgres/init/09-telegram.sql, a stub Bot API andplatform/tests/smoke-telegram.sh. SetTELEGRAM_BOT_TOKEN,TELEGRAM_BOT_USERNAMEand, for a release,DXOS_TELEGRAM_CALLBACK_KEYindocker/.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.ymlpublishes 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-onlydxos-agentruntime modules: cross-language canonical JSON + SHA-256evidence.py, schema-validated LLM provider abstraction with 1-retry JSON repair (ReplayProviderandOllamaProviderwith>= 60sHTTP 429 backoff over dedicated APISIX route/api/internal/agent/llm/v1/chat/completions), Keycloak/Hasura/internal-API client, Agent A1journal-reviewwith deterministic farming hard rules (WITHDRAWAL_PERIOD,MISSING_INFO,DOSAGE,INCONSISTENT), prompt-injection resistance, rule-based fallback on LLM outage, andplatform/agent/tests/scenarios/a1_journal_review.jsonscenario tests. - Agentic layer milestone M1b (
dxos, Keycloak, Hasura, APISIX,apps/web): added realm roleagentand./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 Hasuraagentpermissions across cooperative tables, internal-only APISIX:9081route/api/internal/agent/*injectingX-Dxos-Gatewayafter claim validation, RS256 JWKS verification + internal run/proposal ingestion routes inapps/web, Jest unit/route tests, andplatform/tests/smoke-agent.shboundary smoke checks. - Agentic layer milestone M1a (
apps/web,platform/postgres/init/08-agent.sql): addedplatform.agent_runs,platform.agent_proposals(withagent_proposals_one_openpartial unique index), andplatform.agent_settingswith 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_notemigration, and theProposalInboxUI at/manager/aiand/officer/ai. - Agentic layer milestone M0 skeletons (
platform/agent,platform/telegram): stdlib-only heartbeat skeleton containers (dxos-agent,dxos-telegram) added todocker/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 fromHUB_APK_URLandHUB_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 thedxos-agent-envvolume, 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 underdocker/runtime/<project>/agent/are no longer read.enablenow 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 indocs/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_SECRETis 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$queryRawtemplates, 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*.sqlignore 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
agentrole 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-agentanddxos-telegramrun read-only, without capabilities, with process and CPU limits;08-agent.sqlis 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 ignoredisApproved/rejectionReasonfields to/api/journal/batch-approveand approved the entry; they now invoke the dedicated review endpoint, recordreview_note, and keep rejected entries out ofAPPROVED.
Upgrade notes#
- Set
DXOS_INTERNAL_GATEWAY_SECRETandDXOS_TELEGRAM_CALLBACK_KEYindocker/.env.localto 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, thenmake web-up: the first creates the agent and Telegram tables (08-agent.sql,09-telegram.sql), applies the database migrations and startsdxos-agentanddxos-telegram; the second rebuilds the web app at1.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 roleagentwhen it is missing (on a smaller stack,make up-agentstarts the agent). A cooperative enabled frommainbefore this release runsenableonce more: the credentials moved to thedxos-agent-envvolume. - Telegram (optional): set
TELEGRAM_BOT_TOKENandTELEGRAM_BOT_USERNAMEfrom BotFather, run./dxos telegram enable, then link a phone from the profile page. - External LLM providers (optional): set
ANTHROPIC_API_KEY(andDXOS_ANTHROPIC_MODELto change the defaultclaude-haiku-5-5) orOPENAI_API_KEYwithDXOS_OPENAI_MODEL, restartdxos-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, seedocs/dev-setup.md); every workflow now namesworkflows/system-error-alert.jsonas 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.tscan fail on a frame that is still navigating (issue #44); a failedPlatform Smoke Testjob 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.shassembles 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 webPOST /api/chatbotstream 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 mockHubRepositoryand a demoAuthServiceor, with an issuer configured, on Keycloak OIDC PKCE (clientdxos-mobile) and the web API throughHttpHubRepository; 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. Seeapps/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 schemaapp_staff_work(every table hashtx_code), and signs in with a local owner account or the shared Keycloak account (realmagrimarket, rolemanager). Both followDESIGN.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 asnextjs-weband the redirect URIs of the Android tour app and of the Flutter hub-mobile app (docker/keycloak/realm-agrimarket.json).make mobile-clientadds it to a running realm and does nothing if it exists. Covered byplatform/tests/test_realm_policy.py. -
View
telemetry.sensor_daily(platform/postgres/init/07-telemetry-views.sql): read-only daily summary oftelemetry.sensor_readingsper (htx_code,parcel_code,sensor, Vietnam day) withreading_count,min_value,max_value,avg_value,first_ts,last_ts. Tracked in Hasura astelemetry_sensor_dailywith the samehtx_codefilter as the raw table formanagerandofficer;farmerhas no access. Covered byplatform/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 ofmake 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-smokegives 131 PASS (was 124): five checks for the daily view and two for theofficerrole. 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-dashboard0.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 withpython tests/preview.pyin the app's folder.
Upgrade notes#
make platform-up, thenmake web-up: the first creates the viewtelemetry.sensor_dailyand restarts Hasura so it loads the new metadata; the second rebuilds the web app at1.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 frommainbefore 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-desktopandapps/staff-mobileare 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-dashboardshows 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-mobilereads from a real server and what it still shows from sample data is listed inapps/hub-mobile/README.md. - The browser checks of
app-kit.spec.tscan fail on a frame that is still navigating (issue #44); a failedPlatform Smoke Testjob 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 (entriesand an optionalcreatelink). 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-storegainscreated. The icon map moved tolib/apps/app-icons.tsx. Seedocs/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-extrasstops (never removes) every optional container.make upandmake platform-upare unchanged. See the README. - Designer table (
dxos-app.css): aform-tablemodifier 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_HEAPdefaults to-Xms64m -Xmx512m(override withKEYCLOAK_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-coreormake platform-upafter pulling); recreating it also restarts web. - Run
make platform-upandmake web-up(new menu feed, store section and designer CSS), then./dxos install miniapps/custom-booksor install "Sổ tự tạo" from the App Store (a worker must be running). No migration of existing apps; keep everydocker_*volume. ./dxos validatenow accepts thefeedkey; 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 indxos-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,ILIKEescaping, Vietnamese money, number and date formats, CSV with BOM and formula escaping, chart widths) and a showcase page.make appkit-synccopies the two files into the four apps;make lintfails when a copy differs. - Mini-apps can offer downloads: the app frame sandbox gains
allow-downloadsand the proxy keeps acontent-dispositionheader when it starts withattachment. 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 newname,version,menuandmanifest. Enablements are never touched; a failed build or health check leaves the registry on the old version. The App Store card and detail showCó bản mớiwhen 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) andtea-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 nowmanager-orders.png).
Upgrade notes#
- Run
make platform-upandmake web-up(rebuilds the web image: newdxos-app.css,allow-downloadson 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 newleaf-purchaseroute/overviewreaches an installed app only after its upgrade. Restart./dxos workerif one runs. - No database migration; keep every
docker_*volume.
Known limits#
- Search in the apps is accent-sensitive (
Nguyendoes not findNguyễn): the app roles cannot create theunaccentextension. - 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-supplyprints inside asectionrather than on thebody, 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-upandmake gateway-up:web-uprebuilds or startswebanddisease-apion the generated route file (it replaces the hand-typeddocker compose upforweb, in the README,docs/miniapps.mdand CI);gateway-upputs the gateway back on that file after a hand-typed compose command recreated it on the base one.
Fixed#
./dxos installand./dxos workerrefuse to run while the gateway reads the base route file: after a hand-typeddocker compose upwithoutDXOS_GATEWAY_FILErecreated apisix, every mini-app route answered 404 and an install still ended "Đã cài". They now stop with a message namingmake 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
storeblock 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 validatealso checks the screenshot files (inside the app directory, size, type);catalog-syncstores 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.phasetoprepare,buildandregisterthrough the new./dxos worker-progress, so the page can show the step; a failed install keeps the phase that failed. A hand./dxos installnever 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) andhellocarry astoreblock in Vietnamese; the screenshots come from the real apps with sample data and are retaken withapps/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
buildphase of a failed install, that a hand install writes no request, and thatvalidaterefuses 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-upapplies the new columns and tables without recreatingpostgres(06-app-store.sqlis extended in place and stays idempotent). Keep everydocker_*volume.- Rebuild the web image (
make web-upfrom v1.10.1; before that the full command of the v1.8.0 note, withDXOS_GATEWAY_FILE) and restart./dxos worker, otherwise the page works but no install phase is reported. - Apps that carry a
storeblock declarerequires.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
descriptionin the mini-app manifest (1-200 characters), shown by the upcoming app store;helloandtea-tournow declare one.docs/miniapps.mddocuments 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 now1.9.0 - App Store: install mini-apps per cooperative (the manifest
descriptionabove 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 schemaplatform(platform/postgres/init/06-app-store.sql, applied byplatform-init):app_catalog(synced fromminiapps/*/app.yamlbymake platform-upand 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) andapp_worker(heartbeat); requests and enablements are audited../dxos workeris the host process that claims requests one at a time (ENABLEinstalls the app when needed,DISABLEremoves the container once no HTX is left, and keeps the data), takes a lock indocker/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 as9.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 createbtree_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). Schemaapp_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). Schemaapp_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). Schemaapp_farm_supply - Tests for the store and the three apps:
make apps-smokenow 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/*ofleaf-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 enablestea-shopfor 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) andbusiness-apps.spec.ts(the leaf-purchase and farm-supply stories);screens.spec.tsadds 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 totea-tour's and, inplatform-smoke, a./dxos workerfor the store stories
Upgrade notes#
- First
make platform-uprecreatespostgresonce: it mounts the newplatform/postgres/init/06-app-store.sql. The data indocker_pgdatais kept, andplatform-initcreates the store tables on the existing database. Never delete thedocker_*volumes - Apps installed before the upgrade stay enabled for every HTX: the
platform-initrun that createsplatform.app_enablementsenables 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 installand./dxos removework without it - The web image must be rebuilt (
make web-upfrom v1.10.1; before that the full command of the v1.8.0 note, withDXOS_GATEWAY_FILE): the proxy, the menu and the store page readplatform.app_enablements; the package version is now1.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-netand decodes the token without verifying it, so another installed app can read or change the data ofleaf-purchase,tea-shopandfarm-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_validonly 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-upno 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 recreatedagrimarket-postgres(and its dependents) under a running Keycloak. Keycloak then answered 500 on its next admin call, which failedmake apps-smokeon main and in the release gate (FAIL: keycloak admin PUT .../default-client-scopes/...,Error 22). The Makefile,./dxosand the CIplatform-smokejob now setBUILDX_NO_DEFAULT_ATTESTATIONS=1, so the same inputs give the same image ID. First-start behaviour is unchangedmake apps-smokewaits for Keycloak aftermake 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 helperkc_readyinplatform/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 byapp.yaml(apiVersion: dxos/v1), published as the JSON Schemaplatform/apps/manifest.schema.jsonwithadditionalProperties: falseeverywhere../dxos validate <dir>...refuses a manifest with a schema error, anidalready installed, a licence outside the CLI's OSI list, arequires.corethe core (versioninapps/web/package.json) does not satisfy, animagenot pinned by@sha256:digest, a route or menu path with..,//or characters outside[a-z0-9/_-], a role other thanfarmer,officerandmanager, 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 isdocs/miniapps.md; the decision is recorded indocs/adr/0002-miniapp-architecture.md ./dxos install,removeandlist:./dxosat the repo root runs thedxos-clicontainer (profiletools, no host port, no docker socket) for the manifest, database, gateway, install journal and registry work, and starts or stops the app container itself withdocker 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 withup -d --build --wait, then records the app inplatform.installed_apps(id, name, version, menu, manifest, install time; created byplatform-initfromplatform/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 journaldocker/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;--purgealso drops it.listprints id, version, install time and container state. Protected routes useopenid-connectbearer_onlywith aclaim_schemacheck onrealm_access.roles; a token without one of the manifest's roles gets 401 from the gateway. The routes are merged with the trackedplatform/gateway/apisix.yamlintodocker/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-upandmake uprungateway-syncfirst, so installed apps keep their routes and containers across a restart. App routes match only on the gateway's internal listener9081(vars: [["server_port", "==", "9081"]]), so the published9080answers 404 under/apps/and every outside request goes through the web proxy;gateway-syncrefuses an app route without that condition- Hardened app containers: the generated compose file runs service
app-<id>as user10001:10001with a read-only root filesystem and a/tmptmpfs,cap_drop: [ALL],no-new-privileges, 256 MB of memory and 0.5 CPU, no host port, and only on the new networkdxos-apps-net. That network isinternal: true(no egress) and holds onlyapisixandpostgresbesides 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 schemaapp_<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 withsearch_pathset to its schema, never on the superuser connection, and are recorded inapp_<id>.schema_migrations. Every app table must havehtx_code text NOT NULL, checked after each file and again from a fresh session. The app readsDXOS_APP_DB_URLfromdocker/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.--purgedrops the schema (refused, dropping nothing, when an object outside it depends on it), thenDROP OWNED BYand 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 inplatform.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; onlycontent-type,acceptandcontent-length(plus the token) are forwarded, so the browser'scookie,authorizationandx-hasura-*headers never reach the app; onlycontent-typeandlocationcome back, so the app'sset-cookieis dropped, and a redirect that leaves the app answers 502. Every response carriesContent-Security-Policywithscript-src 'none'andX-Content-Type-Options: nosniff. The per-IP limiter of/api/registernow lives inapps/web/src/lib/ip-rate-limit.ts, unchanged DXOS_APP_PUBLIC_LIMIT: the public mini-app limit per minute and IP for thewebcontainer, read by Compose interpolation, default10; a value that is not a positive integer keeps 10. The CIStart Webstep 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-
GETrequest under/apps/whoseOriginheader is neither<scheme>://<Host>of the request nor theAUTH_URLorigin (Origin: nullincluded), or that has noOriginbutSec-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">(noallow-scripts) on/apps/<id>/..., passes the page query through, adds?theme=light|darkfrom 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 asglobals.css, checked by a test) for light, dark anddata-theme, plus styles for text, tables, forms, buttons andbutton.secondary,.notice,.error,.pill. Tables span their card, header row included. Below 640 px each row is stacked as a card: a cell withdata-labelshows that column name next to its value, and a cell without one keeps the card's full width. Apps setdata-themeon<html>from?theme=and keep it across their links and forms, ashelloandtea-tourdo- Mini-app
tea-tour(Đặt tour đồi chè):./dxos install miniapps/tea-touradds "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 as250.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 anddata-labelon every cell, so they keep their meaning when stacked on phones. Data lives in schemaapp_tea_tour(tours,bookings, both withhtx_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-smokeinstalls and removeshello,tea-tourand the CLI fixtures on a seeded stack (it purges their data, so it refuses to start, with exit 1, when./dxos listshowstea-tourorhelloinstalled): routes 200 with a token and 401 without on the internal port9081, 404 on the published9080, 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 acrossmake platform-up, 404 after removal,--purge, and finallymake platform-smokeon the app-free stack.tests/e2e/story/tea-tour.spec.tsruns 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, withE2E_TEA_TOUR=removed, checks that the menu item is gone and the public page answers 404;screens.spec.tsadds 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,helloandtea-tourtests, validates every manifest underminiapps/, and in theplatform-smokejob installstea-tour, runs the story and the screens, removes it, runs the removal check, thenmake apps-smoke
Changed#
- Version:
apps/web/package.jsonis1.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./dxossetDXOS_GATEWAY_FILEto the generated../docker/runtime/<project>/gateway/apisix.yaml; without it (release bundle, a baredocker compose up) apisix reads the tracked base file and serves no app route - Compose:
postgresalso mountsplatform/postgres/init/05-apps.sqland, likeapisix, joinsdxos-apps-net; thedxos-cliservice is added under profiletools
Fixed#
make platform-smokere-run on a seeded stack: two checks ofsmoke-dataops.shcounted 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 parcelP-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/helloand a reinstall oftea-tour, tea-tour's requests, with the user's token, reachedhello(CI run 43178558735: creating a tour got hello's 404).platform/gateway/config.yamlnow setsapisix.dns_resolver_valid: 1, so the gateway resolves app names again every second.make apps-smokefirst replays that sequence and checks that 30 requests on new connections all reachtea-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
9081condition, andgateway-syncrefuses it. Run./dxos remove <id>(it deletes that route file), then./dxos install miniapps/<id>again - Start the stack with make:
make platform-up(ormake up) createsdocker/runtime/<project>/gateway/apisix.yamland setsDXOS_GATEWAY_FILE. When startingwebon 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 nextmake platform-up - First
make platform-uprecreatespostgresandapisix: their mounts changed (the new init file, the generated route file) and both joindxos-apps-net. The data indocker_pgdatais kept, andplatform-initcreatesplatform.installed_appson the existing database. Never delete thedocker_*volumes - Runtime state per compose project: generated files live under
docker/runtime/<project>/(git-ignored), where<project>is theCOMPOSE_PROJECT_NAMEenvironment variable, defaultdocker. Set the project with that variable;./dxosand the Makefile do not read-pordocker/.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-cliimage 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-tourimage ahead (install it once, then./dxos remove tea-tour --purge), so./dxos install miniapps/tea-tourtakes about 11–12 seconds. On Docker Desktop, start web for the demo with a higherDXOS_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 devoutside Docker cannot reach mini-apps: app routes match only onapisix:9081, which the host cannot reach; work on mini-apps with thewebcontainer- Public limit and
X-Forwarded-For: the public mini-app limit trusts the firstX-Forwarded-Forelement 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 PUBLICkeepsCONNECTon 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--purgefail (the env file is kept) until an admin runsDROP OWNED BY app_<id>in that database- The
--purgedependency 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 byDROP 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
COMMITinside 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,/qand/htxpages. The proxy/apps/<id>/...answers a real 404, so a removed app is unreachable - A bare
docker compose uphas no app routes: withoutDXOS_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 onAUTH_URLnaming 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 inai-models/tea_class_names.txt, 9.2 MB) with Vietnamese labels intea_class_names_vi.json, each marked for officer review.ai-models/tea/holds the reproducible pipeline (train.py,datasets.jsonwith DOIs, download URLs and SHA-256, pinnedrequirements.txt) that runs inpython: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 inai-models/ATTRIBUTION.md; no image is committed.ai-models/tea/MODEL_CARD.mdreports 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 calledhealthyat 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=teaondisease-apiuses the tea leaf model next to the general one (still the default; any other model name answers 400). Responses gainmodelanduncertain; a tea result belowTEA_CONFIDENCE_THRESHOLD(default0.60, rejected at startup outside (0, 1]) has null names and keepstop3./healthaddsmodelswith each model's state - Tea disease flow in the web app: a parcel whose crop names
chè/teais diagnosed with the tea model, any other with the general one. An uncertain result is stored asKhông xác định, and every result still goes to the officers; the farmer screen saysĐã gửi cán bộ kỹ thuật xeminstead of presenting a final diagnosis. A 503 from the tea model is an outage (503AI_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]/reviewtakesconfirmed_diagnosis, required when approving, and stores it inconfirmed_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 aHARVESTEDparcel toTENDINGand opens the cycleLứ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 keypara/<htxCode>/Areas/Journal/<yyyy>/<uuid>-<safe name>, whichPOST /api/journalaccepts asphoto_minio_key. Onlyimage/jpeg,image/pngandimage/webpare 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 lyfor each parcel of the farmer's household whose latest safe harvest date (from journal entries not rejected) is still ahead;Nis whole days, rounded up - Tea demo data:
npm run seed(new script, runsprisma 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). ParcelTC-A3has, relative to the seed run, a fertiliser entry, a spraying entry still under its 7-day withdrawal, a harvested previous round whose lotTC-CHE-A3-001is already exported with a public trace page, and one pending tea disease report. Re-running it changes onlyTCandLBrows (plus the shared market, bulletin and partner rows); the history of the seeded parcels is rebuilt with fresh dates.platform/tests/seed-test.shchecks this on a throwaway database - Tea demo accounts in the realm:
manager_tc,officer_tc,farmer_tc,manager_lb,officer_lb,farmer_lb(passwordTest1234!; 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_syncalso fetches HS0902and stores it asTea;vietnam_market_syncadds a simulated dried tea bud price (Tea,VND/kg). Every price that workflow simulates is now written under the sourceMô 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 pricesgiá 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 ofapps/web/src/styles/globals.css, which now has a dark value for every colour token, applied underprefers-color-scheme: darkunless the viewer picked light, or underdata-theme="dark". A theme button (Sáng → Tối → Theo hệ thống, stored inlocalStoragekeyopentea-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'sdark: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 thatDESIGN.mdmatchesglobals.css. A colour guard fails on hard-coded colours in*.module.cssand*.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.tsruns "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 thedisease-apiaccess 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 ofTC-A2; the public pages/q/<code>of that lot and ofTC-CHE-A3-001show their withdrawal status.tests/e2e/visual/screens.spec.tssaves 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 undertest-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. Theplatform-smokeCI job now seeds the demo data, startsdisease-apiwithweb, runs both specs after the core tenant spec and uploads the screenshots as thepriority-screensartifact.make platform-smokealso createssmoke_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.txthas an exact version, andtensorflow-cpu(unpinned, no arm64 wheel) is replaced bytensorflow==2.21.0withkeras==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-OSeverywhere (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), fromapps/web/src/lib/brand.ts. The Keycloak theme directory and realm keep the nameagrimarket - 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-sansuses 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ùais nowLịch thu hái; a new zone's season defaults toLứa 1/<year>; the default commodity of the bulletin, market widget and market API isChè/Tea(the farmer bulletin page now looks it up by its English name, as the workflows store it, andGET /api/bulletinwithout?commodityreadsTeafor any tea crop of the HTX, such asChè 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
MD2rice 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,officer1andfarmer1are 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_userrefuses any other name, so tests never reset a demo user's password or TOTP. The A3 story and the screenshots also sign in asfarmer_tc, which has no TOTP step; a login does not change the account. Thetwo-htx.sqlfixture shares theTC/LBprofiles 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.cssand*.tsxunderapps/web/srctakes its colours fromglobals.css, so all screens follow the dark theme, and the colour guard's baseline is empty. Text on primary fills uses--color-primary-foregroundand on success or danger fills--color-ink-inverse; the always-dark surfaces (sidebar, bulletin header) use the sidebar tokens. The guard'sexceptionsname 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, whichleaflet.csskeeps white. The lot page's decorative QR preview follows the theme. About 80 variables thatglobals.cssnever 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;@themenames count as undeclared because Tailwind emits them only when a utility needs them. A test fails on anyvar(--…)thatglobals.cssdoes 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,TENDINGorHARVEST_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_tcandfarmer_lbneed. On an existing stack either (a) delete the realm (Realm settings > Action > Delete) and rundocker compose -f docker/docker-compose.yml restart keycloakso--import-realmimports it again, which also drops users created at runtime; or (b) deletemanager1,officer1andfarmer1, then Realm settings > Action > Partial import ofdocker/keycloak/realm-agrimarket.jsonwith only Users and Overwrite, which replaces themanager_tc,manager_lbandfarmer_tcthe 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 deletedocker_pgdata: the realm lives in itskeycloakdatabase next to all app data - Demo data: run
npm run seedonly on a demo database: it rebuilds the history of theTCandLBparcels 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-apicontainer (docker compose -f docker/docker-compose.yml up -d --build --wait web disease-api);make platform-updoes not start it - Never
down -von the main stack: earlier upgrade notes (1.3.0) suggested recreating the Postgres volume or runningdocker compose down -vonce for n8n. Both deletedocker_pgdata, which holds the Keycloak realm and all app data. UseREINDEX DATABASEfor the collation change and let n8n create its tables in then8nschema (README, "Nâng cấp môi trường dev cũ") - Storage: no change to
docker/.env.localis needed.MINIO_ENDPOINTmay beminioorminio:9000
Fixed#
- web image on arm64:
npm installin the Dockerfile could leave out@next/swc-linux-*-muslwithout an error (npm skips an optional download that fails), and BuildKit then reused that broken layer, sonext buildfailed 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_ENDPOINTas a host name whiledocker/.env.local.examplesetsminio:9000, so every request ofwebthat touched storage failed withInvalid endPoint: journal photo upload, diagnosis, the farmer's diagnosis history, the officer's disease screens, documents and QR export. Both adapters now accepthostorhost:port. The browser's presignedPUTto 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/streamevent 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 rawQR_EXPORTED(orREADY) pill and now showsĐã xuất QR,Sẵn sàngorBản nháp; the officer disease queue and review showedPENDINGand now showChờ duyệt; the farmer's diagnosis history mapped a status the reports never take (RESOLVED) and showedCONFIRMED/REJECTEDraw, and now showsChờ duyệt,Đã xác nhậnorBị 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-001is gradedLoại 1instead ofGrade 1 - disease-api health check allows 60 seconds for both TensorFlow models to load before failed checks count, so
up --waitdoes 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/loginor the NO_HTX notice.playwright.config.tssets an e2e-onlyAUTH_SECRETfor the dev server and the specs, and one helper (tests/e2e/helpers/forged-session.ts, HTXTC) 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
--cardwith 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-inversetext - 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 storesQR_EXPORTEDand the generated QR image. Snapshots already stored withREADYare 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/journalaccepted anyphoto_minio_keyinsidepara/<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 fromGET /api/journal. It now accepts only a file key underpara/<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.988as1.0%), and the low-confidence warning always showed. They now show98.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/sessionexposes neither token - Tenant isolation:
requireTenant()resolves the caller's HTX from thehtx_codeclaim, answering 403NO_HTXwhen it is missing or unknown;TenantGuardanswers 404 before any write by ID on a record of another HTX. Notifications sent to a whole HTX now carryhtx_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_UNAVAILABLEand a Vietnamese error page, never a fallback to Prisma - Internal gateway port
9081for thewebcontainer: not limited per IP, JWT and permissions as on9080 - Browser test
tests/e2e/tenant/core-tenant.spec.ts(E2E_CORE=1), run in theplatform-smokeCI job against a realwebcontainer 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:
ssoSessionIdleTimeoutandssoSessionMaxLifespanare 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: removedDISEASE_API_URLandOLLAMA_BASE_URL, which no service reads.docker/.env.local.examplealso drops theKEYCLOAK_ISSUERthat Compose overrides and addsAUTH_URL;.env.examplehas noAUTH_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_keysoutside it answer 400. The one exception ispara/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:
webbuilt theredirect_urifromHOSTNAME(0.0.0.0) and Keycloak refused it; Compose now setsAUTH_URL - Account attributes: Keycloak 24 silently dropped
fullName,phoneandhtxId; 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/forecastand 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_ADMINandKEYCLOAK_ADMIN_PASSWORD, and refuses to fall back toadmin/adminin 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/journalanswers 400 for aphoto_minio_keyoutside 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_driftand20261109130000_notifications_htx), thenplatform-init, as in the deploy section. - On a running release, after
up -d --no-buildrundocker 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,phoneandhtxIdas admin-only attributes (Realm settings > User profile). - Assign the
htx_codeattribute to existing accounts in Keycloak, or they receiveNO_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 (seescripts/backfill-htx-profile-id.sql). - Documents written before this release stay under
para/Projects/,para/Areas/,para/Resources/andpara/Archives/. They are no longer listed and are not moved automatically; copy them topara/<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_ADMINas well asKEYCLOAK_ADMIN_PASSWORDindocker/.env.local, or the admin routes answer 500 in production. - Set
AUTH_URLindocker/.env.localwhen the web app is not served fromhttp://localhost:3000, and add that URL to the redirect URIs of thenextjs-webclient. - Known limits:
9081must stay unpublished, because it is not rate limited per IP;workflows/mattermost-push.jsonposts disease and harvest events of all HTXs to one webhook; in production, pre-upgrade cookies go to login;/api/dev-logincookies carry no access token, so core reads fail closed; the write path is protected in the application, not in the database; thePOST /api/registerlimit is per process and trustsX-Forwarded-For, clients behind one proxy or NAT share it and a value that is not a valid IP goes to one sharedunknownbucket, so it must move to the gateway or a shared store whenwebruns 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) anddxos-ingestvalidate every message and store it intelemetry.sensor_readings; rejected messages are kept with a reason intelemetry.ingest_rejects.dxos-simulator(profiledemo) publishes demo readings - Data lifecycle and lineage:
dxos-lifecyclemoves readings older than 30 days to Parquet (ZSTD) in thedxos-lakebucket 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 intelemetry.lifecycle_runsandaudit.events.python -m dxos_dataops queryreads the cold data through thesensor_readings_coldview. Hasura exposes both telemetry tables to managers and officers (scoped byhtx_code) - In-house LLM:
ollamaservesqwen2.5:0.5b(Apache-2.0) behind the gateway atPOST /api/ai/llm/v1/chat/completions(JWT with thedx-os-coreaudience, 30 requests per minute); the Ollama management API is not routed.ollama-initpulls the model and checks its ID - Dataops image: published to GHCR as
opentea-dx-os-dataops(6 images per release withmigrate); 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-upruns it end to end, and the release flow is identical (--profile tools run --rm ollama-initlast) migratemoved intodocker/docker-compose.yml(profiletools), 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-upmigrates first - Prebuilt
migrateimage (#15):apps/web/prisma/Dockerfileships[email protected], the schema and the migrations; the entrypoint URL-encodesPOSTGRES_PASSWORDwhen it buildsDATABASE_URL - LLM smoke check retries on HTTP 429 and reports failures instead of exiting silently
Upgrade notes#
- Add
DXOS_MQTT_DEVICES(comma list ofHTX_CODE:password) andDXOS_MQTT_INGEST_PASSWORDtodocker/.env.local(seedocker/.env.local.example). The release override makes the broker refuse to start while any of these passwords begins withchange_me. - Re-run
migrateandplatform-init(the postgres image gains04-telemetry.sql); create themosquitto,dxos-ingest,dxos-lifecycleandollamacontainers, then run--profile tools run --rm ollama-init. - Release flow: every
docker composecommand now takes--env-file docker/.env.localbefore-f; without it Compose used the defaults published in this repo. SeaweedFS refuses to start whileMINIO_ACCESS_KEYorMINIO_SECRET_KEYis empty or a placeholder, and Keycloak refuses to start whileKEYCLOAK_ADMIN_PASSWORDis empty,adminor begins withchange_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_PASSWORDandN8N_ENCRYPTION_KEYin that file must match the values the volumes were initialised with (until now thedocker-compose.ymldefaults). - On a running release stack, restart
hasuraandapisixafterup -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-updoes 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 coldmake platform-upis slow because of the Ollama image and the 397 MB model pull;dxos-ingestanddxos-lifecycleshare theagrimarketdatabase account (a least-privilege role is Tier 2).
1.4.0 - 2026-11-09#
Added#
- File quarantine: ClamAV (
clamav) and thedxos-scannerservice scan new objects inagrimarket-docsandagrimarket-private; infected or unscannable (> 50 MiB) objects are copied todxos-quarantine/<bucket>/<key>and removed, with verdicts inaudit.file_scans. The scanner image is published to GHCR asopentea-dx-os-scanner - Audit log: hash-chained, append-only
audit.eventsfed by row triggers on 9 business tables; verify withselect * 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
FOUNDand quarantined instead ofOK. Encrypted documents (for example password-protected PDFs) are still allowed - Scanner re-scans replaced objects: a
cleanrow is only trusted while the object'sLastModifiedis 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-initafterprisma migrate deploy(the postgres image did not change); recreate theseaweedfs,clamavanddxos-scannercontainers. - On an upgraded stack, existing objects over 50 MiB in the watched buckets are moved to
dxos-quarantineduring 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.mdwith a private vulnerability reporting policy - Tier 1 API gateway: APISIX on
:9080with 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_codeclaim - 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-smokerun in CI (platform-smoke) - Release
migrateservice:--profile tools run --rm migrateapplies Prisma migrations inside the compose network
Security#
- Gateway: strips the client-supplied
x-hasura-admin-secretheader on the GraphQL route (it previously let any authenticated user act as Hasura admin);/api/workflow/*and/api/ai/disease/*now require thedx-os-coreaudience - Release override: Hasura refuses to start while
HASURA_GRAPHQL_ADMIN_SECRETis empty or achange_me*placeholder
Changed#
- Gateway CORS: allows the
x-hasura-rolerequest header and exposesX-Request-Id - Release ports: SeaweedFS S3
:9000stays 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 aliasminiokept) - Keycloak: TOTP required for staff, tokens carry the
dx-os-coreaudience and the admin-onlyhtx_codeclaim; thenextjs-webpassword 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:8080and SeaweedFS:9000publish 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), rundocker compose down --remove-orphans, and (dev only — never on production data)docker compose down -vonce for n8n. MinIO data is not migrated to SeaweedFS.
1.2.0 - 2026-11-08#
Added#
- Tag-driven release pipeline: Pushing a
vX.Y.Ztag runs the full CI quality gate, publishes versionedwebandapiimages to GHCR and creates a GitHub Release with CHANGELOG notes and a deployment bundle - Release compose override:
docker/docker-compose.release.ymlrunswebanddisease-apifrom prebuilt GHCR images instead of building from source - Container images on GHCR:
webandapiimages are published to GitHub Container Registry - Build-from-source guide and dependency register: Documented building without Docker and added
DEPENDENCIES.mdwith 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.ymlnow publishesedgeandsha-<commit>images only after the CI Quality Gate passes onmain, using lowercase GHCR image names - License headers: Added MIT license headers to remaining source files
Removed#
- BMAD tooling: Removed
.agent/,.agents/,_bmad/,_bmad-output/anddocs/bmad-workflow-guide.md; project rules now live in the rootAGENTS.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.gzentry 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 agrimarketto 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 installfor 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.