Skip to content

fix: Consolidate-Tasks preserves dates and chronological order#175

Open
MarkMichaelis wants to merge 1 commit into
mainfrom
fix/174-consolidate-date-prefix
Open

fix: Consolidate-Tasks preserves dates and chronological order#175
MarkMichaelis wants to merge 1 commit into
mainfrom
fix/174-consolidate-date-prefix

Conversation

@MarkMichaelis
Copy link
Copy Markdown
Contributor

Summary

Consolidate-Tasks.ps1 stripped the leading YYYY-MM-DD- prefix from every
imported artifact via Get-FeatureSlug, discarding the only chronological
ordering signal that legacy design notes / PRDs carried. The date was recorded
nowhere -- a real run collapsed seven dated design notes into undated slugs.

Changes

  • Preserve an embedded YYYY-MM-DD- prefix on the destination name so the
    tasks/ listing sorts chronologically.
  • Synthesize a date for undated sources via new -InsertDatePrefix switch
    (default on): most-recent git commit date, falling back to the file's
    last-write time. Pass -InsertDatePrefix:$false to opt out.
  • Add a Source Date column to tasks/MIGRATION.md and sort rows
    chronologically.
  • New helpers Get-DatePrefix, Get-GitDate, Get-SourceDate with unit
    • integration tests (43 passing). Updated comment-based help and
      tasks/README.md.

Scope decision (needs sign-off)

New @prd / @plan artifacts intentionally keep the bare <feature> slug
(no date, no issue number in the filename) so the agents can resolve them by
exact path. Their ordering/identity lives in the branch (feat/<issue#>-...),
issue, and git history -- not the filename. Date-prefixing new files would
require switching the agents to glob lookups, a cross-cutting change to the
upstream naming convention affecting all consumers. Deliberately not done
here. See the open question below.

Open question

Should newly created PRDs/plans also carry a sortable prefix (date or issue
number) in the filename, accepting the agent-lookup change? Flagging for a human
decision rather than guessing.

Test

Invoke-Pester -Path .\Consolidate-Tasks.Tests.ps1

Closes #174

Get-FeatureSlug stripped the leading YYYY-MM-DD- prefix from every
imported artifact, discarding the only ordering signal legacy design
notes and PRDs carried. The date was recorded nowhere.

- Preserve an embedded YYYY-MM-DD- prefix on the destination name.
- Add -InsertDatePrefix (default on): for sources lacking an embedded
  date, synthesize a prefix from the most recent git commit date,
  falling back to the file's last-write time.
- Add a Source Date column to tasks/MIGRATION.md; sort rows
  chronologically.
- New helpers Get-DatePrefix, Get-GitDate, Get-SourceDate; tests for
  each plus integration coverage; update help and tasks/README.md.

New agent-created PRDs/plans intentionally keep the bare <feature>
slug so the @prd/@plan agents can resolve them by exact path.

Closes #174

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Consolidate-Tasks discards date prefix and chronological order

1 participant