Skip to content

feat(tracing): add opt-in structured diagnostics (ENG-1028) - #329

Merged
lg2m merged 18 commits into
mainfrom
feat/eng-1028-af5-tracing
Oct 19, 2026
Merged

lg2m merged 18 commits into
mainfrom
feat/eng-1028-af5-tracing

Conversation

@lg2m

@lg2m lg2m commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Behavior

AF5 (docs/plans/developer-experience.md, ENG-1028): opt-in QQ_LOG=info metadata-only JSON diagnostics in the state directory. Logging is off by default. Run/turn/provider/tool/store spans exclude transcripts, tool arguments/results, credentials and arbitrary error text. No wire/schema change.

Design

Proposed ADR-0063. Bounded lossy queue, dedicated writer, exclusive retained log slots; runtime teardown precedes writer drain. Unix no-follow handle-relative traversal. Enabled logging explicitly refused on non-Unix and with --tui-qa-root before creating files.

Review fixes

Current tip362942f0 restores existing release optimization profiles (no provisional z treatment), fixes benchmark opt-level fallback, and closes direct-run spans before terminal events reach callers. All known threads resolved; fresh current-tip review pending (prior8bdd246c receipt reports no major issues).

Verification

cargo xtask check

Head 362942f0870f vs origin/main; 0 changed file(s); scope: full workspace.

Gate Result Tests Time Command
fmt pass 1.6s cargo fmt --all -- --check
lint pass 2.1s cargo xtask lint
clippy pass 7.8s cargo clippy --color never --workspace --all-targets --all-features -- -D warnings
test pass 2785/2785 passed, 15 skipped 952.3s cargo nextest run --color never --profile ci --workspace
doctest pass 1.8s cargo test --color never --workspace --doc
minimal-clippy pass 0.1s cargo clippy --color never -p qq-provider --no-default-features --features test-support --all-targets -- -D warnings
minimal-test pass 211/211 passed, 0 skipped 3.0s cargo nextest run --color never --profile ci -p qq-provider --no-default-features --features test-support

All gates passed in 968.7s.

Real-binary smoke9/9 on362942f0. Focused serial shell/cancel3/3; environment smoke includes invalidQQ_LOG plus help/version/malformedargs. Both latest fixed threads explicitly resolved. Fresh exact-tip Codex review and CI pending.

Remaining blockers — not merge-ready

  • Hosted full H0 run39112300274 FAILED: full48444280>48000000 bytes; minimal43645144>41000000; A/B replay p95 exceeds relative limit. Same-binary A/A fails latency/noise checks, so latency unqualified. No budgets widened. Artifacts retained locally target/af5-hosted-h0 and in Actions.
  • Unused TUI helper default features removed; minimal Linux normal closure299 (below300), preserving parser/events/paste/Windows. TUI393/393 passes. Local minimal artifact43824208 still exceeds41MB. Typed serialization (+1024bytes) and store macro-removal (~51KB saving) experiments reverted, not shipped.
  • Require actual current-tip Codex thumbs-up and green CI. No thumbs-up observed; no merge performed.

ENG-1028 and AF5 performance acceptance remain open.

lg2m added 2 commits October 15, 2026 21:21
Local restart checkpoint only. Full gate passed before review fixes; final gate pending. Performance comparison currently fails size/dependency and two relative budgets. See developer-experience ledger. Not merge-ready.
@lg2m

lg2m commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
Please review current tip 832edb2 for correctness and privacy. Draft remains blocked on documented performance budget failures and Windows path safety; these are not claimed complete. Findings will be fixed and explicitly resolved, with a fresh review requested on final head before merge.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-18T10:29:39.021954Z 362942f 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: 832edb25c0

ℹ️ 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 crates/qq-core/src/runtime/run_loop.rs Resolved
Comment thread crates/qq-core/src/sessions/store.rs Resolved
Comment thread src/main.rs Resolved
@lg2m

lg2m commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
Fixes pushed in 7c95630 and all three fixed threads explicitly resolved via GraphQL. Special tools and accepted side writes now have spans. QQ_LOG plus TUI QA is explicitly refused before any file creation to preserve isolation. Non-Unix enabled logging is refused rather than using unsafe reparse traversal. Subscriber now admits only known numeric fields and span kinds, removes five dependency closure crates, bounds active spans/ancestry, retains parents through final child close. Full local gate passed 378.6s and smoke 7/7; six focused logging tests passed. Performance remains blocked: 43,039,856-byte minimal artifact exceeds unchanged 41MB budget; relative tails fail. PR is not merge-ready and no perf pass claimed. Please review current tip; require your actual thumbs-up on final tip before merge.

