chore: init sf

This commit is contained in:
Mikael Hugo 2026-05-06 23:03:20 +02:00
parent 30f8738585
commit fec30b8278
950 changed files with 2592 additions and 41 deletions

View file

@ -0,0 +1,10 @@
<!-- sf-doc: version=2.75.3 template=.sf/ANTI-GOALS.md state=pending hash=sha256:56b4f7d20d49e4558ac5aea5e967cf3475ef98d68dfa8985ba42b3e2b0d72e25 -->
# Anti-goals
What we explicitly DON'T want. Things that look attractive but we've decided against.
This is gold — most wrong agent calls come from not knowing what to avoid. Each entry: 1-2 sentences with the rationale.
## Examples
- (replace with your own)

486
.sf.migrating/CODEBASE.md Normal file
View file

@ -0,0 +1,486 @@
# Codebase Map
Generated: 2026-05-06T20:40:10Z | Files: 500 | Described: 0/500
<!-- sf:codebase-meta {"generatedAt":"2026-05-06T20:40:10Z","fingerprint":"1102b7e8b36bb171521c69842babb2a19a3f5bef","fileCount":500,"truncated":true} -->
Note: Truncated to first 500 files. Run with higher --max-files to include all.
## Project Knowledge
Generated orientation scaffold. SF should enrich these sections with verified findings before promoting milestone context.
### Stack Signals
- Node.js package manifest present
- TypeScript source detected
- Container/runtime configuration present
- Nix/NixOS configuration present
### Critical Paths To Investigate
- src/ is a likely implementation boundary to map before planning
- packages/ is a likely implementation boundary to map before planning
- scripts/ may contain repo-owned build, test, or deploy entrypoints
- docs/ may contain product or architecture decisions that constrain roadmap scope
- Tracked tests exist; map coverage against the primary user/runtime flows
### Verification Commands To Prove
- npm test or the package.json test script
### Skill Needs
- TypeScript/Node project maintenance
- Containerized runtime and deployment review
- Nix build and deployment review
### Knowledge Gaps To Close
- Fill descriptions for active milestone files after reading them, not from filenames alone
- Record verified runtime boundaries, external services, data stores, and missing skills before final CONTEXT.md
## File Map
### (root)/
- *(38 files: 18 .md, 16 (no ext), 3 .json, 1 .nix)*
### .github/
- `.github/CODEOWNERS`
- `.github/FUNDING.yml`
- `.github/PULL_REQUEST_TEMPLATE.md`
### .github/ISSUE_TEMPLATE/
- `.github/ISSUE_TEMPLATE/bug_report.yml`
- `.github/ISSUE_TEMPLATE/config.yml`
- `.github/ISSUE_TEMPLATE/feature_request.yml`
### .github/workflows/
- `.github/workflows/ai-triage.yml`
- `.github/workflows/build-native.yml`
- `.github/workflows/ci.yml`
- `.github/workflows/cleanup-dev-versions.yml`
- `.github/workflows/dev-publish.yml`
- `.github/workflows/forensics-check.yml`
- `.github/workflows/next-publish.yml`
- `.github/workflows/pipeline.yml`
- `.github/workflows/pr-risk.yml`
- `.github/workflows/prod-release.yml`
- `.github/workflows/version-check.yml`
### .sift_test_dir/
- `.sift_test_dir/secret.txt`
### .vtcode/
- `.vtcode/README.md`
- `.vtcode/tool-policy.json`
### .vtcode/history/
- `.vtcode/history/session-singularity-forge-202605.memory.json`
### .vtcode/logs/
- `.vtcode/logs/trajectory-20260506T065806Z.jsonl`
- `.vtcode/logs/trajectory.jsonl`
### .vtcode/state/
- `.vtcode/state/background_subagents.json`
### .vtcode/terminals/
- `.vtcode/terminals/INDEX.md`
### bin/
- `bin/sf-from-source`
### docker/
- `docker/.env.example`
- `docker/bootstrap.sh`
- `docker/docker-compose.full.yaml`
- `docker/docker-compose.yaml`
- `docker/Dockerfile.ci-builder`
- `docker/Dockerfile.sandbox`
- `docker/entrypoint.sh`
- `docker/README.md`
### docs/
- `docs/DESIGN.md`
- `docs/FRONTEND.md`
- `docs/PLANS.md`
- `docs/PRODUCT_SENSE.md`
- `docs/QUALITY_SCORE.md`
- `docs/README.md`
- `docs/RECORDS_KEEPER.md`
- `docs/RELIABILITY.md`
- `docs/SECURITY.md`
- `docs/SPEC_FIRST_TDD.md`
### docs/adr/
- `docs/adr/0000-purpose-to-software-compiler.md`
- `docs/adr/0001-promote-only-sf-state.md`
- `docs/adr/0002-sf-schedule-pull-based.md`
- `docs/adr/0075-uok-gate-architecture.md`
- `docs/adr/README.md`
### docs/design-docs/
- `docs/design-docs/ADR-TEMPLATE.md`
- `docs/design-docs/core-beliefs.md`
- `docs/design-docs/index.md`
- `docs/design-docs/notification-event-model.md`
### docs/dev/
- *(34 files: 34 .md)*
### docs/dev/building-coding-agents/
- *(26 files: 26 .md)*
### docs/dev/context-and-hooks/
- `docs/dev/context-and-hooks/01-the-context-pipeline.md`
- `docs/dev/context-and-hooks/02-hook-reference.md`
- `docs/dev/context-and-hooks/03-context-injection-patterns.md`
- `docs/dev/context-and-hooks/04-message-types-and-llm-visibility.md`
- `docs/dev/context-and-hooks/05-inter-extension-communication.md`
- `docs/dev/context-and-hooks/06-advanced-patterns-from-source.md`
- `docs/dev/context-and-hooks/07-the-system-prompt-anatomy.md`
- `docs/dev/context-and-hooks/README.md`
### docs/dev/extending-pi/
- *(27 files: 27 .md)*
### docs/dev/pi-ui-tui/
- *(24 files: 24 .md)*
### docs/dev/proposals/
- `docs/dev/proposals/698-browser-tools-feature-additions.md`
- `docs/dev/proposals/rfc-gitops-branching-strategy.md`
### docs/dev/proposals/workflows/
- `docs/dev/proposals/workflows/backmerge.yml`
- `docs/dev/proposals/workflows/create-release.yml`
- `docs/dev/proposals/workflows/README.md`
- `docs/dev/proposals/workflows/sync-next.yml`
### docs/dev/what-is-pi/
- `docs/dev/what-is-pi/01-what-pi-is.md`
- `docs/dev/what-is-pi/02-design-philosophy.md`
- `docs/dev/what-is-pi/03-the-four-modes-of-operation.md`
- `docs/dev/what-is-pi/04-the-architecture-how-everything-fits-together.md`
- `docs/dev/what-is-pi/05-the-agent-loop-how-pi-thinks.md`
- `docs/dev/what-is-pi/06-tools-how-pi-acts-on-the-world.md`
- `docs/dev/what-is-pi/07-sessions-memory-that-branches.md`
- `docs/dev/what-is-pi/08-compaction-how-pi-manages-context-limits.md`
- `docs/dev/what-is-pi/09-the-customization-stack.md`
- `docs/dev/what-is-pi/10-providers-models-multi-model-by-default.md`
- `docs/dev/what-is-pi/11-the-interactive-tui.md`
- `docs/dev/what-is-pi/12-the-message-queue-talking-while-pi-thinks.md`
- `docs/dev/what-is-pi/13-context-files-project-instructions.md`
- `docs/dev/what-is-pi/14-the-sdk-rpc-embedding-pi.md`
- `docs/dev/what-is-pi/15-pi-packages-the-ecosystem.md`
- `docs/dev/what-is-pi/16-why-pi-matters-what-makes-it-different.md`
- `docs/dev/what-is-pi/17-file-reference-all-documentation.md`
- `docs/dev/what-is-pi/18-quick-reference-commands-shortcuts.md`
- `docs/dev/what-is-pi/19-building-branded-apps-on-top-of-pi.md`
- `docs/dev/what-is-pi/README.md`
### docs/exec-plans/
- `docs/exec-plans/tech-debt-tracker.md`
### docs/exec-plans/active/
- `docs/exec-plans/active/index.md`
### docs/exec-plans/completed/
- `docs/exec-plans/completed/index.md`
### docs/generated/
- `docs/generated/db-schema.md`
### docs/plans/
- `docs/plans/README.md`
- `docs/plans/todo-triage-2026-05-06-plan.md`
### docs/product-specs/
- `docs/product-specs/index.md`
- `docs/product-specs/new-user-onboarding.md`
- `docs/product-specs/notification-source-hygiene.md`
### docs/records/
- `docs/records/2026-05-01-repo-vcs-and-notifications.md`
- `docs/records/2026-05-02-bug-hunt-findings.md`
- `docs/records/2026-05-02-pdd-v2-research.md`
- `docs/records/index.md`
### docs/references/
- `docs/references/design-system-reference-llms.txt`
- `docs/references/nixpacks-llms.txt`
- `docs/references/uv-llms.txt`
### docs/specs/
- `docs/specs/README.md`
- `docs/specs/sf-schedule.md`
### docs/user-docs/
- `docs/user-docs/auto-mode.md`
- `docs/user-docs/captures-triage.md`
- `docs/user-docs/commands.md`
- `docs/user-docs/configuration.md`
- `docs/user-docs/cost-management.md`
- `docs/user-docs/custom-models.md`
- `docs/user-docs/dynamic-model-routing.md`
- `docs/user-docs/getting-started.md`
- `docs/user-docs/git-strategy.md`
- `docs/user-docs/migration.md`
- `docs/user-docs/parallel-orchestration.md`
- `docs/user-docs/providers.md`
- `docs/user-docs/remote-questions.md`
- `docs/user-docs/skills.md`
- `docs/user-docs/token-optimization.md`
- `docs/user-docs/troubleshooting.md`
- `docs/user-docs/visualizer.md`
- `docs/user-docs/web-interface.md`
- `docs/user-docs/working-in-teams.md`
### gitbook/
- `gitbook/README.md`
- `gitbook/SUMMARY.md`
### gitbook/configuration/
- `gitbook/configuration/custom-models.md`
- `gitbook/configuration/git-settings.md`
- `gitbook/configuration/mcp-servers.md`
- `gitbook/configuration/notifications.md`
- `gitbook/configuration/preferences.md`
- `gitbook/configuration/providers.md`
### gitbook/core-concepts/
- `gitbook/core-concepts/auto-mode.md`
- `gitbook/core-concepts/project-structure.md`
- `gitbook/core-concepts/step-mode.md`
### gitbook/features/
- `gitbook/features/captures.md`
- `gitbook/features/cost-management.md`
- `gitbook/features/dynamic-model-routing.md`
- `gitbook/features/github-sync.md`
- `gitbook/features/headless.md`
- `gitbook/features/parallel.md`
- `gitbook/features/remote-questions.md`
- `gitbook/features/skills.md`
- `gitbook/features/teams.md`
- `gitbook/features/token-optimization.md`
- `gitbook/features/visualizer.md`
- `gitbook/features/web-interface.md`
- `gitbook/features/workflow-templates.md`
### gitbook/getting-started/
- `gitbook/getting-started/choosing-a-model.md`
- `gitbook/getting-started/first-project.md`
- `gitbook/getting-started/installation.md`
### gitbook/reference/
- `gitbook/reference/cli-flags.md`
- `gitbook/reference/commands.md`
- `gitbook/reference/environment-variables.md`
- `gitbook/reference/keyboard-shortcuts.md`
- `gitbook/reference/migration.md`
- `gitbook/reference/troubleshooting.md`
### mintlify-docs/
- `mintlify-docs/docs.json`
- `mintlify-docs/getting-started.mdx`
- `mintlify-docs/introduction.mdx`
### mintlify-docs/guides/
- `mintlify-docs/guides/auto-mode.mdx`
- `mintlify-docs/guides/captures-triage.mdx`
- `mintlify-docs/guides/change-management.mdx`
- `mintlify-docs/guides/commands.mdx`
- `mintlify-docs/guides/configuration.mdx`
- `mintlify-docs/guides/cost-management.mdx`
- `mintlify-docs/guides/custom-models.mdx`
- `mintlify-docs/guides/dynamic-model-routing.mdx`
- `mintlify-docs/guides/git-strategy.mdx`
- `mintlify-docs/guides/migration.mdx`
- `mintlify-docs/guides/parallel-orchestration.mdx`
- `mintlify-docs/guides/remote-questions.mdx`
- `mintlify-docs/guides/skills.mdx`
- `mintlify-docs/guides/token-optimization.mdx`
- `mintlify-docs/guides/troubleshooting.mdx`
- `mintlify-docs/guides/visualizer.mdx`
- `mintlify-docs/guides/web-interface.mdx`
- `mintlify-docs/guides/working-in-teams.mdx`
### packages/daemon/
- `packages/daemon/package.json`
- `packages/daemon/tsconfig.json`
### packages/daemon/src/
- *(29 files: 29 .ts)*
### packages/native/
- `packages/native/package.json`
- `packages/native/tsconfig.json`
### packages/native/src/
- `packages/native/src/index.ts`
- `packages/native/src/native.ts`
### packages/native/src/__tests__/
- `packages/native/src/__tests__/clipboard.test.mjs`
- `packages/native/src/__tests__/diff.test.mjs`
- `packages/native/src/__tests__/edit.test.mjs`
- `packages/native/src/__tests__/fd.test.mjs`
- `packages/native/src/__tests__/glob.test.mjs`
- `packages/native/src/__tests__/grep.test.mjs`
- `packages/native/src/__tests__/highlight.test.mjs`
- `packages/native/src/__tests__/html.test.mjs`
- `packages/native/src/__tests__/image.test.mjs`
- `packages/native/src/__tests__/json-parse.test.mjs`
- `packages/native/src/__tests__/module-compat.test.mjs`
- `packages/native/src/__tests__/ps.test.mjs`
- `packages/native/src/__tests__/stream-process.test.mjs`
- `packages/native/src/__tests__/symbol.test.mjs`
- `packages/native/src/__tests__/text.test.mjs`
- `packages/native/src/__tests__/truncate.test.mjs`
- `packages/native/src/__tests__/ttsr.test.mjs`
- `packages/native/src/__tests__/watch.test.mjs`
- `packages/native/src/__tests__/xxhash.test.mjs`
### packages/native/src/ast/
- `packages/native/src/ast/index.ts`
- `packages/native/src/ast/types.ts`
### packages/native/src/clipboard/
- `packages/native/src/clipboard/index.ts`
- `packages/native/src/clipboard/types.ts`
### packages/native/src/diff/
- `packages/native/src/diff/index.ts`
- `packages/native/src/diff/types.ts`
### packages/native/src/edit/
- `packages/native/src/edit/index.ts`
- `packages/native/src/edit/types.ts`
### packages/native/src/fd/
- `packages/native/src/fd/index.ts`
- `packages/native/src/fd/types.ts`
### packages/native/src/forge-parser/
- `packages/native/src/forge-parser/index.ts`
- `packages/native/src/forge-parser/types.ts`
### packages/native/src/glob/
- `packages/native/src/glob/index.ts`
- `packages/native/src/glob/types.ts`
### packages/native/src/grep/
- `packages/native/src/grep/index.ts`
- `packages/native/src/grep/types.ts`
### packages/native/src/highlight/
- `packages/native/src/highlight/index.ts`
- `packages/native/src/highlight/types.ts`
### packages/native/src/html/
- `packages/native/src/html/index.ts`
- `packages/native/src/html/types.ts`
### packages/native/src/image/
- `packages/native/src/image/index.ts`
- `packages/native/src/image/types.ts`
### packages/native/src/json-parse/
- `packages/native/src/json-parse/index.ts`
### packages/native/src/ps/
- `packages/native/src/ps/index.ts`
- `packages/native/src/ps/types.ts`
### packages/native/src/stream-process/
- `packages/native/src/stream-process/index.ts`
### packages/native/src/text/
- `packages/native/src/text/index.ts`
- `packages/native/src/text/types.ts`
### packages/native/src/truncate/
- `packages/native/src/truncate/index.ts`
### packages/native/src/ttsr/
- `packages/native/src/ttsr/index.ts`
- `packages/native/src/ttsr/types.ts`
### packages/native/src/xxhash/
- `packages/native/src/xxhash/index.ts`
### packages/pi-agent-core/
- `packages/pi-agent-core/package.json`
- `packages/pi-agent-core/tsconfig.json`
### packages/pi-agent-core/src/
- `packages/pi-agent-core/src/agent-loop.test.ts`
- `packages/pi-agent-core/src/agent-loop.ts`
- `packages/pi-agent-core/src/agent.test.ts`
- `packages/pi-agent-core/src/agent.ts`
- `packages/pi-agent-core/src/index.ts`
- `packages/pi-agent-core/src/interactive-questions.test.ts`
- `packages/pi-agent-core/src/interactive-questions.ts`
- `packages/pi-agent-core/src/proxy.ts`
- `packages/pi-agent-core/src/sf-graph.ts`
- `packages/pi-agent-core/src/types.ts`
### packages/pi-ai/
- `packages/pi-ai/bedrock-provider.d.ts`
- `packages/pi-ai/bedrock-provider.js`
- `packages/pi-ai/oauth.d.ts`
- `packages/pi-ai/oauth.js`
- `packages/pi-ai/package.json`
- `packages/pi-ai/tsconfig.json`
### packages/pi-ai/scripts/
- `packages/pi-ai/scripts/generate-models.ts`
### packages/pi-ai/src/
- `packages/pi-ai/src/api-registry.ts`
- `packages/pi-ai/src/bedrock-provider.ts`
- `packages/pi-ai/src/cli.ts`
- `packages/pi-ai/src/env-api-keys.test.ts`
- `packages/pi-ai/src/env-api-keys.ts`
- `packages/pi-ai/src/index.ts`
- `packages/pi-ai/src/models.custom.ts`
- `packages/pi-ai/src/models.generated.test.ts`
- `packages/pi-ai/src/models.generated.ts`
- `packages/pi-ai/src/models.test.ts`
- `packages/pi-ai/src/models.ts`
- `packages/pi-ai/src/oauth.ts`
- `packages/pi-ai/src/stream.ts`
- `packages/pi-ai/src/types.ts`
- `packages/pi-ai/src/web-runtime-env-api-keys.ts`
- `packages/pi-ai/src/web-runtime-oauth.ts`
### packages/pi-ai/src/providers/
- *(31 files: 30 .ts, 1 .md)*
### packages/pi-ai/src/utils/
- `packages/pi-ai/src/utils/event-stream.test.ts`
- `packages/pi-ai/src/utils/event-stream.ts`
- `packages/pi-ai/src/utils/hash.ts`
- `packages/pi-ai/src/utils/json-parse.ts`
- `packages/pi-ai/src/utils/overflow.ts`
- `packages/pi-ai/src/utils/repair-tool-json.ts`
- `packages/pi-ai/src/utils/sanitize-unicode.ts`
- `packages/pi-ai/src/utils/typebox-helpers.ts`
- `packages/pi-ai/src/utils/validation.ts`
### packages/pi-ai/src/utils/oauth/
- `packages/pi-ai/src/utils/oauth/github-copilot.test.ts`
- `packages/pi-ai/src/utils/oauth/github-copilot.ts`
- `packages/pi-ai/src/utils/oauth/index.ts`
- `packages/pi-ai/src/utils/oauth/openai-codex.ts`
- `packages/pi-ai/src/utils/oauth/pkce.ts`
- `packages/pi-ai/src/utils/oauth/types.ts`
### packages/pi-ai/src/utils/tests/
- `packages/pi-ai/src/utils/tests/json-parse.test.ts`
- `packages/pi-ai/src/utils/tests/overflow.test.ts`
- `packages/pi-ai/src/utils/tests/repair-tool-json.test.ts`
### packages/pi-coding-agent/
- `packages/pi-coding-agent/package.json`
### packages/pi-coding-agent/scripts/
- `packages/pi-coding-agent/scripts/copy-assets.cjs`
### packages/pi-coding-agent/src/
- `packages/pi-coding-agent/src/cli.ts`

