@codyswann/lisa 2.255.0 → 2.256.1
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/package.json +1 -1
- 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-automation-status/SKILL.md +11 -3
- package/plugins/lisa/.codex-plugin/skills/lisa-github-validate-issue/SKILL.md +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-github-write-issue/SKILL.md +9 -3
- package/plugins/lisa/.codex-plugin/skills/lisa-implement/SKILL.md +6 -2
- package/plugins/lisa/.codex-plugin/skills/lisa-jira-validate-ticket/SKILL.md +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-jira-write-ticket/SKILL.md +9 -6
- package/plugins/lisa/.codex-plugin/skills/lisa-linear-validate-issue/SKILL.md +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-linear-write-issue/SKILL.md +9 -3
- package/plugins/lisa/agents/github-agent.md +2 -2
- package/plugins/lisa/agents/jira-agent.md +2 -2
- package/plugins/lisa/agents/linear-agent.md +2 -2
- package/plugins/lisa/rules/eager/config-resolution.md +27 -8
- package/plugins/lisa/rules/eager/pre-flight-autofill.md +21 -7
- package/plugins/lisa/rules/reference/config-resolution.md +55 -16
- package/plugins/lisa/rules/reference/pre-flight-autofill.md +23 -8
- package/plugins/lisa/scripts/automation-status-claude-adapter.mjs +64 -8
- package/plugins/lisa/scripts/automation-status-codex-adapter.mjs +61 -5
- package/plugins/lisa/scripts/automation-status-report.mjs +30 -0
- package/plugins/lisa/scripts/automation-status-run-history.mjs +185 -0
- package/plugins/lisa/skills/lisa-automation-status/SKILL.md +11 -3
- package/plugins/lisa/skills/lisa-github-validate-issue/SKILL.md +1 -1
- package/plugins/lisa/skills/lisa-github-write-issue/SKILL.md +9 -3
- package/plugins/lisa/skills/lisa-implement/SKILL.md +6 -2
- package/plugins/lisa/skills/lisa-jira-validate-ticket/SKILL.md +1 -1
- package/plugins/lisa/skills/lisa-jira-write-ticket/SKILL.md +9 -6
- package/plugins/lisa/skills/lisa-linear-validate-issue/SKILL.md +1 -1
- package/plugins/lisa/skills/lisa-linear-write-issue/SKILL.md +9 -3
- package/plugins/lisa-agy/agents/github-agent.md +2 -2
- package/plugins/lisa-agy/agents/jira-agent.md +2 -2
- package/plugins/lisa-agy/agents/linear-agent.md +2 -2
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/scripts/automation-status-claude-adapter.mjs +64 -8
- package/plugins/lisa-agy/scripts/automation-status-codex-adapter.mjs +61 -5
- package/plugins/lisa-agy/scripts/automation-status-report.mjs +30 -0
- package/plugins/lisa-agy/scripts/automation-status-run-history.mjs +185 -0
- package/plugins/lisa-agy/skills/lisa-automation-status/SKILL.md +11 -3
- package/plugins/lisa-agy/skills/lisa-github-validate-issue/SKILL.md +1 -1
- package/plugins/lisa-agy/skills/lisa-github-write-issue/SKILL.md +9 -3
- package/plugins/lisa-agy/skills/lisa-implement/SKILL.md +6 -2
- package/plugins/lisa-agy/skills/lisa-jira-validate-ticket/SKILL.md +1 -1
- package/plugins/lisa-agy/skills/lisa-jira-write-ticket/SKILL.md +9 -6
- package/plugins/lisa-agy/skills/lisa-linear-validate-issue/SKILL.md +1 -1
- package/plugins/lisa-agy/skills/lisa-linear-write-issue/SKILL.md +9 -3
- 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-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/agents/github-agent.agent.md +2 -2
- package/plugins/lisa-copilot/agents/jira-agent.agent.md +2 -2
- package/plugins/lisa-copilot/agents/linear-agent.agent.md +2 -2
- package/plugins/lisa-copilot/rules/eager/config-resolution.md +27 -8
- package/plugins/lisa-copilot/rules/eager/pre-flight-autofill.md +21 -7
- package/plugins/lisa-copilot/rules/reference/config-resolution.md +55 -16
- package/plugins/lisa-copilot/rules/reference/pre-flight-autofill.md +23 -8
- package/plugins/lisa-copilot/scripts/automation-status-claude-adapter.mjs +64 -8
- package/plugins/lisa-copilot/scripts/automation-status-codex-adapter.mjs +61 -5
- package/plugins/lisa-copilot/scripts/automation-status-report.mjs +30 -0
- package/plugins/lisa-copilot/scripts/automation-status-run-history.mjs +185 -0
- package/plugins/lisa-copilot/skills/lisa-automation-status/SKILL.md +11 -3
- package/plugins/lisa-copilot/skills/lisa-github-validate-issue/SKILL.md +1 -1
- package/plugins/lisa-copilot/skills/lisa-github-write-issue/SKILL.md +9 -3
- package/plugins/lisa-copilot/skills/lisa-implement/SKILL.md +6 -2
- package/plugins/lisa-copilot/skills/lisa-jira-validate-ticket/SKILL.md +1 -1
- package/plugins/lisa-copilot/skills/lisa-jira-write-ticket/SKILL.md +9 -6
- package/plugins/lisa-copilot/skills/lisa-linear-validate-issue/SKILL.md +1 -1
- package/plugins/lisa-copilot/skills/lisa-linear-write-issue/SKILL.md +9 -3
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/agents/github-agent.md +2 -2
- package/plugins/lisa-cursor/agents/jira-agent.md +2 -2
- package/plugins/lisa-cursor/agents/linear-agent.md +2 -2
- package/plugins/lisa-cursor/rules/config-resolution-reference.mdc +55 -16
- package/plugins/lisa-cursor/rules/config-resolution.mdc +27 -8
- package/plugins/lisa-cursor/rules/pre-flight-autofill-reference.mdc +23 -8
- package/plugins/lisa-cursor/rules/pre-flight-autofill.mdc +21 -7
- package/plugins/lisa-cursor/scripts/automation-status-claude-adapter.mjs +64 -8
- package/plugins/lisa-cursor/scripts/automation-status-codex-adapter.mjs +61 -5
- package/plugins/lisa-cursor/scripts/automation-status-report.mjs +30 -0
- package/plugins/lisa-cursor/scripts/automation-status-run-history.mjs +185 -0
- package/plugins/lisa-cursor/skills/lisa-automation-status/SKILL.md +11 -3
- package/plugins/lisa-cursor/skills/lisa-github-validate-issue/SKILL.md +1 -1
- package/plugins/lisa-cursor/skills/lisa-github-write-issue/SKILL.md +9 -3
- package/plugins/lisa-cursor/skills/lisa-implement/SKILL.md +6 -2
- package/plugins/lisa-cursor/skills/lisa-jira-validate-ticket/SKILL.md +1 -1
- package/plugins/lisa-cursor/skills/lisa-jira-write-ticket/SKILL.md +9 -6
- package/plugins/lisa-cursor/skills/lisa-linear-validate-issue/SKILL.md +1 -1
- package/plugins/lisa-cursor/skills/lisa-linear-write-issue/SKILL.md +9 -3
- 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-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-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-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-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-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-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-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/src/base/agents/github-agent.md +2 -2
- package/plugins/src/base/agents/jira-agent.md +2 -2
- package/plugins/src/base/agents/linear-agent.md +2 -2
- package/plugins/src/base/rules/eager/config-resolution.md +27 -8
- package/plugins/src/base/rules/eager/pre-flight-autofill.md +21 -7
- package/plugins/src/base/rules/reference/config-resolution.md +55 -16
- package/plugins/src/base/rules/reference/pre-flight-autofill.md +23 -8
- package/plugins/src/base/scripts/automation-status-claude-adapter.mjs +64 -8
- package/plugins/src/base/scripts/automation-status-codex-adapter.mjs +61 -5
- package/plugins/src/base/scripts/automation-status-report.mjs +30 -0
- package/plugins/src/base/scripts/automation-status-run-history.mjs +185 -0
- package/plugins/src/base/skills/lisa-automation-status/SKILL.md +11 -3
- package/plugins/src/base/skills/lisa-github-validate-issue/SKILL.md +1 -1
- package/plugins/src/base/skills/lisa-github-write-issue/SKILL.md +9 -3
- package/plugins/src/base/skills/lisa-implement/SKILL.md +6 -2
- package/plugins/src/base/skills/lisa-jira-validate-ticket/SKILL.md +1 -1
- package/plugins/src/base/skills/lisa-jira-write-ticket/SKILL.md +9 -6
- package/plugins/src/base/skills/lisa-linear-validate-issue/SKILL.md +1 -1
- package/plugins/src/base/skills/lisa-linear-write-issue/SKILL.md +9 -3
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Shared read-only run-history projection for `/lisa:automation-status`.
|
|
4
|
+
*
|
|
5
|
+
* The durable run-outcome substrate (RBC-3, `automation-run-record.mjs`) stores
|
|
6
|
+
* one bounded JSONL file per registered loop under `.lisa/automations/runs/`.
|
|
7
|
+
* This module turns that substrate — plus the checked-in per-loop runbook
|
|
8
|
+
* (`automation-runbook-contract`) — into the per-item display fields both
|
|
9
|
+
* runtime adapters attach to their status rows, so the Codex and Claude
|
|
10
|
+
* adapters never diverge on how the contract, last outcome, and bounded history
|
|
11
|
+
* are rendered.
|
|
12
|
+
*
|
|
13
|
+
* STRICTLY READ-ONLY: it stats the runbook and reads the run-record file. It
|
|
14
|
+
* never creates the runs directory, a runbook, or a run record — a status read
|
|
15
|
+
* must leave the fleet byte-identical.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import fs from "node:fs/promises";
|
|
19
|
+
import path from "node:path";
|
|
20
|
+
|
|
21
|
+
import {
|
|
22
|
+
automationRunRecordPath,
|
|
23
|
+
readAutomationRunRecords,
|
|
24
|
+
} from "./automation-run-record.mjs";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Inline history cap: the newest N outcomes are listed, the remainder is only
|
|
28
|
+
* counted. A bounded view of an already-bounded file, with the trim stated in
|
|
29
|
+
* the output rather than applied silently.
|
|
30
|
+
*/
|
|
31
|
+
export const AUTOMATION_RUN_HISTORY_DISPLAY_LIMIT = 5;
|
|
32
|
+
|
|
33
|
+
/** The recorded outcome that signals a loop could not finish its own work. */
|
|
34
|
+
export const RECOVERY_REQUIRED_OUTCOME = "recovery-required";
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* How many trailing `recovery-required` runs in a row flip a loop to `FAILING`.
|
|
38
|
+
* The RBC-5 acceptance criteria pin "last three runs" as the escalation
|
|
39
|
+
* trigger; that wins over the ticket prose's looser "five in a row" pattern.
|
|
40
|
+
*/
|
|
41
|
+
export const RECOVERY_REQUIRED_ESCALATION_THRESHOLD = 3;
|
|
42
|
+
|
|
43
|
+
const RUNBOOK_NOT_SCAFFOLDED_LINE =
|
|
44
|
+
"not scaffolded — run /lisa:setup-automations";
|
|
45
|
+
const NO_RECORDED_RUNS_LINE = "no recorded runs yet";
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @typedef {{
|
|
49
|
+
* readonly ts: string
|
|
50
|
+
* readonly outcome: string
|
|
51
|
+
* readonly summary: string
|
|
52
|
+
* }} AutomationLastOutcome
|
|
53
|
+
*
|
|
54
|
+
* @typedef {{
|
|
55
|
+
* readonly runbook: string
|
|
56
|
+
* readonly lastOutcome?: AutomationLastOutcome
|
|
57
|
+
* readonly outcomeHistory: readonly string[]
|
|
58
|
+
* readonly olderRecordCount: number
|
|
59
|
+
* readonly recoveryRequiredStreak: number
|
|
60
|
+
* readonly recoverySummaries: readonly string[]
|
|
61
|
+
* readonly skippedCorruptLines: number
|
|
62
|
+
* }} AutomationRunDisplay
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Resolve the read-only run-history display fields for one registered loop.
|
|
67
|
+
*
|
|
68
|
+
* @param {{
|
|
69
|
+
* readonly projectRoot?: string
|
|
70
|
+
* readonly loopId: string
|
|
71
|
+
* readonly runbookPath?: string
|
|
72
|
+
* }} input
|
|
73
|
+
* @returns {Promise<AutomationRunDisplay>}
|
|
74
|
+
*/
|
|
75
|
+
export async function resolveAutomationRunDisplay(input) {
|
|
76
|
+
const projectRoot = path.resolve(input.projectRoot ?? process.cwd());
|
|
77
|
+
const runbook = await resolveRunbookLine(projectRoot, input.runbookPath);
|
|
78
|
+
const { records, skippedCorruptLines } = await readAutomationRunRecords(
|
|
79
|
+
automationRunRecordPath(projectRoot, input.loopId)
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const newestFirst = records.toReversed();
|
|
83
|
+
const latest = records.at(-1);
|
|
84
|
+
const lastOutcome = latest
|
|
85
|
+
? { ts: latest.ts, outcome: latest.outcome, summary: latest.summary }
|
|
86
|
+
: undefined;
|
|
87
|
+
const outcomeHistory = newestFirst
|
|
88
|
+
.slice(0, AUTOMATION_RUN_HISTORY_DISPLAY_LIMIT)
|
|
89
|
+
.map(record => record.outcome);
|
|
90
|
+
const olderRecordCount = Math.max(
|
|
91
|
+
0,
|
|
92
|
+
records.length - AUTOMATION_RUN_HISTORY_DISPLAY_LIMIT
|
|
93
|
+
);
|
|
94
|
+
const trailingRecovery = collectTrailingRecoveryRuns(records);
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
runbook,
|
|
98
|
+
lastOutcome,
|
|
99
|
+
outcomeHistory,
|
|
100
|
+
olderRecordCount,
|
|
101
|
+
recoveryRequiredStreak: trailingRecovery.length,
|
|
102
|
+
recoverySummaries: trailingRecovery.map(record => record.summary),
|
|
103
|
+
skippedCorruptLines,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Force a `FAILING` verdict when a loop has recorded three or more consecutive
|
|
109
|
+
* `recovery-required` runs — the fleet-health signal the scheduler surface
|
|
110
|
+
* cannot see on its own. Returns a run-signal-shaped escalation, or null when
|
|
111
|
+
* the streak is below the threshold.
|
|
112
|
+
*
|
|
113
|
+
* @param {AutomationRunDisplay | undefined} runDisplay
|
|
114
|
+
* @returns {{ readonly status: "FAILING", readonly summary: string, readonly remediation: string } | null}
|
|
115
|
+
*/
|
|
116
|
+
export function resolveRecoveryEscalation(runDisplay) {
|
|
117
|
+
if (
|
|
118
|
+
!runDisplay ||
|
|
119
|
+
runDisplay.recoveryRequiredStreak < RECOVERY_REQUIRED_ESCALATION_THRESHOLD
|
|
120
|
+
) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Number the citations rather than joining on a delimiter: recorded summaries
|
|
125
|
+
// carry their own `;` and `.`, so a `; `-separated list is ambiguous. `(1) …
|
|
126
|
+
// (2) …` stays legible no matter what punctuation a summary contains.
|
|
127
|
+
const citations = runDisplay.recoverySummaries
|
|
128
|
+
.map((summary, index) => `(${index + 1}) ${summary}`)
|
|
129
|
+
.join(" ");
|
|
130
|
+
return {
|
|
131
|
+
status: "FAILING",
|
|
132
|
+
summary: `the last ${runDisplay.recoveryRequiredStreak} recorded runs all required recovery`,
|
|
133
|
+
remediation: `Repeated recovery-required runs — ${citations} Inspect the loop's runbook and the cited runs, fix the recurring failure, then let the next scheduled run confirm recovery.`,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @param {string} projectRoot
|
|
139
|
+
* @param {string | undefined} runbookPath
|
|
140
|
+
* @returns {Promise<string>}
|
|
141
|
+
*/
|
|
142
|
+
async function resolveRunbookLine(projectRoot, runbookPath) {
|
|
143
|
+
if (!runbookPath) {
|
|
144
|
+
return RUNBOOK_NOT_SCAFFOLDED_LINE;
|
|
145
|
+
}
|
|
146
|
+
const scaffolded = await runbookIsScaffolded(
|
|
147
|
+
path.join(projectRoot, runbookPath)
|
|
148
|
+
);
|
|
149
|
+
return scaffolded ? runbookPath : RUNBOOK_NOT_SCAFFOLDED_LINE;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Read-only existence check for a checked-in runbook. Any stat failure — the
|
|
154
|
+
* file is absent, unreadable, or not a regular file — degrades to "not
|
|
155
|
+
* scaffolded" so the status read never implies health it could not confirm and
|
|
156
|
+
* never throws mid-report.
|
|
157
|
+
*
|
|
158
|
+
* @param {string} runbookAbsolutePath
|
|
159
|
+
* @returns {Promise<boolean>}
|
|
160
|
+
*/
|
|
161
|
+
async function runbookIsScaffolded(runbookAbsolutePath) {
|
|
162
|
+
try {
|
|
163
|
+
const stat = await fs.stat(runbookAbsolutePath);
|
|
164
|
+
return stat.isFile();
|
|
165
|
+
} catch {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @param {readonly import("./automation-run-record.mjs").AutomationRunRecord[]} records
|
|
172
|
+
* @returns {readonly import("./automation-run-record.mjs").AutomationRunRecord[]} trailing recovery-required runs, newest first
|
|
173
|
+
*/
|
|
174
|
+
function collectTrailingRecoveryRuns(records) {
|
|
175
|
+
const trailing = [];
|
|
176
|
+
for (let index = records.length - 1; index >= 0; index -= 1) {
|
|
177
|
+
if (records[index].outcome !== RECOVERY_REQUIRED_OUTCOME) {
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
trailing.push(records[index]);
|
|
181
|
+
}
|
|
182
|
+
return trailing;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export { RUNBOOK_NOT_SCAFFOLDED_LINE, NO_RECORDED_RUNS_LINE };
|
|
@@ -53,8 +53,13 @@ For each expected automation, report:
|
|
|
53
53
|
4. Any detected drift in name, cadence, command shape, or queue arguments.
|
|
54
54
|
5. Any available recent-run health signal such as stale last-run timing or repeated failure status.
|
|
55
55
|
6. A concise remediation hint when attention is needed.
|
|
56
|
+
7. Where the loop's checked-in runbook lives (`automation-runbook-contract`), or `not scaffolded — run /lisa:setup-automations` when it is absent.
|
|
57
|
+
8. How the last recorded run ended — its outcome, one-line summary, and timestamp — or `no recorded runs yet` when the loop has never recorded one.
|
|
58
|
+
9. A bounded run history: the five most recent outcomes newest first, plus a count of how many older records exist when the file holds more.
|
|
56
59
|
|
|
57
|
-
|
|
60
|
+
The last-run and history facts come from the durable run-outcome substrate recorded by each loop (the RBC-3 records under `.lisa/automations/runs/<loop-id>.jsonl`, read through `readAutomationRunRecords`). That directory is local scheduler state, not project knowledge — read it, never write it.
|
|
61
|
+
|
|
62
|
+
Emit an overall grouped fleet verdict such as `HEALTHY`, `ATTENTION_NEEDED`, or `PARTIAL_SUPPORT`, plus the runtime surface inspected. **Repeated recovery is a fleet-health signal the scheduler cannot see**: when a loop's last three or more consecutive recorded runs are all `recovery-required`, report that loop `FAILING` — and therefore the overall verdict `ATTENTION_NEEDED` — even when its scheduler entry itself looks healthy, and point the remediation at the recorded run summaries.
|
|
58
63
|
|
|
59
64
|
## Operator usage
|
|
60
65
|
|
|
@@ -89,7 +94,7 @@ Status-specific remediation guidance:
|
|
|
89
94
|
- `MISSING`: tell the operator which job is absent and recommend rerunning `/lisa:setup-automations` or recreating the missing job with the expected cadence and command.
|
|
90
95
|
- `DRIFTED`: show the expected versus observed cadence/command mismatch and recommend aligning the scheduler entry with Lisa's current setup contract, usually by rerunning `/lisa:setup-automations`.
|
|
91
96
|
- `STALE`: explain that the job exists but has not run recently enough for its cadence. Recommend inspecting the runtime's recent-run history or failure logs before changing queue state.
|
|
92
|
-
- `FAILING`: surface the failure signal directly and recommend checking the latest runtime error plus the affected queue command (`/lisa:intake`, `/lisa:repair-intake`, or exploratory job) after the scheduler issue is resolved.
|
|
97
|
+
- `FAILING`: surface the failure signal directly and recommend checking the latest runtime error plus the affected queue command (`/lisa:intake`, `/lisa:repair-intake`, or exploratory job) after the scheduler issue is resolved. A loop also reports `FAILING` when its last three or more consecutive recorded runs are all `recovery-required` — even with a healthy scheduler entry — in which case cite the recorded run summaries and point the operator at the loop's runbook.
|
|
93
98
|
- `UNSUPPORTED`: explain why the job is intentionally absent and say that no remediation is required unless the project stack or runtime support changed.
|
|
94
99
|
|
|
95
100
|
Render the report in grouped sections using the shared `scripts/automation-status-report.mjs` contract:
|
|
@@ -104,10 +109,13 @@ Generated at: <ISO timestamp>
|
|
|
104
109
|
- <STATUS> <automation-id>: <summary>
|
|
105
110
|
Expected: <cadence> -> <command>
|
|
106
111
|
Observed: <what the runtime exposed>
|
|
112
|
+
Runbook: <.lisa/automations/<loop-id>.runbook.md, or "not scaffolded — run /lisa:setup-automations">
|
|
113
|
+
Last run: <outcome> — <summary> (<ts>), or "no recorded runs yet"
|
|
114
|
+
History: <outcome>, <outcome>, … (newest first); … and <N> older records
|
|
107
115
|
Remediation: <next step when attention is needed>
|
|
108
116
|
```
|
|
109
117
|
|
|
110
|
-
Keep observable runtime facts separate from remediation guidance so operators can distinguish drift, unsupported jobs, and actual failures quickly.
|
|
118
|
+
The Runbook, Last run, and History lines are observable facts and sit between Observed and Remediation. Keep observable runtime facts separate from remediation guidance so operators can distinguish drift, unsupported jobs, and actual failures quickly.
|
|
111
119
|
|
|
112
120
|
## Rules
|
|
113
121
|
|
|
@@ -154,7 +154,7 @@ When `issue_type ∉ {Bug, Epic}`, `parent_ref` must be set — **except for a b
|
|
|
154
154
|
|
|
155
155
|
#### S8 — Target Backend Environment
|
|
156
156
|
|
|
157
|
-
When `runtime_behavior_change = true`, body must contain `## Target Backend Environment
|
|
157
|
+
When `runtime_behavior_change = true`, the body must contain `## Target Backend Environment`. Read accepted environments from the exact configured keys of `.lisa.config.json` `deploy.branches`, never from a hardcoded list. Accept a human-confirmed bare exact configured key or `Confirmed: <env>`, automated `Inferred: <env> — evidence: <title|body|reproduction|hostname>`, automated `Assumption: <env> — remote default branch <branch>` for a unique reverse-map, or `Assumption: remote default branch <branch>` when no unique reverse-map exists. Human confirmation replaces an automated annotation with the bare key or `Confirmed: <env>`. For legacy bare values, use managed draft markers and current ticket content only; provider edit history is not required. A marker proves automation and requires re-annotation; otherwise unknown provenance plus conflicting evidence fails for confirmation. Validate the annotation shape/source and remote-default branch; validate `<env>` as an exact configured key whenever present. A valid branch-only assumption must not fail solely because its reverse-map is absent or ambiguous. Normalize built-in `prod` ↔ `production` only when exactly one of those keys is configured. No other aliases are valid. Skipped for doc-only / config-only / type-only / Epic.
|
|
158
158
|
|
|
159
159
|
#### S9 — Sign-in Required
|
|
160
160
|
|
|
@@ -38,7 +38,7 @@ Resolve `<ORG>` and `<REPO>` from the ref or from `.lisa.config.json`.
|
|
|
38
38
|
| Priority | CREATE | Label `priority:<low|medium|high|critical>`. |
|
|
39
39
|
| Acceptance criteria | Story, Task, Bug, Sub-task, Improvement | Gherkin in `## Acceptance Criteria` — see Phase 3. |
|
|
40
40
|
| Validation Journey | Runtime-behavior changes | Delegate to `/github-add-journey`. |
|
|
41
|
-
| Target backend environment | Runtime-behavior changes |
|
|
41
|
+
| Target backend environment | Runtime-behavior changes | For every work type, use an exact `deploy.branches` key when an environment is known. Human: bare key or `Confirmed: <env>`. Automation: `Inferred: <env> — evidence: <title\|body\|reproduction\|hostname>`, `Assumption: <env> — remote default branch <branch>` for a unique reverse-map, or `Assumption: remote default branch <branch>` otherwise. Human confirmation replaces an automated annotation with the bare key or `Confirmed: <env>`. |
|
|
42
42
|
| Sign-in account / credentials | Authenticated-surface tickets | Recorded under `## Sign-in Required`. |
|
|
43
43
|
| Repository | Bug, Task, Sub-task | GitHub Issues live in exactly one repo by definition — record the repo name under `## Repository`, and reject any AC bullet that references a different repo. |
|
|
44
44
|
| Source Requirement | PRD-sourced issues (`prd_source` provided) | `## Source Requirement` with PRD link + verbatim requirement quote(s) — see Phase 3; enforced at every level, sub-issues included. |
|
|
@@ -91,8 +91,14 @@ Scenario: <name>
|
|
|
91
91
|
[Explicit list of what this issue does NOT cover. Forces scope discipline.]
|
|
92
92
|
|
|
93
93
|
## Target Backend Environment
|
|
94
|
-
[Required when the issue changes runtime behavior.
|
|
95
|
-
|
|
94
|
+
[Required when the issue changes runtime behavior. Use an exact
|
|
95
|
+
`deploy.branches` key. A human-confirmed value is a bare key or
|
|
96
|
+
`Confirmed: <env>`. An automated evidence write is
|
|
97
|
+
`Inferred: <env> — evidence: <title|body|reproduction|hostname>`; an automated
|
|
98
|
+
generic default is `Assumption: <env> — remote default branch <branch>`.
|
|
99
|
+
Without a unique reverse-map use `Assumption: remote default branch <branch>`.
|
|
100
|
+
Human confirmation replaces the automated annotation with a bare key or
|
|
101
|
+
`Confirmed: <env>`. Skip only for doc/config/type-only issues.]
|
|
96
102
|
|
|
97
103
|
## Sign-in Required
|
|
98
104
|
[Include this section ONLY if the work touches authenticated surfaces.
|
|
@@ -84,8 +84,12 @@ Using the general-purpose agent in Team Lead session, Determine the name of this
|
|
|
84
84
|
|
|
85
85
|
Using the general-purpose agent in Team Lead session, **determine the base branch from the ticket's target environment, then sync the working branch onto the latest of it before any work** — so implementation always builds on current target-environment code:
|
|
86
86
|
|
|
87
|
-
1. **Resolve the target environment
|
|
88
|
-
|
|
87
|
+
1. **Resolve the target environment with durable provenance.** The `## Target Backend Environment` value has this exact grammar: a human-confirmed value is either a bare configured key or `Confirmed: <env>`; automated evidence writes `Inferred: <env> — evidence: <title|body|reproduction|hostname>`; an automated fallback writes `Assumption: <env> — remote default branch <branch>` when the branch maps uniquely, or `Assumption: remote default branch <branch>` when it does not. Human confirmation replaces an automated annotation with the bare configured key or `Confirmed: <env>`. For a legacy bare value created before this grammar, use managed draft markers and current ticket content only — provider edit history is not required or assumed. A managed marker proves automation and requires rewriting to `Inferred:` or `Assumption:`; without a marker provenance is unknown, so the value may be used only when no conflicting evidence exists, and a conflict **stops for confirmation**.
|
|
88
|
+
- A human-confirmed value wins. Otherwise a validated `Inferred:` value is next.
|
|
89
|
+
- Otherwise inspect the human-authored title, body, and reproduction steps for exactly one unambiguous signal: an exact `deploy.branches` key as a complete token, or that key as a complete label in a URL hostname (`staging.<domain>`, `gql.staging.*`). Exclude the entire `Target Backend Environment` section and all other machine-authored metadata/draft blocks from this evidence scan so an `Inferred:` or `Assumption:` annotation can never validate or conflict with itself. Clear evidence may supersede only an `Assumption:` value, never a human-confirmed value.
|
|
90
|
+
- The only normalization is built-in `prod` ↔ `production`, and only when exactly one of those keys exists in `deploy.branches`; normalize to that configured key. No other aliases exist.
|
|
91
|
+
- Never infer from arbitrary branch text, URL paths or query strings, or substrings inside other words or hostname labels. Multiple conflicting signals after normalization **stop** the flow. If there are no signals, resolve the remote default branch (`gh repo view --json defaultBranchRef -q .defaultBranchRef.name`, or `git remote set-head origin -a` then `origin/HEAD`). When it reverse-maps uniquely, write the env-bearing `Assumption:` form; when the reverse-map is not unique, write the branch-only form and continue on the remote default without inventing an environment or blocking solely for that ambiguity. Record the fallback assumption in the plan/tracker artifact.
|
|
92
|
+
2. **Map the resolved environment to a base branch** through `.lisa.config.json` `deploy.branches` — the forward direction of the env-keyed `done` resolution. The selected exact configured key must map uniquely, and the mapped branch must exist on the remote. A missing/ambiguous mapping or remote branch **stops** the flow; never guess or silently fall back.
|
|
89
93
|
3. **Establish the feature branch off the latest base, conflict-free:**
|
|
90
94
|
- `git fetch origin`.
|
|
91
95
|
- Already on a feature branch with an **open PR** → reuse it. If the PR's base ≠ the resolved base branch, surface the mismatch and re-target only with confirmation — the ticket's environment is the source of truth.
|
|
@@ -155,7 +155,7 @@ When `issue_type ∉ {Bug, Epic}`, `parent_key` must be set — **except for a b
|
|
|
155
155
|
|
|
156
156
|
#### S8 — Target Backend Environment
|
|
157
157
|
|
|
158
|
-
When `runtime_behavior_change = true`, description must contain a `Target Backend Environment` section (`h2.` / `##` in proposed text, or an ADF heading in live JIRA)
|
|
158
|
+
When `runtime_behavior_change = true`, the description must contain a `Target Backend Environment` section (`h2.` / `##` in proposed text, or an ADF heading in live JIRA). Read accepted environments from the exact configured keys of `.lisa.config.json` `deploy.branches`, never from a hardcoded list. Accept a human-confirmed bare exact configured key or `Confirmed: <env>`, automated `Inferred: <env> — evidence: <title|body|reproduction|hostname>`, automated `Assumption: <env> — remote default branch <branch>` for a unique reverse-map, or `Assumption: remote default branch <branch>` when no unique reverse-map exists. Human confirmation replaces an automated annotation with the bare key or `Confirmed: <env>`. For legacy bare values, use managed draft markers and current ticket content only; provider edit history is not required. A marker proves automation and requires re-annotation; otherwise unknown provenance plus conflicting evidence fails for confirmation. Validate the annotation shape/source and remote-default branch; validate `<env>` as an exact configured key whenever present. A valid branch-only assumption must not fail solely because its reverse-map is absent or ambiguous. Normalize built-in `prod` ↔ `production` only when exactly one of those keys is configured. No other aliases are valid. Skipped for doc-only / config-only / type-only / Epic.
|
|
159
159
|
|
|
160
160
|
#### S9 — Sign-in Required
|
|
161
161
|
|
|
@@ -35,7 +35,7 @@ Required fields (stop and ask if missing — do not invent values):
|
|
|
35
35
|
| Priority | CREATE | Default to project default if unstated |
|
|
36
36
|
| Acceptance criteria | Story, Task, Bug, Sub-task, Improvement | Gherkin — see Phase 3 |
|
|
37
37
|
| Validation Journey | Runtime-behavior changes | Delegate to `/jira-add-journey` |
|
|
38
|
-
| Target backend environment | Runtime-behavior changes | `
|
|
38
|
+
| Target backend environment | Runtime-behavior changes | For every work type, use an exact `deploy.branches` key when an environment is known. Human: bare key or `Confirmed: <env>`. Automation: `Inferred: <env> — evidence: <title\|body\|reproduction\|hostname>`, `Assumption: <env> — remote default branch <branch>` for a unique reverse-map, or `Assumption: remote default branch <branch>` otherwise. Human confirmation replaces an automated annotation with the bare key or `Confirmed: <env>`. |
|
|
39
39
|
| Sign-in account / credentials | Tickets that touch authenticated surfaces | Name the account (or source — 1Password item, env var, seeded fixture) and role; recorded in description (Phase 3). Omit when sign-in is not required. |
|
|
40
40
|
| Single-repo scope | Bug, Task, Sub-task, Improvement | These leaf work units MUST cover one repo only. If the work crosses repos, split it before creating. Epic / Spike / Story may span repos. |
|
|
41
41
|
| Source Requirement | PRD-sourced tickets (`prd_source` provided) | `h2. Source Requirement` with PRD link + verbatim requirement quote(s) — see Phase 3; enforced at every level, sub-tasks included |
|
|
@@ -83,11 +83,14 @@ h2. Out of Scope
|
|
|
83
83
|
[Explicit list of what this ticket does NOT cover. Forces scope discipline.]
|
|
84
84
|
|
|
85
85
|
h2. Target Backend Environment
|
|
86
|
-
[Required when the ticket changes runtime behavior.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
[Required when the ticket changes runtime behavior. Use an exact
|
|
87
|
+
`deploy.branches` key. A human-confirmed value is a bare key or
|
|
88
|
+
`Confirmed: <env>`. An automated evidence write is
|
|
89
|
+
`Inferred: <env> — evidence: <title|body|reproduction|hostname>`; an automated
|
|
90
|
+
generic default is `Assumption: <env> — remote default branch <branch>`.
|
|
91
|
+
Without a unique reverse-map use `Assumption: remote default branch <branch>`.
|
|
92
|
+
Human confirmation replaces the automated annotation with a bare key or
|
|
93
|
+
`Confirmed: <env>`. Skip only for doc/config/type-only tickets.]
|
|
91
94
|
|
|
92
95
|
h2. Sign-in Required
|
|
93
96
|
[Include this section ONLY if the work touches authenticated surfaces.
|
|
@@ -160,7 +160,7 @@ A **build-ready leaf work unit** that is not part of an Epic context stands alon
|
|
|
160
160
|
|
|
161
161
|
#### S8 — Target Backend Environment
|
|
162
162
|
|
|
163
|
-
When `runtime_behavior_change = true`, description must contain `## Target Backend Environment
|
|
163
|
+
When `runtime_behavior_change = true`, the description must contain `## Target Backend Environment`. Read accepted environments from the exact configured keys of `.lisa.config.json` `deploy.branches`, never from a hardcoded list. Accept a human-confirmed bare exact configured key or `Confirmed: <env>`, automated `Inferred: <env> — evidence: <title|body|reproduction|hostname>`, automated `Assumption: <env> — remote default branch <branch>` for a unique reverse-map, or `Assumption: remote default branch <branch>` when no unique reverse-map exists. Human confirmation replaces an automated annotation with the bare key or `Confirmed: <env>`. For legacy bare values, use managed draft markers and current ticket content only; provider edit history is not required. A marker proves automation and requires re-annotation; otherwise unknown provenance plus conflicting evidence fails for confirmation. Validate the annotation shape/source and remote-default branch; validate `<env>` as an exact configured key whenever present. A valid branch-only assumption must not fail solely because its reverse-map is absent or ambiguous. Normalize built-in `prod` ↔ `production` only when exactly one of those keys is configured. No other aliases are valid. Skipped for doc-only / config-only / type-only / Epic.
|
|
164
164
|
|
|
165
165
|
#### S9 — Sign-in Required
|
|
166
166
|
|
|
@@ -57,7 +57,7 @@ Required fields (stop and ask if missing — never invent values):
|
|
|
57
57
|
| Priority | CREATE | Native Linear priority: 0=No priority, 1=Urgent, 2=High, 3=Medium, 4=Low |
|
|
58
58
|
| Acceptance criteria | Story, Task, Bug, Sub-task, Improvement | Gherkin — see Phase 3 |
|
|
59
59
|
| Validation Journey | Runtime-behavior changes | Delegate to `/linear-add-journey` |
|
|
60
|
-
| Target backend environment | Runtime-behavior changes | `
|
|
60
|
+
| Target backend environment | Runtime-behavior changes | For every work type, use an exact `deploy.branches` key when an environment is known. Human: bare key or `Confirmed: <env>`. Automation: `Inferred: <env> — evidence: <title\|body\|reproduction\|hostname>`, `Assumption: <env> — remote default branch <branch>` for a unique reverse-map, or `Assumption: remote default branch <branch>` otherwise. Human confirmation replaces an automated annotation with the bare key or `Confirmed: <env>`. |
|
|
61
61
|
| Sign-in account / credentials | Items that touch authenticated surfaces | Name the account (or source — 1Password item, env var, seeded fixture) and role; recorded in description. Omit when sign-in is not required. |
|
|
62
62
|
| Single-repo scope | Bug, Task, Sub-task | These types MUST cover one repo only. If the work crosses repos, split it before creating. Epic / Spike / Story may span repos. |
|
|
63
63
|
| Source Requirement | PRD-sourced Issues (`prd_source` provided) | `## Source Requirement` with PRD link + verbatim requirement quote(s) — see Phase 3; enforced at every level, sub-issues included. |
|
|
@@ -103,8 +103,14 @@ Linear descriptions are markdown (NOT Jira wiki markup — no `h2.` headings, us
|
|
|
103
103
|
[Explicit list of what this item does NOT cover. Forces scope discipline.]
|
|
104
104
|
|
|
105
105
|
## Target Backend Environment
|
|
106
|
-
[Required when the item changes runtime behavior.
|
|
107
|
-
|
|
106
|
+
[Required when the item changes runtime behavior. Use an exact
|
|
107
|
+
`deploy.branches` key. A human-confirmed value is a bare key or
|
|
108
|
+
`Confirmed: <env>`. An automated evidence write is
|
|
109
|
+
`Inferred: <env> — evidence: <title|body|reproduction|hostname>`; an automated
|
|
110
|
+
generic default is `Assumption: <env> — remote default branch <branch>`.
|
|
111
|
+
Without a unique reverse-map use `Assumption: remote default branch <branch>`.
|
|
112
|
+
Human confirmation replaces the automated annotation with a bare key or
|
|
113
|
+
`Confirmed: <env>`. Skip only for doc/config/type-only items.]
|
|
108
114
|
|
|
109
115
|
## Sign-in Required
|
|
110
116
|
[Include this section ONLY if the work touches authenticated surfaces.
|
|
@@ -53,7 +53,7 @@ Resolve build labels from `.lisa.config.json` `github.labels.build.*` (defaults:
|
|
|
53
53
|
|
|
54
54
|
If `github-verify` returns `FAIL` on any of the above, do NOT continue to build. **Draft the missing spec content first, then block for confirmation** — never bounce a raw "go write all this" checklist back to the author:
|
|
55
55
|
|
|
56
|
-
1. **Best-effort autofill (before blocking).** Run
|
|
56
|
+
1. **Best-effort autofill (before blocking).** Run `pre-flight-autofill` for every work item. Preserve a human bare configured key or `Confirmed: <env>`; automation writes `Inferred: <env> — evidence: <title|body|reproduction|hostname>`, `Assumption: <env> — remote default branch <branch>` for a unique reverse-map, or `Assumption: remote default branch <branch>` otherwise. Human confirmation replaces the annotation with the bare key or `Confirmed: <env>`. For a legacy bare value, use managed draft markers and current ticket content only; provider edit history is not required. A marker proves automation and requires re-annotation; otherwise unknown provenance plus conflicting evidence stops for confirmation. Resolve one exact `deploy.branches` key from the human-authored title, body, and reproduction steps or URL hostname; exclude the complete `Target Backend Environment` section and other machine-authored metadata/draft blocks so annotations cannot become evidence. A reported bug environment is an example, not a restriction. Evidence supersedes only `Assumption:`. Normalize `prod` ↔ `production` only when exactly one is configured; no other aliases exist. Conflicts stop; never infer from arbitrary branch text, URL paths/query strings, or substrings. Write through `github-write-issue`, never overwrite human prose, then re-run `github-verify`.
|
|
57
57
|
2. Relabel: remove the `claimed` label, add the `blocked` label **and** the `human_needed` marker label. Even after the agent drafted what it could, a pre-flight gate failure bounces the issue back to its author because it still needs a human to **confirm the drafted assumptions** or supply something no agent can invent — real missing credentials, access, or an irreducible product/scoping decision — so the marker tells a human scanning the board which blocked issues are waiting on them. The marker is additive to `blocked`, not a replacement. (See the `config-resolution` rule's "Build markers" for when the marker applies and when it must NOT.)
|
|
58
58
|
```bash
|
|
59
59
|
_read_cfg() { local lv gv; lv=$(jq -r "$1 // empty" .lisa.config.local.json 2>/dev/null); gv=$(jq -r "$1 // empty" .lisa.config.json 2>/dev/null); echo "${lv:-${gv}}"; }
|
|
@@ -152,4 +152,4 @@ Note: `done` may be a string or an env-keyed map (`{ dev, staging, production }`
|
|
|
152
152
|
- Never create or materially edit an issue by calling `gh issue create` / `gh issue edit` directly — always delegate to `github-write-issue` (or, from a vendor-neutral caller, `tracker-write`) so relationships, Gherkin criteria, and metadata gates are enforced.
|
|
153
153
|
- If sign-in credentials are in the issue body, extract and pass them to the flow. If the issue touches an authenticated surface and credentials are missing, that is a Step 2 failure — block and reassign rather than guessing.
|
|
154
154
|
- If the issue has a `## Validation Journey` section, pass it to the verifier agent. The Validation Journey's local-verification step must point at the target backend environment named in the body.
|
|
155
|
-
-
|
|
155
|
+
- The environment handoff for every work item uses the same durable grammar: human bare configured key or `Confirmed: <env>`; automated `Inferred: <env> — evidence: <title|body|reproduction|hostname>`, `Assumption: <env> — remote default branch <branch>` for a unique reverse-map, or `Assumption: remote default branch <branch>` otherwise. Human confirmation replaces an automated annotation with the bare key or `Confirmed: <env>`. For legacy bare values, managed draft markers and current ticket content decide provenance; provider edit history is not required. A marker proves automation; otherwise unknown provenance plus conflicting evidence stops for confirmation. Human-confirmed wins, then validated `Inferred:`; otherwise one exact `deploy.branches` key from the human-authored title, body, and reproduction steps or URL hostname drives the implementation base branch. Exclude the complete `Target Backend Environment` section and other machine-authored metadata/draft blocks so annotations cannot become evidence. Evidence supersedes only `Assumption:`. Normalize `prod` ↔ `production` only when exactly one is configured; no other aliases exist. Conflicts stop. Never infer from arbitrary branch text, URL paths/query strings, or substrings. With no signal, use the remote default and record the applicable assumption without blocking on a non-unique reverse-map. Require any selected mapping and remote branch. A reported bug environment is an example of the all-work-type rule. Non-integration fixes still require the linked forward cherry-pick.
|
|
@@ -48,7 +48,7 @@ Use the `jira-verify` skill to check the ticket against organizational standards
|
|
|
48
48
|
**Gating behavior — this is the one place auto-transitioning is allowed:**
|
|
49
49
|
|
|
50
50
|
If `jira-verify` returns `FAIL` on any of the above, do NOT continue to build. **Draft the missing spec content first, then block for confirmation** — never bounce a raw "go write all this" checklist back to the reporter:
|
|
51
|
-
1. **Best-effort autofill (before blocking).** Run
|
|
51
|
+
1. **Best-effort autofill (before blocking).** Run `pre-flight-autofill` for every work item. Preserve a human bare configured key or `Confirmed: <env>`; automation writes `Inferred: <env> — evidence: <title|body|reproduction|hostname>`, `Assumption: <env> — remote default branch <branch>` for a unique reverse-map, or `Assumption: remote default branch <branch>` otherwise. Human confirmation replaces the annotation with the bare key or `Confirmed: <env>`. For a legacy bare value, use managed draft markers and current ticket content only; provider edit history is not required. A marker proves automation and requires re-annotation; otherwise unknown provenance plus conflicting evidence stops for confirmation. Resolve one exact `deploy.branches` key from the human-authored title, body, and reproduction steps or URL hostname; exclude the complete `Target Backend Environment` section and other machine-authored metadata/draft blocks so annotations cannot become evidence. A reported bug environment is an example, not a restriction. Evidence supersedes only `Assumption:`. Normalize `prod` ↔ `production` only when exactly one is configured; no other aliases exist. Conflicts stop; never infer from arbitrary branch text, URL paths/query strings, or substrings. Write through `jira-write-ticket`, never overwrite human prose, then re-run `jira-verify`.
|
|
52
52
|
2. Transition the ticket status to the configured `blocked` status (typically `Blocked` — read from `.lisa.config.json` `jira.workflow.blocked` if present, otherwise the project's standard blocked status). Use `mcp__atlassian__transitionJiraIssue` or equivalent.
|
|
53
53
|
3. **Add the `human_needed` marker label.** Even after the agent drafted what it could, a pre-flight gate failure bounces the ticket back to its reporter because the ticket still needs a human to **confirm the drafted assumptions** or supply something no agent can invent — real missing credentials, access, or an irreducible product/scoping decision. Add the configured label (`jira.labels.human_needed`, default `Human Needed`) to the ticket's `labels` field via `mcp__atlassian__editJiraIssue` — a lightweight metadata update permitted under this same gate exception. This is additive to (not a replacement for) the `blocked` status, so a human scanning the board sees at a glance which blocked tickets are waiting on them. If the label does not exist in the project, record that and proceed — the marker is best-effort. (See the `config-resolution` rule's "Build markers" for when the marker applies and when it must NOT.)
|
|
54
54
|
4. Reassign the ticket to the **Reporter** (the human who filed it — not the Creator field, which may be a bot/integration).
|
|
@@ -132,4 +132,4 @@ Note: `done` may be a string or an env-keyed map (`{ dev, staging, production }`
|
|
|
132
132
|
- Never create or materially edit a ticket by calling MCP write tools directly — always delegate to `jira-write-ticket` so relationships, Gherkin criteria, and metadata gates are enforced
|
|
133
133
|
- If sign-in credentials are in the ticket, extract and pass them to the flow. If the ticket touches an authenticated surface and credentials are missing, that is a Step 2 failure — block and reassign rather than guessing.
|
|
134
134
|
- If the ticket has a Validation Journey section, pass it to the verifier agent. The Validation Journey's local-verification step must point at the target backend environment named in the description (for FE work, that's the deployed backend QA reported against).
|
|
135
|
-
-
|
|
135
|
+
- The environment handoff for every work item uses the same durable grammar: human bare configured key or `Confirmed: <env>`; automated `Inferred: <env> — evidence: <title|body|reproduction|hostname>`, `Assumption: <env> — remote default branch <branch>` for a unique reverse-map, or `Assumption: remote default branch <branch>` otherwise. Human confirmation replaces an automated annotation with the bare key or `Confirmed: <env>`. For legacy bare values, managed draft markers and current ticket content decide provenance; provider edit history is not required. A marker proves automation; otherwise unknown provenance plus conflicting evidence stops for confirmation. Human-confirmed wins, then validated `Inferred:`; otherwise one exact `deploy.branches` key from the human-authored title, body, and reproduction steps or URL hostname drives the implementation base branch. Exclude the complete `Target Backend Environment` section and other machine-authored metadata/draft blocks so annotations cannot become evidence. Evidence supersedes only `Assumption:`. Normalize `prod` ↔ `production` only when exactly one is configured; no other aliases exist. Conflicts stop. Never infer from arbitrary branch text, URL paths/query strings, or substrings. With no signal, use the remote default and record the applicable assumption without blocking on a non-unique reverse-map. Require any selected mapping and remote branch. A reported bug environment is an example of the all-work-type rule. Non-integration fixes still require the linked forward cherry-pick.
|
|
@@ -50,7 +50,7 @@ Use the `linear-verify` skill to check the item against organizational standards
|
|
|
50
50
|
Resolve build labels from `.lisa.config.json` `linear.labels.build.*` (defaults: `status:ready` / `status:in-progress` / `status:code-review`); resolve the `blocked` label from the same section (`linear.labels.build.blocked`, default `status:blocked`) and the `human_needed` marker label from the same section (`linear.labels.build.human_needed`, default `human-needed`).
|
|
51
51
|
|
|
52
52
|
If `linear-verify` returns `FAIL` on any of the above, do NOT continue to build. **Draft the missing spec content first, then block for confirmation** — never bounce a raw "go write all this" checklist back to the creator:
|
|
53
|
-
1. **Best-effort autofill (before blocking).** Run
|
|
53
|
+
1. **Best-effort autofill (before blocking).** Run `pre-flight-autofill` for every work item. Preserve a human bare configured key or `Confirmed: <env>`; automation writes `Inferred: <env> — evidence: <title|body|reproduction|hostname>`, `Assumption: <env> — remote default branch <branch>` for a unique reverse-map, or `Assumption: remote default branch <branch>` otherwise. Human confirmation replaces the annotation with the bare key or `Confirmed: <env>`. For a legacy bare value, use managed draft markers and current ticket content only; provider edit history is not required. A marker proves automation and requires re-annotation; otherwise unknown provenance plus conflicting evidence stops for confirmation. Resolve one exact `deploy.branches` key from the human-authored title, body, and reproduction steps or URL hostname; exclude the complete `Target Backend Environment` section and other machine-authored metadata/draft blocks so annotations cannot become evidence. A reported bug environment is an example, not a restriction. Evidence supersedes only `Assumption:`. Normalize `prod` ↔ `production` only when exactly one is configured; no other aliases exist. Conflicts stop; never infer from arbitrary branch text, URL paths/query strings, or substrings. Write through `linear-write-issue`, never overwrite human prose, then re-run `linear-verify`.
|
|
54
54
|
2. Update labels via `lisa-linear-access operation: save-issue`: remove the current build label, add the configured `blocked` label **and** the configured `human_needed` marker label. (Create either label via `create_issue_label` if needed.) Even after the agent drafted what it could, a pre-flight gate failure bounces the item back to its creator because it still needs a human to **confirm the drafted assumptions** or supply something no agent can invent — real missing credentials, access, or an irreducible product/scoping decision — so the marker tells a human scanning the board which blocked items are waiting on them. The marker is additive to `blocked`, not a replacement. (See the `config-resolution` rule's "Build markers" for when the marker applies and when it must NOT.)
|
|
55
55
|
3. Reassign the item to the **Issue creator** (the human who filed it — Linear's `creator` field).
|
|
56
56
|
4. Post the **confirmation comment** from the `pre-flight-autofill` rule via `lisa-linear-access operation: save-comment`, **not** a bare remediation checklist: disclose it is a Claude draft, give one line per drafted section naming the key assumption made, list any remaining human-only item as a specific question with a recommended default, and close with *"review the drafted sections, correct anything wrong, then flip back to Ready and it builds — or reply with corrections."* Prefix with `[{repo}]`.
|
|
@@ -135,4 +135,4 @@ The label transitions ARE the canonical signal. The native `state` field stays a
|
|
|
135
135
|
- Never create or materially edit an item by calling MCP write tools directly — always delegate to `linear-write-issue` so relationships, Gherkin criteria, and metadata gates are enforced. Two explicit exceptions are permitted: (1) the Step 2 pre-flight failure path (when `linear-verify` returns `FAIL`) may call `lisa-linear-access operation: save-issue` and `lisa-linear-access operation: save-comment` directly to set `status:blocked`, add the configured `human_needed` marker label, and reassign to the creator — this narrow exception is already granted by the rule above; (2) the Step 3 triage path may call `lisa-linear-access operation: save-comment` to post triage findings and `lisa-linear-access operation: save-issue` to add the `claude-triaged-{repo}` label — these are lightweight metadata updates that do not create or materially edit ticket content and therefore do not need to route through `linear-write-issue`.
|
|
136
136
|
- If sign-in credentials are in the item, extract and pass them to the flow. If the item touches an authenticated surface and credentials are missing, that is a Step 2 failure — block and reassign rather than guessing.
|
|
137
137
|
- If the item has a Validation Journey section, pass it to the verifier agent. The Validation Journey's local-verification step must point at the target backend environment named in the description.
|
|
138
|
-
-
|
|
138
|
+
- The environment handoff for every work item uses the same durable grammar: human bare configured key or `Confirmed: <env>`; automated `Inferred: <env> — evidence: <title|body|reproduction|hostname>`, `Assumption: <env> — remote default branch <branch>` for a unique reverse-map, or `Assumption: remote default branch <branch>` otherwise. Human confirmation replaces an automated annotation with the bare key or `Confirmed: <env>`. For legacy bare values, managed draft markers and current ticket content decide provenance; provider edit history is not required. A marker proves automation; otherwise unknown provenance plus conflicting evidence stops for confirmation. Human-confirmed wins, then validated `Inferred:`; otherwise one exact `deploy.branches` key from the human-authored title, body, and reproduction steps or URL hostname drives the implementation base branch. Exclude the complete `Target Backend Environment` section and other machine-authored metadata/draft blocks so annotations cannot become evidence. Evidence supersedes only `Assumption:`. Normalize `prod` ↔ `production` only when exactly one is configured; no other aliases exist. Conflicts stop. Never infer from arbitrary branch text, URL paths/query strings, or substrings. With no signal, use the remote default and record the applicable assumption without blocking on a non-unique reverse-map. Require any selected mapping and remote branch. A reported bug environment is an example of the all-work-type rule. Non-integration fixes still require the linked forward cherry-pick.
|
|
@@ -222,23 +222,47 @@ Declares **where this repo's LLM Wiki lives** so the query/ingest skills can res
|
|
|
222
222
|
|
|
223
223
|
### Env → base branch
|
|
224
224
|
|
|
225
|
-
Implementation flows resolve their PR base from the work item's
|
|
226
|
-
|
|
225
|
+
Implementation flows resolve their PR base from the work item's environment
|
|
226
|
+
evidence in the forward direction of `deploy.branches`.
|
|
227
227
|
For example, `{ "staging": "staging", "production": "main" }` means a staging
|
|
228
228
|
work item starts from `origin/staging` and opens its PR against `staging`. This
|
|
229
229
|
is the reverse/inverse of the env-keyed `done` inference that derives an
|
|
230
230
|
environment from a merged PR's base branch.
|
|
231
231
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
232
|
+
The field grammar records provenance durably: human-confirmed values are a bare
|
|
233
|
+
configured key or `Confirmed: <env>`; automated evidence is
|
|
234
|
+
`Inferred: <env> — evidence: <title|body|reproduction|hostname>`; an automated
|
|
235
|
+
fallback is `Assumption: <env> — remote default branch <branch>`. Human
|
|
236
|
+
fallback without a unique reverse-map is
|
|
237
|
+
`Assumption: remote default branch <branch>`. Human
|
|
238
|
+
confirmation replaces an automated annotation with a bare key or
|
|
239
|
+
`Confirmed: <env>`.
|
|
240
|
+
|
|
241
|
+
For legacy bare values created before this grammar, use managed draft markers
|
|
242
|
+
and current ticket content only; provider edit history is neither required nor
|
|
243
|
+
assumed. A managed marker proves automation and requires rewriting to
|
|
244
|
+
`Inferred:` or `Assumption:`. Without one, provenance remains unknown, so the
|
|
245
|
+
bare value is usable only if no conflicting evidence exists; a conflict stops
|
|
246
|
+
for confirmation.
|
|
247
|
+
|
|
248
|
+
Resolve it in this order: human-confirmed wins; validated `Inferred:` evidence
|
|
249
|
+
is next; otherwise accept one unambiguous exact `deploy.branches` key from the
|
|
250
|
+
human-authored title, body, and reproduction steps or a URL hostname. Exclude
|
|
251
|
+
the entire `Target Backend Environment` section and all other machine-authored
|
|
252
|
+
metadata/draft blocks from the evidence scan, so annotations never validate or
|
|
253
|
+
conflict with themselves. Evidence supersedes only
|
|
254
|
+
an `Assumption:`. Treat the reported bug environment as an example of this
|
|
255
|
+
all-work-type evidence rule, not a special case. Normalize only built-in
|
|
256
|
+
`prod` ↔ `production` when exactly one is configured; no other aliases exist.
|
|
257
|
+
Never infer from arbitrary branch text, URL paths/query strings, or substrings.
|
|
258
|
+
Multiple conflicting signals stop. With no signals, use the remote default
|
|
259
|
+
branch and record an assumption: include the environment only for a unique
|
|
260
|
+
reverse-map; otherwise use the branch-only form without inventing an environment
|
|
261
|
+
or blocking solely on the reverse-map.
|
|
262
|
+
|
|
263
|
+
Every selected environment must have a unique `deploy.branches` mapping and its
|
|
264
|
+
mapped branch must exist on the remote. If either validation fails, stop and
|
|
265
|
+
report it. Do not silently default to the integration branch.
|
|
242
266
|
|
|
243
267
|
For non-integration environment bugs, definition of done is two-step:
|
|
244
268
|
|
|
@@ -509,10 +533,25 @@ If a project's terminal state is the same regardless of env, set `done` to a str
|
|
|
509
533
|
|
|
510
534
|
`deploy.branches` is also read in the **forward** direction by the build flow (`lisa-implement`): the environment a work item targets determines the branch the work is built on and the branch the PR opens against.
|
|
511
535
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
536
|
+
The durable field forms are: bare configured key or `Confirmed: <env>` for a
|
|
537
|
+
human-confirmed value; `Inferred: <env> — evidence: <title|body|reproduction|hostname>`
|
|
538
|
+
for automation-backed evidence; and
|
|
539
|
+
`Assumption: <env> — remote default branch <branch>` for a generic fallback.
|
|
540
|
+
When the remote default has no unique environment reverse-map, the valid form is
|
|
541
|
+
`Assumption: remote default branch <branch>`.
|
|
542
|
+
Human confirmation replaces the automated annotation with a bare key or
|
|
543
|
+
`Confirmed: <env>`.
|
|
544
|
+
|
|
545
|
+
For a legacy bare value, use managed draft markers and current ticket content
|
|
546
|
+
only; do not require provider edit history. A marker proves automation and
|
|
547
|
+
requires re-annotation; otherwise unknown provenance plus conflicting evidence
|
|
548
|
+
stops for confirmation.
|
|
549
|
+
|
|
550
|
+
1. **Resolve provenance first.** Human-confirmed wins, then validated `Inferred:` evidence. Otherwise search the human-authored title, body, and reproduction steps or URL hostname for one unambiguous exact `deploy.branches` key. Exclude the complete `Target Backend Environment` section and other machine-authored metadata/draft blocks from the scan so annotations cannot become evidence. Evidence supersedes only an `Assumption:`.
|
|
551
|
+
2. **Normalize narrowly.** Normalize built-in `prod` ↔ `production` only when exactly one of those keys is configured. No other aliases exist. Never infer from arbitrary branch text, URL paths/query strings, or substrings.
|
|
552
|
+
3. **Handle absence and conflict explicitly.** Multiple conflicting signals stop. With no signals, use the remote default branch (`gh repo view --json defaultBranchRef`, or `origin/HEAD`) and record the env-bearing assumption only for a unique reverse-map; otherwise use the branch-only assumption without inventing an environment or blocking.
|
|
553
|
+
4. **Validate the destination.** The selected exact configured key must map uniquely and the mapped remote branch must exist; otherwise stop without guessing or falling back.
|
|
554
|
+
5. **Before any code is written**, `lisa-implement` fetches and **rebases the working branch onto `origin/<base>`, resolving conflicts**, then opens the PR against that same base (`target_branch=<base>`).
|
|
516
555
|
|
|
517
556
|
This is the exact inverse of the env-keyed `done` "Branch inference" above: `done` derives the env *from* the PR base branch (reverse); the build flow derives the base branch *from* the env (forward). Both use the one `deploy.branches` map, so the branch a PR targets and the `done` status it earns always agree.
|
|
518
557
|
|