Skip to content

fix(types,core): the 5xx fault log and ObjectLogger print an error's cause chain - #37652

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-w4acnx
Nov 26, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-w4acnx

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread
Fixes #37598
Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:用户无感;服务器出 5xx 故障时,运维日志里那一行现在会带上被包在里面的原始错误(原因链),不用再猜真正的故障在哪。
  • 为什么做:记录 AI 问询专题里一张跟进卡,上一张把“关联记录读取失败”改成故障后,日志里看不到底层原因,只能临时把原因拼进堆栈绕开;这次在日志本身补上,绕开的写法一并拿掉。
  • 出错会怎样:只影响服务器日志的内容,接口返回给用户的内容一个字节不变;有问题撤回本次合并即可。
  • 要你做什么:无。

What changes

  • packages/types/src/server-fault-log.ts: new faultCauseChain(thrown) returns the cause chain under a thrown value, outermost first, each link { message, stack? } (message is Name: text for an Error, the text itself for a string cause, JSON for an object cause). Bounded at FAULT_CAUSE_DEPTH_LIMIT (5) links and cycle-safe (stops at the first repeat); either cut ends in a marker link that says so. A throwing cause getter ends the chain instead of costing the line. logServerFault's console fallback (the sink sendError / sendServerFault and every un-wired door reach) now writes causes beside stack. The injected-logger branch is unchanged: it hands the logger the thrown error with its cause intact, and the logger renders it, so the chain is never printed twice.
  • packages/core/src/logger.ts: ObjectLogger.write records an error as { message, stack, causes? } (was { message, stack }), same bounds and same shape, for every logger.error / logger.fatal that passes an Error. Field is absent when there is no cause.
  • Both copies: a link whose read throws (a hostile name / message / stack getter, a Proxy) ends the chain in a marker link ([cause chain link unreadable: reading it threw]) instead of costing the line or the record.
  • One helper or two: two copies, pinned to one output. core already depends on types, but @objectstack/core/logger is the browser-safe entry @objectstack/client bundles, and client does not depend on @objectstack/types; importing it would pull the types root (and @objectstack/spec value imports behind it) into the browser logger. logger-error-cause.test.ts runs eleven fixtures through both and asserts equal output.
  • packages/services/service-record-context/src/record-context-tools.ts: drops the Caused by: suffix PR fix(record-context): a related object's read that fails is a failure, not a refusal #37550 appended to a failed related read's stack (and its now-unused describeThrown). The original still rides on cause, which the fault line now prints.
  • Wire: no response body changes. The fault line is operator-only.
  • Changeset .changeset/37598-fault-log-cause-chain.md (patch: @objectstack/types, @objectstack/core, @objectstack/service-record-context).

Read first: faultCauseChain and the console branch of logServerFault in server-fault-log.ts; renderError in logger.ts.

