stark-ai-de/agent-skills / incubator/skills/engineering-workflows/hindsight-memory
hindsight-memory
VerifiedSet up, diagnose, enable or use scoped Hindsight memory without requiring Greppy. Use when the user requests approved project or workspace memory, compact Codex/pi session outcomes or source-backed reflection. Not for global memory cleanup or implicit ingestion of search-indexed repositories.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.4 KB |
| assets/compose.yaml | config | 2.7 KB |
| assets/parser.nix | other | 783 B |
| assets/project.example.json | config | 873 B |
| assets/workspace.example.json | config | 1.1 KB |
| diagnostics/bank_aliases.py | script | 7.0 KB |
| diagnostics/workspace_status.py | script | 2.8 KB |
| references/setup.md | markdown | 23.9 KB |
| scripts/activate.py | script | 3.2 KB |
| scripts/build_parser.py | script | 2.6 KB |
| scripts/initialize.py | script | 5.1 KB |
| scripts/mcp_launcher.py | script | 9.1 KB |
| scripts/metrics.py | script | 4.6 KB |
| scripts/private_policy.py | script | 1.4 KB |
| scripts/project_scope.py | script | 13.7 KB |
| scripts/session_hook.py | script | 6.1 KB |
| scripts/session_parser.py | script | 11.0 KB |
| scripts/weekly.py | script | 19.5 KB |
| scripts/worker.py | script | 8.8 KB |
| scripts/workspace_scope.py | script | 13.1 KB |
scripts/activate.py
View on GitHub#!/usr/bin/env python3
"""Enable the pilot after recording the agreed manual comparison results."""
import argparse
import datetime
import json
import os
from pathlib import Path
import shlex
import stat
import sys
def activate(home, evidence_path):
fd = os.open(evidence_path, os.O_RDONLY | os.O_NOFOLLOW)
with os.fdopen(fd, encoding="utf-8") as stream:
info = os.fstat(stream.fileno())
if not stat.S_ISREG(info.st_mode) or info.st_uid != os.getuid() or stat.S_IMODE(info.st_mode) != 0o600:
raise ValueError("evidence permissions")
evidence = json.load(stream)
cases = evidence["cases"]
if (evidence["embedding_dimensions"] != 1024 or evidence["bilingual_retrieval"] is not True
or not (evidence.get("model_route_reviewed") is True
or evidence.get("model_route_privacy_accepted") is True) or len(cases) != 6
or {case["kind"] for case in cases} != {"recall", "reflect"}
or any(not isinstance(case["id"], str) or not case["id"].strip() for case in cases)
or len({case["id"] for case in cases}) != 6
or any(type(case[key]) is not bool for case in cases for key in ("hindsight_correct", "baseline_correct", "false_recurrence"))
or any(case["false_recurrence"] for case in cases)):
raise ValueError("qualification incomplete")
score = sum(case["hindsight_correct"] for case in cases)
if score < 5:
raise ValueError("accuracy threshold")
config = Path(home) / ".config/hindsight-greppy/runtime.env"
fd = os.open(config, os.O_RDONLY | os.O_NOFOLLOW)
with os.fdopen(fd, encoding="utf-8") as stream:
info = os.fstat(stream.fileno())
if not stat.S_ISREG(info.st_mode) or info.st_uid != os.getuid() or stat.S_IMODE(info.st_mode) != 0o600:
raise ValueError("runtime permissions")
providers = [shlex.split(value) for line in stream for key, sep, value in [line.rstrip().partition("=")] if sep and key == "HINDSIGHT_API_LLM_PROVIDER"]
if len(providers) != 1 or providers[0] not in (["openai-codex"], ["openai-responses"], ["ollama"]):
raise ValueError("model provider")
state = Path(home) / ".local/state/hindsight-greppy"
state.mkdir(parents=True, exist_ok=True, mode=0o700)
info = state.lstat()
if not stat.S_ISDIR(info.st_mode) or info.st_uid != os.getuid() or stat.S_IMODE(info.st_mode) & 0o077:
raise ValueError("state permissions")
target = state / "pilot-start"
fd = os.open(target, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o600)
with os.fdopen(fd, "w", encoding="utf-8") as stream:
stream.write(datetime.datetime.now(datetime.timezone.utc).isoformat() + "\n")
return target
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--evidence", required=True, type=Path)
args = parser.parse_args()
try:
activate(Path.home(), args.evidence)
except (OSError, ValueError, KeyError, TypeError):
print("Pilot not activated: evidence, permissions or thresholds need review.", file=sys.stderr)
return 1
print("Pilot activated. Only new eligible Greppy CLI sessions will be queued.")
return 0
if __name__ == "__main__":
sys.exit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |