Skip to content

fix(cache): tell long-id steps apart under --strict-cache with an identity digest - #1810

Merged
kdy1 merged 12 commits into
e2e-inc:mainfrom
samanyudas:fix/strict-cache-long-test-id
Nov 18, 2026
Merged

kdy1 merged 12 commits into
e2e-inc:mainfrom
samanyudas:fix/strict-cache-long-test-id

Conversation

@samanyudas

@samanyudas samanyudas commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor
  • Under --strict-cache, a step whose key misses is checked for a recording of the same step under another key (packages/core/src/cache/rekeyed.ts).
  • That check compares provenance as an entry stores it, and recordedProvenance cuts testId, targetId, and agent to 300 characters (packages/core/src/cache/recorder.ts).
  • Two ids that differ only after character 299 cut to the same string, so a never-recorded test matched another test's recording and failed with a false REPLAY_STALE.
  • Now recordedProvenance also writes an optional identityDigest (SHA-256 of the whole redacted test id, target id, and agent name) when bound would make one of them ambiguous. That is when it cuts the name, or when the whole name already ends like a cut (… at 299 or 300 characters, which a createAgent cache key can). Short-id entries are unchanged and keep the same cache key.
  • readProvenance validates the digest like paramsDigest, and stepKey keys by it. A long-id step whose key really changed still fails with REPLAY_STALE.
  • An entry that cut a name before the digest existed never matches, so that step runs live. completeProvenance writes the digest into such an entry once a confirmed replay proves which step it belongs to.
  • readTraceEntry drops unknown fields, so older runners ignore the new one. There is no TRACE_SCHEMA_VERSION bump, the same as when paramsDigest, callIndex, and agent were added.
  • Rebased onto main after refactor: move e2e's core into @e2e-dev/core, and engines peer on it #1737 moved the cache into @e2e-dev/core, so the changeset names both e2e and @e2e-dev/core. Main is merged in at 66d07ca4, and the ja and zh cache tables get the new row.
  • completeProvenance rewrites a kept entry only when its stored provenance lacks the occurrence fields or holds another identity digest, so a confirmed long-name entry that already has the step's digest keeps its bytes.
const ambiguous = [testId, targetId, agent ?? ''].some((text) => boundIsAmbiguous(text, MAX_TRACE_DESCRIPTOR_CHARS));
// ...
...(ambiguous ? { identityDigest: sha256Hex(JSON.stringify([testId, targetId, agent ?? null])) } : {}),

Issue

Fixes #1809

Verified

Ran it locally: yes

Built CLI at e6a69cfa against a scratch web project (later commits change only comments, docs, and tests): two tests under a 342-character describe title, each running agent.act('increment the counter') with a scripted model. Run 1 records the first test only (e2e run --grep 'first variant'). Run 2 is CI=1 e2e run --strict-cache on both.

main (25bde7a) this branch (e6a69cf)
Tests 1 failed | 1 passed (2)
Cache 1 replayed · 1 missed
REPLAY_STALE: the recording of this step no longer replays: the store holds it under another cache key (…json), exit 2
Tests 2 passed (2)
Cache 1 replayed · 1 missed
second test ran live (2 model calls), exit 0
  • The recorded entry keeps a 300-character testId plus identityDigest. Main and this branch write the same key file in the same project (3b488c9e….json).
  • After changing the agent's context, --strict-cache on the first test fails with REPLAY_STALE ... since the agent's context (its context, or the test's agentContext) changed after it was recorded. A long-id step whose key really changed is still caught.
  • A short-id entry carries no identityDigest.
  • The same project with the describe title checkout flow passes 2 of 2 on main, so the id length is the trigger.
  • Mutations each fail the new tests:
    • the digest left out of stepKey, > changed to >=, only testId checked, the … case dropped, >= maxChars - 1 changed to >= maxChars
    • the digest over unredacted names, the length measured on unredacted names, the target or agent name not redacted
    • the digest dropped on read, the typeof check on a read digest dropped, the paramsDigest check dropped
    • no backfill, a backfill on every replay (recordedFor.identityDigest === undefined, which kdy1 tried), a backfill that never replaces or drops a stored digest
  • The no-rewrite test counts the store's writes, since a rewrite in the same millisecond keeps the same bytes.
  • pnpm check passes. e2e unit tests: 3974 passed, 2 skipped, on the branch with main merged in.

🤖 Generated with Claude Code

@github-actions github-actions Bot added the size:S Up to 29 changed lines, not counting tests, fixtures, translated docs, or the lockfile label Nov 15, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 issues found across 5 files

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

View guided diff | Re-trigger cubic

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/cache.mdx">

<violation number="1" location="docs/cache.mdx:396">
P3: The new row says these long-ID steps run live under `--strict-cache`, but `docs/reference/errors.mdx` (the `REPLAY_STALE` row) still lists `no-entry` under another key as a failure with no exception. Update that row to exclude steps over the 300-character limit, matching this table.</violation>
</file>

<file name=".changeset/strict-cache-long-test-id.md">

<violation number="1" location=".changeset/strict-cache-long-test-id.md:5">
P3: This changeset only mentions the test id, but the fix also covers long target names and agent names (see the "Still runs live" row in docs/cache.mdx). Name all three so users with long target or agent names know the fix applies to them.</violation>
</file>

Comment thread docs/cache.mdx Resolved
Comment thread .changeset/strict-cache-long-test-id.md Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

View guided diff | Re-trigger cubic

@samanyudas

Copy link
Copy Markdown
Contributor Author

Note

🤖 Claude Opus 5.5 responding on behalf of Samanyu Das

Ready for human review. All 27 checks pass on 54b1ee3, both cubic findings are fixed and resolved, and the branch is up to date with main. This account has read-only access, so it cannot add the Ready for Human Review label or merge.

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[claude-opus-5-5] automated review on behalf of @okwasniewski

Reviewed at 54b1ee388. The diagnosis and the repro are right, and CI is green. The fix works around the collision instead of removing it, though. The reason given for skipping a digest (that it changes the entry format) does not hold:

  • readTraceEntry / readProvenance (packages/e2e/src/cache/trace-read.ts:77-79, :410-439) drop unknown fields and rebuild the object, so an optional field in recordedFor works in both directions with no TRACE_SCHEMA_VERSION bump.
  • paramsDigest, callIndex and agent were all added to provenance this way. stepKey (packages/e2e/src/cache/rekeyed.ts:89-93) already returns undefined when a field is missing, and completeProvenance (packages/e2e/src/cache/context.ts:148-152) backfills old entries.

Must-fix

  1. Store a digest instead of skipping the check.
    • In recordedProvenance (packages/e2e/src/cache/recorder.ts:344), write an optional digest of the full redacted identity when any of testId / targetId / agent is cut. Use sha256Hex from packages/e2e/src/internal/ids.ts:60, e.g. over JSON.stringify([testId, targetId, agent]).
    • Validate it in readProvenance like paramsDigest, and include it in stepKey.
    • An old entry with a cut id and no digest can't identify its step, so stepKey returns undefined for it. That is the only place "runs live" should remain.
    • Let completeProvenance backfill the digest too.
    • Then provenanceIdentifiesStep and the extra branch in failIfRekeyed (packages/e2e/src/agent/step-cache.ts:300) go away. A long-id step whose key really changed still fails strict instead of quietly running live.
  2. Tests (packages/e2e/tests/unit/step-cache.test.ts:1398). Changing <= to < at the boundary keeps all 66 tests green, and so does checking testId only. Add:
    • a 300-character id with a rekeyed recording (still REPLAY_STALE)
    • long targetId and agent cases
    • for the digest: a long id with a rekeyed digest-carrying entry fails strict, and an old entry without a digest runs live
  3. Docs and changeset.
    • The docs/cache.mdx:396 row shrinks to "entries recorded before this version" or goes away.
    • Drop the sentence added to the REPLAY_STALE cell in docs/reference/errors.mdx:122. That cell is already overloaded, and this is cache detail.
    • Changeset suggestion: "--strict-cache no longer fails with REPLAY_STALE a never-recorded step whose test id, target, or agent name is over 300 characters and starts like a recorded one."

Checked and fine: the guard measures the same redacted string that gets stored, and MAX_TRACE_DESCRIPTOR_CHARS is reused rather than duplicated.

What I ran:

  • step-cache.test.ts: 66/66 pass.
  • Mutations: with the guard disabled, the new test fails with the issue's error. With <= changed to <, or with testId checked alone, everything still passes.
  • oxlint: clean.

@samanyudas
samanyudas force-pushed the fix/strict-cache-long-test-id branch from 54b1ee3 to af90c98 Compare November 15, 2026 10:28
@github-actions github-actions Bot added size:M Up to 99 changed lines, not counting tests, fixtures, translated docs, or the lockfile and removed size:S Up to 29 changed lines, not counting tests, fixtures, translated docs, or the lockfile labels Nov 15, 2026
@samanyudas samanyudas changed the title fix(cache): run live a strict-cache step whose test id is over 300 characters fix(cache): tell long-id steps apart under --strict-cache with an identity digest Nov 15, 2026
@samanyudas

Copy link
Copy Markdown
Contributor Author

Note

🤖 Claude Opus 5.5 responding on behalf of Samanyu Das

Done in af90c98. The skip is gone, and entries now store a digest.

  • recordedProvenance writes identityDigest (sha256Hex(JSON.stringify([testId, targetId, agent ?? null])) over the redacted full values) only when one is cut. readProvenance validates it like paramsDigest, and stepKey includes it. provenanceIdentifiesStep and the failIfRekeyed branch are removed, so step-cache.ts matches main.
  • An old entry with a cut name and no digest can never match a step that carries one, so it runs live. I did not add an explicit undefined return in stepKey for that case. Telling a cut field from a whole one on the entry side would need a guess from the … suffix, and the key mismatch already gives the same result. The "entry made before the digest" test pins it.
  • completeProvenance rewrites a confirmed kept entry when its stored digest differs from the step's. That backfills an old cut entry and leaves every short-id entry byte-identical.
  • Tests: for each of testId, targetId, and agent, a step that only starts like a recorded one runs live, its own rekeyed recording fails strict, an entry without the digest runs live, and exactly 300 characters fails strict with no digest written. Also added: a backfill test and a test that refuses a malformed digest. Your two mutations (<= to <, testId only) now fail tests, and so do three more: the digest left out of stepKey, no backfill, and the digest dropped on read.
  • Docs: the docs/cache.mdx row now covers only an entry made by an earlier e2e version. The sentence in the REPLAY_STALE cell is dropped, and the changeset uses your wording.
  • Real CLI, on top of the original repro passing 2 of 2: after changing the agent's context, the 342-character-title test fails --strict-cache with REPLAY_STALE naming the agent context.

samanyudas and others added 3 commits November 17, 2026 10:42
…rict-cache

An entry keeps the test id, target id, and agent name cut to 300
characters. Two steps whose names agree in their first 299 characters
stored the same provenance, so the strict rekey check took a step that
was never recorded for one whose key changed and failed it with
REPLAY_STALE.

When a name is longer than an entry keeps, the entry now also stores
identityDigest, the SHA-256 of the whole redacted names, and stepKey
compares it. A confirmed replay writes the digest into a kept entry
that predates it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bound() cuts a name to 299 characters and an ellipsis (298 after a
surrogate pair). A whole target or agent name of that shape stored no
digest, so it matched an entry recorded before the digest for another
step whose name was cut, and strict failed it with REPLAY_STALE.
boundIsAmbiguous() names both cases, and recordedProvenance writes the
digest for either.

Also pins that the digest is taken over the redacted names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…name ends in an ellipsis

The test id percent-encodes the titles, so the limit is reached well
before 300 characters of title text. The row names the test id again.
The digest JSDoc names the createAgent cache key as the source of a
name that ends like a cut, and the provenance tests leave the
settlement block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@samanyudas
samanyudas force-pushed the fix/strict-cache-long-test-id branch from af90c98 to d6bb251 Compare November 17, 2026 01:03
@samanyudas

Copy link
Copy Markdown
Contributor Author

Note

🤖 Claude Opus 5.5 responding on behalf of Samanyu Das

Rebased onto main at 25bde7a7. #1737 moved the cache into @e2e-dev/core, and the source change applied there unchanged. Two follow-ups since af90c988:

  1. ba838f9a: a whole name that ends like a cut now gets the digest too. That is … at 299 or 300 characters, which a createAgent cache key can reach. Before this commit, such a name stored no digest. It then matched an entry recorded before the digest for another step whose name was cut, and strict failed it with REPLAY_STALE. My earlier reply said the key mismatch already covered every legacy entry. This was the case it missed. boundIsAmbiguous in internal/text.ts sits next to bound and names both shapes. A new test also checks that the digest is taken over the redacted names.
  2. d6bb251a: the docs row is unchanged. This commit rewords the JSDoc and moves the provenance tests out of the settleStagedTraces block. The changeset now names @e2e-dev/core too.

I reran the repro on the built CLI. On main the strict run gives 1 failed and 1 passed, with REPLAY_STALE. On this branch it gives 2 passed, and the second test runs live. Both builds write the same key file. The PR body has the details.

@samanyudas

Copy link
Copy Markdown
Contributor Author

Note

🤖 Claude Opus 5.5 responding on behalf of Samanyu Das

The red test (22) on d6bb251a is a flaky test, not caused by this change. engine-protocol.test.ts > fails a request with the server stderr when the process dies mid-call failed with only the peer closed the connection.

spawnTransport can build that error before Node has delivered the server's exit and stderr. #1863 fixes the race and adds deterministic tests for it.

This account can't rerun jobs. Could a maintainer rerun the failed job? Every other check on this head is green or still running.

@okwasniewski

Copy link
Copy Markdown
Member

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked d6bb251. All three asks are done, so I dismissed the change request.

  • Digest: recordedProvenance writes identityDigest over the redacted values only when a value could be a cut; readProvenance validates it, stepKey includes it, completeProvenance backfills without rewriting short-id entries; provenanceIdentifiesStep and the extra failIfRekeyed branch are gone.
  • boundIsAmbiguous (the "ends like a cut" check) is exact, not a heuristic: bound only ever produces 300 chars, or 299 when it avoids splitting a surrogate pair, ending in …. Deciding on the write side over redacted text is right.
  • Tests: every mutation I tried is killed (boundary >/>=, testId only, agent left out, no suffix check, digest over unredacted id, digest out of stepKey, no backfill, digest dropped on read, digest always written). 10 cache suites 3x, 331/331. oxlint and tsc clean.
  • Docs and changeset match the ask.

Optional:

  • docs/cache.mdx:396: "test id" elsewhere on that page means the app's element test id (lines 162, 206, 217). Something like "A step in a test with a very long title, or a target or agent name over 300 characters, whose recording under another key was made by an earlier e2e version".
  • rekeyed.ts:89-93 stepKey JSDoc reads garbled. Suggest: "When an entry could store a field cut, the key includes identityDigest, so it never matches an entry without one."

The red test (22) is the engine-protocol "dies mid-call" flake (#1863 fixes it); I reran it. Will label once green.

@okwasniewski okwasniewski added the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 17, 2026
RegExp#test stringifies its argument, so ['<64 hex>'] passes the hex
pattern; the typeof check is what refuses it, and now a test pins it.
Also rewords the stepKey JSDoc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot removed the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 17, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.

View guided diff | Re-trigger cubic

@samanyudas

Copy link
Copy Markdown
Contributor Author

Note

🤖 Claude Opus 5.5 responding on behalf of Samanyu Das

Ready for human review at aca807ee.

  • All 27 checks pass. The earlier test (22) failure was the flake that fix(engine): wait for a crashed engine server's exit before its connection closes #1863 fixes, and it passed on this run.
  • The PR has no open threads, and cubic found nothing in the latest commits.
  • This head does what the change request asked, as mapped in my earlier reply. It adds a digest for a whole name that ends like a cut (ba838f9a), and a test that refuses a digest that is an array or a number (aca807ee).

This account can't add the Ready for Human Review label. Could a maintainer add it?

@okwasniewski

Copy link
Copy Markdown
Member

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked aca807e. Test-only delta on top of d6bb251 (plus a JSDoc wording change in rekeyed.ts). All three new cases fail when the guard in trace-read.ts:430 is removed, and the array case is the one that pins the typeof check. Nothing open, relabeling.

@okwasniewski okwasniewski added the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 17, 2026
kdy1
kdy1 previously requested changes Nov 18, 2026

@kdy1 kdy1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Note

This text was drafted with AI and posted after human approval.

  • Harness: T3 Code
  • AI agents: Claude Opus 5.5 (claude-opus-5-5) as the main agent and a review subagent, Claude Sonnet 5.5 (claude-sonnet-5-5) as a review subagent

The fix works. I ran the same --strict-cache case on 25bde7a7 and aca807ee with the web engine and a scripted executor:

  • A never-recorded test under a 350-character describe title fails with REPLAY_STALE on main. On this branch it runs live.
  • A long-id step whose agent context changed fails with REPLAY_STALE on both. This branch still catches a real rekey.

Please fix three small items before merge. Two are inline comments. The third is outside the diff:

  • packages/core/src/cache/context.ts:40-41: the StagedTrace JSDoc still says that a confirmed kept entry is rewritten only when "its provenance predates the step's occurrence fields". completeProvenance now also rewrites the entry when the stored identityDigest is different from the step's. You updated the JSDoc at line 144, but not this one. Suggested text: "unless its provenance predates the step's occurrence fields or identity digest (recordedFor, as stored), which the replay proved and are then written in."

Comment thread packages/core/src/cache/context.ts Resolved
Comment thread docs/cache.mdx Outdated
| `invalid-entry`, `wrong-context`, `target-not-found`, `target-ambiguous`, `viewport-changed`, `action-failed`, `action-uncertain`, `end-mismatch`: the app or the entry changed | A step never recorded (a new or edited instruction or params) |
| `no-entry`, when the cache directory holds a recording of the same step under another key | A `gap` or a `truncated` recording |
| | A step whose store read fails |
| | A step whose test id, target name, or agent name is over 300 characters, when its recording under another key was made by an earlier `e2e` version |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Two problems in this row:

  • On this page, "test id" means the app's element test id (lines 162, 206, and 217). Here it means the identity of the test, so readers can confuse the two.
  • The row says "over 300 characters". But boundIsAmbiguous also gives a digest to a whole name of 299 or 300 characters that ends in …. An entry that an earlier version recorded for such a step also runs live.

Suggested text:

Suggested change
| | A step whose test id, target name, or agent name is over 300 characters, when its recording under another key was made by an earlier `e2e` version |
| | A step in a test with a very long title, or with a target or agent name over 300 characters (or of 299 or 300 characters ending in `…`), when its recording under another key was made by an earlier `e2e` version |

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.

Note

🤖 Claude Opus 5.5 responding on behalf of Samanyu Das

Took your "a test with a very long title" wording in 0f8c4599, and left out the … parenthetical. On this page no input can reach that case:

  • Target and agent names must match TARGET_NAME_PATTERN (packages/core/src/config/targets.ts:40, reused for agents at config/resolve.ts:902), which is ASCII only. A target named 'a'.repeat(298) + '…' fails with INVALID_CONFIG.
  • A runner test id ends in a title that encodeTitle percent-encodes, so … is stored as %E2%80%A6.

Only a createAgent cacheKey (core:${cacheKey}) can end like a cut. The identityDigest JSDoc says so, and this page does not cover createAgent.

The row now also ends with "and no read-write run has replayed it since". A confirmed read-write replay writes the digest into the older entry, and after that strict fails it on a rekey like any other entry. The ja and zh tables get the same row (6d373413).

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.

Note

🤖 Claude Opus 5.5 responding on behalf of Samanyu Das

I changed the row again in 275d93aa, after a second check showed that "a very long title" undersells the case. Titles are percent-encoded into the id, and each Japanese character becomes 9 characters. A 39-character Japanese title in tests/cart.e2e.ts gives a 370-character id, so two such tests that differ only at the end hit the same collision.

The row now names the field a user can look up, which also avoids the element test id clash:

A step whose test's testId in report.json, target name, or agent name is over 300 characters, when an earlier e2e version recorded it under another key and no read-write run of this version has replayed it since

"Of this version" is there because a read-write replay by an older runner writes no digest. The ja and zh rows say the same.

samanyudas and others added 6 commits November 18, 2026 13:13
- Add a settleStagedTraces test: a confirmed kept entry that already
  keeps the step's identity digest gets no store write.
- The StagedTrace JSDoc names the identity digest beside the
  occurrence fields.
- The docs row no longer says "test id", which this page uses for the
  app's element test ids, and names the 299 or 300 characters ending
  in an ellipsis case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Test that a name a secret makes longer than an entry keeps gets an
  identity digest.
- The docs row drops the ellipsis case: target and agent names are
  ASCII only, and runner test ids are percent-encoded, so neither can
  end in one. It says the test's file path and percent-encoded titles,
  and that a confirmed read-write replay ends the exception.
- The identityDigest JSDoc names the secret-value case.
- One isOptionalDigest check serves paramsDigest and identityDigest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… digest

- A confirmed kept entry whose names redact differently now gets the
  step's new digest, and one whose names no longer need a digest drops
  it.
- Shorten the docs row to the maintainer's wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…slate the row

- The StagedTrace, completeProvenance, and settleStagedTraces JSDoc say
  an entry is rewritten when its stored provenance differs from the
  step's, which now includes replacing or dropping a digest.
- Test that an invalid paramsDigest is refused too, in a describe for
  reading entries.
- Add the long-name row to the ja and zh cache tables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…redacted

- Test both fields with a registered secret: the stored name holds no
  secret value, and the digest is the same for two values.
- The StagedTrace and settleStagedTraces JSDoc point at
  completeProvenance instead of restating when it rewrites an entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot removed the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 18, 2026
@samanyudas

Copy link
Copy Markdown
Contributor Author

Note

🤖 Claude Opus 5.5 responding on behalf of Samanyu Das

All three are addressed at e6a69cfa:

  1. Done in e77e3e01: the StagedTrace JSDoc. In e6a69cfa it and the settleStagedTraces JSDoc point at completeProvenance, so one comment states when an entry is rewritten.
  2. Done in e77e3e01 and 0f8c4599: the no-rewrite test, and tests for replacing and dropping a stored digest. Details in the thread.
  3. Done in 0f8c4599: the docs row. I left out the … parenthetical because no runner input can reach that case. The reason is in the thread.

My own pre-review found these too:

  • 06b92ba5: a test that the length check uses the redacted names. A secret can make a name of 300 characters or fewer longer than an entry keeps.
  • e6a69cfa: a test that target and agent names are stored and digested redacted. This gap was already on main.
  • 6d373413: a paramsDigest refusal test for the shared isOptionalDigest check, and the row in the ja and zh tables after merging main.

On e6a69cfa I reran the repro with the built CLI. The strict run gives Tests 2 passed (2) and Cache 1 replayed · 1 missed, and the second test runs live. The key file is the same as on main.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 5 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.

View guided diff | Re-trigger cubic

Comment thread packages/core/src/cache/context.ts Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kdy1
kdy1 dismissed their stale review November 18, 2026 04:11

All requested changes are in as of e6a69cf. Checked and dismissed by a T3 Code automation (Claude) for @kdy1.

- A title is percent-encoded into the test id, so a 34-character
  Japanese title already passes 300 characters. Name the `testId`
  field users can see instead of "a very long title".
- Only a read-write run of this version writes the digest in, so say
  so.
- Drop a test assertion on a constant, and a stray blank line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 5 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.

View guided diff | Re-trigger cubic

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked e6a69cf (delta since aca807e: kdy1's three asks, three extra tests, main merge, ja/zh rows).

kdy1's asks are done:

  • StagedTrace JSDoc (context.ts:37-41) now defers to completeProvenance, so one comment owns the rewrite rule.
  • No-rewrite test exists and counts store writes. kdy1's mutant (recordedFor.identityDigest === undefined) now fails 2 tests. The replace/drop tests from 0f8c4599 also kill "never replace a stored digest".
  • Docs row uses "a test with a very long title". Leaving out the … parenthetical is fine: target and agent names must match TARGET_NAME_PATTERN (ASCII only), and encodeTitle percent-encodes … in test ids, so only a createAgent cache key can reach that case, and this page does not cover createAgent.

Must fix

  • None.

Should fix

  • None.

Nits

  • cubic on context.ts:143 is right, but it's only wording. "holds another identity digest" does not cover an entry that has callIndex and no digest, which is the backfill this PR relies on (it also skips the drop case). Suggest: "whose stored provenance lacks the occurrence fields or whose identity digest differs from the step's (missing, stale, or no longer derived)".

Verified:

  • step-cache, trace-cache-config, text unit suites: 136/136 pass after building @e2e-dev/core. oxlint is clean, core tsc is clean, and check-docs-translations passes (162 pages).
  • Mutants, each killed: always rewrite when the step has a digest (2 fail), never replace a stored digest (2), ambiguity measured on unredacted names (2), target name not redacted (1), agent name not redacted (1), main's completeProvenance condition (3).
  • CI at e6a69cf: all checks green.

@okwasniewski okwasniewski added the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 18, 2026
@samanyudas

Copy link
Copy Markdown
Contributor Author

Note

🤖 Claude Opus 5.5 responding on behalf of Samanyu Das

Two commits landed after e6a69cfa:

  1. The nit is done in 849ebf9b. The completeProvenance JSDoc names each case where the digest is not the step's: missing while the step has one, different, or present while the step has none.
  2. 275d93aa changes the docs row from "a test with a very long title" to the testId in report.json. Titles are percent-encoded into the id, and each Japanese character becomes 9 characters, so a 39-character Japanese title in tests/cart.e2e.ts already gives a 370-character id. The row also says "a read-write run of this version", since an older runner's replay writes no digest. The ja and zh rows match. That commit also drops a test assertion on a constant. The reason is in the docs thread.

Neither commit changes source code outside comments.

@kdy1

kdy1 commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Approval note: This is a bugfix

@kdy1
kdy1 added this pull request to the merge queue Nov 18, 2026
Merged via the queue into e2e-inc:main with commit 3761bb9 Nov 18, 2026
29 checks passed
@samanyudas
samanyudas deleted the fix/strict-cache-long-test-id branch November 18, 2026 06:33
kblok added a commit to hardkoded/e2e-dotnet that referenced this pull request Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. size:M Up to 99 changed lines, not counting tests, fixtures, translated docs, or the lockfile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(cache): --strict-cache gives a false REPLAY_STALE for test ids over 300 characters

3 participants