Skip to content

refactor: split src/devspark_cli/__init__.py into commands/ sub-package (QUAL1)#35

Merged
markhazleton merged 5 commits into
mainfrom
copilot/qual1-refactor-split-init-py
May 5, 2026
Merged

refactor: split src/devspark_cli/__init__.py into commands/ sub-package (QUAL1)#35
markhazleton merged 5 commits into
mainfrom
copilot/qual1-refactor-split-init-py

Conversation

Copilot AI commented May 5, 2026

Copy link
Copy Markdown
Contributor
  • Identify root cause: two bugs in test_hands_off_lifecycle_contract
    • .documentation/specs/002-harness-runtime/ files were archived to releases/v2.1.0/_prepare_repo FileNotFoundError
    • HarnessRunner silently bypassed manual adapter steps as "passed" in --hands-off mode instead of failing with write_incompatible_adapter
  • Create fixture stubs at .documentation/specs/002-harness-runtime/ (spec.md, contracts/cli-commands.md, contracts/harness-spec-yaml.md) satisfying harness regex/contains validations
  • Update HarnessRunner.execute_step() to fail with write_incompatible_adapter event when hands_off=True and adapter=manual
  • All 6 harness CI scripts pass
  • All 124 pytest tests pass

Copilot AI linked an issue May 5, 2026 that may be closed by this pull request
6 tasks
@markhazleton markhazleton marked this pull request as ready for review May 5, 2026 16:42
Copilot AI and others added 2 commits May 5, 2026 16:51
- Create _app.py: Typer app, BannerGroup, console, show_banner, callback
- Create _github.py: GitHub token helpers, HTTP helpers, ssl_context
- Create _utils.py: StepTracker, run_command, check_tool, is_git_repo, select_with_arrows
- Create _template.py: download_template_from_github, download_and_extract_template, helpers
- Create _upgrade_helpers.py: write_version_stamp, read_version_stamp (shared, avoids circular imports)
- Create commands/__init__.py
- Create commands/init.py: init() @app.command
- Create commands/upgrade.py: upgrade(), render_upgrade_analysis(), helpers
- Create commands/lifecycle.py: check(), version(), doctor(), uninstall()
- Replace __init__.py with 69-line thin entry point (re-exports public API)
- All 124 tests pass, 0 markdownlint errors

Agent-Logs-Url: https://github.com/markhazleton/devspark/sessions/19b3aa71-6aaf-4b39-8409-4c9db35ef83b

Co-authored-by: markhazleton <223906+markhazleton@users.noreply.github.com>
- Refactor detect_ai_agent() nested ternary into readable if/elif/else
- Add comment explaining deferred import in upgrade.py to avoid circular imports
- Fix incomplete URL comment in _utils.py check_tool()

Agent-Logs-Url: https://github.com/markhazleton/devspark/sessions/19b3aa71-6aaf-4b39-8409-4c9db35ef83b

Co-authored-by: markhazleton <223906+markhazleton@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor: Split src/devspark_cli/__init__.py into commands/ sub-package refactor: split src/devspark_cli/__init__.py into commands/ sub-package (QUAL1) May 5, 2026
Copilot AI requested a review from markhazleton May 5, 2026 16:53
…pter in hands-off mode

Two bugs fixed:
1. Create .documentation/specs/002-harness-runtime/ fixture stubs so
   test_hands_off_lifecycle_contract._prepare_repo() can copy them into
   the temp fixture repo (files were archived to releases/v2.1.0/).

2. In HarnessRunner.execute_step(), replace the silent bypass of manual
   adapter steps in --hands-off mode with a hard failure that emits
   reason="write_incompatible_adapter" to events.jsonl, fulfilling the
   hands-off lifecycle contract that was always asserted by the test.

Agent-Logs-Url: https://github.com/markhazleton/devspark/sessions/845d460f-94a3-4ece-9cb9-e8713b879c27

Co-authored-by: markhazleton <223906+markhazleton@users.noreply.github.com>
Copilot AI requested a review from markhazleton May 5, 2026 20:14
@markhazleton markhazleton merged commit 01ac367 into main May 5, 2026
10 of 11 checks passed
@markhazleton markhazleton deleted the copilot/qual1-refactor-split-init-py branch May 5, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: split src/devspark_cli/__init__.py into commands/ sub-package (QUAL1)

2 participants