Conversation
Document the two things this repository exists for: following the ONIX spec while keeping backward compatibility, and growing the set of target languages through code generation. Covers the schema -> XSD parser -> intermediate representation -> mustache pipeline, the make/bazel commands, how to bump an EDItEUR schema release, a step-by-step procedure for adding a new target language, the fixture- driven test convention, and which paths are generated and must not be hand-edited. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
Owner
Author
CI について: この PR の変更が原因ではありません
原因は ドキュメント追加のみの PR に CI の変更を混ぜるのは避けたいので、修正はここでは入れず、パッチだけ提示します。 提案するパッチ両ジョブの - name: Restore caches
- uses: actions/cache@v2
+ uses: actions/cache@v4
with:あわせて、同ワークフロー内の以下も Node 12/16 ランタイム廃止の影響を受けるため、同じタイミングで上げておくのが安全です。
別 PR で対応するか、この PR に含めるか、ご希望に合わせます。 Generated by Claude Code |
Owner
Author
|
CI の修正は別 PR にしました: #56 ( Generated by Claude Code |
`make test` no longer depends on the schema download, so the command table said something that is about to stop being true. Also point at ADR-0003 where `make schema` is described, since that is the command that is currently broken. Add the rule that came out of getting this wrong once: a fixture must not include anything outside fixtures/. Xsd.getSchema follows xs:include recursively, so a single `../schema/` reference puts the whole suite back on editeur.org's availability, which is exactly what test_mixed_html.xsd did. Add a section on recording design decisions as ADRs, with the criteria for what warrants one, so the reference from docs/adr/README.md is reciprocated. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
Both jobs on this branch die before running anything, on the actions/cache@v2 deprecation that #56 fixes. #56 is green, so port it here rather than wait for it to merge. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
kogai
changed the base branch from
main
to
claude/bump-deprecated-github-actions
September 13, 2026 07:56
kogai
added a commit
that referenced
this pull request
Sep 13, 2026
…st` from the schema download (#56) * Bump deprecated GitHub Actions in the test workflow Both CI jobs currently fail two seconds after starting, before any build step runs: ##[error]This request has been automatically failed because it uses a deprecated version of `actions/cache: v2`. GitHub has closed down actions/cache v1 and v2 and now auto-fails runs that reference them at action-download time, so the workflow cannot get as far as `make test` or the bazel e2e target. Bump actions/cache to v4 to unblock that, and bump the remaining actions still on the Node 12 runtime at the same time: - actions/checkout v2 -> v4 - actions/setup-node v2.1.4 -> v4 - haskell/actions/setup v1 -> haskell-actions/setup v2 (repository moved) Tool versions are left as they are (GHC 8.8.3, stack 2.5.1, Node 12.x) so this change is limited to action versions. haskell-actions/setup v2 still exposes the stack-path output the cache step depends on. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z * Decouple `make test` from the schema download With the deprecated actions bumped, the Haskell job now reaches `make test` and fails there instead: `make test` depends on the `schema` target, which fetches the EDItEUR archives, and editeur.org now answers bazel's request with `202 Accepted` instead of the zip. The test suite does not need those archives. Everything under test/ reads fixtures/test_*.xsd; the only reader of ./schema is schemaRoot in src/Lib.hs, which is the code-generation path. The dependency was an over-specification that tied the whole feedback loop for the parser to the availability of an external service. Drop it from `test` and keep it on `build`, where generating code really does need the schema. This does not fix the 202 itself: generation and tracking new schema releases still need the download. Also introduce docs/adr/ to record decisions like this one, with a template, an index, and the two decisions made here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z * Make the mixed-HTML fixture self-contained The previous commit dropped the `schema` prerequisite from `make test` on the claim that nothing under test/ reads schema/. That claim was wrong, and review caught it: fixtures/test_mixed_html.xsd included ../schema/v2/ONIX_XHTML_Subset.xsd directly. Xsd.getSchema follows includes recursively and resolves that relative path with readFile, which throws when the file is absent, and schema/ is gitignored — so on a clean checkout the suite would have failed instead of running. Commit 9352123 confirms the dependency was deliberate: it added `test: schema` in the same change that deleted the vendored 2_1_rev03_schema/ tree and repointed this fixture at ../schema/v2/. Rather than restore the prerequisite, move what the fixture needs into the repository. test_mixed_html_xhtml_subset.xsd declares the 40 element names the fixture refers to, each as a mixed complex type. That is the property the assertions actually rest on: TestModel expects Model.collectElements to come back empty, and that filter keeps only elements with complexMixed = False, so the test means "XHTML elements do not leak into models". Deleting the include instead would have made the assertion vacuous. The stand-in is written here rather than copied from the EDItEUR distribution, so it raises no redistribution question. ADR-0002 is rewritten around what is actually true, including why the dependency was real and why a stand-in is enough. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z * Stop `make test` from invoking bazel, and drop a debug step BZL_BIN used `:=`, so `$(shell npx bazel info bazel-bin)` ran while make parsed the file — on every target, `make test` included. The Haskell job runs `make test` without ever installing node_modules, so that expansion just fails there. Measured in this environment: `make -n test` took 18.1s and printed a bazel download error before doing anything, and 0.011s with the assignment deferred to `=`. Nothing outside the schema recipes reads BZL_BIN, so deferring it costs nothing. Also drop the `ls -lah` step that printed the stack tool path; it was debugging output for the cache setup, not a check anything depends on. Both spotted in review of this PR. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z * Add AGENTS.md (#55) * Add AGENTS.md describing repository values and workflows Document the two things this repository exists for: following the ONIX spec while keeping backward compatibility, and growing the set of target languages through code generation. Covers the schema -> XSD parser -> intermediate representation -> mustache pipeline, the make/bazel commands, how to bump an EDItEUR schema release, a step-by-step procedure for adding a new target language, the fixture- driven test convention, and which paths are generated and must not be hand-edited. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z * Align AGENTS.md with the CI and ADR changes `make test` no longer depends on the schema download, so the command table said something that is about to stop being true. Also point at ADR-0003 where `make schema` is described, since that is the command that is currently broken. Add the rule that came out of getting this wrong once: a fixture must not include anything outside fixtures/. Xsd.getSchema follows xs:include recursively, so a single `../schema/` reference puts the whole suite back on editeur.org's availability, which is exactly what test_mixed_html.xsd did. Add a section on recording design decisions as ADRs, with the criteria for what warrants one, so the reference from docs/adr/README.md is reciprocated. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
kogai
pushed a commit
that referenced
this pull request
Sep 13, 2026
Both .gitignore additions are kept: node_modules/ from the npm work on main, /third_party/distdir/ from this branch's ADR. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
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.
概要
エージェント/コントリビュータ向けのガイドとして
AGENTS.mdを追加しました。このリポジトリの価値を最初に明示し、以降のすべての判断基準がそこに紐づくよう構成しています。
内容
schema/→src/Xsd/のパーサ →Model/Code/Mixedの中間表現 → mustache テンプレート →generated/。言語固有の知識をテンプレートに閉じ込め、src/を言語非依存に保つという設計方針を明記。make schema/make build/make test/make generated/go/v3/npx bazelisk test //e2e/go:snapshot_test。CI の 2 ジョブと対応づけ。Makefile のjsonターゲットが古い点も注記。unimplemented/unreachableで明示して黙って落とさない、generated/を手編集しない。EDItEUR スキーマの版を上げるときに触るファイル (WORKSPACE/org_editeur_*.bazel/BUILD.bazel/Lib.hsのschemaRoot) も手順化。Lib.hsのLanguage/ext/template/generateTo、Main.hsのrun、4 つの mustache、generated/ディレクトリ、Makefile ターゲット、e2e、README の Current Status 表まで。fixtures/test_*.xsdに最小の XSD を足してから HUnit で期待値を書く、という既存の慣習と命名規則。schema/、.stack-work/、bazel-*)。ドキュメントの追加のみで、コードや生成物への変更はありません。
🤖 Generated with Claude Code
https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
Generated by Claude Code