@fairfox/polly 0.85.1 → 0.85.2

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 (99) hide show
  1. package/dist/cli/polly.js.map +1 -1
  2. package/dist/gallery/gallery.css +1 -1
  3. package/dist/gallery/gallery.js +2 -27
  4. package/dist/scripts/build-extension.js.map +1 -1
  5. package/dist/src/actions/index.js +34 -32
  6. package/dist/src/actions/index.js.map +2 -2
  7. package/dist/src/background/index.js +24 -22
  8. package/dist/src/background/index.js.map +2 -2
  9. package/dist/src/background/message-router.js +21 -19
  10. package/dist/src/background/message-router.js.map +2 -2
  11. package/dist/src/client/index.js +9 -7
  12. package/dist/src/client/index.js.map +2 -2
  13. package/dist/src/elysia/index.js +25 -23
  14. package/dist/src/elysia/index.js.map +2 -2
  15. package/dist/src/index.js +68 -64
  16. package/dist/src/index.js.map +3 -3
  17. package/dist/src/mesh-node.js +6 -6
  18. package/dist/src/mesh-node.js.map +1 -1
  19. package/dist/src/mesh.js +92 -90
  20. package/dist/src/mesh.js.map +2 -2
  21. package/dist/src/peer.js +54 -52
  22. package/dist/src/peer.js.map +2 -2
  23. package/dist/src/polly-ui/index.css +1 -1
  24. package/dist/src/polly-ui/index.js +37 -35
  25. package/dist/src/polly-ui/index.js.map +2 -2
  26. package/dist/src/polly-ui/markdown.js +233 -96
  27. package/dist/src/polly-ui/markdown.js.map +4 -4
  28. package/dist/src/polly-ui/styles.css +1 -1
  29. package/dist/src/shared/adapters/index.js +30 -28
  30. package/dist/src/shared/adapters/index.js.map +2 -2
  31. package/dist/src/shared/lib/context-helpers.js +23 -21
  32. package/dist/src/shared/lib/context-helpers.js.map +2 -2
  33. package/dist/src/shared/lib/errors.js +16 -14
  34. package/dist/src/shared/lib/errors.js.map +2 -2
  35. package/dist/src/shared/lib/guards.js +11 -9
  36. package/dist/src/shared/lib/guards.js.map +2 -2
  37. package/dist/src/shared/lib/message-bus.js +24 -22
  38. package/dist/src/shared/lib/message-bus.js.map +2 -2
  39. package/dist/src/shared/lib/resource.js +19 -15
  40. package/dist/src/shared/lib/resource.js.map +3 -3
  41. package/dist/src/shared/lib/state.js +26 -22
  42. package/dist/src/shared/lib/state.js.map +3 -3
  43. package/dist/src/shared/lib/test-helpers.js +11 -9
  44. package/dist/src/shared/lib/test-helpers.js.map +2 -2
  45. package/dist/src/shared/state/app-state.js +22 -18
  46. package/dist/src/shared/state/app-state.js.map +3 -3
  47. package/dist/src/shared/types/messages.js +11 -9
  48. package/dist/src/shared/types/messages.js.map +2 -2
  49. package/dist/tools/bdd/src/cli.js +44 -1
  50. package/dist/tools/bdd/src/cli.js.map +4 -4
  51. package/dist/tools/bdd/src/index.js +54 -11
  52. package/dist/tools/bdd/src/index.js.map +4 -4
  53. package/dist/tools/gallery/src/cli.js +1 -1
  54. package/dist/tools/gallery/src/cli.js.map +2 -2
  55. package/dist/tools/init/src/cli.js +1 -1
  56. package/dist/tools/init/src/cli.js.map +2 -2
  57. package/dist/tools/mutate/src/cli.js +1 -1
  58. package/dist/tools/mutate/src/cli.js.map +2 -2
  59. package/dist/tools/mutate/src/index.js +8 -8
  60. package/dist/tools/mutate/src/index.js.map +2 -2
  61. package/dist/tools/quality/src/cli.js +3 -2
  62. package/dist/tools/quality/src/cli.js.map +3 -3
  63. package/dist/tools/quality/src/index.js +37 -36
  64. package/dist/tools/quality/src/index.js.map +3 -3
  65. package/dist/tools/test/src/adapters/index.js +19 -17
  66. package/dist/tools/test/src/adapters/index.js.map +2 -2
  67. package/dist/tools/test/src/browser/index.js +15 -13
  68. package/dist/tools/test/src/browser/index.js.map +2 -2
  69. package/dist/tools/test/src/browser/run.js +1 -1
  70. package/dist/tools/test/src/browser/run.js.map +2 -2
  71. package/dist/tools/test/src/contrast/index.js +14 -12
  72. package/dist/tools/test/src/contrast/index.js.map +2 -2
  73. package/dist/tools/test/src/coverage-policy/cli.js +5 -5
  74. package/dist/tools/test/src/coverage-policy/cli.js.map +2 -2
  75. package/dist/tools/test/src/coverage-policy/index.js +12 -12
  76. package/dist/tools/test/src/coverage-policy/index.js.map +1 -1
  77. package/dist/tools/test/src/e2e-mesh/index.js +46 -44
  78. package/dist/tools/test/src/e2e-mesh/index.js.map +2 -2
  79. package/dist/tools/test/src/e2e-relay/index.js +3 -3
  80. package/dist/tools/test/src/e2e-relay/index.js.map +1 -1
  81. package/dist/tools/test/src/index.js +26 -24
  82. package/dist/tools/test/src/index.js.map +2 -2
  83. package/dist/tools/test/src/test-utils.js +14 -12
  84. package/dist/tools/test/src/test-utils.js.map +2 -2
  85. package/dist/tools/test/src/tiers/cli.js +1 -1
  86. package/dist/tools/test/src/tiers/cli.js.map +2 -2
  87. package/dist/tools/test/src/tiers/worker.js +1 -1
  88. package/dist/tools/test/src/tiers/worker.js.map +1 -1
  89. package/dist/tools/test/src/visual/index.js +121 -119
  90. package/dist/tools/test/src/visual/index.js.map +2 -2
  91. package/dist/tools/verify/src/cli.js +24 -21
  92. package/dist/tools/verify/src/cli.js.map +4 -4
  93. package/dist/tools/verify/src/config.js +18 -16
  94. package/dist/tools/verify/src/config.js.map +2 -2
  95. package/dist/tools/verify/src/stryker/index.js +6 -6
  96. package/dist/tools/verify/src/stryker/index.js.map +1 -1
  97. package/dist/tools/visualize/src/cli.js +3 -3
  98. package/dist/tools/visualize/src/cli.js.map +2 -2
  99. package/package.json +2 -2
