Skip to content
Open
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
9 changes: 7 additions & 2 deletions src/objects/news-do.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,13 @@ function buildSignalListWhere(filters: SignalListFilters): { whereSql: string; p
params.push(filters.tag);
}
if (filters.status) {
clauses.push("s.status = ?");
params.push(filters.status);
// Virtual filter status=accepted → editorially accepted lifecycle states (#873)
if (filters.status === "accepted") {
clauses.push("s.status IN ('approved', 'brief_included')");
} else {
clauses.push("s.status = ?");
params.push(filters.status);
}
} else if (!filters.includePending) {
// Default listings hide x402-staged-but-unconfirmed rows. Use an explicit
// IN list (the non-pending statuses) so SQLite can hit
Expand Down
6 changes: 4 additions & 2 deletions src/routes/signals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ signalsRouter.get("/api/signals", async (c) => {
const status = c.req.query("status");
const includePending = c.req.query("include_pending") === "true";

if (status && !(SIGNAL_STATUSES as readonly string[]).includes(status)) {
return c.json({ error: `Invalid status. Must be one of: ${SIGNAL_STATUSES.join(", ")}` }, 400);
// status=accepted is a virtual filter (approved + brief_included), not a lifecycle state (#873)
const allowedStatuses = [...SIGNAL_STATUSES, "accepted"] as readonly string[];
if (status && !allowedStatuses.includes(status)) {
return c.json({ error: `Invalid status. Must be one of: ${allowedStatuses.join(", ")}` }, 400);
}

// Pending visibility is author-only. Require an `agent` filter that
Expand Down