singularity-forge/docker/Dockerfile.sandbox
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

43 lines
1.5 KiB
Text

# ──────────────────────────────────────────────
# SF Docker Sandbox Template
# Base: docker/sandbox-templates:shell
# Purpose: Isolated environment for SF auto mode
# Usage: docker sandbox create --template ./docker
# ──────────────────────────────────────────────
FROM node:24-bookworm-slim
# System dependencies required by SF
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
curl \
ca-certificates \
openssh-client \
gosu \
libsecret-1-0 \
&& rm -rf /var/lib/apt/lists/*
# Install SF globally — version controlled via build arg
ARG SF_VERSION=latest
RUN npm install -g singularity-forge@${SF_VERSION}
# Create non-root user for sandbox isolation
RUN groupadd --gid 1000 sf \
&& useradd --uid 1000 --gid sf --shell /bin/bash --create-home sf
# Persistent SF state directory
RUN mkdir -p /home/sf/.sf && chown -R sf:sf /home/sf/.sf
# Workspace directory — synced from host via Docker sandbox
WORKDIR /workspace
RUN chown sf:sf /workspace
# Entrypoint handles UID/GID remapping, bootstrap, and drops to sf user
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
COPY bootstrap.sh /usr/local/bin/bootstrap.sh
RUN chmod +x /usr/local/bin/entrypoint.sh /usr/local/bin/bootstrap.sh
# Expose default SF web UI port
EXPOSE 3000
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["sf", "--help"]