mustflow 2.117.0 → 2.117.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.
- package/package.json +1 -1
- package/templates/default/i18n.toml +8 -2
- package/templates/default/locales/en/.mustflow/skills/INDEX.md +11 -3
- package/templates/default/locales/en/.mustflow/skills/connection-lifecycle-integrity-review/SKILL.md +302 -0
- package/templates/default/locales/en/.mustflow/skills/connection-lifecycle-integrity-review/references/connection-fault-injection-resource-lifetime-validation.md +277 -0
- package/templates/default/locales/en/.mustflow/skills/connection-lifecycle-integrity-review/references/node-stream-transport-lifecycle-checklist.md +381 -0
- package/templates/default/locales/en/.mustflow/skills/memory-lifetime-review/SKILL.md +94 -2
- package/templates/default/locales/en/.mustflow/skills/memory-lifetime-review/references/cross-runtime-memory-stream-reproduction-harness.md +289 -0
- package/templates/default/locales/en/.mustflow/skills/memory-lifetime-review/references/node-memory-resource-backpressure-diagnostics.md +369 -0
- package/templates/default/locales/en/.mustflow/skills/routes.toml +17 -0
- package/templates/default/manifest.toml +12 -1
package/package.json
CHANGED
|
@@ -62,7 +62,7 @@ translations = {}
|
|
|
62
62
|
[documents."skills.index"]
|
|
63
63
|
source = "locales/en/.mustflow/skills/INDEX.md"
|
|
64
64
|
source_locale = "en"
|
|
65
|
-
revision =
|
|
65
|
+
revision = 293
|
|
66
66
|
translations = {}
|
|
67
67
|
|
|
68
68
|
[documents."skill.ada-code-change"]
|
|
@@ -113,6 +113,12 @@ source_locale = "en"
|
|
|
113
113
|
revision = 1
|
|
114
114
|
translations = {}
|
|
115
115
|
|
|
116
|
+
[documents."skill.connection-lifecycle-integrity-review"]
|
|
117
|
+
source = "locales/en/.mustflow/skills/connection-lifecycle-integrity-review/SKILL.md"
|
|
118
|
+
source_locale = "en"
|
|
119
|
+
revision = 2
|
|
120
|
+
translations = {}
|
|
121
|
+
|
|
116
122
|
[documents."skill.behavior-preserving-refactor"]
|
|
117
123
|
source = "locales/en/.mustflow/skills/behavior-preserving-refactor/SKILL.md"
|
|
118
124
|
source_locale = "en"
|
|
@@ -278,7 +284,7 @@ translations = {}
|
|
|
278
284
|
[documents."skill.memory-lifetime-review"]
|
|
279
285
|
source = "locales/en/.mustflow/skills/memory-lifetime-review/SKILL.md"
|
|
280
286
|
source_locale = "en"
|
|
281
|
-
revision =
|
|
287
|
+
revision = 5
|
|
282
288
|
translations = {}
|
|
283
289
|
|
|
284
290
|
[documents."skill.desktop-memory-footprint-review"]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
mustflow_doc: skills.index
|
|
3
3
|
locale: en
|
|
4
4
|
canonical: true
|
|
5
|
-
revision:
|
|
5
|
+
revision: 293
|
|
6
6
|
authority: router
|
|
7
7
|
lifecycle: mustflow-owned
|
|
8
8
|
---
|
|
@@ -272,7 +272,14 @@ refer to `AGENTS.md` and `.mustflow/config/commands.toml` to implement the most
|
|
|
272
272
|
review rather than prose polishing.
|
|
273
273
|
- Use `memory-lifetime-review` as an adjunct when code creates, registers, caches, spawns, opens,
|
|
274
274
|
subscribes, schedules, streams, or otherwise retains values or resources whose cleanup,
|
|
275
|
-
cancellation, eviction, shutdown,
|
|
275
|
+
cancellation, eviction, shutdown, ownership transfer, RSS/heap/external classification,
|
|
276
|
+
allocator residency, queue-byte growth, end-to-end backpressure, or same-source cross-runtime
|
|
277
|
+
memory and stream reproduction must be reviewed.
|
|
278
|
+
- Use `connection-lifecycle-integrity-review` as an adjunct when TCP sockets, HTTP keep-alive or
|
|
279
|
+
pooling, HTTP/2 streams or sessions, Node or Web Streams, FIN/RST, half-close, destroy or abort
|
|
280
|
+
races, response-body abandonment, reader or writer locks, backpressure, buffer budgets, natural
|
|
281
|
+
process exit, connection shutdown, fault injection, soak testing, resource-growth gates, or
|
|
282
|
+
connection-lifetime resolution claims need transport-lifecycle review.
|
|
276
283
|
- Use `desktop-memory-footprint-review` as an adjunct when Windows, macOS, Linux, Electron,
|
|
277
284
|
WebView, WPF, WinUI, Win32, Qt, Java Swing or JavaFX, .NET, JVM, Rust, C++, Python, or other
|
|
278
285
|
desktop app code needs scenario-level memory review across working set versus private memory,
|
|
@@ -686,7 +693,8 @@ routes. Event routes stay inactive until their event occurs.
|
|
|
686
693
|
| Notification generation, email, push, SMS, in-app inbox, digest, reminder, campaign, announcement, marketing message, transactional message, security alert, receipt, legal notice, notification preference, unsubscribe, suppression, quiet hours, timezone schedule, provider webhook, delivery attempt, notification template, or notification audit work needs notification-delivery triage for duplicate, late, suppressed, unsubscribed, wrong-channel, quiet-hours, timezone, retry, provider-webhook, hard-bounce, complaint, invalid-token, fallback, or audit risk | `.mustflow/skills/notification-delivery-integrity-review/SKILL.md` | User goal, current diff or target files, notification event ledger, notification intent ledger, recipient/channel/category ledger, preference and legal policy ledger, suppression ledger, schedule/timezone/quiet-hours/digest ledger, delivery job and attempt ledger, provider event ledger, in-app inbox ledger, audit/security/privacy/operations ledger, existing tests, and configured command intents | Source event and outbox records, notification intent records, preference snapshots, final pre-send rechecks, suppression records, schedule records, timezone-safe recurring intent, quiet-hours behavior, digest records, delivery jobs, delivery attempts, provider event receipts, provider webhook signature and dedupe handling, in-app inbox state, semantic dedupe keys, queue priority, retry classification, template snapshots, redacted audit logs, campaign dry run/sample/canary/ramp-up/kill-switch controls, focused hostile-path tests, and directly synchronized docs or templates | sendNotification shortcut, global opt-out, marketing consent bypass, provider acceptance treated as delivery, missing outbox, stale recipient scope, hard bounce ignored, complaint ignored, one-click unsubscribe missing, link-scanner mutation, stale push token, logout token leak, collapse key misuse, lockscreen data leak, in-app inbox count drift, mark_all_read_before race, semantic dedupe key missing, aggregation hidden as dedupe, digest window drift, quiet-hours delayed blast, timezone DST bug, provider limit starvation, unknown provider outcome blind retry, poison notification loop, provider webhook signature or dedupe gap, template render-time leak, account deletion pending-send leak, fallback spam, dry-run/sample/canary gap, no why-sent or why-suppressed audit, or happy-path-only notification tests | `changes_status`, `changes_diff_summary`, `lint`, `build`, `test_related`, `test`, `docs_validate_fast`, `test_release`, `mustflow_check` | Notification delivery reviewed, source-event/intent/recipient/preference/suppression/schedule/digest/delivery/provider/inbox/audit map, findings, fixes or recommendation, hostile-path evidence, verification, and remaining notification-delivery risk |
|
|
687
694
|
| Code review or implementation needs api-misuse-resistance triage for APIs, SDKs, function boundaries, service methods, endpoints, command methods, DTOs, request shapes, response shapes, operation names, call ordering, lifecycle setup, boolean parameters, option bags, null or empty semantics, internal table leakage, string-only errors, success-only failure models, idempotency, pagination, sorting, filtering, authorization shape, status mutation, PATCH command buses, time formats, money amounts, open enums, async jobs, bulk partial failures, cacheability, response size, overfragmented calls, internal/external API mixing, version policy, deprecation telemetry, rate limits, retry hints, observability, SDK ergonomics, or caller contract tests | `.mustflow/skills/api-misuse-resistance-review/SKILL.md` | User goal, current diff or target files, caller ledger, operation ledger, shape ledger, compatibility evidence, existing style, and configured command intents | Operation-centered names, explicit lifecycle or builder boundaries, named options or split operations, narrowed option bags, explicit absence and PATCH semantics, public DTO mapping, stable errors, idempotency metadata, cursor stability, auth-specific operations, command-shaped state changes, time and money units, unknown enum handling, job resources, item-level bulk results, cache and rate-limit hints, observability fields, SDK examples, focused tests, and directly synchronized docs or templates | implementation-leaking name, hidden state machine, boolean riddle, trash-can options, null folklore, DB schema frozen as API, string-only error, success-only design, duplicate side effect, moving-list pagination, random default order, hidden permission mode, illegal status transition, PATCH-as-command bus, timezone ambiguity, floating money, closed external enum, fake synchronous completion, erased partial failure, uncacheable expensive read, all-in-one payload bloat, frontend-as-backend call graph, internal/external contract blur, decorative version number, unmeasured deprecation, retry-hostile rate limit, untraceable operation, awkward SDK, happy-path-only contract test, or first-time caller trap | `changes_status`, `changes_diff_summary`, `lint`, `build`, `test_related`, `test`, `test_audit`, `docs_validate_fast`, `test_release`, `mustflow_check` | API misuse resistance reviewed, caller and operation ledgers, shape and contract findings, fixes or recommendation, compatibility notes, verification, and remaining caller-misuse risk |
|
|
688
695
|
| Code review or implementation needs error-message-integrity triage for error text, error codes, validation messages, parse failures, API or CLI error envelopes, public user messages, internal logs, structured diagnostics, exception wrapping, provider errors, retryable flags, idempotency errors, queue or batch failures, partial failures, permission errors, conflict errors, impossible-state errors, support IDs, redaction, stable machine fields, monitoring fields, or troubleshooting text | `.mustflow/skills/error-message-integrity-review/SKILL.md` | User goal, current diff or target files, error audience ledger, error contract ledger, disclosure ledger, recovery ledger, and configured command intents | Stable error codes, expected/actual fields, failed-operation context, reasons, safe identifiers, public/internal message split, redaction, retryability, idempotency metadata, provider metadata, parse positions, range bounds, conflict facts, partial-failure summaries, structured log fields, focused tests, and directly synchronized docs or templates | empty failed label, invalid-value fog, missing action, result repeated as cause, no work context, public/internal message mixing, sensitive value leak, missing safe identifier, retry ambiguity, try-again-later dodge, unstable string-only code, overbroad error bucket, validation info leak, parse location missing, range without bounds, timezone ambiguity, provider evidence loss, cause destruction, brittle message concatenation, prose-only logs, internal jargon in user text, permission existence leak, should-never-happen message, vague conflict, idempotency uncertainty, missing attempt count, partial failure erased, untested error contract, no 30-second next action, or call-site-specific taxonomy drift | `changes_status`, `changes_diff_summary`, `lint`, `build`, `test_related`, `test`, `test_audit`, `docs_validate_fast`, `test_release`, `mustflow_check` | Error message integrity reviewed, surfaces and audiences, code/message contract, evidence and redaction findings, fixes or recommendation, verification, and remaining error-message risk |
|
|
689
|
-
| Object lifetime, retained references, cleanup symmetry, event listeners, timers, subscriptions, goroutines, threads, workers, streams, native handles, caches, queues, registries, closures, or memory/resource leak risk is created, changed, reviewed, or reported | `.mustflow/skills/memory-lifetime-review/SKILL.md` | Lifetime surface, setup
|
|
696
|
+
| Object lifetime, retained references, cleanup symmetry, event listeners, timers, subscriptions, goroutines, threads, workers, streams, native handles, caches, queues, registries, closures, RSS, heap, external memory, ArrayBuffer or Buffer retention, allocator fragmentation, unbounded buffering, backpressure, or memory/resource leak risk is created, changed, reviewed, diagnosed, validated, or reported | `.mustflow/skills/memory-lifetime-review/SKILL.md` | Lifetime surface, setup and cleanup sites, retainer graph, repetition path, success and error paths, storage-location/retention-owner/terminal-status classification, controlled workload phases, post-GC and post-quiescent slopes, request-attempt-branch-stream ownership DAG, byte-flow and queue ledgers, cache/pool/handle evidence, protocol backpressure evidence, statistical tolerance, and configured command intents | Teardown, cancellation, ownership, weak-reference, eviction, queue-bound, stream-close, worker-shutdown, lifecycle-symmetry code, bounded memory and resource instrumentation, queue-byte accounting, terminal invariants, stop/plateau/resume fixtures, focused tests, and directly synchronized docs or templates | long-lived owner retaining short-lived object, setup without cleanup, unstable listener identity, timeout without cancellation, RSS-only diagnosis, overlapping totals subtracted as native memory, heapTotal called live memory, TIME_WAIT called a process leak, unbounded queue called safe because it drains, cache called bounded by TTL alone, fragmentation claimed before live native allocations are ruled out, accepted bytes confused with committed bytes, count HWM used as a byte cap, clone/tee branch abandoned, whole HTTP/2 transport paused for one stream, finalizer-only cleanup, weak-reference cover-up, or missing repeated-lifecycle proof | `changes_status`, `changes_diff_summary`, `lint`, `build`, `test_related`, `test`, `docs_validate_fast`, `test_release`, `mustflow_check` | Lifetime boundary, storage/owner/terminal classification, setup and cleanup owners, ownership DAG, retainer paths, memory floors and slopes, queue/backpressure envelope, stop and resume evidence, repeated-lifecycle proof, verification, and remaining lifetime risk |
|
|
697
|
+
| TCP sockets, HTTP keep-alive or pooling, HTTP/2 streams or sessions, Node.js streams, Web Streams readers or writers, FIN/RST, half-close, destroy or abort races, unconsumed response bodies, backpressure, connection shutdown, transport resource leaks, fault injection, soak tests, or connection-lifetime resolution claims are created, changed, reviewed, debugged, validated, or reported | `.mustflow/skills/connection-lifecycle-integrity-review/SKILL.md` | Protocol and role, physical connection, request, body, lock and pool ownership, event and action ledger, orthogonal lifecycle dimensions, terminal-cause policy, reuse gate, buffer and resource ledgers, shutdown paths, harness isolation, closed-cohort request ledger, fault schedule, clean comparator, seed and duration policy, resource-growth gates, and configured command intents | Transport, read, write, pool, request, body, reader or writer, termination admission, quarantine, body lease, buffer budget, resource scope, shutdown state, diagnostics, fault and soak fixtures, measurement gates, regression contracts, docs, route metadata, and synchronized templates | single closing enum, destroy-everywhere cleanup, duplicate finalize, total-order event assumption, request/socket lifetime collapse, body cancel killing an HTTP/2 session, unsafe keep-alive reuse, unbounded discard, backpressure ignored, pending write double settlement, TIME_WAIT called a leak, flat RSS called a fix, contaminated harness counts, retry-until-green, restart called resolution, unref as cleanup, upgraded transport leak, or natural-exit theater | `changes_status`, `changes_diff_summary`, `lint`, `build`, `test_related`, `test`, `docs_validate_fast`, `test_release`, `mustflow_check` | Protocol and ownership layers, orthogonal states, event/action and primary-cause decisions, finalize/destroy admission, reuse/quarantine and body disposition, resource and buffer invariants, fault and soak evidence, application/library/runtime/environment attribution, resolution classification, verification, and remaining connection-lifecycle risk |
|
|
690
698
|
| Desktop app memory footprint needs scenario-level review for Windows, macOS, Linux, Electron, WebView, WPF, WinUI, Win32, Qt, Java Swing or JavaFX, .NET, JVM, Rust, C++, Python, working set versus private memory, RSS, dirty pages, live set, peak and after-close memory, UI virtualization, data virtualization, renderer and window count, module loading, image decode size, OS-discardable caches, memory-mapped files, `madvise`, `EmptyWorkingSet`, .NET LOH, `ArrayPool<T>`, WPF visual trees, GDI or USER handles, detached DOM nodes, hidden windows or tabs, string deduplication, large buffer capacity, struct padding, object graph shape, undo history, inactive views, low-memory signals, or scenario memory budgets | `.mustflow/skills/desktop-memory-footprint-review/SKILL.md` | Scenario ledger, measurement ledger, UI residency ledger, data residency ledger, cache ledger, runtime ledger, existing tests, package surfaces, synchronized docs or templates, and configured command intents | UI virtualization, data virtualization, container recycling, lazy model fetch, renderer or window disposal, feature-entry module loading, image downsampling, cache cost limits, discardable cache behavior, streaming or memory-mapped file access, mapped-range release hints, low-memory handlers, after-close cleanup, undo compaction, object-shape flattening, string or symbol tables, pooled-buffer scope, native handle release, and focused tests | working-set theater, full UI object creation, UI-only virtualization, hidden renderer retention, eager feature module, original-size thumbnail, item-count-only cache, full file read, mapped range held forever, unsafe pooled buffer return, GDI or USER handle leak, detached DOM retention, console measurement artifact, duplicate string bloat, live-set staircase, cleared-but-huge buffer, padded bulk struct, pointer-heavy row model, whole-document undo snapshot, inactive tab kept fully rendered, no-op low-memory handler, or missing after-close evidence | `changes_status`, `changes_diff_summary`, `lint`, `build`, `test_related`, `test`, `docs_validate_fast`, `test_release`, `mustflow_check` | Desktop memory footprint boundary reviewed, scenario budget, measurement metric, UI/data virtualization, renderer/window, module, media, cache, file, runtime, native handle, UI retention, string, data model, history, inactive view, memory-pressure, after-close evidence, verification, and remaining desktop-memory risk |
|
|
691
699
|
| Code review or implementation needs hot-path triage for repeated ordinary work, external round trips, multi-pass collection chains, hidden quadratic lookup, per-item allocation or serialization, transaction or lock hold time, sequential async waits, unbounded fan-out, cache stampede, queue throughput, retry multiplication, timeout waits, or missing observability before a broader optimization pass | `.mustflow/skills/hot-path-performance-review/SKILL.md` | Hot path, multipliers, per-iteration cost, boundary ledger, data-size and tail-latency evidence, correctness boundaries, and configured command intents | Batching, projection, lookup tables, bounded concurrency, timeout and cancellation wiring, bulk writes, cache-key boundaries, queue backpressure, transaction or lock narrowing, focused tests, and lightweight observability tied to the hot path | repeated I/O in loops, N+1 query, multi-pass array traversal, hidden `O(n^2)` lookup, unbounded `SELECT *`, large offset pagination, index defeat, wide transaction, lock-held slow work, sequential `await`, unbounded `Promise.all`, per-item client creation, cache key explosion, cache stampede, hot-path logging, deep clone, repeated JSON conversion, CPU-heavy request work, queue bottleneck relocation, retry storm, or p95/p99 blind spot | `changes_status`, `changes_diff_summary`, `lint`, `build`, `test_related`, `test`, `docs_validate_fast`, `test_release`, `mustflow_check` | Hot path reviewed, cost ledger, repeated-boundary and hidden-complexity findings, semantics preserved, evidence level, verification, and remaining hot-path performance risk |
|
|
692
700
|
| API endpoints, handlers, controllers, resolvers, serializers, mappers, service methods, middleware, webhook receivers, backend-for-frontend paths, admin APIs, or route-level request paths need latency review for repeated work inside one request | `.mustflow/skills/api-request-performance-review/SKILL.md` | API request boundary, Request cost ledger, route span, DB query count, Redis count, external API calls, pool acquire wait, transaction scope, cache hit or miss, payload and response bytes, serialization time, ORM behavior, correctness boundaries, and configured command intents | Projection narrowing, query-count or lazy-loading guards, bounded batching, request-scope memoization, Redis `MGET` or pipeline use, app-side filtering or sorting cleanup, transaction narrowing, route-level observability, focused tests, and directly synchronized docs or templates | per-request I/O fan-out, ORM serializer lazy loading, eager-load row explosion, `SELECT *`, app-side filtering after overfetch, deep `OFFSET`, expensive `COUNT(*)`, index mismatch for `WHERE` plus `ORDER BY` plus `LIMIT`, external API inside transaction, pool acquire wait hidden behind fast queries, Redis loop, cache miss amplification, repeated JSON serialization, huge response bytes, CPU-heavy request work, Node flame graph gap, Go pprof gap, MongoDB `explain()` gap, or missing OpenTelemetry span evidence | `changes_status`, `changes_diff_summary`, `lint`, `build`, `test_related`, `test`, `docs_validate_fast`, `test_release`, `mustflow_check` | API request path reviewed, Request cost ledger, route-level DB/Redis/external/cache/serialization/CPU findings, evidence level, verification, and remaining API request performance risk |
|
package/templates/default/locales/en/.mustflow/skills/connection-lifecycle-integrity-review/SKILL.md
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.connection-lifecycle-integrity-review
|
|
3
|
+
locale: en
|
|
4
|
+
canonical: true
|
|
5
|
+
revision: 2
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: connection-lifecycle-integrity-review
|
|
9
|
+
description: Apply this skill when TCP sockets, HTTP keep-alive or pooling, HTTP/2 streams or sessions, Node.js streams, Web Streams readers or writers, FIN/RST handling, half-close behavior, destroy or abort races, unconsumed response bodies, backpressure, connection shutdown, transport resource leaks, fault injection, soak tests, or connection-lifetime resolution claims are created, changed, reviewed, debugged, validated, or reported.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.connection-lifecycle-integrity-review
|
|
15
|
+
command_intents:
|
|
16
|
+
- changes_status
|
|
17
|
+
- changes_diff_summary
|
|
18
|
+
- lint
|
|
19
|
+
- build
|
|
20
|
+
- test_related
|
|
21
|
+
- test
|
|
22
|
+
- docs_validate_fast
|
|
23
|
+
- test_release
|
|
24
|
+
- mustflow_check
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# Connection Lifecycle Integrity Review
|
|
28
|
+
|
|
29
|
+
<!-- mustflow-section: purpose -->
|
|
30
|
+
## Purpose
|
|
31
|
+
|
|
32
|
+
Keep physical connections, transport read and write sides, logical requests, response bodies,
|
|
33
|
+
reader or writer ownership, pool eligibility, and process shutdown from being collapsed into one
|
|
34
|
+
misleading lifecycle flag.
|
|
35
|
+
|
|
36
|
+
The central invariant is not that every connection is destroyed. Graceful FIN paths may never call
|
|
37
|
+
`destroy`. The stronger invariant is that every owned connection record is finalized exactly once,
|
|
38
|
+
and an abortive destroy or reset action is accepted at most once.
|
|
39
|
+
|
|
40
|
+
<!-- mustflow-section: use-when -->
|
|
41
|
+
## Use When
|
|
42
|
+
|
|
43
|
+
- TCP, TLS, HTTP/1.1 keep-alive, HTTP/2 multiplexing, HTTP clients, servers, agents, dispatchers,
|
|
44
|
+
connection pools, upgraded sockets, WebSocket, CONNECT, or raw stream transports change.
|
|
45
|
+
- Code handles `end`, `finish`, `error`, `close`, FIN, RST, timeout, abort, `destroy`,
|
|
46
|
+
`resetAndDestroy`, half-close, pending writes, drain, or shutdown deadlines.
|
|
47
|
+
- A logical request, response body, body reader, stream, or HTTP/2 stream can finish or cancel while
|
|
48
|
+
its physical connection or session remains alive.
|
|
49
|
+
- Response bodies can be partially read, paused, abandoned, discarded, cancelled, or left locked.
|
|
50
|
+
- Slow consumers, backpressure, retries, transforms, adapters, or observability capture can retain
|
|
51
|
+
unbounded buffers.
|
|
52
|
+
- A review or report claims that sockets are leak-free, safely reusable, fully drained, naturally
|
|
53
|
+
terminating, or closed exactly once.
|
|
54
|
+
|
|
55
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
56
|
+
## Do Not Use When
|
|
57
|
+
|
|
58
|
+
- The task only changes HTTP schemas, status codes, or headers with no connection, body, pooling,
|
|
59
|
+
cancellation, streaming, or shutdown behavior; use `api-contract-change` or
|
|
60
|
+
`http-api-semantics-review`.
|
|
61
|
+
- The task only changes compression, CDN caching, SSE replay, WebTransport delivery choice, or proxy
|
|
62
|
+
buffering without transport lifetime risk; use `http-delivery-streaming`.
|
|
63
|
+
- The task is a general retained-object or cleanup review without network or stream lifecycle
|
|
64
|
+
semantics; use `memory-lifetime-review`.
|
|
65
|
+
- The task models a durable business entity lifecycle rather than independently closing transport
|
|
66
|
+
dimensions; use `state-machine-pattern`.
|
|
67
|
+
- No connection, request, body, stream, pool, timer, listener, buffer, or shutdown boundary is
|
|
68
|
+
present to inspect.
|
|
69
|
+
|
|
70
|
+
<!-- mustflow-section: required-inputs -->
|
|
71
|
+
## Required Inputs
|
|
72
|
+
|
|
73
|
+
- Protocol and role: raw TCP, TLS, HTTP/1.1, HTTP/2, WebSocket, CONNECT, client, server, proxy, or
|
|
74
|
+
adapter.
|
|
75
|
+
- Ownership ledger for the physical connection or session, logical request, response body, reader,
|
|
76
|
+
writer, pool slot, timers, listeners, retry entries, and buffer reservations.
|
|
77
|
+
- Event and action ledger distinguishing observed events from local actions such as graceful end,
|
|
78
|
+
cancel, destroy, reset, quarantine, pool return, or forced shutdown.
|
|
79
|
+
- State dimensions for transport, readable side, writable side, pool membership, request, body
|
|
80
|
+
disposition, reader or writer lock, and server or client shutdown when each is relevant.
|
|
81
|
+
- Terminal-cause policy, including which contender records the primary cause and how later causes
|
|
82
|
+
are retained for diagnostics without repeating side effects.
|
|
83
|
+
- Reuse criteria, parser or framing boundary evidence, pending write state, buffered bytes, protocol
|
|
84
|
+
corruption state, and body disposition.
|
|
85
|
+
- Success, half-close, timeout, abort, peer reset, writer error, reader cancel, unconsumed body,
|
|
86
|
+
slow-consumer, and shutdown paths that the implementation supports.
|
|
87
|
+
- Relevant command-intent contract entries for tests, build, docs, release checks, and mustflow
|
|
88
|
+
validation.
|
|
89
|
+
- For Node.js, Web Streams, or Undici-specific work, read
|
|
90
|
+
`references/node-stream-transport-lifecycle-checklist.md` before changing event-order,
|
|
91
|
+
cancellation, body-consumption, active-resource, or natural-exit behavior.
|
|
92
|
+
- For repeated fault injection, soak testing, resource-growth gates, runtime or library attribution,
|
|
93
|
+
operational containment, or permanent-resolution claims, read
|
|
94
|
+
`references/connection-fault-injection-resource-lifetime-validation.md` before designing the
|
|
95
|
+
campaign or accepting its conclusion.
|
|
96
|
+
|
|
97
|
+
<!-- mustflow-section: preconditions -->
|
|
98
|
+
## Preconditions
|
|
99
|
+
|
|
100
|
+
- Higher-priority instructions and `.mustflow/config/commands.toml` have been checked for the
|
|
101
|
+
selected repository.
|
|
102
|
+
- Required inputs are available, or missing protocol and ownership decisions can be reported
|
|
103
|
+
without inventing behavior.
|
|
104
|
+
- Version-sensitive runtime behavior is tied to current official documentation or repository tests;
|
|
105
|
+
supplied reference material is guidance, not proof that every runtime version behaves identically.
|
|
106
|
+
- If general retained-reference risk dominates, also use `memory-lifetime-review`.
|
|
107
|
+
- If races between termination contenders dominate, also use `race-condition-review`.
|
|
108
|
+
- If delivery, cache, reconnect, or proxy semantics dominate, also use `http-delivery-streaming`.
|
|
109
|
+
|
|
110
|
+
<!-- mustflow-section: allowed-edits -->
|
|
111
|
+
## Allowed Edits
|
|
112
|
+
|
|
113
|
+
- Add or tighten lifecycle state, terminal-cause arbitration, connection and request scopes, body
|
|
114
|
+
lease policy, pool quarantine, buffer budgets, shutdown phases, diagnostics, and focused tests.
|
|
115
|
+
- Separate physical connection finalization from logical request and body settlement.
|
|
116
|
+
- Centralize graceful-end and abortive-termination actions so timers, abort signals, writer errors,
|
|
117
|
+
and shutdown do not each perform duplicate cleanup.
|
|
118
|
+
- Add bounded discard, cancellation, drain, grace, or force deadlines where protocol semantics allow.
|
|
119
|
+
- Do not call `destroy` from every completion path merely because repeated destruction is a runtime
|
|
120
|
+
no-op.
|
|
121
|
+
- Do not remove a connection from the active registry before its physical close event is observed.
|
|
122
|
+
- Do not return a connection to a pool from writable/readable flags alone without parser or framing
|
|
123
|
+
boundary and body-disposition evidence.
|
|
124
|
+
- Do not use `unref`, garbage collection, finalization registries, or process exit as connection
|
|
125
|
+
cleanup.
|
|
126
|
+
- Do not weaken event-count, callback-settlement, buffer-bound, natural-exit, or open-handle tests.
|
|
127
|
+
- Do not treat static review, one green reproducer, a flat RSS graph, a restart, or traffic limiting
|
|
128
|
+
as proof that a connection-lifetime defect is permanently resolved.
|
|
129
|
+
|
|
130
|
+
<!-- mustflow-section: procedure -->
|
|
131
|
+
## Procedure
|
|
132
|
+
|
|
133
|
+
1. Draw the ownership layers before editing.
|
|
134
|
+
- Separate physical connection or HTTP/2 session, logical request, response body or stream,
|
|
135
|
+
reader and writer locks, pool lease, and process or server lifecycle.
|
|
136
|
+
- Name which layer owns each timer, listener, pending callback, retry item, buffer reservation,
|
|
137
|
+
and registry entry.
|
|
138
|
+
2. Replace a single closing enum with orthogonal dimensions where shutdown can happen
|
|
139
|
+
independently.
|
|
140
|
+
- Model transport, read side, write side, pool membership, request state, body disposition, and
|
|
141
|
+
reader or writer ownership separately when the protocol permits independent progress.
|
|
142
|
+
- Treat remote and local half-close as valid combinations, not impossible intermediate states.
|
|
143
|
+
3. Separate events from actions.
|
|
144
|
+
- Treat EOF or `end`, write completion or `finish`, `error`, and physical `close` as observed
|
|
145
|
+
events.
|
|
146
|
+
- Treat graceful `end`, cancel, discard, quarantine, `destroy`, reset, and force-close as local
|
|
147
|
+
actions whose admission must be controlled.
|
|
148
|
+
- Do not require an abortive action on a graceful path.
|
|
149
|
+
4. Centralize terminal-cause arbitration.
|
|
150
|
+
- Route timeout, abort signal, writer error, protocol error, peer reset, body abandonment, and
|
|
151
|
+
forced shutdown through one termination admission function.
|
|
152
|
+
- Atomically accept the first terminal cause and at most one abortive action.
|
|
153
|
+
- Record later competing causes as secondary diagnostics without repeating destroy, reset,
|
|
154
|
+
callback settlement, metrics, or registry removal.
|
|
155
|
+
5. Define finalization boundaries.
|
|
156
|
+
- Finalize and remove a physical connection record once, after physical close is observed.
|
|
157
|
+
- Permit a request to settle earlier after its request-scoped timers, listeners, retries, body
|
|
158
|
+
lease, and user result are finalized.
|
|
159
|
+
- Keep connection-core close and error observation alive even after request cleanup.
|
|
160
|
+
6. Write the protocol-specific reuse gate as a conjunction of observable conditions.
|
|
161
|
+
- Require open transport sides, parser or framing boundary, terminal body disposition, no pending
|
|
162
|
+
writes, no reserved buffers, no terminal cause, no protocol corruption, and correct pool owner.
|
|
163
|
+
- Quarantine any HTTP/1.1 connection that observed premature close, truncated framing, parser
|
|
164
|
+
failure, content-length mismatch, reset, or unrecoverable body abandonment.
|
|
165
|
+
- Apply cancellation and reuse at HTTP/2 stream scope unless connection-level GOAWAY, session
|
|
166
|
+
error, or flow-control corruption invalidates the whole session.
|
|
167
|
+
7. Give every response body a disposition and deadline.
|
|
168
|
+
- Require consume, bounded discard, protocol-specific cancel, or failure.
|
|
169
|
+
- Use both byte and wall-clock limits for discard; endless discard is a denial-of-service path.
|
|
170
|
+
- Settle cancellation separately from releasing a reader lock, and release the owner in a
|
|
171
|
+
finally-like boundary.
|
|
172
|
+
8. Make write and backpressure accounting explicit.
|
|
173
|
+
- Stop or pause production after a write or enqueue signal reports backpressure.
|
|
174
|
+
- Settle every accepted write callback or promise exactly once as success or failure.
|
|
175
|
+
- Reserve bytes before enqueueing across readable, writable, adapter, parser, transform, retry,
|
|
176
|
+
discard, and observability layers; do not mistake a high-water mark for a global hard limit.
|
|
177
|
+
9. Build connection and request resource scopes.
|
|
178
|
+
- Register timers, listener removers, retry tokens, body leases, locks, pending writes, buffer
|
|
179
|
+
reservations, and close waiters at creation time.
|
|
180
|
+
- Make disposal idempotent and keep request cleanup from deleting connection-core observers.
|
|
181
|
+
10. Define server and client shutdown as bounded phases.
|
|
182
|
+
- Stop new accepts or requests first, then drain idle and active work, reject new HTTP/2 streams
|
|
183
|
+
when applicable, escalate after a deadline, and wait for physical closes.
|
|
184
|
+
- Track WebSocket, CONNECT, HTTP/2, and other upgraded or separately owned transports explicitly;
|
|
185
|
+
generic HTTP close-all helpers may not own them.
|
|
186
|
+
11. Add observable conservation and cleanup invariants.
|
|
187
|
+
- Compare created, active, and closed connections; started and terminal requests; accepted and
|
|
188
|
+
settled writes; opened and disposed body leases; reserved, current, and released buffers.
|
|
189
|
+
- Keep identifiers in logs or traces and metric labels bounded to reason, protocol, role, or
|
|
190
|
+
mode.
|
|
191
|
+
12. Test races and partial orders, not one pretty sequence.
|
|
192
|
+
- Cover local-first, remote-first, simultaneous FIN, RST, timeout plus abort, pending write plus
|
|
193
|
+
reset, body end plus cancel, paused read, unconsumed body, slow consumer, and shutdown races.
|
|
194
|
+
- Assert event counts, primary cause, accepted destroy count, request result, pool state,
|
|
195
|
+
registry size, pending writes, body disposition, lock ownership, and peak reserved bytes.
|
|
196
|
+
- Add a child-process natural-exit test without `process.exit` when configured test surfaces can
|
|
197
|
+
exercise event-loop handle leaks.
|
|
198
|
+
13. Separate heap retention from event-loop liveness and native resource leakage.
|
|
199
|
+
- An unresolved promise alone does not keep the event loop alive, but a reachable promise chain
|
|
200
|
+
can retain request state.
|
|
201
|
+
- Check active timers, sockets, DNS/TLS work, file descriptors or handles, and heap retaining
|
|
202
|
+
paths with the configured diagnostics available to the repository.
|
|
203
|
+
14. Design fault campaigns around closed cohorts and uncontaminated resource evidence when the task
|
|
204
|
+
requires more than focused lifecycle tests.
|
|
205
|
+
- Separate the system under test from load generators, raw fault peers, proxies, and packet or
|
|
206
|
+
network injectors so their timers and handles do not enter the system ledger.
|
|
207
|
+
- Give each request deterministic bytes, digest, idempotency identity, lifecycle timestamps, and
|
|
208
|
+
exactly one terminal outcome; compare clean and faulted traffic under predeclared load, seed,
|
|
209
|
+
duration, and statistical gates.
|
|
210
|
+
- Keep explicit-agent teardown campaigns separate from pool-reuse steady-state campaigns.
|
|
211
|
+
15. Attribute the owner with differential reproduction before choosing a fix.
|
|
212
|
+
- Repeat the same fault schedule through the full application, a library-only reproducer, a
|
|
213
|
+
runtime-core reproducer, and direct versus production-like network paths where available.
|
|
214
|
+
- Classify application, library, runtime, or environment cause only from the layer where the
|
|
215
|
+
failure appears or disappears, retaining-path evidence, version bisect, or reproducible
|
|
216
|
+
infrastructure mechanics.
|
|
217
|
+
16. Calibrate the conclusion to the evidence.
|
|
218
|
+
- Distinguish fix candidate, mitigation, symptom suppression, and permanent resolution.
|
|
219
|
+
- Require pre-fix failure, post-fix success, compatible correctness and performance regression,
|
|
220
|
+
bounded repeated and soak evidence, and a causal owner before claiming permanent resolution.
|
|
221
|
+
- Treat long-running soak, packet, native-handle, heap, or production-path checks as manual-only
|
|
222
|
+
or missing unless the selected repository configures them.
|
|
223
|
+
17. Verify through configured command intents and report unavailable protocol, fault-injection,
|
|
224
|
+
active-resource, heap, file-descriptor, or natural-exit evidence instead of inventing commands.
|
|
225
|
+
|
|
226
|
+
<!-- mustflow-section: postconditions -->
|
|
227
|
+
## Postconditions
|
|
228
|
+
|
|
229
|
+
- Physical connection, request, body, stream, lock, pool, and shutdown ownership are distinct where
|
|
230
|
+
their lifetimes can diverge.
|
|
231
|
+
- Every connection record has one observable finalization path; graceful paths do not require
|
|
232
|
+
destroy, and abortive paths accept at most one destroy or reset action.
|
|
233
|
+
- Primary terminal cause, secondary contenders, event counts, callback settlement, and registry
|
|
234
|
+
removal are deterministic under supported races.
|
|
235
|
+
- Connection reuse requires framing completion, terminal body disposition, clean transport state,
|
|
236
|
+
zero pending writes or reservations, and protocol-specific eligibility.
|
|
237
|
+
- Response bodies, locks, timers, listeners, retries, buffers, and upgraded connections have bounded
|
|
238
|
+
ownership and shutdown behavior.
|
|
239
|
+
- Tests or explicitly reported evidence gaps cover the highest-risk FIN, RST, timeout, abort,
|
|
240
|
+
cancellation, backpressure, and shutdown paths.
|
|
241
|
+
- Fault and soak conclusions preserve the tested protocol, role, environment, cohort, seed,
|
|
242
|
+
duration, measurement gate, and causal-owner boundary instead of generalizing from one run.
|
|
243
|
+
|
|
244
|
+
<!-- mustflow-section: verification -->
|
|
245
|
+
## Verification
|
|
246
|
+
|
|
247
|
+
Use configured oneshot command intents when available:
|
|
248
|
+
|
|
249
|
+
- `changes_status`
|
|
250
|
+
- `changes_diff_summary`
|
|
251
|
+
- `lint`
|
|
252
|
+
- `build`
|
|
253
|
+
- `test_related`
|
|
254
|
+
- `test`
|
|
255
|
+
- `docs_validate_fast`
|
|
256
|
+
- `test_release`
|
|
257
|
+
- `mustflow_check`
|
|
258
|
+
|
|
259
|
+
Prefer the narrowest configured tests that exercise the changed protocol and lifecycle boundary.
|
|
260
|
+
Do not infer raw packet tools, load generators, heap profilers, active-handle inspectors, open-FD
|
|
261
|
+
commands, or child-process harnesses from this skill.
|
|
262
|
+
|
|
263
|
+
<!-- mustflow-section: failure-handling -->
|
|
264
|
+
## Failure Handling
|
|
265
|
+
|
|
266
|
+
- If protocol and ownership boundaries are unknown, stop and list the missing decisions before
|
|
267
|
+
inventing a universal state machine.
|
|
268
|
+
- If observed event order differs across valid runs, encode the supported partial order and event
|
|
269
|
+
counts instead of forcing one total order.
|
|
270
|
+
- If a second termination contender repeats side effects, centralize admission before patching each
|
|
271
|
+
callback independently.
|
|
272
|
+
- If safe reuse cannot be proved from parser or framing and body evidence, quarantine the connection.
|
|
273
|
+
- If a body cannot be consumed, discarded, or cancelled within bounds, fail the body and retire the
|
|
274
|
+
owning stream or connection at the narrowest safe protocol scope.
|
|
275
|
+
- If shutdown passes only after adding `unref` or `process.exit`, keep the test failing and report the
|
|
276
|
+
live handle or missing owner.
|
|
277
|
+
- If exact runtime behavior is version-sensitive and current official evidence is unavailable,
|
|
278
|
+
narrow the claim and report the freshness gap.
|
|
279
|
+
- If a reproducer turns green without retained-owner, handle, version, or infrastructure evidence,
|
|
280
|
+
report a fix candidate rather than a resolved root cause.
|
|
281
|
+
- If only traffic limiting, isolation, version pinning, or process restart prevents exhaustion,
|
|
282
|
+
report mitigation and preserve the unresolved ownership risk.
|
|
283
|
+
|
|
284
|
+
<!-- mustflow-section: output-format -->
|
|
285
|
+
## Output Format
|
|
286
|
+
|
|
287
|
+
- Protocol, role, and ownership layers reviewed
|
|
288
|
+
- Transport, read, write, pool, request, body, lock, and shutdown states
|
|
289
|
+
- Event versus action ledger
|
|
290
|
+
- Primary and secondary termination-cause policy
|
|
291
|
+
- Finalization and destroy or reset admission result
|
|
292
|
+
- Reuse and quarantine gate
|
|
293
|
+
- Body disposition, reader or writer ownership, and backpressure or buffer budget
|
|
294
|
+
- Resource scopes, timers, listeners, retries, registries, and upgraded transports
|
|
295
|
+
- Shutdown phases and escalation deadline
|
|
296
|
+
- Invariants, fault matrix, event counts, and natural-exit or active-resource evidence
|
|
297
|
+
- Harness isolation, closed-cohort ledger, repeated-fault and soak gates, and clean-traffic isolation
|
|
298
|
+
- Application, library, runtime, or environment attribution evidence
|
|
299
|
+
- Fix candidate, mitigation, symptom suppression, or permanent-resolution classification
|
|
300
|
+
- Command intents run
|
|
301
|
+
- Skipped diagnostics and reasons
|
|
302
|
+
- Remaining connection lifecycle risk
|