Add Sdlc/ProcessBoundary cop restricting process-starting calls to named boundary classes #637
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#637
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 2026-09-23 shell/ENV self-calling audit (#631-#636) found the repository's process-starting calls scattered and confirmed which classes are legitimate boundaries:
Git::Repo(plugins/os-sdlc/lib/os_sdlc/adapter/git/repo.rb, sole git caller, ADR-0174),ProjectShell(plugins/os-sdlc/lib/os_sdlc/model/project_shell.rb, ADR-0191), the ruby-lsp/lsp daemon classes underplugins/os-sdlc/lib/os_sdlc/lsp_probe/daemon/(ADR-0197/0198/0201), and several ast-grep callers (for exampleplugins/os-sdlc/lib/os_sdlc/lsp_probe/ast_definition.rb,plugins/os-sdlc/lib/os_sdlc/evidence/probe/rows.rb). The pb-mirror (pbm) boundary lives in the separatepb-mirrorgem, outside this repo, and is out of scope for this cop.Today's audit relied on manual grep. There is no static check that stops a new process-starting call from landing outside the allowed boundary classes at the next commit.
os-sdlcalready has a precedent for a structural custom cop:Sdlc/RequireInMethodatplugins/os-sdlc/lib/os_sdlc/cops/require_in_method.rb, with its test atplugins/os-sdlc/tests/cops/require_in_method_test.rb.An
adr-findsearch for "custom rubocop cop", "lint", and a file-scoped search againstrequire_in_method.rbreturned no candidates, so no constraining ADR came back from the CLI. ADR-0154 (lint lessons) and ADR-0194 (one-constant-per-file) are named by the requester as likely-relevant precedent for cop design and should be read before implementation, even though the finder did not surface them.Observed
n/a: this is a design/feature ticket, not a bug report.
Reproduce
n/a: no existing cop enforces the boundary-class rule; there is nothing to reproduce.
Expected
Add a new custom cop,
Sdlc/ProcessBoundary(or equivalent name), that:%x,Kernel#system,exec,spawn,Process.spawn,Open3.*,IO.popen— found in a class not on an explicit allowlist.libandtestsonly.Origin
Git::RepoADR-0174,ProjectShellADR-0191, lsp daemon ADR-0197/0198/0201) ← this ticket adds the missing static enforcement.Owner sketch
Acceptance criteria
system("git ...")call inside a class not on the allowlist, when the cop runs, then it reports one offense whose message names an existing boundary class to route the call through instead.`git status`backtick call insideGit::Repo, when the cop runs, then it reports no offense.Open3.capture2call insideProjectShell, when the cop runs, then it reports no offense.Process.spawncall inside a brand-new class with no existing boundary fit, when the cop runs, then the offense message tells the author to add a new named boundary class rather than only flagging the violation.tests/, when the cop runs, then the same boundary-class rule applies as inlib/.lib/andtests/(for example abin/script), when the cop runs, then it is out of scope and reports no offense.Structural follow-through
os-adr:findat implementation time whether either constrains cop shape, since the CLI search run during capture returned no candidates.Absorbed by #1647 part B (branch ticket-1647-lesson, commit
7f055cd1d, not merged yet). The cop isSdlc/Structural/ProcessStartOutsideAdapter. It uses no allowlist of boundary classes. It uses a value rule: a process start in alib/file is allowed only in an adapter, a class whose every public method reaches the start (constructor, builder, and helper methods of the start do not count), or an object that keeps a started process (blockless popen). Differences from this ticket: (1) scope islib/only; tests are covered by the #1647 runtime guard in test_helper, which has no exceptions (ruling 88, ruling 92); (2) no named-boundary list, so tool-named adapters need no entry; (3) a second cop,Sdlc/Structural/AdapterBuiltOutsideEntry, flags an adapter built or named outside the entry. Whole-plugins probe 2026-11-09: 4 hits, 0 false positives. Close this ticket when #1647 merges.Resolution
Done: Absorbed by #1647: Sdlc/Structural/ProcessStartOutsideAdapter cop, structural adapter rule instead of a boundary-class list
Evidence: main
7f055cd1; 0 hits on main after38b3284dFollow-ups: none