Skip to content

fix(dashboard): tolerate string decisions, derive active projects, log passive activations#23

Open
juanparisma wants to merge 1 commit into
Luispitik:mainfrom
juanparisma:fix/dashboard-decisions-and-passive-telemetry
Open

fix(dashboard): tolerate string decisions, derive active projects, log passive activations#23
juanparisma wants to merge 1 commit into
Luispitik:mainfrom
juanparisma:fix/dashboard-decisions-and-passive-telemetry

Conversation

@juanparisma
Copy link
Copy Markdown

Three fixes found while auditing a live Sinapsis install.

1. collect_decisions crashes on string-form decisions

_operator-state.json can store strategicDecisions as a list of plain strings. The current code calls .get('date') on each item, raising AttributeError: 'str' object has no attribute 'get' and aborting the whole dashboard generation. Now tolerates both shapes (objects {id,date,decision} and plain strings).

2. collect_projects always reports 0 active projects

active was computed as [p for p in projects if p.get('active')], but the registry never sets an active flag, so the dashboard always showed 0 projects even with thousands of observations. Now derives 'active' from observation recency (≤14 days) and resolves friendly project names from the registry / last observation instead of showing raw dir hashes.

3. Passive rules fire silently — no telemetry

_passive-activator.sh injected matched rules but never wrote a log, so collect_passive_log() always returned empty and the dashboard reported 0 passive activations. Added a one-line-per-fired-rule append to _passive.log (TIMESTAMP | rule_id | tool), matching the format collect_passive_log() already parses. Mirrors how the instinct activator logs to _instinct.log.

All three verified against a real install (Windows, py 3.12 / node 24): dashboard went from 'Projects: 0' to the real count, and _passive.log now populates on tool use. py_compile and a functional smoke test pass for both files.

…g passive activations

- collect_decisions: handle strategicDecisions as plain strings (not just
  objects). Previously crashed with AttributeError: 'str' has no 'get' when
  operator-state stored decisions as strings.
- collect_projects: 'active' count was always 0 because the registry never
  sets an 'active' flag. Now derives activity from observation recency
  (<=14d) and resolves friendly project names from the registry/observations
  instead of showing raw hashes.
- _passive-activator.sh: write fired rule activations to _passive.log
  ('TS | rule_id | tool') so the dashboard and /passive-status can report
  passive-rule telemetry. Previously passive rules fired silently with no
  log, so activation counts were always 0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant