Skip to content

fix(resources): a transport reply's result takes its owner's declared paths off box (rf2-9yvig) - #11831

Merged
mike-thompson-day8 merged 1 commit into
mainfrom
worker/transport-path-decl-fix
Oct 30, 2026
Merged

mike-thompson-day8 merged 1 commit into
mainfrom
worker/transport-path-decl-fix

Conversation

@mike-thompson-day8

@mike-thompson-day8 mike-thompson-day8 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Bead: rf2-9yvig

What

Managed HTTP settles an attempt by dispatching [<internal-reply-id> <verification-payload> <result>]. Since #11826 the resources carrier projector tokenizes that result's :value when the owner makes the coarse :sensitive? / :large? claim. An owner that declares only paths (:sensitive [[:token]]) classifies :serialize, though, so under :rf.egress/include-event-args? its declared paths rode raw on the transport event's :rf.event/v and on the epoch record's :trigger-event. The continuation reply carrying the same value to its :reply-to target already redacted them.

Fix

The transport result now gets the second arm that every other reply copy already has, at the same site (project-transport-result in trace_egress.cljc):

  • The owner the verification payload names is resolved once (transport-owner): the resource named by its work id, or a mutation attempt's :mutation-id. The same owner is used for both arms.
  • If that owner makes the coarse claim, :value is tokenized, and an unregistered owner fails closed. That part is unchanged.
  • Otherwise the owner's declared paths are substituted through redact-reply-declarations. That function now takes the owner spec, and the continuation reply's lookup moves into reply-owner-spec.
  • :error is still tokenized unconditionally.

There is no new policy and no new declaration source. One reading choice: an infinite feed's declaration is read as written, not through feed-reply-spec. The transport result is the single decoded page the declaration was written against (Spec 016 §infinite-feed :value). feed-reply-spec exists only because the :reply-to value is the merged item list.

On box, nothing changes. The transport arm runs only through project-fx-args-egress, so the on-box trace and the app's :reply-to handler still receive the raw value. The new test pins both.

No core change: :trigger-event already goes through the same carrier projector (project-captured-carrier).

Probe and control

New test a-transport-replys-result-takes-its-owners-declared-paths in resources_key_identity_event_egress_cljs_test.cljc. It covers the read twin (:r/paths) and the mutation twin (:m/paths), both :sensitive [[:token]] with no coarse claim, each settled with {:status :ok :value {:token <sentinel> :ok 1}}.

  • Must redact: [2 :value :token] reads :rf/redacted on :trigger-event and on every :rf.event/v copy, and no off-box copy carries the sentinel.
  • Controls: the undeclared sibling :ok rides. The :reply-to target's :value reads {:token :rf/redacted :ok 1} on both carriers. The on-box trace and the app's handler both keep the raw value.

Reproduction on the trunk code, with only the test added: 6 failures. The token assertion failed on both carriers for both twins, and the leak assertion failed for both twins. Every control was green.

Quality gates

Exit codes are captured from each runner itself, never through a pipe.

  • Baseline (trunk c0b027bb5c, before any edit): resources clojure -M:test exit 0, 600 tests / 1896 assertions. The trunk CI CLJS (shadow-cljs :node-test) job at the same commit: 6819 tests / 19985 assertions.
  • Predicted delta: +1 test and +28 assertions on both hosts (14 assertions per twin).
  • Resources clojure -M:test: exit 0, 601 tests / 1924 assertions (+1 / +28, as predicted).
  • npm run test:cljs: exit 0, 6820 tests / 20013 assertions (+1 / +28, as predicted). It ran through the machine-wide shadow lane.
  • Probe namespace, trunk code with only the test added: exit 1, 6 failures (the reproduction).
  • Plant (the path arm (redact-reply-declarations result spec) replaced by result; anchor count 1): exit 1, exactly the 6 predicted failures. The :token assertion failed on :trigger-event and on :rf.event/v for both twins, and the leak assertion failed for both twins. The sibling :ok, the :reply-to copies, the on-box trace and the app handler stayed green.
  • Restore: the blob hash (default form) equals HEAD's blob for trace_egress.cljc, and git diff --quiet exits 0.
  • Ratchets: clj-kondo exit 0 on the three files (0 errors, 0 warnings). The always-on scripts/check_*.py gates that grade implementation source (retired spellings, ambient durable reads, thrown error messages, keyword catalogue, egress walker residue, inject-cofx residue, test lane bijection, JVM lanes, require-alias dialect, runtime subsystem grading) each exited 0.
  • Final-base gate: this PR's CI. The local runs above were taken before a rebase onto two trunk commits, a beads checkpoint and a tools/story fix, neither touching these paths.
  • Core: untouched, so scripts/test-jvm-implementation.sh was not run.

… paths off box (rf2-9yvig)

Managed HTTP settles an attempt by dispatching
[<internal-reply-id> <verification-payload> <result>]. The carrier projector
gave that result a coarse owner's claim, but an owner declaring only paths
classifies :serialize, so under :rf.egress/include-event-args? its declared
paths rode raw on the event's :rf.event/v and the record's :trigger-event,
while the continuation reply carrying the same value to its :reply-to target
redacted them.

The transport result now takes the continuation reply's second arm too: the
owner the payload names (its work id's resource, or a mutation attempt's
:mutation-id) resolves once, its coarse claim tokenizes :value, and otherwise
redact-reply-declarations substitutes its declared paths. A feed's
declaration reads as written there, because the result is the single page it
was written against. The read and mutation twins are both covered; the
on-box trace and the app's :reply-to handler keep the raw value.
@mike-thompson-day8
mike-thompson-day8 force-pushed the worker/transport-path-decl-fix branch from 7b77e6f to 8105f7b Compare October 30, 2026 02:29
@mike-thompson-day8
mike-thompson-day8 marked this pull request as ready for review October 30, 2026 02:51
@mike-thompson-day8
mike-thompson-day8 merged commit f31d272 into main Oct 30, 2026
76 checks passed
@mike-thompson-day8
mike-thompson-day8 deleted the worker/transport-path-decl-fix branch October 30, 2026 02:53
mike-thompson-day8 added a commit that referenced this pull request Oct 30, 2026
Merge: f31d272 at 2026-10-30T02:53:09Z.
Completeness: The requested path-only transport-result fix is complete for resource and mutation owners and preserves continuation replies. One adjacent actionable cursor-carrier gap was reproduced and filed separately.
Correctness: The shared declared-path projection and coarse-owner controls are correct, with meaningful reported twin-carrier tests, six-failure fault plants and passing CI. A focused JVM probe on the exact merge additionally proves coarse-sensitive infinite-feed page cursors remain raw in runtime verification payloads on opted-in event and effect carriers; filed as a new open Bead.
Implementation quality: Good localized reuse of the existing declaration projector and one owner lookup; the feed raw-page versus merged-item distinction is sound. The newly filed cursor correction can remain in the same existing carrier seam without new policy or API.
Findings: rf2-jbitg.
Source forward pointers: rf2-9yvig.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant