Live data from Hacker News

If AI writes code, should the session be part of the commit?

github.com

351–360 of 410 posts

Re: If AI writes code, should the session be part of the commit?

#351
post #14

Why should it be? The agent session is a messy intermediate output, not an artifact that should be part of the final product. If the "why" of a code change is important, have your agent write a commit message or a documentation file that is polished and intended for consumption.

post mortems / bug hunting -- pinpointing what part of the logic was to blame for a certain problem.

Then look at the code, the session will only confuse. To read an LLM's explanation is to anthropomorphize what will just be a probabilistic incident.

Re: If AI writes code, should the session be part of the commit?

#352
I just cannot for the life of me understand the problem that this is solving. The only way that makes any sense is if sessions are atomic along with commits. If a session results in many commits in this becomes a fundamentally incomplete record, such as it was a record at all. Even if we do restrict to one session per commit, we are not in control over the agent’s context—-the session details will contain the user prompting the actions and the reasoning summaries. It will not contain a crucial part, which is how the agent assembles information about the project. So you’re left with a record that looks very complete and is silently incomplete. I don’t understand what the benefit of retaining that is.

Re: If AI writes code, should the session be part of the commit?

#353
post #340

Earlier quoted context omitted.

is this not what entire.io is doing? Was founded by the old Github CEO Thomas Dohmke

Yes, when I first saw this, its exactly what I thought of.

No mention of Agent Trace [0] yet. Interestingly, Entire are not supporting Agent Trace [1]

0. https://agent-trace.dev/

1. https://github.com/entireio/cli/issues/386

Re: If AI writes code, should the session be part of the commit?

#354
Mostly that’s going to be noise. But in some rare occasion I could see it being useful. So my unhelpful notion is that we might need a new thing - leave the commit message as a meaning- dense human-to-human message, and also have a development process flight-recorder log stored alongside. Storage is basically free so why not?

Re: If AI writes code, should the session be part of the commit?

#355

The way I write code with AI is that I start with a project.md file, where I describe what I want done. I then ask it to make a plan.md file from that project.md to describe the changes it will make (or what it will create if Greenfield). I then iterate on that plan.md with the AI until it's what I want. I then ask it to make a detailed todo list from the plan.md and attach it to the end of plan.md. Once I'm fully sa…

Interesting! I actually split up larger goals into two plan files: one detailed plan for design, and one "exec plan" which is effectively a build graph but the nodes are individual agents and what they should do. I throw the two-plan-file thing into a protocol md file along with a code/review loop.

Re: If AI writes code, should the session be part of the commit?

#356
I settled on a similar workflow but across two agents instead of one session.

One agent writes task specs. The other implements them. Handoff files bridge the gap. The spec IS the session artifact because it captures intent, scope, and constraints before any code gets written.

The plan.md approach people are describing here is basically what happens naturally when you force yourself to write intent before execution.

Re: If AI writes code, should the session be part of the commit?

#357

Earlier quoted context omitted.

Depending on the size it might make sense as a kind of commit metadata reference to external, like the signed-off-by field. Chat-Session-Ref: claude://gjhgdvbnjuteshjoiyew Perhaps that could also link out to other kinds of meeting transcripts or something too.

That wouldn't be very portable. A benefit of committing to your history is that it lives with the code no matter where the code or the AI service you use goes.

That's true. I was thinking of it as being more like how LFS works since presumably the LLM contexts could be large and you wouldn't necessarily want all of them on every clone.

Re: If AI writes code, should the session be part of the commit?

#358

Should your browser and search history be part of the commit too?

The thought you have while coding should be part of your workbook. This is a distillation of all the input and processing at the time, which can be a valuable clue for bug hunting and refactoring.

yeah lets commit all your thoughts too, and your personal journal. please also include a picture of your children and wife in the commit
Post reply on HN