Agents Builders

Add terminal session context markers

Archived Priority 1
task-58903a988139

Teach McRitchie Studio worktree tooling to write a non-secret context marker for each generated worktree. The marker should make it obvious which app, task, branch, port, URL, and review stage a terminal belongs to.

Created

Jun 18, 14:23

Queued

Jun 18, 14:23

Started

Jun 18, 14:24

Completed

Jun 18, 22:46

DevOps handoff

Type

Feature

Shape

Worktree Slug

Repositories

mcritchie-studio

Release Train

agent-devops-context-markers

Branch

feat/terminal-session-context-marker

devops tooling docs

Acceptance Criteria

  • Generated worktrees get a non-secret context file with app/task/branch/port/URL metadata
  • Production tasks store a human-readable devops.worktree_slug while keeping Task.slug generated and immutable
  • Agents can bind a production task URL to a worktree so terminal context and PR bodies lead from the task record
  • Agents can run a command from inside a worktree to print the current task context
  • The command prints shell snippets for terminal title and prompt marker usage
  • Agent docs require feature alignment and acceptance criteria before implementation starts
  • Agent handoffs lead with the McRitchie Studio task URL before the PR URL
  • Existing worktree lifecycle commands continue to work
  • Task UI and API preserve devops.worktree_slug

Expected Test Plan

  • PASS ruby -c bin/agent-worktree
  • PASS bin/agent-worktree bind-task mcritchie-studio terminal-session-context-marker task-58903a988139
  • PASS bin/agent-worktree whereami --json
  • PASS bin/agent-worktree whereami --shell
  • PASS bin/agent-worktree shell-hook zsh | zsh -n
  • PASS bin/agent-worktree status mcritchie-studio terminal-session-context-marker
  • PASS bin/agent-worktree snapshot mcritchie-studio
  • PASS bin/agent-worktree finish mcritchie-studio terminal-session-context-marker
  • PASS bin/rails test test/models/task_test.rb test/controllers/tasks_controller_test.rb test/controllers/api/v1/tasks_controller_test.rb
  • PASS http://localhost:3014/up returned 200

Checks Run

  • PR #41 is merged and present in current QA deploy cd0b46e
  • bin/qa-server status mcritchie-studio returned QA /up 200
  • bin/devops-cycle --no-refresh --plan passed on current main
  • ruby -c bin/agent-worktree passed
  • bin/install-agent-docs check passed
  • current QA deploy cd0b46e returned /up 200
  • Production deploy v71 at ef693ab
  • heroku run bin/rails db:migrate --app mcritchie-studio passed
  • heroku ps --app mcritchie-studio reported web and worker up
  • curl -I https://mcritchie.studio/up returned 200
  • curl -I https://mcritchie.studio/signin returned 200
  • BASE_URL=https://mcritchie.studio npx playwright test --grep @qa-readonly passed 2 tests

Stage Timeline

Who handled each stage, the time it took (measured), and the model / tokens / cost reported (best-effort) — plus who's on it right now. means the agent didn't report that metric.

No stage changes recorded yet.

Conversation

QA review feedback, agent handoffs, and follow-up notes for this task.

Handoff shannon 9 days ago

Draft PR is open at https://github.com/amcritchie/mcritchie-studio/pull/41. Implemented non-secret .agent-context.json markers for generated worktrees plus bin/agent-worktree whereami and shell-hook zsh. Local proof is up at http://localhost:3014 with /up 200. Verified syntax, whereami human/JSON/shell output, zsh hook syntax, status, snapshot, and finish checks.

Handoff shannon 9 days ago

Task-led PR handoff is ready: https://mcritchie.studio/tasks/task-58903a988139 Draft PR is open at https://github.com/amcritchie/mcritchie-studio/pull/41. Implemented non-secret .agent-context.json markers for generated worktrees plus bin/agent-worktree whereami, bind-task, and shell-hook zsh. Expanded the task model/API/UI to preserve devops.worktree_slug as the human-readable feature handle. Updated agent docs so feature agents align acceptance criteria with Mr. McRitchie, create the production task before implementation, bind the task to the worktree, and lead final handoffs from the task URL. Local proof is up at http://localhost:3014 with /up 200. Verified syntax, task binding, whereami JSON/shell output, finish checks, and focused task metadata tests.

Handoff shannon 9 days ago

Task-led PR handoff is ready: https://mcritchie.studio/tasks/task-58903a988139 PR is ready for Avi review at https://github.com/amcritchie/mcritchie-studio/pull/41. Branch is rebased on current origin/main and the launcher graduation check reports clean +2/-0 with /up 200. Implemented non-secret .agent-context.json markers for generated worktrees plus bin/agent-worktree whereami, bind-task, and shell-hook zsh. Expanded the task model/API/UI to preserve devops.worktree_slug as the human-readable feature handle. Updated agent docs so feature agents align acceptance criteria with Mr. McRitchie, create the production task before implementation, bind the task to the worktree, and lead final handoffs from the task URL. Local proof is up at http://localhost:3014 with /up 200. Verified syntax, task binding, whereami JSON/shell output, finish checks, and focused task metadata tests.

Handoff avi 9 days ago

Avi reconciliation: PR #41 is already merged and included in the current McRitchie Studio QA deploy at cd0b46e. Moved this task from PR Review to QA Review with QA URL https://qa.mcritchie.studio/devops. Production not deployed.

Handoff avi 9 days ago

Avi QA acceptance: terminal session context markers are accepted from QA based on merged PR #41 being present in current QA deploy cd0b46e plus agent-worktree syntax and docs checks. Moved to prod_ready for explicit production approval. Production not deployed.

Handoff avi 8 days ago

Avi production closeout: deployed approved McRitchie Studio release train to production as Heroku release v71 at ef693ab. PR #49 was intentionally excluded by deploying ef693ab rather than current main. Migration passed; web and worker dynos are up; /up and /signin return 200; read-only Playwright smoke passed 2 tests against https://mcritchie.studio. Moving task to done.

Handoff avi 8 days ago

Avi post-deploy note: Discord release note for production release v71 at ef693ab was sent to the release-notes webhook after the deploy.

Sealed-bid sizing

Edit →

Alex (PM)

Avi (PO)

Dev

Actual