Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ reading sees a dozen clips, so a count in the brief only holds for each dozen.
With a number, every clip is still read, then one more model call goes over
all the picks and puts them in order for the brief: the best set of that many
first (the mix the brief asks for, one clip may give most of it, never the
same moment twice), then stand-ins. `pick=best` lists that set: kept picks
first (they count toward the number; when more are kept than wanted, the best
of them), then the model's order. Dropping one brings in the next with no new
call. A new number orders them again; picks from clips read later do too, at
same moment twice), then stand-ins. `pick=best` lists that set, best scored
first (or by clip with `sort=clip`): kept picks count first toward the number
(when more are kept than wanted, the best of them), then the model's choice.
Dropping one brings in its next stand-in with no new call. A new number orders them again; picks from clips read later do too, at
most every 15 minutes while footage is still coming in. The list says where it
stands: `wanted`, `counts.best`, and `ranking: { status: waiting | running |
done | failed, error, due }`.
Expand Down
6 changes: 4 additions & 2 deletions src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,9 @@ app.post("/api/projects/:id/highlights/stop", async (c) => {
// min_score=2..5, pick=best|open|keep|drop|not_dropped|all (default all),
// folder= (a folder and everything inside it), sort=score|clip. Pages of 100,
// at most 1000. skipped=1 adds the clips judged not worth using, and why.
// pick=best is the project's best `wanted`, in the order the model put them.
// pick=best is the project's best `wanted`: which they are is the model's
// call; they are listed best scored first like the rest (the model's order
// breaks ties; it lists a set as it read it, not by strength).
app.get("/api/projects/:id/highlights", async (c) => {
const id = c.req.param("id");
const project = await get<{
Expand All @@ -1427,7 +1429,7 @@ app.get("/api/projects/:id/highlights", async (c) => {
q("sort") === "clip"
? "f.folder, f.name, h.src_in"
: pick === "best"
? "COALESCE(h.rank, 1000000000), h.score DESC, f.folder, f.name, h.src_in"
? "h.score DESC, COALESCE(h.rank, 1000000000), f.folder, f.name, h.src_in"
: "h.score DESC, f.folder, f.name, h.src_in";
const rows = await query<HighlightListRow>(
`SELECT ${HIGHLIGHT_COLUMNS}
Expand Down
1 change: 1 addition & 0 deletions test/e2e/run.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,7 @@ console.log("11g ok: a clip under a second is logged as too short, without an an
assert.ok(kept.every((k) => best.some((h) => h.id === k)), "every kept pick is in");
const chosen = best.filter((h) => h.pick !== "keep");
assert.ok(chosen.every((h) => h.kind === "broll"), "the model's choice, not the score's");
assert.ok(best.every((h, i) => i === 0 || best[i - 1].score >= h.score), "listed best scored first");
const ranks = db.prepare("SELECT rank FROM footage_highlights WHERE project_id = ? AND pick IS NOT 'drop' ORDER BY rank").all(pid).map((x) => x.rank);
assert.ok(ranks.every((x, i) => x === i + 1), `every pick not dropped has a place: ${ranks}`);
console.log(`11h ok: best ${wanted} chosen in one call, kept picks in, the model's order over the score`);
Expand Down
Loading