Personal Telegram developer console for GitHub
feat(delivery): complete final delivery rows 16-20
* feat(delivery): add final delivery gates 16-20 * test(delivery): cover final delivery gates * docs(delivery): define rows 16-20 acceptance * docs(ops): add production operations runbook
davoodmehraban89 committed
Oct 5, 2026 at 08:36 UTC
4e04a0fcbae34891b6158f53d3091c542c231aca
4 files changed
+121
docs/FINAL_DELIVERY_16_20.md
new
+30
@@ -0,0 +1,30 @@
1
+# Nexa Dev Bot — Final Delivery Rows 16–20
2
+
3
+Final delivery is evidence-gated and fail-closed. CI success alone is never enough to declare completion.
4
+
5
+## 16 — Release integrity
6
+The exact `main` SHA must be known, CI on the delivery change must succeed, and the production deployment workflow must succeed. A branch-only green run is insufficient.
7
+
8
+## 17 — Runtime verification
9
+The deployed revision must correspond to the accepted `main` revision and the production runtime must be healthy. Provider/runtime failures remain explicit; no synthetic success is allowed.
10
+
11
+## 18 — Rollback readiness
12
+A known-good production version must exist and rollback procedure must be documented. Rollback/redeploy remains subject to the existing Safe Approval policy and must never create a bypass around owner/action/risk/target/expiry binding or durable replay protection.
13
+
14
+## 19 — Operations handoff
15
+The repository must contain an operator runbook, security invariants, and a monitoring/incident path. Secret values, source/draft bodies and signed approval tokens must not be copied into handoff evidence.
16
+
17
+## 20 — Final acceptance
18
+All tests must be green, no critical blocker may remain open for the delivered scope, and exact delivery evidence must be recorded. Final acceptance is invalidated by any failed prerequisite row.
19
+
20
+## Locked invariants
21
+- Owner-only private Telegram operations.
22
+- READ owner-only; WRITE/DESTRUCTIVE behind central policy and Safe Approval.
23
+- One-time durable replay protection.
24
+- Workspace provider writes remain branch-first; no direct `main` mutation.
25
+- Public `/status` stays minimal and contains no owner diagnostics.
26
+- Production and Preview state remain isolated.
27
+- Provider errors are explicit and never converted to success.
28
+
29
+## Verification order
30
+PR CI → locked-head merge → post-merge `main` CI → exact-SHA deploy → production runtime verification → rollback readiness check → operations/security handoff review → evidence record.
docs/OPERATIONS_RUNBOOK.md
new
+24
@@ -0,0 +1,24 @@
1
+# Nexa Dev Bot — Production Operations Runbook
2
+
3
+## Release gate
4
+1. Identify the exact candidate commit SHA.
5
+2. Require successful PR CI.
6
+3. Merge only the reviewed head.
7
+4. Require successful post-merge CI on the exact `main` SHA.
8
+5. Deploy only that verified SHA through the repository deployment workflow.
9
+6. Verify production runtime independently before acceptance.
10
+
11
+## Runtime incident path
12
+Treat failed CI/deploy, provider errors, Worker runtime degradation, approval/replay failures, and GitHub/Cloudflare evidence mismatch as explicit failures. Preserve bounded non-secret evidence: exact SHA, workflow/run/job IDs, deployment/version IDs, action ID, outcome and timestamp. Never persist tokens, secret values, source/draft bodies or signed approval callbacks.
13
+
14
+## Rollback
15
+Rollback only to a known-good deployed version. Any Cloudflare operation changing deployed code remains DESTRUCTIVE and must use owner-bound Safe Approval with durable one-time replay protection. After rollback, independently verify active version/traffic/runtime state and record the evidence.
16
+
17
+## Workspace safety
18
+Workspace mutations remain Draft → Diff → Commit Message → Ready → Safe Approval → branch commit. The target is `nexa/edit-*`; direct `main` mutation, force update and silent conflict resolution are prohibited.
19
+
20
+## Security regression gate
21
+Before accepting a release, verify owner-only Telegram boundary, central action policy, HMAC approval verification, durable replay guard, owner-scoped Workspace state, explicit provider failures, bounded Telegram rendering, minimal public `/status`, and Production/Preview isolation.
22
+
23
+## Recovery
24
+When a provider or validation action fails, keep the failure visible and preserve a bounded recovery path. Never report a retry as successful until fresh provider/runtime evidence confirms it.
src/core/final-delivery.js
new
+25
@@ -0,0 +1,25 @@
1
+const DELIVERY_ROWS = Object.freeze([
2
+ { id: 16, key: 'release', title: 'Release integrity', required: ['mainSha', 'ciSuccess', 'deploySuccess'] },
3
+ { id: 17, key: 'runtime', title: 'Runtime verification', required: ['deployedShaMatchesMain', 'runtimeHealthy'] },
4
+ { id: 18, key: 'rollback', title: 'Rollback readiness', required: ['knownGoodVersion', 'rollbackDocumented'] },
5
+ { id: 19, key: 'operations', title: 'Operations handoff', required: ['runbookPresent', 'securityInvariantsPresent', 'monitoringPathPresent'] },
6
+ { id: 20, key: 'acceptance', title: 'Final acceptance', required: ['allTestsGreen', 'noOpenCriticalBlocker', 'evidenceRecorded'] }
7
+]);
8
+
9
+export function getFinalDeliveryRows() {
10
+ return DELIVERY_ROWS.map(row => ({ ...row, required: [...row.required] }));
11
+}
12
+
13
+export function evaluateFinalDelivery(evidence = {}) {
14
+ const rows = DELIVERY_ROWS.map(row => {
15
+ const missing = row.required.filter(key => evidence[key] !== true && !(key === 'mainSha' && typeof evidence[key] === 'string' && evidence[key].length >= 7) && !(key === 'knownGoodVersion' && typeof evidence[key] === 'string' && evidence[key].length > 0));
16
+ return { id: row.id, key: row.key, title: row.title, complete: missing.length === 0, missing };
17
+ });
18
+ return { complete: rows.every(row => row.complete), rows };
19
+}
20
+
21
+export function renderFinalDeliverySummary(evidence = {}) {
22
+ const report = evaluateFinalDelivery(evidence);
23
+ const lines = report.rows.map(row => `${row.complete ? '✅' : '⛔'} ${row.id}. ${row.title}${row.complete ? '' : ` — missing: ${row.missing.join(', ')}`}`);
24
+ return [`Final delivery: ${report.complete ? 'ACCEPTED' : 'BLOCKED'}`, ...lines].join('\n');
25
+}
test/final-delivery.test.js
new
+42
@@ -0,0 +1,42 @@
1
+import test from 'node:test';
2
+import assert from 'node:assert/strict';
3
+import { evaluateFinalDelivery, getFinalDeliveryRows, renderFinalDeliverySummary } from '../src/core/final-delivery.js';
4
+
5
+const accepted = {
6
+ mainSha: '3fdcbe613b02768a24a3bbfbf66fb247a0897092',
7
+ ciSuccess: true,
8
+ deploySuccess: true,
9
+ deployedShaMatchesMain: true,
10
+ runtimeHealthy: true,
11
+ knownGoodVersion: 'known-good',
12
+ rollbackDocumented: true,
13
+ runbookPresent: true,
14
+ securityInvariantsPresent: true,
15
+ monitoringPathPresent: true,
16
+ allTestsGreen: true,
17
+ noOpenCriticalBlocker: true,
18
+ evidenceRecorded: true
19
+};
20
+
21
+test('rows 16-20 are explicit and stable', () => {
22
+ assert.deepEqual(getFinalDeliveryRows().map(row => row.id), [16, 17, 18, 19, 20]);
23
+});
24
+
25
+test('final acceptance is fail closed when evidence is absent', () => {
26
+ const report = evaluateFinalDelivery({});
27
+ assert.equal(report.complete, false);
28
+ assert.equal(report.rows.every(row => row.complete === false), true);
29
+});
30
+
31
+test('final acceptance passes only with all required evidence', () => {
32
+ const report = evaluateFinalDelivery(accepted);
33
+ assert.equal(report.complete, true);
34
+ assert.equal(report.rows.every(row => row.complete), true);
35
+ assert.match(renderFinalDeliverySummary(accepted), /Final delivery: ACCEPTED/);
36
+});
37
+
38
+test('one failed runtime gate blocks the whole delivery', () => {
39
+ const report = evaluateFinalDelivery({ ...accepted, runtimeHealthy: false });
40
+ assert.equal(report.complete, false);
41
+ assert.deepEqual(report.rows.find(row => row.id === 17).missing, ['runtimeHealthy']);
42
+});