Summary
The Dakar ODW review pipeline has no tracing spans, structured span
attributes, bounded metrics, or alerting. --telemetry only streams ODW's
own log lines to stderr (see docs/developers-guide.md); there is no
runId/reviewBase/headCommit/stateFile/attempt/latency span
instrumentation, no bounded metrics emission, and no alert path on ODW
invocation failure, result-polling timeout, or record failure.
Rationale
This was raised during review of #1 and confirmed unresolved: a grep across
bin/dakar-review.mjs, workflows/dakar-review.js, and
scripts/review-state.mjs finds no tracing/observability instrumentation.
This is a genuine functional gap in operational visibility, not aspirational
polish, and is out of scope for #1 given its size.
Affected areas
bin/dakar-review.mjs — prepare/plan/review/verify/synthesize/record
stages and the ODW result-polling loop
workflows/dakar-review.js — phase() boundaries
scripts/review-state.mjs — withStateLock acquisition/release and
appendReview
docs/dakar-review-design.md (Section 8) and docs/developers-guide.md —
documentation of the instrumentation contract
Acceptance criteria
- Structured spans wrap each stage (prepare, plan, review, verify,
synthesize, record) and the ODW result-polling loop.
- Each span carries
runId, reviewBase, headCommit, stateFile,
attempt, latencyMs, and stage/outcome (ok|error).
- Bounded metrics counters (attempt counts, per-stage latency) are emitted.
- An actionable alert path triggers on ODW invocation failure, result
polling timeout, or record failure.
- No new runtime dependency beyond Node built-ins unless one is already used
elsewhere in the repo.
- Existing
dryRun and stdout/stderr contracts are preserved.
- Tests added/updated (e.g.
tests/cli.test.mjs,
tests/review-state.robustness.test.mjs, or a new
tests/observability.test.mjs) asserting span/metric emission for at
least one success and one failure path per stage.
docs/dakar-review-design.md Section 8 and docs/developers-guide.md
updated to describe the instrumentation contract.
AI agent prompt
Add structured tracing spans and alerting to Dakar's ODW review pipeline.
Scope:
- bin/dakar-review.mjs: wrap prepare, plan, review, verify, synthesize, and
record stages (and the ODW result-polling loop) in structured spans.
- workflows/dakar-review.js: emit span-start/span-end events at each phase()
boundary already present in the code.
- scripts/review-state.mjs: instrument withStateLock acquisition/release and
appendReview with span attributes.
Required span fields: runId, reviewBase, headCommit, stateFile, attempt,
latencyMs, and stage/outcome (ok|error).
Add bounded metrics counters (attempt counts, latency histograms per stage)
and an actionable alert path triggered on ODW invocation failure, result
polling timeout, or record failure — reusing the existing stage/error JSON
convention on stderr as the alert payload, or wiring to an external sink if
one is already used elsewhere in the repo.
Constraints: no new runtime dependency beyond Node built-ins unless already
present elsewhere in the repo; keep dryRun and existing stdout/stderr
contracts unchanged; add or update tests (tests/cli.test.mjs,
tests/review-state.robustness.test.mjs, or a new
tests/observability.test.mjs) asserting span/metric emission for at least one
success and one failure path per stage; update docs/dakar-review-design.md
Section 8 and docs/developers-guide.md to describe the new instrumentation
contract.
Backlinks
Summary
The Dakar ODW review pipeline has no tracing spans, structured span
attributes, bounded metrics, or alerting.
--telemetryonly streams ODW'sown log lines to stderr (see
docs/developers-guide.md); there is norunId/reviewBase/headCommit/stateFile/attempt/latencyspaninstrumentation, no bounded metrics emission, and no alert path on ODW
invocation failure, result-polling timeout, or record failure.
Rationale
This was raised during review of #1 and confirmed unresolved: a grep across
bin/dakar-review.mjs,workflows/dakar-review.js, andscripts/review-state.mjsfinds no tracing/observability instrumentation.This is a genuine functional gap in operational visibility, not aspirational
polish, and is out of scope for #1 given its size.
Affected areas
bin/dakar-review.mjs— prepare/plan/review/verify/synthesize/recordstages and the ODW result-polling loop
workflows/dakar-review.js—phase()boundariesscripts/review-state.mjs—withStateLockacquisition/release andappendReviewdocs/dakar-review-design.md(Section 8) anddocs/developers-guide.md—documentation of the instrumentation contract
Acceptance criteria
synthesize, record) and the ODW result-polling loop.
runId,reviewBase,headCommit,stateFile,attempt,latencyMs, andstage/outcome(ok|error).polling timeout, or record failure.
elsewhere in the repo.
dryRunand stdout/stderr contracts are preserved.tests/cli.test.mjs,tests/review-state.robustness.test.mjs, or a newtests/observability.test.mjs) asserting span/metric emission for atleast one success and one failure path per stage.
docs/dakar-review-design.mdSection 8 anddocs/developers-guide.mdupdated to describe the instrumentation contract.
AI agent prompt
Backlinks