Skip to content

feat: automatic CLI request reports via telemetry controls - #276

Merged
toddysm merged 12 commits into
mainfrom
feature/transfer-endpoint-report/cli-e0d42f4d
Dec 5, 2026
Merged

toddysm merged 12 commits into
mainfrom
feature/transfer-endpoint-report/cli-e0d42f4d

Conversation

@toddysm

@toddysm toddysm commented Dec 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Enable default stderr request reports for artifact/config/layer/blob/manifest pulls and manifest/layout/Docker/blob pushes, using library-owned collection and existing telemetry controls.
  • Stream escaped text or one consolidated request_report JSON event; mirror root diagnostic logs without changing result stdout, raw payloads, result schemas, or opt-in timing/debug/metrics behavior.
  • Preserve deferred warnings, settled progress/telemetry, primary error/cancellation identity and owned-resource cleanup; fail explicitly on sole collection/export failures without rollback claims.
  • Add 81 focused physical-dispatch, ordering, suppression, log and failure-boundary cases; adapt existing transport fixtures and channel assertions and include coverage in the minimum-Click workflow.
  • Defer library-owned report storage until operation preflight completes; preserve portable validation errors and explicitly explain native storage requirements.
  • Reject manifest/blob log aliases of download outputs and upload sources before either file opens; reuse one shared preflight guard.
  • Protect layout metadata/content and archive sources before telemetry, including dry runs. Directory-source logs must be outside the source with a unique link; ambiguous hard-linked logs fail closed without scanning the graph.
  • Serialize lazy acquisition per configuration and share failed-destination state across nested warning/report coordinators, including distinct descriptors for the same pipe.
  • Detect late collection failures, preserve healthy diagnostics on spool reads, and expose suppressed telemetry cleanup failures without replacing primary errors.
  • Update telemetry documentation.

Closes #261.
Related tracking issue: #254. Integrated readiness/security/performance validation (#262) and final feature documentation (#263) remain separate delivery items. Owner authorized merge after final-head green hosted checks and settled reviews; branch/worktree cleanup is not requested.

Final-head local validation (macOS, Python 3.12.16; source at a14c9c6)

  • Report/manifest/blob/download-validation/artifact selector: 593 passed on each of Click 8.5.1 and minimum Click 8.1.0.
  • Supplemental progress/component/layout/telemetry selector: 480 passed, 3 skipped.
  • All six follow-up comments are fixed: library-sanitized layout source metadata; accurate result-output flush diagnostics; shared-sink propagation without warning coordinators; shutdown flush guards; Click Unicode/binary adaptation with tracked borrowed buffers; immediate failure sharing before timed-scenario telemetry finalization.
  • Four source/diagnostic regressions, seven enhanced sink/shutdown cases, five encoding cases and two timed-scenario cases reproduced before their fixes; cancellation coverage also passes. Tests verify original failure identity/cause, no repeated destination I/O, harmless empty Click probes, borrowed ownership, unchanged results and healthy report/log delivery.
  • Focused Ruff, mypy (Python 3.10 target; six modules including sink helpers), Bandit, whitespace and wheel/source-contract checks pass; layout/downloads/report CLI modules match packaged wheel contents.
  • Existing Click/build deprecation warnings remain. No owner-approved layout resource benchmark changed or rerun.

Review and hosted checks

All fifteen known review threads are fixed and resolved with individual exact fix-SHA replies. Copilot/Codex reviewed 0bf4039 with no open findings. Its hosted matrix exposed a coupled artifact terminal assertion that expected cleanup to retry a known failed sink and repaint a Failed row, contradicting the required zero-retry contract. a14c9c6 preserves healthy terminal failed/cancelled row assertions, original error/storage/resource checks and now verifies exact no-write/no-flush counts after failure and borrowed streams remaining open. Disabling only the no-retry guard makes this strengthened regression fail (7 writes/6 flushes versus 4 writes/3 flushes at failure); the expanded full artifact selector passes on both Click versions. Production behavior remains unchanged from 0bf4039.

All 13 runnable hosted checks passed on a14c9c6; the optional dispatch-only benchmark was skipped by its existing condition. Final-head Copilot review and Codex review settled with no open findings. All fifteen resolved threads were verified to have separate exact fix-SHA replies. Prior-head retargeted-symlink macOS test passed on 0bf4039; no unrelated worker code/test changes. Owner explicitly authorized conditional merge after current-head validation and settled reviews; no protection bypass or branch/worktree cleanup is authorized.

toddysm and others added 2 commits December 4, 2026 15:56
Enable library-backed reports through existing telemetry controls for supported pull and push commands. Preserve result channels, deferred diagnostics, error precedence, and diagnostic log ownership. Add focused physical-dispatch and sink-failure coverage for #261.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Read the stdout channel explicitly on both minimum and current Click, whose merged diagnostic output now includes the automatic request report.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings December 5, 2026 00:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-05T17:04:53.611829Z a14c9c6 Manual request
ℹ️ 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.

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce6c47fd41

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/regshape/cli/request_report.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unprotected overlap between log and download destinations can corrupt downloaded payloads while the command still exits successfully.

4 open issues
What changed in this PR

Adds automatic CLI request reports using the existing library collector and telemetry controls, advancing #261 while leaving integrated validation and final documentation to #262 and #263.

Changes:

  • Enables text or consolidated JSON reports on stderr, with diagnostic-log mirroring.
  • Adds reporting to supported transfers and telemetry controls to Docker push.
  • Adds focused coverage, updates existing fixtures, and documents reporting behavior.
File Description
src/​regshape/​tests/​test_request_report_cli.py Adds report and failure-boundary coverage.
src/​regshape/​tests/​test_progress_display.py Updates transport mocks and report assertions.
src/​regshape/​tests/​test_manifest_cli.py Checks Docker telemetry-log ownership.
src/​regshape/​tests/​test_manifest_cli_progress.py Mocks report-owned HTTP sessions.
src/​regshape/​tests/​test_layout_push.py Reads result JSON from stdout.
src/​regshape/​tests/​test_image_progress.py Adapts progress tests to automatic reports.
src/​regshape/​tests/​test_component_cli.py Updates report and error-order assertions.
src/​regshape/​tests/​test_artifact_push.py Adapts push fixtures and output assertions.
src/​regshape/​tests/​test_artifact_pull_cli.py Updates report, warning, and suppression checks.
src/​regshape/​tests/​test_artifact_download.py Checks warnings before reports.
src/​regshape/​tests/​test_artifact_cli.py Updates transport and diagnostic assertions.
src/​regshape/​libs/​decorators/​request_report.py Accepts the shared text-output protocol.
src/​regshape/​cli/​telemetry.py Connects telemetry sessions to reporting.
src/​regshape/​cli/​request_report.py Adds rendering and report lifecycle management.
src/​regshape/​cli/​manifest.py Enables manifest transfer reports.
src/​regshape/​cli/​layout.py Enables push and dry-run reports.
src/​regshape/​cli/​docker.py Adds push reporting and telemetry controls.
src/​regshape/​cli/​components.py Enables component download reports.
src/​regshape/​cli/​blob.py Enables blob transfer reports.
src/​regshape/​cli/​artifact.py Enables artifact pull reports.
docs/​library/​telemetry.md Documents automatic reports and failure behavior.
.github/​workflows/​tests.yml Includes report tests in minimum-Click coverage.

Review effort: Balanced

Comment thread src/regshape/cli/request_report.py Resolved
Comment thread src/regshape/cli/request_report.py Resolved
Comment thread src/regshape/cli/request_report.py Resolved
Comment thread src/regshape/cli/telemetry.py Resolved
Acquire caller-owned reporting lazily at the first library operation scope. Preserve portable validation errors and explicitly suppress reporting in the downloader-only retry test.

Reject manifest output aliases before opening diagnostic logs, including hard links and symlinks, with focused regression coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep healthy diagnostic sinks available after spool-read errors, fail on collection errors discovered during rendering, and expose suppressed telemetry cleanup failures without replacing primary exceptions.

Reject blob/log aliases before telemetry acquisition. Ten focused regression cases reproduce the reviewed failures and pass with these corrections.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A log/output path collision can silently corrupt verified blob downloads, while concurrent collector initialization can split reports and lose spool cleanup handles.

6 open issues

Review effort: Balanced

Comment thread src/regshape/cli/request_report.py Resolved
@toddysm
toddysm requested a balanced review from Copilot December 5, 2026 00:21
@toddysm

toddysm commented Dec 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7621c6ac1f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/regshape/cli/manifest.py Resolved
Serialize lazy collector acquisition per configuration and recheck ownership under the lock. Propagate known failed destinations through nested diagnostic proxies so aliased result writes and flushes are not retried.

Cover copied worker contexts and distinct descriptors for the same pipe, preserving primary errors and healthy report logs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@toddysm

toddysm commented Dec 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Concurrent first-scope acquisition can create multiple collectors for one configuration, splitting reports and leaving an overwritten collector inaccessible for normal export and cleanup.

No open issues 🎉

6 resolved since last review

Review effort: Balanced

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: a96f1f192f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Share the pre-telemetry file separation decorator across manifest and blob downloads and uploads. Reject path, symlink and hard-link aliases before opening logs or credentials, preserving upload inputs.

Six added source-alias cases reproduce the missing preflight and pass alongside current/minimum Click command regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@toddysm
toddysm requested a balanced review from Copilot December 5, 2026 00:33
@toddysm

toddysm commented Dec 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2d34aba0c9

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/regshape/cli/layout.py Resolved
Apply shared log separation before layout telemetry, including dry runs and archive inputs. Reject directory-contained logs and ambiguous multiply-linked outside logs using bounded ancestor metadata rather than scanning the source graph.

Nine directory metadata/content and archive alias cases fail before the guard and pass afterward; document the conservative outside-log policy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed to evaluate output-sink compatibility and failure handling when stdout and stderr share a destination.

No open issues 🎉

Review effort: Balanced

@toddysm
toddysm requested a balanced review from Copilot December 5, 2026 00:40
@toddysm

toddysm commented Dec 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 63c0fd2013

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Output failure handling still allows diagnostics to retry a broken shared destination and shutdown to reflush a failed stdout buffer, risking raw errors or an unintended exit status.

2 open issues

Review effort: Balanced

Comment thread src/regshape/cli/request_report.py Resolved
Comment thread src/regshape/cli/request_report.py Resolved
Address the remaining #276 sink-coordination review findings without retrying failed output destinations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@toddysm
toddysm requested a balanced review from Copilot December 5, 2026 16:32
@toddysm

toddysm commented Dec 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 64f26a7cda

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/regshape/cli/request_report.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A critical issue remains: timed manifest result-output failures can trigger telemetry writes to the same broken pipe because aliased stdout/stderr proxies do not immediately share failure state.

1 open issue
2 resolved since last review

Review effort: Balanced

Comment thread src/regshape/cli/request_report.py Resolved
Keep Unicode and binary CLI results compatible while sharing no-retry failure state across adapted buffers for #276.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@toddysm
toddysm requested a balanced review from Copilot December 5, 2026 16:43
@toddysm

toddysm commented Dec 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 601673abc2

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Aliased stdout/stderr can retry a broken pipe during telemetry cleanup because write failures are not shared immediately, and the regression test misses this boundary.

1 open issue

Review effort: Balanced

Prevent timed result failures from retrying a broken destination; preserve original errors and Click empty-probe behavior for #276.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@toddysm
toddysm requested a balanced review from Copilot December 5, 2026 16:50
@toddysm

toddysm commented Dec 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 0bf4039030

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because subtle interactions in output failure tracking, telemetry cleanup, exception chaining, and sink contracts can suppress reports, obscure original errors, or reject valid outputs.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Keep failed/cancelled row assertions for healthy terminals and verify no destination writes or flushes after a terminal failure. Preserve error identity, borrowed streams and resource cleanup.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@toddysm
toddysm requested a balanced review from Copilot December 5, 2026 17:03
@toddysm

toddysm commented Dec 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: a14c9c6954

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because multiple moderate findings involve subtle cleanup retries, loss of exception causes, and suppressed report delivery to healthy logs.

No open issues 🎉

Review effort: Balanced

@toddysm
toddysm merged commit 7393206 into main Dec 5, 2026
15 checks passed
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.

Render automatic request reports using existing CLI telemetry controls

2 participants