Skip to content

Spec 002: today's order within a day is Reviewed, Authored, Created - #213

Merged
adamjohnwright merged 1 commit into
mainfrom
spec002/t019-edit-order
Nov 13, 2026
Merged

adamjohnwright merged 1 commit into
mainfrom
spec002/t019-edit-order

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Spec 002 (specs/002-analysis-report), T007's rule, found by T019's comparison with today's report. This is a single-PR fix.

The bug: on a day with several kinds of edit, pdf-export printed Created above Authored, and today's report prints Authored above Created. This happened in 4 of 25 and 8 of 50 reported pathways on T019's run.

Why: today's report (the deployed analysis-report library) groups a day's edits with Collectors.groupingBy into a HashMap keyed by the action. groupingBy fills it with computeIfAbsent, which puts a new key at the head of its bucket. Created, Authored and Reviewed share a bucket and are added in that order, so they come out reversed. The order within a day is therefore Modified, Revised, Edited, Reviewed, Authored, Created. Research R2 had inferred the order that put gives. I reproduced this with the same collectors on Java 11, and it agrees with today's PDFs.

Changes

  • ACTION_ORDER in src/report/edits.ts.
  • Research R2 and T007's text corrected.
  • A new test of editHistory over all six kinds on one day, seen failing before the fix.
  • The fixture-graph test's expected order corrected with it. That test was not run here: the host's fixture container is older than the fixture. CI loads the fixture and runs it.

🤖 Generated with Claude Code

T019's run found pdf-export's edit history printing Created above Authored
on one day where today's report prints Authored above Created. Today's
groups a day's edits into a hash map with computeIfAbsent, which puts a new
key at the head of its bucket; Created, Authored and Reviewed share one and
are added in that order, so they come out reversed: Modified, Revised,
Edited, Reviewed, Authored, Created. Research R2 had inferred put's order.

A test of editHistory over all six kinds on one day, seen failing before
the fix; the fixture-graph test's expected order corrected with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit 1ecee1e into main Nov 13, 2026
2 checks passed
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.

1 participant