@@ -19,12 +19,14 @@ var __toESM = (mod, isNodeMode, target) => {
19
19
  }
20
20
  target = mod != null ? __create(__getProtoOf(mod)) : {};
21
21
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- for (let key of __getOwnPropNames(mod))
23
- if (!__hasOwnProp.call(to, key))
24
- __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
26
- enumerable: true
27
- });
22
+ if (mod && typeof mod === "object" || typeof mod === "function") {
23
+ for (let key of __getOwnPropNames(mod))
24
+ if (!__hasOwnProp.call(to, key))
25
+ __defProp(to, key, {
26
+ get: __accessProp.bind(mod, key),
27
+ enumerable: true
28
+ });
29
+ }
28
30
  if (canCache)
29
31
  cache.set(mod, to);
30
32
  return to;
@@ -122,16 +124,16 @@ function defineVerification(config) {
122
124
  return config;
123
125
  }
124
126
  export {
125
- stateConstraint,
126
- somePeer,
127
- requires,
128
- oneOf,
129
- inRange,
130
- hasLength,
131
- forAllPeers,
132
- ensures,
127
+ $constraints,
133
128
  defineVerification,
134
- $constraints
129
+ ensures,
130
+ forAllPeers,
131
+ hasLength,
132
+ inRange,
133
+ oneOf,
134
+ requires,
135
+ somePeer,
136
+ stateConstraint
135
137
  };
136
138
 
