Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ project is tagged; between releases, entries are dated and `main` moves.

## [Unreleased]

## [2.0.3] — 2026-10-19

Patch release: the Windows suite goes green. The v2.0.2 install path was
correct on POSIX, but Windows exposed two failures the matrix caught after
the release was tagged: `--help` crashed under the cp1252 pipe encoding, and
a test tried to execute the launcher as a native program, which Windows
cannot do.

### Fixed

- **CLI output is UTF-8 even when Windows redirects it.** A pipe inherits
the locale code page, and `print(__doc__)` raised `UnicodeEncodeError` on
the help arrow before it could print a line. `main` now reconfigures
stdout and stderr where the stream supports it, so help text, JSON with
`ensure_ascii=False`, and error messages survive a redirect on a
non-UTF-8 Windows console.
- **The bare-launcher test is POSIX-only.** Windows has no exec bit and
`CreateProcess` cannot run a `.py` file without a registered association.
The portable spelling — `python3 <skill-base-dir>/scripts/executor` —
remains the tested, documented form on every platform.

## [2.0.2] — 2026-10-19

Patch release: the engine ships with the skill. Installing the skills used
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ cp -R executor/skills/* <your-agents-skills-dir>/
Pin to a release tag instead of `main` for stability:

```bash
git clone --branch v2.0.2 git@github.com:Atri10/executor.git
git clone --branch v2.0.3 git@github.com:Atri10/executor.git
```

There are no dependencies to install: the engine is the standard library,
Expand Down Expand Up @@ -116,7 +116,7 @@ Install The Executor skill library for me:
The engine ships inside skills/executor/scripts/lib/, so copy the whole
directory — do not copy only the .md files.
4. Verify: run python3 <skills-dir>/executor/scripts/executor --version
(prints 2.0.2), then python3 <skills-dir>/executor/scripts/executor
(prints 2.0.3), then python3 <skills-dir>/executor/scripts/executor
--help (lists the command surface). Do not set PYTHONPATH and do not
install a package: the launcher carries its engine. Also confirm every
copied skills/<name>/ directory contains a SKILL.md — count the
Expand Down Expand Up @@ -572,7 +572,7 @@ flowchart TD
| Path | What it is |
|---|---|
| `engine/executor/` | the engine source: `cli.py`, `engine.py`, `schemas.py`, `paths.py`, `store.py`, `views.py`, `policy.py` |
| `engine/tests/` | the suite (739 tests), including the tree-walking contract tests |
| `engine/tests/` | the suite (741 tests), including the tree-walking contract tests |
| `skills/executor/` | the router skill, its prompt templates, the references, and the engine that ships with it |
| `skills/executor/scripts/executor` | the launcher; resolves `scripts/lib/executor/` relative to itself |
| `skills/executor/scripts/lib/executor/` | the installed engine — a generated mirror of `engine/executor/` |
Expand Down
2 changes: 1 addition & 1 deletion engine/executor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Executor v2 engine — single-writer, typed-payload, event-sourced.
#
# Public surface is the CLI in executor.cli; this package is the kernel.
__version__ = "2.0.2"
__version__ = "2.0.3"
SCHEMA_VERSION = "v1"
STORE_VERSION = "v1"
12 changes: 12 additions & 0 deletions engine/executor/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ def _emit(obj) -> None:
print(json.dumps(obj, indent=2, ensure_ascii=False))


def _utf8_stdio() -> None:
"""The engine is UTF-8 end to end, but a Windows pipe inherits the
locale code page and `print` raises on the first arrow or non-Latin
title. Reconfigure where the stream allows it; in-process test doubles
do not."""
for stream in (sys.stdout, sys.stderr):
reconfigure = getattr(stream, "reconfigure", None)
if reconfigure is not None:
reconfigure(encoding="utf-8")


def _err(e: ExecError | Rejection) -> int:
if isinstance(e, Rejection):
print(json.dumps({"rejected": e.to_dict()}, indent=2), file=sys.stderr)
Expand Down Expand Up @@ -230,6 +241,7 @@ def cmd_migrate(args: list[str]) -> int:


def main(argv: list[str]) -> int:
_utf8_stdio()
if len(argv) < 2 or argv[1] in ("-h", "--help", "help"):
print(__doc__)
return 0
Expand Down
20 changes: 20 additions & 0 deletions engine/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,26 @@ def test_importing_the_package_entry_does_not_run_it(self):
self.assertTrue(hasattr(module, "main"))


class Stdio(unittest.TestCase):
"""Windows pipes use the locale code page, which cannot encode the help
arrow or a non-Latin title; the streams are reconfigured to UTF-8 where
they support it."""

def test_a_stream_that_can_reconfigure_is_switched_to_utf8(self):
fake = mock.Mock()
with mock.patch.object(cli.sys, "stdout", fake), \
mock.patch.object(cli.sys, "stderr", io.StringIO()):
cli._utf8_stdio()
fake.reconfigure.assert_called_once_with(encoding="utf-8")

def test_a_stream_without_reconfigure_is_left_alone(self):
out = io.StringIO()
with mock.patch.object(cli.sys, "stdout", out), \
mock.patch.object(cli.sys, "stderr", out):
cli._utf8_stdio()
self.assertEqual(out.getvalue(), "")


class NewCommand(CliCase):
def test_new_creates_an_initiative_through_the_engine(self):
code, out, _ = self.cli("new", "Mobility", "exam", "portal")
Expand Down
3 changes: 3 additions & 0 deletions engine/tests/test_engine_ships_with_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ def test_a_full_command_runs_in_a_fresh_git_repo(self):
self.assertEqual(status.returncode, 0, status.stderr)
self.assertIn("INIT-0001", status.stdout)

@unittest.skipIf(os.name == "nt",
"Windows has no exec bit; the python3 spelling is the "
"portable one")
def test_the_exec_bit_runs_it_directly(self):
"""Where the exec bit survived the copy, the bare form works."""
proc = subprocess.run(
Expand Down
2 changes: 1 addition & 1 deletion skills/executor/scripts/lib/executor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Executor v2 engine — single-writer, typed-payload, event-sourced.
#
# Public surface is the CLI in executor.cli; this package is the kernel.
__version__ = "2.0.2"
__version__ = "2.0.3"
SCHEMA_VERSION = "v1"
STORE_VERSION = "v1"
12 changes: 12 additions & 0 deletions skills/executor/scripts/lib/executor/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ def _emit(obj) -> None:
print(json.dumps(obj, indent=2, ensure_ascii=False))


def _utf8_stdio() -> None:
"""The engine is UTF-8 end to end, but a Windows pipe inherits the
locale code page and `print` raises on the first arrow or non-Latin
title. Reconfigure where the stream allows it; in-process test doubles
do not."""
for stream in (sys.stdout, sys.stderr):
reconfigure = getattr(stream, "reconfigure", None)
if reconfigure is not None:
reconfigure(encoding="utf-8")


def _err(e: ExecError | Rejection) -> int:
if isinstance(e, Rejection):
print(json.dumps({"rejected": e.to_dict()}, indent=2), file=sys.stderr)
Expand Down Expand Up @@ -230,6 +241,7 @@ def cmd_migrate(args: list[str]) -> int:


def main(argv: list[str]) -> int:
_utf8_stdio()
if len(argv) < 2 or argv[1] in ("-h", "--help", "help"):
print(__doc__)
return 0
Expand Down
Loading