@libreflare/worker-runtime 0.9.4 → 0.10.0

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 (70) hide show
  1. package/README.md +323 -33
  2. package/dist/log-handler.d.ts.map +1 -1
  3. package/dist/log-handler.js +3 -4
  4. package/dist/log-handler.js.map +1 -1
  5. package/dist/rule-evaluator/accept-encoding.d.ts.map +1 -1
  6. package/dist/rule-evaluator/accept-encoding.js +3 -0
  7. package/dist/rule-evaluator/accept-encoding.js.map +1 -1
  8. package/dist/rule-evaluator/access-values.d.ts +5 -3
  9. package/dist/rule-evaluator/access-values.d.ts.map +1 -1
  10. package/dist/rule-evaluator/access-values.js +9 -3
  11. package/dist/rule-evaluator/access-values.js.map +1 -1
  12. package/dist/rule-evaluator/country-codes.generated.js +1 -1
  13. package/dist/rule-evaluator/diagnostics.d.ts +1 -1
  14. package/dist/rule-evaluator/diagnostics.d.ts.map +1 -1
  15. package/dist/rule-evaluator/diagnostics.js +1 -0
  16. package/dist/rule-evaluator/diagnostics.js.map +1 -1
  17. package/dist/rule-evaluator/edge-evaluation.d.ts +128 -0
  18. package/dist/rule-evaluator/edge-evaluation.d.ts.map +1 -0
  19. package/dist/rule-evaluator/edge-evaluation.js +316 -0
  20. package/dist/rule-evaluator/edge-evaluation.js.map +1 -0
  21. package/dist/rule-evaluator/edge-record.d.ts +173 -0
  22. package/dist/rule-evaluator/edge-record.d.ts.map +1 -0
  23. package/dist/rule-evaluator/edge-record.js +771 -0
  24. package/dist/rule-evaluator/edge-record.js.map +1 -0
  25. package/dist/rule-evaluator/evaluator.d.ts +21 -0
  26. package/dist/rule-evaluator/evaluator.d.ts.map +1 -1
  27. package/dist/rule-evaluator/evaluator.js +60 -3
  28. package/dist/rule-evaluator/evaluator.js.map +1 -1
  29. package/dist/rule-evaluator/explain.d.ts +6 -0
  30. package/dist/rule-evaluator/explain.d.ts.map +1 -1
  31. package/dist/rule-evaluator/explain.js +54 -20
  32. package/dist/rule-evaluator/explain.js.map +1 -1
  33. package/dist/rule-evaluator/fields.d.ts +50 -6
  34. package/dist/rule-evaluator/fields.d.ts.map +1 -1
  35. package/dist/rule-evaluator/fields.js +72 -50
  36. package/dist/rule-evaluator/fields.js.map +1 -1
  37. package/dist/rule-evaluator/functions.d.ts +18 -0
  38. package/dist/rule-evaluator/functions.d.ts.map +1 -1
  39. package/dist/rule-evaluator/functions.js +58 -4
  40. package/dist/rule-evaluator/functions.js.map +1 -1
  41. package/dist/rule-evaluator/log-sample.d.ts +23 -0
  42. package/dist/rule-evaluator/log-sample.d.ts.map +1 -1
  43. package/dist/rule-evaluator/log-sample.js +5 -3
  44. package/dist/rule-evaluator/log-sample.js.map +1 -1
  45. package/dist/rule-evaluator/match-chain.d.ts +8 -0
  46. package/dist/rule-evaluator/match-chain.d.ts.map +1 -1
  47. package/dist/rule-evaluator/match-chain.js +16 -0
  48. package/dist/rule-evaluator/match-chain.js.map +1 -1
  49. package/dist/rule-evaluator/operators.d.ts +5 -0
  50. package/dist/rule-evaluator/operators.d.ts.map +1 -1
  51. package/dist/rule-evaluator/operators.js +52 -0
  52. package/dist/rule-evaluator/operators.js.map +1 -1
  53. package/dist/rule-evaluator/query-args.d.ts +2 -2
  54. package/dist/rule-evaluator/query-args.d.ts.map +1 -1
  55. package/dist/rule-evaluator/query-args.js +11 -4
  56. package/dist/rule-evaluator/query-args.js.map +1 -1
  57. package/dist/rule-evaluator/request-headers.d.ts +7 -0
  58. package/dist/rule-evaluator/request-headers.d.ts.map +1 -1
  59. package/dist/rule-evaluator/request-headers.js +27 -16
  60. package/dist/rule-evaluator/request-headers.js.map +1 -1
  61. package/dist/rule-evaluator/validation.d.ts.map +1 -1
  62. package/dist/rule-evaluator/validation.js +151 -48
  63. package/dist/rule-evaluator/validation.js.map +1 -1
  64. package/dist/rule-evaluator.d.ts +5 -0
  65. package/dist/rule-evaluator.d.ts.map +1 -1
  66. package/dist/rule-evaluator.js +3 -0
  67. package/dist/rule-evaluator.js.map +1 -1
  68. package/dist/tools/explain-rule-miss.js +259 -10
  69. package/dist/tools/explain-rule-miss.js.map +1 -1
  70. package/package.json +4 -4
package/README.md CHANGED
@@ -120,7 +120,8 @@ when that argument is invalid, or a syntax error left it uncertain.
120
120
  Where Cloudflare's documentation and its ruleset engine disagree, validation
121
121
  follows the engine, as observed with dry-run rule validation. For example, URL
