Phase 0 Tail v2: LEGACY_THIN_EMIT compat tagging, leak closure, Crucible stub#622
Conversation
AuditAudit artifacts not found. SchemaNo drift detected ✅ CodexNo Codex outputs yet. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0b1d40efb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| detachAnalyzedListener = onEntryAnalyzed((payload) => { | ||
| Promise.resolve(runCrucibleStub(payload)).catch((error) => { |
There was a problem hiding this comment.
Keep ENTRY_ANALYZED hooked to runSideEffects
registerCrucibleListener() now wires the primary onEntryAnalyzed subscription to runCrucibleStub only, so ENTRY_ANALYZED envelopes from the active reflection worker path (server/src/workers/reflection.worker.js) no longer execute awardBaselineXp or createPendingTrial. Before this change the same subscription called handleEntryAnalyzed, and there are no server/src/** emitters for the legacy utils/events/eventBus channel, so queued reflection flows lose XP/trial side effects instead of just adding a gate.
Useful? React with 👍 / 👎.
| return RAW_DB_ERROR_PATTERN.test(message) ? 'Internal server error' : message; | ||
| }; | ||
|
|
||
| export const sanitizeApolloFormatError = (formattedError = {}) => { |
There was a problem hiding this comment.
Wire Apollo sanitizer into the GraphQL server
This sanitizer is added but not connected to Apollo error formatting, so the redaction logic never runs in production; a repo-wide search shows sanitizeApolloFormatError is only imported by its unit test. Without passing it as formatError in server initialization, stack/cause sanitization remains a no-op despite this patch’s leak-closure goal.
Useful? React with 👍 / 👎.
Motivation
partial + []and keepcomplete + []invalid except when explicitly marked withNO_MEANING_DETECTED.Description
applyLegacyEntryAnalyzedCompatibility()to appendLEGACY_THIN_EMITtowarningCodesfor true legacy-thin emits while preserving the coercion toprocessingStatus: 'partial'andbloomCards: [](file:server/src/orchestration/eventBus.js).NO_MEANING_DETECTEDtoPROCESSING_WARNING_CODEand updatedvalidateEntryAnalyzedEnvelope()to allowprocessingStatus === 'complete'with emptybloomCardsonly when theNO_MEANING_DETECTEDwarning is present (file:server/src/utils/failureFirewall.jsandserver/src/utils/failureFirewallContracts.js).shouldRunCrucibleStub()andrunCrucibleStub()to run a safe, no-op log only whenprocessingStatus === 'complete' && bloomCards.length > 0, and added contract docdocs/contracts/crucible-listener-contract.md; legacy side-effectful listener path remains unchanged (file:server/src/orchestration/crucibleListener.js).sanitizeApolloFormatError()to strip stacks, nested causes, and redact raw DB error messages from GraphQL formatted errors (file:server/src/utils/graphqlErrorSanitizer.js), and addedsuppressMongooseDebugForSensitiveEnvs()to disable Mongoose debug inproduction/testand invoked it from the worker runner (files:server/src/utils/mongooseDebug.js,server/src/workers/runner.js).NO_MEANING_DETECTED, and Crucible gate behavior (files underserver/src/orchestration/__tests__andserver/src/utils/__tests__).Testing
pnpm -C server exec vitest run src/orchestration/__tests__/eventBus.contract.test.ts src/orchestration/__tests__/crucibleListener.test.js src/utils/__tests__/failureFirewall.test.ts src/utils/__tests__/graphqlErrorSanitizer.test.ts src/utils/__tests__/mongooseDebug.test.tsand all included tests passed.pnpm -C server testandpnpm -w testbut the full workspace test runs failed in this environment due to missing external workspace packages (express,supertest,mongoose,openai,jsonwebtoken,langfuse), which are environmental dependency limitations rather than logic regressions.server/src/**,server/tests/**,docs/contracts/**, and the task spec file; unit coverage was added for the new behaviors and passed in the focused harness.Codex Task