Skip to content

Port: port/pr-10-main#1

Merged
briansumma merged 1 commit into
mainfrom
port/pr-10-main
May 14, 2026
Merged

Port: port/pr-10-main#1
briansumma merged 1 commit into
mainfrom
port/pr-10-main

Conversation

@briansumma
Copy link
Copy Markdown
Collaborator

Ported from upstream cytostack/openwolf. Needs review before merge.

@briansumma
Copy link
Copy Markdown
Collaborator Author

PR #1 Review — Port: port/pr-10-main

Status: Draft | Author: Brian Summa | Ported from: cytostack/openwolf


Overview

This is a one-line change that adds .dart to the CODE_EXTENSIONS set in src/scanner/anatomy-scanner.ts. When recognized as a code file, Dart source files will:

  1. Use the code token ratio (3.5 chars/token) instead of the default fallback (3.75) during token estimation
  2. Be scanned and described in .wolf/anatomy.md output

Code Quality & Style ✅

  • The change is minimal and surgical — exactly the right scope.
  • Consistent with the existing formatting of the CODE_EXTENSIONS set.
  • No logic is altered; this is purely additive.

Correctness ✅

  • .dart is the correct and only standard source extension for Dart.
  • The 3.5 chars/token ratio is reasonable for Dart — it's a C-style language with similar density to TypeScript/Java already in the set.
  • No other extensions are needed (.dart.snapshot is a compiled binary artifact and belongs in BINARY_EXTENSIONS if anything, but it's not commonly seen in repos).

Potential Issues

  • No test coverage — The CODE_EXTENSIONS set doesn't appear to have dedicated unit tests for membership. That's a pre-existing gap, not introduced here; no action needed for this PR.
  • Missing from BINARY_EXTENSIONS? — Generated Dart files (.dart.snapshot, .dill) could theoretically appear in repos. These aren't covered by any current set, meaning they'd fall through to the default token ratio. Low risk, pre-existing gap, out of scope for this PR.

Security ✅

No security concerns. This is a read-side extension classification only.


Verdict

Approve to merge. The change is correct, minimal, and well-scoped. No blocking issues.

One optional suggestion before merging: bump the draft status to "Ready for review" once you've confirmed this ports cleanly from upstream and the .dart addition was intentional (not just noise from the upstream diff).

@briansumma briansumma marked this pull request as ready for review May 14, 2026 20:17
@briansumma briansumma merged commit 5acfc30 into main May 14, 2026
@briansumma briansumma deleted the port/pr-10-main branch May 14, 2026 20:19
briansumma added a commit that referenced this pull request May 14, 2026
- 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>
briansumma added a commit that referenced this pull request May 14, 2026
* 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>
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