Run os-sdlc CLI and other spawning tests in-process #1331
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#1331
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
Many os-sdlc tests outside
tests/crc/andtests/detector/still start our own bin scripts with Open3. This slows the suite, which runs 65.8 s against a 60 s budget. Some bins have no callable entry:bin/lint-concept-cycleshas an inline body, anddup-sweepanddead-code-sweepdefine a class inside the bin file.Approach
Call the in-process entry for each bin:
lint_sweep_test:OsSdlc::Lint::Sweeping.run(argv:, cwd:).concept_cycle_check_test: extract the body ofbin/lint-concept-cyclesinto aConceptCycleCheckclass, then call it.procman_bin_list_test: it crosses the Gemfile boundary. Keep it as the smoke test for that bin.fast_gate_bin_test,ticket_growth_cli_test,cli_project_config*.remediation_*cli:OsSdlc::Lint::Remediation.run.evidence:OsSdlc::Evidence::Collection.start.bin/os-sdlc:OsSdlc::Boot::Onboarding.start.lsp-probe:OsSdlc::Daemon::Navigation.start.dup-sweepanddead-code-sweep: move the class from the bin file tolib/, then call it.subprocess_dispatch_runner.rb,sdlc_executable_helpers.rb,evidence_bin_helpers.rb,fast_gate_scenario,lint_changed_hook_scenario.Expected saving: 5 to 10 s.
Behavior is unchanged. The existing suite is the proof. Each bin keeps exactly one smoke test, in a file named
<bin>_bin_smoke_test.rb. The smoke test runs the bin as a subprocess to prove the plain-ruby boot (ADR-0166) and the shebang. Calls to external tools (git, rubocop, likec4) stay as subprocess calls. The ADR-0232os-sdlc-<command>contract (stdin, argv, stdout byte-identical; harness errors on stderr with exit 3) must stay asserted by the in-process tests or the smoke tests.Required work:
bin/lint-concept-cyclesinto aConceptCycleCheckclass underlib/; the bin calls it.bin/dup-sweepand inbin/dead-code-sweeptolib/; each bin calls it.<bin>_bin_smoke_test.rbfile per converted bin;procman_bin_list_teststays as the smoke test for its bin and is renamed to match.Open3inplugins/os-sdlc/tests/support/subprocess_dispatch_runner.rbAcceptance criteria
*_bin_smoke_test.rbfile starts a pluginbin/script as a subprocess.--help.bin/dup-sweep,bin/dead-code-sweep, andbin/lint-concept-cycles, when read, then each has a one-line body that calls a class inlib/.Owner sketch
OsSdlc::Lint::Sweeping.run(argv:, cwd:),OsSdlc::Lint::Remediation.run,OsSdlc::Evidence::Collection.start,OsSdlc::Boot::Onboarding.start,OsSdlc::Daemon::Navigation.start, and a newConceptCycleCheck.Non-goals
The crc and detector bin tests. Other tickets cover them.
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.
fast-gate touched-test selection reported the same set (touched 7 tests, 12 runs) for every gate after commit
ff904de8, and the os-me and os-adr gates missed changed files. Skeptic verdict: DROP. The cause is unconfirmed and there is no reproduce command. Check whether the forked worker caused it. File a ticket only if that confirms a selection bug. Run: fast-batch-15, session 01c29715.Resolution
Done: every remaining os-sdlc bin and hook test calls its entry in-process; five bins moved their logic to lib; one smoke test per bin and hook.
Evidence: Finding C 85681fb5..c16aac78; fixes R15
d9c39ac7, R16b8ea605b, R21ba8e8415. 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: #1409 (fast-gate touched-test selection), #1387 (lint_changed churn; occurrence posted), #1337 (cop; main added fast_gate/os_sdlc_lint_bin_test.rb with an Open3 spawn during the batch, which the cop's zero-offense criterion will catch).