137
- //# debugId=D9257AB1F243F69864756E2164756E21
139
+ //# debugId=C9BD95A58333E1C764756E2164756E21
@@ -5,7 +5,7 @@
5
5
  "// Verification primitives for formal verification\n// These are runtime no-ops but extracted during verification\n\n/**\n * Assert a precondition that must be true when the handler executes.\n *\n * In production: No-op (compiled away)\n * In verification: Translated to TLA+ assertion\n *\n * @example\n * messageBus.on(\"USER_LOGIN\", (payload) => {\n * requires(state.user.loggedIn === false, \"User must not be logged in\")\n * state.user.loggedIn = true\n * })\n */\nexport function requires(condition: boolean, message?: string): void {\n // Runtime no-op - only used during verification\n // Condition and message are checked during static analysis only\n void condition;\n void message;\n}\n\n/**\n * Assert a postcondition that must be true after the handler completes.\n *\n * In production: No-op (compiled away)\n * In verification: Translated to TLA+ assertion\n *\n * @example\n * messageBus.on(\"USER_LOGIN\", (payload) => {\n * state.user.loggedIn = true\n * ensures(state.user.loggedIn === true, \"User must be logged in\")\n * })\n */\nexport function ensures(condition: boolean, message?: string): void {\n // Runtime no-op - only used during verification\n // Condition and message are checked during static analysis only\n void condition;\n void message;\n}\n\n/**\n * Define a global invariant that must always hold.\n *\n * In production: No-op (compiled away)\n * In verification: Translated to TLA+ invariant\n *\n * @example\n * invariant(\"UserIdConsistent\", () =>\n * state.user.loggedIn === false || state.user.id !== null\n * )\n */\nexport function invariant(_name: string, condition: () => boolean): void {\n // Runtime no-op - only used during verification\n // Name and condition are checked during static analysis only\n void condition;\n}\n\n/**\n * Assert that a value is within a valid range.\n *\n * @example\n * requires(inRange(todoCount, 0, 100), \"Todo count must be 0-100\")\n */\nexport function inRange(value: number, min: number, max: number): boolean {\n return value >= min && value <= max;\n}\n\n/**\n * Assert that a value is one of the allowed values.\n *\n * @example\n * requires(oneOf(state.user.role, [\"admin\", \"user\"]), \"Role must be admin or user\")\n */\nexport function oneOf<T>(value: T, allowed: T[]): boolean {\n return allowed.includes(value);\n}\n\n/**\n * Assert that an array has a specific length constraint.\n *\n * @example\n * requires(hasLength(state.todos, { max: 10 }), \"Too many todos\")\n */\nexport function hasLength(array: unknown[], constraint: { min?: number; max?: number }): boolean {\n if (constraint.min !== undefined && array.length < constraint.min) return false;\n if (constraint.max !== undefined && array.length > constraint.max) return false;\n return true;\n}\n\n/**\n * Declare state-level constraints for verification and optional runtime checking.\n * Maps message types to preconditions on state fields.\n *\n * The parser automatically wires these constraints to handlers during verification.\n * Optionally, constraints can be enforced at runtime by passing `{ runtime: true }`.\n *\n * @example\n * // Verification only (TLA+ generation)\n * const state = { loggedIn: false };\n *\n * $constraints(\"loggedIn\", {\n * USER_LOGOUT: { requires: \"state.loggedIn === true\", message: \"Must be logged in\" },\n * BOOKMARK_ADD: { requires: \"state.loggedIn === true\", message: \"Must be logged in\" },\n * });\n *\n * @example\n * // Runtime enforcement (function predicates)\n * $constraints(\"loggedIn\", {\n * USER_LOGOUT: {\n * requires: (state) => state.loggedIn === true,\n * message: \"Must be logged in to logout\"\n * },\n * }, { runtime: true });\n */\nexport function $constraints(\n stateField: string,\n constraints: Record<\n string,\n {\n requires?: string | ((state: unknown) => boolean);\n ensures?: string | ((state: unknown) => boolean);\n message?: string;\n }\n >,\n options?: { runtime?: boolean }\n): void {\n // Register constraints for runtime checking if enabled\n if (options?.runtime) {\n // Import dynamically to avoid circular dependencies\n // This is safe because it only happens at runtime, not during static analysis\n // @ts-expect-error - Dynamic import path resolves correctly at runtime\n import(\"../../../src/shared/lib/constraints.js\")\n .then(({ registerConstraints }) => {\n registerConstraints(stateField, constraints);\n })\n .catch(() => {\n // Silently ignore - constraints module may not be available during static analysis\n });\n }\n\n // For verification: Still a no-op at runtime\n // Parser extracts these and wires them to TLA+ handlers\n}\n\n/**\n * Declare a global state constraint that prunes structurally impossible states.\n *\n * In production: No-op (compiled away)\n * In verification: Translated to TLC CONSTRAINT clause, discarding states\n * that violate the predicate from the exploration queue entirely.\n *\n * Unlike `invariant()` (which checks but still explores), `stateConstraint()`\n * prevents the model checker from ever reaching the pruned states.\n *\n * @example\n * stateConstraint(\"LeaderRequiresConnection\", () =>\n * !connectionState.value.isLeader || connectionState.value.status === \"connected\"\n * )\n */\nexport function stateConstraint(\n name: string,\n predicate: () => boolean,\n options?: { message?: string }\n): void {\n void name;\n void predicate;\n void options;\n}\n\n/**\n * Cross-peer universal quantifier for use inside `requires` and\n * `ensures` predicates. The runtime is a no-op that simply runs the\n * predicate against a single dummy context (so the assertion never\n * triggers at runtime); the verifier recognizes the wrapper in\n * predicate source and emits a `\\A peer \\in Contexts \\ {ctx} : (...)`\n * clause that asks TLC to check the inner predicate against every\n * other context.\n *\n * @example\n * ensures(\n * forAllPeers(peer => peer.todos.value.length === todos.value.length),\n * \"every peer agrees on todo count\"\n * );\n */\nexport function forAllPeers<TPeer>(predicate: (peer: TPeer) => boolean): boolean {\n void predicate;\n return true;\n}\n\n/**\n * Cross-peer existential quantifier for use inside `requires` and\n * `ensures` predicates. Runtime no-op; the verifier emits a\n * `\\E peer \\in Contexts \\ {ctx} : (...)` clause.\n *\n * @example\n * ensures(\n * somePeer(peer => peer.user.value.loggedIn === true),\n * \"at least one peer has a logged-in user\"\n * );\n */\nexport function somePeer<TPeer>(predicate: (peer: TPeer) => boolean): boolean {\n void predicate;\n return true;\n}\n\n// Re-export for convenience\nexport const verify = {\n requires,\n ensures,\n invariant,\n inRange,\n oneOf,\n hasLength,\n $constraints,\n stateConstraint,\n forAllPeers,\n somePeer,\n};\n",
6
6
  "// Configuration Helper for @fairfox/polly/verify\n//\n// Lightweight entry point for user configuration files.\n// Does NOT include heavy dependencies (ts-morph, analysis, etc.)\n// which are only needed by the CLI tool.\n\n// Configuration Types (inlined to avoid heavy dependencies)\n\n// polly#160: a directional capability whose grant requires a precondition.\n// Desugars to a TLA+ safety invariant `(enabledBy) => (requires)`. enabledBy /\n// requires are TS boolean expressions in the requires()/ensures() dialect\n// referencing state via `state.` / signal `.value` form (e.g. \"state.authReady\").\n// Inlined here (like SubsystemConfig) so this authoring entry point stays\n// dependency-light; the canonical type is CapabilityConfig in config/types.ts.\ninterface CapabilityConfig {\n name: string;\n enabledBy: string;\n requires: string;\n message?: string;\n}\n\n// Subsystem configuration for compositional verification\ninterface SubsystemConfig {\n state: string[]; // Field names from parent state config\n handlers: string[]; // Message type names\n // Per-subsystem message bounds; override messages.maxInFlight and merge\n // into messages.perMessageBounds for this subsystem only.\n bounds?: {\n maxInFlight?: number;\n perMessageBounds?: Record<string, number>;\n };\n}\n\n// Point a subsystem's reachability witnesses at a hand-written TLA+ spec instead\n// of the generated UserApp_<subsystem>. Inlined here (like SubsystemConfig) to\n// keep this authoring entry point dependency-light; canonical type is\n// CustomTLAPath in config/types.ts.\ninterface CustomTLAPath {\n tla: string; // path (relative to cwd) to the hand-written .tla the witness EXTENDS\n cfg: string; // path (relative to cwd) to its .cfg\n module?: string; // module to EXTEND; defaults to the MODULE name parsed from `tla`\n fields?: Record<string, string>; // BDD field name → this spec's TLA+ variable name\n}\n\n// Legacy verification configuration\ninterface LegacyVerificationConfig {\n state: Record<string, unknown>;\n /**\n * polly#117: optional mesh-document declarations. When present, each\n * key names a `$meshState` document and its value declares the\n * field-level state schema for that document. The verifier emits a\n * separate slot in `contextStates[ctx].mesh[<docId>]` for these\n * fields and adds a `PropagateMeshOp` action that allows the doc's\n * value on one context to flow to another — modelling Automerge\n * sync between peers. Mesh references inside `forAllPeers` quantifiers\n * route through this slot so cross-peer convergence claims are\n * actually checked.\n *\n * @example\n * ```ts\n * defineVerification({\n * state: { localCounter: { type: \"number\", min: 0, max: 3 } },\n * mesh: {\n * todos: {\n * entries: { type: \"enum\", values: [\"empty\", \"one\", \"many\"] },\n * },\n * },\n * messages: { maxInFlight: 2 },\n * });\n * ```\n */\n mesh?: Record<string, Record<string, unknown>>;\n messages: {\n // Basic bounds\n maxInFlight?: number;\n maxTabs?: number;\n maxClients?: number;\n maxRenderers?: number;\n maxWorkers?: number;\n maxContexts?: number;\n\n // Tier 1 Optimizations (no precision loss)\n include?: string[]; // Only verify these message types\n exclude?: string[]; // Exclude these message types (mutually exclusive with include)\n symmetry?: string[][]; // Groups of symmetric message types [[type1, type2], [type3, type4]]\n perMessageBounds?: Record<string, number>; // Different maxInFlight per message type\n };\n onBuild?: \"warn\" | \"error\" | \"off\";\n onRelease?: \"warn\" | \"error\" | \"off\";\n\n // Verification engine options\n verification?: {\n timeout?: number; // Timeout in seconds (0 = no timeout)\n workers?: number; // Number of TLC workers\n };\n\n // Subsystem-scoped verification (compositional)\n subsystems?: Record<string, SubsystemConfig>;\n\n // Bind a subsystem's witnesses to a hand-written .tla/.cfg (read only by the\n // --witness pass; a custom subsystem is skipped during generated-spec verify).\n customTLAPaths?: Record<string, CustomTLAPath>;\n\n // Tier 2 Optimizations (controlled approximations)\n tier2?: {\n // Temporal constraints: ordering requirements between messages\n temporalConstraints?: Array<{\n before: string; // Message type that must occur first\n after: string; // Message type that must occur after\n description?: string; // Human-readable description\n }>;\n\n // Bounded exploration: limit depth for specific scenarios\n boundedExploration?: {\n maxDepth?: number; // Maximum state depth to explore\n criticalPaths?: string[][]; // Sequences of message types that must be fully explored\n };\n };\n\n // polly#160: directional capability invariants + write-coupling lint groups\n capabilities?: CapabilityConfig[];\n coupledFields?: string[][];\n}\n\n// Adapter-based configuration (for future use)\ninterface AdapterVerificationConfig {\n adapter: unknown; // Adapter interface not exported to avoid heavy deps\n state: Record<string, unknown>;\n bounds?: {\n maxInFlight?: number;\n [key: string]: unknown;\n };\n onBuild?: \"warn\" | \"error\" | \"off\";\n\n // polly#160: directional capability invariants + write-coupling lint groups\n capabilities?: CapabilityConfig[];\n coupledFields?: string[][];\n}\n\n// Union type for both config formats\ntype UnifiedVerificationConfig = LegacyVerificationConfig | AdapterVerificationConfig;\n\n/**\n * Define verification configuration with type checking\n *\n * Used in generated verification.config.ts files.\n *\n * @example\n * ```typescript\n * import { defineVerification } from '@fairfox/polly/verify'\n *\n * export default defineVerification({\n * state: {\n * \"user.role\": { type: \"enum\", values: [\"admin\", \"user\", \"guest\"] },\n * },\n * messages: {\n * maxInFlight: 6,\n * maxTabs: 2,\n * },\n * })\n * ```\n */\nexport function defineVerification<T extends UnifiedVerificationConfig>(config: T): T {\n // Validate configuration structure\n if (\"adapter\" in config) {\n // New adapter-based format\n if (!config.adapter) {\n throw new Error(\"Configuration must include an adapter\");\n }\n if (!config.state) {\n throw new Error(\"Configuration must include state bounds\");\n }\n } else if (\"messages\" in config) {\n // Legacy format\n if (!config.state) {\n throw new Error(\"Configuration must include state bounds\");\n }\n if (!config.messages) {\n throw new Error(\"Legacy configuration must include messages bounds\");\n }\n } else {\n throw new Error(\n \"Invalid configuration format. Must include either 'adapter' (new format) or 'messages' (legacy format)\"\n );\n }\n\n return config;\n}\n\n// Re-export verification primitives for user code\nexport {\n $constraints,\n ensures,\n forAllPeers,\n hasLength,\n inRange,\n oneOf,\n requires,\n somePeer,\n stateConstraint,\n} from \"./primitives/index.js\";\n"
7
7
  ],
8
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,SAAS,QAAQ,CAAC,WAAoB,SAAwB;AAmB9D,SAAS,OAAO,CAAC,WAAoB,SAAwB;AA8B7D,SAAS,OAAO,CAAC,OAAe,KAAa,KAAsB;AAAA,EACxE,OAAO,SAAS,OAAO,SAAS;AAAA;AAS3B,SAAS,KAAQ,CAAC,OAAU,SAAu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A,IAC3D;AAAA,IACA,IAAI,CAAC,OAAO,UAAU;AAAA,MACpB,MAAM,IAAI,MAAM,mDAAmD;AAAA,IACrE;AAAA,EACF,EAAO;AAAA,IACL,MAAM,IAAI,MACR,wGACF;AAAA;AAAA,EAGF,OAAO;AAAA;",
9
+ "debugId": "C9BD95A58333E1C764756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -93,12 +93,12 @@ var pollyStrykerPreset = {
93
93
  };
94
94
  var stryker_default = pollyStrykerPreset;
95
95
  export {
96
- strykerPlugins,
97
- pollyStrykerPreset,
98
- stryker_default as default,
99
- VERIFY_PRIMITIVES,
96
+ POLLY_VERIFY_IGNORER_NAME,
100
97
  PollyVerifyIgnorer,
101
- POLLY_VERIFY_IGNORER_NAME
98
+ VERIFY_PRIMITIVES,
99
+ stryker_default as default,
100
+ pollyStrykerPreset,
101
+ strykerPlugins
102
102
  };
