HerdOS Herd Management

Files
- cattle-management-platform.html: main office/management dashboard
- herdos-field-app.html: phone/tablet field app without finance/business screens
- cattle-management-platform.css/js: main app styling and behavior
- herdos-field-app.css/js: field app styling and behavior
- api/server.js: JSON REST API for HerdOS Main, HerdOS Field, RFID readers, sync, cattle records, and work records, backed by PostgreSQL/Supabase in production
- api/AUTH.md: JWT and Auth0/Clerk/Supabase Auth setup for secure user sessions
- api/SYNC-VALIDATION.md: offline conflict rules and backend validation policy
- api/BACKUP-DR.md: cloud backup, restore drill, crash reporting, performance alert, HTTPS, and custom domain runbook
- api/db/postgres-rls.sql: managed PostgreSQL/Supabase/AWS RDS schema with row-level security for organization isolation
- api/DEPLOYMENT.md, Dockerfile, render.yaml, railway.toml, and fly.toml: PaaS and cloud deployment path for the API
- mobile/react-native-expo: React Native/Expo native HerdOS Field app for one iOS and Android codebase with secure token storage
- cattle-hero.png: local visual asset
- herdos-herd-grazing-hero.png: overview and Field app background image with dairy and beef cattle grazing
- herdos.webmanifest and herdos-service-worker.js: install/offline support when served over http
- herdos-platform-compat.js: quiet OS/browser capability detector for Android, Windows, macOS, iOS, and iPadOS
- herdos-logo-original.png and herdos-logo-icon.png: original HerdOS logo supplied by the founder, prepared for platform headers and installable app icon use
- HERDOS-CROSS-PLATFORM-COMPATIBILITY.txt: compatibility notes for Android, Windows, Apple OS, PWA install behavior, and native app paths
- HERDOS-BRAND-PROTECTION.txt: practical trademark and brand-protection checklist for launch preparation
- HERDOS-SECURITY-HARDENING.txt: production security checklist for tenant isolation, auth, HTTPS, RLS, rate limiting, and code-integrity checks
- HERDOS-SECURITY-CHECKSUMS.json and herdos-security-guard.js: tamper-evidence manifest and runtime file-integrity warning layer
- HERDOS-SECURITY-HEADERS.example: production hosting header template for CSP, HSTS, frame protection, nosniff, referrer policy, and permissions policy
- HERDOS-SECURITY-DECISIONS.txt: selected security controls, deferred controls, and client-experience rules
- HERDOS-MACBOOK-PRO-SECURITY.txt: owner/developer workstation checklist for this MacBook Pro 2023
- HERDOS-PRODUCTION-MATURITY-PLAN.txt: private owner plan that turns early-stage repository, pilot, production, and launch gaps into controlled development gates
- HERDOS-OFFLINE-SCALE-VALIDATION.txt: offline, RFID, sync, weak-network, concurrency, and high-volume validation plan
- HERDOS-RFID-INTEGRATION-PLAN.txt: global RFID adapter strategy for handhelds, wands, panels, scales, country EID formats, and vendor middleware
- HERDOS-RFID-HARDWARE-BRIDGE.txt: browser Bluetooth, Serial/USB, HID, USB permission, keyboard-wedge, duplicate-read, and vendor-adapter status notes
- HERDOS-COMMERCIAL-READINESS.txt: pricing, licensing, demo, pilot, case study, and funder-readiness plan
- tools/herdos-security-check.js: owner-side checksum verifier, manifest writer, and package-hash helper
- tools/herdos-load-sim.js: offline/high-volume sync payload simulator for validating field batches before production pilots
- tools/herdos-rfid-bridge-smoke.js: verifies main and Field RFID hardware bridge wiring, browser API controls, and vendor-adapter documentation

How to run
1. Put all files in the same folder.
2. Serve the folder with any static web server.
3. Open cattle-management-platform.html for the main platform.
4. Open herdos-field-app.html on phones/tablets.

How to run the API
1. Open a terminal in the api folder.
2. Run node server.js.
3. Use http://127.0.0.1:8080/api/v1/sync/field-events as the JSON sync endpoint for HerdOS Field.
4. Use http://127.0.0.1:8080/api/v1 for the API endpoint catalog.
5. All device/server communication uses application/json.
6. For production authentication and organization isolation, run with HERDOS_REQUIRE_AUTH=true and HERDOS_REQUIRE_TENANT=true.
7. Use api/DEPLOYMENT.md to deploy the API to Render, Railway, Fly.io, AWS, or Google Cloud.

Custom domain setup
- HerdOS is ready to be hosted under the domain you are going to register because all app links are relative.
- Upload this folder to a static hosting provider, then point your domain DNS records to that host.
- Use HTTPS/SSL on the domain before using the app seriously on phones, tablets, RFID workflows, or offline mode.
- If using GitHub Pages, rename CNAME.example to CNAME and replace the placeholder with your real domain.
- Use HERDOS-DOMAIN-SETUP.txt for the full domain connection checklist.

Current sync behavior
- Main system publishes task and herd updates to the field app.
- Field app records return to the correct main-system workspaces when the apps are used from the same installation.
- The main platform now creates a farm-linked Field app launcher/download. The launcher stores the selected farm identity locally, opens HerdOS Field with the correct organization ID, and does not embed access tokens or cloud secrets.
- The main Mobile Sync area now includes a compact Field App Hub with launch/download actions, a three-step linking guide, and a connected Field device directory so owners can quickly find the new workflow.
- Each farm can name multiple Field apps under owner access, such as Health chute phone, Maternity tablet, Pasture crew tablet, or Inventory scanner. The device name, department, site, and responsible user travel with every synced work record.
- Each Field app now keeps its own local outbox, sync log, version counter, and last-sync status by device ID. Syncing Field app A does not mark, clear, or upload Field app B's local queue.
- Linked Field apps in the same company can still see shared cow activity after sync. Company records are merged into the Field app record feed as shared records, while each tablet's local pending work remains independent.
- The included API adds a server sync layer for cattle, work records, field batches, RFID readers, RFID scans, master data, and change feeds.
- Dry Cow records from the main platform or HerdOS Field route into the Dry Cow workspace and remain tied to the Dairy transition flow.
- Mobile apps can cache data locally, send JSON sync batches on reconnection, and request JSON changes from the server.
- API records are organization-scoped so each ranch account can only read and update its own animals, work records, sync batches, tasks, and RFID readers.
- Client A, B, and C are isolated by HerdOS organization ID across the login gateway, local offline storage, auth token cache, RFID readers, work queues, Field device directory, API sync batches, and PostgreSQL RLS. Each browser tab keeps its own active farm session so testing multiple clients on one machine does not switch or expose another client's records.
- The main platform now opens first through Farm/Ranch Registration or Login. A client must register the farm/ranch, receive a HerdOS ID, and set an owner PIN before entering the management workspace.
- Farm/Ranch Registration is kept only at the entry gateway and is no longer shown inside the Overview after login.
- Returning clients login with HerdOS ID or organization ID, owner email, and PIN to reopen their independent cattle management platform.
- Farm/Ranch Registration captures farm/ranch name, business type, owner contact, phone, location, primary operation, and herd size.
- Create mode creates a new organization and owner account. Join mode lets invited workers attach to an existing organization without creating a second business workspace.
- HerdOS Field reads the same organization profile on the same domain and sends the organization ID with offline sync batches, so tablet records land in the correct ranch workspace.
- HerdOS Field uses a separate local Field device profile so naming a phone or tablet does not overwrite the main management platform device profile when both are opened in the same browser.
- HerdOS Field no longer exposes a Main button, full-package download button, or main-dashboard install shortcut. Field users can collect and sync records, but they cannot open the main management platform from the Field app interface.
- Offline animal edits use version-based conflict rules. Stale edits return SYNC_CONFLICT for manual review unless the request explicitly chooses last-write-wins.
- Backend validation rejects impossible data before storage, including future event dates, impossible calf birth weights, invalid body condition scores, and negative quantities or amounts.
- Admin backup endpoints can create local snapshots and run restore drills for pilot/testing use, while production should use daily managed cloud snapshots from Supabase, AWS RDS, or MongoDB Atlas.
- Performance alerts log API calls over 2 seconds, with special attention to herd-list loading and database indexing.
- Frontend and backend crash reporting hooks are included, with optional Sentry/LogRocket provider integration through production configuration.
- The public package describes what the system does, while deeper implementation details should stay in private owner documentation.

Presentation-ready interface
- The main overview is reduced to the core operating surfaces: RFID action, live farm activity, mobile sync readiness, Dairy/Beef station selection, and today's work.
- The main overview now includes a compact Operations Pulse for herd, field, RFID, feed, health, and business follow-up readiness without exposing private build details.
- Operations now focuses on direct record entry, bulk farm work, and synced field records instead of static presentation panels.
- HerdOS Field opens around scan, station selection, assigned work, practical work entry, daily critical checks, and sync status so workers and funders can understand the workflow quickly.
- Duplicate bulk-entry surfaces have been reduced so field workers use the Work Console as the main place for one-by-one, RFID, manual, and bulk rows.
- The Field Work Console includes a direct Save entry button for immediate single-record capture, plus Add to batch for repeated work.
- RFID compatibility has been strengthened with unrestricted global reader profiles for manual tags, official EID, ISO 11784/11785 LF animal-ID workflows, FDX-B/HDX 134.2 kHz profiles, country EID programs, AIN, NLIS, CCIA, EU/UK official EID, UHF/EPC payloads where used, Bluetooth, USB HID, serial, Wi-Fi, panel/chute, scale, gate, CSV, JSON, API, vendor middleware, and offline queue handoffs.
- RFID reader setup defaults to "Global / any country" and "Unrestricted global hardware" so the farm country setting helps reporting and formatting without limiting the client's selected tags, readers, or vendor workflows.
- RFID setup has been simplified around a "Global auto-detect" mode. Advanced global standards, country programs, EPC, vendor payloads, and duplicate controls remain available in a collapsible installer panel.
- Performance feel has been tuned with debounced herd/cattle search, global tag alias matching, duplicate-read handling, and cleaner reader context on synced scan records.
- Branding now uses the original HerdOS cattle/RFID/pasture logo supplied by the founder across the main and Field platforms, with a brand-protection checklist included for formal clearance and filing.
- Main and Field operational forms now stage scanned/manual entries into retractable review lists before final saving, with editable fields, duplicate/remove controls, and Save reviewed entries.
- Field health entries now capture product, dose/route, and follow-up date as structured fields before syncing to the main Health workspace.
- The main platform includes a Dry Cow workspace for dry-off planning, far-off dry management, close-up transition monitoring, SOP tasks, milk safety, dry treatments, pen moves, and dry cow performance reporting.
- HerdOS Field includes Dry Cow entry for barn-side dry-off, BCS, teat sealant, hoof trim, close-up, and maternity handoff records.

Mobile offline sync foundation
- Main platform and HerdOS Field now include a Mobile Offline Sync Center.
- Phones and tablets can keep farm work saved during weak signal or no internet.
- Each field device is recognized by the system and can show saved work waiting to update.
- When connection returns, saved work updates the correct main workspaces.
- The Sync Center shows device readiness, saved work, pending updates, and last update in simple operational language.
- For true multi-device iOS/Android cloud synchronization after reconnection, the next production step is to connect HerdOS to a private backend database/API with accounts, permissions, conflict resolution, and encrypted transport.

Individual cow profile
- Main platform and Field app both include an Individual Cow Profile.
- Enter or scan a cow tag to see pen/location, days pregnant, due date, breed, lactation, body condition, health history, vaccination history, and treatment history.
- In the main platform, the Herd Registry Animal Records buttons filter the table by All, Dairy, Beef, and Flagged animals.
- Main platform cow profiles can move cows from one pen/location to another, add vaccination, disease/diagnosis, treatment, health check, pregnancy check, and withdrawal review records.
- Cow profile records include automatic record dates and adjustable follow-up/withdrawal dates.
- Individual cow profiles display vaccination records, disease/diagnosis records, treatment records, all related health information, pen movement history, and dry cow transition history.
- The main cow profile health form includes a retractable guided section under Record type. Choosing Vaccination, Treatment, Disease/Diagnosis, Health Check, Pregnancy Check, Withdrawal Review, or Pen Move shows the related selectable options while keeping manual typing available.
- Pens/locations, cow groups, diseases/conditions, products/vaccines/medicines, treatment/dose/route, dose/quantity, breed/category, feed amounts, inventory quantities, and sales quantities include clickable selectable lists plus manual entry where the farm may use its own names or units.
- Vaccine selections show label-dose guidance cards for mature cows, heifers, and calves where manufacturer/official label guidance is available. Always confirm exact dose, route, timing, age, pregnancy status, and withdrawal rules with the current product label and herd veterinarian.
- Disease/condition selections now correlate with related vaccine/prevention options and possible treatment/support actions. For example, Pneumonia/BRD suggests respiratory vaccine options and BRD pull/treatment actions, while Scours suggests dam scours vaccination and calf support actions. Vaccines are shown as prevention/control tools, not as treatment for active disease.
- The main Health workspace now includes its own Health Department Cow Entry panel with cow lookup, individual profile display, guided disease/vaccine/treatment correlation, follow-up dates, withdrawal dates, and health record saving.
- Main office Manual Entry, Inventory Entry, and Maternity & Calf Care Entry include compact guided panels with selectable work-area, location, priority, category, pen, calf sex, calf-care status, feeding/intake, and note suggestions while keeping manual entry available.
- HerdOS Field work forms include guided panels for Daily Checks, Health, Maternity & Calf Care, Movement, Supplies, and Manual records. These guided selections sync back inside the record note and route into the correct main workspace.

Automatic dates and follow-ups
- Main platform workspaces include adjustable record date and follow-up date panels for operations, herd registry, RFID, dairy, beef, health, breeding, Maternity & Calf Care, feed and pasture, inventory, labor, equipment, sales, reports, and finance.
- Field app work forms automatically add record date and follow-up date fields that can be changed manually before saving.

Breeding department
- Main platform Breeding includes a professional semen and sire record form for cow/heifer tag, group name, insemination/service date, service type, semen supplier, straw/batch ID, sire name or official code, sire breed, semen type, breeding trigger, technician, location, pregnancy check date, expected calving date, and notes.
- Pregnancy duration is calculated from the insemination/service date, and expected calving defaults to 283 days after service while remaining editable for breed, veterinarian, or farm-specific adjustment.
- Saving a main breeding record routes it to the Breeding workspace, adds it to the pregnancy duration summary, and updates the matching cow profile pregnancy start/due date when the tag is found.
- HerdOS Field includes a Breeding tab so workers can record AI, timed AI, natural service, heat checks, pregnancy checks, rebreed decisions, and embryo transfer records from phones/tablets.
- Breeding records follow ICAR-style service recording expectations by capturing served animal ID, service date, sire identity/name, semen/straw reference where available, recording method, and timely reproduction follow-up.

Dairy and Beef stations
- The main platform separates Dairy Station and Beef Station as production workstations, with Dairy shown as the priority station on the dashboard and sidebar.
- Field app uses a dedicated Dairy/Beef station switch above the work tabs so workers interact with one production station at a time.
- Feed and Parlor are not separate Field workstations; Field work tabs focus on Work, Cattle, RFID, Health, Breeding, Maternity & Calf Care, Moves, Supplies, Manual, and Sync.
- Field app navigation is intentionally restricted to field work areas. Main management access should be controlled separately through owner/manager accounts and the main platform URL.
- Beef Station workflow buttons open operational beef workspaces for Feed, Moves, Sales, Health, Inventory, and Reports, each with beef-specific actions and synced record lists.
- On the main platform, selecting Dairy or Beef sets the active station context. Shared workspaces such as Operations, Health, Maternity & Calf Care, Labor, Breeding, Feed and Pasture, Finance, RFID Station, Inventory, Sales, Equipment, and Reports display records and follow-up dates for the selected station context to avoid mixing dairy and beef information.
- When a known animal tag is entered, the registered animal type decides whether the record belongs to Dairy or Beef. The selected station context is used for group, pen, inventory, or equipment records without an animal tag.
- Herd Registry remains the common ground for all animals and keeps All, Dairy, Beef, and Flagged filters.

Bulk cattle addition
- Herd Registry includes a Bulk add cattle drawer above Animal Records.
- HerdOS Field Cattle also includes a Bulk add cattle drawer for phone/tablet workers.
- Managers can paste cattle rows with RFID/tag, name, type, pen/location, status, next action, and breed.
- Tag-only rows are also supported by using the selected default type, pen/location, status, and next action.
- Existing tag numbers are updated rather than duplicated, while new tag numbers are added to the herd registry and shared between the main platform and HerdOS Field master data.
- Herd Registry now works like an operational cattle registry: click a tag number to open the individual animal profile, edit identity/pen/status/breeding dates, select visible cattle, and apply group pen/status/action updates with dated registry records.
- HerdOS Field now includes a dedicated Work console for RFID/manual cattle registration from the barn, chute, pasture, or handheld reader. Workers can scan or type tags, build rows one by one, or paste mixed cattle rows.

Bulk farm work addition
- Main Operations and HerdOS Field Today include Bulk add farm work drawers.
- Bulk work rows can create vaccination, medication/treatment, health check, pen move, pasture move, breeding, pregnancy, maternity and calf care, inventory, equipment, incident, correction, and general records.
- HerdOS Field Work can stage mixed rows in one batch. Rows beginning with Cattle update the herd registry, while Vaccination, Medication / treatment, Dry cow, Maternity & calf care, Movement, Supplies, and incident rows sync to their matching main workspaces. Its pen/location, cow/group, product/action, dose/quantity/status, breed/category, and cattle-registration defaults are select-or-type fields.
- Each row can start with its own record type, or use the selected default type when the type is omitted.
- Pen move and pasture move rows update the animal's current pen/location when the tag is found, while also saving the movement record.
- Bulk work records carry record dates, follow-up dates, station context, product/action, dose/quantity, and notes.

Inventory requests
- Main platform Inventory includes manual critical inventory entry for item, category, quantity required, current stock, priority, needed-by date, and notes.
- Field app Supplies lets workers send inventory request lists with item, category, quantity required, current stock, location, and follow-up dates back to the main Inventory workspace.

Feed and Pasture department
- Main platform Feed & Pasture includes a daily work entry for feed delivery, bunk score, refusals/orts, water access, mineral checks, pasture moves, forage condition, fence/gate repair, ration review, feed shortages, supplier/lot traceability, priorities, and follow-up dates.
- The Feed & Pasture Daily Board summarizes recent main and field records, highlights open issues such as water problems, heavy refusals, overgrazing, wet-weather risk, fence repairs, and feed shortages, and separates delivered feed, pasture moves, and water/mineral checks.
- Field feed-specific notes can still be sent through Manual or Bulk Work when needed, but Feed is no longer a standalone Field workstation.
- Feed records route to the main Feed & Pasture workspace automatically and respect the selected Dairy or Beef station context when the animal, group, or note identifies the stream.

Sales department
- Main platform Sales includes a full transaction entry for milk pickups, finished beef, feeder cattle, cull cows, calf sales, breeding stock, hay/feed sales, buyer/processor, quantity, weight/volume, price, projected total, deposit, delivery date, document status, payment terms, and notes.
- Sales Work Board tracks open sales, projected revenue, committed head/units, document readiness, traceability/withdrawal/transport/invoice status, and buyer follow-up.
- Sales records route to the Sales workspace and create a linked Finance receivable/income record when a projected total is entered.
- Sales can calculate projected gross from quantity, weight/volume, and price when a projected total is not typed, including common per-head, per-lb, per-cwt, per-kg, per-liter, and per-ton pricing.

Finance department
- Main platform Finance includes income, expenses, invoices, payments, payables, receivables, debt payments, budget plans, owner draw/contribution, enterprise category, vendor/buyer/payee, amount, due/paid date, reference number, payment method, and notes.
- Finance Work Board summarizes income recorded, expenses recorded, net cash position, open receivables, transaction status, due dates, and references.
- Sales and Finance now convert mixed-currency records into the selected business currency using refreshed online forex rates, cached offline rates, or manager-saved manual rates when live rates are unavailable.
- Finance is intentionally kept on the main management platform, while the phone/tablet Field app remains focused on operational data collection without finance/business screens.

Security and owner control
- Main platform and HerdOS Field now open in Owner access mode by default so all departments and work functions remain usable.
- The Security panel remains available as an optional local protection tool, but it no longer locks the platform or disables department forms by default.
- The Owner can reset local security from the main platform Security panel. Security events are stored in a local audit log when the panel is used.
- This optional local protection can reduce casual unauthorized use on a device. It is not a replacement for production cybersecurity.
- For real protection against hackers, deploy HerdOS with HTTPS, a backend database, server-side user accounts and permissions, MFA, encrypted backups, device management, secure RFID middleware, audit logging on the server, and regular security updates. This follows the direction of CISA, NIST, FTC, and SBA small-business cybersecurity guidance.
- HerdOS now adds browser CSP, API security headers, API rate limiting, and file-integrity checks so unexpected or planted changes to critical files are easier to detect before customers keep using a compromised copy.
- Production security must keep HERDOS_REQUIRE_AUTH=true, HERDOS_REQUIRE_TENANT=true, HERDOS_ENFORCE_HTTPS=true, exact-domain CORS, private .env secrets, managed auth/MFA, and tested PostgreSQL RLS.
- Security decisions are intentionally kept in back-office files rather than crowding daily farm screens. HerdOS does not hard-lock customer work to one MacBook, block offline field use with anti-debugging, or rely on obfuscation as a security boundary. It protects clients through tenant isolation, auth, RLS, audit trails, trusted deployment, checksums, and signed native releases when mobile/desktop builds are produced.
- After approved code changes, run `node tools/herdos-security-check.js --write`, rebuild the package, then run `node tools/herdos-security-check.js` and `node tools/herdos-security-check.js --package-hash` from the `outputs` folder.

JWT authentication and managed auth providers
- HerdOS API now supports Bearer JWT authentication for authenticated main-system and field-device requests.
- Devices send Authorization: Bearer <jwt> after login, while the API verifies the token before accepting farm data.
- Auth0, Clerk, or Supabase Auth can be used to manage passwords, MFA, password resets, and sessions outside HerdOS.
- The verified token organization_id claim decides which ranch account the request belongs to; organization headers cannot override the token.
- Local pilot JWTs include organization_id, role, roles, and permissions so the API can validate the user and ranch workspace without extra lookup on every request.
- Saved API records include light audit metadata for the authenticated user/provider without storing passwords or secrets.

Managed hosting and organization isolation
- HerdOS now includes a managed database path for PostgreSQL on Supabase or AWS RDS.
- Recommended first managed launch choice: Supabase PostgreSQL with RLS, using api/.env.supabase.example as the safe secret template.
- Heavier cloud option: AWS RDS PostgreSQL, using api/.env.aws-rds.example when HerdOS needs deeper AWS infrastructure control.
- Run `npm run test:postgres-rls` from api/ to apply the PostgreSQL migration and verify that two test farms cannot see each other's data.
- The API accepts a ranch organization header and filters all farm-owned JSON data by organization.
- The PostgreSQL migration in api/db/postgres-rls.sql creates organizations, users, organization_members, organization_invites, animals, work records, treatments, pastures, RFID devices, Field devices, tasks, sync batches, and telemetry with organization_id isolation.
- Row-level security policies ensure Rancher A cannot accidentally view Rancher B's animals, work records, RFID devices, Field devices, tasks, sync batches, or users.
- MongoDB Atlas can also be used, but organization isolation must be enforced with organizationId fields, organization-aware unique indexes, and API rules because MongoDB does not provide PostgreSQL-style RLS.

