journeyman-cli 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,77 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ push:
7
+ tags:
8
+ - 'v*'
9
+ pull_request:
10
+ branches:
11
+ - main
12
+
13
+ jobs:
14
+ security-and-tests:
15
+ name: Security Audits & Unit Tests
16
+ runs-on: ubuntu-latest
17
+
18
+ steps:
19
+ - name: Checkout repository
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: '3.10'
26
+
27
+ - name: Install dependencies
28
+ run: |
29
+ python -m pip install --upgrade pip setuptools
30
+ python -m pip install bandit pip-audit ruff
31
+
32
+ - name: Lint and Code Style Check (Ruff)
33
+ run: ruff check src/
34
+
35
+ - name: Security Code Analysis (Bandit)
36
+ # B310: urllib.request.urlopen (we mock/handle this securely)
37
+ # B404/B603: subprocess usage (required for compiling/validating)
38
+ # We skip these specific warnings or run bandit to catch other high-severity issues.
39
+ run: bandit -r src/ -x tests/ --skip B310,B404,B603
40
+
41
+ - name: Dependency Vulnerability Audit (pip-audit)
42
+ run: pip-audit
43
+
44
+ - name: Run Unit Tests
45
+ run: |
46
+ PYTHONPATH=src python3 -m unittest discover -s tests -v
47
+
48
+ build-n-publish:
49
+ name: Build and publish Python 🐍 distribution 📦 to PyPI
50
+ needs: security-and-tests
51
+ # Only publish on tag pushes or release triggers, not on standard pull requests
52
+ if: github.event_name != 'pull_request'
53
+ runs-on: ubuntu-latest
54
+ permissions:
55
+ # Required for Trusted Publishing (OIDC) to PyPI
56
+ id-token: write
57
+ contents: read
58
+
59
+ steps:
60
+ - name: Checkout repository
61
+ uses: actions/checkout@v4
62
+
63
+ - name: Set up Python
64
+ uses: actions/setup-python@v5
65
+ with:
66
+ python-version: '3.10'
67
+
68
+ - name: Install build dependencies
69
+ run: python -m pip install --upgrade pip setuptools build
70
+
71
+ - name: Build binary wheel and source tarball
72
+ run: python -m build
73
+
74
+ - name: Publish package distribution to PyPI
75
+ uses: pypa/gh-action-pypi-publish@release/v1
76
+ with:
77
+ skip-existing: true
@@ -0,0 +1,28 @@
1
+ # Spec files and worker artifacts
2
+ tasks/*.md
3
+ *.bak
4
+ *.partial
5
+ .sb_tmp_*
6
+
7
+ # Python
8
+ __pycache__/
9
+ *.py[cod]
10
+ *$py.class
11
+ *.egg-info/
12
+ .eggs/
13
+ dist/
14
+ build/
15
+ .venv/
16
+ venv/
17
+
18
+ # Editor / OS
19
+ .DS_Store
20
+ .idea/
21
+ .vscode/
22
+ *.swp
23
+ *~
24
+
25
+ # Local / secrets (never commit)
26
+ .env
27
+ .env.*
28
+ !.env.example
@@ -0,0 +1,129 @@
1
+ # Changelog
2
+
3
+ All notable changes to **journeyman** are documented here.
4
+
5
+ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
+ Versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ---
9
+
10
+ ## [Unreleased]
11
+
12
+ ---
13
+
14
+ ## [1.1.0] — 2026-07-26
15
+
16
+ ### Added
17
+
18
+ #### Cost tracking
19
+ - **Per-call cost line** on stderr after every successful worker run:
20
+ `[journeyman] 1,252 tokens (840 in + 412 out) | est. cost: $0.00007`
21
+ Local models always show `$0.000`. Falls back to "Token count unavailable" when
22
+ the provider does not return usage data.
23
+ - **Usage log** at `~/.local/share/journeyman/usage.jsonl` (overridable via
24
+ `JOURNEYMAN_USAGE_LOG`); every successful run appends one JSON line with provider,
25
+ model, token counts, estimated cost, output file, and UTC timestamp.
26
+ - **`journeyman stats`** command — reads the usage log and prints a grouped summary
27
+ table (provider / model / run count / total tokens / estimated cost); supports
28
+ `--since DAYS` and `--json` flags.
29
+ - **`MODEL_PRICING`** table in `constants.py` — approximate mid-2025 list prices for
30
+ all built-in remote providers; local providers always resolve to `$0.00`.
31
+
32
+ #### Agent integration
33
+ - **Templates** for wiring journeyman into frontier agents (in `templates/`):
34
+ - `CLAUDE.md` — Claude Code
35
+ - `AGENTS.md` — Codex CLI
36
+ - `cursorrules` — Cursor
37
+ - `GEMINI.md` — Gemini CLI
38
+ - `copilot-instructions.md` — GitHub Copilot
39
+ - `journeyman.mdc` — Cursor MDC rules format
40
+ - `install.sh` post-install tip now lists all template filenames explicitly.
41
+
42
+ #### CLI flags
43
+ - `--json-output` — write a structured JSON summary to stdout on exit; stdout is
44
+ otherwise silent (safe to pipe to `jq` or capture in a script).
45
+ - `--root DIR` — set project root; all relative `--task`, `--out`, and `--context`
46
+ paths resolve from here (useful when agent CWD ≠ project root).
47
+ - `--task -` — read spec from stdin instead of a file; preferred invocation pattern
48
+ for autonomous agents (no temp-file round-trip).
49
+ - `--timeout SECONDS` — override the default 120 s HTTP timeout for model API calls.
50
+
51
+ #### Tooling
52
+ - `journeyman version` command (`journeyman --version` also works).
53
+ - Python 3.7+ version check in `journeyman.sh` with a clear error message.
54
+ - `USAGE_LOG_PATH` added to `constants.py` (overridable via `JOURNEYMAN_USAGE_LOG`).
55
+ - Dynamic provider lists in error messages — all messages now derive from
56
+ `VALID_REMOTE_PROVIDERS` in `constants.py`, so adding a new provider auto-updates
57
+ every error string.
58
+
59
+ ### Changed
60
+
61
+ - **Streaming** (`--stream`) now writes to **stderr**, keeping **stdout** clean for
62
+ `--json-output`; `stream_options: {"include_usage": true}` is also sent so token
63
+ counts are available even for streamed responses.
64
+ - **README** completely rewritten — punchy hook, architecture diagram, agent
65
+ integration table, full CLI options, exit-code reference, and data flow & trust section.
66
+ - `install.sh` tip message now lists each template filename on its own line.
67
+
68
+ ### Fixed
69
+
70
+ - **Context injection backtick corruption** — context files are now injected using
71
+ `=== Context: name ===` / `=== End: name ===` delimiters instead of triple-backtick
72
+ fences, so context files that contain `` ``` `` can no longer corrupt the
73
+ code-extraction regex.
74
+ - **`OSError` on directory paths** — passing a directory as `--context` or `--task`
75
+ (e.g. `--context src/`) previously crashed with an unhandled `IsADirectoryError`;
76
+ now exits cleanly with code 2 and a descriptive message.
77
+
78
+ ### Tests
79
+
80
+ - Test count: **66 → 119** (all passing).
81
+ - New test classes:
82
+ - `TestStdinSpec` — `--task -` stdin invocation and content forwarding
83
+ - `TestJsonOutput` — `--json-output` success and failure paths
84
+ - `TestContextSizeWarning` — 32 KB context threshold warning
85
+ - `TestRootFlag` — relative path resolution with `--root`
86
+ - `TestCostTracking` — `estimate_cost`, `append_usage_log`, usage field in JSON output
87
+ - `TestUtf8Reads` — binary context file exits with code 2
88
+ - `TestFormatContextSnippet` — `===` delimiter correctness and code-extraction safety
89
+
90
+ ---
91
+
92
+ ## [1.0.0] — 2026-07-18
93
+
94
+ Initial release.
95
+
96
+ ### Added
97
+
98
+ - `journeyman worker` — sends a one-file spec to a local or economical model, validates
99
+ syntax (`py_compile`, `node --check`, `bash -n`, `tsc --noEmit`), and atomically
100
+ writes the output file with a `.bak` of the previous version.
101
+ - `journeyman setup` — interactive and flag-driven configuration of local/remote backends;
102
+ stores config in `~/.config/journeyman/config.json` (mode 0600 for keys).
103
+ - `journeyman detect` — probe and display the active backend.
104
+ - **Auto-detection** — local backends probed on startup in priority order:
105
+ Ollama (11434) → LM Studio (1234) → llama.cpp / mlx_lm (8080); remote fallback uses
106
+ the first provider with a key set: Groq → Together AI → Gemini → OpenAI.
107
+ - `--expect PATTERN` — regex that must appear in generated code; retried up to 2× with
108
+ the failure fed back to the model.
109
+ - `--stream` — display generated content as it arrives.
110
+ - `--lang` — override language detection from file extension
111
+ (`python`, `javascript`, `typescript`, `bash`).
112
+ - `--no-validate` / `--no-backup` — opt-out flags.
113
+ - `install.sh` — link and copy installation modes; `--uninstall` support; registers
114
+ the skill under `~/.claude/skills/journeyman/` for Claude Code discovery.
115
+ - `SKILL.md` — agent-readable skill definition with full workflow and exit-code contract.
116
+ - `references/REVIEW.md` — human review protocol for code generated by the worker.
117
+ - Exit codes: `0` success, `1` no code block, `2` config/network error,
118
+ `3` validation failed, `4` stream interrupted, `5` `--expect` pattern absent after
119
+ retries.
120
+ - 66 unit tests covering `extract_code`, `detect_backend`, `_auth_header`,
121
+ `write_atomic`, retry logic, and setup commands.
122
+ - `scripts/constants.py` — single source of truth for all backend definitions,
123
+ provider env vars, and config path.
124
+ - `scripts/backend_util.py` — shared config load/save, model listing, and local model
125
+ selection helpers.
126
+
127
+ [Unreleased]: https://github.com/RajatGarg97/journeyman/compare/v1.1.0...HEAD
128
+ [1.1.0]: https://github.com/RajatGarg97/journeyman/compare/v1.0.0...v1.1.0
129
+ [1.0.0]: https://github.com/RajatGarg97/journeyman/releases/tag/v1.0.0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 journeyman contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,150 @@
1
+ Metadata-Version: 2.4
2
+ Name: journeyman-cli
3
+ Version: 1.1.0
4
+ Summary: Route implementation tasks to a local or economical model
5
+ Author: Rajat Garg
6
+ License: MIT
7
+ License-File: LICENSE
8
+ Classifier: Environment :: Console
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: >=3.7
13
+ Description-Content-Type: text/markdown
14
+
15
+ # journeyman
16
+
17
+ **Save your frontier tokens for thinking. A local or economical model writes every line of code — and tight specs make small models write it well.**
18
+
19
+ `journeyman` is an Agent Skill designed to plug into **Claude Code**, **Codex CLI**, **Cursor**, **GitHub Copilot**, and **Gemini CLI**. It is built on a simple division of labor:
20
+ 1. **The Frontier Agent (Claude/GPT/Gemini)** acts as the architect. It writes plans, tests, and highly specific per-file specs. It *never* writes the application source code directly.
21
+ 2. **The Worker Model (Local or Low-Cost Remote)** types out the actual code based on those tight specs.
22
+
23
+ By enforcing this contract, you save expensive API tokens on repetitive code generation, and you force small models to generate high-quality code because they are never given vague prompts.
24
+
25
+ ---
26
+
27
+ ## Quick Start
28
+
29
+ ### 1. Install the CLI
30
+
31
+ You can install `journeyman` directly as a Python package from the repository root:
32
+
33
+ ```bash
34
+ git clone <this-repo-url> journeyman
35
+ cd journeyman
36
+ pip install .
37
+ ```
38
+
39
+ Alternatively, you can run `./install.sh` which runs `pip install` and registers the skill for Claude Code under `~/.claude/skills/journeyman`. (Use `./install.sh --copy` for a standalone copy-mode installation.)
40
+
41
+ ### 2. Configure your Worker Model
42
+
43
+ `journeyman` is zero-config if you run a local model server. It automatically detects and connects to **Ollama** (port 11434), **LM Studio** (1234), **llama.cpp**, and **mlx_lm** (8080).
44
+
45
+ If you don't have local hardware, you can fall back to fast, low-cost remote providers:
46
+
47
+ ```bash
48
+ # See all available backends (local and remote)
49
+ journeyman setup --list
50
+
51
+ # Set a preferred remote fallback (requires GROQ_API_KEY in your environment)
52
+ journeyman setup --prefer-remote groq
53
+
54
+ # Or store a key in the config file (mode 0600; env vars still win)
55
+ journeyman setup --set-api-key groq "$GROQ_API_KEY"
56
+ ```
57
+
58
+ ### 3. Integrate with your Agent
59
+
60
+ Journeyman ships with ready-to-paste integration templates. Just copy the contents of the relevant file into your project:
61
+
62
+ | Agent | File to edit | Template to copy |
63
+ |---|---|---|
64
+ | **Claude Code** | `CLAUDE.md` in project root | `templates/CLAUDE.md` |
65
+ | **Codex CLI** | `AGENTS.md` in project root | `templates/AGENTS.md` |
66
+ | **Cursor** (current) | `.cursor/rules/journeyman.mdc` | `templates/journeyman.mdc` |
67
+ | **Cursor** (legacy) | `.cursorrules` in project root | `templates/cursorrules` |
68
+ | **GitHub Copilot** | `.github/copilot-instructions.md` | `templates/copilot-instructions.md` |
69
+ | **Gemini CLI** | `GEMINI.md` in project root | `templates/GEMINI.md` |
70
+
71
+ Once added, just tell your agent: *"Use journeyman to build a CLI todo app."*
72
+
73
+ ---
74
+
75
+ ## How it Works
76
+
77
+ ```text
78
+ you ──"build X"──▶ frontier agent (Claude / Gemini / GPT)
79
+ │ 1. writes architecture and per-file specs
80
+ │ 2. invokes journeyman ──▶ local or economical model
81
+ │ (writes the file)
82
+ │ 3. reviews the code, runs tests
83
+ │ 4. on failure: improves the SPEC and re-delegates
84
+
85
+ working, reviewed code — written locally or via a low-cost remote
86
+ ```
87
+
88
+ The worker script (`journeyman worker`) validates the generated code (Python: `py_compile`; JS: `node --check`; TS: `tsc --noEmit`; Bash: `bash -n`) and handles automatic retries if the local model messes up, before passing control back to the frontier agent for final review.
89
+
90
+ ---
91
+
92
+ ## Manual CLI Usage
93
+
94
+ You can use `journeyman` manually without an agent. The worker takes a markdown spec and outputs a validated file:
95
+
96
+ ```bash
97
+ # Pipe a spec directly (preferred for agents)
98
+ journeyman worker --task - --out src/parser.py --expect 'class Parser' <<'SPEC'
99
+ # Task: Create a CSV parser
100
+ ## Output file
101
+ src/parser.py
102
+ ## Language & Runtime
103
+ Python 3.11+
104
+ ## Signatures
105
+ class Parser: ...
106
+ SPEC
107
+
108
+ # Or use a spec file
109
+ journeyman worker --task tasks/01-parser.md --out src/parser.py --stream
110
+ ```
111
+
112
+ ### CLI Options
113
+
114
+ | Flag | Description |
115
+ |---|---|
116
+ | `--task FILE` | Spec file (Markdown), or `-` for stdin |
117
+ | `--out FILE` | Output file path |
118
+ | `--context FILE...` | Read-only context files to inject |
119
+ | `--expect PATTERN` | Regex that must appear in output |
120
+ | `--json-output` | Write JSON result summary to stdout (for agent consumption) |
121
+ | `--stream` | Show output as it is generated (to stderr) |
122
+ | `--lang` | Override auto-detected language (`python`, `javascript`, `typescript`, `bash`) |
123
+ | `--no-validate` | Skip syntax check |
124
+ | `--no-backup` | Overwrite without creating a `.bak` copy |
125
+ | `--timeout SECONDS` | HTTP timeout for model API calls (default: 120) |
126
+ | `--root DIR` | Project root; relative paths resolve from here |
127
+
128
+ ---
129
+
130
+ ## Requirements & Trust
131
+
132
+ - **Python 3.7+** (No external dependencies; standard library only).
133
+ - **Data flow**: If you use a local backend (Ollama/LM Studio), **no data leaves your machine**. If you use a remote fallback, specs and injected context files are sent to that API.
134
+ - **Safety**: `journeyman` performs atomic writes. If a file exists, it automatically creates a `.bak` copy before overwriting.
135
+
136
+ ## Exit Codes
137
+
138
+ Agents rely on strict exit codes to manage the workflow:
139
+
140
+ | Code | Meaning | Agent Action |
141
+ |---|---|---|
142
+ | **0** | Success — validated output written | Review the output |
143
+ | **1** | No code block in response | Tighten spec and retry |
144
+ | **2** | Config, argument, or network error | Do NOT retry; ask user to check setup |
145
+ | **3** | Validation failed after max retries | Fix the file directly |
146
+ | **4** | Stream interrupted | Retry |
147
+ | **5** | `--expect` pattern missing after retries | Tighten expect/signatures; retry |
148
+
149
+ ---
150
+ *License: MIT*
@@ -0,0 +1,136 @@
1
+ # journeyman
2
+
3
+ **Save your frontier tokens for thinking. A local or economical model writes every line of code — and tight specs make small models write it well.**
4
+
5
+ `journeyman` is an Agent Skill designed to plug into **Claude Code**, **Codex CLI**, **Cursor**, **GitHub Copilot**, and **Gemini CLI**. It is built on a simple division of labor:
6
+ 1. **The Frontier Agent (Claude/GPT/Gemini)** acts as the architect. It writes plans, tests, and highly specific per-file specs. It *never* writes the application source code directly.
7
+ 2. **The Worker Model (Local or Low-Cost Remote)** types out the actual code based on those tight specs.
8
+
9
+ By enforcing this contract, you save expensive API tokens on repetitive code generation, and you force small models to generate high-quality code because they are never given vague prompts.
10
+
11
+ ---
12
+
13
+ ## Quick Start
14
+
15
+ ### 1. Install the CLI
16
+
17
+ You can install `journeyman` directly as a Python package from the repository root:
18
+
19
+ ```bash
20
+ git clone <this-repo-url> journeyman
21
+ cd journeyman
22
+ pip install .
23
+ ```
24
+
25
+ Alternatively, you can run `./install.sh` which runs `pip install` and registers the skill for Claude Code under `~/.claude/skills/journeyman`. (Use `./install.sh --copy` for a standalone copy-mode installation.)
26
+
27
+ ### 2. Configure your Worker Model
28
+
29
+ `journeyman` is zero-config if you run a local model server. It automatically detects and connects to **Ollama** (port 11434), **LM Studio** (1234), **llama.cpp**, and **mlx_lm** (8080).
30
+
31
+ If you don't have local hardware, you can fall back to fast, low-cost remote providers:
32
+
33
+ ```bash
34
+ # See all available backends (local and remote)
35
+ journeyman setup --list
36
+
37
+ # Set a preferred remote fallback (requires GROQ_API_KEY in your environment)
38
+ journeyman setup --prefer-remote groq
39
+
40
+ # Or store a key in the config file (mode 0600; env vars still win)
41
+ journeyman setup --set-api-key groq "$GROQ_API_KEY"
42
+ ```
43
+
44
+ ### 3. Integrate with your Agent
45
+
46
+ Journeyman ships with ready-to-paste integration templates. Just copy the contents of the relevant file into your project:
47
+
48
+ | Agent | File to edit | Template to copy |
49
+ |---|---|---|
50
+ | **Claude Code** | `CLAUDE.md` in project root | `templates/CLAUDE.md` |
51
+ | **Codex CLI** | `AGENTS.md` in project root | `templates/AGENTS.md` |
52
+ | **Cursor** (current) | `.cursor/rules/journeyman.mdc` | `templates/journeyman.mdc` |
53
+ | **Cursor** (legacy) | `.cursorrules` in project root | `templates/cursorrules` |
54
+ | **GitHub Copilot** | `.github/copilot-instructions.md` | `templates/copilot-instructions.md` |
55
+ | **Gemini CLI** | `GEMINI.md` in project root | `templates/GEMINI.md` |
56
+
57
+ Once added, just tell your agent: *"Use journeyman to build a CLI todo app."*
58
+
59
+ ---
60
+
61
+ ## How it Works
62
+
63
+ ```text
64
+ you ──"build X"──▶ frontier agent (Claude / Gemini / GPT)
65
+ │ 1. writes architecture and per-file specs
66
+ │ 2. invokes journeyman ──▶ local or economical model
67
+ │ (writes the file)
68
+ │ 3. reviews the code, runs tests
69
+ │ 4. on failure: improves the SPEC and re-delegates
70
+
71
+ working, reviewed code — written locally or via a low-cost remote
72
+ ```
73
+
74
+ The worker script (`journeyman worker`) validates the generated code (Python: `py_compile`; JS: `node --check`; TS: `tsc --noEmit`; Bash: `bash -n`) and handles automatic retries if the local model messes up, before passing control back to the frontier agent for final review.
75
+
76
+ ---
77
+
78
+ ## Manual CLI Usage
79
+
80
+ You can use `journeyman` manually without an agent. The worker takes a markdown spec and outputs a validated file:
81
+
82
+ ```bash
83
+ # Pipe a spec directly (preferred for agents)
84
+ journeyman worker --task - --out src/parser.py --expect 'class Parser' <<'SPEC'
85
+ # Task: Create a CSV parser
86
+ ## Output file
87
+ src/parser.py
88
+ ## Language & Runtime
89
+ Python 3.11+
90
+ ## Signatures
91
+ class Parser: ...
92
+ SPEC
93
+
94
+ # Or use a spec file
95
+ journeyman worker --task tasks/01-parser.md --out src/parser.py --stream
96
+ ```
97
+
98
+ ### CLI Options
99
+
100
+ | Flag | Description |
101
+ |---|---|
102
+ | `--task FILE` | Spec file (Markdown), or `-` for stdin |
103
+ | `--out FILE` | Output file path |
104
+ | `--context FILE...` | Read-only context files to inject |
105
+ | `--expect PATTERN` | Regex that must appear in output |
106
+ | `--json-output` | Write JSON result summary to stdout (for agent consumption) |
107
+ | `--stream` | Show output as it is generated (to stderr) |
108
+ | `--lang` | Override auto-detected language (`python`, `javascript`, `typescript`, `bash`) |
109
+ | `--no-validate` | Skip syntax check |
110
+ | `--no-backup` | Overwrite without creating a `.bak` copy |
111
+ | `--timeout SECONDS` | HTTP timeout for model API calls (default: 120) |
112
+ | `--root DIR` | Project root; relative paths resolve from here |
113
+
114
+ ---
115
+
116
+ ## Requirements & Trust
117
+
118
+ - **Python 3.7+** (No external dependencies; standard library only).
119
+ - **Data flow**: If you use a local backend (Ollama/LM Studio), **no data leaves your machine**. If you use a remote fallback, specs and injected context files are sent to that API.
120
+ - **Safety**: `journeyman` performs atomic writes. If a file exists, it automatically creates a `.bak` copy before overwriting.
121
+
122
+ ## Exit Codes
123
+
124
+ Agents rely on strict exit codes to manage the workflow:
125
+
126
+ | Code | Meaning | Agent Action |
127
+ |---|---|---|
128
+ | **0** | Success — validated output written | Review the output |
129
+ | **1** | No code block in response | Tighten spec and retry |
130
+ | **2** | Config, argument, or network error | Do NOT retry; ask user to check setup |
131
+ | **3** | Validation failed after max retries | Fix the file directly |
132
+ | **4** | Stream interrupted | Retry |
133
+ | **5** | `--expect` pattern missing after retries | Tighten expect/signatures; retry |
134
+
135
+ ---
136
+ *License: MIT*