Skip to content

Enforce effect-system philosophy across codebase#487

Merged
proboscis merged 3 commits into
mainfrom
refactor/effect-philosophy-violations
Jul 8, 2026
Merged

Enforce effect-system philosophy across codebase#487
proboscis merged 3 commits into
mainfrom
refactor/effect-philosophy-violations

Conversation

@proboscis

Copy link
Copy Markdown
Owner

Summary

  • writer/slog_handler: Convert from factory pattern to pre-installed handlers using lazy state init (Get/Put + Some). Remove .log side-channel entirely — replaced with writer_log()/slog_log() effect-system-native helpers that return frozen copies
  • ShellRun effect: New ShellRun effect + ShellRunResult + production shell-run-handler as the IO boundary for subprocess execution. Handlers yield effects instead of calling subprocess.run directly
  • Handler conversions: docker-build-handler, image-push-handler, rsync-handler, write-file-handler, docker-run-handler all yield ShellRun now
  • ExecResult: Added output field, removed sys.stdout.write bypass — callers decide what to do with output
  • 59 files updated: factory calls (writer()writer, slog_handler()slog_handler), .log access removal, WithHandler usage fixes, documentation updates

Test plan

  • 530 tests pass (2 pre-existing failures unrelated: CreateWorkspace NameError)
  • All Hy modules compile and import correctly (doeff_docker, doeff_ml_nexus)
  • ml_nexus_interpreter full stack import verified
  • Traverse tests (non-sim_time) pass after WithHandler → direct call fix

🤖 Generated with Claude Code

proboscis and others added 3 commits July 8, 2026 23:43
Remove 3 obsolete docs (cache.md, 08-graph-tracking.md, 22-with-intercept.md)
whose APIs are entirely _Removed. Fix AGENTS.md project structure (referenced
non-existent core.py, interpreter.py, effects/, handlers/, utils.py, types.py,
cache.py). Fix README.md build command (uv sync → make sync) and mark deprecated
CLI flags. Rewrite docs/13-api-reference.md to match current run(doexpr) single-arg
API, correct handler composition, and remove deleted APIs. Update docs/index.md
Quick Example and Effect Reference. Record remaining ~20 stale files in
documentation-fix-table.md with priority and replacement guide.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update 39 files across tutorials (01-09), advanced docs (11-22),
design docs, proposals, specs, positioning materials, and integration
guides. Key changes applied throughout:

- default_handlers() → individual handler composition
- run(prog, handlers=..., env=...) → run(doexpr) single-arg
- RunResult/.value/.is_ok() → run() returns raw value
- async_run() → run(scheduled(prog))
- Modify → Get + Put
- WithIntercept → WithObserve(observer, body)
- KleisliProgram/Call → @Do returns Callable, produces Expand
- task.cancel() → yield Cancel(task)
- Gather(*programs) → Spawn first, then Gather(*tasks)
- LLMStructuredOutput → LLMStructuredQuery
- Sleep → ClockSleep in doeff_agents

No from-doeff-import of deleted APIs remains in any docs/ file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…IO in handlers

- Convert writer/slog_handler from factories to pre-installed handlers
  using lazy state init (Get/Put + Some), removing .log side-channel
- Add writer_log()/slog_log() @Do helpers to read log through effects
- Add ShellRun effect + ShellRunResult + shell-run-handler as IO boundary
  for subprocess execution — handlers yield effects, not call subprocess
- Convert docker-build-handler, image-push-handler, rsync-handler,
  write-file-handler, docker-run-handler to yield ShellRun
- Add output field to ExecResult, remove sys.stdout.write bypass
- Fix 59 files: factory calls, .log access, WithHandler usage, docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@proboscis
proboscis merged commit 9365d46 into main Jul 8, 2026
1 check passed
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