redlinegate 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +188 -0
  3. package/commands/redline-init.md +54 -0
  4. package/commands/redline-verify.md +69 -0
  5. package/dist/bin/redline.js +605 -0
  6. package/dist/bin/redline.js.map +1 -0
  7. package/dist/commands/exempt.js +45 -0
  8. package/dist/commands/exempt.js.map +1 -0
  9. package/dist/commands/init.js +615 -0
  10. package/dist/commands/init.js.map +1 -0
  11. package/dist/commands/policy.js +25 -0
  12. package/dist/commands/policy.js.map +1 -0
  13. package/dist/commands/remove.js +427 -0
  14. package/dist/commands/remove.js.map +1 -0
  15. package/dist/commands/review.js +72 -0
  16. package/dist/commands/review.js.map +1 -0
  17. package/dist/commands/sync.js +42 -0
  18. package/dist/commands/sync.js.map +1 -0
  19. package/dist/commands/verify.js +478 -0
  20. package/dist/commands/verify.js.map +1 -0
  21. package/dist/config/redline-json.js +187 -0
  22. package/dist/config/redline-json.js.map +1 -0
  23. package/dist/core/errors.js +25 -0
  24. package/dist/core/errors.js.map +1 -0
  25. package/dist/core/git.js +152 -0
  26. package/dist/core/git.js.map +1 -0
  27. package/dist/core/log.js +22 -0
  28. package/dist/core/log.js.map +1 -0
  29. package/dist/core/severity.js +16 -0
  30. package/dist/core/severity.js.map +1 -0
  31. package/dist/core/version.js +15 -0
  32. package/dist/core/version.js.map +1 -0
  33. package/dist/detect/scan.js +79 -0
  34. package/dist/detect/scan.js.map +1 -0
  35. package/dist/detect/stack.js +71 -0
  36. package/dist/detect/stack.js.map +1 -0
  37. package/dist/enforce/ladder.js +148 -0
  38. package/dist/enforce/ladder.js.map +1 -0
  39. package/dist/exempt/parse.js +86 -0
  40. package/dist/exempt/parse.js.map +1 -0
  41. package/dist/metrics/options.js +257 -0
  42. package/dist/metrics/options.js.map +1 -0
  43. package/dist/metrics/run.js +72 -0
  44. package/dist/metrics/run.js.map +1 -0
  45. package/dist/platforms/azure/client.js +53 -0
  46. package/dist/platforms/azure/client.js.map +1 -0
  47. package/dist/platforms/azure/index.js +69 -0
  48. package/dist/platforms/azure/index.js.map +1 -0
  49. package/dist/platforms/azure/install.js +917 -0
  50. package/dist/platforms/azure/install.js.map +1 -0
  51. package/dist/platforms/azure/policy-types.js +70 -0
  52. package/dist/platforms/azure/policy-types.js.map +1 -0
  53. package/dist/platforms/azure/verify.js +309 -0
  54. package/dist/platforms/azure/verify.js.map +1 -0
  55. package/dist/platforms/detect.js +40 -0
  56. package/dist/platforms/detect.js.map +1 -0
  57. package/dist/platforms/github/client.js +49 -0
  58. package/dist/platforms/github/client.js.map +1 -0
  59. package/dist/platforms/github/index.js +54 -0
  60. package/dist/platforms/github/index.js.map +1 -0
  61. package/dist/platforms/github/install.js +558 -0
  62. package/dist/platforms/github/install.js.map +1 -0
  63. package/dist/platforms/github/push.js +102 -0
  64. package/dist/platforms/github/push.js.map +1 -0
  65. package/dist/platforms/github/remote.js +36 -0
  66. package/dist/platforms/github/remote.js.map +1 -0
  67. package/dist/platforms/github/verify.js +366 -0
  68. package/dist/platforms/github/verify.js.map +1 -0
  69. package/dist/platforms/http.js +58 -0
  70. package/dist/platforms/http.js.map +1 -0
  71. package/dist/platforms/pull-request-templates.js +157 -0
  72. package/dist/platforms/pull-request-templates.js.map +1 -0
  73. package/dist/platforms/remote.js +21 -0
  74. package/dist/platforms/remote.js.map +1 -0
  75. package/dist/platforms/resolve.js +69 -0
  76. package/dist/platforms/resolve.js.map +1 -0
  77. package/dist/platforms/shape.js +19 -0
  78. package/dist/platforms/shape.js.map +1 -0
  79. package/dist/platforms/types.js +24 -0
  80. package/dist/platforms/types.js.map +1 -0
  81. package/dist/policy/checks.js +91 -0
  82. package/dist/policy/checks.js.map +1 -0
  83. package/dist/policy/diff.js +50 -0
  84. package/dist/policy/diff.js.map +1 -0
  85. package/dist/registry/discover.js +74 -0
  86. package/dist/registry/discover.js.map +1 -0
  87. package/dist/registry/serialize.js +41 -0
  88. package/dist/registry/serialize.js.map +1 -0
  89. package/dist/registry/types.js +2 -0
  90. package/dist/registry/types.js.map +1 -0
  91. package/dist/remove/host.js +294 -0
  92. package/dist/remove/host.js.map +1 -0
  93. package/dist/render/commands.js +139 -0
  94. package/dist/render/commands.js.map +1 -0
  95. package/dist/render/manifest.js +82 -0
  96. package/dist/render/manifest.js.map +1 -0
  97. package/dist/render/markers.js +166 -0
  98. package/dist/render/markers.js.map +1 -0
  99. package/dist/render/profile.js +23 -0
  100. package/dist/render/profile.js.map +1 -0
  101. package/dist/render/standards.js +169 -0
  102. package/dist/render/standards.js.map +1 -0
  103. package/dist/render/vendors.js +199 -0
  104. package/dist/render/vendors.js.map +1 -0
  105. package/dist/review/engines/api.js +95 -0
  106. package/dist/review/engines/api.js.map +1 -0
  107. package/dist/review/engines/embedded.js +20 -0
  108. package/dist/review/engines/embedded.js.map +1 -0
  109. package/dist/review/engines/types.js +2 -0
  110. package/dist/review/engines/types.js.map +1 -0
  111. package/dist/review/glob.js +29 -0
  112. package/dist/review/glob.js.map +1 -0
  113. package/dist/review/prompt.js +45 -0
  114. package/dist/review/prompt.js.map +1 -0
  115. package/dist/review/rules.js +25 -0
  116. package/dist/review/rules.js.map +1 -0
  117. package/dist/review/schema.js +84 -0
  118. package/dist/review/schema.js.map +1 -0
  119. package/dist/review/scope.js +27 -0
  120. package/dist/review/scope.js.map +1 -0
  121. package/dist/sarif/map.js +58 -0
  122. package/dist/sarif/map.js.map +1 -0
  123. package/dist/sarif/parse.js +88 -0
  124. package/dist/sarif/parse.js.map +1 -0
  125. package/dist/sarif/types.js +2 -0
  126. package/dist/sarif/types.js.map +1 -0
  127. package/dist/sync/host.js +21 -0
  128. package/dist/sync/host.js.map +1 -0
  129. package/dist/sync/plan.js +47 -0
  130. package/dist/sync/plan.js.map +1 -0
  131. package/dist/sync/render.js +57 -0
  132. package/dist/sync/render.js.map +1 -0
  133. package/dist/sync/run.js +118 -0
  134. package/dist/sync/run.js.map +1 -0
  135. package/dist/verify/host.js +52 -0
  136. package/dist/verify/host.js.map +1 -0
  137. package/dist/verify/remote.js +146 -0
  138. package/dist/verify/remote.js.map +1 -0
  139. package/package.json +52 -0
  140. package/platforms/azure/gate-template.yml +105 -0
  141. package/rulesets/redline-org-ruleset.json +46 -0
  142. package/rulesets/redline-ruleset.json +49 -0
  143. package/scripts/assign-rule-ids.mjs +129 -0
  144. package/scripts/build-baseline.mjs +124 -0
  145. package/scripts/build-correlation.mjs +74 -0
  146. package/scripts/build-dashboard.mjs +584 -0
  147. package/scripts/build-digest.mjs +164 -0
  148. package/scripts/build-inbox.mjs +133 -0
  149. package/scripts/build-registry.mjs +42 -0
  150. package/scripts/build-roi.mjs +181 -0
  151. package/scripts/check-pins.mjs +88 -0
  152. package/scripts/collect-telemetry.mjs +300 -0
  153. package/scripts/lib/__tests__/baseline.test.mjs +132 -0
  154. package/scripts/lib/__tests__/correlate.test.mjs +131 -0
  155. package/scripts/lib/__tests__/dora.test.mjs +110 -0
  156. package/scripts/lib/__tests__/exemptions.test.mjs +85 -0
  157. package/scripts/lib/__tests__/metrics-scanner.test.mjs +65 -0
  158. package/scripts/lib/__tests__/sarif.test.mjs +125 -0
  159. package/scripts/lib/__tests__/spend.test.mjs +64 -0
  160. package/scripts/lib/baseline.mjs +156 -0
  161. package/scripts/lib/correlate.mjs +125 -0
  162. package/scripts/lib/dora.mjs +133 -0
  163. package/scripts/lib/exemptions.mjs +79 -0
  164. package/scripts/lib/metrics.mjs +172 -0
  165. package/scripts/lib/rules.mjs +107 -0
  166. package/scripts/lib/sarif.mjs +108 -0
  167. package/scripts/lib/spend.mjs +69 -0
  168. package/scripts/measure-context.mjs +101 -0
  169. package/scripts/render-self.mjs +18 -0
  170. package/scripts/score-seeds.mjs +294 -0
  171. package/scripts/validate.mjs +394 -0
  172. package/standards/core.md +124 -0
  173. package/standards/manifest.json +214 -0
  174. package/standards/stacks/csharp.md +29 -0
  175. package/standards/stacks/go.md +30 -0
  176. package/standards/stacks/java.md +30 -0
  177. package/standards/stacks/javascript.md +42 -0
  178. package/standards/stacks/kotlin.md +27 -0
  179. package/standards/stacks/microservices.md +37 -0
  180. package/standards/stacks/nodejs.md +34 -0
  181. package/standards/stacks/python.md +29 -0
  182. package/standards/stacks/react-native.md +29 -0
  183. package/standards/stacks/react.md +46 -0
  184. package/standards/stacks/swift.md +26 -0
  185. package/standards/stacks/terraform.md +27 -0
  186. package/templates/CODEOWNERS +29 -0
  187. package/templates/azure/pull_request_template.md +72 -0
  188. package/templates/github/pull_request_template.md +72 -0
  189. package/templates/redline.yml +35 -0
  190. package/templates/repo-context.md +64 -0
  191. package/workflows/dashboard.yml +119 -0
  192. package/workflows/inbox.yml +97 -0
  193. package/workflows/redline-collect.yml +61 -0
  194. package/workflows/redline-gate.yml +301 -0
  195. package/workflows/redline-sync.yml +79 -0
  196. package/workflows/seed-canary.yml +231 -0
  197. package/workflows/verify-onboarding.yml +115 -0
  198. package/workflows/weekly-digest.yml +78 -0
@@ -0,0 +1,478 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { isRedlineError } from "../core/errors.js";
4
+ import { deselectedCapabilities, labelsCarriedByGate, readConfig, } from "../config/redline-json.js";
5
+ import { loadManifest } from "../render/manifest.js";
6
+ import { render } from "../render/standards.js";
7
+ import { LOCAL_HEADING, LOCAL_RULES_FILE, localSection, readLocalRules } from "../render/vendors.js";
8
+ import { observePullRequestTemplates, } from "../platforms/pull-request-templates.js";
9
+ // Which way the two standards versions run. Neither direction is local drift —
10
+ // the repository is in the state its own `redline init` left it in — but the
11
+ // operator's next move differs, so the finding must not tell someone running a
12
+ // pinned older CLI to re-run init and render the repository backwards.
13
+ //
14
+ // Deliberately forgiving: `standardsVersion` is whatever some earlier CLI
15
+ // wrote, so a segment that will not parse compares as 0 rather than throwing,
16
+ // and versions that differ only outside the numbers (a prerelease or build
17
+ // suffix) are reported as the upstream direction — different, and still not
18
+ // local drift.
19
+ function versionOrder(installed, recorded) {
20
+ if (installed === recorded)
21
+ return 'same';
22
+ const parts = (version) => version.split('.').map((segment) => {
23
+ const value = Number.parseInt(segment, 10);
24
+ return Number.isNaN(value) ? 0 : value;
25
+ });
26
+ const left = parts(installed);
27
+ const right = parts(recorded);
28
+ for (let i = 0; i < Math.max(left.length, right.length); i += 1) {
29
+ const a = left[i] ?? 0;
30
+ const b = right[i] ?? 0;
31
+ if (a !== b)
32
+ return a > b ? 'newer' : 'older';
33
+ }
34
+ return 'newer';
35
+ }
36
+ // What `redline verify` says instead of a failure about a capability this
37
+ // repository declined at onboarding. It is neither a pass it did not earn nor
38
+ // the silence that would leave a reader unable to tell "off because we chose
39
+ // to" from "off because it broke".
40
+ const OFF_BY_CHOICE = 'off by choice';
41
+ // The platform arrives as a thunk, not a value: resolving one builds a host
42
+ // client, which resolves a credential and throws `permission` (exit 3) when
43
+ // there is none. A repository whose only problem is that nobody ran
44
+ // `redline init` must not be told it lacks credentials, so the .redline.json
45
+ // short-circuit below runs before the platform is ever resolved.
46
+ export async function verify(platformFor, opts) {
47
+ const findings = [];
48
+ const add = (check, ok, detail) => {
49
+ findings.push({ check, ok, detail });
50
+ };
51
+ // A missing or corrupt .redline.json is a usage problem, not drift: there is
52
+ // nothing else worth checking, so this short-circuits to a single finding.
53
+ // The caller (redline verify's exit-code mapping) uses that single-finding
54
+ // shape to distinguish "not onboarded" (exit 2) from "onboarded but wrong"
55
+ // (exit 1) without verify() itself owning process exit codes.
56
+ let config;
57
+ try {
58
+ config = readConfig(opts.cwd);
59
+ }
60
+ catch (error) {
61
+ const message = isRedlineError(error) ? error.message : String(error);
62
+ add('onboarded', false, message);
63
+ return { findings, ok: false };
64
+ }
65
+ if (!config) {
66
+ add('onboarded', false, `no ${opts.cwd}/.redline.json — run: npx redlinegate init`);
67
+ return { findings, ok: false };
68
+ }
69
+ add('onboarded', true, `profile ${config.profile}, standards v${config.standardsVersion}`);
70
+ // Every remaining check reads from the host or the filesystem. A thrown
71
+ // RedlineError('host', ...) from any platform call below is deliberately
72
+ // left uncaught here: it must propagate out of verify() as a genuine host
73
+ // failure (exit 4), never get reinterpreted as a capability finding. A
74
+ // previous task's bug reported a host 404 as two "denied" capabilities,
75
+ // filing false work against an administrator — that must not repeat here.
76
+ // One finding for the whole selection, so the report describes the entire
77
+ // surface rather than falling silent about the parts that were never
78
+ // installed. Each finding a deselection governs says so again in its own
79
+ // words below, where a reader looking for that capability will be.
80
+ const optedOut = deselectedCapabilities(config.menu, config.capabilities);
81
+ add('capabilities', true, optedOut.length === 0
82
+ ? 'every capability selected'
83
+ : `${OFF_BY_CHOICE} at onboarding, so Redline neither installs nor checks them: ${optedOut.join(', ')}${labelsCarriedByGate(config.capabilities)
84
+ ? '. labels was not deselected: the gate install is what creates them, so a deselected ' +
85
+ 'gate takes them with it'
86
+ : ''}`);
87
+ const platform = await platformFor();
88
+ const ref = await platform.repoRef(opts.cwd);
89
+ // Read before the policy, because whether anything in this repository can
90
+ // publish the Redline check is what decides whether a blocking policy is a
91
+ // working gate or a repository-wide deadlock. Local: no host call.
92
+ const machinery = platform.readGateMachinery(opts.cwd);
93
+ const gateOwned = config.capabilities.gate;
94
+ // A fact about the repository, not about who owns it: a gate file a
95
+ // deselection stopped maintaining still fires on every pull request until
96
+ // someone deletes it. Tying this to `gateOwned` made verify say the check was
97
+ // published and unpublishable in two findings of the same report.
98
+ const publishesExpected = machinery.present && machinery.publishes === machinery.expected;
99
+ // Normally not read at all when the repository declined it: whatever policy
100
+ // is on the host then belongs to a human, and every comparison below would
101
+ // report their own configuration as Redline's drift. The exception is a
102
+ // repository Redline itself gave a blocking policy to before the deselection
103
+ // — that ruleset is still live, still requires the Redline check, and this is
104
+ // the last place anyone finds out before a pull request hangs forever.
105
+ const leftBlocking = !config.capabilities.mergePolicy &&
106
+ config.menu.blockingGate &&
107
+ !config.pendingAdmin.includes('merge-policy');
108
+ const policy = config.capabilities.mergePolicy || leftBlocking ? await platform.readPolicy(ref) : null;
109
+ // Redline applied it, Redline no longer maintains it, and it still requires
110
+ // the Redline check. Two states, and they are not the same sentence: while
111
+ // something still publishes that check nothing is blocked and this is a
112
+ // hazard to name, and once nothing does, every pull request in the repository
113
+ // is blocked forever and it is a failure.
114
+ const leftBlockingPolicy = leftBlocking && policy !== null && policy.blocking;
115
+ const orphanedBlocking = leftBlockingPolicy && !publishesExpected;
116
+ // Every setting `redline init` applies, not just the blocking flag: an
117
+ // administrator who turns off code-owner review or approvals leaves the gate
118
+ // reporting green while the review requirements it was installed for are
119
+ // gone. CONTRACT with cli/commands/init.ts's applyPolicy call: it applies
120
+ // requiredApprovals 1, dismissStaleReviews true, requireCodeOwnerReview from
121
+ // the menu and requireThreadResolution true. Those are literals there and
122
+ // cannot be imported, so raising init's approval count without raising
123
+ // MINIMUM_APPROVALS here would leave a repository sitting at the old count
124
+ // reporting clean. Compared as a floor, not for equality: a team that
125
+ // requires three approvals is stricter than the standard, and failing them
126
+ // would fail their own gate on every pull request.
127
+ const MINIMUM_APPROVALS = 1;
128
+ const weakened = [];
129
+ // Settings the host says it cannot attribute to Redline are reported and
130
+ // never compared — see MergePolicy.unownedSettings.
131
+ const unowned = policy?.unownedSettings ?? [];
132
+ const owned = (setting) => !unowned.includes(setting);
133
+ if (policy !== null) {
134
+ // First, because they make every comparison below moot: a policy the host
135
+ // says is not applying is a policy whose settings are readable and inert,
136
+ // and a policy the host says nothing can satisfy is an outage whoever
137
+ // configured what. `advisoryReason` was printed inside the detail of a
138
+ // PASSING finding whose own words were "every pull request will sit
139
+ // blocked" — Azure sets it in exactly one state (a blocking Status policy
140
+ // with no Build Validation policy to queue the pipeline) and GitHub never
141
+ // sets it, so failing on it cannot produce a false positive anywhere.
142
+ if (policy.notEnforcedReason !== undefined)
143
+ weakened.push(policy.notEnforcedReason);
144
+ if (policy.advisoryReason !== undefined)
145
+ weakened.push(policy.advisoryReason);
146
+ if (policy.blocking !== config.menu.blockingGate) {
147
+ weakened.push(`policy is ${policy.blocking ? 'blocking' : 'advisory'}, config says ${config.menu.blockingGate ? 'blocking' : 'advisory'}`);
148
+ }
149
+ if (owned('requiredApprovals') && policy.requiredApprovals < MINIMUM_APPROVALS) {
150
+ weakened.push(`it requires ${policy.requiredApprovals} approval(s), below the ${MINIMUM_APPROVALS} redline init applied`);
151
+ }
152
+ if (owned('dismissStaleReviews') && !policy.dismissStaleReviews) {
153
+ weakened.push('approvals are no longer dismissed when new commits are pushed, so a review of code that is ' +
154
+ 'no longer in the pull request can carry the merge');
155
+ }
156
+ if (owned('requireCodeOwnerReview') &&
157
+ config.menu.sensitivePathReviewers &&
158
+ !policy.requireCodeOwnerReview) {
159
+ weakened.push('code-owner review is off, so the sensitive paths in CODEOWNERS no longer require their owner');
160
+ }
161
+ if (owned('requireThreadResolution') && !policy.requireThreadResolution) {
162
+ weakened.push('unresolved review threads no longer block a merge');
163
+ }
164
+ }
165
+ add('merge-policy', config.capabilities.mergePolicy ? policy !== null && weakened.length === 0 : !orphanedBlocking, !config.capabilities.mergePolicy
166
+ ? orphanedBlocking
167
+ ? 'the merge policy Redline applied here is still blocking and still requires ' +
168
+ `${machinery.expected}, which nothing in this repository publishes — every pull request ` +
169
+ 'is blocked until you relax or delete it on the host, or re-select the gate'
170
+ : leftBlockingPolicy
171
+ ? `${OFF_BY_CHOICE}, but the merge policy Redline applied here is still blocking and ` +
172
+ `still requires ${machinery.expected} — only ${machinery.path} publishes that, and ` +
173
+ 'Redline no longer maintains it, so deleting it blocks every pull request'
174
+ : `${OFF_BY_CHOICE} — this repository manages its own branch policy, so Redline applies none ` +
175
+ 'and compares none'
176
+ : policy === null
177
+ ? 'no Redline merge policy found on the host — if this is a repository that was refused ' +
178
+ 'admin rights at onboarding, a plain redline init treats that as settled and will not ' +
179
+ 'retry it: after an administrator grants the rights, run redline init --repair'
180
+ : `${weakened.length === 0
181
+ ? `policy is ${policy.blocking ? 'blocking' : 'advisory'} as configured, ${policy.requiredApprovals} approval(s), code-owner review ${policy.requireCodeOwnerReview ? 'on' : 'off'}`
182
+ : weakened.join('; ')}${unowned.length > 0 ? `; not compared here: ${unowned.join(', ')}` : ''}`);
183
+ // The check-name comparison is the highest-value check in the product: an
184
+ // unsatisfiable required-check name silently blocks every pull request.
185
+ // It runs whenever the host has any pull request to inspect, independent
186
+ // of whether the live policy currently lists required checks — an
187
+ // advisory (non-blocking) gate has no required checks by design, but the
188
+ // check name still needs confirming before anyone promotes it to blocking.
189
+ // Read from the local checkout, not the host: the file `init` wrote is the
190
+ // only evidence that separates "the gate has not run on this pull request
191
+ // yet" — which is not drift, and used to fail healthy repositories daily —
192
+ // from "the gate is gone or renamed", which is an outage nothing else in
193
+ // this command observes. render() covers rendered standards artifacts only,
194
+ // so before this the deletion was invisible.
195
+ const requiredChecks = policy?.requiredChecks ?? [];
196
+ // Three separate failures, and they need three different sentences. The
197
+ // renamed case is not "the policy requires something else": telling an
198
+ // operator whose job id is already correct to rename it back points them at
199
+ // a fiction, and it was reachable — an advisory repository requires no
200
+ // checks, so a rename there used to pass entirely.
201
+ const renamed = machinery.publishes !== null && machinery.publishes !== machinery.expected;
202
+ const policyMoved = machinery.publishes !== null &&
203
+ !renamed &&
204
+ requiredChecks.length > 0 &&
205
+ !requiredChecks.includes(machinery.publishes);
206
+ const machineryHealthy = machinery.present && machinery.publishes !== null && !renamed && !policyMoved;
207
+ add('gate-machinery', !gateOwned || machineryHealthy, !gateOwned
208
+ ? machinery.present
209
+ ? // The file is not deleted by a deselection — deleting a repository's
210
+ // files is not Redline's to do — so saying Redline installs none here
211
+ // would describe a state this repository is not in, and would invite
212
+ // the operator to delete a workflow that is still running. Where a
213
+ // blocking policy Redline left behind still needs it, this must not
214
+ // invite that deletion at all: the merge-policy finding above says
215
+ // the same deletion blocks every pull request.
216
+ `${OFF_BY_CHOICE} — Redline no longer maintains a gate here, but ${machinery.path} from ` +
217
+ `an earlier run is still present and still publishes ${machinery.publishes ?? machinery.expected}` +
218
+ `${leftBlockingPolicy
219
+ ? ', which the still-blocking merge policy needs — see the merge-policy finding'
220
+ : '; it is yours to keep or delete'}`
221
+ : `${OFF_BY_CHOICE} — this repository publishes its own merge gate, so Redline installs none ` +
222
+ `at ${machinery.path}`
223
+ : !machinery.present
224
+ ? `${machinery.path} is not in this repository, so nothing will ever publish ${machinery.expected}` +
225
+ `${requiredChecks.includes(machinery.expected) ? ' — which the policy requires' : ''}` +
226
+ '; re-run redline init'
227
+ : machinery.publishes === null
228
+ ? `${machinery.path} no longer publishes ${machinery.expected} — the gate is not triggered by ` +
229
+ 'pull requests, or the part of the file that reports it has been edited; re-run redline init'
230
+ : renamed
231
+ ? `${machinery.path} publishes ${machinery.publishes} rather than ${machinery.expected}, so no ` +
232
+ 'policy requiring the Redline gate can ever be satisfied; rename it back or re-run redline init'
233
+ : policyMoved
234
+ ? `${machinery.path} publishes ${machinery.expected} as installed, but the policy requires ` +
235
+ `${requiredChecks.join(', ')} — the policy no longer requires the Redline gate, so fix the ` +
236
+ 'policy rather than the workflow'
237
+ : `${machinery.path} publishes ${machinery.publishes}`);
238
+ const pr = await platform.latestPullRequestNumber(ref);
239
+ if (pr === null) {
240
+ add('check-name-reported', true, 'no pull request yet — open one to confirm the check reports');
241
+ }
242
+ else {
243
+ const reported = await platform.readReportedCheckNames(ref, pr);
244
+ const required = requiredChecks;
245
+ const missing = required.filter((name) => !reported.includes(name));
246
+ // The host is asked about the newest pull request of any state, which on a
247
+ // healthy repository is routinely one that predates the gate — merged
248
+ // before onboarding, or never updated since. Nothing Redline-shaped ran on
249
+ // that head SHA, so the required check being absent from it is evidence of
250
+ // nothing at all, and reporting a broken contract from it failed healthy
251
+ // repositories and, through the Azure gate, every pull request in them.
252
+ // The gate publishes `redline-gate / gate` on GitHub and `redline/gate` on
253
+ // Azure (github/install.ts REQUIRED_CHECK, azure/policy-types.ts
254
+ // AZURE_STATUS_GENRE), so a reported name under that prefix is a gate run
255
+ // — including one published under a name the policy does not require,
256
+ // which is exactly the misconfiguration worth failing for.
257
+ //
258
+ // This path is only safe because the gate-machinery finding below fails
259
+ // when nothing in the repository can publish the check at all. Soften one
260
+ // without the other and a deleted or renamed gate reports green while
261
+ // every pull request in the repository is blocked forever.
262
+ const gateRan = reported.some((name) => name.toLowerCase().startsWith('redline'));
263
+ if (required.length > 0 && missing.length > 0 && !gateRan) {
264
+ add('check-name-reported', true, machineryHealthy
265
+ ? `no gate run observed yet on PR #${pr} — open or update a pull request to see the gate report ` +
266
+ `(the policy requires ${required.join(', ')})`
267
+ : `no Redline gate run has published anything on PR #${pr}'s head commit — see the ` +
268
+ 'gate-machinery finding for why');
269
+ }
270
+ else if (required.length > 0 && missing.length > 0) {
271
+ add('check-name-reported', false, `expected ${missing.join(', ')} but PR #${pr} only reported: ${reported.length > 0 ? reported.join(', ') : '(nothing)'} — ${missing.join(', ')} was never reported${
272
+ // Only a blocking policy blocks. Azure reports required checks off a
273
+ // Status policy that nothing queues a build for, and telling that
274
+ // operator every pull request is blocked sends them after the wrong
275
+ // half of the problem.
276
+ policy?.blocking === true ? ', so the policy will block every pull request in this repository' : ''}`);
277
+ }
278
+ else if (required.length > 0) {
279
+ add('check-name-reported', true, `required checks reported on PR #${pr}: ${required.join(', ')}`);
280
+ }
281
+ else {
282
+ add('check-name-reported', true, `${gateOwned && config.capabilities.mergePolicy
283
+ ? 'no required check configured yet (advisory gate)'
284
+ : // Only the two that decide whether a required check of Redline's
285
+ // could exist at all. Naming the rest of the selection here would
286
+ // point the reader at capabilities that have nothing to do with it.
287
+ `no required check of Redline's — ${[
288
+ ...(gateOwned ? [] : ['gate']),
289
+ ...(config.capabilities.mergePolicy ? [] : ['merge-policy']),
290
+ ].join(', ')} ${OFF_BY_CHOICE}`} — PR #${pr} reported: ${reported.length > 0 ? reported.join(', ') : '(nothing)'}`);
291
+ }
292
+ }
293
+ // Four states, not two — `applied`/`already` are positive answers and
294
+ // `denied` is a negative one; all three are definite. `unsupported` and
295
+ // `unknown` are the two ways nothing was answered, and they are not the
296
+ // same thing (Task 17). `unsupported` is ALSO definite — Advanced Security
297
+ // is unlicensed on this Azure repository, so no administrator action ever
298
+ // makes it appear, and it must never fail a plain `redline verify` the way
299
+ // a real gap does. `unknown` is the indeterminate one — GitHub omits
300
+ // security_and_analysis for a token without admin permission, and Azure's
301
+ // enablement endpoint cannot tell "you cannot see this" apart from a
302
+ // well-formed refusal — so "security floor enabled" must never be printed
303
+ // on the strength of it either. `--gate` has exactly one caller:
304
+ // platforms/azure/gate-template.yml, whose "Redline gate" step runs as
305
+ // `$(System.AccessToken)` — the build service identity, which is not a
306
+ // repository administrator and so is routinely refused the Advanced
307
+ // Security enablement endpoint. Failing there for what that identity
308
+ // structurally cannot see would block every pull request in the
309
+ // repository, and a gate that always fails is a gate nobody keeps, so the
310
+ // gate run is told what could not be checked without being failed for it.
311
+ // (workflows/verify-onboarding.yml, the fleet re-verification job, is
312
+ // `if: false` and still shells out to a deleted script — it invokes this
313
+ // CLI nowhere.) A `denied` capability fails in both modes; an `unsupported`
314
+ // one never fails either.
315
+ const security = await platform.readSecurityState(ref);
316
+ const off = security.outcomes.filter((o) => o.status === 'denied').map((o) => o.capability);
317
+ const unlicensed = security.outcomes
318
+ .filter((o) => o.status === 'unsupported')
319
+ .map((o) => o.capability);
320
+ const unobserved = security.outcomes
321
+ .filter((o) => o.status === 'unknown')
322
+ .map((o) => o.capability);
323
+ const unlicensedDetail = `not available on this repository: ${unlicensed.join(', ')}`;
324
+ const unobservedDetail = `not confirmed: ${unobserved.join(', ')} — not visible to this token`;
325
+ add('security-floor', off.length === 0 && (unobserved.length === 0 || opts.gate === true), [
326
+ off.length > 0 ? `disabled: ${off.join(', ')}` : null,
327
+ unobserved.length > 0 ? unobservedDetail : null,
328
+ unlicensed.length > 0 ? unlicensedDetail : null,
329
+ ]
330
+ .filter((s) => s !== null)
331
+ .join('. ') || 'security floor enabled');
332
+ // Read-only: render() runs in check mode, which reports staleness without
333
+ // writing or touching the working tree.
334
+ const manifest = loadManifest(opts.root);
335
+ const rendered = render({
336
+ root: opts.root,
337
+ profile: config.profile,
338
+ out: opts.cwd,
339
+ vendors: config.vendors,
340
+ check: true,
341
+ });
342
+ const stale = rendered.stale;
343
+ // A repository's own rules file is not something the repository can be
344
+ // failing at: the artifacts trail it until the next render, which is work to
345
+ // do. The excuse is bounded three ways, because an unbounded one is a drift
346
+ // bypass in the oversight product itself — the local section is rendered into
347
+ // four artifacts, and every other managed file (each
348
+ // `.github/instructions/redline-*.instructions.md`, each per-stack
349
+ // `.cursor/rules/redline-*.mdc`) can never carry it, so "some stale artifact
350
+ // lacks the section" excused hand edits the local file had nothing to do
351
+ // with. It has to be per-path, it has to cover the WHOLE stale set, and a
352
+ // removal is never explained by a rules file at all.
353
+ const local = readLocalRules(opts.cwd);
354
+ const section = local === null ? null : localSection(local);
355
+ const explainedByLocalRules = (relPath) => {
356
+ if (!rendered.localRuleFiles.includes(relPath))
357
+ return false;
358
+ const path = join(opts.cwd, relPath);
359
+ if (!existsSync(path))
360
+ return false; // a missing artifact is stale for its own reason
361
+ const body = readFileSync(path, 'utf8');
362
+ // With a rules file present: the artifact does not yet carry the section
363
+ // this render would give it. With none: it still carries a section this
364
+ // render would take away — and only when the last run recorded one, which
365
+ // is what tells "had one and it went away" from a heading a human typed.
366
+ return section === null ? config.localRules && body.includes(LOCAL_HEADING) : !body.includes(section);
367
+ };
368
+ const localStale = stale.length > 0 &&
369
+ rendered.staleRemovals.length === 0 &&
370
+ rendered.staleWritten.every(explainedByLocalRules);
371
+ // Two different things look identical to render(): a repository someone
372
+ // edited by hand, and a repository the org has moved past. `render()` uses
373
+ // the *installed* CLI's standards, so every publish of standards/** made
374
+ // every onboarded repository stale at once — exit 1 everywhere, and a failed
375
+ // Azure gate on every open pull request, for work only `redline init` can
376
+ // do. The recorded standardsVersion is what tells them apart.
377
+ // Direction matters to the operator even though neither direction is drift:
378
+ // a newer version is a release to adopt, an older one is a pinned CLI
379
+ // rendering rules this repository has already moved past, and telling the
380
+ // second operator to re-run init would render the repository backwards.
381
+ const drift = versionOrder(manifest.version, config.standardsVersion);
382
+ add('artifacts-current', stale.length === 0 || drift !== 'same' || localStale, stale.length === 0
383
+ ? `rendered artifacts match standards v${manifest.version}`
384
+ : drift === 'newer'
385
+ ? `standards updated upstream (v${config.standardsVersion} → v${manifest.version}) — re-run redline init to adopt: ${stale.join(', ')}`
386
+ : drift === 'older'
387
+ ? `this CLI renders standards v${manifest.version}, older than the v${config.standardsVersion} this repository recorded — update the CLI rather than re-running init here: ${stale.join(', ')}`
388
+ : localStale
389
+ ? `this repository's own ${LOCAL_RULES_FILE} has changed since the last render — re-run redline init to fold it in: ${stale.join(', ')}`
390
+ : `stale: ${stale.join(', ')}`);
391
+ // The pull request template is the one thing `redline init` writes that
392
+ // `verify` could not see, so a repository whose template was deleted, or
393
+ // whose markers a human half-edited, or which grew an Azure branch template
394
+ // after onboarding, all looked healthy right up until the next init.
395
+ const templates = observePullRequestTemplates(platform.host, opts.cwd);
396
+ const mangled = templates.filter((t) => t.state === 'mangled');
397
+ const incomplete = templates.filter((t) => t.state === 'incomplete');
398
+ const describe = (t) => `${t.path}${t.branch ? ' (branch template)' : ''}`;
399
+ add('pull-request-template', !gateOwned || (templates.length > 0 && mangled.length === 0 && incomplete.length === 0), !gateOwned
400
+ ? `${OFF_BY_CHOICE} — the pull request template is part of the merge gate this repository declined`
401
+ : templates.length === 0
402
+ ? 'no pull request template — every pull request opens with an empty body, which the gate ' +
403
+ 'fails for having no "## Launch readiness" section; run redline init to restore it'
404
+ : mangled.length > 0
405
+ ? `${mangled.map(describe).join(', ')} has a broken REDLINE:BEGIN/END marker pair — redline init ` +
406
+ 'refuses to write to it until a single pair is restored, so nothing here is being maintained'
407
+ : incomplete.length > 0
408
+ ? `${incomplete
409
+ .map((t) => `${describe(t)} does not answer ${t.missing.join(' or ')}`)
410
+ .join('; ')} — the gate fails a pull request opened from it; run redline init`
411
+ : templates
412
+ .map((t) => `${describe(t)} — ${t.state === 'managed'
413
+ ? 'maintained inside REDLINE markers'
414
+ : "answers the gate on its own, so it stays the repository's own file"}`)
415
+ .join('; '));
416
+ // pendingAdmin is a known, recorded state — not drift — so it gets its own
417
+ // check rather than folding into artifacts-current or security-floor. Every
418
+ // entry records one thing: `redline init` attempted a write and the host
419
+ // refused it. Nothing read here can clear that, so every clause below points
420
+ // at `redline init --repair`, the only run that retries a write a settled
421
+ // repository would otherwise never attempt again.
422
+ //
423
+ // Only a read that answered can produce work for an administrator, and the
424
+ // same rule the security-floor finding runs on applies here — but the two
425
+ // unanswered statuses need different advice, not just different wording.
426
+ // `unsupported` is definite: Advanced Security is not licensed here, so no
427
+ // administrator action would ever clear it. `unknown` is indeterminate: the
428
+ // token could not see the setting, and an administrator enabling it is
429
+ // exactly what clears it. Giving `unknown` the `unsupported` advice had this
430
+ // finding telling the operator nothing would help while security-floor, on
431
+ // the same repository, told them to retry with a token that can see it.
432
+ const statusOf = (capability) => security.outcomes.find((o) => o.capability === capability)?.status ?? null;
433
+ const withStatus = (...statuses) => config.pendingAdmin.filter((capability) => {
434
+ const status = statusOf(capability);
435
+ return status !== null && statuses.includes(status);
436
+ });
437
+ const grantedSince = withStatus('applied', 'already');
438
+ const stillPending = withStatus('denied');
439
+ // Observed, and the answer was definite: "not here to enable".
440
+ const unavailable = withStatus('unsupported');
441
+ // Observed, and nothing was learned.
442
+ const invisible = withStatus('unknown');
443
+ // Never read back at all: labels, review-ownership, repo-property, gate and
444
+ // merge-policy have no read side, so a record of one is exactly as true as
445
+ // the day it was written and no verify run will ever clear it.
446
+ const unverifiable = config.pendingAdmin.filter((capability) => statusOf(capability) === null);
447
+ const clauses = [
448
+ stillPending.length > 0 ? `an administrator must still enable: ${stillPending.join(', ')}` : null,
449
+ unavailable.length > 0
450
+ ? `recorded as pending, but not available on this repository, so no administrator action ` +
451
+ `would clear it: ${unavailable.join(', ')}`
452
+ : null,
453
+ invisible.length > 0
454
+ ? `recorded as pending and not visible to this token: ${invisible.join(', ')} — an ` +
455
+ `administrator enabling it is what clears this, so re-read with a token that can see the ` +
456
+ `setting, then run redline init --repair`
457
+ : null,
458
+ unverifiable.length > 0
459
+ ? `recorded as pending; not verifiable with this token: ${unverifiable.join(', ')} — after an ` +
460
+ `administrator grants access, a plain redline init will not recheck these; run redline init --repair`
461
+ : null,
462
+ grantedSince.length > 0
463
+ ? `${grantedSince.join(', ')} now granted on the host, but the record is of a refused write and ` +
464
+ `no read clears it — run redline init --repair to retry the write`
465
+ : null,
466
+ ].filter((s) => s !== null);
467
+ add('pending-admin',
468
+ // The security-floor shape, for the same reason: `--gate` has one caller,
469
+ // the Azure gate template, running as a build service identity that cannot
470
+ // enable anything. Failing every pull request forever over a record only
471
+ // `redline init` can clear is a gate nobody keeps. An operator who asks
472
+ // whether onboarding finished is still told no, in both directions.
473
+ opts.gate === true ? stillPending.length === 0 : config.pendingAdmin.length === 0, config.pendingAdmin.length === 0
474
+ ? 'nothing awaiting an administrator'
475
+ : `partially onboarded — ${clauses.length > 0 ? clauses.join('. ') : 'nothing left outstanding'}`);
476
+ return { findings, ok: findings.every((f) => f.ok) };
477
+ }
478
+ //# sourceMappingURL=verify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify.js","sourceRoot":"","sources":["../../cli/commands/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,GAEX,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACrG,OAAO,EACL,2BAA2B,GAE5B,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