Skip to content

feat(i18n): agent-facing text to English; add githana_api endpoint reference - #25

Merged
ProjectNyaser merged 1 commit into
mainfrom
feat/agent-english-and-api-reference
Oct 15, 2026
Merged

ProjectNyaser merged 1 commit into
mainfrom
feat/agent-english-and-api-reference

Conversation

@ProjectNyaser

Copy link
Copy Markdown
Member

Agent-facing surfaces are English now; text only a human reads stays Chinese. Plus a
new githana_api endpoint reference, and one file moved back to where it belongs.

1. Agent-facing text → English

The rule: the reader decides the language, not the directory.

Layer Language Why
Code comments Chinese kept only humans read them
Agent-facing strings: tool description, zod .describe(), every returned message and error English the model reads them
skills/githana/SKILL.md English the shipped manual
lib/routes/**, settings-only implementations, scripts/ build logs, README Chinese kept a person reads them

Measured with a character state machine (string-literal vs comment, so a // inside a string
cannot fool it):

Agent-facing string-literal CJK:  2306 → 0
Chinese comments kept:            4096 lines, unchanged

SKILL.md went 483 → 570 lines, frontmatter untouched.

Two judgement calls worth flagging:

  • scripts/ stays Chinese. Build logs are read by a maintainer. I initially wrote the brief
    the other way and had to correct it after checking the sibling repo (dshana's scripts/ has
    ~1163 CJK lines, with English runtime strings).
  • lib/secret.js is mixed on purpose. Its exception texts are English (they can reach an
    agent), but the one string that renders into the settings page stays Chinese.

2. githana_api endpoint reference (skills/githana/references/)

24 files, one per category, 277 endpoints — only those inside the permission surface,
because an undeclared permission means api gets a 403 there too; listing those would mix
"can do" with "always fails".

Data source is GitHub's official permission-indexed endpoint table
(github/docs, server-to-server-permissions.json), whose stated semantics are "for each
permission granted, these are the endpoints the app can use" — so the filter is a direct
intersection with the granted set, and the OR/AND question does not arise (an endpoint
appearing under several permissions means any one suffices).

DELETE /repos/{owner}/{repo}/git/refs/{ref} (deleting a remote branch) will now be
findable instead of having to be inferred.

Wired as a derive task alongside version / thirdparty, so it cannot drift from the
granted set; CI fetches the table then runs derive --check. The upstream API-version
segment is pinned deliberately — following main would let the whole reference change
with no trigger point.

additional-permissions is handled conservatively: a hit with addl=false suffices on its
own, otherwise every permission listed for that endpoint must be held. The two readings
differ by only 4 endpoints (POST /user/repos, forks, generate — all also needing
administration), and the conservative one keeps them out, which is correct.

3. tools/gpg-keygen.js → lib/gpg-keygen.js

It was not a tool: app.js imports the ten githana-* entries only, and its sole caller is
the settings page. Sitting under tools/ — where the naming contract is tools/<tool>.js —
made it read as a tool entry, and the README already carried a parenthetical to correct the
impression. Its siblings (gpg-publish / oauth / openpgp-key / secret / dpapi) were
already in lib/. Git records it as a rename; the code is byte-identical apart from the
import paths.

Verified on the installed build

Real tool calls (not just the source):

githana_api   → path must start with /
githana_repo  → invalid repo argument format …
githana_pr    → argument validation failed … Fix the arguments along the field paths above
git push      → succeeded / the remote reference was updated

bin/app.mjs no longer contains the old Chinese tool descriptions; references/ ships
(25 files); derive --check is clean across all three tasks.

One known display artefact: the host's already-registered tool table does not refresh on
install, so tool descriptions still read Chinese within the running session — the shipped
artefact is English. A reload or new session picks it up.

Note on how this reached the branch

I pushed this straight to main first, which broke this repo's own convention (feature
branch → PR → review → merge). main has been force-pushed back to bd390ae and the work
now lives only on this branch. Flagging it rather than quietly rewriting.

…ference

Agent-facing surfaces are English now; text only a human reads stays Chinese.

- skills/githana/SKILL.md: whole manual translated (483 → 570 lines), frontmatter untouched
- tools/**: tool descriptions, zod .describe(), every returned message and error
- lib/**: only the strings an agent can reach (oauth / gpg-publish / openpgp-key /
  dpapi / secret's exception texts). Code comments stay Chinese throughout.
- lib/routes/** and the settings-only implementations stay Chinese (their reader is
  the person clicking the button), as do scripts/ build logs and the README

Add the githana_api endpoint reference (skills/githana/references/, 24 files):
one file per category listing every endpoint this App's permission set can reach,
with the supporting permission and read/write level. Generated by a new derive task
from GitHub's official permission-indexed endpoint table, so it cannot drift from
the granted set. The manual's escape-hatch section now points at it.

Move tools/gpg-keygen.js → lib/gpg-keygen.js: it is not a tool (nothing registers
it; app.js imports the ten githana-* entries only) and its sole caller is the
settings page, so sitting under tools/ misread as a tool entry. Its siblings
(gpg-publish / oauth / openpgp-key / secret / dpapi) already live in lib/.

Verified on the installed build: tool errors come back English, the old Chinese
tool descriptions are gone from bin/app.mjs, and references/ ships (25 files).

Co-authored-by: HanaAgent <313794804+HanaAgent@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 149 files, which is 49 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 236aac4c-aaa6-4f1a-9435-a25c5955716a
📥 Commits

Reviewing files that changed from the base of the PR and between bd390ae and 1945f22.

📒 Files selected for processing: 149
  • .github/workflows/ci.yml
  • .gitignore
  • README.md
  • app.js
  • lib/dpapi.js
  • lib/gpg-keygen.js
  • lib/gpg-publish.js
  • lib/oauth.js
  • lib/openpgp-key.js
  • lib/routes/actions.js
  • lib/secret.js
  • package.json
  • scripts/derive/api-reference.mjs
  • scripts/derive/api-source.mjs
  • scripts/derive/fetch-permission-table.mjs
  • scripts/derive/index.mjs
  • skills/githana/SKILL.md
  • skills/githana/references/INDEX.md
  • skills/githana/references/actions.md
  • skills/githana/references/activity.md
  • skills/githana/references/apps.md
  • skills/githana/references/branches.md
  • skills/githana/references/checks.md
  • skills/githana/references/code-scanning.md
  • skills/githana/references/collaborators.md
  • skills/githana/references/commits.md
  • skills/githana/references/dependency-graph.md
  • skills/githana/references/deployments.md
  • skills/githana/references/git.md
  • skills/githana/references/issues.md
  • skills/githana/references/licenses.md
  • skills/githana/references/markdown.md
  • skills/githana/references/metrics.md
  • skills/githana/references/migrations.md
  • skills/githana/references/pulls.md
  • skills/githana/references/reactions.md
  • skills/githana/references/releases.md
  • skills/githana/references/repos.md
  • skills/githana/references/search.md
  • skills/githana/references/secret-scanning.md
  • skills/githana/references/users.md
  • tools/actions/api.js
  • tools/actions/cache/delete.js
  • tools/actions/cache/list.js
  • tools/actions/git/commit.js
  • tools/actions/git/exec.js
  • tools/actions/git/push.js
  • tools/actions/issue/close.js
  • tools/actions/issue/comment.js
  • tools/actions/issue/create.js
  • tools/actions/issue/delete.js
  • tools/actions/issue/develop.js
  • tools/actions/issue/edit.js
  • tools/actions/issue/list.js
  • tools/actions/issue/lock.js
  • tools/actions/issue/pin.js
  • tools/actions/issue/reopen.js
  • tools/actions/issue/status.js
  • tools/actions/issue/transfer.js
  • tools/actions/issue/unlock.js
  • tools/actions/issue/unpin.js
  • tools/actions/issue/view.js
  • tools/actions/label/clone.js
  • tools/actions/label/create.js
  • tools/actions/label/delete.js
  • tools/actions/label/edit.js
  • tools/actions/label/list.js
  • tools/actions/pr/checkout.js
  • tools/actions/pr/checks.js
  • tools/actions/pr/close.js
  • tools/actions/pr/comment.js
  • tools/actions/pr/create.js
  • tools/actions/pr/diff.js
  • tools/actions/pr/edit.js
  • tools/actions/pr/list.js
  • tools/actions/pr/lock.js
  • tools/actions/pr/merge.js
  • tools/actions/pr/ready.js
  • tools/actions/pr/reopen.js
  • tools/actions/pr/revert.js
  • tools/actions/pr/review.js
  • tools/actions/pr/status.js
  • tools/actions/pr/unlock.js
  • tools/actions/pr/update-branch.js
  • tools/actions/pr/view.js
  • tools/actions/release/create.js
  • tools/actions/release/delete-asset.js
  • tools/actions/release/delete.js
  • tools/actions/release/download.js
  • tools/actions/release/edit.js
  • tools/actions/release/list.js
  • tools/actions/release/upload.js
  • tools/actions/release/verify-asset.js
  • tools/actions/release/verify.js
  • tools/actions/release/view.js
  • tools/actions/repo/clone.js
  • tools/actions/repo/create.js
  • tools/actions/repo/fork.js
  • tools/actions/repo/gitignore.js
  • tools/actions/repo/license.js
  • tools/actions/repo/list.js
  • tools/actions/repo/read-dir.js
  • tools/actions/repo/read-file.js
  • tools/actions/repo/sync.js
  • tools/actions/repo/view.js
  • tools/actions/run/cancel.js
  • tools/actions/run/delete.js
  • tools/actions/run/download.js
  • tools/actions/run/list.js
  • tools/actions/run/rerun.js
  • tools/actions/run/view.js
  • tools/actions/run/watch.js
  • tools/actions/workflow/disable.js
  • tools/actions/workflow/enable.js
  • tools/actions/workflow/list.js
  • tools/actions/workflow/run.js
  • tools/actions/workflow/view.js
  • tools/githana-api.js
  • tools/githana-cache.js
  • tools/githana-git.js
  • tools/githana-issue.js
  • tools/githana-label.js
  • tools/githana-pr.js
  • tools/githana-release.js
  • tools/githana-repo.js
  • tools/githana-run.js
  • tools/githana-workflow.js
  • tools/lib/bin.js
  • tools/lib/ci.js
  • tools/lib/exec.js
  • tools/lib/gh.js
  • tools/lib/git-remote-helper.mjs
  • tools/lib/github.js
  • tools/lib/gpg.shim.mjs
  • tools/lib/graphql.js
  • tools/lib/identity.js
  • tools/lib/issue.js
  • tools/lib/params.js
  • tools/lib/pr.js
  • tools/lib/release.js
  • tools/lib/remote-helper-shim.js
  • tools/lib/repo.js
  • tools/lib/rest.js
  • tools/lib/rest.worker.mjs
  • tools/lib/surface.js
  • tools/lib/tasks.js
  • tools/lib/transfer.js
  • tools/lib/verbs.js
  • tools/lib/workflow-toggle.js

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ProjectNyaser
ProjectNyaser merged commit 802c0b2 into main Oct 15, 2026
7 checks passed
@ProjectNyaser
ProjectNyaser deleted the feat/agent-english-and-api-reference branch October 15, 2026 15:15
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