@graffiticode/l0175 0.2.0
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/dist/compiler.d.ts +12 -0
- package/dist/compiler.d.ts.map +1 -0
- package/dist/compiler.js +1285 -0
- package/dist/compiler.js.map +1 -0
- package/dist/embedding.d.ts +64 -0
- package/dist/embedding.d.ts.map +1 -0
- package/dist/embedding.js +294 -0
- package/dist/embedding.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/lexicon.d.ts +644 -0
- package/dist/lexicon.d.ts.map +1 -0
- package/dist/lexicon.js +101 -0
- package/dist/lexicon.js.map +1 -0
- package/dist/static/instructions.md +527 -0
- package/dist/static/language-info.json +85 -0
- package/dist/static/lexicon.json +1112 -0
- package/dist/static/schema.json +162 -0
- package/dist/static/scope.json +28 -0
- package/dist/static/spec.html +572 -0
- package/dist/static/stems.md +374 -0
- package/dist/static/template.gc +67 -0
- package/dist/static/usage-guide.md +111 -0
- package/package.json +33 -0
- package/spec/README.md +18 -0
- package/spec/data/examples.gc +84 -0
- package/spec/data/examples_with_explanations.md +124 -0
- package/spec/data/training_examples.json +122 -0
- package/spec/docs.md +102 -0
- package/spec/examples.md +91 -0
- package/spec/instructions.md +337 -0
- package/spec/language-info.json +78 -0
- package/spec/schema.json +162 -0
- package/spec/scope.json +28 -0
- package/spec/spec.md +277 -0
- package/spec/stems.md +374 -0
- package/spec/template.gc +67 -0
- package/spec/unparse-hints.json +3 -0
- package/spec/usage-guide.md +111 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Comments
|
|
2
|
+
|
|
3
|
+
| This is a comment
|
|
4
|
+
let x = 10 ..
|
|
5
|
+
|
|
6
|
+
// Basic variable declarations
|
|
7
|
+
let x = 42..
|
|
8
|
+
let greeting = "hello"..
|
|
9
|
+
let flag = 1..
|
|
10
|
+
|
|
11
|
+
// Lists
|
|
12
|
+
let empty = []..
|
|
13
|
+
let numbers = [1, 2, 3, 4, 5]..
|
|
14
|
+
let mixed = [1, "two", [3, 4]]..
|
|
15
|
+
|
|
16
|
+
// Records
|
|
17
|
+
let point = {x: 10, y: 20}..
|
|
18
|
+
let person = {name: "Alice", age: 30, hobbies: ["coding", "reading"]}..
|
|
19
|
+
|
|
20
|
+
// Lambda expressions
|
|
21
|
+
let identity = <x: x>..
|
|
22
|
+
let add2 = <a b: add a b>..
|
|
23
|
+
let double = <x: add x x>..
|
|
24
|
+
let map = <fn arr: <i: fn arr[i]>>..
|
|
25
|
+
|
|
26
|
+
// Function application
|
|
27
|
+
let added = add2 3 4..
|
|
28
|
+
let doubled = double 21..
|
|
29
|
+
let mapped = map (double) numbers..
|
|
30
|
+
|
|
31
|
+
// Composition
|
|
32
|
+
let compose = <f g x: f g x>..
|
|
33
|
+
let addThenDouble = compose (double) (add2)..
|
|
34
|
+
let result2 = addThenDouble 5 7
|
|
35
|
+
|
|
36
|
+
// Pattern matching (commented in grammar but showing syntax)
|
|
37
|
+
case x of
|
|
38
|
+
0: "zero"
|
|
39
|
+
1: "one"
|
|
40
|
+
_: "many"
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
// Conditionals
|
|
44
|
+
let max = <x y:
|
|
45
|
+
if gt x y
|
|
46
|
+
then x
|
|
47
|
+
else y
|
|
48
|
+
>..
|
|
49
|
+
|
|
50
|
+
// Recursive functions
|
|
51
|
+
let factorial = <n:
|
|
52
|
+
case n of
|
|
53
|
+
1: 1
|
|
54
|
+
_: mul n factorial sub n 1
|
|
55
|
+
>..
|
|
56
|
+
|
|
57
|
+
// Higher order functions
|
|
58
|
+
let filter = <pred arr:
|
|
59
|
+
case arr of
|
|
60
|
+
[]: []
|
|
61
|
+
[x, rest]:
|
|
62
|
+
if (pred x)
|
|
63
|
+
then concat [x] (filter pred rest)
|
|
64
|
+
else filter pred rest
|
|
65
|
+
end
|
|
66
|
+
> ..
|
|
67
|
+
|
|
68
|
+
let reduce = <f acc xs:
|
|
69
|
+
case xs of
|
|
70
|
+
[]: acc
|
|
71
|
+
[x, rest]: reduce f (f acc x) rest
|
|
72
|
+
end
|
|
73
|
+
> ..
|
|
74
|
+
|
|
75
|
+
// Real-world examples
|
|
76
|
+
let sum = reduce plus 0 [1 2 3 4] | yields 10
|
|
77
|
+
|
|
78
|
+
let shoppingCart = [
|
|
79
|
+
{name: "Book", price: 10, quantity: 2},
|
|
80
|
+
{name: "Pen", price: 1, quantity: 5},
|
|
81
|
+
{name: "Notebook", price: 5, quantity: 1}
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
let total = calculateTotal shoppingCart
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
|
2
|
+
# Graffiticode Examples with Explanations
|
|
3
|
+
|
|
4
|
+
Graffiticode is a functional language with minimal no infix syntax. Here are examples demonstrating core language features:
|
|
5
|
+
|
|
6
|
+
## Basic Declarations
|
|
7
|
+
|
|
8
|
+
```gc
|
|
9
|
+
let x = 42..
|
|
10
|
+
```
|
|
11
|
+
Binds the value `42` to the variable `x`.
|
|
12
|
+
|
|
13
|
+
## Data Structures
|
|
14
|
+
|
|
15
|
+
### Lists
|
|
16
|
+
|
|
17
|
+
```gc
|
|
18
|
+
let emptyList = []..
|
|
19
|
+
let numbers = [1 2 3 4 5]..
|
|
20
|
+
let nested = [1 [2 3] 4]..
|
|
21
|
+
```
|
|
22
|
+
Lists can contain any values including other lists. Comma separators are optional. Access elements using index notation: `nth 0 numbers` returns `1`.
|
|
23
|
+
|
|
24
|
+
### Records
|
|
25
|
+
|
|
26
|
+
```gc
|
|
27
|
+
let point = {x: 10, y: 20}
|
|
28
|
+
let person = {
|
|
29
|
+
name: "Alice"
|
|
30
|
+
age: 30
|
|
31
|
+
address: {
|
|
32
|
+
street: "123 Main St"
|
|
33
|
+
city: "Anytown"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
Records are key-value structures. Comma separators are optional. Access using dot notation: `get person "name"` returns `"Alice"`.
|
|
38
|
+
|
|
39
|
+
## Functions
|
|
40
|
+
|
|
41
|
+
### Lambda Expressions
|
|
42
|
+
|
|
43
|
+
```gc
|
|
44
|
+
let identity = <x: x>..
|
|
45
|
+
let add2 = <a b: add a b>..
|
|
46
|
+
let double = <x: add x x>..
|
|
47
|
+
```
|
|
48
|
+
Functions are defined using the `<parameters: body>` syntax.
|
|
49
|
+
|
|
50
|
+
### Function Application
|
|
51
|
+
|
|
52
|
+
```gc
|
|
53
|
+
let sum = add2 3 4.. // Returns 7
|
|
54
|
+
let twice = double 5.. // Returns 10
|
|
55
|
+
```
|
|
56
|
+
Functions are applied by listing arguments after the function name.
|
|
57
|
+
|
|
58
|
+
## Higher-Order Functions
|
|
59
|
+
|
|
60
|
+
```gc
|
|
61
|
+
let map = <fn arr: <i: fn nth i arr>>..
|
|
62
|
+
let filter = <pred arr: <i: if pred arr[i] then arr[i] else []>>..
|
|
63
|
+
let reduce = <fn acc arr: if isEmpty arr then acc else reduce (fn) fn acc hd arr tl arr>..
|
|
64
|
+
|
|
65
|
+
let doubled = map (double) [1, 2, 3] // Returns [2, 4, 6]
|
|
66
|
+
let evens = filter (<x: eq mod x 2 0>) [1, 2, 3, 4, 5] // Returns [2, 4]
|
|
67
|
+
let sum = reduce (add2) 0 [1, 2, 3, 4] // Returns 10
|
|
68
|
+
```
|
|
69
|
+
Functions that take other functions as arguments or return functions. Wrap function
|
|
70
|
+
arguments in parens to avoid eager evaluation.
|
|
71
|
+
|
|
72
|
+
## Conditional Logic
|
|
73
|
+
|
|
74
|
+
```gc
|
|
75
|
+
let max = <a b: if gt a b then a else b>
|
|
76
|
+
let abs = <x: if lt x 0 then -x else x>
|
|
77
|
+
```
|
|
78
|
+
The if-then-else expressions `if condition then trueValue else falseValue` is used for conditionals.
|
|
79
|
+
|
|
80
|
+
## Recursion
|
|
81
|
+
|
|
82
|
+
```gc
|
|
83
|
+
let factorial = <n: if le n 1 then 1 else mul n factorial sub n 1>
|
|
84
|
+
let fibonacci = <n: if le n 1 then n else add fibonacci sub n 1 fibonacci sub n 2>
|
|
85
|
+
```
|
|
86
|
+
Functions can call themselves to create recursive algorithms.
|
|
87
|
+
|
|
88
|
+
## Composition
|
|
89
|
+
|
|
90
|
+
```gc
|
|
91
|
+
let compose = <f g: f g>..
|
|
92
|
+
let addThenDouble = compose (double) (add)..
|
|
93
|
+
let result = addThenDouble 5 7.. // double(add(5, 7)) = double(12) = 24
|
|
94
|
+
```
|
|
95
|
+
Functions can be composed to create new functions.
|
|
96
|
+
|
|
97
|
+
## Real-World Example: Data Processing
|
|
98
|
+
|
|
99
|
+
```gc
|
|
100
|
+
let products = [
|
|
101
|
+
{id: 1, name: "Laptop", price: 1200, stock: 5},
|
|
102
|
+
{id: 2, name: "Phone", price: 800, stock: 10},
|
|
103
|
+
{id: 3, name: "Tablet", price: 500, stock: 7},
|
|
104
|
+
{id: 4, name: "Headphones", price: 100, stock: 15}
|
|
105
|
+
]..
|
|
106
|
+
|
|
107
|
+
let inStock = <item: get item "stock" > 0>..
|
|
108
|
+
let applyDiscount = <item discount: {
|
|
109
|
+
id: item.id
|
|
110
|
+
name: item.name
|
|
111
|
+
price: mul get item "price" sub 1 discount
|
|
112
|
+
stock: get item "stock"
|
|
113
|
+
}>..
|
|
114
|
+
|
|
115
|
+
let calculateTotal = <items:
|
|
116
|
+
reduce (<item total: add total get item "price">) 0 items
|
|
117
|
+
>..
|
|
118
|
+
|
|
119
|
+
// Filter in-stock items, apply 10% discount, calculate total
|
|
120
|
+
let availableItems = filter (inStock) products..
|
|
121
|
+
let discountedItems = map (<item: applyDiscount item 0.1>) availableItems..
|
|
122
|
+
let total = calculateTotal discountedItems..
|
|
123
|
+
```
|
|
124
|
+
A more complex example showing how to process a collection of products.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"description": "Program structure",
|
|
4
|
+
"code": "42..",
|
|
5
|
+
"explanation": "Evaluates to the value 42. `..` is the program terminator.",
|
|
6
|
+
"expected_output": "42"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"description": "Basic let declaration",
|
|
10
|
+
"code": "let x = 42..",
|
|
11
|
+
"explanation": "Binds the value 42 to the variable x. `..` is the declaration terminator.",
|
|
12
|
+
"expected_output": "x = 42"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"description": "String declaration",
|
|
16
|
+
"code": "let greeting = \"hello world\"..",
|
|
17
|
+
"explanation": "Binds the string \"hello world\" to the variable greeting",
|
|
18
|
+
"expected_output": "greeting = \"hello world\""
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"description": "List creation",
|
|
22
|
+
"code": "[1, 2, 3, 4, 5]",
|
|
23
|
+
"explanation": "Creates a list of integers",
|
|
24
|
+
"expected_output": "numbers = [1, 2, 3, 4, 5]"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"description": "List creation",
|
|
28
|
+
"code": "let numbers = [1, 2, 3, 4, 5]..",
|
|
29
|
+
"explanation": "Creates a list of integers and binds it to the variable numbers",
|
|
30
|
+
"expected_output": "numbers = [1, 2, 3, 4, 5]"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"description": "Record creation",
|
|
34
|
+
"code": "let person = {name: \"Alice\", age: 30}..",
|
|
35
|
+
"explanation": "Creates a record with two fields and binds it to the variable person",
|
|
36
|
+
"expected_output": "person = {name: \"Alice\", age: 30}"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"description": "Simple lambda expression",
|
|
40
|
+
"code": "let double = <x: add x x>..",
|
|
41
|
+
"explanation": "Creates a function that doubles its input and binds it to the variable double",
|
|
42
|
+
"expected_output": "double = <function>"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"description": "Function application",
|
|
46
|
+
"code": "let result = double 21..",
|
|
47
|
+
"explanation": "Applies the double function to the value 21 and binds the result to the variable result",
|
|
48
|
+
"expected_output": "result = 42"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"description": "Multi-parameter lambda",
|
|
52
|
+
"code": "let sum = <a b: add a b>",
|
|
53
|
+
"explanation": "Creates a function that adds two values and binds it to the variable sum",
|
|
54
|
+
"expected_output": "sum = <function>"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"description": "Multi-parameter function application",
|
|
58
|
+
"code": "let val = sum 3 4..",
|
|
59
|
+
"explanation": "Applies the sum function to the values 3 and 4 and binds the result to the variable val",
|
|
60
|
+
"expected_output": "val = 7"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"description": "Higher-order function - map implementation",
|
|
64
|
+
"code": "let map = <fn arr: <i: fn arr[i]>>..",
|
|
65
|
+
"explanation": "Creates a higher-order function that applies a function to each element of an array",
|
|
66
|
+
"expected_output": "map = <function>"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"description": "Using higher-order function",
|
|
70
|
+
"code": "let doubled = map (double) [1, 2, 3]..",
|
|
71
|
+
"explanation": "Applies the double function to each element in the array [1, 2, 3]. Function name double is in parens to control function application.",
|
|
72
|
+
"expected_output": "doubled = [2, 4, 6]"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"description": "List indexing",
|
|
76
|
+
"code": "let first = nth numbers 0..",
|
|
77
|
+
"explanation": "Accesses the first element of the numbers list",
|
|
78
|
+
"expected_output": "first = 1"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"description": "Record field access",
|
|
82
|
+
"code": "let name = get person \"name\"..",
|
|
83
|
+
"explanation": "Accesses the name field of the person record",
|
|
84
|
+
"expected_output": "name = \"Alice\""
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"description": "Conditional expression",
|
|
88
|
+
"code": "let max = <a b: if gt a b then a else b>..",
|
|
89
|
+
"explanation": "Creates a function that returns the maximum of two values",
|
|
90
|
+
"expected_output": "max = <function>"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"description": "Using conditional",
|
|
94
|
+
"code": "let larger = max 10 20..",
|
|
95
|
+
"explanation": "Applies the max function to the values 10 and 20",
|
|
96
|
+
"expected_output": "larger = 20"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"description": "Recursive function",
|
|
100
|
+
"code": "let factorial = <n: if le n 1 then 1 else mul n factorial sub n 1>..",
|
|
101
|
+
"explanation": "Creates a recursive function that calculates the factorial of a number",
|
|
102
|
+
"expected_output": "factorial = <function>"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"description": "Using recursive function",
|
|
106
|
+
"code": "let fact5 = factorial 5..",
|
|
107
|
+
"explanation": "Calculates the factorial of 5",
|
|
108
|
+
"expected_output": "fact5 = 120"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"description": "Function composition",
|
|
112
|
+
"code": "let compose = <f g x: f g x>..\nlet addThenDouble = compose (double) (add)..\nlet result = addThenDouble 5 7..",
|
|
113
|
+
"explanation": "Creates a function that composes two functions, then uses it to first add 5 and 7, then double the result",
|
|
114
|
+
"expected_output": "result = 24"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"description": "Complex data processing",
|
|
118
|
+
"code": "let products = [\n {id: 1, name: \"Laptop\", price: 1200, stock: 5},\n {id: 2, name: \"Phone\", price: 800, stock: 10},\n {id: 3, name: \"Tablet\", price: 500, stock: 0}\n]..\n\nlet inStock = <item: gt get item \"stock\" 0>..\nlet availableItems = filter (inStock) products",
|
|
119
|
+
"explanation": "Filters a list of products to only include those that are in stock",
|
|
120
|
+
"expected_output": "availableItems = [\n {id: 1, name: \"Laptop\", price: 1200, stock: 5},\n {id: 2, name: \"Phone\", price: 800, stock: 10}\n]"
|
|
121
|
+
}
|
|
122
|
+
]
|
package/spec/docs.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
|
2
|
+
# L0175 User Manual
|
|
3
|
+
|
|
4
|
+
_Revised: 2026-06-18_
|
|
5
|
+
|
|
6
|
+
**Introduction**
|
|
7
|
+
|
|
8
|
+
*Graffiticode* is a collection of domain languages for creating task-specific web apps.
|
|
9
|
+
**L0175** composes 5th-grade English Language Arts assessment items conforming to the
|
|
10
|
+
Smarter Balanced specification ELA · Grade 5 · Claim 1 (Reading), for learning targets **T4**
|
|
11
|
+
(Reasoning & Evidence, literary), **T11** (Reasoning & Evidence, informational), **T9**
|
|
12
|
+
(Central Ideas, informational), **T8** (Key Details, informational), and **T10** (Word Meanings,
|
|
13
|
+
informational). Targets are **different skills**: T4/T11 ask students to infer or conclude and
|
|
14
|
+
justify with evidence; T9 asks them to determine the main idea, the key details that build it, or
|
|
15
|
+
summarize; T8 **gives** the inference and asks them to select the supporting evidence; T10 asks
|
|
16
|
+
for the meaning of a targeted word in context.
|
|
17
|
+
|
|
18
|
+
One language serves **multiple learning targets**, chosen by a required top-level `target`:
|
|
19
|
+
`c1-t4` (literary, RL), `c1-t11` (informational, RI), `c1-t9` (informational, RI-1/RI-2),
|
|
20
|
+
`c1-t8` (informational, RI-1/RI-7), or `c1-t10` (informational, RI-4/L-4). It is
|
|
21
|
+
**item-first**: a program declares its `target`, then authors the `outcome`s (questions) first —
|
|
22
|
+
each with a unique `id`, a `focus` correct claim (a **list** on `multi-select`), and an explicit
|
|
23
|
+
`stem` — then the supported and distractor `claim`s (each distractor `targets` the question(s) it
|
|
24
|
+
foils) and the evidence `source`s for one passage. The compiler *composes* each outcome from its
|
|
25
|
+
`focus` and the foils that target it, assembling a finished item (EBSR, Hot Text, Short Text,
|
|
26
|
+
Multiple Choice, or Multi-Select).
|
|
27
|
+
|
|
28
|
+
### Overview
|
|
29
|
+
|
|
30
|
+
The program
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
target c1-t4
|
|
34
|
+
passage "The Tide Pool"
|
|
35
|
+
type literary
|
|
36
|
+
lines [ "Mara crouched at the edge of the tide pool, ignoring the picnic behind her." ]
|
|
37
|
+
claims [ claim id "c1" status supported dimension character subject "Mara"
|
|
38
|
+
text "Mara is more interested in the tide pool than in the picnic." cites ["e1"] {}
|
|
39
|
+
claim id "c2" status distractor error-type misreads-detail targets ["q1"]
|
|
40
|
+
text "Mara is angry at her brother." rationale "Silence is absorption, not anger." cites ["e1"] {} ]
|
|
41
|
+
evidence [ source id "e1" line 1 status directly-supports supports ["c1"] {} ]
|
|
42
|
+
outcomes [ outcome id "q1" type ebsr dimension character subject "Mara" standard rl-1 focus "c1"
|
|
43
|
+
stem "Which of these inferences about Mara is supported by the passage?"
|
|
44
|
+
stem-b "Which sentence(s) from the passage best support your answer in Part A?" {} ]
|
|
45
|
+
{}..
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
composes a two-part EBSR item and renders it as an answerable form with a Student / Review
|
|
49
|
+
toggle.
|
|
50
|
+
|
|
51
|
+
### Vocabulary
|
|
52
|
+
|
|
53
|
+
| Form | Arity | Example | Description |
|
|
54
|
+
| ---- | :---: | ------- | ----------- |
|
|
55
|
+
| **target** | 2 | `target c1-t11` | Required, top level; selects the learning-target profile (`c1-t4` / `c1-t11` / `c1-t9` / `c1-t8` / `c1-t10`) |
|
|
56
|
+
| **passage** | 2 | `passage "Title"` | Sets the passage heading; chains with `type` and `lines` |
|
|
57
|
+
| **type** | 2 | `type literary` | Passage type (`literary` / `informational`) or, on an outcome, the item type |
|
|
58
|
+
| **lines** | 2 | `lines [ "..." "..." ]` | Passage paragraphs (one entry per source paragraph), auto-numbered from 1 — preserve the request's paragraph breaks; don't merge into one block. Hot Text selects at the sentence level automatically, so split by paragraph (not by sentence) for every task model |
|
|
59
|
+
| **claims** | 2 | `claims [ claim ... {} ]` | The candidate inference statements |
|
|
60
|
+
| **claim** | 1 | `claim id "c1" status supported ... {}` | One inference candidate (supported or distractor) |
|
|
61
|
+
| **evidence** | 2 | `evidence [ source ... {} ]` | The evidence sources |
|
|
62
|
+
| **source** | 1 | `source id "e1" line 1 status directly-supports ... {}` | One passage line tagged by support role |
|
|
63
|
+
| **outcomes** | 2 | `outcomes [ outcome ... {} ]` | The intended items (authored first) |
|
|
64
|
+
| **outcome** | 1 | `outcome id "q1" type ebsr dimension character focus "c1" stem "..." ... {}` | One question to compose |
|
|
65
|
+
| **rubric** | 2 | `rubric [ band ... {} ]` | Short-text scoring bands (on an outcome) |
|
|
66
|
+
| **band** | 1 | `band score 2 descriptor "..." {}` | One rubric row |
|
|
67
|
+
| **title** | 2 | `title "..."` | Optional assessment title (top level) |
|
|
68
|
+
| **grade** | 2 | `grade 5` | Optional reading-level target (top level); defaults to the guideline/target's grade |
|
|
69
|
+
|
|
70
|
+
Attribute functions (arity-2, merge one key into the element's record):
|
|
71
|
+
|
|
72
|
+
- **top level** — `target` (required: `c1-t4` | `c1-t11` | `c1-t9` | `c1-t8` | `c1-t10`), `title` (optional), `grade` (optional reading-level target; defaults to the target's grade), `words` (c1-t10 only — a list of `word`s)
|
|
73
|
+
- **word / meaning** (c1-t10) — `word` has `id`, `text`, `line`/`quote`, `meanings`; `meaning` has `id`, `text`, `status` (`correct` | `distractor`), `error-type`* + `rationale`* on distractors
|
|
74
|
+
- **identity / refs** — `id`, `cites` (claim→evidence ids), `supports` (evidence→claim ids), `focus` (outcome→correct claim id, or a list on `multi-select`), `targets` (distractor→outcome ids)
|
|
75
|
+
- **claim** — `status`, `dimension`, `text`, `error-type`*, `rationale`*, `targets`*, `plausibility` (0–1 distractor temptingness override), `subject`, `standard`, `dok`
|
|
76
|
+
- **evidence** — `status`, `line` (or `quote`), `supports`, `rationale`
|
|
77
|
+
- **outcome / stem** — `id`†, `type`†, `dimension`†, `focus`†, `stem`† (Part A / single-question / prompt, from `stems.md`), `stem-b` (Part B, required on EBSR), `subject`, `standard`, `dok`, `rubric` (short-text)
|
|
78
|
+
- **rubric band** — `score`, `descriptor`
|
|
79
|
+
|
|
80
|
+
\* required on distractor claims. † required on every outcome. See `spec.md` for the full per-function reference.
|
|
81
|
+
|
|
82
|
+
### Enumerations
|
|
83
|
+
|
|
84
|
+
- `target`: `c1-t4` (literary, R&E), `c1-t11` (informational, R&E), `c1-t9` (informational, Central Ideas), `c1-t8` (informational, Key Details), `c1-t10` (informational, Word Meanings)
|
|
85
|
+
- item `type`: `ebsr`, `hot-text`, `short-text`, `multiple-choice`, `multi-select` (allowed set per target — T4/T11: ebsr/hot-text/short-text · T9: multiple-choice/multi-select/ebsr/hot-text/short-text · T8: multiple-choice/multi-select/hot-text · T10: multiple-choice/multi-select/hot-text)
|
|
86
|
+
- `dimension` (c1-t4): `character`, `setting`, `event`, `point-of-view`, `theme`, `topic`, `narrators-feelings`, `character-relationship`
|
|
87
|
+
- `dimension` (c1-t11): `relationships-interactions`, `author-use-of-information`, `point-of-view`, `purpose`, `authors-opinion`
|
|
88
|
+
- `dimension` (c1-t9): `central-idea`, `key-detail`, `summary` · (c1-t8): `supporting-evidence` · (c1-t10): `word-meaning`
|
|
89
|
+
- claim `status`: `supported`, `distractor` · source `status`: `directly-supports`, `supports-wrong-claim`, `irrelevant` · meaning `status` (c1-t10): `correct`, `distractor`
|
|
90
|
+
- `error-type` (c1-t4 / c1-t11): `misreads-detail`, `erroneous-inference`, `faulty-reasoning` · (c1-t9): `too-narrow`, `too-broad`, `misreads-detail`, `insignificant` · (c1-t8): none (non-supporting sources) · (c1-t10): `other-meaning`, `misinterprets`, `wrong-context`
|
|
91
|
+
- `standard` (c1-t4): `rl-1`, `rl-3`, `rl-6`, `rl-9` · (c1-t11): `ri-1`, `ri-3`, `ri-6`, `ri-7`, `ri-8`, `ri-9` · (c1-t9): `ri-1`, `ri-2` · (c1-t8): `ri-1`, `ri-7` · (c1-t10): `ri-4`, `l-4`, `l-4a`, `l-4b`, `l-4c`, `l-5c`
|
|
92
|
+
- `dok`: `r-dok1`, `r-dok2`, `r-dok3` (R&E → r-dok3; T9 → r-dok2, written summary r-dok3; T8 & T10 → r-dok2)
|
|
93
|
+
|
|
94
|
+
### Grade-appropriate reading level
|
|
95
|
+
|
|
96
|
+
Author the passage **and** every claim, option, and rationale at the grade the guideline targets
|
|
97
|
+
(Grade 5 for `c1-t4` / `c1-t11`; override with a top-level `grade <n>` when the user asks for
|
|
98
|
+
another grade). Keep sentences short and mostly simple/compound (≈ `2·grade + 2` words on
|
|
99
|
+
average), vocabulary concrete and high-frequency, and the inference grounded in **specific
|
|
100
|
+
details from the text** rather than abstract literary or rhetorical analysis — DOK 3 is strategic
|
|
101
|
+
reasoning *within* grade-level text, not harder text. The compiler estimates the passage's
|
|
102
|
+
reading level and emits a warning when it reads above the target grade.
|
package/spec/examples.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
|
2
|
+
# L0175 RAG Training Examples
|
|
3
|
+
|
|
4
|
+
_Revised: 2026-06-24_
|
|
5
|
+
|
|
6
|
+
Natural-language prompts for training a RAG model on L0175 — composing 5th-grade ELA
|
|
7
|
+
assessment items (Smarter Balanced · Grade 5 · Claim 1) for learning targets **T4**
|
|
8
|
+
(`target c1-t4`, Reasoning & Evidence, literary), **T11** (`target c1-t11`, Reasoning & Evidence,
|
|
9
|
+
informational), **T9** (`target c1-t9`, Central Ideas, informational), **T8** (`target c1-t8`,
|
|
10
|
+
Key Details, informational), and **T10** (`target c1-t10`, Word Meanings, informational). Each
|
|
11
|
+
program declares its `target` first. Categories 1–6 below are literary (T4); Category 7 is
|
|
12
|
+
informational R&E (T11); Category 8 is Central Ideas (T9); Category 9 is Key Details (T8);
|
|
13
|
+
Category 10 is Word Meanings (T10).
|
|
14
|
+
|
|
15
|
+
## Category 1: EBSR items (two-part selected response)
|
|
16
|
+
|
|
17
|
+
1. Write an EBSR item about the main character's motivation in a story about a girl at a tide pool.
|
|
18
|
+
2. Compose a two-part item: Part A asks what can be inferred about the narrator's feelings; Part B asks for the supporting line.
|
|
19
|
+
3. Make an EBSR item about the setting and how it shapes the mood of the scene.
|
|
20
|
+
4. Build an EBSR item about an event and why the character reacts the way she does.
|
|
21
|
+
5. Write an EBSR item about the relationship between two characters, standard rl-3.
|
|
22
|
+
6. Compose an EBSR item about the author's point of view, standard rl-6.
|
|
23
|
+
7. Make an EBSR item about the theme of the passage.
|
|
24
|
+
|
|
25
|
+
## Category 2: Hot Text items (select text)
|
|
26
|
+
|
|
27
|
+
8. Make a hot-text item where students click the statement that best describes the character, then click the supporting sentences.
|
|
28
|
+
9. Compose a hot-text item where Part B asks students to highlight every sentence that shows the character's focus.
|
|
29
|
+
10. Write a hot-text item about the narrator's feelings toward another character.
|
|
30
|
+
|
|
31
|
+
## Category 3: Short Text items (constructed response)
|
|
32
|
+
|
|
33
|
+
11. Write a short-text item asking what inference can be made about the character, with evidence.
|
|
34
|
+
12. Compose a short-text constructed-response item about the theme, hand-scored 0–2.
|
|
35
|
+
13. Make a short-text item about how the setting affects the character, with a custom rubric.
|
|
36
|
+
|
|
37
|
+
## Category 4: Authoring the inference graph
|
|
38
|
+
|
|
39
|
+
14. Add a supported claim, that the character cares more about the tide pool than the picnic, and point question q1's focus at it.
|
|
40
|
+
15. Add a second supported claim about the brother and build a separate question q2 around it.
|
|
41
|
+
16. Tag line 1 and line 3 as directly supporting the main inference.
|
|
42
|
+
17. Mark line 2 as evidence that supports a wrong claim, tied to both the correct claim and the 'anger' distractor.
|
|
43
|
+
18. Mark the last two lines as irrelevant so they can serve as Part B foils.
|
|
44
|
+
|
|
45
|
+
## Category 5: Distractors by error type
|
|
46
|
+
|
|
47
|
+
19. Add a misreads-detail distractor for question q1 that takes the character's silence as anger.
|
|
48
|
+
20. Add an erroneous-inference distractor for q1 that the character dislikes being outdoors.
|
|
49
|
+
21. Add a faulty-reasoning distractor for q1 that mistakes the character's whisper for fear.
|
|
50
|
+
22. Give each distractor a rationale explaining the student error it targets, and tag it with the question id(s) it foils.
|
|
51
|
+
|
|
52
|
+
## Category 6: Item-first composition
|
|
53
|
+
|
|
54
|
+
23. Compose the questions first: write an EBSR question, a short-text question, and a hot-text question, each with its stem from the guideline catalog, then author foils targeting each.
|
|
55
|
+
24. Compose one question per inference dimension the passage supports, then author a targeted foil set for each.
|
|
56
|
+
25. Set a question's focus to a specific correct claim and write its stem, then author the distractors that target it.
|
|
57
|
+
|
|
58
|
+
## Category 7: Informational items (target c1-t11)
|
|
59
|
+
|
|
60
|
+
26. From an informational article about the history of bridge design, write an EBSR item about the relationships between the successive designs (dimension relationships-interactions, standard ri-3).
|
|
61
|
+
27. Make an item about how the author uses evidence to support a point in a science article (dimension author-use-of-information, standard ri-8).
|
|
62
|
+
28. Compose an EBSR item about the author's point of view in an informational passage about city planning (dimension point-of-view, standard ri-6).
|
|
63
|
+
29. Write a short-text item asking what conclusion can be drawn about the author's opinion of renewable energy, with key evidence (dimension authors-opinion).
|
|
64
|
+
30. Make a hot-text item about the author's purpose in an informational passage (dimension purpose).
|
|
65
|
+
|
|
66
|
+
## Category 8: Central Ideas items (target c1-t9)
|
|
67
|
+
|
|
68
|
+
A DIFFERENT skill from Reasoning & Evidence — the main idea, the key details that build it, and summary (DOK 2; standards ri-1+ri-2). Distractors are usually TRUE statements that just aren't central: too-narrow (a supporting detail), too-broad (an overgeneralization), insignificant (a minor detail), or misreads-detail.
|
|
69
|
+
|
|
70
|
+
31. From an informational article about honeybees, write a multiple-choice item asking which sentence best states the main idea (dimension central-idea). Make the distractors a true supporting detail (too-narrow), an overgeneralization (too-broad), and a misread (misreads-detail).
|
|
71
|
+
32. Make a multi-select item: choose the two sentences that should be included in a summary of the passage (dimension summary); `focus` lists the two correct claims, distractors are insignificant or too-broad statements.
|
|
72
|
+
33. Compose an EBSR item where Part A asks for the main idea and Part B asks which detail best supports it (dimension central-idea, standard ri-2).
|
|
73
|
+
34. Write a short-text item: "Determine the main idea of the passage. Explain using key details…" (dimension central-idea, DOK r-dok3).
|
|
74
|
+
35. Write a multiple-choice "missing key detail" item: present a short summary in the stem and ask which key detail is missing; the focus claim is the missing detail.
|
|
75
|
+
|
|
76
|
+
## Category 9: Key Details items (target c1-t8)
|
|
77
|
+
|
|
78
|
+
A DIFFERENT model — the inference/conclusion is GIVEN in the stem and the student selects the supporting EVIDENCE (DOK 1–2; standards ri-1+ri-7; dimension supporting-evidence). Author ONE supported claim = the given inference (its `focus`), state it in the stem, and author `source`s as the options: directly-supports = correct evidence (with a `quote`), supports-wrong-claim/irrelevant = distractor evidence. No distractor claims.
|
|
79
|
+
|
|
80
|
+
36. From an informational article about Roman aqueducts, write a multiple-choice item that states the conclusion "aqueducts brought water to distant cities" and asks which detail from the passage best supports it (dimension supporting-evidence).
|
|
81
|
+
37. Make a multi-select item: which two details best support the stated conclusion? Select two answers (two directly-supports sources are the correct set).
|
|
82
|
+
38. Make a single-part hot-text item: state the inference, then have students click the sentence(s) in the passage that support it (dimension supporting-evidence).
|
|
83
|
+
|
|
84
|
+
## Category 10: Word Meanings items (target c1-t10)
|
|
85
|
+
|
|
86
|
+
A DIFFERENT model — the question asks for the MEANING of a targeted word/phrase in context, so the options are meanings (DOK 1–2; standard ri-4 + the L-4 family). Author a top-level `words` list: a `word` (the targeted word, with line/quote for context) holding `meanings` — `status correct` (the answer) + `status distractor` (error-type other-meaning/misinterprets/wrong-context + rationale). The outcome's `focus` names the word; state the word + its sentence in the stem.
|
|
87
|
+
|
|
88
|
+
39. From an informational article, write a multiple-choice item asking what the word "aqueduct" most likely means as used in the passage (dimension word-meaning, standard l-4a — context). Distractors: another meaning that ignores context (other-meaning), a misread (misinterprets), and a wrong-context meaning.
|
|
89
|
+
40. Make a multi-select item: "What does the word 'channel' most likely mean? Choose two answers." (two correct meanings, dimension word-meaning).
|
|
90
|
+
41. Write a roots/affixes item: ask what the root in a word means, standard l-4b (dimension word-meaning).
|
|
91
|
+
42. Make a click-the-word item (hot-text): "Read the dictionary entry … Click the word in the paragraph that matches this definition." Author the candidate `word`s — the correct one is the outcome's `focus` with the `line` of its paragraph, plus a few distractor candidate words from that same paragraph (`text` only, no `meanings`). The compiler shows the paragraph and makes those authored candidates clickable; the focus word is correct. (Author only the correct word and every content word in the paragraph becomes a choice.) Keep the passage out of the stem.
|