Tests

  • packages/types/src/server-fault-log-cause.test.ts (15): console fallback logs each cause's message and stack (wrapper → mid → root); CONTROL no cause ⇒ no causes; a declared capability absence (warn) carries none; cycle and self-cause stop with a marker; a 20-deep chain stops at 5 plus a marker; string and object causes; a throwing getter; a link whose message read throws ends in a marker and the line is still written; a cause is redacted like the error (an object cause, by whole words as the logger matches its redact list, inside an array in an object cause, and on the console fallback line); an injected logger receives the error with cause intact and no causes in meta; sendServerFault's body carries no cause text while its line carries the root.
  • packages/core/src/logger-error-cause.test.ts (18): JSON record carries error.causes for error and fatal; CONTROL no cause; cycle; deep chain; a cause is redacted like the error (under a configured redact list); a link whose message read throws ends in a marker and the record is still written; parity with faultCauseChain over eleven fixtures (nested Error, cycle, deep chain, string cause, object cause, a cause redacted like the error, field names under the default redact words whole-word matched, an array inside an object cause, an object cause that cannot be serialized, a link whose message read throws, a throwing cause getter).
  • packages/runtime/src/mcp-record-context-tools-bridge.test.ts: the real-kernel outage case now finds the original as causes[0] (Error: OUTAGE, stack carrying it) on all four fault lines, the stack carries no Caused by:, and the answer text on both doors carries no cause text.
  • packages/services/service-record-context/src/__tests__/record-context-tools.test.ts: the suffix pin now asserts cause is the original and the stack carries no Caused by:.
  • Ablation (the console branch's causes spread disabled, rebuilt, marker proved in dist/): server-fault-log-cause.test.ts 2 failed / 8 passed (the two that read the chain off the line), the runtime harness outage case failed (causes[0].message undefined). Restored (blob = HEAD, git diff HEAD empty, marker absent from dist/): 10/10 and 28/28.

Acceptance notes

  • A test per sink with a nested cause, cycle and deep chain bounded: server-fault-log-cause.test.ts, logger-error-cause.test.ts.
  • The record-context harness outage case still finds the original in the fault line with the suffix removed: mcp-record-context-tools-bridge.test.ts.
  • No response body change: pinned in the harness (both doors) and in sendServerFault's case.
  • Noted, not filed: @objectstack/observability's ConsoleLogger / JsonLogger (the other Logger implementations) still record an error as { error, stack } without its cause (loggers.ts lines 56 and 114 on this head); outside the claim's surface, and carried by 37598 跟进:可观测性包的控制台与 JSON 日志器也打印被包装的原始错误 #37658.

Rework (contract review 7200020944, seat REWORK 7200035097)

  • M1: Clause-②: yes (widening) in this body and the changeset (three new exports on @objectstack/types: faultCauseChain, FAULT_CAUSE_DEPTH_LIMIT, FaultCauseLine); every package stays at patch.
  • S1: fixed as the area relayed; pinned by the tests named "a cause is redacted like the error" in both packages.
  • S2: each link is guarded in both copies; the case is in the parity fixtures and in each package's own tests.
  • S3: the observability loggers are carried by 37598 跟进:可观测性包的控制台与 JSON 日志器也打印被包装的原始错误 #37658.
  • N1: both docblocks name logger-error-cause.test.ts.

Second delta (contract review 7200840843 PASS, seat REWORK 7200856706):

  • S4: the console fallback's default field-name rule is now ObjectLogger's own whole-word matcher (the finding(core): ObjectLogger 的脱敏表按子串匹配,一个叫 keys 的普通字段会被整块换成 ***REDACTED*** #5573 rule) over the same default words, copied beside faultCauseChain; a parity fixture of the spellings that differ (keys, tokens, monkey, keyword, secretary, apiKey, apikey, accesstoken, refresh_tokens, clientSecret, API_KEY) fails on any drift. Drift check: with the fallback put back to a substring match and rebuilt, that fixture went red (1 failed / 17 passed); restored (blob = HEAD), 18/18.
  • N2: the faultCauseChain docblock says the fallback applies only the default words, never a host's own redact list.
  • N3: an array inside an object cause is pinned in both packages and in the parity fixtures.
  • Handing the MCP doors the kernel logger is out of scope; the area files it.

Verification

  • Local: see the report for the head, the targeted suites, each touched package's whole suite and typecheck, and the derived gate families.
  • Two-minute check: pnpm --filter @objectstack/types exec vitest run --project local src/server-fault-log-cause.test.ts, expected 10 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6CZHczeF42DiDgkJPmk


Generated by Claude Code

…cause chain

logServerFault prints the cause chain as causes beside stack on its console
fallback; ObjectLogger prints it as error.causes. Bounded at five links,
cycle-safe, never on the wire. record-context drops its Caused-by stack suffix.

Claude-Session: https://claude.ai/code/session_01Utp6CZHczeF42DiDgkJPmk
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

18 anchor(s) derived from 3 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • 2 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 46 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 05563a57f00f60223ccb4974db444c8231f1fd9d → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 4683161efc6b538a75ecd2fb48e9426d2615ce88 — the merge of head d6092ff79df63ec50fcaa457ca84d2787029f838 into base 05563a57f00f60223ccb4974db444c8231f1fd9d, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 4683161efc6b538a75ecd2fb48e9426d2615ce88 && git checkout 4683161efc6b538a75ecd2fb48e9426d2615ce88
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 05563a57f00f60223ccb4974db444c8231f1fd9d d6092ff79df63ec50fcaa457ca84d2787029f838 && git checkout -B drift-repro 05563a57f00f60223ccb4974db444c8231f1fd9d && git merge --no-ff d6092ff79df63ec50fcaa457ca84d2787029f838

node scripts/docs-audit/affected-docs.mjs --json 05563a57f00f60223ccb4974db444c8231f1fd9d

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head d12137d · 2026-11-26T17:59Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: TIER_DEFAULT
Head-sha: d12137d7ca7f0505e2b766db7dfd7563b80b4ddd
Local-runs: none

Read: card #37598 (body, triage, claim, os-dev-report), PR #37652 (body, 8 files), git diff origin/main...pr-37652-a, and the 68 check-runs on the head (57 success, 11 skipped, 0 failure: TypeScript Type Check, Lint & Repo Gates, Check Changeset, Test Core 10/10 and aggregate, Dogfood Regression Gate among them).

① Derived judgments

Accept-set: no change. Nothing under packages/spec/**, no schema, no authorable key, no response body. Right.

Public surface, each change the diff publishes:

  • @objectstack/types (published, publishConfig; root entry is export * from './server-fault-log.js'): three NEW exports, faultCauseChain, FAULT_CAUSE_DEPTH_LIMIT and FaultCauseLine. This is additive, and it is mis-declared (M1). The core parity test imports faultCauseChain from the package root, so the export is load-bearing and cannot simply be made private.
  • @objectstack/types logServerFault: the console fallback line gains causes beside stack. The injected-logger branch is unchanged: it still hands toError(input.error), the same object with cause intact. This is additive for log consumers. Right.
  • @objectstack/core ObjectLogger: an error record goes from { message, stack } to { message, stack, causes? }. renderError, causeOf and causeLine are module-private. The change is additive, and causes is absent when there is no cause. Right in shape, but see S1 and S2.
  • @objectstack/service-record-context: describeThrown was module-private, so no export is removed. failure.stack no longer carries the Caused by: suffix that fix(record-context): a related object's read that fails is a failure, not a refusal #37550 added. That changes the log text, not the wire, and is acceptable only because both in-repo sinks now render cause (see S3 for the sinks outside the repo).

Wire: no path puts faultCauseChain or error.causes on an answer. faultCauseChain is called from the logServerFault console branch only. renderError is called from ObjectLogger.write only. Neither response-envelope.ts nor serverFaultLogMeta carries a stack or a cause. Both the harness (both MCP doors: no causes and no Caused by in the answer text) and the sendServerFault case (generic envelope) pin this. Right.

Findings:

  • M1 (must-fix) — Clause-②: no is wrong. The diff adds three exports to the published @objectstack/types root. Under seat precedent a new export on a published package is Clause-②: yes (widening), still at patch. Fix the line in BOTH the PR body and .changeset/37598-fault-log-cause-chain.md, and keep all three packages at patch. The card prescribed no, but the card wrote its prescription before the export existed, and the diff decides.
  • S1 (should-fix) — security-relevant, in the ObjectLogger non-Error cause path (causeLine in packages/core/src/logger.ts). The details go to the seat out of band and are not repeated here.
  • S2 (should-fix) — only a throwing cause getter is guarded. A cause whose name, message or stack read throws (a hostile getter, or a Proxy) costs the whole record. In logServerFault the outer catch returns false and the fault line is never written; before this diff the same input logged. In ObjectLogger.write, renderError sits outside any try, so logger.error throws to its caller. The fix is to wrap causeLine per link and emit a marker link on a throw, in both copies, and to add the case to the parity fixtures.
  • N1 (nit) — both docblocks say "logger.test.ts pins the two to one output", but the parity block is in packages/core/src/logger-error-cause.test.ts.

② Semver level

patch on @objectstack/types, @objectstack/core and @objectstack/service-record-context matches what the diff publishes: a bug fix plus additive exports and additive log fields. Nothing is removed or narrowed, so no BREAKING banner or ADR-0087 marker is owed. Metadata-protocol: none is right: nothing a metadata author can write changes.

Clause-②: wrong as declared. It should read yes (widening), because of the three new @objectstack/types exports (M1). The new log output shape (causes on the console fallback, error.causes on ObjectLogger) is an additive widening for log consumers: no existing field changes meaning or goes missing.

③ Boundary flags

Security-touching: yes

open_questions: none in the report. security_findings: none in the report: disagreed, see S1.

Dev flag (out-of-scope finding, "noted, not filed"): @objectstack/observability ConsoleLogger and JsonLogger record an error as { error, stack } without cause. The flag is real. No in-repo door is handed one (the MCP doors use the console fallback, and the dispatcher uses the kernel logger). Both are public exports a host can inject, though. For such a host, removing the record-context Caused by: suffix turns a logged root cause back into a lost one.

  • S3 (should-fix) — file the follow-up card for the observability loggers instead of carrier: none. This is not blocking for this head.

Seat questions:

  1. Wire: never. The chain feeds only the console fallback meta and the ObjectLogger record. No answer builder reads either, and the harness on both doors plus the sendServerFault case pin the answer bodies. Operator-only holds.
  2. Disclosure: yes, it is wider for log readers, in two ways. (a) An Error cause's name: message and stack are now printed wherever a wrapper used to hide them. Those are driver and host messages of the same class the unwrapped error already printed, so this is the card's intent, and the record-context path already printed them through the suffix. (b) The non-Error cause path in ObjectLogger is a new concern (S1). The console fallback was never redacted, so it has no new mechanism, only new content.
  3. Parity: real for the branches it feeds. Five fixtures (nested Error, cycle, nine-deep chain past the limit, string cause, object cause) go through the actual JSON record and are compared with toEqual against faultCauseChain. A drift in a marker text, the depth limit, cycle handling, or Error, string or object rendering fails it. It does not cover the throwing-getter branch or a JSON-throwing or JSON-undefined object cause. The two implementations agree there by reading (safeStringify is identical to core's inline form), but no fixture would catch a drift. Add those cases with S2.
  4. fix(record-context): a related object's read that fails is a failure, not a refusal #37550 harness: yes. The real-kernel outage case asserts, on all four fault lines across both doors, that causes[0].message is Error: OUTAGE and that causes[0].stack contains it, and that the stack carries no Caused by:. The report's ablation (the causes spread disabled) reds this case. It proves the console-fallback sink that the MCP doors use. The ObjectLogger sink is proven by the core unit test, not by the harness. That is sufficient because the injected-logger branch passes the original error object unchanged.
  5. Clause-②: faultCauseChain (with FAULT_CAUSE_DEPTH_LIMIT and FaultCauseLine) is a new export of the published @objectstack/types, so the line must be Clause-②: yes (widening) at patch (M1). The log shape change is an additive widening for log consumers and does not change the level.

SQL push-down (Prime Directive 5): the diff has no data access, no id materialisation and no in-app join. No finding.

Implemented-by: claude/project-thread-w4acnx
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: FAIL

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: d12137d7ca7f0505e2b766db7dfd7563b80b4ddd
REWORK — L1, seat repo:objectstack#5

  1. Shape: draft against main. 8 files, +446/−24. Not governed. Security-touching (log content).
  2. Premise: printing the Error.cause chain for operators is sound. It never reaches the wire, the parity test is real, and the fix(record-context): a related object's read that fails is a failure, not a refusal #37550 outage case still proves the original error is logged.
  3. Gates: contract record 7200020944 (TIER_DEFAULT) reads FAIL on M1. CI on this head: 0 failed.
  4. Owed before landing (ids from the record):
  5. Ride along: N1 (both docblocks name logger.test.ts; the parity test is logger-error-cause.test.ts).
  6. Landing terms: after the delta, the same reviewer re-checks it. Then the area lands it.

… declare the widening

Rework for the contract review: a link whose read throws ends the chain
in a marker in both copies; object causes render under the same rules in
both copies; Clause-2 reads yes (widening); docblocks name the parity test.

Claude-Session: https://claude.ai/code/session_01Utp6CZHczeF42DiDgkJPmk
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l and removed size/m labels Nov 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 5a623151013b8fc71ea913cdbec0a727be96cdd7
Local-runs: none

Delta review: prior head d12137d7ca7f0505e2b766db7dfd7563b80b4ddd, now 5a623151013b8fc71ea913cdbec0a727be96cdd7 (2 commits). Read: the delta diff (5 files, +152 / -15), the net diff against main (the same 8 files, +583 / -24), the PR body, the seat REWORK 7200035097, the dev delta report 7200784938, card #37658, and the 72 check-runs on the head (59 success, 13 skipped, 0 failure, all completed).

① Derived judgments

Accept-set: unchanged and empty. There is no spec, schema or response-body change. Public surface: the same three new @objectstack/types exports as before. faultCauseChain's second parameter changes from a depth limit to a per-key redaction predicate. The export is new in this PR and has no released consumer, so the change costs nothing, and FAULT_CAUSE_DEPTH_LIMIT still fixes the depth. The ObjectLogger record shape is unchanged: error.causes stays optional and additive.

Prior ids:

  • M1: closed. Clause-②: yes (widening) is now in the PR body and in .changeset/37598-fault-log-cause-chain.md, and every package stays at patch.
  • S1: closed. Both copies now serialize a non-Error object cause through a JSON.stringify replacer. ObjectLogger passes its own configured redact rule (isRedactedFieldName), so the cause follows the same rule as the record's fields. The replacer runs at every depth, so nested objects and objects inside arrays are covered too (the types test pins nested.authToken). Value-borne text is not covered: a message string, or a value that toJSON turns into a string. That is outside the logger's existing contract, which redacts by field name only and has never scrubbed an error's own message. Not a finding.
  • S2: closed. Each link is read inside a guard in both copies. A throwing name, message or stack read ends the chain in [cause chain link unreadable: reading it threw], and the record is still written: logServerFault returns true, and ObjectLogger no longer throws. The String(cause) fallback is inside the same guard. The parity fixtures cover the case.
  • S3: closed. 37598 跟进:可观测性包的控制台与 JSON 日志器也打印被包装的原始错误 #37658 (open) carries the observability loggers, and the PR body names it.
  • N1: closed. Both docblocks name logger-error-cause.test.ts.

New:

  • S4 (should-fix): the console fallback's default rule is a substring match (lower.includes(word)), while ObjectLogger's rule matches on word boundaries.
    • Because of that, the fallback redacts the values under bare keys and tokens, and under monkey, keyword and secretary. The maintainer's ruling on finding(core): ObjectLogger 的脱敏表按子串匹配,一个叫 keys 的普通字段会被整块换成 ***REDACTED*** #5573 says those must not be redacted. A reader sees ***REDACTED*** where nothing secret was withheld.
    • It is a superset of ObjectLogger's default rule, so it leaks nothing. But the docblock says "the same rule a logger applies to its own fields", which is not what it does.
    • No parity fixture uses such a key, so the drift between the two copies is not caught.
    • Fix: align the fallback with the word-boundary rule, or narrow the docblock and add a fixture that pins the documented difference.
  • N2 (nit): the faultCauseChain docblock says the fallback "errs towards withholding". That is true only against the default list. The fallback cannot apply a list a host configured on its logger, and the MCP doors always log through the fallback. State that limitation in the docblock.
  • N3 (nit): no test pins an array inside an object cause. JSON semantics cover it, but a fixture should hold it in both copies.

② Semver level

patch on @objectstack/types, @objectstack/core and @objectstack/service-record-context is right. Clause-②: yes (widening) is now right: three new exports on a published package, and additive log fields. Metadata-protocol: none is right.

③ Boundary flags

Security-touching: yes

open_questions: none. The dev's out_of_scope_findings entry is carried by #37658. The report gives security_findings as withheld; the redaction gap S1 described is closed by this head.

Host-configured words on the console fallback: a host's stricter list (for example, extra domain words) is not applied to object causes on the fallback line, which is the MCP doors' only sink. I accept this at this scope for four reasons:

  • The fallback has never applied host redaction to anything (message, meta, stack). It has no logger config to read.
  • The default words still apply, and more broadly than ObjectLogger applies them.
  • No in-repo producer puts a plain object on Error.cause.
  • The real fix is to hand the MCP doors the kernel logger, which is outside this card's surface.
    Documenting the limitation is N2. A carrier card is optional.

Pre-existing, ungraded: when the top-level thrown value is a non-Error object, toError still stringifies it into the message without redaction. That is unchanged from main and not touched by this PR.

SQL push-down (Prime Directive 5): there is no data access in the diff. No finding.

Implemented-by: claude/project-thread-w4acnx
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对 (delta)

Head-sha: 5a623151013b8fc71ea913cdbec0a727be96cdd7
REWORK — L1, seat repo:objectstack#5 (short)

  1. Shape: unchanged, 8 files, +583/−24. Not governed, security-touching. Clause-②: yes (widening) at patch is now right.
  2. Closed: M1, S1, S2, S3, N1.
  3. Gates: delta record 7200840843 (TIER_DEFAULT) reads PASS, with one new should-fix. CI on this head: 0 failed.
  4. Owed before landing:
  5. Ride along if cheap: N2 (say in the docblock that the fallback applies only the default words, not a host's own list), N3 (pin an array inside an object cause). Handing the MCP doors the kernel logger is out of scope. The area may file it as a p3 under 37463 跟进:服务器 5xx 故障日志不打印被包装的原始错误(cause) #37598.
  6. Landing terms: after the delta, the same reviewer re-checks it. Then the area lands it, and the seat adds security.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: TIER_DEFAULT
Head-sha: d6092ff79df63ec50fcaa457ca84d2787029f838
Local-runs: none

This is the second delta review. The prior head was 5a623151013b8fc71ea913cdbec0a727be96cdd7; the new head d6092ff79df63ec50fcaa457ca84d2787029f838 adds one commit.

I read:

Check-runs: 58 success, 13 skipped. One PR-body guards run is cancelled. It was superseded by a later run of the same job on this head, at 18:51:09Z, which succeeded. No gate is red or unanswered.

① Derived judgments

The accept-set is unchanged and empty. The public surface is unchanged: the same three new @objectstack/types exports. This round adds only module-private helpers in server-fault-log.ts.

Prior ids:

  • S4: closed. isDefaultRedactedFieldName now runs ObjectLogger's whole-word matcher over the default words.
    • I compared the copy against packages/core/src/logger.ts line by line. tokenizeFieldName uses the same three split regexes and the same lower-casing. singularizeWord, isQualifiedConcatenation, containsWordRun and fieldWordsMatchPattern have the same logic. The qualifier set holds the same 31 entries in the same order.
    • The default words match LoggerConfig.redact's default and core's constructor default. The types copy passes each word as a single-word pattern, which is equivalent to tokenizing it because the default words are single lowercase words.
    • A new parity fixture runs the spellings that used to differ through both copies, with ObjectLogger at its default config. Those spellings are keys, tokens, monkey, keyword, secretary, tokenizer, apiKey, apikey, accesstoken, refresh_tokens, clientSecret, password and API_KEY. The fixture fails if the two copies drift, and the dev reports it went red when a substring match was put back. types also has its own case pinning the whole-word result.
  • N2: closed. The faultCauseChain docblock now says that only the default words apply on the console fallback, and that a host's own redact list is not applied there. 37598 跟进:MCP 入口的故障日志改用内核日志器,主机的脱敏设置才生效 #37666 (open) carries the fix of handing the MCP doors the kernel logger.
  • N3: closed. An array inside an object cause is now pinned in both places: in the types package's own cases, and as a parity fixture with secrets under two different keys.

New:

  • N4 (nit): the parity fixture uses 2 of the 31 glued qualifiers (api, access). An edit to the qualifier list in only one copy would drift without failing a test. One fixture with each qualifier glued to a default word would close this. It does not block.

② Semver level

Unchanged from the previous round, and still right. Every package is at patch. Clause-②: yes (widening) holds for the three new @objectstack/types exports and the additive log fields. Metadata-protocol: none holds.

③ Boundary flags

Security-touching: yes

open_questions: none. security_findings is withheld in the report. The redaction findings from earlier rounds are closed on this head. The host-list limitation is documented (N2) and carried by #37666. The observability loggers are carried by #37658.

SQL push-down (Prime Directive 5): the diff has no data access. No finding.

Implemented-by: claude/project-thread-w4acnx
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对 (delta 2)

Head-sha: d6092ff79df63ec50fcaa457ca84d2787029f838
ACCEPT — L1, seat repo:objectstack#5

  1. Shape: draft against main. 8 files, +683/−24. Not governed. Security-touching (log redaction of causes), so the seat adds security. Clause-②: yes (widening) at patch.
  2. Closed: M1, S1, S2, S3, N1 (round 1), and S4, N2, N3 (round 2). Both copies now redact an object cause key by key with the same whole-word matcher, and every link is guarded.
  3. Gates: delta record 7201430392 (TIER_DEFAULT) reads PASS, with no open should-fix. CI on this head: 0 failed (the cancelled PR-body guards run was superseded by a green rerun).
  4. Accepted deviations: N4 (the parity fixture covers 2 of the 31 glued qualifiers; it can ride on 37598 跟进:可观测性包的控制台与 JSON 日志器也打印被包装的原始错误 #37658).
  5. Out of scope and where it went: 37598 跟进:可观测性包的控制台与 JSON 日志器也打印被包装的原始错误 #37658 (observability loggers drop cause), 37598 跟进:MCP 入口的故障日志改用内核日志器,主机的脱敏设置才生效 #37666 (hand the MCP doors the kernel logger).
  6. Landing terms: not governed, under 3000 lines, no decision owed. The area lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Adding security: this PR changes how log redaction applies to an error's cause chain (seat ACCEPT 7201440400, item 1).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbeF2saT6wUBV4E9uc

Landing: ACCEPT 7201440400 (delta contract record 7201430392, PASS; security label 7201448562) at head d6092ff79df63ec50fcaa457ca84d2787029f838.

Probe Reading
Check-runs on head 59 success, 17 skipped, 0 failed, 0 in progress; 1 cancelled is the PR-body guards run superseded by rerun 140113809653 (success) after the body patch
Governed / size check-governed-merges --pr 37652: NOT governed, 707 changed lines ≤ 3000; mergeable_state unstable only while Check Changeset reran on the label, now complete
landing-k PRBASE 05563a5 (Test Core 2/10, run 45879093703); K = 7 < 15; no locale leg; no shared book under this PR

Status: ready + auto-merge (merge queue). On MERGED, #37598 closes by Fixes; #37658 (observability loggers, plus N4: the rest of the glued qualifiers in the parity fixture) and #37666 (MCP doors get the kernel logger) unblock.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 26, 2026 19:22
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 6b7b305 Nov 26, 2026
77 of 78 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-w4acnx branch November 26, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation security size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

37463 跟进:服务器 5xx 故障日志不打印被包装的原始错误(cause)

2 participants