Skip to content

The meta-skill that builds and improves all your skills, including itself. Watches your work sessions (autonomous or human-led), captures patterns, corrections and judgement calls, and turns them into skill improvements and new skill candidates for your review. Practical application of the Augmented Expertise methodology. Open source: CC BY 4.0.

Validator: reach a verdict when the console cannot encode output

Eoghan Henn0bc5e732664c
diff --git a/references/migration.md b/references/migration.md
index 747b260..4aa408e 100644
--- a/references/migration.md
+++ b/references/migration.md
@@ -50,6 +50,9 @@ the counter continues from where the single-file log left off.
## Procedure
Run from the workspace folder. Python 3.8+, no dependencies.
+`<skill directory>` below is the installed skill's own directory (the one
+holding `SKILL.md`); where `python3` is not a real interpreter (on Windows
+it can be the Microsoft Store alias), use `py -3`.
1. **Make sure nothing else is writing.** Close parallel sessions and
check for a scheduled review due in the next hour. The conversion
@@ -70,9 +73,9 @@ Run from the workspace folder. Python 3.8+, no dependencies.
you do not intend to convert:
```bash
- python3 scripts/migrate-log.py --check skill-observations/log.md
+ python3 "<skill directory>/scripts/migrate-log.py" --check skill-observations/log.md
find skill-observations/archive -maxdepth 1 -name '*.md' -exec \
- python3 scripts/migrate-log.py --check {} +
+ python3 "<skill directory>/scripts/migrate-log.py" --check {} +
```
Two invocations rather than one glob: the archive directory may not
@@ -105,7 +108,7 @@ Run from the workspace folder. Python 3.8+, no dependencies.
5. **Convert the live log:**
```bash
- python3 scripts/migrate-log.py --convert skill-observations/log.md \
+ python3 "<skill directory>/scripts/migrate-log.py" --convert skill-observations/log.md \
--out skill-observations/observation-log \
--id-floor-from skill-observations/archive \
--overrides overrides.json
diff --git a/scripts/validate-skill-bundle.py b/scripts/validate-skill-bundle.py
index 3c3adfc..fa9fcff 100644
--- a/scripts/validate-skill-bundle.py
+++ b/scripts/validate-skill-bundle.py
@@ -800,6 +800,15 @@ def check_bundle(path, fails):
def main(argv):
+ # A console or pipe whose code page cannot encode a character this script
+ # prints (U+2014 under cp949 or cp932) would raise UnicodeEncodeError and
+ # exit 1 with no verdict, the code a failed gate uses. Replace instead.
+ for stream in (sys.stdout, sys.stderr):
+ if hasattr(stream, "reconfigure"):
+ try:
+ stream.reconfigure(errors="replace")
+ except (ValueError, AttributeError):
+ pass
if len(argv) < 2:
print(__doc__); return 2
if argv[1] == "--selftest":