View file

@ -0,0 +1,9 @@
# Decisions Register
<!-- Append-only. Never edit or remove existing rows.
To reverse a decision, add a new row that supersedes it.
Read this file at the start of any planning or research phase. -->
| # | When | Scope | Decision | Choice | Rationale | Revisable? | Made By |
|---|------|-------|----------|--------|-----------|------------|---------|
| D001 | | environment | How to handle missing libsecret dependency for keytar native addon on Linux. | Add libsecret-1-0 / libsecret-1-dev to all Linux environment definitions (Docker, Nix, CI). | @github/keytar (used by @google/gemini-cli-core) requires libsecret on Linux. Without it, keychain initialization fails with a cryptic "Failed to load keytar native addon" error. Adding it to the core environment definitions ensures it is present in all official SF environments. | Yes | agent |

View file

@ -0,0 +1,4 @@
# SF Project Preferences
## Triage Settings
auto_triage: true

View file

@ -0,0 +1,10 @@
<!-- sf-doc: version=2.75.3 template=.sf/PRINCIPLES.md state=pending hash=sha256:9d5c50cb3d602f66468a33a4324068fab8a022fab0fd6940c371a5986af2947e -->
# Principles
Durable design philosophy. Things this codebase believes are true.
Add entries as you make decisions. Each entry: 1-2 sentences. Cite the rationale (the why, not just the what).
## Examples
- (replace with your own)

View file

@ -0,0 +1,18 @@
# SF Self-Feedback
Anomalies caught during auto runs (by runtime detectors or via the
`sf_self_report` tool). Each row is a candidate work item for sf to
address in itself. This markdown file is a compact working view; the
durable source of truth is `self-feedback.jsonl`.
Blocking entries (severity high+) remain active until an sf fix explicitly
marks them resolved with evidence.
## Open Entries
| Timestamp | Kind | Severity | Blocking | sfVersion | Unit | Summary |
|---|---|---|---|---|---|---|
| 2026-05-06T14:28:33.996Z | gap-audit-orphan-prompt | medium | no | unknown | — | orphan prompt: add-tests, complete-milestone, complete-slice, debug-diagnose, debug-session-manager, discuss-headless, discuss, doctor-heal, forensics, gate-evaluate, heal-skill, parallel-research-slices, plan-milestone, product-audit, queue, quick-task, reactive-execute, reassess-roadmap, refine-slice, replan-slice, research-milestone, rethink, review-migration, rewrite-docs, run-uat, scan, system, triage-captures, validate-milestone, workflow-oneshot, worktree-merge |
| 2026-05-06T19:53:09.867Z | upstream-rollup:runaway-guard-hard-pause | medium | no | 2.75.3 | — | 6 external-repo entries of kind 'runaway-guard-hard-pause' across 2 repos |
| 2026-05-06T19:53:09.868Z | upstream-rollup:gap-audit-orphan-prompt | medium | no | 2.75.3 | — | 150 external-repo entries of kind 'gap-audit-orphan-prompt' across 149 repos |
| 2026-05-06T19:53:09.869Z | upstream-rollup:gap-audit-orphan-command | medium | no | 2.75.3 | — | 66 external-repo entries of kind 'gap-audit-orphan-command' across 66 repos |

18
.sf.migrating/STATE.md Normal file
View file

@ -0,0 +1,18 @@
# SF State
**Active Milestone:** M001-6377a4: Consolidate Memory Systems into Unified node:sqlite Store
**Active Slice:** S01: Unified Memory Schema and Core API
**Phase:** executing
**Requirements Status:** 0 active · 0 validated · 0 deferred · 0 out of scope
## Milestone Registry
- 🔄 **M001-6377a4:** Consolidate Memory Systems into Unified node:sqlite Store
## Recent Decisions
- None recorded
## Blockers
- None
## Next Action
Execute T01: Audit and extend sf.db memories schema in slice S01.

10
.sf.migrating/TASTE.md Normal file
View file

@ -0,0 +1,10 @@
<!-- sf-doc: version=2.75.3 template=.sf/TASTE.md state=pending hash=sha256:ee9ea8ade6f8434e9425a989bab9735d2068395978d61940e18679b93b1f11b0 -->
# Taste
What good code looks like here. Idioms, conventions, "we prefer X over Y" calls.
Add entries as you notice patterns worth preserving. Each entry: 1-2 sentences with a concrete example.
## Examples
- (replace with your own)

View file

@ -0,0 +1 @@
{"eventId":"3c37d4c1-a9a3-4605-aa5d-f094908cc23f","traceId":"dispatch:M001-6377a4:evaluating-gates","turnId":"M001-6377a4","category":"orchestration","type":"dispatch-envelope","ts":"2026-05-06T21:01:28.966Z","payload":{"envelope":{"action":"skip","reason":{"reasonCode":"state","summary":"skipped","evidence":{"phase":"evaluating-gates","mid":"M001-6377a4"}}},"explanation":"[state] skip: skipped."}}

