feat(v1.1): item 6 — dry-catalog messaging (forged batches with 0 fresh are labeled)
section_state now mirrors the composed recipe at body.recipe; the forge note appends 'catalog fully reviewed' when the batch has zero fresh cards. The FE shows the BACKLOG sentence in the report (dryCap) and in the forge status line whenever recipe.new===0 with cards served; a non-dry forge behaves exactly as before. No new fetch loops.
This commit is contained in:
@@ -530,6 +530,11 @@ def create_app(db_path, img_dir, state_dir=None):
|
||||
conn, engine, size=size,
|
||||
profile_version=prof['version'] if prof else None,
|
||||
note=note)
|
||||
# v1.1 item 6: label the dry-catalog state on the forge note
|
||||
recipe = (json.loads(newsec['recipe'])
|
||||
if newsec['recipe'] else {})
|
||||
if recipe.get('new') == 0:
|
||||
note = '%s · catalog fully reviewed' % (note or '')
|
||||
return section_state(conn, newsec, note=note)
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
@@ -219,6 +219,7 @@ nav{height:calc(68px + env(safe-area-inset-bottom,0px));display:flex;align-items
|
||||
<div id="repLine2"></div>
|
||||
<button class="rforge" id="btnForge">Forge next 25</button>
|
||||
<div class="rstatus" id="forgeStatus"></div>
|
||||
<div class="rcap" id="dryCap" style="display:none">Catalog fully reviewed — fresh listings arrive with the next 08:30 import; showing second looks</div>
|
||||
<div class="rmode" id="modeRow">
|
||||
<span id="modeOnd" class="on">on demand</span><i class="sep">⇄</i><span id="modeStr">strict</span>
|
||||
<div class="rcap" id="strictCap" style="display:none">Waiting for the nightly read — next section after the agent runs.</div>
|
||||
@@ -1191,6 +1192,8 @@ function paintMode(){
|
||||
}
|
||||
function updateSectionUI(body){
|
||||
sectTotal=body.progress.total;
|
||||
// item 6: the dry-catalog caption rides every hydrate (legacy API -> absent)
|
||||
$('dryCap').style.display= dryLabel(body)?'':'none';
|
||||
let decided=0;
|
||||
for(const it of (body.items||[])){
|
||||
const local=localDecisions.get(it.id);
|
||||
@@ -1231,6 +1234,13 @@ async function setRubricDebug(m){
|
||||
}
|
||||
$('tRubOff').onclick=()=>setRubricDebug('off');
|
||||
$('tRubOn').onclick=()=>setRubricDebug('on');
|
||||
/* item 6: dry catalog — a forged batch with zero fresh cards is labeled,
|
||||
never silent (BACKLOG "Dry-catalog messaging"). */
|
||||
const DRY_MSG='Catalog fully reviewed — fresh listings arrive with the next 08:30 import; showing second looks';
|
||||
function dryLabel(body){
|
||||
return !!(body && body.recipe && body.recipe.new===0
|
||||
&& body.items && body.items.length>0);
|
||||
}
|
||||
$('btnForge').onclick=async()=>{
|
||||
if(forgeBusy||!section) return;
|
||||
forgeBusy=true;
|
||||
@@ -1240,8 +1250,10 @@ $('btnForge').onclick=async()=>{
|
||||
const res=await fetch('/api/section/forge',{method:'POST',headers:{'Content-Type':'application/json'},body:'{}'});
|
||||
const body=await res.json();
|
||||
if(res.ok){
|
||||
$('forgeStatus').textContent= body.note&&body.note.indexOf('fallback')>=0
|
||||
?'Agent offline — forging on the last read.':'';
|
||||
$('forgeStatus').textContent= dryLabel(body)
|
||||
?DRY_MSG
|
||||
:(body.note&&body.note.indexOf('fallback')>=0
|
||||
?'Agent offline — forging on the last read.':'');
|
||||
section=body;
|
||||
buffer.length=0;
|
||||
const live=new Set([...pile.map(c=>c.d.id),...hist.map(h=>h.id)]);
|
||||
|
||||
Reference in New Issue
Block a user