122
122
  rewrite expressions accept every field URL rewrite filters accept,
123
- `hash_in_range()` takes one seed, `lookup_json_*()` keys must be literals,
123
+ `hash_in_range()` takes one seed and, like `uuidv4()`, can appear only once in
124
+ an expression, `lookup_json_*()` keys must be literals,
124
125
  header map keys such as `http.request.headers["x-a"]` must be lowercase, and
125
126
  integer literals must fit in 64 bits, with `0x` making one hex and a leading `0` making one octal. Field availability keeps each preset's
126
127
  documented fields and the observed differences apart, and `fieldAvailability`
@@ -178,12 +179,10 @@ URL rewrite filters and rewrite targets also reject the functions the URL
178
179
  rewrite phase does not accept, such as `split()` in either and `to_string()`
179
180
  in filters, with `function.unavailable`. Rewrite targets reject operators,
180
181
  quantifiers, and conditions used as function arguments, such as `eq`, `any()`,
181
- and `to_string((ssl))`, with `operator.unavailable`. In both,
182
- `concat()`, `regex_replace()`, and `wildcard_replace()` can appear only once,
183
- and the replacement functions cannot be nested. These phase rules depend on the
184
- preset alone: `fieldAvailability` does not change them, and they do not apply
185
- to source-key rules or when `evaluateExpression` decides whether an expression
186
- is valid.
182
+ and `to_string((ssl))`, with `operator.unavailable`. In both, `concat()` can
183
+ appear only once. These phase rules depend on the preset alone:
184
+ `fieldAvailability` does not change them, and they do not apply to source-key
185
+ rules or when `evaluateExpression` decides whether an expression is valid.
187
186
  `getRuleExpressionFunctionDescriptions()` lists only the functions a preset
188
187
  accepts, `url-rewrite-filter` by default as in validation; the
189
188
  `logging-source-key` preset lists every function.
@@ -209,8 +208,11 @@ Cloudflare accepts. An expression with a syntax error, a type mismatch such as
209
208
  a Number compared with a String, an invalid function call such as `coalesce()`
210
209
  with one argument, or a field on the right of an operator other than `eq`,
211
210
  `ne`, `lt`, `le`, `gt` or `ge` is not evaluated and does not match, even if
212
- another branch would match. The warnings list the validation errors. Field
213
- availability is not part of this check, but unknown fields are.
211
+ another branch would match. So is an expression that calls `hash_in_range()`,
212
+ `regex_replace()`, `uuidv4()` or `wildcard_replace()` twice, or nests
213
+ `regex_replace()` and `wildcard_replace()` in each other, which no Cloudflare
214
+ phase accepts. The warnings list the validation errors. Field availability and the URL rewrite
215
+ phase's rules are not part of this check, but unknown fields are.
214
216
 
215
217
  ### Comparisons and Missing Values
216
218
 
@@ -452,6 +454,12 @@ a query. Cloudflare answers 400 to a query with a space, a control character or
452
454
  a byte outside ASCII before any rule runs, and drops a fragment, so `?a=#b`
453
455
  reads as `a=`.
454
456
 
457
+ `http.host` and `http.request.full_uri` read the host in lowercase, without a
458
+ port or a trailing dot, as the rules engine does on any port, though a
459
+ Worker's `request.url` keeps a port other than 443 and a trailing dot the
460
+ client sent. The Host header reads as the Worker gets it, which keeps them
461
+ but drops a `:443` the engine's keeps.
462
+
455
463
  ### Request Headers
456
464
 
457
465
  Workers lowercases and sorts request header names, joins repeated headers into
@@ -526,30 +534,49 @@ On a challenge solve, the browser sends the solve as a form POST, and
526
534
  Cloudflare rebuilds the challenged request in its place, before its rules run.
527
535
  Cloudflare and the Worker both read the rebuilt request, but
528
536
  `request.cf.requestHeaderNames` still names the solve's headers, such as
529
- `Content-Type`, `Origin` and a `Referer` to the challenge page. In a live
530
- probe, Cloudflare listed the rebuilt request's headers from before transforms,
531
- without `X-Forwarded-Proto` and with `Host` in title case. The evaluator takes
532
- a GET for a solve when its names list `Content-Length`, `Content-Type` and
533
- `Origin` and the Worker has none of them. It then lists `Host` and the solve's
534
- headers, in the solve's order, but the solve's own `Content-Length`,
535
- `Content-Type`, `Origin`, `Cache-Control` and `Referer` where the Worker lacks
536
- them. Another listed header the Worker lacks keeps an unknown value, as on
537
- other requests. The Worker's other headers follow, such as a `Sec-Fetch-User`
538
- the solve did not send, except those Cloudflare and Managed Transforms add,
539
- such as `CF-Ray`, `X-Real-IP` and `True-Client-IP`.
540
-
541
- Worker context cannot tell everything about the rebuilt request. A header a
542
- request header transform rule added is listed with the Worker's other headers,
543
- and one of the solve's own five that such a rule removed from the challenged
544
- request is not listed, though Cloudflare lists it. A header's count, which
545
- splits its joined value, comes from the solve's names. The Worker's other
546
- headers count once, and over HTTP/1 their names are lowercase rather than the
547
- client's spelling. Cloudflare's order followed no protocol's layout in the
548
- probe, so positions in the names and values follow the order above, and
549
- validation warns where a rule reads them by index or through `join()`, also by
550
- way of `coalesce()`, `concat()` and functions that map over them, or where
551
- `any()` or `all()` pairs them with an array from another list. The raw header
552
- fields are unknown on a solve, so reading them in order gets no such warning.
537
+ `Content-Type`, `Origin` and a `Referer` to the challenge page. In live
538
+ probes, Cloudflare listed the rebuilt request's headers from before
539
+ transforms, without `X-Forwarded-Proto`, and without `Cache-Control` and
540
+ `Pragma` even where the challenged request sent them. It spelled `Host` as
541
+ for the challenged request's protocol, in lowercase after HTTP/3 and in title
542
+ case after HTTP/2. Its connection fields, such as `http.request.version`,
543
+ `cf.tls_version` and the RTTs, read the solve's connection, as `request.cf`
544
+ does, even where the browser had switched to HTTP/3 after the challenge.
545
+ Cloudflare runs its URL rewrite rules again on the rebuilt request, so a
546
+ rewrite that depends on `Cache-Control` or `Pragma` no longer applies after
547
+ the solve, and the request goes where its unrewritten URL leads, which may
548
+ not be the Worker. Validation gives the notice
549
+ `field.header_dropped_on_challenge_solve` where a rule looks either header up
550
+ by name: by its key in the request headers, with `has_key()`, or among the
551
+ header names, with `has_value()` or by comparing each with the name in `any()`
552
+ or `all()`.
553
+
554
+ The evaluator takes a GET for a solve when its names list `Content-Length`,
555
+ `Content-Type` and `Origin` and the Worker has none of them. It then lists
556
+ `Host` and the solve's headers, in the solve's order, but the solve's own
557
+ `Content-Length`, `Content-Type`, `Origin` and `Referer`, and `Cache-Control`
558
+ and `Pragma`, where the Worker lacks them. Another listed header the Worker
559
+ lacks keeps an unknown value, as on other requests. The Worker's other headers
560
+ follow, such as a `Sec-Fetch-User` the solve did not send, except those
561
+ Cloudflare and Managed Transforms add, such as `CF-Ray`, `X-Real-IP` and
562
+ `True-Client-IP`.
563
+
564
+ Worker context cannot tell everything about the rebuilt request. It spells
565
+ `Host` as for the solve's protocol, which differs from the challenged
566
+ request's where the browser switched protocols in between, as browsers can
567
+ after the challenge page shows them HTTP/3. A header a request header
568
+ transform rule added is listed with the Worker's other headers, and one of
569
+ the solve's own, such as `Referer`, that such a rule removed from the
570
+ challenged request is not listed, though Cloudflare lists it. A header's
571
+ count, which splits its joined value, comes from the solve's names. The
572
+ Worker's other headers count once, and over HTTP/1 their names are lowercase
573
+ rather than the client's spelling. Cloudflare's order followed no protocol's
574
+ layout in the probes, so positions in the names and values follow the order
575
+ above, and validation warns where a rule reads them by index or through
576
+ `join()`, also by way of `coalesce()`, `concat()` and functions that map over
577
+ them, or where `any()` or `all()` pairs them with an array from another list.
578
+ The raw header fields are unknown on a solve, so reading them in order gets no
579
+ such warning.
553
580
 
554
581
  Cloudflare replays a challenged POST with its body, so it keeps its
555
582
  `Content-Type` and is not taken for a solve. Cloudflare's header fields read
@@ -617,6 +644,240 @@ inferred matches whenever assuming the list results alone can make the
617
644
  expression match. Set `inferListMatches: false` to report such expressions as
618
645
  not matched instead.
619
646
 
647
+ ## Edge Record Evaluation
648
+
649
+ `evaluateEdgeExpression()` evaluates an expression on a Cloudflare Logpush
650
+ edge record, as Libreflare's edge log mapping stores it, for a request whose
651
+ record lists a Custom Rule. Cloudflare's match is given, so the question is
652
+ which branch matched. A record holds some of the values the rules engine
653
+ read, and each condition it cannot decide may have gone either way.
654
+
655
+ ```ts
656
+ import { evaluateEdgeExpression, readEdgeRecord } from '@libreflare/worker-runtime/rule-evaluator';
657
+
658
+ const record = readEdgeRecord(storedRecord, {
659
+ loggedFields: { requestHeaders: ['accept', 'sec-fetch-dest'], cookies: ['session'] },
660
+ urlNormalization: 'rfc3986',
661
+ });
662
+ const { result, branch, candidates } = evaluateEdgeExpression(expression, record);
663
+ ```
664
+
665
+ `readEdgeRecord()` reads the record nested as the mapping writes it, or
666
+ flattened as VictoriaLogs returns it. It throws `EdgeRecordError` for a record
667
+ without a Ray ID or an http or https URL. Its options are the zone's state at the
668
+ record's time:
669
+
670
+ - `loggedFields`: the request headers and cookies the zone's custom-field rules
671
+ log, with the request headers logged raw in `requestHeaders` and those
672
+ logged transformed in `transformedRequestHeaders`. Without them, the headers
673
+ and cookies in the record stand in, and `assumedLoggedFields` is true. The
674
+ record keys a cookie by its name in lowercase, so a key with letters that
675
+ the logged cookies do not name, as none are without them, leaves that
676
+ cookie unknown in any spelling.
677
+ - `urlNormalization`: `off`, `cloudflare` or `rfc3986`, the zone's setting for
678
+ incoming URLs. Without it, a condition on a path that a normalization type
679
+ would change is unknown, unless every type's path decides it alike. One that
680
+ holds for every type, but by another inline list member, gives a branch for
681
+ each member, since the chain names it.
682
+
683
+ A result has a certainty:
684
+
685
+ | Certainty | Meaning |
686
+ | --- | --- |
687
+ | `matched` | The record decided every condition, and the expression matched. `branch` holds the chain. |
688
+ | `inferred` | One branch remains possible. Its chain marks each condition the record could not decide. |
689
+ | `unknown` | More than one branch remains possible. `candidates` lists up to four, in expression order, and `moreCandidates` says whether there are more. |
690
+ | `disagreed` | The record's values rule out a match. |
691
+ | `unavailable` | The expression is invalid, or uses a comparison Cloudflare would not evaluate. The warnings say why. |
692
+
693
+ The branch is the first alternative of an `or` that matched, as on managed
694
+ request logs. An alternative the record cannot decide may have been it, so an
695
+ alternative that matches after one is not the branch alone: `A or B`, where
696
+ the record cannot decide `A` and `B` holds, is `unknown` with both. Branches
697
+ use the managed request logs' forms, and `matchChainText()` and
698
+ `matchChainSha1()` give the `evaluation.chain` and `evaluation.chainSHA1` the
699
+ Managed Worker logs. A chain marks each condition the record could not decide
700
+ with ` [inferred]`, so a branch's hash differs from the Managed Worker's
701
+ wherever the marks differ. The marks name conditions in the chain only: in
702
+ `A xor B`, where `A` holds and the record cannot decide `B`, the result is
703
+ `inferred` with the chain `A`, as `B` is taken as false, and its hash equals
704
+ a matched one.
705
+
706
+ A chain names the inline list member a condition matched, as in
707
+ `http.host in { ... "a" ... }`. So a condition the record cannot decide
708
+ gives a branch for each member it may have matched: those its readings of
709
+ the record match, or any member a value can match first where the record
710
+ does not hold the value. An `all()` that may have held over no value, as
711
+ over a header the client may not have sent, also gives the branch that names
712
+ no member.
713
+
714
+ Conditions are taken as independent, as if no two read the same value. So
715
+ `h eq "a" and h eq "b"`, on a header the zone did not log, is `inferred`
716
+ rather than `disagreed`.
717
+
718
+ ### Routes and Rule Versions
719
+
720
+ A managed route's rewrite puts the route's prefix before the visitor's path,
721
+ and every Custom Rule reads the rewritten path. The record holds the
722
+ visitor's. Its `MatchedRules` (`edge.security.matched_rules`) lists the
723
+ transform rules that matched, URL rewrites among them, in rule order, and
724
+ never a Custom Rule. When several rewrites match, the last one sets the path,
725
+ since each reads the visitor's values.
726
+
727
+ `evaluateEdgeRecordRules()` evaluates every Custom Rule a record lists, each
728
+ once, with the rule version, route application and logged fields in effect at
729
+ the record's time, its `_time`, which Cloudflare's `EdgeStartTimestamp` sets:
730
+
731
+ - When the last route rewrite in `MatchedRules`, by each application's
732
+ `rewriteRuleId`, is a route's, every rule is evaluated with that route's
733
+ prefix before the visitor's path, and the route's expression is evaluated on
734
+ the visitor's request, whatever Custom Rules the record lists, if any. That
735
+ expression must be the text the Managed Worker evaluates, not Cloudflare's
736
+ minified one, or the chains differ.
737
+ - A rewrite rule listed after it, one of the operator's own, may have set the
738
+ path again, so the path fields are unknown.
739
+ - With no route rewrite listed, rules are evaluated with the visitor's path.
740
+ - A linked rule that matches only with its route's prefix, when
741
+ `MatchedRules` does not show that route's rewrite as the one applied, keeps
742
+ its result, usually `disagreed`, and gets `unlistedRewrite` and a warning.
743
+ On 2026-09-23, GraphQL's `productMatches`, which reports the same rules,
744
+ left a route's rewrite out of most challenged requests on one zone. In
745
+ November that zone listed it on all but one, and Logpush listed it on every
746
+ record of a production sample.
747
+ - A rule with no version at the record's time is `unavailable`, and the
748
+ warnings say what else the timeline lacked.
749
+ - The record's rule sources tell the Custom Rules from other products' rules.
750
+ The mapping's `compact()` drops an empty entry from either array, and when
751
+ they no longer line up, a listed rule the timeline has no versions of is
752
+ taken as another product's, with a warning.
753
+
754
+ To count omissions on stored records without the evaluator, query for a
755
+ linked rule's records that lack its route's rewrite:
756
+
757
+ ```
758
+ edge.security.rule_ids:"<linked rule ID>" -edge.security.matched_rules:"<rewrite rule ID>" | stats count()
759
+ ```
760
+
761
+ ### Fields
762
+
763
+ Probes on a playground zone compared edge records with the rules engine's
764
+ values for the same requests, which a response header transform rule echoed
765
+ into the records (live requests, 2026-11-16 and 2026-11-17,
766
+ `test/fixtures/edge-record-probes.json`). The evaluator reads only what they
767
+ showed equal:
768
+
769
+ - `ip.src` reads the client address, and the location fields, Cloudflare's
770
+ ASN, country, city, region code, latitude and longitude. Logpush gives the
771
+ country in lowercase, and the mapping uppercases it.
772
+ - `http.request.version`, `cf.tls_version` and `cf.tls_cipher` read the
773
+ record's protocol, TLS version and cipher. Over plain HTTP, Logpush gives
774
+ `none` and `NONE`, the mapping drops them, and the engine reads both as
775
+ empty. Over HTTPS, a record without them leaves them unknown.
776
+ - `cf.edge.client_port` reads the client's source port, over HTTP/3 too, and
777
+ `cf.zone.name` the zone's name. `cf.timings.client_tcp_rtt_msec` is 0 over
778
+ HTTP/3, as the record's is, and over TCP the record's RTT plus 1, as it is a
779
+ Worker's: the engine's was the record's plus 1 on every TCP request probed,
780
+ and on 15 production requests the Worker's equaled the record's. An RTT of
781
+ 0 over TCP is unknown.
782
+ - `cf.ray_id` joins the Ray ID and the data center.
783
+ - `http.host`, `http.request.full_uri` and `raw.http.request.full_uri` read
784
+ the record's host, which Logpush gives in lowercase with any port or
785
+ trailing dot the client sent. The engine reads it without them, on any
786
+ port. Its Host header keeps the client's case, which the record does not
787
+ show, so the header's value is unknown, though the header is always sent
788
+ once.
789
+ - `http.request.timestamp.sec` and `.msec` read `_time`, which equals the
790
+ engine's timestamp to the millisecond.
791
+ - The raw URI fields read the path and query as sent, lowercase escapes
792
+ included. Normalization does not change the query. For the path, the
793
+ Cloudflare type decodes escaped unreserved characters, uppercases the hex
794
+ digits of other escapes, merges `//`, resolves `.` and `..` segments, and
795
+ turns `\` into `/`. The RFC 3986 type does the same, but keeps `//` and
796
+ encodes `\` as `%5C`. A path of uppercase escapes, such as `/%E8%90%8C`,
797
+ stays as it is. The probes did not show the order of those steps, so a path
798
+ whose result depends on it is unknown, as are dot segments above the root
799
+ or at the end, a `..` after an empty segment, and malformed escapes. Both
800
+ types also encode `"`, `` ` ``, `|`, `^`, `<`, `>`, `{` and `}`, with
801
+ uppercase hex, and keep `[`, `]`, the sub-delimiters, `:` and `@`, which the
802
+ record holds as sent. With normalization off, the path is as sent. A path
803
+ with raw bytes outside ASCII got a 400 and no record, and a path with
804
+ another character outside printable ASCII is unknown. The engine and
805
+ Logpush both leave out a `#` and what follows it.
806
+ - Logged request headers: the record holds a header's first value, under its
807
+ name in lowercase. It mirrors the engine's view: Content-Length for a body
808
+ that arrived before the rules ran, computed when the client sent it
809
+ chunked, and Transfer-Encoding for one that arrived later, and no
810
+ X-Real-IP. A header the zone did not log is unknown, and so is
811
+ X-Forwarded-Proto, which Cloudflare adds, but not to the request it
812
+ rebuilds on a challenge solve.
813
+ - A header logged transformed holds what the origin received. With a Request
814
+ Header Transform Rule setting logged headers (2026-11-16), one logged raw
815
+ held the client's value, or nothing when the client sent none, and one
816
+ logged transformed held the rule's value either way. So a
817
+ header logged transformed is unknown, and so is a header the record holds
818
+ that the logged fields lack. A header logged both ways needs two
819
+ custom-field rules, and is unknown.
820
+ - `http.user_agent`, `http.referer` and the `X-Requested-With` header come
821
+ from Logpush's standard fields, which every record has.
822
+ - Logged cookies: Logpush matches a configured cookie name case-sensitively
823
+ and keys its value by the name in lowercase, and the evaluator maps it back.
824
+ With `LfpCase` logged, a request sending `lfpcase=lower; LfpCase=Upper` was
825
+ logged as `{"lfpcase": "Upper"}`. Other cookies are unknown, and so are
826
+ `http.cookie` and the Cookie header, which a logged cookie in the record
827
+ shows was sent. Flattened, a header named `cookie.<name>` and cookie
828
+ `<name>` share a key, which the logged fields tell apart. With both logged,
829
+ both are unknown, and without the logged fields, the key is the cookie's.
830
+ - Header names have unknown places in the list. Over HTTP/2 and HTTP/3, the
831
+ logged headers' names are known in lowercase, but for `Host` and
832
+ `Content-Length`, which the engine spells in title case over HTTP/2. Over
833
+ HTTP/1, names keep the client's spelling, so only `Host`, `Connection`,
834
+ `Upgrade` and `Content-Length`, which the engine spells itself, are known.
835
+ The raw names spelled X-Forwarded-Proto in lowercase on a challenged
836
+ HTTP/3 request, and in title case otherwise.
837
+ - The order of the header names and values is unknown, and so are the
838
+ headers the zone did not log. So `any()` or `all()` over them with an
839
+ inline list, which names the member the first header matched, gives a
840
+ branch for each member a value can match first, those the record's headers
841
+ match first. A header the zone did not log is taken as able to hold any
842
+ value, even through a function such as `lower()`, so a branch can be listed
843
+ that the function cannot give.
844
+ - `cf.verified_bot_category` reads the record's category, and is empty
845
+ without one, so `cf.client.bot` is false. A record without `request.cf`
846
+ leaves both unknown.
847
+ - `cf.worker.upstream_zone` is empty: the edge log preset's filter leaves out
848
+ Workers' subrequests.
849
+
850
+ Other fields are unknown, such as the TLS client hashes, Bot Management
851
+ fields, the continent and time zone, and the body. Fields of `request.cf`
852
+ that a record holds, as the mapping may add them, read as on a Worker request.
853
+
854
+ ### Limits
855
+
856
+ - A logged header or cookie the record lacks was not sent, or was sent empty:
857
+ Logpush logs a value sent empty as `""`, and the mapping drops it. A
858
+ condition on one is evaluated both ways, for up to three in one condition,
859
+ and is unknown where the two differ. Past three, it is unknown, with a
860
+ branch for each inline list member it can name, and for an `all()`, the
861
+ one that names none. So a condition on a logged header's
862
+ value, such as `any(http.request.headers["sec-fetch-dest"][*] eq
863
+ "empty")`, stays known, while one on its presence, such as `has_key()`, is
864
+ never decided by its absence. Its chain carries the mark, so its hash
865
+ differs from the Managed Worker's for the same branch. An empty `Referer` or
866
+ `User-Agent` reads as empty either way, though the engine lists the header.
867
+ - A value the record holds but cannot tell the engine's reading of, such as
868
+ a path whose normalization was not observed or a TCP RTT of 0, is taken as
869
+ able to hold any value. So a condition testing it against an inline list
870
+ gives a branch for each member, even members the record's value rules out.
871
+ - A header sent twice is taken as sent once, with its first value, which is
872
+ all Logpush logs. The engine has both values. Cookies are taken as sent once
873
+ too.
874
+ - A rewrite rule of the operator's own is not evaluated. With no route
875
+ rewrite listed, a rule that reads a path one of them changed is
876
+ `disagreed`, and after a route's rewrite, the path is unknown. The query
877
+ fields read the visitor's query, before or after a route's rewrite, which
878
+ sets only the path. So a rule that reads a query one of them set can be
879
+ `disagreed`, or name the wrong branch.
880
+
620
881
  ## Development
621
882
 
622
883
  ```powershell
@@ -647,3 +908,32 @@ The tool reports with `explainExpressionMatch`. In its results, `actual` and
647
908
  `expected` hold only observed values, so `null` is a Cloudflare missing value
648
909
  and `[]` an empty collection. An operand the evaluator cannot resolve is
649
910
  omitted and named in `unavailable`.
911
+
912
+ For an edge record, the tool reports the certainty and the branch or the
913
+ candidates, each with its chain's SHA-1, and for `disagreed`, the conditions
914
+ that rule out a match. Give the zone's state with `--logged-headers`,
915
+ `--transformed-headers`, `--logged-cookies` and `--url-normalization`. When the record's
916
+ `MatchedRules` lists a route's rewrite, give the route's prefix with
917
+ `--route-prefix`:
918
+
919
+ ```powershell
920
+ npm run explain:rule -- --sample <edge-record-json-path> --expr 'starts_with(http.request.uri.path, "/p/")' --route-prefix /p --url-normalization rfc3986
921
+ ```
922
+
923
+ To count results by certainty over a sample of records, one JSON record per
924
+ line, give the rule versions, route applications, links and logged fields as
925
+ an `EdgeRuleTimeline`:
926
+
927
+ ```powershell
928
+ npm run explain:rule -- --samples <ndjson-path> --timeline <json-path> --url-normalization rfc3986
929
+ ```
930
+
931
+ It also counts the records whose path a URL normalization would change, lists
932
+ the linked rules that match only through a route rewrite the record's
933
+ `MatchedRules` does not show, and counts the records' warnings by reason,
934
+ such as a timeline entry missing at a record's time. A line it cannot read is
935
+ listed with its error, and the rest are still counted. A record that reads
936
+ but fails to evaluate ends the run, naming its line. An empty
937
+ `--logged-headers`, `--transformed-headers` or `--logged-cookies` is an empty
938
+ list. An option that does not apply to the input, such as `--logged-headers`
939
+ with `--samples` or `--route-prefix` with a managed request log, is an error.
@@ -1 +1 @@
1
- {"version":3,"file":"log-handler.d.ts","sourceRoot":"","sources":["../src/log-handler.ts"],"names":[],"mappings":"AAMA,OAAO,EAKN,KAAK,4BAA4B,EAEjC,KAAK,yBAAyB,EAC9B,MAAM,qBAAqB,CAAC;AAE7B,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAEtC,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,YAAY,CAAC,QAAQ,CAAC,CAAC;AAE/E,MAAM,WAAW,gBAAgB;IAChC,KAAK,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACvE;AAED,MAAM,WAAW,iCAAiC;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,KAAK,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACtG,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,YAAY,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IAC7E,aAA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,OAAO,KAAK,YAAY,CAAC,MAAM,CAAC,CAAC;IACzD,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,gGAAgG;IAChG,iBAAiB,CAAC,EAAE,MAAM,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,4BAA4B,CAAC;IAC3C,sBAAsB,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,GAAG,MAAM,CAAC;CACpD;AAED,MAAM,WAAW,+BAAgC,SAAQ,iCAAiC;IACzF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sBAAsB,CAAC,EAAE,yBAAyB,CAAC;CACnD;AAwDD,wBAAsB,uBAAuB,CAAC,GAAG,SAAS,MAAM,EAC/D,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,gBAAgB,EACrB,OAAO,GAAE,+BAAoC,GAC3C,OAAO,CAAC,QAAQ,CAAC,CAwDnB;AAED;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,+BAAoC,GAAG,IAAI,CA2B/G;AA4BD,wBAAsB,aAAa,CAClC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,0BAA0B,EAClC,GAAG,CAAC,EAAE,gBAAgB,GACpB,OAAO,CAAC,QAAQ,CAAC,CAkGnB"}
@@ -2,7 +2,7 @@ import { parseCookie } from 'cookie';
2
2
  import * as setCookieParser from 'set-cookie-parser';
3
3
  import { waitUntil } from 'cloudflare:workers';
4
4
  import { Address6 } from 'ip-address';
5
- import { evaluateExpression } from './rule-evaluator.js';
5
+ import { evaluateExpression, matchChainSha1, matchChainText } from './rule-evaluator.js';
6
6
  import { prepareIpList } from './rule-evaluator/custom-lists.js';
7
7
  import { findLibreflareRuntimeRoute, libreflareLoggingHeadersReader, readCachedLibreflareRuntimeConfig, stripWorkerRoutePrefix as defaultStripWorkerRoutePrefix, } from './runtime-config.js';
8
8
  const sleep = (ms) => {
@@ -226,12 +226,11 @@ export async function handleRequest(request, config, ctx) {
226
226
  path: ruleEvaluationPath,
227
227
  customLists: config.customLists,
228
228
  });
229
- const matchChain = rule.matchChainCompat.join(' -> ');
230
- const hashBuffer = await crypto.subtle.digest('SHA-1', new TextEncoder().encode(matchChain));
229
+ const matchChain = matchChainText(rule.matchChainCompat);
231
230
  logEventBody.evaluation = {
232
231
  match: String(rule.matched),
233
232
  chain: matchChain,
234
- chainSHA1: new Uint8Array(hashBuffer).toHex(),
233
+ chainSHA1: await matchChainSha1(matchChain),
235
234
  largeBlocks: rule.largeBlocks,
236
235
  inferred: String(rule.inferredViaList),
237
236
  warnings: rule.warnings,
@@ -1 +1 @@
1
- {"version":3,"file":"log-handler.js","sourceRoot":"","sources":["../src/log-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAC;AACnD,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EACN,0BAA0B,EAC1B,8BAA8B,EAC9B,iCAAiC,EACjC,sBAAsB,IAAI,6BAA6B,GAIvD,MAAM,qBAAqB,CAAC;AAuC7B,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE;IAC5B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC9B,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,MAAc,EA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,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACpC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAC1B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;QACrC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,GAAG;YAAE,OAAO,IAAI,CAAC;IACvE,CAAC;IACD,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC;AACpD,CAAC;AAED,SAAS,oBAAoB,CAAC,SAAiB;IAC9C,OAAO,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,GAAG,CAAC;QACjD,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,yCAAyC,CAAC;AAC9C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"accept-encoding.d.ts","sourceRoot":"","sources":["../../src/rule-evaluator/accept-encoding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,cAAc,EAAkB,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC7F,OAAO,EAAiE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC9G,OAAO,EAAa,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAgGvD,wBAAgB,iCAAiC,CAChD,IAAI,EAAE,cAAc,GAAG,QAAQ,EAC/B,GAAG,EAAE,WAAW,EAChB,aAAa,EAAE,OAAO,EACtB,eAAe,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,GAChD,IAAI,CAoBN"}
1
+ {"version":3,"file":"accept-encoding.d.ts","sourceRoot":"","sources":["../../src/rule-evaluator/accept-encoding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,cAAc,EAAkB,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC7F,OAAO,EAAiE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC9G,OAAO,EAAa,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAgGvD,wBAAgB,iCAAiC,CAChD,IAAI,EAAE,cAAc,GAAG,QAAQ,EAC/B,GAAG,EAAE,WAAW,EAChB,aAAa,EAAE,OAAO,EACtB,eAAe,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,GAChD,IAAI,CAsBN"}
@@ -94,6 +94,9 @@ function acceptEncodingValue(ctx) {
94
94
  return values === null || isUnknownHeaderValues(values) ? null : values[0] ?? null;
95
95
  }
96
96
  export function warnIfAcceptEncodingZstdSensitive(node, ctx, currentResult, evaluateWithCtx) {
97
+ // Edge records hold Accept-Encoding as the client sent it, which the rules engine read.
98
+ if (ctx.edge)
99
+ return;
97
100
  const responseContentEncoding = ctx.response?.headers.get('content-encoding') ?? '';
98
101
  if (parseAcceptEncodingTokens(responseContentEncoding).some(token => token === 'zstd')) {
99
102
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"accept-encoding.js","sourceRoot":"","sources":["../../src/rule-evaluator/accept-encoding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAsD,MAAM,UAAU,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,iBAAiB,EAAoB,MAAM,aAAa,CAAC;AAC9G,OAAO,EAAE,SAAS,EAAgB,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAErF;;;;;;;GAOG;AACH,SAAS,yBAAyB,CAAC,IAAe;IACjD,IAAI,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACnE,IA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B,aAAsB,EACtB,eAAkD;IAElD,wFAAwF;IACxF,IAAI,GAAG,CAAC,IAAI;QAAE,OAAO;IACrB,MAAM,uBAAuB,GAAG,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;IACpF,IAAI,yBAAyB,CAAC,uBAAuB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,MAAM,CAAC,EAAE,CAAC;QACxF,OAAO;IACR,CAAC;IAED,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC;QAAE,OAAO;IACtC,MAAM,cAAc,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;IAChD,IAAI,cAAc,KAAK,IAAI;QAAE,OAAO;IAEpC,MAAM,UAAU,GAAG,0BAA0B,CAAC,GAAG,EAAE,0BAA0B,CAAC,cAAc,CAAC,CAAC,CAAC;IAC/F,MAAM,aAAa,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;IAClD,IAAI,aAAa,KAAK,aAAa;QAAE,OAAO;IAC5C,MAAM,OAAO,GAAG,SAAS,CAAC,aAAa,CAAC,CAAC;IACzC,GAAG,CAAC,QAAQ,CAAC,GAAG,CACf,qHAAqH,IAAI,CAAC,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,8CAA8C,CAC3M,CAAC;IACF,gEAAgE;IAChE,IAAI,CAAC,OAAO;QAAE,OAAO;IACrB,KAAK,MAAM,OAAO,IAAI,UAAU,CAAC,QAAQ;QAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACtE,CAAC"}
@@ -8,7 +8,9 @@ import { type Evaluated, type Known, type Unknown } from './outcome.js';
8
8
  export type UnknownElement = () => Unknown;
9
9
  /** An element of an array while evaluating, or a map key's values. */
10
10
  export type ElementValue = Known<CfValue> | UnknownElement;
11
- export declare function isUnknownElement(element: ElementValue): element is UnknownElement;
11
+ /** A map key's values, which can be known in part, as a header sent once with unknown text. */
12
+ export type MapEntryValue = Known<CfValue | PartialArrayValue> | UnknownElement;
13
+ export declare function isUnknownElement(element: MapEntryValue): element is UnknownElement;
12
14
  /**
13
15
  * An array some of whose elements are unknown while evaluating, such as the
14
16
  * request header values when Worker context lacks one. Its known elements can
@@ -69,13 +71,13 @@ export declare class RuleMapValue {
69
71
  private readonly more?;
70
72
  constructor(
71
73
  /** A key's values, nil for a key the map does not have, or unknown. */
72
- lookup: (key: string) => ElementValue,
74
+ lookup: (key: string) => MapEntryValue,
73
75
  /** The keys the map has, from mapKeys(). */
74
76
  keys: () => ReadonlySet<string>,
75
77
  /** Why the map may have keys `keys()` does not list, when it may. */
76
78
  more?: UnknownElement | undefined);
77
79
  /** The values for a key, or nil when the map has no such key. */
78
- get(key: string): Evaluated<CfValue>;
80
+ get(key: string): Evaluated<CfValue | PartialArrayValue>;
79
81
  /**
80
82
  * Whether the map has a key, which is known for a listed key even when its
81
83
  * values are not. Values are nil only for a key the map does not have, so
@@ -1 +1 @@
1
- {"version":3,"file":"access-values.d.ts","sourceRoot":"","sources":["../../src/rule-evaluator/access-values.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAoB,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAE1F;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC;AAE3C,sEAAsE;AACtE,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC;AAE3D,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,IAAI,cAAc,CAEjF;AAMD;;;;;;;;GAQG;AACH,qBAAa,iBAAiB;IAE5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE;IAC1C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,SAAS,CAAC,OAAO,GAAG,iBAAiB,CAAC;IAKxD;;;;OAIG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC;IAMpC,gDAAgD;IAChD,MAAM,IAAI,OAAO,EAAE,GAAG,iBAAiB;CASvC;AAED,uFAAuF;AACvF,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,iBAAiB,GAAG,YAAY,CAAC;AAEtE;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,CAAC,YAAY,CAAC,CAmBtH;AAcD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,UAAU,EAAE,GAAG,OAAO,CAE/F"}
@@ -110,7 +110,8 @@ export class RuleMapValue {
110
110
  }
111
111
  /** The values for a key, or nil when the map has no such key. */
112
112
  get(key) {
113
- return evaluatedElement(this.lookup(key));
113
+ const value = this.lookup(key);
114
+ return isUnknownElement(value) ? value() : value;
114
115
  }
115
116
  /**
116
117
  * Whether the map has a key, which is known for a listed key even when its
@@ -127,7 +128,10 @@ export class RuleMapValue {
127
128
  values() {
128
129
  const elements = [...this.keys()].map((key) => {
129
130
  const value = this.lookup(key);
130
- return isUnknownElement(value) ? value : known(value.value ?? []);
131
+ if (isUnknownElement(value))
132
+ return value;
133
+ // As one element, values known in part are unknown, and may stand for any number of values.
134
+ return value.value instanceof PartialArrayValue ? value.value.knownValues().unknown : known(value.value ?? []);
131
135
  });
132
136
  return PartialArrayValue.from(elements, this.more);
133
137
  }
@@ -150,7 +154,9 @@ export function applyRuntimeAccessPath(value, accessPath) {
150
154
  if (first.kind === 'ArrayWildcardAccess')
151
155
  return known(applyExpandedAccess(value.values(), rest));
152
156
  const selected = value.get(first.key);
153
- return isUnknown(selected) ? selected : known(applyValueAccessPath(selected.value, rest));
157
+ if (isUnknown(selected))
158
+ return selected;
159
+ return selected.value instanceof PartialArrayValue ? applyRuntimeAccessPath(selected.value, rest) : known(applyValueAccessPath(selected.value, rest));
154
160
  }
155
161
  if (value instanceof PartialArrayValue) {
156
162
  if (first.kind === 'MapKeyAccess')