Serverless, PaaS, and cloud deployment
- HerdOS API now includes Docker and deployment files for rapid hosting on Render, Railway, or Fly.io.
- The same container can be deployed to AWS ECS/Fargate, AWS EC2, or Google Cloud Run for heavier workloads.
- The API exposes /health for platform health checks, honors platform PORT variables, binds correctly inside containers, and handles shutdown signals cleanly.
- Use PILOT-ONBOARDING.md for the first farm setup flow, RFID setup checks, Field app sync checks, and go/no-go pilot gate.

Responsive and cross-platform mobile path
- HerdOS is designed as a web/PWA platform for Android, Windows, macOS, iOS, and iPadOS when served from HTTPS or a trusted local server.
- The main and Field apps now include Apple mobile web app metadata, Windows tile metadata, Android/Chromium install metadata, a richer web manifest, dynamic mobile viewport handling, and a quiet local capability profile.
- HerdOS web and Field now include stronger phone layouts for chute-side use, including larger touch targets, fixed mobile navigation, safer form inputs, and less horizontal friction.
- The Field app keeps worker actions focused on RFID/tag entry, Work batch entry, station switching, health, breeding, maternity and calf care, moves, supplies, manual entry, sync, and offline queues.
- The mobile/react-native-expo app provides a functional React Native path for one app codebase that can deploy to iOS and Android.
- The native app is NativeWind/Tailwind-ready, opens through Farm/HerdOS ID login, stores JWT sessions through Expo SecureStore, scopes offline queues by organization, names each field device, queues records offline, and syncs through the HerdOS API.

Dynamic application experience
- Main platform includes a live command center with clock, station context, synced record counts, active RFID reader status, live activity feed, rotating recommended next actions, and quick workflow launch buttons.
- HerdOS Field includes a live shift pulse, next-step suggestion, sync health indicator, recent field activity feed, and fast workflow buttons for Health, Breeding, Maternity & Calf Care, and Moves.
- Both apps now feel more like active web applications while still remaining downloadable and usable as a local static package.
- Latest polish pass aligns main and field asset versions, adds clearer busy states for sync/cloud tests, keeps final connection status visible after sync, and verifies desktop/mobile layouts without horizontal overflow.
- Main platform entry now opens as a clean Login screen, with password reset tucked under "Forgot password?" and farm registration moved into a Sign up mode so the gateway no longer crowds the first screen.
- Owner email uniqueness is enforced during farm registration: one owner email can register one farm account only, and duplicate attempts are directed to Login or Forgot password for follow-up.

Heavy workload handling
- Main platform and HerdOS Field keep local event queues bounded to protect browser performance during heavy daily use.
- Large synced record lists render in batches, showing the latest records first with a heavy-queue notice instead of trying to draw thousands of cards at once.
- Live dashboards show queue size and local storage capacity so managers know when the system is carrying a large workload.
- The standards JSON export remains available for deeper history and backup. For full production scale, connect records to a private production database.

Offline operation and reconnection
- Main platform and HerdOS Field can be opened and used offline once the app has been prepared on the device.
- Records entered while offline are saved on the device and marked as waiting to update.
- When the device comes back online, pending records update the correct workspace lists and refresh the connection indicator.
- The connection pill in each header shows Online, Offline, pending record count, and queued update status.
- The Sync Center on both apps shows device readiness, saved work, pending updates, and last update.
- This is local/offline-first behavior. True cloud synchronization after internet reconnection requires the future backend database and API step.

Public overview protection
- The main overview now uses a buyer-safe HerdOS Readiness Snapshot instead of exposing the internal operating structure.
- Sensitive build logic, strategic operating details, formulas, configuration notes, and deeper system methods should stay in private owner documentation.
- Public-facing screens focus on what the farm team can do and what needs attention, not how HerdOS was built internally.
- The platform remains market-ready while protecting the owner’s knowledge and future commercial position.

Maternity & Calf Care records
- Main platform and Field app include structured Maternity & Calf Care entries for calved cow information, pen, calving date/time, calf sex, calf breed, RFID/tag number, first colostrum time, calf weight, calf-care status, feeding/intake, follow-up date, and notes.

Department information flow
- Main platform and Field app include a dairy lifecycle handoff flow: Milking -> Dry Cows Pen -> Maternity & Calf Care -> Fresh Pen -> Milking, with Health connected across every step.
- Department handoff panels share critical information such as SCC, dry-off, pregnancy, calving watch, colostrum, calf tag, weight, calf-care intake, fresh cow checks, treatment, vaccination, and withdrawal status.

Daily critical controls
- Main platform Overview includes Daily Critical Controls for biosecurity, sick/isolation pens, water and feed access, heat stress, maternity/calf-care risk, mortality/incidents, and facility/safety risks.
- HerdOS Field includes a Daily Critical Checks form for workers to send severity, action required, location, related tag/group, record date, follow-up date, and notes.
- Synced daily checks are routed to the relevant main workspaces automatically. For example, water checks appear in Feed and Equipment, isolation notes appear in Health, calf risks appear in Maternity & Calf Care and Health, and mortality or incident logs appear in Reports.

ICAR-style livestock data standards
- Main platform includes an ICAR Livestock Data Standard Layer for animal identity, event record core, dairy recording, beef recording, health/welfare, and data exchange readiness.
- Every new shared record is stamped with schema version, holding ID, location ID, recorder ID, recording method, official animal ID, visible animal ID, species, production stream, and data quality flag where available.
- HerdOS Field work forms include a collapsible "ICAR / livestock data fields" section so workers can add holding ID, recorder ID, method, official animal ID, and visible tag cross-reference.
- The main system can export a local JSON livestock data exchange file from the standards panel.
- This is an operational alignment layer for structured records and interoperability. Formal ICAR certification or official national reporting still requires the appropriate ICAR member organization, government rules, and production database integration.

Production maturity and market readiness
- HerdOS is now organized as an advanced prototype/pilot-ready platform with a clear path to production.
- The repository being new or private is acceptable at this stage. The next proof points should be pilot evidence, repeatable tests, clean packaging, domain setup, support process, and production database deployment.
- The included JSON store remains useful only for demos and local validation. Commercial multi-ranch operation should run the API with HERDOS_STORAGE_ADAPTER=postgres, DATABASE_URL, PostgreSQL/Supabase RLS, tenant isolation, backups, restore drills, and observability.
- Use HERDOS-PRODUCTION-MATURITY-PLAN.txt to decide what is demo-ready, pilot-ready, production-ready, and market-ready.
- Use HERDOS-OFFLINE-SCALE-VALIDATION.txt and the VS Code task "HerdOS: Offline Load Simulation" to test high-volume offline field records before pilots.
- Use HERDOS-RFID-INTEGRATION-PLAN.txt to keep RFID global and adapter-based without confusing the user interface.
- Use HERDOS-COMMERCIAL-READINESS.txt to prepare pricing, licensing, buyer documents, pilot case studies, and funder presentation material.
- The priority production build order is: production database/RLS, authenticated cloud API, offline sync stress testing, RFID hardware adapters, native mobile build, then customer-facing commercial materials.

Room for future corrections
- Both apps include manual entry.
- Manual entry includes "Correction request" so users can flag wrong records, missing animals, incorrect tag numbers, or workflow changes.
- Herd Registry and Field Cattle include CSV file upload support for bulk cattle imports from Excel-exported CSV files, so large herds do not need to be typed one animal at a time.
- Empty herd screens now point users to sync master data, scan tags, or bulk import cattle instead of leaving a blank page.
- Keep this file with the project and update it as new corrections are made.
