Port: port/pr-17-extend-scanner-lang-support#3
Conversation
Adds Flutter-critical languages (Kotlin, Swift, Objective-C) plus common gaps (C++ variants, C#, Ruby, PHP, Lua, Vue, Svelte, HTML, Protobuf, GraphQL, Terraform, shell variants) to both extension sets. Also brings src/tracker/token-estimator.ts CODE_EXTS back in sync with src/scanner/anatomy-scanner.ts CODE_EXTENSIONS — the two sets had drifted apart since only CODE_EXTENSIONS gets the .dart addition from #10. Adds a one-line "Keep in sync with ..." comment above each so future additions hit both places. These sets control the chars-per-token ratio (3.5 for code vs 3.75 fallback) used by estimateTokens; the net effect is ~7% more accurate token accounting in anatomy.md and detectContentType() consumers for projects written in these languages.
|
Here's my review of PR #3: PR #3 — Port: Extend Scanner Language SupportStatus: DRAFT | Lines: +16 / -2
|
…HTML ratio Addresses two PR review findings: WR-01 — Eliminate duplicate parallel Sets Both `anatomy-scanner.ts` and `token-estimator.ts` maintained byte-for-byte identical `CODE_EXTENSIONS`/`CODE_EXTS` sets linked only by a "Keep in sync" comment — an unenforceable convention that would silently produce divergent token-ratio behaviour the moment a future contributor updated one file and missed the other. Extract to `src/utils/extensions.ts` as a single source of truth and import from both consumers. WR-02 — Remove .html/.htm from CODE_EXTENSIONS HTML is markup with prose content and attribute text; classifying it as `code` applies a 3.5 chars/token ratio that consistently under-counts tokens, risking budget overruns. Dropping .html/.htm from CODE_EXTENSIONS lets them fall through to the default `mixed` ratio (3.75), which is more accurate. A comment in extensions.ts records the rationale.
|
✅ Autofixer applied. Build and tests passed. Promoting to Ready for Review. |
- isOpenWolfHook: check _managedBy as primary signal, path substring as backward-compat fallback for pre-tag installs - Add comment documenting that _managedBy is empirically observed passthrough, not a guaranteed Claude Code field (Warning #2) - Add comment in replaceOpenWolfHooks documenting co-location assumption: one inner hook per outer entry unsupported (Warning #1) - Reformat HOOK_SETTINGS to multi-line expanded style, respects 80-char line length rule (Info #4) - Code duplication between init.ts and update.ts already resolved by prior extraction to hook-settings.ts (Info #3) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* init/update: tag hook entries with _managedBy: "openwolf" Adds `_managedBy: "openwolf"` to every hook object in `HOOK_SETTINGS` so Claude Code's settings round-tripper recognizes them as third-party managed entries and preserves them through `/effort`, `/config`, and similar rewrites. Without the tag, entries get silently dropped: a working OpenWolf install can be de-wired by typing `/effort medium` once, since Claude Code's merge logic only preserves entries it recognizes as owned (claude-hooks uses the same field, for example). Also tightens `replaceOpenWolfHooks` to recognize the new tag in addition to the legacy `.wolf/hooks/` substring — defensive against future path schema changes, and keeps the dedupe correct for installs upgrading from a pre-tag version. The two changes are minimal and backward-compatible: untagged entries from older installs still match the substring fallback, so upgrades clean up cleanly. New installs get tagged from the start. Fixes cytostack#31. * fix(hook-settings): address PR #8 review comments - isOpenWolfHook: check _managedBy as primary signal, path substring as backward-compat fallback for pre-tag installs - Add comment documenting that _managedBy is empirically observed passthrough, not a guaranteed Claude Code field (Warning #2) - Add comment in replaceOpenWolfHooks documenting co-location assumption: one inner hook per outer entry unsupported (Warning #1) - Reformat HOOK_SETTINGS to multi-line expanded style, respects 80-char line length rule (Info #4) - Code duplication between init.ts and update.ts already resolved by prior extraction to hook-settings.ts (Info #3) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: ManniX-ITA <20623405+mann1x@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Ported from upstream cytostack/openwolf. Needs review before merge.