103
103
 
104
- //# debugId=E89A09026CD3C7E064756E2164756E21
104
+ //# debugId=3F81A70229C7A31264756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "// Stryker mutation-testing ignorer for polly's verify primitives (polly#143).\n//\n// `requires`, `ensures`, `invariant`, `stateConstraint`, `forAllPeers`, and\n// `somePeer` are runtime no-ops: in production they compile away, in\n// verification they translate to TLA+ assertions. Nothing observes their\n// condition or message argument at test runtime, so EVERY mutation inside one\n// of these callsites is guaranteed to survive — a string-literal flip in an\n// `ensures(...)` message, an `===` → equality mutation in a `requires(...)`\n// condition. On a downstream project mutating six state-machine specs this\n// dragged the mutation score down to 21%, all of it noise rather than real\n// test-coverage gaps.\n//\n// Polly is the right place to ship this knowledge: it knows which of its\n// primitives are no-ops. This module is a Stryker `Ignore` plugin that marks\n// every mutant inside a verify callsite as ignored, plus a small config preset\n// consumers can spread into their `stryker.conf.*`.\n//\n// Usage (stryker.conf.json):\n//\n// {\n// \"plugins\": [\"@fairfox/polly/stryker\"],\n// \"ignorers\": [\"polly-verify\"]\n// }\n//\n// Or, in stryker.conf.mjs:\n//\n// import pollyStrykerPreset from \"@fairfox/polly/stryker\";\n// export default { ...pollyStrykerPreset, mutate: [\"src/**/*.ts\"] };\n//\n// Set `\"polly\": { \"excludeVerifyCallsites\": false }` to keep the plugin listed\n// but disable the ignoring (e.g. in a shared base config).\n\nimport type { StrykerOptions } from \"@stryker-mutator/api/core\";\nimport type { Ignorer, NodePath } from \"@stryker-mutator/api/ignore\";\nimport {\n commonTokens,\n declareFactoryPlugin,\n PluginKind,\n tokens,\n} from \"@stryker-mutator/api/plugin\";\n\n/**\n * The polly verify primitives whose argument expressions are runtime no-ops.\n * A mutation anywhere inside a call to one of these cannot be killed by a test,\n * so its mutants are excluded from scoring.\n */\nexport const VERIFY_PRIMITIVES: ReadonlySet<string> = new Set([\n \"requires\",\n \"ensures\",\n \"invariant\",\n \"stateConstraint\",\n \"forAllPeers\",\n \"somePeer\",\n]);\n\n/** The Stryker plugin name consumers reference in `ignorers`. */\nexport const POLLY_VERIFY_IGNORER_NAME = \"polly-verify\";\n\n// The Stryker API types `NodePath` as an empty interface; at runtime it is a\n// Babel NodePath. We narrow only the surface we touch — `isCallExpression()`\n// and `node.callee` — without pulling in @babel/types as a dependency.\ninterface BabelIdentifier {\n type: \"Identifier\";\n name: string;\n}\ninterface BabelMemberExpression {\n type: \"MemberExpression\";\n computed: boolean;\n property: { type: string; name?: string };\n}\ntype BabelCallee = BabelIdentifier | BabelMemberExpression | { type: string };\ninterface CallExpressionPath extends NodePath {\n isCallExpression(): boolean;\n node: { callee?: BabelCallee };\n}\n\n/** Narrow the opaque `NodePath` to the Babel surface we touch. */\nfunction isCallExpressionPath(path: NodePath): path is CallExpressionPath {\n return \"isCallExpression\" in path && typeof path.isCallExpression === \"function\";\n}\n\n/**\n * Resolve the simple name of a call's callee, covering both a bare call\n * (`ensures(...)`) and a member call (`verify.ensures(...)` / `polly.ensures(...)`).\n * Computed member access (`obj[\"ensures\"](...)`) is intentionally not matched —\n * it cannot be resolved statically and is not a pattern polly emits.\n */\nfunction isBabelIdentifier(callee: BabelCallee): callee is BabelIdentifier {\n return callee.type === \"Identifier\";\n}\n\nfunction isBabelMemberExpression(callee: BabelCallee): callee is BabelMemberExpression {\n return callee.type === \"MemberExpression\";\n}\n\nfunction calleeName(callee: BabelCallee | undefined): string | undefined {\n if (!callee) return undefined;\n if (isBabelIdentifier(callee)) {\n return callee.name;\n }\n if (isBabelMemberExpression(callee)) {\n if (!callee.computed && callee.property.type === \"Identifier\") {\n return callee.property.name;\n }\n }\n return undefined;\n}\n\n/**\n * A Stryker `Ignore` plugin. Stryker calls `shouldIgnore` on entering each AST\n * node; returning a message marks that node — and every descendant, until the\n * node is left — as ignored. So matching the verify `CallExpression` itself\n * covers its condition and message arguments in one shot.\n */\nexport class PollyVerifyIgnorer implements Ignorer {\n constructor(private readonly primitives: ReadonlySet<string> = VERIFY_PRIMITIVES) {}\n\n shouldIgnore(path: NodePath): string | undefined {\n if (!isCallExpressionPath(path) || !path.isCallExpression()) {\n return undefined;\n }\n const name = calleeName(path.node.callee);\n if (name && this.primitives.has(name)) {\n return (\n `Inside polly's ${name}(...) — a runtime no-op (compiled away in production, ` +\n `translated to a TLA+ assertion in verification). No test can observe or kill ` +\n `mutations here, so they are excluded from the score (polly#143).`\n );\n }\n return undefined;\n }\n}\n\n/** Reads `polly.excludeVerifyCallsites` (default: enabled) off Stryker options. */\nfunction isEnabled(options: StrykerOptions): boolean {\n const polly = options[\"polly\"];\n if (typeof polly !== \"object\" || polly === null) return true;\n return !(\"excludeVerifyCallsites\" in polly) || polly.excludeVerifyCallsites !== false;\n}\n\n// When disabled the plugin still loads but ignores nothing, so a shared config\n// can list it unconditionally and individual projects opt out via options.\nconst NOOP_IGNORER: Ignorer = { shouldIgnore: () => undefined };\n\nfunction pollyVerifyIgnorerFactory(options: StrykerOptions): Ignorer {\n return isEnabled(options) ? new PollyVerifyIgnorer() : NOOP_IGNORER;\n}\npollyVerifyIgnorerFactory.inject = tokens(commonTokens.options);\n\n/** The plugin array Stryker reads when this module is listed in `plugins`. */\nexport const strykerPlugins = [\n declareFactoryPlugin(PluginKind.Ignore, POLLY_VERIFY_IGNORER_NAME, pollyVerifyIgnorerFactory),\n];\n\n/**\n * A partial Stryker config that wires up the ignorer. Spread it into a\n * `stryker.conf.mjs` default export, or replicate its two keys in JSON.\n */\nexport const pollyStrykerPreset = {\n plugins: [\"@fairfox/polly/stryker\"],\n ignorers: [POLLY_VERIFY_IGNORER_NAME],\n} as const;\n\n// biome-ignore lint/style/noDefaultExport: ergonomic `import preset from \"@fairfox/polly/stryker\"`\nexport default pollyStrykerPreset;\n"
6
6
  ],
7
7
  "mappings": ";;;;;;;;;;;;;;;;;;;AAkCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYO,IAAM,oBAAyC,IAAI,IAAI;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,IAAM,4BAA4B;AAqBzC,SAAS,oBAAoB,CAAC,MAA4C;AAAA,EACxE,OAAO,sBAAsB,QAAQ,OAAO,KAAK,qBAAqB;AAAA;AASxE,SAAS,iBAAiB,CAAC,QAAgD;AAAA,EACzE,OAAO,OAAO,SAAS;AAAA;AAGzB,SAAS,uBAAuB,CAAC,QAAsD;AAAA,EACrF,OAAO,OAAO,SAAS;AAAA;AAGzB,SAAS,UAAU,CAAC,QAAqD;AAAA,EACvE,IAAI,CAAC;AAAA,IAAQ;AAAA,EACb,IAAI,kBAAkB,MAAM,GAAG;AAAA,IAC7B,OAAO,OAAO;AAAA,EAChB;AAAA,EACA,IAAI,wBAAwB,MAAM,GAAG;AAAA,IACnC,IAAI,CAAC,OAAO,YAAY,OAAO,SAAS,SAAS,cAAc;AAAA,MAC7D,OAAO,OAAO,SAAS;AAAA,IACzB;AAAA,EACF;AAAA,EACA;AAAA;AAAA;AASK,MAAM,mBAAsC;AAAA,EACpB;AAAA,EAA7B,WAAW,CAAkB,aAAkC,mBAAmB;AAAA,IAArD;AAAA;AAAA,EAE7B,YAAY,CAAC,MAAoC;AAAA,IAC/C,IAAI,CAAC,qBAAqB,IAAI,KAAK,CAAC,KAAK,iBAAiB,GAAG;AAAA,MAC3D;AAAA,IACF;AAAA,IACA,MAAM,OAAO,WAAW,KAAK,KAAK,MAAM;AAAA,IACxC,IAAI,QAAQ,KAAK,WAAW,IAAI,IAAI,GAAG;AAAA,MACrC,OACE,kBAAkB,+DAClB,kFACA;AAAA,IAEJ;AAAA,IACA;AAAA;AAEJ;AAGA,SAAS,SAAS,CAAC,SAAkC;AAAA,EACnD,MAAM,QAAQ,QAAQ;AAAA,EACtB,IAAI,OAAO,UAAU,YAAY,UAAU;AAAA,IAAM,OAAO;AAAA,EACxD,OAAO,EAAE,4BAA4B,UAAU,MAAM,2BAA2B;AAAA;AAKlF,IAAM,eAAwB,EAAE,cAAc,MAAG;AAAA,EAAG;AAAA,EAAU;AAE9D,SAAS,yBAAyB,CAAC,SAAkC;AAAA,EACnE,OAAO,UAAU,OAAO,IAAI,IAAI,qBAAuB;AAAA;AAEzD,0BAA0B,SAAS,OAAO,aAAa,OAAO;AAGvD,IAAM,iBAAiB;AAAA,EAC5B,qBAAqB,WAAW,QAAQ,2BAA2B,yBAAyB;AAC9F;AAMO,IAAM,qBAAqB;AAAA,EAChC,SAAS,CAAC,wBAAwB;AAAA,EAClC,UAAU,CAAC,yBAAyB;AACtC;AAGA,IAAe;",
8
- "debugId": "E89A09026CD3C7E064756E2164756E21",
8
+ "debugId": "3F81A70229C7A31264756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -20,8 +20,8 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
20
20
  // tools/analysis/src/extract/project-detector.ts
21
21
  var exports_project_detector = {};
22
22
  __export(exports_project_detector, {
23
- detectProjectConfig: () => detectProjectConfig,
24
- ProjectDetector: () => ProjectDetector
23
+ ProjectDetector: () => ProjectDetector,
24
+ detectProjectConfig: () => detectProjectConfig
25
25
  });
26
26
  import * as fs3 from "node:fs";
27
27
  import * as path3 from "node:path";
@@ -6989,4 +6989,4 @@ main().catch((_error) => {
6989
6989
  process.exit(1);
6990
6990
  });
6991
6991
 
6992
- //# debugId=4CA1C5520447E2E464756E2164756E21
6992
+ //# debugId=92ABD113FE6A23FD64756E2164756E21