|
| 1 | +--- |
| 2 | +id: dso-sapj |
| 3 | +status: open |
| 4 | +deps: [dso-hui3] |
| 5 | +links: [] |
| 6 | +created: 2026-03-20T15:35:16Z |
| 7 | +type: task |
| 8 | +priority: 1 |
| 9 | +assignee: Joe Oakhart |
| 10 | +parent: dso-q2ev |
| 11 | +--- |
| 12 | +# Update dso-setup.sh to create config at .claude/dso-config.conf |
| 13 | + |
| 14 | +## What |
| 15 | + |
| 16 | +Update plugins/dso/scripts/dso-setup.sh to write dso.plugin_root= to .claude/dso-config.conf (not workflow-config.conf), and update all test fixtures in tests/scripts/test-dso-setup.sh that assert the old workflow-config.conf path. |
| 17 | + |
| 18 | +## Why |
| 19 | + |
| 20 | +Story dso-q2ev: dso-setup.sh must create .claude/dso-config.conf in host projects and must not create workflow-config.conf. Story dso-uc2d (CLOSED) already migrated config resolution — this story completes the setup side. |
| 21 | + |
| 22 | +## Changes to dso-setup.sh |
| 23 | + |
| 24 | +1. Line 114 comment: update 'workflow-config.conf' to '.claude/dso-config.conf' |
| 25 | +2. Lines 131-141 CONFIG block: |
| 26 | + - Change: CONFIG="$TARGET_REPO/workflow-config.conf" |
| 27 | + - To: CONFIG="$TARGET_REPO/.claude/dso-config.conf" |
| 28 | + - In the live-run branch (not dryrun), ensure mkdir -p "$(dirname "$CONFIG")" before writing to CONFIG (the .claude/ dir may not exist if setup is running for the first time and hasn't created it yet via shim install — confirm: line 124 already does mkdir -p "$TARGET_REPO/.claude/scripts/" so .claude/ is guaranteed to exist before CONFIG is written; no extra mkdir needed) |
| 29 | + - Update dryrun echo message: 'Would write dso.plugin_root=$PLUGIN_ROOT to $CONFIG' (CONFIG auto-reflects new value) |
| 30 | +3. Line 463 env var guidance echo: change 'workflow-config.conf' to '.claude/dso-config.conf' |
| 31 | +4. Line 471 next steps echo: change '1. Edit workflow-config.conf' to '1. Edit .claude/dso-config.conf' |
| 32 | + |
| 33 | +## Changes to tests/scripts/test-dso-setup.sh |
| 34 | + |
| 35 | +Update fixture assertions that reference the old path (must reference new path to pass GREEN): |
| 36 | + |
| 37 | +1. test_setup_writes_plugin_root (line 71): grep path "$T/workflow-config.conf" → "$T/.claude/dso-config.conf" |
| 38 | +2. test_setup_is_idempotent (lines 91, 102): grep path "$T/workflow-config.conf" → "$T/.claude/dso-config.conf" |
| 39 | + Also update the pre-existing-entry fixture (line 98): echo into "$T2/.claude/dso-config.conf" instead of "$T2/workflow-config.conf" |
| 40 | +3. test_setup_dryrun_no_config_written (line 462): check path "$T/workflow-config.conf" → "$T/.claude/dso-config.conf" |
| 41 | +4. test_setup_is_still_idempotent_with_new_features (line 432): grep path "$T/workflow-config.conf" → "$T/.claude/dso-config.conf" |
| 42 | + |
| 43 | +## TDD Requirement |
| 44 | + |
| 45 | +This task is GREEN phase — it makes tests written in task dso-hui3 pass. |
| 46 | + |
| 47 | +After changes, run: |
| 48 | + bash tests/scripts/test-dso-setup.sh 2>&1 | tail -20 |
| 49 | + |
| 50 | +Expected: ALL tests pass including the 3 new tests from dso-hui3 AND all previously-passing tests (no regressions). |
| 51 | + |
| 52 | +## Acceptance Criteria Details |
| 53 | + |
| 54 | +- [ ] grep -q 'dso.plugin_root=' "$T/.claude/dso-config.conf" passes after fresh setup (new path written) |
| 55 | + Verify: T=$(mktemp -d) && git -C "$T" init -q && bash plugins/dso/scripts/dso-setup.sh "$T" plugins/dso >/dev/null 2>&1; grep -q 'dso.plugin_root=' "$T/.claude/dso-config.conf" && echo OK |
| 56 | +- [ ] workflow-config.conf is NOT created at repo root by dso-setup.sh |
| 57 | + Verify: T=$(mktemp -d) && git -C "$T" init -q && bash plugins/dso/scripts/dso-setup.sh "$T" plugins/dso >/dev/null 2>&1; ! test -f "$T/workflow-config.conf" && echo OK |
| 58 | +- [ ] dso-setup.sh idempotent: second run does not duplicate entry in .claude/dso-config.conf |
| 59 | + Verify: T=$(mktemp -d) && git -C "$T" init -q && bash plugins/dso/scripts/dso-setup.sh "$T" plugins/dso >/dev/null 2>&1; bash plugins/dso/scripts/dso-setup.sh "$T" plugins/dso >/dev/null 2>&1; count=$(grep -c '^dso.plugin_root=' "$T/.claude/dso-config.conf") && [ "$count" = 1 ] && echo OK |
| 60 | +- [ ] --dryrun does not create .claude/dso-config.conf |
| 61 | + Verify: T=$(mktemp -d) && git -C "$T" init -q && bash plugins/dso/scripts/dso-setup.sh "$T" plugins/dso --dryrun >/dev/null 2>&1; ! test -f "$T/.claude/dso-config.conf" && echo OK |
| 62 | + |
| 63 | +## Files to Edit |
| 64 | + |
| 65 | +- plugins/dso/scripts/dso-setup.sh (lines 114, 131, 137, 140, 463, 471) |
| 66 | +- tests/scripts/test-dso-setup.sh (lines 71, 91, 98-103, 432, 462) |
| 67 | + |
| 68 | +## ACCEPTANCE CRITERIA |
| 69 | + |
| 70 | +- [ ] `bash tests/run-all.sh` passes (exit 0) |
| 71 | + Verify: cd $(git rev-parse --show-toplevel) && bash tests/run-all.sh |
| 72 | +- [ ] `ruff check plugins/dso/scripts/*.py tests/**/*.py` passes (exit 0) |
| 73 | + Verify: cd $(git rev-parse --show-toplevel) && ruff check plugins/dso/scripts/*.py tests/**/*.py |
| 74 | +- [ ] `ruff format --check plugins/dso/scripts/*.py tests/**/*.py` passes (exit 0) |
| 75 | + Verify: cd $(git rev-parse --show-toplevel) && ruff format --check plugins/dso/scripts/*.py tests/**/*.py |
| 76 | +- [ ] dso-setup.sh writes dso.plugin_root= to .claude/dso-config.conf (new path) |
| 77 | + Verify: T=$(mktemp -d) && git -C "$T" init -q && bash $(git rev-parse --show-toplevel)/plugins/dso/scripts/dso-setup.sh "$T" $(git rev-parse --show-toplevel)/plugins/dso >/dev/null 2>&1; grep -q 'dso.plugin_root=' "$T/.claude/dso-config.conf" && echo OK |
| 78 | +- [ ] dso-setup.sh does NOT create workflow-config.conf at repo root |
| 79 | + Verify: T=$(mktemp -d) && git -C "$T" init -q && bash $(git rev-parse --show-toplevel)/plugins/dso/scripts/dso-setup.sh "$T" $(git rev-parse --show-toplevel)/plugins/dso >/dev/null 2>&1; ! test -f "$T/workflow-config.conf" && echo OK |
| 80 | +- [ ] dso-setup.sh idempotent: second run does not duplicate entry in .claude/dso-config.conf |
| 81 | + Verify: T=$(mktemp -d) && git -C "$T" init -q && R=$(git rev-parse --show-toplevel) && bash "$R/plugins/dso/scripts/dso-setup.sh" "$T" "$R/plugins/dso" >/dev/null 2>&1 && bash "$R/plugins/dso/scripts/dso-setup.sh" "$T" "$R/plugins/dso" >/dev/null 2>&1; count=$(grep -c '^dso.plugin_root=' "$T/.claude/dso-config.conf") && [ "$count" = 1 ] && echo OK |
| 82 | +- [ ] --dryrun does not create .claude/dso-config.conf |
| 83 | + Verify: T=$(mktemp -d) && git -C "$T" init -q && bash $(git rev-parse --show-toplevel)/plugins/dso/scripts/dso-setup.sh "$T" $(git rev-parse --show-toplevel)/plugins/dso --dryrun >/dev/null 2>&1; ! test -f "$T/.claude/dso-config.conf" && echo OK |
| 84 | +- [ ] All tests in test-dso-setup.sh pass including dso-hui3 RED tests (now GREEN) |
| 85 | + Verify: bash $(git rev-parse --show-toplevel)/tests/scripts/test-dso-setup.sh 2>&1 | grep -c FAIL | awk '{exit ($1 > 0)}' |
| 86 | + |
0 commit comments