adaptertest

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHookCommandPortability

func CheckHookCommandPortability(t *testing.T, commands []string)

CheckHookCommandPortability asserts none of commands contains a shell metacharacter.

func CheckMatcherEqualsGuardTools

func CheckMatcherEqualsGuardTools(t *testing.T, matcher string, want []string)

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

func CheckMergeGateOptions(t *testing.T, deliverySkillPath string)

CheckMergeGateOptions pins deliverySkillPath's documented merge-gate question options against the exact two-option set.

func CheckPlanGateOptions

func CheckPlanGateOptions(t *testing.T, deliverySkillPath string)

CheckPlanGateOptions pins deliverySkillPath's documented plan-gate question options against the exact PRD §8 four-option set.

func CheckRunVerbTokens

func CheckRunVerbTokens(t *testing.T, skillGlob string)

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

func CheckSetupTerminalForms(t *testing.T, setupSkillPath string)

CheckSetupTerminalForms pins setupSkillPath's documented terminal forms against the exact three commands each interview ends with.

func CheckStatementLiterals

func CheckStatementLiterals(t *testing.T, skillGlob string)

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

func Profile(host string) map[string]RoleSpec

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.

Types

type RoleSpec

type RoleSpec struct {
	Model  string
	Effort string
}

RoleSpec is one role's committed host profile: the exact model and effort string an installed agent definition must carry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL