Files
loki/scripts
be60065267 feat(projects): one "Make it happen" button that starts a project (#158)
* feat(projects): one "Make it happen" button that starts a project

Starting a project meant finding four controls and knowing their order:
AI profile fill (a chip in Context), milestone generation (a second chip
inside that chip's drawer), repo provisioning (inside a collapsed
"Project settings" details), and dispatch (a link to another page). Every
piece already worked. Only the composition was missing, so a person with
an idea and a paragraph describing it faced eight empty fields, a "Set
the next action", an unset completion contract, and a "dispatch one from
Control" dead end.

ProjectKickoff runs those four in order from the description already
written, reporting each step as it lands so a partial failure still says
exactly what got done. lib/project-kickoff is the SSOT for the plan and
is what decides whether the hero renders, so the button can never do more
or less than the page claims.

- kickoff dispatch kind: briefs the agent with the profile + roadmap and
  targets milestone 1, scoped to one run
- provision accepts template "auto", inferred from the project's stack —
  a cold start that stops to ask "which starter?" has already lost
- linked goals break progress ties by creation, so a fresh roadmap's
  "milestone 1" is reproducibly milestone 1
- template list existed three times (zod enum, picker, registry); light
  metadata now lives in config/project-templates and the seeded registry
  derives from it
- 30 assertions covering the plan, the render contract, and inference

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(test): pin autopilot-eligibility to its frozen clock

The `blocked` case called evaluateScheduledDispatch without `nowMs`, so its
one-minute-old fixture was aged against the real wall clock instead of the
NOW the whole file is written against. It went green on 2026-08-02 and started
failing for everyone 24h later, when that fixture crossed
BLOCKED_RECHECK_TTL_MS and the block correctly decayed to dispatchable — a
time bomb in the test, not a regression in the gate.

Default nowMs in one wrapper every case now goes through, so no future case
can forget it, and give the SSOT property check a single shared opts object:
"identical facts" has to include the clock, or it compares two different
questions.

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

* fix(projects): kickoff reports what the dispatch actually did

Self-review catch. injectPrompt answers 200 with `ok: true` in two cases where
no agent is working: it REFUSED because the user was mid-keystroke in the target
tab (`blocked: user-typing`), and it queued a command with no runner connected
to collect it (`warning: runner-offline`). Both are flagged deliberately —
inject-core's own comment says it fails loud "so the UI can warn instead of
pretending it's running" — and the card reported both as "agent working".

A card whose entire justification is honest per-step reporting must not be the
thing that launders those. Refused now shows as failed, which also swaps the
useless "Watch it work" for the "Try again" that would fix it; queued says it is
queued.

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

---------

Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 16:06:15 +02:00
..