Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# kata:gitattributes:base:begin
# Universal LF — yukimemi/* projects are cross-platform (web,
# Universal LF — projects using these templates are cross-platform (web,
# Rust, Go) and never intentionally rely on CRLF, so normalize
# every text file to LF on commit. Binary files are auto-detected
# (`text=auto`), so this is safe for images, PDFs, etc.
Expand Down
124 changes: 124 additions & 0 deletions .github/workflows/apm-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: apm-bump

# Auto-refresh apm.lock.yaml on a weekly cadence.
#
# Why this exists:
# - Before pj-base#?? / pj-rust#??, the renri `[[hooks.post_create]]`
# hook ran `apm install --update` on every `renri add`. That
# rewrites apm.lock.yaml whenever upstream renri (or any other
# apm dep) has moved — which, during active renri development,
# happens often. Developers ended up `jj restore`-ing the lock
# on every worktree create just to keep feature-branch diffs
# clean.
# - Solution split into two parts:
# (a) the renri hook now runs plain `apm install` (no --update),
# which is idempotent against the existing lock — fresh
# worktrees install the recorded skills without touching the
# lock. Lives in pj-base's `renri.toml.base` (this layer)
# and pj-rust's `Makefile.toml` (`tasks.on-add` chain).
# (b) **this workflow** does the upstream-refresh. Weekly cron
# runs `apm install --update`; if the lock changes, it opens
# (or updates) a rolling `apm-bump/auto` PR. Auto-merged
# when CI passes. Same shape as `kata-apply.yml.tera`'s
# Renovate-equivalent for kata-managed files.
#
# Schedule: Mondays 04:00 UTC (~13:00 JST). Weekly is plenty for
# skill drift; tighten via `workflow_dispatch` when needed.
#
# `.tera` suffix: same dual purpose as the other workflow
# templates here — keeps GHA from auto-running the source inside
# pj-base, and opts the file into kata's Tera rendering for the
# `{{ vars.actions.* }}` action-version pins.
#
# Setup requirement on every consumer (one-time):
# `KATA_APPLY_TOKEN` repo secret — classic PAT with `repo` +
# `workflow` scope. PAT-owned PRs trigger downstream workflows
# (the auto-merge gate needs CI to fire); GITHUB_TOKEN-opened
# PRs would skip CI by GitHub design.
#
# `when = "always"` (in template.toml): every consumer wants
# identical refresh behaviour; fixes to the workflow itself flow
# automatically on next apply.

on:
schedule:
# 04:00 UTC weekly Mondays. Off-peak; minute 0 is fine for a
# once-a-week job (no cron-storm worry the way daily jobs have).
- cron: "0 4 * * 1"
workflow_dispatch:

permissions:
# `peter-evans/create-pull-request` needs both: contents to
# write the branch, pull-requests to open/update the PR.
contents: write
pull-requests: write

concurrency:
# Serialise: if a scheduled run and a manual dispatch overlap,
# let them run sequentially so the second sees the first's
# commit (same shape as kata-apply.yml.tera).
group: apm-bump
cancel-in-progress: false

jobs:
bump:
runs-on: ubuntu-latest
steps:
# PAT (KATA_APPLY_TOKEN), same reason kata-apply.yml.tera
# uses it: PRs pushed via GITHUB_TOKEN don't trigger CI,
# which would block the auto-merge gate. PAT-owned identity
# restores the trigger chain.
- uses: actions/checkout@v6.0.2
with:
token: ${{ secrets.KATA_APPLY_TOKEN }}

- name: Install apm
# aka.ms/apm-unix is the Unix one-liner installer published
# by Microsoft/apm. Same source the local-dev docs use
# ("install via aka.ms/apm-unix or your platform's package
# manager").
run: |
set -euo pipefail
curl -fsSL https://aka.ms/apm-unix | sh
echo "$HOME/.apm/bin" >> "$GITHUB_PATH"

- name: Refresh apm.lock.yaml
# No-op when apm.yml is absent — some PJs may not ship one
# yet, and the workflow shouldn't fail because of that.
# The actual `apm install --update` then resolves every
# `dependencies.apm:` entry to upstream HEAD and rewrites
# the lock. Targets match the local Makefile.toml task
# (copilot/claude/gemini) so worktrees and CI agree on
# which agent skill dirs get populated.
run: |
set -euo pipefail
if [ ! -f apm.yml ]; then
echo "no apm.yml; nothing to refresh"
exit 0
fi
apm install --update -t copilot,claude,gemini

- name: Open / update PR if there are changes
id: cpr
uses: peter-evans/create-pull-request@v8.1.1
with:
token: ${{ secrets.KATA_APPLY_TOKEN }}
branch: apm-bump/auto
delete-branch: true
title: "chore(apm): refresh apm.lock.yaml"
commit-message: "chore(apm): refresh apm.lock.yaml"
body: |
Automated `apm install --update` (weekly schedule + manual dispatch).

Auto-merged when CI passes; left open if CI fails.

<!-- pj-base ships this workflow; see yukimemi/pj-base -->
author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
committer: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"

- name: Enable auto-merge
if: steps.cpr.outputs.pull-request-number != ''
env:
GH_TOKEN: ${{ secrets.KATA_APPLY_TOKEN }}
run: |
gh pr merge --auto --squash ${{ steps.cpr.outputs.pull-request-number }}
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ jobs:
# blocking renovate auto-merge for downstream consumers).
# Main keeps saving so every PR rebuild gets a warm cache.
save-if: ${{ github.ref == 'refs/heads/main' }}
# The GH Actions cache backend transient-flakes the restore
# step on windows-latest just often enough to gate release
# pipelines (verified on yukimemi/kanade@v0.6.2 — the cache
# restore died mid-tar, killed the Windows build matrix, and
# blocked the publish). Fall through to a cold cargo build
# when the restore errors out: ~3–5 min slower on a single
# job, but self-healing instead of release-blocking.
continue-on-error: true
- run: cargo check --all-targets

test:
Expand All @@ -48,6 +56,10 @@ jobs:
- uses: Swatinem/rust-cache@v2.9.1
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
# See the check job above for why continue-on-error is set
# on every rust-cache restore (transient GH Actions cache
# backend flake on windows-latest).
continue-on-error: true
# `cargo test --all-targets` covers lib / bins / tests / benches
# / examples but EXCLUDES doc tests, so run --doc separately.
# Doc-test step is gated on `src/lib.rs` presence: `cargo test
Expand Down Expand Up @@ -88,6 +100,10 @@ jobs:
- uses: Swatinem/rust-cache@v2.9.1
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
# See the check job above for why continue-on-error is set
# on every rust-cache restore (transient GH Actions cache
# backend flake on windows-latest).
continue-on-error: true
- run: cargo clippy --all-targets -- -D warnings

lockfile:
Expand All @@ -102,6 +118,10 @@ jobs:
- uses: Swatinem/rust-cache@v2.9.1
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
# See the check job above for why continue-on-error is set
# on every rust-cache restore (transient GH Actions cache
# backend flake on windows-latest).
continue-on-error: true
- run: cargo check --locked --all-targets

coverage:
Expand All @@ -121,6 +141,10 @@ jobs:
- uses: Swatinem/rust-cache@v2.9.1
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
# See the check job above for why continue-on-error is set
# on every rust-cache restore (transient GH Actions cache
# backend flake on windows-latest).
continue-on-error: true
- uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov
Expand Down
27 changes: 15 additions & 12 deletions .kata/applied.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
preset = "github.com/yukimemi/pj-presets:rust-cli"
applied_at = "2026-05-17T04:40:43.234375838Z"
applied_at = "2026-05-24T04:45:12.151282216Z"

[[templates]]
source = "github.com/yukimemi/pj-base"
rev = "f04151faf4f0678be9621bb724c8f3120a5e4d8b"
version = "0.10.0"
rev = "3e3c7ee971897ae6cc71e78d597c838412974f19"
version = "0.12.1"

[[templates]]
source = "github.com/yukimemi/pj-rust"
rev = "9f103ca5aaf39e1dcf1a4d84b11685821aabc62f"
version = "0.5.0"
rev = "f78e190bac618fc3870b3c4a6e4187eb01c3cc42"
version = "0.7.0"

[[templates]]
source = "github.com/yukimemi/pj-rust-cli"
rev = "9263751c3f94f3415147e546db33170157fb1503"
rev = "58fae0574cbf118e61312c7599c412bfd7d3d3ac"
version = "0.2.0"

[files.".agents/skills/renri/SKILL.md"]
Expand All @@ -29,13 +29,16 @@ once_applied = true
content_hash = "486c974de88903113ed99b4e643432b7050e88f1031276f5263e8da7b43fe11e"

[files.".gitattributes"]
content_hash = "1a4b579b1b643a41dbf97d8834ff1f3f1fe532ff863d0f861431cf3ca47d31e2"
content_hash = "6d380d1ecc2f882c2011429d548a6f3c774b74f0c757d884453e4667172acc2a"

[files.".github/workflows/apm-bump.yml"]
content_hash = "79b12afa028841f8bce3c0caffd60dfe491642dba685142e33ed22a8cfcb9f9d"

[files.".github/workflows/auto-tag.yml"]
content_hash = "0796dfb281c7447610035360622ddada137a8e2d89efa574aea89374676d768b"

[files.".github/workflows/ci.yml"]
content_hash = "741862d937397ea8fa0c02529cb4e7bc81266a8e628d317e590fa4687c2a3ec5"
content_hash = "594c14cf24dd2aa17d8c50d0db6d56321cb729ad4fc660888d7e6fbe36ca9211"

[files.".github/workflows/kata-apply.yml"]
content_hash = "bc0e3def04b634949297d60322999a27f53bffc71b6cb662ae58ac8087e78bed"
Expand All @@ -51,7 +54,7 @@ content_hash = "4bebd1c3417c33f9d1c51f011694f6d82b098bbb1a5a102ba56e97ab01a866ef
once_applied = true

[files."AGENTS.md"]
content_hash = "e4f146a1c66d11e6b6c707f52507b3e37da2fe52d8d7cf13f75edcf9ad5d3a7f"
content_hash = "2a38543fca1f22128c41fe51c40159e8ea7f3331ae221fb99cddfca0194ece32"

[files."CLAUDE.md"]
content_hash = "a76b3af252969b8120128d7ce44f2b6cfdcf88c7420ee00675732f542d047529"
Expand All @@ -63,7 +66,7 @@ content_hash = "3670f70a2f0be4013926bab6e878b90a42ad64c17899080aef4d193b246fa390
once_applied = true

[files."Makefile.toml"]
content_hash = "27e3f57b9efd6c177843d9b0d248f40af5843739bcde6ceaf985f2ce518ecfcf"
content_hash = "930554e54d2c4090b4e0ba6014dd0692a05884ff6af803897f9d1c1647818b94"

[files."OPENCODE.md"]
content_hash = "11993dc7feec5fca8e83934f135de33879b88f100c48aeba0729de2f57a11a48"
Expand All @@ -75,7 +78,7 @@ once_applied = true
once_applied = true

[files."clippy.toml"]
content_hash = "89dbb3b4fd63c479f61f077d2383ab5c0998ea838f271ed57fd09281975deda0"
content_hash = "c750cb285075d0cb0c5c9ea77cd67baf7b0c4af864603cbe6c0c6692e75ed6fb"

[files."opencode.json"]
content_hash = "2ada1cf4347db9e98fadd67ca72cd9e29042c5bf6ab719d666b5d71f97663e81"
Expand All @@ -90,4 +93,4 @@ content_hash = "f4751570494ba62997cfb47e3abee2e707d3e01d924d1e8b940905a4e7c974f3
content_hash = "9eac3c057320afbad00022718e0c14731122b4c3f28abd2dc702846244c39f66"

[files."rustfmt.toml"]
content_hash = "8a0bd07a7aaaf3e9fed5dd297b04a5f96c4a969d895375aa4e00247a95aa616c"
content_hash = "0d4916b2ce83f5270265e2fcc01b308e34e255d37fde92946382f8dbeb4427bb"
Loading
Loading