The architecture behind visible proposals, human confirmation, atomic writes, and guarded undo.
Transparency note: This article was prepared with AI assistance and was reviewed, fact-checked, and edited by the author based on a real development experience.
The plan separates the original commitment, later additions, and actual progress. It contains only fictional data. Screenshot recreated and anonymized with AI-assisted tools. Image by the author.
Building a Personal Application · Part 2 of 3
In Part 1, I explained why I started this application: I wanted to connect goals, planning, and daily reality instead of creating another task list. This article focuses on the architecture, safety decisions, and failure modes that emerged when I turned that idea into a system I use every day.
The first version could create goals, projects, and tasks; prepare a plan; execute it; and close a review. Technically, the journey was complete. Daily use revealed a more important truth: a flow can be finished and still fail to fit real life.
This is not a universal recipe. It is an account of how the product changed when it met real data, changing schedules, ambiguous language, and interruptions.
I could have started with goals, habits, statistics, AI, calendar, and health at the same time. Instead, I built the smallest route that demonstrated the complete idea:
create → plan → execute → review → plan again
The application is a modular Django monolith. The responsive web interface works on desktop and mobile, and normal operations do not depend on AI. That last point matters: if the model or connector is unavailable, I can still plan and close the day.
The vertical slice created a stable core. It also made every later feature easier to question: if it did not improve one part of the loop, it probably was not a priority.
Initially, confirming a daily plan almost froze it. The commitment for the day seemed as if it should remain fixed. In practice, a day changes constantly.
Meetings appear, tasks take longer than expected, and unplanned work gets completed. If software forces the user to pretend nothing changed, the history becomes useless.
The plan became a live document. It preserves the original intention while recording additions, postponements, and unplanned work. The difference between “I intended to do this” and “this is what I actually did” contains more information than either list alone.
I wanted to type or dictate updates without opening several screens. A typical sentence might be: “I finished the proposal and the other task moves to tomorrow.”
The easy implementation would send the sentence to a model and execute whatever it returned. I chose a longer route:
The most recent capture can also be undone when the affected data has not changed since. The pattern — interpret, preview, confirm, audit — became a central product rule. AI can save clicks; it should not turn an ambiguous sentence into invisible mutations.
The complete path deliberately separates interpretation from persistence:
text or voice → candidate matching → structured actions → validation → preview → human confirmation → atomic transaction → audit → guarded undo
Not every input uses the same interpreter. Quick capture can resolve bounded cases with deterministic rules, while an AI assistant can prepare broader operations through private tools. Both paths share the same contract: propose first, validate identifiers and permissions, and write only after a valid confirmation.
A simplified proposal can look like this:
{ "source_text": "I finished the proposal and the other task moves to tomorrow", "actions": [ {"type": "complete_task", "task_id": "confirmed-uuid"}, {"type": "reschedule_task", "task_id": "confirmed-uuid", "date": "tomorrow"} ]}
The text does not authorize anything. Identifiers are resolved inside the authenticated owner’s data; the schema rejects unknown actions; the preview is signed and expires; and confirmation validates it again before applying every action inside one database transaction. A partial failure cannot leave half of the sentence applied.
Undo is not a blind inverse operation. The system stores the minimum data needed to reverse a change and checks that affected records are still compatible. If another operation has changed a task or the plan has entered a state that makes reversal unsafe, undo is rejected instead of deleting newer work.
This architecture does not eliminate model mistakes. It moves them to a visible, inspectable stage before they become permanent.
In code, confirmation resembles this simplified example:
@transaction.atomicdef confirm_preview(user, signed_token, selected_actions=None): payload = load_signed_preview(signed_token, max_age=PREVIEW_TTL)
if payload["owner_id"] != str(user.id): raise InvalidPreview("This preview belongs to another account") actions = validate_selection(payload["actions"], selected_actions) undo_log = [] for action in actions: if action["kind"] == "update_task": task = Task.objects.select_for_update().get( id=action["task_id"], owner=user ) undo_log.append(apply_task_action(task, action)) else: undo_log.append(apply_scoped_action(user, action)) return AuditRecord.objects.create( owner=user, source_text=payload["source_text"], actions=actions, undo_data=undo_log, )
The signature detects modified content and limits the preview lifetime. Owner scoping prevents a valid identifier from another account from being enough. select_for_update() locks tasks being changed, and transaction.atomic ensures that either every selected action is confirmed or none is. The undo record is created inside the same transaction.
A task, a meeting, and a health measurement can appear together on Today, but they do not mean the same thing.
A web application cannot read HealthKit directly. A small iPhone Shortcut sends only the daily total using a revocable key. The same boundary-oriented approach allowed an Apple Notes entry to reach the private journal without storing the original key as plain application data.
Integration should not mean copying everything everywhere. Often the safer design is to preserve one canonical source and display its data in the right context.
The calendar helps compare workload and progress without confusing meetings, tasks, and external data sources. Screenshot recreated and anonymized with AI-assisted tools. Image by the author.
Once the system contained real goals, the initial structure became too limited. I added areas and subareas, finite and continuous goals, tasks linked directly to a goal, habits, metrics, and progress formulas.
Creating tables was not the hard part. The challenge was evolving without breaking existing tasks, plans, and events.
I used additive migrations, explicit ownership, and protected historical relationships. Inferred classifications are prepared for review instead of being automatically applied. Missing data remains different from a measured zero, and formulas use predefined operations rather than arbitrary expressions.
That may seem excessive for a personal tool. It is exactly the right time to learn the discipline: if the project ever has more users, their records cannot become migration test material.
The latest structure separates outcomes, task execution, habits, and projects. The displayed 50% is a fictional case created for this series. Screenshot recreated and anonymized with AI-assisted tools. Image by the author.
AI assistants helped me explore designs, implement changes, write tests, and detect inconsistencies. They also interact with the product through private tools. Speed, however, does not remove responsibility. A convincing proposal can still be wrong.
Tool calls are restricted by owner, validated, and audited. Write operations use identifiers obtained from prior reads instead of accepting an approximate title match. Operations that may be retried use idempotency keys, so one request should not create duplicate records. Edits can include an expected version to prevent a stale agent from silently overwriting a newer change.
Each connector call records its outcome, but the audit log does not copy passwords, secrets, or full personal text. Being able to call a tool is not the same as having permission to decide.
I also learned that “give the model context” cannot mean sending an entire life history. Reads have date limits and pagination. Journal and health data require separate tools. Credentials never appear in assistant responses. Context minimization reduces exposure, cost, and the chance that irrelevant personal information influences a decision.
Human supervision does not make the system infallible. A preview can be too dense, a user can confirm without reading, and text matching can still select the wrong object. I am therefore testing three additional defenses: show the affected object rather than only the action; require more explicit confirmation for sensitive changes; and treat corrections and undo events as signals that the interpretation needs improvement.
Local tests also do not prove multi-user readiness. Authentication, tenant isolation, account recovery, abuse limits, encrypted backups, incident response, and production operations need a different level of validation.
Tests for this flow do more than assert a successful response. They verify that previewing does not mutate the database; one user cannot apply another user’s token; ambiguous language remains marked as needing clarification; only selected actions are confirmed; and completing a task together with logging unplanned work can be undone as one operation.
Those cases expose failures that a test focused only on generated text would miss. In a system that can change personal data, boundary behavior matters as much as interpretation quality.
Five ideas have changed the project the most:
The final article asks the next question: should this remain a private tool, or is there a version that would make sense as a web product, a companion mobile app, or a service?
To improve that decision, I would value one concrete example: which unexpected change breaks your daily plan most often, and how do you record it now?
Previous: “Why I Started Building My Own Personal Operating System.” Continue with Part 3: “From Private AI Prototype to Product: What I Would Validate Before Scaling.”
Written by Neural Curiosity
Exploring how thoughtful software and human-centered AI can turn real problems into practical systems.
How I Built a Human-in-the-Loop AI System was originally published in Dev Genius on Medium, where people are continuing the conversation by highlighting and responding to this story.