mandrel 1.87.0 → 1.89.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 (140) hide show
  1. package/.agents/README.md +18 -13
  2. package/.agents/audit-checklists/architecture.md +24 -0
  3. package/.agents/audit-checklists/clean-code.md +24 -0
  4. package/.agents/audit-checklists/dependencies.md +14 -0
  5. package/.agents/audit-checklists/devops.md +17 -0
  6. package/.agents/audit-checklists/documentation.md +22 -0
  7. package/.agents/audit-checklists/lighthouse.md +15 -0
  8. package/.agents/audit-checklists/navigability.md +14 -0
  9. package/.agents/audit-checklists/performance.md +22 -0
  10. package/.agents/audit-checklists/privacy.md +21 -0
  11. package/.agents/audit-checklists/quality.md +18 -0
  12. package/.agents/audit-checklists/security.md +22 -0
  13. package/.agents/audit-checklists/seo.md +16 -0
  14. package/.agents/audit-checklists/sre.md +24 -0
  15. package/.agents/audit-checklists/ux-ui.md +21 -0
  16. package/.agents/docs/SDLC.md +63 -16
  17. package/.agents/docs/configuration.md +5 -3
  18. package/.agents/instructions.md +51 -21
  19. package/.agents/personas/architect.md +10 -7
  20. package/.agents/personas/engineer.md +4 -3
  21. package/.agents/personas/project-manager.md +5 -2
  22. package/.agents/personas/refactorer.md +5 -3
  23. package/.agents/rules/git-conventions.md +77 -0
  24. package/.agents/schemas/agentrc.schema.json +16 -4
  25. package/.agents/schemas/audit-rules.json +16 -2
  26. package/.agents/schemas/audit-rules.schema.json +7 -6
  27. package/.agents/schemas/lifecycle/merge.unlanded.schema.json +38 -0
  28. package/.agents/schemas/signal-event.schema.json +28 -13
  29. package/.agents/scripts/acceptance-spec-reconciler.js +6 -4
  30. package/.agents/scripts/check-context-budget.js +320 -0
  31. package/.agents/scripts/diagnose-friction.js +4 -4
  32. package/.agents/scripts/epic-audit-prepare.js +30 -2
  33. package/.agents/scripts/epic-audit-recheck.js +46 -13
  34. package/.agents/scripts/epic-deliver-prepare.js +80 -8
  35. package/.agents/scripts/epic-plan-spec.js +4 -8
  36. package/.agents/scripts/generate-lens-checklists.js +180 -0
  37. package/.agents/scripts/lib/audit-suite/checklist-threading.js +300 -0
  38. package/.agents/scripts/lib/audit-suite/findings.js +27 -0
  39. package/.agents/scripts/lib/audit-suite/index.js +9 -0
  40. package/.agents/scripts/lib/audit-suite/lens-checklist.js +212 -0
  41. package/.agents/scripts/lib/audit-suite/selector.js +136 -5
  42. package/.agents/scripts/lib/checks/loop-health.js +340 -0
  43. package/.agents/scripts/lib/cli-args.js +8 -0
  44. package/.agents/scripts/lib/config/explain.js +4 -0
  45. package/.agents/scripts/lib/config/runners.js +21 -2
  46. package/.agents/scripts/lib/config/temp-paths.js +24 -0
  47. package/.agents/scripts/lib/config-settings-schema-delivery.js +23 -3
  48. package/.agents/scripts/lib/config-settings-schema-quality.js +7 -0
  49. package/.agents/scripts/lib/doc-tiers.js +291 -0
  50. package/.agents/scripts/lib/epic-body-sections.js +5 -2
  51. package/.agents/scripts/lib/epic-merge-lock.js +83 -0
  52. package/.agents/scripts/lib/epic-plan-clarity.js +3 -1
  53. package/.agents/scripts/lib/feedback-loop/audit-results-graduator.js +66 -20
  54. package/.agents/scripts/lib/feedback-loop/graduator-core.js +395 -86
  55. package/.agents/scripts/lib/feedback-loop/memory-freshness.js +299 -72
  56. package/.agents/scripts/lib/feedback-loop/retro-proposals-graduator.js +438 -0
  57. package/.agents/scripts/lib/gates/friction.js +15 -5
  58. package/.agents/scripts/lib/observability/perf-aggregator.js +30 -104
  59. package/.agents/scripts/lib/observability/perf-report-readers.js +1 -1
  60. package/.agents/scripts/lib/observability/signal-validator.js +204 -0
  61. package/.agents/scripts/lib/observability/signals-writer.js +157 -54
  62. package/.agents/scripts/lib/observability/tool-trace-hook.js +42 -4
  63. package/.agents/scripts/lib/orchestration/acceptance-eval-decision.js +1 -1
  64. package/.agents/scripts/lib/orchestration/code-review.js +74 -4
  65. package/.agents/scripts/lib/orchestration/consolidation-precondition.js +213 -0
  66. package/.agents/scripts/lib/orchestration/doc-reader.js +4 -96
  67. package/.agents/scripts/lib/orchestration/docs-digest.js +34 -0
  68. package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/authoring-context.js +56 -19
  69. package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/run-spec-phase.js +22 -0
  70. package/.agents/scripts/lib/orchestration/lifecycle/emit-merge-unlanded.js +188 -0
  71. package/.agents/scripts/lib/orchestration/lifecycle/listeners/README.md +6 -0
  72. package/.agents/scripts/lib/orchestration/lifecycle/listeners/automerge-armer.js +69 -8
  73. package/.agents/scripts/lib/orchestration/lifecycle/listeners/automerge-predicate.js +11 -2
  74. package/.agents/scripts/lib/orchestration/lifecycle/listeners/finalizer.js +47 -61
  75. package/.agents/scripts/lib/orchestration/lifecycle/listeners/index.js +39 -3
  76. package/.agents/scripts/lib/orchestration/lifecycle/listeners/label-transitioner.js +144 -0
  77. package/.agents/scripts/lib/orchestration/lifecycle/listeners/merge-watcher.js +258 -14
  78. package/.agents/scripts/lib/orchestration/lifecycle/listeners/notify-dispatcher.js +6 -0
  79. package/.agents/scripts/lib/orchestration/merge-block-class.js +218 -0
  80. package/.agents/scripts/lib/orchestration/plan-review-routing.js +1 -1
  81. package/.agents/scripts/lib/orchestration/post-merge/phases/worktree-reap.js +3 -3
  82. package/.agents/scripts/lib/orchestration/retro/phases/compose-body.js +63 -34
  83. package/.agents/scripts/lib/orchestration/retro/phases/gather-signals.js +167 -52
  84. package/.agents/scripts/lib/orchestration/retro/phases/post-and-mirror.js +49 -2
  85. package/.agents/scripts/lib/orchestration/retro-proposals.js +12 -55
  86. package/.agents/scripts/lib/orchestration/retro-runner.js +9 -0
  87. package/.agents/scripts/lib/orchestration/single-story-close/phases/code-review.js +8 -0
  88. package/.agents/scripts/lib/orchestration/single-story-close/phases/confirm-merge.js +419 -0
  89. package/.agents/scripts/lib/orchestration/single-story-close/phases/options.js +35 -2
  90. package/.agents/scripts/lib/orchestration/single-story-close/phases/wrong-tree-guard.js +353 -69
  91. package/.agents/scripts/lib/orchestration/single-story-close/runner.js +66 -4
  92. package/.agents/scripts/lib/orchestration/spec-section-validator.js +60 -9
  93. package/.agents/scripts/lib/orchestration/story-close/auto-refresh-runner.js +7 -5
  94. package/.agents/scripts/lib/orchestration/story-close/merge-runner.js +24 -2
  95. package/.agents/scripts/lib/orchestration/story-close/phases/code-review.js +167 -8
  96. package/.agents/scripts/lib/orchestration/story-close/shared-checkout-guard.js +163 -0
  97. package/.agents/scripts/lib/orchestration/ticketing/reads.js +20 -9
  98. package/.agents/scripts/lib/planning-corpus.js +306 -0
  99. package/.agents/scripts/lib/signals/detectors/common.js +10 -10
  100. package/.agents/scripts/lib/signals/detectors/index.js +4 -4
  101. package/.agents/scripts/lib/signals/detectors/retry.js +19 -18
  102. package/.agents/scripts/lib/signals/detectors/rework.js +1 -1
  103. package/.agents/scripts/lib/signals/schema.js +56 -81
  104. package/.agents/scripts/lib/signals/span-tree.js +6 -5
  105. package/.agents/scripts/lib/story-plan.js +3 -0
  106. package/.agents/scripts/lib/wave-runner/tick.js +10 -2
  107. package/.agents/scripts/lifecycle-emit.js +39 -8
  108. package/.agents/scripts/providers/github/issues.js +12 -1
  109. package/.agents/scripts/resolve-doc-tiers.js +83 -0
  110. package/.agents/scripts/retro-run.js +51 -0
  111. package/.agents/scripts/signals-view.js +1 -1
  112. package/.agents/scripts/single-story-close.js +20 -1
  113. package/.agents/scripts/standalone-feedback-rollup.js +188 -0
  114. package/.agents/scripts/story-close.js +48 -0
  115. package/.agents/scripts/story-plan.js +51 -12
  116. package/.agents/scripts/validate-docs-freshness.js +69 -15
  117. package/.agents/skills/core/documentation-and-adrs/SKILL.md +58 -0
  118. package/.agents/skills/core/epic-plan-decompose-author/SKILL.md +5 -3
  119. package/.agents/skills/core/epic-plan-spec-author/SKILL.md +20 -7
  120. package/.agents/skills/core/scope-triage/SKILL.md +61 -0
  121. package/.agents/skills/skills.index.json +3 -3
  122. package/.agents/workflows/audit-documentation.md +82 -2
  123. package/.agents/workflows/helpers/code-review.md +193 -44
  124. package/.agents/workflows/helpers/deliver-epic.md +128 -39
  125. package/.agents/workflows/helpers/deliver-stories.md +26 -0
  126. package/.agents/workflows/helpers/epic-audit.md +116 -283
  127. package/.agents/workflows/helpers/epic-deliver-story.md +14 -0
  128. package/.agents/workflows/helpers/epic-plan-decompose.md +18 -200
  129. package/.agents/workflows/helpers/epic-plan-spec.md +18 -180
  130. package/.agents/workflows/helpers/plan-epic.md +141 -105
  131. package/.agents/workflows/helpers/plan-story.md +32 -0
  132. package/.agents/workflows/helpers/single-story-deliver.md +43 -0
  133. package/.agents/workflows/loops/nightly-audit.md +9 -7
  134. package/docs/CHANGELOG.md +29 -0
  135. package/lib/cli/doctor.js +44 -0
  136. package/package.json +4 -3
  137. package/.agents/scripts/epic-plan-spec-validate.js +0 -111
  138. package/.agents/scripts/lib/feedback-loop/code-review-graduator.js +0 -207
  139. package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/prompts.js +0 -58
  140. package/.agents/scripts/lib/signals/detectors/hotspot.js +0 -292
package/.agents/README.md CHANGED
@@ -731,13 +731,18 @@ chain, `security-review`, and `ultrareview` were added in Story #2871.
731
731
 
732
732
  ---
733
733
 
734
- ## Feedback loop — code-review auto-graduation
735
-
736
- When the Epic finalize listener runs, non-blocking code-review findings
737
- (severity `high`, `medium`, or `low`) that survived merge are
738
- auto-graduated into follow-up issues, routed by source classification
739
- into the framework repo or the consumer repo. The toggle lives at
740
- `delivery.feedbackLoop.codeReviewAutoFile` and defaults to `true`.
734
+ ## Feedback loop — verification-results auto-graduation
735
+
736
+ When the Epic finalize listener runs, non-blocking findings (severity
737
+ `high`, `medium`, or `suggestion`) that survived merge are auto-graduated
738
+ into follow-up issues in a SINGLE pass over the unified
739
+ `verification-results` structured comment (Story #4411 folded the former
740
+ `code-review` and `audit-results` comments into one), routed by source
741
+ classification into the framework repo or the consumer repo. The toggle
742
+ lives at `delivery.feedbackLoop.auditResultsAutoFile` and defaults to
743
+ `true`. (The former `codeReviewAutoFile` key was retired with its
744
+ graduator when the pass unified — a config carrying it fails validation;
745
+ delete the key.)
741
746
 
742
747
  To opt out (for example, to triage findings manually during a
743
748
  stabilization window), set the toggle to `false` in your root
@@ -747,17 +752,17 @@ stabilization window), set the toggle to `false` in your root
747
752
  {
748
753
  "delivery": {
749
754
  "feedbackLoop": {
750
- "codeReviewAutoFile": false
755
+ "auditResultsAutoFile": false
751
756
  }
752
757
  }
753
758
  }
754
759
  ```
755
760
 
756
- When disabled, the listener short-circuits and leaves the structured
757
- `code-review` comments on the Epic ticket untouched. Re-enabling the
758
- toggle is safe: the graduator embeds an idempotency marker
759
- (`<!-- code-review-followup: epic-<id>-finding-<idx> -->`) in each filed
760
- issue body, so re-runs skip findings that already have an issue.
761
+ When disabled, the listener short-circuits and leaves the
762
+ `verification-results` comment on the Epic ticket untouched. Re-enabling
763
+ the toggle is safe: the graduator embeds a content-derived idempotency
764
+ marker in each filed issue body, so re-runs skip findings that already
765
+ have an issue.
761
766
 
762
767
  ---
763
768
 
@@ -0,0 +1,24 @@
1
+ <!-- GENERATED FILE — do not edit by hand.
2
+ Source of truth: .agents/workflows/audit-architecture.md
3
+ Regenerate: node .agents/scripts/generate-lens-checklists.js
4
+ Drift is gated by: npm run docs:check
5
+ -->
6
+
7
+ # Architecture & Clean Code Audit — authoring checklist
8
+
9
+ > Audit architectural boundaries, module coupling, and layering violations; emit a structured findings report keyed to High/Medium/Low severity.
10
+
11
+ Self-check your change against this lens's concerns before you ship:
12
+
13
+ - [ ] Documented architecture boundaries
14
+ - [ ] Automated boundary checks
15
+ - [ ] Over-Engineering & Abstractions
16
+ - [ ] Cognitive Load & Nesting
17
+ - [ ] Dead Code & Redundancy
18
+ - [ ] Naming & Self-Documentation
19
+ - [ ] Coupling & Cohesion
20
+ - [ ] Testable Surface (Humble-Object Boundary)
21
+ - [ ] High
22
+ - [ ] Medium
23
+ - [ ] Low
24
+ - [ ] Automated Architecture Guardrails
@@ -0,0 +1,24 @@
1
+ <!-- GENERATED FILE — do not edit by hand.
2
+ Source of truth: .agents/workflows/audit-clean-code.md
3
+ Regenerate: node .agents/scripts/generate-lens-checklists.js
4
+ Drift is gated by: npm run docs:check
5
+ -->
6
+
7
+ # Clean Code & Maintainability Audit — authoring checklist
8
+
9
+ > Audit code smells, dead code, complexity hotspots, and maintainability-index outliers; emit a structured findings report.
10
+
11
+ Self-check your change against this lens's concerns before you ship:
12
+
13
+ - [ ] Logic Complexity
14
+ - [ ] Duplication
15
+ - [ ] Component Health
16
+ - [ ] Naming Clarity
17
+ - [ ] Error Handling
18
+ - [ ] Dead Code
19
+ - [ ] SOLID Principles
20
+ - [ ] DRY (Don't Repeat Yourself)
21
+ - [ ] KISS (Keep It Simple, Stupid)
22
+ - [ ] Testability
23
+ - [ ] Dead Code & Orphaned Modules
24
+ - [ ] Documentation
@@ -0,0 +1,14 @@
1
+ <!-- GENERATED FILE — do not edit by hand.
2
+ Source of truth: .agents/workflows/audit-dependencies.md
3
+ Regenerate: node .agents/scripts/generate-lens-checklists.js
4
+ Drift is gated by: npm run docs:check
5
+ -->
6
+
7
+ # Dependency Update Audit — authoring checklist
8
+
9
+ > Audit `package. json` for unused, outdated, and major-version-stale dependencies; surface Node-engine drift and propose upgrade batches.
10
+
11
+ Self-check your change against this lens's concerns before you ship:
12
+
13
+ - [ ] Inventory & Stale Check
14
+ - [ ] Vulnerability Scan
@@ -0,0 +1,17 @@
1
+ <!-- GENERATED FILE — do not edit by hand.
2
+ Source of truth: .agents/workflows/audit-devops.md
3
+ Regenerate: node .agents/scripts/generate-lens-checklists.js
4
+ Drift is gated by: npm run docs:check
5
+ -->
6
+
7
+ # DevOps Infrastructure Audit — authoring checklist
8
+
9
+ > Audit CI/CD workflows, container images, infrastructure-as-code, and deployment pipelines; surface failure modes and hardening gaps.
10
+
11
+ Self-check your change against this lens's concerns before you ship:
12
+
13
+ - [ ] Redundancy & Duplication
14
+ - [ ] Performance Gaps
15
+ - [ ] Security & Compliance
16
+ - [ ] Standardization & Modernization
17
+ - [ ] Reliability & Resilience
@@ -0,0 +1,22 @@
1
+ <!-- GENERATED FILE — do not edit by hand.
2
+ Source of truth: .agents/workflows/audit-documentation.md
3
+ Regenerate: node .agents/scripts/generate-lens-checklists.js
4
+ Drift is gated by: npm run docs:check
5
+ -->
6
+
7
+ # Documentation Staleness & Completeness Audit — authoring checklist
8
+
9
+ > Audit the repository's main documentation for staleness, semantic drift, and completeness; emit a structured High/Medium/Low findings report.
10
+
11
+ Self-check your change against this lens's concerns before you ship:
12
+
13
+ - [ ] Checker failures
14
+ - [ ] Generator dirtiness
15
+ - [ ] Command & Script References
16
+ - [ ] Path & Module References
17
+ - [ ] Workflow & Contract Descriptions
18
+ - [ ] Version & Topology Claims
19
+ - [ ] Completeness
20
+ - [ ] History Bloat
21
+ - [ ] Contradiction
22
+ - [ ] Authority Drift
@@ -0,0 +1,15 @@
1
+ <!-- GENERATED FILE — do not edit by hand.
2
+ Source of truth: .agents/workflows/audit-lighthouse.md
3
+ Regenerate: node .agents/scripts/generate-lens-checklists.js
4
+ Drift is gated by: npm run docs:check
5
+ -->
6
+
7
+ # Lighthouse Audit & Analysis — authoring checklist
8
+
9
+ > Run a Lighthouse audit (Performance / Accessibility / Best Practices / SEO) and produce a structured findings report
10
+
11
+ Self-check your change against this lens's concerns before you ship:
12
+
13
+ - [ ] Opportunities
14
+ - [ ] Diagnostics
15
+ - [ ] Failed audits
@@ -0,0 +1,14 @@
1
+ <!-- GENERATED FILE — do not edit by hand.
2
+ Source of truth: .agents/workflows/audit-navigability.md
3
+ Regenerate: node .agents/scripts/generate-lens-checklists.js
4
+ Drift is gated by: npm run docs:check
5
+ -->
6
+
7
+ # Navigability Audit — authoring checklist
8
+
9
+ > Audit the whole route tree against the consumer's nav-registry SSOT — every route has a persona nav door and no nav href is dead. A deliberately-global lens (Epic #4131, F2/F3) exempt from the cross-epic-leak guard and routed onto route-adding change sets.
10
+
11
+ Self-check your change against this lens's concerns before you ship:
12
+
13
+ - [ ] Every route has a persona nav door.
14
+ - [ ] No nav href is dead.
@@ -0,0 +1,22 @@
1
+ <!-- GENERATED FILE — do not edit by hand.
2
+ Source of truth: .agents/workflows/audit-performance.md
3
+ Regenerate: node .agents/scripts/generate-lens-checklists.js
4
+ Drift is gated by: npm run docs:check
5
+ -->
6
+
7
+ # Performance & Bottleneck Audit — authoring checklist
8
+
9
+ > Audit hot paths, algorithmic complexity, and I/O bottlenecks in the tooling surface (`epic-close`, dispatcher, gates); propose remediations.
10
+
11
+ Self-check your change against this lens's concerns before you ship:
12
+
13
+ - [ ] Database/API Efficiency
14
+ - [ ] Frontend Rendering
15
+ - [ ] Bundle Size
16
+ - [ ] Resource Usage
17
+ - [ ] Network Path
18
+ - [ ] Latency
19
+ - [ ] Throughput
20
+ - [ ] Efficiency
21
+ - [ ] Scalability
22
+ - [ ] Core Web Vitals
@@ -0,0 +1,21 @@
1
+ <!-- GENERATED FILE — do not edit by hand.
2
+ Source of truth: .agents/workflows/audit-privacy.md
3
+ Regenerate: node .agents/scripts/generate-lens-checklists.js
4
+ Drift is gated by: npm run docs:check
5
+ -->
6
+
7
+ # Privacy and PII Data Audit — authoring checklist
8
+
9
+ > Audit logs, telemetry, and persistence paths for PII leakage and retention violations; surface secrets exposure and consent gaps.
10
+
11
+ Self-check your change against this lens's concerns before you ship:
12
+
13
+ - [ ] Log Statements
14
+ - [ ] Storage
15
+ - [ ] API Requests
16
+ - [ ] Analytics
17
+ - [ ] Data Minimization
18
+ - [ ] Leaky Logging
19
+ - [ ] Insecure Transmission
20
+ - [ ] Hardcoded Secrets
21
+ - [ ] Consent & Retention
@@ -0,0 +1,18 @@
1
+ <!-- GENERATED FILE — do not edit by hand.
2
+ Source of truth: .agents/workflows/audit-quality.md
3
+ Regenerate: node .agents/scripts/generate-lens-checklists.js
4
+ Drift is gated by: npm run docs:check
5
+ -->
6
+
7
+ # Testing & Quality Assurance Audit — authoring checklist
8
+
9
+ > Audit test coverage gaps, flaky tests, missing assertions, and test-pyramid balance; recommend a remediation batch.
10
+
11
+ Self-check your change against this lens's concerns before you ship:
12
+
13
+ - [ ] Coverage vs. Confidence
14
+ - [ ] Test Fragility & Flakiness
15
+ - [ ] Mocking & Stubbing Strategy
16
+ - [ ] Test Data Management
17
+ - [ ] Performance & Execution
18
+ - [ ] Requirement Alignment
@@ -0,0 +1,22 @@
1
+ <!-- GENERATED FILE — do not edit by hand.
2
+ Source of truth: .agents/workflows/audit-security.md
3
+ Regenerate: node .agents/scripts/generate-lens-checklists.js
4
+ Drift is gated by: npm run docs:check
5
+ -->
6
+
7
+ # Security & Vulnerability Audit — authoring checklist
8
+
9
+ > Audit dependency CVEs, input-validation gaps, secrets handling, and auth boundaries; emit a structured High/Medium/Low findings report.
10
+
11
+ Self-check your change against this lens's concerns before you ship:
12
+
13
+ - [ ] Input Validation
14
+ - [ ] Injection Risks
15
+ - [ ] Authentication/Authorization
16
+ - [ ] Dependency Security
17
+ - [ ] Secret Management
18
+ - [ ] Injection
19
+ - [ ] Broken Access Control
20
+ - [ ] Cryptographic Failures
21
+ - [ ] Security Misconfiguration
22
+ - [ ] Vulnerable Components
@@ -0,0 +1,16 @@
1
+ <!-- GENERATED FILE — do not edit by hand.
2
+ Source of truth: .agents/workflows/audit-seo.md
3
+ Regenerate: node .agents/scripts/generate-lens-checklists.js
4
+ Drift is gated by: npm run docs:check
5
+ -->
6
+
7
+ # SEO & Generative Engine Optimization Audit — authoring checklist
8
+
9
+ > Audit SEO fundamentals and Generative Engine Optimization signals (meta, structured data, crawlability); only relevant for web targets.
10
+
11
+ Self-check your change against this lens's concerns before you ship:
12
+
13
+ - [ ] Traditional SEO
14
+ - [ ] AIO & GEO (Answer Engine Optimization)
15
+ - [ ] Core Web Vitals
16
+ - [ ] Crawlability
@@ -0,0 +1,24 @@
1
+ <!-- GENERATED FILE — do not edit by hand.
2
+ Source of truth: .agents/workflows/audit-sre.md
3
+ Regenerate: node .agents/scripts/generate-lens-checklists.js
4
+ Drift is gated by: npm run docs:check
5
+ -->
6
+
7
+ # Production Release Candidate Audit — authoring checklist
8
+
9
+ > Audit production-readiness for a release candidate: SLOs, observability, runbooks, error budgets, and rollback paths.
10
+
11
+ Self-check your change against this lens's concerns before you ship:
12
+
13
+ - [ ] Config Integrity
14
+ - [ ] Hardcoding Scan
15
+ - [ ] Fallback Logic
16
+ - [ ] Secret Leaks
17
+ - [ ] Input Sanitization
18
+ - [ ] Dependency Risks
19
+ - [ ] Console Hygiene
20
+ - [ ] Error Swallowing
21
+ - [ ] Boundary Handling
22
+ - [ ] Dead Code
23
+ - [ ] Complexity
24
+ - [ ] Asset Loading
@@ -0,0 +1,21 @@
1
+ <!-- GENERATED FILE — do not edit by hand.
2
+ Source of truth: .agents/workflows/audit-ux-ui.md
3
+ Regenerate: node .agents/scripts/generate-lens-checklists.js
4
+ Drift is gated by: npm run docs:check
5
+ -->
6
+
7
+ # UX/UI & Design System Audit — authoring checklist
8
+
9
+ > Audit UX/UI consistency and design system adherence
10
+
11
+ Self-check your change against this lens's concerns before you ship:
12
+
13
+ - [ ] Hardcoded Values
14
+ - [ ] Component Re-implementation
15
+ - [ ] Interactive States
16
+ - [ ] Typography
17
+ - [ ] Information Hierarchy
18
+ - [ ] Error States
19
+ - [ ] Loading States
20
+ - [ ] Responsiveness
21
+ - [ ] Accessibility (UX-focused)
@@ -112,12 +112,18 @@ From zero to shipped:
112
112
  3. **Phase 3 — close-validation** — lint, test, and the project's
113
113
  ratcheted baselines run against the Epic branch. Evidence is
114
114
  cached by HEAD SHA so re-runs short-circuit.
115
- 4. **Phase 4 — audit** — runs the change-set audit lenses against
116
- the Epic diff; findings flow through as advisory signal.
115
+ 4. **Phase 4 — Epic-close lens roster** — resolves (does not walk) the
116
+ slim Epic-close lens roster: the change-set `gate3` selection plus the
117
+ risk-routed lenses, restricted to the **cumulative + global +
118
+ risk-routed** tiers via `selectEpicCloseLenses` (every local-tier
119
+ change-set lens is excluded — already verified shift-left). The roster is
120
+ handed to Phase 5.
117
121
  5. **Phase 5 — code-review** — auto-invokes the in-process
118
- `lib/orchestration/code-review.js` (extracted from the old
119
- `helpers/code-review.md` helper); findings persist as a
120
- `code-review` structured comment on the Epic. Critical findings
122
+ `lib/orchestration/code-review.js`; walks the cumulative Epic diff
123
+ **once**, executing the Phase 4 lens roster as review dimensions
124
+ **alongside** the review pillars (Story #4412 folded the standalone lens
125
+ walk into this pass). Findings persist as the single unified
126
+ `verification-results` structured comment on the Epic. Critical findings
121
127
  halt the run.
122
128
  6. **Phase 6 — retro** — auto-invokes the in-process
123
129
  `lib/orchestration/retro-runner.js` (extracted from the old
@@ -889,13 +895,31 @@ watch / auto-merge / cleanup tail that drives the PR to merge:
889
895
  on `git rev-parse HEAD`. A clean tree on a re-run short-circuits in
890
896
  milliseconds. A failing gate halts the workflow until the regression is
891
897
  fixed on a hotfix branch and re-merged into the Epic.
892
- 2. **Audit (Phase 4).** The change-set audit lenses run against the Epic
893
- diff; findings flow through as advisory signal to inform the code
894
- review that follows.
895
- 3. **Code-review (Phase 5).** `lib/orchestration/code-review.js` (extracted
896
- from the `code-review.md` helper) audits the diff and posts the
897
- findings as a `code-review` structured comment on the Epic. 🔴 Critical
898
- findings halt the run; 🟠/🟡/🟢 findings flow through as non-blocking.
898
+ 2. **Epic-close lens roster (Phase 4).** Resolves does not walk the slim
899
+ Epic-close lens roster (`epicCloseLenses`): the `gate3` change-set selection
900
+ plus the risk-routed lenses, restricted to the **cumulative + global +
901
+ risk-routed** tiers via `selectEpicCloseLenses`. Every **local-tier**
902
+ change-set lens is excluded because its concern is already verified
903
+ shift-left the write-time distilled checklist threaded into the Story
904
+ prompt (Story #4410) and the maker-blind Story-scope local-lens pass in
905
+ `story-close` (Story #4409). The roster is handed to Phase 5; there is no
906
+ standalone Phase 4 walk and no separate `audit-results` comment (Story
907
+ #4412).
908
+ 3. **Code-review (Phase 5) — cumulative diff walked once.**
909
+ `lib/orchestration/code-review.js` walks `main..epic/<id>` a single time,
910
+ executing the Phase 4 lens roster as review **dimensions** alongside the
911
+ review pillars, and posts the unified `verification-results` structured
912
+ comment on the Epic (Story #4411 unified the former `code-review` and
913
+ `audit-results` contracts; Story #4412 folded the lens walk into this pass).
914
+ Remediation is **tier-aware and split by finding class** (Story #4412): the
915
+ review-pillar findings route off `delivery.codeReview.autoFixSeverity`
916
+ (default `medium` — 🔴/🟠/🟡 on-branch, 🟢 stays on the comment), while the
917
+ Epic-close lens findings route off `delivery.epicAudit.autoFixSeverity`
918
+ (default **`high`** — only 🔴/🟠 on-branch; 🟡/🟢 graduate, because 🟡
919
+ Medium concerns were already remediated shift-left). Fixed findings land
920
+ under the comment's `## Fixed on-branch` section so the graduator skips
921
+ them. The severity gate is unchanged: surviving 🔴 Critical findings halt
922
+ the run; surviving 🟠/🟡/🟢 flow through as non-blocking.
899
923
  4. **Retro (Phase 6).** `lib/orchestration/retro-runner.js` (extracted from the old
900
924
  retro helper) aggregates perf signals, friction counts, hotfix counts,
901
925
  recut counts, parked counts, and HITL count using
@@ -992,7 +1016,7 @@ required checks fail.
992
1016
  label-transition pathway flips the Epic to `agent::done` on merge.
993
1017
  The operator becomes a touchpoint here only when they (a) disarm
994
1018
  auto-merge in the GitHub UI to inspect required-checks, the
995
- `code-review` comment, and the retro before merging by hand, or
1019
+ `verification-results` comment, and the retro before merging by hand, or
996
1020
  (b) checks fail and need remediation on the Epic branch. There is
997
1021
  no separate close command — the close-out side effects (PR open,
998
1022
  handoff comment) are owned by `/deliver`'s
@@ -1213,15 +1237,38 @@ on so re-runs short-circuit when state has not changed.
1213
1237
 
1214
1238
  | Gate | When | What Runs | Blocking? | Idempotency key |
1215
1239
  | ------------------------- | ---------------------------------------------------- | ----------------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------ |
1216
- | Gate 1 | After Story completion | Content-triggered audits (clean-code, etc.) | advisory | Audit-report comment per Story (`audit-<lens>` structured comment) |
1217
- | Gate 2 | Pre-integration | Dependency + DevOps audits | advisory | Audit-report comment per Epic (`audit-<lens>` structured comment) |
1218
- | Gate 3 | `/deliver` `delivery.code-review` state | Full automated audit pass | blocking | `code-review` structured comment on Epic, keyed by Epic HEAD SHA |
1240
+ | Tier 1 — write-time | During Story implementation | Local-tier lens checklists threaded into the Story prompt (clean-code, etc.) | advisory | Distilled checklist in the hydrated Story prompt (Story #4410) |
1241
+ | Tier 2 — Story-scope | `story-close` (maker-blind subprocess) | Local-tier lens roster over the Story diff (`selectLocalLenses`) | advisory | `verification-results` structured comment on the Story |
1242
+ | Tier 3 — Epic-close | `/deliver` Phase 4→5 (code-review pass) | Slim roster: cumulative + global + risk-routed lenses (`selectEpicCloseLenses`) + pillars | blocking | `verification-results` structured comment on Epic, keyed by Epic HEAD SHA |
1219
1243
  | Gate 4 | `/deliver` `delivery.finalize` state (pre-PR) | `audit-sre` production readiness gate | blocking | `audit-sre` structured comment on Epic, keyed by Epic HEAD SHA |
1220
1244
  | Close-validation | `/deliver` `delivery.close-validation` state | lint + test + maintainability + CRAP + coverage ratchets via `evidence-gate.js` | blocking | `evidence-gate` cache entry keyed by `git rev-parse HEAD` |
1221
1245
  | Pre-push | Local `.husky/pre-push` hook on every push | Diff-scoped quality preview + coverage/CRAP ratchet | blocking | Working-tree SHA + staged-diff hash (per push) |
1222
1246
  | Acceptance reconciliation | `/deliver` `delivery.finalize` state | `acceptance-spec-reconciler.js` diffs AC IDs against `@ac-*` / `@pending` feature tags | blocking | `acceptance-reconcile` structured comment on Epic, keyed by spec-body SHA |
1223
1247
  | Spec freshness | `/plan` `planning.spec-authoring` state | Re-derives Tech Spec / Acceptance Spec staleness against Epic body checksum | advisory | `epic-plan-state` checkpoint entry per spec artifact body SHA |
1224
1248
 
1249
+ #### Three-tier lens model (Epic #4405)
1250
+
1251
+ The three audit-lens tiers above (write-time → Story-scope → Epic-close) form a
1252
+ **shift-left** verification model in which **each lens concern is verified at
1253
+ exactly one tier**, chosen by the lens's `scope` field in `audit-rules.json`
1254
+ (resolved by `resolveLensTier`):
1255
+
1256
+ - **`local`** lenses (decidable from a single Story's diff) are verified at the
1257
+ two innermost tiers — the write-time distilled checklist (Tier 1) and the
1258
+ maker-blind Story-scope pass (Tier 2). They are **not** re-run at Epic close.
1259
+ - **`cumulative`** lenses (only decidable across the Epic's combined diff) and
1260
+ **`global`** lenses (whole-product properties) are verified at Epic close
1261
+ (Tier 3) only.
1262
+ - **Risk-routed** lenses run at Epic close regardless of tier, because a
1263
+ high-risk axis (or a route-adding change set) explicitly demands them.
1264
+
1265
+ The Epic-close roster (`selectEpicCloseLenses`) is deliberately **slim**: it
1266
+ excludes every local-tier change-set lens so the outermost tier — where a fix
1267
+ is most expensive — does not re-verify a concern already covered shift-left.
1268
+ The Epic-close remediation threshold reflects this (`delivery.epicAudit.autoFixSeverity`
1269
+ defaults to `high`): 🟡 Medium code-quality findings are remediated at the
1270
+ innermost tiers, not re-remediated at close.
1271
+
1225
1272
  ### Review & feedback loop
1226
1273
 
1227
1274
  When audits produce findings, the orchestrator compiles a structured Markdown
@@ -275,12 +275,14 @@ top-level keys are validation errors.
275
275
  | `epicAudit` | No | `object` | — | Nested configuration block. |
276
276
  | `epicAudit.maxFixAttempts` | No | `integer` | — | Maximum auto-fix retry attempts per finding in /deliver Phase 4 (epic-audit). 0 disables auto-fix. Default 3. |
277
277
  | `epicAudit.maxFixScopeFiles` | No | `integer` | — | Maximum file count a single auto-fix may modify before escalating to agent::blocked. Default 5. |
278
+ | `epicAudit.autoFixSeverity` | No | `"high"` \| `"medium"` | `"high"` | Severity threshold for on-branch remediation of the Epic-close lens findings walked inside the /deliver Phase 5 code-review pass (Story #4412 folded the former Phase 4 lens walk into that single cumulative-diff pass). `high` (default) routes only 🔴 Critical / 🟠 High lens findings into the host-LLM remediation loop while 🟡 Medium and 🟢 Suggestion findings graduate to follow-up issues (🟡 Medium concerns are already remediated shift-left at the write-time and Story-scope tiers); `medium` opts back into routing 🔴/🟠/🟡 (Mediums batched per lens). Hard cutover — no back-compat flag. |
278
279
  | `codeReview` | No | `object` | — | Nested configuration block. |
279
280
  | `codeReview.provider` | No | `"native"` \| `"codex"` \| `"security-review"` | `"native"` | Legacy single-adapter selection. ReviewProvider that produces the Finding[] consumed by runCodeReview(). Story #2833 registered `native` (in-process maintainability/lint); Story #2830 added `codex` (invokes `/codex:review` plugin); Story #2871 added `security-review` (shells out to `claude --print /security-review`). When `providers` (chain shape) is set this field is ignored with a warning. Selecting an adapter whose probe fails hard-fails at factory construction unless declared `optional: true` in the chain. |
280
281
  | `codeReview.providers[]` | No | `array<object>` | — | Multi-provider chain (Story #2871). When set and non-empty, takes precedence over the legacy `provider` field. The orchestrator iterates inline entries in declaration order and merges their Finding[] before posting one structured comment; manual-prompt entries (e.g. ultrareview) contribute a trailing 'Manual review suggestions' section. Each item has: name, scopes, optional, manualPrompt, when. |
281
282
  | `codeReview.providerConfig` | No | `object` | — | Optional escape hatch for adapter-specific configuration. No documented keys in Epic #2815; reserved so future adapters can be configured without another schema migration. |
282
283
  | `codeReview.maxFixAttempts` | No | `integer` | — | Maximum auto-fix retry attempts per finding in /deliver Phase 5 (code-review). 0 disables auto-fix. Default 3. |
283
284
  | `codeReview.maxFixScopeFiles` | No | `integer` | — | Maximum file count a single auto-fix may modify before escalating to agent::blocked. Default 5. |
285
+ | `codeReview.autoFixSeverity` | No | `"high"` \| `"medium"` | `"medium"` | Severity threshold for on-branch remediation in /deliver Phase 5 (code-review). `medium` (default) routes 🔴/🟠/🟡 findings into the host-LLM focused-fix routing (Mediums batched per lens: one commit per lens, a single validation + rescan at the end) while 🟢 suggestions still graduate to follow-up issues; `high` reproduces the pre-4399 Critical/High-only routing. Hard cutover — no back-compat flag. |
284
286
  | `retro` | No | `object` | — | Story #3042 (Epic #3019). Operator-tunable retro behaviour. Currently exposes `perfThresholds`, the gates the retro perf-signals classifier uses to decide which signals to surface in the `## Performance Signals` / `## Recommended Follow-Ons` retro sections. |
285
287
  | `retro.perfThresholds` | No | `object` | — | Gates for `classifyPerfSignals` (lib/orchestration/retro-perf-heuristics.js). Defaults are 0.6 / 0.4 / 2. |
286
288
  | `retro.perfThresholds.utilisation` | No | `number` | — | Per-wave utilisation threshold. Waves whose `utilisation` is strictly below this value emit a `low-utilisation` signal. Default 0.6. |
@@ -306,8 +308,8 @@ top-level keys are validation errors.
306
308
  | `preflight.maxClaudeQuotaTokens` | No | `integer` | — | — |
307
309
  | `failOnConcurrencyHazards` | No | `boolean` | — | — |
308
310
  | `feedbackLoop` | No | `object` | — | Nested configuration block. |
309
- | `feedbackLoop.codeReviewAutoFile` | No | `boolean` | `true` | When true (default), the Epic finalize listener auto-files non-blocking code-review findings as follow-up issues routed by source classification. Set to false to suppress auto-filing; findings remain accessible in the structured comments on the Epic. |
310
311
  | `feedbackLoop.auditResultsAutoFile` | No | `boolean` | `true` | When true (default), the Epic finalize listener auto-files non-blocking audit-results findings as follow-up issues routed by source classification. Set to false to suppress auto-filing; findings remain accessible in the structured comments on the Epic. |
312
+ | `feedbackLoop.retroProposals` | No | `boolean` | `true` | When true (default), the retro auto-files its actionable routed proposals as meta::<framework-gap\|consumer-improvement> + friction::<category> issues via the graduator pre-parsed-findings seam, and the rendered retro sections list the filed issue numbers instead of paste-ready gh command stanzas. Set to false to fall back to the command stanzas. |
311
313
 
312
314
  <!-- END GENERATED:agentrc -->
313
315
 
@@ -749,8 +751,8 @@ per-scope override.
749
751
 
750
752
  | Field | Required | Default | Purpose |
751
753
  | ----------------------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
752
- | `codeReviewAutoFile` | No | `true` | When `true`, the Epic finalize listener auto-files non-blocking code-review findings as follow-up issues routed by source classification. |
753
- | `auditResultsAutoFile` | No | `true` | When `true`, the Epic finalize listener auto-files non-blocking audit-results findings as follow-up issues routed by source classification. |
754
+ | `auditResultsAutoFile` | No | `true` | When `true`, the Epic finalize listener auto-files non-blocking findings from the unified `verification-results` comment as follow-up issues routed by source classification. (The former `codeReviewAutoFile` key was retired with its graduator when Story #4411 unified the pass; a config carrying it fails validation.) |
755
+ | `retroProposals` | No | `true` | When `true`, the retro runner auto-files the retro's actionable routed proposals as GitHub follow-up issues (Story #4418). |
754
756
 
755
757
  ---
756
758
 
@@ -139,8 +139,12 @@ technology context is intentionally kept out of `.agentrc.json`.
139
139
  ### H. Observability & Friction Telemetry
140
140
 
141
141
  You MUST log telemetry about any operational difficulty or automation
142
- opportunity you encounter. Post friction details directly to the relevant
143
- GitHub Story (or Epic) ticket:
142
+ opportunity you encounter. Friction is a **local NDJSON signal**:
143
+ `diagnose-friction.js` appends one canonical `kind: friction` record to the
144
+ per-Epic/per-Story `signals.ndjson` stream on local disk (validated
145
+ write-time against `signal-event.schema.json`; the retro roll-up reads it
146
+ back). It is not posted to the GitHub ticket at capture time — the retro
147
+ phase is what surfaces the aggregated friction as routed proposals.
144
148
 
145
149
  - **Command**:
146
150
  `node .agents/scripts/diagnose-friction.js --story [STORY_ID] --cmd [FAILED_COMMAND]`
@@ -149,10 +153,12 @@ GitHub Story (or Epic) ticket:
149
153
  command failures, or ambiguity requiring explicit self-correction. Also
150
154
  after repetitive sequences of commands or boilerplate-heavy steps that
151
155
  could be simplified by a workflow or skill.
152
- - **No-ticket fallback**: If you hit friction outside an Epic/Story
153
- loop, write a JSON record to `temp/friction-<timestamp>.json` with the
154
- same fields, and mention the file in your final summary so a human can
155
- route it later. Do not silently drop the signal.
156
+ - **No-Epic context**: Outside an Epic/Story loop there is no per-Epic
157
+ stream to anchor to, so the record lands on the **standalone signal
158
+ stream** (`temp/standalone/stories/story-<sid>/signals.ndjson`) under the
159
+ same canonical schema. The signal is never silently dropped a
160
+ best-effort write failure is logged, not swallowed into a promise of a
161
+ side-file that no reader consumes.
156
162
 
157
163
  #### Log Level Control
158
164
 
@@ -260,26 +266,37 @@ budget grounds.
260
266
 
261
267
  1. **Context First:** Before proposing any solution, understand the
262
268
  repository's tech stack, historical context, and structure.
263
- - **Mandatory Reading (planning & interactive tasks)**: For planning
264
- (`/plan`) and interactive tasks, before starting ANY work you MUST read
265
- every file listed in `project.docsContextFiles` in `.agentrc.json`.
266
- This list is the project's authoritative reference set (architecture,
267
- data dictionary, decisions log, patterns, etc.) and replaces any
268
- hardcoded filename list. Resolve each entry against
269
- `project.paths.docsRoot` (default `docs/`) and skip silently
270
- when an entry's file is absent. The decisions log (`decisions.md`) may
271
- be either a single-file dated-entry log or an **index** into a
272
- `decisions/` ADR directory both are first-class layouts (see
269
+ - **Digest-first Reading (planning & interactive tasks, Story #4433)**:
270
+ For planning (`/plan`) and interactive tasks, read the project's **docs
271
+ digest** before reading any full doc file do not read every file
272
+ listed in `project.docsContextFiles` up front. The epic planning path
273
+ ensures (generates or reuses) a per-Epic docs digest — a single compact
274
+ outline (path, byte size, heading outline with line numbers, and the
275
+ first paragraph under each `##`) built from `project.docsContextFiles`
276
+ at `temp/epic-<epicId>/docs-digest.md` (`epic-plan-spec.js
277
+ --emit-context`, via the shared generator in
278
+ `.agents/scripts/lib/orchestration/docs-digest.js`; the same file the
279
+ `/deliver` story sub-agents below already consume). Use the digest to
280
+ decide which docs bear on the task at hand, then **pull the full file
281
+ on demand** (jump to the section at the line number the digest names)
282
+ when a section actually bears on the decision. The decisions log
283
+ (`decisions.md`) may be either a single-file dated-entry log or an
284
+ **index** into a `decisions/` ADR directory — both are first-class
285
+ layouts (see
273
286
  [`skills/core/documentation-and-adrs`](skills/core/documentation-and-adrs/SKILL.md)).
274
- When it is an index, only the index is the mandatory-read; the
275
- per-ADR bodies under `decisions/` are link-followed on demand
276
- (index-only by default), not auto-loaded into every task's context.
287
+ When it is an index, treat the index like any other digested doc —
288
+ link-follow the per-ADR bodies under `decisions/` on demand, not
289
+ auto-loaded into every task's context. When no digest exists yet for
290
+ the task at hand (an ad hoc interactive task with no Epic in scope, or
291
+ `project.docsContextFiles` unset) there is no mandatory docs read —
292
+ read a full doc only when the task itself points you at one. This is a
293
+ hard cutover: there is no read-every-`docsContextFiles`-file branch
294
+ retained.
277
295
  - **Digest-first Reading (`/deliver` story sub-agents)**: A `/deliver`
278
296
  Story delivery sub-agent (dispatched via `helpers/epic-deliver-story` or
279
297
  `helpers/single-story-deliver`) does **not** re-read the full
280
298
  `project.docsContextFiles` set per Story. Instead it reads the **per-Epic
281
- docs digest** — a single compact outline (path, byte size, heading
282
- outline with line numbers, and the first paragraph under each `##`) that
299
+ docs digest** — the same file and shape described above — that
283
300
  `epic-deliver-prepare.js` writes to
284
301
  `temp/epic-<epicId>/docs-digest.md` and the parent threads into the
285
302
  child prompt as `docsDigestPath`. Use the digest to decide which docs are
@@ -291,6 +308,19 @@ budget grounds.
291
308
  points you at one. This is the hard cutover from the former
292
309
  read-every-file-per-Story rule: delivery children no longer ingest the
293
310
  whole docs set up front.
311
+ - **Standalone-Story planning path (`story-plan.js --emit-context`)**:
312
+ The standalone counterpart to `/plan` for Stories that do not attach
313
+ to an Epic does not write a `docs-digest.md` file at all — there is
314
+ no per-Epic directory to anchor one. Instead `buildCorpusContext`
315
+ (`.agents/scripts/lib/planning-corpus.js`) builds the same compact
316
+ digest shape in memory and threads it inline as
317
+ `corpusContext.docsDigest` on the `--emit-context` envelope, next to
318
+ `corpusContext.relevantSections` (ranked excerpts from existing
319
+ Epics' Tech Spec sections). Treat `corpusContext.docsDigest` exactly
320
+ like the file-based digest above — decide relevance from the outline,
321
+ then pull the full file on demand — the only difference is the
322
+ delivery mechanism (inline JSON field vs. a temp file path), not the
323
+ content or the digest-first discipline.
294
324
  - **Conditional Reads**: When the task touches UI copy, layout, or
295
325
  routing and the corresponding file is present in the project, also
296
326
  read `docs/style-guide.md` and `docs/web-routes.md`. Skip both when