< 092024-04-10⋎11 >

Topic for #farmOS is: farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Forum: farmOS.discourse.groupSet by mstenta on 2021-06-15 at 12:52
09:31farmBOT@farmOS@fosstodon.org => The #farmOS monthly community call is today at 2pm Eastern. All are welcome! farmos.org/community/monthly-call/ => fosstodon.org/@farmOS/112246152872359746
13:12*jgaehring[m] has joined
13:12jgaehring[m]I have been thinking about the [movement logic](farmos.org/model/logic/location/) recently, and discussed it a bit yesterday w/ paul121 and Octavio Martín Duarte , and I'm curious to understand better the decision to make 1.x Area taxonomy terms into types of Assets in 2.x, rather than their own Area or Location entity. mstenta, would you say the... (full message at
13:12jgaehring[m]<matrix.org/_matrix/media/v3/download/mat>)
13:13jgaehring[m](maybe this would be better as a forum post, now that I look at it)
13:14*symbioquine[m] has joined
13:14symbioquine[m]Maybe you can share the gist of the discussion yesterday too?
13:14*mstenta[m] has joined
13:14mstenta[m]jgaehring: yea those are probably the right issues
13:15jgaehring[m]awesome, thanks!
13:15jgaehring[m]symbioquine[m]: yea, I'll be there, happy to discuss the background behind this interest
13:15mstenta[m]if I had to summarize in one sentence it would be: we found in practice that "locations" are almost always treated the same as "assets" - and we were replicating a lot of code to make them work that way for "areas"
13:16jgaehring[m]ah
13:16mstenta[m]certainly added some complexity to the data model in some ways, but simplified in a lot more ways... so there were tradeoffs for sure
13:17symbioquine[m]Off the top of my head, the decision feels very obvious in retrospect - given the use-cases it opens up: locations of implements on tractors (both movable assets), animals in portable locations like chicken tractors, etc
13:18symbioquine[m]Or in my case, inventory boxes of seed packets
13:18jgaehring[m]symbioquine[m]: that's a good user scenario to consider
13:19symbioquine[m]The inventory box locations are themselves tracked and have all the same needs as assets - logs, groupings, flags, etc
13:20mstenta[m]> certainly added some complexity to the data model in some ways, but simplified in a lot more ways... so there were tradeoffs for sure
13:20mstenta[m]I forget where I heard this quote recently (maybe someone said it on a dev call?), but it's stuck with me: "there are no solutions - only tradeoffs" :-)
13:21symbioquine[m]jgaehring[m]: It might be an uncommon enough scenario that it doesn't make sense to design for it explicitly, but I love how moving to farmOS >2 meant our data/processes just fit way more cleanly into the farmOS data model.
13:22mstenta[m]another good way to think about it: land assets can also be described as "soil" assets...
13:22mstenta[m]you are managing the soil as an asset just as much (or more) than the plants that go into it
13:23jgaehring[m]so my interest in this basically boils down to the question: How can this [location logic](farmos.org/model/logic/location/#logic) be represented in serialized form, so that it could be replicated on another device, shared over the wire, and versioned in the event of future changes to the algorithm?
13:23mstenta[m]also worth noting... the distinction "is_location" and "is_fixed" is important
13:23mstenta[m]with regards to movement, is_location has no effect
13:24mstenta[m]it's really just about whether or not an asset is considered "fixed"
13:24mstenta[m]jgaehring: gotcha - makes sense! that's why i wanted to document the "logic" in the model too... it's necessary to understand how the granular "atomic" data is used to construct "current state"
13:25mstenta[m](where "current" could be in the past/future too!)
13:25mstenta[m]"where was this animal last year this time?"
13:25mstenta[m]is not static
13:25symbioquine[m]mstenta[m]: (...to the backend - the UI clearly uses the `is_location` attribute to determine what locations are available destinations for moving stuff.)
13:25mstenta[m]* location is not
13:26mstenta[m]yes. IIRC is_location is mostly used for UX
13:26jgaehring[m]jgaehring[m]: and to me there are two ways to approach that...
13:26jgaehring[m]1. Serialize the logic, in the form of some kind of RPC or query format or even raw code, or
13:26jgaehring[m]2. Make the concept of "movements" into an independent data structure (call that endity, object, or what have you), akin to quantities, so they can be referenced separately from both the asset it refers to and the log that records when and how the action took place
13:27mstenta[m]ha! movements actually used to be a separate object, similar to quantities, in v1 :-)
13:27mstenta[m](but that fact was largely hidden...)
13:27jgaehring[m]and to jive with what you were saying, mstenta, I don't think either of those are the "right answer", they just come with trade-offs
13:28jgaehring[m]mstenta[m]: ohhh, did I know that? makes sense, in any event
13:28mstenta[m](it was mainly done to make it easier to share fields across log types... but we simplified things in v2
13:28mstenta[m]I think you have to have logic to compute location
13:29mstenta[m]It's sort of unavoidable IMO
13:29jgaehring[m]<mstenta[m]> "also worth noting... the..." <- yes, I agree, this has been central to my thinking about it as well
13:29mstenta[m](gotta jump to a call, back later...)
13:30jgaehring[m]mstenta[m]: curious the meaning of the second "have" in that statement, hahaha, but "to be continued..."
13:31symbioquine[m]I interpret it to mean "include an implementation of"
13:31jgaehring[m]s/endity/entity/
13:32jgaehring[m]symbioquine[m]: as in it can't be serialized?
13:32symbioquine[m]It's clearly possible to express the logic abstractly enough to send it over the wire, but whether it is worth it is trickier to say...
13:33jgaehring[m]where "implementation" is a "program that runs"?
13:33jgaehring[m]symbioquine[m]: I guess, assume for argument's sake it's worth it
13:34symbioquine[m]Since apps like Field Kit or Asset Link will likely have very different internal strategies for handling caching, offline state changes, etc
13:35symbioquine[m]I mean I'm not totally opposed, but it feels like we're signing up for a much harder problem than just keeping that logic implemented in a few places.
13:36jgaehring[m]and in some sense, it's not too tricky if you just send code over the wire, you can parse it as an abstract syntax tree and version it and the like, wouldn't even be a very large payload for that kind of logic, but my main concern is that then you've got code that you must evaluate after it's been transported somehow, which is first and foremost a security issue, but also has the potential for more headaches down the road
13:38jgaehring[m]symbioquine[m]: yea, I don't see any changes, regardless which approach I took, as being integrated into farmOS necessarily, more so that other programs could interact with farmOS more reliably
13:39jgaehring[m]so again, assume for the moment, "it's worth it," at least for those other programs, and for farmOS assuming we want it to be able to interact with them
13:43symbioquine[m]<jgaehring[m]> "and in some sense, it's not..." <- I'm not even worried about how to send the code or the security challenges... I'm worried about what abstraction would be needed so the code could generically say "if the asset is not fixed find the latest movement log and use the geometry from that log or the referenced location"
13:44symbioquine[m]For instance, in Asset Link that would need to be translated into an Orbit.js expression that is aware of the completeness of the caching of the relevant logs.
13:44symbioquine[m]A desktop application might need to translate it into some SQL query against a SQLite cache.
13:45symbioquine[m]> <@jgaehring:matrix.org> and in some sense, it's not too tricky if you just send code over the wire, you can parse it as an abstract syntax tree and version it and the like, wouldn't even be a very large payload for that kind of logic, but my main concern is that then you've got code that you must evaluate after it's been transported somehow, which is first and foremost a security issue, but also has the potential for more headaches
13:45symbioquine[m]down the road
13:45symbioquine[m] * I'm not even worried about how to send the code or the security challenges... I'm worried about what abstraction would be needed so the code could generically say "if the asset is not fixed find the latest movement log and use the geometry from that log or the referenced location"
13:45jgaehring[m]yea, the logic is stateful, the way I see it, and that's the core part of the "headaches down the road" I allude to, b/c it gets tricky to guarantee your db doesn't permit an invalid state that still complies with the logic as specified
13:45symbioquine[m]The abstraction layer that would need to be consistent in both of those applications (such that the can run whatever code farmOS would send) would be bigger than the logic itself.
13:46symbioquine[m]s/the/they/
13:46symbioquine[m] * IMHO, the abstraction layer that would need to be consistent in both of those applications (such that they can run whatever code farmOS would send) would be bigger than the logic itself.
13:47symbioquine[m]At some level this turns into it's own distributable VM with a dedicated instruction set for manipulating the farmOS data model 🤓
13:49symbioquine[m]That might be an interesting problem to solve, but it's pretty far removed from the areas of investment that I think are most urgently needed.
13:50jgaehring[m]if you were sending code, then yea, you would need an interpreter, but in some cases (as in JS) that's just this amount of code:... (full message at <matrix.org/_matrix/media/v3/download/mat>)
13:50jgaehring[m]is that the best way to do it? probably not
13:51jgaehring[m]but there are other alternatives for code generation, sanitizing, evaluation, etc. all of which are pretty standard and would mostly just need to be configured
13:52jgaehring[m]the bigger problem, imo, is the statefulness of the logic, which is in effect the state of your database
13:53symbioquine[m]jgaehring[m]: Yeah, that's what I said above
13:53jgaehring[m]which is why I am currently favoring option #1 above, to make the logic stateless, or not logic at all, so you can just represent a movement as values in a data structure
13:54jgaehring[m]to me, that could be as simple as a sequence of geometries
13:54symbioquine[m]<jgaehring[m]> "and to me there are two ways..." <- > <@jgaehring:matrix.org> and to me there are two ways to approach that...... (full message at <matrix.org/_matrix/media/v3/download/mat>)
13:54jgaehring[m]yes
13:54jgaehring[m]oh, sorry, meant # 2
13:54jgaehring[m]oops!
13:55jgaehring[m] * which is why I am currently favoring option ~~#1 above~~ #2 above, to make the logic stateless, or not logic at all, so you can just represent a movement as values in a data structure
13:55symbioquine[m]I'm not seeing how making "movements" a separate data structure solves the problem
13:55jgaehring[m]> 2. Make the concept of "movements" into an independent data structure (call that entity, object, or what have you), akin to quantities, so they can be referenced separately from both the asset it refers to and the log that records when and how the action took place
13:56jgaehring[m]the major trade-off there is that you're now introducing a breaking change to the data model
13:56symbioquine[m]quantities still have the same problem
13:57symbioquine[m]* quantities (for inventory) still have
13:57symbioquine[m]The sum of the quantities over time still needs to be interpreted client-side to tell what the current inventory is.
13:58symbioquine[m]jgaehring[m]: Maybe we can ignore that problem for now and just talk about why we'd want the resulting data model?
14:01jgaehring[m]I gotta run for now, but sure
14:01symbioquine[m]jgaehring[m]: Maybe continue in that forum topic?
14:03jgaehring[m]I'll have to post something later, out of time for now
14:07*paul121[m] has joined
14:07paul121[m]Just thinking... this would be more interesting/pertinent if the "logic" was "configurable" 🤔
14:07paul121[m]eg: if you could choose from a few variations of movement or inventory logic. it would be really important to communicate that
14:11symbioquine[m]Maybe interpolated tractor locations as a function of time 🧐😅
14:13paul121[m]yeaa same with inventory haha
14:16symbioquine[m]You could model a water resovior and have logs capturing changes in outflow/inflow rate 🤓
15:20mstenta[m]I'll throw another wrench:
15:21mstenta[m]If the Group module is enabled it adds some logic so that assets that are members of a group have the same location as the group 🫣😅
15:24mstenta[m]I think our best bet is to document how the logic works in farmOS core, and leave it to other applications to replicate that if/when necessary. Not every application that uses the data needs location, or inventory, or group membership. But if they do, then they should replicate the same logic.
15:31jgaehring[m]<mstenta[m]> "I think our best bet is to..." <- yea, I like that idea, I am thinking about the ability to serialize and share that logic as being a bonus that the secondary program provides, not that farmOS has to provide, but that way it can maintain interoperability with farmOS while also providing a simplified interface for other programs/services to connect to, so like either a subset or superset of the farmOS data model is what I'm
15:31jgaehring[m]thinking, and an intermediary if other programs want to use it that way
15:35mstenta[m]Yea interesting! Trying to wrap my head around it :-)
15:36mstenta[m]For what it's worth, internally farmOS has a "location service" which encapsulates the logic, and provides a couple of methods that take standard arguments. Maybe it would be useful to review those.
15:36symbioquine[m]The farmOS API also already includes the computed result of the logic...
15:37mstenta[m]For example, getLocation() takes an asset and a timestamp as arguments
15:37symbioquine[m]So the only case where external applications need to do the computation themselves is when they want to see the effect of modifications to the data without first writing them into farmOS.
15:37jgaehring[m]I want to schedule a time to bring concrete use cases to the table and try out different ways of structuring data for them (JSON Schema, SHACL, or this format CUE I brought up on the forum yesterday)
15:37mstenta[m]The timestamp defaults to the current time, but can also be used to ask "where was this asset in the past" or "where will it be in the future"
15:37mstenta[m]Here is the AssetLocationInterface which declares the available methods and their parameters: github.com/farmOS/farmOS/blob/3.x/module
15:38jgaehring[m]mstenta[m]: oh yea! I'd really like to look at those
15:38symbioquine[m]mstenta[m]: Those these aren't exposed for arbitrary requests via the API at the moment.
15:38mstenta[m](other methods include hasLocation(), hasGeometry(), getGeometry(), and getMovementLog())
15:39jgaehring[m]at the end of the day, I take the Little Lisper's approach that code is data and data is code, you can always (usually?) represent one with the other... eg, a POST request is just a function, they data fields are parameters, the response the return value
15:40symbioquine[m]can =/= should
15:41symbioquine[m] * can ≠ should
15:41symbioquine[m]Not trying to be confrontational exactly, just pointing out its a big can of worms with a relatively small payoff
15:43symbioquine[m]Good to formalize/document what the logic is, less clearly good to have farmOS actually vend the logic to clients directly
15:45symbioquine[m]Unless, as Paul pointed out, we have clear requirements for the logic to be extended in ways that are too varied/exotic/conflicting to be baked into farmOS itself
15:45mstenta[m]I do see some value... especially considering how modules can override it (like Group)... that isn't currently documented anywhere. But yea it does seem complicated.
15:45mstenta[m]And ultimately easiest solution is to just document it :-)
15:46symbioquine[m]and I'd still argue that there are a lot of lower-hanging-fruit in terms of farmOS key features/UX
17:44mstenta[m]The farmOS monthly call starts in about 15 minutes. All are welcome! farmos.org/community/monthly-call/
17:46mstenta[m]Agenda - open for ideas! farmos.discourse.group/t/farmos-monthly-
17:49*farmBOT has joined
18:55*dazinism[m] has joined
18:55*Adam[m] has joined
18:55*adinfinitum[m]1 has joined
18:55*agrooe[m] has joined
18:55*aislinnpearson[m] has joined
18:55*AlainaLawrence[m] has joined
18:56*almavizca[m] has joined
18:56*alphonse86[m] has joined
18:56*AllanMacGregor[m] has joined
18:56*amber_s[m] has joined
18:56*and712[m] has joined
18:56*Anonymous[m]1 has joined
18:57*ant109[m] has joined
18:57*antoine[m] has joined
18:57*calbasi[m]1 has joined
18:57*BjrnBrala[m] has joined
18:57*CarlosAlberto[m] has joined
18:57*blm5303[m] has joined
18:58*botlfarm[m] has joined
18:58*GrantBraught[m] has joined
18:58*buddysbestfarm[m] has joined
18:58*BuzzKC[m] has joined
18:58*canadrian[m] has joined
18:58*conservationmaven[m] has joined
18:58*uploaded an image: (137KiB) < matrix.org/_matrix/media/v3/download/mat >
18:59*courtneylking[m] has joined
18:59*ChristophWolfes[m] has joined
18:59symbioquine[m]symbioquine[m]: Participants
18:59*davd[m] has joined
18:59*DavidFrancisco[m] has joined
18:59*donblair[m] has joined
18:59*OmkarEkbote[m] has joined
19:00*dzfarmer[m] has joined
19:00*eddieironsmith[m] has joined
19:00*EvanKelley[m] has joined
19:00*elpronto[m] has joined
19:00*SpencerOnazi[m] has joined
19:00*EricLarese[m] has joined
19:01*SerendibIndustries[m] has joined
19:01*evered[m] has joined
19:01*f2tmg[m] has joined
19:01*FarmerEd[m] has joined
19:01*farmtech[m] has joined
19:01*FeiWang[m] has joined
19:02*NilsNullson[m] has joined
19:02*MattFletcher[m] has joined
19:02*fosten[m] has joined
19:02*frederike[m] has joined
19:02*kosnick[m] has joined
19:02*FreshiesFarmsLLC[m] has joined
19:03*friedrich[m] has joined
19:03*gbathree[m] has joined
19:03*GediminasVaitkus[m] has joined
19:03*GennaFudin[m] has joined
19:03*gfudin[m] has joined
19:03*ggcc18[m] has joined
19:04*GudjonEinarMagnusson[m] has joined
19:04*goldi[m] has joined
19:04*gretel[m] has joined
19:04*guangchunluo[m] has joined
19:04*guillermo-farmos[m] has joined
19:04*gunter[m] has joined
19:05*GerardoLisboa[m] has joined
19:05*harry[m] has joined
19:05*hra38192639[m] has joined
19:05*ian_vai[m] has joined
19:05mstenta[m]Thanks!
19:05*imlostlmao[m] has joined
19:05*ionitatelecom[m] has joined
19:06*Ian[m]1 has joined
19:06*iuresearcherpw[m] has joined
19:06*IyarkaiTechLab[m] has joined
19:06*JasonJoe[m] has joined
19:06*JustinLewis[m] has joined
19:07mstenta[m]I wonder if we should just merge github.com/farmOS/farmOS/pull/825 for 3.2.0? 😄
19:07*Jo[m] has joined
19:07*jolau[m] has joined
19:07*jrballesteros05[m] has joined
19:07*sgoodall[m] has joined
19:07*jsoons[m] has joined
19:07*JustGav[m] has joined
19:08*justgav[m]1 has joined
19:08*JustinCampbell[m] has joined
19:08*justinestrada[m] has joined
19:08*kaizerking[m] has joined
19:08*KarsonWynne[m] has joined
19:08*kawaiipunkshethey[m] has joined
19:09*keylum88[m] has joined
19:09*klrmn[m] has joined
19:09*RamakrishnaReddy[m] has joined
19:09*kunigunde[m] has joined
19:09*lauriewayne[m] has joined
19:10*leku[m] has joined
19:10*leogaggl[m] has joined
19:10*lordeddi[m] has joined
19:10*ludwa6[m] has joined
19:10*marcelo[m] has joined
19:10*MarcosCarballal[m] has joined
19:11*margeo[m] has joined
19:11*matrixtrix[m] has joined
19:11*Maty[m] has joined
19:11*MaximeLeduc[m] has joined
19:11*m035[m] has joined
19:11*Mims[m] has joined
19:12*mindcls[m] has joined
19:12*Mo[m]1 has joined
19:12*monkeyflowerfarm[m] has joined
19:12*morgs_john[m] has joined
19:12*morgsbrew[m] has joined
19:12*Mos[m] has joined
19:13*mseverething[m] has joined
19:13*munjoma[m] has joined
19:13*nickhudson[m] has joined
19:13*Noaht[m] has joined
19:13*nzsnowman[m] has joined
19:14*OctavioMartnDuarte[m] has joined
19:14*olaf[m] has joined
19:14*oliverp44[m] has joined
19:14*oswald[m] has joined
19:14*PaulC[m] has joined
19:15*pcambra[m] has joined
19:15*peko[m] has joined
19:15*perfectinfoseeker[m] has joined
19:15*GuilhermePerotta[m] has joined
19:15*petednz[m] has joined
19:15*phantomse[m] has joined
19:16*AnthonyRitter[m] has joined
19:16*piegeux[m] has joined
19:16*EricMeadows[m] has joined
19:16*postmanpat[m] has joined
19:16*PradiptaSaha[m] has joined
19:16*qoyyuum[m] has joined
19:17*valida-69[m] has joined
19:17*r3c4ll[m] has joined
19:17*RafatKhashan[m] has joined
19:17*ratapenail[m] has joined
19:17*raul[m] has joined
19:17*riotmiked[m] has joined
19:18*RogerioMbuli[m] has joined
19:18*royills[m] has joined
19:18*runfastthinkslow[m] has joined
19:18*samrose[m] has joined
19:18*sandg100[m] has joined
19:18*AnasHaddad[m] has joined
19:19*scrdcow[m] has joined
19:19*shane_aldrich[m] has joined
19:19*shmida[m] has joined
19:19*shplorf[m] has joined
19:19*sj-techjorblad[m] has joined
19:19*skalakm[m] has joined
19:20*skipper_is[m] has joined
19:20*BrandonSmith[m] has joined
19:20*spacespy[m] has joined
19:20*spitz234[m] has joined
19:20*Spixmaster[m] has joined
19:20*steinfarm[m] has joined
19:21*steve456[m]1 has joined
19:21mstenta[m]botlfarm: ^
19:21*JanSonntag[m] has joined
19:21*anderclick[m] has joined
19:21*t4cradle[m] has joined
19:21*HiraHaleem[m] has joined
19:22*tamtran94[m] has joined
19:22*tamtran[m] has joined
19:22*testuser769[m] has joined
19:22*thattechguy99[m] has joined
19:22*thattechguy[m] has joined
19:22*TheSlurpee[m] has joined
19:23*Thimm[m] has joined
19:23*todrobbinshehim[m] has joined
19:23*toino[m] has joined
19:23*tool172[m] has joined
19:23*UgeshB[m] has joined
19:23*Ujeeee[m] has joined
19:24*UzelJames[m] has joined
19:24*MatrixTravelerbot[m] has joined
19:24*wildhavenfarm[m] has joined
19:24*wombat83[m] has joined
19:24*wotnak[m] has joined
19:24*DavidWilson[m] has joined
19:25*yaaitha[m] has joined
19:25*yahtu[m] has joined
19:25*YashGoel[m] has joined
19:25*zackmuma[m] has joined
19:25*ZaneBelkhayat[m] has joined
19:25*zedrickr11[m] has joined
19:36mstenta[m]And @room ^
19:36mstenta[m]😄

< 092024-04-10⋏11 >