feat: time-aware Super Contexte synthesis
- knowledge.py: classify trades by maturity before building synthesis prompt; only mature trades (≥35% elapsed) contribute to P&L stats and conclusions; immature trades listed for transparency only - Add 6h staleness gate on POST /synthesize (force=true to override) - System prompt now includes hard timing rule: GPT-4o must not revise existing conclusions because of newly-added immature trades - useApi.ts: useSynthesizeKnowledge accepts force boolean param - SuperContexte.tsx: shows amber notice with age when skipped + offers "Force quand même" button; success banner uses new response shape Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -526,11 +526,14 @@ export const useKnowledgeEntries = () =>
|
||||
export const useSynthesizeKnowledge = () => {
|
||||
const qc = useQueryClient()
|
||||
return useMutation({
|
||||
mutationFn: () => api.post('/knowledge/synthesize').then(r => r.data),
|
||||
onSuccess: () => {
|
||||
qc.invalidateQueries({ queryKey: ['knowledge-state'] })
|
||||
qc.invalidateQueries({ queryKey: ['knowledge-history'] })
|
||||
qc.invalidateQueries({ queryKey: ['knowledge-entries'] })
|
||||
mutationFn: (force: boolean = false) =>
|
||||
api.post(`/knowledge/synthesize${force ? '?force=true' : ''}`).then(r => r.data),
|
||||
onSuccess: (_data) => {
|
||||
if (!_data?.skipped) {
|
||||
qc.invalidateQueries({ queryKey: ['knowledge-state'] })
|
||||
qc.invalidateQueries({ queryKey: ['knowledge-history'] })
|
||||
qc.invalidateQueries({ queryKey: ['knowledge-entries'] })
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user