Repository navigation
fix: align test_mapping assertion_type with Gaze's assertion-type set - #28
Conversation
Amends specs/004-test-mapping (spec, data-model, contract, R6 note) and adds OpenSpec change align-assertion-types. The kind set becomes Gaze's equality / error_check / nil_check / diff_check / custom, routed by parity with Gaze's Go-native testify routing; "" and the comparison/membership kinds are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n-types 1.1, 1.2) assertion_type is now exactly Gaze's equality / error_check / nil_check / diff_check / custom, routed by parity with Gaze's Go-native testify routing. toBeNull/toBeUndefined/toBeDefined → nil_check, snapshots → diff_check, ordered/containment/truthiness/type/length matchers → equality, assert.ifError → error_check, mock occurrence/count forms, toSatisfy, assert.fail and unknown matchers → custom. No row carries an empty type, so Gaze's assertion-detection confidence counts every recognized assertion. On this repo: 0 rows outside Gaze's set (was 389), detection confidence 91 → 100. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jflowers
left a comment
There was a problem hiding this comment.
Council Verdict: APPROVE WITH ADVISORIES
Council approved with advisories — unresolved HIGH/CRITICAL findings require human judgment before merge.
Reviewers: divisor-adversary, divisor-architect, divisor-curator, divisor-guard
Iterations: 1
Input: origin/main@c6e64d7ea02b9d2dbe52df913ed0db53400e558a...fix/align-assertion-types@1ea3234
Dispatch Provenance
| Run | Agent | Source | Requested | Resolved parent | Reported |
|---|---|---|---|---|---|
| 614838c5 | divisor-adversary | advisor | Muse-Spark-Open-816B-A42B-NVFP4 | — | Muse-Spark-Open-816B-A42B-NVFP4 |
| d9ae7600 | divisor-architect | advisor | Muse-Spark-Open-816B-A42B-NVFP4 | — | Muse-Spark-Open-816B-A42B-NVFP4 |
| 1c3326b9 | divisor-curator | advisor | Muse-Spark-Open-816B-A42B-NVFP4 | — | Muse-Spark-Open-816B-A42B-NVFP4 |
| 121006d7 | divisor-guard | advisor | Muse-Spark-Open-816B-A42B-NVFP4 | — | Muse-Spark-Open-816B-A42B-NVFP4 |
Divisor Adversary (APPROVE)
No findings.
Divisor Architect (APPROVE WITH ADVISORIES)
- 1 LOW finding omitted (see inline comment).
Divisor Curator (APPROVE)
No findings.
Divisor Guard (APPROVE)
No findings.
This review was generated by /uf.review-council (AI-assisted).
| @@ -133,12 +133,12 @@ As the pipeline, I infer which side-effect type each assertion observes — trac | |||
| **Assertion detection** | |||
|
|
|||
| - **FR-007**: The pipeline MUST collect assertions from each paired test's callback subtree (including nested function expressions within it; hooks and describe-scope statements excluded): (a) `expect(...)` chains on which a matcher method is invoked — one row per matcher invocation — and (b) `node:assert` / `node:assert/strict` calls (`assert(...)`, `assert.ok`, `assert.equal`, `assert.throws`, and siblings), recognized through the file's import/require declarations whose module specifier is exactly `node:assert`, `node:assert/strict`, or `assert` — matched syntactically in both checker and parse-only modes (node:assert admits no in-root re-export, so the specifier table is the complete resolution; the binding forms are pinned in the data model, Section 4.2). An `expect(...)` with no matcher invocation is not an assertion. The complete matcher / assert-form classification table MUST be pinned as normative data in this feature's data model, with every standard vitest/jest matcher and `node:assert` function routed to a kind or explicitly to none. | |||
There was a problem hiding this comment.
[LOW] FR-007 still pins "routed to a kind or explicitly to none" — stale after the closed-set amendment
FR-007 (line 135) requires the classification table to route "every standard vitest/jest matcher and node:assert function ... to a kind or explicitly to none." The closed kind set is now never-empty — Gaze's five values (equality, error_check, nil_check, diff_check, custom), with the total miss path routing to custom — so "explicitly to none" describes the removed empty-string-unclassified semantics and contradicts FR-001, FR-008, and data-model Section 4. The same phrase also appears in the MatcherTable row at line 161. Suggested wording for both: "routed to a kind" (the miss path is total and lands on custom).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dot-force#28) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Aligns
test_mapping'sassertion_typewith Gaze's own vocabulary before v0.2.0 is published. Refs #7.Problem
Spec 004 took its assertion vocabulary from snake-eyes:
equality,comparison,membership,error_check, plus""for 19 standard matchers it left unclassified (toBeUndefined,toBeNull,toBeTruthy,toHaveLength,toHaveBeenCalled, snapshots, …). That vocabulary isn't Gaze's:docs/porting/taxonomy-reference.md§ Assertion Types) and its JSON report schema'sassertion_typeenum (internal/report/schema.go) both list exactlyequality,error_check,nil_check,diff_check,custom. Ourcomparison,membershipand""aren't in that list.AssertionDetectionConfidenceas the share of rows with a non-empty type (internal/adapter/quality.goclassificationConfidence), so every""row lowered it.""; unknown forms becomecustom.Change
Each form now gets the kind Gaze's Go detector assigns to its testify equivalent (
classifyTestifyCall+mapKindToType):equalityGreater/Less),toContain/toMatch/assert.match(Contains/Regexp),toBeTruthy/toBeFalsy/assert.ok/bareassert()(True/False),toHaveLength(Len),toBeInstanceOf/toBeTypeOf(IsType),toHaveProperty,toBeNaNerror_checkassert.ifError(NoError)nil_checktoBeNull,toBeUndefined,toBeDefined(Nil/NotNil)diff_checktoMatchSnapshot,toMatchInlineSnapshot(go-cmpDiff)customtoSatisfy,assert.fail, and any unknown matcherNegation,
.resolves.and.rejects.behave as before. Detection, pairing andside_effect_typeinference are unchanged: inference only branches onerror_check, and no existing test'sside_effect_typechanged.Spec first (e026231): amends
specs/004-test-mapping/in place (spec.md, data-model.md §2–4/§7, contract, and a note on research R6) and adds OpenSpec changealign-assertion-types. The test that comparesmatchers.tsagainst the data-model tables row by row passes on the amended tables.Result on this repo's own tests
"", 43membership, 22comparison)classificationConfidenceGates
npx biome check src/ tests/: passnpm run build: passnpx vitest run --coverage: 1,501 passed; 95.06% statements, 89.86% branches (unchanged)One pre-existing timing risk: on the first coverage run,
pipeline.test.ts› "collects node:assert assertions through the pipeline in both bootstrap modes" took 5.39s against vitest's default 5s timeout and failed. It passed in isolation and on a full rerun. That test's duration is unrelated to this change, but it could make CI flaky.Constitution check
I Protocol Fidelity PASS · II Detection Accuracy PASS · III TypeScript-Native N/A · IV Testability PASS · V Analysis Safety PASS (details in the proposal)
Follow-ups
comparison,membership,identityandgeneric, so it has the same mismatch with Gaze.docs/protocol.mddescribesassertion_typeas an open string, while its taxonomy reference and report schema use the closed five values.Before merge
uf.review-council: all reviewers APPROVE🤖 Generated with Claude Code