Commit baaf6e8
committed
Intelligence setup hardening, PDF inline citations, GraphQL validation + perf fixes, demo walkthroughs
Squash of six commits addressing the PR #1982 review and the defects
uncovered while verifying the feature live.
Intelligence setup (review fixes):
- batch_run_action(allow_partial=True) queues up to BATCH_RUN_MAX_DOCS
instead of refusing on large corpora; per-template remainingCount
surfaces the deferred remainder in the banner toast.
- Setup status gains canSetup + referenceAvailable; is_fully_set_up no
longer demands deployment-unavailable pieces (zombie-CTA fix); the
banner hides for viewers who cannot run setup.
- setupCorpusIntelligence requires CRUD, matching AddTemplateToCorpus /
CreateCorpusAction; shared CorpusActionService.install_template
replaces the duplicated clone recipe; reference action dedupe via
get_or_create + GovernanceGraphLive consults setup status before
installing; post-create chain surfaces ok=false; lookup-only
EnrichmentService.get_analyzer; redundant queries trimmed.
PDF inline citations:
- Enrichment mentions on PDF documents are projected onto PAWLs token
bounding boxes via PlasmaPDF (shared opencontractserver/utils/
span_projection.py, also used by datacell grounding) — TOKEN_LABEL
with real page numbers instead of unpaintable char-offset spans.
Whitespace-insensitive ordinal-occurrence remapping absorbs
txt-extract/PAWLs drift; legacy span mentions upgrade in place on
re-enrichment. useReferenceMentions fixed (scoped analyzedCorpusId
discovery, client.query instead of a hanging looped useLazyQuery,
lean GET_REFERENCE_MENTIONS_FOR_ANALYSIS selection — ~176s -> ~0s).
GraphQL spec validation + performance:
- validation_rules now extend (not replace) graphql-core's spec rules —
unknown-argument/field and variable-type validation had been silently
disabled in every environment. All 26 invalid frontend documents
repaired, including silently-broken features: new DeleteMetadataColumn
and UpdateFieldset mutations (BaseService pattern, IDOR-unified
messages), corpus chat history shape fix, tokenAuth unified on the
WithUser payload, redirect corpus context sourced from route slugs.
CI sweep: tests/architecture/test_frontend_graphql_documents.py +
scripts/validate_frontend_graphql.py.
- Presigned-URL cache lifetime now derives from AWS_QUERYSTRING_EXPIRE
(was the 7-day CacheControl max-age) and is clamped to half the
signature lifetime — cached file links could 403 for hours.
- UserFeedbackQuerySet.visible_to_user inherited-visibility rewritten as
a correlated Exists (was an uncorrelated IN materializing the full
annotations table per evaluation): GetAnnotationsForAnalysis measured
176s -> 2.3s for a 108-mention document.
Branding + docs:
- Navbar wordmark [cite] -> [OpenContracts] (serif treatment kept,
19px, aria-label aligned).
- README leads with two captioned demo walkthrough GIFs
(docs/assets/images/gifs/demo-{1,2}-*.gif): one-click corpus
intelligence setup and the explore-and-ask tour with inline statutory
citations.1 parent 6687145 commit baaf6e8
49 files changed
Lines changed: 2118 additions & 509 deletions
File tree
- changelog.d
- config
- graphql
- settings
- docs/assets/images/gifs
- frontend
- src
- __tests__
- components
- admin
- cookies
- corpuses
- CorpusHome/intelligence
- documents
- knowledge_base/document/document_kb
- layout
- maps
- graphql
- hooks
- routing
- views
- tests
- opencontractserver
- corpuses/services
- enrichment
- services
- tests
- architecture
- utils
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
40 | 65 | | |
41 | 66 | | |
42 | 67 | | |
| |||
189 | 214 | | |
190 | 215 | | |
191 | 216 | | |
192 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
193 | 220 | | |
194 | 221 | | |
195 | 222 | | |
| |||
240 | 267 | | |
241 | 268 | | |
242 | 269 | | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
247 | 274 | | |
248 | 275 | | |
249 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
1604 | 1604 | | |
1605 | 1605 | | |
1606 | 1606 | | |
1607 | | - | |
1608 | | - | |
1609 | | - | |
1610 | | - | |
1611 | | - | |
1612 | | - | |
1613 | | - | |
1614 | | - | |
1615 | | - | |
1616 | | - | |
1617 | | - | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
1618 | 1612 | | |
1619 | | - | |
1620 | | - | |
1621 | | - | |
1622 | | - | |
1623 | | - | |
1624 | | - | |
1625 | | - | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
1626 | 1617 | | |
1627 | 1618 | | |
1628 | 1619 | | |
1629 | 1620 | | |
1630 | 1621 | | |
1631 | 1622 | | |
1632 | | - | |
1633 | | - | |
1634 | | - | |
1635 | | - | |
1636 | | - | |
1637 | | - | |
1638 | | - | |
1639 | 1623 | | |
1640 | 1624 | | |
1641 | 1625 | | |
| |||
1664 | 1648 | | |
1665 | 1649 | | |
1666 | 1650 | | |
1667 | | - | |
| 1651 | + | |
| 1652 | + | |
1668 | 1653 | | |
1669 | 1654 | | |
1670 | 1655 | | |
| |||
0 commit comments