Projection refusal's cached err.stack header keeps the pre-append message, diverging from exception.message on recorded spans

Open
#2,215 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript
Domain
observability

Research direction

Read plugins-workspace/context-graph/src/project.js around line 90, then trace how withSpan records errors in src/core/observability/span_helpers.js and src/core/observability/runtime.js. Run test/plugins/context-graph-projection-budget.test.js first. Done means the propagated error's stack header and the graph.project span's exception.stacktrace first line include the appended clause, while the existing identity, code, and limitBytes assertions still pass.

Written by the indexing model from the issue text.

Description

Source: #2199 at 54a0f1b96340fde3dabc1fd3f0af9581a20ff7e8
Location: hypaware-core/plugins-workspace/context-graph/src/project.js:90
Severity: nit

Evidence

executeQuerySql runs inside withSpan, whose error path calls span.recordException(err) (src/core/observability/span_helpers.js:81), which reads error.stack (src/core/observability/runtime.js:293); V8 formats and caches the stack string before the wrapper appends the lever, so span events record exception.message with HYP_GRAPH_PROJECTION_MAX_HEAP_MB and exception.stacktrace whose first line is without it.

Why deferral is safe

No operator surface loses the lever: all three surfaces a projection refusal reaches print err.message (command.js:59, tick.js:62, commands.js reportErrors), and the only .stack consumer on the CLI path, describeBootFailure (bin/hypaware.js:145), handles boot failures a caught projection refusal never reaches. The divergence is internal to recorded span events, where exception.message carries the correct text; fixing it means minting a replacement error, destroying the typed identity finding 6's test now pins, or mutating err.stack. Classified preference: telemetry-cosmetic, no user-facing loss.

Acceptance condition

After projectGraph's wrapper appends the lever, the propagated error's stack header (and the graph.project span's exception.stacktrace first line) contains the appended clause, matching exception.message; proven by a test that fails at 54a0f1b9 and passes after, while the instanceof/code/limitBytes assertions in test/plugins/context-graph-projection-budget.test.js stay green.

Review preference; backlog only. A human may explicitly delegate it with neutral:fix.

Dominant language
JavaScript
Stars
11
Forks
0
Avg merge
2h 49m
Merged PRs (30d)
302

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hyparam/hypaware

All issues in hyparam/hypaware

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.