Human Intervention Required
I was working on my Planned Wallet application today with Gemini. I tend to develop a new feature starting with a feature outline prompt, designing the API changes (adhering to Consumer Driven Contracts), then the back-end changes, then the front-end changes. I have local commands such as make clean test itest to run unit and integration tests, with a local docker compose file for manual testing and visual inspection of the UI.
Today’s goal was delivering a feature to implement a personalized budget. In my mind, you budget based on known bills, income, and what you’re target is to allow for spend on a given day, trending over time to show whether you’re on target or off target for your expenses.
Here is the prompt I prepared:
OK, back to the budgeting feature. In my vision, a Budget shows up like a perspective and is available to basic and premium subscribers. The idea is you have a set of bills, income, and accounts tied to the budget. Any outgoing expense from the accounts that is not tied to a bill go against the calculated budget. The expectation is that you must start with your total bills being less than the total income, and then allowed to spend outside of that calculated amount. We track, based on the start day of the budget (not start of history for the accounts).
My ambition is to track:
- Total days under budget (I was properly managing my spending) vs Days failed to maintain budget (I overspent on X day)
- Total savings/overspending based on this budget target
- Trending savings/overspend as a line graph on accounts incorporated into the spend. Should be able to view this window as far back as the budget goes, with 30/60/90/year being optional once the budget is older than this window.
Considerations:
If my budget includes my credit card and my checking account, if I pay to my credit card from my checking account, it should be excluded as an expense from the checking account. I’m open to discussing how we approach this. IE I have a checking account A and a credit card B. I spend money on B, and when the bill is due, I make a payment to B from A. I do not want the double tap presenting in the budget.
I want the budget to be based on a time of “budget created” and tracked over time.
It makes no sense to have a budget when your bills are more than income. If the user attempts to create a budget with more bills than income, the creation should be rejected in both the UI and the API.
The budget must have an income, so budget options in the UI should not show up until an income is created
Bills can change and income can change. When either of these happen, I think we prompt the user “Changing this bill/income will modify Budget X to Y”. If the rules regarding bills exceeding income are triggered by a bill modification, the UI must notify the user that Budget X will be destroyed with this change as bills exceed income.
I think that we then create a history of budget where we store start date, end date, spend limit per day. The “history” is tied to the original budget plan.
Changing accounts to the budget simply adjust the tracked spending habits.
I do not want rules about income more than spend being applied in the database as a CONSTRAINT. I want this purely a back-end and front-end contract agreement so that if we change, there are no headaches in the database.
Engage with me on questions, approaches, and any loose ends about how a budget implementation could look.
Admittedly, reading through it, I realized I was brainstorming more than architecting. This is the very problem I’m writing about now. What was delivered was thousands of lines of interconnected, coupled code locking budgets to accounts, accounts to accounts, accounts to bills, budgets to bills, and spaghetti everywhere. It also managed to use up about 15% of my Gemini usage in 25 minutes. The college mantra “high cohesion, low coupling!” rang out as I was reviewing code.
I discarded absolutely everything, stepped away, and restarted from an architecture perspective. What is the domain implied when considering a domain design for budgets? What is the bounded context driving a budget? How would we want the data modeled so that it isn’t coupling account data? What would API calls trigger to the underlying data that were sensible to an API consumer?
I came up with some ideas, which I’m still scratching out in Sublime, but I’m not done.
The point is that I could easily see a vibe coder just running with the idea of “budgets are against accounts and bills and income and make it so!” and the maintenance nightmare assured by the deliverable would be overwhelming to engineers and AI models alike.
Human engineers are still required.