Skip to content

fix: include cadence-less projects in project_progress#19

Merged
Koopa0 merged 2 commits into
mainfrom
fix/project-progress-cadence-optional
Jul 2, 2026
Merged

fix: include cadence-less projects in project_progress#19
Koopa0 merged 2 commits into
mainfrom
fix/project-progress-cadence-optional

Conversation

@Koopa0

@Koopa0 Koopa0 commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • project_progress's ProjectMomentum query previously excluded any in_progress/planned project without expected_cadence set, hiding real projects from the owner's momentum view.
  • Owner decision: a cadence-less project should still appear, just never be marked stalled (no threshold to exceed without a cadence) — project.Stalled already handled this correctly for empty/unrecognised cadence, so only the SQL candidate gate and its doc comments needed to change.

Changes

  • internal/project/query.sql — removed AND p.expected_cadence IS NOT NULL from ProjectMomentum
  • internal/db/query.sql.go — regenerated via sqlc generate
  • internal/project/progress.go — updated doc comments (Momentum, deref, ProjectMomentum struct)
  • internal/mcp/ops/catalog.go — updated project_progress tool description
  • internal/mcp/integration_test.goTestIntegration_ProjectProgress_CandidateFilter now asserts a cadence-less project IS included with stalled=false, instead of asserting exclusion

Test Plan

  • go build ./..., go vet ./..., golangci-lint run ./... — 0 issues
  • Unit tests: go test ./... — pass
  • Integration tests (-tags=integration, real PostgreSQL via testcontainers) for internal/mcp and internal/project — pass, including the updated candidate-filter test
  • Independent go-reviewer pass confirmed no other place in the repo assumes expected_cadence is always non-NULL for a projects[] row

project_progress previously required expected_cadence to be set for a
project to appear in projects[], hiding in_progress/planned projects
that simply hadn't had a cadence assigned yet. A cadence-less project
now appears with expected_cadence "" and stalled always false —
project.Stalled already treated an unrecognised/empty cadence as no
threshold to exceed, so only the SQL candidate gate and its doc
comments needed to change.
@augmentcode

augmentcode Bot commented Jul 2, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR fixes project_progress so in-progress/planned projects are no longer hidden just because expected_cadence is NULL.

Changes:

  • Removes the expected_cadence IS NOT NULL gate from the ProjectMomentum SQL query
  • Regenerates sqlc output to reflect the query change
  • Updates Go/docs/tool metadata to clarify cadence-less projects are included
  • Updates the integration candidate-filter test to expect cadence-less inclusion

Technical Notes: Cadence-less projects should still appear but never be marked stalled because project.Stalled treats empty/unrecognized cadence as “no threshold to exceed”.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread internal/mcp/integration_test.go Outdated
noCadence, ok := byProjectSlug["no-cadence"]
if !ok {
t.Errorf("no-cadence project missing from projects[], want included (cadence-less, not excluded)")
} else if noCadence.Stalled {

@augmentcode augmentcode Bot Jul 2, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test doesn’t currently exercise the “cadence-less but has an open next action” case: the no-cadence project is inserted without any todos/milestones so open_next_action will likely be false and stalled will be false regardless of cadence. As written, it may not catch a regression where cadence-less projects become stalled when they do have an open next action.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

… cadence-miss path

The no-cadence candidate-filter test's stalled=false assertion could pass
vacuously two ways: the seeded project had no open next action (Stalled
short-circuits on !openNextAction before ever consulting cadence), and its
own INSERT ran without setting koopa.actor, so the audit trigger's 'human'
fallback gave it a last_human_activity_at of "just now" (Stalled's
now.Sub(lastHuman) > threshold branch is never true for a few-millisecond
gap regardless of the threshold). Neither gap was hit by
cadenceDays[""] resolving correctly.

Give the project an open todo (via a non-human actor, so the todo's own
creation event doesn't add human activity either) and seed the project
itself under a non-human actor so it has no human activity at all —
lastHuman stays nil, which is the one branch where a broken
cadenceDays[""] lookup (ok=true) would flip the result to stalled=true.
Verified by temporarily mutating cadenceDays to accept "" and confirming
the test fails, then reverting.

Flagged by Augment's automated PR review.
@Koopa0

Koopa0 commented Jul 2, 2026

Copy link
Copy Markdown
Owner Author

Addressed: the no-cadence project now has an open todo (so open_next_action=true and Stalled actually reaches the cadence lookup instead of short-circuiting), and is seeded under a non-human actor so it has zero human activity — the one branch where a broken cadenceDays[""] lookup would flip the result to stalled. Verified the fix actually catches the bug by temporarily mutating cadenceDays to accept "" and confirming the test fails, then reverting (see commit 2424416).

@Koopa0 Koopa0 merged commit 8c9c79a into main Jul 2, 2026
5 checks passed
@Koopa0 Koopa0 deleted the fix/project-progress-cadence-optional branch July 2, 2026 08:03
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