claw-code/src
YeonGyu-Kim ef432f164e feat: #180 implement --version flag for metadata protocol (#28 proactive demand)
Cycle #28 closes the low-hanging metadata protocol gap identified in #180.

## The Gap

Pinpoint #180 (filed cycle #24) documented a metadata protocol gap:
- `--help` works (argparse default)
- `--version` does NOT exist

The ROADMAP entry deferred implementation pending demand. Cycle #28 dogfood
probe found this during routine invariant audit (attempt to call `--version`
as part of comprehensive CLI surface coverage). This is concrete evidence of
real friction, not speculative gap-filling.

## Implementation

Added `--version` flag to argparse in `build_parser()`:

```python
parser.add_argument('--version', action='version', version='claw-code 1.0.0 (Python harness)')
```

Simple one-liner. Follows Python argparse conventions (built-in action='version').

## Tests Added (3)

TestMetadataFlags in test_exec_route_bootstrap_output_format.py:

1. test_version_flag_returns_version_text — `claw --version` prints version
2. test_help_flag_returns_help_text — `claw --help` still works
3. test_help_still_works_after_version_added — Both -h and --help work

Regression guard on the original help surface.

## Test Status

- 214 → 217 tests passing (+3)
- Zero regressions
- Full suite green

## Discipline

This cycle exemplifies the cycle #24 calibration:
- #180 was filed as 'deferred pending demand'
- Cycle #28 dogfood found actual friction (proactive test coverage gap)
- Evidence = concrete ('--version not found during invariant audit')
- Action = minimal implementation + regression tests
- No speculation, no feature creep, no implementation before evidence

Not 'we imagined someone might want this.' Instead: 'we tried to call it
during routine maintenance, got ENOENT, fixed it.'

## Related

- #180 (cycle #24): Metadata protocol gap filed
- Cycle #27: Cross-channel consistency audit established framework
- Cycle #28 invariant audit: Discovered actual friction, triggered fix

---

Classification (per cycle #24 calibration):
- Red-state bug? ✗ (not a malfunction, just an absence)
- Real friction? ✓ (audit probe could not call the flag, had to special-case)
- Evidence-backed? ✓ (proactive test coverage revealed the gap)

Source: Jobdori cycle #28 dogfood — invariant audit attempting comprehensive
CLI surface coverage found that --version was unsupported.
2026-04-30 11:03:06 +09:00
..
assistant chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
bootstrap chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
bridge chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
buddy chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
cli chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
components chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
constants chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
coordinator chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
entrypoints chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
hooks chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
keybindings chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
memdir chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
migrations chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
moreright chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
native_ts chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
outputStyles chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
plugins chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
reference_data Make the repository's primary source tree genuinely Python 2026-03-31 07:17:34 -07:00
remote chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
schemas chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
screens chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
server chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
services chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
skills chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
state chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
types chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
upstreamproxy chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
utils chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
vim chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
voice chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
QueryEngine.py Make the repository's primary source tree genuinely Python 2026-03-31 07:17:34 -07:00
Tool.py Make the repository's primary source tree genuinely Python 2026-03-31 07:17:34 -07:00
__init__.py feat(#160): wire claw list-sessions and delete-session CLI commands 2026-04-30 11:03:06 +09:00
_archive_helper.py chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
bootstrap_graph.py Rewriting Project Claw Code - Python port with Rust on the way 2026-03-31 08:16:20 -07:00
command_graph.py Rewriting Project Claw Code - Python port with Rust on the way 2026-03-31 08:16:20 -07:00
commands.py Rewriting Project Claw Code - Python port with Rust on the way 2026-03-31 08:16:20 -07:00
context.py Rewriting Project Claw Code - Python port with Rust on the way 2026-03-31 08:16:20 -07:00
costHook.py Make the repository's primary source tree genuinely Python 2026-03-31 07:17:34 -07:00
cost_tracker.py Make the repository's primary source tree genuinely Python 2026-03-31 07:17:34 -07:00
deferred_init.py Rewriting Project Claw Code - Python port with Rust on the way 2026-03-31 08:16:20 -07:00
dialogLaunchers.py Make the repository's primary source tree genuinely Python 2026-03-31 07:17:34 -07:00
direct_modes.py Rewriting Project Claw Code - Python port with Rust on the way 2026-03-31 08:16:20 -07:00
execution_registry.py Rewriting Project Claw Code - Python port with Rust on the way 2026-03-31 08:16:20 -07:00
history.py Rewriting Project Claw Code - Python port with Rust on the way 2026-03-31 08:16:20 -07:00
ink.py Make the repository's primary source tree genuinely Python 2026-03-31 07:17:34 -07:00
interactiveHelpers.py Make the repository's primary source tree genuinely Python 2026-03-31 07:17:34 -07:00
main.py feat: #180 implement --version flag for metadata protocol (#28 proactive demand) 2026-04-30 11:03:06 +09:00
models.py Rewriting Project Claw Code - Python port with Rust on the way 2026-03-31 08:16:20 -07:00
parity_audit.py Make the repository's primary source tree genuinely Python 2026-03-31 07:17:34 -07:00
permissions.py Rewriting Project Claw Code - Python port with Rust on the way 2026-03-31 08:16:20 -07:00
port_manifest.py Make the repository's primary source tree genuinely Python 2026-03-31 07:17:34 -07:00
prefetch.py Rewriting Project Claw Code - Python port with Rust on the way 2026-03-31 08:16:20 -07:00
projectOnboardingState.py Make the repository's primary source tree genuinely Python 2026-03-31 07:17:34 -07:00
query.py Make the repository's primary source tree genuinely Python 2026-03-31 07:17:34 -07:00
query_engine.py feat: #164 Stage B prep — add cancel_observed field to TurnResult 2026-04-30 11:03:06 +09:00
remote_runtime.py Rewriting Project Claw Code - Python port with Rust on the way 2026-03-31 08:16:20 -07:00
replLauncher.py Make the repository's primary source tree genuinely Python 2026-03-31 07:17:34 -07:00
runtime.py feat: #164 Stage B prep — add cancel_observed field to TurnResult 2026-04-30 11:03:06 +09:00
session_store.py fix(#160): harden delete_session contract — idempotency, race-safety, typed partial-failure 2026-04-30 11:03:06 +09:00
setup.py Rewriting Project Claw Code - Python port with Rust on the way 2026-03-31 08:16:20 -07:00
system_init.py Rewriting Project Claw Code - Python port with Rust on the way 2026-03-31 08:16:20 -07:00
task.py Make the repository's primary source tree genuinely Python 2026-03-31 07:17:34 -07:00
tasks.py Make the repository's primary source tree genuinely Python 2026-03-31 07:17:34 -07:00
tool_pool.py Rewriting Project Claw Code - Python port with Rust on the way 2026-03-31 08:16:20 -07:00
tools.py Rewriting Project Claw Code - Python port with Rust on the way 2026-03-31 08:16:20 -07:00
transcript.py Rewriting Project Claw Code - Python port with Rust on the way 2026-03-31 08:16:20 -07:00