Skip to content

fix: turn main's Backend tests green (3 fixes #75 did not carry) - #78

Merged
avabbbb merged 3 commits into
mainfrom
fix/main-green
Oct 9, 2026
Merged

avabbbb merged 3 commits into
mainfrom
fix/main-green

Conversation

@avabbbb

@avabbbb avabbbb commented Oct 9, 2026

Copy link
Copy Markdown
Owner

fix: turn main's Backend tests green (3 fixes #75 did not carry)

Base: main 9aaac1a. Local full backend suite after these 3 commits: 1088 passed, 2 skipped, 0 failed (main alone: 4 failed / 1084 passed).

  1. fix(reset): cancel each live worker once during quiesce. _quiesce_active_work cancelled the same worker twice (cancel_career_task + _cancel_task_objects). When the second cancel landed during a commit, the worker abandoned a SQLite write transaction while still holding RESERVED. The next BEGIN IMMEDIATE then waited 30 s and failed with "database is locked". The failure is intermittent and also happens on main. Fix: skip cancel() for tasks that are already cancelling(), but still await them. Fixes test_local_data_reset::test_registry_confirmed_reset_....
  2. feat(resume): finalize a proposal when its last decision group is confirmed. On the decision-plan path, once every change is reviewed, the proposal moves from in_review to accepted (if at least one change was accepted) or to rejected (if all were rejected). In the same transaction it creates a ResumeVersion and sets current_version_id. The operation is idempotent and replay-safe. The shared helpers proposal_fully_reviewed and mark_workspace_proposal_accepted live in resume_versions.py, and create_resume_version_record now reuses them. The manual workspace review route is unchanged. Fixes test_tailor_resume_fixture_runs_ask_plan_receipts_and_workspace_on_one_run.
  3. test(career): pin automation-event lookups to the test's own target. The suite shares one DB, and rows[0] picked up another test's event. These tests failed only in full-suite order.

cancel_career_task already cancels a career task's live worker; the
follow-up _cancel_task_objects cancelled it again. The second cancel could
land inside the worker's final awaited DB commit, orphaning an open SQLite
write transaction (RESERVED lock) so the reset's checkpoint hit
'database is locked' after the 30s busy timeout. Flaky on main too.
Skip tasks that already have a pending cancellation; still await them.

(cherry picked from commit b15017f56941cf75c7fcd4ccaea5a557fe4b20d7)
…firmed

Confirming every resume decision group left the proposal 'in_review' with
no accepted ResumeVersion. A confirmed decision-plan node now finalizes the
proposal in the same review transaction once no change is pending: snapshot
the workspace as a ResumeVersion and mark it accepted through
mark_workspace_proposal_accepted, the helper now shared with
create_resume_version_record (all-rejected closes it as 'rejected').
Idempotent, and a replayed final review finalizes a fully reviewed but
unfinalized proposal. Direct workspace reviews keep the existing contract:
the proposal stays open until the user saves a version.

Drop the strict xfail on
test_tailor_resume_fixture_runs_ask_plan_receipts_and_workspace_on_one_run.

(cherry picked from commit 42203d951c84987cf42d2d4d2ccd61a31e969482)
…shared DB order leak)

(cherry picked from commit 5da56feb4e06495782e8662759ea0e11c40d1e0e)
@avabbbb
avabbbb merged commit 4baaddb into main Oct 9, 2026
15 checks passed
@avabbbb
avabbbb deleted the fix/main-green branch October 9, 2026 02:12
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.

1 participant