Skip to content

test(flows): name the lead_assignment SLA test for what it asserts, drop the inert crm_task walk - #1787

Merged
huangyiirene merged 2 commits into
mainfrom
claude/issue-1775-sla-test-names-what-it-pins
Sep 8, 2026
Merged

huangyiirene merged 2 commits into
mainfrom
claude/issue-1775-sla-test-names-what-it-pins

Conversation

@huangyiirene

Copy link
Copy Markdown
Collaborator

Fixes #1775

Ruled by the director seat, decision batch #91 (comment 5583975407), option A: lead_assignment was never meant to create a task, so the test title is what is wrong. Test-only, Clause-②: no, nothing under src/.

What changed

test/flow-record-change.test.ts — a rename and a deletion, nothing else:

  1. Deleted the walk over h.store.crm_task in the lead_assignment SLA test, together with the block comment that existed only to explain it.
  2. Renamed sends every SLA task to the lead owner, never a dot-walked manager to renders both SLA branch alerts with no field left as the literal "undefined".

Plus .changeset/sla-alert-test-names-what-it-pins.md. The flow file is untouched — option B (a create_record node) was refused as capability expansion decided by a test title.

The card's premise, re-measured on this branch

The card was written against 5b2ecdd; this branch is based on 9371173, so everything was re-located rather than inherited. The test is at test/flow-record-change.test.ts:271.

The walk really was inert. Its assertion was inverted so that any row it inspected would fail it:

-  expect(String(t.owner_id), `rating ${rating} task has a phantom owner`).not.toBe('undefined');
+  expect(String(t.owner_id), `rating ${rating} task ABLATION`).toBe('__ABLATION_MUST_FAIL__');

On-disk proof 086a5072 -> 63c9f21c, then Tests 1 passed | 43 skipped (44), VERDICT command-exit 0. It inspects zero rows, on both ratings. Restored to 086a5072, git diff HEAD empty.

What survives is live. The same ablation applied to the surviving notification walk (.not.toContain('undefined') becomes .toContain('__LIVENESS_ABLATION__'), blob f69c68c3 -> 82606b01) goes red: Tests 1 failed | 43 passed (44), naming the renamed test. So that walk inspects a real row — one per rating — and its payload is {"to":["rep1"],…}, the lead owner. Restored, blob back to f69c68c3, git diff HEAD empty.

Deviation from the ruling's parenthetical — measured, and worth a maintainer's eye

The ruling asked for the title to name "the next_followup_date stamp and the owner-addressed alert". Measured on this branch, this test pins neither of those two things, so taking that phrase literally would have re-created the defect the card exists to remove. The title states the assertion instead. Every leg below mutated src/flows/lead-assignment.flow.ts temporarily, proved the mutation reached disk by blob hash, ran the file, then restored it and re-proved the blob — the flow file is byte-identical to main in this PR.

Leg Mutation Renamed test What actually reds
stamp next_followup_date renamed on both update_record nodes green lead_assignment stamps the SLA on an integration-written lead — a different test in this file, which seeds a crm_lead row and reads the stamp back
recipient {record.owner_id} becomes {record.owner_id.manager_id} green the two branch tests above it, plus the stamp test — the notify node fails outright and emits nothing, so this test's walk has no row to inspect
recipient {record.owner.manager_id} green same three
recipient {record.manager_id} green same three
template a dot-walk planted in notify_hot's title green nothing — all 44 pass
template a second dot-walked title form green nothing — all 44 pass

Two readings follow. First, the stamp is pinned, but by a different test, so this title must not claim it. Second, on the pinned engine (17.3.0 — read from package.json and the installed @objectstack/spec) an unresolvable recipient no longer silently interpolates to undefined — the node fails loudly and the branch tests catch it — so the dot-walk the old title named is caught, just not here. This test asserts only that no field of the emitted notification renders as the literal string undefined; it does not assert who the recipient is. The new title says exactly that and no more.

Gates

pnpm verify = validate && typecheck && lint && lint:i18n-gate && hygiene && hygiene:tokens && build && test. Exit code captured before any pipe: 0 (VERDICT command-exit 0, held 139s), re-run on the final head 4b7cb757 after the last commit so the reading is not from an older tree.

  • Test Files 164 passed (164) · Tests 3439 passed | 1 skipped (3440)
  • ✓ source hygiene clean · ✓ source token ratchet clean

Counts, before and after, measured from real runs of the changed file:

before after
*.test.ts files in test/ 164 164
tests in test/flow-record-change.test.ts 44 44
expect( sites in that file 77 76

The deleted walk shows up as one fewer assertion site, not as a smaller file or test count — no it, describe or gate was added or removed.

Line budget: NOT APPLICABLE. The ratchet gate names its own surface: Source token ratchet — authored surface: src/**/*.ts minus src/translations, src/data. This PR touches test/ and .changeset/ only, neither of which is inside it; the gate printed ✓ source token ratchet clean.

Changeset

Empty frontmatter — the sanctioned "this PR releases nothing" declaration that .github/workflows/changeset-check.yml documents, on par with the skip-changeset label, and the form the two most recent test-only PRs in this repo used. Nothing under src/ moved, so no object, field, view, label, page, hook or translation string reaches a user; a versioned entry would announce a release that does not exist. A changeset file rather than the label because the file also carries the measurement into CHANGELOG.md-adjacent history and needs no label write to stay green.

验收备注


Generated by Claude Code

…rop the inert crm_task walk

`lead_assignment` authors no `create_record` node, so the walk over
`h.store.crm_task` inside "sends every SLA task to the lead owner, never a
dot-walked manager" inspected zero rows on every input. Measured: with the
walk's assertion inverted so any inspected row would fail it, the test stayed
green; the same ablation on the notification walk reds, so that one is live.

The flow is unchanged. The walk is deleted rather than turned into an assertion
that the app does nothing, and the title now states what the surviving
assertion checks — no field of either branch's alert renders as the literal
string "undefined".

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpRjGNnwyo2J1rrmekxB1W
… the ablation record

The pinned @objectstack packages are 17.3.0 (package.json and the installed
@objectstack/spec both read 17.3.0); the changeset said 17.2.0. Six flow
mutations were run, not five.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpRjGNnwyo2J1rrmekxB1W
@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
hotcrm Ignored Ignored Sep 8, 2026 1:04pm UTC

Request Review

@github-actions github-actions Bot added the ci/cd CI plumbing and the verification pipeline label Sep 8, 2026
@huangyiirene
huangyiirene marked this pull request as ready for review September 8, 2026 13:09
@huangyiirene
huangyiirene added this pull request to the merge queue Sep 8, 2026
Merged via the queue into main with commit 0f0ca04 Sep 8, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd CI plumbing and the verification pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lead_assignment's "SLA" is a date stamp, never a task — decide whether the flow is missing a create_record or the test's name overstates it

2 participants