Skip to content

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.automatedOpened by automation.priority: lowNice-to-have, cosmetic, or speculative; opportunistic.work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions