interplane.Get Omega
Read in your language

omega-tool-model

First-party Omega tool-use model source, serving harnesses, and verification records

Brought by drakestapleton

branch main Branches Tags History

omega-tool-model / native-training / strict.om

220 lines · 2885 bytes Raw Blame History
1note Two unseen real fixture reads. Count the first request, the isolated result reply and the complete cycle separately.
2text qhead "Task: Read the note and report its value.\nFile: "
3text q1 "notes/item98271.txt"
4text q2 "notes/item98349.txt"
5text ask "\nState: unread\nAnswer:\n"
6text result "\nState: read\nTool result: value = "
7text answer "\nAnswer:\n"
8text req1 "{\"tool\":\"read_file\",\"path\":\"notes/item98271.txt\"}"
9text req2 "{\"tool\":\"read_file\",\"path\":\"notes/item98349.txt\"}"
10text denied "\nState: denied\nTool result: Permission denied.\nAnswer:\n"
11text noauth "Permission denied."
12text missing "\nState: missing\nTool result: File not found.\nAnswer:\n"
13text nofile "File not found."
14global qdata uchar 3
15fn qlen t ulong to ulong
16if eq t 0
17ret len qhead
18end
19if eq t 1
20ret len q1
21end
22if eq t 2
23ret len q2
24end
25if eq t 3
26ret len ask
27end
28if eq t 4
29ret len result
30end
31if eq t 5
32ret len answer
33end
34if eq t 6
35ret len req1
36end
37if eq t 7
38ret len req2
39end
40if eq t 8
41ret len denied
42end
43if eq t 9
44ret len noauth
45end
46if eq t 10
47ret len missing
48end
49if eq t 11
50ret len nofile
51end
52if eq t 12
53ret len qdata
54end
55exit 77
56end
57fn qbyte t ulong i ulong to uchar
58if eq t 0
59ret get qhead i
60end
61if eq t 1
62ret get q1 i
63end
64if eq t 2
65ret get q2 i
66end
67if eq t 3
68ret get ask i
69end
70if eq t 4
71ret get result i
72end
73if eq t 5
74ret get answer i
75end
76if eq t 6
77ret get req1 i
78end
79if eq t 7
80ret get req2 i
81end
82if eq t 8
83ret get denied i
84end
85if eq t 9
86ret get noauth i
87end
88if eq t 10
89ret get missing i
90end
91if eq t 11
92ret get nofile i
93end
94if eq t 12
95ret get qdata i
96end
97exit 77
98end
99fn qadd s ulong to void
100n = get icount 0
101for i ulong qlen s
102put iprom add n i qbyte s i
103end
104put icount 0 add n qlen s
105end
106fn qmake p ulong to void
107put icount 0 0
108qadd 0
109qadd p
110end
111fn qinfer to void
112put og 9 0
113ocpush 0
114n = obprompt 3
115for i ulong n
116ocpush get obtk i
117end
118put oon 0 0
119for j ulong 64
120c = gsnext
121if eq c 0
122ret
123end
124obtput c
125ocpush c
126end
127end
128fn qeq s ulong to bool
129if ne get oon 0 qlen s
130ret false
131end
132for i ulong qlen s
133if ne get oout i qbyte s i
134ret false
135end
136end
137ret true
138end
139fn qcase p ulong want ulong to void
140qmake p
141qadd 3
142qinfer
143asked = qeq want
144if not asked
145put oon 0 0
146oputc 82
147oputc 32
148oputc 48
149oputc 32
150oputc 48
151oputc 10
152oflush
153ret
154end
155fd = long 0
156if eq p 1
157fd = fopen q1 0 len q1 0 0
158else
159fd = fopen q2 0 len q2 0 0
160end
161if lt fd 0
162exit 71
163end
164r = read int fd qdata 0 len qdata
165cl = fclose int fd
166if ne r 3
167exit 72
168end
169qmake p
170qadd 4
171qadd 12
172qadd 5
173qinfer
174got = qeq 12
175put oon 0 0
176oputc 82
177oputc 32
178if asked
179oputc 49
180else
181oputc 48
182end
183oputc 32
184if got
185oputc 49
186else
187oputc 48
188end
189oputc 10
190oflush
191end
192fn qstate st ulong expected ulong to void
193qmake 1
194qadd st
195qinfer
196ok = qeq expected
197put oon 0 0
198oputc 83
199oputc 32
200if ok
201oputc 49
202else
203oputc 48
204end
205oputc 10
206oflush
207end
208fn main to int
209ockload 1
210put og 6 1
211obload 4 get og 0
212ggopen
213ggupw
214qcase 1 6
215qcase 2 7
216qstate 8 9
217qstate 10 11
218r = nvstop
219ret 0
220end