Documentation
¶
Overview ¶
Package adaptertest is the PRD §23 shared parity layer both host adapters' plugin tests consume: fixtures (the committed §10 role profiles) and assertion helpers (skill/manifest drift pins) so cross-host invariants — the run-verb allowlist, the four anti-forgery statement literals, the plan/merge gate option text, the setup interview's terminal forms, hook command portability, and matcher/guard parity — have exactly one source instead of a copy per adapter that can silently drift apart.
This package carries no Test functions and tests nothing of its own; it is test-support only, imported by adapters/claude/plugin_test.go and adapters/codex/plugin_test.go. Every exported Check* helper takes a *testing.T and calls t.Helper(), and reads files relative to the caller's own working directory — the same assumption each adapter's plugin_test.go already makes, since `go test` runs a package's tests with that package's directory as the process cwd.
It may import internal/run (the four statement constants) and internal/guard (a caller may pass guard.ClaudeTools()/CodexTools() into CheckMatcherEqualsGuardTools) and nothing else in this module — it is a leaf test-support package, not a place for adapter-specific or engine policy code.
Index ¶
- func CheckHookCommandPortability(t *testing.T, commands []string)
- func CheckMatcherEqualsGuardTools(t *testing.T, matcher string, want []string)
- func CheckMergeGateOptions(t *testing.T, deliverySkillPath string)
- func CheckPlanGateOptions(t *testing.T, deliverySkillPath string)
- func CheckRunVerbTokens(t *testing.T, skillGlob string)
- func CheckSetupTerminalForms(t *testing.T, setupSkillPath string)
- func CheckStatementLiterals(t *testing.T, skillGlob string)
- func Profile(host string) map[string]RoleSpec
- type RoleSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckHookCommandPortability ¶
CheckHookCommandPortability asserts none of commands contains a shell metacharacter.
func CheckMatcherEqualsGuardTools ¶
CheckMatcherEqualsGuardTools asserts matcher (a "|"-joined hook matcher string) names exactly the tools in want, in both directions: the matcher must name every guard-handled tool, and name nothing else, since guard denies any other tool_name by default (broadening the matcher without extending guard would hard-deny at the hook, never reaching guard's own decision).
func CheckMergeGateOptions ¶
CheckMergeGateOptions pins deliverySkillPath's documented merge-gate question options against the exact two-option set.
func CheckPlanGateOptions ¶
CheckPlanGateOptions pins deliverySkillPath's documented plan-gate question options against the exact PRD §8 four-option set.
func CheckRunVerbTokens ¶
CheckRunVerbTokens drift-pins every `orch run <verb>` token mentioned in a skill (found by skillGlob, e.g. "skills/*/SKILL.md") against the real verb set: a renamed or removed verb that a skill still mentions fails the test instead of silently documenting a dead command.
func CheckSetupTerminalForms ¶
CheckSetupTerminalForms pins setupSkillPath's documented terminal forms against the exact three commands each interview ends with.
func CheckStatementLiterals ¶
CheckStatementLiterals asserts every `"statement": "..."` literal quoted in a skill (found by skillGlob) equals one of the internal/run approval/statement constants, and that every constant appears at least once across the matched skills — so a skill can never silently drop or misquote one of the anti-forgery statements the engine requires verbatim.
func Profile ¶
Profile returns the committed §10 profile for host ("claude" or "codex"), keyed by role: "scout", "implementer", "specialist", "reviewer", "reviewer-safe". Every adapter's agent roster is asserted equal to this map so the two hosts' plugin tests and the committed §10 table can never silently diverge from one another.
An unrecognized host is a programming error in the caller (a typo, or a new host added to the module without updating this fixture) — Profile panics rather than returning a zero value a test might silently pass against.