Skip to content

Harness: catch exception-path cleanup + atomic session-load regressions #452

Description

@larock22

1) Outcome

Harness and CI reliably catch exception-path cleanup + session-load atomicity regressions before review.

2) Current vs Desired

Current: Semantic state-integrity regressions (exception-path cleanup gaps; load_session() partial mutation on failure) can land in PRs without any harness or CI gate failing, and are only caught by review/CodeRabbit.
Desired: The local harness and CI fail deterministically for these regressions (via targeted tests and/or running the pre-push stage in CI).

3) Scope

Allowed to change:

  • CI workflows under .github/workflows/ (harness parity)
  • HARNESS.md (documentation parity)
  • Tests under tests/ (add failure-path regression coverage)
  • Pre-commit wiring if needed to align stages

NOT allowed to change:

  • Product behavior unrelated to harness enforcement
  • Broad refactors unrelated to these failure-path invariants

4) Acceptance Criteria (Definition of Done)

  • CI runs the equivalent of the pre-push stage checks (at minimum: mypy + pytest) on pull_request and fails when they fail.
  • Add a regression test that fails if TextualReplApp request teardown leaves dangling state when the final delta flush raises.
  • Add a regression test that fails if StateManager.load_session() returns False but mutates the live session (atomicity on failure).
  • HARNESS.md accurately describes what runs in CI vs local (no claim that pre-push checks are enforced in CI if they are not).

5) Verification

Automated:

  • uv run pre-commit run --hook-stage pre-push --all-files
  • uv run pytest tests/unit/ui/test_request_threading.py tests/unit/core/test_session_usage_schema.py

Manual:

  • Step 1: Open a PR and confirm CI includes a job that executes the pre-push-equivalent checks.
  • Step 2: Introduce a small intentional regression locally (e.g., break one of the new failure-path tests) and confirm the check fails.
  • Expected: CI blocks merge until the relevant check passes.

Evidence required:

  • Test command output
  • Short manual verification log (what PR/run, expected vs actual)

6) Bug-only (if applicable; otherwise N/A)

N/A

7) Links

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    choreMaintenance and housekeeping taskstestingTesting infrastructure and test coverage improvements

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions