Commit Graph

6 Commits

Author SHA1 Message Date
CoreRasurae cc24d8c8ac fix(cli): remove legacy plan commands from help output
Completely removed all legacy plan commands from the CLI:
    - Removed tell, build, new, current, cd, continue CLI commands
    - Removed programmatic wrapper functions (tell_command, build_command, etc.)
    - Removed legacy deprecation message
    - Updated help text to indicate V3 Plan Lifecycle exclusively
    - Removed stale references to tell/build in help output and command validation

    Removes the legacy 'tell' and 'build' CLI shortcuts from main.py:
    - Removed echo lines advertising tell/build commands
    - Removed tell/build from valid_cmds list
    - Removed tell/build from _LIGHTWEIGHT_COMMANDS frozenset
    - These dead entries were preventing helpful error messages

    Test infrastructure improvements:
    - Event bus exception test: Patch the module-level logger during emit() so that
      structlog.testing.capture_logs() can capture the logs. Without patching, the
      module-level logger created at import time is not captured by the context manager.
    - Session create/list commands: Suppress cleveragents.mcp logger to CRITICAL level
      during JSON/YAML output formatting to prevent health check warnings with ANSI codes
      from being written to stdout before JSON output, which breaks JSON parsing.
    - Extended plan_cli_coverage_boost with scenarios for estimation_result,
      invariants, execution_environment, validation_summary, and checkpoint
      coverage in _plan_spec_dict

    Documentation:
    - Created docs/Legacy_to_V3_Guide.md with comprehensive migration instructions
    - Updated CONTRIBUTING.md to document removal of legacy workflow
    - Updated CHANGELOG.md to reference issue #4181 instead of PR #10800

ISSUES CLOSED: #4181
2026-05-05 02:01:49 +00:00
freemo 48cff5cfe0 refactor(cli): rename plan lifecycle-list and lifecycle-apply to match specification
CI / build (push) Successful in 18s
CI / lint (push) Failing after 31s
CI / helm (push) Successful in 33s
CI / typecheck (push) Successful in 50s
CI / security (push) Failing after 51s
CI / coverage (push) Has been skipped
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Failing after 1m50s
CI / docker (push) Has been skipped
CI / quality (push) Successful in 3m43s
CI / integration_tests (push) Has been cancelled
CI / e2e_tests (push) Has been cancelled
CI / benchmark-publish (push) Has been cancelled
CI / status-check (push) Has been cancelled
Renames `plan lifecycle-list` to `plan list` and `plan lifecycle-apply` to `plan apply` to align with the specification's canonical command names. Removes legacy V2 plan commands that occupied those names.

- Renamed CLI command registrations from lifecycle-list/lifecycle-apply to list/apply
- Removed legacy V2 apply and list commands (~200 lines)
- Updated apply shortcut in main.py to delegate to v3 lifecycle
- Added defensive null check for plan existence in apply command
- Updated 63+ test, doc, and benchmark files for consistency

Closes #881

Co-authored-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
Co-committed-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
2026-04-02 19:09:04 +00:00
brent.edwards 3eecb79003 test(plan): TDD failing tests for checkpoint real rollback (bug #822)
CI / lint (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 46s
CI / typecheck (pull_request) Successful in 56s
CI / security (pull_request) Successful in 56s
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 29s
CI / e2e_tests (pull_request) Successful in 2m7s
CI / unit_tests (pull_request) Successful in 3m8s
CI / docker (pull_request) Successful in 9s
CI / integration_tests (pull_request) Successful in 3m57s
CI / coverage (pull_request) Successful in 7m48s
CI / benchmark-regression (pull_request) Successful in 40m48s
TDD expected-fail tests proving bug #822 exists:
CheckpointService.rollback_to_checkpoint() returns a successful
RollbackResult but does not execute git reset --hard. Files modified
after the checkpoint remain unchanged after rollback.

Also fixes Robot Framework timeout robustness across the entire test
suite: all Run Process calls now use on_timeout=kill (prevents
SIGTERM-induced -15 exit codes under CI load) and timeouts increased
to 120s (prevents premature kills during heavy parallel execution).

ISSUES CLOSED: #839
2026-03-16 01:45:50 +00:00
hurui200320 cb1403c24d test(e2e): validate M3 acceptance criteria for v3.2.0 milestone closure (#559)
CI / lint (push) Successful in 15s
CI / build (push) Successful in 15s
CI / quality (push) Successful in 24s
CI / security (push) Successful in 34s
CI / typecheck (push) Successful in 54s
CI / benchmark-regression (push) Has been skipped
CI / integration_tests (push) Successful in 3m14s
CI / unit_tests (push) Successful in 3m34s
CI / docker (push) Successful in 41s
CI / coverage (push) Successful in 4m26s
CI / benchmark-publish (push) Has been cancelled
## Summary

Validates all 10 M3 (v3.2.0) acceptance criteria via the E2E verification suite. This is the final gate before closing milestone v3.2.0.

### Single Commit (Squashed per CONTRIBUTING.md)

Branch history was squashed from 2 commits into 1 (`e1665c6e`) to comply with the one-commit-per-issue rule. The single commit includes:

1. **Original work**: Suite-level Force Tags, per-test acceptance criteria tags, enhanced documentation with milestone cross-references, CHANGELOG and CONTRIBUTORS entries.
2. **Review feedback fixes** (addressing Luis's CRITICAL/HIGH findings): Replaced fixture-self-assertion patterns with real CLI-path validation for all 10 acceptance criteria, added persistence-backed decision tree checks, robust JSON output parsing, explicit Robot process timeouts, and clearer correction tags.
3. **Rebase onto current master** (`fff6bb38`): Clean rebase resolving CHANGELOG conflict, as requested by PM (freemo).
4. **Bug fix — `async_enabled` attribute**: `PlanLifecycleService.execute_plan()` accesses `self.settings.async_enabled` (`plan_lifecycle_service.py:283`). The test helper's `_make_settings()` used `create_autospec(Settings)` but didn't set this attribute, causing `plan execute` CLI tests to fail with `AttributeError`. Fixed by adding `settings.async_enabled = False`.
5. **Timeout fixes for parallel execution**: When `pabot` runs 16 parallel Robot processes, cold-start import times + Alembic migrations cause 30s timeouts to be insufficient. Increased timeouts from 30s to 120s in 3 robot files: `actor_context_management.robot`, `decision_di_wiring_smoke.robot`, `changeset_persistence.robot`.

### Files Changed (7)

| File | Change |
|------|--------|
| `robot/helper_m3_e2e_verification.py` | Rewritten for real CLI-path validation; `_make_settings()` fixed with `async_enabled = False` |
| `robot/m3_e2e_verification.robot` | Force Tags, per-test tags, timeouts, enhanced docs |
| `robot/actor_context_management.robot` | Timeout 30s → 120s (line 92) |
| `robot/decision_di_wiring_smoke.robot` | Timeout 30s → 120s (lines 14, 21) |
| `robot/changeset_persistence.robot` | `${TIMEOUT}` 30s → 120s (line 12) |
| `CHANGELOG.md` | Entry for #494 |
| `CONTRIBUTORS.md` | Added Rui Hu |

### Acceptance Criteria Verified (10/10)

**Success Criteria:**
- `plan use` + `plan execute` generates decisions during Strategize
- `plan tree` displays decision tree correctly (via CLI invocation)
- `plan explain` shows full decision context (via CLI invocation)
- `invariant add --project` / `invariant list --project` work with project scope
- `plan correct --dry-run` performs impact analysis (via CLI invocation)
- `plan correct --mode=revert` executes live correction (via CLI invocation)

**Technical Criteria:**
- Decisions recorded with full context snapshot
- Decision tree persists to database and renders correctly
- Correction in revert mode re-executes from decision point
- Invariants enforced during strategize

### Quality Gates (Full Nox Suite)

| Session | Result | Details |
|---------|--------|---------|
| `lint` | PASS | ruff clean |
| `format` | PASS | ruff format clean |
| `typecheck` | PASS | pyright 0 errors, 0 warnings |
| `security_scan` | PASS | bandit clean |
| `dead_code` | PASS | vulture clean |
| `unit_tests` | PASS | 8500 BDD scenarios, 0 failures |
| `integration_tests` | PASS | 1194/1194 tests, 0 failures |
| `docs` | PASS | mkdocs build clean |
| `build` | PASS | wheel built |
| `benchmark` | PASS | performance benchmarks pass |
| `coverage_report` | PASS | 96.96% → rounds to 97% (meets `--fail-under=97`) |

Closes #494

Reviewed-on: #559
Reviewed-by: Luis Mendes <luis.mendes@cleverthis.com>
Co-authored-by: Rui Hu <rui.hu@cleverthis.com>
Co-committed-by: Rui Hu <rui.hu@cleverthis.com>
2026-03-05 15:09:19 +00:00
brent.edwards e8aa5ac268 fix(ci): restore venv PATH, use absolute resource paths, and add timeouts in robot tests
CI / lint (pull_request) Successful in 15s
CI / typecheck (pull_request) Successful in 28s
CI / security (pull_request) Successful in 21s
CI / quality (pull_request) Successful in 15s
CI / integration_tests (pull_request) Failing after 6m25s
CI / build (pull_request) Successful in 15s
CI / unit_tests (pull_request) Successful in 6m52s
CI / docker (pull_request) Successful in 9s
CI / coverage (pull_request) Successful in 5m5s
- Restore session.env["PATH"] in integration_tests nox session to ensure
  Run Process uses venv Python instead of system Python
- Convert bare Resource references to ${CURDIR}/ absolute paths across
  30 robot files to fix CI resolution failures
- Add timeout=30s to all Run Process calls in rxpy_route_validation.robot
  to prevent hanging tests
- Tag 2 rxpy tests as slow (require running actors unavailable on CI)
- Fix LangGraph test to use correct config file (LANGGRAPH_CONFIG)
- All 204 tests pass (4 excluded: 2 slow + 2 discovery)
2026-02-13 02:42:57 +00:00
freemo 12b91cef5e Finished port of v2 into actors, phase 7.5 complete 2026-02-02 18:46:33 -05:00