Repository navigation
demoStaff spells the legal head and finance controller names as literals that keys.ts mirrors; a rename silently drops seeded reviews - #192
Merged
Conversation
…from keys.ts demoStaff spelled 'Head of Legal' and 'Finance Controller' as literals while src/data/keys.ts mirrored them as LEGAL_HEAD / FINANCE_CONTROLLER for reviewerOf(). clm_review.reviewer is required, so renaming one side dropped every review dealt to that account and the seed still reported success. Both entries now take their name from the same constant the fixture deals by, as the requesters and counsel already do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017nzWFRUo2U7evMkPdVniAn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017nzWFRUo2U7evMkPdVniAn
Contributor
Author
席位核对 — ACCEPT · head
|
| check | reading |
|---|---|
| shape | draft → main, Fixes #191; mergeable clean |
| CI on the head | both Validate check-runs success on b8b4342 = PR head.sha |
| scope | 2 files. objectstack.config.ts takes the legal head's and the finance controller's demoStaff names from src/data/keys.ts (as it already does for CONTRACT_OWNERS / LEGAL_OWNERS), and its comment lists every account the fixture deals to by name. The seat added one comment-only commit (b8b4342, seat call A on the dev's open question): the keys.ts JSDoc no longer claims the config spells them as literals. The resolved strings are unchanged. Nothing governed |
| reverse check | with both constants renamed in keys.ts, this branch's config follows (60 reviews, 0 dealt to an undeclared account), while main's config leaves 24 reviews naming accounts nobody carries. Restored to HEAD, with the blob hashes matching |
| live | before and after are identical: 60 reviews, 0 naming the Dev Admin, and the same per-account deal. legal.head@ and finance@ sign in (zh-CN) and see their own reviews |
Landing: under the maintainer's merge authorization (project thread: 「你可以自己审核的就自己合并」).
Generated by Claude Code
zhuangjianguo
marked this pull request as ready for review
October 27, 2026 13:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #191
Clause-②: no
Metadata-protocol: none
demoStaffinobjectstack.config.tsspelled the Head of Legal and the Finance Controller as literals, whilesrc/data/keys.tscopied the same strings asLEGAL_HEADandFINANCE_CONTROLLERforreviewerOf().clm_review.revieweris required, so if one side was renamed, every review dealt to that account would be dropped and the seed would still report success. Both entries now take their name from the keys.ts constants, the same way the requesters (CONTRACT_OWNERS) and the counsel (LEGAL_OWNERS) already do.What changed
One file,
objectstack.config.ts:LEGAL_HEADandFINANCE_CONTROLLERfrom./src/data/keys.js, and the twodemoStaffentries use them asname. Emails and positions are unchanged.demoStaffcomment now lists every account the fixture deals rows to by name (requesters, counsel, head of legal, finance controller) and says whyreviewermakes a drift lose rows instead of landing NULL. The old sentence "The fixture names none of them" stopped being true with Seeded reviews name the Dev Admin as reviewer instead of the legal staff #189, and it now covers only the remaining four positions.The resolved names are byte-identical to before (
Head of Legal,Finance Controller), so the seeded data does not change.Reverse check: rename the keys.ts constant
The fix is committed (
e24c3bf). Then a script with atraprestore did three things: it changedLEGAL_HEADto'General Counsel'andFINANCE_CONTROLLERto'Group Controller'insrc/data/keys.ts(on disk: 1 hit for each new string, 0 for the old ones), compiled the stack withtsc, and loaded it withCLM_DEMO_SEED=1. The two legs were run against the same renamed keys.ts:On main, the rename leaves 24 reviews (8 head of legal + 16 finance) naming an account
demoStaffnever creates, which are the rows the loader would refuse. On this branch both sides move together.Live readings:
pnpm demo:zh, port 3161, @objectstack 18.2.0, throwaway DBBoth runs started from an empty
.objectstack/data. The before run used a detached worktree at origin/main494fb35, and the after run used this branch ate24c3bf. Reviews were read as admin@ withGET /api/v1/data/clm_reviewand resolved againstsys_user.clm_reviewtotalBrowser: Chromium
/opt/pw-browsers/chromium, locale zh-CN. For each persona I filled the/_console/sign-in form with password admin123 and then read data as that persona:POST /api/v1/auth/sign-in/emailreturned 200 and landed on 法务工作台 › 待受理 (clm_contract/view/legal_intake, 6 条记录). The session user isHead of Legalandhtml langiszh-CN. 60 reviews are visible, and 8 name this account (Legal · Head of Legal,Finance · Head of Legal, ...). Before and after are the same.clm_payment_plan/view/all_payment_plans. The session user isFinance Controller. 50 reviews are visible, and 16 name this account (Finance · Finance Controller). Before and after are the same.401 GET /api/v1/auth/get-sessionon the login page, before sign-in.Gates (head
e24c3bf, each exit code captured before any pipe)pnpm install: exit 0pnpm validate: exit 0 (✓ Validation passed)pnpm lint: exit 0 (0 warnings,6 suggestion(s), same as main)pnpm typecheck: exit 0pnpm lint:i18n-gate: exit 0 (COVERAGE : 0 missing keys across 2 locale(s))CLM_DEMO_SEED=1 pnpm validate: exit 0 (✓ Validation passed)Acceptance notes
LEGAL_HEAD/FINANCE_CONTROLLERinsrc/data/keys.tsstill saysobjectstack.config.ts"spells them as literals rather than from here". After this PR that sentence is false. The claim's file surface allows keys.ts only for a missing export, so I did not touch it. The report proposes the replacement text for the seat.🤖 Generated with Claude Code
https://claude.ai/code/session_017nzWFRUo2U7evMkPdVniAn