Skip to content

[Feature]: Core flow-back step for drift where the code is ahead of the spec #4940

Closed as not planned

Description

@stn1slv

Problem Statement

Spec Kit documents three spec persistence models in docs/guides/evolving-specs.md. Flow-forward and living spec both end with /speckit.converge. Flow-back has no command for its main step: after implementation, the guide says to update the artifacts that now disagree with the accepted direction and run /speckit.analyze, but nothing performs that update.

/speckit.converge already finds this kind of drift. Its unrequested and contradicts findings often mean the code is right and the spec or plan is out of date, for example an endpoint the plan never declared, or a behavior that changed during implementation for a good reason. Converge treats the artifacts as the only source of intent, so the only remedy it offers is a task to justify or remove the code. When the team wants to keep the code, the agent edits spec.md and plan.md by hand, with no rules about IDs, completed tasks, or where the new content may come from.

Proposed Solution

Keep converge append-only and give its code-ahead findings a second route.

  1. For each unrequested or contradicts finding, converge asks which side is right. "The spec is right" keeps today's behavior and appends a task. "The code is right" adds no task, and the report lists the finding as artifact drift.
  2. A core amend step takes those confirmed findings and edits the feature's own spec.md and plan.md under fixed rules:
    • Content comes only from the confirmed finding and the feature's artifacts. Code is read only to resolve file paths, never to write requirements. Git history is not a source.
    • Existing FR, SC and T IDs are never reused or renumbered. New IDs continue the file's own convention and width.
    • Tasks marked [X] are never edited.
    • Entries marked RETIRED, SUPERSEDED by [ID] or CANCELLED are never amended or revived. The amendment goes to the live entry.
    • An item that conflicts with a constitution MUST rule is withheld and reported, not written.
    • A dated revision note records which entries changed.

Out of scope: deduplicating repeated converge runs (#4269 points toward stopping on unchecked tasks instead), and extension-specific parts such as parsing a feature path from the arguments.

Alternatives Considered

  • A standalone core command that takes a hand-written gap report and amends spec, plan and tasks. The community reconcile extension works this way today. It does the job, but the user has to find drift that converge has already found.
  • A flow-back mode inside converge that edits spec.md and plan.md directly. This breaks converge's append-only contract, so I don't recommend it.
  • Leave this to community extensions and link them from the Flow-Back section of evolving-specs.md. If maintainers prefer this, I'm happy to send that docs PR instead.

Component

Specify CLI (initialization, commands)

AI Agent (if applicable)

All agents

Use Cases

  1. Implementation added POST /api/v1/exports, which plan.md never mentions. Converge reports it as unrequested. The team keeps it, so plan.md gets the endpoint and spec.md gets a new FR, and nobody gets a task to remove code that works.
  2. A validation rule was relaxed during implementation after a product discussion. Converge reports contradicts on FR-007. The team confirms the code, and FR-007 is amended with a revision note instead of getting a revert task.

Acceptance Criteria

  • Converge still writes only to tasks.md, and only by appending
  • Code-ahead findings can be marked as artifact drift instead of producing a task
  • The amend step edits only the current feature's spec.md and plan.md, and only from confirmed findings
  • No ID reuse or renumbering, no edits to [X] tasks, no revival of RETIRED, SUPERSEDED or CANCELLED entries
  • The Flow-Back section of evolving-specs.md names the command
  • Template scaffold tests cover the new rules, with positive and negative cases

Additional Context

Two community extensions already cover this gap:

Related: #4156 and #4158 (/speckit.revise) handle intentional requirement changes. This issue is about drift found after implementation. Both rely on the same RETIRED, SUPERSEDED and CANCELLED markers.

AI Disclosure

Drafted with Claude Code (Claude Opus 5.5), human-supervised. The agent compared the reconcile extension with converge.md, the docs and the related issues, and drafted this text.

Activity

  1. mnriem commented on Oct 13, 2026

    @mnriem
    Collaborator

    Thanks for the detailed proposal, and for already delivering and maintaining the reconcile extension, which is listed in our community catalog. We recognize that you are asking to bring that existing capability into core and reuse findings from converge—not simply asking for reconciliation tooling.

    The distinction we want to preserve is delivery versus persistence.

    The delivery process is the same regardless of the persistence model: specify, plan, tasks, implement, and converge, repeating implement/converge until the implementation satisfies the agreed feature artifacts. Converge assesses completeness against that documented intent, with the constitution as the governing constraint.

    The three persistence models describe what teams do with those artifacts after delivery:

    • Flow-forward: preserve completed feature directories as historical records and create new ones for subsequent changes.
    • Living spec: maintain spec.md as the contract and revise or regenerate its derived artifacts.
    • Flow-back: allow accepted discoveries to inform updates across the artifact set.

    We deliberately describe these alternatives without prescribing one. They are persistence strategies, not alternative delivery processes or a commitment to provide a core command for every maintenance operation. Consequently, the absence of a core flow-back amendment command is not a missing step in the delivery workflow.

    Your proposal preserves converge’s append-only writes, but changes another important part of its contract. Allowing an unrequested or contradicts finding to produce no remediation task because “the code is right” would route a disagreement out of the delivery loop while the documented intent still says otherwise. Accepting an implementation discovery is a legitimate human decision, but that decision must be reflected in the intended contract before convergence can establish agreement. Converge should not substitute approval of the code for that agreement.

    Also, an unrequested finding does not necessarily demand removal of working code: the existing command explicitly permits a task to review/justify or remove the addition. The finding identifies a mismatch; it does not establish that the implementation has no value.

    That said, your reading exposes ambiguity in our documentation. The flow-back descriptions currently mention edits during implementation and continuing implementation after reconciliation. That wording blurs the delivery/persistence boundary we intend to preserve. We should clarify it rather than suggest the distinction is already expressed consistently.

    For these reasons, we would not add the proposed routing to converge or introduce a core amendment command. Your existing reconcile extension is an appropriate home for opt-in persistence automation—not an interim solution awaiting replacement by core. This is consistent with the extension direction previously given on github/spec-kit#4158 and github/spec-kit#3848.

    A focused documentation PR clarifying the shared delivery process and the subsequent persistence choices would be welcome. A neutral link to your already-listed extension from the flow-back guidance would also be reasonable, provided it is clearly optional and does not imply a required workflow step or a security endorsement.

    Closing this core feature request as not planned. The documentation clarification is welcome as a separate, focused contribution; it does not depend on accepting the proposed core behavior.

    AI disclosure: Drafted with GitHub Copilot, powered by GPT-6.1 Sol, in an interactive session for maintainer review. AI assistance covered issue assessment and response drafting.

  2. added
    triage-out-of-scopeVerdict: won't land in core — invalid, duplicate, off-mission, or redirected to an extension
    on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage-out-of-scopeVerdict: won't land in core — invalid, duplicate, off-mission, or redirected to an extension

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions