Skip to content

37598 跟进:可观测性包的控制台与 JSON 日志器也打印被包装的原始错误 #37658

Done
1 of 1 issue completed

Description

@objectstack-fleet

repo:objectstack#5 · os-bill · session_01Utp6CbeF2saT6wUBV4E9uc

Filing gate: ② follow-up out of #37598. The source is the card thread's os-dev report on PR #37652 (comment 7199875525, out-of-scope finding "noted, not filed"). The owning area files it under the source card, per the maintainer's standing permission for areas to file their own follow-up cards.
Grading: area:ai · Bug · p3 · reach: every host that logs through @objectstack/observability's ConsoleLogger or JsonLogger an error wrapped on cause · evidence: read.

维护者速读

  • 做什么:上一张卡让服务器故障日志打印被包装的原始错误。可观测性包里另外两个日志器(控制台、JSON)还是不打印。让它们用同样的方式打出原始错误。
  • 谁受益:用这两个日志器排障的运维。
  • 不做会怎样:换了日志器,根因又看不到了。
  • 需要你做的:无。

What

packages/observability/src/loggers.ts — ConsoleLogger and JsonLogger serialize an error without its cause. After PR #37652, logServerFault (faultCauseChain, packages/types) and ObjectLogger (packages/core) record the chain (5 links, cycle-safe, operator-only). Give both observability loggers the same shape, reading the existing helper if @objectstack/observability can reach it without a new edge, else pin a copy to it with a parity test as core does.

Acceptance

  • A test per logger: a wrapped error logs each cause's message and stack; a cycle and a deep chain are bounded; parity with faultCauseChain's output.
  • Clause-②: no, Metadata-protocol: none.

Blocked-by: #37598 (PR #37652)
Parent: #37598
Size: XS
Dedupe (objectstack, is:issue): ConsoleLogger cause 0 · JsonLogger Error.cause 0.

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    pm:blocked
    area:ai
    domain:server
    on Nov 26, 2026
  2. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:ai · domain:server · Bug · priority:p3 · pm:blocked · size XS; rationale: the observability package's ConsoleLogger and JsonLogger should also print an error's wrapped cause, after #37598's PR. Read; p3 as filed; blocked by #37598.

  3. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbeF2saT6wUBV4E9uc

    Unblocked: PR #37652 merged at 6b7b3051c1; the cause-chain printing this card builds on is on main. pm:blocked → pm:queue.

  4. added
    pm:queue
    and removed
    pm:blocked
    on Nov 26, 2026
  5. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbeF2saT6wUBV4E9uc

    Claim: PM loop round 13 · area ai-36996 (topic #36996 non-cloud rows; the maintainer, verbatim, 2026-11-25T12:57Z project thread: 「开一个 36996 专题,接手剩余任务」; area concurrency 3 under the maintainer's total of 10, 2026-11-26T13:44Z: 「后续并发降到10」) · 2026-11-26T23:04Z
    Session: session_01Utp6CbeF2saT6wUBV4E9uc
    Account: os-bill
    Area: ai-36996
    Branch: claude/issue-37658-observability-cause-chain
    Worktree: objectstack-issue-37658
    Domain: domain:server
    Seat: repo:objectstack#5
    File surface: packages/observability/src/loggers.ts (ConsoleLogger, JsonLogger) and their tests, plus a test-only parity pin against faultCauseChain (@objectstack/types) if it needs only a devDependency; N4 of contract record on PR #37652 (one fixture with each of the glued redact qualifiers) in packages/core/src/logger-error-cause.test.ts and/or packages/types/src/server-fault-log-cause.test.ts; root .changeset/. ⛔ No runtime dependency edge added to @objectstack/observability; no packages/spec/**, packages/mcp/**, skills/**, docs/adr/**, ui/**; no change to logServerFault or ObjectLogger behaviour. Stop on breach and report.
    Container & model: XS, mode:subagent, model: default — dispatch-gates --tier: "no path-derived mandate", effort: medium
    Clause-②: no
    Metadata-protocol: none
    Responsibility: packages/observability (ConsoleLogger / JsonLogger serialize an error without its cause) produces a lost root cause | no platform path covers it | every operator on a host that logs through the observability loggers
    Premise: holds — on origin/main aca4960f66: loggers.ts reads no cause; @objectstack/observability depends on @objectstack/spec only, so the shape is pinned by a copy with a parity test, as core does. PR #37652 merged.
    Serial constraints cleared: #37598 (PR #37652) merged; #37666 (PR #37694) merged. In flight: #37609 (packages/lint/**), PR #37674 (skills/**): disjoint.
    Pre-claim deps: #37598 closed
    Prior rulings read: contract records on PR #37652 (N4) and seat ACCEPT 7201440400

  6. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 26, 2026
  7. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbeF2saT6wUBV4E9uc
    os-dev-report

    {
      "issue": 37658,
      "status": "done",
      "branch": "claude/issue-37658-observability-cause-chain",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37716",
      "head": "d2a09be453",
      "session": "session_01Utp6CbeF2saT6wUBV4E9uc",
      "premise_still_valid": true,
      "summary": "ConsoleLogger and JsonLogger (packages/observability/src/loggers.ts) now add `causes` beside `error` and `stack` on error()/fatal(): one entry per cause link, outermost first, each its message and stack, at most 5 links, cycle-safe, ending in a marker entry when cut; an uncaused error logs byte-identically (causes omitted). The helper is a private pinned copy of faultCauseChain (no runtime edge; observability still depends on @objectstack/spec only; no export added), held to faultCauseChain by a parity test via a devDependency on @objectstack/types aliased to source in vitest.config.ts. N4: core's parity block (packages/core/src/logger-error-cause.test.ts) gains one fixture gluing each of the 31 glued qualifiers to a default word plus a control proving the fixture exercises each; observability's parity block carries the same fixture. ObjectLogger and logServerFault unchanged. Premise held on origin/main aca4960f66: loggers.ts read no cause.",
      "files_changed": [".changeset/37658-observability-loggers-cause-chain.md", "packages/core/src/logger-error-cause.test.ts", "packages/observability/package.json", "packages/observability/src/__tests__/loggers.test.ts", "packages/observability/src/loggers.ts", "packages/observability/vitest.config.ts", "pnpm-lock.yaml"],
      "line_budget": "407 changed lines (+401 / -6, 7 files) vs the 3000 human-merge threshold: under (dispatch-gates readout at d2a09be453). No skills/** touched.",
      "acceptance": [
        "per logger, a wrapped error logs each cause's message and stack: PASS (ConsoleLogger + JsonLogger 'logs each cause's message and stack, outermost first'; fatal for both)",
        "a cycle is bounded: PASS (both loggers 'stops a cycle at its first repeat, and says so')",
        "a deep chain is cut at the limit: PASS (both loggers, 20-deep chain cut to FAULT_CAUSE_DEPTH_LIMIT + marker, limit imported from @objectstack/types)",
        "parity with faultCauseChain: PASS (12 fixtures x 2 loggers, toEqual(faultCauseChain(error)))",
        "no runtime dependency added: PASS (dependencies still only @objectstack/spec; @objectstack/types is a devDependency, workspace allows it: types depends on spec only, no cycle)",
        "N4 glued-qualifier fixture: PASS (core parity block + control; same fixture in observability parity)",
        "ablation, one, on the cause reading in one logger: PASS (red 30/44, restored)",
        "Clause-② no, Metadata-protocol none: PASS (PR body + changeset line-initial; Check Changeset success)"
      ],
      "tests": "At d2a09be453, under os-verify-lock: `pnpm --filter @objectstack/observability test && typecheck` -> Test Files 7 passed (7), Tests 120 passed (120), both tsc programs clean, VERDICT command-exit 0. `pnpm --filter @objectstack/core test && typecheck` -> Test Files 158 passed (158), Tests 3791 passed (3791), VERDICT command-exit 0. loggers.test.ts alone: Tests 44 passed (44). Ablation: scripts/ablation-replace.mjs on packages/observability/src/loggers.ts, anchor `const causes = causeChain(error);` -> `const causes: CauseLine[] = [];` (anchor 1->0, blob d037c912f881 -> 3aed5820db82): Tests 30 failed | 14 passed (44); restore blob == HEAD d037c912f881, git diff HEAD empty. Subject imported from source (../loggers.js), so no build/dist leg. First typecheck run was red (TS2554 x16: two-arg Error constructor under the package's ES2020 lib) and fixed in d2a09be453 with a withCause helper.",
      "gates": "Local: dispatch-gates --commands at d2a09be453 derived 79; 77 exit 0; `pnpm check:dual-build-cjs-loads` exit 3 and `pnpm check:lean-entry-closure` exit 3 = PREREQUISITE NOT MET (need a whole-workspace build) -> NOT MEASURED locally, both run by CI's Lint & Repo Gates = success. `dispatch-gates --ran` with exit-annotated record -> '79 derived famil(ies) accounted for — 77 run, 2 NOT-MEASURED', exit 0. check-nul-bytes exit 0. overlap-check --branch=HEAD VERDICT clean exit 0 before each push. CI at d2a09be453: 69 check-runs, 60 success, 9 skipped, 0 failed; required: Lint & Repo Gates success, TypeScript Type Check success, Test Core 1-10/10 success, Build Core success, Governed Surface Queue Guard success, Lint UI success, Type Check UI success, Test UI 1-16/16 success, Build & E2E UI success, Live E2E UI success, Dogfood Regression Gate success; Check Changeset success. test:repo not run locally (diff touches no repo-project test); CI Test Core green.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "readings": "BASE aca4960f66 (origin/main at fetch); PR #37716 draft true, head d2a09be4539616e39c8dc20aaf78d67b38c32f77, assignee os-bill; relay read-back: 4499 bytes sent, 4499 stored, identical; body ends with the signed line.",
      "deviations": [],
      "mcp_calls": "0",
      "api_writes": "2 — relay pr_create (POST /repos/objectstack-ai/objectstack/pulls + POST /issues/37716/assignees, one stroke, run 45910098325); post-stamped os-dev-report comment POST /repos/objectstack-ai/objectstack/issues/37658/comments. Plus git push x3 (not REST).",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed — the glued-qualifier fixture lists in the core and observability tests are hand copies: removing a qualifier from any of the three copies fails a parity test, adding one to a single copy fails nothing until the fixture grows (PR Acceptance notes)."
      ]
    }
  8. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbeF2saT6wUBV4E9uc

    Claim amendment · 2026-11-26T23:53Z · claim 7205240498 · corrections made at area L1 on PR #37716.

    • Clause-②: no → Clause-②: yes (widening), patch. ConsoleLogger and JsonLogger now emit an additive causes field on error() / fatal(). The seat read additive log fields as widening on PR fix(types,core): the 5xx fault log and ObjectLogger print an error's cause chain #37652. The changeset (head 80855b22b0) and the PR body carry the corrected line.
    • File surface, named explicitly: packages/observability/package.json (a devDependency on @objectstack/types for the parity test, as the claim allowed), packages/observability/vitest.config.ts (its source alias) and pnpm-lock.yaml. No runtime dependency is added. The rest of the claim stands.
  9. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbeF2saT6wUBV4E9uc

    ACCEPT → PR #37716 comment 7206892683 (contract record 7206884238, PASS)

  10. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbeF2saT6wUBV4E9uc

    Merged: PR #37716 at 7e638ba777 closed this card by Fixes. Delivered: the @objectstack/observability console and JSON loggers record a wrapped error's cause chain in an additive causes field, matching faultCauseChain (the 5-link limit, the cycle and unreadable-link markers, guarded reads); an error with no cause logs byte-identically; the core parity fixture glues all 31 qualifiers (N4 of PR #37652). Left: #37744 carries N1 and N2 of record 7206884238, handed to repo:objectstack#1. pm:dispatched removed.

  11. removed
    pm:dispatched
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:serverpriority:p3

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions