@alecsibilia/luca 14.0.0-alpha.2 → 14.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +76 -0
- package/README.md +7 -2
- package/board/client/board-look.ts +31 -1
- package/board/client/board-panel-parts.tsx +150 -0
- package/board/client/board-panel-stages.ts +99 -0
- package/board/client/board-panel-styles.ts +223 -0
- package/board/client/board-panel.tsx +77 -1275
- package/board/client/engine-life.ts +48 -0
- package/board/client/final-review-stack.tsx +144 -0
- package/board/client/heartbeat.tsx +61 -0
- package/board/client/helper-lines.tsx +69 -0
- package/board/client/live-feed.tsx +86 -0
- package/board/client/live-line.ts +73 -0
- package/board/client/model-line.tsx +178 -0
- package/board/client/needs-you-section.tsx +133 -0
- package/board/client/one-line.tsx +193 -0
- package/board/client/repo-wait-banner.tsx +69 -0
- package/board/client/run-footer.tsx +68 -0
- package/board/client/run-header.tsx +189 -0
- package/board/client/run-picker.tsx +98 -0
- package/board/client/status-bar.tsx +131 -0
- package/board/client/step-dots.tsx +127 -0
- package/board/client/stuck-actions.tsx +269 -0
- package/board/client/ticket-card-view.tsx +238 -0
- package/board/client/ticket-detail.tsx +87 -0
- package/board/client/ticket-stack.tsx +119 -0
- package/board/client/ticket-wait.ts +188 -0
- package/board/client/timeline-rows.tsx +41 -14
- package/board/client/usage-line.tsx +51 -0
- package/board/client/wait-line.tsx +39 -0
- package/board/index.client.tsx +1 -1
- package/board/index.server.ts +7 -1
- package/board/package.json +1 -1
- package/board/server/board-panel-state-helpers.ts +67 -0
- package/board/server/board-server-check.ts +294 -0
- package/board/server/board-server-engine.ts +129 -0
- package/board/server/board-server-events.ts +134 -0
- package/board/server/board-server-read.ts +190 -0
- package/board/server/board-server-resume.ts +164 -0
- package/board/server/board-server-start.ts +174 -0
- package/board/server/board-server-store.ts +281 -0
- package/board/server/board-server-types.ts +114 -0
- package/board/server/board-server-util.ts +4 -0
- package/board/server/board-server.ts +52 -943
- package/board/server/board-vocabulary-engine.ts +144 -0
- package/board/server/board-vocabulary-review.ts +115 -0
- package/board/server/board-vocabulary-run.ts +145 -0
- package/board/server/board-vocabulary-shapes.ts +153 -0
- package/board/server/board-vocabulary.ts +20 -375
- package/board/server/current-step-panel-helpers.ts +108 -0
- package/board/server/describe-record.ts +403 -0
- package/board/server/engine-launch.ts +20 -3
- package/board/server/engine-restart-helpers.ts +105 -0
- package/board/server/engine-watch.ts +45 -5
- package/board/server/journal-rebuild-helpers.ts +169 -0
- package/board/server/live-file.ts +130 -0
- package/board/server/luca-version.ts +1 -1
- package/board/server/make-rows.ts +14 -629
- package/board/server/record-texts.ts +350 -0
- package/board/server/reduce-board-agent-start.ts +224 -0
- package/board/server/reduce-board-agents.ts +160 -0
- package/board/server/reduce-board-counters.ts +138 -0
- package/board/server/reduce-board-create.ts +148 -0
- package/board/server/reduce-board-final-review.ts +174 -0
- package/board/server/reduce-board-needs-you.ts +283 -0
- package/board/server/reduce-board-reasons.ts +59 -0
- package/board/server/reduce-board-run.ts +255 -0
- package/board/server/reduce-board-settle.ts +88 -0
- package/board/server/reduce-board-steps.ts +226 -0
- package/board/server/reduce-board-text.ts +139 -0
- package/board/server/reduce-board-ticket-checks.ts +168 -0
- package/board/server/reduce-board-ticket-join.ts +144 -0
- package/board/server/reduce-board-ticket-start.ts +132 -0
- package/board/server/reduce-board-update.ts +117 -0
- package/board/server/reduce-board-usage.ts +247 -0
- package/board/server/reduce-board.ts +100 -1917
- package/board/server/reply-post.ts +407 -0
- package/board/server/run-registry.ts +8 -4
- package/board/server/ticket-stages-panel-helpers.ts +296 -0
- package/board/shared/board-rows.ts +9 -0
- package/board/shared/board-rpc.ts +42 -0
- package/board/shared/board-state-counts.ts +77 -0
- package/board/shared/board-state-live.ts +99 -0
- package/board/shared/board-state-review.ts +59 -0
- package/board/shared/board-state-run.ts +236 -0
- package/board/shared/board-state-ticket.ts +257 -0
- package/board/shared/board-state-usage.ts +107 -0
- package/board/shared/board-state.ts +97 -567
- package/board/shared/reply-actions.ts +207 -0
- package/engine/agents/agent-launcher.ts +27 -4
- package/engine/agents/claude-launcher-helpers.ts +233 -0
- package/engine/agents/claude-launcher.ts +28 -669
- package/engine/agents/claude-messages.ts +212 -0
- package/engine/agents/claude-options.ts +43 -8
- package/engine/agents/common-instructions.ts +138 -0
- package/engine/agents/input-channel.ts +36 -0
- package/engine/agents/launch-paths.ts +29 -0
- package/engine/agents/launch-session.ts +227 -0
- package/engine/agents/learner-instructions.ts +31 -0
- package/engine/agents/open-session.ts +210 -0
- package/engine/agents/prompt-sections.ts +95 -0
- package/engine/agents/rejoin-prompts.ts +135 -0
- package/engine/agents/reviewer-instructions.ts +99 -0
- package/engine/agents/role-instructions.ts +31 -244
- package/engine/agents/role-prompts.ts +39 -109
- package/engine/agents/role-results.ts +106 -7
- package/engine/agents/scripted-launcher.ts +21 -6
- package/engine/agents/session-pool.ts +124 -0
- package/engine/agents/turn-progress.ts +283 -0
- package/engine/agents/writer-instructions.ts +151 -0
- package/engine/cli/computer-adapters-real.ts +15 -3
- package/engine/cli/computer-adapters.ts +2 -0
- package/engine/cli/computer-checks.ts +87 -4
- package/engine/cli/config-reload-text.ts +39 -0
- package/engine/cli/decision-model-setup.ts +70 -0
- package/engine/cli/doctor-command.ts +1 -0
- package/engine/cli/doctor.ts +21 -3
- package/engine/cli/going-runs.ts +192 -36
- package/engine/cli/init-command.ts +1 -0
- package/engine/cli/init.ts +23 -1
- package/engine/cli/live-runs.ts +73 -0
- package/engine/cli/luca-run.ts +42 -7
- package/engine/cli/luca-skills.ts +183 -0
- package/engine/cli/luca.ts +8 -1
- package/engine/cli/models-command.ts +119 -0
- package/engine/cli/read-run.ts +81 -0
- package/engine/cli/run-args.ts +33 -6
- package/engine/cli/run-demo.ts +143 -0
- package/engine/cli/run-end.ts +184 -0
- package/engine/cli/run-modes-helpers.ts +81 -0
- package/engine/cli/run-modes.ts +62 -439
- package/engine/cli/setup.ts +5 -48
- package/engine/cli/unfinished-runs.ts +122 -0
- package/engine/cli/upgrade-command.ts +212 -30
- package/engine/cli/upgrade-finish.ts +149 -0
- package/engine/cli/upgrade.ts +112 -71
- package/engine/config/config-fields.ts +127 -0
- package/engine/config/config-reload.ts +250 -0
- package/engine/config/engine-config-schema.ts +235 -0
- package/engine/config/engine-config.ts +72 -142
- package/engine/config/test-commands.ts +102 -0
- package/engine/core/agent-guards-helpers.ts +84 -0
- package/engine/core/agent-turn.ts +395 -0
- package/engine/core/already-done.ts +44 -1
- package/engine/core/build-action.ts +214 -0
- package/engine/core/build-context.ts +135 -0
- package/engine/core/build-launch.ts +259 -0
- package/engine/core/commit-in.ts +282 -0
- package/engine/core/decide-build-early.ts +108 -0
- package/engine/core/decide-build-ending.ts +145 -0
- package/engine/core/decide-build-helpers.ts +87 -0
- package/engine/core/decide-build-tickets.ts +207 -0
- package/engine/core/decide-build-view.ts +103 -0
- package/engine/core/decide-build.ts +101 -1368
- package/engine/core/decide-final-fix.ts +203 -0
- package/engine/core/decide-final-review.ts +55 -310
- package/engine/core/decide-red-green.ts +398 -0
- package/engine/core/decide-rejoin.ts +259 -0
- package/engine/core/decide-repo-wait.ts +129 -0
- package/engine/core/decide-run-budget.ts +86 -12
- package/engine/core/decide-stuck-helpers.ts +127 -0
- package/engine/core/decide-stuck.ts +60 -8
- package/engine/core/decide-ticket-review.ts +95 -0
- package/engine/core/decide-ticket.ts +267 -0
- package/engine/core/decide-waits.ts +47 -0
- package/engine/core/decide.ts +74 -23
- package/engine/core/engine-chores.ts +163 -0
- package/engine/core/environment-rerun.ts +83 -0
- package/engine/core/evidence-text.ts +84 -0
- package/engine/core/execute-action.ts +303 -0
- package/engine/core/execute-already-done-check.ts +133 -0
- package/engine/core/execute-build.ts +68 -944
- package/engine/core/execute-changeset.ts +5 -7
- package/engine/core/execute-final-review.ts +125 -13
- package/engine/core/execute-gates.ts +182 -0
- package/engine/core/execute-intake.ts +130 -0
- package/engine/core/execute-join.ts +276 -0
- package/engine/core/execute-memory.ts +12 -0
- package/engine/core/execute-pull-request.ts +84 -0
- package/engine/core/execute-red-check.ts +219 -0
- package/engine/core/execute-repo-wait.ts +129 -0
- package/engine/core/execute-stuck.ts +25 -10
- package/engine/core/execute-waits.ts +158 -0
- package/engine/core/execute-with-jev.ts +118 -0
- package/engine/core/execute.ts +124 -831
- package/engine/core/final-failure-cap.ts +38 -0
- package/engine/core/final-review-action.ts +125 -0
- package/engine/core/final-review-text.ts +63 -17
- package/engine/core/final-stuck-text.ts +86 -0
- package/engine/core/fix-loop-text.ts +49 -2
- package/engine/core/left-out.ts +120 -0
- package/engine/core/live-file.ts +372 -0
- package/engine/core/loop-caps.ts +25 -2
- package/engine/core/not-in-run.ts +7 -3
- package/engine/core/pull-request-text.ts +255 -6
- package/engine/core/repo-wait-text.ts +81 -0
- package/engine/core/review-text.ts +55 -1
- package/engine/core/run-crash-recovery-helpers.ts +16 -0
- package/engine/core/run-session-close-helpers.ts +96 -0
- package/engine/core/run-start.ts +148 -0
- package/engine/core/run-stuck-text.ts +86 -0
- package/engine/core/schedule-rules.ts +193 -0
- package/engine/core/stuck-detail-text.ts +89 -0
- package/engine/core/stuck-format.ts +22 -0
- package/engine/core/stuck-text.ts +29 -332
- package/engine/core/ticket-stuck-text.ts +192 -0
- package/engine/core/worktree-changes.ts +106 -0
- package/engine/gates/already-done-check.ts +120 -0
- package/engine/gates/feature-map.ts +96 -0
- package/engine/gates/gate-runner.ts +108 -108
- package/engine/gates/gate-schemas.ts +61 -2
- package/engine/gates/leftover-scan.ts +154 -31
- package/engine/gates/new-tests.ts +45 -0
- package/engine/gates/own-files-check.ts +98 -0
- package/engine/gates/prepare-check.ts +60 -0
- package/engine/gates/prepare-slots.ts +99 -0
- package/engine/gates/red-check.ts +184 -16
- package/engine/gates/shell-check.ts +64 -0
- package/engine/gates/slot-waits.ts +55 -0
- package/engine/gates/slow-test-runner.ts +59 -0
- package/engine/gates/test-checks.ts +161 -0
- package/engine/gates/test-runner.ts +164 -5
- package/engine/gates/test-slots.ts +48 -0
- package/engine/git/git-adapter.ts +55 -396
- package/engine/git/git-commits.ts +132 -0
- package/engine/git/git-join.ts +139 -0
- package/engine/git/git-read.ts +123 -0
- package/engine/git/git-run.ts +32 -0
- package/engine/git/git-worktrees.ts +143 -0
- package/engine/git/outside-links.ts +55 -0
- package/engine/guards/after-turn-check.ts +31 -5
- package/engine/guards/guard-hook.ts +60 -12
- package/engine/guards/guard-roles.ts +68 -0
- package/engine/guards/helper-rules.ts +92 -0
- package/engine/guards/permission-rules.ts +161 -0
- package/engine/guards/role-rules-helpers.ts +48 -0
- package/engine/guards/role-rules.ts +34 -606
- package/engine/guards/shell-rules.ts +344 -0
- package/engine/guards/worktree-git.ts +208 -0
- package/engine/guards/worktree-snapshot.ts +412 -0
- package/engine/guards/worktree-state.ts +28 -825
- package/engine/guards/worktree-undo.ts +260 -0
- package/engine/guards/write-rules.ts +149 -0
- package/engine/index.ts +30 -9
- package/engine/intake/criteria-checks.ts +114 -0
- package/engine/intake/intake-checks.ts +164 -30
- package/engine/intake/intake-schemas.ts +37 -2
- package/engine/jev/clef-client.ts +259 -0
- package/engine/jev/decision-model-credentials.ts +212 -0
- package/engine/jev/jev-jobs.ts +144 -60
- package/engine/jev/jev-schemas.ts +86 -5
- package/engine/jev/jev-shadow-helpers.ts +218 -0
- package/engine/jev/jev-shadow.ts +109 -64
- package/engine/jev/model-pick.ts +275 -0
- package/engine/journal/agent-entries.ts +167 -0
- package/engine/journal/agent-message-entries.ts +72 -0
- package/engine/journal/agent-turn-replay.ts +203 -0
- package/engine/journal/already-done-entries.ts +55 -0
- package/engine/journal/commit-entries.ts +56 -0
- package/engine/journal/cross-ticket-replay.ts +222 -0
- package/engine/journal/decision-model-entries.ts +86 -0
- package/engine/journal/entry-fields.ts +10 -0
- package/engine/journal/final-review-entries.ts +128 -0
- package/engine/journal/final-review-replay.ts +324 -0
- package/engine/journal/final-review-round.ts +320 -0
- package/engine/journal/final-review-state.ts +180 -0
- package/engine/journal/gate-entries.ts +81 -0
- package/engine/journal/intake-entries.ts +87 -0
- package/engine/journal/join-entries.ts +126 -0
- package/engine/journal/journal-entry-schema.ts +218 -0
- package/engine/journal/journal-kinds.ts +97 -0
- package/engine/journal/journal-record-schema.ts +218 -0
- package/engine/journal/journal-record.ts +43 -1400
- package/engine/journal/journal.ts +6 -1
- package/engine/journal/limit-entries.ts +90 -0
- package/engine/journal/memory-entries.ts +124 -0
- package/engine/journal/memory-replay.ts +157 -0
- package/engine/journal/plan-replay.ts +139 -0
- package/engine/journal/pull-request-entries.ts +41 -0
- package/engine/journal/replay.ts +157 -2144
- package/engine/journal/reply-replay.ts +144 -0
- package/engine/journal/repo-wait-entries.ts +53 -0
- package/engine/journal/run-entries.ts +172 -0
- package/engine/journal/run-state.ts +264 -0
- package/engine/journal/shared-failure-replay.ts +133 -0
- package/engine/journal/stuck-entries.ts +193 -0
- package/engine/journal/ticket-progress.ts +392 -0
- package/engine/journal/ticket-replay.ts +411 -0
- package/engine/journal/ticket-result-replay.ts +364 -0
- package/engine/journal/ticket-retry-replay.ts +142 -0
- package/engine/journal/worktree-entries.ts +122 -0
- package/engine/models/model-score.ts +512 -0
- package/engine/shell/run-command.ts +187 -18
- package/engine/testing/agent-turn-fixtures.ts +287 -0
- package/engine/testing/already-done-fixtures.ts +97 -0
- package/engine/testing/build-fixtures.ts +68 -973
- package/engine/testing/checkouts-fixtures.ts +48 -0
- package/engine/testing/final-review-fixtures.ts +62 -1
- package/engine/testing/final-review-steps.ts +143 -0
- package/engine/testing/limit-fixtures.ts +85 -0
- package/engine/testing/live-file-fixtures.ts +57 -0
- package/engine/testing/practice-repo.ts +10 -4
- package/engine/testing/practice-run.ts +1 -1
- package/engine/testing/reply-fixtures.ts +88 -0
- package/engine/testing/run-budget-fixtures.ts +165 -0
- package/engine/testing/run-fixtures.ts +219 -0
- package/engine/testing/sdk-play.ts +177 -0
- package/engine/testing/setup-repo.ts +194 -0
- package/engine/testing/step-record-fixtures.ts +55 -0
- package/engine/testing/ticket-step-fixtures.ts +272 -0
- package/engine/testing/wait-scenarios.ts +186 -0
- package/engine/tracker/gh-retry.ts +217 -0
- package/engine/tracker/github-tracker.ts +310 -90
- package/engine/tracker/in-memory-tracker.ts +8 -4
- package/engine/tracker/tracker.ts +131 -6
- package/package.json +2 -1
- package/skills/luca-retro/SKILL.md +74 -0
- package/skills/luca-retro/scripts/retro-summary.ts +1356 -0
- package/skills/luca-unstick/SKILL.md +153 -0
- package/skills/luca-unstick/scripts/stuck-summary.ts +1063 -0
- package/engine/jev/jev-client.ts +0 -173
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: luca-unstick
|
|
3
|
+
description: Gets a stuck Luca run moving again. It reads the run's journal, the ticket's worktree, and the spec issue, says in plain words why a ticket (or the final review, or the whole run) is stuck, recommends one reply (retry, skip, stop, or ship) or a safe fix first, and posts that reply on the spec issue once the owner says yes. Use it for `/luca-unstick [run id] [#ticket]`, for the board's "Help me" button, and whenever someone asks why a Luca run or ticket is stuck, what to answer Luca's stuck comment, or how to get a run going again, even if they don't name the skill.
|
|
4
|
+
argument-hint: "[run id] [#ticket]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Get a stuck Luca run moving
|
|
8
|
+
|
|
9
|
+
When Luca's engine gets stuck, it doesn't guess. It posts a comment on the spec issue and waits for the spec's owner to reply with one word. Picking the right word takes reading: the journal, the ticket's worktree, the agent's reason. This skill does that reading, explains it, and posts the word for the owner once they say yes.
|
|
10
|
+
|
|
11
|
+
You were given: $ARGUMENTS
|
|
12
|
+
|
|
13
|
+
That is a run id, a ticket (`#139` or `139`), both, or nothing. The board's "Help me" button sends `/luca-unstick <run id> #<ticket>` or `/luca-unstick <run id>`.
|
|
14
|
+
|
|
15
|
+
Talk to the owner in plain words: short sentences, no jargon they didn't use first. They want to know what broke and what to do, not how the engine works.
|
|
16
|
+
|
|
17
|
+
## 1. Find the run and read what's stuck
|
|
18
|
+
|
|
19
|
+
Run the helper from the repo's folder. It only reads.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
bun ~/.claude/skills/luca-unstick/scripts/stuck-summary.ts <run id> <ticket number>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Pass the ticket as a bare number (`134`, not `#134`): in the shell, `#` starts a comment, so `#134` would be lost. Leave out what you weren't given.
|
|
26
|
+
|
|
27
|
+
- With a run id, it sums up that run. With a ticket too, only that ticket (and the run itself).
|
|
28
|
+
- With no run id, it lists this repo's runs (from the main checkout, any of its worktrees, or a subfolder), newest first, and sums up the newest one that waits on a reply. If that isn't the one the owner means, ask.
|
|
29
|
+
- It prints: the spec, its owner, the repo (`owner/repo`), the Luca version the run is on, the run branch, whether the engine is running now, how the board saw it end, and, for each stuck thing, the stuck reason and detail, the worktree, the agent's last result (such as a `bad_test` with its file, test, and reason), the last failed checks with the end of their output, and the replies since.
|
|
30
|
+
- It cites each journal record as `seq <n>` (such as `seq 1234`), as `/luca-retro` does, and tickets as `#<n>`. Cite records the same way: on GitHub, `#<n>` links to an issue.
|
|
31
|
+
|
|
32
|
+
Where things live, if you need more:
|
|
33
|
+
|
|
34
|
+
- The runs folder: `~/.local/state/luca/runs/<run id>/` (or `$LUCA_RUNS_DIR`). It holds `journal.jsonl`, the run branch's worktree (`run-branch/`), and each ticket's worktree (`tickets/<n>/`).
|
|
35
|
+
- `luca-run --unfinished` lists every run that isn't over, and whether it may restart by itself.
|
|
36
|
+
- The board's run registry: `~/.local/state/luca/board/runs.json`. It holds each run's token. Never print or copy it.
|
|
37
|
+
- One record in full: `jq -c 'select(.seq == 1234)' <journal>`. The records are JSON lines: `seq`, `time`, `kind`, `ticket`, `role`, `content`.
|
|
38
|
+
- The stuck comment itself: `gh api repos/<owner/repo>/issues/comments/<comment id>` (the id is in the `stuck_reported` line).
|
|
39
|
+
|
|
40
|
+
Then look where the reason points (the playbook below says where):
|
|
41
|
+
|
|
42
|
+
- The worktree: `git -C <worktree> status --short`, `git -C <worktree> diff`, and `git -C <worktree> log --oneline -5`.
|
|
43
|
+
- The run branch: `git -C <run branch worktree> log --oneline -10`.
|
|
44
|
+
- A test file the agent named: read it, and the code it tests.
|
|
45
|
+
|
|
46
|
+
## 2. Explain it, then recommend one action
|
|
47
|
+
|
|
48
|
+
Keep it short, like this:
|
|
49
|
+
|
|
50
|
+
> **Stuck:** ticket #134, "Rescue catch battle".
|
|
51
|
+
> **Why:** Two tests pin exact addresses from the build map. Any change to the game code moves them, so no correct version of this ticket can pass them.
|
|
52
|
+
> **What I'd do:** Rewrite those two tests so they check the layout, not exact addresses, then reply `retry #134`.
|
|
53
|
+
> **Why that:** The implementer is right, and a retry keeps the edited tests.
|
|
54
|
+
|
|
55
|
+
Recommend one action. Mention another only when it's a close call, in one line.
|
|
56
|
+
|
|
57
|
+
## 3. The playbook
|
|
58
|
+
|
|
59
|
+
Find the stuck reason: `ticket_stuck` (a ticket), `final_review_stuck` (the final review), or `run_stuck` (the whole run). Then:
|
|
60
|
+
|
|
61
|
+
| Reason | What it usually means | What to do |
|
|
62
|
+
| --- | --- | --- |
|
|
63
|
+
| `prepare_failed` | The repo's `prepare` command (a build) failed in a fresh worktree before any agent worked. | Read the end of its output. If it says "Timed out", or ended with no exit code, it ran out of time: check whether the build really finished (its outputs are in the worktree), and reply `retry #n`. The next build is quicker, since most of it is done. A missing tool or a real build error needs fixing on this computer first, then `retry #n`. Raising `prepare_timeout_ms` in `.luca/config.json` only helps the next run: a run keeps the config it started with. |
|
|
64
|
+
| `bad_test` | A test was sent back as bad a second time: by the implementer (it says the test is wrong), or by the engine (the test passed with no `expect()` call, so it checks nothing). The detail says which sent each of the two. | Read the test and the reason: the implementer's, or, for the engine's, that the test runs no `expect()`. If the reason holds (the test pins something the ticket must change, such as build addresses or a line another ticket added), fix the test in the worktree (step 4), then `retry #n`. If the test is right and the code is wrong, say so, and reply `retry #n`: the fresh agent is told why it got stuck. A test the engine found empty needs a real check: add the `expect()` calls in the worktree (step 4), or remove the test if its criterion has another test, then `retry #n`. After a rebase (a `tests_sent_back` line), Luca 14.0.0-alpha.3 and newer already gave the test-writer a turn to update the tests, so read what joined the run branch since: that is usually what the test must now expect. |
|
|
65
|
+
| `nothing_new_to_test` | The test-writer found nothing to test. | Two cases. (a) The ticket changes no behavior: add the `refactor` label to the ticket, then `retry #n` (a label change starts it over as a refactor). (b) The work is already on the base branch: check the commit it names is really there (`git log --oneline <base> -- <file>`). If nothing else in the run is left to build, reply `stop`, then offer to close the ticket with a comment naming the commit. If other tickets still build, reply `retry #n`: on Luca 14.0.0-alpha.2 or newer, a fresh test-writer can answer "already done", and the engine checks it and closes the ticket itself. |
|
|
66
|
+
| `red_check_failed` | The new tests don't fail the way they should, after every fix round (or a test update left a criterion with no test). | Read the red check's problems. Usually a criterion is vague, or a "new" test already passes. Make the ticket's criteria clearer (a text change starts it over), or fix the tests in the worktree (step 4). Then `retry #n`. |
|
|
67
|
+
| `agent_failed` | An agent failed on every try it had. | Read the last failed try. A guard failure means it wrote a file its role may not (such as a report file); a result failure means bad output. If the cause is in the ticket (unclear, too big), fix the ticket and `retry #n`. If it looks like the model had a bad day, `retry #n`. If it keeps failing the same way, it may be an engine bug (see below). |
|
|
68
|
+
| `gates_failed` | The checks (tests, types, lint) still fail after every fix round. | Read the failing check's output. If it's a real bug in the ticket's code, fix it in the worktree only if it's small and clear, else make the ticket clearer; then `retry #n`. If the check fails on `main` too (a flaky or broken test), fix that first. If a test check's output starts with "Timed out", the tests ran out of time (5 minutes by default): raise `test_timeout_ms` in `.luca/config.json`. A run takes the new value when it resumes. |
|
|
69
|
+
| `environment_failed` | A writer answered `environment`: it says the failed red check or checks aren't the ticket's fault (a port already in use, a test that fails on the base branch too). The engine reran the check, and it failed the same way, or the ticket used up its 2 environment reruns. The detail has the agent's evidence and the output. | Check the evidence on this computer: another run or process holding a port, a test that fails on `main` too. Fix that first (stop the other process, fix the old test), then `retry #n`. If the output points at the ticket's code instead, treat it like `gates_failed`. |
|
|
70
|
+
| `changes_requested` | The ticket review still asks for changes after every fix round. | Read the open findings. If they matter, fix them in the worktree (or clarify the ticket) and `retry #n`. If they can wait, `skip #n` keeps the rest of the run going. |
|
|
71
|
+
| `join_failed` | The ticket still clashes with the run branch after every rebase. | `retry #n` puts it on the run branch's tip again (uncommitted edits in its worktree are replaced). If two tickets keep fighting over the same lines, `skip #n` and build it in a later run. |
|
|
72
|
+
| `join_gates_failed` | The checks fail once the ticket joins the run branch. Its join was undone, so the run branch is safe. | Usually two tickets that pass alone but break together. `retry #n` fixes it on top of the run branch. |
|
|
73
|
+
| `install_failed` | Installing the dependencies failed. | Fix the manifest or lockfile on the base branch, then `retry #n`. |
|
|
74
|
+
| `leftovers_found` | The leftover scan found files that must not be committed (a report file, a nested git repo). | Delete or move those files out of the worktree (they're not the ticket's work), then `retry #n`. If one is a doc the repo wants, add a pattern for it to `leftover_allow` in the repo's `.luca/config.json` instead and resume the run (only a resume reads the config again, a plain `retry` doesn't), then `retry #n`. |
|
|
75
|
+
| `setup_change_needed` | An agent needs a change only a person may make (a test setup file, a binary file, something that needs the network). The final review can be stuck on it too. | Read what it asks for. If it's right, make that change yourself in the worktree (ask the owner first: this one isn't a test file), then `retry #n` (a bare `retry` for the final review). |
|
|
76
|
+
| `crashed` | The engine crashed in the same step, again and again. | That's an engine bug, not the ticket (see below). |
|
|
77
|
+
| `undo_refused` | The ticket's join is still on the run branch, but undoing it would have rewound the run branch over other work (its join isn't on the branch, or other commits sit on top of it), so Luca left the run branch alone. Nothing new starts or joins until it's sorted (#519). | Look at the run branch's log next to the joins in the journal. Put the run branch back so the ticket's join is on top, or take its join off by hand (ask the owner first), then `retry #n`. Or `skip #n`. |
|
|
78
|
+
| `run_budget` | The whole run used up its budget of tokens. | Look at what used them (a ticket stuck in fix loops?). A bare `retry` tops it up by half a budget, and `retry +3M` (or `+500k`, or a plain number) by the amount named; `stop` ends the run. |
|
|
79
|
+
| `pull_request_failed` | Every ticket is done, but `gh pr create` failed, so the run's PR didn't open. The run branch is pushed, and the PR's full text is in the run folder's `pull-request.md`. | Read `gh`'s error. A GitHub or sign-in hiccup: a bare `retry` opens the PR. If you open it by hand from the run branch first, `retry` reuses it and never opens a second one. |
|
|
80
|
+
| `repo_busy` | The run waited 24 hours, before intake, for an earlier run on the same repo that is still going. Nothing was built yet. | Check the earlier run the detail names: is it really still going, or stuck waiting for a reply? A bare `retry` waits up to 24 hours more; `stop` ends this run, to start again later or with `luca-run --alongside`. |
|
|
81
|
+
|
|
82
|
+
The final review, when `final_review_stuck`:
|
|
83
|
+
|
|
84
|
+
- `changes_requested`: read the lenses' open findings. If they can wait for review in the PR, reply `ship` (the PR opens with them listed at the top). If they matter, fix them in the run branch's worktree, then a bare `retry`.
|
|
85
|
+
- Anything else (`gates_failed`, `agent_failed`, `bad_test`, `leftovers_found`): fix what trips it in the run branch's worktree, then `retry`; or `ship` to open the PR anyway. For `leftovers_found` on a doc the repo wants, add a `leftover_allow` pattern and resume the run instead, as for a ticket.
|
|
86
|
+
- `skip` doesn't apply to the final review.
|
|
87
|
+
|
|
88
|
+
The reply words, and when each fits:
|
|
89
|
+
|
|
90
|
+
- `retry #n`: go again with a fresh agent and fresh counts. It keeps edits in the worktree. If the ticket's title, text, or labels changed, it starts over from scratch instead.
|
|
91
|
+
- `skip #n`: leave the ticket out, with every ticket that waits on it. The rest ship. They stay open.
|
|
92
|
+
- `stop`: end the run without a PR. The branch is kept.
|
|
93
|
+
- `ship`: only for a stuck final review: open the PR anyway.
|
|
94
|
+
|
|
95
|
+
With one thing stuck, the bare word works. With more than one ticket stuck, `retry` and `skip` must name one (`retry #12`).
|
|
96
|
+
|
|
97
|
+
### Not stuck, but stopped
|
|
98
|
+
|
|
99
|
+
The helper's "State" and "Engine" lines tell these apart.
|
|
100
|
+
|
|
101
|
+
- **Engine not running, run not over** (a crash, a kill, a reboot). Replies wait until the run is resumed: the engine reads replies sent while it was down. For a run the board started, type `/luca-run resume <run id>` in a Paseo chat, so the board stays attached. Otherwise run `luca-run --resume <run id>`.
|
|
102
|
+
- **The engine crashed** ("The engine crashed: ..." in the board line or the log). That is an engine bug, not a reason to retry the ticket. Say so plainly. Show the error and the end of the log. Suggest filing an issue on `asibilia/luca-framework` with the run id, the Luca version, and the error, and resuming the run (as above). If a newer Luca fixes it, `luca upgrade` first; the run then resumes on the new version.
|
|
103
|
+
- **The launcher stopped it** (a `run_stopped` record with a reason such as the wrong login or model). A restart would stop the same way. Fix what the reason says (sign in with the right Claude plan, say), then resume.
|
|
104
|
+
- **A billing stop** (a `run_stopped` with billing). The run never goes on. Say why, and that a new run is the way forward once billing is sorted out.
|
|
105
|
+
- **A limit wait** (`limit_wait_started`). Not stuck: the run goes on by itself when the plan window resets.
|
|
106
|
+
- **Intake refused it** (`intake_refused`). That's the spec or its tickets, not a reply: say what intake wanted (the helper lists it). Fix the issues, then start a new run with `/luca-run <spec>`.
|
|
107
|
+
- **It crashed on a missing label** (the log names a label that isn't found). That's the repo's setup: run `luca setup` in the repo, which makes the labels a run needs. Luca 14.0.0-alpha.4 and newer create a missing label instead of crashing; on an older run, `luca upgrade` first, then resume or start again.
|
|
108
|
+
|
|
109
|
+
## 4. Fixing tests in the worktree
|
|
110
|
+
|
|
111
|
+
Only when the playbook says so, and only test files (the config's `test_file_patterns` in `.luca/config.json` say which files are tests). Never change the ticket's code yourself: the fresh agent does that after the retry.
|
|
112
|
+
|
|
113
|
+
1. Say which test you'll change and why, in one line, before you change it.
|
|
114
|
+
2. Edit the test in the ticket's worktree (`~/.local/state/luca/runs/<run id>/tickets/<n>/`), not in the owner's checkout.
|
|
115
|
+
3. Make it check what the ticket's criterion means, not a number the change is bound to move.
|
|
116
|
+
4. Run only that test file, with a time limit: `cd <worktree> && timeout 300 bun test <file>`. Some tests need the repo's `prepare` build first; if a test fails only because the build's outputs are missing, say so rather than running the build.
|
|
117
|
+
5. Never commit, never stage, never push. A `retry` keeps uncommitted edits, and the engine commits them with the ticket.
|
|
118
|
+
6. Show the owner the diff (`git -C <worktree> diff -- <file>`).
|
|
119
|
+
|
|
120
|
+
## 5. Ask, then post the reply
|
|
121
|
+
|
|
122
|
+
1. Check who's signed in: `gh api user --jq .login`. It must be the spec's owner (the "Spec owner" line), because the engine ignores replies from anyone else. If it isn't, don't post: give the owner the exact word to post themselves.
|
|
123
|
+
2. Ask the owner to confirm, showing the exact comment. For example: "Post `retry #134` on spec #133 in asibilia/heartgold-plus?" Wait for a yes. Don't post on your own judgment.
|
|
124
|
+
3. Post just the word, nothing else in the comment (a reply with other text isn't read as a reply):
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
gh issue comment <spec> --repo <owner/repo> --body "retry #134"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
4. Note the "Last record" seq from the summary before you post.
|
|
131
|
+
|
|
132
|
+
## 6. Check the engine took it
|
|
133
|
+
|
|
134
|
+
If the engine is running, wait for it to read the reply (it reads every minute or so):
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
bun ~/.claude/skills/luca-unstick/scripts/stuck-summary.ts <run id> --watch <last seq>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
It reads the journal every few seconds for up to 3 minutes and prints what the engine did: `reply_received`, then `ticket_retried` (resume, restart, or refused), `ticket_skipped`, `final_review_retried`, or `final_review_shipped`. Or `reply_ignored` with why (such as `no_ticket_named` or `not_stuck`).
|
|
141
|
+
|
|
142
|
+
- Taken: say so in one line, and what happens next.
|
|
143
|
+
- `reply_ignored`, or a `ticket_retried` that was refused: say why, and what would work.
|
|
144
|
+
- Nothing after 3 minutes: check the engine is still running (run the helper again). If it isn't, resume the run (see above); the reply waits on the issue and counts once it's back.
|
|
145
|
+
|
|
146
|
+
If the engine isn't running when you post, skip the wait: tell the owner the reply counts once the run is resumed, and how to resume it.
|
|
147
|
+
|
|
148
|
+
## What not to do
|
|
149
|
+
|
|
150
|
+
- Don't reply for the owner without their yes.
|
|
151
|
+
- Don't retry a crash as if it were the ticket's fault.
|
|
152
|
+
- Don't edit code files, commit, push, or change the spec or tickets without asking.
|
|
153
|
+
- Don't edit the journal or the board's registry. They are the engine's.
|