Commit graph

49 commits

Author SHA1 Message Date
Mikael Hugo
ba4b2d46d9 sf snapshot: uncommitted changes after 43m inactivity 2026-05-15 15:53:19 +02:00
Mikael Hugo
cf52aceb64 feat(uok,gate-runner): extend ctx with surface/runControl/permissionProfile/parentTrace
Slice 3b of "Make UOK the SF Control Plane". UokGateRunner.run now reads
the schema-v2 run-context fields off ctx and propagates them into every
gate_run trace event (unknown-gate path, circuit-breaker-blocked path,
normal execution path). Fields are omitted when absent so legacy callers
keep the pre-v2 shape and status-uok continues to classify them as
"legacy" rather than "incomplete".

Helper buildGateRunEvent centralizes the trace shape so the three sites
stay in sync.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 18:13:45 +02:00
Mikael Hugo
e2dd625d7d sf snapshot: uncommitted changes after 383m inactivity 2026-05-14 16:03:35 +02:00
Mikael Hugo
f68ab20953 fix(ai): backfill MiniMax M2/M2.1 cacheRead pricing 2026-05-14 04:55:46 +02:00
Mikael Hugo
65e195a9fd feat: Created draft mapping of SF patterns to ACE reference draft
SF-Task: S05/T01
2026-05-13 02:01:41 +02:00
Mikael Hugo
e2f2cb7e2e feat: Create Command Behavior Verification Matrix across CLI, TUI, and…
SF-Task: S04/T01
2026-05-12 23:01:31 +02:00
Mikael Hugo
f789bf0f40 sf snapshot: uncommitted changes after 53m inactivity 2026-05-12 22:51:31 +02:00
Mikael Hugo
9a678f1449 sf snapshot: uncommitted changes after 270m inactivity 2026-05-12 21:58:31 +02:00
Mikael Hugo
16db710468 sf snapshot: uncommitted changes after 49m inactivity 2026-05-12 16:45:04 +02:00
Mikael Hugo
a9ebfb4442 fix(skills): move sf-wiki project override to .agents/skills/ (standard location)
.agents/skills/ is the documented standard for project-level skill overrides
(docs/user-docs/skills.md). .sf/skills/ is also searched but .agents/skills/
is the ecosystem-standard path used across all compatible agents.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-11 20:10:21 +02:00
Mikael Hugo
edd0eb22ac feat(skills): add project-level sf-wiki skill override with UPPERCASE convention
.sf/skills/ is the project-local skill override directory. This override
inherits all sf-wiki defaults and adds one project-specific rule: wiki
pages use UPPERCASE filenames (INDEX.md, ARCHITECTURE.md, etc.) to match
the .sf/ operational file convention (DECISIONS.md, KNOWLEDGE.md, etc.).

The built-in src/resources/skills/sf-wiki/SKILL.md stays generic (lowercase).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-11 19:54:18 +02:00
Mikael Hugo
0d187e53d7 chore(wiki): rename wiki pages to UPPERCASE to match .sf/ convention
All .sf/ operational files use UPPERCASE (DECISIONS.md, KNOWLEDGE.md, etc.).
Wiki pages now follow the same convention: INDEX.md, ARCHITECTURE.md,
WORKFLOWS.md, SUBSYSTEMS.md, GLOSSARY.md.

Also updates sf-wiki SKILL.md and system.md prompt references.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-11 19:50:06 +02:00
Mikael Hugo
eacbbaac82 TODO: simplify md-tracking — drop snapshot blob, accept mid-edit corner
Some checks are pending
CI / detect-changes (push) Waiting to run
CI / docs-check (push) Blocked by required conditions
CI / lint (push) Blocked by required conditions
CI / build (push) Blocked by required conditions
CI / integration-tests (push) Blocked by required conditions
CI / windows-portability (push) Blocked by required conditions
CI / rtk-portability (linux, blacksmith-4vcpu-ubuntu-2404) (push) Blocked by required conditions
CI / rtk-portability (macos, macos-15) (push) Blocked by required conditions
CI / rtk-portability (windows, blacksmith-4vcpu-windows-2025) (push) Blocked by required conditions
Final settled design: sha + git ref only, no DB content snapshots at
all. The mid-edit case (file observed dirty) loses the ability to
reconstruct the intermediate working-tree state, but the change-
detection signal is preserved and the operator can commit first if
intermediate fidelity matters.

Trades a corner-case fidelity loss for a much simpler schema and
no DB-vs-disk content duplication. Git remains the only version
store; the DB row is a pure "where I left off" pointer.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 19:49:25 +02:00
Mikael Hugo
b818ae2c5a docs(wiki): add subsystems.md and glossary.md wiki pages
Complete the standard wiki page set from sf-wiki SKILL.md:
- subsystems.md: table of all subsystems with path, purpose, tests
- glossary.md: project-specific terms (ADR, UOK, PDD, YOLO, wiki, etc.)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-11 19:27:01 +02:00
Mikael Hugo
e679478d1b feat(wiki): wire .sf/wiki/ as tracked context source
- auto-bootstrap-context.js: scan .sf/wiki/*.md in collectAutoBootstrapFiles
  so wiki pages load as priority context in headless autonomous bootstrap
- headless-context.ts: same fix for the TS bootstrap path
- system-context.js: loadWikiBlock already existed and was wired into
  fullSystem; add .sf/wiki/ to Tier 1 escalation policy lookup sources
- system.md: add wiki/ to .sf/ directory structure; add Conventions entry
  explaining wiki is tracked in git (hand edits persist) and injected
  automatically when present
- git-runtime-patterns.js: do NOT gitignore .sf/wiki/ — wiki pages are
  tracked like DECISIONS.md so hand edits survive commits and clones
- .sf/wiki/: seed index.md, architecture.md, workflows.md for this repo

Wiki filenames follow sf-wiki SKILL.md convention: lowercase (index.md,
architecture.md, workflows.md, subsystems.md, glossary.md).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-11 19:24:23 +02:00
Mikael Hugo
64ddbd950f refactor(extensions): consolidate duplicate code into canonical modules
- Delete ghost package packages/pi-agent-core (no dist, no consumers,
  TS build errors; JS source sf-db.js had 3 commits not mirrored in TS)
- Remove build:pi-agent-core from root package.json build:pi pipeline
- Merge all models from MODEL_COST_PER_1K_INPUT into BUNDLED_COST_TABLE
  (model-cost-table.js is now the single canonical cost source)
- Remove duplicate MODEL_COST_PER_1K_INPUT object and getModelCost()
  from model-router.js; use lookupModelCost() from model-cost-table.js
- Replace hand-rolled isTransientNetworkError in preferences-models.js
  with delegation to classifyError() in error-classifier.js

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-11 08:28:49 +02:00
Mikael Hugo
0b5fa75c0d fix(lint): fix all pre-existing lint failures
- check-sf-extension-inventory.mjs: expand parseDirectRegisteredCommands()
  scan to include 7 more files (guards/inturn.js, notifications/notify.js,
  permissions/index.js, ui/usage-bar.js, commands/legacy/audit.js,
  commands/legacy/create-extension.js, commands/legacy/create-slash-command.js)
  and filter results by BASE_RUNTIME_COMMAND_NAMES to exclude doc-string false
  positives ("name" in create-slash-command.js template text)

- extension-manifest.json: remove 'clear' (subcommand of logs/notifications,
  never a top-level pi.registerCommand)

- packages/pi-agent-core/src/db/sf-db.ts: fix 23 noVoidTypeReturn errors
  - openDatabase: void → boolean (caller uses return value at line 5625)
  - claimEscalationOverride: void → boolean (caller checks at escalation.js:243)
  - resolveSelfFeedbackEntry: void → boolean (caller checks at self-feedback.js:387)
  - copyWorktreeDb: void → boolean (caller checks at reconcileWorktreeDb)
  - compactUokMessages: void → {before,after} (caller returns value at message-bus.js:238)
  - insertSessionTurn: void → bigint|null (caller uses id at session-recorder.js:104)
  - expireStaleMemories: void → number (caller uses count at auto-start.js:1047)
  - deleteMemorySourceRow: void → boolean (caller returns value at memory-source-store.js:107)
  - deleteMemoryEmbedding: void → boolean (caller returns value at memory-embeddings.js:328)
  - updateBacklogItemStatus: remove dead return expression (callers discard value)
  - removeBacklogItem: remove dead return expression (callers discard value)
  - updateGateCircuitBreaker: remove dead return {total,avgMs,...} (wrong-type
    code accidentally merged from getGateLatencyStats, never reachable)
  - markUokMessageRead: remove dead return true/false (callers discard value)

- Auto-fix formatting and organizeImports in ~30 source files (biome --write)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-11 04:02:31 +02:00
Mikael Hugo
adb449d642 fix: consolidate extensions into sf, migrate kernel.ts, fix test suite
- Fold sf-usage-bar, sf-notify, sf-inturn-guard, sf-permissions,
  slash-commands into sf extension (ui/, notifications/, guards/,
  permissions/, commands/legacy/)
- Delete vectordrive extension
- Migrate uok/kernel.js to TypeScript (kernel.ts) with full interfaces
- Add allowJs/checkJs:false to tsconfig.resources.json for incremental TS migration
- Add symlink dedup to extension-discovery.ts (seenRealPaths Set)
- Add before_provider_request delegate back to native-search.js so
  session budget tests exercise the middleware end-to-end
- Fix parseSfNativeTools() to return all SF manifest tools (drop sf_ filter)
- Fix test assertions: plan_milestone/complete_task/validate_milestone
- Remove subagent from app-smoke.test.ts (folded into sf/subagent/)
- Remove sf-permissions/sf-inturn-guard/subagent from features-inventory test
- Fix resolveSearchProvider autonomous mode test to pass 'auto' explicitly
- Remove legacy /clear slash command (conflicts with built-in clear_terminal)
- Update web-command-parity-contract.test.ts for clear removal

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-11 02:40:52 +02:00
Mikael Hugo
24592507c3 sf snapshot: uncommitted changes after 53m inactivity 2026-05-11 01:54:55 +02:00
Mikael Hugo
852bf8c5aa sf snapshot: uncommitted changes after 78m inactivity 2026-05-11 01:01:03 +02:00
Mikael Hugo
702ec3fc0e refactor(sf): rename guidance files TASTE.md→STYLE.md, ANTI-GOALS.md→NON-GOALS.md
More self-explanatory names. No behavioral change — same files, same purpose.

- .sf/TASTE.md → .sf/STYLE.md (# Taste → # Style)
- .sf/ANTI-GOALS.md → .sf/NON-GOALS.md (# Anti-goals → # Non-goals)
- All code references updated: auto-bootstrap-context, system-context,
  gitignore, milestone-framing-check, scaffold-constants, spec-projections
- Section headings injected into agent context updated to match

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-10 21:28:31 +02:00
Mikael Hugo
ce13017519 chore(.sf): update PROJECT.md — DB healthy, S01+S02 complete, S03 next
- Remove stale BLOCKED/corrupted-DB claim
- Mark M001-3hf5k0 complete, reflect S01+S02 done in M001-6377a4
- Clarify S03 has T02-T04 pending (verification evidence work)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-10 20:49:08 +02:00
Mikael Hugo
d33e30e885 feat(notifications): NOTICE_KIND enum, schema v2 dedup, sf-db cleanup
- notification-store: schema v2 — repeatCount/lastTs merge for non-blocking
  notices; NOTICE_KIND enum (SYSTEM_NOTICE, TOOL_NOTICE, BLOCKING_NOTICE,
  USER_VISIBLE) for renderer classification without message parsing
- sf-db: remove gate_runs and audit_events tables (replaced by uok audit.js
  and trace-writer); schema reduced by ~370 lines
- notify-interceptor: tag auto-mode system notices with NOTICE_KIND.SYSTEM_NOTICE
- auto-prompts, guided-flow, system-context: use NOTICE_KIND on emit calls
- cli-status: expanded headless status surface + test coverage
- headless-types: new status fields
- Makefile/justfile: dev workflow improvements
- record-promoter, requirement-promoter: minor cleanup
- sf-db-migration tests: updated for dropped tables
- uok-gate-runner, uok-metrics, uok-outcome, uok-status tests: updated

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-10 20:13:58 +02:00
Mikael Hugo
3ffd882c8c sf snapshot: uncommitted changes after 56m inactivity 2026-05-10 17:16:30 +02:00
Mikael Hugo
924383b6f7 sf snapshot: uncommitted changes after 197m inactivity 2026-05-10 15:59:33 +02:00
Mikael Hugo
02a4339a51 refactor: rename pi-* packages to forge-native names (Phase 1)
Rename all four packages/pi-* directories to forge-native names,
stripping the 'pi' identity and establishing forge's own:

- packages/pi-coding-agent → packages/coding-agent
- packages/pi-ai → packages/ai
- packages/pi-agent-core → packages/agent-core
- packages/pi-tui → packages/tui

Package names updated:
- @singularity-forge/pi-coding-agent → @singularity-forge/coding-agent
- @singularity-forge/pi-ai → @singularity-forge/ai
- @singularity-forge/pi-agent-core → @singularity-forge/agent-core
- @singularity-forge/pi-tui → @singularity-forge/tui

All import references, bare string references, path references,
internal variable names (_bundledPi*), and dist files updated.
@mariozechner/pi-* third-party compat aliases preserved.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-10 11:28:01 +02:00
Mikael Hugo
b2bcb922de sf snapshot: uncommitted changes after 37m inactivity 2026-05-10 09:56:56 +02:00
Mikael Hugo
7e8e3aa846 sf snapshot: pre-dispatch, uncommitted changes after 30m inactivity 2026-05-10 09:19:51 +02:00
Mikael Hugo
529138db9a sf snapshot: uncommitted changes after 33m inactivity 2026-05-10 07:54:07 +02:00
Mikael Hugo
20c0d74106 sf snapshot: pre-dispatch, uncommitted changes after 31m inactivity 2026-05-10 06:26:32 +02:00
Mikael Hugo
074dab5644 sf snapshot: uncommitted changes after 59m inactivity 2026-05-10 05:55:06 +02:00
Mikael Hugo
be785ea13f fix(tui): restore auto mode bottom banner
Remove setFooter(hideFooter) calls in auto-start.js and auto.js that were
overriding the sf-tui footer with a near-invisible stub. The sf-tui footer
already checks isAutoActive() and routes to renderAutoFooter — no override
needed. Also remove now-unused hideFooter import from auto.js.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-10 04:33:54 +02:00
Mikael Hugo
32d2faac50 chore: update metrics db wal/shm state
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-10 04:29:28 +02:00
Mikael Hugo
01d58c570d sf snapshot: uncommitted changes after 36m inactivity 2026-05-10 04:27:43 +02:00
Mikael Hugo
6b7d327672 sf snapshot: uncommitted changes after 30m inactivity 2026-05-10 03:21:24 +02:00
Mikael Hugo
a3f2479a4c fix: remove stale M001/M002 milestone dirs; fix dispatch-guard circular dep; fix telemetry normalization
- Remove stale .sf/milestones/M001/ and M002/ (not in DB, were blocking dispatch)
- dispatch-guard.js: import findMilestoneIds from milestone-ids.js directly (not
  via guided-flow.js, which is in the circular-dep cluster)
- auto.js: normalize 'Cannot dispatch' → prior-slice-blocker, 'SF resources updated'
  → resources-stale, 'Stuck:' → stuck in telemetry (was silently bucketing as 'other')

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-10 02:12:13 +02:00
Mikael Hugo
15185c2e7d sf snapshot: uncommitted changes after 60m inactivity 2026-05-10 01:29:08 +02:00
Mikael Hugo
f66555456f sf snapshot: uncommitted changes after 72m inactivity 2026-05-10 00:28:55 +02:00
Mikael Hugo
6f174cabc1 sf snapshot: uncommitted changes after 59m inactivity 2026-05-09 23:16:14 +02:00
Mikael Hugo
5065701a31 sf snapshot: uncommitted changes after 31m inactivity 2026-05-09 21:41:08 +02:00
Mikael Hugo
8432b626c2 sf snapshot: uncommitted changes after 34m inactivity 2026-05-09 19:40:31 +02:00
Mikael Hugo
9875812c1b sf snapshot: uncommitted changes after 131m inactivity 2026-05-09 02:53:47 +02:00
Mikael Hugo
7287490cfd fix: enhance missing-checkpoint repair with better low-confidence guidance
- Add explicit low-confidence reconstruction guidance for no-transcript cases
- Clarify when to use outcome='decide' when confidence < 0.98
- Fix typo in repair prompt ('what was was expected' -> 'what was expected')
- Strengthen final human-acceptance-gate guidance to prefer outcome='decide'
- Addresses solver-missing-checkpoint self-feedback entry acceptance criteria

Resolves: sf-mowykewh-3ehn5p
2026-05-08 15:47:00 +02:00
Mikael Hugo
89677b7e9b sf snapshot: uncommitted changes after 110m inactivity 2026-05-08 00:17:47 +02:00
Mikael Hugo
deeb4dbd4e sf snapshot: uncommitted changes after 61m inactivity 2026-05-07 16:39:39 +02:00
Mikael Hugo
4f217cc88c docs: promote sf state guidance 2026-05-07 03:59:38 +02:00
Mikael Hugo
a14cd0df29 chore: ignore generated sf eval outputs 2026-05-07 03:57:08 +02:00
Mikael Hugo
14c59a7583 Phase 3: Property-based FSM tests (17 passing tests)
- Created src/resources/extensions/sf/tests/phases-fsm.test.ts
- 17 comprehensive property-based tests using fast-check
- FSM invariants verified: terminal states, no invalid transitions, dispatch termination
- State transition correctness validated for all paths (pending→running→done, etc.)
- Performance tests confirm sub-1s processing for 500+ concurrent units
- Tests confirm BLOCKED state is non-terminal (can retry after unblock)
- All tests passing 

Phase 3 completes test coverage roadmap: 40% → 60%+ coverage target
- Phase 1: 48 tests (metrics + triage) ✓
- Phase 2: 31 tests (crash recovery) ✓
- Phase 3: 17 tests (property-based FSM) ✓

Total this session: 104 new tests, all passing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-07 01:01:04 +02:00
Mikael Hugo
fec30b8278 chore: init sf 2026-05-06 23:03:20 +02:00