Skip to content
Merged

Dev #2685

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
46f6e00
[ARCH-SPIKE] Refactor identity permissions and claims handling
plavoie-BC Apr 30, 2026
3c52090
[AB#32738] Update claim handling for user ID compatibility
plavoie-BC Apr 30, 2026
68192ca
[AB#32738] Simplify permission check logic in handler
plavoie-BC Apr 30, 2026
cad2330
[AB#32738] Seed host-level ITAdmin/ITOps permissions
plavoie-BC Apr 30, 2026
3c404b8
[AB#32738] Add role claim for ITAdmin in login handler
plavoie-BC Apr 30, 2026
bf8761c
[AB#32738] Add unit tests for user ID claim handling
plavoie-BC Apr 30, 2026
f1115c4
[AB#32738] Enhance user ID claim handling for GUID parsing
plavoie-BC Apr 30, 2026
f666ba4
Merge remote-tracking branch 'origin/dev' into bugfix/AB#32738-SPIKE-…
plavoie-BC May 7, 2026
1db4b22
feature/AB#32049-Promethious
JamesPasta May 7, 2026
865d808
feature/AB#32049-Promethious
JamesPasta May 7, 2026
428fa0b
feature/AB#32049-Promethious
JamesPasta May 7, 2026
d40bb76
feature/AB#32049-Promethious
JamesPasta May 7, 2026
da8652c
feature/AB#32049-Promethious
JamesPasta May 7, 2026
a9b63d0
feature/AB#32049-Promethious
JamesPasta May 7, 2026
2ea5772
feature/AB#32049-Promethious
JamesPasta May 7, 2026
c96ea11
feature/AB#32049-Prometheus
JamesPasta May 12, 2026
b646a1f
Merge branch 'dev' into bugfix/AB#32738-SPIKE-abp-cached-permissions
plavoie-BC May 12, 2026
ec4bf5d
feature/AB#32049-Prometheus
JamesPasta May 12, 2026
9fabdf2
Potential fix for pull request finding
JamesPasta May 12, 2026
95c94f0
feature/AB#32049-Prometheus
JamesPasta May 12, 2026
7d71ada
Merge branch 'feature/AB#32049-Promethious' of https://github.com/bcg…
JamesPasta May 12, 2026
8cb15ad
feature/AB#32049-Prometheus
JamesPasta May 12, 2026
9802719
feature/AB#32049-Prometheus
JamesPasta May 12, 2026
4a9c974
feature/AB#32049-Prometheus
JamesPasta May 12, 2026
22bd29e
feature/AB#32049-Prometheus-Tests
JamesPasta May 12, 2026
bf481e7
feature/AB#32049-Prometheus-Tests
JamesPasta May 12, 2026
36b0446
feature/AB#32049-Prometheus-Tests
JamesPasta May 13, 2026
e5e0f81
feature/AB#32049-Prometheus-Tests
JamesPasta May 13, 2026
e128b85
feature/AB#32049-Prometheus-Tests
JamesPasta May 13, 2026
c60eef7
feature/AB#32049-Prometheus-Tests
JamesPasta May 13, 2026
16b296a
feature/AB#32049-Prometheus-Tests
JamesPasta May 13, 2026
f4a2fa1
feature/AB#32049-Prometheus-Tests
JamesPasta May 14, 2026
a0598de
feature/AB#32049-Prometheus-Tests
JamesPasta May 14, 2026
381de39
feature/AB#32049-Prometheus-TestsLogging
JamesPasta May 14, 2026
11bc3c9
feature/AB#32049-Prometheus-TestsLogging
JamesPasta May 14, 2026
d030a40
feature/AB#32049-Prometheus-TestsLogging
JamesPasta May 14, 2026
bb05370
feature/AB#32049-Prometheus-TestsLogging
JamesPasta May 14, 2026
5e6ed09
feature/AB#32049-Prometheus-TestsLogging
JamesPasta May 14, 2026
1f16da0
feature/AB#32049-Prometheus-TestsLogging
JamesPasta May 14, 2026
32b3295
feature/AB#32049-Prometheus-TestsLogging
JamesPasta May 14, 2026
c660c41
feature/AB#32049-Prometheus-TestsLogging
JamesPasta May 14, 2026
7590cae
feature/AB#32049-Prometheus-TestsLogging
JamesPasta May 14, 2026
3db80f5
feature/AB#32049-Prometheus-TestsLogging
JamesPasta May 14, 2026
080fd14
feature/AB#32049-FixBuildExceptionConsistency
JamesPasta May 22, 2026
2711bf5
feature/AB#32049-FixBuildExceptionConsistency
JamesPasta May 22, 2026
07252bd
feature/AB#32049-FixBuildExceptionConsistency
JamesPasta May 22, 2026
f06f8c3
feature/AB#32049-FixBuildUOW
JamesPasta May 22, 2026
184a12d
feature/AB#32049-FixBuildUOW
JamesPasta May 22, 2026
00a98b2
feature/AB#32049-FixBuildExceptionConsistency
JamesPasta May 25, 2026
102b705
feature/AB#32049-FixBuildExceptionConsistency
JamesPasta May 25, 2026
358d976
Merge branch 'dev' into feature/AB#32049-Promethious
JamesPasta Jun 2, 2026
53add40
Merge pull request #2525 from bcgov/test
JamesPasta Jun 3, 2026
7e531cd
Merge pull request #2531 from bcgov/hotfix/AB#FixTestConflicts
JamesPasta Jun 3, 2026
d8b1967
feature/AB#32049-PrometheusCoPilotSuggestions
JamesPasta Jun 3, 2026
e34f0a8
feature/AB#32049-PrometheusCoPilotSuggestions
JamesPasta Jun 4, 2026
6da4f7a
feature/AB#32049-PrometheusCoPilotSuggestions
JamesPasta Jun 4, 2026
eeb9d5a
hotfix/AB#33472-FixPaymentsLinks
JamesPasta Jun 12, 2026
c218d93
Merge pull request #2564 from bcgov/hotfix/AB#33472-FixPaymentsLinks
DarylTodosichuk Jun 12, 2026
4bea26c
hotfix/AB#33472-FixPaymentsLinks
JamesPasta Jun 12, 2026
19043d5
Merge pull request #2565 from bcgov/hotfix/AB#33472-FixPaymentsLinks
aurelio-aot Jun 12, 2026
56f7058
Merge pull request #2591 from bcgov/test
DarylTodosichuk Jun 23, 2026
7e7cf37
AB#33632: Bugfix - Error On Resync of Submission Attachments
aurelio-aot Jun 26, 2026
9f6d02f
AB#32921 update configuration management page script handling
AndreGAot Jun 26, 2026
ef5735e
Merge pull request #2611 from bcgov/hotfix/AB#33632-Attachment-Re-Syn…
JamesPasta Jun 26, 2026
49e9607
Merge pull request #2613 from bcgov/hotfix/AB#32921-account-codings
JamesPasta Jun 26, 2026
fbc3250
Merge remote-tracking branch 'origin/dev' into bugfix/AB#32738-SPIKE-…
AndreGAot Jul 7, 2026
d0353c4
AB#32738 Fix ABP permission/role authorization gaps and reduce auth c…
AndreGAot Jul 8, 2026
0b94044
AB#33569 add onboarding mapping suggestion endpoint
jacobwillsmith Jul 9, 2026
9d1bc88
AB#33569 add generated mapping modal flow
jacobwillsmith Jul 9, 2026
a86e479
AB#32311 break mapping read service cycle
jacobwillsmith Jul 9, 2026
3bc8bcb
AB#33569 refine mapping suggestion button
jacobwillsmith Jul 9, 2026
aff4b5e
AB#33569 align onboarding mapping prompt seed
jacobwillsmith Jul 9, 2026
a207005
AB#33569 refine mapping prompt ui
jacobwillsmith Jul 9, 2026
aff8536
AB#33569 add AI form generation operations
jacobwillsmith Jul 10, 2026
76599d6
AB#33569 fix form generation review issues
jacobwillsmith Jul 10, 2026
4a00f56
AB#33569 fix attachment summary rebase fallout
jacobwillsmith Jul 10, 2026
f2ccd15
AB#33569 normalize AI form generation contracts
jacobwillsmith Jul 10, 2026
8794a6b
AB#33569 add form generation operations and queue wiring
jacobwillsmith Jul 11, 2026
5416871
AB#33569 align form mapping direction and AI runtime state
jacobwillsmith Jul 12, 2026
011d4da
AB#33569 tighten AI generate button states
jacobwillsmith Jul 11, 2026
5e9f371
AB#33569 align form generation prompt payloads
jacobwillsmith Jul 11, 2026
0b8156b
AB#33569 stabilize AI generation runtime
jacobwillsmith Jul 11, 2026
960faa9
AB#33569 align form mapping direction and AI runtime state
jacobwillsmith Jul 12, 2026
4987614
AB#33569 stabilize AI runtime and host wiring
jacobwillsmith Jul 13, 2026
8ac2c8f
AB#33569 update AI tests for refactor
jacobwillsmith Jul 13, 2026
5d1642b
AB#33569 fix AI generation contract regressions
jacobwillsmith Jul 13, 2026
2eb132d
AB#33569 fix AI generate button states
jacobwillsmith Jul 13, 2026
0c2e0cb
[AB#33552] Add application history widget refresh logic
plavoie-BC Jul 13, 2026
fd95f3a
[AB#33552] Render Status Visibility in History
plavoie-BC Jul 13, 2026
f63fe08
[AB#33552] Update Pacific Time handling for historic PST
plavoie-BC Jul 13, 2026
6acf117
[AB#33552] History Widget Code Quality Cleanup
plavoie-BC Jul 13, 2026
3661456
[AB#33552] History Widget Code Quality Fixes
plavoie-BC Jul 13, 2026
99829c4
[AB#33376] Optimize dashboard queries for performance
plavoie-BC Jul 13, 2026
312a358
[AB#33376] Optimize tag filtering in dashboard queries
plavoie-BC Jul 13, 2026
e28dae3
AB#33569 fix AI generation flows
jacobwillsmith Jul 14, 2026
1946b73
AB#33569 split scoresheet generation
jacobwillsmith Jul 14, 2026
680311d
AB#33569 split worksheet generation
jacobwillsmith Jul 14, 2026
1ea52b9
AB#33569 remove worksheet and scoresheet scope
jacobwillsmith Jul 14, 2026
ae64712
AB#33336: Add Quick Date Range Filter for Payment List
aurelio-aot Jul 13, 2026
8ef347d
AB#33630 add AI worksheet generation
jacobwillsmith Jul 14, 2026
d4a0892
AB#33336: Current Fiscal Year Option for Quick Date Range
aurelio-aot Jul 14, 2026
8d14cbd
AB#33336: Hide Disabled Buttons To Nicely Show Date Filters
aurelio-aot Jul 14, 2026
27cfd97
AB#33336: Fix sonarqube issues
aurelio-aot Jul 14, 2026
50e4231
AB#33336: Fix sonarqube issues
aurelio-aot Jul 14, 2026
8827bec
[AB#33086] Add Fiscal Year End calculation for applicant page
plavoie-BC Jun 23, 2026
305a8fa
[AB#33086] Add Fiscal Year End calculation and localization
plavoie-BC Jun 22, 2026
0ac93db
[AB#33086] Fiscal Year End - SonarQube Fixes
plavoie-BC Jun 23, 2026
e39acef
[AB#33086] Fiscal Year End Date - Fix Mapping Bug
plavoie-BC Jun 23, 2026
7e26ed1
Merge remote-tracking branch 'origin/dev' into bugfix/AB#32738-SPIKE-…
AndreGAot Jul 15, 2026
141854c
AB#33789-sonarqube-issues
DavidBrightBcGov Jul 15, 2026
08523ec
Merge pull request #2674 from bcgov/hotfix/AB#33086-FYE-HOTFIX
plavoie-BC Jul 16, 2026
358c117
AB#33508 - Rename Norifications folder to Notifications
hasanpour Jul 16, 2026
deb1b75
AB#33630 fix AI runtime nullability warnings
jacobwillsmith Jul 16, 2026
413acb9
Merge branch 'dev', remote-tracking branch 'origin' into feature/AB#3…
JamesPasta Jul 16, 2026
a0cebb7
AB#32738 - more permission updates and fixes
AndreGAot Jul 16, 2026
ce9dc18
Merge branch 'dev' into bugfix/AB#32738-SPIKE-abp-cached-permissions
AndreGAot Jul 16, 2026
d6fc8ba
Merge branch 'dev' into bugfix/AB#33786-sonarqube-issues
DavidBrightBcGov Jul 16, 2026
84d21dd
AB#33408: Fix Security Findings When Validating Tenant API Key
aurelio-aot Jul 16, 2026
134d282
AB#33413: Security Finding-ApiKeyAuthorizationFilter Accepts Whitespa…
aurelio-aot Jul 20, 2026
a433f23
Merge pull request #2370 from bcgov/bugfix/AB#32738-SPIKE-abp-cached-…
JamesPasta Jul 21, 2026
d5b20f6
AB#33421: Security Finding- Cross-Site Scripting On CasResponse
aurelio-aot Jul 21, 2026
005c2e2
Merge pull request #2675 from bcgov/bugfix/AB#33786-sonarqube-issues
JamesPasta Jul 21, 2026
af685e3
Merge pull request #2681 from bcgov/bugfix/AB#33413-Security-Finding-…
JamesPasta Jul 21, 2026
3d711b4
Merge pull request #2680 from bcgov/bugfix/AB#33408-Security-Finding-…
JamesPasta Jul 21, 2026
3b7bc2d
Merge pull request #2662 from bcgov/feature/AB#33552-status-audit-his…
JamesPasta Jul 21, 2026
76ed70b
Merge pull request #2657 from bcgov/feature/AB#33569-api-endpoint-to-…
JamesPasta Jul 21, 2026
9fdb361
Merge pull request #2666 from bcgov/feature/AB#33336-Payment-List-Dat…
JamesPasta Jul 21, 2026
8c6ee60
Merge pull request #2663 from bcgov/bugfix/AB#33376-dashboard-optimiz…
JamesPasta Jul 21, 2026
398ab75
Merge pull request #2676 from bcgov/feature/AB#33508-Rename-Norificat…
JamesPasta Jul 21, 2026
1e9de82
AB#33421: Fix sonarqube issues
aurelio-aot Jul 21, 2026
e164de6
AB#33421: Fix Sonarqube Issues
aurelio-aot Jul 21, 2026
fb331b4
AB#33872 handle missing ChefsFormVersionGuid
AndreGAot Jul 21, 2026
bafc629
Merge pull request #2686 from bcgov/bugfix/AB#33872-reporting-configu…
AndreGAot Jul 21, 2026
6c607a7
feature/AB#32049-Prometheus-2
JamesPasta Jul 21, 2026
cc61a6f
Merge remote-tracking branch 'origin/dev' into feature/AB#32049-Prome…
JamesPasta Jul 21, 2026
a510cc8
AB#33863 preserve existing mappings during AI generation
jacobwillsmith Jul 21, 2026
63366e2
feature/AB#32049-Prometheus-2-CoPilotFixes
JamesPasta Jul 21, 2026
aa16ca0
Merge pull request #2684 from bcgov/bugfix/AB#33421-Cross-Site-Script…
JamesPasta Jul 21, 2026
6a41b01
Merge pull request #2687 from bcgov/feature/AB#32049-Promethious
JamesPasta Jul 21, 2026
8f17bf8
AB#33630 harden AI worksheet generation
jacobwillsmith Jul 22, 2026
5b2ee89
AB#33630 address worksheet generation review
jacobwillsmith Jul 22, 2026
fd32ccb
AB#33878 change LookupUserNameAsync to protected
AndreGAot Jul 22, 2026
7a58634
AB#32738 adjust permission and dynamic cache log levels
AndreGAot Jul 22, 2026
fdc4d9f
Merge pull request #2688 from bcgov/feature/AB#33863-ai-mapping-prese…
JamesPasta Jul 22, 2026
f68f192
Merge pull request #2689 from bcgov/feature/AB#33630-ai-worksheet-end…
JamesPasta Jul 22, 2026
266b085
Merge pull request #2690 from bcgov/bugfix/AB#32738-reduce-logging
JamesPasta Jul 22, 2026
84e9cc9
Merge pull request #2691 from bcgov/bugfix/AB#33878-swagger-fix
JamesPasta Jul 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions applications/Unity.GrantManager/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,27 @@ services:
networks:
- common-network

prometheus:
image: prom/prometheus:latest
ports:
- "9090:9090"
volumes:
- ./scripts/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./scripts/prometheus/alert-rules.yml:/etc/prometheus/alert-rules.yml:ro
depends_on:
- unity-grantmanager-web
networks:
- common-network

alertmanager:
image: prom/alertmanager:latest
ports:
- "9093:9093"
volumes:
- ./scripts/prometheus/alertmanager.yml:/etc/alertmanager/alertmanager.yml:ro
networks:
- common-network

volumes:
postgres_data:
redis_volume_data:
Expand Down
14 changes: 14 additions & 0 deletions applications/Unity.GrantManager/modules/Unity.AI/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Unity.AI Docs

## Architecture
- [`index.md`](./index.md)
- [`flow-map.md`](./flow-map.md)
- [`prompt-map.md`](./prompt-map.md)
- [`implementation-playbook.md`](./implementation-playbook.md)

## Operations
- [`operations/application-analysis.md`](./operations/application-analysis.md)
- [`operations/attachment-summary.md`](./operations/attachment-summary.md)
- [`operations/application-scoring.md`](./operations/application-scoring.md)
- [`operations/form-mapping.md`](./operations/form-mapping.md)
- [`operations/form-worksheet.md`](./operations/form-worksheet.md)
14 changes: 14 additions & 0 deletions applications/Unity.GrantManager/modules/Unity.AI/docs/flow-map.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Flow Map

## Standard path
UI -> API app service -> queue -> background job -> AI runtime -> persisted result

## Operation families
- Application Analysis: submission -> analysis
- Attachment Summary: attachment ids -> summaries
- Application Scoring: application + scoresheet -> scoring
- Form Mapping: form version -> mapping
- Form Worksheet: form version -> worksheet

## Build Rule
See [`implementation-playbook.md`](./implementation-playbook.md) for the canonical add-a-new-operation sequence.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# AI Operation Implementation Playbook

## Purpose
Use this when adding a new AI operation. Start with the bare minimum and only add optional pieces when the operation needs them.

Use these existing operations as the canonical references:

1. `ApplicationAnalysis`
2. `ApplicationScoring`
3. `AttachmentSummary`
4. `FormMapping`
5. `FormWorksheet`

## Base Pattern
1. Define the prompt type.
2. Add the v2 prompt seed.
3. Add the operation seed.
4. Add the runtime contract method.
5. Add the runtime implementation.
6. Add the app service or queue entry.
7. Add the background job only if the result must be applied or persisted.
8. Add the UI button and status polling only if users trigger the operation from the web app.
9. Add tests for the prompt, runtime parsing, and job or service path.

## Bare Minimum
For the first pass, only add what is required for a working operation:

- prompt type
- prompt seed
- operation seed
- runtime method
- queue/app service entry
- job or direct apply path, if needed

## Optional Pieces
Add these only when the operation needs them:

- feature flag
- permissions
- permission definition provider entries
- menu entry
- UI button
- status polling
- refresh-after-complete behavior
- persistence/import/publish/assign behavior

## Rules
- Keep the prompt as the source of truth.
- Reuse the existing async generation pattern.
- Do not hardcode field buckets or response shapes in UI code.
- Do not invent new plumbing if an existing operation already does the same job.
- Do not add tenant feature seeding.
- Do not add write-back UI behavior unless the operation already persists output.

## Expected Flow
1. User clicks Generate.
2. UI disables the button and shows generating state, if the operation has UI.
3. API checks permission and feature flag, if the operation uses them.
4. API queues the generation request.
5. Background job loads the operation context.
6. Job builds the prompt payload from existing data.
7. AI runtime renders v2 prompts and logs input/output.
8. Job parses the AI response.
9. Job applies the result if needed.
10. Job stamps status and rate limit state.
11. UI polls status and refreshes after completion, if applicable.

## Validation
- Confirm the prompt version is v2.
- Confirm the operation exists in the AI operation seed.
- Confirm any required feature flag exists in the host feature definitions.
- Confirm any required permission is wired in the permission definition provider.
- Confirm the UI button uses the same generating/status flow as the other operations, if it is user-triggered.
80 changes: 80 additions & 0 deletions applications/Unity.GrantManager/modules/Unity.AI/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Unity.AI Index

## Domain.Shared
AI constants:
- feature flags
- permission names
- localization keys
- prompt type names

## Application.Contracts
Public AI surface:
- app service interfaces
- queue interfaces
- DTOs
- permission definitions

## Application
AI implementation:
- runtime
- prompt seeding
- generation app services
- validators
- prompt logging

## Web
UI-facing AI bits:
- menus
- generation buttons
- status polling

## Files
### Application
- `AI/Operations` - validators and helpers
- `AI/Runtime` - rendering, parsing, logging, provider calls
- `AI/Prompts` - prompt types and template plumbing
- `DataSeed` - seeded prompt and operation data
- `Generation/AIGenerationAppService.cs` - generation API

### Application.Contracts
- `AI/IAIService.cs` - runtime contract
- `Generation/IAIGenerationAppService.cs` - generation app service contract
- `Generation/*ResultDto.cs` - queued result DTOs
- `AI/Operations/IAIGenerationPrerequisiteValidator.cs` - queue prerequisites
- `Automation/IApplicationAIGenerationQueue.cs` - queue contract
- `Permissions/*` - permissions

### Domain.Shared
- `Features/AIFeatures.cs` - feature flags
- `Localization/AILocalizationKeys.cs` - messages
- `PromptTypes/AIPromptTypes.cs` - prompt family names

### Web
- `Menus/AIMenuContributor.cs` - menu entries
- `Menus/AIMenus.cs` - menu item names

## Access
| Operation | View | Generate |
| --- | --- | --- |
| Application Analysis | `ViewApplicationAnalysis` | `GenerateApplicationAnalysis` |
| Attachment Summary | `ViewAttachmentSummary` | `GenerateAttachmentSummaries` |
| Application Scoring | `ViewScoringResult` | `GenerateScoring` |
| Form Mapping | `ViewFormMapping` | `GenerateFormMapping` |
| Form Worksheet | `ViewFormWorksheet` | `GenerateFormWorksheet` |

- Features:
- `Unity.AI.ApplicationAnalysis`
- `Unity.AI.AttachmentSummaries`
- `Unity.AI.Scoring`
- `Unity.AI.FormMapping`
- `Unity.AI.FormWorksheet`

- Rule:
- Both permission and feature gate must allow generation.

## AI Notes
- Prompt logging: logs rendered system/user prompts and provider output.
- Response parsing: parses provider output into stable app-facing results.
- Feature gating: disabled features fail early at the API boundary.
- Background jobs: mark failures, then re-throw.
- New operation playbook: see `implementation-playbook.md`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Application Analysis

## Goal
Generate an AI analysis of an application submission.

## Inputs
- Application submission data
- Application context
- Optional attachments, when present

## Surface
- `POST /api/app/ai/generation/application-analysis`
- `GET /api/app/ai/generation/status`

## Contract
- Structured analysis output. Returns an immediate queued result via API app service, queue, background job, and AI runtime.

## Notes
- This is a reviewer-oriented summary and recommendation flow.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Application Scoring

## Goal
Generate scored answers for a submitted application against an assigned scoresheet.

## Inputs
- Application submission data
- Assigned scoresheet
- Scoresheet questions and definitions

## Surface
- `POST /api/app/ai/generation/application-scoring`
- `GET /api/app/ai/generation/status`

## Contract
- Structured scoring output. Returns an immediate queued result via API app service, queue, background job, and AI runtime.

## Notes
- The prompt asks for answers only for the configured section or scoresheet context.
- The parsed output must align with the scoresheet question ids.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Attachment Summary

## Goal
Generate summaries for selected application attachments.

## Inputs
- One or more attachment IDs
- Application context

## Surface
- `POST /api/app/ai/generation/attachment-summary`
- `GET /api/app/ai/generation/status`

## Contract
- Structured attachment summary output. Returns an immediate queued result via API app service, queue, background job, and AI runtime.

## Notes
- Each attachment is processed as part of the generation request.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Form Mapping

## Goal
Generate recommended CHEFS-to-Unity field mapping for a form version.

## Inputs
- CHEFS fields from the form version
- Unity core intake fields
- Worksheet-derived custom fields when available

## Rule
- Prefer existing Unity core intake fields where they already fit the source field.
- Only suggest worksheet fields or worksheet creation when the form genuinely needs them.

## Surface
- `POST /api/app/ai/generation/form-mapping`
- `GET /api/app/ai/generation/status`
- `GET /api/app/application-form-version/{id}`

## Contract
- Structured mapping recommendation JSON output. Returns an immediate queued result via API app service, queue, background job, and AI runtime.

## Output Shape
- Core field matches.
- Worksheet field matches.
- Worksheet creation suggestions.
- Issues or conflicts.
- Keep the result valid JSON and compatible with the mapping page flow.

## Notes
- The AI response is expected to stay structured and JSON-shaped.
- For new operations, follow [`implementation-playbook.md`](../implementation-playbook.md).
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Form Worksheet

## Goal
Generate a recommended worksheet definition for a form version.

## Inputs
- Form version context
- Form name
- Existing worksheet links
- Worksheet field context

## Rule
- Prefer existing Unity core fields when they already fit the need.
- Only add new worksheet fields when the form genuinely needs extra Unity fields.

## Surface
- `POST /api/app/ai/generation/form-worksheet`
- `GET /api/app/ai/generation/status`

## Contract
- Structured Flex worksheet JSON output. Returns an immediate queued result via API app service, queue, background job, and AI runtime.

## Output Shape
- Full worksheet definition JSON.
- Include only additional worksheet fields that the form needs beyond core Unity fields.
- Keep the result valid JSON and compatible with Flex import.

## Notes
- The AI output should stay valid JSON.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Prompt Map

## Prompt families
- `ApplicationAnalysis` - review and recommendation
- `AttachmentSummary` - attachment summary
- `ApplicationScoring` - question scoring
- `FormMapping` - CHEFS to Unity mapping
- `FormWorksheet` - worksheet generation

## Versions
- `v0`, `v1`, `v2` live under `AI/Prompts/Versions`
- The seeder loads built-in prompt rows from those versions
- Runtime selects by prompt family and version

## Prompt rules
- Versioned prompts are the source of truth.
- Prompt templates define the request shape.
- Structured outputs should stay JSON-shaped.
- New versions should not silently change behavior.

## Build Rule
Use [`implementation-playbook.md`](./implementation-playbook.md) when adding a new prompt-backed operation.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ public interface IAIService
Task<bool> IsAvailableAsync();

Task<AttachmentSummaryResponse> GenerateAttachmentSummaryAsync(AttachmentSummaryRequest request, CancellationToken cancellationToken = default);
Task<AttachmentSummaryBatchResponse> GenerateAttachmentSummaryBatchAsync(AttachmentSummaryBatchRequest request, CancellationToken cancellationToken = default);
Task<ApplicationAnalysisResponse> GenerateApplicationAnalysisAsync(ApplicationAnalysisRequest request, CancellationToken cancellationToken = default);
Task<ApplicationScoringResponse> GenerateApplicationScoringAsync(ApplicationScoringRequest request, CancellationToken cancellationToken = default);
Task<FormMappingResponse> GenerateFormMappingAsync(FormMappingRequest request, CancellationToken cancellationToken = default);
Task<FormWorksheetResponse> GenerateFormWorksheetAsync(FormWorksheetRequest request, CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ public interface IAIGenerationPrerequisiteValidator
Task EnsureApplicationAnalysisAvailableAsync(Guid applicationId);

Task EnsureApplicationScoringAvailableAsync(Guid applicationId);

Task EnsureFormMappingAvailableAsync(Guid applicationFormVersionId);

Task EnsureFormWorksheetAvailableAsync(Guid applicationFormVersionId);
}
Loading
Loading