Skip to content

refactor: retire the unlogged HTTP retrieval path in the target observer - #172

Merged
Nagi-Inaba merged 2 commits into
mainfrom
refactor/retire-legacy-http-observer
Oct 12, 2026
Merged

Nagi-Inaba merged 2 commits into
mainfrom
refactor/retire-legacy-http-observer

Conversation

@Nagi-Inaba

Copy link
Copy Markdown
Owner

Problem

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 the hash of whatever bytes arrived while its identity recorded request_profile: credential_free_get_identity_encoding_v1.

Change

  • Remove the older path. 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.
  • No CLI command used the older path: run-targets.mjs sets 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.
  • The three HTTP tests in tests/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.
  • Add a CHANGELOG entry.

Verification

  • node scripts/verify-all.mjs on Windows / Node.js 22.19.0: PASS, 91 test files
  • Codex / Claude parity remains valid
  • Canonical files were edited and node scripts/sync-distributions.mjs --write was followed by --check
  • Relevant focused regression tests updated: gzip rejection, size limit and request-log assertions in tests/target-observer.test.mjs
  • Remote CI is reported separately

Compatibility

  • Schema/profile/procedure version impact: none
  • Migration required: no for CLI users. A direct library caller that observes an HTTP target must pass the run network policy and run ID. The per-call maxBytes and timeoutMs options no longer apply to HTTP; the run policy and the network session fix those limits.
  • CHANGELOG updated. docs/version-support.md: not applicable.

Security and privacy

  • No credentials, private URLs, local paths, or real audit evidence are included. The only credential-looking string is the dummy user:secret@ in a test that checks credentials are rejected.
  • Boundaries are stricter, never looser: every HTTP retrieval now goes through content-encoding rejection, the byte cap, the request budget and the request log.
  • Release preparation, publication and remote CI results are reported separately

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

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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T05:33:50.784179Z 80ad27e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

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>
@Nagi-Inaba
Nagi-Inaba merged commit b26a00e into main Oct 12, 2026
6 checks passed
@github-actions
github-actions Bot deleted the refactor/retire-legacy-http-observer branch October 12, 2026 13:06
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