garrytan / garrytan/gstack

/office-hours reads the builder profile after Phase 4.5 has written to it, so a first session gets the welcome_back tier and is asked how an assignment it just issued went

Open
#2,801 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
133k
Forks
19.9k
Avg merge
18h 46m
Merged PRs (30d)
26

Description

`/office-hours` Phase 4.5 appends this session's entry to the builder profile. Phase 6 Step 1 then reads that same profile to choose a closing tier. Within one run the write precedes the read, so a genuine first session reports `SESSION_COUNT: 1` / `TIER: welcome_back`, and the `introduction` tier — the one holding the actual first-session content and the YC introduction — is unreachable on the run it was written for.

The welcome_back path then instructs the model to say "Welcome back. Last time you were working on [LAST_ASSIGNMENT]. How's it going?" where `LAST_ASSIGNMENT` is the assignment issued a few minutes earlier in the same session.

This is the mirror image of #1677 ("always reports SESSION_COUNT: 0, welcome_back tier is unreachable"), which #1682 fixed by unifying the writer and reader onto `developer-profile.json`. The unification is correct; what is missing is that Phase 4.5 and Phase 6 are now the same store at two points in one run, so the run observes itself as history. Distinct from #2657, which is about `sessions[]` under-counting *across* runs from Phase-4.5-only logging — same single writer, different symptom.

## Observed

First-ever `/office-hours` run on this machine, v1.71.x, macOS. No prior `developer-profile.json` entries for this project slug.

Phase 4.5 ran:

```
gstack-developer-profile --log-session '{"date":"...","mode":"startup","project_slug":"",...}'
```

Phase 6 Step 1 then ran `gstack-builder-profile` and got:

```
SESSION_COUNT: 1
TIER: welcome_back
LAST_PROJECT:
LAST_ASSIGNMENT: Ship /check and get 50 strangers to run their own PDF through it
LAST_DESIGN_TITLE:
DESIGN_COUNT: 0
DESIGN_TITLES: []
TOTAL_SIGNAL_COUNT: 7
CROSS_PROJECT: false
```

`LAST_ASSIGNMENT` is this run's own assignment. `DESIGN_COUNT: 0` and an empty `DESIGN_TITLES` alongside `TIER: welcome_back` is the tell — the welcome_back path reads `DESIGN_TITLES` for "Your first design was X. Now you're on Y", and there is nothing to put in either slot.

## Repro

Fresh profile (or a project slug with no prior sessions). Run `/office-hours` to completion. At Phase 6, `gstack-builder-profile` reports `SESSION_COUNT: 1, TIER: welcome_back` rather than `0, introduction`.

## Suggested fix

Any of:

1. Read the profile at skill start (the preamble already runs) and carry the tier value through to Phase 6, so the tier reflects state as of before this run.
2. Have `gstack-builder-profile` accept a flag to exclude entries whose timestamp falls within the current run, or have Phase 6 subtract this session's own entry before selecting a tier.
3. Move the Phase 4.5 `--log-session` call to after Phase 6's read. This is the smallest diff but it loses the entry if the run dies during the closing, which is the failure mode #2657 is about — so (1) or (2) is probably better.

Option (1) fits the existing structure: the preamble is already the place session-scoped values (`SESSION_ID`, `TEL_START`) are captured and carried forward.

A cheap guard regardless of which fix lands: if `LAST_ASSIGNMENT` equals the assignment this run just wrote, treat the tier as `introduction`.

## Note on scope

Reported, not PR'd, because the choice between (1), (2) and (3) interacts with #2657's proposal to reconcile `sessions[]` against `timeline.jsonl`, and whoever owns that should pick. Happy to send a PR for whichever direction you prefer.

Contributor guide

Open the contributing guide

Research direction

Trace `/office-hours` from its preamble through Phase 4.5 and Phase 6 Step 1, comparing the profile read with the entry written to `developer-profile.json`. Review the interaction with `sessions[]` and `timeline.jsonl` described in #2657. Done means a fresh profile selects `SESSION_COUNT: 0` and the `introduction` tier without losing session logging.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.