mandrel 2.100.0 → 2.102.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.
Files changed (47) hide show
  1. package/.agents/agents/story-worker.md +7 -1
  2. package/.agents/audit-checklists/resilience.md +40 -0
  3. package/.agents/audit-checklists/sre.md +2 -4
  4. package/.agents/docs/agentrc-reference.json +3 -0
  5. package/.agents/docs/configuration.md +3 -0
  6. package/.agents/docs/workflows.md +2 -1
  7. package/.agents/rules/ci-remediation.md +8 -0
  8. package/.agents/schemas/agentrc.schema.json +26 -0
  9. package/.agents/schemas/audit-rules.json +44 -2
  10. package/.agents/schemas/audit-rules.schema.json +2 -2
  11. package/.agents/schemas/story-deliver-terminal.schema.json +17 -3
  12. package/.agents/schemas/validation-evidence.schema.json +10 -0
  13. package/.agents/scripts/lib/audit-suite/selector.js +80 -1
  14. package/.agents/scripts/lib/audit-to-stories/audit-lenses.js +1 -0
  15. package/.agents/scripts/lib/close-lock-events.js +18 -5
  16. package/.agents/scripts/lib/close-validation/gates.js +6 -1
  17. package/.agents/scripts/lib/close-validation/runner.js +10 -11
  18. package/.agents/scripts/lib/close-validation/test-delta.js +124 -0
  19. package/.agents/scripts/lib/config/pull-request.js +25 -0
  20. package/.agents/scripts/lib/config-settings-schema-delivery.js +22 -0
  21. package/.agents/scripts/lib/config-settings-schema.js +5 -0
  22. package/.agents/scripts/lib/coverage-capture-delta.js +2 -1
  23. package/.agents/scripts/lib/generated/agentrc-validator.js +2 -2
  24. package/.agents/scripts/lib/git/sync-from-base.js +4 -2
  25. package/.agents/scripts/lib/orchestration/ci-red-handling.js +4 -3
  26. package/.agents/scripts/lib/orchestration/ci-rerun-guard.js +81 -25
  27. package/.agents/scripts/lib/orchestration/handoff-state.js +41 -0
  28. package/.agents/scripts/lib/orchestration/review-providers/code-review.js +97 -28
  29. package/.agents/scripts/lib/orchestration/single-story-close/phases/base-sync.js +7 -0
  30. package/.agents/scripts/lib/orchestration/single-story-close/phases/close-validation.js +22 -4
  31. package/.agents/scripts/lib/orchestration/single-story-close/phases/confirm-merge.js +104 -57
  32. package/.agents/scripts/lib/orchestration/single-story-close/phases/merge-wait-recovery.js +16 -16
  33. package/.agents/scripts/lib/orchestration/single-story-close/phases/normalize-pr-title.js +28 -13
  34. package/.agents/scripts/lib/orchestration/single-story-close/phases/open-pr.js +1 -0
  35. package/.agents/scripts/lib/orchestration/single-story-close/phases/pr-body-trailers.js +38 -0
  36. package/.agents/scripts/lib/orchestration/single-story-close/phases/pre-push.js +24 -16
  37. package/.agents/scripts/lib/orchestration/single-story-close/phases/pull-request.js +18 -7
  38. package/.agents/scripts/lib/orchestration/single-story-close/runner.js +60 -34
  39. package/.agents/scripts/lib/orchestration/story-deliver-terminal.js +1 -1
  40. package/.agents/scripts/lib/orchestration/story-handoff.js +36 -9
  41. package/.agents/scripts/lib/test-run-credit.js +26 -0
  42. package/.agents/scripts/lib/validation-evidence.js +6 -0
  43. package/.agents/workflows/audit-resilience.md +290 -0
  44. package/.agents/workflows/audit-sre.md +12 -21
  45. package/.agents/workflows/helpers/deliver-reference.md +28 -1
  46. package/docs/CHANGELOG.md +25 -0
  47. package/package.json +1 -1
@@ -6,8 +6,7 @@ description: "Audit production-readiness for a release candidate: SLOs, observab
6
6
 
7
7
  You are a Senior SRE & Lead Developer running an operational-readiness audit for
8
8
  a production release candidate — rollback & recovery paths, observability &
9
- instrumentation, resilience & failure handling, and runbooks & operational
10
- docs. The shared lens machinery lives in
9
+ instrumentation, graceful shutdown, and runbooks & operational docs. The shared lens machinery lives in
11
10
  [`helpers/audit-lens-core.md`](helpers/audit-lens-core.md). Write the report to
12
11
  `{{auditResultsDir}}/audit-sre-results.md`. Each finding carries a **Category:**
13
12
  (`Rollback & Recovery | Observability | Resilience | Runbooks`); the report adds
@@ -27,27 +26,22 @@ Per the core's Scope interpretation:
27
26
  Run this lens as one `subagent_type: auditor` dispatch per the core's
28
27
  Execution strategy.
29
28
 
30
- ## Step 1: Resilience Detection Battery (Read-Only, Tool-First)
29
+ ## Step 1: Operational Readiness Battery (Read-Only, Tool-First)
31
30
 
32
31
  This lens audits **operational readiness** — can this release be observed,
33
32
  survive failure, and be rolled back? It deliberately does **not** re-audit
34
33
  secrets, injection, dead code, or complexity; those are owned by
35
- [`audit-security`](audit-security.md) and [`audit-clean-code`](audit-clean-code.md).
36
- Ground findings in the greps below, then read the operational surfaces they
34
+ [`audit-security`](audit-security.md) and [`audit-clean-code`](audit-clean-code.md),
35
+ and it leaves dependency barriers (timeouts, retries, swallowed failures) and
36
+ the signal path from a failure to a human to
37
+ [`audit-resilience`](audit-resilience.md). Ground findings in the greps below, then read the operational surfaces they
37
38
  flag.
38
39
 
39
- 1. **Run the resilience battery.** Each grep maps to a Step 2 dimension:
40
+ 1. **Run the readiness battery.** Each grep maps to a Step 2 dimension:
40
41
 
41
42
  ```bash
42
- # Network calls without a timeout (a hung upstream stalls the whole request)
43
- rg -n "\b(fetch|axios(\.\w+)?|http\.request|got|ky)\s*\(" --glob '!**/*.test.*' | \
44
- rg -v -i "timeout|signal|AbortController"
45
43
  # Graceful-shutdown handlers (their ABSENCE is the finding for long-lived processes)
46
44
  rg -n "process\.on\(\s*['\"]SIG(TERM|INT)['\"]" || echo "no SIGTERM/SIGINT handler found"
47
- # Error-swallowing empty catch blocks (silent failure — no signal to observe)
48
- rg -n "catch\s*(\([^)]*\))?\s*\{\s*\}"
49
- # Retry / backoff on network-dependent work (resilience to transient failure)
50
- rg -n -i "retr(y|ies)|backoff|circuit.?breaker|p-retry"
51
45
  # Health / readiness endpoints (needed for orchestrated rollout & rollback)
52
46
  rg -n -i "/(health|healthz|readyz|livez|ping)\b|healthCheck"
53
47
  ```
@@ -80,22 +74,19 @@ Evaluate the release candidate against these **production-readiness** criteria.
80
74
 
81
75
  ### 3. Resilience & Failure Handling
82
76
 
83
- - **Timeouts & Cancellation:** Every outbound call needs a timeout /
84
- `AbortSignal` (grep 1 in Step 1). A call without one is a Reliability finding.
85
- - **Retry & Backoff:** Transient-failure-prone calls should retry with backoff;
86
- flag network work that fails hard on the first error.
87
77
  - **Graceful Shutdown:** Long-lived processes must handle `SIGTERM`/`SIGINT`
88
- and drain in-flight work (grep 2). Its absence risks dropped requests on
78
+ and drain in-flight work (grep 1). Its absence risks dropped requests on
89
79
  every deploy.
90
- - **Error Boundaries:** Empty `catch` blocks (grep 3) swallow failures with no
91
- signal — flag each as an Observability + Resilience finding.
80
+ - **Dependency barriers** belong to `audit-resilience`: timeouts, retries,
81
+ swallowed failures, integrity under partial failure and the alert path. Drop
82
+ them here.
92
83
 
93
84
  ### 4. Runbooks & Operational Docs
94
85
 
95
86
  - **Runbook Coverage:** Does an operational runbook exist for this
96
87
  service/feature (how to deploy, roll back, and respond to the top failure
97
88
  modes)? A new production surface with no runbook is a finding.
98
- - **Health & Readiness:** Are health/readiness endpoints (grep 5) present and
89
+ - **Health & Readiness:** Are health/readiness endpoints (grep 2) present and
99
90
  wired into the orchestrator so a bad rollout is caught before it takes
100
91
  traffic?
101
92
  - **On-Call Escalation:** Is ownership / escalation for this surface documented?
@@ -485,8 +485,35 @@ full-suite lock wait expired) logs a deferred line and the close settles
485
485
  line naming host contention — neither is reported as failing tests.
486
486
 
487
487
  Every full-suite run ends on `⏲ suite timings: lockWaitMs=… hostWaitMs=…
488
- testRunMs=…`, which close carries as the envelope's `suiteTimings`. The
488
+ testRunMs=…`. The handoff envelope carries its credited run's figures as
489
+ top-level `lockWait` / `suiteTimings` (null when the depositor ran no suite).
490
+ The close terminal's `suiteTimings` names its `source`: `close` when close
491
+ spawned the suite, `credited-run` when it honoured the handoff's credit;
492
+ `spawns[]` lists every spawn of that run. A `lockWaitMs` large next to
493
+ `testRunMs` is serialization behind sibling suites, not a slow suite — the
494
+ cue for `delivery.execution.workloads`. The
489
495
  `coverage.timeoutMs` clock starts at spawn, never in the lock queue; a suite
490
496
  that writes `$MANDREL_SUITE_READY_FILE` when its tests start (after a
491
497
  consumer load gate) gets a fresh bound for them, so worst-case wall is lock
492
498
  wait + 2 × `timeoutMs`.
499
+
500
+ **Delta re-credit after a base move.** When close's base sync merged
501
+ incoming paths (`BASE MOVED`), the `test` gate is the suite gate, the
502
+ pre-sync head holds `test` credit and `project.commands.testChanged` is set,
503
+ close runs that command instead of the full suite, with the pre-sync head in
504
+ `MANDREL_CHANGED_SINCE`, under the full-suite lock. Its log and progress line
505
+ read `test (delta since <sha12>, <n> incoming path(s))`; a green run deposits
506
+ `test` evidence for the merged tree (`scope: delta`, `since: <sha>`) under
507
+ the full-suite identity, so a re-close is credited, and a red one fails the
508
+ close like a red full run. An incoming coverage-config file or Story file,
509
+ no credit, no command, or coverage-capture running the suite logs
510
+ `test delta re-credit not eligible (<reason>)` and runs the full suite — the
511
+ same delta rules as the coverage capture's own delta refresh.
512
+
513
+ **PR-body trailers.** Close appends each git trailer named in
514
+ `delivery.pullRequest.bodyTrailers` (last branch commit carrying it wins) to
515
+ the PR body it opens; workers record one with `git commit --trailer`.
516
+
517
+ **Early merged-PR probe.** Before any sync or gate, close reads the head's
518
+ pull requests; a merged one whose head every surviving branch tip equals
519
+ short-circuits to the land tail instead of re-validating landed work.
package/docs/CHANGELOG.md CHANGED
@@ -15,6 +15,31 @@ All notable changes to this project will be documented in this file.
15
15
  -->
16
16
  <!-- markdownlint-disable-file MD004 MD012 MD037 -->
17
17
 
18
+ ## [2.102.0](https://github.com/dsj1984/mandrel/compare/mandrel-v2.101.0...mandrel-v2.102.0) (2026-10-23)
19
+
20
+
21
+ ### Added
22
+
23
+ * add /audit-resilience: a global lens that inventories every external dependency and follows each failure through its barrier to a human ([#5892](https://github.com/dsj1984/mandrel/issues/5892)) ([#5893](https://github.com/dsj1984/mandrel/issues/5893)) ([7a52cfc](https://github.com/dsj1984/mandrel/commit/7a52cfc123670a2b91d08c6310c9d26c8bc25988))
24
+
25
+ ## [2.101.0](https://github.com/dsj1984/mandrel/compare/mandrel-v2.100.0...mandrel-v2.101.0) (2026-10-23)
26
+
27
+
28
+ ### Added
29
+
30
+ * close lifts consumer-declared git trailers from the branch commits into the pull-request body ([#5875](https://github.com/dsj1984/mandrel/issues/5875)) ([#5885](https://github.com/dsj1984/mandrel/issues/5885)) ([443ee08](https://github.com/dsj1984/mandrel/commit/443ee08ace3ba785a34577b5b6a4822eeb238c61))
31
+ * confirm-merge re-arms auto-merge once the advisory check that disarmed it reports green on the same head, and the block names that check ([#5876](https://github.com/dsj1984/mandrel/issues/5876)) ([#5886](https://github.com/dsj1984/mandrel/issues/5886)) ([85a8aac](https://github.com/dsj1984/mandrel/commit/85a8aacfc6e4525d4b3d10aae859ac9dffd55c31))
32
+ * handoff and close envelopes carry the credited run's lock wait and suite timings, so the serialization cost of a delivery is visible per run ([#5879](https://github.com/dsj1984/mandrel/issues/5879)) ([#5888](https://github.com/dsj1984/mandrel/issues/5888)) ([68e9683](https://github.com/dsj1984/mandrel/commit/68e9683ccc2c41b16ecaf0b71485ae951d4b5ec1))
33
+ * the code-review provider reviews a large diff file by file within the prompt cap instead of truncating it ([#5878](https://github.com/dsj1984/mandrel/issues/5878)) ([#5882](https://github.com/dsj1984/mandrel/issues/5882)) ([e64a84e](https://github.com/dsj1984/mandrel/commit/e64a84e780c6546723466d9c4df1d46cbfb3ee46))
34
+ * the lint driver names every task that failed, with its exit code, and flags a crash exit ([#5889](https://github.com/dsj1984/mandrel/issues/5889)) ([#5891](https://github.com/dsj1984/mandrel/issues/5891)) ([7db5a92](https://github.com/dsj1984/mandrel/commit/7db5a923679fbe8158c4eb1541ed4cc7cc51447e))
35
+ * when the base moves between handoff and close, the `test` gate re-credits by running only the tests the incoming commits affect ([#5880](https://github.com/dsj1984/mandrel/issues/5880)) ([#5890](https://github.com/dsj1984/mandrel/issues/5890)) ([66423e3](https://github.com/dsj1984/mandrel/commit/66423e36c06dcfdb44564516c74d1cc829bc932d))
36
+
37
+
38
+ ### Fixed
39
+
40
+ * close probes the head's pull request before validation and short-circuits to the land tail when it already merged ([#5877](https://github.com/dsj1984/mandrel/issues/5877)) ([#5887](https://github.com/dsj1984/mandrel/issues/5887)) ([ddc1b52](https://github.com/dsj1984/mandrel/commit/ddc1b52c2f081928c6eff297803c5e60a34ece9c))
41
+ * **deps:** drop the braces audit exception now that GHSA-vfj7-8cjw-p6xm is withdrawn ([#5883](https://github.com/dsj1984/mandrel/issues/5883)) ([364f547](https://github.com/dsj1984/mandrel/commit/364f54705372e26d1b5d1c8d628fc9628940efbf))
42
+
18
43
  ## [2.100.0](https://github.com/dsj1984/mandrel/compare/mandrel-v2.99.0...mandrel-v2.100.0) (2026-10-23)
19
44
 
20
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mandrel",
3
- "version": "2.100.0",
3
+ "version": "2.102.0",
4
4
  "description": "Claude Code-first opinionated workflow framework: instructions, skills, rules, and SDLC workflows that govern AI coding assistants.",
5
5
  "files": [
6
6
  ".agents/",