Skip to content

test: assert observed results instead of pins - #1509

Closed
ScriptedAlchemy wants to merge 4 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/test-behavior-not-implementation-7532
Closed

ScriptedAlchemy wants to merge 4 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/test-behavior-not-implementation-7532

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

Motivation

Principle: test-behavior-not-implementation.

A constant pin fails when the constant is edited and never observes the mechanism that reads it. An absence-only or toBeTruthy check still passes if the subject returns the wrong non-empty value. A weak is_err passes for the wrong refusal.

Changes

Typed refusals and observed readouts:

  • Sealed format compatibility is true/false for literal revisions, not REVISION == 12.
  • Clone fingerprint constants are not restated; winnow boundaries stay.
  • Sanitizer version is asserted on the receipt. A 1,048,576-byte record is admitted; 1,048,577 bytes is TooLarge.
  • Registry workers definition reports schema_revision == 7. Exact workers: 0 is the typed NonCanonical refusal; workers: 2 is Ok(()).
  • Identity, handoff, source-edit, CI localization, proximity, topology, query inventory, and cancellation constructors assert the typed error and a concrete accepted value.
  • Dashboard text that users see is asserted as that string, not toBeTruthy. Node count is 12.9K (figure plus unit), not the figure fragment alone.

Publication store:

  • Tip already covers CodeIndexDemandAdmissionV1::NotApplicable and no longer reads a missing reused field on ChangedCodeChunkSetV1.
  • Pointer memo reused on mtime+size alone, so the undecodable-pointer test restored an equal-length pointer and still compared the previous identity. Reuse now requires the file-byte digest.

Test plan

  • Dashboard vitest on the rewritten files: 31 files, 289 passed, then ScopedBrain 12 passed after the 12.9K readout assertion
  • Domain/contracts/global-db/code-index lib tests named in the first assertion pass
  • remote_query_request_enforces_shard_inventory_bounds_and_identity
  • generation_manifest_requires_matching_canonical_language_revisions (digest mismatch, then order / set mismatch after restamp)
  • source_edit_effect_rejects_zero_catalog_revision, source_edit_effect_rejects_zero_privacy_key_epoch, source_edit_effect_requires_the_exact_current_grant
  • publication_store lib tests: 27 passed, including publication_over_an_undecodable_active_generation_refuses_a_moved_pointer
  • Full workspace nextest was not run

Checklist

  • No secrets
  • No changelog: tests plus an internal pointer-read correctness fix
  • Breaking changes: none
Open in Web Open in Cursor 

Replace constant pins, absence-only checks, and weak is_ok/is_err
assertions with calls that match a literal observed result.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9d92dc6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

cursoragent and others added 3 commits September 17, 2026 01:49
Assert typed refusals and the text users see instead of is_err,
is_ok, and toBeTruthy checks that pass for any result.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Pointer memo keyed only on mtime and size, so a same-quantum rewrite
of equal length still compared against the previous pointer. Hash
the bytes before reuse. Align generation and shard refusals with the
error the validator actually returns.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Integrated or superseded directly on the #707 branch at ff36c4f; follow-up compile/typecheck regressions were fixed on that branch.

@ScriptedAlchemy
ScriptedAlchemy deleted the cursor/test-behavior-not-implementation-7532 branch October 11, 2026 00:05
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.

2 participants