Skip to content

Read manifest preferences as UTF-8 - #219

Merged
savvides merged 2 commits into
mainfrom
cursor/preamble-prefs-utf8-d497
Nov 24, 2026
Merged

savvides merged 2 commits into
mainfrom
cursor/preamble-prefs-utf8-d497

Conversation

@savvides

Copy link
Copy Markdown
Owner

Summary

The preamble preferences block opened .idstack/project.json with the locale encoding. With LC_ALL=C and PYTHONUTF8=0, that encoding is ASCII. A UTF-8 course name (for example Café) then made json.load raise UnicodeDecodeError. The block hides the error (except Exception: pass and 2>/dev/null), so verbosity, export_format, preferred_lms and auto_advance_pipeline never printed. The block now opens the file as UTF-8.

scripts/idstack-gen-skills regenerated each skills/*/SKILL.md. The ste-core block did not change, and extension/shared/ste-rules.js is unchanged.

No minor findings. No issue opened. This pull request does not close an issue.

Tests

Before the fix, ./test/test-preamble-python.sh on Python 3.12.3:

PASS: extracted a non-empty preferences block
FAIL: preferences survive a non-ASCII manifest when the locale is ASCII (expected exit 0, got 1)
FAIL: export format survives a non-ASCII manifest when the locale is ASCII (expected exit 0, got 1)
FAIL: preferred LMS survives a non-ASCII manifest when the locale is ASCII (expected exit 0, got 1)
FAIL: auto-advance survives a non-ASCII manifest when the locale is ASCII (expected exit 0, got 1)
Results: 7/11 passed, 4 failed

After the fix, same interpreter:

./test/test-preamble-python.sh
Results: 11/11 passed, 0 failed
EXIT:0

python3 test/test-ste-check.py
Ran 38 tests in 2.944s
OK
EXIT:0

scripts/idstack-gen-skills --dry-run
The script examined 16 templates. 0 have problems.
EXIT:0
  • scripts/idstack-gen-skills --dry-run is clean
  • ./test/smoke-test.sh (not run)
  • ./test/integration-test.sh (not run)
  • Deferred findings have their own issue (none deferred)
Open in Web Open in Cursor 

cursoragent and others added 2 commits November 23, 2026 20:35
The preferences block opened project.json with the locale encoding.
Under an ASCII locale a non-ASCII course name raised UnicodeDecodeError,
and the block hid the error, so the known preference lines never printed.

Co-authored-by: Philippos Savvides <savvides@users.noreply.github.com>
…t-design

Review of #219: the same locale-encoding read was in three other inline
manifest reads. start reported a valid non-ASCII manifest as invalid;
course-import and assessment-design printed an empty MANIFEST_UPDATED, so
the merge silently dropped --expect-updated. A smoke check now fails on any
inline open() of .idstack/project.json without an encoding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
savvides added a commit that referenced this pull request Nov 23, 2026
…objectives (#226)

Matches #219's smoke check for inline manifest reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@savvides

Copy link
Copy Markdown
Owner Author

Review (Claude Code):

  • The preamble fix is correct. The new test fails without it (7/11) and passes with it (11/11) on macOS python3 too.
  • Fixed (fd2c918): three other inline manifest reads opened .idstack/project.json with the locale encoding. /idstack:start reported a valid non-ASCII manifest as MANIFEST_INVALID. course-import and assessment-design printed an empty MANIFEST_UPDATED, so the merge silently dropped --expect-updated. All three now pass encoding="utf-8"; SKILL.md regenerated.
  • Added: a smoke check that fails on any inline open(".idstack/project.json") with no encoding, in the preamble or a skill template (tested against both quote styles). CLAUDE.md smoke count 695 → 696. CHANGELOG entry rewritten to cover all four reads and pass ASD-STE100.
  • Note for merge order: Pass --expect-updated from needs-analysis and learning-objectives #232 adds four more MANIFEST_UPDATED reads without an encoding; the new smoke check fails on them after this lands. Its review session has been told.

Local: smoke 696/696, integration 81/81, zsh 275/275, preamble-python 11/11, check-doc-accuracy OK, gen-skills --dry-run clean. CI: all green except mutation (still running).

@savvides
savvides merged commit a699101 into main Nov 24, 2026
7 checks passed
@savvides
savvides deleted the cursor/preamble-prefs-utf8-d497 branch November 24, 2026 02:03
savvides added a commit that referenced this pull request Nov 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants