Repository navigation
refactor: retire the unlogged HTTP retrieval path in the target observer - #172
Merged
Merged
Conversation
target-observer.mjs carried two HTTP clients. The run-policy path goes through the network session: it rejects any content encoding, caps the bytes of the whole session, enforces the per-run request budget and keeps a request log. The older path, taken when no run policy was supplied, had none of those guards. It also returned a hash of whatever bytes arrived while its identity recorded request_profile credential_free_get_identity_encoding_v1. Every CLI route already passes the saved run policy and run ID (run-targets.mjs sets both before observing an HTTP target), so the older path was reachable only by direct library callers and the tests. It is removed; observeTarget now rejects an HTTP target that lacks the saved run network policy or run ID before any request is made. File, Git and saved web-state targets are unchanged. target-observer.mjs shrinks from 327 to 241 lines. The three HTTP tests of target-observer.test.mjs now run through the session path with a real run policy. They keep the identity, drift and fail-closed assertions and add the rejection of a gzip response and the request-log evidence, which the older path could not provide. The retired per-call maxBytes and timeoutMs options no longer apply to HTTP; the run policy and the session fix those limits. Verified: verify-all passes on Node.js 22.19.0 (Windows), 91 test files. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Keep both CHANGELOG entries. The Node.js 22 baseline (pull request 171) and this change each add one bullet at the same place in the Unreleased section; no other file conflicts. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
target-observer.mjscarried two HTTP clients. The run-policy path goes through the network session: it rejects any content encoding, caps the bytes of the whole session, enforces the per-run request budget and keeps a request log. The older path, taken when no run policy was supplied, had none of those guards. It also returned the hash of whatever bytes arrived while its identity recordedrequest_profile: credential_free_get_identity_encoding_v1.Change
observeTargetnow rejects an HTTP target that lacks the saved run network policy or run ID before any request is made. File, Git and saved web-state targets are unchanged.target-observer.mjsshrinks from 327 to 241 lines.run-targets.mjssets both the saved run policy and the run ID before observing an HTTP target. It was reachable only by direct library callers and the tests.tests/target-observer.test.mjsnow run through the session path with a real run policy. They keep the identity, drift and fail-closed assertions and add the rejection of a gzip response and the request-log evidence, which the older path could not provide.Verification
node scripts/verify-all.mjson Windows / Node.js 22.19.0: PASS, 91 test filesnode scripts/sync-distributions.mjs --writewas followed by--checktests/target-observer.test.mjsCompatibility
maxBytesandtimeoutMsoptions no longer apply to HTTP; the run policy and the network session fix those limits.Security and privacy
user:secret@in a test that checks credentials are rejected.Merge note
Sibling PRs from the same batch also add one bullet at the same place in
CHANGELOG.md. After one of them merges, the others need a trivial conflict resolution that keeps both bullets.Issue
Part of the follow-ups listed after PR #169. Closes no issue.
🤖 Generated with Claude Code