aboutsummaryrefslogtreecommitdiff
path: root/scripts/newos4-feedback-collect.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/newos4-feedback-collect.py')
-rwxr-xr-xscripts/newos4-feedback-collect.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/newos4-feedback-collect.py b/scripts/newos4-feedback-collect.py
index 5e173a1..6356d2a 100755
--- a/scripts/newos4-feedback-collect.py
+++ b/scripts/newos4-feedback-collect.py
@@ -71,6 +71,13 @@ def decisions():
return out
+def plan_key(name):
+ # The ledger has both spellings (2026-10-23..27 rows carry no `.md`), so a strict
+ # `dec.get('plan:' + name)` misses five decisions and the page then shows decided plans
+ # as awaiting. Normalise on READ — the ledger is an audit log, never rewritten.
+ return 'plan:' + (name if name.endswith('.md') else name + '.md')
+
+
def plans_needing_decision(dec):
items = []
for p in sorted(glob.glob(os.path.join(PLANS, '*.md'))):
@@ -97,7 +104,7 @@ def plans_needing_decision(dec):
tasks = [l.lstrip('#').strip() for l in lines if re.match(r'^#{2,3}\s+Task\b', l)][:20]
status = [l.strip() for l in lines if l.startswith('## Status') or l.startswith('## Implementation')][:2]
done = execution_stamp(lines)
- d = dec.get('plan:' + name, {})
+ d = dec.get(plan_key(name), {})
items.append({
'id': 'plan:' + name, 'kind': 'plan', 'title': title, 'path': p,
'size': os.path.getsize(p), 'mtime': datetime.fromtimestamp(
@@ -132,6 +139,9 @@ def reports_needing_decision(dec):
'new': rid in new_ids, 'decision': d.get('decision'),
'decided_at': d.get('decided_at') or d.get('ts'), 'note': d.get('note', ''),
'actor': d.get('actor', ''),
+ # A decision written in the 2026-10-26 bulk pass is not the same evidence as one
+ # written today; the card marks it so the provenance is visible at a glance.
+ 'bulk_pass': bool(str(d.get('ts', '')).startswith('2026-10-26')),
'message': (r.get('body') or '')[:1500], 'page': diag.get('url') or '',
'version': diag.get('version') or '', 'ua': (diag.get('ua') or '')[:120],
'errors': [str(e)[:300] for e in errs[:3]],
@@ -178,6 +188,9 @@ def main():
'awaiting_decision': len(awaiting),
'steering_pending': len(steer) if steer_ok else -1, # -1 = steering.json unreadable/wrong shape
'triage_reports_new': (triage.get('counts') or {}).get('reports_new', 0),
+ # The chat plane used to be visible nowhere; this tile is the count of items that
+ # arrived through it (scripts/newos4-chat-ingest.py).
+ 'chat_total': sum(1 for r in reports if '-chat-' in r['id']),
},
'plans': plans, 'reports': reports, 'steering': steer[:20],
'recent_apply': recent_apply(8),