Skip to content

test(seats): a credential streamed one character per delta never reaches the record - #3011

Merged
lilyshen0722 merged 1 commit into
mainfrom
wren/task-604-seat-record-credential-test
Oct 30, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
wren/task-604-seat-record-credential-test

Conversation

@lilyshen0722

@lilyshen0722 lilyshen0722 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Written by Wren, a Commonly agent — https://commonly.me/v2/pods/6a8f6dc7a1dccf2e02f31015

Summary

  • Adds two tests to packages/seats/test/record-redact-stream.test.js, beside the split tests. Test-only: src/trace/store.js is unchanged.
  • A whole value streamed one character per delta: the joined message text is exactly [redacted], and the marker is written before run.settled.
  • A value cut one character short, streamed one character per delta: the held tail flushes as [redacted] before run.settled, and the joined text is exactly the marker.

Verification

  • node --test "test/**/*.test.js" in packages/seats: 247 of 247 pass.
  • Mutation check: with the hold-back disabled in store.js (const cut = joined.length), both new tests fail, and so does the existing one-character-short test. The store was restored before the commit.

Tracks TASK-604. Tier 0 (test only, no production code).

🤖 Generated with Claude Code

…hes the record

Two cases beside the split tests, test-only (the store is unchanged):

- the whole value streamed one character per delta: every delta is held
  while it is still a prefix of the value, the completed value is replaced
  by the marker, and the joined message text is exactly the marker, written
  before run.settled;
- the value cut one character short, streamed one character per delta: the
  held tail is flushed as the marker before run.settled, and the joined text
  is exactly the marker.

Mutation check: with the hold-back disabled in store.js, both new tests fail.
The seats suite passes 247/247.

TASK-604

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-authored-by: wren <WyJ3cmVuIiwiZGVmYXVsdCJd@agents.commonly.invalid>
Agent-Model: claude/claude-haiku-5-5/max
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between b5e9708 and fe268ef.

Files selected for processing: 1
  • packages/seats/test/record-redact-stream.test.js

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

Walkthrough

Two tests cover streamed credential redaction. They verify redaction for a complete credential and for a stream that ends one character short, before run.settled.

Changes: Streamed credential redaction

Layer / File(s) Summary
Test redaction at stream boundaries
packages/seats/test/record-redact-stream.test.js
Tests stream a credential one character at a time. They assert that stored stream and record bytes contain [redacted] rather than the credential, including when the stream ends one character short. Both tests check that redaction occurs before run.settled.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Possibly related PRs

  • Team-Commonly/commonly#2739: Adds the trace store and existing streamed-credential redaction tests that this PR extends with one-character delta cases.
Merge Risk: Minimal · up to fe268

The added tests cover streamed redaction, with no actionable merge risk identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly identifies the test change and the credential-streaming behavior it covers.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description directly matches the changes. It identifies the two streaming redaction tests, their expected behavior, verification results, and test-only scope.
Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Tier 0 operator check at fe268ef. This PR changes one test file and no production code (store.js is unchanged).

  • The two tests stream the redaction canary one character per delta, first the whole value and then the value cut one character short. Each asserts that the record holds exactly [redacted] and that the marker lands before run.settled.
  • They exercise the existing hold-back path. The PR body reports a mutation check: disabling the hold-back makes both tests fail.
  • CI is green at this head, and there are no open review threads.

GATE: PASS

@lilyshen0722
lilyshen0722 added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 948cfbf Oct 30, 2026
27 checks passed
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