Commit graph

3892 commits

Author SHA1 Message Date
Mikael Hugo
c3ab4bfccf feat(sf): port 16 workflow templates from gsd-2
Adds 16 ready-to-use workflow templates that gsd-2 has but SF was
missing. Each runs via /sf workflow run <name> or /sf start <name>.

Markdown phased workflows (10):
- accessibility-audit  — UI a11y scan + remediation report
- api-breaking-change  — survey callers, migrate, deprecate, schedule removal
- changelog-gen        — release notes from git log since last tag
- ci-bootstrap         — minimal-working CI pipeline
- dead-code            — find unused functions/files (report only, no delete)
- issue-triage         — classify a GitHub issue + label/priority recommendation
- observability-setup  — structured logs, metrics, tracing
- onboarding-check     — walk README as new contributor, report gaps
- performance-audit    — measure → fix → measure
- pr-review            — structured code review of a PR
- pr-triage            — bucket open PRs (merge/close/nudge)
- release              — version bump → changelog → tag → publish (gated)

YAML-step iterators (4):
- docs-sync            — backfill JSDoc/TSDoc on undocumented exports
- env-audit            — inventory env vars + flag drift
- rename-symbol        — global rename across code/tests/docs
- test-backfill        — write unit tests for untested functions

All gsd-specific refs adapted: /gsd → /sf, .gsd/ → .sf/, gsd-build/gsd-2
→ singularity-forge/sf-run.

Templates need no SF-runtime tools (sf_*, subagent, browser_*) — they
run via the bash + git + gh/npm commands the agent already has.
Discovery verified: discoverPlugins() picks up all 27 templates
(11 existing + 16 new); registry.json is 1:1 with the .md/.yaml files.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 19:01:51 +02:00
Mikael Hugo
955ee66614 fix(sf): replace 'Lex' personal name with generic 'project owner' in milestone-validation template
templates/milestone-validation.md:60 was instructing the validating agent
to add 'enough context for Lex to make a decision'. Lex is the
developer's personal nickname; bundled templates ship to every SF user
and other users would write validation reports referencing a stranger.

Now reads 'enough context for the project owner to make a decision' —
generic and accurate for any project.

Tree-wide grep for Lex/Mikael/Mikki across bundled resources now
returns zero personal-name references.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 18:49:20 +02:00
Mikael Hugo
b0e1e9ae1b fix(sf): replace developer-machine paths with portable placeholders
Three bundled files referenced /home/mhugo/code/singularity-forge in
example commands and prompt templates. They ship to every SF install,
where /home/mhugo/code/ doesn't exist:

- workflow-templates/full-project.md: "defined in SF-WORKFLOW.md" was
  ambiguous (LLM resolves relative to cwd). Now points at the canonical
  ~/.sf/agent/SF-WORKFLOW.md install path (per loader.ts:236).

- skills/context-doctor/SKILL.md: Step 6 commit example used
  "cd /home/mhugo/code/singularity-forge". Generic "<project-root>"
  works for any user.

- skills/dispatching-subagents/SKILL.md: subagent task-prompt template
  hardcoded "Repo: /home/mhugo/code/singularity-forge" in the CONTEXT
  section. Same fix.

The acquiring-skills skill has more dev-specific content (mikki-bunker
host, /home/mhugo/code/, dev-tree copy paths) that's clearly a personal
workflow shipping in the bundled tree — left untouched here, needs a
real triage decision (delete from bundle vs generalize).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 18:46:20 +02:00
Mikael Hugo
64fcbf881e fix(skills): correct .claude/skills/gh/ → .claude/skills/github-workflows/references/gh/
The github-workflows skill bundles a sub-tree at references/gh/ that was
historically a standalone 'gh' skill. After it got nested inside
github-workflows, the docs and scripts kept the old install path:

  .claude/skills/gh/scripts/github_project_setup.py  (stale)

When this skill is installed (as 'github-workflows'), the actual path is:

  .claude/skills/github-workflows/references/gh/scripts/github_project_setup.py

Anyone copy-pasting an example uv run command from issue-stories.md,
milestones.md, labels.md, projects-v2.md, or the script's own help
output would hit ENOENT on the abbreviated path.

11 line replacements across 5 files (4 reference docs + 1 Python
script's own typer.echo).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 18:42:44 +02:00
Mikael Hugo
626813b616 fix(vectordrive): silence optional dependency warning 2026-05-02 18:42:25 +02:00
Mikael Hugo
22f22181db fix(sf): mark research summary saves terminal 2026-05-02 18:42:25 +02:00
Mikael Hugo
18643702b2 fix(sf): give workflow-templates/product-audit.md an absolute prompt path
Step 1 said "Load the audit prompt at \`prompts/product-audit.md\`".
That's a relative path the dispatched LLM would resolve against the
project's working directory — but \`prompts/product-audit.md\` doesn't
live in the user's project; it lives in the bundled extension copied
to \`~/.sf/agent/extensions/sf/prompts/\` (per prompt-loader.ts:50
__extensionDir/prompts).

LLMs running this workflow would either fail to find the file, walk
the filesystem looking for it, or skip the guidance silently. Now
points at the canonical location and clarifies that the prompt holds
evidence-collection guidance and output schema (the structured tool
sf_product_audit handles persistence).

Partially addresses sf-monzctqw-w4g85x — the path is now right; the
broader prompt-vs-hardcoded-tool design tension is left for a real
triage decision.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 18:39:38 +02:00
Mikael Hugo
a3ef4bdf3f fix(sf): remove workflow tool aliases 2026-05-02 18:32:50 +02:00
Mikael Hugo
1be11744ee fix(skills): update create-skill SKILL.md + workflows to canonical skill paths
After last fire fixed sf-skill-ecosystem.md, three more sites in the
create-skill skill were still teaching the legacy ~/.sf/agent/skills/
and .pi/agent/skills/ paths:

- create-skill/SKILL.md:91 quick reference
- create-skill/workflows/create-new-skill.md:18 (scope question)
- create-skill/workflows/create-new-skill.md:102 (Step 5 directory creation)
- create-skill/workflows/audit-skill.md:19,29 (skill enumeration ls commands)

Now point at the canonical four-directory ecosystem
(~/.agents/skills/, ~/.claude/skills/, plus project-local variants)
that the runtime actually scans (per skill-discovery.ts:16-17,
skill-telemetry.ts:34-35, preferences-skills.ts:39-43).

The audit-skill ls block now enumerates all four locations so the
audit report matches what SF will actually load.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 18:32:19 +02:00
Mikael Hugo
effa8eade4 fix(skills): correct skill-directory paths in create-skill ecosystem reference
src/resources/skills/create-skill/references/sf-skill-ecosystem.md
documented skill paths that don't match what the SF runtime actually
scans:

- Doc said user-scope: `~/.sf/agent/skills/` and project-scope: `.pi/agent/skills/`
- Code (skill-discovery.ts:16-17, skill-telemetry.ts:34-35,
  skill-health.ts:240-241, skill-catalog.ts:1014-1015,
  preferences-skills.ts:39-43) actually scans:
  - User: `~/.agents/skills/` + `~/.claude/skills/`
  - Project: `<cwd>/.agents/skills/` + `<cwd>/.claude/skills/`

Anyone following the create-skill skill's reference doc would have
written skills to a path the runtime no longer actively reads —
`~/.sf/agent/skills/` is now legacy and only consulted if the
`.migrated-to-agents` marker is missing.

Also fixed:
- Telemetry path: said `~/.sf/metrics.json` (user-scope), actually
  `<project>/.sf/metrics.json` (project-scope per metrics.ts:665)
- Doctor command: said `/doctor`, actual command is `/sf doctor`

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 18:29:17 +02:00
Mikael Hugo
ec235c8832 fix(sf): system.md names isolation field correctly as git.isolation
prompts/system.md:106 told agents the isolation mode lives in
PREFERENCES.md under `taskIsolation.mode`. The preferences validator
(preferences-validation.ts:84-88) explicitly REJECTS that key — along
with task_isolation and bare isolation — with the error
'use "git.isolation" instead'. The canonical field is git.isolation
(verified in PREFERENCES.md template line 22 and preferences.ts:897).

Anyone following the system-prompt instruction would write the wrong
config, the validator would discard it, and isolation would silently
fall back to default 'none'.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 18:16:48 +02:00
Mikael Hugo
b046bc1687 chore: clean up remaining sf-2 stale-name code comments
Final sweep after the prompt + script + README sweep for stale repo
references. These are pure code comments, not active behavior, but they
mislead readers about what repo this code lives in:

- src/resource-loader.ts: "sf-2 repo's working tree" → "sf-run repo's"
- src/web/safe-import-meta-resolve.ts: example URL hostname
- src/resources/extensions/sf/schemas/parsers.ts: dropped "sf-2 /" prefix
- src/resources/extensions/sf/schemas/validate.ts: same
- scripts/parallel-monitor.mjs: comment about "sf-2 repo itself"

Tests intentionally not touched — the test fixtures use @sf-build as a
generic scope name to exercise the symlink-merge logic, and the test
tmpdir prefixes (sf-2821-, sf-2945-) are just numeric tags from issue
numbers, not repo refs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 18:14:22 +02:00
Mikael Hugo
56234b5131 fix(sf): canonicalize milestone id tool surface 2026-05-02 18:09:13 +02:00
Mikael Hugo
416eaf8d12 fix(sf): move add-tests.md skillActivation from dangling end to step 0
Same pattern fixed in scan.md last fire. The {{skillActivation}}
placeholder was the very last line of add-tests.md, after the
'Report sf-internal observations' section, so the default activation
sentence the prompt-loader injects landed where the agent only reads
it AFTER finishing test generation. Move to Instructions step 0 so
skills are activated before code reading begins.

Confirmed via sweep: no more prompts have a dangling {{skillActivation}}
at end-of-file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 18:08:55 +02:00
Mikael Hugo
ba4bab1034 fix(sf): correct stale .sf milestone paths in prompts + ADR-impl absolute links
prompts/parallel-research-slices.md step 3 told the dispatcher to verify
research at `.sf/{{mid}}/`, but slice research files actually live at
`.sf/milestones/{{mid}}/slices/<sliceId>/<sliceId>-RESEARCH.md`. Step 3
verification could only ever fail.

prompts/validate-milestone.md sent the three milestone-validation reviewer
agents to wrong paths:
- parentTrace pointed at `.sf/{{milestoneId}}/S0X-SUMMARY.md` (slice
  summaries actually live at `.sf/milestones/{{milestoneId}}/slices/S0X/`)
- Reviewer A read `.sf/{{milestoneId}}/REQUIREMENTS.md` (the file is at
  project-level `.sf/REQUIREMENTS.md`)
- Reviewer A scanned `.sf/{{milestoneId}}/` for slice SUMMARYs (wrong dir)
- Reviewer C read `.sf/{{milestoneId}}/CONTEXT.md` (actual file is
  `.sf/milestones/{{milestoneId}}/{{milestoneId}}-CONTEXT.md`)

Reviewers would either return false MISSING / FAIL verdicts or have to
re-discover the layout.

docs/dev/ADR-{008,009}-IMPLEMENTATION-PLAN.md "Related ADR" links pointed
to absolute paths inside a contributor's old Mac (`/Users/jeremymcspadden/
Github/sf-2/...`). Replaced with sibling-file relative paths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 18:06:16 +02:00
Mikael Hugo
21113e18a9 fix: update remaining stale repo and scope refs to singularity-forge
After fixing forensics.md and error-classifier.ts last fire, swept the
rest of the tree for the same class of stale reference:

- scripts/validate-pack.js: criticalPackages list used \`@sf\` and
  \`@sf-build\` scopes — neither exists in node_modules; this is in CI
  (.github/workflows/ci.yml) + prepublishOnly, so the validation step
  was failing to find anything. Now \`@singularity-forge/pi-coding-agent\`
  and \`@singularity-forge/rpc-client\` (the actual scope).
- src/resources/skills/github-workflows/references/gh/SKILL.md: same
  GraphQL bug as forensics.md — owner:"sf-build" name:"sf-2" — and
  three \`gh project\` commands using owner sf-build. The gh issue
  create command above already used singularity-forge/sf-run, so the
  follow-up calls always failed. Also retitled "sf-2 Backlog" to
  "sf-run Backlog".
- src/resources/extensions/sf/bootstrap/system-context.ts: deprecation
  warning linked to https://github.com/sf-build/SF/issues/1492.
- packages/mcp-server/README.md, packages/rpc-client/README.md: 9 refs
  to \`@sf-build/...\` for installable package names — would mislead
  anyone copy-pasting into npm install.
- docs/user-docs/troubleshooting.md (+ zh-CN): GitHub Issues link
  pointed at github.com/sf-build/SF/issues.
- docs/user-docs/getting-started.md (+ zh-CN): clone URL was correct
  but the next \`cd\` was \`cd sf-2/docker\` — won't exist after a
  fresh clone of sf-run.
- docs/dev/ci-cd-pipeline.md: GHCR org was \`sf-build\`.

Code comments containing "sf-2" / "sf-build" in non-active places
(parsers.ts banner, error message URLs in tests, dev-doc absolute
paths from a contributor's Mac) left alone — they're informational
and not addressed by users or runtime.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 18:01:55 +02:00
Mikael Hugo
65be8c7f16 fix(sf): update stale repo references to singularity-forge/sf-run
forensics.md: GraphQL queries used owner:"sf-build" name:"sf-2" while
the gh issue create command above them correctly used
--repo singularity-forge/sf-run. This meant /sf forensics could create
the issue but the follow-up calls to set issue type would silently fail
against a non-existent repo. Both GraphQL queries now match the canonical
singularity-forge/sf-run.

error-classifier.ts: doc-comment @see link pointed to the old
sf-build/sf repo URL.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 17:56:44 +02:00
Mikael Hugo
59a37c1080 fix(sf): move scan.md skillActivation from dangling end to Instructions step 0
The {{skillActivation}} placeholder was at the very bottom of scan.md,
after the 'Report sf-internal observations' section, with no header or
context. Since the default prompt-loader provides a one-sentence
'use the SF Skill Preferences block...' instruction, it landed as an
orphan footer the agent only encountered AFTER finishing the scan.

Move it to step 0 of the numbered Instructions so the agent activates
skills before exploring the codebase, matching the research-slice and
plan-milestone pattern.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 17:53:54 +02:00
Mikael Hugo
61485c5bef fix(sf): remove legacy completion tool aliases 2026-05-02 17:51:38 +02:00
Mikael Hugo
1891ccbdcd chore(sf): delete orphaned commands-debug + debug-session-store
`/sf debug` was ported in 360208cba but never wired up:

- handleDebug exported but no caller anywhere in the tree
- not in commands/catalog.ts
- loadPrompt("debug-session-manager") and loadPrompt("debug-diagnose")
  referenced prompts that never existed in prompts/ — guaranteed
  runtime crash if the dispatch path were ever hit
- debug-session-store.ts only consumed by commands-debug.ts
- no tests reference any of it

887 LOC of dead code with a latent crash. Removing both files
eliminates the orphan-prompt callsite that gap-audit kept flagging
and the broken dispatch path. Resolves sf-moohvyzc-ll5bd0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 17:42:28 +02:00
Mikael Hugo
e07f2bc225 fix(sf): add depth calibration to research-milestone prompt
Mirror the tiered Deep/Targeted/Light breakdown that research-slice.md
already had — same structure, milestone-scoped wording. Add explicit
'## Steps' header so the numbered steps no longer flow visually out of
the calibration paragraph.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 17:39:23 +02:00
Mikael Hugo
8032ee6144 fix(sf): gap-audit detects prompts loaded by direct filesystem read
Orphan-prompt detection only checked loadPrompt() callsites. Three
prompts (heal-skill, product-audit, review-migration) are loaded by
direct readFileSync of "<name>.md" — they got false-flagged as orphans.

Add a literal-filename check so any source file containing "<name>.md"
counts as a load. Cheap one-pass grep, same shape as the existing
loadPrompt patterns.

Verified with live runGapAudit: 0 new findings (was previously logging
the 3 false positives every session_start).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 17:29:44 +02:00
Mikael Hugo
617608347d fix(sf): align auto-mode prompts to canonical sf_task_complete / sf_slice_complete
Auto-mode prompts called legacy aliases (sf_complete_task, sf_complete_slice)
while guided used canonical (sf_task_complete, sf_slice_complete). The
divergence was locked in by the test 'auto execute-task requires legacy
completion alias until prompt contract is aligned' — explicit tech debt
marker.

Migrated:
- workflow-mcp.ts getRequiredWorkflowToolsForAutoUnit: returns canonical
- prompts/execute-task.md: 4 callsites
- prompts/complete-slice.md: 3 callsites
- prompts/reactive-execute.md: any (none on this file)
- workflow-mcp.test.ts: assertion + transport-error fixtures
- Test rename: 'requires legacy completion alias' → 'requires canonical'

The aliases stay registered (sf_complete_task → sf_task_complete) so
external callers and old session resumes don't break. Tool-naming.test.ts
still asserts both names route to the same handler.

Resolves: sf-moohqbza-yyq8sd.
Tests: workflow-mcp + tool-naming 29/29 pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 17:25:53 +02:00
Mikael Hugo
9d13c7ef49 chore(sf): delete orphan templates/reassessment.md
29-line template with zero callers. inlineTemplate("reassessment")
isn't called anywhere; reassess-roadmap.md prompt has its own inline
structure. Removing prevents drift between dead template and live
prompt.

Resolves: orphan-template-reassessment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 17:21:42 +02:00
Mikael Hugo
21663be282 fix(sf): add depth calibration to plan-milestone prompt
Mirror plan-slice + research-slice + research-milestone: 3-tier
Calibrate Depth (Deep / Targeted / Light) with explicit Light tier
authorizing 1-2-slice decompositions for focused well-scoped work.

Prevents the synthesized over-decomposition pattern where every
milestone produced 4-5 slices regardless of scope.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 17:18:14 +02:00
Mikael Hugo
012862fc9a fix(sf): add depth calibration to plan-slice prompt
plan-slice was force-deep on every dispatch — full multi-task
decomposition + long architectural narration regardless of slice
complexity. research-slice has a 3-tier Calibrate Depth section
(Deep / Targeted / Light) that lets the agent right-size; plan-slice
now mirrors it.

Light tier explicitly authorizes 1-task plans for well-understood
work (CRUD, config changes, established-pattern wiring) — preventing
the synthesized 4-task decompositions that were a likely contributor
to recurring runaway-guard pauses on planning units.

Resolves: sf-moohebyg-y0hnhq.
Tests: plan-slice-prompt 16/16 still pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 17:13:52 +02:00
Mikael Hugo
b9375656ca fix(sf): stop on contradictory roadmap slice counts 2026-05-02 17:13:06 +02:00
Mikael Hugo
8133ba9003 fix(sf): avoid parallel research redispatch loops 2026-05-02 17:08:36 +02:00
Mikael Hugo
71ce87b981 fix(sf): await scoped dispatch messages 2026-05-02 16:57:41 +02:00
Mikael Hugo
364a1e000e fix(sf): compact feedback view and animate progress 2026-05-02 16:43:54 +02:00
Mikael Hugo
fbee428196 fix(sf): record sessionId+sessionFile in auto.lock at acquire time
acquireSessionLock now accepts an optional sessionInfo arg (sessionId,
sessionFile) and writes both into the initial lockData JSON. The
caller in auto-start.ts:382 reads them from ctx.sessionManager.
updateSessionLock already writes these fields per-dispatch; this
closes the gap at acquire time.

Lets observers correlate the live auto.lock with the .sf/sessions/
event log (e.g. flow-auditor agents, dashboard, doctor).

Resolves: sf-moocx6lv-9grpvt (active-auto-session-pointer-missing).

Tests: 32/32 in session-lock + auto-start.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 16:27:08 +02:00
Mikael Hugo
8814e0b8ce fix(sf): avoid self-reload on dirty inline fixes 2026-05-02 16:26:06 +02:00
Mikael Hugo
f5290e41aa fix(sf): reload after self-feedback inline fixes 2026-05-02 16:12:23 +02:00
Mikael Hugo
a4059e5871 fix(sf): add 'hook' to LogComponent + use it in hook-emitter
The auto-drain shipped hook-emitter.ts:80,93 logWarning calls with
component "hook-emitter" but that string wasn't in the LogComponent
union, blocking tsc compilation. Add 'hook' to the union (consistent
with the existing short component names like 'tool', 'dispatch',
'timer') and update the two callsites.

Without this, tsc fails and dist/resource-loader.js (which contains
the new verifyManifestFilesExist fix) can't update — leaving the
ask-user-questions.js boot failure unresolved despite the source-side
fix landing in aa7d3f10a.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 16:08:16 +02:00
Mikael Hugo
644187c73e fix: resolve 10 high-severity self-feedback inline-fix issues
- gap-audit prompt detection: Add DYNAMICALLY_LOADED_PROMPTS set for prompts
  loaded through wrappers (research-slice, plan-slice, execute-task, etc.)
  and detect loadPrompt calls with comma-separated args (#sf-moobj36l-ewu7js)

- gap-audit command detection: Detect exact match, prefix match, and
  switch/case patterns for command dispatch (#sf-moobj36o-n8b7g9)

- empty task summary: Add isValidTaskSummary() to require non-empty content
  with frontmatter or H1 before reconciliation marks task complete
  (#sf-moobj36o-6rxy6e)

- journal write failures: Emit bounded health warning to .write-failures.jsonl
  on journal write failure with per-session dedup (#sf-moobj36p-ikq3b2)

- resource sync manifest divergence: Add verifyManifestFilesExist() to check
  all manifest-listed files exist on disk after hash match (#sf-moody5qi-8gbwp2)

- self-feedback markdown stale: Regenerate SELF-FEEDBACK.md from jsonl on
  markResolved with resolved entries section (#sf-moobj36p-rlo95i)

- self-feedback context bloat: Cap entries to 20 max, 4000 chars, inject
  compact summaries only with pointer to jsonl for full evidence
  (#sf-moobj36p-ko6snt)

- hook-emitter types: Replace unknown with EventResult discriminated union,
  implement emitExtensionEvent call with fallback warning when _pi missing
  (#sf-moobmhwt-bxejb6, #sf-moobmhx4-gk9g83)

- export visualizer types: Add VisualizerExportData interface with proper
  PhaseAggregate/SliceAggregate/ModelAggregate/ProjectTotals types
  replacing any (#sf-moobmhx0-ow5fhy)

- native-edit-bridge: Already resolved (artifact removed from repo)
  (#sf-moobj36q-z4id3u)
2026-05-02 16:03:52 +02:00
Mikael Hugo
c61f848f79 fix(sf): make reload work in interactive sessions 2026-05-02 15:52:31 +02:00
Mikael Hugo
a48cf9beb0 refactor(sf): rename sift cache env to SIFT_SEARCH_CACHE
Switches the per-project sift warmup runtime dir field from cacheHome
(generic XDG_CACHE_HOME) to searchCache (specific SIFT_SEARCH_CACHE).
Narrower env var only redirects sift's search index, leaving sift's
other XDG_CACHE_HOME consumers (model downloads etc.) on the global
~/.cache/sift path so models are shared across projects.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 15:33:41 +02:00
Mikael Hugo
c4ac851187 fix(sf): isolate sift warmup cache per project 2026-05-02 15:24:14 +02:00
Mikael Hugo
f21890addb fix(sf): cap sift warmup and add minimax coverage 2026-05-02 15:13:16 +02:00
Mikael Hugo
7e1eff46a2 fix(sf): remove unwired native edit bridge 2026-05-02 15:02:26 +02:00
Mikael Hugo
9f773815d1 fix(sf): repair doctor orphan cleanup 2026-05-02 14:34:16 +02:00
Mikael Hugo
f990ce1048 test(sf): cover manual rate command 2026-05-02 14:26:31 +02:00
Mikael Hugo
d4e094b408 fix(sf): surface agent-end ordering failures 2026-05-02 14:25:44 +02:00
Mikael Hugo
c19d987894 fix(sf): wire /sf rate to manual ops dispatcher
/sf rate was advertised in commands/catalog.ts and reachable from auto-mode
but had no branch in the manual ops handler — typing /sf rate outside
auto-mode silently no-op'd because ops.ts had no trimmed.startsWith("rate ")
branch. Add the dispatch alongside the existing /sf todo branch using the
same lazy-import pattern. handleRate from commands-rate.ts already exists.

Resolves: sf-monzctqn-m42nlq (command-dispatch-gap).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 14:24:23 +02:00
Mikael Hugo
a8f0c63b0a fix(sf): contain research unit dispatch 2026-05-02 14:23:01 +02:00
Mikael Hugo
64b46fcb8a fix(sf): self-heal stale auto locks before resume 2026-05-02 14:10:16 +02:00
Mikael Hugo
bba5a7f143 fix(headless): ignore pasted prose on orchestrator stdin 2026-05-02 14:08:08 +02:00
Mikael Hugo
3d0ebd981f fix(sf): drain self-feedback into repair turns 2026-05-02 13:59:22 +02:00
Mikael Hugo
983a2e0a44 refactor(sf): rename BACKLOG.md → SELF-FEEDBACK.md (matches jsonl SoT)
The forge-local human-readable file was misnamed — it's sf-internal self-
reports, not a generic project backlog. The jsonl source-of-truth is
already self-feedback.jsonl; the markdown should match.

Renames:
- File: BACKLOG.md → SELF-FEEDBACK.md
- Constant: BACKLOG_HEADER → SELF_FEEDBACK_HEADER
- Constant: BACKLOG_MAX_CHARS → SELF_FEEDBACK_MAX_CHARS
- Function: appendBacklogRow → appendSelfFeedbackRow
- Function: loadBacklogBlock → loadSelfFeedbackBlock (parallel session)
- Prompt file: prompts/triage-backlog.md → prompts/triage-self-feedback.md (parallel session)
- Module: triage-backlog.ts → triage-self-feedback.ts (parallel session)
- Header: "# SF Self-Feedback Backlog" → "# SF Self-Feedback"

Doc/text refs across prompts (execute-task, complete-milestone,
triage-self-feedback) and helper modules (gap-audit, requirement-promoter,
db-tools, system-context) updated to .sf/SELF-FEEDBACK.md.

Migration: new exported migrateLegacyBacklogFilename() in self-feedback.ts
runs at session_start (wired in register-hooks.ts) — renames the legacy
BACKLOG.md → SELF-FEEDBACK.md once, idempotent + non-fatal. system-context's
loadSelfFeedbackBlock also reads either name during the transition.

system-context.ts: BACKLOG_MAX_CHARS retained but raised earlier from 2000
to 8000 with all-entries-fit-or-truncate-tail (separate commit). The SoT
mtime-cache and per-severity rendering remain as before.

Tests: 77/77 pass across UOK + upstream-bridge + triage-self-feedback.

Not done in this commit (next iteration):
- Direct-drain dispatch at session_start for high/critical (subprocess spawn).
- Queue promotion for medium severity.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 13:52:57 +02:00
Mikael Hugo
6a492079b9 fix(sf): speed resource sync and expand backlog context 2026-05-02 13:42:50 +02:00