Skip to content

fix(server): stop counting disabled conventions as completed work - #1152

Merged
xarmian merged 1 commit into
PerpetualSoftware:mainfrom
asjdf:fix/1049-terminal-options-standup
Aug 18, 2026
Merged

fix(server): stop counting disabled conventions as completed work#1152
xarmian merged 1 commit into
PerpetualSoftware:mainfrom
asjdf:fix/1049-terminal-options-standup

Conversation

@asjdf

@asjdf asjdf commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #1049. I checked open PRs on 2026-08-18 (dependabot, #1125 / #1066, #1034 web) — none of them touch listTerminalItemsSince or this contract. Upstream main still loops models.DefaultTerminalStatuses and ignores per-collection terminal_options.

Standup, changelog, and project report treated a disabled convention as completed work:

  1. Mechanical: listTerminalItemsSince (and the CLI standup/changelog loops) iterated the global DefaultTerminalStatuses union instead of TerminalValuesForDoneField(). A collection that only declares shipped was still scanned for done; setting Conventions terminal_options: [] changed nothing.
  2. Completed-work semantics: stock Conventions declare terminal_options: ["disabled"]. Even after honoring the schema, disabled is a non-shipping close, not completed work. Report already had this distinction as negativeTerminals (rejected/cancelled/…). I moved that list to models (shared with standup/changelog) and added disabled. No new counts_as_work product flag — that's the issue's part 2, a maintainer call.

What changed:

  • listTerminalItemsSince resolves positive terminals per collection and keeps the existing CollectionIDs OR ItemIDs visibility filter (guest item-grant changelog still works).
  • CLI pad project standup / changelog use the same helper (listCompletedWorkSince) so the KEEP IN SYNC contract holds. MCP already proxies the server handlers.
  • GetReport uses models.IsNegativeTerminal, so a disabled convention no longer increments the day's completed count.

Test plan

  • New tests failed on current main (disabled CONVE in standup/changelog/report; custom terminal_options: ["shipped"] still counted done).
  • After the fix:
    • go test ./internal/models/ ./internal/store/ ./internal/server/ — pass
    • Focused cases: TestProjectStandupEndpoint_DisabledConventionNotCompleted, TestProjectStandupEndpoint_HonorsCollectionTerminalOptions, TestProjectChangelogEndpoint_DisabledConventionNotCompleted, TestGetReport_DisabledConventionNotCompleted, TestGetReport_NegativeTerminalNotCompleted, existing standup/changelog/ACL tests
    • go vet on the changed packages
    • CLI package compile-checked (go build ./cmd/pad with a stub web/build; full make build not run — web embed is out of scope)
  • Original CLI repro (pad workspace create / item update CONVE-2 --status disabled / project standup --format json) not run end-to-end here; the HTTP standup/changelog/report tests encode that contract.

Standup, changelog, and project report treated a disabled convention as
completed work because they used the global DefaultTerminalStatuses union
(or counted every schema terminal as throughput). Honor per-collection
terminal_options and skip negative terminals, including disabled.
@asjdf
asjdf requested a review from xarmian as a code owner August 18, 2026 08:53
@xarmian
xarmian merged commit 22c5a85 into PerpetualSoftware:main Aug 18, 2026
7 checks passed
@xarmian

xarmian commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Thanks @asjdf for this contribution — and a well-built one: honoring per-collection terminal_options on both the CLI and server paths, keeping the KEEP-IN-SYNC contract between the two copies, and pinning each facet of the fix with its own test made this straightforward to review and merge. The review surfaced two narrow pre-existing edges (guest item-grant scoping in the grouped query, and the display layer hardcoding status) — both tracked internally as follow-ups, neither a fault of this PR. Hope to see you around the repo again.

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.

standup/report count disabled conventions as completed work — listTerminalItemsSince ignores schema terminal_options

2 participants