Skip to content

tools: drop artifacts/publish after passing verify gates - #35

Merged
ANcpLua merged 2 commits into
mainfrom
feat/verify-clean-publish
Jul 6, 2026
Merged

tools: drop artifacts/publish after passing verify gates#35
ANcpLua merged 2 commits into
mainfrom
feat/verify-clean-publish

Conversation

@ANcpLua

@ANcpLua ANcpLua commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Status: complete-and-verified

Problem: the AOT demo verifiers must publish into the repo's standard artifacts/ layout (redirecting via --artifacts-path breaks the prebuilt-Analyzer path contract documented in verify-aot-publish-gate.py), so every run leaves ~50–150 MB of NativeAOT output per demo. A full matrix accumulates multiple GB on dev disks — observed 1.6 GB of publish/ inside a 7.5 GB artifacts/ tree.

Change: verify_helpers.remove_publish_outputs() deletes artifacts/publish and reports the freed size. Both entry points call it only on a fully passing run:

  • verify-aot-autoinstrumentation-goal.py — after all selected verifiers pass
  • verify-aot-publish-gate.py — after a passing gate (before the ok-line)

Failures keep the tree for inspection; --keep-publish opts out on both tools. artifacts/bin and artifacts/obj are deliberately untouched — deleting them would force full rebuilds and bin carries the prebuilt-Analyzer contract.

Verification: python3 tools/verify-aot-autoinstrumentation-goal.py --only "real sqlite demo" — demo AOT-published and verified, then printed removed artifacts/publish (…MB), exit 0. py_compile clean on all three files; --list paths unaffected.

🤖 Generated with Claude Code

The AOT demos must publish into the standard artifacts/ layout (the prebuilt-
Analyzer path contract forbids --artifacts-path), so every demo run leaves its
~50-150 MB NativeAOT publish output behind — a full matrix accumulates multiple
GB on dev disks (observed: 1.6 GB publish/ inside a 7.5 GB artifacts/ tree).

The publish tree is a pure verification byproduct: each verifier executes the
binary and asserts within the same run. Both entry points (the goal orchestrator
and the AOT-publish gate) now remove artifacts/publish after a fully passing
run and report the freed size; failures keep it for inspection. --keep-publish
opts out.

Verified: ran the goal orchestrator --only "real sqlite demo" — demo passed,
publish tree removed, exit 0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3e62118c-0f4c-4dba-b6b8-97458b74c71f

📥 Commits

Reviewing files that changed from the base of the PR and between 0f4ff79 and 70e4df0.

📒 Files selected for processing (1)
  • tools/verify_helpers.py
📜 Recent review details
⏰ Context from checks skipped due to timeout. (7)
  • GitHub Check: verify (ubuntu-24.04-arm)
  • GitHub Check: verify (macos-latest)
  • GitHub Check: webapi-aot-demo (ubuntu-24.04-arm)
  • GitHub Check: webapi-aot-demo (macos-latest)
  • GitHub Check: otlp collector fixtures
  • GitHub Check: smoke (ubuntu-24.04-arm)
  • GitHub Check: smoke (macos-latest)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

**: # Qyl.OpenTelemetry.AutoInstrumentation agent rules

Mission

This repository is the runtime AOT auto-instrumentation lane for qyl, evolving into a
self-describing observability substrate. The foundation is unchanged: .NET 10
NativeAOT-compatible zero-code instrumentation through managed build assets, source generation,
DiagnosticListener consumption, and module-initializer boot. The direction is the North Star
below.

Keep this repository separate from:

  • semantic-convention package generation (Qyl.OpenTelemetry.SemanticConventions is a referenced
    vocabulary package, not generated here),
  • the old CLR-profiler/OpenTelemetry auto-instrumentation substrate.

North Star — declare and prove the whole stack

Every observability tool today is pull-by-observation: a backend learns what a service emits
by receiving samples over time, and never knows whether it has seen the whole surface. qyl has a
capability none of them have — because instrumentation is source-generated interceptors + a static
contract + a referenced semconv registry + (incrementally) DTO inference, the complete set of
telemetry a binary can ever produce is a compile-time-derivable fact, with provenance.

The substrate goal: every qyl binary ships a complete, machine-readable Telemetry Capability
Graph (TCG)
— the full possible OpenTelemetry surface for that exact binary, each capability
tagged compile-time-owned vs runtime-valued — and proves it by self-hosting (instrumenting its
own pipeline with its own mechanism, zero extra code). Any external entity consumes the TCG to know
the entire stack before a span is sampled. The contract becomes the shared semantic graph; an OTLP
backend is just one consumer.

Three pillars:

  1. Self-host (the proof). qyl instruments qyl with qyl — QylSelfTelemetry /
    SemConvConformanceProcessor are the seed; the binary observing itself is how "declared TCG ==
    runtime reality" is checked.
  2. **Compile-time-complete TCG (the ar...

Files:

  • tools/verify_helpers.py

⚙️ CodeRabbit configuration file

**: Operating principles (solo-dev, agentic SDLC — reviews are advisory, agents act on them):

  1. LAZY: one self-contained, correct review beats ten partial ones. Every finding is
    definitive — concrete evidence with file:line, a concrete fix, no "consider maybe",
    no open or ambiguous questions back to the author. If you cannot decide a point
    from the diff plus repo context, stay silent on it. Never cite a source, API, or
    version you have not verified; an unverifiable claim is a dropped claim.
  2. IMPATIENT: never stall a PR. There are no compatibility obligations here — internal
    and dogfooding code has NO public-API contract; removing shims, breaking signatures,
    and deleting dead paths are normal, desirable changes. Do not flag backward
    compatibility, deprecation ceremony, or migration paths. (SemVer applies only to
    commercially sold libraries — this repo has none.)
  3. EGO: hold the bar of the best reviewer on the market — flag real correctness,
    security, data-loss, and structural problems precisely; produce zero noise.

Files:

  • tools/verify_helpers.py
🔇 Additional comments (1)
tools/verify_helpers.py (1)

27-34: LGTM!


📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added a --keep-publish option to preserve generated publish artifacts after verification.
    • When --keep-publish is not set, successful runs now automatically remove publish outputs.
  • Bug Fixes

    • On verification failures, artifacts remain available for inspection.
    • Cleanup is best-effort and will be skipped gracefully if an error occurs, avoiding hard failures.

Walkthrough

Adds remove_publish_outputs() in tools/verify_helpers.py and wires both verifier scripts to delete artifacts/publish after successful runs unless --keep-publish is set.

Changes

Publish output cleanup

Layer / File(s) Summary
Cleanup helper
tools/verify_helpers.py
Adds shutil import and remove_publish_outputs(), which deletes artifacts/publish under ROOT, measures deleted size, and returns a status string, short-circuiting if absent.
Verifier script wiring
tools/verify-aot-autoinstrumentation-goal.py, tools/verify-aot-publish-gate.py
Imports the helper, adds --keep-publish, and conditionally prints the cleanup result after successful completion while keeping failure exits unchanged in the publish gate.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing artifacts/publish after passing verify gates.
Description check ✅ Passed The description clearly matches the changeset and explains the cleanup behavior, flags, and verification.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/verify-clean-publish
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/verify-clean-publish

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tools/verify_helpers.py`:
- Around line 13-29: The cleanup helper can raise an uncaught OSError and turn
an otherwise passing verification run into a failure. Update
remove_publish_outputs() to handle errors around the size scan and
shutil.rmtree, and make it return a safe summary message instead of letting
exceptions escape. Keep the behavior localized in remove_publish_outputs() so
the call sites in verify-aot-autoinstrumentation-goal.py and
verify-aot-publish-gate.py don’t need their own error handling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3aaefa5f-7d76-4358-ab65-256bffc6e332

📥 Commits

Reviewing files that changed from the base of the PR and between 5f49d03 and 0f4ff79.

📒 Files selected for processing (3)
  • tools/verify-aot-autoinstrumentation-goal.py
  • tools/verify-aot-publish-gate.py
  • tools/verify_helpers.py
📜 Review details
⏰ Context from checks skipped due to timeout. (6)
  • GitHub Check: webapi-aot-demo (macos-latest)
  • GitHub Check: webapi-aot-demo (ubuntu-24.04-arm)
  • GitHub Check: smoke (ubuntu-24.04-arm)
  • GitHub Check: smoke (macos-latest)
  • GitHub Check: verify (macos-latest)
  • GitHub Check: verify (ubuntu-24.04-arm)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

**: # Qyl.OpenTelemetry.AutoInstrumentation agent rules

Mission

This repository is the runtime AOT auto-instrumentation lane for qyl, evolving into a
self-describing observability substrate. The foundation is unchanged: .NET 10
NativeAOT-compatible zero-code instrumentation through managed build assets, source generation,
DiagnosticListener consumption, and module-initializer boot. The direction is the North Star
below.

Keep this repository separate from:

  • semantic-convention package generation (Qyl.OpenTelemetry.SemanticConventions is a referenced
    vocabulary package, not generated here),
  • the old CLR-profiler/OpenTelemetry auto-instrumentation substrate.

North Star — declare and prove the whole stack

Every observability tool today is pull-by-observation: a backend learns what a service emits
by receiving samples over time, and never knows whether it has seen the whole surface. qyl has a
capability none of them have — because instrumentation is source-generated interceptors + a static
contract + a referenced semconv registry + (incrementally) DTO inference, the complete set of
telemetry a binary can ever produce is a compile-time-derivable fact, with provenance.

The substrate goal: every qyl binary ships a complete, machine-readable Telemetry Capability
Graph (TCG)
— the full possible OpenTelemetry surface for that exact binary, each capability
tagged compile-time-owned vs runtime-valued — and proves it by self-hosting (instrumenting its
own pipeline with its own mechanism, zero extra code). Any external entity consumes the TCG to know
the entire stack before a span is sampled. The contract becomes the shared semantic graph; an OTLP
backend is just one consumer.

Three pillars:

  1. Self-host (the proof). qyl instruments qyl with qyl — QylSelfTelemetry /
    SemConvConformanceProcessor are the seed; the binary observing itself is how "declared TCG ==
    runtime reality" is checked.
  2. **Compile-time-complete TCG (the ar...

Files:

  • tools/verify_helpers.py
  • tools/verify-aot-publish-gate.py
  • tools/verify-aot-autoinstrumentation-goal.py

⚙️ CodeRabbit configuration file

**: Operating principles (solo-dev, agentic SDLC — reviews are advisory, agents act on them):

  1. LAZY: one self-contained, correct review beats ten partial ones. Every finding is
    definitive — concrete evidence with file:line, a concrete fix, no "consider maybe",
    no open or ambiguous questions back to the author. If you cannot decide a point
    from the diff plus repo context, stay silent on it. Never cite a source, API, or
    version you have not verified; an unverifiable claim is a dropped claim.
  2. IMPATIENT: never stall a PR. There are no compatibility obligations here — internal
    and dogfooding code has NO public-API contract; removing shims, breaking signatures,
    and deleting dead paths are normal, desirable changes. Do not flag backward
    compatibility, deprecation ceremony, or migration paths. (SemVer applies only to
    commercially sold libraries — this repo has none.)
  3. EGO: hold the bar of the best reviewer on the market — flag real correctness,
    security, data-loss, and structural problems precisely; produce zero noise.

Files:

  • tools/verify_helpers.py
  • tools/verify-aot-publish-gate.py
  • tools/verify-aot-autoinstrumentation-goal.py
🔇 Additional comments (2)
tools/verify-aot-autoinstrumentation-goal.py (1)

10-11: LGTM!

Also applies to: 130-134, 160-164

tools/verify-aot-publish-gate.py (1)

41-42: LGTM!

Also applies to: 191-193, 247-250

Comment thread tools/verify_helpers.py
shutil.rmtree after a green run is best-effort hygiene; an OSError (AV lock,
IDE indexer, Windows handle) now degrades to a 'cleanup skipped' notice instead
of crashing the gate post-success. CodeRabbit finding, verified with a
read-only-dir simulation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ANcpLua
ANcpLua merged commit 5bb3587 into main Jul 6, 2026
9 checks passed
@ANcpLua
ANcpLua deleted the feat/verify-clean-publish branch July 6, 2026 02:08
ANcpLua added a commit that referenced this pull request Jul 6, 2026
The main slnx carried 39 projects, 30 of them Qyl.Real*Demo apps that each wire
the source-interceptor generator as an analyzer — opening the solution in an IDE
runs 30 generator pipelines on every edit, which is the remaining structural
IDE-load source after the artifacts/publish cleanup (#35).

Main slnx now carries src + tests + benchmarks (9 projects); the demo matrix
lives in Qyl.OpenTelemetry.AutoInstrumentation.Demos.slnx. The goal orchestrator
gains a 'demos release build' step directly after 'release build', so compile
coverage of the demos is unchanged. nuget-publish packs individual projects and
is unaffected. CLAUDE.md documents the split.

Verified: both solutions build Release green; gate subset (contract invariants,
release build, demos release build, package layout) passes.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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