Commit Graph

27 Commits

Author SHA1 Message Date
mikkeli 2103a423fe build: pin job container image to Gitea registry (v0)
Workflows now pull pi5-16.local:3005/mikkeli/novoyuuparosk-wiki-runner:v0
instead of relying on the host dockerd image cache. Registry is the
authority; act_runner pull_image flipped to true accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 10:27:41 +09:00
mikkeli f7d84b4f0f fix(tech): preserve h1 elements — do not strip first heading
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 00:02:02 +09:00
mikkeli 1bfad8332c feat(tech): add tech blog pipeline
Publishes mikkeli/tech-blogs to the wiki at bare titles (no prefix).
Every page gets Category:Tech blog; Category:Blog:<year> from the date
field; Category:<tag> per tag entry (no prefix).

Fields: title (required), wiki.publish (required), date (optional,
YYYY-MM-DD), tags (optional list).

Source repo tech-blogs not yet initialised — pipeline ships first.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 00:00:18 +09:00
mikkeli 230a3badc3 fix(ses): preserve h1 elements — do not strip first heading
Songs always carries a # Song title line so stripping makes sense there,
but SES body structure is freeform and may use h1 deliberately.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 00:00:08 +09:00
mikkeli dfe1f9c631 feat(ses): add SES light novel pipeline; extract shared lib/wiki.py
New pipeline at pipelines/ses/ publishes mikkeli/ses-light-novel to
the SES: MediaWiki namespace. All pages get Category:SES and
Category:SES:<type> (type from frontmatter, fallback to parent dir name).

Shared functions (connect_wiki, markdown_to_wikitext, strip_first_h1,
AUTO_BANNER_PREFIX) extracted from songs/publish.py into lib/wiki.py;
songs refactored to import from there.

Also adds publish-ses.yml workflow stub and updates Dockerfile and
root README.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 16:23:26 +09:00
mikkeli 6144d1f399 feat(songs): inject Category:Songs for pages with an album
Pages with a valid `album` field now get [[Category:Songs]] prepended
before [[Category:Album:<name>]]. Companion/sibling pages without an
album are unaffected. Updated SCHEMA.md and pipeline README accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 10:17:22 +09:00
mikkeli db159fd63d Merge pull request 'automation/songs' (#4) from automation/songs into master
Reviewed-on: mikkeli/novoyuuparosk-auto-wiki#4
2026-06-10 00:54:28 +00:00
mikkeli d08f95fc96 Merge branch 'master' into automation/songs 2026-06-10 00:54:22 +00:00
mikkeli f135906392 chore: update workflow stub to use prebuilt runner image
Switch from python:3.12-slim + apt/pip installs to
novoyuuparosk-wiki-runner:latest. Removes the two install steps.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 09:40:01 +09:00
mikkeli 38e76ff56d docs: remove plaintext bot secret, update runner image references
Credentials moved to Gitea user-scope vault — removed from README.
Architecture diagram and songs pipeline deps section updated to reflect
prebuilt novoyuuparosk-wiki-runner:latest image (no runtime dep installs).
Noted workflow stubs in .gitea/workflows/ may be stale.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 09:38:27 +09:00
mikkeli f2fe4da667 fix(songs): sibling substitution uses bare tag match, not [[TAG]] wrapper
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 00:46:57 +09:00
mikkeli 87874fa935 feat(songs): optional album, categories list, sibling placeholder resolution
- `album` no longer required; category format changed to Category:Album:<name>
- New optional `categories` list for additional arbitrary categories
- `wiki.siblings` bill of materials: path+tag required for resolution, label optional
- Post-Pandoc [[TAG]] substitution with four-tier fallback (link+label, link, plain label, plain tag)
- Sibling map built from all published posts in the same run; unresolved siblings degrade gracefully
- SCHEMA.md fully updated; README.md deferred items moved to implemented

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 00:45:42 +09:00
mikkeli ef8ba3f01f feat: add shared runner Dockerfile and document rebuild process
All wiki pipelines share novoyuuparosk-wiki-runner:latest — a
locally-built image with git, pandoc, ca-certificates, and Python
packages pre-installed. Eliminates the apt-get and pip install
steps from every job run. Rebuild manually on the Pi when deps change.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 00:15:29 +09:00
mikkeli 580ef2109e feat(songs): LRC file upload and footer link
For songs with an `lrc` field in frontmatter:
- Verifies the file exists and is valid UTF-8 (warns and skips otherwise)
- Uploads to wiki as `File:<title>.lrc` via MediaWiki file API
- Idempotent: skips upload if SHA1 matches existing wiki file
- Appends `[[Media:<title>.lrc|Synced lyrics (.lrc)]]` before the
  category tag at the bottom of the wiki page

Songs without `lrc` in frontmatter are unaffected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 23:11:00 +09:00
mikkeli 33f47435ee refactor(songs): rename render.py to publish.py
render.py was a misleading name — the script validates, renders,
and writes to MediaWiki (and will soon upload LRC files too).
publish.py better describes the full scope of the entry point.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 22:38:52 +09:00
mikkeli afc6a62791 docs: update all docs to reflect v1 live state
- template_auto_generated.wikitext: generated_at → commit parameter
- SCHEMA.md: same banner fix; clarify that frontmatter-less files are
  silently skipped, not errors
- pipelines/songs/README.md: full rewrite — v1 live status, self-
  contained workflow pattern, correct env table, modes, one-off setup
  marked done, full decisions log
- README.md: architecture reflects actual pattern (no workflow_call),
  URL_TO_GITEA variable added, setup checklist marked complete, host
  network mode documented

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 18:39:36 +09:00
mikkeli cf6567cd77 Merge pull request 'fix(songs): skip pages with existing non-auto-generated content' (#2) from automation/songs into main
Reviewed-on: mikkeli/novoyuuparosk-auto-wiki#2
2026-06-09 09:31:02 +00:00
mikkeli 65aa617935 fix(songs): skip pages with existing non-auto-generated content
If a wiki page exists but was written manually (no Auto-generated
banner), the bot now skips it instead of attempting an overwrite
that triggers MediaWiki CAPTCHA. Clear stderr warning tells user
to delete the page or add the banner to hand ownership to the bot.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 18:23:14 +09:00
mikkeli 3895cb5c25 fix(songs): skip files without wiki.publish:true before validation
Files with no frontmatter or wiki.publish not set should be silently
ignored rather than failing the whole pipeline run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 18:13:55 +09:00
mikkeli d49b2f0bca Merge pull request 'automation/songs' (#1) from automation/songs into main
Just get it done
2026-06-09 09:03:35 +00:00
mikkeli df7195511f render: replace generated_at timestamp with commit SHA in banner
Timestamps made the idempotency check always false — every run would
rewrite every page. Commit SHA is stable: same source commit produces
identical wikitext, so unchanged pages are correctly skipped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 18:01:46 +09:00
mikkeli 58507edfd5 workflows: replace github.server_url with vars.URL_TO_GITEA
Gitea blocks vars/secrets prefixed with GITEA_ or GITHUB_.
Also avoids relying on github.server_url which resolves to
github.com rather than the local Gitea instance on this runner.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 17:48:32 +09:00
mikkeli 7f1bf2f995 Implement songs pipeline v1
- render.py: frontmatter validation, h1 strip, pandoc conversion,
  banner/category injection, idempotent MediaWiki writes via mwclient
- requirements.txt: python-frontmatter, mwclient, PyYAML
- template_auto_generated.wikitext: paste into wiki as Template:Auto-generated
- .gitea/workflows/publish-songs.yml: reusable workflow; job container
  python:3.12-slim installs pandoc via apt (no host-level pandoc needed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 16:40:05 +09:00
wan 6d51a3dd2b docs: split root README cross-cutting; expand songs pipeline README 2026-06-09 11:22:41 +09:00
wan 6f451f616a Added gitignore. Ignoring Claude local settings 2026-06-09 11:18:49 +09:00
wan f573460c41 songs: schema doc and v1 scope readme 2026-06-09 10:51:47 +09:00
mikkeli 375eb7af1f Initial commit 2026-06-09 00:03:55 +00:00