Skip to content

docs(case-assignment): guard 4's comment names the triage rule, not the flag - #1615

Merged
os-steve merged 1 commit into
mainfrom
claude/issue-1593-guard4-comment-names-the-triage-rule
Sep 6, 2026
Merged

docs(case-assignment): guard 4's comment names the triage rule, not the flag#1615
os-steve merged 1 commit into
mainfrom
claude/issue-1593-guard4-comment-names-the-triage-rule

Conversation

@claude

@claude claude Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Fixes #1593

Comment text only. case_self_claim's guard 4 in src/objects/_case-assignment.ts said it draws "the same line the sharing rule draws with is_closed == false". The triage grant has not drawn that line since #1145case_unassigned_triage_sharing reads record.owner_id == null && record.status != "resolved" && record.status != "closed". The guard itself is correct and is untouched. This is #1327's unfinished second half: the same false "these two are the same rule" claim, in the same file, one screenful below where that card's header fix landed.

Type of Change

Documentation update (source comment). No behaviour change, no metadata change, no test change.

Proof that no executable line changed

Two independent readings, both against the base commit 9924ee1a.

1. The diff, filtered to lines that are not comment text, is empty.

$ git diff -U0 9924ee1a HEAD -- src/objects/_case-assignment.ts \
    | grep -E '^[+-]' | grep -vE '^(\+\+\+|---)' | sed -E 's/^[+-]//' \
    | grep -cvE '^[[:space:]]*//'
0

2. The file's comment-stripped text is byte-identical. Stronger than (1), because it also catches a comment edit that reached into a string literal, which a line-shape filter cannot see. Measured with the repo's own stripComments / authoredText imported from scripts/check-source-token-ratchet.mjs, so this is the gate's own basis rather than a hand-rolled stripper:

authoredText BASE sha256/16 = c89c73bb708d15ba  chars 4666  tokens 1167
authoredText HEAD sha256/16 = c89c73bb708d15ba  chars 4666  tokens 1167
AUTHORED (EXECUTABLE) TEXT IDENTICAL : true
raw bytes differ  (must be true)     : true

Files changed: src/objects/_case-assignment.ts (comment block only) and one added changeset. Nothing under test/ is touched — that surface belongs to epic #1579.

What the correction had to get right

src/sharing/case.sharing.ts holds three conditions, and two of them legitimately draw with is_closed == false:

line condition which rule
:58 record.priority == "critical" && record.is_closed == false case_escalation_sharing — manager, edit
:88 record.priority == "critical" && record.is_closed == false case_director_sharing — director, read
:186 record.owner_id == null && record.status != "resolved" && record.status != "closed" case_unassigned_triage_sharing — the one guard 4 is about

Lines 10 and 70 of that file carry ⚠️ headers ruling :58 and :88 deliberate (2026-08-31, do not align). So the old comment was not wrong that a sharing rule draws with is_closed == false — it was wrong about which one. The new comment names the unowned/triage grant specifically and states in so many words that the other two are neither this rule nor drift, so a reader arriving with "align them" in mind is stopped at both ends rather than redirected onto the ruled pair.

Why it states the asymmetry positively instead of only deleting the false clause

A comment that merely drops an error can rot back to it, because the deletion leaves no reason on the page. The replacement records the reason each line is where it is:

  • guard 4 stops at closed alone, because reopening a resolved case is picking the work up, so whoever does it should become its owner;
  • the triage grant excludes resolved as well, because a resolved unowned case is history, not backlog, and the tab's row count has to keep meaning "work waiting for a human".

It also says why the gap is observable at all — it is live for exactly the callers the sharing rule does not reach (an admin, a manager holding the escalation share), which is why test/unassigned-case-triage-reach.test.ts drives the closed guard once per layer, the second time with an actor that can reach the row.

Everything still true in the old comment survives verbatim in substance: status is read first because it is a string on every driver, and is_closed is accepted as true or 1 because SQLite hands booleans back as integers. The file's other five is_closed mentions were read and left alone — they explain why the load-balancing counts use $nin over statuses instead of the flag, which is the opposite claim and still true.

No issue numbers were added to the comment block, so this adds no new issue archaeology of the kind #1184 is about.

Changeset

An empty-frontmatter changeset, not the skip-changeset label. .github/workflows/changeset-check.yml documents that form as the sanctioned "this PR releases nothing" declaration, on par with the label, and it counts as an added changeset for the gate. It is preferable to the label here for two reasons: it is added by the PR itself so the gate is satisfied by the diff rather than by a mutable label another workflow could strip, and it leaves the reasoning in the tree. It carries no links, so link-check.yml waking on it has nothing to resolve.

Gates — what each run establishes, and what none of them establishes

pnpm verify's eight steps were run individually in a fresh worktree, exit code captured before any pipe. All green.

step exit what it establishes
validate 0 the metadata graph still parses and resolves
typecheck 0 tsc --noEmit clean — types unmoved
lint 0 objectstack lint still at zero warnings, the state #1596 landed
lint:i18n-gate 0 locale gate clean
hygiene 0 no control bytes, no console.log, no TODO, copyright header present; the file is 26,121 bytes, 25.5% of the 100KB cap and well under the 70% advisory
hygiene:tokens 0 ratchet clean — business semantics ~84,838 of the ruled 100,000
build 0 dist/objectstack.json builds (2039.4 KB)
test 0 160 files, 3392 passed, 1 skipped

Read narrowly:

  • hygiene:tokens is blind to this change by construction. It strips comments before counting, so its green says nothing about the comment. The file's authored-token reading is unchanged at 1,167, which is the proof of blindness, not a pass on the prose. The ceiling was not touched: it is a ruled 100,000 from Re-anchor the business-semantics ratchet to 100,000 and decouple the README banner from the ceiling — banner pins the measured reading, the ceiling stands alone (maintainer ruling 2026-09-05) #1601, and the gate's own opportunistic re-anchor advisory that fires against it is already documented as expected at scripts/check-source-token-ratchet.mjs:205-211.
  • test green establishes that the predicates were not movedtest/live-work-predicate-parity.test.ts still pins the triage grant's status predicate by name and test/unassigned-case-triage-reach.test.ts still drives both layers — not that the prose describing them is accurate.
  • ⚠️ No gate in this repo reads a comment. None of the eight rows above is evidence that the new sentence is true. Its correctness rests on the source lines quoted in the table further up: src/sharing/case.sharing.ts:58, :88, :186, and the ⚠️ headers at that file's lines 10 and 70. Those are what a reviewer should check.

Scope

Base main, draft. Assignee untouched, no second claim comment posted. One card, one file plus its changeset.


Generated by Claude Code

…he flag

`case_self_claim`'s guard 4 said it draws "the same line the sharing rule
draws with `is_closed == false`". The triage grant has not drawn that line
since #1145: `case_unassigned_triage_sharing` is
`record.owner_id == null && record.status != "resolved" && record.status != "closed"`.

Comment text only — the comment-stripped text of the file is byte-identical
before and after. Neither predicate is touched: guard 4 stopping at `closed`
alone and the grant excluding `resolved` too are both correct and deliberate,
and the comment now states that asymmetry positively instead of asserting
sameness, so it cannot rot back to the false claim.

It also disambiguates the hazard: two of the three conditions in
`src/sharing/case.sharing.ts` legitimately draw with `is_closed == false` —
the manager and director grants on critical-priority cases, ruled deliberate
under their own headers. The comment names the unowned/triage grant
specifically and says those two are neither this rule nor drift.

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

vercel Bot commented Sep 6, 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 6, 2026 12:11am UTC

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

metadata Declarative metadata — schema, security posture, UI surfaces

Projects

None yet

2 participants