@enricai/barnacle 1.12.54 → 1.12.56

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 (58) hide show
  1. package/dist/api/schemas/common.d.ts +28 -0
  2. package/dist/api/schemas/common.d.ts.map +1 -1
  3. package/dist/api/schemas/common.js +51 -0
  4. package/dist/api/schemas/common.js.map +1 -1
  5. package/dist/plugins/config-plugin.d.ts +8 -0
  6. package/dist/plugins/config-plugin.d.ts.map +1 -1
  7. package/dist/plugins/config-plugin.js +56 -3
  8. package/dist/plugins/config-plugin.js.map +1 -1
  9. package/dist/plugins/json-schema-to-zod.d.ts +6 -3
  10. package/dist/plugins/json-schema-to-zod.d.ts.map +1 -1
  11. package/dist/plugins/json-schema-to-zod.js +18 -6
  12. package/dist/plugins/json-schema-to-zod.js.map +1 -1
  13. package/dist/plugins/loader.d.ts.map +1 -1
  14. package/dist/plugins/loader.js +7 -1
  15. package/dist/plugins/loader.js.map +1 -1
  16. package/dist/recon/capture-filters.d.ts +2 -55
  17. package/dist/recon/capture-filters.d.ts.map +1 -1
  18. package/dist/recon/capture-filters.js +449 -4
  19. package/dist/recon/capture-filters.js.map +1 -1
  20. package/dist/recon/load-value-constraints.d.ts +22 -0
  21. package/dist/recon/load-value-constraints.d.ts.map +1 -0
  22. package/dist/recon/load-value-constraints.js +61 -0
  23. package/dist/recon/load-value-constraints.js.map +1 -0
  24. package/dist/recon/value-constraints.d.ts +46 -0
  25. package/dist/recon/value-constraints.d.ts.map +1 -0
  26. package/dist/recon/value-constraints.js +31 -0
  27. package/dist/recon/value-constraints.js.map +1 -0
  28. package/dist/scraper/errors.d.ts +12 -0
  29. package/dist/scraper/errors.d.ts.map +1 -1
  30. package/dist/scraper/errors.js +21 -1
  31. package/dist/scraper/errors.js.map +1 -1
  32. package/dist/scraper/flow-runner.d.ts +87 -23
  33. package/dist/scraper/flow-runner.d.ts.map +1 -1
  34. package/dist/scraper/flow-runner.js +440 -71
  35. package/dist/scraper/flow-runner.js.map +1 -1
  36. package/dist/scraper/http-client.d.ts +11 -0
  37. package/dist/scraper/http-client.d.ts.map +1 -1
  38. package/dist/scraper/http-client.js +96 -2
  39. package/dist/scraper/http-client.js.map +1 -1
  40. package/dist/scraper/phantom-click.d.ts +2 -2
  41. package/dist/scraper/phantom-click.d.ts.map +1 -1
  42. package/dist/scraper/phantom-click.js +6 -5
  43. package/dist/scraper/phantom-click.js.map +1 -1
  44. package/dist/scraper/submit-control.d.ts +11 -6
  45. package/dist/scraper/submit-control.d.ts.map +1 -1
  46. package/dist/scraper/submit-control.js +38 -7
  47. package/dist/scraper/submit-control.js.map +1 -1
  48. package/dist/scripts/recon-browser.d.ts +45 -8
  49. package/dist/scripts/recon-browser.d.ts.map +1 -1
  50. package/dist/scripts/recon-browser.js +145 -16
  51. package/dist/scripts/recon-browser.js.map +1 -1
  52. package/dist/scripts/recon-generate.d.ts +65 -4
  53. package/dist/scripts/recon-generate.d.ts.map +1 -1
  54. package/dist/scripts/recon-generate.js +389 -51
  55. package/dist/scripts/recon-generate.js.map +1 -1
  56. package/dist/site-plugin.d.ts +9 -0
  57. package/dist/site-plugin.d.ts.map +1 -1
  58. package/package.json +1 -1
@@ -336,6 +336,67 @@ function urlOwnValues(url) {
336
336
  }
337
337
  return values;
338
338
  }
339
+ /**
340
+ * The set of raw values a request's own POST body already exposes to the
341
+ * caller: every leaf value of a JSON body, or every value of a URL-encoded
342
+ * form body. Parsed the same permissive way {@link urlOwnValues} treats the
343
+ * query string — an unparsable or absent body simply contributes no values,
344
+ * never an error.
345
+ */
346
+ function bodyOwnValues(requestPostData) {
347
+ const values = new Set();
348
+ if (!requestPostData)
349
+ return values;
350
+ try {
351
+ const leaves = [];
352
+ collectLeafValues(JSON.parse(requestPostData), leaves);
353
+ for (const leaf of leaves)
354
+ values.add(leaf);
355
+ return values;
356
+ }
357
+ catch {
358
+ // not JSON — fall through to URL-encoded form parsing
359
+ }
360
+ try {
361
+ for (const value of new URLSearchParams(requestPostData).values())
362
+ values.add(value);
363
+ }
364
+ catch {
365
+ // unparsable body contributes no derivable values
366
+ }
367
+ return values;
368
+ }
369
+ /**
370
+ * True when every same-endpoint occurrence that carries a response body has
371
+ * a response fully explained by that SAME occurrence's own request — every
372
+ * response leaf is one of that occurrence's own URL query/path values or its
373
+ * own POST body's own values. A same-origin noise widget's varying response
374
+ * (a fresh session id, an incrementing counter) has no such relationship to
375
+ * its own request; a real per-item drill's response is, by definition, a
376
+ * function of the identifier the caller just sent it. This is what tells the
377
+ * two apart when they are otherwise indistinguishable by cardinality alone —
378
+ * {@link MIN_DENSE_REPEAT_FOR_RESPONSE_VARIANCE_SIGNAL}'s own docs note a
379
+ * drill's `{ productId }` body produces a response signature "just as
380
+ * high-cardinality as an actual per-call-varying beacon's fingerprint."
381
+ * Requires at least two occurrences to actually carry a body, mirroring
382
+ * {@link hasFreelyVaryingResponseAcrossOccurrences}'s own evidence floor.
383
+ */
384
+ function hasResponseFullyExplainedByOwnRequestPerOccurrence(sameEndpoint) {
385
+ const withBody = sameEndpoint.filter((c) => c.responseBody !== undefined);
386
+ if (withBody.length < 2)
387
+ return false;
388
+ return withBody.every((occurrence) => {
389
+ const leaves = [];
390
+ collectLeafValues(occurrence.responseBody, leaves);
391
+ if (leaves.length === 0)
392
+ return false;
393
+ const ownValues = new Set([
394
+ ...urlOwnValues(occurrence.url),
395
+ ...bodyOwnValues(occurrence.requestPostData),
396
+ ]);
397
+ return leaves.every((leaf) => ownValues.has(leaf));
398
+ });
399
+ }
339
400
  /**
340
401
  * True when `capture`'s response carries no business-relevant state: a
341
402
  * non-JSON (or absent) content-type, a null/undefined body, a JSON body
@@ -463,8 +524,362 @@ function endpointOrigin(url) {
463
524
  * timestamp, or session nonce that differs on every fire even though the
464
525
  * fixed query is the only signal that actually identifies the endpoint —
465
526
  * the body varies, but the response never carries anything the flow could
466
- * not already derive from the request itself.
527
+ * not already derive from the request itself. When the response DOES carry
528
+ * business-looking (non-URL-derivable) values, that alone is not proof of a
529
+ * real endpoint either: a beacon can stamp a fresh fingerprint/session id
530
+ * into its own response on every fire, so this also falls back to
531
+ * {@link hasFreelyVaryingResponseAcrossOccurrences} — a response that varies
532
+ * on almost every occurrence is exactly as much noise as one that echoes the
533
+ * request.
534
+ *
535
+ * A candidate with NO query string at all has no key to prove "fixed" —
536
+ * `hasFixedKey` has nothing to key off — so it falls back to
537
+ * {@link hasNoBusinessRelevantResponseState}, gated by
538
+ * {@link MIN_QUERYLESS_REPEAT_COUNT} same-endpoint occurrences rather than the
539
+ * fixed-query branch's bare `>= 2`. That higher bar is what keeps a
540
+ * genuinely-polled own endpoint (e.g. a two-call `/health` check with no
541
+ * response metadata supplied) from being misread as noise: with no headers
542
+ * or body, {@link hasNoBusinessRelevantResponseState} itself defaults to "no
543
+ * business-relevant state," so query-key-less repeats need to already look
544
+ * densely repeated before that default is trusted.
545
+ *
546
+ * When the query-less candidate's request body is byte-identical across every
547
+ * occurrence, a business-looking response is trusted only if it shows SOME
548
+ * evidence of real state: either it varies almost every call
549
+ * ({@link hasFreelyVaryingResponseAcrossOccurrences}) or it never varies at
550
+ * all ({@link hasNoObservedResponseVariance}) both read as noise, because
551
+ * neither demonstrates the bounded, repeats-dominate cycling (e.g. a boolean
552
+ * flipping between two values) a genuinely-polled own endpoint produces.
553
+ *
554
+ * When the request body varies across occurrences (unlike the fixed-query
555
+ * branch, which only needs the query key fixed), the missing-metadata
556
+ * default is NOT trusted: a same-endpoint POST with a differing body per
557
+ * call (e.g. a single `/graphql` endpoint fanning out distinct operations)
558
+ * only reads as noise when the candidate explicitly supplies a
559
+ * `content-type` header — otherwise the varying body is exactly the shape a
560
+ * real multi-operation API produces, and treating "no metadata given" as
561
+ * proof of noise would drop the whole flow. Once that header is present, a
562
+ * business-looking response still falls back to
563
+ * {@link hasFreelyVaryingResponseAcrossOccurrences} for the same reason as
564
+ * the fixed-query branch — a same-origin widget can vary both its request
565
+ * body and its response payload per call and still be noise. A byte-identical
566
+ * body across every occurrence is unambiguous regardless of metadata, so that
567
+ * case still defers fully to {@link hasNoBusinessRelevantResponseState}.
568
+ */
569
+ /**
570
+ * Minimum same-endpoint occurrence count required to flag a query-less
571
+ * candidate as noise. Higher than the fixed-query branch's bare `>= 2`
572
+ * because a query-less candidate has no fixed key to corroborate the match —
573
+ * only the repeat count itself distinguishes a densely-polled sensor from a
574
+ * legitimately-repeated own endpoint (a two-call `/health` check).
575
+ */
576
+ const MIN_QUERYLESS_REPEAT_COUNT = 3;
577
+ /**
578
+ * Minimum same-endpoint occurrence count required before a QUERY-LESS
579
+ * candidate's LACK of observed response variance is trusted as a noise
580
+ * signal — i.e. before {@link hasNoObservedResponseVariance} (identical
581
+ * request, response never once shows a second value) or a query-less
582
+ * candidate whose own request body ALSO varies every call is allowed to fall
583
+ * through to {@link hasFreelyVaryingResponseAcrossOccurrences}.
584
+ *
585
+ * A query-less candidate has no fixed query key to independently corroborate
586
+ * that every occurrence really is the same recurring widget (unlike the
587
+ * fixed-query-key branch below, where a recurring key such as
588
+ * `clientId`/`environment` already proves that). Two shapes need this
589
+ * corroboration:
590
+ *
591
+ * 1. An identical-body query-less candidate whose response has never once
592
+ * shown a second value ({@link hasNoObservedResponseVariance}) is
593
+ * genuinely ambiguous at low count: a same-origin noise widget that
594
+ * happens to return one static value for its whole archived session
595
+ * looks identical to a real closed-set poll (a feature toggle) that
596
+ * simply has not flipped yet within a short capture window. A widget's
597
+ * response varying almost every call ({@link hasFreelyVaryingResponseAcrossOccurrences})
598
+ * is NOT gated here — nothing about an identical, unchanging request can
599
+ * explain a varying response, so that signal is trustworthy regardless
600
+ * of count.
601
+ * 2. A query-less candidate whose own request body ALSO varies every call
602
+ * has no corroboration for {@link hasFreelyVaryingResponseAcrossOccurrences}
603
+ * either: a paged listing's `{ page: n }` body and a per-item drill's
604
+ * `{ productId }` body produce a response signature just as
605
+ * high-cardinality as an actual per-call-varying beacon's fingerprint, at
606
+ * the same low occurrence counts recon fixtures and most live flows
607
+ * exercise (a handful of pages, a handful of drilled items).
608
+ *
609
+ * In both shapes, occurrence count is the only remaining corroborating
610
+ * signal for a query-less candidate: a same-origin widget fires on every
611
+ * page load and accumulates a dense repeat count over one recon session,
612
+ * while a real own endpoint's repeat count is bounded by how many
613
+ * pages/items/polls the flow actually performs. This does NOT gate the
614
+ * fixed-query-key branch, whose recurring key is itself the corroborating
615
+ * signal a query-less candidate lacks — that branch's own regression
616
+ * coverage proves the classification must hold well below this floor.
617
+ */
618
+ const MIN_DENSE_REPEAT_FOR_RESPONSE_VARIANCE_SIGNAL = 10;
619
+ /**
620
+ * Distinct pathnames belonging to endpoints OTHER than `candidateEndpoint`,
621
+ * present in `allCaptures` — the reference pool {@link isCorroboratedByStructuralIsolation}
622
+ * compares the candidate against. Drawn from the same capture run so the
623
+ * signal stays intrinsic to this archive rather than any global assumption
624
+ * about what a "real" path looks like.
625
+ */
626
+ function otherEndpointPaths(candidateEndpoint, allCaptures) {
627
+ const paths = new Set();
628
+ for (const capture of allCaptures) {
629
+ if (endpointOrigin(capture.url) === candidateEndpoint)
630
+ continue;
631
+ try {
632
+ paths.add(new URL(capture.url).pathname);
633
+ }
634
+ catch {
635
+ // unparsable URL contributes no comparison path
636
+ }
637
+ }
638
+ return [...paths];
639
+ }
640
+ function weakNoiseSignalFor(sameEndpoint) {
641
+ if (hasNoObservedResponseVariance(sameEndpoint))
642
+ return "no-variance";
643
+ if (hasFreelyVaryingResponseAcrossOccurrences(sameEndpoint))
644
+ return "freely-varying";
645
+ return null;
646
+ }
647
+ /**
648
+ * True when `poolPath` should NOT be trusted as corroboration for
649
+ * `candidateEndpoint`'s isolation check — i.e. what
650
+ * {@link nonNoiseOtherEndpointPaths} excludes from the pool
651
+ * {@link isCorroboratedByStructuralIsolation} compares a candidate's raw
652
+ * segments/tokens against.
653
+ *
654
+ * A pool path with an intrinsically empty/echoed response
655
+ * ({@link hasNoBusinessRelevantResponseState}) is excluded unconditionally —
656
+ * that signal needs no corroboration of its own to trust, so a path that
657
+ * shows it is disqualified as a corroborator regardless of what asked.
658
+ *
659
+ * Otherwise, a pool path is excluded only when BOTH it and the candidate it
660
+ * is being asked to corroborate exhibit `"no-variance"` (see
661
+ * {@link poolPathLooksNoiseShaped}'s own doc for why `"freely-varying"` is
662
+ * exempt from this half of the rule): two distinct, structurally-unrelated
663
+ * noise endpoints that merely share one raw path segment (e.g. a shared
664
+ * infra/widget-family prefix) and are BOTH byte-identical-forever would
665
+ * otherwise "vouch" for each other's raw-segment overlap and neither would
666
+ * be recognized as isolated — mirroring why
667
+ * {@link isStructurallyIsolatedCapture} excludes self-referential pool paths
668
+ * from ITS overlap set.
669
+ *
670
+ * This mutual-exclusion rule fires ONLY for the `"no-variance"` signal (a
671
+ * response that is byte-identical on every occurrence), never for
672
+ * `"freely-varying"`: a real endpoint family routinely has TWO siblings that
673
+ * both show freely-varying, near-unique responses (a paged listing and a
674
+ * per-item drill both produce a different body on every call) — that shared
675
+ * high-cardinality pattern is the NORMAL shape of genuine business data, not
676
+ * evidence against it, and corroboration between such siblings is exactly
677
+ * how {@link isZeroVarianceRepeatCapture} is designed to rescue a real,
678
+ * low-occurrence, per-page/per-item candidate from its own high-cardinality
679
+ * reading. A byte-identical response, in contrast, is never how a real
680
+ * per-occurrence data endpoint behaves regardless of occurrence count, so
681
+ * two such endpoints "corroborating" each other via nothing but a shared raw
682
+ * segment carries no evidentiary weight. An occurrence count alone is
683
+ * deliberately NOT used as this discriminator: that would repeat the exact
684
+ * absolute-count mistake this corroboration check exists to correct.
685
+ *
686
+ * A pool path with no observed response body at all (the common case for a
687
+ * chain's own plain sibling steps, which this file's fixtures never attach a
688
+ * body to) contributes no evidence either way and is treated as a genuine
689
+ * sibling — absence of data is not evidence of noise.
690
+ */
691
+ function poolPathLooksNoiseShaped(poolPath, candidateEndpoint, candidateSignal, allCaptures) {
692
+ const atPoolPath = allCaptures.filter((capture) => {
693
+ if (endpointOrigin(capture.url) === candidateEndpoint)
694
+ return false;
695
+ try {
696
+ return new URL(capture.url).pathname === poolPath;
697
+ }
698
+ catch {
699
+ return false;
700
+ }
701
+ });
702
+ const withBody = atPoolPath.filter((capture) => capture.responseBody !== undefined);
703
+ const representative = withBody[0];
704
+ if (representative === undefined)
705
+ return false;
706
+ if (hasNoBusinessRelevantResponseState(representative))
707
+ return true;
708
+ if (candidateSignal !== "no-variance")
709
+ return false;
710
+ const sameEndpoint = atPoolPath.filter((capture) => capture.method === representative.method);
711
+ return weakNoiseSignalFor(sameEndpoint) === "no-variance";
712
+ }
713
+ /**
714
+ * {@link otherEndpointPaths}, minus any pool path that is itself
715
+ * {@link poolPathLooksNoiseShaped noise-shaped RELATIVE TO `candidate`} — the
716
+ * corroboration pool {@link isCorroboratedByStructuralIsolation} actually
717
+ * compares a candidate's raw segments/tokens against. Kept separate from the
718
+ * raw, unfiltered {@link otherEndpointPaths} result because "no other
719
+ * endpoint exists in this run at all" (isolation genuinely cannot be
720
+ * established) and "every other endpoint in this run is itself noise"
721
+ * (isolation from every LEGITIMATE sibling is fully established) are
722
+ * different findings and must not collapse to the same "nothing to compare"
723
+ * fallback.
724
+ */
725
+ function nonNoiseOtherEndpointPaths(candidateEndpoint, candidateSameEndpoint, allCaptures) {
726
+ const candidateSignal = weakNoiseSignalFor(candidateSameEndpoint);
727
+ return otherEndpointPaths(candidateEndpoint, allCaptures).filter((path) => !poolPathLooksNoiseShaped(path, candidateEndpoint, candidateSignal, allCaptures));
728
+ }
729
+ /**
730
+ * True when `a` and `b` are the same word, or one is a shared-stem prefix of
731
+ * the other (e.g. `avail` / `available`, `product` / `products`) — the same
732
+ * abbreviation and pluralization variants a same-flow endpoint family
733
+ * routinely uses for what is, structurally, the same resource word. The
734
+ * 4-character floor keeps this from firing on short, coincidentally-
735
+ * overlapping fragments.
736
+ */
737
+ function tokensShareStem(a, b) {
738
+ if (a === b)
739
+ return true;
740
+ const [shorter, longer] = a.length <= b.length ? [a, b] : [b, a];
741
+ return shorter.length >= 4 && longer.startsWith(shorter);
742
+ }
743
+ /**
744
+ * True when any token in `candidateTokens` shares a stem (see
745
+ * {@link tokensShareStem}) with any token in `referenceTokens`.
467
746
  */
747
+ function sharesStemmedToken(candidateTokens, referenceTokens) {
748
+ for (const candidateToken of candidateTokens) {
749
+ for (const referenceToken of referenceTokens) {
750
+ if (tokensShareStem(candidateToken, referenceToken))
751
+ return true;
752
+ }
753
+ }
754
+ return false;
755
+ }
756
+ /**
757
+ * True when a query-less candidate's repeat is corroborated as noise by
758
+ * structural isolation from every OTHER distinct endpoint already present in
759
+ * the same capture run — a signal intrinsic to the capture's relationship to
760
+ * the rest of the flow, unlike an absolute occurrence count, which cannot
761
+ * tell a low-count real endpoint apart from a low-count noise widget (both
762
+ * produce the identical response-variance shape at a small sample size; see
763
+ * capture-filters.test.ts's own paired isolated/related fixtures at the same
764
+ * 7-occurrence count).
765
+ *
766
+ * Does NOT reuse {@link isStructurallyRelevantCapture}'s exact-token-equality
767
+ * rule for a candidate with a compound segment: that rule is deliberately
768
+ * strict because its job (schema-inference family membership) is hurt more
769
+ * by a false "related" than a false "unrelated". This predicate's bias runs
770
+ * the other way — a false "isolated" here discards a real endpoint's data as
771
+ * noise — so it uses {@link sharesStemmedToken}'s more permissive stem
772
+ * comparison instead: two same-flow endpoints commonly spell the same
773
+ * resource word as an abbreviation or a different inflection (a `product-
774
+ * avail` poll and an `available-products` listing sharing "avail"/
775
+ * "available"), which an exact-token bar can't see. A plain-word candidate
776
+ * (empty token set) does NOT get {@link isStructurallyIsolatedCapture}'s
777
+ * conservative "assume related unless self-referential" fallback — that
778
+ * fallback exists to protect a *plain-word chain step* from being misread as
779
+ * noise when it shares no token with its siblings, which is the opposite of
780
+ * what this predicate needs. But it also must not default to "isolated"
781
+ * outright: a candidate that shares a raw meaningful segment with another
782
+ * endpoint (e.g. `/user/profile` alongside a sibling `/user/profile/edit`,
783
+ * or `/feature-toggles/catalog` alongside a sibling `/catalog/listing`) is
784
+ * still demonstrably part of the same flow even when its compound segment's
785
+ * tokens don't line up with the sibling's. So EVERY candidate — compound-
786
+ * token or plain-word — additionally falls back to a raw-segment overlap
787
+ * check when the token check finds nothing: isolated only when it shares
788
+ * nothing, stemmed token or raw segment, with any other endpoint in the run
789
+ * (an `/pulse/api/v1/urgency`-shaped candidate sharing nothing with the rest
790
+ * of the flow).
791
+ *
792
+ * When the run captured no OTHER distinct endpoint at all, there is nothing
793
+ * to compare against, so isolation cannot be established either way — the
794
+ * caller falls back to the occurrence-count floor in that case.
795
+ *
796
+ * The comparison pool is split into two arguments on purpose:
797
+ * `otherPaths` (every other distinct endpoint captured in the run, raw and
798
+ * unfiltered) only answers "is there anything to compare against at all",
799
+ * while `corroboratingPaths` ({@link nonNoiseOtherEndpointPaths}, with any
800
+ * pool path that is itself {@link poolPathLooksNoiseShaped noise-shaped}
801
+ * excluded) is what the token/segment overlap is actually checked against.
802
+ * Using the unfiltered pool for both would let two distinct, structurally-
803
+ * unrelated noise endpoints that merely share one raw path segment "vouch"
804
+ * for each other via that shared segment, so neither is ever recognized as
805
+ * isolated — the raw-segment fallback below has no protection of its own
806
+ * against that the way {@link isStructurallyIsolatedCapture} already does
807
+ * for its pool.
808
+ */
809
+ function isCorroboratedByStructuralIsolation(candidatePath, otherPaths, corroboratingPaths) {
810
+ if (otherPaths.length === 0)
811
+ return false;
812
+ const candidateTokens = pathStructuralTokens(candidatePath);
813
+ if (candidateTokens.size > 0 &&
814
+ corroboratingPaths.some((otherPath) => sharesStemmedToken(candidateTokens, pathStructuralTokens(otherPath)))) {
815
+ return false;
816
+ }
817
+ const candidateSegments = meaningfulPathSegments(candidatePath);
818
+ if (candidateSegments.length === 0)
819
+ return false;
820
+ const otherSegments = new Set(corroboratingPaths.flatMap((path) => meaningfulPathSegments(path)));
821
+ return !candidateSegments.some((segment) => otherSegments.has(segment));
822
+ }
823
+ /**
824
+ * True when same-endpoint occurrences carry JSON response bodies that are
825
+ * mostly pairwise distinct — i.e. the payload never settles back into a
826
+ * value it has already shown.
827
+ *
828
+ * This is what tells a genuinely-polled own endpoint (a feature-toggle feed,
829
+ * a health check) apart from a query-less noise widget whose response merely
830
+ * LOOKS like real data: both can carry non-URL-derivable JSON leaves, but a
831
+ * real polled endpoint cycles through a small closed set of states (a
832
+ * boolean flips between two values, say), so most occurrences duplicate an
833
+ * earlier one, while a per-load noise widget (a chat-bubble loader stamping
834
+ * a fresh counter/session id into its own response) produces a near-unique
835
+ * value on almost every occurrence. Comparing each occurrence against just
836
+ * the candidate's own value can't distinguish these — a two-state toggle and
837
+ * an ever-incrementing counter both differ from any single candidate about
838
+ * half the time — so this counts distinct values across ALL occurrences
839
+ * instead: a low-cardinality set (repeats dominate) is a real poll, a
840
+ * high-cardinality set (values rarely repeat) is noise. Occurrences with no
841
+ * response metadata supplied contribute no evidence either way, so this only
842
+ * fires when at least two occurrences actually carry a body to compare.
843
+ */
844
+ function hasFreelyVaryingResponseAcrossOccurrences(sameEndpoint) {
845
+ const { withBody, distinctSignatures } = responseSignatureCardinality(sameEndpoint);
846
+ if (withBody.length < 2)
847
+ return false;
848
+ return distinctSignatures.size > withBody.length / 2;
849
+ }
850
+ /**
851
+ * Distinct JSON-response signatures observed across same-endpoint occurrences,
852
+ * alongside the subset that actually carried a body — the shared cardinality
853
+ * count {@link hasFreelyVaryingResponseAcrossOccurrences} (high-cardinality
854
+ * noise) and {@link hasNoObservedResponseVariance} (zero-cardinality noise)
855
+ * each read off, so the two "not real state" signals can't drift apart on
856
+ * how a signature is computed.
857
+ */
858
+ function responseSignatureCardinality(sameEndpoint) {
859
+ const withBody = sameEndpoint.filter((c) => c.responseBody !== undefined);
860
+ return {
861
+ withBody,
862
+ distinctSignatures: new Set(withBody.map((c) => JSON.stringify(c.responseBody))),
863
+ };
864
+ }
865
+ /**
866
+ * True when every same-endpoint occurrence that carried a response body
867
+ * carried the SAME body — i.e. the response never once demonstrated a
868
+ * second state. A genuinely-polled own endpoint with real closed-set state
869
+ * (a toggle that flips between two values) shows at least one differing
870
+ * occurrence somewhere in the archive; a query-less noise widget that
871
+ * happens to have been captured returning one static, business-looking-but-
872
+ * non-URL-derivable value for the whole archived session shows none. This is
873
+ * the query-less-only counterpart to {@link hasFreelyVaryingResponseAcrossOccurrences}:
874
+ * that one catches a widget whose value changes almost every call, this one
875
+ * catches the opposite extreme — a widget whose value never changes at all —
876
+ * neither of which is evidence of the bounded, repeats-dominate cycling a
877
+ * real closed-set poll produces.
878
+ */
879
+ function hasNoObservedResponseVariance(sameEndpoint) {
880
+ const { withBody, distinctSignatures } = responseSignatureCardinality(sameEndpoint);
881
+ return withBody.length >= 2 && distinctSignatures.size <= 1;
882
+ }
468
883
  function isZeroVarianceRepeatCapture(candidate, allCaptures) {
469
884
  let candidateUrl;
470
885
  try {
@@ -477,9 +892,35 @@ function isZeroVarianceRepeatCapture(candidate, allCaptures) {
477
892
  if (candidateEndpoint === null)
478
893
  return false;
479
894
  const candidateKeys = [...candidateUrl.searchParams.keys()];
480
- if (candidateKeys.length === 0)
481
- return false;
482
895
  const sameEndpoint = allCaptures.filter((c) => c.method === candidate.method && endpointOrigin(c.url) === candidateEndpoint);
896
+ if (candidateKeys.length === 0) {
897
+ if (sameEndpoint.length < MIN_QUERYLESS_REPEAT_COUNT)
898
+ return false;
899
+ const queryLessBodyIdentical = sameEndpoint.every((c) => c.requestPostData === candidate.requestPostData);
900
+ if (queryLessBodyIdentical) {
901
+ if (hasNoBusinessRelevantResponseState(candidate))
902
+ return true;
903
+ if (hasFreelyVaryingResponseAcrossOccurrences(sameEndpoint))
904
+ return true;
905
+ if (sameEndpoint.length < MIN_DENSE_REPEAT_FOR_RESPONSE_VARIANCE_SIGNAL &&
906
+ !isCorroboratedByStructuralIsolation(candidateUrl.pathname, otherEndpointPaths(candidateEndpoint, allCaptures), nonNoiseOtherEndpointPaths(candidateEndpoint, sameEndpoint, allCaptures))) {
907
+ return false;
908
+ }
909
+ return hasNoObservedResponseVariance(sameEndpoint);
910
+ }
911
+ const hasExplicitContentType = Object.keys(candidate.responseHeaders ?? {}).some((key) => key.toLowerCase() === "content-type");
912
+ if (!hasExplicitContentType)
913
+ return false;
914
+ if (hasResponseFullyExplainedByOwnRequestPerOccurrence(sameEndpoint))
915
+ return false;
916
+ if (hasNoBusinessRelevantResponseState(candidate))
917
+ return true;
918
+ if (sameEndpoint.length < MIN_DENSE_REPEAT_FOR_RESPONSE_VARIANCE_SIGNAL &&
919
+ !isCorroboratedByStructuralIsolation(candidateUrl.pathname, otherEndpointPaths(candidateEndpoint, allCaptures), nonNoiseOtherEndpointPaths(candidateEndpoint, sameEndpoint, allCaptures))) {
920
+ return false;
921
+ }
922
+ return hasFreelyVaryingResponseAcrossOccurrences(sameEndpoint);
923
+ }
483
924
  if (sameEndpoint.length < 2)
484
925
  return false;
485
926
  const sameEndpointUrls = sameEndpoint
@@ -500,7 +941,11 @@ function isZeroVarianceRepeatCapture(candidate, allCaptures) {
500
941
  if (!hasFixedKey)
501
942
  return false;
502
943
  const bodyIdentical = sameEndpoint.every((c) => c.requestPostData === candidate.requestPostData);
503
- return bodyIdentical || hasNoBusinessRelevantResponseState(candidate);
944
+ if (bodyIdentical)
945
+ return true;
946
+ if (hasNoBusinessRelevantResponseState(candidate))
947
+ return true;
948
+ return hasFreelyVaryingResponseAcrossOccurrences(sameEndpoint);
504
949
  }
505
950
  /**
506
951
  * True when `hostname` is allowed as a fixture host: an exact match against
@@ -1 +1 @@
1
- {"version":3,"file":"capture-filters.js","sourceRoot":"","sources":["../../src/recon/capture-filters.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;AAEH;;;;;;;GAOG;AACH;IACE,OAAO;QACL,4BAA4B;QAC5B,aAAa;QACb,yBAAyB;QACzB,sBAAsB;QACtB,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,EAAE,CAAC;aAChD,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aACpB,MA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,CAAC,CAAC,eAAe,KAAK,SAAS,CAAC,eAAe,CAAC,CAAC;IACjG,IAAI,aAAa;QAAE,OAAO,IAAI,CAAC;IAC/B,IAAI,kCAAkC,CAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/D,OAAO,yCAAyC,CAAC,YAAY,CAAC,CAAC;AACjE,CAAC;AAED;;;;;;;GAOG;AACH,8BACE,QAAgB,EAChB,mBAA6B,EAC7B,cAA6B;IAE7B,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACpC,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAClF,IAAI,gBAAgB,CAAC,IAAI,GAAG,CAAC;QAAE,OAAO,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjE,OAAO,cAAc,KAAK,IAAI,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,cAAc,CAAC;AAC/E,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Engine-internal loader for `--value-constraints`. Like {@link @/recon/load-vocabulary},
3
+ * deliberately NOT in the package's `exports` map: consumers author a value-constraints
4
+ * module against the `./recon/value-constraints` type contract, and only `recon-generate`
5
+ * ever loads one. Exporting this would publish an import-time side effect (dynamic
6
+ * `import()` of arbitrary consumer code) as public API for no caller.
7
+ */
8
+ import { type ReconValueConstraints } from "./value-constraints";
9
+ /** The `--value-constraints` value that opts a site out of declaring any. */
10
+ export declare const VALUE_CONSTRAINTS_NONE = "none";
11
+ /**
12
+ * Loads a consumer's value-constraints module.
13
+ *
14
+ * Resolution reuses {@link resolvePluginSpecifier}, so `--value-constraints` accepts
15
+ * the same specifier forms as `BARNACLE_PLUGINS`, `--vocabulary`, and `--form-schema`.
16
+ * Export resolution matches the plugin loader's `m.valueConstraints ?? m.default ?? m`.
17
+ *
18
+ * Throws rather than falling back: constraints that were asked for and are broken
19
+ * are an error, while asking for none is the caller's explicit `none`.
20
+ */
21
+ export declare function loadReconValueConstraints(specifier: string, baseDir: string): Promise<ReconValueConstraints>;
22
+ //# sourceMappingURL=load-value-constraints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-value-constraints.d.ts","sourceRoot":"","sources":["../../src/recon/load-value-constraints.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,EAA2B,KAAK,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEhG,6EAA6E;AAC7E,eAAO,MAAM,sBAAsB,SAAS,CAAC;AA4B7C;;;;;;;;;GASG;AACH,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,qBAAqB,CAAC,CAehC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ /**
3
+ * Engine-internal loader for `--value-constraints`. Like {@link @/recon/load-vocabulary},
4
+ * deliberately NOT in the package's `exports` map: consumers author a value-constraints
5
+ * module against the `./recon/value-constraints` type contract, and only `recon-generate`
6
+ * ever loads one. Exporting this would publish an import-time side effect (dynamic
7
+ * `import()` of arbitrary consumer code) as public API for no caller.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.VALUE_CONSTRAINTS_NONE = void 0;
11
+ exports.loadReconValueConstraints = loadReconValueConstraints;
12
+ const v4_1 = require("zod/v4");
13
+ const errors_1 = require("../lib/errors");
14
+ const discover_1 = require("../plugins/discover");
15
+ const value_constraints_1 = require("./value-constraints");
16
+ /** The `--value-constraints` value that opts a site out of declaring any. */
17
+ exports.VALUE_CONSTRAINTS_NONE = "none";
18
+ /** Matches the emitter's identifier rule: a field name is spliced into source as
19
+ * `payload.<name>` in the generator's extendFields map, so anything else emits a
20
+ * broken plugin that still generates. */
21
+ const payloadFieldNameSchema = v4_1.z
22
+ .string()
23
+ .regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/, "must be a valid JS identifier to splice into generated code");
24
+ const fieldConstraintSchema = v4_1.z
25
+ .object({
26
+ enumValues: v4_1.z.array(v4_1.z.string()).optional(),
27
+ min: v4_1.z.number().optional(),
28
+ max: v4_1.z.number().optional(),
29
+ })
30
+ .refine((v) => v.min === undefined || v.max === undefined || v.min <= v.max, {
31
+ message: "min must not be greater than max",
32
+ });
33
+ /**
34
+ * Validates the shape at the boundary so a malformed declaration fails at generate
35
+ * time with a field path, rather than silently emitting an unconstrained schema.
36
+ */
37
+ const valueConstraintsSchema = v4_1.z.record(payloadFieldNameSchema, fieldConstraintSchema);
38
+ /**
39
+ * Loads a consumer's value-constraints module.
40
+ *
41
+ * Resolution reuses {@link resolvePluginSpecifier}, so `--value-constraints` accepts
42
+ * the same specifier forms as `BARNACLE_PLUGINS`, `--vocabulary`, and `--form-schema`.
43
+ * Export resolution matches the plugin loader's `m.valueConstraints ?? m.default ?? m`.
44
+ *
45
+ * Throws rather than falling back: constraints that were asked for and are broken
46
+ * are an error, while asking for none is the caller's explicit `none`.
47
+ */
48
+ async function loadReconValueConstraints(specifier, baseDir) {
49
+ if (specifier === exports.VALUE_CONSTRAINTS_NONE)
50
+ return value_constraints_1.EMPTY_VALUE_CONSTRAINTS;
51
+ const href = (0, discover_1.resolvePluginSpecifier)(specifier, baseDir);
52
+ const mod = await import(href);
53
+ const record = mod;
54
+ const raw = record.valueConstraints ?? record.default ?? mod;
55
+ const parsed = valueConstraintsSchema.safeParse(raw);
56
+ if (!parsed.success) {
57
+ throw new Error(`value-constraints module ${JSON.stringify(specifier)} does not export a valid ReconValueConstraints: ${(0, errors_1.toErrorMessage)(parsed.error)}`);
58
+ }
59
+ return parsed.data;
60
+ }
61
+ //# sourceMappingURL=load-value-constraints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-value-constraints.js","sourceRoot":"","sources":["../../src/recon/load-value-constraints.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,+BAA2B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