Repository navigation
refactor(harness): search frozen shot snapshots - #162
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14301dc0c2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if status == "pending" || status == "running" { | ||
| pendingIDs = append(pendingIDs, frozen[index].asset.ID) | ||
| } else { | ||
| failedIDs = append(failedIDs, frozen[index].asset.ID) |
There was a problem hiding this comment.
Keep missing automatic-index jobs pending
When shot.search starts just after ProxyGenerated marks a video ready but before ensureBaseShotIndexForAsset enqueues its index job, baseShotIndexJobStatus returns missing and this branch immediately classifies the asset as failed. This is a real import window because go/internal/worker/ingest.go commits ingest_status='ready' at lines 82-89, may generate peaks, and only enqueues the base index at lines 107-114; searches during that interval therefore return shot_index_failed instead of waiting for automatic indexing. Treat a missing job as pending until the barrier timeout or until the enclosing ingest reaches a terminal failure.
Useful? React with 👍 / 👎.
| for _, tag := range input.Tags { | ||
| if strings.TrimSpace(tag) != "" { | ||
| tagQueries = append(tagQueries, buildShotSearchQuery(tag)) | ||
| } |
There was a problem hiding this comment.
Verify tag matches with the same synonym semantics
When a tag matches only through the new synonym vocabulary—for example tags:["夕阳"] against a shot whose only matching field is 晚霞—the executor accepts it here, but validTypedToolRecoveryResult still checks tags through the literal-token-only shotMatchesAnyRequestedTag at go/internal/agent/tool_recovery.go:1220. The production middleware consequently replaces this legitimate successful result with tool_execution_error as unverifiable. The receipt verifier needs to share the executor's synonym-aware tag predicate.
Useful? React with 👍 / 👎.
| func queryNegatesAlias(query, alias string) bool { | ||
| for _, prefix := range []string{"无", "没有", "没", "非", "不要", "排除", "避免"} { | ||
| if strings.Contains(query, prefix+alias) { | ||
| return true |
There was a problem hiding this comment.
Detect negation across normal separators
When users write a negation with normal whitespace or punctuation, such as 不要 背光 or 不要,背光, normalizeSearchText preserves that separator while this check only searches for the concatenated 不要背光. The query is then treated as a positive 背光 synonym query and can return backlit shots, reversing the requested meaning. Normalize or skip separators between the negation prefix and alias before testing.
Useful? React with 👍 / 👎.
PR5 验收证据最终提交:
本地门禁
首轮 CI 在临界覆盖率处报告 89.9%,因此补充了冻结集合、回执真值、稳定排序、取消和输入边界测试,将本地覆盖率提高到 90.2%。最终 CI run 30765555744 5/5 全绿:质量/契约/覆盖率、macOS race、Ubuntu race、Playwright、Web 全部通过。 内置浏览器真实验收在隔离栈(API
API / SQLite / Worker 真值
结论:PR5 的冻结快照检索、全就绪 barrier、无 embedding 排序、稳定 tie-break、回执真值与严格只读边界均通过代码门禁和真实运行时验收。 |
目标
落实 #157 的 PR5:把 shot.search 改为基于完整冻结基础索引快照的无 embedding 检索,删除 partial detection candidate / 模型补建索引语义。
实现
证据
浏览器/API/SQLite/日志的真实模型验收将在 CI 全绿后作为 PR 评论补充,再决定是否合并。
Part of #157