Skip to content

codev task start --base rejects its own repository: a short SHA blocks the task immediately #60

Open

Description

@urban233

codev task start --base and codev task check --head accept an abbreviated
SHA and record it verbatim. The drift check then compares it against the full
HEAD as a plain string:

# src/codev_workflow/task.py:979
if head != expected_head:

So a task started with a short SHA is blocked from its first moment:

$ codev task start --id x --base 99a46f1 ...
$ codev next
{"recommendation": "escalate: the snapshot moved",
 "reason": "code changed outside the tracked builder/reviewer flow",
 "blocked": true}

Nothing had changed. git rev-parse --short HEAD is 99a46f1 and HEAD is
99a46f105adbf05bafbf9f57067a9f3a4851abb5.

Why it matters beyond the inconvenience: the message says "code changed
outside the tracked builder/reviewer flow", which is alarming and wrong, and
recovering costs a pause + resume cycle. A developer copying a base from
git log --oneline — the obvious place to get one — hits this every time.
Hit twice in one session: once on task check --head, once on task start --base.

Fix: normalise both sides through git rev-parse before comparing, at
write time or at compare time. Two lines, plus a test that a short and a full
SHA for the same commit compare equal.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions