Run os-aidd-lint hook and CLI tests in-process #1334
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1334
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The os-aidd-lint hooks
post_tool_use(10 tests),session_start(4), andsession_end(4) have a top-leveldef main.HookInput.readreads$stdin. Tests can only start them as subprocesses.aidd_lint_testalso spawns the CLI once. About 1.5 s of the 2.4 s suite goes to spawns.Approach
Extract each hook body into a class with an injectable stdin, for example
AiddLint::Hooks::PostToolUse#run(invocation). The hook script calls the class. Convert theaidd_lint_testspawn toAiddLint::CLI.new(invocation).run(argv).Behavior is unchanged. The existing suite is the proof. Each bin or hook keeps exactly one smoke test, in a file named
<bin>_bin_smoke_test.rb. The smoke test runs it as a subprocess to prove the plain-ruby boot and the shebang. Calls to external tools (git, rubocop) stay as subprocess calls.Required work:
AiddLint::Hooks::PostToolUse,AiddLint::Hooks::SessionStart, andAiddLint::Hooks::SessionEndfrom the hook scripts.aidd_lint_testto call the classes andAiddLint::CLI.<bin>_bin_smoke_test.rbfile per hook and for the CLI.Acceptance criteria
*_bin_smoke_test.rbfile starts a pluginbin/orhooks/script as a subprocess.--helpor on empty valid input.runis called, then it gives the same output as the hook script did.Owner sketch
AiddLint::Hooks::PostToolUse#run(invocation)andAiddLint::CLI.new(invocation).run(argv).Origin
ruby plugins/os-sdlc/tests/all.rbtook 65.8 s against a 60 s budget. About 70% of summed test time is tests that start our own bin scripts with Open3.jared referenced this issue2026-10-25 19:49:02 +00:00
Work started in /os-sdlc:fast-batch fast-batch-15, branch fast-batch-15.
Resolution
Done: os-aidd-lint hook bodies moved to AiddLint::Hooks classes with an injected Invocation; tests in-process; a missing cwd warns and exits 0 as before (R12).
Evidence: Finding F
a7e0ae2e,605b77d9; fixes R12784126ce, R171ae9c537. Suites atc9f5db8f: os-sdlc 2701 runs 0 failures (53.1 s, budget 60 s), os 47, os-backlog 327, os-aidd-lint 491, os-adr 111, os-me 399, cc-architect plugin_config 106, all green. Merged to mainc9f5db8f, pushedbe5d2c5d. Batch state and rulings: docs/crc/os-sdlc/fast-batch-15/.Follow-ups: #1337 (cop). Nothing else.