Skip to content

feat(validate+watch): H23 bare-sleep rule + watchdog recommendation -- closes #184 #182#186

Merged
tbitcs merged 1 commit into
developfrom
feat/issues-182-184-sleep-rule-watchdog
May 20, 2026
Merged

feat(validate+watch): H23 bare-sleep rule + watchdog recommendation -- closes #184 #182#186
tbitcs merged 1 commit into
developfrom
feat/issues-182-184-sleep-rule-watchdog

Conversation

@tbitcs
Copy link
Copy Markdown
Contributor

@tbitcs tbitcs commented May 20, 2026

Closes #184, closes #182. See commit message for full details. 831 tests passing.
Co-Authored-By: Oz oz-agent@warp.dev

#182

#184 — H23: No Bare Sleep Delays in Scripts
- Add H23 to docs/governance/RULES.md and rules.md.j2 scaffold template
- Add _check_bare_sleep() to validator.py: scans .sh/.ps1/.cmd/.bash
  for bare sleep/Start-Sleep without any loop/retry context (for/while/
  until/max_retries/retry). Flags as a warning; files with loop context
  are exempt (sleep inside a polling loop is intentional).
- Wire into run_validate() alongside _check_blocking_loops()

#182 — watchdog recommendation
- Improve specsmith watch message: shows interval, explains how to add
  watchdog>=4.0 to pyproject.toml [project.optional-dependencies].dev
- Add watchdog>=4.0 to the pyproject.toml.j2 scaffold template so new
  projects get it in their dev extras automatically

Co-Authored-By: Oz <oz-agent@warp.dev>
@tbitcs tbitcs enabled auto-merge (squash) May 20, 2026 19:22
@tbitcs tbitcs merged commit 205c077 into develop May 20, 2026
17 checks passed
@tbitcs tbitcs deleted the feat/issues-182-184-sleep-rule-watchdog branch May 20, 2026 19:23
tbitcs added a commit that referenced this pull request May 21, 2026
* fix(agent/run): silent no-response + provider visibility — closes #186-followup

Root causes of specsmith run returning nothing:
1. DEFAULT_OLLAMA_MODEL=qwen2.5:7b not installed; Ollama 404 silently swallowed
2. run_chat returning None gave user zero feedback
3. EventEmitter always wrote JSONL even in interactive terminal mode

Fixes:
- chat_runner: _pick_ollama_model() queries /api/tags and selects the first
  installed model from a preference list (lighter models first); falls back
  to DEFAULT_OLLAMA_MODEL only when the API is unreachable or list is empty.
  SPECSMITH_OLLAMA_MODEL env var still wins unconditionally.
- runner: _handle_command() prints an actionable hint when run_chat returns
  None — explains whether Ollama is running (with model name) or no provider
  is available at all.
- events: PlainTextEmitter subclass — token() writes raw text to stdout,
  emit() is a no-op. Used by AgentRunner when json_events=False so LLM
  responses render as readable prose instead of JSONL blobs.
- runner: check_providers() probes all four providers (Ollama, Anthropic,
  OpenAI, Gemini) and returns ProviderStatus(name, available, model, note).
- runner: _print_banner() shows a provider status table in interactive mode
  so the user knows upfront which model will respond before typing.
- cli: specsmith run --check validates providers and exits 0/1 without
  starting the REPL.
- run_interactive: adds a trailing newline after each streamed response so
  the next prompt doesn't bleed onto the last output line.

19 new tests in test_agent_run_feedback.py (854 total, 0 failures).

Co-Authored-By: Oz <oz-agent@warp.dev>

* style: ruff format cli.py

Co-Authored-By: Oz <oz-agent@warp.dev>

* style: fix import sort in test_agent_run_feedback.py

Co-Authored-By: Oz <oz-agent@warp.dev>

---------

Co-authored-by: Oz <oz-agent@warp.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant