import{_ as a,o as i,c as n,ag as e}from"./chunks/framework.CmQHR1bQ.js";const c=JSON.parse('{"title":"Git Worktree Strategy for Venture Parallel Development","description":"","frontmatter":{},"headers":[],"relativePath":"guides/GIT_WORKTREE_GUIDE.md","filePath":"guides/GIT_WORKTREE_GUIDE.md"}'),t={name:"guides/GIT_WORKTREE_GUIDE.md"};function l(p,s,h,r,k,o){return i(),n("div",null,[...s[0]||(s[0]=[e(`<h1 id="git-worktree-strategy-for-venture-parallel-development" tabindex="-1">Git Worktree Strategy for Venture Parallel Development <a class="header-anchor" href="#git-worktree-strategy-for-venture-parallel-development" aria-label="Permalink to &quot;Git Worktree Strategy for Venture Parallel Development&quot;">​</a></h1><p>This guide defines the git worktree workflow for parallel development on Venture. Worktrees allow multiple developers or L3 copilot agents to work on different features simultaneously without branch conflicts.</p><h2 id="overview" tabindex="-1">Overview <a class="header-anchor" href="#overview" aria-label="Permalink to &quot;Overview&quot;">​</a></h2><p><strong>Git worktree</strong> creates multiple working directories linked to the same repository. Each worktree can:</p><ul><li>Operate on a different branch</li><li>Run independent tests</li><li>Have isolated CI checks</li><li>Be merged independently</li></ul><p>This prevents:</p><ul><li>Merge conflicts when different agents work on different services</li><li>Long-lived feature branches</li><li>Blocked work waiting for unrelated PRs</li></ul><h2 id="architecture" tabindex="-1">Architecture <a class="header-anchor" href="#architecture" aria-label="Permalink to &quot;Architecture&quot;">​</a></h2><h3 id="sprint-milestone-tracking" tabindex="-1">Sprint Milestone Tracking <a class="header-anchor" href="#sprint-milestone-tracking" aria-label="Permalink to &quot;Sprint Milestone Tracking&quot;">​</a></h3><p>Venture development is organized in milestones (M1-M8):</p><table tabindex="0"><thead><tr><th>Milestone</th><th>Service</th><th>Track</th><th>Description</th></tr></thead><tbody><tr><td>M1</td><td>control-plane-api</td><td>Track A</td><td>Core control plane and API</td></tr><tr><td>M2</td><td>policy-engine</td><td>Track A</td><td>Policy engine and allowlist</td></tr><tr><td>M3</td><td>treasury-api</td><td>Track B</td><td>Treasury ledger and payout</td></tr><tr><td>M4</td><td>artifact-compiler</td><td>Track C</td><td>Artifact determinism and compilation</td></tr><tr><td>M5</td><td>agent-runtime</td><td>Track A</td><td>Agent execution and task queue</td></tr><tr><td>M6</td><td>compliance-engine</td><td>Track B</td><td>Compliance case management</td></tr><tr><td>M7</td><td>venture-orchestrator</td><td>Track A</td><td>Workflow orchestration</td></tr><tr><td>M8</td><td>integration-suite</td><td>All</td><td>Full system integration tests</td></tr></tbody></table><h3 id="worktree-per-milestone" tabindex="-1">Worktree Per Milestone <a class="header-anchor" href="#worktree-per-milestone" aria-label="Permalink to &quot;Worktree Per Milestone&quot;">​</a></h3><p>Create one worktree per sprint:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Sprint 1: Control Plane</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> worktree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> add</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ../venture-wt-m1-control</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">  -b</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> feat/venture-m1-control-plane</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin/main</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Sprint 2: Policy Engine</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> worktree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> add</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ../venture-wt-m2-policy</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">  -b</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> feat/venture-m2-policy-engine</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin/main</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Sprint 3: Treasury</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> worktree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> add</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ../venture-wt-m3-treasury</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">  -b</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> feat/venture-m3-treasury-api</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin/main</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Sprint 4: Artifacts</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> worktree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> add</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ../venture-wt-m4-artifacts</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">  -b</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> feat/venture-m4-artifact-compiler</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin/main</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># ... and so on</span></span></code></pre></div><p>Directory structure:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>/Users/kooshapari/temp-PRODVERCEL/485/kush/</span></span>
<span class="line"><span>├── parpour/                          # Main worktree (main branch)</span></span>
<span class="line"><span>├── venture-wt-m1-control/            # M1 control-plane-api</span></span>
<span class="line"><span>├── venture-wt-m2-policy/             # M2 policy-engine</span></span>
<span class="line"><span>├── venture-wt-m3-treasury/           # M3 treasury-api</span></span>
<span class="line"><span>├── venture-wt-m4-artifacts/          # M4 artifact-compiler</span></span>
<span class="line"><span>├── venture-wt-m5-agent/              # M5 agent-runtime</span></span>
<span class="line"><span>├── venture-wt-m6-compliance/         # M6 compliance-engine</span></span>
<span class="line"><span>├── venture-wt-m7-orch/               # M7 venture-orchestrator</span></span>
<span class="line"><span>└── venture-wt-m8-integration/        # M8 integration suite</span></span></code></pre></div><h2 id="branch-naming-convention" tabindex="-1">Branch Naming Convention <a class="header-anchor" href="#branch-naming-convention" aria-label="Permalink to &quot;Branch Naming Convention&quot;">​</a></h2><p>All branches follow the pattern:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>feat/venture-m{N}-{service-name}</span></span></code></pre></div><p>Examples:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>feat/venture-m1-control-plane</span></span>
<span class="line"><span>feat/venture-m2-policy-engine</span></span>
<span class="line"><span>feat/venture-m3-treasury-api</span></span>
<span class="line"><span>feat/venture-m4-artifact-compiler</span></span>
<span class="line"><span>feat/venture-m5-agent-runtime</span></span>
<span class="line"><span>feat/venture-m6-compliance-engine</span></span>
<span class="line"><span>feat/venture-m7-venture-orchestrator</span></span>
<span class="line"><span>feat/venture-m8-integration-tests</span></span></code></pre></div><p><strong>DO NOT</strong> use:</p><ul><li><code>feature/...</code></li><li><code>develop</code></li><li><code>feature-x</code> (too vague)</li><li><code>wip/...</code> (not production ready)</li></ul><h2 id="commit-message-convention" tabindex="-1">Commit Message Convention <a class="header-anchor" href="#commit-message-convention" aria-label="Permalink to &quot;Commit Message Convention&quot;">​</a></h2><p>Every commit follows a strict format:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>{type}({service}): {FR-ID} {description}</span></span>
<span class="line"><span></span></span>
<span class="line"><span>{optional body with rationale}</span></span>
<span class="line"><span></span></span>
<span class="line"><span>Fixes: #{issue_number}</span></span>
<span class="line"><span>Co-Authored-By: {agent_name} &lt;{email}&gt;</span></span></code></pre></div><h3 id="types" tabindex="-1">Types <a class="header-anchor" href="#types" aria-label="Permalink to &quot;Types&quot;">​</a></h3><table tabindex="0"><thead><tr><th>Type</th><th>Usage</th></tr></thead><tbody><tr><td><code>feat</code></td><td>New feature (implements FR)</td></tr><tr><td><code>test</code></td><td>New test or test fix</td></tr><tr><td><code>fix</code></td><td>Bug fix (implements bug fix FR)</td></tr><tr><td><code>refactor</code></td><td>Code restructuring (no behavior change)</td></tr><tr><td><code>docs</code></td><td>Documentation only</td></tr><tr><td><code>chore</code></td><td>Build, deps, tooling</td></tr></tbody></table><h3 id="services" tabindex="-1">Services <a class="header-anchor" href="#services" aria-label="Permalink to &quot;Services&quot;">​</a></h3><p>Allowed service names (lowercase):</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>policy      # policy-engine</span></span>
<span class="line"><span>treasury    # treasury-api</span></span>
<span class="line"><span>agent       # agent-runtime</span></span>
<span class="line"><span>artifact    # artifact-compiler</span></span>
<span class="line"><span>compliance  # compliance-engine</span></span>
<span class="line"><span>orch        # venture-orchestrator</span></span>
<span class="line"><span>ctrl        # control-plane-api</span></span></code></pre></div><h3 id="examples" tabindex="-1">Examples <a class="header-anchor" href="#examples" aria-label="Permalink to &quot;Examples&quot;">​</a></h3><p>Good commits:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>feat(treasury): FR-VNT-TREAS-003 spend authorization gate</span></span>
<span class="line"><span></span></span>
<span class="line"><span>Implements default-deny authorization check before any spend.</span></span>
<span class="line"><span>Validates amount_cents against prior authorization record.</span></span>
<span class="line"><span>Raises SpendNotAuthorized if no matching authorization.</span></span>
<span class="line"><span></span></span>
<span class="line"><span>Fixes: #42</span></span>
<span class="line"><span></span></span>
<span class="line"><span>test(treasury): FR-VNT-TREAS-003 failing test</span></span>
<span class="line"><span></span></span>
<span class="line"><span>Failing test for spend authorization enforcement.</span></span>
<span class="line"><span>Tests that unregistered spend raises SpendNotAuthorized.</span></span>
<span class="line"><span></span></span>
<span class="line"><span>feat(policy): FR-VNT-POLICY-002 tool allowlist validation</span></span>
<span class="line"><span></span></span>
<span class="line"><span>Adds validation to check tool against agent&#39;s allowlist.</span></span>
<span class="line"><span>Default-deny: if tool not in allowlist, reject.</span></span>
<span class="line"><span>Role-specific allowlist lookups from policy bundle.</span></span>
<span class="line"><span></span></span>
<span class="line"><span>fix(orch): FR-VNT-BUG-001 handle nil workflow_id in events</span></span>
<span class="line"><span></span></span>
<span class="line"><span>Event processing crashed on nil workflow_id.</span></span>
<span class="line"><span>Add guard clause to skip events without workflow linkage.</span></span>
<span class="line"><span></span></span>
<span class="line"><span>refactor(agent): consolidate task envelope parsing</span></span>
<span class="line"><span></span></span>
<span class="line"><span>Extract duplicate envelope parsing into shared utility.</span></span>
<span class="line"><span>No behavior change; improves code reuse.</span></span>
<span class="line"><span></span></span>
<span class="line"><span>docs(treasury): update ledger invariant documentation</span></span>
<span class="line"><span></span></span>
<span class="line"><span>Clarify double-entry balance requirement.</span></span>
<span class="line"><span>Add example ledger entry sequences.</span></span>
<span class="line"><span></span></span>
<span class="line"><span>chore: upgrade nats dependency to 0.13.1</span></span>
<span class="line"><span></span></span>
<span class="line"><span>Pins NATS version to address performance issue.</span></span>
<span class="line"><span>Verified with integration tests.</span></span></code></pre></div><p>Bad commits:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>update code              # Too vague</span></span>
<span class="line"><span>fix everything          # Too broad</span></span>
<span class="line"><span>WIP                     # Not production ready</span></span>
<span class="line"><span>fr-003                  # No type, too short</span></span>
<span class="line"><span>feat: added new thing    # No FR, no service</span></span></code></pre></div><h2 id="worktree-workflow" tabindex="-1">Worktree Workflow <a class="header-anchor" href="#worktree-workflow" aria-label="Permalink to &quot;Worktree Workflow&quot;">​</a></h2><h3 id="creating-a-new-worktree" tabindex="-1">Creating a New Worktree <a class="header-anchor" href="#creating-a-new-worktree" aria-label="Permalink to &quot;Creating a New Worktree&quot;">​</a></h3><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Create worktree for M3 Treasury milestone</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /Users/kooshapari/temp-PRODVERCEL/485/kush/parpour</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> worktree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> add</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ../venture-wt-m3-treasury</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">  -b</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> feat/venture-m3-treasury-api</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">  origin/main</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ../venture-wt-m3-treasury</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Verify you&#39;re on the right branch</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> branch</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Install dependencies (if not shared)</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">uv</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> sync</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Start development</span></span></code></pre></div><h3 id="updating-from-main" tabindex="-1">Updating from main <a class="header-anchor" href="#updating-from-main" aria-label="Permalink to &quot;Updating from main&quot;">​</a></h3><p>While developing in a worktree, keep it synced with main for dependency updates:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /Users/kooshapari/temp-PRODVERCEL/485/kush/venture-wt-m3-treasury</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Fetch latest</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> fetch</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Rebase on main (preferred for features)</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> rebase</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin/main</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># If conflicts, resolve and continue</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> rebase</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --continue</span></span></code></pre></div><p><strong>DO NOT</strong> merge main into feature branches. Always rebase.</p><h3 id="switching-between-worktrees" tabindex="-1">Switching Between Worktrees <a class="header-anchor" href="#switching-between-worktrees" aria-label="Permalink to &quot;Switching Between Worktrees&quot;">​</a></h3><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># List all worktrees</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> worktree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> list</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Switch to treasury worktree</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /Users/kooshapari/temp-PRODVERCEL/485/kush/venture-wt-m3-treasury</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Switch to policy worktree</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /Users/kooshapari/temp-PRODVERCEL/485/kush/venture-wt-m2-policy</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Back to main</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /Users/kooshapari/temp-PRODVERCEL/485/kush/parpour</span></span></code></pre></div><h3 id="running-tests-in-worktree" tabindex="-1">Running Tests in Worktree <a class="header-anchor" href="#running-tests-in-worktree" aria-label="Permalink to &quot;Running Tests in Worktree&quot;">​</a></h3><p>Each worktree is isolated. Tests run in that worktree&#39;s environment:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /Users/kooshapari/temp-PRODVERCEL/485/kush/venture-wt-m3-treasury</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Run unit tests for this milestone</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pytest</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tests/unit/test_treasury.py</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -v</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Run integration tests</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pytest</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tests/integration/test_treasury_api.py</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -v</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Run all tests with coverage</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pytest</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tests/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --cov=app</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --cov-report=html</span></span></code></pre></div><h2 id="l3-copilot-per-worktree-pattern" tabindex="-1">L3 Copilot Per-Worktree Pattern <a class="header-anchor" href="#l3-copilot-per-worktree-pattern" aria-label="Permalink to &quot;L3 Copilot Per-Worktree Pattern&quot;">​</a></h2><p>Each copilot agent works within its worktree context:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Agent 1: Work on M1 control plane</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">copilot</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -p</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Implement FR-VNT-CTRL-001 in control-plane-api.</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Failing test at: tests/unit/test_control_plane.py::test_workflow_creation</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Must pass test without adding fallbacks or legacy compatibility.</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Commit message: &#39;feat(ctrl): FR-VNT-CTRL-001 workflow creation endpoint&#39;&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">  --yolo</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --model</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> gpt-5-mini</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">  --add-dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /Users/kooshapari/temp-PRODVERCEL/485/kush/venture-wt-m1-control</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Agent 2: Work on M3 treasury (simultaneously)</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">copilot</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -p</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Implement FR-VNT-TREAS-003 in treasury-api.</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Failing test at: tests/unit/test_treasury.py::test_spend_requires_authorization</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Must pass test without adding fallbacks or legacy compatibility.</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Commit message: &#39;feat(treasury): FR-VNT-TREAS-003 spend authorization gate&#39;&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">  --yolo</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --model</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> gpt-5-mini</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">  --add-dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /Users/kooshapari/temp-PRODVERCEL/485/kush/venture-wt-m3-treasury</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Agent 3: Work on M2 policy engine</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">copilot</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -p</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Implement FR-VNT-POLICY-002 in policy-engine.</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Failing test at: tests/unit/test_policy.py::test_allowlist_validation</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Must pass test without adding fallbacks or legacy compatibility.</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Commit message: &#39;feat(policy): FR-VNT-POLICY-002 tool allowlist validation&#39;&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">  --yolo</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --model</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> gpt-5-mini</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">  --add-dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /Users/kooshapari/temp-PRODVERCEL/485/kush/venture-wt-m2-policy</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;</span></span></code></pre></div><p>Each agent operates independently:</p><ul><li>No branch conflicts</li><li>Parallel test execution</li><li>Isolated CI checks</li><li>Independent merge timelines</li></ul><h3 id="passing-context-to-copilot" tabindex="-1">Passing Context to Copilot <a class="header-anchor" href="#passing-context-to-copilot" aria-label="Permalink to &quot;Passing Context to Copilot&quot;">​</a></h3><p>When invoking copilot in a worktree, include the absolute path:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">copilot</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -p</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Your task description&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">  --yolo</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --model</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> gpt-5-mini</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">  --add-dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /Users/kooshapari/temp-PRODVERCEL/485/kush/venture-wt-m3-treasury</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">  &amp;</span></span></code></pre></div><p>The <code>--add-dir</code> parameter tells copilot to:</p><ul><li>Read all project files from that directory</li><li>Understand the local git state</li><li>Make commits to that worktree</li><li>Reference local imports and dependencies</li></ul><h2 id="merge-strategy" tabindex="-1">Merge Strategy <a class="header-anchor" href="#merge-strategy" aria-label="Permalink to &quot;Merge Strategy&quot;">​</a></h2><h3 id="per-fr-squash-merge" tabindex="-1">Per-FR Squash Merge <a class="header-anchor" href="#per-fr-squash-merge" aria-label="Permalink to &quot;Per-FR Squash Merge&quot;">​</a></h3><p>Each FR merges as a single commit via squash merge:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /Users/kooshapari/temp-PRODVERCEL/485/kush/parpour</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Ensure main is up to date</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> fetch</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pull</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> main</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Switch to feature branch (in separate worktree or local)</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /Users/kooshapari/temp-PRODVERCEL/485/kush/venture-wt-m3-treasury</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Ensure feature is rebased on latest main</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> rebase</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin/main</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Create pull request (via GitHub UI or gh CLI)</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gh</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pr</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> create</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --title</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;feat(treasury): FR-VNT-TREAS-003 spend authorization&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">  --body</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Implements spend authorization gate with default-deny policy.</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">## Changes</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">- Add AuthorizationEngine.validate_spend()</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">- Add SpendNotAuthorized exception</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">- Add unit tests for authorization logic</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">## Test Coverage</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">- tests/unit/test_treasury.py::test_spend_requires_authorization (GREEN)</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">- tests/unit/test_treasury.py::test_amount_ceiling_enforcement (GREEN)</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Closes #42&quot;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># After PR approval, squash merge</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> checkout</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> main</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pull</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> main</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gh</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pr</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> merge</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --squash</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --subject</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;feat(treasury): FR-VNT-TREAS-003 spend authorization gate&quot;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Clean up worktree</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> worktree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> remove</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ../venture-wt-m3-treasury</span></span></code></pre></div><h3 id="per-milestone-rebase-before-final-merge" tabindex="-1">Per-Milestone Rebase Before Final Merge <a class="header-anchor" href="#per-milestone-rebase-before-final-merge" aria-label="Permalink to &quot;Per-Milestone Rebase Before Final Merge&quot;">​</a></h3><p>Before merging a milestone&#39;s final PR to main:</p><ol><li>Rebase all commits to ensure clean history</li><li>Run full test suite</li><li>Verify no conflicts with other milestones</li></ol><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># In milestone worktree</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /Users/kooshapari/temp-PRODVERCEL/485/kush/venture-wt-m3-treasury</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Fetch latest</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> fetch</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Rebase on main</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> rebase</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin/main</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># If conflicts, resolve</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> rebase</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --continue</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Push to branch</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> push</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> feat/venture-m3-treasury-api</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --force-with-lease</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Create or update PR</span></span></code></pre></div><h2 id="conflict-resolution" tabindex="-1">Conflict Resolution <a class="header-anchor" href="#conflict-resolution" aria-label="Permalink to &quot;Conflict Resolution&quot;">​</a></h2><h3 id="schema-and-event-definitions" tabindex="-1">Schema and Event Definitions <a class="header-anchor" href="#schema-and-event-definitions" aria-label="Permalink to &quot;Schema and Event Definitions&quot;">​</a></h3><p>Schema and event definitions are the most conflict-prone. Resolve with this rule:</p><p><strong>All schema changes go through main first.</strong></p><p>Example:</p><ol><li>M3 (treasury) needs to add a field to EventEnvelope</li><li>M1 (control-plane) also needs to modify EventEnvelope</li></ol><p>Resolution:</p><ol><li>M3 submits PR with schema change (without treasury-specific fields yet)</li><li>Schema change merges to main</li><li>All other milestones (including M1) rebase and get the updated schema</li><li>M1 and M3 then add their respective fields</li></ol><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># M3 worktree: Add shared field</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># File: app/events/models.py - EventEnvelope</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Add: trace_id field</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> commit</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -m</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;feat(events): FR-VNT-EVENT-001 add trace_id to EventEnvelope&quot;</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> push</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> feat/venture-m3-treasury-api</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Merge to main via PR</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># M1 worktree: Rebase to get trace_id</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /Users/kooshapari/temp-PRODVERCEL/485/kush/venture-wt-m1-control</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> fetch</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> rebase</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin/main</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Now M1 can use trace_id in control-plane logic</span></span></code></pre></div><h3 id="resolving-three-way-conflicts" tabindex="-1">Resolving Three-Way Conflicts <a class="header-anchor" href="#resolving-three-way-conflicts" aria-label="Permalink to &quot;Resolving Three-Way Conflicts&quot;">​</a></h3><p>If a conflict occurs during rebase:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Rebase stops at conflicted commit</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> status</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # Shows conflicted files</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Option 1: Abort rebase (if not sure)</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> rebase</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --abort</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Option 2: Resolve and continue</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Edit conflicted files</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Remove conflict markers</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Stage resolved files</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> add</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> rebase</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --continue</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Option 3: Take ours or theirs</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> checkout</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --ours</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> app/treasury/models.py</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> add</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> app/treasury/models.py</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> rebase</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --continue</span></span></code></pre></div><h2 id="cleanup" tabindex="-1">Cleanup <a class="header-anchor" href="#cleanup" aria-label="Permalink to &quot;Cleanup&quot;">​</a></h2><h3 id="removing-finished-worktrees" tabindex="-1">Removing Finished Worktrees <a class="header-anchor" href="#removing-finished-worktrees" aria-label="Permalink to &quot;Removing Finished Worktrees&quot;">​</a></h3><p>After a milestone merges to main:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># In main worktree</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /Users/kooshapari/temp-PRODVERCEL/485/kush/parpour</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># List worktrees</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> worktree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> list</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Remove completed worktree</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> worktree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> remove</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ../venture-wt-m3-treasury</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Verify</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> worktree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> list</span></span></code></pre></div><h3 id="listing-all-worktrees" tabindex="-1">Listing All Worktrees <a class="header-anchor" href="#listing-all-worktrees" aria-label="Permalink to &quot;Listing All Worktrees&quot;">​</a></h3><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> worktree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> list</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Output:</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># /Users/kooshapari/temp-PRODVERCEL/485/kush/parpour                       e1c2d45 [main]</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># /Users/kooshapari/temp-PRODVERCEL/485/kush/venture-wt-m1-control         7f8a9e2 [feat/venture-m1-control-plane]</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># /Users/kooshapari/temp-PRODVERCEL/485/kush/venture-wt-m2-policy          b4c5d6e [feat/venture-m2-policy-engine]</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># /Users/kooshapari/temp-PRODVERCEL/485/kush/venture-wt-m3-treasury        2a3b4c5 [feat/venture-m3-treasury-api]</span></span></code></pre></div><h3 id="pruning-invalid-worktrees" tabindex="-1">Pruning Invalid Worktrees <a class="header-anchor" href="#pruning-invalid-worktrees" aria-label="Permalink to &quot;Pruning Invalid Worktrees&quot;">​</a></h3><p>If a worktree directory is deleted manually:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> worktree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> prune</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Or verbose</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> worktree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> prune</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -v</span></span></code></pre></div><h2 id="continuous-integration" tabindex="-1">Continuous Integration <a class="header-anchor" href="#continuous-integration" aria-label="Permalink to &quot;Continuous Integration&quot;">​</a></h2><p>Each worktree&#39;s branch runs its own CI:</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># .github/workflows/test-milestone.yml</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Test Milestone</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">on</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  push</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    branches</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">      - </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">feat/venture-m*</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">jobs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  test-unit</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    runs-on</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ubuntu-latest</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    steps</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">      - </span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">uses</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">actions/checkout@v3</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">      - </span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Set up Python</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">        uses</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">actions/setup-python@v4</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">      - </span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Install uv</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">        run</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">pip install uv</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">      - </span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Run tests</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">        run</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">pytest tests/unit/ -v</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  test-integration</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    runs-on</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ubuntu-latest</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    services</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      postgres</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">        image</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">postgres:16</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      nats</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">        image</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nats:latest-alpine</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      redis</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">        image</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">redis:7-alpine</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    steps</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">      - </span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">uses</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">actions/checkout@v3</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">      - </span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Run integration tests</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">        run</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">pytest tests/integration/ -v</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  test-e2e</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    runs-on</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ubuntu-latest</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    steps</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">      - </span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">uses</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">actions/checkout@v3</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">      - </span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Start services</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">        run</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">docker-compose up -d</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">      - </span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Run E2E tests</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">        run</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">pytest tests/e2e/ -v</span></span></code></pre></div><h2 id="summary" tabindex="-1">Summary <a class="header-anchor" href="#summary" aria-label="Permalink to &quot;Summary&quot;">​</a></h2><p>Worktree workflow enables:</p><ul><li><strong>Parallel development</strong>: Multiple agents work simultaneously</li><li><strong>No conflicts</strong>: Each worktree is independent</li><li><strong>Clean history</strong>: Squash merge keeps main tidy</li><li><strong>Easy rollback</strong>: Remove problematic worktree and recreate</li><li><strong>Isolated CI</strong>: Each branch runs independent tests</li><li><strong>Fast feedback</strong>: No blocked work waiting for unrelated PRs</li></ul><p>Key commands:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Create</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> worktree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> add</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ../venture-wt-{service}</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -b</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> feat/venture-m{N}-{service}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin/main</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># List</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> worktree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> list</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Update</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ../venture-wt-{service}</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> rebase</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> origin/main</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Merge</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gh</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pr</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> merge</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --squash</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Cleanup</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> worktree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> remove</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ../venture-wt-{service}</span></span></code></pre></div><p>Follow the commit message convention strictly. Always rebase before merging. Keep schema changes in main. Use L3 copilot agents per worktree. Deploy with confidence.</p>`,96)])])}const g=a(t,[["render",l]]);export{c as __pageData,g as default};
