@codyswann/lisa 8.2.11 → 8.4.0
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/all/copy-overwrite/scripts/lisa-work-item.mjs +50 -11
- package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +1 -1
- package/cdk/package-lisa/package.lisa.json +1 -1
- package/dist/cli/confined-project-read.d.ts +2 -1
- package/dist/cli/confined-project-read.d.ts.map +1 -1
- package/dist/cli/confined-project-read.js +22 -5
- package/dist/cli/confined-project-read.js.map +1 -1
- package/dist/cli/gh-cli.d.ts +2 -1
- package/dist/cli/gh-cli.d.ts.map +1 -1
- package/dist/cli/gh-cli.js +5 -3
- package/dist/cli/gh-cli.js.map +1 -1
- package/dist/cli/github-read-issue-cmd.d.ts +62 -0
- package/dist/cli/github-read-issue-cmd.d.ts.map +1 -0
- package/dist/cli/github-read-issue-cmd.js +121 -0
- package/dist/cli/github-read-issue-cmd.js.map +1 -0
- package/dist/cli/github-reader-relationships.d.ts +41 -0
- package/dist/cli/github-reader-relationships.d.ts.map +1 -0
- package/dist/cli/github-reader-relationships.js +218 -0
- package/dist/cli/github-reader-relationships.js.map +1 -0
- package/dist/cli/github-reader-target.d.ts +24 -0
- package/dist/cli/github-reader-target.d.ts.map +1 -0
- package/dist/cli/github-reader-target.js +95 -0
- package/dist/cli/github-reader-target.js.map +1 -0
- package/dist/cli/github-reader-wire.d.ts +72 -0
- package/dist/cli/github-reader-wire.d.ts.map +1 -0
- package/dist/cli/github-reader-wire.js +125 -0
- package/dist/cli/github-reader-wire.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/learnings-overflow-cmd.js +2 -2
- package/dist/cli/learnings-overflow-cmd.js.map +1 -1
- package/dist/configs/jest/expo.d.ts.map +1 -1
- package/dist/configs/jest/expo.js +6 -0
- package/dist/configs/jest/expo.js.map +1 -1
- package/dist/controls/commands/attest-workspace.d.ts +1 -7
- package/dist/controls/commands/attest-workspace.d.ts.map +1 -1
- package/dist/controls/commands/attest-workspace.js +29 -12
- package/dist/controls/commands/attest-workspace.js.map +1 -1
- package/dist/controls/commands/declaration-check.d.ts.map +1 -1
- package/dist/controls/commands/declaration-check.js +7 -4
- package/dist/controls/commands/declaration-check.js.map +1 -1
- package/dist/controls/commands/seed.d.ts +1 -9
- package/dist/controls/commands/seed.d.ts.map +1 -1
- package/dist/controls/commands/seed.js +72 -65
- package/dist/controls/commands/seed.js.map +1 -1
- package/dist/controls/configure-road.d.ts +2 -0
- package/dist/controls/configure-road.d.ts.map +1 -1
- package/dist/controls/configure-road.js +18 -14
- package/dist/controls/configure-road.js.map +1 -1
- package/dist/controls/proof-copy.d.ts.map +1 -1
- package/dist/controls/proof-copy.js +3 -0
- package/dist/controls/proof-copy.js.map +1 -1
- package/dist/controls/proof-scratch.d.ts +42 -0
- package/dist/controls/proof-scratch.d.ts.map +1 -0
- package/dist/controls/proof-scratch.js +172 -0
- package/dist/controls/proof-scratch.js.map +1 -0
- package/dist/controls/register-evidence-rule.d.ts +2 -0
- package/dist/controls/register-evidence-rule.d.ts.map +1 -1
- package/dist/controls/register-evidence-rule.js +8 -7
- package/dist/controls/register-evidence-rule.js.map +1 -1
- package/dist/controls/register-rules.d.ts +2 -0
- package/dist/controls/register-rules.d.ts.map +1 -1
- package/dist/controls/register-rules.js.map +1 -1
- package/dist/controls/register-types.d.ts +2 -4
- package/dist/controls/register-types.d.ts.map +1 -1
- package/dist/controls/register-types.js.map +1 -1
- package/dist/controls/register.d.ts +2 -0
- package/dist/controls/register.d.ts.map +1 -1
- package/dist/controls/register.js +3 -1
- package/dist/controls/register.js.map +1 -1
- package/dist/controls/shipped-parts.d.ts +82 -0
- package/dist/controls/shipped-parts.d.ts.map +1 -0
- package/dist/controls/shipped-parts.js +216 -0
- package/dist/controls/shipped-parts.js.map +1 -0
- package/dist/core/learnings-document.d.ts +2 -3
- package/dist/core/learnings-document.d.ts.map +1 -1
- package/dist/core/learnings-document.js.map +1 -1
- package/dist/core/learnings-overflow.d.ts +4 -0
- package/dist/core/learnings-overflow.d.ts.map +1 -1
- package/dist/core/learnings-overflow.js +47 -24
- package/dist/core/learnings-overflow.js.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.json +18 -0
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/nightly-e2e-guard-behavior-certificate.js.map +1 -1
- package/dist/core/upstream-evidence-manifest.json +101 -27
- package/dist/strategies/package-lisa-host-pins.d.ts +7 -12
- package/dist/strategies/package-lisa-host-pins.d.ts.map +1 -1
- package/dist/strategies/package-lisa-host-pins.js +29 -30
- package/dist/strategies/package-lisa-host-pins.js.map +1 -1
- package/dist/strategies/package-lisa-range-intersection.d.ts +8 -0
- package/dist/strategies/package-lisa-range-intersection.d.ts.map +1 -0
- package/dist/strategies/package-lisa-range-intersection.js +73 -0
- package/dist/strategies/package-lisa-range-intersection.js.map +1 -0
- package/expo/package-lisa/package.lisa.json +8 -2
- package/harper-fabric/package-lisa/package.lisa.json +3 -2
- package/package.json +4 -4
- package/phaser/package-lisa/package.lisa.json +3 -2
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-configure/SKILL.md +8 -7
- package/plugins/lisa/.codex-plugin/skills/lisa-github-read-issue/SKILL.md +22 -106
- package/plugins/lisa/.codex-plugin/skills/lisa-linear-sync/SKILL.md +3 -3
- package/plugins/lisa/.codex-plugin/skills/lisa-persist-learning/SKILL.md +37 -5
- package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/validate-config.mjs +5 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +56 -49
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/references/runbook-template.md +5 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/answer-record.mjs +24 -20
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-answer-record.mjs +3 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-status.mjs +2 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/config.mjs +4 -1
- package/plugins/lisa/hooks/inject-resolved-config.mjs +23 -1
- package/plugins/lisa/rules/reference/config-resolution.md +1 -0
- package/plugins/lisa/skills/lisa-configure/SKILL.md +8 -7
- package/plugins/lisa/skills/lisa-github-read-issue/SKILL.md +22 -106
- package/plugins/lisa/skills/lisa-linear-sync/SKILL.md +3 -3
- package/plugins/lisa/skills/lisa-persist-learning/SKILL.md +37 -5
- package/plugins/lisa/skills/lisa-secrets-access/scripts/validate-config.mjs +5 -0
- package/plugins/lisa/skills/lisa-session-manager/SKILL.md +56 -49
- package/plugins/lisa/skills/lisa-session-manager/references/runbook-template.md +5 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/answer-record.mjs +24 -20
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-answer-record.mjs +3 -1
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-status.mjs +2 -1
- package/plugins/lisa/skills/lisa-session-manager/scripts/config.mjs +4 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-configure/SKILL.md +8 -7
- package/plugins/lisa-agy/skills/lisa-github-read-issue/SKILL.md +22 -106
- package/plugins/lisa-agy/skills/lisa-linear-sync/SKILL.md +3 -3
- package/plugins/lisa-agy/skills/lisa-persist-learning/SKILL.md +37 -5
- package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/validate-config.mjs +5 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +56 -49
- package/plugins/lisa-agy/skills/lisa-session-manager/references/runbook-template.md +5 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/answer-record.mjs +24 -20
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-answer-record.mjs +3 -1
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-status.mjs +2 -1
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/config.mjs +4 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/hooks/inject-resolved-config.mjs +23 -1
- package/plugins/lisa-copilot/rules/reference/config-resolution.md +1 -0
- package/plugins/lisa-copilot/skills/lisa-configure/SKILL.md +8 -7
- package/plugins/lisa-copilot/skills/lisa-github-read-issue/SKILL.md +22 -106
- package/plugins/lisa-copilot/skills/lisa-linear-sync/SKILL.md +3 -3
- package/plugins/lisa-copilot/skills/lisa-persist-learning/SKILL.md +37 -5
- package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/validate-config.mjs +5 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +56 -49
- package/plugins/lisa-copilot/skills/lisa-session-manager/references/runbook-template.md +5 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/answer-record.mjs +24 -20
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-answer-record.mjs +3 -1
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-status.mjs +2 -1
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/config.mjs +4 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/hooks/inject-resolved-config.mjs +23 -1
- package/plugins/lisa-cursor/rules/config-resolution-reference.mdc +1 -0
- package/plugins/lisa-cursor/skills/lisa-configure/SKILL.md +8 -7
- package/plugins/lisa-cursor/skills/lisa-github-read-issue/SKILL.md +22 -106
- package/plugins/lisa-cursor/skills/lisa-linear-sync/SKILL.md +3 -3
- package/plugins/lisa-cursor/skills/lisa-persist-learning/SKILL.md +37 -5
- package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/validate-config.mjs +5 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +56 -49
- package/plugins/lisa-cursor/skills/lisa-session-manager/references/runbook-template.md +5 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/answer-record.mjs +24 -20
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-answer-record.mjs +3 -1
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-status.mjs +2 -1
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/config.mjs +4 -1
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/hooks/inject-resolved-config.mjs +23 -1
- package/plugins/lisa-devin/rules/reference/config-resolution.md +1 -0
- package/plugins/lisa-devin/skills/lisa-configure/SKILL.md +8 -7
- package/plugins/lisa-devin/skills/lisa-github-read-issue/SKILL.md +22 -106
- package/plugins/lisa-devin/skills/lisa-linear-sync/SKILL.md +3 -3
- package/plugins/lisa-devin/skills/lisa-persist-learning/SKILL.md +37 -5
- package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/validate-config.mjs +5 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +56 -49
- package/plugins/lisa-devin/skills/lisa-session-manager/references/runbook-template.md +5 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/answer-record.mjs +24 -20
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-answer-record.mjs +3 -1
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-status.mjs +2 -1
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/config.mjs +4 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/src/base/hooks/inject-resolved-config.mjs +23 -1
- package/plugins/src/base/rules/reference/config-resolution.md +1 -0
- package/plugins/src/base/skills/lisa-configure/SKILL.md +8 -7
- package/plugins/src/base/skills/lisa-github-read-issue/SKILL.md +22 -106
- package/plugins/src/base/skills/lisa-linear-sync/SKILL.md +3 -3
- package/plugins/src/base/skills/lisa-persist-learning/SKILL.md +37 -5
- package/plugins/src/base/skills/lisa-secrets-access/scripts/validate-config.mjs +5 -0
- package/plugins/src/base/skills/lisa-session-manager/SKILL.md +56 -49
- package/plugins/src/base/skills/lisa-session-manager/references/runbook-template.md +5 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/answer-record.mjs +24 -20
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-answer-record.mjs +3 -1
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-status.mjs +2 -1
- package/plugins/src/base/skills/lisa-session-manager/scripts/config.mjs +4 -1
- package/rails/copy-overwrite/lefthook.yml +3 -0
- package/rails/copy-overwrite/scripts/check-nightly-e2e-health.mjs +5115 -0
- package/rails/copy-overwrite/scripts/lisa-rails-ast-grep.mjs +31 -0
- package/rails/copy-overwrite/scripts/lisa-rails-gates.mjs +5 -0
- package/scripts/check-derived-artifacts.mjs +1 -0
- package/scripts/generate-nightly-e2e-guard-certificate.mjs +15 -1
- package/scripts/two-channel-couplings.json +37 -7
- package/scripts/verify-packed-learnings-contract.mjs +27 -1
- package/typescript/copy-overwrite/.prettierignore +2 -0
- package/typescript/copy-overwrite/scripts/lisa-typecheck.mjs +82 -0
- package/typescript/package-lisa/package.lisa.json +3 -2
|
@@ -102,11 +102,12 @@ the manager.
|
|
|
102
102
|
`/lisa:implement <REF> managedBy=<manager-name>`; `lisa-implement` owns what `managedBy=` means.
|
|
103
103
|
Never start a worker another way, and never reuse a worker for another item or a new attempt.
|
|
104
104
|
- **Capacity** comes only from `capacity` (`can_spawn`, `free_slots`).
|
|
105
|
-
- **Notification channel.** Read `notify` from `status` at the start of every cycle.
|
|
105
|
+
- **Notification channel.** Read `notify` from `status` at the start of every cycle. Read
|
|
106
|
+
`notifyLevel` from the same result. `telegram`: the
|
|
106
107
|
project's own bot, which `start` attached. `none` (`sessionManager.notify.provider` is `"none"`,
|
|
107
108
|
or there is no `notify` block): there is no channel, and `start` launched you without one.
|
|
108
109
|
Having no channel is a normal configuration, never a failure. Every step below that posts to
|
|
109
|
-
Telegram
|
|
110
|
+
Telegram uses both fields as described in "Questions and notifications".
|
|
110
111
|
- **Ledger.** `.lisa/session-manager/ledger.json` is the manager's memory across restarts; attempts
|
|
111
112
|
live there, never in tracker comments. Read it with `ledger get`; change it only through the
|
|
112
113
|
`ledger` subcommands.
|
|
@@ -170,9 +171,14 @@ the manager.
|
|
|
170
171
|
- **Telegram configured** (`notify` is `telegram`):
|
|
171
172
|
- Talk only to the paired, allowlisted chat. Every message starts with the ref in brackets, e.g.
|
|
172
173
|
`[<TEAM>-123]`. Keep it phone-sized, with options on numbered lines.
|
|
173
|
-
-
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
- `notifyLevel: all` sends both **Ask** and **FYI** messages. `notifyLevel: asks-only` sends **Ask**
|
|
175
|
+
messages and records **FYI** messages in the transcript. Both modes keep the usual ledger and
|
|
176
|
+
tracker writes. Routine cycle summaries belong in the transcript.
|
|
177
|
+
- Reply to an operator's Telegram `status` command in the paired chat at either notification level.
|
|
178
|
+
- **Ask** covers questions, requests for operator action, duplicate-manager warnings and the
|
|
179
|
+
hold digest. **FYI** covers worker starts and outcomes, tracker changes, routine retries and
|
|
180
|
+
answer acknowledgements.
|
|
181
|
+
- When you post an **Ask** question, keep the Telegram message id the reply tool returns; the ledger needs
|
|
176
182
|
it.
|
|
177
183
|
- **End every question with how to answer:** `Answer with: <label> <your answer>`. The label is
|
|
178
184
|
the key for a Jira or Linear item (`<TEAM>-123`), and for a GitHub item `#12`, or `repo#12` when
|
|
@@ -184,7 +190,7 @@ the manager.
|
|
|
184
190
|
with the rest of the cycle, and end it with outcome `recovery-required` and the summary
|
|
185
191
|
`Telegram not paired: run tmux attach -t <name> and pair with /telegram:access pair <code>.`
|
|
186
192
|
(`<name>` is `sessionManager.name`). Skip the other notices. The `/loop` keeps running, and the
|
|
187
|
-
next cycle sends
|
|
193
|
+
next cycle sends any pending **Ask** questions ("Unsent questions" below).
|
|
188
194
|
|
|
189
195
|
## Mark and move on
|
|
190
196
|
|
|
@@ -239,8 +245,8 @@ In this order, every time:
|
|
|
239
245
|
It returns `marker` (the configured human-needed label, else the configured `blocked` role),
|
|
240
246
|
`move` for an `exhausted` item, the `comment` to post, and `planningMiss`. It writes nothing. Exit 2 for text
|
|
241
247
|
that looks like a credential: rewrite it without the secret and plan again. Exit 2 because no
|
|
242
|
-
marker is configured: record the question (step 2),
|
|
243
|
-
`recovery-required` with
|
|
248
|
+
marker is configured: record the question (step 2), send the CLI's recovery message as an
|
|
249
|
+
**Ask**, carry on, and end the cycle `recovery-required` with that message as the summary.
|
|
244
250
|
2. **Ledger first.** `ledger set-question <ref> --kind <kind>` with the same text on STDIN (add
|
|
245
251
|
`--sender <sender>` for a worker's question). The ledger comes before the tracker so a crash
|
|
246
252
|
leaves a pending question the next cycle finishes, never a marker nobody will remove.
|
|
@@ -273,14 +279,15 @@ In this order, every time:
|
|
|
273
279
|
`signal` is `wrongly-escalated`, also post `planningMiss.overruledMarker.comment` on the item
|
|
274
280
|
once the subagent has started, so the overruled-escalation sweep does not capture the same
|
|
275
281
|
ruling again.
|
|
276
|
-
7. **Continue the cycle.** With Telegram, also send the question there, ending with
|
|
282
|
+
7. **Continue the cycle.** **Ask.** With Telegram, also send the question there, ending with
|
|
277
283
|
`answerWith.channel`, and re-record it with `ledger set-question <ref> --telegram-message-id <id>`
|
|
278
284
|
(same text, which keeps its `askedAt` and its mark). Without a channel there is nothing else to
|
|
279
285
|
send. Then go on with the next item.
|
|
280
286
|
|
|
281
287
|
If step 3 or 4 fails (the tracker is unreachable, or the read-back does not show the marker),
|
|
282
288
|
leave the ledger as it is (`markedAt` stays null), carry on with the cycle and end it
|
|
283
|
-
`recovery-required
|
|
289
|
+
`recovery-required`. **Ask** for any operator action that the recovery requires. The next cycle's
|
|
290
|
+
"Waiting on a human" step finishes the mark.
|
|
284
291
|
|
|
285
292
|
**Clearing**, once a human has answered (on the item, with `answer`, or on Telegram):
|
|
286
293
|
|
|
@@ -297,15 +304,14 @@ leave the ledger as it is (`markedAt` stays null), carry on with the cycle and e
|
|
|
297
304
|
- `worker-question` or `decision` whose worker already reported `DONE` or `FAILED` (the
|
|
298
305
|
question outlives the worker in the ledger, so its marker can still be removed): do not
|
|
299
306
|
resume the finished worker. Record the answer on the item (below); the next attempt reads it
|
|
300
|
-
there. A worker's `FAILED`
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
left where it is. `resume` refuses a finished
|
|
307
|
+
there. A worker's `FAILED` may leave the item in `claimed` with a human-needed label or
|
|
308
|
+
move it to the `blocked` role. First read the item with `lisa-tracker-read`. When `answer-plan`
|
|
309
|
+
returns `requeue: true` for an item in the `claimed` or `blocked` role, move it to the `ready`
|
|
310
|
+
role in the step 2 update, so the next dispatch starts a fresh attempt that reads
|
|
311
|
+
the answer. A `FAILED` attempt with the reason `left the claimed role outside the manager`
|
|
312
|
+
returns `requeue: false` to preserve the human's move into the `blocked` role.
|
|
313
|
+
Leave items in any other role where they are. A `DONE` worker's item is left where it is.
|
|
314
|
+
`resume` refuses a finished
|
|
309
315
|
worker (exit 2), and `spawn` refuses a ref while its question is pending, so finish this
|
|
310
316
|
clearing first.
|
|
311
317
|
|
|
@@ -330,7 +336,7 @@ leave the ledger as it is (`markedAt` stays null), carry on with the cycle and e
|
|
|
330
336
|
`lisa-tracker-write`, with a short comment: `[lisa-session-manager] Answer delivered; removed the
|
|
331
337
|
hold.` when a worker received the answer (`SendMessage` or `resume`), else
|
|
332
338
|
`[lisa-session-manager] Answer recorded on the item; removed the hold.` When `answer-plan`
|
|
333
|
-
returned `requeue: true` and the read-back shows the item in the `blocked` role, the same
|
|
339
|
+
returned `requeue: true` and the read-back shows the item in the `claimed` or `blocked` role, the same
|
|
334
340
|
update also moves it to the `ready` role; in any other role, leave the item where it is. Read
|
|
335
341
|
it back with `lisa-tracker-read`.
|
|
336
342
|
3. `ledger clear-question <ref>` (`--reset-attempts` for an `exhausted` item). After "Record the
|
|
@@ -362,24 +368,25 @@ leave the ledger as it is (`markedAt` stays null), carry on with the cycle and e
|
|
|
362
368
|
Telegram plugin (0.0.7) does not, so never guess one.
|
|
363
369
|
- `answer`: follow "Clearing" in "Mark and move on" with `message` as the answer (`SendMessage`
|
|
364
370
|
to a live worker, `resume <ref>` for one that was idle-stopped or is gone without finishing,
|
|
365
|
-
the `repo:<name>` stamp for a repo-routing question), then acknowledge
|
|
371
|
+
the `repo:<name>` stamp for a repo-routing question), then acknowledge it as **FYI**.
|
|
366
372
|
**Only when no worker will receive it** — `ledger get <ref>` shows the worker reported `DONE`
|
|
367
373
|
or `FAILED`, the question is `exhausted`, or no worker was started for it (a `decision`, say;
|
|
368
374
|
never a repo-route) — first queue it in the ledger with `channel-answer <ref>` (`body` on
|
|
369
375
|
STDIN, source `channel`), so "Record the answer on the item" can post it. A live or resumable
|
|
370
376
|
worker gets its answer exactly as before, without `channel-answer`. Exit 2 from
|
|
371
377
|
`channel-answer` delivers nothing and has two causes, told apart by its stderr: one that says
|
|
372
|
-
the answer looks like it holds a credential (
|
|
373
|
-
|
|
374
|
-
|
|
378
|
+
the answer looks like it holds a credential (**Ask** the operator to send it again without
|
|
379
|
+
the secret), or one that says the ref has no pending question or no ledger item (as **FYI**,
|
|
380
|
+
reply that the question was already answered or nothing is pending for it).
|
|
375
381
|
When the answer was recorded on the item, say so in the acknowledgement: it was posted on the
|
|
376
382
|
item, where anyone who can read the item can see it.
|
|
377
|
-
- `ambiguous`:
|
|
383
|
+
- `ambiguous`: **Ask** which ref it is for, listing `candidates`, each with the label to start the
|
|
378
384
|
answer with (`Answer with: #12 <your answer>`).
|
|
379
|
-
- `invalid-command`: a mistyped command (`cap 40`, `stop A B`). Deliver it to no worker.
|
|
380
|
-
|
|
385
|
+
- `invalid-command`: a mistyped command (`cap 40`, `stop A B`). Deliver it to no worker. **Ask**
|
|
386
|
+
the operator to correct it with `reason` and explain how to label an answer meant for a worker.
|
|
381
387
|
- `command`:
|
|
382
|
-
- `status`:
|
|
388
|
+
- `status`: reply directly in the paired Telegram chat with the running count, cap, pending
|
|
389
|
+
questions, and pause state. Send the reply at either notification level.
|
|
383
390
|
- `pause` / `resume`: `ledger control --paused true|false`. Relaying and reconciling continue
|
|
384
391
|
while paused; only dispatch stops.
|
|
385
392
|
- `cap N`: `ledger control --max-workers N`. This may raise the limit above
|
|
@@ -389,8 +396,8 @@ leave the ledger as it is (`markedAt` stays null), carry on with the cycle and e
|
|
|
389
396
|
`ledger finish <ref> --status FAILED` with reason "stopped by the operator". This is an explicit
|
|
390
397
|
human instruction, which is why it may return a claimed item to Ready.
|
|
391
398
|
- **`[<REF>] DONE: …` / `[<REF>] FAILED: …` from a worker:**
|
|
392
|
-
`ledger finish <ref> --status DONE|FAILED --sender <sender>` (reason on STDIN) and
|
|
393
|
-
|
|
399
|
+
`ledger finish <ref> --status DONE|FAILED --sender <sender>` (reason on STDIN) and report one **FYI**
|
|
400
|
+
line. On `FAILED`, also move the item to the `blocked`
|
|
394
401
|
role through `lisa-tracker-write` with a comment `[lisa-session-manager] Worker failed: <reason>`
|
|
395
402
|
(assigning "me" in the same update when it is unassigned: "Taking an item"),
|
|
396
403
|
and read both back with `lisa-tracker-read`. When the reason says a
|
|
@@ -411,7 +418,7 @@ session's own loops with `CronList`. When `manager.self` is true, this session *
|
|
|
411
418
|
and its own `/loop` is the manager's loop: never report it as a second manager, and never recommend
|
|
412
419
|
`CronDelete` or stopping it. When `manager.self` is true and `status` `manager.otherCyclers` is not
|
|
413
420
|
empty, another session ran a cycle in this project within twice the interval, so two managers can
|
|
414
|
-
hand out the same item: warn the operator
|
|
421
|
+
hand out the same item: warn the operator as an **Ask**, name each
|
|
415
422
|
entry's `by` and `at`, and recommend stopping **that** session's loop, never this one. A `pid:` entry
|
|
416
423
|
names the process that ran that one cycle, so a single other session can leave several `pid:`
|
|
417
424
|
entries; report them as one or more other sessions, never as an exact count. When
|
|
@@ -419,7 +426,7 @@ entries; report them as one or more other sessions, never as an exact count. Whe
|
|
|
419
426
|
`manager.self` is `null`, recommend stopping nothing, whatever `manager.otherCyclers` says; report
|
|
420
427
|
that self-identification failed. When `manager.running` is true, `manager.self` is false, and this
|
|
421
428
|
session runs its own `/lisa:session-manager cycle` loop, two managers can hand out the same item:
|
|
422
|
-
warn the operator and recommend stopping **this** session's loop, never the tmux manager. The tmux
|
|
429
|
+
warn the operator as an **Ask** and recommend stopping **this** session's loop, never the tmux manager. The tmux
|
|
423
430
|
manager cannot see another session's loop, so it learns of one only from `manager.otherCyclers` and
|
|
424
431
|
must not invent one from anything else. `manager.self` means running inside the manager's tmux
|
|
425
432
|
session, so another Claude started in a second window of that same tmux session also reads true.
|
|
@@ -427,7 +434,7 @@ Never infer a second manager from the tmux session existing plus a loop being pr
|
|
|
427
434
|
|
|
428
435
|
### 1. Reconcile
|
|
429
436
|
|
|
430
|
-
**Unsent questions** (only when `notify` is `telegram`). `ledger get` shows every pending question.
|
|
437
|
+
**Unsent questions** (only when `notify` is `telegram`). **Ask.** `ledger get` shows every pending question.
|
|
431
438
|
One with `telegramMessageId: null` never reached Telegram: it was recorded while Telegram was
|
|
432
439
|
unavailable or unpaired, or before Telegram was configured. (Re)send each
|
|
433
440
|
to Telegram now and re-record it with `ledger set-question <ref> --telegram-message-id <id>` (same
|
|
@@ -478,7 +485,7 @@ shows them.
|
|
|
478
485
|
answers with the `answerCommand` from `status`. A reply that looks like it holds a credential is
|
|
479
486
|
never queued: it is skipped and listed in `refused`, so a later reply is still read.
|
|
480
487
|
Whenever `refused` is present (with `queued: true`, or `queued: false` and
|
|
481
|
-
`reason: "credential-refused"`),
|
|
488
|
+
`reason: "credential-refused"`), send an **Ask** in plain words, from `refusedExplanation`:
|
|
482
489
|
the secret is now on the item, so they should delete that comment, rotate the secret, and reply
|
|
483
490
|
again without it. `refused` comes back every cycle until the comment is deleted, so say it once
|
|
484
491
|
per refused comment `id` (note the ids you reported in the transcript). On `queued: true`, also
|
|
@@ -493,10 +500,10 @@ shows them.
|
|
|
493
500
|
| Classification | Action |
|
|
494
501
|
|---|---|
|
|
495
502
|
| `working`, `waiting`, `finished` | Nothing. |
|
|
496
|
-
| `requestion` | With Telegram
|
|
503
|
+
| `requestion` | **Ask.** With Telegram, re-send the pending question once, then re-record it with `ledger set-question` (same text, new message id); that restarts the re-ping clock. With no channel, leave it pending. |
|
|
497
504
|
| `stalled`, `dead` | Read the item. If it left the `claimed` role, a human moved it: do not retry or move it; `ledger finish <ref> --status FAILED` with reason "left the claimed role outside the manager". Otherwise check for a merged PR first (`gh pr list --state merged --search <ref>` in the item's repo dir). If merged, leave the state change to Lisa's lifecycle and `ledger finish <ref> --status DONE` with reason "PR merged". Otherwise `claude stop <worker>` if it is still listed, then re-read the item (after the stop, so a reassignment in the meantime is seen) and `spawn` a **fresh** attempt when capacity allows, with that re-read's `--assignees` ("Taking an item"; the CLI counts attempts). |
|
|
498
|
-
| `setup-gap` | The worker's first prompt never ran: `setupGap.kind` is `unknown-command` (Lisa's plugin is not visible in that repo, so `/lisa:implement` is unknown there) or `prompt-blocked` (a `UserPromptSubmit` hook rejected the prompt; `setupGap.detail` is what the hook said). Retrying cannot fix it. `claude stop <worker>` if it is still listed, `ledger finish <ref> --status FAILED --setup-gap` with reason "setup gap: <kind>: <detail>" (the spawn is not counted as an attempt). Then read the item: If it left the `claimed` role, a human moved it: respect that and do not move it back to the `ready` role. Otherwise move the item back to the `ready` role. Either way
|
|
499
|
-
| `blocked-on-prompt` | The live worker is stuck on a prompt nobody attached can answer: its agent row reports `waitingFor` (e.g. "permission prompt") other than waiting on its own subagent. It will never proceed on its own, however its logs change. `claude stop <worker>` if it is still listed, then re-read the item and `spawn` a **fresh** attempt when capacity allows, with its `--assignees` ("Taking an item"; the CLI counts attempts; at `stall.maxAttempts` it classifies `exhausted` instead).
|
|
505
|
+
| `setup-gap` | The worker's first prompt never ran: `setupGap.kind` is `unknown-command` (Lisa's plugin is not visible in that repo, so `/lisa:implement` is unknown there) or `prompt-blocked` (a `UserPromptSubmit` hook rejected the prompt; `setupGap.detail` is what the hook said). Retrying cannot fix it. `claude stop <worker>` if it is still listed, `ledger finish <ref> --status FAILED --setup-gap` with reason "setup gap: <kind>: <detail>" (the spawn is not counted as an attempt). Then read the item: If it left the `claimed` role, a human moved it: respect that and do not move it back to the `ready` role. Otherwise move the item back to the `ready` role. Either way send one **Ask** naming the repo and what the operator needs to fix, do not respawn it, do not dispatch to that repo again until the operator fixes it, and end the cycle `recovery-required` with that line as the summary. `classify` has already recorded the repo's setup gap, so later cycles' `queue` leaves that repo out and `spawn` refuses it until the operator fixes the repo and runs `ledger clear-setup-gap <repo>` (`.` on a single-repo project); include that command in the line. |
|
|
506
|
+
| `blocked-on-prompt` | The live worker is stuck on a prompt nobody attached can answer: its agent row reports `waitingFor` (e.g. "permission prompt") other than waiting on its own subagent. It will never proceed on its own, however its logs change. `claude stop <worker>` if it is still listed, then re-read the item and `spawn` a **fresh** attempt when capacity allows, with its `--assignees` ("Taking an item"; the CLI counts attempts; at `stall.maxAttempts` it classifies `exhausted` instead). Record one **FYI** line naming the item, the `waitingFor` text, and when a fresh attempt can start. This is once per occurrence: the fresh worker is not blocked, so the same occurrence never repeats. Not a `setup-gap`: the first prompt ran, so the attempt counts and the item stays claimed. |
|
|
500
507
|
| `exhausted` | Attempts reached `stall.maxAttempts`. Stop the worker if listed, `ledger finish <ref> --status FAILED`, then follow "Mark and move on" with `--kind exhausted` and, as the reason, how many attempts failed and how each ended: it moves the item to the `blocked` role and marks it for a human. |
|
|
501
508
|
|
|
502
509
|
Why a worker started with `--dangerously-skip-permissions` reaches a permission prompt at all is
|
|
@@ -569,7 +576,7 @@ just as long. Sweep both every cycle, after `classify` and before Dispatch:
|
|
|
569
576
|
already posted, which only re-lanes the item); a partial
|
|
570
577
|
lift is also in `holds.keep` with the reasons still left for a person. Then remove
|
|
571
578
|
the human-needed label and move it to the `ready` role as its `actions` say.
|
|
572
|
-
- `holds.keep`: when `holds.digest.changed` is true, send `holds.digest.text`
|
|
579
|
+
- `holds.keep`: when `holds.digest.changed` is true, send `holds.digest.text` as an **Ask**
|
|
573
580
|
once (Telegram when configured, else the cycle summary; nothing when the text is empty), then
|
|
574
581
|
record it with `ledger control --hold-digest <fingerprint>` (`none` when `fingerprint` is
|
|
575
582
|
null). An unchanged list is never re-sent.
|
|
@@ -690,8 +697,8 @@ item held back only by them is claimable in this same cycle:
|
|
|
690
697
|
separately, e.g. `stale links: cleared 12 stale blocker links on 7 items; 3 now ready to start;
|
|
691
698
|
2 planned removals not done (retried next cycle); 4 items left for the next cycle; 29 real
|
|
692
699
|
blockers remain on 18 items.` Put that in the cycle's transcript line and in the recorded run
|
|
693
|
-
summary.
|
|
694
|
-
|
|
700
|
+
summary. When `report.inaccessible` is non-empty and its list changed since the last cycle,
|
|
701
|
+
report one **FYI** line naming the blockers that could not be opened.
|
|
695
702
|
|
|
696
703
|
A failure anywhere in this sweep is one transcript line and never makes the cycle
|
|
697
704
|
`recovery-required`. It holds dispatch for one item only: an item owed a restore (a blocker link
|
|
@@ -713,12 +720,12 @@ queue below). For each:
|
|
|
713
720
|
- `release`: dissolve the edges and move the item to the `ready` role in one `lisa-tracker-write`
|
|
714
721
|
update, with a comment `[lisa-session-manager] Released: <reason>`, setting the assignee to
|
|
715
722
|
"me" in that same update when the item is unassigned ("Taking an item"); read it back with
|
|
716
|
-
`lisa-tracker-read` and confirm the role (and the assignee) changed before you claim it did.
|
|
723
|
+
`lisa-tracker-read` and confirm the role (and the assignee) changed before you claim it did. Report the release as **FYI**.
|
|
717
724
|
- `decide` (access-only; a blocker was closed NOT PLANNED): relay nothing to the operator. Make
|
|
718
725
|
the call from the item's and blocker's evidence: re-scope the item to build without the
|
|
719
726
|
dependency (dissolve the edge and move it to the `ready` role), drop an edge that no longer applies, or
|
|
720
727
|
close the item; a move of an unassigned item also assigns it to "me" ("Taking an item"). Post `[lisa-session-manager] Decision: <which> — <why>` in the same
|
|
721
|
-
`lisa-tracker-write` update, and read it back before you claim it landed.
|
|
728
|
+
`lisa-tracker-write` update, and read it back before you claim it landed. Report the decision as **FYI**.
|
|
722
729
|
- `keep` with a manager question pending: "Waiting on a human" above handles it.
|
|
723
730
|
- `keep`, `escalate`, `skip-human-gate`: leave it. Gate self-blocks and clarification blocks
|
|
724
731
|
belong to `lisa-repair-intake` and humans.
|
|
@@ -823,7 +830,7 @@ Skip while `capacity` reports `paused`. Otherwise:
|
|
|
823
830
|
Never spawn on the claim's word alone.
|
|
824
831
|
4. **Spawn.** `spawn <ref> --assignees '<json>' [--repo <key>]`, with the assignees the step 3
|
|
825
832
|
re-read showed ("Taking an item", rule 4).
|
|
826
|
-
- exit 0:
|
|
833
|
+
- exit 0: record `[<REF>] started in <repo> (<name>)` as **FYI**.
|
|
827
834
|
- exit 3 (no capacity): move the item back to the `ready` role and stop dispatching.
|
|
828
835
|
- exit 4 (a live worker holds it): if the ledger has no item for it, record it with
|
|
829
836
|
`ledger record-spawn <ref> --worker <worker> --session-id <id> --repo <key>`; continue.
|
|
@@ -838,15 +845,15 @@ Skip while `capacity` reports `paused`. Otherwise:
|
|
|
838
845
|
refuses the repo (exit 2, nothing launched) until the operator fixes it and runs
|
|
839
846
|
`ledger clear-setup-gap <repo>` (`.` on a single-repo project). The exit-2 stdout's
|
|
840
847
|
`setupGapStatus` says what to tell the operator:
|
|
841
|
-
- `recorded` (this spawn found the gap) or `not-recorded` (the ledger write failed):
|
|
842
|
-
the CLI's one-line message
|
|
848
|
+
- `recorded` (this spawn found the gap) or `not-recorded` (the ledger write failed): send
|
|
849
|
+
the CLI's one-line message as an **Ask** and end the cycle `recovery-required` with that
|
|
843
850
|
message as the summary.
|
|
844
851
|
- `already-recorded` (the operator was told when it was recorded): post nothing and
|
|
845
852
|
continue with the next item.
|
|
846
853
|
- exit 5 (not taken; nothing launched): `reason` `unassigned` means assign the item to "me"
|
|
847
854
|
through `lisa-tracker-write`, read it back, and spawn again with the new assignees;
|
|
848
855
|
`foreign` means someone else holds it, so leave it where it is and continue.
|
|
849
|
-
- any other exit: move the item back to the `ready` role,
|
|
856
|
+
- any other exit: move the item back to the `ready` role, report the return as **FYI**, and continue.
|
|
850
857
|
3. **Backlog tier, lowest priority.** Only when `backlogPickup` is on, every `ordered` item has been
|
|
851
858
|
taken or skipped, and `capacity` still says `can_spawn`. Ready work always wins: never promote a
|
|
852
859
|
backlog item while a dispatchable Ready item remains. For the next `backlogOrdered` item with no
|
|
@@ -874,9 +881,9 @@ Skip while `capacity` reports `paused`. Otherwise:
|
|
|
874
881
|
is exactly the one the update intended: the unchanged existing assignee, or "me" for an
|
|
875
882
|
item that was unassigned. Then `ledger validation-cleared <ref>`.
|
|
876
883
|
5. Continue with steps 2.3 and 2.4 (claim in the child repo, re-read, spawn, handle the exit)
|
|
877
|
-
exactly as for a Ready item, with one change: on exit 0,
|
|
878
|
-
`[<REF>] promoted from backlog and started in <repo> (<name>)`
|
|
879
|
-
|
|
884
|
+
exactly as for a Ready item, with one change: on exit 0, use
|
|
885
|
+
`[<REF>] promoted from backlog and started in <repo> (<name>)` as the **FYI** start message.
|
|
886
|
+
Every other exit keeps its step 2.4 handling.
|
|
880
887
|
A promotion written and read back counts as a state change for the run outcome; a spawn that
|
|
881
888
|
then fails follows step 2.4's exits (the item stays in Ready with the assignee step 4 left on it).
|
|
882
889
|
|
|
@@ -19,6 +19,11 @@ The configured tracker's lanes (the `ready`, `claimed` and `blocked` roles from
|
|
|
19
19
|
read through the tracker access layer; the manager's ledger in `.lisa/session-manager/`; the live
|
|
20
20
|
session list from `claude agents`; and, when `sessionManager.notify.provider` is `telegram`, the
|
|
21
21
|
project's own Telegram chat. Telegram is optional: with no channel, questions wait in the ledger.
|
|
22
|
+
Read `notifyLevel` from `status` each cycle. `all` sends questions and routine notices to a paired
|
|
23
|
+
chat. `asks-only` sends questions, requests for operator action, duplicate-manager warnings and the
|
|
24
|
+
hold digest. Routine worker starts, outcomes, tracker changes and acknowledgements go to the
|
|
25
|
+
transcript in that mode. Reply in the paired chat when the operator sends a `status` command
|
|
26
|
+
at either notification level.
|
|
22
27
|
|
|
23
28
|
## Candidate selection
|
|
24
29
|
|
|
@@ -23,6 +23,9 @@ import {
|
|
|
23
23
|
/** Worker statuses after which no worker receives an answer. */
|
|
24
24
|
const FINISHED = new Set(["DONE", "FAILED"]);
|
|
25
25
|
|
|
26
|
+
/** The stall pass observed a tracker move made outside the manager. */
|
|
27
|
+
const EXTERNAL_MOVE_REASON = "left the claimed role outside the manager";
|
|
28
|
+
|
|
26
29
|
/** How each answer source is named in the comment. */
|
|
27
30
|
const SOURCE_NAMES = { cli: "answer", channel: "Telegram" };
|
|
28
31
|
|
|
@@ -63,41 +66,42 @@ function skipReason(status, worker, pending) {
|
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* this move the "next attempt" that reads the recorded answer is never
|
|
70
|
-
* dispatched (CodySwannGT/lisa#4643). It holds whether the answer still has
|
|
71
|
-
* to be posted or is already on the item. A `DONE` worker's item and a
|
|
72
|
-
* repo-routing answer (carried by its `repo:<name>` stamp) are not moved.
|
|
69
|
+
* Ask the manager to requeue a FAILED worker's item from claimed or blocked
|
|
70
|
+
* once its answer is recorded, including an answer already on the item.
|
|
71
|
+
* An observed external move explicitly keeps the item's tracker status.
|
|
73
72
|
* @param {string | undefined} status - The ledger item's status
|
|
73
|
+
* @param {string | null | undefined} finishReason - Why the attempt finished
|
|
74
74
|
* @param {{kind?: string, answer?: object | null} | null} pending - The
|
|
75
75
|
* pending question
|
|
76
|
-
* @returns {{requeue?:
|
|
76
|
+
* @returns {{requeue?: boolean}} The flag, only when it applies
|
|
77
77
|
*/
|
|
78
|
-
function requeueOf(status, pending) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
pending?.kind !== "repo-route";
|
|
83
|
-
return due ? { requeue: true } : {};
|
|
78
|
+
function requeueOf(status, finishReason, pending) {
|
|
79
|
+
if (status !== "FAILED" || !pending?.answer || pending.kind === "repo-route")
|
|
80
|
+
return {};
|
|
81
|
+
return { requeue: finishReason !== EXTERNAL_MOVE_REASON };
|
|
84
82
|
}
|
|
85
83
|
|
|
86
84
|
/**
|
|
87
85
|
* Plan recording a queued answer on the item. Throws when the answer looks
|
|
88
86
|
* like it holds a credential: it would be posted on the item.
|
|
89
87
|
* @param {{ref: string, status?: string, worker?: string | null,
|
|
90
|
-
* pending: object | null}} input - The item's
|
|
91
|
-
* worker, and
|
|
92
|
-
* @returns {{ref: string, record: false, reason: string, requeue?:
|
|
88
|
+
* pending: object | null, finishReason?: string | null}} input - The item's
|
|
89
|
+
* ref, ledger status, worker, pending question, and attempt finish reason
|
|
90
|
+
* @returns {{ref: string, record: false, reason: string, requeue?: boolean} |
|
|
93
91
|
* {ref: string, record: true, source: string, answerAt: string | null,
|
|
94
|
-
* comment: string, requeue?:
|
|
92
|
+
* comment: string, requeue?: boolean}} Plan; answerAt is the queued answer's
|
|
95
93
|
* `at`, which `ledger clear-question --expect-answer-at` checks before
|
|
96
94
|
* clearing; `requeue: true` means also move the item to the `ready` role
|
|
97
95
|
*/
|
|
98
|
-
export function planAnswerRecord({
|
|
96
|
+
export function planAnswerRecord({
|
|
97
|
+
ref,
|
|
98
|
+
status,
|
|
99
|
+
finishReason,
|
|
100
|
+
worker,
|
|
101
|
+
pending,
|
|
102
|
+
}) {
|
|
99
103
|
const reason = skipReason(status, worker, pending);
|
|
100
|
-
const requeue = requeueOf(status, pending);
|
|
104
|
+
const requeue = requeueOf(status, finishReason, pending);
|
|
101
105
|
if (reason) return { ref, record: false, reason, ...requeue };
|
|
102
106
|
const { source, text, at } = pending.answer;
|
|
103
107
|
const shape = findCredentialShape(text);
|
|
@@ -49,7 +49,8 @@ export async function channelAnswer(ctx) {
|
|
|
49
49
|
* @param {object} ctx - CLI context
|
|
50
50
|
* @returns {Promise<{ json: object }>} `{ref,record:false,reason}` or
|
|
51
51
|
* `{ref,record:true,source,comment}`, either with `requeue: true` when a
|
|
52
|
-
* FAILED worker's item must also move to the `ready` role
|
|
52
|
+
* FAILED worker's item must also move to the `ready` role, or false when
|
|
53
|
+
* the ledger records an external tracker move
|
|
53
54
|
*/
|
|
54
55
|
export async function answerPlan(ctx) {
|
|
55
56
|
const ref = requirePositional(ctx, "ref");
|
|
@@ -64,6 +65,7 @@ export async function answerPlan(ctx) {
|
|
|
64
65
|
planAnswerRecord({
|
|
65
66
|
ref,
|
|
66
67
|
status: entry?.status,
|
|
68
|
+
finishReason: entry?.reason,
|
|
67
69
|
worker: entry?.worker ?? null,
|
|
68
70
|
pending,
|
|
69
71
|
})
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
|
|
11
11
|
import { listAgents, requireConfig, run } from "./cli-runtime.mjs";
|
|
12
|
-
import { notifyProvider } from "./config.mjs";
|
|
12
|
+
import { DEFAULT_NOTIFY_LEVEL, notifyProvider } from "./config.mjs";
|
|
13
13
|
import { callerSessionName, otherCyclers } from "./cyclers.mjs";
|
|
14
14
|
import { buildHasSession } from "./launch.mjs";
|
|
15
15
|
import { listPendingQuestions } from "./ledger-questions.mjs";
|
|
@@ -88,6 +88,7 @@ export async function status(ctx) {
|
|
|
88
88
|
otherCyclers: otherCyclers(ledger, config, ctx.now()),
|
|
89
89
|
},
|
|
90
90
|
notify: notifyProvider(config),
|
|
91
|
+
notifyLevel: config.notify.level ?? DEFAULT_NOTIFY_LEVEL,
|
|
91
92
|
control: ledger.control,
|
|
92
93
|
workers: Object.entries(ledger.items).map(([ref, item]) => ({
|
|
93
94
|
ref,
|
|
@@ -58,6 +58,9 @@ export const SESSION_MANAGER_DEFAULTS = Object.freeze({
|
|
|
58
58
|
/** The `notify` choices `buildDefaultBlock` (and `init-config --notify`) take. */
|
|
59
59
|
export const NOTIFY_CHOICES = Object.freeze(["none", "telegram"]);
|
|
60
60
|
|
|
61
|
+
/** Notification level used when a project declares none. */
|
|
62
|
+
export const DEFAULT_NOTIFY_LEVEL = "all";
|
|
63
|
+
|
|
61
64
|
/**
|
|
62
65
|
* The notification provider a resolved (or raw) block runs with.
|
|
63
66
|
* @param {{ notify?: { provider?: unknown } } | null | undefined} config
|
|
@@ -76,7 +79,7 @@ export function notifyProvider(config) {
|
|
|
76
79
|
* cpuFraction: number, maxLoadPerCore: number }} CapacityBlock
|
|
77
80
|
* @typedef {{ noOutputMinutes: number, maxAttempts: number,
|
|
78
81
|
* requestionHours: number, orphanHours: number }} StallBlock
|
|
79
|
-
* @typedef {{ provider: string, stateDir?: string }} NotifyBlock
|
|
82
|
+
* @typedef {{ provider: string, level?: "all" | "asks-only", stateDir?: string }} NotifyBlock
|
|
80
83
|
* @typedef {{
|
|
81
84
|
* name: string,
|
|
82
85
|
* interval: string,
|