Skip to content

knowledge/youtube-digest: persist the resolved --target in WatchState so resume can recover it #1356

Closed

Description

@kyle-sexton

Deferred from the Codex review on #1027 (P2, SKILL.md L289). #1027 closed the
--target local-checkout resolution gap at the contract layer and deliberately kept the
machine-local checkout path out of the staged slice README.md; persisting the resolved
target through the extraction runtime is the remaining half and is a code change, out
of that PR's documentation scope.

Finding

watch --target <repo> resolves a synthesis target, but nothing in the extraction runtime
persists it:

  • extraction/watch/watch-state.js — the WatchState typedef (fields: videoId,
    videoSlug, sourceUrl, title, status, phases, skipResearch, frameSelection,
    artifactPaths, tempSession) has no target field, and createWatchState() writes
    none.
  • buildContinuationPrompt() (same file) tells a resumed session to read
    run-state/watch.json, source/transcript.txt, and the lane deliverables — never the
    slice root README.md that carries the **Target:** line.
  • extraction/watch/run-resume.js reads only run-state/watch.json.

So a cross-repo watch --target <repo> interrupted before synthesis loses the resolved
target: resume must re-infer or re-ask.

Fix direction

Persist the resolved target name in WatchState when the watch starts, and surface it
in buildContinuationPrompt() so the resumed session re-runs the SKILL.md "Synthesis
target resolution" rungs against the recorded name instead of re-asking.

Portability constraint (the reason #1027 did not just write the path anywhere): the
resolved local checkout path is machine-local. run-state/watch.json is Staged: yes per
the Output contract and is already {tmp}-tokenized by serializeTempSession() /
sanitize-slice-temp-paths.js — so persist the portable name, not the absolute tree
path, or route the path through the same tokenization/sanitization seam.

Acceptance

resume on a watch started with --target <repo> recovers the target without re-asking,
and no staged artifact gains a machine-local absolute path.

Related

Activity

  1. added
    needs-triage
    on Jul 25, 2026
  2. kyle-sexton commented on Jul 25, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during triage.

    Triage

    Verified. Confirmed in extraction/watch/watch-state.js: the WatchState typedef (videoId, videoSlug, sourceUrl, title, status, phases, skipResearch, frameSelection, artifactPaths, tempSession) has no target field, and createWatchState({ videoId, videoSlug, sourceUrl, title }) writes none. buildContinuationPrompt() in the same file directs a resumed session to run-state/watch.json, source/transcript.txt, and lane deliverables — never the slice-root README.md **Target:** line. Confirmed run-resume.js reads only run-state/watch.json. The gap is exactly as described: a cross-repo watch --target <repo> interrupted before synthesis loses the resolved target on resume.

    Classification: Task (deferred code-review nit, not a reported production failure), priority: low, work-class: scoped.

    Agent Brief

    Type: Task
    Summary: Persist the resolved synthesis-target name in WatchState so a resumed watch session recovers it instead of re-asking, without leaking a machine-local absolute path into staged artifacts.

    Current behavior: watch --target <repo> resolves a synthesis target but the extraction runtime never records it. WatchState has no target field, and the resume continuation prompt never points a resumed session at re-deriving it.

    Desired behavior: The resolved target's portable name (not the absolute local checkout path) is written into WatchState when the watch starts, and buildContinuationPrompt() surfaces it so a resumed session re-runs the target-resolution logic against the recorded name instead of re-asking the user.

    Key interfaces:

    • WatchState typedef — needs a target-name field alongside the existing videoId/videoSlug/sourceUrl fields.
    • createWatchState() — needs to accept and persist the resolved target name when one is present.
    • buildContinuationPrompt() — needs to surface the recorded target name in its resume guidance.

    Acceptance criteria:

    • resume on a watch started with --target <repo> recovers the target without re-asking.
    • No staged artifact (anything marked Staged: yes in the output contract) gains a machine-local absolute path — the persisted value is a portable name, or is routed through the existing temp-path tokenization/sanitization seam.

    Out of scope:

  3. added
    agent-ready
    and removed
    needs-triage
    on Jul 25, 2026
  4. added theissue type on Jul 25, 2026
  5. self-assigned this
    on Jul 25, 2026
  6. kyle-sexton commented on Jul 25, 2026

    @kyle-sexton
    MemberAuthor
    No description provided.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-ready

Type

Fields

No fields configured for Task.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions