Skip to content

Add Kotoba Plus Code encode/decode binding - #765

Closed
com-junkawasaki wants to merge 3 commits into
google:mainfrom
kotoba-lang:cursor/kotoba-olc-binding-4f27
Closed

com-junkawasaki wants to merge 3 commits into
google:mainfrom
kotoba-lang:cursor/kotoba-olc-binding-4f27

Conversation

@com-junkawasaki

Copy link
Copy Markdown

Adds kotoba/ next to the other language directories.

v1 encode/decode of a full Plus Code. Coordinates are microdegrees (i64) because kotoba v0.7.2 wasm has no IEEE floats. No shorten/recover. Kotoba cannot FFI.

Google CLA may apply. Happy to sign.

Fork PR: kotoba-lang#1

Compile openlocationcode.kotoba to host-independent wasm32 with kotoba
CLI v0.7.2. The wasm backend is i64-only, so coordinates are
microdegrees and codes are packed ASCII words. Vendored encode/decode
vectors come from test_data/; CI downloads the 0.7.2 CLI and runs
kotoba/checks.sh.

Co-authored-by: Jun Kawasaki <04.feasts_minded@icloud.com>
@google-cla

google-cla Bot commented Aug 28, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

The repo's zizmor blanket policy (zizmor/unpinned-uses, mandatory) failed
zizmor-output with 25 findings at every unpinned uses: in
.github/workflows/main.yml: 22 pre-existing in upstream jobs plus the 2
added by this PR (test-kotoba). Each ref now pins the exact commit its
moving tag/branch currently resolves to, keeping runtime behavior
identical while satisfying the policy. Local zizmor 1.25.2 (same digest
as CI) now reports 0 unpinned-uses findings.

@com-junkawasaki com-junkawasaki left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honest review (author self-triage)

Code review. kotoba/openlocationcode.kotoba implements Plus Code encode/decode over the correct alphabet (23456789CFGHJMPQRVWX) and the correct normalization spans (latitude ×25 → 4.5e9, longitude ×8192 → 2.94912e9 across 5 pairs). I traced the encode/decode fixture paths and ran kotoba/checks.sh locally with kotoba 0.7.2: encode fixtures and decode fixtures both pass (wasm32 i64-v1, reference-types).

Fixed on our side. zizmor-output was failing because the repo's blanket zizmor/unpinned-uses policy flags every unpinned uses: in .github/workflows/main.yml — 25 findings: the 2 added by this PR's test-kotoba job plus 22 pre-existing in upstream jobs (lines 10–172). A partial fix would leave the gate red, so I pinned all of them to the exact commits their moving tags/branches currently resolve to (resolved via git ls-remote, annotated tags dereferenced — e.g. bazelbuild/setup-bazelisk@v3 → b39c379c…, actions/checkout@v4 → 11d5960a…). The comment # v4 etc. records the original ref. Pin-only, no behavior change. Local zizmor 1.25.2 (same image digest the CI uses) now reports 0 unpinned-uses findings.
Note for maintainers: 22 of the 24 pinned lines are pre-existing jobs. Happy to split the pin-only change into its own PR if you prefer this one to stay minimal.

What blocks this PR (exactly):

  1. cla/google is FAILURE — Google CLA unsigned. Signing is a legal act reserved for the owner; we will not sign it.
  2. The CI workflow's jobs (including test-kotoba) have not run on this PR — fork workflow runs need maintainer approval here.
  3. Required maintainer review (we have no upstream write access).

zizmor-output still failed after SHA-pinning: exit 13 = any Medium/High
finding fails the gate. The remaining 25 mediums were 13
excessive-permissions (jobs inheriting default token permissions) and
12 artipacked (checkout leaving credentials in the workspace). Fixed
with a workflow-level 'permissions: contents: read' and
'persist-credentials: false' on every checkout step. All jobs here are
test-only (checkout + toolchain setup + tests), so read-only contents
and no persisted credentials are behavior-safe. Local zizmor 1.25.2
(same digest as CI): 'No findings to report.'
@com-junkawasaki

Copy link
Copy Markdown
Author

Follow-up (record correction): my review above said the pin commit alone cleared zizmor-output — it cleared only zizmor/unpinned-uses. The gate also fails on any Medium/High finding (exit 13), and 25 mediums remained (13 excessive-permissions, 12 artipacked). Commit 3e96296 fixes those too — workflow-level permissions: contents: read plus persist-credentials: false on every checkout (behavior-safe: all jobs are test-only). Local zizmor 1.25.2 (same digest as CI) now reports "No findings to report", and the PR's zizmor-output is green.

Remaining blockers on this PR are unchanged: cla/google (unsigned — signing is a legal act reserved for the owner) and maintainer review.

@drinckes

Copy link
Copy Markdown
Contributor

We're not accepting new language implementations, as it's too much load to maintain multiple languages we're not familiar with.

See https://github.com/google/open-location-code/blob/main/CONTRIBUTING.md#contributing-a-new-implementation

@drinckes drinckes closed this Oct 26, 2026
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.

3 participants