Reorganize task categories from opaque a/b to descriptive names
Replace category_a/category_b directories with algorithm, pipeline, environment, filesystem, and process. Add separate mode field (solve/convert) to decouple orchestration from capability grouping. Add per-category summary and questionnaire breakdowns to both terminal report and HTML export.
This commit is contained in:
34
tasks/pipeline/log_parser.toml
Normal file
34
tasks/pipeline/log_parser.toml
Normal file
@@ -0,0 +1,34 @@
|
||||
name = "log_parser"
|
||||
category = "pipeline"
|
||||
mode = "convert"
|
||||
description = """
|
||||
Read log lines from stdin. Each line has the format: "LEVEL: message"
|
||||
where LEVEL is one of ERROR, WARN, INFO.
|
||||
Count occurrences of each level and print a summary sorted by level name.
|
||||
Format: "LEVEL: count"
|
||||
"""
|
||||
|
||||
bash_source = """
|
||||
#!/bin/bash
|
||||
while IFS= read -r line || [[ -n "$line" ]]; do
|
||||
echo "${line%%:*}"
|
||||
done | sort | uniq -c | while read -r count level; do
|
||||
echo "$level: $count"
|
||||
done
|
||||
"""
|
||||
|
||||
[[test_cases]]
|
||||
stdin = """ERROR: disk full
|
||||
INFO: started
|
||||
WARN: low memory
|
||||
ERROR: timeout
|
||||
INFO: completed"""
|
||||
expected_stdout = """ERROR: 2
|
||||
INFO: 2
|
||||
WARN: 1"""
|
||||
|
||||
[[test_cases]]
|
||||
stdin = """INFO: boot
|
||||
INFO: ready
|
||||
INFO: shutdown"""
|
||||
expected_stdout = "INFO: 3"
|
||||
Reference in New Issue
Block a user