@@ -17,6 +17,21 @@ export const command = "rubrics <action>";
1717export const describe = "Import and export rubrics in YML format" ;
1818
1919// YML structure types
20+
21+ /**
22+ * A YAML reference on a rubric check. Either name-keyed (review_round + part +
23+ * criterion + check) or by numeric `id` fallback. Mirrors `YamlReference` in
24+ * `utils/supabase/DatabaseTypes.d.ts` — the frontend CLI just passes these
25+ * through unchanged to/from the edge function.
26+ */
27+ interface YamlReferenceYml {
28+ review_round ?: string ;
29+ part ?: string ;
30+ criterion ?: string ;
31+ check ?: string ;
32+ id ?: number ;
33+ }
34+
2035interface RubricCheckYml {
2136 name : string ;
2237 description : string | null ;
@@ -31,6 +46,7 @@ interface RubricCheckYml {
3146 group : string | null ;
3247 max_annotations : number | null ;
3348 student_visibility : string ;
49+ references ?: YamlReferenceYml [ ] ;
3450}
3551
3652interface RubricCriteriaYml {
@@ -289,6 +305,15 @@ export const builder = (yargs: Argv) => {
289305 logger . info ( ` Parts: ${ data . summary . parts } ` ) ;
290306 logger . info ( ` Criteria: ${ data . summary . criteria } ` ) ;
291307 logger . info ( ` Checks: ${ data . summary . checks } ` ) ;
308+ if ( typeof data . summary . references === "number" ) {
309+ logger . info ( ` References: ${ data . summary . references } ` ) ;
310+ }
311+ if ( Array . isArray ( data . reference_warnings ) && data . reference_warnings . length > 0 ) {
312+ logger . info ( ` Skipped references: ${ data . reference_warnings . length } ` ) ;
313+ for ( const w of data . reference_warnings ) {
314+ logger . info ( ` - ${ w . check_path } : ${ w . reason } ` ) ;
315+ }
316+ }
292317 } catch ( error ) {
293318 handleError ( error ) ;
294319 }
@@ -315,6 +340,9 @@ function printRubricTree(rubric: RubricYml): void {
315340 for ( const check of criteria . checks ) {
316341 const points = check . points >= 0 ? `+${ check . points } ` : `${ check . points } ` ;
317342 logger . info ( ` Check: ${ check . name } (${ points } )` ) ;
343+ if ( Array . isArray ( check . references ) && check . references . length > 0 ) {
344+ logger . info ( ` References: ${ check . references . length } ` ) ;
345+ }
318346 }
319347 }
320348 }
0 commit comments