EngineeringArticle

Building Program Response v1

A build-log entry on the architecture for Program Response v1 in Physara: separating what the program tells a user to do from what they actually did, and splitting the next build across three Codex worktrees.
August 31, 20263 min readPhysara

Today I worked on the architecture for Program Response v1 in Physara.

The reason I wanted to build this is pretty simple: Physara can create a training block, but that only tells the user what they’re supposed to do. I needed a way for the app to understand what they actually did.

That sounds straightforward, but once I started going through it there were a lot of situations I had to account for.

If Physara gives someone 4 exercises and 12 total sets, but they only complete 3 exercises and 8 sets, I don’t want the app to just call that workout “complete” or “failed.” It should understand that they completed part of the workout.

Same thing if they substitute an exercise. I want the original program to stay exactly how Physara prescribed it, while separately recording what the user actually did instead.

I also had to separate someone actually skipping a workout from someone just not logging it. Those aren’t necessarily the same thing, and I don’t want missing data automatically being treated like failure.

A big part of today was defining that line:

Training Intelligence: What should the user do?

Program Response: What did the user actually do?

Later, another part of Physara can answer whether the program actually worked.

I think keeping those separate is important because just because someone followed a program doesn’t automatically mean it was effective, and I don’t want the app making conclusions it doesn’t have enough information to make.

Some of the things I worked through today:

  • tracking individual training blocks, workouts, exercises and sets
  • partial workouts
  • skipped vs unreported workouts
  • exercise substitutions
  • extra sets or exercises
  • preventing extra work from making adherence look better than it really was
  • how the workout data should be stored
  • making sure each user can only access their own training data
  • making sure duplicate submissions don’t create duplicate workout records

Before writing the actual feature, I locked the architecture down, committed it, pushed it and tagged the checkpoint.

I also started using the Codex app more seriously today.

Instead of having one agent work through the whole feature from beginning to end, I split the next part of Program Response into three separate areas:

  • Domain / core logic
  • QA / testing
  • UI

Each one is running in its own Git worktree from the same approved architecture.

That means they can all work at the same time without editing the same branch or stepping on each other’s changes.

The Domain side can work on the actual execution and adherence logic, QA can think through the ways it could break, and the UI side can work through how someone will actually use it.

I’m still going to review everything before anything gets merged. The point isn’t to just let AI change the app on its own. It’s more about breaking the work up, giving each agent clear boundaries, and being able to move different parts of the feature forward at the same time.

Today was mostly about getting that foundation right before I start connecting everything together.