@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: 7c95630e6a

ℹ️ 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 xtask/src/smoke.rs Resolved
Comment thread crates/qq-core/src/runtime/run_loop.rs Resolved
Comment thread xtask/src/smoke.rs Resolved
@lg2m
lg2m marked this pull request as ready for review October 17, 2026 09:32
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@lg2m

lg2m commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
Current tip c85c036 merges latest main and fixes all three latest findings; all fixed threads explicitly resolved. Session supervisor now owns a correlated run span through yielded-event persistence. Smoke handles non-Unix refusal and macOS fallback path. Linux tracing smoke passes. Release size reduced via package-level compact profiles: minimal 40,194,448 bytes, below unchanged 41MB cap. Still qualifying latency: clean current-main A/A itself fails many relative budgets and both main/candidate have identical 305-crate closure (over existing 300 cap). No budgets widened, no perf pass claimed. Latest full gate failed goal-host drain timeout; exact focused rerun passed. Continuing verification, not merge-ready yet.

@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: c85c036601

ℹ️ 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 crates/qq-core/src/runtime/run_loop.rs Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@lg2m

lg2m commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
Current tip 86632fe. Full CI-profile gate passed 278.8s and all 9 smoke scenarios passed. Corrected new-main fixture shared 10-second watchdog across 16 setups to the same 10-second bound per iteration, retaining all 16 behavioral assertions. No performance pass claimed: minimal binary now 40,194,448 bytes meets existing cap, but main and candidate identical dependency closure is 305 > 300 and clean-main A/A itself fails many latency budgets. All completed/failed/partial measurements are documented in ledger. Please review latest tip; all fixed prior threads explicitly resolved. Remaining performance qualification prevents merge until addressed.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 86632fe313

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

@lg2m

lg2m commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
Latest tip d8bf876 fixes both fresh run-context findings: side-question supervisor now covers persistence and execution reuses an existing supervisor run span instead of allocating a second ordinal. Both fixed threads explicitly resolved. Focused side-question tests 4/4 and full local CI-profile gate passed 335.0s. Controlled remote turn-overhead qualification is running in workflow 39024735697; no perf pass claimed. Size cap now met, inherited 305-vs-300 dependency budget and noisy local A/A remain blockers.

@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: d8bf87679e

ℹ️ 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/logging.rs Resolved
Comment thread Cargo.toml Resolved
@lg2m

lg2m commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
Fixes pushed in 6494183; all three fixed threads explicitly resolved. Run span now encloses scheduler catch/drain/fallback settlement and side launch catch/fallback; direct side calls retain their own single context. IO initialization diagnostics expose actionable source details. tracing-core defaults disabled with std only; valuable removed from lock. Focused panic/side 12/12 and logging 6/6 pass; full local CI-profile gate passes 340.3s. Remote controlled recording failed before measuring because workflow hardcoded core opt=3; verifier now compares each arm against declared core profile and retains equal safety/debug settings. No latency budget widened or pass claimed.

@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: 64941832b6

ℹ️ 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 .github/workflows/ci.yml Resolved
Comment thread src/logging.rs Resolved
Comment thread crates/qq-core/src/runtime/run_loop.rs Resolved
@lg2m

lg2m commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
Latest fixes in 420c383 and 4f26d6f: direct spans start on first poll; disconnected writer still joins and returns preserved IO cause with regression; direct side catch/fallback owns run context; workflow derives trailing override from qq-core consistently. All four fixed threads explicitly resolved. Full local CI-profile gate passed 320.1s after final fix; preceding gate373.1s and smoke9/9 passed. Please review current tip. Earlier remote performance treatment has wrong baseline override and is not claimed qualifying.

@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: 4f26d6f0fe

ℹ️ 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 Cargo.toml Resolved
Comment thread crates/qq-core/src/runtime/run_loop.rs Resolved
@lg2m

lg2m commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
New tip a60224f fixes both latest findings; all17 known threads explicitly resolved. Restored hot-crate inherited level3 rather than claiming the controlled turn diagnostic qualifies H0. Direct stream terminal events now release phase/run span ownership before yielding, with red-before/green-after real-subscriber success/failure regression. Full CI-profile workspace gate passed347.6s and329.6s; logging7/7; smoke9/9. Performance/size acceptance remains open; no merge readiness claimed yet.

@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: a60224f0ec

ℹ️ 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 Cargo.toml Resolved
Comment thread .github/workflows/ci.yml Resolved
@lg2m

lg2m commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
Current tip af394f8 restores shipped qq and paired xtask s profile and fixes package→top-level→default opt fallback in workflow. Red-before/green-after four-case expression regression, fixture5/5, full CI-profile workspace gate321.7s, smoke9/9. All19 known threads explicitly resolved. No current performance/size pass claimed; please review current tip.

@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: af394f8d0d

ℹ️ 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 Cargo.toml Resolved
Comment thread crates/qq-core/src/runtime/run_loop.rs Resolved
Comment thread crates/qq-core/src/runtime/run_loop.rs Resolved
@lg2m

lg2m commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
Current24cd5dc0 fixes both span-lifetime findings (public paused/context failure and selector/goal completion yields), explicitly resolved. Full CI-profile gate333.0s, focused terminal matrix and goal/selector3/3, smoke9/9 pass. The performance-budget thread intentionally remains open pending actual qualifying evidence; no waiver or readiness claimed.

@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: 24cd5dc04b

ℹ️ 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 crates/qq-core/src/runtime/run_loop.rs Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread docs/adr/README.md Resolved
@lg2m

lg2m commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
Current tip8bdd246c pushes verified provider terminal-span cleanup, debuginfo arm matching regression, ADR index correction and paused-clock fixture repair. Explicit resolution confirmed for all3fixed threads. Stable clean-head full CI-profile gate passes1078.0s at2processes; logging8/8, workflow7/7, actionlint and smoke9/9 pass. All known threads currently resolved (performance thread was resolved externally; its acceptance remains unproven, not waived). Starting full hosted H0 recording with unchanged budgets; no performance pass claimed yet.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 8bdd246c3b

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

@lg2m

lg2m commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
Pushed791efffe after clean full local gate1005.4s: fixes CI answer-wait deadline setup race with explicit phase entry before virtual deadline advancement. Earlier8bdd review reports no major issues. Separate manual CI trace-fixture race also diagnosed and fixed locally4d1075a0; payload now waits for foreground subscription (focused0.31s), full gate before push. HostedH0 still running; no performance-budget pass claimed.

@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

qq/.github/workflows/ci.yml

Lines 313 to 314 in 791efff

[[ "$BASELINE_SHA" =~ ^[0-9a-f]{40}$ ]]
[[ "$CANDIDATE_SHA" =~ ^[0-9a-f]{40}$ ]]

P1 Badge Reject identical H0 baseline and candidate commits

When a manual dispatch supplies the dispatch commit itself as perf_baseline_sha, this H0 job checks only that both values are forty-hex and then records the same checkout as baseline, candidate, and control. Both A/B and A/A can consequently pass without measuring the proposed change, despite this workflow being the full matched H0/size qualification; reject BASELINE_SHA == CANDIDATE_SHA before recording, as the turn-overhead job already does.

AGENTS.md reference: AGENTS.md:L94-L95

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

@lg2m

lg2m commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
Current tipbbcb6d8d removes only unused crossterm derive-more and pulldown-cmark CLI/HTML default helpers; paste/events/Windows and Markdown parser retained. Measured minimal Linux normal closure299 (from305), TUI393/393, clean full CI-profile gate954.3s. Prior4d1075a0 trace fixture fix gate911.4s and GitHubCI pass. Performance remains BLOCKED: hosted39112300274 AB full48,444,280>48MB/min43,645,144>41MB; replayp95 fails; same-binaryAA fails latency/noise so unqualified. Local new artifact43,824,208>41MB. No budget/profile changes or pass claimed. Please review current tip.

@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: bbcb6d8ddb

ℹ️ 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 crates/qq-core/src/runtime/run_loop.rs Resolved
Comment thread src/main.rs Resolved
@lg2m

lg2m commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
Current tip362942f0 fixes both latest findings (completed serial tool future dropped before yields; invalidQQ_LOG validated before Clap exits). Both explicitly marked resolved. Clean full CI-profile gate968.7s passes, shell/cancel3/3, structured real smoke pass including invalidenv+help/version/malformedargs. Dependency closure299. Performance/size acceptance still blocked; no budgets widened or performance pass claimed. Please review exact current tip.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 362942f087

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

@lg2m
lg2m merged commit 46769b9 into main Oct 19, 2026
8 checks passed
@lg2m
lg2m deleted the feat/eng-1028-af5-tracing branch October 19, 2026 04:48
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