EntryScripts#entries classifies by absolute path, so a root under a hooks directory marks every script as a hook #1427

Open
opened 2026-10-27 17:04:38 +00:00 by jared · 0 comments
Owner

Problem

Extractor::EntryScripts#entries (shipped in #1405) decides kind hook by path.include?("/hooks/") on the absolute path. A project root such as /home/x/hooks/myproj makes every bin/* script a hook. The kind must come from the path relative to the root: bin/ is bin, hooks/ is hook.

Reproduce

ruby -Iplugins/os-sdlc/lib -e 'require "os_sdlc"; p OsSdlc::SystemModel::Extractor::EntryScripts.new("/tmp/hooks/demo").entries.map(&:kind)'

with /tmp/hooks/demo/bin/run a Ruby script. Output: ["hook"]; expected ["bin"].

Approach

Classify the kind from the path relative to @root.

Required work:

  1. Classify the kind from the path relative to @root — check: absent include?("/hooks/") in plugins/os-sdlc/lib/os_sdlc/system_model/extractor/entry_scripts.rb

Acceptance criteria

  1. Given a root whose absolute path contains /hooks/ and a Ruby script under bin/, when entries are read, then its kind is bin.
  2. Given the same root and a Ruby script under hooks/, when entries are read, then its kind is hook.

Owner sketch

class OsSdlc::SystemModel::Extractor::EntryScripts
  def entries; end
end

Origin

  • Trigger: /os-sdlc:implement 1405, implementation 186, contract-auditor dispatch 1666 GAP
  • Improvised this session: none
  • Chain: wrong kind for roots under a hooks directory ← kind read from the absolute path ← DESIGN (ticket #1405 Approach said "hook for hooks/*" without naming the relative path)
  • Root candidate: none found; searched EntryScripts, entry kind, hooks path, coverage report
  • Where: plugins/os-sdlc/lib/os_sdlc/system_model/extractor/entry_scripts.rb:16
  • Session: 47f54f99-e35c-4567-a3e6-581fecf54dc3
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/47f54f99-e35c-4567-a3e6-581fecf54dc3.jsonl

VERDICT: CREATE

## Problem `Extractor::EntryScripts#entries` (shipped in #1405) decides kind `hook` by `path.include?("/hooks/")` on the absolute path. A project root such as `/home/x/hooks/myproj` makes every `bin/*` script a `hook`. The kind must come from the path relative to the root: `bin/` is `bin`, `hooks/` is `hook`. ## Reproduce ``` ruby -Iplugins/os-sdlc/lib -e 'require "os_sdlc"; p OsSdlc::SystemModel::Extractor::EntryScripts.new("/tmp/hooks/demo").entries.map(&:kind)' ``` with `/tmp/hooks/demo/bin/run` a Ruby script. Output: `["hook"]`; expected `["bin"]`. ## Approach Classify the kind from the path relative to `@root`. Required work: 1. Classify the kind from the path relative to `@root` — check: absent `include?("/hooks/")` in `plugins/os-sdlc/lib/os_sdlc/system_model/extractor/entry_scripts.rb` ## Acceptance criteria 1. Given a root whose absolute path contains `/hooks/` and a Ruby script under `bin/`, when entries are read, then its kind is `bin`. 2. Given the same root and a Ruby script under `hooks/`, when entries are read, then its kind is `hook`. ## Owner sketch ```ruby class OsSdlc::SystemModel::Extractor::EntryScripts def entries; end end ``` ## Origin - Trigger: /os-sdlc:implement 1405, implementation 186, contract-auditor dispatch 1666 GAP - Improvised this session: none - Chain: wrong kind for roots under a hooks directory ← kind read from the absolute path ← DESIGN (ticket #1405 Approach said "hook for hooks/*" without naming the relative path) - Root candidate: none found; searched EntryScripts, entry kind, hooks path, coverage report - Where: plugins/os-sdlc/lib/os_sdlc/system_model/extractor/entry_scripts.rb:16 - Session: 47f54f99-e35c-4567-a3e6-581fecf54dc3 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/47f54f99-e35c-4567-a3e6-581fecf54dc3.jsonl VERDICT: CREATE
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#1427
No description provided.