Skip to content

follow-up: minor review findings from train PR #20911 for company-os work-item hierarchy (#20478) #20930

Open
1 of 2 issues completed

Description

@mrveiss

Valid, non-blocking review findings from PR #20911 (train carrying #20478), grouped here. Parent: #18978.

Backend

  • autobot-backend/llc/api/budget.py:83 — token_limit has only le=TOKEN_LIMIT_MAX; add a lower bound so a value below the signed 64-bit minimum is a 422, not a DB error.
  • autobot-backend/llc/tests/test_budget_raise_approval_8214.py:221 — pin the BigInteger boundary independently of TOKEN_LIMIT_MAX.
  • autobot-backend/llc/scheduler/liveness_monitor.py:315 — the heartbeat_missed unfiled-recovery notice is not surfaced to company users; wire it to a user-visible notification.
  • autobot-backend/llc/services/project_backfill.py:117 — detect (and report in the preview) a projectless PBI whose Task sits in another project before applying, so the backfill cannot create a hierarchy violation.
  • autobot-backend/llc/services/work_item_hierarchy.py:191 — move_subtree_to_project stops at MAX_HIERARCHY_DEPTH; traverse the whole subtree or reject the move before writing.
  • autobot-backend/llc/services/work_item_hierarchy.py:204 — reparent(parent_id=None) detaches a projectless legacy item without enforcing the project rule; validate when the parent actually changes (no-op updates stay no-ops).
  • autobot-backend/llc/services/work_item_hierarchy.py:101 — compare project ids as parsed UUIDs, not strings (un-hyphenated UUID is rejected as a mismatch).
  • autobot-backend/llc/services/work_item_own_task.py:101 — if the transition rolls back after the checkout fence is deleted, a direct agent checkout can replace a still-active human claim; release the fence after commit and make checkout reject an active human claim under the row lock.
  • autobot-backend/llc/services/work_item_own_task.py:101 — a Redis eval failure in stamp_and_release fails the transition before commit; give it a recovery path that lets the transition complete.

Frontend

  • autobot-frontend/src/components/llc/BacklogCreateModal.vue:154 — validate story points are a whole number before submit, with a translated field error.
  • autobot-frontend/src/composables/llc/useAssignableProjects.ts:25 — reload (and clear selections/invalidate pending loads) when the company route param changes.
  • autobot-frontend/src/i18n/locales/en.json:8771 — the no-projects hint is wrong when all projects are archived; describe availability instead.
  • autobot-frontend/src/views/llc/BacklogView.vue:322 — a successful create followed by a failed refresh is silent; say the item was created, the refresh failed, and offer retry.
  • autobot-frontend/src/views/llc/KanbanBoardView.vue:273 — block a second move of a card until its pending move settles, so a rollback cannot restore a stale column.
  • autobot-frontend/src/views/llc/workItemTypes.ts:109 — route work-item type/priority option labels through the existing llc.enums.workItemType / llc.enums.priority keys.
  • autobot-frontend/src/views/llc/__tests__/BacklogView.projectFilter.test.ts:144 — cover the filtered post-create refresh (URL carries project_id, rows stay in items).
  • libs/autobot-ui/src/components/__tests__/BaseInput.test.ts:15 — assert the number input emits ['001'] on update:modelValue.

Activity

  1. mrveiss commented on Nov 6, 2026

    @mrveiss
    OwnerAuthor

    Maintainer decisions for the items that needed one:

    • project_backfill.py:117: the preview lists a projectless PBI whose Task is already in another project as a conflict. Apply skips those items, fills the rest, and reports what it skipped.
    • liveness_monitor.py:315: the unfiled-recovery notice goes through the existing in-app notification service. No new channel.
    • BacklogView.vue:322: if the item is created but the refresh fails, show a warning toast saying so, with a Retry button that reloads the list.
    • KanbanBoardView.vue:273: a card with a move still pending is locked (no drag, pending indicator shown) until its request settles.

    Both work_item_own_task.py:101 findings are confirmed against the train branch:

    • A human claim leaves checkout_run_id unset, so checkout cannot see it. Once the fence is gone, a rolled-back transition lets an agent checkout replace the live human claim.
    • A Redis error during the release turns into a 500 before commit.

    Fix: checkout refuses an active human claim under the row lock. The fence is released after commit through the existing after_commit/after_rollback listener pattern, and a Redis failure there only logs a warning, leaving the fence to expire on its TTL.

    Implementation starts once train T85 lands, since the files overlap.

  2. mrveiss commented on Nov 7, 2026

    @mrveiss
    OwnerAuthor

    Closure check against origin/main (PR #20947 via merge train #21028). 14 of 16 items verified and ticked; 2 stay open and arrive in a follow-up PR. Minor findings from the train review are tracked separately in #21032 (not part of these ACs). Issue stays open.

    Closure check against origin/main (PR #20947 via merge train #21028). The checklist has 17 items: 14 verified and ticked; 3 stay open (the token_limit lower bound, its boundary test, the heartbeat_missed notice) and arrive in a follow-up PR. Minor findings from the train review are tracked separately in #21032 (not part of these ACs). Issue stays open.
    |---|---|---|
    | budget.py token_limit lower bound | OPEN | autobot-backend/llc/api/budget.py:84 still Field(None, le=TOKEN_LIMIT_MAX), no ge |
    | BigInteger boundary test | OPEN | depends on the bound above; not delivered |
    | liveness_monitor heartbeat_missed user notice | OPEN | not delivered in this PR (autobot-backend/llc/scheduler/liveness_monitor.py:293-304 unchanged for this AC) |
    | project_backfill conflict preview | verified | autobot-backend/llc/services/project_backfill.py _conflicting (:88), conflicting_item_ids in preview (:107); tests/test_project_backfill_conflicts_20930.py (4 tests) |
    | move_subtree full traversal | verified | services/work_item_hierarchy.py _descendant_ids (:186) reads whole subtree before write; test_moving_a_subtree_reaches_every_depth_before_writing (40 levels) in tests/test_work_item_hierarchy_18978.py:425 |
    | reparent(None) enforces project rule, no-op stays no-op | verified | work_item_hierarchy.py reparent (:218), early return when parent unchanged; tests ...:439, ...:448 |
    | project ids compared as UUIDs | verified | _same_project (:92); test at tests/test_work_item_hierarchy_18978.py:421 (PROJECT.replace("-", "")) |
    | fence released after commit; checkout rejects live human claim under row lock | verified | services/work_item_own_task.py _release_after_commit (:209), other_checkout_holder (:102) called after with_for_update in services/work_item_service.py:451; tests/test_checkout_fence_after_commit_20930.py (rollback, savepoint, human-claim, generation tests) |
    | Redis failure in release cannot fail the transition | verified | _delete_fence (:172) logs and lets the fence expire on TTL; test_a_redis_failure_after_the_commit_is_logged_and_never_fails_the_t... (:98) |
    | story points whole-number validation | verified | autobot-frontend/src/components/llc/BacklogCreateModal.vue:159-165, key llc.backlog.storyPointsWholeNumber (en.json:8779); BacklogCreateModal.test.ts:192 |
    | reload on company change | verified | composables/llc/useAssignableProjects.ts:49 watch resets list, invalidates in-flight load; useAssignableProjects.test.ts:67 |
    | no-projects hint for archived projects | verified | en.json:8778 noProjectsHint now describes availability and archived projects |
    | created-but-refresh-failed message + retry | verified | views/llc/BacklogView.vue:56-58,327; BacklogView.projectFilter.test.ts:180 |
    | Kanban second move blocked while pending | verified | views/llc/KanbanBoardView.vue:262-290 (movingIds, guard in onDrop); KanbanBoardView.items.test.ts:188 |
    | type/priority labels via llc.enums keys | verified | views/llc/workItemTypes.ts:108-125 labelKey: 'llc.enums.*', rendered with t(wt.labelKey) in BacklogView.vue:37 and BacklogCreateModal.vue:41; no dedicated test for the key mapping |
    | filtered post-create refresh test | verified | BacklogView.projectFilter.test.ts:164 |
    | BaseInput number input emits ['001'] | verified | libs/autobot-ui/src/components/__tests__/BaseInput.test.ts:43-44 |

  3. mrveiss commented on Nov 7, 2026

    @mrveiss
    OwnerAuthor

    Verified on main (22097e0), 15 of 19 boxes ticked, each against code: work_item_hierarchy.py (_descendant_ids, reparent validates on change, _same_project compares UUIDs); project_backfill.py (_conflicting, conflicting_item_ids in preview); liveness_monitor.py (_notify_admins_unfiled_recovery publishes heartbeat_missed on the router channel, consumed by useLLCNotifications.ts; company-wide until #20885); BacklogCreateModal.vue (Number.isInteger), useAssignableProjects.ts (watch(companyId), en.json noProjectsHint, BacklogView.vue createdRefreshFailed, KanbanBoardView.vue isMoving, workItemTypes.ts labelKey: 'llc.enums...', BaseInput.test.ts ['001']. Still open: budget.py:84 token_limit still only le=TOKEN_LIMIT_MAX (no lower bound); test_budget_raise_approval_8214.py:217-221 still built on TOKEN_LIMIT_MAX; work_item_own_task.py:101 two items (checkout rejecting an active human claim under the row lock, and recovery when the Redis eval in stamp_and_release fails) not verified from the code.

  4. mrveiss commented on Nov 7, 2026

    @mrveiss
    OwnerAuthor

    Verified on main at 22097e0, ticking two boxes:

    • Human claim respected under the row lock: work_item_service.py checkout takes select(LLCWorkItem)...with_for_update(), then other_checkout_holder(item, agent_id) raises CheckoutConflict; other_checkout_holder in work_item_own_task.py returns the user … holder when assignee_user_id and checkout_locked_at are both set. A rolled-back transition keeps the claim stamp, so the agent checkout is refused.
    • Redis eval failure no longer fails the transition: stamp_and_release queues the release via _release_after_commit (after_commit listener; a rollback drops it), and the release path catches the failure and logs that the fence expires on its TTL.
      Still open: the token_limit lower bound and its independent boundary test.
  5. mrveiss commented on Nov 8, 2026

    @mrveiss
    OwnerAuthor

    Open item, not delivered by PR #21055: TOKEN_LIMIT_MIN is the signed 64-bit floor, so the API still accepts NEGATIVE token limits. The two lower-bound boxes stay unticked. The follow-up PR, after #21055 lands, sets a meaningful floor (0, or 1 if a zero limit has special meaning), with boundary tests at 0 and -1.

  6. mrveiss commented on Nov 8, 2026

    @mrveiss
    OwnerAuthor

    Part landed: PR #21055 merged to main via merge train #21184 (merge commit 209d547): the claude_code auth-failure reason is kept on the run and the agent is paused. This PR referenced the issue (Refs), it did not close it; the issue is open and its remaining acceptance criteria are not claimed as delivered.

  7. mrveiss commented on Nov 8, 2026

    @mrveiss
    OwnerAuthor

    Maintainer decision (2026-11-08): new writes require token_limit >= 1 (TOKEN_LIMIT_MIN); blocking an agent is done by pausing it. A stored legacy token_limit = 0 keeps blocking dispatch on every path (dispatch gate, budget watchdog, tracker) through one shared rule; no stored data is rewritten. Implemented in #21220.

  8. mrveiss commented on Nov 20, 2026

    @mrveiss
    OwnerAuthor

    AC audit against main 13685f3 (2026-11-20). A branch deleted as ZERO means its content is on main; it does not by itself meet the ACs.

    PR #21220 closed (ZERO); #20947 closed (ZERO).

    • budget.py: token_limit is Field(ge=TOKEN_LIMIT_MIN, le=TOKEN_LIMIT_MAX) (llc/api/budget.py:87); test_budget_raise_approval_8214.py:225-232 refuses 0, -1, -9223372036854775808.
    • Open: test_budget_raise_approval_8214.py:221 still builds the upper boundary from TOKEN_LIMIT_MAX (models/budget.py:17, 2**63 - 1); the only literal pin is the lower bound. Left unticked.
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

    area: company-osWave 4 · cluster A — Company OS & LLC canvasbackendphase:M2.3Goals and work hierarchy

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions