Compare commits

..

1 Commits

2 changed files with 18 additions and 53 deletions

View File

@@ -353,3 +353,11 @@ cp ~/.hermes/sessions/sessions.json ~/.hermes/sessions/sessions.json.bak.$(date
4. Keep docs-only PRs and script-import PRs on clean branches from `origin/main`; do not mix them with unrelated local history.
Until those are reconciled, trust this inventory over older prose.
### Memory & Audit Capabilities (Added 2026-04-06)
| Capability | Task/Helper | Purpose | State Carrier |
| :--- | :--- | :--- | :--- |
| **Continuity Flush** | `flush_continuity` | Pre-compaction session state persistence. | `~/.timmy/continuity/active.md` |
| **Sovereign Audit** | `audit_log` | Automated action logging with confidence signaling. | `~/.timmy/logs/audit.jsonl` |
| **Fallback Routing** | `get_model_for_task` | Dynamic model selection based on portfolio doctrine. | `fallback-portfolios.yaml` |

View File

@@ -1170,62 +1170,19 @@ def archive_pipeline_tick():
# ── Existing: Orchestration ──────────────────────────────────────────
TRIAGE_SYSTEM_PROMPT = (
"You are an expert issue triager for the Timmy project.\n"
"Analyze the issue title and body and categorize it into ONE of these labels: "
"bug, feature, ops, security, epic, documentation, research.\n"
"Return ONLY the label name in lowercase."
)
@huey.periodic_task(crontab(minute="*/15"))
def triage_issues():
"""Scan unassigned issues and automatically label them using gemma2:2b."""
"""Passively scan unassigned issues without posting comment spam."""
g = GiteaClient()
backlog = g.find_unassigned_issues(limit=20)
triaged = 0
# Ensure labels exist in the repo (simplified check)
# In a real scenario, we'd fetch or create them.
# For now, we assume standard labels exist.
for issue_info in backlog:
repo = issue_info.get("repo") if isinstance(issue_info, dict) else None
# find_unassigned_issues returns Issue objects if called on a repo,
# but the existing tasks.py implementation was a bit mixed.
# Let's fix it to be robust.
# Re-implementing triage_issues for better leverage
triaged_count = 0
for repo_path in REPOS:
issues = g.find_unassigned_issues(repo_path, limit=10)
for issue in issues:
# Skip if already has a category label
existing_labels = {l.name.lower() for l in issue.labels}
categories = {"bug", "feature", "ops", "security", "epic", "documentation", "research"}
if existing_labels & categories:
continue
prompt = f"Title: {issue.title}\nBody: {issue.body}"
label = hermes_local(
prompt=prompt,
model="gemma2:2b",
caller_tag="triage-classifier",
system_prompt=TRIAGE_SYSTEM_PROMPT
)
if label:
label = label.strip().lower().replace(".", "")
if label in categories:
# We need label IDs for add_labels, but Gitea also allows adding by name in some endpoints.
# GiteaClient.add_labels takes IDs. Let's assume we can find or just use create_comment for now
# if we don't have a label name -> ID map.
# Better: use a comment to 'suggest' the label if we can't easily map IDs.
g.create_comment(repo_path, issue.number, f"🤖 Triaged as: **{label}**")
triaged_count += 1
return {"triaged": triaged_count}
backlog = []
for repo in REPOS:
for issue in g.find_unassigned_issues(repo, limit=10):
backlog.append({
"repo": repo,
"issue": issue.number,
"title": issue.title,
})
return {"unassigned": len(backlog), "sample": backlog[:20]}
@huey.periodic_task(crontab(minute="*/30"))