cc-architect: PluginConfig::Cli moves out of bin/plugin-config, takes an Invocation (cwd, env HOME); CLI tests run in-process #641
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#641
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?
Map: #631
Blocked by #638
Problem
Child of #631. Scope is narrowed to one entry point, bin/plugin-config, so that the work fits one red round. The user's 631d also held the repo-wide fork guard and the timeout revert. Those are test-only and go to a separate child (631e) because each child routes to exactly one pipeline.
Observed
PluginConfig::Cliis defined inside plugins/cc-architect/scripts/plugin_config/bin/plugin-config (127 lines), so tests can reach it only by forking. It readsDir.pwdandDir.home(line 83) andFileLocations::INSTALLED_PLUGINS_PATH(line 95). That constant is computed fromDir.homeat load time (file_locations.rb:7).Operations::Base#installed_plugins_pathalso readsDir.home(operations/base.rb:75). 19 tests fork the binary with aHOMEenv hash throughCliTestHelpers#run_cli(test/test_cli.rb:25) and test_cli_edge_cases.rb:25. The files are test_cli.rb (8), test_cli_edge_cases.rb (8), test_cli_audit_missing_manifest_not_applicable.rb (1), test_cli_register_marketplace_required_keys_coupling.rb (1), and test_cli_schema_error_exit_contract.rb (1). The whole plugin_config suite takes 2.9 s (2026-09-23).Reproduce
Expected
One prose sentence:
PluginConfig::Cli.run(argv, invocation)reads cwd and HOME only from the invocation and returns an exit status; bin/plugin-config only builds the Invocation and calls it.Origin
Owner sketch
Acceptance criteria
PluginConfig::Cli.run(%w[enable project p], invocation)runs, then the project settings file holds ap@key, the status line is oninvocation.stdout, and the status is 0.user, when enable runs, then the settings file under the invocation's HOME holds the key and the project settings file does not.audit projectruns, then the marketplace is resolved from that file.invocation.stdoutand the status is 1.registerruns, then diagnostic JSON is oninvocation.stdoutand the status is 2.list projectruns as a subprocess, then it exits 0.Open3, then only the smoke test matches.Approach
PluginConfig::Clifrom bin/ to plugin_config/cli.rb.build_paramsaddshome:frominvocation.env.fetch('HOME').FileLocations::INSTALLED_PLUGINS_PATHbecomesinstalled_plugins_path(home), andOperations::Base#installed_plugins_pathuses thehomeparam. Keep the exit codes 0/1/2.CliTestHelpers#run_cli(and its copy in test_cli_edge_cases.rb) to callCli.runwith an Invocation built fromhome:andchdir:.Required work:
PluginConfig::Cliout of bin/plugin-config intoplugin_config/cli.rb, takinghome:frominvocation.env.fetch('HOME'). (check:! grep -n 'module Cli' plugins/cc-architect/scripts/plugin_config/bin/plugin-config)FileLocations::INSTALLED_PLUGINS_PATHintoinstalled_plugins_path(home)and updateOperations::Base#installed_plugins_pathto take thehomeparam. (proven by AC 3)CliTestHelpers#run_cliand its copy in test_cli_edge_cases.rb) to callCli.runwith an Invocation. (proven by AC 7)Structural follow-through
Body before Required-work migration, 2026-09-23
Map: #631
Blocked by #638
Problem
Child of #631. Scope is narrowed to one entry point, bin/plugin-config, so that the work fits one red round. The user's 631d also held the repo-wide fork guard and the timeout revert. Those are test-only and go to a separate child (631e) because each child routes to exactly one pipeline.
Observed
PluginConfig::Cliis defined inside plugins/cc-architect/scripts/plugin_config/bin/plugin-config (127 lines), so tests can reach it only by forking. It readsDir.pwdandDir.home(line 83) andFileLocations::INSTALLED_PLUGINS_PATH(line 95). That constant is computed fromDir.homeat load time (file_locations.rb:7).Operations::Base#installed_plugins_pathalso readsDir.home(operations/base.rb:75). 19 tests fork the binary with aHOMEenv hash throughCliTestHelpers#run_cli(test/test_cli.rb:25) and test_cli_edge_cases.rb:25. The files are test_cli.rb (8), test_cli_edge_cases.rb (8), test_cli_audit_missing_manifest_not_applicable.rb (1), test_cli_register_marketplace_required_keys_coupling.rb (1), and test_cli_schema_error_exit_contract.rb (1). The whole plugin_config suite takes 2.9 s (2026-09-23).Reproduce
Expected
One prose sentence:
PluginConfig::Cli.run(argv, invocation)reads cwd and HOME only from the invocation and returns an exit status; bin/plugin-config only builds the Invocation and calls it.Origin
Owner sketch
Acceptance criteria
PluginConfig::Cli.run(%w[enable project p], invocation)runs, then the project settings file holds ap@key, the status line is oninvocation.stdout, and the status is 0.user, when enable runs, then the settings file under the invocation's HOME holds the key and the project settings file does not.audit projectruns, then the marketplace is resolved from that file.invocation.stdoutand the status is 1.registerruns, then diagnostic JSON is oninvocation.stdoutand the status is 2.list projectruns as a subprocess, then it exits 0.Open3, then only the smoke test matches.Approach
PluginConfig::Clifrom bin/ to plugin_config/cli.rb.build_paramsaddshome:frominvocation.env.fetch('HOME').FileLocations::INSTALLED_PLUGINS_PATHbecomesinstalled_plugins_path(home), andOperations::Base#installed_plugins_pathuses thehomeparam. Keep the exit codes 0/1/2.CliTestHelpers#run_cli(and its copy in test_cli_edge_cases.rb) to callCli.runwith an Invocation built fromhome:andchdir:.Structural follow-through
Work started via /os-sdlc:implement on branch ticket-641 (worktree .claude/worktrees/ticket-641).
Blocked in os-sdlc implementation 18 (session 007cbccc), branch ticket-641. Programmer dispatch 209 went green on the seam, but the reviewed test set includes TestCliInvocationSeam#test_only_smoke_test_file_uses_open3_across_test_cli_files (test_cli_invocation_seam.rb:134), which asserts that test_cli.rb and test_cli_edge_cases.rb no longer call Open3. Only a test edit (CliTestHelpers#run_cli in-process, ticket item R3) can satisfy it. The map routes a red diff-test to programmer-repair, which may not edit tests; repair dispatches 210 and 211 made no change. Stopped per the user's two-repair rule. Worktree and uncommitted diff left in place.
Resolution
Done: PluginConfig::Cli lives in plugin_config/cli.rb and takes an Invocation (cwd, stdin, stdout, stderr, env). bin/plugin-config builds the Invocation and delegates. The 19 CLI tests call Cli.run in-process through Invocation.for_test; one smoke test still forks the binary.
Evidence: Merge
7414b978on main (branch commitcaa11ed6). plugin_config suite on main: 104 runs, 384 assertions, 0 failures. Seam test test_only_smoke_test_file_uses_open3_across_test_cli_files green. Hand-finished after the pipeline stalled at implementation 18 on the test-helper edit.Follow-ups: #665 filed (user-approved): os-sdlc map routes a red test-file diff to a role that may edit tests. Pre-existing rubocop Style/Documentation offenses in plugin_config/test: dropped, out of scope.