Files
loki/scripts
ecb45ff219 chore(agents): derive default models from adapter SSOT; prune unparsed narration mandate (#119)
* chore(agents): derive default models from adapter SSOT; prune unparsed narration mandate

- AGENT_DEFAULT_MODELS in agent-registry.ts duplicated each adapter's
  defaultModel (claude.ts, codex.ts, gemini.ts, cursor.ts, grok.ts).
  Now derived from the adapter registry via findAdapter — the adapter
  definitions are the single source of truth. All consumers
  (agent-preferences.ts, orchestration/run/route.ts) unchanged.
- Removed the forced opening line 'Picked <X> (T_); displaced <Y>.'
  from the three autopilot templates in prompt-library.ts (next_best,
  test_and_fix, quality). Repo-wide grep confirms nothing parses this
  line — it was pure narration, which current prompting guidance flags
  as counterproductive. The parsed session-handoff contract
  (status:/tsc:/lint:/tests: fields) is untouched.

Note: re-run scripts/generate-agent-prompts.ts after merge to refresh
~/.config/agent-prompts.json.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(test): stop worktree-workspace test from hijacking the real repo under git hooks

When git runs hooks (husky pre-push), it exports GIT_DIR — absolute when
pushing from a linked worktree. The test's git child processes inherited
it, and absolute GIT_DIR overrides `git -C <sandbox>`, so every
'throwaway repo' operation silently targeted the REAL repository:
stray 'init' commits authored by test@test landed on real branches
(replacing the tree with the sandbox's app.ts), and the test's worktree
add/prune ops ran against the real repo. This is the likely root cause
of the known 'git user test wipes .claude/worktrees/*' hazard, and it
made any push from a linked worktree both destructive and red.

Fix: strip GIT_DIR/GIT_WORK_TREE/GIT_INDEX_FILE/GIT_COMMON_DIR/
GIT_OBJECT_DIRECTORY/GIT_PREFIX from process.env before any git
subprocess runs. Verified: suite passes standalone and with a hostile
absolute GIT_DIR exported; real repo untouched in both.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: test <test@test>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 16:38:24 +02:00
..