empirical-sdd 0.36.0 → 0.37.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/CHANGELOG.md CHANGED
@@ -8,10 +8,324 @@ under the alpha rules in [docs/versioning.md](docs/versioning.md).
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.37.0] - 2026-09-18
12
+
13
+ ### Added
14
+
15
+ - Repository identity now follows the root of HEAD's first-parent history,
16
+ so full clones can recognize the same durable artifacts. The original
17
+ checkout still accepts its old path-derived id; a reviewed
18
+ `.empirical/identity.json` can declare verified earlier ids for other clones.
19
+ Shallow clones retain a path identity until their full history is available.
20
+ - A clone with an absent local capability claim can select and verify its
21
+ feature. Integrate refuses with `CAPABILITY_CLAIM_UNREACHABLE` when the
22
+ comparison base is unavailable; locks, delegation and ownership transfers
23
+ remain restricted to linked worktrees of one checkout. Legacy authorization
24
+ and delivery/publication markers retain their original identity bindings.
25
+
26
+ - A timed-out verification command now shows its way out. The status card marks the check with `timedOutAfterMs` and adds a decision naming the exits: run it in the background, use a smaller command, hand it to PR CI, raise `timeoutMs` up to the maximum, or stop. The agent is told to offer them instead of rerunning the same command in the foreground, and to suggest the background run before long runs.
27
+
28
+ - Verification progress now reports where the feature stands and whether each
29
+ command passed. QA execution and independent integration replay carry the
30
+ phase and its 1-based position in the feature's phase order
31
+ (`phase 6/8 verify`), derived from the same order the roadmap reports —
32
+ including the review-first Complex order — and their closing heartbeat marks
33
+ `finished: passed` or `finished: failed` alongside the existing exit code,
34
+ timeout and signal detail. Hosts holding a `progressToken` receive the same
35
+ facts in the progress message text, with only the standard notification
36
+ fields. The receipt still decides what a run proves, a timeout or signal is
37
+ never marked passed, and no argv, environment value or child output enters the
38
+ progress channel.
39
+
40
+ - Verify proof no longer goes stale for line-ending-only changes, and human QA
41
+ records can bind the paths they assessed. (SDD-84)
42
+ - **Line endings:** QA receipts record `textTreeDigest` (CRLF normalized to
43
+ LF in text files). At the Verify gate and on the status card, a receipt
44
+ below full CI survives a CRLF-only change. Scoped digests normalize too.
45
+ Promotion and full-CI proof stay byte-exact.
46
+ - **Human records:** `qa-record` accepts `assessedPaths`, so a human record
47
+ survives changes outside what it assessed.
48
+ - **Recorded scope:** an executed receipt's recorded scope must still match
49
+ the current policy command's scope and kind.
50
+ - **Scope matching:** entries are NFC-normalized, repeated `**` collapses,
51
+ and `workspace:../path` resolves by directory first.
52
+
53
+ - After a recorded review, the next local review is a delta re-review. (SDD-85)
54
+ - **What the reviewer sees:** the packet carries `reReview`: the diff since
55
+ the previous reviewed head, the previous canonical review, the findings still
56
+ open, and the non-blocking findings already deferred.
57
+ - **Finding ids:** the reviewer repeats ids that are still open and omits fixed
58
+ ones. Triage reports `findingHistory` with each id as open, fixed, deferred
59
+ or new.
60
+ - **Full review instead:** used when the base moved, the previous head is not
61
+ a merge-free ancestor of HEAD, or the criteria, decisions or amendments
62
+ changed.
63
+ - **Gate check:** the gate rebuilds the same packet from the recorded context
64
+ and refuses a context that no longer matches its stored result.
65
+ - **Pull request body:** deferred findings carried from earlier rounds still
66
+ appear there.
67
+
68
+ - New Complex and promoted Fast features run Review before Verify. Saved
69
+ features retain their original order; Verify preserves and revalidates the
70
+ independent review before advancing to Integrate.
71
+ - Review results may carry structured findings with a severity and a category.
72
+ - Critical, high, security and acceptance findings block, and an approval
73
+ can't carry one.
74
+ - The recorded review returns `triage` with the round and the exits:
75
+ fix (with the Verify checks it re-runs and their estimates), defer
76
+ non-blocking findings to a ticket, open a draft pull request for CI, or
77
+ stop.
78
+ - After the review round limit, the exits must be offered instead of
79
+ another automatic lap.
80
+ - `empirical_review_defer` (`__internal review-defer`) records deferrals.
81
+ - Deliver lists every non-blocking finding and its deferral in the pull
82
+ request body. (SDD-86)
83
+
84
+ - Verification commands may declare `scope: "workspace"` to derive their
85
+ Verify-gate QA receipt scope from the pnpm, npm, yarn, bun or Turbo workspace
86
+ package graph: the target package plus its transitive workspace
87
+ dependencies. The scope is derived again at validation and a changed graph
88
+ makes the receipt stale; ambiguous targets bind the whole tree and record a
89
+ `SCOPE_WORKSPACE_UNRESOLVED` reason.
90
+ - Background verification jobs: `empirical_qa_start`, `empirical_qa_status` and
91
+ `empirical_qa_cancel` (with `__internal qa-start`, `qa-status` and
92
+ `qa-cancel`) run a matrix-authorized command in a detached snapshot worktree
93
+ of the committed `HEAD`, so agents keep working. Jobs are durable records
94
+ under the Git common directory, run one at a time per repository, record a
95
+ normal QA receipt bound to the job commit, report `stale` when the feature
96
+ revision or source tree moves, and always remove their snapshot.
97
+ - Background jobs stream a bounded, redacted live log, record the failing test
98
+ files named by bun, node `--test` and vitest/jest output, and accept
99
+ `testFiles` to rerun only tracked test files through a `testFiles: "changed"`
100
+ command. Roadmaps list recent jobs with stable fields, the CLI status card
101
+ adds a `Regression:` line, and managed skills ask for approval before a
102
+ full regression without CI, run it in the background and keep working.
103
+
104
+ - `empirical_sync_target` (`__internal sync-target [--fetch] [--target <ref>]`)
105
+ keeps a feature branch current with its target: it predicts conflicts with
106
+ `git merge-tree`, merges only when the worktree is clean and conflict-free,
107
+ never rebases, forces or pushes, and otherwise changes nothing and reports the
108
+ conflicting files.
109
+ - The roadmap adds a `decision` waiting item and a sync `nextAction` when the
110
+ branch is behind its target with predicted conflicts or by more than
111
+ `staleness.maxBehind` commits (default 10), read from local refs only. The
112
+ optional `staleness` configuration never blocks a gate.
113
+ - Managed skills sync with the target at every checkpoint and before opening or
114
+ updating a pull request, and re-run only the tests for conflicted files.
115
+ - Size guardrail: Complex features over 6 acceptance criteria or 2
116
+ capabilities in Specify through Implement carry `featureSize`, a non-blocking
117
+ roadmap decision and a `nextAction` proposing slices. `empirical_split_decision`
118
+ records keep (reason required) or split at the exact revision, limits are
119
+ configurable with `sizeGuardrail`, and the skill presents the split option
120
+ before implementing.
121
+ - Time budget and checkpoints: roadmaps carry `time` (`elapsedMs`,
122
+ `phaseElapsedMs`, `budgetMs`, `over`) derived from journal timestamps, and
123
+ the status card shows a `Time:` line. An optional per-lane `budget` in
124
+ `.empirical/config.json` defaults to Fast 30, Quick 60 and Complex 120
125
+ minutes; invalid values fail with `INVALID_CONFIG`. An exceeded budget, or
126
+ Review sending work back to Implement, adds a decision checkpoint with
127
+ explicit exits, and `empirical_checkpoint` records the choice to continue
128
+ with more minutes. The generated skill never continues past an exceeded
129
+ budget without the user's choice.
130
+ - `empirical_qa_plan` returns a Verify `selection` beside the unchanged matrix:
131
+ one command per automated Verify check, chosen as a deterministic
132
+ minimum-cost cover (fewest unknown estimates, lowest summed median duration,
133
+ fewest commands, earliest policy order) with per-entry `estimateMs`,
134
+ `sharedWith` and `reason`. Full-CI commands are never candidates, and
135
+ changed-file commands only when a changed test file matches. Profile plans mark
136
+ `selected` entries, roadmap Verify checks name `selectedCommandId`, and
137
+ `nextAction` runs the selected command once for every check it covers.
138
+ - Local full-suite runs need an explicit, immutable approval bound to the
139
+ feature, revision, commit, tree, policy, command, argv and shown estimate.
140
+ `empirical_qa_approve` (private `qa-approve --revision --command --estimate-ms
141
+ [--yes]`) records it, asking through MCP form elicitation when the host
142
+ advertises elicitation and otherwise marking it `agent-relayed`; the CLI marks
143
+ `cli` or `cli-unattended`. Each approval authorizes one run. Publish's explicit
144
+ publication authorization, passed to `empirical_qa_execute` as
145
+ `publicationAuthorization`, approves Publish's own full-CI run.
146
+ - A deterministic `promotionRoute` (`ci` or `local` with every reason) on the
147
+ roadmap's full-CI check; route `local` shows one authorization item with the
148
+ command, estimate, revision and first reason.
149
+
150
+ ### Changed
151
+
152
+ - Raised the verification command timeout ceiling from 15 to 45 minutes, in the
153
+ runtime bound, both Policy v2 command schemas and the benchmark harness, so a
154
+ long complete suite is no longer killed mid-run. Projects opt in by raising a
155
+ command's `timeoutMs`; this repository's own policy moves after the release,
156
+ because published 0.36.0 and earlier versions, and early 0.37.0 preview
157
+ builds, reject timeouts above 15 minutes.
158
+
159
+ - Generated agent guidance now ships early: open a draft pull request at the
160
+ first coherent commit of feature work, push every commit, and never let test
161
+ runs block commits or pushes. Tests for the change run in the background and
162
+ heavy runs belong to pull-request CI. Push authority covers only the agent's
163
+ own feature branch and draft pull requests, never merges, protected or target
164
+ branches, or force pushes. Implement instructions carry the same rule.
165
+ - An omitted `promotion.fullCi` now means `auto`: pull-request CI with pinned
166
+ required checks proves full CI at Deliver unless an SDD-67 local-forcing reason
167
+ applies, and otherwise the full suite runs locally after approval. The digest
168
+ of an unchanged policy is kept; an explicit `local` is now kept in the parsed
169
+ policy (one digest change) and always runs locally. `remote-checks` is unchanged.
170
+ - A fresh `empirical_qa_execute` or `empirical_evidence_execute` full-CI run
171
+ refuses with `FULL_SUITE_APPROVAL_REQUIRED` before starting without a matching
172
+ approval; receipt reuse needs none.
173
+ - Integrate on `auto`'s route `ci` needs no full-CI receipt and records the
174
+ route in its integration receipt. Independent replay never executes full CI
175
+ and runs only the Verify selection (every bare non-full-CI command when the
176
+ feature changed verification configuration); `integrationReplayCommands`
177
+ plans replay (`integrationReplayPlan` stays as a deprecated export), and a
178
+ policy with only full-CI commands replays nothing with a plan note.
179
+ - Route `ci` also needs delivery authority (`DELIVERY_NOT_AUTHORIZED` otherwise),
180
+ lifecycle observation refuses full-CI commands, and per-command estimates match
181
+ a bare command's exact argv only.
182
+ - Under `auto`, Deliver may push and open the source pull request before proof,
183
+ returns `promotion-proof-required` with `route: "ci"` until the exact head is
184
+ green, and switches to `route: "local"` with the pending approval when remote
185
+ proof is ineligible; it merges nothing before proof.
186
+ - Skill guidance, Verify, consolidation, Integrate, Deliver and Publish
187
+ instructions state that iterating runs nothing, "run the changed tests" runs
188
+ `iterate` once, Verify runs the selection, the full suite runs only as PR CI or
189
+ an approved local run, and agents never approve on the user's behalf.
190
+
191
+ ### Fixed
192
+
193
+ - A source change after an approved review returns `REVIEW_STALE` before
194
+ validating Verify receipts, including when the collected review's tree is stale.
195
+ - Workspace scope inference refuses every spelling of npm's
196
+ `--include-workspace-root` flag, including `=true`, so root tests and source
197
+ remain bound by whole-tree evidence.
198
+
199
+ - Scoped QA receipts recorded by a passing Verify gate remain valid Verify
200
+ evidence through later phases. Review artifacts and promotion proof retain
201
+ exact tree binding; an unrelated edit no longer forces another repair lap.
202
+ - Background log callback declarations use portable byte arrays so packed
203
+ consumers do not require ambient Node `Buffer` types.
204
+ - Split guidance now provides an executable early exit: explicit contract
205
+ revision returns Design or Plan to Specify while retaining the approved
206
+ contract; unapproved Specify work can be narrowed directly. No migration
207
+ required; existing state and receipts retain their schema.
208
+ - Verify command selection respects each command's criterion allowlist; a
209
+ cheaper partial command never displaces a command that can satisfy the check.
210
+ - Background jobs retain their originating checkout, feature, command arguments
211
+ and policy/matrix bindings. A changed policy cannot certify an older command;
212
+ cancellation terminates the detached test process before snapshot cleanup.
213
+ Older queued jobs without execution bindings fail `JOB_STALE` and must be
214
+ restarted; no durable feature-state migration is required.
215
+ - Canonical review failure transitions use triage's recorded-review count and
216
+ round-limit boundary; earlier Verify failures no longer exhaust the first
217
+ review repair. Existing review history is honored without a state migration.
218
+ - Command timeouts now terminate POSIX process groups, attempt Windows process
219
+ tree termination, and bound output cleanup so inherited pipes cannot leave QA
220
+ waiting indefinitely. Timeout receipts remain non-passing even when a wrapper
221
+ exits successfully during termination.
222
+ - Bounded command logs now retain the final output after noisy setup, and
223
+ verification progress reports timeout, signal and exit status on completion.
224
+ - QA reports preparation, command execution, finalization and receipt-reuse
225
+ timings separately. MCP clients requesting progress receive phase updates,
226
+ and the final diagnostic timing summary lives in result metadata, outside the
227
+ immutable receipt.
228
+ - QA skips a second dependency fingerprint when the initial fingerprint is
229
+ unavailable or the command failed, timed out or was cancelled. Such receipts
230
+ remain ineligible for reuse. Invalid retry history is rejected before running
231
+ another command and checked again after execution.
232
+ - Ready-to-close guidance no longer runs full CI during consolidation. Final
233
+ verification profile plans omit commands covering promotion checks such as
234
+ `qa-full-ci`. Full CI follows the approved local or eligible remote promotion
235
+ route instead of being repeated during Verify and integration replay.
236
+ - Verification profile plans list each executable command once with the
237
+ `coveredCheckIds` a single run covers, so a command declared for two checks
238
+ is no longer run twice.
239
+ - A Done Fast feature that is implemented and not integrated accepts on-demand
240
+ optional checks again: `qa-plan`, `qa-execute`, `evidence-execute` and
241
+ `evidence-collect` take its explicit `id`, refused before migration for any
242
+ other feature. Evidence execution for it needs an explicit profile. Receipts
243
+ stay optional and the completion level does not change.
244
+ - Stale evidence receipts refused by `complete` or `reuseReceiptId`, including
245
+ future revisions, another GitHub repository, unknown matrix checks and
246
+ modified artifacts, return `RECEIPT_STALE` with the receipt id and the changed
247
+ binding instead of `UNEXPECTED`.
248
+ - Empty or whitespace-only Context pages are refinement-required, so the
249
+ Context gate no longer passes them.
250
+ - At Verify, `verify` evaluates the active feature's valid on-disk receipts the
251
+ way the completion gate would, so it no longer lists them as missing before
252
+ `complete`. Full-CI, remote-checks and review receipts, and every later gate,
253
+ stay recorded-only.
254
+ - Review refuses an empty committed diff with `REVIEW_DIFF_EMPTY` and keeps
255
+ committed evidence receipts and journal events out of the reviewed diff. The
256
+ diff spans the whole Git worktree when the project is nested in it. Reviews
257
+ recorded under the previous diff must be requested again.
258
+ - A malformed review submission, including one wrapped in a `submission`
259
+ property, returns `INVALID_ARGUMENT` instead of crashing.
260
+ - Doctor recommends `core.longpaths=true` for a Git repository on Windows
261
+ (`GIT_LONGPATHS_DISABLED`), because generated evidence receipt paths can
262
+ exceed Git's Windows path limit.
263
+
264
+ ### Migration
265
+
266
+ - Upgrade to `empirical-sdd@0.37.0`, refresh managed repository/global agent
267
+ skills through Empirical integrations, and restart or reconnect MCP clients
268
+ so they discover the new tools and guidance. Upgrading the package alone does
269
+ not rewrite installed skills or refresh a running server.
270
+ - For delta re-review, pass the returned `reReview` context to the isolated
271
+ reviewer, including the previous verdict and open/deferred findings. Keep the
272
+ ids of still-open findings. Prepare a new packet if deferrals change while a
273
+ review is pending; changed bases, merge history or contracts need a full review.
274
+ - New Verify QA receipts normalize CRLF in ordinary text. Older scoped receipts
275
+ made on a CRLF checkout may become stale and must be rerun. Human records can
276
+ opt into `assessedPaths`; that scope exception applies during Verify only.
277
+ Review and full-CI/promotion proof retain exact binding. See the documented
278
+ line-ending limitations in `docs/protocol.md` when tests depend on text bytes.
279
+ - Keep existing Schema 5 state and receipts; do not reinitialize projects or
280
+ edit evidence to migrate them. New Complex and promoted Fast features record
281
+ `reviewFirst: true`; existing features without that field keep Verify before
282
+ Review. Clients must follow the returned phase and roadmap instead of assuming
283
+ one global order.
284
+ - If every full-suite run must remain local, explicitly configure
285
+ `promotion.fullCi: "local"` in the project policy. An omitted setting now uses
286
+ `auto`, which accepts CI only with eligible pinned required checks and delivery
287
+ authority, otherwise requiring a local run. Each fresh local full-suite run
288
+ needs a separate explicit approval bound to the displayed candidate and
289
+ command; delivery authority alone does not approve it.
290
+ - Re-run checks or obtain a fresh review when Empirical reports stale proof.
291
+ Explicit `local` normalization can change the policy digest once, and the
292
+ review diff now excludes receipts and journal events. Do not rewrite receipt
293
+ bindings to preserve old approvals.
294
+ - To use workspace-derived Verify reuse, opt in with `scope: "workspace"` only
295
+ for commands whose target/dependency graph is resolvable. Commands without a
296
+ scope still bind the whole tree; global inputs always bind, and independent
297
+ review and full-CI promotion proof remain exact.
298
+ - Restart any preview-era background jobs that report `JOB_STALE` because they
299
+ lack the new execution bindings. Existing feature state needs no rewrite.
300
+ - Treat `roadmap.time` as a live clock when comparing status responses; compare
301
+ durable action fields separately. Respect the budget checkpoint and explicit
302
+ continue/split/defer/stop choices returned by the updated guidance.
303
+ - Upgrade every CLI/MCP host before setting command `timeoutMs` above 900000.
304
+ The new ceiling is 2700000 (45 minutes); existing configured limits stay as
305
+ configured. A policy change invalidates its old proof and needs a new approved
306
+ run. Progress consumers should use the returned phase and outcome; MCP keeps
307
+ standard notification fields and carries the extra facts in message text.
308
+ - Before moving legacy evidence to another clone, use a full-history checkout
309
+ (unshallow it first when needed). Use the lineage id from post-upgrade receipt
310
+ provenance and only verified prior ids from that repository's older receipts
311
+ to prepare and review `.empirical/identity.json`, following the format in
312
+ `docs/protocol.md`. Commit the record before relying on it in another clone;
313
+ never admit an unknown id just to make validation pass. Existing local path
314
+ identities remain recognized in their original checkout.
315
+ - A missing capability claim does not contain a recoverable comparison base.
316
+ Perform integration from the owning checkout or explicitly transfer to one of
317
+ its linked worktrees; do not invent a base or copy Git-private claim state to
318
+ simulate cross-machine ownership.
319
+
11
320
  ## [0.36.0] - 2026-09-16
12
321
 
13
322
  ### Added
14
323
 
324
+ - Verification commands may declare an optional `scope` of repository-relative
325
+ path prefixes or simple globs. Their Complex Verify-gate QA receipts record a
326
+ scoped content digest and stay valid when only files outside the scope and
327
+ global configuration change. Full-CI commands refuse `scope`, and promotion,
328
+ remote-checks, review, human and collected evidence keep whole-tree binding.
15
329
  - Added the empirical-init **Track every change** ticket preset. It expands the
16
330
  complete feature/fix/chore by Fast/Quick/Complex matrix to `required`, shows
17
331
  that matrix before setup is saved, and applies the existing strict tracker
@@ -808,7 +1122,8 @@ Published through GitHub Actions trusted publishing with npm provenance.
808
1122
 
809
1123
  - Prepared and released package version `0.20.2`.
810
1124
 
811
- [Unreleased]: https://github.com/goempirical/empirical-sdd/compare/v0.36.0...HEAD
1125
+ [Unreleased]: https://github.com/goempirical/empirical-sdd/compare/v0.37.0...HEAD
1126
+ [0.37.0]: https://github.com/goempirical/empirical-sdd/compare/v0.36.0...v0.37.0
812
1127
  [0.36.0]: https://github.com/goempirical/empirical-sdd/compare/v0.35.0...v0.36.0
813
1128
  [0.35.0]: https://github.com/goempirical/empirical-sdd/compare/v0.34.0...v0.35.0
814
1129
  [0.34.0]: https://github.com/goempirical/empirical-sdd/compare/v0.33.0...v0.34.0
package/README.md CHANGED
@@ -92,9 +92,13 @@ Implement → Done (implemented; verification skipped)
92
92
  Complex:
93
93
 
94
94
  ```text
95
- Specify → Design → Plan → Implement → Context? → VerifyReview → Integrate
95
+ Specify → Design → Plan → Implement → Context? → ReviewVerify → Integrate
96
96
  ```
97
97
 
98
+ Existing features retain their saved Verify-before-Review order. New Complex
99
+ features and promoted Fast features review first; changing reviewed code requires
100
+ another review before Verify can finish.
101
+
98
102
  A Complex feature that shows an interface gets its mockup at Specify when the
99
103
  saved mockup preference is enabled. The contract is still open: seeing a screen
100
104
  reveals states and flows that prose misses and those belong in the criteria.
@@ -142,8 +146,17 @@ Next: Run qa-unit at revision 5 (~2m 10s) when you request tests
142
146
  Waiting on you: [test-request] Ask to run 1 check (~2m 10s), or keep iterating
143
147
  [environment] qa-browser needs isolated-consumer
144
148
  Verification: 2 of 4 checks left (~2m 10s known; 1 unknown)
149
+ Time: 1h 12m of 2h budget
145
150
  ```
146
151
 
152
+ Work does not run silently for hours. Elapsed time comes from the feature's
153
+ journal and is measured against a per-lane budget (defaults: Fast 30, Quick 60,
154
+ Complex 120 minutes; override with `"budget": { "fast": 45 }` in
155
+ `.empirical/config.json`). Past the budget, or when Review sends work back to
156
+ Implement, the card stops at a checkpoint and offers explicit exits: ship as
157
+ is with a draft PR, split, defer non-blocking findings, continue with a new
158
+ budget (`empirical_checkpoint`), or stop.
159
+
147
160
  `empirical status`, `explain`, `next` and `loop` print it, `--json` carries the
148
161
  same `roadmap`, and the agent skill shows it at every start, phase change and
149
162
  stop, and before a long run it estimates and offers to defer. The card reports
@@ -166,21 +179,42 @@ A team can set `defaultMode` to `direct` in `.empirical/config.json`, and each
166
179
  developer can override it for their own checkout; explicit Fast, Complex or
167
180
  "use Empirical" requests always start those lanes.
168
181
 
182
+ ## Keep features small
183
+
184
+ When a Complex feature grows past 6 acceptance criteria or 2 capabilities, the
185
+ status card asks whether to split it into independently shippable slices, each
186
+ with its own draft PR, or keep it as one with a recorded reason. The question
187
+ never blocks a gate; tune or disable it with `sizeGuardrail` in
188
+ `.empirical/config.json`.
189
+
169
190
  ## Run tests when you need them
170
191
 
171
192
  Fast and Complex iteration do not automatically run tests after edits. Ask for a
172
193
  run when ready:
173
194
 
174
- - “Run the changed tests” or “run the affected tests” uses the `iterate`
175
- verification profile: only commands configured with `testFiles: "changed"`.
176
- - “Now run it”, “run everything” or “ready to close” uses the `final` profile.
195
+ - “Run the changed tests” or “run the affected tests” runs the `iterate`
196
+ verification profile once: only commands configured with `testFiles: "changed"`.
197
+ - “Now run it”, “run everything” or “ready to close” uses the `final` profile,
198
+ which runs only the Verify selection: one cheapest configured command per
199
+ Verify check, never full CI.
177
200
  - “Keep iterating; skip tests for now” leaves verification pending.
178
201
 
179
202
  One test request does not enable automatic reruns after subsequent changes, and
180
- no phase, iteration or consolidation runs tests by itself. One exact full-CI
181
- receipt recorded at Integrate also serves Deliver when nothing changed, and a
182
- repository can opt into `promotion.fullCi: "remote-checks"` so passing GitHub
183
- required checks on the exact pushed commit stand in for local full CI.
203
+ no phase, iteration or consolidation runs tests by itself. The full suite runs
204
+ once, at the very end. By default (`promotion.fullCi` omitted, which means
205
+ `auto`) it runs as pull-request CI when the repository's GitHub delivery pins
206
+ required checks and no SDD-67 local-forcing reason applies; Deliver merges
207
+ nothing until those checks pass on the exact head. Otherwise it runs locally,
208
+ only after you approve that exact run (command, revision and estimate), and one
209
+ exact full-CI receipt recorded at Integrate also serves Deliver when nothing
210
+ changed. Agents never approve on your behalf; Publish's explicit publication
211
+ authorization is the approval for its own full-CI run. An explicit
212
+ `promotion.fullCi: "local"` always runs locally, and `"remote-checks"` keeps
213
+ remote proof without a local fallback.
214
+ A focused command can declare a `scope` of paths so an edit elsewhere does not
215
+ invalidate its Verify receipt; global configuration (policy, manifests,
216
+ lockfiles, workflows, argv-named files) always invalidates it, and full CI and
217
+ promotion proof are never scoped. See [docs/mcp.md](docs/mcp.md).
184
218
  If no focused command is configured, the agent reports the gap instead of
185
219
  silently running the entire suite. Complex still requires real evidence before
186
220
  claiming verified completion; Fast can finish implemented and unverified.
@@ -188,6 +222,24 @@ Explicit final verification or promotion requests include their required checks,
188
222
  and CI/release gates remain enforced. An explicit no-tests request takes
189
223
  precedence over execution and leaves any conflicting gate pending.
190
224
 
225
+ Long local runs can go to the background: `empirical_qa_start` runs the command
226
+ in a snapshot worktree of the committed `HEAD` and returns a job id immediately,
227
+ `empirical_qa_status` reports progress and the receipt, and `empirical_qa_cancel`
228
+ stops it. See [MCP usage](docs/mcp.md#background-verification-jobs).
229
+ When CI is not available, agents ask before a full regression at the end, run
230
+ it in the background with your approval, keep working, and rerun only the
231
+ failing test files if it fails.
232
+
233
+ ### Ship early
234
+
235
+ Agents open a draft pull request at the first coherent commit of feature work
236
+ and push every commit. Commits and pushes never wait on tests: the change's
237
+ tests run in the background while work continues, and heavy or full-suite runs
238
+ belong to pull-request CI unless you approve a local run. This authority covers
239
+ only the agent's own feature branch and draft pull requests; agents never merge,
240
+ never push to protected or target branches, and never force push. Without a
241
+ remote or `gh`, the agent says so and continues locally.
242
+
191
243
  Existing repositories need their managed skills refreshed with `empirical-init`
192
244
  and a restarted agent session after upgrading to receive this guidance.
193
245
 
@@ -297,6 +349,12 @@ worktree created by another tool or `git worktree add`, your agent previews and
297
349
  applies Empirical prepare to fill in the missing files.
298
350
  See [local environment files](docs/protocol.md#local-environment-files-in-worktrees).
299
351
 
352
+ Long-lived branches drift. The status card flags a branch that is behind its
353
+ target with predicted conflicts or by more than 10 commits, and your agent syncs
354
+ at each checkpoint: Empirical merges the target only when it is clean and
355
+ conflict-free, never rebases or force-pushes, and names conflicting files right
356
+ away. See [staying current](docs/mcp.md#stay-current-with-the-target-branch).
357
+
300
358
  Ask your agent for the read-only overview to see specs, owners, branches,
301
359
  profiles, progress and verification status together. Unrelated malformed records
302
360
  appear as local diagnostics without selecting or deleting any spec. Independent
@@ -1,3 +1,4 @@
1
+ export declare const TEST_FILE: RegExp;
1
2
  /** Paths changed on this branch since `base`, plus uncommitted and untracked work. */
2
3
  export declare function changedPaths(root: string, base: string | null): string[];
3
4
  /**
@@ -16,3 +17,17 @@ export declare function resolveCommandArgv(root: string, command: {
16
17
  cwd: string;
17
18
  testFiles?: "changed" | undefined;
18
19
  }, base: string | null): string[];
20
+ /**
21
+ * The argv for an explicit rerun of named test files, such as a failed job's
22
+ * failing files. Only `testFiles: "changed"` commands accept file arguments,
23
+ * and every file must be a tracked, existing test file of this repository.
24
+ */
25
+ export declare function resolveExplicitTestArgv(root: string, command: {
26
+ id: string;
27
+ argv: readonly string[];
28
+ cwd: string;
29
+ testFiles?: "changed" | undefined;
30
+ }, files: readonly unknown[]): {
31
+ argv: string[];
32
+ files: string[];
33
+ };