Skip to content

docs: add JSDoc to Logger and document why it logs to stderr - #9077

Merged
lpcox merged 2 commits into
mainfrom
copilot/add-jsdoc-to-logger
Sep 27, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/add-jsdoc-to-logger

Conversation

Copilot AI commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

src/logger.ts had no JSDoc. The issue also asked why every level calls console.error instead of console.info, console.warn and console.debug. This PR adds JSDoc and keeps the console.error calls on purpose. It only adds comments; runtime behaviour is unchanged.

Changes

  • JSDoc: covers LOG_LEVELS, the Logger class and constructor, setLevel, the private shouldLog, every level method (prefix, colour, threshold) and the exported logger singleton.
  • stderr rationale (class-level doc): in Node, console.info and console.debug write to stdout. awf wraps a user command whose stdout is often piped or parsed, so logs must not mix into it. Sending every level to stderr keeps stdout clean.
/**
 * All messages are written to stderr via `console.error`, regardless of level.
 * This is intentional: in Node.js, `console.info` and `console.debug` write to
 * stdout, which would interleave log lines with the stdout of the command
 * wrapped by awf and break callers that parse or pipe that output.
 */
class Logger {

Copilot AI linked an issue Sep 27, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add JSDoc comments for Logger class docs: add JSDoc to Logger and document why it logs to stderr Sep 27, 2026
Copilot AI requested a review from lpcox September 27, 2026 16:04
@lpcox
lpcox marked this pull request as ready for review September 27, 2026 16:07
Copilot AI balanced review requested due to automatic review settings September 27, 2026 16:07

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.

Copilot review overview

🟢 Approval recommended

The documentation accurately reflects the existing implementation and introduces no runtime changes.

Review effort: Balanced
Findings: None

What changed in this PR

Documents logger behavior and explains why all log levels use stderr without changing runtime behavior.

Changes:

  • Adds JSDoc for logger levels, methods, and singleton.
  • Documents stderr usage to preserve wrapped-command stdout.
File Description
src/​logger.ts Adds accurate JSDoc for logger behavior and stderr rationale.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 92.66% 92.67% 📈 +0.01%
Statements 91.14% 91.15% 📈 +0.01%
Functions 89.17% 89.17% ➡️ +0.00%
Branches 84.27% 84.28% 📈 +0.01%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed.

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

🛡️ Egress verdict from Smoke Copilot Network Isolation

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

Tested by Smoke Chroot

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Claude passed

Generated by Smoke Claude for #9077

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

🔮 The oracle has spoken through Smoke Codex

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #9077

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Gemini reports failed. Facets need polishing...

💎 Faceted by Smoke Gemini

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

Check Status
API ✅ PASS
gh CLI ✅ PASS
File access ✅ PASS

Overall result: ✅ PASS

Generated by Smoke Claude for #9077 · claude · haiku45 · 29.9 AIC · ⊞ 4.6K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot Engine — @Copilot @lpcox

Overall: PASS

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox Network isolation egress smoke test results:

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed domain (github.com): reachable, HTTP 200
  • ✅ Blocked domain (example.com): connection blocked (TLS cert verify failed — proxy denial)

Overall: PASS

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions github-actions Bot added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Sep 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Cloud Hypervisor + Copilot

Check Result
1. list_pull_requests (github/gh-aw-firewall) ✅ PASS — returned PR #9068
2. curl https://github.com (expect 200/301) ❌ FAIL — all curl network calls denied by sandbox before reaching network ("Permission denied")
3. Write/read file in /tmp/gh-aw/agent/ ✅ PASS
4. curl (example.com/redacted) (expect blocked, 000/403) ✅ PASS — blocked (same sandbox denial)

Overall: FAIL (check 2 could not confirm an allowed egress response; curl itself was denied at the tool level rather than returning an HTTP status).

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor
Add label ready-for-aw to run again

@lpcox
lpcox deployed to aoai-model September 27, 2026 17:24 — with GitHub Actions Active
@lpcox
lpcox deployed to aoai-model September 27, 2026 17:24 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

✅ Smoke Test: Copilot BYOK (Direct) Mode

  • ✅ HTTP github.com connectivity (HTTP 200)
  • ✅ File write/read test passed
  • ✅ MCP connectivity verified (PR data matches)
  • ✅ BYOK inference working (reading this means api-proxy → api.githubcopilot.com path active)

Status: PASS — Direct BYOK mode (COPILOT_PROVIDER_API_KEY) operating correctly.

cc @lpcox @Copilot

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Services Connectivity

  • Redis PING: ✅ (PONG)
  • PostgreSQL pg_isready: ✅ (accepting connections)
  • PostgreSQL SELECT 1: ✅ (1)

Overall: PASS

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.14 Python 3.12.14 ✅ YES
Node.js v24.21.0 v22.23.2 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

⚠️ Not all versions matched — Node.js differs between host and chroot environments. smoke-chroot label not applied.

Tested by Smoke Chroot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor
  • Upgrade gh-aw workflows to v0.89.22
  • Document B35 and D16 runner failure modes
  • GitHub PR/discussion reads ✅
  • Playwright title check ❌ (tool unavailable)
  • File write/read ✅
  • AWF build ✅
  • Discussion comment ✅
  • Overall: FAIL

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

📡 OTel Tracing Smoke Test Results

# Scenario Result
1 Module Loading ✅ otel.js loads; isEnabled() → true; exports startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled, plus internal exporter/serialization helpers
2 Test Suite ✅ 3 suites, 68/68 tests passed (otel.test.js, otel-fanout.test.js, otel-workload-identity.test.js)
3 Env Var Forwarding ✅ GITHUB_AW_OTEL_TRACE_ID/GITHUB_AW_OTEL_PARENT_SPAN_ID present in env-passthrough.ts; GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, and trace context vars present in api-proxy-env-config.ts
4 Token Tracker Integration ✅ onUsage callback present in token-tracker-http.js (OTEL hook point)
5 OTEL Diagnostics / OTLP Export ✅ GH_AW_OTLP_ENDPOINTS resolved to the Sentry endpoint and injected into the api-proxy container; Squid access log shows repeated successful CONNECT ... TCP_TUNNEL:HIER_DIRECT calls from the api-proxy sidecar (172.30.0.30) to o205451.ingest.us.sentry.io:443, confirming spans were exported through the firewall

Summary: All 5 scenarios validated successfully. No regressions detected in OTEL tracing, token-attribute propagation, or OTLP export path.

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia ✅ 1/1 passed ✅ PASS
Bun hono ✅ 1/1 passed ✅ PASS
C++ fmt ✅ N/A ✅ PASS
C++ json ✅ N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world ✅ N/A ✅ PASS
.NET json-parse ✅ N/A ✅ PASS
Go color ✅ 1/1 passed ✅ PASS
Go env ✅ 1/1 passed ✅ PASS
Go uuid ✅ 1/1 passed ✅ PASS
Java gson ✅ 1/1 passed ✅ PASS
Java caffeine ✅ 1/1 passed ✅ PASS
Node.js clsx ✅ passed ✅ PASS
Node.js execa ✅ passed ✅ PASS
Node.js p-limit ✅ passed ✅ PASS
Rust fd ✅ 1/1 passed ✅ PASS
Rust zoxide ✅ 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — PASS

Notes:

  • Bun and Deno were not preinstalled and were installed via npm install -g (postinstall scripts required --allow-scripts=bun/deno; direct curl install scripts were blocked by sandbox policy, so npm-based installs were used instead — no impact on test results).
  • Maven required an explicit -Dmaven.repo.local override (default ~/.m2/repository was not writable in this sandbox); Maven proxy settings.xml for squid-proxy was applied as instructed.
  • All 18 test projects across all 8 ecosystems built/installed and passed their test suites with no errors.

Generated by Build Test Suite for #9077 · copilot · auto · 39.2 AIC · ⊞ 11.8K · ◷
Add label ready-for-aw to run again

@lpcox
lpcox merged commit b4f4a81 into main Sep 27, 2026
135 of 138 checks passed
@lpcox
lpcox deleted the copilot/add-jsdoc-to-logger branch September 27, 2026 17:42

This branch was successfully deployed

1 active deployment
aoai-model — 7c3cdb44 Deployed Sep 27, 2026 by lpcox via conclusion #1785
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing JSDoc for Logger

3 participants