mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-30 11:22:34 +00:00
fix: Bun+Windows write-through EEXIST, non-Anthropic --max-cost pricing, dream-page exclusion in enrich (#2407)
* fix(write-through): guard mkdir against EEXIST on Bun+Windows Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(budget): resolve non-Anthropic model pricing via canonical table under --max-cost Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(enrich): exclude dream-generated pages from thin candidates Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
503f61e6e4
commit
2941e17798
@@ -6255,6 +6255,12 @@ export class PostgresEngine implements BrainEngine {
|
||||
)`
|
||||
: sql``;
|
||||
|
||||
// Exclude dream/synthesize-generated pages (reflections, originals, cycle
|
||||
// logs carrying frontmatter dream_generated:true). enrich develops ENTITY
|
||||
// stubs; running it on a generated essay/log creates circular self-citation
|
||||
// and drops the H1. IS DISTINCT FROM 'true' keeps NULL/'false' rows.
|
||||
const dreamCondition = sql`AND (p.frontmatter ->> 'dream_generated') IS DISTINCT FROM 'true'`;
|
||||
|
||||
// Whitelisted ORDER BY (no injection — enum maps to a literal fragment).
|
||||
const orderKey = ENRICH_ORDER_SQL[opts.order] ? opts.order : 'inbound-links';
|
||||
const orderBy = sql.unsafe(ENRICH_ORDER_SQL[orderKey]);
|
||||
@@ -6278,6 +6284,7 @@ export class PostgresEngine implements BrainEngine {
|
||||
AND (char_length(p.compiled_truth) + char_length(COALESCE(p.timeline, ''))) < ${threshold}
|
||||
${sourceCondition}
|
||||
${recencyCondition}
|
||||
${dreamCondition}
|
||||
ORDER BY ${orderBy}
|
||||
LIMIT ${limit}
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user