Skip to content

Normalize freshness digests across WordPress and standalone providers #1316

Description

@chubes4

Problem

The WordPress workspace refresh and standalone worktree provider hash the same remote-ref listing with different byte normalization. WordPress-side GitRunner returns for-each-ref output without the trailing newline, while StandaloneWorktreeProvider::run_git() preserves raw stdout.

As a result, workspace git pull --allow-primary-refresh writes valid filesystem evidence that standalone planning can never match. A current primary remains blocked with freshness_refresh_required after the exact prescribed refresh.

Reproduction

  1. Refresh a clean primary with wp datamachine-code workspace git pull <repo> --allow-primary-refresh.
  2. Confirm .git/datamachine-code-freshness.json exists.
  3. Invoke standalone planning for a new worktree.
  4. Observe freshness_refresh_required.
  5. Hash identical git for-each-ref --format='%(refname) %(objectname)' refs/remotes/origin output with and without its final newline; the filesystem evidence matches the newline-free digest while standalone planning computes the newline-preserving digest.

Expected

Define one canonical remote-ref serialization/digest contract and use it in both WordPress and standalone paths. Existing version-2 evidence produced by an explicit refresh should immediately authorize standalone planning for unchanged refs.

Acceptance criteria

  • WordPress refresh evidence and standalone matching use byte-identical normalization.
  • Deterministic coverage includes raw Git output with a trailing newline.
  • Changed refs still invalidate evidence fail-closed.
  • A release-style trackerless standalone plan succeeds after the prescribed WordPress refresh.

Related to #1314, but this is the current cross-runtime digest incompatibility rather than the missing standalone refresh command.

AI assistance

OpenAI GPT-5.6 Sol via OpenCode traced the failed release through both freshness implementations, compared the exact digest inputs, and identified trailing-newline normalization as the mismatch. Chris Huber directed and authorized the upstream repair.

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