8000 fix(common,op): the download_web spans of RemoteStorage record the source URL with no credentials by minimal-foundry[bot] · Pull Request #3713 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(common,op): the download_web spans of RemoteStorage record the source URL with no credentials - #3713

Merged
norrietaylor merged 2 commits into
mainfrom
agent/2817-the-download-web-spans-of-remotestorage-record-t
Nov 23, 2026
Merged

norrietaylor merged 2 commits into
mainfrom
agent/2817-the-download-web-spans-of-remotestorage-record-t

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

Follow-up

Fixes #2817

Task marker
### D2817 — The download_web spans of RemoteStorage record the source URL with no credentials, no query and no fragment
  kind: task
  size: S
  est: 25 code, 70 tests
  executor: agent
  origin: residual
  epic: 1437
  layers:
    - spans:
      - crates/common/src/remote_storage.rs: Add skip(url) to the instrument attributes of download_web_with_verification_and_caching and download_web_placed, and record fields(url) from the stripped URL. Add a pub stripped_url function and a test that reads the span fields.
      - crates/common/src/lib.rs: Export stripped_url from remote_storage.
      - crates/op/src/specs.rs: stripped_url calls common::stripped_url, so one function strips a URL. strip_urls and its callers in sources.rs stay as they are.
      test: cargo test -p common download_web_spans_record_a_stripped_url
  proof: A subscriber that records span fields shows https://host/path for a source URL that carries user:password@ and a signed query, and the password and the token are not in the span.

Proof

A subscriber that records span fields now shows https://127.0.0.1:/pkg.tar.gz as the url field of both the download_web_with_verification_and_caching span and the download_web_placed span, for a source URL with user:hunter2@, a signed X-Goog-Signature query and a fragment. The password, the token, the query key and the fragment are in no span field.

Notes from the agent: The test uses a small recording tracing::Subscriber written in the test module, because common has no tracing-subscriber dev-dependency and Cargo.toml is not in the layers. T 8000 he span url field is an Option. It is empty when the text is not a URL. RemoteStorage's other #[tracing::instrument] spans (for example download_with_verification_and_caching) are not changed, because they take a bucket and an object, not a URL. op::specs::stripped_url now calls common::stripped_url. I did not run op's existing stripped_url test, but cargo clippy -p common -p op --all-targets is clean.

Tests

line exit tail
cargo test -p common download_web_spans_record_a_stripped_url 0 running 1 test test remote_storage::span_tests::download_web_spans_record_a_stripped_url ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 91 filtered out; finished in 0.12s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in

Verify

min task run agent-verify exited 100, so this PR is a draft.

me and age are named
    ok
    ok   - report.json carries every key and every gate row has value, baseline, threshold and result
    ok   - changed crates carry new hits and deltas against the baseline
    ok   - only the strict hit on a changed line is new; the untouched one on line 22 is not
    ok   - the hit is listed as path:line [code]
    ok   - promotable lints are carried
    ok   - collectors that did not run are listed
    == step_summary_is_appended ==
    ok   - existing content is kept
    ok   - the Markdown report is appended
    ok   - appended bytes are report.md
    ok   - an unwritable summary path does not stop the report
    ok   - the summary variable does not change the report
    == gate_runs_without_rustc ==
    ok   - the gate exits 0 with rustc and cargo-clippy unusable
    ok   - neither rustc nor cargo-clippy was invoked
    ok   - stdout ends with the verdict, the report path and its sha256
    ok   - the sha256 is report.json's
    ok   - the snapshot records gate mode
    ok   - the compiling collectors and cargo-shear are recorded as not measured
    == darwin_scope_lists_uncovered_crates_in_report ==
    ok   - the changed crate the pinned scope left out is listed
    ok   - the report names the pinned scope
    ok   - the report lists decode under Scope
    ok   - an uncovered crate's strict hits read as not measured, not zero
    ok   - no promotable list from a partial scope
    ok   - a scoped ratchet re-sums the baseline over the same crates
    == gate_fits_probe_budget ==
    ok   - the gate over the real tree took 1s, inside the 300 s probe budget
    ok   - the gate wrote its report (exit 0)
    ok   - the evidence line is last on stdout
    == clippy_strict_unchanged ==
    ok   - a strict hit on a changed line exits 2
    ok   - the hit is printed as path:line: message [code]
    ok   - the guidance follows on stderr
    ok   - the scope is derived from the changed crate
    ok   - a hit on an unchanged line is clean, exit 0
    ok   - no changes since BASE exits 0 before cargo runs
    ok   - a pinned scope says which changed crate it leaves out

    metrics_test: 204 passed, 2 failed
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
        import json,sys; s=json.load(open(sys.argv[1])); print(eval(sys.argv[2]))
                                     ~~~~^^^^^^^^^^^^^
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp.EClVVM0qPg/mut/.scratch/nonextest/snapshot.json'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
        import json,sys; s=json.load(open(sys.argv[1])); print(eval(sys.argv[2]))
                                     ~~~~^^^^^^^^^^^^^
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp.EClVVM0qPg/mut/.scratch/nonextest/snapshot.json'

    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
error: test run failed

The download_web_with_verification_and_caching and download_web_placed
spans recorded the raw URL, with its credentials, signed query and
fragment. They now skip the argument and record the URL from one shared
stripped_url, which op::specs now calls.
@coderabbitai
coderabbitai Bot commented Nov 20, 2026 •
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 810acb82-5e8f-49a2-b9fb-7d52a1f63f2d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@norrietaylor
Copy link
Copy Markdown
Member

/arch-review

@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: PASS · the full ruling

The change conforms to the design. Design principle 7 and the Output conventions say that secrets never appear in any output. Both download_web_* spans now record the URL without its credentials, query and fragment. No other span on this path records the raw URL. The helper now lives in common, and op delegates to it, so one function strips a URL.

Ruled at b2aa4cb against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.

@norrietaylor
norrietaylor marked this pull request as ready for review November 23, 2026 18:23
@norrietaylor
Copy link
Copy Markdown
Member

Marked ready: arch passed b2aa4cb and CI is green. The verify failure was metrics_test (a missing .scratch/nonextest/snapshot.json in the coder box), a script harness this PR does not touch.

@norrietaylor
norrietaylor requested a review from a team as a code owner November 23, 2026 18:23
@minimal-foundry
minimal-foundry Bot commented Nov 23, 2026 •
Copy link
Copy Markdown
Contributor Author

Approved: no findings at bf1fb171e4ae.

Nothing to do.

Clobber: none.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approved

Verdict APPROVE — No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 23, 2026
@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gate passes at b2aa4cb: minimal-review approved, arch-review PASS, every lane aggregator green, no open threads.

@norrietaylor
norrietaylor added this pull request to the merge queue Nov 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 23, 2026
@norrietaylor
Copy link
Copy Markdown
Member

/revise
This PR conflicts with main after #3256 (build boxes) merged, in: crates/common/src/lib.rs crates/common/src/remote_storage.rs

Merge main. #3256 changed the source-fetch code in these files (declared-source probing, stripped_url-style helpers and the fetch argv). Keep #3256's behaviour, and keep this PR's rule that no span records a raw source URL. If #3256 already added a URL-stripping helper, use one helper, not two. Run the PR's test lines again and record them.

main (#3256) removed download_web_placed and Placement. The span test now checks the one download_web span that is left. common::stripped_url stays the only URL-stripping helper.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on a /revise note, pushed as bf1fb171e4ae.

Resolved conflicts in: crates/common/src/lib.rs, crates/common/src/remote_storage.rs

line exit tail
cargo test -p common download_web_spans_record_a_stripped_url 0 running 1 test test remote_storage::span_tests::download_web_spans_record_a_stripped_url ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 88 filtered out; finished in 0.09s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in

Verify min task run agent-verify exited 100.

me and age are named
    ok
    ok   - report.json carries every key and every gate row has value, baseline, threshold and result
    ok   - changed crates carry new hits and deltas against the baseline
    ok   - only the strict hit on a changed line is new; the untouched one on line 22 is not
    ok   - the hit is listed as path:line [code]
    ok   - promotable lints are carried
    ok   - collectors that did not run are listed
    == step_summary_is_appended ==
    ok   - existing content is kept
    ok   - the Markdown report is appended
    ok   - appended bytes are report.md
    ok   - an unwritable summary path does not stop the report
    ok   - the summary variable does not change the report
    == gate_runs_without_rustc ==
    ok   - the gate exits 0 with rustc and cargo-clippy unusable
    ok   - neither rustc nor cargo-clippy was invoked
    ok   - stdout ends with the verdict, the report path and its sha256
    ok   - the sha256 is report.json's
    ok   - the snapshot records gate mode
    ok   - the compiling collectors and cargo-shear are recorded as not measured
    == darwin_scope_lists_uncovered_crates_in_report ==
    ok   - the changed crate the pinned scope left out is listed
    ok   - the report names the pinned scope
    ok   - the report lists decode under Scope
    ok   - an uncovered crate's strict hits read as not measured, not zero
    ok   - no promotable list from a partial scope
    ok   - a scoped ratchet re-sums the baseline over the same crates
    == gate_fits_probe_budget ==
    ok   - the gate over the real tree took 0s, inside the 300 s probe budget
    ok   - the gate wrote its report (exit 0)
    ok   - the evidence line is last on stdout
    == clippy_strict_unchanged ==
    ok   - a strict hit on a changed line exits 2
    ok   - the hit is printed as path:line: message [code]
    ok   - the guidance follows on stderr
    ok   - the scope is derived from the changed crate
    ok   - a hit on an unchanged line is clean, exit 0
    ok   - no changes since BASE exits 0 before cargo runs
    ok   - a pinned scope says which changed crate it leaves out

    metrics_test: 204 passed, 2 failed
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
        import json,sys; s=json.load(open(sys.argv[1])); print(eval(sys.argv[2]))
                                     ~~~~^^^^^^^^^^^^^
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp.SNjJtwqIls/mut/.scratch/nonextest/snapshot.json'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
        import json,sys; s=json.load(open(sys.argv[1])); print(eval(sys.argv[2]))
                                     ~~~~^^^^^^^^^^^^^
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp.SNjJtwqIls/mut/.scratch/nonextest/snapshot.json'

    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
error: test run failed

Converted to a draft: verify exited 100.

A subscriber that records span fields shows https://127.0.0.1:/pkg.tar.gz in the download_web_with_verification_and_caching span for a source URL with user:hunter2@, a signed X-Goog-Signature query and a fragment. The password, the token, the query key and the fragment are not in any span field.

Notes from the agent: This round merged main and resolved the conflicts in crates/common/src/lib.rs and crates/common/src/remote_storage.rs. Main (#3256) removed download_web_placed and Placement, so only download_web_with_verification_and_caching carries the skip(url) and fields(url = stripped_url(url)) span now. The test no longer calls download_web_placed. Main's adopt, fetch_to_file, source_hosts and GCS_HOST exports stay as main has them. Main added no URL-stripping helper, so common::stripped_url is the only one, and op's stripped_url calls it. fetch_to_file, fetch_once and source_hosts in main have no tracing::instrument, so they record no URL in a span. cargo clippy -p common -p op --all-targets and cargo fmt --check are clean. The other staged changes in the merge commit come from main unchanged, and that includes the .github/workflows files.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 23, 2026 19:19
@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: PASS · the full ruling

The merge of main keeps the change conformant. Main (#3256) removed download_web_placed, so the merge correctly drops that span edit and its test leg. The remaining URL span records only the stripped URL, as architecture.md line 193 and line 386 require. The PR body still names the removed span in its Proof section. Update that text.

Ruled at bf1fb17 against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.

@norrietaylor
norrietaylor marked this pull request as ready for review November 23, 2026 20:54
@norrietaylor
Copy link
Copy Markdown
Member

/review

@norrietaylor
norrietaylor added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 1007525 Nov 23, 2026
38 of 39 checks passed
@norrietaylor
norrietaylor deleted the agent/2817-the-download-web-spans-of-remotestorage-record-t branch November 23, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracing spans record source URLs with credentials (remote_storage download_web*)

1 participant

0