5 Commits

Author SHA1 Message Date
calesthio
9482eddeff fix: recover bounded defects from PR backlog 2026-08-03 02:14:01 -07:00
0xDevNinja
7ad68f28ec fix(corpus): normalize diversify() position term so similarity can compete
The greedy score mixed incommensurate scales: cosine similarity bounded
to [-1, 1] against an absolute list index that grows with the pool. For
a candidate j positions later to be preferred at the default
diversity=0.5, its similarity advantage had to exceed j -- impossible for
the non-negative cosines real footage embeddings produce. diversify()
therefore returned the input order verbatim, placing exact-duplicate
clips in adjacent edit slots, the one thing its docstring promises to
prevent. The threshold where the knob started working also depended on
pool size (0.66 at 4 candidates, 0.95 at 11).

Normalize the position term to [0, 1] so both terms share a scale. The
documented endpoints hold exactly as before: diversity=0 returns input
order, diversity=1 picks the most mutually dissimilar. Enumerating the
position also drops the O(n^2) remaining.index() lookup per candidate.

Closes #392
2026-07-16 18:44:14 +05:30
0xDevNinja
5dcd026ef7 fix(checkpoint): don't KeyError on manifest stages without a canonical artifact
_validate_artifacts_for_stage looked up CANONICAL_STAGE_ARTIFACTS[stage]
unconditionally, but the valid stage list comes from the pipeline manifest via
get_pipeline_stages(), which declares stages beyond the 9 canonical ones — e.g.
character-animation adds `character_design`/`rig_plan`. Such a stage passes the
`stage in valid_stages` guard, then raised an unhandled KeyError on the
canonical lookup, so those stages could never be checkpointed (the crash hits
write/read_checkpoint and friends, even for in_progress checkpoints).

Look the canonical artifact up defensively with `.get()` and skip the
required-artifact check when there is none. Canonical stages still require their
artifact when completed.
2026-07-07 15:29:03 +05:30
0xDevNinja
f08a77979c fix(schema): allow empty files[] in source_media_review artifact
review_source_media deliberately returns files:[] with a 'no source media —
fully generated production' summary when no user media is supplied or none can
be reviewed, but the schema declared files.minItems:1, so that intended
artifact failed its own validation. Relax files.minItems to 0 to match the
code's deliberate empty-media state (planning_implications still carries an
entry, so its minItems:1 remains satisfied).

Adds a regression test validating the no-source-media artifact.

Closes #269
2026-07-02 16:52:00 +05:30
0xDevNinja
364182cc39 fix(variation_checker): measure longest run for consecutive same-size shots
Check 2 flagged 'N consecutive same-size shots' from a count of every equal
adjacent pair across the whole plan, not the length of any real run. So three
separate 2-shot groups (wide,wide,cu,cu,med,med) tripped a false '3
consecutive' violation, while a genuine run of 3 (only 2 pairs) was never
flagged. Track the current run length, reset on change, and compare the longest
run >= 3.

Adds regression tests: non-consecutive pairs pass, a true run of 3 is flagged,
unspecified shots don't form a run.

Closes #268
2026-07-02 16:52:00 +05:30