Replies: 5 comments 7 replies
|
This is a good question! In an ideal world any drift between code and spec should be "reconciled". Ideally this happens automatically without you having to worry about. In these cases where a drift does occur, my view is it's ok to update the source of truth directly to match the changed implementation. I'm looking at ways to see if this is possible to detect in a simpler automatic way, but up till then this process has to be manual unfortunately. Similar to my comment on this other thread, I think the only 2 options are either
|
|
my 2 cents The manual approach works but relies on the developer remembering to reconcile which is the weak link. what I think is missing is detection. In practice, quick fixes happen in plan mode or even direct edits at 11pm, and nobody remembers to sync the specs after. By the time you open the next session, the specs are stale and the agent is working from outdated context. A few ideas on how this could be solved more systematically:
Would love to see something like a /opsx:reconcile command that handles this flow natively. |
|
I strongly believe in "code itself is a detailed spec, and PRD level specs are for additional context", so bidirectional flows would really help me use OpenSpec. However, I'll understand if you are going to focus on one-way flow. |
|
@aa333, the code-as-spec position is honest about something most spec advocates dodge: implementation IS the most detailed and most current description of behavior. Any spec that says otherwise is just a model of the code, and models drift. Where it breaks down for me is the question "why does the system do this specifically?" Bidirectional flow is the right ask, but I'd push on the framing: the two directions are not symmetric. Code -> spec is mechanical (the LLM can diff the change and reconcile structurally). Spec -> code is intentional (someone has to decide the change is wanted before code follows). Conflating them is what makes "auto-sync" usually mean "auto-overwrite the spec whenever code changes", which is exactly the silent-drift failure mode the thread is asking about. @idanshimon's post-commit detection idea is the bridge I'd bet on: surface the drift as a question (was this a fix, an intentional change, or an unintentional one?), don't auto-reconcile. The agent doesn't know which of @benoitheinrich's (a) vs (b) cases it is. The human does. |
|
Normally, if there is a small change that I know i can resolve quickly, I'll commit that change and quickly
"i've just added a manual change to the repository, can you please update any specs that need updating due to this change" The agent will then look at the commit's and create a new change that can be synced. I think a custom command would be useful like |
Uh oh!
There was an error while loading. Please reload this page.
I understand that the OpenSpec flow is designed to keep openspec/specs/** as the source of truth, with changes proposed under openspec/changes/** and archived back into specs after implementation.
What I’m finding hard to reconcile is this:
If I directly edit code in my repo (instead of generating it from a spec/task), the specs don’t automatically know about those changes.
That seems to introduce “spec drift” — code and spec are no longer aligned. Like with the spec driven development can i edit my code manually as part of a bets practice workflow? or is all code to be written by my AI based on specs?
All reactions