Commit a68fd8b356c0d6160b598dde2caf11a63026f38e

Authored by yibo
1 parent 719fdbb7

Fix: mark T8 dance-video library entries edited:true

ingest.js's syncLibrary() only carries a library entry forward as-is
when edited is true; otherwise its periodic auto-sync (every 5 min)
rebuilds the record from the raw H3 job and silently drops
channel/characterId/garmentId/refDanceVideoId. That broke the M.7
dedupe cache and would have let dance clips leak into the regular
live-channel pool once channel got wiped. Caught while running a real
batch generation: the second sync cycle stripped a clip's traceability
fields within 5 minutes of it landing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011Deddn3sM3oQnmvqWSMb4y
dressup-generate.test.js
@@ -187,6 +187,12 @@ test(&quot;generate: full happy path lands a clip with character/garment/dance-ref tr @@ -187,6 +187,12 @@ test(&quot;generate: full happy path lands a clip with character/garment/dance-ref tr
187 assert.equal(clip.garmentId, garment.id); 187 assert.equal(clip.garmentId, garment.id);
188 assert.equal(clip.refDanceVideoId, danceRef.id); 188 assert.equal(clip.refDanceVideoId, danceRef.id);
189 assert.equal(clip.channel, "dance"); 189 assert.equal(clip.channel, "dance");
  190 + // ingest.js's syncLibrary() only carries a library entry forward as-is
  191 + // when `edited` is true; otherwise its periodic auto-sync (every 5 min,
  192 + // server.js) rebuilds the record from the raw H3 job and silently drops
  193 + // channel/characterId/garmentId/refDanceVideoId — breaking both the M.7
  194 + // dedupe cache and pickNextClip()'s dance-channel exclusion.
  195 + assert.equal(clip.edited, true, "dance clip must be edited:true or the next library sync wipes its traceability fields");
190 196
191 // T10's admin.html traceability column joins clip.characterId/garmentId/ 197 // T10's admin.html traceability column joins clip.characterId/garmentId/
192 // refDanceVideoId back against the three admin lists to show "谁的脸 + 198 // refDanceVideoId back against the three admin lists to show "谁的脸 +
server.js
@@ -779,6 +779,13 @@ async function generateDanceVideo(job, opts = {}) { @@ -779,6 +779,13 @@ async function generateDanceVideo(job, opts = {}) {
779 const clip = { 779 const clip = {
780 id: polled.id, 780 id: polled.id,
781 source: "h3console", 781 source: "h3console",
  782 + // ingest.js's syncLibrary() only carries an entry forward as-is
  783 + // when `edited` is true — otherwise it rebuilds the record from
  784 + // the raw H3 job on its next periodic sync, which knows nothing
  785 + // about channel/characterId/garmentId/refDanceVideoId and would
  786 + // silently strip them (and leak this clip into the non-dance
  787 + // pickNextClip() pool, since `channel` would be gone too).
  788 + edited: true,
782 channel: "dance", 789 channel: "dance",
783 characterId: job.characterId, 790 characterId: job.characterId,
784 garmentId: job.garmentId, 791 garmentId: job.garmentId,