-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
310 lines (253 loc) · 9.33 KB
/
Copy pathjustfile
File metadata and controls
310 lines (253 loc) · 9.33 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
set positional-arguments
# Show available recipes.
default:
@just --list
# Show the current project progress and canonical verification proofs.
screen:
cargo build --bin atxt >/dev/null
just mission-status
printf '\n'
cargo run --quiet --bin atxt -- screen
printf '\n'
just video-signal
printf '\n'
printf '\033[2moperator guide:\033[0m README.md (verification modes and current proof path)\n'
printf '\033[2mrelease gate:\033[0m RELEASE.md (manual release checklist)\n'
# Print the canonical video verification signal.
video-signal:
#!/usr/bin/env bash
set -euo pipefail
repo_root="{{justfile_directory()}}"
fixture="$repo_root/src/testdata/multimodal_test.mp4"
target_dir="${CARGO_TARGET_DIR:-$repo_root/target}"
if [[ "$target_dir" != /* ]]; then
target_dir="$repo_root/$target_dir"
fi
atxt_bin="$target_dir/debug/atxt"
if [[ ! -f "$fixture" ]]; then
printf 'error: video mission fixture not found: %s\n' "$fixture" >&2
exit 1
fi
cargo build --bin atxt >/dev/null
printf 'atxt video signal\n'
printf 'fixture: %s\n' "${fixture#$repo_root/}"
printf 'rendering multimodal summary...\n'
TERM=xterm-256color COLORTERM=truecolor COLUMNS=80 LINES=24 "$atxt_bin" render "$fixture"
# Build the workspace binary.
build:
cargo build --bin atxt
fmt:
cargo fmt --all
fmt-check:
cargo fmt --all --check
# Run cargo check across the workspace.
cargo-check:
cargo check --all-targets --all-features
clippy:
cargo clippy --all-targets --all-features -- -W clippy::all -D warnings
# Run the workspace test suite with cargo-nextest.
test:
cargo nextest run
# Run workspace documentation tests.
doctest:
cargo test --doc
# Run the atxt CLI with arbitrary arguments.
run *args:
cargo run --quiet --bin atxt -- {{args}}
# Print the canonical timed-sequence verification signal.
signal:
#!/usr/bin/env bash
set -euo pipefail
repo_root="{{justfile_directory()}}"
fixture="$repo_root/src/testdata/half-swap.gif"
target_dir="${CARGO_TARGET_DIR:-$repo_root/target}"
if [[ "$target_dir" != /* ]]; then
target_dir="$repo_root/$target_dir"
fi
atxt_bin="$target_dir/debug/atxt"
if [[ ! -f "$fixture" ]]; then
printf 'error: mission fixture not found: %s\n' "$fixture" >&2
exit 1
fi
cargo build --bin atxt >/dev/null
if command -v ffprobe >/dev/null 2>&1; then
dimensions="$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0:s=x "$fixture" | head -n1)"
frame_count="$(ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of csv=p=0 "$fixture" | head -n1)"
else
dimensions="unknown"
frame_count="unknown"
fi
render_direct() {
local output_file="$1"
local command_string
printf -v command_string 'cd %q && TERM=xterm-256color COLORTERM=truecolor COLUMNS=8 LINES=2 %q render %q' "$repo_root" "$atxt_bin" "$fixture"
script -qec "$command_string" /dev/null | tr -d '\r' >"$output_file"
}
render_degraded() {
local output_file="$1"
TERM=dumb NO_COLOR=1 SSH_CONNECTION=mission COLUMNS=8 LINES=4 "$atxt_bin" render "$fixture" >"$output_file"
}
direct_output="$(mktemp)"
degraded_output="$(mktemp)"
trap 'rm -f "$direct_output" "$degraded_output"' EXIT
render_direct "$direct_output"
render_degraded "$degraded_output"
direct_expected=$'⣿⣿⠀⠀⠀⠀⣿⣿\n⣿⣿⠀⠀⠀⠀⣿⣿\n'
degraded_expected=$'@@ @@\n@@ @@\n@@ @@\n@@ @@\n'
if [[ "$(cat "$direct_output")"$'\n' != "$direct_expected" ]]; then
printf 'error: direct mission render did not produce braille signal\n' >&2
cat "$direct_output" >&2
exit 1
fi
if [[ "$(cat "$degraded_output")"$'\n' != "$degraded_expected" ]]; then
printf 'error: degraded mission render did not produce the expected ascii fallback signal\n' >&2
cat "$degraded_output" >&2
exit 1
fi
printf 'atxt signal\n'
printf 'fixture: %s\n' "${fixture#$repo_root/}"
printf 'dimensions: %s\n' "$dimensions"
printf 'source frames: %s\n' "$frame_count"
printf 'direct terminal: interactive tty, truecolor, contact-sheet braille path\n'
printf 'direct render:\n'
cat "$direct_output"
printf 'degraded terminal: captured session, dumb/no-color, ascii fallback\n'
printf 'degraded render:\n'
cat "$degraded_output"
printf 'summary: the same timed visual input remains reviewable as one contact-sheet signal across direct and degraded terminal paths\n'
# Print the canonical audio verification signal.
audio-signal:
#!/usr/bin/env bash
set -euo pipefail
repo_root="{{justfile_directory()}}"
fixture="$repo_root/src/testdata/pulse.wav"
target_dir="${CARGO_TARGET_DIR:-$repo_root/target}"
if [[ "$target_dir" != /* ]]; then
target_dir="$repo_root/$target_dir"
fi
atxt_bin="$target_dir/debug/atxt"
if [[ ! -f "$fixture" ]]; then
printf 'error: mission fixture not found: %s\n' "$fixture" >&2
exit 1
fi
cargo build --bin atxt >/dev/null
render_direct() {
local output_file="$1"
local command_string
printf -v command_string 'cd %q && TERM=xterm-256color COLORTERM=truecolor COLUMNS=16 LINES=4 %q render %q' "$repo_root" "$atxt_bin" "$fixture"
script -qec "$command_string" /dev/null | tr -d '\r' >"$output_file"
}
render_degraded() {
local output_file="$1"
TERM=dumb NO_COLOR=1 SSH_CONNECTION=mission COLUMNS=16 LINES=4 "$atxt_bin" render "$fixture" >"$output_file"
}
direct_output="$(mktemp)"
degraded_output="$(mktemp)"
trap 'rm -f "$direct_output" "$degraded_output"' EXIT
render_direct "$direct_output"
render_degraded "$degraded_output"
direct_expected=$'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n⠉⠉⠉⠉⠀⠀⠀⠀⠉⠉⠉⠉⠀⠀⠀⠀\n⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n⠀⠀⠀⠀⠉⠉⠉⠉⠀⠀⠀⠀⠉⠉⠉⠉\n'
degraded_expected=$' \n######## \n \n ########\n'
if [[ "$(cat "$direct_output")"$'\n' != "$direct_expected" ]]; then
printf 'error: direct audio mission render did not produce braille signal\n' >&2
cat "$direct_output" >&2
exit 1
fi
if [[ "$(cat "$degraded_output")"$'\n' != "$degraded_expected" ]]; then
printf 'error: degraded audio mission render did not produce the expected ascii fallback signal\n' >&2
cat "$degraded_output" >&2
exit 1
fi
printf 'atxt audio signal\n'
printf 'fixture: %s\n' "${fixture#$repo_root/}"
printf 'direct terminal: interactive tty, truecolor, waveform braille path\n'
printf 'direct render:\n'
cat "$direct_output"
printf 'degraded terminal: captured session, dumb/no-color, ascii fallback\n'
printf 'degraded render:\n'
cat "$degraded_output"
printf 'summary: the same audio input remains reviewable as one waveform signal across direct and degraded terminal paths\n'
# Print the current or latest mission completion summary.
mission-status:
#!/usr/bin/env bash
set -euo pipefail
shopt -s nullglob
select_rank() {
case "$1" in
active) echo 60 ;;
achieved) echo 50 ;;
paused) echo 40 ;;
defining) echo 30 ;;
verified) echo 20 ;;
abandoned) echo 10 ;;
*) echo 0 ;;
esac
}
frontmatter_value() {
local file="$1"
local key="$2"
sed -n "s/^${key}: //p" "$file" | head -n1
}
mission_files=(.keel/missions/*/README.md)
if ((${#mission_files[@]} == 0)); then
printf '%s\n' "atxt mission" "status: none" "note: no missions found"
exit 0
fi
selected_file=""
selected_rank=-1
selected_stamp=""
for file in "${mission_files[@]}"; do
status="$(frontmatter_value "$file" status)"
rank="$(select_rank "$status")"
stamp="$(frontmatter_value "$file" updated_at)"
case "$status" in
active) stamp="$(frontmatter_value "$file" activated_at)" ;;
achieved) stamp="$(frontmatter_value "$file" achieved_at)" ;;
verified) stamp="$(frontmatter_value "$file" verified_at)" ;;
esac
stamp="${stamp:-0000-00-00T00:00:00}"
if (( rank > selected_rank )) || { (( rank == selected_rank )) && [[ "$stamp" > "$selected_stamp" ]]; }; then
selected_file="$file"
selected_rank="$rank"
selected_stamp="$stamp"
fi
done
mission_id="$(frontmatter_value "$selected_file" id)"
mission_title="$(frontmatter_value "$selected_file" title)"
mission_status="$(frontmatter_value "$selected_file" status)"
printf 'atxt mission\n'
printf 'id: %s\n' "$mission_id"
printf 'title: %s\n' "$mission_title"
printf 'status: %s\n' "$mission_status"
case "$mission_status" in
achieved)
printf 'next: nix develop -c keel mission verify %s\n' "$mission_id"
;;
active)
printf 'next: nix develop -c keel mission next %s\n' "$mission_id"
;;
esac
# Print project progress visualizations.
# Show the 3D Drift Globe prototype.
globe:
cargo build --bin atxt >/dev/null
cargo run --quiet --bin atxt -- globe
# Verify all stories, regenerate the board, and stage all .keel artifacts.
ship:
#!/usr/bin/env bash
set -euo pipefail
keel verify run --all
keel generate
keel doctor
git add .keel
printf '\n\x1b[1;32mSHIPPED:\x1b[0m .keel artifacts synchronized.\n'
just screen
quality: fmt-check cargo-check clippy
keel *args:
keel {{args}}
coverage args="":
mkdir -p coverage
if [[ -n "{{args}}" ]]; then cargo llvm-cov nextest {{args}}; else cargo llvm-cov nextest --lcov --output-path ./coverage/lcov.info; fi
check: quality test doctest
flake-check:
nix flake check