Documentation
¶
Overview ¶
Package packconformance implements the Pack contract v1 conformance test framework — docs/plans/signal-ingest-detailed-design.md §7.2 ("Pack が 満たすべきもの", the Pack-author-facing half of the contract) and §7.3 ("conformance test は boid リポジトリに置き、公式 Pack は CI で常時通す。 custom Pack の作者も同じテストを手元で回せる"), docs/plans/signal-driven- review.md §14 Q21/Q22.
Deliberately at the MODULE ROOT (github.com/novshi-tech/boid/ packconformance), not under internal/ — a package under internal/ is importable only from within github.com/novshi-tech/boid/... (Go's internal-package import rule), so a custom Pack author's own, completely separate Go module could never `import` it, no matter how it phrased its own test file. That directly contradicts §7.3's "custom Pack の作者も同じテストを手元で回せる" — confirmed by trying exactly that import from an external module and getting "use of internal package ... not allowed". testutil/ (this repo's existing test-helper package) sits at the module root for the identical reason. See scripts/check-internal-architecture.sh's own package-allowlist check, which only enumerates internal/'s immediate children — moving this package out of internal/ does not touch it.
ConformancePack is the single entry point: given the directory of ONE Pack version (a directory that itself contains integration.yaml — integrationpack.Pack.Dir's shape, NOT the multi-pack installation root integrationpack.LoadPacks walks; see ConformancePack's own doc comment for why this package deliberately does not call LoadPacks), it runs every machine-checkable §7.2 requirement as an independent t.Run subtest:
- manifest: integration.yaml parses via the existing integrationpack.ParseManifest (PR-4) — no parsing logic of this package's own
- skill (Q21): no skills/**/SKILL.md or skills/**/references/*.md file mentions a boid CLI command or names a builtin skill
- connector: 終了 — every declared connectors[].executable exists and is executable (hard requirement), and, best-effort and skippable, actually launches without crashing or hanging when given the contract's env (§5.2/§7.1) and a deliberately-unreachable BOID_API_BASE
- 拡張禁止 (Q16-18 相当) — a light grep guard: no .go source files, no literal reference to boid's own internal/ import path, anywhere in the Pack directory
A custom (non-official) Pack author runs the exact same checks locally, from their OWN Go module (a plain `go get github.com/novshi-tech/boid@latest` away — this package is at the module root specifically so that works), which is the whole point of putting this in a plain go test package rather than a shell script or a boid subcommand:
import "github.com/novshi-tech/boid/packconformance"
func TestConformance(t *testing.T) {
packconformance.ConformancePack(t, "/path/to/my-pack/1.0.0")
}
officialpacks_test.go is the other half of Q22 ("公式 Pack は CI で常時 通す"): an env-var-gated sweep (BOID_API_SKILLS_DIR) that discovers every Pack directory in a checked-out boid-api-skills tree and runs ConformancePack against each. .github/workflows/blackbox-e2e.yml's pack-conformance job sets that env var to a sibling actions/checkout of novshi-tech/boid-api-skills and invokes it.
Index ¶
Constants ¶
const DefaultLaunchTimeout = 10 * time.Second
DefaultLaunchTimeout bounds how long the connector-launch smoke check (checkConnectorLaunchable) waits for a connector process to exit before killing it and failing that connector's subtest. Generous relative to what it's actually exercising — a connector reacting to an immediately- refused BOID_API_BASE connection (§5.3) — because a Pack author's local `go test` run may take longer to start an interpreter than CI does.
Variables ¶
This section is empty.
Functions ¶
func ConformancePack ¶
ConformancePack runs every machine-checkable requirement from docs/plans/ signal-ingest-detailed-design.md §7.2 ("Pack が満たすべきもの") against the Pack VERSION directory at dir — a directory that itself contains integration.yaml, i.e. one <pack-name>/<version>/ directory such as integrationpack.Pack.Dir, NOT the multi-pack installation root integrationpack.LoadPacks walks (<integrations.dir>/<pack>/<version>/).
This deliberately does NOT call LoadPacks: LoadPacks treats every entry of its root directory as a Pack directory, which breaks on a Pack REPO checkout root specifically because of that checkout's own .git/ directory — LoadPacks goes looking for "<root>/.git/<version>/integration.yaml", finds nothing, and returns a hard error (docs/plans/signal-ingest-detailed-design.md §12.1, "B1" — reproduced, not yet fixed as of this package; fixing it is out of this package's scope). ConformancePack sidesteps that failure mode entirely by taking a single, already-known-good Pack directory rather than a root to enumerate. officialpacks_test.go's own discovery (walking for integration.yaml files, explicitly skipping dot-directories) is the layer that would otherwise need LoadPacks-style enumeration, and avoids the same bug the same way — see its own doc comment.
Every requirement runs as its own t.Run subtest so one failing check does not hide the rest (docs/plans/signal-ingest-detailed-design.md §7.3's "custom Pack の作者も同じテストを手元で回せる" is only useful if a Pack author fixing one thing at a time can see everything else that's still broken in the same run).
Types ¶
type Options ¶
type Options struct {
// LaunchTimeout overrides DefaultLaunchTimeout for the connector-launch
// smoke check. Zero (the default) means DefaultLaunchTimeout.
LaunchTimeout time.Duration
// SkipLaunch disables the connector-launch smoke check entirely. The
// existence/executable-bit check (§7.2's "connector: 終了" row's
// structural half) always runs regardless of this flag — only the
// "actually run it and confirm it doesn't immediately crash or hang"
// best-effort half is optional.
//
// Use this when the environment running the conformance test cannot
// provide a connector's own runtime dependency (e.g. no python3 on a
// Pack author's machine, or a stripped-down CI image): docs/plans/
// signal-ingest-detailed-design.md §5.3 places that burden on "その
// project の実行 image", which is not necessarily the same image
// `go test` runs in.
SkipLaunch bool
}
Options configures ConformancePackOpts. The zero Options is what ConformancePack uses.