Files
loki/scripts
GandClaude Opus 4.8 d3bceadf4e feat(frontier): self-improvement loop — digest → proposals → human-gated goals (#34)
The second half of the frontier loop, and the differentiated one: turn each
day's digest into concrete proposals for how FleetCrown should evolve. The loop
AUTO-PROPOSES ONLY — a human accepts (→ a roadmap goal) or dismisses; it never
builds on its own (building straight from a news feed is exactly the ungoverned
action to avoid). Decision history grounds the next run so nothing is re-proposed.

Brain (src/lib/frontier/propose.ts):
- generateProposals — Groq, grounded in FleetCrown's mission + the owner's
  active goals + already-considered titles. Returns ≤3 specific proposals, each
  tying a real frontier item to a FleetCrown capability; empty list is the
  correct (and common) answer. sourceUrls validated against the real digest.
- critiqueProposals — an adversarial reviewer that defaults to REJECTING and
  scores 0-100; only ≥70 reach a human. The `model` param is the cross-model
  verification swap point (callGroqText now takes a model override): point the
  judge at a different model than the generator for uncorrelated errors.
- Code-level Jaccard dedup as a net beyond the LLM instruction.

Wiring:
- run.ts runFrontierProposals: target = owner of the "fleetcrown" entity
  (resolved, not hardcoded) → generate → critique → store survivors.
- The daily cron runs it after the digest (best-effort; never fails the digest).
- frontier_proposals table (status proposed|accepted|dismissed, score, links).
- /api/frontier/proposals (GET list) + /[id] (POST accept→createGoal / dismiss),
  owner-gated via requirePrivateApiAccess.
- /system: FrontierProposalsCard inbox (server read) + ProposalRow (client
  Accept/Dismiss). Accept reuses createGoal; provenance links fold into the goal.

Verified: tsc=0, eslint=0; full local run drafted 3 / surfaced 3 real proposals
(78-90) from today's arXiv items; accept→goal path tested + cleaned up.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 06:33:44 +02:00
..