Conversation
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
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
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
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
flow, unordered-containers and mtl are declared in the library stanza but
nothing imports them.
$ grep -rh '^import' src app test | ... # no Flow, no Data.HashMap,
# no Control.Monad.{State,Reader,
# Writer,Except}
The two "Flow" hits in the tree are ONIX type names in test expectations,
not the package. The State, Reader and Except monad transformers the
parser uses come from Control.Monad.Trans.*, which is transformers, not
mtl; transformers stays declared.
They are removed ahead of the resolver bump rather than with it: three
fewer packages the snapshot has to satisfy, and three fewer candidates to
rule out if that bump does not compile.
onix.cabal is hpack output but it is committed, so it is updated to match
by hand — the same three build-depends entries. Regenerating it properly
needs stack, which cannot run here (haskell.org is blocked by egress
policy), so CI is what confirms this.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
総評
必須1.
|
| 検索語 | 結果 |
|---|---|
Flow |
2 件。ただし test/TestModel.hs:312 の typeName = Just "Flow" と test/TestMixed.hs:33 の xmlReferenceName = "Flow" で、いずれも ONIX の型名の文字列リテラル。import は 0 件 |
flow の演算子 |> <| .> <. !> <! |
0 件 |
HashMap / HashSet / unordered-containers |
いずれも 0 件 |
Control.Monad.{State,Except,Reader,Writer,RWS,Cont,Error} |
すべて 0 件 |
MonadState / MonadReader / MonadError / throwError / catchError / liftEither |
すべて 0 件(mtl 固有の型クラス・関数は使われていない) |
PackageImports |
0 件({-# LANGUAGE PackageImports #-} による別経路の import は無し) |
Control.Monad.Trans(前方一致) |
src/Xsd/Parser.hs:14 に完全一致の 1 件 ← 必須 #1 |
Data.HashMap を経由しない形での unordered-containers 依存(mustache の Value が内部で HashMap を使う、Data.Yaml/aeson の Object など)も確認しましたが、このリポジトリ側は Text.Mustache の object / (~>) / ToMustache しか触っておらず、HashMap 型がシグネチャに現れる箇所はありません。型クラスインスタンスの解決は直接依存でなくても効くので、この経路で build-depends が要求されることはありません。
transformers に実在するか 1 個ずつ確認
src/Xsd.hs と src/Xsd/Parser.hs で実際に使われている識別子を列挙し、transformers-0.5.6.2(タグ 0.5.6.2, commit 0fe761c)の exposed-modules と突き合わせました。
$ curl -s https://raw.githubusercontent.com/haskell/transformers/0fe761c9287111373ae64ab39b67fbcde212b3f7/transformers.cabal
# (条件分岐を畳んで整形した抜粋)
exposed-modules:
Control.Applicative.Backwards
Control.Applicative.Lift
Control.Monad.Signatures
Control.Monad.Trans.Accum
Control.Monad.Trans.Class
Control.Monad.Trans.Cont
Control.Monad.Trans.Except
Control.Monad.Trans.Error
Control.Monad.Trans.Identity
Control.Monad.Trans.List
Control.Monad.Trans.Maybe
Control.Monad.Trans.Reader
Control.Monad.Trans.RWS(.CPS/.Lazy/.Strict)
Control.Monad.Trans.Select
Control.Monad.Trans.State(.Lazy/.Strict)
Control.Monad.Trans.Writer(.CPS/.Lazy/.Strict)
Data.Functor.Constant
Data.Functor.Reverse
Data.Functor.Identity
(加えて impl(ghc<7.11) のときだけ Control.Monad.IO.Class ほか)
$ curl -s -o /dev/null -w "%{http_code}" .../0fe761c.../Control/Monad/Trans.hs
404
$ curl -s -o /dev/null -w "%{http_code}" .../0fe761c.../Control/Monad/Trans/Class.hs
200
$ curl -s https://raw.githubusercontent.com/haskell/mtl/v2.2.2/mtl.cabal
exposed-modules:
...
Control.Monad.Trans ← ここにある
...
$ curl -s https://raw.githubusercontent.com/haskell/mtl/v2.2.2/Control/Monad/Trans.hs
module Control.Monad.Trans (
module Control.Monad.Trans.Class,
module Control.Monad.IO.Class
) where
各 import と使用ヘルパの判定:
| 箇所 | import / 識別子 | 提供元 | 判定 |
|---|---|---|---|
src/Xsd.hs:13 |
Control.Monad.Trans.State |
transformers | OK |
src/Xsd.hs:64,67,72 |
evalStateT / gets / modify' |
transformers Control.Monad.Trans.State(.Lazy) |
OK |
src/Xsd.hs:12,71 |
Control.Monad.IO.Class / liftIO |
base(base-4.9 以降) | OK |
src/Xsd/Parser.hs:15,524,599 |
Control.Monad.Trans.Except / runExcept / throwE / Except |
transformers | OK |
src/Xsd/Parser.hs:16,33,525,564,625… |
Control.Monad.Trans.Reader / runReaderT / ReaderT / asks / local |
transformers | OK |
src/Xsd/Parser.hs:13 |
Control.Monad(unless / when など) |
base | OK |
src/Xsd/Parser.hs:14,598 |
Control.Monad.Trans / lift |
mtl | NG(必須 #1) |
src/Lib.hs:48,58 の reader は file Reader = "reader" と "reader.mustache" という文字列リテラルで、mtl の reader とは無関係です。src/Xsd/Types.hs:49 の get、test/TestModel.hs:42 の put も State モナドとは無関係で、前者はコメント文中の "get rid of"、後者はテストデータの文字列リテラル内の語です。
hpack ハッシュ
onix.cabal:7 の -- hash: が「1〜2 行目 + 9 行目以降(= ヘッダコメント 6 行を除いた本文)」の SHA-256 であることを、base ブランチの .cabal で再現して確認しました。
$ alg(){ { sed -n '1,2p' "$1"; tail -n +9 "$1"; } | sha256sum | cut -d' ' -f1; }
$ git show origin/claude/bump-deprecated-github-actions:onix.cabal > base.cabal
$ git show origin/claude/drop-unused-haskell-deps:onix.cabal > new.cabal
base recorded : d894bbda696a3e4398796a16a928bd9923bbeaae2b4a61ad371f193c8322fa0d
base computed : d894bbda696a3e4398796a16a928bd9923bbeaae2b4a61ad371f193c8322fa0d ← 一致(アルゴリズム確認)
new recorded : d894bbda696a3e4398796a16a928bd9923bbeaae2b4a61ad371f193c8322fa0d
new computed : ccd13791926f8c74575d5f17648a17adbbe0740ce44707823a93b20ae5f7605c ← 不一致(推奨 #2)
その他
stack.yamlの extra-deps はHUnit-1.6.1.0とtypeable/xsd-parserの 2 つだけで、今回の 3 パッケージは lts-16.27 のスナップショット由来。extra-deps 側に取り残しは発生しません。- Bazel(
BUILD.bazel/WORKSPACE)は EDItEUR のスキーマ取得と Go の e2e だけを扱っており、Haskell の依存宣言は持っていません。追随が必要なファイルは他にありません。 .github/workflows/test.ymlのキャッシュキーはhashFiles('**/package.yaml')とhashFiles('**/onix.cabal')を含むので、この変更でキャッシュは自然に切り替わります。
検証できなかったこと
- 実ビルド。この環境には GHC も stack も無く、
haskell.org(= Hackage 含む)が egress ポリシーでブロックされているため取得もできません。必須 Configure Renovate #1 は Hackage ではなく GitHub 上のhaskell/transformersとhaskell/mtlのリリースタグを直接参照して判断しています。 - hpack / stack の実挙動。「ハッシュ不一致 → 手動変更扱いで上書きしない/
package.yamlを無視して.cabalを採用」は hpack・stack の既知の挙動に基づく説明で、この環境で実行して再現したものではありません。ハッシュが不一致であること自体は上記のとおり実測です。 import Control.Monad.Trans以外に mtl 由来のものが無いかの網羅性は、上表の grep の範囲での確認です。CPP による条件付き import はgrep -rn '^#' --include=*.hsが 0 件、{-# LANGUAGE ... #-}もOverloadedStrings/LambdaCase/DeriveGeneric/FlexibleInstances/NamedFieldPuns/DuplicateRecordFieldsのみで、PackageImportsやCPPは使われていないことまでは確認しました。
Generated by Claude Code
Review caught that mtl was not in fact unused. src/Xsd/Parser.hs:14 was
`import Control.Monad.Trans` — the bare module, which transformers does
not expose. It comes from mtl, which re-exports
Control.Monad.Trans.Class and Control.Monad.IO.Class through it. The
check behind the previous commit only looked for
Control.Monad.{State,Reader,Writer,Except}, so this line went unnoticed,
and with -hide-all-packages the build would have failed on a missing
module rather than anything subtle.
Import Control.Monad.Trans.Class (lift) instead. lift is the only thing
Parser.hs used from it (one use, line 598); liftIO in Xsd.hs comes from
base's Control.Monad.IO.Class, which that module already imports
directly. With this, mtl really is unused.
Also refresh onix.cabal's hpack hash, which the previous commit left
pointing at the pre-edit content. A stale hash makes hpack treat the file
as hand-modified and stop regenerating it, so later package.yaml changes
would silently fail to propagate. The algorithm was confirmed by
reproducing origin/main's recorded hash from its own file before
computing this one.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
|
レビューありがとうございます。必須の指摘は完全に正しく、こちらの検証が不十分でした。 修正しました (4653a9d)。 必須:
|
flow/unordered-containers/mtlの 3 つはpackage.yamlの library スタンザに宣言されていますが、どこからも import されていません。base は #56 (CI が動く状態が前提のため)。
根拠
src/app/test/の全 import を列挙して突き合わせました。flowFlowunordered-containersData.HashMap.*mtlControl.Monad.{State,Reader,Writer,Except}ツリー内の "Flow" 2 件は
test/TestModel.hs:312とtest/TestMixed.hs:33にある ONIX の型名で、パッケージとは無関係です。mtlについて補足すると、パーサが使っているのはControl.Monad.Trans.State/Control.Monad.Trans.Except/Control.Monad.Trans.Readerで、これらはtransformersが提供するモジュールです(mtlのControl.Monad.Stateではありません)。transformersは宣言に残しています。なぜ resolver 更新より先に出すか
resolver を上げるとスナップショットがこの 3 つも解決対象に含みます。先に落としておけば、満たすべきパッケージが 3 つ減り、もしビルドが通らなかったときの容疑者も 3 つ減ります。
onix.cabalについてhpack の生成物ですがコミットされているので、同じ 3 行を手で削って整合させました。本来は
stackに再生成させるべきですが、この環境では実行できません(haskell.orgが egress ポリシーでブロック)。確認
🤖 Generated with Claude Code
https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
Generated by Claude Code