fix(skills): write BOMs as escape sequences so apm audit stops flagging them #232

Merged
Defame1297 merged 2 commits from fix/apm-hidden-chars-208 into main 2026-11-27 16:18:47 +00:00
Owner

Closes #208

What changed

Every apm install printed apm audit hidden-character warnings for four intentional literal U+FEFF (byte order mark) characters. Each one sits inside a Python string literal, so the fix writes it as the Python escape sequence instead: a backslash followed by ufeff. The same bytes reach Python as before.

File Line Role
plugins/core/.apm/skills/provider-adapter-author/tests/validate-adapter.bats 301, 308 Fixtures that write BOMs (inside python3 -c "...", where bash passes the backslash through)
plugins/kyberforge/.apm/skills/factory-audit/scripts/lib-boundary-resolver.sh 1058 strip_bom (inside a quoted heredoc, read with read -r)
tests/test-adr0020-frontmatter.sh 88 bom fixture: not in the issue's list, found in review, same fix
  • factory-audit is bumped to 1.0.7 (ADR-0022). The provider-adapter-author change is only under tests/, which the bump gate skips.
  • apm audit --strip was deliberately not used, because it would delete the characters these tests and the stripper depend on.

Item 1 (the "parked pending approval" warning)

This warning is harmless, and nothing in this PR changes it. Kyberforge's bin/ contains only README.md, and its one hook (check-apm-current.sh) is deployed byte-identical and executable, with the SessionStart entry present in .claude/settings.json. The finding is recorded on #208.

Verification

  • apm audit --file reports warnings on main and none on this branch. No literal U+FEFF remains under plugins/.
  • The old and new fixture commands produce byte-identical output (cmp). strip_bom still strips exactly one leading BOM.
  • The provider-adapter-author and factory-audit bats suites pass (349 tests), and test-adr0020-frontmatter.sh passes 36/36.
  • The full pre-push gate set passed on push.
  • One clean-context review round found nothing blocking.

After merge

The deployed .claude/skills/ copies keep warning until this reaches main and apm install refreshes (ADR-0019). The stray .claude/worktrees/agent-a7dc0465a8f8b5cfc also holds old copies and will keep warning until someone removes it.

🤖 Generated with Claude Code

https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi

Closes #208 ## What changed Every `apm install` printed `apm audit` hidden-character warnings for four intentional literal U+FEFF (byte order mark) characters. Each one sits inside a Python string literal, so the fix writes it as the Python escape sequence instead: a backslash followed by `ufeff`. The same bytes reach Python as before. | File | Line | Role | |---|---|---| | `plugins/core/.apm/skills/provider-adapter-author/tests/validate-adapter.bats` | 301, 308 | Fixtures that write BOMs (inside `python3 -c "..."`, where bash passes the backslash through) | | `plugins/kyberforge/.apm/skills/factory-audit/scripts/lib-boundary-resolver.sh` | 1058 | `strip_bom` (inside a quoted heredoc, read with `read -r`) | | `tests/test-adr0020-frontmatter.sh` | 88 | `bom` fixture: not in the issue's list, found in review, same fix | - `factory-audit` is bumped to 1.0.7 (ADR-0022). The `provider-adapter-author` change is only under `tests/`, which the bump gate skips. - `apm audit --strip` was deliberately **not** used, because it would delete the characters these tests and the stripper depend on. ## Item 1 (the "parked pending approval" warning) This warning is harmless, and nothing in this PR changes it. Kyberforge's `bin/` contains only `README.md`, and its one hook (`check-apm-current.sh`) is deployed byte-identical and executable, with the `SessionStart` entry present in `.claude/settings.json`. The finding is recorded on #208. ## Verification - `apm audit --file` reports warnings on `main` and none on this branch. No literal U+FEFF remains under `plugins/`. - The old and new fixture commands produce byte-identical output (`cmp`). `strip_bom` still strips exactly one leading BOM. - The provider-adapter-author and factory-audit bats suites pass (349 tests), and `test-adr0020-frontmatter.sh` passes 36/36. - The full pre-push gate set passed on push. - One clean-context review round found nothing blocking. ## After merge The deployed `.claude/skills/` copies keep warning until this reaches `main` and `apm install` refreshes (ADR-0019). The stray `.claude/worktrees/agent-a7dc0465a8f8b5cfc` also holds old copies and will keep warning until someone removes it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
Claude added the Kind/Bug label 2026-11-27 16:01:20 +00:00
Claude added 2 commits 2026-11-27 16:01:20 +00:00
The validate-adapter.bats fixtures and factory-audit's strip_bom held
literal U+FEFF characters, which apm audit reports as hidden characters
on every install. Replace each with the Python backslash-ufeff escape;
behaviour is unchanged (fixtures still emit EF BB BF, all 349 bats tests
pass).

Bump factory-audit to 1.0.7 (ADR-0022); provider-adapter-author's change
is under tests/, which the bump gate ignores.

Refs #208

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
tests/test-adr0020-frontmatter.sh held a literal U+FEFF in its 'bom'
fixture, which apm audit flags as a hidden character. Write it as the
Python backslash-ufeff escape instead; the test still passes (36/36).

Refs #208

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
Defame1297 merged commit 92d39ae1f9 into main 2026-11-27 16:18:47 +00:00
Defame1297 deleted branch fix/apm-hidden-chars-208 2026-11-27 16:18:47 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Holocron#232