Skip to content

Conversation

@hardwarehuman
Copy link
Collaborator

@hardwarehuman hardwarehuman commented Dec 5, 2025

Description of change

This now updates both the citations service and the Monitoring goal creation process to follow all the additional logic we know about:

  • Considering Findings closed/complete/done for the purposes of AR and Monitoring Goal creation if a Monitoring Goal has been closed for the relevant grant since the last time a monitoring review was delivered containing that Finding.
  • Using the MonitoringFindingHistory.determination for the latest review as the findingType, unless null, in which case it defaults back to MonitoringFindings.findingType
  • Considering Findings 'Active' if they have a status of 'Active' or 'Elevated Deficiency' OR if the latest review for the Finding is not yet delivered

This is considerably more comprehensive than the original Jira/PR so needs to be re-reviewed.

How to test

This is not an easy one to test separately. On way to see it working because the AOC ED80AFF2-78CF-40C0-BBC4-9C5258DC22C8 isn't present in the open_citations CTE and so won't trigger a Goal opening.

I would expect it to open goals for:

 grantId |  rname   | grant num
---------+----------+------------
   12656 | 257754FU | 02HP000452
   15492 | 257827FU | 04CH012635
   15902 | 251575FU | 06CH012933
   12632 | 251012FU | 07CH011961
   15790 | 250220FU | 90CI010161

Issue(s)

Checklists

Every PR

  • Meets issue criteria
  • JIRA ticket status updated
  • Code is meaningfully tested
  • Meets accessibility standards (WCAG 2.1 Levels A, AA)
  • API Documentation updated
  • Boundary diagram updated
  • Logical Data Model updated
  • Architectural Decision Records written for major infrastructure decisions
  • UI review complete
  • QA review complete

Before merge to main

  • OHS demo complete
  • Ready to create production PR

Production Deploy

  • PR created as Draft
  • Staging smoke test completed
  • PR transitioned to Open
  • Reviewer added (after transitioning to Open to ensure Slack notifications trigger)
    • Sequence: Draft PR → Smoke test → Open PR → Add reviewer
    • Confirm that Slack notification was sent after reviewer was added

After merge/deploy

  • Update JIRA ticket status

@hardwarehuman hardwarehuman marked this pull request as ready for review December 5, 2025 20:56
Copy link
Collaborator

@kryswisnaskas kryswisnaskas left a comment

Choose a reason for hiding this comment

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

Thanks for the update to the monitoring goal logic and documentation!

A quick check on grants_needing_goal. Shouldn't we also link the open_citations in the logic there?

@hardwarehuman
Copy link
Collaborator Author

Thanks for the update to the monitoring goal logic and documentation!

A quick check on grants_needing_goal. Shouldn't we also link the open_citations in the logic there?

Whoooops! Somewhere along the way there was a significant reversion. I'll fix that and repush

Copy link
Collaborator

@kryswisnaskas kryswisnaskas left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

@hardwarehuman hardwarehuman changed the title [TTAHUB-4152] monitoring goals stay closed for aocs [TTAHUB-4152] (DO NOT MERGE until OHS confirms logic) monitoring goals stay closed for aocs Dec 17, 2025
@hardwarehuman hardwarehuman changed the title [TTAHUB-4152] (DO NOT MERGE until OHS confirms logic) monitoring goals stay closed for aocs [TTAHUB-4152] Consider Findings done after Monitoring Goal closure Jan 30, 2026
@hardwarehuman
Copy link
Collaborator Author

The changes on this are pretty large so they need rereview

),
-- Select all the potentially-relevant reviews
-- for early filtering of monitoring datasets
all_reviews AS (
Copy link
Collaborator

Choose a reason for hiding this comment

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

this isn't used later, is it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ugggh it isn't but it probably should have been in ordered_citation_reviews. I changed the citations ordered_citation_reviews to match what was in createMonitoringGoals but using all_reviews would be faster. Trying to keep these things consistent is a giant PITA and I can't wait to replace most of this with the fact tables. It's probably fast enough this way but it would be faster if I used the more refined version here which is closer to what's in the recipient spotlight.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I certainly defer to your expertise, but if it's just a performance issue, the query ran pretty quick on prod data, so if it's accurate both ways it might be good to just wait for the fact

Copy link
Collaborator

@thewatermethod thewatermethod left a comment

Choose a reason for hiding this comment

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

Ran the script, runs without error. Data modifications look to be correct.

@hardwarehuman hardwarehuman added this pull request to the merge queue Feb 3, 2026
Merged via the queue into main with commit cd6a8d2 Feb 3, 2026
10 checks passed
@hardwarehuman hardwarehuman deleted the ttahub-4152/monitoring_goals_stay_closed_for_aocs branch February 3, 2026 19:23
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.

6 participants