Skip to content

fix: office-hours marks sessions "success" without writing design doc#1049

Open
walton-chris wants to merge 1 commit intogarrytan:mainfrom
walton-chris:fix/office-hours-verify-design-doc-artifact
Open

fix: office-hours marks sessions "success" without writing design doc#1049
walton-chris wants to merge 1 commit intogarrytan:mainfrom
walton-chris:fix/office-hours-verify-design-doc-artifact

Conversation

@walton-chris
Copy link
Copy Markdown

Summary

The office-hours skill can log outcome:success in the timeline even
when Phase 5 (design doc write) was skipped. The session looks
complete in telemetry, but no *-design-*.md artifact exists on disk,
silently breaking downstream skills (/plan-ceo-review,
/plan-eng-review) that read design docs from
~/.gstack/projects/{slug}/.

Repro

Observed in the wild on an apex-coach session (2026-04-12):

{"skill":"office-hours","event":"completed","branch":"master",
 "outcome":"success","duration_s":"0","session":"unknown",
 "ts":"2026-04-12T11:59:40.368Z"}

duration_s:"0" and session:"unknown" are a separate shell-state bug
addressed in a companion PR. But the real issue here is
outcome:"success" logged against ~/.gstack/projects/apex-coach/
which contains zero *-design-*.md files. A session with no
persisted artifact is not a successful session.

Fix

Two changes to office-hours/SKILL.md.tmpl:

  1. New section "Pre-Telemetry: Verify Design Doc Artifact" inserted
    before the {{LEARNINGS_LOG}} placeholder. It re-derives SLUG,
    uses the preamble's ~/.gstack/sessions/\$PPID touch file as a
    session-start time reference, and finds any *-design-*.md
    written after that time. Emits ARTIFACT_STATUS: ok or no_doc.

  2. New rule in Important Rules instructing Claude to use the
    artifact check to drive OUTCOME in the preamble's telemetry
    block. Log outcome:no_doc when no doc was written, never
    outcome:success.

Net diff: +56 lines, 0 deletions. Zero impact on sessions that
correctly write a doc.

Test plan

  • Run `/office-hours` on a new project, complete Phase 5, confirm
    timeline logs `outcome:success` and artifact exists
  • Run `/office-hours`, abandon mid-conversation, confirm timeline
    logs `outcome:no_doc`
  • Run `/office-hours` in a project with existing old design docs,
    confirm the `-newer` check correctly distinguishes this session's
    doc from prior ones

Generated with Claude Code

The office-hours skill can complete the final telemetry block and log
`outcome:success` even when Phase 5 (design doc write) was skipped —
e.g., when a session ends early or the conversation pivots to
implementation. The timeline shows `event:completed` with no
corresponding `*-design-*.md` file on disk, silently losing the
artifact that downstream skills (/plan-ceo-review, /plan-eng-review)
depend on.

Fix: add a "Pre-Telemetry: Verify Design Doc Artifact" section that
runs before the preamble's telemetry block. It re-derives SLUG (since
shell state doesn't persist between Bash tool calls), uses the
preamble's `~/.gstack/sessions/$PPID` touch file as a session-start
time reference, and looks for a fresh design doc written after that
point. Emits `ARTIFACT_STATUS: ok` or `no_doc`.

The Important Rules section now instructs Claude to use this result
to drive OUTCOME — never log `success` when `no_doc`.

Repro: observed in apex-coach session 2026-04-12 — timeline logged
`duration_s:"0"`, `session:"unknown"`, `outcome:"success"`, but no
design doc exists in ~/.gstack/projects/apex-coach/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant