SourceUnitState (introduced in #27) records "framework observed this
unit at this sha at this time" so the Reactor knows what to
re-extract. Today only BatchService writes through
SourceUnitStateService; when a user clicks "Run /braid-extract" in
Studio on a single unit, the observation is NOT recorded.
Consequence: a manual extract leaves the unit's recorded state stale.
The Reactor (#29) would then see the unit as new or changed even
though a human just processed it, and would re-extract unnecessarily.
Scope
- Identify the dispatch path used by Studio's "Run skill" UI for
braid-extract.
- After a successful extract run with a known (sourceId, path), call
SourceUnitStateService.recordObservation(workspaceId, sourceId,
path, sha, runId).
- The dispatcher already knows (sourceId, path) because the user
picks it from the unit picker; plumb it through.
- Failure or cancel: do NOT record. The unit's state stays as it was.
Out of scope
- Generic "post-skill hook" infrastructure. One call site, hard-coded
for braid-extract is fine for v0.
- Auto-recording from skills outside braid-extract.
Acceptance
- Run /braid-extract from Studio against one intent unit; after it
completes, that unit's SourceUnitState entry exists with the
current sha and the runId of the manual run.
- Re-run /braid-extract on the same unchanged unit. The recorded sha
stays the same; only lastObservedAt and lastObservedByRunId
refresh.
- Cancel a /braid-extract mid-run. No SourceUnitState entry is
written for that attempt.
Depends on: #27.
SourceUnitState (introduced in #27) records "framework observed this
unit at this sha at this time" so the Reactor knows what to
re-extract. Today only BatchService writes through
SourceUnitStateService; when a user clicks "Run /braid-extract" in
Studio on a single unit, the observation is NOT recorded.
Consequence: a manual extract leaves the unit's recorded state stale.
The Reactor (#29) would then see the unit as new or changed even
though a human just processed it, and would re-extract unnecessarily.
Scope
braid-extract.
SourceUnitStateService.recordObservation(workspaceId, sourceId,
path, sha, runId).
picks it from the unit picker; plumb it through.
Out of scope
for braid-extract is fine for v0.
Acceptance
completes, that unit's SourceUnitState entry exists with the
current sha and the runId of the manual run.
stays the same; only lastObservedAt and lastObservedByRunId
refresh.
written for that attempt.
Depends on: #27.