Skip to content

feat(T7-v14): tasken L62 adoption — record_error on circular-import#58

Open
KooshaPari wants to merge 1 commit into
mainfrom
chore/T7-v14-otel-metrics-adopt-Tasken-2026-06-21
Open

feat(T7-v14): tasken L62 adoption — record_error on circular-import#58
KooshaPari wants to merge 1 commit into
mainfrom
chore/T7-v14-otel-metrics-adopt-Tasken-2026-06-21

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Jun 21, 2026

Copy link
Copy Markdown
Owner

User description

L62 (error rate observability) adoption for v14 cycle-3 T7. Adds one pheno_otel::metrics::record_error call (gated by the otel feature) to application::import circular-import check. Adds pheno-otel as optional path dep behind the same otel feature. Depends on pheno-otel#52.


CodeAnt-AI Description

Record circular import errors in observability when OTel is enabled

What Changed

  • Circular imports during file resolution now emit an error metric when observability is turned on
  • The new metric is only included for users who enable the existing otel feature, so non-OTel builds are unchanged

Impact

✅ Clearer import error dashboards
✅ Faster detection of circular-import spikes
✅ No extra observability dependency for non-OTel users

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

…le-3 T7)

Adds one `pheno_otel::metrics::record_error` call (gated by the
`otel` feature) to the circular-import check in
`application::import`, the highest-traffic error site in the import
pipeline. Adds `pheno-otel` as an optional path dep behind the same
`otel` feature as the existing tracing + opentelemetry deps so
non-OTel consumers don't pull it in.

Refs: plans/2026-06-20-v14-71-pillar-cycle-3-p0.md § T7, ADR-036B, ADR-042.
Depends on: pheno-otel#52 (metrics API).
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@codeant-ai

codeant-ai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@sonarqubecloud

Copy link
Copy Markdown

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​opentelemetry@​0.24.010010093100100
Addedcargo/​tracing@​0.1.4410010093100100
Addedcargo/​tracing-subscriber@​0.3.239910093100100

View full report

@codeant-ai codeant-ai Bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Jun 21, 2026

@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: 0c2a418e24

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Cargo.toml
# so consumers that don't want OTel don't pull it in. When enabled, the
# `import::ImportError::CircularImport` site records an `errors.count` metric
# labelled `tasken.import.circular` so fleet-wide error rate dashboards see it.
pheno-otel = { path = "../pheno-otel", optional = true }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid requiring an external sibling crate for every build

In a clean checkout that only contains Tasken (the CI workflow checks out only this repository before cargo build --workspace), this optional path dependency still makes Cargo load /workspace/pheno-otel/Cargo.toml during manifest resolution; I checked with cargo metadata --no-deps, and it fails with failed to load manifest for dependency pheno-otel before any feature selection or build can proceed. Please vendor/workspace the crate or depend on a published/git source so default builds do not require a sibling directory.

Useful? React with 👍 / 👎.

Comment thread src/application/import.rs
// --- Circular import check ---
if visited.iter().any(|p| p == path) {
#[cfg(feature = "otel")]
pheno_otel::metrics::record_error("tasken.import", "circular_import");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: The error reason string does not match the documented metric label contract for this integration (tasken.import.circular), so circular-import failures will be recorded under a different series and won't show up in the intended error-rate dashboard. Use the expected reason token so this call emits the same metric key/labels that the observability pipeline is configured to aggregate. [api mismatch]

Severity Level: Major ⚠️
- ⚠️ Circular import errors recorded under unexpected metric label.
- ⚠️ L62 error-rate dashboard misses circular import failures.
- ⚠️ Alerts for circular imports may never fire.
Steps of Reproduction ✅
1. Enable the `otel` feature for the Tasken crate so the optional observability
dependencies are active (see `Cargo.toml:23-32`, where the `otel` feature wires in
`dep:pheno-otel` and is documented as L62 error-rate observability).

2. Observe the documented expectation in `Cargo.toml:8-12` that the
`import::ImportError::CircularImport` site "records an `errors.count` metric labelled
`tasken.import.circular` so fleet-wide error rate dashboards see it."

3. Run the circular-import test with the `otel` feature enabled, e.g. `cargo test
--features otel test_import_cycle_detected` which exercises `ImportResolver::resolve_file`
in `src/application/import.rs:129` and the cycle-detection test
`test_import_cycle_detected` at `src/application/import.rs:521-527` (this constructs
`a.json` and `b.json` that import each other and calls `resolver.resolve_file(&a_path)`).

4. When the cycle is detected, `resolve_inner` in `src/application/import.rs:12-19` (file
lines ~140-179) executes the circular-import guard; at line 155 it calls
`pheno_otel::metrics::record_error("tasken.import", "circular_import");`, which produces a
metric label based on `"tasken.import.circular_import"` instead of the documented
`"tasken.import.circular"` token, so circular-import errors are emitted under a different
label than the dashboards are configured to aggregate.

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** src/application/import.rs
**Line:** 155:155
**Comment:**
	*Api Mismatch: The error reason string does not match the documented metric label contract for this integration (`tasken.import.circular`), so circular-import failures will be recorded under a different series and won't show up in the intended error-rate dashboard. Use the expected reason token so this call emits the same metric key/labels that the observability pipeline is configured to aggregate.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@kilo-code-bot

kilo-code-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 2 Issues Found | Recommendation: Request Changes

Overview

Severity Count
CRITICAL 1
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

CRITICAL

File Line Issue
Cargo.toml 62 Path dependency pheno-otel = { path = "../pheno-otel" } forces Cargo to load the sibling crate's manifest during resolution, even when the otel feature is disabled. This breaks cargo build --workspace in clean checkouts that only contain Tasken. Use a published version or git dependency.

WARNING

File Line Issue
src/application/import.rs 155 pheno_otel::metrics::record_error is called with reason token "circular_import", but the documented metric label contract in Cargo.toml specifies tasken.import.circular. This mismatch means circular-import errors will not appear in the intended L62 error-rate dashboard.
Files Reviewed (2 files)
  • Cargo.toml - 1 issue
  • src/application/import.rs - 1 issue

Fix these issues in Kilo Cloud


Reviewed by step-3.7-flash · Input: 127K · Output: 11.7K · Cached: 172.4K

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant