• Adds supervisor/deploy_stage.py: stage_deployment() creates a deployment row,
    git-worktree-checks-out the target commit into a fresh directory (--detach,
    never in-place git pull), copies the production DB to a one-time candidate
    copy, and Popens a real candidate backend process on a free port.
    
    Return value follows 04-P §4.6's state-machine table (status after the call
    is 'candidate_starting') rather than 03-C's one-line 'staged' summary --
    04-P's own trigger text ("c_deploy_supervisor_stage 完成" moves the row to
    candidate_starting) is the more detailed/authoritative source when the two
    disagree, same precedent used throughout this project.
    
    Found and closed two real gaps along the way:
    - deployment's own field list never included where a candidate's checkout
      directory lives -- added candidate_instance_dir to schema.py (also what
      the NEXT staging call's previous_instance_dir bootstraps from once a
      deployment reaches 'finalized').
    - backend_server.py had no CLI entry point at all since U-007 -- create_server()
      was only ever instantiated in-process by tests. Added main() (argparse +
      serve_forever + SIGTERM->shutdown() from a separate thread, per
      http.server's own same-thread-deadlock warning).
    
    RealCandidateLaunchTest spawns and HTTP-probes a genuine
    `python3 -m src.backend_server` subprocess against a real git-worktree
    checkout of this repo (not mocked) -- caught a real ordering issue doing so:
    git worktree only sees committed content, so testing before this Unit's own
    commit landed would check out backend_server.py without main() at all.
    Fixed by using `git stash create` (builds a commit object from the current
    working tree without touching HEAD/index) as the commit-to-test-against,
    falling back to plain HEAD once the tree is clean post-commit.
    
    Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
    bboonnee authored
     
    Browse File »
  • Adds the two Deploy Supervisor entities from 01-M §1.15/§1.16 (17 tables
    total): deployment (full 15-value blue-green state machine, per 01-M's own
    text rather than supervisor-auto-rollback-design.md §3's abbreviated
    summary table) and deploy_health_signal (append-only health/monitoring
    samples). ux_deployment_active enforces 01-M's "only one non-terminal
    deployment at a time" constraint via an expression-based unique index
    (CREATE UNIQUE INDEX ... ON deployment((1)) WHERE status NOT IN (...)) --
    the same partial-unique-index idiom work_graph_run already uses, just with
    a constant instead of a real grouping column since there's exactly one
    graphlemon self-target.
    
    bug_record.root_cause_category's schema-level CHECK now accepts
    core_engine, but bug_record.py's own application-layer whitelist
    deliberately does not follow yet -- classifying a bug as core_engine is a
    file-path-based rule (05 §5.8), not something the Validator's existing
    3-perspective judge_root_cause can produce, and wiring that classification
    + c_org_loop_route's routing is U-035's job.
    
    392 tests green.
    
    Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
    bboonnee authored
     
    Browse File »

  • c_pick_folder 补上 Windows(PowerShell FolderBrowserDialog)和 Linux
    (zenity 优先、回退 kdialog)实现,三平台都覆盖到。c_project_create
    (U-002 已实现的 project_scaffold.create_project())第一次接上 HTTP
    路由 POST /api/projects——backend_server.py 因此第一次需要持有 sqlite
    连接,schema.connect() 加 check_same_thread=False 参数,配合
    server.conn_lock 序列化 ThreadingHTTPServer 各请求线程的访问。
    frontend/app.js 补上 #/setup 真实交互(选文件夹→校验 Git 仓库→非
    Git 仓库二次确认→创建→跳转仪表盘),DOM class 命名对齐
    docs/wireframes/v_project_setup.html。
    
    REQ-11 完整 happy 用例(含创建 task)还需要 U-023 的
    v_goal_composer/c_task_create,本 Unit 只完成 v_project_setup/
    c_pick_folder/c_project_create 部分,development-plan.md 已记录。
    
    Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
    bboonnee authored
     
    Browse File »

  • Implements docs/sdd/01-M-模型设计.md §1.0-1.14 as stdlib sqlite3 DDL in src/
    (deployment/deploy_health_signal §1.15-1.16 are PH5/U-034, deliberately
    excluded). Covers all entities' fields, enum CHECK constraints, FKs, and
    the two non-trivial unique indexes (work_graph_run's per-(task_id,org_node)
    active-run partial index, artifact's (task_id,artifact_type,git_commit_sha)
    composite key).
    
    Per user decision (2026-07-30): bug_record.root_cause_category excludes
    'core_engine' for now -- that value is PH5-scoped and development-plan.md
    assigns adding it to U-034, not U-001; a test locks this in.
    
    14 stdlib unittest cases in src/test_schema.py cover table creation and the
    Done criterion's named constraint classes (unique/FK/enum), all passing.
    
    Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
    bboonnee authored
     
    Browse File »