Skip to content

Take the name pool and the rule matrix from @gryt/core - #375

Merged
sivert-io merged 1 commit into
mainfrom
claude/core-tranche-2
Sep 3, 2026
Merged

Take the name pool and the rule matrix from @gryt/core#375
sivert-io merged 1 commit into
mainfrom
claude/core-tranche-2

Conversation

@sivert-io

Copy link
Copy Markdown
Member

Second tranche, against
@gryt/core@0.2.0. 83 lines out.
The phone side is Gryt-chat/mobile with the same package.

The name pool

This file asked for it:

This is a copy of the mobile app's src/profile/randomName.ts. … Change
one, change the other. GRYT-847.

The 152 words were byte-identical either side — I checked before moving — so
nothing anybody gets called changes. common/index.ts re-exports from the
package so consumers reaching it through @/common don't move.

The rule matrix, where the two had drifted

channelPermissionRules.ts becomes a re-export. Its implementation keyed a cell
by role and permission joined with a NUL; the phone used a space. Both
internally consistent, neither broken today, and only one of the two safe from a
value containing the separator. The package keeps the NUL.

Worth a look: this file held two literal NUL bytes, which is why git had
been treating a permissions file as binary and showing no diff for it. The
package writes the same separator as a \u0000 escape, so it's text again — and
this PR's diff for it is readable, which the last few changes to it were not.

Something I got wrong, and should fix next

Moving the whole file swept five exports into the package that only this app
uses
: CUSTOM_VALUE, EVERYONE_VALUE, scopeChoiceFromValue,
scopeChoiceValue, scopeOptions. They're <select> adapters — web-shaped, and
they fail the package's own test of "would both apps need a copy".

They're pure and harmless, so I'm not churning a release for it, but they should
come back here in tranche 3. Flagging rather than leaving the package to quietly
become a dumping ground.

Checks

tsc -b clean. Verified first against a packed tarball, then against the
published package — the lockfile resolves shasum edf6dfe3…, the same artifact.

Both were copies of the phone's, and one of them had drifted without anybody
noticing.

randomName.ts is gone. Its own header said "This is a copy of the mobile app's
src/profile/randomName.ts ... Change one, change the other. GRYT-847." The 152
words were byte-identical either side, so nothing anybody gets called changes.
common/index.ts re-exports from the package, so the consumers that reach it
through `@/common` do not move.

channelPermissionRules.ts becomes a re-export. The implementation it held keyed
a cell by role and permission joined with a NUL, where the phone used a space —
both consistent, neither broken, and only one of the two safe from a value
containing the separator. The package keeps the NUL.

That file also held two literal NUL bytes, which is why git had been treating a
permissions file as binary and showing no diffs for it. The package writes the
same separator as a `\u0000` escape, and this file is text again.

Needs @gryt/core 0.2.0. Verified against a packed tarball of it before release.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sivert-io
sivert-io merged commit 6f6fa5b into main Sep 3, 2026
2 of 3 checks passed
sivert-io added a commit that referenced this pull request Sep 4, 2026
`client:main` has been failing CI since #375. `yarn lint` is the job, and it
fails on two `simple-import-sort/exports` errors: `common/index.ts:65` and
`settings/src/channelPermissionRules.ts:13`.

Both are the autofix. No behaviour, no reordering of anything that runs — the
rule sorts the names inside an export list and nothing reads them in order.

Kept separate from the GRYT-406 work that found it, because a red main blocks
every other branch and should not wait behind a feature.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant