singularity-forge/flake.nix
Mikael Hugo 0e2edfdebf feat: implement 3 quick wins for SF self-evolution
Quick Win 1: Close Self-Report Feedback Loop [9/10 impact]
- Added self-report-fixer.js module with automatic fix classification
- Pattern-based detection for high-confidence fixes (e.g., prompt rubrics)
- Deduplication and severity-based categorization of reports
- Designed for extension into triage-self-feedback pipeline

Quick Win 2: Activate Continuous Model Learning [8/10 impact]
- Added model-learner.js with ModelPerformanceTracker class
- Per-task-type tracking: success rate, latency, cost, token efficiency
- Auto-demotion for models failing >50% on specific task types
- A/B testing infrastructure for hypothesis testing on low-risk tasks
- Failure analysis with pattern detection (e.g., timeouts, quality issues)
- Storage: .sf/model-performance.json, .sf/model-failure-log.jsonl

Quick Win 3: Automate Knowledge Injection [7/10 impact]
- Added knowledge-injector.js with semantic similarity scoring
- Integrated into auto-prompts.js for execute-task prompts
- queryKnowledge already exists in context-store.js (60% done)
- Enhanced with: semantic matching, confidence filtering, contradiction detection
- Tracks knowledge usage for feedback loop

Integration:
- Modified auto-prompts.js to inject knowledge via knowledgeInjection variable
- Added getKnowledgeInjection helper for graceful degradation
- All new modules pass build check and are in dist/

Status: Core infrastructure in place; ready for integration into dispatch loop.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 22:01:37 +02:00

67 lines
1.7 KiB
Nix

{
description = "Development and build environment for singularity-forge";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
flake-utils.url = "github:numtide/flake-utils";
};
nixConfig = {
extra-substituters = [
"https://cache.centralcloud.com/default"
];
extra-trusted-public-keys = [
"default:ywfU21WX06iOn2Ec2lae1jYh4w8LO4IQkmp06vJzsk8="
];
};
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
};
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
bash
cargo
clippy
git
just
libsecret
pkg-config
protobuf
rust-analyzer
rustc
rustfmt
uv
zlib
];
shellHook = ''
export SF_SOURCE_DIR="${toString ./.}"
if [ -x "$HOME/.local/bin/mise" ]; then
MISE_NODE_BIN="$("$HOME/.local/bin/mise" which node 2>/dev/null || true)"
if [ -n "$MISE_NODE_BIN" ]; then
export PATH="$(dirname "$MISE_NODE_BIN"):$PATH"
fi
fi
export PATH="$SF_SOURCE_DIR/bin:$PATH"
export RUST_BACKTRACE=1
echo "singularity-forge development shell"
echo " cargo: $(command -v cargo)"
echo " node : $(command -v node)"
echo " protoc: $(command -v protoc)"
echo " rustc: $(command -v rustc)"
echo ""
echo "Build native addon:"
echo " node rust-engine/scripts/build.js"
'';
};
});
}