9
.sf.migrating/auto.lock Normal file
View file

@ -0,0 +1,9 @@
{
"pid": 602181,
"startedAt": "2026-05-06T21:03:18.530Z",
"unitType": "starting",
"unitId": "bootstrap",
"unitStartedAt": "2026-05-06T21:03:18.530Z",
"sessionId": "ae5fa2d7-1fb9-4edc-a082-8c00c8f27322",
"sessionFile": "/home/mhugo/.sf/agent/sessions/--home-mhugo-code-singularity-forge--/2026-05-06T21-03-07-490Z_ae5fa2d7-1fb9-4edc-a082-8c00c8f27322.jsonl"
}

View file

@ -0,0 +1,7 @@
{"ts":"2026-05-06T14:28:31.670Z","ok":true,"errors":0,"warnings":4,"fixes":2,"codes":["stale_uncommitted_changes","scaffold_drift","env_docker","env_git_remote"],"issues":[{"severity":"warning","code":"stale_uncommitted_changes","message":"Uncommitted changes detected with no commit in 64 minutes (threshold: 30m). Snapshotting tracked files.","unitId":"project"},{"severity":"warning","code":"scaffold_drift","message":"Scaffold drift: 8 missing. Auto-sync handles missing+pending; editing-drift needs review.","unitId":"project"},{"severity":"warning","code":"env_docker","message":"Project has Docker files but docker is not installed","unitId":"environment"},{"severity":"warning","code":"env_git_remote","message":"Git remote 'origin' is unreachable — Remote: git@github.com:singularity-ng/singularity-forge.git","unitId":"environment"}],"fixDescriptions":["created sf snapshot after 64m of uncommitted changes","scaffold sync: created 8 missing, refreshed 0 pending"],"summary":"Clean · 2 fixed · Uncommitted changes detected with no commit in 64 minutes (threshold: 30m). Snapshotting tracked files."}
{"ts":"2026-05-06T19:53:08.016Z","ok":true,"errors":0,"warnings":2,"fixes":2,"codes":["stale_uncommitted_changes","scaffold_drift"],"issues":[{"severity":"warning","code":"stale_uncommitted_changes","message":"Uncommitted changes detected with no commit in 321 minutes (threshold: 30m). Snapshotting tracked files.","unitId":"project"},{"severity":"warning","code":"scaffold_drift","message":"Scaffold drift: 22 pending upgrade. Auto-sync handles missing+pending; editing-drift needs review.","unitId":"project"}],"fixDescriptions":["created sf snapshot after 321m of uncommitted changes","scaffold sync: created 0 missing, refreshed 22 pending"],"summary":"Clean · 2 fixed · Uncommitted changes detected with no commit in 321 minutes (threshold: 30m). Snapshotting tracked files."}
{"ts":"2026-05-06T20:01:00.544Z","ok":true,"errors":0,"warnings":0,"fixes":0,"codes":[],"summary":"Clean"}
{"ts":"2026-05-06T20:48:06.181Z","ok":true,"errors":0,"warnings":0,"fixes":0,"codes":[],"summary":"Clean"}
{"ts":"2026-05-06T21:01:38.008Z","ok":true,"errors":0,"warnings":2,"fixes":5,"codes":["state_file_stale","legacy_plan_slug_directory","orphaned_milestone_directory"],"issues":[{"severity":"warning","code":"state_file_stale","message":"STATE.md is stale — shows \"evaluating-gates\" but derived state is \"executing\"","unitId":"project"},{"severity":"warning","code":"orphaned_milestone_directory","message":"Milestone directory /home/mhugo/code/singularity-forge/.sf/milestones/M001 exists on disk but has no corresponding database entry or roadmap. It may be leftover from manual cleanup or a DB reset.","unitId":"M001"}],"fixDescriptions":["rebuilt STATE.md from derived state","renamed legacy plan directory /home/mhugo/code/singularity-forge/.sf/milestones/M001-6377a4 -> /home/mhugo/code/singularity-forge/.sf/milestones/M001","removed orphaned milestone directory /home/mhugo/code/singularity-forge/.sf/milestones/M001","re-rendered missing projections for M001-6377a4","updated /home/mhugo/code/singularity-forge/.sf/STATE.md"],"summary":"Clean · 5 fixed · STATE.md is stale — shows \"evaluating-gates\" but derived state is \"executing\""}
{"ts":"2026-05-06T21:03:13.257Z","ok":true,"errors":0,"warnings":2,"fixes":5,"codes":["state_file_stale","legacy_plan_slug_directory","orphaned_milestone_directory"],"issues":[{"severity":"warning","code":"state_file_stale","message":"STATE.md is stale — shows \"executing\" but derived state is \"planning\"","unitId":"project"},{"severity":"warning","code":"orphaned_milestone_directory","message":"Milestone directory /home/mhugo/code/singularity-forge/.sf/milestones/M001 exists on disk but has no corresponding database entry or roadmap. It may be leftover from manual cleanup or a DB reset.","unitId":"M001"}],"fixDescriptions":["rebuilt STATE.md from derived state","renamed legacy plan directory /home/mhugo/code/singularity-forge/.sf/milestones/M001-6377a4 -> /home/mhugo/code/singularity-forge/.sf/milestones/M001","removed orphaned milestone directory /home/mhugo/code/singularity-forge/.sf/milestones/M001","re-rendered missing projections for M001-6377a4","updated /home/mhugo/code/singularity-forge/.sf/STATE.md"],"summary":"Clean · 5 fixed · STATE.md is stale — shows \"executing\" but derived state is \"planning\""}
{"ts":"2026-05-06T21:03:18.523Z","ok":true,"errors":0,"warnings":2,"fixes":5,"codes":["state_file_stale","legacy_plan_slug_directory","orphaned_milestone_directory"],"issues":[{"severity":"warning","code":"state_file_stale","message":"STATE.md is stale — shows \"planning\" but derived state is \"executing\"","unitId":"project"},{"severity":"warning","code":"orphaned_milestone_directory","message":"Milestone directory /home/mhugo/code/singularity-forge/.sf/milestones/M001 exists on disk but has no corresponding database entry or roadmap. It may be leftover from manual cleanup or a DB reset.","unitId":"M001"}],"fixDescriptions":["rebuilt STATE.md from derived state","renamed legacy plan directory /home/mhugo/code/singularity-forge/.sf/milestones/M001-6377a4 -> /home/mhugo/code/singularity-forge/.sf/milestones/M001","removed orphaned milestone directory /home/mhugo/code/singularity-forge/.sf/milestones/M001","re-rendered missing projections for M001-6377a4","updated /home/mhugo/code/singularity-forge/.sf/STATE.md"],"summary":"Clean · 5 fixed · STATE.md is stale — shows \"planning\" but derived state is \"executing\""}

View file

@ -0,0 +1,5 @@
{"v":2,"cmd":"plan-milestone","params":{"milestoneId":"M001-6377a4"},"ts":"2026-05-06T20:52:17.383Z","actor":"agent","hash":"b906f145e874093b","session_id":"2f2465fe-6d1a-4cd5-9c4a-8e24b8f918b3"}
{"v":2,"cmd":"plan-slice","params":{"milestoneId":"M001-6377a4","sliceId":"S01"},"ts":"2026-05-06T21:00:11.914Z","actor":"agent","hash":"bd14d9ef6fc058d7","session_id":"2f2465fe-6d1a-4cd5-9c4a-8e24b8f918b3"}
{"v":2,"cmd":"plan-slice","params":{"milestoneId":"M001-6377a4","sliceId":"S02"},"ts":"2026-05-06T21:00:35.433Z","actor":"agent","hash":"8e32cd7cc20296fd","session_id":"2f2465fe-6d1a-4cd5-9c4a-8e24b8f918b3"}
{"v":2,"cmd":"plan-slice","params":{"milestoneId":"M001-6377a4","sliceId":"S03"},"ts":"2026-05-06T21:01:03.716Z","actor":"agent","hash":"7ac92b15144efc89","session_id":"2f2465fe-6d1a-4cd5-9c4a-8e24b8f918b3"}
{"v":2,"cmd":"plan-slice","params":{"milestoneId":"M001-6377a4","sliceId":"S04"},"ts":"2026-05-06T21:01:36.518Z","actor":"agent","hash":"3df2b6925cb01e42","session_id":"2f2465fe-6d1a-4cd5-9c4a-8e24b8f918b3"}

View file

@ -0,0 +1,20 @@
<!-- sf-doc: version=2.75.3 template=.sf/harness/specs/bootstrap.md state=pending hash=sha256:b86ba7cf2cec39a7a9f9d94f885998cfe26eebfc5b76fdd8375ef125e927e0cf -->
# Bootstrap Spec: Agent Legibility
Verifies that this repo is minimally agent-legible.
## Criteria
- [ ] `AGENTS.md` exists at repo root and is non-empty.
- [ ] `ARCHITECTURE.md` exists at repo root and is non-empty.
- [ ] `docs/exec-plans/active/` exists.
- [ ] `docs/exec-plans/tech-debt-tracker.md` exists.
- [ ] `docs/design-docs/ADR-TEMPLATE.md` exists.
## Verification command
```bash
for f in AGENTS.md ARCHITECTURE.md docs/exec-plans/active/index.md docs/exec-plans/tech-debt-tracker.md docs/design-docs/ADR-TEMPLATE.md .sf/harness/specs/bootstrap.md; do [ -s "$f" ] && echo "OK: $f" || echo "MISSING: $f"; done
```
All lines should start with `OK:` for the bootstrap spec to pass.

View file

@ -0,0 +1,8 @@
{
"pid": 262512,
"ppid": 1279131,
"cwd": "/home/mhugo/code/singularity-forge",
"startedAt": "2026-05-06T19:52:58.440Z",
"sessionFile": "/home/mhugo/.sf/sessions/--home-mhugo-code-singularity-forge--/2026-05-06T19-52-58-440Z_add2d60c-b32c-439e-8d5f-417fa5f54399.jsonl",
"token": "60d88834-20d1-40e9-9b05-c9483f7d35be"
}

18
.sf.migrating/mcp.json Normal file
View file

@ -0,0 +1,18 @@
{
"mcpServers": {
"serena": {
"command": "uvx",
"args": [
"--from",
"serena-agent",
"serena",
"start-mcp-server",
"--transport",
"stdio",
"--project-from-cwd",
"--context",
"desktop-app"
]
}
}
}

View file

@ -0,0 +1,102 @@
{
"schemaVersion": 1,
"origin": "db-projection",
"generatedAt": "2026-05-06T21:03:18.498Z",
"sourceDbPath": "/home/mhugo/code/singularity-forge/.sf/sf.db",
"milestone": {
"id": "M001-6377a4",
"title": "Consolidate Memory Systems into Unified node:sqlite Store",
"status": "active",
"vision": "Replace the three fragmented memory systems (KNOWLEDGE.md, memory-store.js/sf.db, and memory extension/sql.js) with a single unified memory store backed by node:sqlite. All memory ingestion, querying, and prompt injection flows through one canonical database table with semantic search, confidence ranking, and automatic maintenance.",
"dependsOn": [],
"successCriteria": [
"A single `memories` table in `sf.db` stores all project memory with categories, confidence, hit_count, and embeddings",
"Session transcript extraction pipeline writes directly to `sf.db` instead of separate `agent.db`",
"KNOWLEDGE.md is retired as a live system; existing entries are optionally migrated",
"Memory query returns ranked results via `getRelevantMemoriesRanked(query, limit)` using node:sqlite",
"System prompt injection uses the unified memory store, not multiple competing sources",
"All better-sqlite3 and sql.js dependencies for memory are removed"
],
"definitionOfDone": [
"All three legacy memory systems are removed or deprecated",
"Unified memory store passes all new tests",
"Migration script can import existing KNOWLEDGE.md and old agent.db data",
"Documentation updated to describe the single memory system",
"No references to better-sqlite3 or sql.js in memory-related code"
],
"requirementCoverage": "Covers: unified memory storage, semantic search, session-based learning. Partially covers: cross-session context persistence. Leaves for later: multi-project memory sharing, cloud-synced memory.",
"boundaryMapMarkdown": "### S01 → S02\n\nProduces:\n- Unified `memories` table schema in `sf.db`\n- `MemoryStore` class with CRUD, query, and ranking API\n- `formatMemoriesForPrompt()` for system prompt injection\n\nConsumes:\n- Existing `sf-db.js` adapter and schema initialization\n\n### S02 → S03\n\nProduces:\n- Session transcript scanner and LLM extraction pipeline\n- Direct write path to `sf.db` memories table\n- `/memory` command reading from unified store\n\nConsumes:\n- `MemoryStore` API from S01\n- `completeSimple` LLM call from pi-ai\n\n### S03 → S04\n\nProduces:\n- KNOWLEDGE.md importer\n- Legacy agent.db migration script\n- Deprecation warnings for old memory paths\n\nConsumes:\n- `MemoryStore` API from S01\n- Existing KNOWLEDGE.md and agent.db files"
},
"slices": [
{
"id": "S01",
"title": "Unified Memory Schema and Core API",
"status": "pending",
"risk": "high",
"depends": [],
"demo": "A test creates a memory, queries it by relevance, and formats it for prompt injection — all via node:sqlite",
"goal": "Create the canonical `memories` table in `sf.db` and a `MemoryStore` class that replaces memory-store.js with a node:sqlite implementation",
"successCriteria": "- `sf.db` has a `memories` table with: id, category, content, confidence, hit_count, source, session_id, source_unit_type, source_unit_id, created_at, updated_at, superseded_by\n- `MemoryStore` class exposes: createMemory, updateMemory, reinforceMemory, supersedeMemory, getActiveMemoriesRanked, getRelevantMemoriesRanked, formatMemoriesForPrompt\n- All methods gracefully degrade when DB is unavailable\n- Unit tests cover CRUD, ranking, source filtering, and embedding fallback",
"proofLevel": "contract",
"integrationClosure": "Produces the MemoryStore API that all downstream slices consume. No external wiring yet.",
"observabilityImpact": "No runtime signals added yet; tests verify table schema and query correctness.",
"isSketch": false,
"sketchScope": "",
"sequence": 1
},
{
"id": "S02",
"title": "Session Transcript Extraction Pipeline",
"status": "pending",
"risk": "medium",
"depends": [
"S01"
],
"demo": "After running a session, the pipeline extracts memories and stores them in sf.db; `/memory view` shows the extracted knowledge",
"goal": "Port the two-phase extraction pipeline from the memory extension to write directly into the unified sf.db store instead of separate agent.db",
"successCriteria": "- Session .jsonl files are scanned and filtered for the current cwd\n- Phase 1: LLM extracts durable knowledge from transcripts, writes to sf.db memories table with source='extracted'\n- Phase 2: Consolidation deduplicates and ranks memories\n- /memory command reads from unified store\n- Pipeline runs fire-and-forget on session start without blocking dispatch\n- Rate limiting prevents store bloat (max 10 memories per session)",
"proofLevel": "integration",
"integrationClosure": "Wires the extraction pipeline into the session lifecycle and replaces the old memory extension storage path.",
"observabilityImpact": "Pipeline logs extraction stats (processed, errors) to the console. Memory store tracks hit_count for reinforcement.",
"isSketch": false,
"sketchScope": "",
"sequence": 2
},
{
"id": "S03",
"title": "Migration and Legacy Deprecation",
"status": "pending",
"risk": "low",
"depends": [
"S02"
],
"demo": "Running a migration command imports existing KNOWLEDGE.md and agent.db memories into sf.db; old files are left as read-only backups",
"goal": "Provide a one-time migration path from KNOWLEDGE.md and the old agent.db into the unified store, then deprecate the legacy systems",
"successCriteria": "- Migration script can import KNOWLEDGE.md entries as memories with source='migrated'\n- Migration script can import agent.db stage1_outputs as memories with source='extracted'\n- Dry-run mode reports counts without modifying database\n- sf.db is automatically backed up before migration\n- knowledge-compounding.js and knowledge-injector.js are removed or no-op'd\n- Memory extension uses MemoryStore instead of sql.js\n- CHANGELOG documents the consolidation and deprecation",
"proofLevel": "contract",
"integrationClosure": "Cleans up legacy code paths and provides a safe migration for existing users.",
"observabilityImpact": "Migration script reports counts of imported records per source. Deprecation warnings logged for old API usage.",
"isSketch": false,
"sketchScope": "",
"sequence": 3
},
{
"id": "S04",
"title": "System Prompt Integration and Cleanup",
"status": "pending",
"risk": "medium",
"depends": [
"S03"
],
"demo": "Starting a new session injects relevant ranked memories from sf.db into the system prompt; no references to old memory systems remain in the codebase",
"goal": "Replace all system prompt injection paths to use the unified memory store, remove dead code, and verify end-to-end",
"successCriteria": "Not provided.",
"proofLevel": "Not provided.",
"integrationClosure": "Not provided.",
"observabilityImpact": "Not provided.",
"isSketch": false,
"sketchScope": "",
"sequence": 4
}
]
}

View file

@ -0,0 +1,12 @@
# M001-6377a4: Consolidate Memory Systems into Unified node:sqlite Store
## Vision
Replace the three fragmented memory systems (KNOWLEDGE.md, memory-store.js/sf.db, and memory extension/sql.js) with a single unified memory store backed by node:sqlite. All memory ingestion, querying, and prompt injection flows through one canonical database table with semantic search, confidence ranking, and automatic maintenance.
## Slice Overview
| ID | Slice | Risk | Depends | Done | After this |
|----|-------|------|---------|------|------------|
| S01 | Unified Memory Schema and Core API | high | — | ⬜ | A test creates a memory, queries it by relevance, and formats it for prompt injection — all via node:sqlite |
| S02 | Session Transcript Extraction Pipeline | medium | S01 | ⬜ | After running a session, the pipeline extracts memories and stores them in sf.db; `/memory view` shows the extracted knowledge |
| S03 | Migration and Legacy Deprecation | low | S02 | ⬜ | Running a migration command imports existing KNOWLEDGE.md and agent.db memories into sf.db; old files are left as read-only backups |
| S04 | System Prompt Integration and Cleanup | medium | S03 | ⬜ | Starting a new session injects relevant ranked memories from sf.db into the system prompt; no references to old memory systems remain in the codebase |

View file

@ -0,0 +1 @@
63e10aeb3835f89f

View file

@ -0,0 +1,28 @@
{
"schemaVersion": 3,
"status": "warming",
"startedAt": "2026-05-06T21:03:03.705Z",
"command": "/nix/store/vzx1mi9c0xfadmsm9dhd83d005cb1qs9-coreutils-9.8/bin/timeout",
"cwd": "/home/mhugo/code/singularity-forge",
"args": [
"--kill-after=10",
"600",
"/home/mhugo/.cargo/bin/sift",
"search",
"--json",
"--strategy",
"page-index-hybrid",
"--limit",
"1",
"--retriever-timeout-ms",
"30000",
".",
"repo architecture source tests entrypoints configuration"
],
"scope": ".",
"siftBinary": "/home/mhugo/.cargo/bin/sift",
"hardTimeoutSec": 600,
"searchCache": "/home/mhugo/code/singularity-forge/.sf/runtime/sift/search-cache",
"tmpDir": "/home/mhugo/code/singularity-forge/.sf/runtime/sift/tmp",
"pid": 602029
}

Some files were not shown because too many files have changed in this diff Show more