Commit 33a7b90
fix(app): bubble up artifact-based progress through control/requirement/framework views (CS-316)
* fix(app): bubble up artifact-based progress through control/requirement/framework views (CS-316)
Make progress and compliance reflect underlying artifact completion rather than only fully-satisfied controls, and surface documents alongside policies and tasks throughout the framework view.
- Add Documents column to per-requirement controls table
- Align EvidenceSubmissionInfo with API field name (submittedAt) so the 6-month freshness check actually fires
- Compute requirement status from all control statuses, not just satisfied count
- Compute requirement compliance % from average of per-control progress (policies + tasks + documents)
- Show aggregate framework % across deduplicated artifacts in the framework progress bar
- Mirror the framework view on the requirement page: top progress bar, per-control compliance bar, status next to compliance, paginated controls table, narrower description column
- Paginate the requirements table with the DS Table built-in pagination (10/25/50/100)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(app): address cubic review on PR #2695
- Tighten getControlProgressPercent task-filter test: the unrelated task is now `todo` so a missing filter would surface as 50% instead of silently passing at 100%.
- Per-control Documents column on the requirement page: reuse getRequirementArtifactCounts so document counts honour the same 6-month freshness rule as the status badge and compliance bar (previously any historical submission counted as completed). Policies and tasks counts also flow through the same aggregator for consistency.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(api): bubble up artifact-based progress in framework compliance score
Previously computeFrameworkComplianceScore was binary on full-control satisfaction: a control with one in-progress task pulled the framework to 0%. The frameworks list and overview pages consume this score, so they showed Not Started even when most underlying policies/tasks/documents were already done.
- Rewrite computeFrameworkComplianceScore to count unique artifacts (policies by id, tasks by id, document types by formType) across the framework and weight each one equally.
- Documents only count as completed when their latest submission is within 6 months (matches the freshness rule used elsewhere).
- Drop the now-unused hasAnyArtifact / isControlCompleted helpers.
- Tests cover empty frameworks, all-complete, partial progress (vs. old 0%), document freshness, and cross-control deduplication. Also stub frameworkInstance.findMany / sOADocument.findFirst so the existing getOverviewScores tests run again.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Mariano <marfuen98@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e1782c1 commit 33a7b90
2 files changed
Lines changed: 161 additions & 56 deletions
Lines changed: 111 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| |||
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
| 51 | + | |
| 52 | + | |
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
| |||
240 | 248 | | |
241 | 249 | | |
242 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
243 | 352 | | |
244 | 353 | | |
245 | 354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
331 | | - | |
| 330 | + | |
| 331 | + | |
332 | 332 | | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
343 | 337 | | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
| 338 | + | |
354 | 339 | | |
355 | | - | |
356 | | - | |
357 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
358 | 350 | | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
364 | 357 | | |
365 | | - | |
366 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
367 | 378 | | |
368 | 379 | | |
369 | 380 | | |
370 | 381 | | |
371 | 382 | | |
372 | | - | |
373 | | - | |
| 383 | + | |
| 384 | + | |
374 | 385 | | |
375 | | - | |
376 | | - | |
| 386 | + | |
| 387 | + | |
377 | 388 | | |
378 | | - | |
379 | | - | |
| 389 | + | |
380 | 390 | | |
381 | 391 | | |
382 | 392 | | |
383 | 393 | | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
| 394 | + | |
| 395 | + | |
400 | 396 | | |
0 commit comments