Skip to content

update reports "all tools up to date" for generated files whose content is damaged #1807

Description

@dwin-gharibi

openspec update decides whether a tool needs refreshing from the generatedBy
version marker in its skill files. That marker says nothing about the command
files written next to them, so a hand-edited, partially written or truncated
command file is never detected — update reports everything current and repairs
nothing.

A deleted generated file is restored by a plain update; a modified one is
not.

Reproduction

openspec init --tools claude
wc -c .claude/commands/opsx/propose.md      # 12154

printf 'CORRUPTED\n' > .claude/commands/opsx/propose.md

openspec update
# ✓ All 1 tool(s) up to date (v1.12.0)
#   Tools: claude
# Use --force to refresh files anyway.

wc -c .claude/commands/opsx/propose.md      # 10  — still corrupted

openspec update --force
wc -c .claude/commands/opsx/propose.md      # 12154 — repaired

Expected

update refreshes a generated file whose content no longer matches what the CLI
would generate, or at least does not claim the tool is "up to date" when it is
not.

Actual

The damaged file is left in place and the CLI reports success. Recovery requires
knowing about --force.

Impact

Low severity — the message does name --force, and docs/cli.md documents
--force as "Force update even when files are up to date". The inaccuracy is the
claim itself: the file is not up to date. A user who edits a generated command
file also never receives the newer workflow instructions a release ships, while
being told they are current.

Environment

  • OpenSpec 1.12.0 (reproduced on the published npm package and on a build of
    main @ e062b95)
  • Node v22.23.2, Linux

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