os-sdlc runner: fetch ticket body at implementation-open and store on the implementations row #500

Closed
opened 2026-08-24 13:46:11 +00:00 by jared · 3 comments
Owner

Decided 2026-08-24 during the #491 run retrospective (session 35d2936f).

Problem: the ticket body is fetched lazily per dispatch via BriefFacts#ticket_brief -> TeaTracker#fetch_body. TeaTracker.for falls back silently to NullTracker when the subagent root lacks .sdlc/project.yaml / .cc-os/config (worktrees), so change-interpreter received "(no tracker configured -- ticket body unavailable)" and errored; the orchestrator recovered by pasting the ticket inline.

Design (approved):

  1. At implementation-open (OpenImplementation.call, runs in the orchestrator cwd where the tracker always resolves), fetch the ticket body once and store it in a new ticket_body column on the implementations table.
  2. BriefFacts#ticket_brief reads implementation[:ticket_body] first, falls back to a live fetch.
  3. NullTracker#fetch_body must RAISE (TrackerUnavailable) instead of returning a placeholder string — fail loudly, no silent degradation.
  4. Extend the enrich: fact vocabulary in BriefFacts via a Ruby registry (name -> lambda) rather than SQL-in-YAML handoff files; revisit only if the fact count grows past ~10.

Relations: partly supersedes the scope of #498 (subagent tracker access). Needs an /os-adr:find pass and likely a small ADR (persistence change).

Decided 2026-08-24 during the #491 run retrospective (session 35d2936f). Problem: the ticket body is fetched lazily per dispatch via BriefFacts#ticket_brief -> TeaTracker#fetch_body. TeaTracker.for falls back silently to NullTracker when the subagent root lacks .sdlc/project.yaml / .cc-os/config (worktrees), so change-interpreter received "(no tracker configured -- ticket body unavailable)" and errored; the orchestrator recovered by pasting the ticket inline. Design (approved): 1. At implementation-open (OpenImplementation.call, runs in the orchestrator cwd where the tracker always resolves), fetch the ticket body once and store it in a new `ticket_body` column on the `implementations` table. 2. BriefFacts#ticket_brief reads `implementation[:ticket_body]` first, falls back to a live fetch. 3. NullTracker#fetch_body must RAISE (TrackerUnavailable) instead of returning a placeholder string — fail loudly, no silent degradation. 4. Extend the enrich: fact vocabulary in BriefFacts via a Ruby registry (name -> lambda) rather than SQL-in-YAML handoff files; revisit only if the fact count grows past ~10. Relations: partly supersedes the scope of #498 (subagent tracker access). Needs an /os-adr:find pass and likely a small ADR (persistence change).
Author
Owner

Work started on branch worktree-ticket-500: TeaTracker#fetch_body at implementation-open, ticket_body persisted on the implementations row, NullTracker#fetch_body raises (fail loudly). Body-only, no comments; schema-version bump per ADR-0129.

Work started on branch worktree-ticket-500: TeaTracker#fetch_body at implementation-open, ticket_body persisted on the implementations row, NullTracker#fetch_body raises (fail loudly). Body-only, no comments; schema-version bump per ADR-0129.
Author
Owner

Resolution

Done: Ticket body is fetched once at implementation-open (TeaTracker.for in orchestrator cwd, before Db.connect) and persisted in a new implementations.ticket_body column (SCHEMA_VERSION 16, wipe-and-recreate per ADR-0129). BriefFacts#ticket_brief reads the stored body first, live fetch only on nil. NullTracker#fetch_body raises TrackerUnavailable instead of returning a placeholder brief. Body-only, no comments, by decision.

Evidence: Merged to main a0b969c (feature commit b25598e, branch worktree-ticket-500). ADR-0146. New tests: open_implementation_ticket_body_test.rb, brief_facts_ticket_body_test.rb, NullTracker raise assertions in tea_tracker_test.rb; offline repo: tracker fixture tests/support/ticket_fixture.rb. Suite 1063 runs, 4 failures all pre-existing ChangeInterpreterAgentTest baseline (reproduced on clean main pre-change); rubocop clean on touched files. Plugin cache refreshed.

Follow-ups: 1) Pre-existing ChangeInterpreterAgentTest 4 baseline failures (blueprint prefix assertions) predate this ticket and remain red. 2) Pre-existing Metrics class/method-length offenses in cli_subagent_stop_test.rb, tea_tracker_test.rb, cli_next_instruction_helpers.rb. 3) change-interpreter charter's subagent-stop snippet omits session_id/agent_type and uses a broken echo-pipe form. 4) #498 subagent tracker access is partly superseded by this change. None captured as tickets yet.

## Resolution **Done:** Ticket body is fetched once at implementation-open (TeaTracker.for in orchestrator cwd, before Db.connect) and persisted in a new implementations.ticket_body column (SCHEMA_VERSION 16, wipe-and-recreate per ADR-0129). BriefFacts#ticket_brief reads the stored body first, live fetch only on nil. NullTracker#fetch_body raises TrackerUnavailable instead of returning a placeholder brief. Body-only, no comments, by decision. **Evidence:** Merged to main a0b969c (feature commit b25598e, branch worktree-ticket-500). ADR-0146. New tests: open_implementation_ticket_body_test.rb, brief_facts_ticket_body_test.rb, NullTracker raise assertions in tea_tracker_test.rb; offline repo: tracker fixture tests/support/ticket_fixture.rb. Suite 1063 runs, 4 failures all pre-existing ChangeInterpreterAgentTest baseline (reproduced on clean main pre-change); rubocop clean on touched files. Plugin cache refreshed. **Follow-ups:** 1) Pre-existing ChangeInterpreterAgentTest 4 baseline failures (blueprint prefix assertions) predate this ticket and remain red. 2) Pre-existing Metrics class/method-length offenses in cli_subagent_stop_test.rb, tea_tracker_test.rb, cli_next_instruction_helpers.rb. 3) change-interpreter charter's subagent-stop snippet omits session_id/agent_type and uses a broken echo-pipe form. 4) #498 subagent tracker access is partly superseded by this change. None captured as tickets yet.
jared closed this issue 2026-08-24 19:50:31 +00:00
Author
Owner

Follow-up captured: #501 (settling-agent charter settlement snippet — missing payload fields, echo-pipe corruption, worktree-guard trip; skeptic verdict CREATE). Other follow-ups from the close comment: pre-existing ChangeInterpreterAgentTest failures and Metrics offenses remain known-baseline, dropped; #498 overlap noted on that ticket's scope.

Follow-up captured: #501 (settling-agent charter settlement snippet — missing payload fields, echo-pipe corruption, worktree-guard trip; skeptic verdict CREATE). Other follow-ups from the close comment: pre-existing ChangeInterpreterAgentTest failures and Metrics offenses remain known-baseline, dropped; #498 overlap noted on that ticket's scope.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#500
No description provided.