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:
33
tasks/environment/env_config.toml
Normal file
33
tasks/environment/env_config.toml
Normal file
@@ -0,0 +1,33 @@
|
||||
name = "env_config"
|
||||
category = "environment"
|
||||
mode = "solve"
|
||||
description = """
|
||||
Read a config format from stdin where each line is "KEY=VALUE".
|
||||
For each line, set an environment variable with that key and value.
|
||||
After processing all lines, run the command `env` and print only the variables
|
||||
that were set from the input, sorted alphabetically by key, in "KEY=VALUE" format.
|
||||
|
||||
You must actually set these as environment variables and retrieve them back
|
||||
(not just echo the input).
|
||||
"""
|
||||
|
||||
[[test_cases]]
|
||||
stdin = """APP_NAME=myapp
|
||||
APP_PORT=8080
|
||||
APP_DEBUG=true"""
|
||||
expected_stdout = """APP_DEBUG=true
|
||||
APP_NAME=myapp
|
||||
APP_PORT=8080"""
|
||||
env = {}
|
||||
|
||||
[[test_cases]]
|
||||
stdin = """DB_HOST=localhost
|
||||
DB_PORT=5432"""
|
||||
expected_stdout = """DB_HOST=localhost
|
||||
DB_PORT=5432"""
|
||||
env = {}
|
||||
|
||||
[[test_cases]]
|
||||
stdin = "SINGLE_VAR=hello"
|
||||
expected_stdout = "SINGLE_VAR=hello"
|
||||
env = {}
|
||||
40
tasks/environment/env_path_builder.toml
Normal file
40
tasks/environment/env_path_builder.toml
Normal file
@@ -0,0 +1,40 @@
|
||||
name = "env_path_builder"
|
||||
category = "environment"
|
||||
mode = "convert"
|
||||
description = """
|
||||
Read directory paths from stdin, one per line.
|
||||
Append each to the MYPATH environment variable (colon-separated), skipping duplicates.
|
||||
The initial value of MYPATH is provided via the environment (may be empty).
|
||||
Print the final value of MYPATH to stdout.
|
||||
"""
|
||||
|
||||
bash_source = """
|
||||
#!/bin/bash
|
||||
while IFS= read -r dir || [[ -n "$dir" ]]; do
|
||||
if [[ -z "$MYPATH" ]]; then
|
||||
export MYPATH="$dir"
|
||||
elif [[ ":$MYPATH:" != *":$dir:"* ]]; then
|
||||
export MYPATH="$MYPATH:$dir"
|
||||
fi
|
||||
done
|
||||
echo "$MYPATH"
|
||||
"""
|
||||
|
||||
[[test_cases]]
|
||||
stdin = """/usr/local/bin
|
||||
/usr/bin
|
||||
/usr/local/bin
|
||||
/opt/bin"""
|
||||
expected_stdout = "/usr/local/bin:/usr/bin:/opt/bin"
|
||||
env = { "MYPATH" = "" }
|
||||
|
||||
[[test_cases]]
|
||||
stdin = """/new/path
|
||||
/existing"""
|
||||
expected_stdout = "/already/here:/new/path:/existing"
|
||||
env = { "MYPATH" = "/already/here" }
|
||||
|
||||
[[test_cases]]
|
||||
stdin = "/only"
|
||||
expected_stdout = "/only"
|
||||
env = { "MYPATH" = "" }
|
||||
Reference in New Issue
Block a user