lastlight-core 0.31.0 → 0.32.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/config/default.yaml +35 -4
- package/dist/config/config.d.ts +35 -3
- package/dist/config/config.js +155 -9
- package/dist/config/config.js.map +1 -1
- package/dist/config/repo-config.js +3 -0
- package/dist/config/repo-config.js.map +1 -1
- package/dist/engine/agent-executor.d.ts +5 -0
- package/dist/engine/agent-executor.js +1 -0
- package/dist/engine/agent-executor.js.map +1 -1
- package/dist/engine/executors/orchestrator.d.ts +21 -1
- package/dist/engine/executors/orchestrator.js +13 -2
- package/dist/engine/executors/orchestrator.js.map +1 -1
- package/dist/engine/pr-decisions.js +14 -1
- package/dist/engine/pr-decisions.js.map +1 -1
- package/dist/evals-api.d.ts +2 -1
- package/dist/evals-api.js +4 -1
- package/dist/evals-api.js.map +1 -1
- package/dist/sandbox/docker.d.ts +12 -6
- package/dist/sandbox/docker.js +17 -3
- package/dist/sandbox/docker.js.map +1 -1
- package/dist/sandbox/k8s/kubernetes-sandbox.js +12 -3
- package/dist/sandbox/k8s/kubernetes-sandbox.js.map +1 -1
- package/dist/sandbox/k8s/run-agent-script.d.ts +6 -0
- package/dist/sandbox/k8s/run-agent-script.js +6 -0
- package/dist/sandbox/k8s/run-agent-script.js.map +1 -1
- package/dist/sandbox/sandbox.d.ts +15 -1
- package/dist/sandbox/sandbox.js +7 -0
- package/dist/sandbox/sandbox.js.map +1 -1
- package/dist/sandbox/smol.d.ts +11 -5
- package/dist/sandbox/smol.js +19 -3
- package/dist/sandbox/smol.js.map +1 -1
- package/dist/workflows/handlers/fanout.js +15 -2
- package/dist/workflows/handlers/fanout.js.map +1 -1
- package/dist/workflows/handlers/post-review.js +5 -5
- package/dist/workflows/runner.js +19 -3
- package/dist/workflows/runner.js.map +1 -1
- package/dist/workflows/simple.d.ts +10 -1
- package/dist/workflows/simple.js +34 -2
- package/dist/workflows/simple.js.map +1 -1
- package/package.json +4 -4
- package/skills/building/SKILL.md +7 -0
- package/workflows/build.yaml +104 -4
- package/workflows/dependabot-ci-fix.yaml +5 -5
- package/workflows/pr-fix.yaml +1 -1
- package/workflows/pr-review.yaml +5 -5
- package/workflows/prompts/executor.md +11 -5
- package/workflows/prompts/fix.md +8 -3
- package/workflows/prompts/guardrails.md +39 -12
package/workflows/build.yaml
CHANGED
|
@@ -35,11 +35,18 @@ phases:
|
|
|
35
35
|
label: Context
|
|
36
36
|
type: context
|
|
37
37
|
|
|
38
|
+
# Guardrails is two phases (issue #385). The agent does the judgement work —
|
|
39
|
+
# install, typecheck, lint, and naming the repo's full test command — and
|
|
40
|
+
# writes it to `.git/lastlight-gate.sh` (inside .git, so it is never
|
|
41
|
+
# committed). It does NOT run the suite. `guardrails_gate` then runs that
|
|
42
|
+
# script ONCE, deterministically, under `gate.timeoutSeconds`: the exit code
|
|
43
|
+
# is the verdict, so READY can only mean the full suite exited 0.
|
|
38
44
|
- name: guardrails
|
|
39
|
-
label: Guardrails
|
|
45
|
+
label: Guardrails · setup
|
|
40
46
|
prompt: prompts/guardrails.md
|
|
41
47
|
model: "{{models.guardrails}}"
|
|
42
48
|
variant: "{{variants.guardrails}}"
|
|
49
|
+
timeout_seconds: { from: gate.phaseTimeoutSeconds }
|
|
43
50
|
on_output:
|
|
44
51
|
contains_BLOCKED:
|
|
45
52
|
action: fail
|
|
@@ -52,16 +59,106 @@ phases:
|
|
|
52
59
|
Proceeding with the build cycle so the architect can plan, and the
|
|
53
60
|
executor can install, the missing tooling. The guardrails report at
|
|
54
61
|
`{{issueDir}}/guardrails-report.md` lists what's missing.
|
|
55
|
-
contains_READY:
|
|
56
|
-
action: continue
|
|
57
62
|
messages:
|
|
58
|
-
on_success: "
|
|
63
|
+
on_success: "Setup verified (install, typecheck, lint) — running the full test suite next"
|
|
59
64
|
on_blocked: |
|
|
60
65
|
**Guardrails check: BLOCKED** — missing foundational tooling.
|
|
61
66
|
|
|
62
67
|
See the guardrails report on branch `{{branch}}` at `{{issueDir}}/guardrails-report.md`.
|
|
63
68
|
Once you've added the missing tooling, ask me to build this issue again — the check will re-run against the current repo state.
|
|
64
69
|
|
|
70
|
+
# No LLM. Prints exactly one verdict line (READY / BLOCKED) and exits 0 so
|
|
71
|
+
# the verdict flows through on_output; a non-zero exit here means the gate
|
|
72
|
+
# machinery itself broke. Paths are relative to the checkout — the same cwd
|
|
73
|
+
# the guardrails agent ran in — so `{{issueDir}}` (incl. a relocated
|
|
74
|
+
# `../.lastlight/…`) resolves identically.
|
|
75
|
+
- name: guardrails_gate
|
|
76
|
+
label: Guardrails · full test suite
|
|
77
|
+
type: bash
|
|
78
|
+
timeout_seconds: { from: gate.phaseTimeoutSeconds }
|
|
79
|
+
command: |
|
|
80
|
+
dir='{{issueDir}}'
|
|
81
|
+
limit='{{gate.timeoutSeconds}}'
|
|
82
|
+
gate=.git/lastlight-gate.sh
|
|
83
|
+
log=.git/lastlight-gate.log
|
|
84
|
+
mkdir -p "$dir"
|
|
85
|
+
set_status() {
|
|
86
|
+
{ grep -v '^guardrails_status:' "$dir/status.md" 2>/dev/null; echo "guardrails_status: $1"; } > "$dir/status.md.tmp"
|
|
87
|
+
mv "$dir/status.md.tmp" "$dir/status.md"
|
|
88
|
+
}
|
|
89
|
+
report() {
|
|
90
|
+
{
|
|
91
|
+
echo ''
|
|
92
|
+
echo '## Full test suite gate (run by the harness)'
|
|
93
|
+
echo ''
|
|
94
|
+
echo "- Verdict: $1 — $2"
|
|
95
|
+
if [ -f "$gate" ]; then echo "- Command (\`$gate\`):"; echo '```sh'; cat "$gate"; echo '```'; fi
|
|
96
|
+
if [ -n "${code:-}" ]; then
|
|
97
|
+
echo "- Exit code: $code · duration: ${dur}s · limit: gate.timeoutSeconds=${limit}s"
|
|
98
|
+
echo ''; echo 'Last 60 lines of output:'; echo '```'; tail -n 60 "$log"; echo '```'
|
|
99
|
+
fi
|
|
100
|
+
} >> "$dir/guardrails-report.md"
|
|
101
|
+
}
|
|
102
|
+
block() { set_status BLOCKED; report BLOCKED "$1"; echo "BLOCKED — $1"; exit 0; }
|
|
103
|
+
if grep -qs '^guardrails_status: READY' "$dir/status.md"; then
|
|
104
|
+
echo 'READY — guardrails already verified (the full test suite passed on an earlier run)'; exit 0
|
|
105
|
+
fi
|
|
106
|
+
# BOOTSTRAP is written by the agent, so it only waives a suite that does not
|
|
107
|
+
# exist yet: a gate script present means there IS a suite, and it always runs.
|
|
108
|
+
if [ ! -f "$gate" ] && grep -qs '^guardrails_status: BOOTSTRAP' "$dir/status.md"; then
|
|
109
|
+
echo 'READY — bootstrap build: no test suite to gate yet (the executor establishes it)'; exit 0
|
|
110
|
+
fi
|
|
111
|
+
case "$limit" in ''|*[!0-9]*) block "gate.timeoutSeconds is not set in the run context (got '$limit')";; esac
|
|
112
|
+
[ -f "$gate" ] || block "guardrails did not produce a gate command ($gate is missing)"
|
|
113
|
+
start=$(date +%s)
|
|
114
|
+
if command -v timeout >/dev/null 2>&1; then
|
|
115
|
+
timeout -k 30 "$limit" bash "$gate" > "$log" 2>&1; code=$?
|
|
116
|
+
else
|
|
117
|
+
echo '(no coreutils timeout on this host: bounded by the phase timeout only)' > "$log"
|
|
118
|
+
bash "$gate" >> "$log" 2>&1; code=$?
|
|
119
|
+
fi
|
|
120
|
+
dur=$(( $(date +%s) - start ))
|
|
121
|
+
if [ "$code" -eq 0 ]; then
|
|
122
|
+
set_status READY
|
|
123
|
+
report READY "full test suite passed (exit 0) in ${dur}s"
|
|
124
|
+
echo "READY — full test suite passed (exit 0) in ${dur}s"
|
|
125
|
+
exit 0
|
|
126
|
+
fi
|
|
127
|
+
if [ "$code" -eq 124 ] || { [ "$code" -eq 137 ] && [ "$dur" -ge "$limit" ]; }; then
|
|
128
|
+
reason="full test suite did not finish within gate.timeoutSeconds (${limit}s) — raise gate.timeoutSeconds in the overlay or .lastlight/lastlight.yml"
|
|
129
|
+
else
|
|
130
|
+
reason="full test suite failed (exit $code)"
|
|
131
|
+
fi
|
|
132
|
+
set_status BLOCKED
|
|
133
|
+
report BLOCKED "$reason"
|
|
134
|
+
echo "BLOCKED — $reason"
|
|
135
|
+
echo ''
|
|
136
|
+
echo 'Last 60 lines of output:'
|
|
137
|
+
tail -n 60 "$log"
|
|
138
|
+
exit 0
|
|
139
|
+
on_output:
|
|
140
|
+
contains_BLOCKED:
|
|
141
|
+
action: fail
|
|
142
|
+
message: "Guardrails check: BLOCKED — full test suite gate"
|
|
143
|
+
unless_label: "lastlight:bootstrap"
|
|
144
|
+
unless_title_matches: "^(guardrails:|\\[guardrails\\])"
|
|
145
|
+
bypass_message: |
|
|
146
|
+
**Guardrails check: BLOCKED** (full test suite) — but this is a bootstrap task
|
|
147
|
+
(label `lastlight:bootstrap` or "guardrails:" title prefix detected).
|
|
148
|
+
Proceeding with the build cycle. The gate result is in
|
|
149
|
+
`{{issueDir}}/guardrails-report.md`.
|
|
150
|
+
contains_READY:
|
|
151
|
+
action: continue
|
|
152
|
+
messages:
|
|
153
|
+
on_start: "running the full test suite (limit {{gate.timeoutSeconds}}s)…"
|
|
154
|
+
on_skipped_done: "already verified"
|
|
155
|
+
on_success: "READY — full test suite passed — [guardrails-report.md]({{artifactUrl guardrails-report.md}})"
|
|
156
|
+
on_blocked: |
|
|
157
|
+
**Guardrails check: BLOCKED** — the full test suite did not pass.
|
|
158
|
+
|
|
159
|
+
See `{{issueDir}}/guardrails-report.md` for the command, exit code and output tail.
|
|
160
|
+
Fix the suite (or raise `gate.timeoutSeconds` if it timed out), then ask me to build this issue again.
|
|
161
|
+
|
|
65
162
|
- name: architect
|
|
66
163
|
label: Architect
|
|
67
164
|
prompt: prompts/architect.md
|
|
@@ -86,6 +183,7 @@ phases:
|
|
|
86
183
|
skill: building
|
|
87
184
|
model: "{{models.executor}}"
|
|
88
185
|
variant: "{{variants.executor}}"
|
|
186
|
+
timeout_seconds: { from: gate.phaseTimeoutSeconds }
|
|
89
187
|
messages:
|
|
90
188
|
on_start: "implementing the architect's plan…"
|
|
91
189
|
on_skipped_done: "already completed"
|
|
@@ -97,6 +195,8 @@ phases:
|
|
|
97
195
|
skills: [code-review, building]
|
|
98
196
|
model: "{{models.reviewer}}"
|
|
99
197
|
variant: "{{variants.reviewer}}"
|
|
198
|
+
# Bounds each review AND each fix run (the fix re-runs the full suite once).
|
|
199
|
+
timeout_seconds: { from: gate.phaseTimeoutSeconds }
|
|
100
200
|
output_var: review
|
|
101
201
|
loop:
|
|
102
202
|
max_cycles: 2
|
|
@@ -87,11 +87,11 @@ phases:
|
|
|
87
87
|
- "scratch.fixMarkers.diagnosis.class == 'flaky'"
|
|
88
88
|
- "scratch.fixMarkers.diagnosis.class == 'infra-dependent'"
|
|
89
89
|
- "scratch.fixMarkers.diagnosis.class == 'upstream-broken'"
|
|
90
|
-
# Load-bearing: the gate command otherwise inherits
|
|
91
|
-
# which kills any real test suite
|
|
92
|
-
# from the run's repo-clamped `
|
|
93
|
-
# fallback
|
|
94
|
-
timeout_seconds: { from:
|
|
90
|
+
# Load-bearing: the gate command otherwise inherits the short
|
|
91
|
+
# `sandbox.untilBashTimeoutSeconds` default, which kills any real test suite
|
|
92
|
+
# mid-run and reports a false red. Read from the run's repo-clamped `gate:`
|
|
93
|
+
# block; no YAML fallback — a context without it fails loud (issue #385).
|
|
94
|
+
timeout_seconds: { from: gate.timeoutSeconds }
|
|
95
95
|
on_output:
|
|
96
96
|
requires_marker: "CI_FIX_COMPLETE:"
|
|
97
97
|
generic_loop:
|
package/workflows/pr-fix.yaml
CHANGED
|
@@ -30,7 +30,7 @@ phases:
|
|
|
30
30
|
- "scratch.fixMarkers.diagnosis.class == 'flaky'"
|
|
31
31
|
- "scratch.fixMarkers.diagnosis.class == 'infra-dependent'"
|
|
32
32
|
- "scratch.fixMarkers.diagnosis.class == 'upstream-broken'"
|
|
33
|
-
timeout_seconds: { from:
|
|
33
|
+
timeout_seconds: { from: gate.timeoutSeconds }
|
|
34
34
|
on_output:
|
|
35
35
|
requires_marker: "CI_FIX_COMPLETE:"
|
|
36
36
|
generic_loop:
|
package/workflows/pr-review.yaml
CHANGED
|
@@ -50,7 +50,7 @@ phases:
|
|
|
50
50
|
skip_if:
|
|
51
51
|
- "triageEnabled != true"
|
|
52
52
|
- "reviewIsRereview != true"
|
|
53
|
-
timeout_seconds: { from: triageTimeoutSeconds
|
|
53
|
+
timeout_seconds: { from: triageTimeoutSeconds }
|
|
54
54
|
# NO `on_output.requires_marker`, deliberately — see AC2 in
|
|
55
55
|
# `tests/workflows/pr-review-probes.test.ts`: nothing in this workflow may
|
|
56
56
|
# declare an `on_output` action, because a red run posts
|
|
@@ -84,7 +84,7 @@ phases:
|
|
|
84
84
|
- "analysisEnabled != true"
|
|
85
85
|
- "probesEnabled != true"
|
|
86
86
|
- "scratch.reviewTriage.depth == 'light'"
|
|
87
|
-
timeout_seconds: { from: probePhaseTimeoutSeconds
|
|
87
|
+
timeout_seconds: { from: probePhaseTimeoutSeconds }
|
|
88
88
|
command: |
|
|
89
89
|
set -u
|
|
90
90
|
FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
|
|
@@ -120,7 +120,7 @@ phases:
|
|
|
120
120
|
# and a skipped node is not `succeeded`.
|
|
121
121
|
depends_on: [prepare]
|
|
122
122
|
trigger_rule: all_done
|
|
123
|
-
timeout_seconds:
|
|
123
|
+
timeout_seconds: { from: factsTimeoutSeconds }
|
|
124
124
|
command: |
|
|
125
125
|
set -u
|
|
126
126
|
FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
|
|
@@ -168,7 +168,7 @@ phases:
|
|
|
168
168
|
- "scratch.reviewTriage.depth == 'light'"
|
|
169
169
|
depends_on: [facts]
|
|
170
170
|
trigger_rule: all_done
|
|
171
|
-
timeout_seconds:
|
|
171
|
+
timeout_seconds: { from: seedTimeoutSeconds }
|
|
172
172
|
command: |
|
|
173
173
|
set -u
|
|
174
174
|
FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
|
|
@@ -364,7 +364,7 @@ phases:
|
|
|
364
364
|
# `all_done`: the floor must apply even when the adjudicator failed — that
|
|
365
365
|
# is precisely when there is something to repair.
|
|
366
366
|
trigger_rule: all_done
|
|
367
|
-
timeout_seconds:
|
|
367
|
+
timeout_seconds: { from: reconcileTimeoutSeconds }
|
|
368
368
|
command: |
|
|
369
369
|
set -u
|
|
370
370
|
FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
|
|
@@ -14,10 +14,16 @@ commands:
|
|
|
14
14
|
- Use the test/lint/typecheck commands the plan copied from the guardrails
|
|
15
15
|
report — no need to re-open guardrails-report.md unless the plan omitted them.
|
|
16
16
|
|
|
17
|
-
Follow the **building** skill for the mechanics: install dependencies first
|
|
18
|
-
write the failing test before implementing (TDD)
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
Follow the **building** skill for the mechanics: install dependencies first and
|
|
18
|
+
write the failing test before implementing (TDD). Guardrails already proved the
|
|
19
|
+
full suite green before you started, so before committing: run the targeted
|
|
20
|
+
tests for the areas you touched, plus typecheck, lint and build — these must
|
|
21
|
+
pass. Then run the full test suite ONCE with bash `timeout: {{gate.timeoutSeconds}}`, as
|
|
22
|
+
`<full test command> > /tmp/gate.log 2>&1; echo EXIT=$?` — the exit code is the
|
|
23
|
+
verdict; read the log tail only to diagnose a failure. If it times out, record
|
|
24
|
+
"full suite timed out after {{gate.timeoutSeconds}}s" in the summary and carry on
|
|
25
|
+
to publish (CI runs the full suite on the PR). Never re-run it with a larger
|
|
26
|
+
timeout or a different filter.
|
|
21
27
|
|
|
22
28
|
Before committing, also honour the building skill's **decomposition budget** and
|
|
23
29
|
**type-safety** rules: keep functions under ~15 cyclomatic complexity (a
|
|
@@ -27,7 +33,7 @@ to skip a validator the same code defines. If the repo's only test path needs an
|
|
|
27
33
|
unavailable external service, add a runnable unit/CLI test with in-memory
|
|
28
34
|
fixtures rather than declaring the change unverified.
|
|
29
35
|
|
|
30
|
-
AFTER THE GATE
|
|
36
|
+
AFTER THE GATE (targeted tests, typecheck, lint, build green; full suite passed or timed out):
|
|
31
37
|
1. Write {{issueDir}}/executor-summary.md:
|
|
32
38
|
- What was done, files changed
|
|
33
39
|
- Test / lint / typecheck results (paste actual output)
|
package/workflows/prompts/fix.md
CHANGED
|
@@ -7,10 +7,15 @@ Start by reading {{issueDir}}/reviewer-verdict.md — fix ONLY those issues. The
|
|
|
7
7
|
test/lint/typecheck commands are in {{issueDir}}/guardrails-report.md (and the
|
|
8
8
|
architect plan).
|
|
9
9
|
|
|
10
|
-
Follow the **building** skill: run the
|
|
11
|
-
|
|
10
|
+
Follow the **building** skill: before committing, run the targeted tests for what
|
|
11
|
+
you changed plus typecheck, lint and build — these must pass. Then run the full test suite ONCE with bash `timeout: {{gate.timeoutSeconds}}`, as
|
|
12
|
+
`<full test command> > /tmp/gate.log 2>&1; echo EXIT=$?` — the exit code is the
|
|
13
|
+
verdict; read the log tail only to diagnose a failure. If it times out, record
|
|
14
|
+
"full suite timed out after {{gate.timeoutSeconds}}s" in the summary and carry on
|
|
15
|
+
to publish (CI runs the full suite on the PR). Never re-run it with a larger
|
|
16
|
+
timeout or a different filter.
|
|
12
17
|
|
|
13
|
-
AFTER THE GATE
|
|
18
|
+
AFTER THE GATE (targeted tests, typecheck, lint, build green; full suite passed or timed out):
|
|
14
19
|
1. APPEND to {{issueDir}}/executor-summary.md under heading "## Fix Cycle {{fixCycle}}" (what was fixed, test/lint/typecheck results)
|
|
15
20
|
2. Update status.md: current_phase = fix_loop_{{fixCycle}}
|
|
16
21
|
3. Publish with `github_publish` — `{ owner: "{{owner}}", repo: "{{repo}}",
|
|
@@ -7,6 +7,11 @@ CONTRIBUTING.md if present) for project-specific guidance.
|
|
|
7
7
|
THE ISSUE THIS BUILD WILL IMPLEMENT (use it to judge the escape hatch below):
|
|
8
8
|
{{contextSnapshot}}
|
|
9
9
|
|
|
10
|
+
YOUR JOB IS SETUP, NOT THE TEST RUN. Do NOT run the full test suite — not even
|
|
11
|
+
a "representative" subset. The harness runs it right after you, once, under a
|
|
12
|
+
fixed timeout, and judges it by exit code. You install, check typecheck + lint,
|
|
13
|
+
and write down the exact full-suite command for the harness to run.
|
|
14
|
+
|
|
10
15
|
SKIP CHECK — if {{issueDir}}/status.md already exists and contains
|
|
11
16
|
guardrails_status: READY, output "READY — guardrails already verified" and stop.
|
|
12
17
|
|
|
@@ -32,10 +37,10 @@ present, that's fine.** A configured command that FAILS is a blocker. A command
|
|
|
32
37
|
that simply doesn't exist is NOT a blocker.
|
|
33
38
|
|
|
34
39
|
1. **Test Framework** — Does the repo have a test runner (vitest, jest, pytest,
|
|
35
|
-
cargo test, etc.)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
cargo test, etc.) and test files? Identify the FULL test command exactly as
|
|
41
|
+
CI / the contributor docs run it (e.g. `pnpm turbo run test`, `npm test`,
|
|
42
|
+
`pytest`). Do NOT run it. (A repo with no test framework at all is the one
|
|
43
|
+
absent-tooling case that still blocks — there's nothing to verify against.)
|
|
39
44
|
|
|
40
45
|
2. **Linting** — Is a linter configured (eslint, biome, ruff, clippy, etc.)?
|
|
41
46
|
If configured, the lint command MUST pass → a failing lint BLOCKS. If no
|
|
@@ -48,11 +53,32 @@ that simply doesn't exist is NOT a blocker.
|
|
|
48
53
|
|
|
49
54
|
4. **CI Pipeline** (informational only) — Does .github/workflows/ exist with test/lint steps?
|
|
50
55
|
|
|
56
|
+
Give every install/typecheck/lint command `timeout: {{gate.timeoutSeconds}}` and
|
|
57
|
+
judge it by exit code: `<cmd> > /tmp/gate.log 2>&1; echo EXIT=$?` (read the log
|
|
58
|
+
tail only to diagnose). Never re-run a timed-out command with a larger timeout or
|
|
59
|
+
a different filter — a timeout is a failed check.
|
|
60
|
+
|
|
51
61
|
AFTER CHECKING:
|
|
52
62
|
1. mkdir -p {{issueDir}}
|
|
53
|
-
2.
|
|
54
|
-
|
|
55
|
-
|
|
63
|
+
2. Unless you are BLOCKING or this is a bootstrap build, write the gate script
|
|
64
|
+
`.git/lastlight-gate.sh` (inside `.git`, so it is never committed):
|
|
65
|
+
```sh
|
|
66
|
+
#!/usr/bin/env bash
|
|
67
|
+
set -euo pipefail
|
|
68
|
+
<the repo's full test suite command(s), exactly as CI runs them — one per line>
|
|
69
|
+
```
|
|
70
|
+
TESTS ONLY. You already ran lint and typecheck above and failed fast on them —
|
|
71
|
+
do NOT repeat lint, typecheck or build here (the harness would run them twice).
|
|
72
|
+
Several test commands are fine (e.g. one per suite), one per line; plus any
|
|
73
|
+
`cd` they need. No install, no `|| true`, no `| tail`/`grep`, nothing that
|
|
74
|
+
could turn a failing suite into exit 0.
|
|
75
|
+
3. Write {{issueDir}}/guardrails-report.md with the status of each check and the
|
|
76
|
+
full test command you put in the gate script. The harness appends the suite's
|
|
77
|
+
result (exit code, duration, output tail) to this file.
|
|
78
|
+
4. Write {{issueDir}}/status.md with current_phase: guardrails AND
|
|
79
|
+
guardrails_status: GATE_PENDING (setup ok), BOOTSTRAP, or BLOCKED. Never write
|
|
80
|
+
READY — only the harness's full-suite run can.
|
|
81
|
+
{{#if !externalizeArtifacts}}5. `github_publish` with `{ owner: "{{owner}}", repo: "{{repo}}", message: "docs: guardrails check for #{{issueNumber}}", include: [".lastlight"] }` — one signed commit of `.lastlight/` only, so the dependency install you just ran does not ride along. It also creates the branch on GitHub if it isn't there yet. Write the report and status file first: with nothing under `.lastlight/` it reports `published: false` and creates no branch.{{/if}}{{#if externalizeArtifacts}}5. Do NOT git add or commit {{issueDir}}/ — the harness persists it to the Last Light server automatically.{{/if}}
|
|
56
82
|
|
|
57
83
|
ESCAPE HATCH — bootstrap tasks (CHECK THIS FIRST):
|
|
58
84
|
If THE ISSUE ABOVE is itself asking to ADD the tooling you're checking for —
|
|
@@ -63,15 +89,15 @@ point of the build is to create it. In that case:
|
|
|
63
89
|
- In guardrails-report.md, mark this a BOOTSTRAP build: list what's missing and
|
|
64
90
|
state that the executor must ESTABLISH this tooling as the task — there are no
|
|
65
91
|
existing test/lint/typecheck commands to rely on yet.
|
|
66
|
-
- Write guardrails_status:
|
|
67
|
-
|
|
92
|
+
- Write guardrails_status: BOOTSTRAP and OUTPUT: BOOTSTRAP so the build proceeds
|
|
93
|
+
(the harness skips the suite run for a bootstrap build).
|
|
68
94
|
This applies even when there is no `lastlight:bootstrap` label and the title has
|
|
69
95
|
no `guardrails:` prefix — judge it from the issue's intent.
|
|
70
96
|
|
|
71
97
|
Otherwise (the issue is normal feature/bug work, not about adding tooling):
|
|
72
98
|
|
|
73
99
|
Apply the present-must-pass rule. BLOCK if ANY of these hold:
|
|
74
|
-
- there is no test framework at all
|
|
100
|
+
- there is no test framework at all;
|
|
75
101
|
- a linter IS configured but the lint command fails;
|
|
76
102
|
- type checking IS configured but the typecheck command fails;
|
|
77
103
|
- the dependency install itself failed.
|
|
@@ -90,6 +116,7 @@ IF A BLOCKING CONDITION ABOVE HOLDS:
|
|
|
90
116
|
- OUTPUT must include: BLOCKED
|
|
91
117
|
|
|
92
118
|
OTHERWISE — every check that EXISTS passes (absent lint/typecheck is fine):
|
|
93
|
-
- OUTPUT must include:
|
|
119
|
+
- OUTPUT must include: GATE_PENDING (the harness now runs the full suite)
|
|
94
120
|
|
|
95
|
-
OUTPUT: Exactly one of
|
|
121
|
+
OUTPUT: Exactly one of GATE_PENDING, BOOTSTRAP or BLOCKED, followed by a brief
|
|
122
|
+
summary. Do not use the word "blocked" anywhere unless you are blocking.
|