fix(dashboard): tolerate string decisions, derive active projects, log passive activations#23
Open
juanparisma wants to merge 1 commit into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three fixes found while auditing a live Sinapsis install.
1.
collect_decisionscrashes on string-form decisions_operator-state.jsoncan storestrategicDecisionsas a list of plain strings. The current code calls.get('date')on each item, raisingAttributeError: '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_projectsalways reports 0 active projectsactivewas computed as[p for p in projects if p.get('active')], but the registry never sets anactiveflag, 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.shinjected matched rules but never wrote a log, socollect_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 formatcollect_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.lognow populates on tool use.py_compileand a functional smoke test pass for both files.