Repository navigation
Conversation
…ials The translations workflow no longer reads ANTHROPIC_API_KEY. It exchanges its GitHub OIDC token for one-hour AWS credentials of the role in vars.LOOM_I18N_AWS_ROLE_ARN and hands them to the Translate step only. translate.py signs each Messages API request to bedrock-mantle with SigV4 and refuses credentials without a session token. While no role is set the job writes a step-summary line and succeeds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…is signed again Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…t; model-policy note Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…hide secrets in repr Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…r test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…es go on the repository Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
This branch has not been deployed
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.
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
...
Why
The translations workflow needed the repository secret
ANTHROPIC_API_KEY. The secret was never added, so every run on main failed with "ANTHROPIC_API_KEY is not set" and no page was translated. A stored API key is also a long-lived credential in a job that can push branches. Translations now authenticate with no stored secret: the job trades its GitHub OIDC token for one-hour AWS credentials and calls Claude on Amazon Bedrock.scripts/i18n/translate.pysends the same Messages API request to Bedrock'sbedrock-mantleendpoint (https://bedrock-mantle.<region>.api.aws/anthropic/v1/messages, modelanthropic.claude-sonnet-5-5). Each request is signed with AWS Signature Version 4 using only the standard library. The script refuses credentials that have no session token, so a long-lived access key cannot be used. TheANTHROPIC_API_KEYpath is removed. The USD cap, the verifier and the retry rules are unchanged. The stamp still recordsclaude-sonnet-5-5, so no page goes stale because of this change..github/workflows/i18n.ymlruns its job in the environmenti18n, getsid-token: writeand runsaws-actions/configure-aws-credentials(pinned by sha, v6.3.0) withrole-to-assume: vars.LOOM_I18N_AWS_ROLE_ARNandaws-region: vars.LOOM_I18N_AWS_REGION. These are repository variables because an ARN is not a credential. The credentials are passed as step outputs into the Translate step only (output-env-credentials: false); the steps that push the branch never see them.LOOM_I18N_AWS_ROLE_ARNis empty, the job is skipped by itsif:, so pushes to main no longer leave a red run. The skip is on the job rather than a step so that the job does not enter the environmenti18n. A job that enters it records a deployment, and that would create the environment without its deployment-branch rule.CONTRIBUTING.md#translationsgives the IAM role's trust policy (OIDC providertoken.actions.githubusercontent.com, audiencests.amazonaws.com, subrepo:ClickHouse/loom:environment:i18n) and its permission policy. Trusting the environment instead ofref:refs/heads/mainkeeps every other job on main that hasid-token: writefrom assuming the role. The environment's deployment branches limit it to main, which covers both a push and a manual run there. It also shows how a contributor runs the script with temporary credentials.Design choices:
bedrock-mantleinstead ofbedrock-runtimeInvokeModel. The Messages API onbedrock-mantletakes the request body the script already builds,output_config.effortincluded. Its IAM action isbedrock-mantle:CreateInference. That action authorizes the account's project rather than a model ARN, so the permission policy limits it to one model with thebedrock-mantle:Modelcondition.2026-10-21. The Claude-on-Bedrock page sendsanthropic-version: 2026-10-21tobedrock-mantlein its example (https://platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock), and the versioning notes say Bedrock accepts it for Claude 4.7 and later. The request uses none of the fields that version removes (temperature,top_p,top_k). The direct Messages API callers elsewhere in the repository keep2023-06-01.anthropic[bedrock]SDK. The script and its unit tests have no third-party dependencies. The SDK client would pull a dependency tree into a job that hascontents: writeand AWS credentials, and each package in it would need a hash pin. The signer is about 40 lines. A unit test pins its output to botocore'sSigV4Authfor the same request.Scope and risk
This touches the translations workflow, its script and tests, and the contributor docs. The server, the SDKs and the dashboard are unchanged. Until the role and variables exist, the workflow does nothing. The first real request will settle two facts that unit tests cannot check: whether Bedrock serves Claude Sonnet 5.5 in the chosen region, and whether the model value matched by the
bedrock-mantle:Modelcondition isanthropic.claude-sonnet-5-5. A wrong value fails the run with a 403 and spends nothing. The cost cap still uses Anthropic's list prices, and Bedrock bills at its own, so the cap is approximate.Compatibility, rollout and rollback
i18nwith deployment branches set tomainonly (Settings → Environments). Create an IAM role in an AWS account where Bedrock has Claude Sonnet 5.5 enabled, with the trust and permission policies inCONTRIBUTING.md#translations. Then set the repository variablesLOOM_I18N_AWS_ROLE_ARNandLOOM_I18N_AWS_REGION. TheANTHROPIC_API_KEYsecret is no longer read.python -m scripts.i18n.translate updatelocally now needs temporary AWS credentials instead of an Anthropic API key.Tests
tests/unit/test_i18n.py: each AWS variable is read into its own field; the request namesanthropic.claude-sonnet-5-5. The SigV4authorizationheader equals botocore'sSigV4Authoutput for the same request, credentials and time. A call posts the signed request to thebedrock-mantleURL, and a retry after a 503 is signed again with its own date.updaterefuses to start when any ofAWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_SESSION_TOKENorAWS_REGIONis missing. The existing update tests run with AWS credentials in the environment.ruff format --check,ruff check,make mypy-gate(0 new errors), and.venv/bin/python -m pytest tests/unit/test_i18n.py tests/unit/test_doc_links.py tests/unit/test_public_copy.py tests/unit/test_agent_instructions.py: all passed. The fulltests/unitsuite passes excepttest_document_extraction.py::test_deeply_nested_hidden_html_parses_in_bounded_time, a wall-clock bound that fails on a loaded shared host and passes in CI. The workflow parses as YAML. The merge push touches neitherREADME.mdnordocs/, so it starts no run. A manual run on main after the merge, with the variable still empty, checks the skip path.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. It checked the endpoint, model id and IAM action against the Claude-on-Bedrock and AWS service authorization pages, and checked the signer against botocore.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed. (Server behaviour is unchanged; the one local unit failure is the wall-clock test named under Tests.)docs/describe the system as it now is, and this description names any operator steps and wire changes.🤖 Generated with Claude Code