Skip to content

Improve causal tracing, refund demo, and Next.js roadmap - #55

Merged
stackloomdev merged 1 commit into
mainfrom
codex/refund-trace-nextjs-roadmap
Jul 27, 2026
Merged

stackloomdev merged 1 commit into
mainfrom
codex/refund-trace-nextjs-roadmap

Conversation

@stackloomdev

Copy link
Copy Markdown
Owner

What changed

  • Extend compile-time and runtime evidence for derived conditions, repeated expressions, bounded DAG evaluation, and truthful fallbacks.
  • Keep sensitive values redacted across aliases, historical rows, exports, and repeated component instances.
  • Distinguish confirmed, possible, and lost network provenance in the inspector.
  • Add a real refund fixture that traces disabled={!canRefund} through order.status === "paid" to GET /api/orders/4821 · 200.
  • Replace the public demo GIF and inspector screenshot with the refund trace.
  • Mark the project as Vite-first and document the bounded Next.js Client Component feasibility track and RSC boundary.
  • Coalesce inspector refreshes without putting ordinary host interactions on the full inspection path.

Why

The previous public demo did not demonstrate CauseScope's strongest value: following a rendered UI decision back through state to the network response that produced it. The tracing engine also needed stronger guarantees for real-world derived expressions, repeated reads, sensitive data, and ambiguous evidence.

Impact

The README now shows the end-to-end refund evidence chain in under eight seconds. Runtime evidence is more accurate and bounded, sensitive values remain redacted, ordinary interactions stay responsive, and unsupported Next.js/RSC behavior is stated explicitly instead of implied.

Validation

  • pnpm check
    • workspace typecheck, tests, and builds
    • production runtime removal
    • performance and package-size budgets
    • public API, release, links, trace contract, and StackBlitz verification
    • packed-package installs on Vite 5, 6, 7, and 8
    • 12 React 19 Chromium E2E scenarios plus React 18 and React SWC coverage
  • Runtime core: 50/50 tests
  • Babel plugin: 34/34 tests
  • Overlay: 3/3 tests
  • Privacy scan and git diff --check
  • No JavaScript, JSX, or MJS source files introduced

@stackloomdev
stackloomdev marked this pull request as ready for review July 27, 2026 10:06
@stackloomdev
stackloomdev merged commit d2479af into main Jul 27, 2026
11 checks passed
@stackloomdev
stackloomdev deleted the codex/refund-trace-nextjs-roadmap branch July 27, 2026 10:06

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 421627a373

ℹ️ 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".

])],
);

path.insertBefore(t.variableDeclarator(t.cloneNode(traceIdentifier), traceCall));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep trace temporaries out of named exports

When a traced binding is declared as export const canRefund = ..., inserting the trace declarator before this VariableDeclarator adds it to the same exported variable declaration. Development output therefore unexpectedly exports the generated _canRefundDerivation value, changing the module namespace between development and production and potentially affecting consumers that enumerate exports or Fast Refresh boundary detection. Insert the temporary in a separate, non-exported declaration instead.

Useful? React with 👍 / 👎.

const sensitiveResult = typeof result !== "boolean" && sensitiveInputs.size > 0;
this.#recordExpression(
input.metadata,
sensitiveResult ? "[REDACTED]" : result,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the observed value when evaluating conditional renders

When a sensitive derived non-boolean feeds conditional JSX—for example const visible = account.secret.value || ""; return <div>{visible && <Private />}</div>—this replaces the actual expression result with "[REDACTED]" before #recordExpression calls evaluateConditionalRender. Because logical rendering is inferred from the result's truthiness and object type, a genuinely rendered React element is then reported as hidden; ternaries can likewise select the wrong branch when a falsy sensitive operand becomes the truthy redaction marker. Keep the real value for internal condition/outcome evaluation and redact only the stored/displayed trace.

AGENTS.md reference: AGENTS.md:L9-L9

Useful? React with 👍 / 👎.

Comment on lines +42 to +43
if (operator !== "===" && operator !== "!==" && (needsUserCoercion(left) || needsUserCoercion(right))) {
return COERCION_UNAVAILABLE;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve observed ternary tests when coercion is unavailable

For a direct conditional render whose test requires object coercion, such as expiresAt < now ? <Expired /> : <Active /> with Date operands, this now makes the binary evaluation unavailable. evaluateCondition then falls back to the overall JSX result rather than the observed test value; because either ternary branch is a truthy React element, evaluateConditionalRender always reports the consequent even when the alternate was rendered. Capture the test result during the original evaluation or leave the branch explicitly unavailable instead of substituting the rendered branch value.

AGENTS.md reference: AGENTS.md:L9-L9

Useful? React with 👍 / 👎.

stackloomdev added a commit that referenced this pull request Jul 27, 2026
Publish the derived-condition tracing, evidence redaction, refund demo, and Vite-first roadmap work from #55 as causescope 1.0.0-beta.8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant