Ongoing "farm_shane_fungi" module notes and development

Here is the somewhat copied document I have going right now for 0.0.1:

Cultivation Flow

1. Intake of Genetics, Equipment and Supplies/Materials (Purchasing Tab)
    a. This is the first step in the process of mushroom farming
    b. Equipment is self-explanatory
    c. Spores, Fungi Tissue, Liquid Cultures (and more) can be used to grow mycelial mass in Petri Dishes (agar-based), additional Liquid Cultures, and Slants (for genetic library)
2. Lab Facilities (Lab Tab)
    a. Selecting, Storing, and Growing of genetics leading to inoculation of Spawn Media
3. Spawn Colonization (Spawn Tab)
    a. Inoculation from mycelial mass originating from agar, or liquid culture
    b. Grains
    c. Sawdust
    d. Wood Chips
4. Fruiting (Fruiting Tab)
    a. Spawn is layered with a Substrate or Substrate Mix/Recipe and allowed to colonize
    b. Mycelial mat is formed
    c. Primordia growth happens
    d. Pins arrive
    e. Fruiting Bodies develop
5. Harvesting (Harvesting Tab)
    a. Mature Fruiting Bodies are removed for processing
    b. Each Substrate can be harvested between 2 and 4 times before substrate is discarded to compost
6. Processing/Packaging (Processing Tab)
    a. Fresh Fruit for restaurants and farmers markets
    b. Dried whole Fruits packaged for resale (great for reconstituting in broth for soups, etc.)
    c. Dried whole Fruits processed into powder form for supplements
7. Sales (Sales Tab)
    a. Restaurants
    b. Farmers Markets
    c. DTC Online Sales

Equipment Types

1. Reusable/Replaceable
    a. Jars, Lids, Stir Plate, Laminar Flow Hood (HEPA and pre-filters), Fans, Humidifiers, Lights, Racks, Scales, Empty Petri Dishes, etc.
2. Single Use
    a. Syringe Needles, Scalpel Blades, Petri Dishes, Slants, Gloves, etc.

** Materials and or Assets?**

1. Fungi Tissue, Spores, Liquid Culture, Swabs
2. Substrate Mixes/Recipes (raw materials and supplements)
3. Culture Media (agar and liquid culture media that has not been inoculated)
4. Spawn Media (grain, wood chips, straw, sawdust, etc.)
5. Cleaning and Sanitizing Chemicals

** Ideas for Module**

1. Load as a single page to manage assets/logs//inventory/etc.
2. Tabbed interface to switch between the stages of cultivation
    a. Dashboard (should show inventory levels as well)
    b. Lab
    c. Spawn
    d. Fruiting
    e. Harvesting
    f. Processing/Packaging
    g. Sales (? not sure how this would work)

I know this is a lot to take in, but this is basically the entirety of the process. Please look this over and let’s figure out the best way to get this modeled without diving into the core of farmOS.

Most of the items being used along the way will need to have some way of tracking current inventory. Whether that is the genetic library, materials that make up the substrate medium (and how much of the mix/recipe is available), lab supplies, packaging supplies, equipment, etc.

I’m looking forward to any and all advice!

Prost! :beers:


Thanks @shane_aldrich ! Very helpful to see it all laid out, and for others to be able to chime in as you design this. :slight_smile:

(Disclaimer: you and I have already discussed a lot of what I’m about to write, so this is perhaps more for the benefit of others. But also to get out some of my thoughts around model/workflow design…)

I always like to split up the design process into two main areas: workflow and data model. The workflow describes how the system will be used on a day-to-day basis, from a high level user perspective, while the data model describes how to represent the records themselves as assets and logs.

So perhaps we can take your outline above and create two more outlines to divide it up. Then it’s just a matter of building the data types/fields to store the data, and then the workflow UI to create/manage it.

Another good question to ask is: how will we be finding these records in the future, days/months/years after the actual workflow/data entry happens. Looking ahead often helps to refine the data model, in my experience.

I always try to boil things down to the fewest number of data types possible while still representing all necessary aspects. So for example, I’d like to see if you can meet your needs with just 2 asset types: fungi and material.

Although the workflows are very different, I think we can find a lot of commonality with the way we’ve modeled Plants in farmOS core. We have a single plant asset, which can be used to represent a set of plants from seed all the way to harvest. But, just like with mushroom cultivation, there are many points along the way where a plant asset might need to “split” into multiple other assets. For example: you might create a plant asset when you seed a bunch of trays in a greenhouse. Then, when it comes time to transplant them outside, you may want to split that across multiple fields. You can either continue to treat them as the same asset, or it might make sense to create new assets so that they can be managed separately. (Now, to be clear, this “splitting” idea would be a workflow-level feature, and we don’t actually have that for plant assets yet, so you would have to do it manually, but that’s how we’ve thought about it.)

Fungi assets could be thought of very similarly. Imagine you have a single fungi asset that represents a batch of agar petri dishes that have all been inoculated with the same strain. Once those are colonized, you might create a new set of fungi assets to represent spawn that was inoculated from the colonized agar. These assets would reference the agar assets in the parent field (because they come from that lineage), but could then be managed separately (and the old assets archived). In this example, we only need one asset type: fungi. This is just to illustrate that it may not be necessary to create different asset types for each step of the process.

The same goes for materials, perhaps. With your help, we’ve created a new material asset type that will be part of farmOS 2.x core. I think this asset type might be able to represent a lot of the other “things” you need to manage. Raw materials like agar, jars, bags, dishes, etc etc could potentially all be tracked as material assets with inventory. So for example a single asset that represents “Sawdust inventory”, if that makes sense. Then, when you use some sawdust to create an inoculated bag for fruiting, you can create a log that basically says “We added this much sawdust to this fungi asset” and decrement your sawdust inventory asset.

Ultimately, the decision around “how many asset types are needed?” boils down to what specific information needs to live on each (what fields on the asset type, in other words). Asset types and log types are differentiated by the fields they have. For example, an Input log has input-specific fields like “input method” and “input source” that do not exist on other log types.

So figuring out what fields are needed is an important step in the data modeling. And there’s a delicate balance there… the more specific fields you need, the more asset types you need. And the more asset types, the more management/maintenance is required in the long run. So I try to encourage keeping things general when possible, and creating new asset/log types only when you’re sure they are necessary. Otherwise, see if things can fit into the existing asset/log types and fields.

Well that was already a lot more than I intended to write, so I’ll stop there for now. I didn’t talk about workflow, so maybe that’s a good next step.

Another important question is: what do you want to track? And how granular do you want to get? Obviously at a high level you want to track fungi assets, inoculation, harvest, etc. But do you also want to track very specific lower-level things like how many jars you have at any given time? The more granular, the more data there is to manage (and enter), so it’s also good to think pragmatically about how you’ll be managing all the data from day to day. It’s fun to model things down to a very low level, but sometimes that ends up being overkill in practice. :slight_smile: