--- description: End-to-end Linear ticket resolution. Manager (vmanager) oversees worker (vintern) through context, implement, CI, staging test, and PR review. category: verkada --- flowchart TD _HEADER_["
Verkada One-Shot
End-to-end Linear ticket resolution. Manager (vmanager) oversees worker (vintern) through context, implement, CI, staging test, and PR review.
"]:::headerStyle classDef headerStyle fill:none,stroke:none subgraph _MAIN_[" "] %% Phase 1: Context subgraph Context["/v:context"] START[Linear Ticket] --> PR_DIFF[Read PR Diff
+ Comments] & LINEAR[Read Linear Issue
+ Parent + Docs] & NOTION[Read Notion Docs] & REPO_DOCS[Read vcerberus/docs
+ Backend-Docs] PR_DIFF & LINEAR & NOTION & REPO_DOCS --> CTX_DONE[Context Built] end %% Phase 2: Implement subgraph Implement["/v:implement"] CTX_DONE --> CHECKOUT[Checkout Ticket Branch
Rebase onto Master] CHECKOUT --> PLAN[Present Impl Plan
deep thinking] PLAN --> CODE[Write Code + Tests] end %% Alternate Entry: Babysit BABYSIT([/v:pm:babysit
CI only]) -.-> AUTOFIX BABYSIT_TEST([/v:pm:babysit-test
CI + staging]) -.-> AUTOFIX %% Phase 3: Push subgraph Push["/v:push"] CODE --> AUTOFIX[just autofix] AUTOFIX --> COMMIT[Commit + Push] COMMIT --> DRAFT_PR{PR Exists?} DRAFT_PR -->|No| CREATE_PR[Create Draft PR] DRAFT_PR -->|Yes| SKIP_PR[Push to Existing] CREATE_PR --> CI_START[CI Triggered] SKIP_PR --> CI_START end %% Phase 4: CI Loop subgraph CI["/v:ci:watch"] CI_START --> PR_STAT[pr-stat --watch
background monitor] PR_STAT --> CI_RESULT{CI Result?} CI_RESULT -->|Green| STAGING CI_RESULT -->|Green, babysit| CHECK_ISSUE CI_RESULT -->|Failed| DIAGNOSE{Diagnose Failure} end %% Phase 4a: CI Diagnosis subgraph Diagnosis["CI Diagnosis"] DIAGNOSE --> BB_LOGS[BuildBuddy:
Get Failure Logs] BB_LOGS --> REPRO[Run Failing Test
--config=remote] REPRO --> REAL{Real Failure?} REAL -->|No: CI flake| RETRY[CI Retry
Rebase + Push] REAL -->|Yes| INVESTIGATE[Investigate Failure
Hypothesize Root Cause] INVESTIGATE --> FIX_CI[Fix + Autofix
+ Push] RETRY --> PR_STAT FIX_CI --> PR_STAT end %% Phase 5: Staging Test subgraph Staging["/v:vrasr-verkurl-test"] STAGING[Build Component] --> TEST_PLAN[Draft Test Plan
positive + negative] TEST_PLAN --> USER_APPROVE{User Approves
Test Plan?} USER_APPROVE -->|No| TEST_PLAN USER_APPROVE -->|Yes| PUSH_VRASR[Push to vRASR Pod] PUSH_VRASR --> RUN_TESTS[Execute Tests
via verkurl] RUN_TESTS --> STAGING_RESULT{Tests Pass?} STAGING_RESULT -->|No| STAGE_FIX[Fix + Re-push] STAGE_FIX --> CODE STAGING_RESULT -->|Yes| UPDATE_PR[Update PR with
Test Results] end %% Phase 6: PR Review Loop subgraph Review["PR Review Loop"] UPDATE_PR --> CHECK_ISSUE{All Issue
Conditions Met?} CHECK_ISSUE -->|No| CODE CHECK_ISSUE -->|Yes| WATCH_PR[Monitor for
PR Comments] WATCH_PR --> COMMENTS{Comments
Received?} COMMENTS -->|Yes| ADDRESS[Address PR Comments
Reply + Fix + Push] ADDRESS --> PR_STAT COMMENTS -->|No, Approved| DONE([Done:
Slack Notify]) end %% Manager Layer subgraph Manager["vmanager (Orchestrator)"] HEARTBEAT[Heartbeat: 5min
Check vintern] ~~~ SLACK[Slack Notify
Done or Stuck] end click START "#" "**Linear Ticket**\nThe Linear ticket to be resolved end-to-end.\nContains: title, description, acceptance criteria, comments.\n\nMay be a sub-issue of a larger epic -- if so, read the parent too." click PR_DIFF "#" "**Read PR Diff + Comments**\nIf a PR already exists for this branch:\n`gh pr diff --name-only` -- list changed files\n`gh pr diff` -- full diff content\n\nAlso read all inline review comments and conversation comments.\n`gh api repos/verkada/Verkada-Backend/pulls/NNN/comments`\n\nRuns in parallel with other context reads." click LINEAR "#" "**Read Linear Issue**\nRead the full Linear ticket including:\n- Description and acceptance criteria\n- All comments (may contain user feedback)\n- Attached documents\n- Parent issue (if sub-issue)\n- Parent's documents and context\n\nUse `linear-cli` to fetch." click NOTION "#" "**Read Notion Docs**\nIf the Linear ticket references Notion pages, read them.\nCommon references: design docs, architecture decisions, deployment processes.\n\nAccess via Notion MCP." click REPO_DOCS "#" "**Read Repo Docs**\nRead relevant documentation from:\n- `vcerberus/docs/` -- service-specific docs\n- `Verkada-Backend-Docs/` -- cached LLM docs, Notion exports, Linear exports\n\nMatch docs to the PR's domain (permissions, Apple Wallet, schedules, etc)." click CTX_DONE "#" "**Context Built**\nAll parallel context reads complete.\nThe vintern now has full understanding of:\n- What the PR already changes\n- What reviewers have said\n- What the Linear ticket requires\n- Relevant Notion and repo documentation" click BABYSIT "#" "**Alternate Entry: /v:pm:babysit**\nSkips implementation -- code is already written.\nEnters at /v:push to push outstanding changes.\n\nRuns: /v:context (if needed) then /v:push then CI loop.\nFixes CI failures and addresses PR comments.\nDoes NOT run staging tests -- exits after CI green.\n\nUse when code is done and you just need to shepherd it through CI." click BABYSIT_TEST "#" "**Alternate Entry: /v:pm:babysit-test**\nSame as /v:pm:babysit but continues through staging.\n\nRuns: /v:context (if needed) then /v:push then CI loop,\nthen /v:vrasr-verkurl-test *without asking for user approval*\non the test plan (auto-approves based on PR diff).\n\nUse when code is done and needs both CI and staging validation." click CHECKOUT "#" "**Checkout Ticket Branch**\nCheckout the branch specified in the Linear ticket.\nEnsure it's based on latest master:\n`git fetch origin master`\n`git rebase origin/master`\n\nIf no branch exists yet, create one from the ticket ID." click PLAN "#" "**Present Implementation Plan**\nThink deeply about how to address the issue.\nDo NOT write code yet -- just present a plan.\n\nConsider:\n- Which files need changes\n- What tests to add/modify\n- Edge cases and risks\n- Existing patterns to follow" click CODE "#" "**Write Code + Tests**\nImplement the plan:\n- Follow existing code patterns\n- Write tests alongside code\n- Use parameterized logging (`logger.info('msg %s', var)`)\n- Import at top of file, never lazily\n- Use `from flask_pydantic_spec` not `from spectree`" click AUTOFIX "#" "**just autofix**\nRun the project's autofix command before every commit.\nFixes linting, formatting, import sorting.\n\nMandatory -- CI will fail without it." click COMMIT "#" "**Commit + Push**\nCommit changes and push to the remote branch.\nNever commit as Claude -- always as the user.\nNever add Co-Authored-By headers." click DRAFT_PR "#" "**PR Exists?**\nCheck if a PR already exists for this branch.\nIf on master, create a new branch first." click CREATE_PR "#" "**Create Draft PR**\nCreate a draft PR using gh:\n`gh pr create --draft --title 'Title' --body 'Description'`\n\nNever add 'Generated with Claude Code' to PR description." click SKIP_PR "#" "**Push to Existing PR**\nPR already exists -- just push the new commits.\nCI will be triggered automatically." click CI_START "#" "**CI Triggered**\nPushing to the remote branch triggers Verkada's CI pipeline.\nMonitor with pr-stat." click PR_STAT "#" "**pr-stat --watch**\nRun as a background monitor:\n`pr-stat --watch -t 3600`\n\nAuto-exits on success, failure, or timeout (1 hour).\nChecks CI status, review blockers, merge readiness." click CI_RESULT "#" "**CI Result**\nGreen: all checks pass, proceed to staging test.\nFailed: diagnose whether it's a real failure or CI flake." click DIAGNOSE "#" "**CI or Real?**\nDetermine if the failure is a real code issue or a CI flake.\n\n1. Build context on the PR\n2. Get the invocation ID from gh\n3. Pull failure logs from BuildBuddy\n4. Run failing test with `--config=remote`\n5. If remote passes: CI flake. If remote fails: real issue." click BB_LOGS "#" "**BuildBuddy Logs**\nUse `buildbuddy-cli` to get detailed failure information:\n- Which targets failed\n- Error messages and stack traces\n- Test output logs\n\nDon't guess at failures -- read the actual logs." click REPRO "#" "**Reproduce with --config=remote**\nRun the specific failing test:\n`bazel test //service/test/... --config=remote`\n\nIf it passes remotely, the CI failure was a flake.\nIf it fails remotely, it's a real code issue." click REAL "#" "**Real Failure?**\nCI flake: test passes with --config=remote, or test is entirely unrelated to the PR changes.\nReal failure: test fails with --config=remote and is related to the changes." click RETRY "#" "**CI Retry**\nCI flake -- rebase and re-trigger:\n1. `git fetch origin master`\n2. `git rebase origin/master`\n3. `just autofix` (only commit YOUR files)\n4. `git push --force-with-lease`\n\nMonitor the new CI run with pr-stat." click INVESTIGATE "#" "**Investigate Failure**\nReal CI failure. Identify root cause:\n1. Merge latest master\n2. Run autofix + push\n3. Sub-agent A: BuildBuddy log analysis\n4. Sub-agent B: Reproduce with --config=remote\n5. Form hypothesis from both agents' findings" click FIX_CI "#" "**Fix CI Issue**\nAddress the identified root cause.\nRun autofix, commit, push.\nLoop back to pr-stat monitoring." click STAGING "#" "**Build Component**\nBuild the current state of the service:\n`just build -c vcerberus --publish --use-invoke`\n\nRun in parallel with test plan drafting." click TEST_PLAN "#" "**Draft Test Plan**\nPlan how to test the PR changes against vRASR:\n- Positive tests (expected behavior works)\n- Negative tests (error cases handled)\n- Regression tests (existing behavior preserved)\n\nBased on the PR diff vs master." click USER_APPROVE "#" "**User Approves Test Plan?**\nPresent the test plan with checkbox options.\nUser confirms which tests to run and how.\nAdjust if rejected." click PUSH_VRASR "#" "**Push to vRASR Pod**\nDeploy the built component to a vRASR pod.\nConfirm the pod is live and serving." click RUN_TESTS "#" "**Execute Tests via verkurl**\nRun the approved test plan using verkurl to make authenticated requests against the vRASR pod.\nDocument results for each test case." click STAGING_RESULT "#" "**Staging Tests Pass?**\nIf any tests fail, analyze why and loop back to fix code.\nIf all pass, update the PR with results." click STAGE_FIX "#" "**Fix + Re-push**\nStaging test revealed issues.\nFix code, loop back through implement/push/CI." click UPDATE_PR "#" "**Update PR**\nAdd the staging test results to the PR description or as a comment.\nThis serves as evidence the changes work in a real environment." click CHECK_ISSUE "#" "**All Conditions Met?**\nRe-read the original Linear ticket and all comments.\nVerify every acceptance criterion is satisfied.\nIf not, loop back to implementation." click WATCH_PR "#" "**Monitor for PR Comments**\nWatch for reviewer comments on the PR.\nUse /reminder heartbeats to check periodically." click COMMENTS "#" "**Comments Received?**\nReviewers may post inline comments, request changes, or approve.\nIf comments: address them. If approved: done." click ADDRESS "#" "**Address PR Comments**\n1. Read all inline review comments\n2. Reply to questions (prefix with robot emoji)\n3. Make code fixes for requested changes\n4. Reply in-thread explaining what was done\n5. Autofix, commit, push\n\nNever post to the main PR conversation -- only reply in-thread." click DONE "#" "**Done: Slack Notify**\nAll conditions met, CI green, staging tested, PR approved.\n\nNotify via Slack:\n`/slackctl send @joseph.schlesinger 'robot-emoji says: PROJ-123 complete -- PR #456 ready to merge'`\n\nAlso notify if stuck in a way the manager cannot resolve." click HEARTBEAT "#" "**Manager Heartbeat**\nThe vmanager sets `/reminder` every 5 minutes.\nOn each check:\n- Is the vintern making progress?\n- Is it stuck on CI, staging, or reviews?\n- Nudge according to the protocol\n\nThis enables overnight autonomous operation." click SLACK "#" "**Slack Notification**\nNotify @joseph.schlesinger via `/slackctl` when:\n- Work is complete (PR ready to merge)\n- vintern is stuck and manager cannot resolve\n\nAlways prefix with robot emoji: 'robot-emoji says:'\nAlways include full context." classDef context fill:#d1ecf1,stroke:#7ec8d8 classDef implement fill:#e8daef,stroke:#b07cc6 classDef push fill:#dfe6ff,stroke:#5b7bce classDef ci fill:#fff3cd,stroke:#f0c040 classDef diagnosis fill:#ffeaa7,stroke:#e0c040 classDef staging fill:#dfe6ff,stroke:#5b7bce classDef review fill:#fff3cd,stroke:#f0c040 classDef approved fill:#d4edda,stroke:#5cb85c classDef flagged fill:#f8d7da,stroke:#e06070 classDef manager fill:#e8daef,stroke:#b07cc6 classDef entrypoint fill:#ffeaa7,stroke:#e0c040,stroke-width:2px,stroke-dasharray:5 5 class START,PR_DIFF,LINEAR,NOTION,REPO_DOCS,CTX_DONE context class BABYSIT,BABYSIT_TEST entrypoint class CHECKOUT,PLAN,CODE implement class AUTOFIX,COMMIT,DRAFT_PR,CREATE_PR,SKIP_PR push class CI_START,PR_STAT,CI_RESULT ci class DIAGNOSE,BB_LOGS,REPRO,REAL,INVESTIGATE diagnosis class STAGING,TEST_PLAN,USER_APPROVE,PUSH_VRASR,RUN_TESTS,STAGING_RESULT staging class UPDATE_PR,CHECK_ISSUE,WATCH_PR,COMMENTS,ADDRESS review class DONE approved class RETRY,FIX_CI,STAGE_FIX flagged class HEARTBEAT,SLACK manager end style _MAIN_ fill:none,stroke:none,padding:0 _HEADER_ ~~~ _MAIN_