@memberjunction/rubrics-base 0.0.0 → 6.2.0-edge.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +183 -0
- package/README.md +35 -28
- package/dist/RubricEngineBase.d.ts +150 -0
- package/dist/RubricEngineBase.d.ts.map +1 -0
- package/dist/RubricEngineBase.js +267 -0
- package/dist/RubricEngineBase.js.map +1 -0
- package/dist/RubricScoring.d.ts +60 -0
- package/dist/RubricScoring.d.ts.map +1 -0
- package/dist/RubricScoring.js +363 -0
- package/dist/RubricScoring.js.map +1 -0
- package/dist/RubricVersionDiff.d.ts +59 -0
- package/dist/RubricVersionDiff.d.ts.map +1 -0
- package/dist/RubricVersionDiff.js +256 -0
- package/dist/RubricVersionDiff.js.map +1 -0
- package/dist/authoring.d.ts +16 -0
- package/dist/authoring.d.ts.map +1 -0
- package/dist/authoring.js +98 -0
- package/dist/authoring.js.map +1 -0
- package/dist/canonical.d.ts +22 -0
- package/dist/canonical.d.ts.map +1 -0
- package/dist/canonical.js +152 -0
- package/dist/canonical.js.map +1 -0
- package/dist/evidence.d.ts +13 -0
- package/dist/evidence.d.ts.map +1 -0
- package/dist/evidence.js +38 -0
- package/dist/evidence.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/sampling.d.ts +71 -0
- package/dist/sampling.d.ts.map +1 -0
- package/dist/sampling.js +63 -0
- package/dist/sampling.js.map +1 -0
- package/dist/snapshot.d.ts +16 -0
- package/dist/snapshot.d.ts.map +1 -0
- package/dist/snapshot.js +114 -0
- package/dist/snapshot.js.map +1 -0
- package/dist/types.d.ts +170 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +39 -7
package/LICENSE
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
License text copyright (c) 2024 MariaDB plc, All Rights Reserved.
|
|
4
|
+
"Business Source License" is a trademark of MariaDB plc.
|
|
5
|
+
|
|
6
|
+
-----------------------------------------------------------------------------
|
|
7
|
+
|
|
8
|
+
Parameters
|
|
9
|
+
|
|
10
|
+
Licensor: Blue Cypress, Inc.
|
|
11
|
+
|
|
12
|
+
Licensed Work: MemberJunction.
|
|
13
|
+
The Licensed Work is (c) 2023-2026 Blue Cypress, Inc.
|
|
14
|
+
|
|
15
|
+
Additional Use Grant: Subject to the terms of this License, Licensor grants
|
|
16
|
+
you the following additional rights to make Production
|
|
17
|
+
Use of the Licensed Work.
|
|
18
|
+
|
|
19
|
+
1. Internal Use
|
|
20
|
+
|
|
21
|
+
You may make production use of the Licensed Work for
|
|
22
|
+
your own internal business or organizational operations.
|
|
23
|
+
|
|
24
|
+
2. Nonprofit Use
|
|
25
|
+
|
|
26
|
+
If you are a Nonprofit, you may make production use of
|
|
27
|
+
the Licensed Work for the operations and activities of
|
|
28
|
+
your Organizational Family.
|
|
29
|
+
|
|
30
|
+
3. MemberJunction Certified Program Use
|
|
31
|
+
|
|
32
|
+
If you are authorized by Licensor under the
|
|
33
|
+
MemberJunction Certified Program to provide professional
|
|
34
|
+
services using the Licensed Work, you may make
|
|
35
|
+
production use of the Licensed Work in providing such
|
|
36
|
+
professional services to a client, provided that:
|
|
37
|
+
|
|
38
|
+
(a) the Licensed Work is deployed in, and the applicable
|
|
39
|
+
production use occurs within, an environment owned,
|
|
40
|
+
leased, licensed, subscribed to, or otherwise controlled
|
|
41
|
+
by that client; and
|
|
42
|
+
|
|
43
|
+
(b) the production use is for that client's own internal
|
|
44
|
+
business or organizational operations or is otherwise
|
|
45
|
+
independently permitted to that client under this
|
|
46
|
+
Additional Use Grant.
|
|
47
|
+
|
|
48
|
+
4. Definitions Applicable to the Additional Use Grant
|
|
49
|
+
|
|
50
|
+
"Affiliate" means, with respect to a specified Person,
|
|
51
|
+
any other Person that directly or indirectly Controls,
|
|
52
|
+
is Controlled by, or is under common Control with such
|
|
53
|
+
specified Person.
|
|
54
|
+
|
|
55
|
+
"Control" (including the terms "Controls," "Controlled
|
|
56
|
+
by," and "under common Control with") means the direct
|
|
57
|
+
or indirect possession of the power to direct or cause
|
|
58
|
+
the direction of the management and policies of a
|
|
59
|
+
Person, whether through ownership of voting interests,
|
|
60
|
+
by contract, or otherwise.
|
|
61
|
+
|
|
62
|
+
"Organizational Family" means, with respect to a Person,
|
|
63
|
+
(a) such Person and its Affiliates, and (b) any
|
|
64
|
+
nonprofit organization, governmental entity, chapter,
|
|
65
|
+
division, local affiliate, regional affiliate, state
|
|
66
|
+
affiliate, national affiliate, or other entity that is
|
|
67
|
+
formally affiliated with such Person through governing
|
|
68
|
+
documents, a charter, bylaws, a membership agreement, or
|
|
69
|
+
another written organizational instrument, and is
|
|
70
|
+
recognized under such documents as part of the same
|
|
71
|
+
organizational structure.
|
|
72
|
+
|
|
73
|
+
"Nonprofit" means a Person recognized by the Internal
|
|
74
|
+
Revenue Service as exempt from federal income taxation
|
|
75
|
+
under Section 501(c)(3), 501(c)(4), 501(c)(5), or
|
|
76
|
+
501(c)(6) of the Internal Revenue Code, or a foreign
|
|
77
|
+
organization recognized under substantially equivalent
|
|
78
|
+
laws.
|
|
79
|
+
|
|
80
|
+
A Person claiming eligibility as a Nonprofit shall, upon
|
|
81
|
+
Licensor's reasonable request, provide documentation
|
|
82
|
+
reasonably sufficient to demonstrate that it qualifies
|
|
83
|
+
as a Nonprofit. If such Person materially misrepresents,
|
|
84
|
+
or is unable to demonstrate, its qualification as a
|
|
85
|
+
Nonprofit, the rights granted to such Person under
|
|
86
|
+
Section 2 of this Additional Use Grant shall terminate.
|
|
87
|
+
|
|
88
|
+
"MemberJunction Certified Program" means Licensor's
|
|
89
|
+
then-current program for certifying and authorizing a
|
|
90
|
+
Person to provide professional services using the
|
|
91
|
+
Licensed Work.
|
|
92
|
+
|
|
93
|
+
"Person" means any individual, corporation, limited
|
|
94
|
+
liability company, partnership, association, nonprofit
|
|
95
|
+
organization, governmental entity, or other legal or
|
|
96
|
+
organizational entity.
|
|
97
|
+
|
|
98
|
+
Change Date: Four (4) years from the date the Licensed Work is first
|
|
99
|
+
made available.
|
|
100
|
+
|
|
101
|
+
Change License: MIT License.
|
|
102
|
+
|
|
103
|
+
For information about alternative licensing arrangements for the Licensed
|
|
104
|
+
Work, please contact Blue Cypress, Inc.
|
|
105
|
+
|
|
106
|
+
-----------------------------------------------------------------------------
|
|
107
|
+
|
|
108
|
+
Terms
|
|
109
|
+
|
|
110
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
111
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
112
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
113
|
+
production use.
|
|
114
|
+
|
|
115
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
116
|
+
available distribution of a specific version of the Licensed Work under this
|
|
117
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
118
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
119
|
+
above terminate.
|
|
120
|
+
|
|
121
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
122
|
+
currently in effect as described in this License, you must purchase a
|
|
123
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
124
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
125
|
+
|
|
126
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
127
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
128
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
129
|
+
for each version of the Licensed Work released by Licensor.
|
|
130
|
+
|
|
131
|
+
You must conspicuously display this License on each original or modified copy
|
|
132
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
133
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
134
|
+
License apply to your use of that work.
|
|
135
|
+
|
|
136
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
137
|
+
terminate your rights under this License for the current and all other
|
|
138
|
+
versions of the Licensed Work.
|
|
139
|
+
|
|
140
|
+
This License does not grant you any right in any trademark or logo of
|
|
141
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
142
|
+
Licensor as expressly required by this License).
|
|
143
|
+
|
|
144
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
145
|
+
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
146
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
147
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
148
|
+
TITLE.
|
|
149
|
+
|
|
150
|
+
MariaDB hereby grants you permission to use this License's text to license
|
|
151
|
+
your works, and to refer to it using the trademark "Business Source License",
|
|
152
|
+
as long as you comply with the Covenants of Licensor below.
|
|
153
|
+
|
|
154
|
+
-----------------------------------------------------------------------------
|
|
155
|
+
|
|
156
|
+
Covenants of Licensor
|
|
157
|
+
|
|
158
|
+
In consideration of the right to use this License's text and the "Business
|
|
159
|
+
Source License" name and trademark, Licensor covenants to MariaDB, and to all
|
|
160
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
161
|
+
|
|
162
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
163
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
164
|
+
where "compatible" means that software provided under the Change License
|
|
165
|
+
can be included in a program with software provided under GPL Version 2.0
|
|
166
|
+
or a later version. Licensor may specify additional Change Licenses without
|
|
167
|
+
limitation.
|
|
168
|
+
|
|
169
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
170
|
+
impose any additional restriction on the right granted in this License, as
|
|
171
|
+
the Additional Use Grant; or (b) insert the text "None".
|
|
172
|
+
|
|
173
|
+
3. To specify a Change Date.
|
|
174
|
+
|
|
175
|
+
4. Not to modify this License in any other way.
|
|
176
|
+
|
|
177
|
+
-----------------------------------------------------------------------------
|
|
178
|
+
|
|
179
|
+
Notice
|
|
180
|
+
|
|
181
|
+
The Business Source License (this document, or the "License") is not an Open
|
|
182
|
+
Source license. However, the Licensed Work will eventually be made available
|
|
183
|
+
under an Open Source License, as stated in this License.
|
package/README.md
CHANGED
|
@@ -1,45 +1,52 @@
|
|
|
1
1
|
# @memberjunction/rubrics-base
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
UI-safe scoring and version classification for rubrics. Pure functions: no database and no Angular. The server and the author preview both call this package. Neither one keeps a second copy of the math.
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
> **Start with the [Rubrics Guide](../../../guides/RUBRICS_GUIDE.md)** — the model, the five common tasks, tests, agents, and adopting rubrics in an application. This README is the package reference.
|
|
6
6
|
|
|
7
|
-
This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
|
|
8
7
|
|
|
9
|
-
##
|
|
8
|
+
## Scoring
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
1. Configure OIDC trusted publishing for the package name `@memberjunction/rubrics-base`
|
|
13
|
-
2. Enable secure, token-less publishing from CI/CD workflows
|
|
14
|
-
3. Establish provenance for packages published under this name
|
|
10
|
+
`RubricScoring.Compute` scores a version snapshot and its answers. A levels answer uses the level's normalized value. A numeric answer maps the raw value across the scale's minimum and maximum, and inverts that when lower is better. A Percentage scale is a numeric scale named Percentage, or any numeric scale whose minimum is 0 and maximum is 100.
|
|
15
11
|
|
|
16
|
-
|
|
12
|
+
The outcome is the first match:
|
|
17
13
|
|
|
18
|
-
|
|
14
|
+
1. **Incomplete** when completeness is below the version minimum.
|
|
15
|
+
2. **NotApplicableFailure** when a not-applicable answer used Fail the evaluation.
|
|
16
|
+
3. **Incomplete** when the overall score is null.
|
|
17
|
+
4. **GateFailed** when a non-advisory gate is unanswered or below its gate minimum. The minimum is 0 when the criterion does not set one.
|
|
18
|
+
5. **Passed** or **BelowThreshold** when a pass threshold is set.
|
|
19
|
+
6. **Scored** otherwise.
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
`Passed` is true only for Passed. It is null for Scored, and for Incomplete when the version has no threshold and no gate. Comparisons use the score rounded to six decimal places.
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
## Versions
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
2. Configure the trusted publisher (e.g., GitHub Actions)
|
|
26
|
-
3. Specify the repository and workflow that should be allowed to publish
|
|
27
|
-
4. Use the configured workflow to publish your actual package
|
|
25
|
+
`RubricVersionDiff.Diff` compares a draft with the version it was cloned from. The bump says whether scores stay comparable.
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
- **Major** — a non-advisory node was added or removed, or a scoring field on a non-advisory node changed, or `IsAdvisory` flipped, or the version's not-applicable policy changed, or a scale used by a non-advisory node changed its type, range, step, direction, or a level's value. A node that is advisory on both sides does not make those scoring-field edits Major.
|
|
28
|
+
- **Minor** — the pass threshold or minimum completeness changed, a band was added or removed or its range or tone changed, or an advisory node's scoring fields changed, or evidence or rationale became required.
|
|
29
|
+
- **Patch** — wording, sequence, and the display range. Bands match by label. A renamed label on the same band is Patch.
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
- Contains no executable code
|
|
33
|
-
- Provides no functionality
|
|
34
|
-
- Should not be installed as a dependency
|
|
35
|
-
- Exists only for administrative purposes
|
|
31
|
+
`HighestNonDraftVersion` is the highest Published or Retired version. A Draft is not a base. The first publish, with no such base, is 1.0.0. The author may request a higher bump and may not request a lower one. A draft identical to its base cannot be published.
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
`SnapshotFromRows` builds the snapshot those functions score. `EvidenceJson` turns plain text into a quote list and leaves an evidence array as JSON.
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
- [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
|
|
41
|
-
- [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
|
|
35
|
+
`BandFor` names the band for a 0..1 score. `WeightShares` is each node's percent of its non-advisory siblings. `DraftProblems` names a tree that cannot be published. `Frozen` is true when a published version uses the scale. The author widgets call these. They do not keep a second copy.
|
|
42
36
|
|
|
43
|
-
|
|
37
|
+
## CLI
|
|
44
38
|
|
|
45
|
-
|
|
39
|
+
This package does not talk to the database. The commands that do are:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
mj rubric list
|
|
43
|
+
mj rubric show <rubric>[@version]
|
|
44
|
+
mj rubric diff <rubric> <version> <version>
|
|
45
|
+
mj rubric validate <file>
|
|
46
|
+
mj rubric evaluate --rubric <rubric> --entity <name> --record <id> [--evaluator LLM|Deterministic]
|
|
47
|
+
mj test run --rubric <rubric>[@version]
|
|
48
|
+
mj test suite --rubric <rubric>[@version]
|
|
49
|
+
mj test promote-criteria <test>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`mj rubric evaluate` defaults to LLM, which is stored as AIPrompt. None of these commands publish a version. `mj test promote-criteria` copies a test's inline judge criteria onto a Draft rubric and sets `Test.RubricID`. `@memberjunction/rubrics` is the server package that runs an evaluation.
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { BaseEngine, type IMetadataProvider, type UserInfo } from '@memberjunction/core';
|
|
2
|
+
import type { NotApplicablePolicy, RubricBandSnapshot, RubricNodeSnapshot } from './types.js';
|
|
3
|
+
export interface RubricCategoryRecord {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
parentId?: string | null;
|
|
7
|
+
description?: string | null;
|
|
8
|
+
sequence: number;
|
|
9
|
+
}
|
|
10
|
+
export interface RubricScaleLevelRecord {
|
|
11
|
+
id: string;
|
|
12
|
+
label: string;
|
|
13
|
+
value: number;
|
|
14
|
+
normalizedValue: number;
|
|
15
|
+
description?: string | null;
|
|
16
|
+
sequence: number;
|
|
17
|
+
}
|
|
18
|
+
export interface RubricScaleRecord {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
scaleType: 'Levels' | 'Numeric';
|
|
22
|
+
minValue?: number | null;
|
|
23
|
+
maxValue?: number | null;
|
|
24
|
+
step?: number | null;
|
|
25
|
+
higherIsBetter: boolean;
|
|
26
|
+
levels: RubricScaleLevelRecord[];
|
|
27
|
+
}
|
|
28
|
+
export interface RubricRecord {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
categoryId?: string | null;
|
|
32
|
+
description?: string | null;
|
|
33
|
+
status: string;
|
|
34
|
+
}
|
|
35
|
+
/** A version row plus the tree that hangs off it. Status may be Draft; the cache drops those. */
|
|
36
|
+
export interface RubricVersionRecord {
|
|
37
|
+
id: string;
|
|
38
|
+
rubricId: string;
|
|
39
|
+
status: string;
|
|
40
|
+
majorVersion?: number | null;
|
|
41
|
+
minorVersion?: number | null;
|
|
42
|
+
patchVersion?: number | null;
|
|
43
|
+
/** Default when a criterion does not set its own. The scorer reads this off the version. */
|
|
44
|
+
notApplicablePolicy: NotApplicablePolicy;
|
|
45
|
+
passThreshold?: number | null;
|
|
46
|
+
minimumCompleteness?: number | null;
|
|
47
|
+
instructions?: string | null;
|
|
48
|
+
scoreDisplayMin: number;
|
|
49
|
+
scoreDisplayMax: number;
|
|
50
|
+
nodes: RubricNodeSnapshot[];
|
|
51
|
+
bands: RubricBandSnapshot[];
|
|
52
|
+
}
|
|
53
|
+
export interface AgentRubricRecord {
|
|
54
|
+
id: string;
|
|
55
|
+
agentId: string;
|
|
56
|
+
rubricId: string;
|
|
57
|
+
purpose?: string | null;
|
|
58
|
+
isDefault: boolean;
|
|
59
|
+
status: string;
|
|
60
|
+
priority: number;
|
|
61
|
+
}
|
|
62
|
+
/** Everything the cache holds. The server engine loads rows and passes them here. */
|
|
63
|
+
export interface RubricCacheSnapshot {
|
|
64
|
+
categories: RubricCategoryRecord[];
|
|
65
|
+
scales: RubricScaleRecord[];
|
|
66
|
+
rubrics: RubricRecord[];
|
|
67
|
+
versions: RubricVersionRecord[];
|
|
68
|
+
agentRubrics: AgentRubricRecord[];
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A published version plus the criteria, anchors, bands, and scales that score it.
|
|
72
|
+
* The policy, threshold, completeness minimum, instructions, and display range are
|
|
73
|
+
* the version fields RubricScoring reads, so a caller with only this cache can build
|
|
74
|
+
* a RubricVersionSnapshot.
|
|
75
|
+
*/
|
|
76
|
+
export interface CachedPublishedVersion {
|
|
77
|
+
id: string;
|
|
78
|
+
rubricId: string;
|
|
79
|
+
majorVersion: number;
|
|
80
|
+
minorVersion: number;
|
|
81
|
+
patchVersion: number;
|
|
82
|
+
notApplicablePolicy: NotApplicablePolicy;
|
|
83
|
+
passThreshold: number | null;
|
|
84
|
+
minimumCompleteness: number | null;
|
|
85
|
+
instructions: string | null;
|
|
86
|
+
scoreDisplayMin: number;
|
|
87
|
+
scoreDisplayMax: number;
|
|
88
|
+
nodes: RubricNodeSnapshot[];
|
|
89
|
+
bands: RubricBandSnapshot[];
|
|
90
|
+
scales: RubricScaleRecord[];
|
|
91
|
+
}
|
|
92
|
+
/** Entities {@link RubricEngineBase.Config} keeps fresh. */
|
|
93
|
+
export declare const RUBRIC_CACHE_ENTITIES: readonly ["MJ: Rubric Categories", "MJ: Rubric Scales", "MJ: Rubric Scale Levels", "MJ: Rubrics", "MJ: Rubric Versions", "MJ: Rubric Criteria", "MJ: Rubric Criterion Levels", "MJ: Rubric Bands", "MJ: AI Agent Rubrics"];
|
|
94
|
+
/**
|
|
95
|
+
* Cache of rubric definitions. It is a {@link BaseEngine}, so a metadata provider
|
|
96
|
+
* can refresh it. Only versions whose status is Published are kept, each with its
|
|
97
|
+
* criteria, level anchors, bands, and the scales those criteria use. Drafts are dropped.
|
|
98
|
+
* Callers can still replace the shaped cache directly.
|
|
99
|
+
*/
|
|
100
|
+
export declare class RubricEngineBase extends BaseEngine<RubricEngineBase> {
|
|
101
|
+
static get Instance(): RubricEngineBase;
|
|
102
|
+
constructor();
|
|
103
|
+
/**
|
|
104
|
+
* Loads the rubric entities, then rebuilds the published-version maps the
|
|
105
|
+
* readers use. A metadata refresh is not visible until that rebuild.
|
|
106
|
+
*/
|
|
107
|
+
Config(forceRefresh?: boolean, contextUser?: UserInfo, provider?: IMetadataProvider): Promise<void>;
|
|
108
|
+
private loaded;
|
|
109
|
+
private categories;
|
|
110
|
+
private scales;
|
|
111
|
+
private rubrics;
|
|
112
|
+
private published;
|
|
113
|
+
private publishedByRubric;
|
|
114
|
+
private agentRubrics;
|
|
115
|
+
/**
|
|
116
|
+
* Replace the whole cache. Published versions are stored with their tree.
|
|
117
|
+
* A Draft or Retired version is not stored, even when its criteria were loaded.
|
|
118
|
+
*/
|
|
119
|
+
ReplaceCache(snapshot: RubricCacheSnapshot): void;
|
|
120
|
+
/** Category by id, or null when it was not in the last snapshot. */
|
|
121
|
+
GetCategory(id: string): RubricCategoryRecord | null;
|
|
122
|
+
/** Scale by id, including its levels, or null. */
|
|
123
|
+
GetScale(id: string): RubricScaleRecord | null;
|
|
124
|
+
/** Rubric definition by id, or null. */
|
|
125
|
+
GetRubric(id: string): RubricRecord | null;
|
|
126
|
+
/**
|
|
127
|
+
* A published version with its criteria, anchors, bands, and scales.
|
|
128
|
+
* Returns null for an unknown id and for a draft that was present in the snapshot.
|
|
129
|
+
*/
|
|
130
|
+
GetPublishedVersion(versionId: string): CachedPublishedVersion | null;
|
|
131
|
+
/** Every cached published version of one rubric, highest number first. */
|
|
132
|
+
GetPublishedVersions(rubricId: string): CachedPublishedVersion[];
|
|
133
|
+
/** The highest published version of a rubric, or null when none is published. */
|
|
134
|
+
GetLatestPublishedVersion(rubricId: string): CachedPublishedVersion | null;
|
|
135
|
+
/** Rubrics linked to an agent, highest priority first. */
|
|
136
|
+
GetAgentRubrics(agentId: string): AgentRubricRecord[];
|
|
137
|
+
}
|
|
138
|
+
/** Builds the shaped cache from the entity rows {@link RubricEngineBase.Config} just loaded. */
|
|
139
|
+
export declare function ShapedCacheFromRows(loaded: {
|
|
140
|
+
categories: unknown[];
|
|
141
|
+
scales: unknown[];
|
|
142
|
+
levels: unknown[];
|
|
143
|
+
rubrics: unknown[];
|
|
144
|
+
versions: unknown[];
|
|
145
|
+
criteria: unknown[];
|
|
146
|
+
anchors: unknown[];
|
|
147
|
+
bands: unknown[];
|
|
148
|
+
agentRubrics: unknown[];
|
|
149
|
+
}): RubricCacheSnapshot;
|
|
150
|
+
//# sourceMappingURL=RubricEngineBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RubricEngineBase.d.ts","sourceRoot":"","sources":["../src/RubricEngineBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiC,KAAK,iBAAiB,EAAE,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGxH,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE9F,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,QAAQ,GAAG,SAAS,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE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