Time window 24 hours. Suggested effort about 3 to 4 hours.
Context
Services write structured logs as JSON lines. On-call engineers want a fast CLI to filter and summarise them without loading anything into a database.
Core requirements
logq FILE [options]reads JSON lines from a file, or from stdin when FILE is-, streaming in constant memory.--where 'level=error',--where 'status>=500', repeatable (all must match). Operators=,!=,>,>=,<,<=, and~(substring). Nested fields with dots:http.status>=500.--sinceand--untilon thetsfield (ISO 8601).--fields a,b,cprints the selected fields as a table; otherwise matching lines are printed unchanged.--count-by FIELDprints counts per value, sorted descending.- Malformed lines are skipped and counted; the count goes to stderr at the end.
Acceptance criteria
- Commit a sample log (
samples/app.log, at least 200 lines) and the script that generated it.logq samples/app.log --where level=error --count-by serviceprints the right numbers, and the README shows it. - Exit codes: 0 when something matched, 1 when nothing matched, 2 on bad usage (with a helpful message).
- Handles a 1 GB file without reading it into memory (say how you checked).
- Unit tests for the filter expression parser and integration tests that run the CLI.
Stretch goals (optional)
--format csv|json|table.--percentiles FIELD(p50, p95, p99) for numeric fields.- Follow mode (
-f) liketail -f. - Gzip input.
Constraints
- Any language. Suggested: Python (argparse or typer), Go, Rust or Node.
- Runnable from the repository with one documented command.
Deliverables (every project)
- Source code committed in this repository (the grader diffs against the first commit).
README.mdthat replaces the stub, with: how to install, run and test it (copy-pasteable commands); the decisions and trade-offs you made; what you would do next with more time; and a short note on how you used the AI agent (what you delegated, what you checked or rewrote).- Automated tests that run with a single command (
npm test,pytest,go test ./...orcargo test). - No secrets in the repository. Anything configurable reads from environment variables with safe defaults.
Ground rules
- The 24-hour clock is a window, not a workload. Stop at roughly the suggested effort, then write down what you would do next. A small, finished, tested core beats a large unfinished one.
- Use the AI agent as much or as little as you like: every prompt is recorded and the report shows how it was used. You are judged on the result and on whether you understood and verified what the agent produced.
- The work is yours. PraxisAI uses it only to produce your assessment report.