Skip to content

feat(server): manual extract from Studio records source unit observation #31

@mroops0111

Description

@mroops0111

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

  1. 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.
  2. Re-run /braid-extract on the same unchanged unit. The recorded sha
    stays the same; only lastObservedAt and lastObservedByRunId
    refresh.
  3. Cancel a /braid-extract mid-run. No SourceUnitState entry is
    written for that attempt.

Depends on: #27.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions